ios10

How to make phone call in iOS 10 using Swift? [duplicate]

孤街醉人 提交于 2019-11-28 15:24:08
问题 This question already has an answer here: Calling a phone number in swift 20 answers I want my app to be able to call a certain number when a button is clicked. I've tried to google it but there doesn't seem to have one for iOS 10 so far (where openURL is gone). Can someone put an example for me on how to do so? For instance like: @IBAction func callPoliceButton(_ sender: UIButton) { // Call the local Police department } 回答1: You can call like this: if let url = URL(string: "tel://\(number)")

Remove duplicate structs in array based on struct property in Swift

妖精的绣舞 提交于 2019-11-28 12:54:18
I have made a simple struct and implemented the Equatable protocol : extension MyModelStruct: Equatable {} func ==(lhs: NModelMatch, rhs: NModelMatch) -> Bool { let areEqual = lhs.id == rhs.id return areEqual } public struct MyModelStruct { var id : String? var staticId : String? init(fromDictionary dictionary: NSDictionary){ id = dictionary["id"] as? String ... } Then in my project i get an array of [MyModelStruct], what i what to do is to remove all the MyModelStruct that have the same id let val1 = MyModelStruct(id:9, subId:1) let val2 = MyModelStruct(id:10, subId:1) let val3 =

MFMailComposeViewController without Mail app installed?

余生长醉 提交于 2019-11-28 12:44:41
Now that apps like Apple's "Mail" app can be deleted in iOS 10, what will happen when a developer attempts to initialize and present MFMailComposeViewController and the default Mail app is not installed and configured on the device? If the app crashes, what is the best way to check for this case? On iOS 12 and above, canSendMail() will return true even if the Mail app is not installed. The MFMailComposeViewController will be presented, but the user will be unable to send mail. On iOS versions below 12: It looks like MFMailComposeViewController.canSendMail() will return false, and

How to implement rich notifications in ios 10 with Firebase

佐手、 提交于 2019-11-28 12:41:44
I have been looking for a solution for this since quite a while. But I am not able to find anything. I have implemented Push Notifications for iOS using FCM. But I don't know if FCM supports iOS 10 rich notifications. If it does, I didn't find code to implement it. Thanks in advance. EI Captain v2.0 I have the same question why rich notification not working.. and the problem is with FCM mutable-content payload .. it turns in to gcm.notification.mutable-content when payload receives and that's why there is a problem which is not resolved yet. For more information, you can check this issue from

UserNotification in 3 days then repeat every day/hour - iOS 10

与世无争的帅哥 提交于 2019-11-28 12:11:45
UILocalNotification has been depreciated so I would like to update my code to the UserNotification framework: let alertDays = 3.0 let alertSeconds = alertDays * 24.0 * 60.0 * 60.0 let localNotification:UILocalNotification = UILocalNotification() localNotification.alertAction = "Reminder" localNotification.alertTitle = "Reminder Title" localNotification.alertBody = "Reminder Message" localNotification.fireDate = Foundation.Date(timeIntervalSinceNow: alertSeconds) localNotification.repeatInterval = .day UIApplication.shared().scheduleLocalNotification(localNotification) How can I set a similar

iOS local notification not firing second time but shows in getpendingnotificationrequests

有些话、适合烂在心里 提交于 2019-11-28 12:08:26
问题 I have implemented iOS 10 local notification where it works for the first alarm but not for other. I have import iOS 10 library , implemented delegate , receiving it first time in the delegate but it just not firing later. My date formate looks like : 2017-05-28 14:04:07 +0000 NSCalendar *calendar = [[NSCalendar alloc] initWithCalendarIdentifier:NSGregorianCalendar]; [calendar setTimeZone:[NSTimeZone localTimeZone]]; //(NSCalendarUnitYear | NSCalendarUnitMonth | NSCalendarUnitDay |

Why push notification is shown when app is foreground? (iOS10 / iPhone 7)

ⅰ亾dé卋堺 提交于 2019-11-28 11:51:04
问题 I'm having weird experience. Why push notification is shown (in native banner) when app is foreground? It's only reproduced on iPhone 7 (iOS10.1.1). I tested on the other iPhones like a iPhone 5 and iPhone 6s with same app, same iOS version. It's not shown when app is in foreground as normal. Push banner appears only on iPhone 7. Is this normal? My app is created by Xamarin.forms. (For now, Xamarin convert c# code to objective C, so it's basically objective c) Thanks. 回答1: If an application

iOS 10.3 beta 3 doesn't persist data of KeychainItem

痞子三分冷 提交于 2019-11-28 11:26:00
I have observed behavior of app in iOS 10.2.1 device and iOS 10.3 beta 3 device for https://developer.apple.com/library/content/samplecode/GenericKeychain/Introduction/Intro.html Keychain data is being deleted in iOS 10.3 beta 3. That was still found in earlier versions. Do we have any alternative to do this? Now that 10.3 has been officially released, it's been confirmed by several parties, including in this Apple's developers forum post , that this issue is not present in the final release. Keychain data is not being deleted upon app's uninstall. Originally (Since iOS 10.3 beta 1 to 5?) the

AVAssetExportSession in ios 10 not working for iPhone 7

巧了我就是萌 提交于 2019-11-28 10:23:13
问题 When I am blending two videos with AVAssetExportSession in ios 9 its working perfectly. but when i blend with AVAssetExportSession in iOS 10, it in not working. Please help me if any know the reason, Thank you. actualy code is working for iphone 6s and earlier, but not for working for iPhone 7 for example -(void) blendVideoOverVideo:(NSURL*)mainVideoUrl andBlendVideoUrl:(NSURL*)liveEffectUrl { AVURLAsset *mainVideoUrlAsset =[AVURLAsset URLAssetWithURL:mainVideoUrl options:nil]; //

Allow Full Access check in keyboards iOS10

你。 提交于 2019-11-28 09:28:20
Recently iOS has an update of iOS 10 & there are certain changes for developers one of the change is now we can't check allow full access the way we did previously is given below -(BOOL)isOpenAccessGranted{ return [UIPasteboard generalPasteboard]; } I searched the latest Developer Guide for UIPasteboard , but was unable to solve it. Did any one has a proper solution for this. iOS11 and above is easy. iOS10 Solution: Check all the copy-able types, if one of them is available, you have full access otherwise not. -- Swift 4.2-- override var hasFullAccess: Bool { if #available(iOS 11.0, *){ return