ios9

Swift 2 / iOS 9 - libz.dylib not found

雨燕双飞 提交于 2019-11-27 17:23:21
I'm using some external codes from google in my new Swift 2.0 project that required "libz.dylib" in earlier versions. After updating to the new XCode / the new SDK. XCode is now unable to import the libz.dylib and throws some errors Undefined symbols for architecture i386: "_deflate", referenced from: +[GAICompressionUtil gai_dataByCompressingBytes:length:compressionLevel:mode:] in libGoogleAnalyticsServices.a(GAICompressionUtil.o) "_deflateEnd", referenced from: +[GAICompressionUtil gai_dataByCompressingBytes:length:compressionLevel:mode:] in libGoogleAnalyticsServices.a(GAICompressionUtil.o)

Action Sheet problems in iOS 9

浪尽此生 提交于 2019-11-27 16:41:55
问题 Apple has deprecated the action sheet in iOS 8.3 how do you add an action sheet to my user interface? I realized Apple's documentation isn't very clear on how to create an action sheet with UIAlertController. So after a little playing around I just wanted to share my code, since I couldn't really find anything useful on Stack Exchange about this topic. 回答1: I had the same problem in my iPhone app, with an UIActionSheet to ask the user if they wanted to take a photo, or pick an image from

Fixing NSURLConnection Deprecation from Swift 1.2 to 2.0

心不动则不痛 提交于 2019-11-27 16:25:10
I have a function written in Swift 1.2, that checks for Reachability of Address or IP. Here it is : func isHostConnected(hostAddress : String) -> Bool { var response : NSURLResponse? let request = NSMutableURLRequest(URL: NSURL(string: hostAddress)!) request.timeoutInterval = 3 let data = NSURLConnection.sendSynchronousRequest(request, returningResponse: &response, error: nil) return ((response as? NSHTTPURLResponse)!.statusCode == 200) } Now since, NSURLConnection is deprecated, as per Xcode suggestion I tried writing it using NSURLSession.dataTaskWithRequest , here it is : func

Safari on iOS 9 does not trigger click event on hidden input file

感情迁移 提交于 2019-11-27 16:22:02
问题 I have a website with an upload field, but the input is hidden with display: none; and I have a div for calling this action. It worked on iOS 8, but now after the iOS 9 update, nothing happens when I touch in the div. I've tried using the [0].click() or pure VanillaJS like document.getElementById('file_input').click() and nothing works. All these methods work between iOS 5 and iOS 8. If you want, link to this example on JSFiddle: https://jsfiddle.net/o1r265tz/6/embedded/result/ $(document)

How to use PHPhotoLibrary like ALAssetsLibrary

好久不见. 提交于 2019-11-27 16:14:17
问题 For iOS9, ALAssetsLibrary is deprecated. So how to change it as PHPPhotoLibrary instead of ALAssets ? if (RecordedSuccessfully && recording == NO) { //----- RECORDED SUCESSFULLY ----- NSLog(@"didFinishRecordingToOutputFileAtURL - success"); ALAssetsLibrary *library = [[ALAssetsLibrary alloc] init]; if ([library videoAtPathIsCompatibleWithSavedPhotosAlbum:outputFileURL]) { [library writeVideoAtPathToSavedPhotosAlbum:outputFileURL completionBlock:^(NSURL *assetURL, NSError *error) { if (error)

What is the impact of the “Requires full screen” option in Xcode for an iPhone-only app?

感情迁移 提交于 2019-11-27 14:18:25
问题 For an iPad-only app or a universal app, the "Requires full screen" option tells Xcode/iOS whether the app supports iPad multitasking feature introduced in iOS 9. But the "Requires full screen" option is also present if it's an iPhone-only app. In this case, what is the impact of this option? 回答1: There is no impact at all. Apple engineers thinks that its not required to hide, or may be Plus phones will get landscape slide over in later iOS versions :) From the documentation: To opt out of

iOS 9 … Are WebView(s) exempt from the App Transport Security Exceptions (ATS) rules that block insecure HTTP hosts?

我们两清 提交于 2019-11-27 13:39:23
问题 In iOS 9, Apple is blocking insecure HTTP connections for apps, unless specific hosts are whitelisted. http://ste.vn/2015/06/10/configuring-app-transport-security-ios-9-osx-10-11/ Are WebView(s) exempt from these rules for obvious reasons, or are we still expected to whitelist hosts that a browser opens... including all links from a given page? I wasn't sure if this was our responsibility or if that was exempt. 回答1: SFSafariViewController can show HTTP without the NSAppTransportSecurity key.

iOS9 Swift File Creating NSFileManager.createDirectoryAtPath with NSURL

那年仲夏 提交于 2019-11-27 13:29:45
Before iOS9, we had created a directory like so let documentsPath = NSSearchPathForDirectoriesInDomains(.DocumentDirectory, .UserDomainMask, true)[0] as! String let logsPath = documentsPath.stringByAppendingPathComponent("logs") let errorPointer = NSErrorPointer() NSFileManager.defaultManager().createDirectoryAtPath(logsPath, withIntermediateDirectories: true, attributes: nil, error: errorPointer) But with iOS9 they removed String.stringByAppendingPathComponent. The auto convert tool replaced our use of String with NSURL. createDirectoryAtPath() takes a string so I need to convert the NSURL to

Swift: How to remember cookies for further http requests

不羁的心 提交于 2019-11-27 13:01:01
问题 I am working on a login application. After successful login response comes back with cookie data. How can I use/save this data for my future requests? For starters I am trying to save it in NSHTTPCookieStorage . But that is also not working. Login Method(partial): let task = session.dataTaskWithRequest(request) { (data, responseData, error) -> Void in if let response = responseData as? NSHTTPURLResponse { statusCode = response.statusCode print("Response code: \(statusCode)") } var json:

setStatusBarHidden is deprecated in iOS 9.0

对着背影说爱祢 提交于 2019-11-27 12:41:54
问题 I am upgrading my code from iOS 8 to iOS 9. I have a code snippet in my program [[UIApplication applicationName] setStatusBarHidden:YES]; . I am getting the warning "setStatusBarHidden is deprecated in iOS 9.0, Use -[UIViewController prefersStatusBarHidden". If I just replace 'setStatusBarHidden' with 'prefersStatusBarHidden', I get 'instance method not found'. Can someone please suggest me how to solve this problem? 回答1: Add below code to your view controller.. - (BOOL)prefersStatusBarHidden