Skip to content

Commit

Permalink
Merge pull request #40 from JNDisrupter/development
Browse files Browse the repository at this point in the history
Upgrade minimum IOS Version
  • Loading branch information
jayelzaghmoutt authored Aug 27, 2024
2 parents ea4d180 + 06a99a2 commit f8f7b46
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 19 deletions.
8 changes: 4 additions & 4 deletions Example/JNPhoneNumberView.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 9.3;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
Expand Down Expand Up @@ -471,7 +471,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 9.3;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
Expand All @@ -487,7 +487,7 @@
CURRENT_PROJECT_VERSION = "⁨⁨⁨⁨";
DEVELOPMENT_TEAM = 243T5L9MQG;
INFOPLIST_FILE = JNPhoneNumberView/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
MODULE_NAME = ExampleApp;
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.$(PRODUCT_NAME:rfc1034identifier)";
Expand All @@ -504,7 +504,7 @@
CURRENT_PROJECT_VERSION = "⁨⁨⁨⁨";
DEVELOPMENT_TEAM = 243T5L9MQG;
INFOPLIST_FILE = JNPhoneNumberView/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
MODULE_NAME = ExampleApp;
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.$(PRODUCT_NAME:rfc1034identifier)";
Expand Down
5 changes: 4 additions & 1 deletion Example/Podfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
source 'https://github.com/CocoaPods/Specs.git'

use_frameworks!
platform :ios, '9.0'
platform :ios, '12.0'

target 'JNPhoneNumberView_Example' do
pod 'JNPhoneNumberView', :path => '../'

pod 'libPhoneNumber-iOS'
end

4 changes: 2 additions & 2 deletions JNPhoneNumberView.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ Pod::Spec.new do |s|
s.license = { :type => "MIT", :file => "LICENSE" }
s.author = { "Jayel Zaghmoutt" => "eng.jayel.z@gmail.com", "hamzakhanfar" => "ha.khanfer@gmail.com" }
s.source = { :git => "https://github.com/JNDisrupter/JNPhoneNumberView.git", :tag => "#{s.version}" }
s.ios.deployment_target = "9.0"
s.swift_version = "5.0"
s.ios.deployment_target = "12.0"
s.swift_version = "5.10"
s.source_files = "JNPhoneNumberView/**/*.swift"
s.resources = "JNPhoneNumberView/**/*.{png,pdf,jpeg,jpg,storyboard,xib,xcassets,ttf,json}"
s.dependency "libPhoneNumber-iOS"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ import libPhoneNumber_iOS
let metaDataHelper = NBMetadataHelper()

// get meta data for specific region code
if let metaData = metaDataHelper.getMetadataForRegion(regionCode) {
if let metaData = metaDataHelper?.getMetadataForRegion(regionCode) {

// Init and fill country code
let country = Country()
Expand Down Expand Up @@ -70,19 +70,19 @@ import libPhoneNumber_iOS
guard let dialCodeNumber = Int(modifiedDialCode) else { return nil }

// Phone number util
let phoneNumberUtil = NBPhoneNumberUtil()
let phoneNumberUtil = NBPhoneNumberUtil.sharedInstance()

// Country code
var generatedRegionCode: String?

// Get region code
if let regionCode = phoneNumberUtil.getRegionCode(for: phoneNumber) {
if let regionCode = phoneNumberUtil?.getRegionCode(for: phoneNumber) {

generatedRegionCode = regionCode
}

// Country code
else if let countryCode = phoneNumberUtil.getRegionCode(forCountryCode: NSNumber(value: dialCodeNumber)) {
else if let countryCode = phoneNumberUtil?.getRegionCode(forCountryCode: NSNumber(value: dialCodeNumber)) {

generatedRegionCode = countryCode
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,8 @@ import libPhoneNumber_iOS
*/
@objc public class func isPhoneNumberValid(phoneNumber: String, defaultRegion: String) -> Bool {

// Init phone number util
let phoneNumberUtil = NBPhoneNumberUtil()

// Parse phone number
if let parsedPhoneNumber = JNPhoneNumberUtil.parsePhoneNumber(phoneNumber, defaultRegion: defaultRegion) {
if let phoneNumberUtil = NBPhoneNumberUtil.sharedInstance(), let parsedPhoneNumber = JNPhoneNumberUtil.parsePhoneNumber(phoneNumber, defaultRegion: defaultRegion) {

// Check if region code is empty
if defaultRegion.isEmpty {
Expand Down Expand Up @@ -58,7 +55,7 @@ import libPhoneNumber_iOS
}

// Init phone number util
let phoneNumberUtil = NBPhoneNumberUtil()
guard let phoneNumberUtil = NBPhoneNumberUtil.sharedInstance() else { return nil}

// Parse phone number
do {
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@

## Requirements

- iOS 9.0+ / macOS 10.10+
- Xcode 9.0+
- Swift 4+
- iOS 12.0+ / macOS 14.4+
- Xcode 15.3+
- Swift 5+


## Installation
Expand Down

0 comments on commit f8f7b46

Please sign in to comment.