Skip to content

Commit

Permalink
Merge pull request #31 from JNDisrupter/development
Browse files Browse the repository at this point in the history
Development
  • Loading branch information
jayelzaghmoutt authored May 4, 2021
2 parents c8e1579 + 2837b37 commit 6d4221e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 41 deletions.
2 changes: 1 addition & 1 deletion JNPhoneNumberView.podspec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

Pod::Spec.new do |s|
s.name = "JNPhoneNumberView"
s.version = "1.0.15"
s.version = "1.0.16"
s.summary = "Phone Number Validation with country dial code picker"
s.description = "A view to show the country dial code and the phone number, you can click on the dial code and select another country from the countries picker, this view has a delegate methods to pass the international number and validity of it."
s.homepage = "https://github.com/JNDisrupter"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,46 +69,7 @@ import libPhoneNumber_iOS
return phoneNumber
} catch {

// National number
var nationalNumber: NSString? = nil

// Dial code
let dialCode = phoneNumberUtil.extractCountryCode(modifiedPhoneNumber, nationalNumber: &nationalNumber)

// Check if dial code or national phone number not detected
if (dialCode?.description ?? "").isEmpty || nationalNumber == nil {
return nil
}

// Create phone number object
let nbPhoneNumber = NBPhoneNumber()

// Set dial code
nbPhoneNumber.countryCode = dialCode

// Check if national number not empty
if nationalNumber!.length > 0 {

// Convert NSString To String
let stringNationalNumber: String = nationalNumber! as String

// National Phone Number
var nationalPhoneNumber: NSNumber

if let integerValue = Int64(stringNationalNumber) {
// Convert national number from string to NSNumber
nationalPhoneNumber = NSNumber(value: integerValue)
}else{
// Convert national number from NSString to NSNumber
nationalPhoneNumber = NSNumber(value: nationalNumber!.floatValue)
}


// set national number
nbPhoneNumber.nationalNumber = nationalPhoneNumber
}

return nbPhoneNumber
return nil
}
}
}

0 comments on commit 6d4221e

Please sign in to comment.