ios10

Wait till local notifications from UNUserNotificationCenter gets deleted using removePendingNotificationRequests ios 10 swift 3

别来无恙 提交于 2019-12-10 10:28:07
问题 Using new local notifications from UNUserNotificationCenter . I try to delete notification with some identifiers: UNUserNotificationCenter.current().removePendingNotificationRequests(withIdentifiers: identifiers) and from documention: This method executes asynchronously, removing the pending notification requests on a secondary thread. Completion handler is not present. So how do I know when its really get deleted? Before moving ahead, I need to make sure that this identifier is not present

iOS 10 video tag with “autoplay muted playsinline” stops background music (spotify)

风流意气都作罢 提交于 2019-12-10 10:27:53
问题 I am trying to keep playing background music like Spotify playing with playing a inline video with attributs: "autoplay muted playsinline". <video id="video" muted="muted" autoplay loop muted playsinline > <source src="video.mp4" type="video/mp4"> </video> <script> window.onload = function () { var element = document.getElementById('video'); element.muted = "muted"; } </script> But when I run this the video is plays inline and autoplaying. But as soon as the video start the background music

UserDefaults.standard set nil Error in XCode 8 and Swift 3

对着背影说爱祢 提交于 2019-12-10 10:19:35
问题 This seems a bug. I am trying to remove an existing value in the defaults. UserDefaults.standard.set(nil, forKey: "test-me") let val = UserDefaults.standard.object(forKey: "test-me") print ("val=\(val)") I got the following output - val=Optional(<62706c69 73743030 d4010203 04050608 09582476 65727369 6f6e5824 6f626a65 63747359 24617263 68697665 72542474 6f701200 0186a0a1 0755246e 756c6c5f 100f4e53 4b657965 64417263 68697665 72d10a0b 54726f6f 74800008 111a232d 3237393f 51545900 00000000

Address Book crash on iOS10

坚强是说给别人听的谎言 提交于 2019-12-10 10:17:00
问题 Selecting a contact from contact picker crashes the app in iOS10.0. Contacts picker is shown using ABPeoplePickerNavigationController like this: let contactsPicker = ABPeoplePickerNavigationController() contactsPicker.peoplePickerDelegate = self self.presentViewController(contactsPicker, animated: true, completion: nil) Here is the stack trace from crash log: *** Terminating app due to uncaught exception 'CNPropertyNotFetchedException', reason: 'A property was not requested when contact was

Swift 3 / iOS 10 / TodayExtension - UserDefaults always returns nil

别说谁变了你拦得住时间么 提交于 2019-12-10 10:11:32
问题 This is my first Question on this site. I have a problem that I cannot fix. I'm working on an easy note application with today extension. I have had no problem in Swift 2.2 and iOS 9. Problem just appears in Swift 2.3 and Swift 3, on iOS 10. The problem I have is the following : User can write a note (saved in UserDefaults) and open Notification Center and watch his notes in a TodayExtension. I have these methods to save notes in UserDefaults and retrieve it from UserDefaults (I'm using

Swift 3.0 how to use startDeviceMotionUpdates(to: withHandler)?

本小妞迷上赌 提交于 2019-12-10 09:27:28
问题 Swift 3.0 was released alongside Xcode 8.0 and apparently a lot has changed. I'm very unfamiliar with the new syntax in swift. Can someone help me out? I'm trying to figure out what goes in motionManager.startDeviceMotionUpdates( to: OperationQueue.current()!, withHandler: ) after the "withHandler:" I am trying to get my SceneKit program be able to utilize the accelerometer to determine the orientation of an SCNNode platform. I am also fairly new to swift (about 5 days into programming in

What is the difference between Apple's iMessage template or adding an extension to an existing app?

瘦欲@ 提交于 2019-12-10 09:27:25
问题 I have noticed this different regarding the creation of messages apps for iOS 10. If you create a new project using iMessage Application choice on the new project's template, Xcode will create two targets, an app and an extension. but the project is not able to run. (see by this second picture that there is only one choice on the target selector at the bottom and that target is the extension). When you create a normal app, like a single view app and then add a target that is an app extension

MFMailComposeViewController error [MC] Filtering mail sheet accounts for bundle ID

梦想与她 提交于 2019-12-10 02:19:12
问题 I do the standard functionality of sending messages with MFMailComposeViewController . My code: if MFMailComposeViewController.canSendMail() { let mail = MFMailComposeViewController() mail.mailComposeDelegate = self mail.setToRecipients(["someemail@gmail.com"]) mail.setSubject("Subject") mail.setMessageBody("Some Text", isHTML: false) self.presentViewController(mail, animated: true, completion: nil) } Controller do not open and I see a message in the console that have never seen. [MC]

Unrecognized selector UIDeviceRGBColor countByEnumeratingWithState:objects:count:

北慕城南 提交于 2019-12-10 01:48:20
问题 I know this is kind of a dupe, but I don't have enough reputation yet to comment on the original post and, while I don't have an answer, I do have more useful information (a concrete example). Moderators, feel free to move this to the proper location. When compiling my code using the latest XCode 8 beta 6 (iOS 10 SDK), I get an exception "Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UIDeviceRGBColor countByEnumeratingWithState:objects:count:]:

Reading Serial Port iOS

让人想犯罪 __ 提交于 2019-12-10 01:42:06
问题 I have the following code to read and write to serial ports on iOS 10.3.3 Jailbroken iPhone 6S (I used h3lix to jailbreak): Serial.h: // // Serial.h // iOUSB // // Created by Brandon on 2018-05-21. // Copyright © 2018 XIO. All rights reserved. // #if !defined(__cplusplus) //-fmodules -fcxx-modules @import Foundation; #else #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wauto-import" #import <Foundation/Foundation.h> #pragma clang diagnostic pop #endif #define BAUD_RATE 9600