ios10

How do I set an NSCalendarUnitMinute repeatInterval on iOS 10 UserNotifications?

随声附和 提交于 2020-01-09 05:18:07
问题 In UILocalNotification we use NSCalendarUnitMinute like repetition ..... but I can't find in iOS 10 UserNotification doc ... How can I use NSCalendarUnitMinute like repetition in iOS 10 UserNotification ? here is the code which will schedule local notification at 8:30 pm and will repeat after every one minute. UILocalNotification* localNotification = [[UILocalNotification alloc] init]; localNotification.fireDate = pickerDate; localNotification.alertBody = self.textField.text;

popover doesn't display on iphone

前提是你 提交于 2020-01-07 07:25:12
问题 I followed this UIPopoverPresentationController on iPhone doesn't produce popover but doesn't produce popover on iphone. Here is the code of viewcontroller class ViewController:UIViewController,UIPopoverPresentationControllerDelegate{ override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the view. } override func prepare(for segue: UIStoryboardSegue, sender: Any?) { if segue.identifier == "second"{ let secondVC = segue.destination let controller :

delete core data managed object with Swift 3

99封情书 提交于 2020-01-07 02:58:27
问题 Swift 3 has migrated my code and changed: context.deleteObject(myManagedObject) to context.delete(myManagedObject) this is compiling fine (XCode 8b3) but at runtime complaining that the context does not have a function/selector delete(managedObject) Here is the runtime error: [NSManagedObjectContext delete:]: unrecognized selector sent to instance My code is very basic: func delete() { let appDel: AppDelegate = UIApplication.shared().delegate as! AppDelegate if let context:

Universal links doesn't work in iOS 10.2

淺唱寂寞╮ 提交于 2020-01-06 18:36:14
问题 I have serve apple-app-site-association in my HTTPS root (kumpul.co.id/apple-app-site-association) and the result is passed from https://branch.io/resources/aasa-validator/#resultsbox I have configured it in my entitlements: applinks:kumpul.co.id and i have put this function in my Appdelegate.swift: func application(_ application: UIApplication, continue userActivity: NSUserActivity, restorationHandler: @escaping ([Any]?) -> Void) -> Bool { NSLog("Check Universal Link") // 1 guard

how to set array of date to fireDate in local notification at a time

不想你离开。 提交于 2020-01-06 02:18:45
问题 Actually in my app I'm starting more than two timers at different times. After certain time intervals I want notifications to fire. It's working fine when the app is on foreground but not in the background. How can I solve this? Please help. Thanks! 回答1: You need to do following... You need to turn on background mode. In AppDelegate, Add this code to run app in background Create a property @property (nonatomic, assign) UIBackgroundTaskIdentifier backgroundTask; and then do following... -

MPMusicPlayerController does not send background notifications when using Apple Music (Sample Project is Included)

允我心安 提交于 2020-01-05 04:06:17
问题 This is a problem that has been bothering us for months now. I created a bug report for apple, but they aren't responding. I also created a sample project that demonstrates the bug. I would really appreciate any ideas that you guys have. So without further adieu, here is the description of the problem and a link to the sample project. Thank you so much! Sample Project: https://dl.dropboxusercontent.com/u/28210/AppleMusicBug.zip MPMusicPlayerController is used to play Apple Music songs via the

Custom Title View not Centered in iOS 10

半城伤御伤魂 提交于 2020-01-04 05:21:34
问题 This post is a separate topic but related to Custom Nav Title offset ios 11 I created a new thread because it is a separate issue. From project: https://github.com/ekscrypto/Swift-Tutorial-Custom-Title-View To recreate the problem, simply put a button on the existing Root View Controller that pushes another view controller. The "< Back" button scoots the title over, which makes it terribly uncentered. How can I fix this? Thank you. 回答1: Simple change required to support earlier versions of

Disable Add Call option from CallKit

偶尔善良 提交于 2020-01-04 03:16:11
问题 Is there a way to disable Add Call option from Callkit when receiving a VoIP call? I couldn't find any api to disable this. But WhatsApp disabled this feature. 回答1: Set the supportsGrouping , supportsUngrouping and supportsHolding properties to false in the CXCallUpdate for the call. 回答2: You need to set both supportsGrouping , supportsUngrouping and supportsHolding properties to false in the CXCallUpdate, and set maximumCallGroups and maximumCallsPerCallGroup to 1 in your

Swift 3 Local notifications not firing

独自空忆成欢 提交于 2020-01-04 02:40:12
问题 I have the following setup and no notification are firing at all. Based on other similar questions on the stack, I've put in a unique identifier for each request and I've also added the body to the content. I've got this function which requests permission from user. func sendIntNotifications() { //1. Request permission from the user UNUserNotificationCenter.current().requestAuthorization(options: [.alert, .badge, .sound], completionHandler: { (granted, error) in if granted { print (

How to perform action for a custom UITableViewCell inside my viewController?

孤者浪人 提交于 2020-01-03 19:38:51
问题 I have a custom cell that has a xib, this cell contains a button, when the button is pressed I want to do an action , but not inside my custom cell class but from inside the viewcontroller that contains the tableview of the custom cell, any help please? 回答1: First of all you should write a protocol for example: protocol CustomCellDelegate { func doAnyAction(cell:CustomUITableViewCell) } Then inside your custom cell class declare: weak var delegate:CustomCellDelegate? and inside your IBAction