Skip to content

Commit

Permalink
Merge pull request iziz#345 from mojio/update_readme
Browse files Browse the repository at this point in the history
Update README to use singleton
  • Loading branch information
paween authored Apr 21, 2021
2 parents 78c8e2d + a3d6e16 commit 5e34f52
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 5e34f52

Please sign in to comment.