Skip to content

Commit

Permalink
add if#available check
Browse files Browse the repository at this point in the history
  • Loading branch information
richtwin567 committed Aug 28, 2020
1 parent e4ac64e commit 81266a2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ios/Runner/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,14 @@ public class NativeContact: NSObject {

var phoneNumbers : [CNLabeledValue<CNPhoneNumber>] = []

if #available(iOS 9.0, *){
for phone in phones {
var cnphone : CNLabeledValue<CNPhoneNumber> = CNLabeledValue(
label: phone.label,
value: CNPhoneNumber(stringValue: phone.number)
)
phoneNumbers.append(cnphone)
}
}}

contact.phoneNumbers = phoneNumbers

Expand Down

0 comments on commit 81266a2

Please sign in to comment.