ios9

PHPhotoLibrary save a gif data

☆樱花仙子☆ 提交于 2019-12-30 07:19:30
问题 I can't find a similar method to ALAssetsLibrary->writeImageDataToSavedPhotosAlbum in the new PHPhotoLibrary since ALAssetsLibrary deprecated in iOS 9 I can't save GIF probably I'm using this code [[PHPhotoLibrary sharedPhotoLibrary] performChanges:^{ PHAssetChangeRequest *assetRequest = [PHAssetChangeRequest creationRequestForAssetFromImage:[UIImage imageWithData:gifdata]]; placeholder = [assetRequest placeholderForCreatedAsset]; photosAsset = [PHAsset fetchAssetsInAssetCollection:collection

How to avoid “wants to open” dialog triggered by openURL in iOS 9.0

末鹿安然 提交于 2019-12-30 03:56:05
问题 I use openURL to open app B from App A , and I get this alert dialog " App A wants to open App B ", with two buttons, "Open" and "Cancel". If I press "Cancel", app B won't open and dialog will appear again. If I press "Open", app B will open and dialog won't appear again. I would like to somehow to make it not appear to begin with. I am wondering if there is a key I should add to app A 's info.plist in order to skip the dialog step when doing openURL to app B . Any ideas? Update: After

SFSafariViewController Remove OAuth2 Cookie

不问归期 提交于 2019-12-30 02:42:11
问题 I have an iOS application that authenticates with Uber API using OAuth2 in a UIWebView . When upgrading to iOS 9, I run in to the issue of ATS blocking the https request for the login page. I then added an exception for the Uber login page, but then noticed the login page makes several other requests to Facebook, Amazon Web Services, and other websites, all getting blocked by ATS. I don't want to have to maintain a list of exceptions for the the Uber login page, as Uber can easily change

Specify location for ipa file in Xcode 7 Ad-Hoc release

梦想的初衷 提交于 2019-12-30 02:37:06
问题 UPDATE: This issue is still present in Xcode 7.1 beta 2. Looks like this will be here a while. I just updated to Xcode 7 GM and am in the process of generating ad-hoc archives for various builds. However, it does not appear that you can specify the directory path where you want to save the resulting .ipa file. It is going straight to the desktop in a pre-named folder that includes a timestamp. Steps to (hopefully) reproduce From the main menu, select Product --> Archive In the resulting

How to detect where the on demand resources are located after being downloaded?

吃可爱长大的小学妹 提交于 2019-12-29 09:17:12
问题 I implement the app thinning in my project by getting the reference from below two answers:- https://stackoverflow.com/a/33145955/988169 https://stackoverflow.com/a/31688592/988169 How to detect where the on demand resources are located after being downloaded? 回答1: Unless you specified a bundle when you initialized the resource request, the resources are placed in the main bundle by default. So for example, you could access them this way, if appropriate to your type of resource: NSString

iOS: Dynamic Height For UITableViewCell

浪子不回头ぞ 提交于 2019-12-29 08:48:13
问题 I'm using iOS9 XCode7 I need to change the height of cell Dynamically according to labelText Height I have used: self.tableView.rowHeight=UITableViewAutomaticDimension; But it is not working for custom made cell. sizetoFit is removed in iOS9. Please suggest something. Thanks 回答1: Give your label constrains relative to the cell, top, bottom, left and right. Than your cell size will grow with the content height. also make your label multiline.(by setting Lines property to 0 in attribute

sorted function in Swift 2

限于喜欢 提交于 2019-12-29 07:55:48
问题 I'm sorting an Array like this: var users = ["John", "Matt", "Mary", "Dani", "Steve"] func back (s1:String, s2:String) -> Bool { return s1 > s2 } sorted(users, back) But I'm getting this error 'sorted' is unavailable: call the 'sort()' method on the collection What should be the correct way to use the sort() method here? 回答1: Follow what the error message is telling you, and call sort on the collection: users.sort(back) Note that in Swift 2 , sorted is now sort and the old sort is now

MFMailComposeViewController throws an error only in iOS 9

蹲街弑〆低调 提交于 2019-12-29 05:03:10
问题 I can't get MFMailComposeViewController to open without throwing a fatal error in iOS 9 Simulator. The same code (Objective C) works flawlessly in iOS 8.x and lower but today I installed Xcode 7 beta 5 and when I run the app on iOS 9 Simulator, I get a dialog box titled "MailCompositionService quit unexpectedly" and when I view the error report, I see: Application Specific Information: *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSArrayI

iOS 9: Frame no longer set in viewWillAppear after UINavigationController pushViewController

给你一囗甜甜゛ 提交于 2019-12-29 04:37:26
问题 I'm trying to solve a view placement bug that has arisen as of iOS 9. I am instantiating a view controller from a xib file (non-autolayout) and then pushing this onto my UINavigationController . The problem is that when the view controller's viewWillAppear method is called, its frame has not yet been adjusted to the navigation controller's size and is still what was set in the xib file. It doesn't get set properly now until viewDidAppear . This is completely screwing up my code. Does anyone

Is there a way to hide “Back to Safari” from status bar in iOS9?

梦想的初衷 提交于 2019-12-28 14:09:09
问题 How to hide this < Back to Safari from status bar programmatically? I'm getting it in my app – as I'm going out from my app if a user wants to login with their Facebook account. Here's the scenario for which I don't like (want) "Back to Safari" in my app. At first launch of the app (and user not logged in). User choose Login with Facebook option. Facebook iOS SDK comes into the picture, it takes me to the Safari. I logged in and back to the app But, there's "Back to Safari"... It shouldn't be