Skip to content

Commit

Permalink
Update README to use singleton
Browse files Browse the repository at this point in the history
  • Loading branch information
pauluhn committed Apr 21, 2021
1 parent 78c8e2d commit a3d6e16
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ https://github.com/google/libphonenumber/issues

Metadata in this library was generated from that. so, you should change it first. :)

## Install
## Install

#### Using [CocoaPods](http://cocoapods.org/?q=libPhoneNumber-iOS)
```
Expand Down Expand Up @@ -65,7 +65,7 @@ See sample test code from
## Usage - **NBPhoneNumberUtil**
```obj-c
NBPhoneNumberUtil *phoneUtil = [[NBPhoneNumberUtil alloc] init];
NBPhoneNumberUtil *phoneUtil = [NBPhoneNumberUtil sharedInstance];
NSError *anError = nil;
NBPhoneNumber *myNumber = [phoneUtil parse:@"6766077303"
defaultRegion:@"AT" error:&anError];
Expand Down Expand Up @@ -139,7 +139,9 @@ import libPhoneNumber_iOS
override func viewDidLoad() {
super.viewDidLoad()

let phoneUtil = NBPhoneNumberUtil()
guard let phoneUtil = NBPhoneNumberUtil.sharedInstance() else {
return
}

do {
let phoneNumber: NBPhoneNumber = try phoneUtil.parse("01065431234", defaultRegion: "KR")
Expand Down

0 comments on commit a3d6e16

Please sign in to comment.