Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update README to use singleton #345

Merged
merged 1 commit into from
Apr 21, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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