Tag: ios10

如何限制button点击

我有一个这样的VC 对于我已经embeddedUIButtons的checkbox,我点击更改他们的图像。 这是我的代码 @IBOutlet weak var bestSellerButton: UIButton! @IBOutlet weak var trendingButton: UIButton! @IBOutlet weak var lowToHighButton: UIButton! @IBOutlet weak var highToLowButton: UIButton! var isBoxClicked = Bool() func updateCheckImageOnClick(button: UIButton) { if isBoxClicked == true { isBoxClicked = false button.setImage(UIImage.init(named: "checkmark"), for: UIControlState.normal) } else { isBoxClicked = true button.setImage(UIImage(), for: UIControlState.normal) } } @IBAction […]

有没有办法打开在推送通知中收到的url,而无需在iOS 10中打开应用程序?

我试图打开一个url传递在ios 10中的推送通知。到目前为止,我还没有find一种方式来打开一个URL,而无需打开应用程序。 有没有办法打开在推送通知收到的url,而无需打开应用程序? 我find了一个解决方法来打开url(ios <10的解决方法),但是再次打开应用程序。 更新: 我注意到,对于设备(iOS 10.0)下面的mentohds得到参与应用程序:didRegisterForRemoteNotificationsWithDeviceToken userNotificationCenter:willPresentNotification: userNotificationCenter:didReceiveNotificationResponse: 但是,应用程序:didReceiveRemoteNotification:fetchCompletionHandler:和 – 应用程序:didReceiveRemoteNotification: 不被调用。 我是新来的ios,这是我得到了多less: AppDelegate.h #import <UIKit/UIKit.h> #import <UserNotifications/UserNotifications.h> @interface AppDelegate : UIResponder <UIApplicationDelegate,UNUserNotificationCenterDelegate> @property (strong, nonatomic) UIWindow *window; @end AppDelegate.m #import "AppDelegate.h" @interface AppDelegate () @end @implementation AppDelegate – (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { // Override point for customization after application launch. if […]

声音问题修复了iOS 10推送通知

我为我们的应用程序实施了推送通知。 在iOS 9上,声音的话很好。 在iOS 10上,这是非常不可预知的。 在iOS 10.0.2上从Xcode全新安装会显示我的自定义声音。 重新安装会popup默认声音。 我不知道什么时候,但有时我也听不到声音。 从这里和其他许多人阅读我的结论是,它在硬重启后工作。 2个问题: 苹果是否完全解决了这个问题的任何版本? 如果是这样的版本? 硬重启后,问题会完全消失吗? 或者你需要再做一次? 如果是的话?

在接听来自CallKit的呼叫时,Sinch – callDidEstablish没有在locking屏幕上被调用

在接听来自CallKit的呼叫时,Sinch – callDidEstablish没有在locking屏幕上被调用。 我已经集成了CallKit但是从锁屏响应来电呼叫委托方法没有被呼叫build立呼叫。 我也通过iOS Sinch Document说: 在后台调用 – [SINCall回答]是可能的。 该呼叫没有立即回答,但操作被认为是挂起的,一旦应用程序返回到前台,呼叫应答。 有没有办法build立从locking屏幕回答它的呼叫。 提前致谢。

iOS 10推送通知中的媒体附件

我正在努力在iOS 10中向我的推送通知添加图像。 我已经添加了一个通知服务扩展,并使用了下面的代码: override func didReceive(_ request: UNNotificationRequest, withContentHandler contentHandler: @escaping (UNNotificationContent) -> Void) { self.contentHandler = contentHandler bestAttemptContent = (request.content.mutableCopy() as? UNMutableNotificationContent) if let urlString = request.content.userInfo["image-url"] as? String, let fileUrl = URL(string: urlString) { URLSession.shared.downloadTask(with: fileUrl) { (location, response, error) in if let location = location { let options = [UNNotificationAttachmentOptionsTypeHintKey: kUTTypePNG] if […]

在iOS 10中的WhatsApp集成和openURL问题

我在我的iOS应用程序中集成了whastapp。 当我在iOS 10设备上testing它时 它崩溃了一个问题。 对未呈现的视图进行快照会产生空的快照。 确保您的视图在屏幕更新后的快照或快照之前至less已呈现一次。 NSURL *whatsappURL = [NSURL URLWithString:[NSString stringWithFormat: @"whatsapp://send?abid=%@&text=WelcomeToChatBought",[abidArray objectAtIndex:buttonclicked.tag-1000]]]; if ([[UIApplication sharedApplication] canOpenURL: whatsappURL]) { [[UIApplication sharedApplication] openURL: whatsappURL]; } 可能是什么问题。 任何帮助,将不胜感激。

如何在创build新logging时使用CloudKit在没有延迟的情况下更新TableView中的数据

在我的应用程序中有2个视图控制器。 第一个“MainViewController”显示了从私有CloudKit数据库中获取的CKRecords字段的tableView。 在VC的viewWillAppear方法中,我从CloudKit获取logging并重新加载tableview的数据,以显示用户以前保存在CloudKit中的最新获取结果。 第二个视图控制器“CreateRecordViewController”用于创buildCKRecords并将其保存到CloudKit的专用数据库。 所以我在CreateRecordViewController中创buildlogging并在MainViewController中显示它们。 问题是:当我在CreateRecordViewController创buildlogging时,它保存在CloudKit服务器上,但closures此CreateRecordViewController并转到MainViewController后,tableview并不总是及时更新。 这是我CreateRecordViewController中保存logging的代码: CloudKitManager.sharedInstance.privateDatabase.save(myRecord) { (savedRecord, error) -> Void in if error == nil { print("successfully saved record code: \(savedRecord)") } else { // Insert error handling print("error Saving Data to iCloud: \(error.debugDescription)") } } logging保存后,我closuresCreateRecordViewController并查看MainViewController。 正如我之前在viewWillAppear of MainViewController中所说的,我检查iCloud是否可用,如果可用,我使用CloudKit中的查询获取所有logging,并在tableView中显示它们。 override func viewWillAppear(_ animated: Bool) { CKContainer.default().accountStatus { (accountStatus, error) in switch […]

iOS 10中是否有新的设备标识符?

有没有人find一种新的方式来唯一标识iOS 10中的设备? 我还没有看到任何文件提到在这方面的变化,我想问之前,我投降了供应商的标识。

使用iOS 10中的UNNotificationSettings检查通知types

如何使用UNNotificationSettings获取iOS 10中的通知types? 在以前的iOS上,我会使用这个: UIUserNotificationSettings *notificationSettings = [[UIApplication sharedApplication] currentUserNotificationSettings]; Bool active = notificationSettings.types == UIUserNotificationTypeNone ? NO: YES;

ISO8601DateFormatter不parsingISOdatestring

我试图parsing这个 2017-01-23T10:12:31.484Z 使用由iOS 10提供的原生ISO8601DateFormatter类,但总是失败。 如果string不包含毫秒,则创buildDate对象时没有问题。 我试过这个和许多options组合,但总是失败… let formatter = ISO8601DateFormatter() formatter.timeZone = TimeZone(secondsFromGMT: 0) formatter.formatOptions = [.withInternetDateTime, .withDashSeparatorInDate, .withColonSeparatorInTime, .withColonSeparatorInTimeZone, .withFullTime] 任何想法? 谢谢!