ios10

iOS 10 push notification when app terminated?

雨燕双飞 提交于 2019-12-05 18:22:06
I'm face the problem after upgraded to iOS 10 about push notification (I am using Swift3). In normal case when application open or application still in background everything work as well (can receive push notification and update data as my logic). But when application is terminated i can't handle push notification when application become active. Here is my test case. Edit Scheme to Wait for executable to be launched. Double press home button and swipe application up. Run Xcode wait until "Wait for application to launch" shown. Test send push notification from server. Device received push

Animate navigation bar barTintColor change in iOS10 not working

青春壹個敷衍的年華 提交于 2019-12-05 18:08:36
问题 I upgraded to XCode 8.0 / iOS 10 and now the color change animation of my navigation bar is not working anymore, it changes the color directly without any animation. UIView.animateWithDuration(0.2, animations: { self.navigationController?.navigationBar.barTintColor = currentSection.color! }) Anyone knows how to fix this? 回答1: To animate navigationBar’s color change in iOS10 you need to call layoutIfNeeded after setting color inside animation block. Example code: UIView.animateWithDuration(0.5

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

℡╲_俬逩灬. 提交于 2019-12-05 18:02:34
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 of the type iMessage, you will have two targets there, the app and the extension. My questions are:

Crash requesting authorisation to Photos Library in iOS 10

一世执手 提交于 2019-12-05 17:56:16
I have a sample iOS 10 application requesting authorisation to the Photos Library and crashing on a real device with the following crash error: PhotosAuthorizationCrashTest[2014:42551] [access] <private> The repo can be found here Here's the code that requests authorisation (Swift 3.0): private func requestAuthorizationIfNeeded() { DispatchQueue.main.async { let status = PHPhotoLibrary.authorizationStatus() if status == .authorized { return } PHPhotoLibrary.requestAuthorization({ (status) in if status == .authorized { return } NSLog("Could not get authorization to access photos") }) } } I've

Rendering a video with webGL in IOS 10 beta 7 (Safari) - shows weird purplish colors

你说的曾经没有我的故事 提交于 2019-12-05 17:53:45
I'm rendering a video in webGL, by passing a Video object as the source for texImage2D . This works great in all platforms (that supports webGL), however in Safari in IOS 10 beta 7, it is rendered with weird colors (in previous IOS versions it looks ok). For example, this is an image frame from it, that looks how it's supposed: And this is how it's rendered in IOS 10 (the weird version): Is this an IOS10 beta bug? Here is the render code (that happens for each frame): gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT); gl.bindTexture(gl.TEXTURE_2D, frameTexture); gl.texImage2D(gl.TEXTURE_2D,

AVAudioSession : microphone headphone as input and iphone speaker as output

末鹿安然 提交于 2019-12-05 17:52:43
With iOS10 there are more possibilities to manage AUdioSession, but i couldn't manage to keep the headphone microphone as input while audio is going out through the iphone speaker. The 'overrideOutputAudioPort' method below also override the input audio port as the iphone microphone let session = AVAudioSession.sharedInstance() do { try session.setCategory(AVAudioSessionCategoryPlayAndRecord) try! session.overrideOutputAudioPort(.speaker) } catch { } Is there any solution to keep the headphone as input? How I undeerstand this Apple documentation , this is not possible using AVAudioSession : If

UICollectionView Prefetch Data Source in iOS 10?

偶尔善良 提交于 2019-12-05 17:30:01
问题 What is the purpose of prefetchDataSources introduced in iOS 10? I just ran a project in XCode 8 GM Seed and started getting errors: MessagesExtension[17902:1238603] *** Assertion failure in -[UICollectionView _createPreparedSupplementaryViewForElementOfKind:atIndexPath:withLayoutAttributes:applyAttributes:], /BuildRoot/Library/Caches/com.apple.xbs/Sources/UIKit_Sim/UIKit-3599.6/UICollectionView.m:2161 回答1: UICollectionView gains a new property this year called prefetchDataSource. Just like

Open phone settings when button is clicked in my app

亡梦爱人 提交于 2019-12-05 16:58:53
I recently upgraded to Xcode 8 and converted my code to Swift 3. I am making a custom keyboard (extension) which worked perfectly fine till iOS 9, but i am facing a couple of issues in iOS 10. The container app of the custom keyboard contains a button which directs the user to the keyboard settings to add the keyboard Issue: This button click is not working in iOS 10 i.e the user is not directed to the settings. I have configured the URL Schemes in my project and have tried the following code : @IBAction func btnGetStarted(_ sender: AnyObject) { let settingsUrl = URL(string:

Can I submit Swift 2.2 app with Xcode 7.3 when iOS 10 is released?

风流意气都作罢 提交于 2019-12-05 15:25:35
When iOS 10 be released, will I be able to submit to the app store app that runs with Swift 2.2 and was built with Xcode 7.3? Or is it mandatory to move to swift 2.3 or Swift 3 and build the app with Xcode 8? Dejan Skledar Yes you can. Even macOS Sierra will support Xcode 7.3 (unlike Xcode 6 on El Capitan), so you can choose to build your applications in Swift 2.2 or Swift 3. For the App Store submission, the minimum Xcode version is 6.0. (October 2016) For more information you can check out this answer: Minimum Xcode version to upload to App store (As on February 2016) 来源: https:/

An empty snapshotView on iPhone 7/7plus

随声附和 提交于 2019-12-05 15:04:44
问题 My first question here:) Recently I update my Xcode to 8, and the resizableSnapshotView method doesn't work properly on some simulators. The snapshotView works well on all testing devices with iOS9/10 and simulators under iPhone6s, but it is empty on iPhone7/7p simulators. I think 7/7p may need some authorities for accessing snapshot, but I have no idea what they are. let cell = self.tableView.cellForRow(at: IndexPath(row: 0, section: 0)) as! CalendarCell var topFrame = cell.frame topFrame