ios9

IOS-9 UIStackView issue in scrolling to leading edge

允我心安 提交于 2019-12-05 05:59:24
问题 I am trying to implement scroll for UIStackView where there are two buttons to add and delete views horizontally. I am changing the scroll.contentSize as the size of UIStackView so when the stack size is greater than the ScrollView's size, stack view can be scrolled. But while scrolling I am not able to reach to the starting of stack view. Few of my views in the beginning can't be reached while scrolling but last views can be reached. //In load view scroll = [[UIScrollView alloc]initWithFrame

localization in ios swift. how can i change application language at run time

微笑、不失礼 提交于 2019-12-05 05:51:27
问题 i am creating app in ios swift. now i want to make app in dual language so from editor menu i just export and import for localization. its create two file for me. now i want to put two button on first page of my app. and when user press button 1 i want to load english language. and if user press button 2 i want to load turkish language. so how can i do this in swift? 回答1: Instead of using NSLocalizedString method to localize your App, load the localizable strings according to the language

No back button on segue in Swift 2

落爺英雄遲暮 提交于 2019-12-05 05:35:08
I just ported my project over to Swift 2, and everything is working great - except that even the most simple segues have no back button. Here is the prepare for segue function that I am using: override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) { // Get the new view controller using [segue destinationViewController]. // Pass the selected object to the new view controller. if segue.identifier == "showExercise" { if let nav = segue.destinationViewController as? UINavigationController { if let exercisesController = nav.topViewController as? ExercisesController { let cell =

How do I replace MPMoviePlayer notifications?

时光总嘲笑我的痴心妄想 提交于 2019-12-05 05:28:30
In iOS 9 MPMoviePlayer and all his components are deprecated. We used MPMoviePlayerController notifications, like MPMoviePlayerLoadStateDidChangeNotification, MPMovieDurationAvailableNotification, MPMoviePlayerPlaybackStateDidChangeNotification, MPMoviePlayerReadyForDisplayDidChangeNotification , to track video service quality. But now with AVPlayerViewController I can't find properly replacement for these notifications. How do I replace these notifications now? AVPlayerViewController is a lot different in its usage from the MPMoviePlayerViewController . Instead of using notifications you use

How to center a label horizontally for all iOS devices in Swift

十年热恋 提交于 2019-12-05 04:37:43
I can't figure out how to make the label horizontally center in a image view, The label says "You've been here. What would you rate us , I want the What would you rate us to be under the "You've been here." What I attempted to do accomplish this was to add 2 lines to the labels and select the label plus the 3 buttons and clicked on "Add Missing Constrains". When I run the program this is the result. How can I fix it so the text is entered on all devices? Constrains for your label try to add constraints like: Add top, width and height constraints as shown in below screen shot and make sure that

How to resolve Type of expression is ambiguous without more context for an audio recorder in swift 2

孤者浪人 提交于 2019-12-05 04:23:36
I have upgraded to Swift 2.0 and I quite can't understand this when I try to record a sound: Type of expression is ambiguous without more context on var recordSettings What should I do to fixt this error and more important, why? var recordSettings = [ AVFormatIDKey: kAudioFormatAppleLossless, AVEncoderAudioQualityKey : AVAudioQuality.Max.rawValue, AVEncoderBitRateKey : 320000, AVNumberOfChannelsKey: 2, AVSampleRateKey : 44100.0 ] var dirPaths = NSSearchPathForDirectoriesInDomains(.DocumentDirectory, .UserDomainMask, true) var docsDir: AnyObject = dirPaths[0] var soundFilePath = docsDir

xcode 7.1 for iOS 9 missing libc++.dylib required for Objective C Realm Static Framework

我与影子孤独终老i 提交于 2019-12-05 03:27:19
I am following this doc for integrating realm in my iOS app. Realm static framework for iOS My problem is in step 3. I am unable to find libc++.dylib. I find a few other .tbd ones but none of them are libc++. I followed a few other SO posts on using the "add other" option and doing command+shift+G and find that library but it's not in that list either. Does anyone know any workarounds? I had the same problem. I found some kind of way around. Go to Build Phases > Link Binary with Librairies > + > Add other Once in the file selection window do "CMD"+Shift+G (Go to folder) and type /usr/lib/ From

iOS 9 Black Launch Screen [closed]

一笑奈何 提交于 2019-12-05 02:25:45
I've been developing my app and was running fine until iOS8. However, today after updating my phone to iOS9, I saw that the launch screen of my app became black. The same issue happened to some other apps as well (Anyone else can also see this in on a device running iOS 9). Any idea why this may be the case? How can I fix this? I has same problem. and in my case was fixed do a re-install from the App Store. Here's the solution: downloaded xcode 7, updated my code to swift 2, recompiled the app and problem solved. 来源: https://stackoverflow.com/questions/32621237/ios-9-black-launch-screen

Deprecated: 'sendAsynchronousRequest:queue:completionHandler:' in iOS9

走远了吗. 提交于 2019-12-05 01:46:44
I have my own class to make http calls but now in iOS9 this method is deprecated: [NSURLConnetion sendAsynchronousRequest:queue:completionHandler:] I'm trying to test the new one [NSURLSession dataTaskWithRequest:completionHandler:] but Xcode give an error because it doesn't found this method. Xcode compiler warning with deprecated line: 'sendAsynchronousRequest:queue:completionHandler:' is deprecated: first deprecated in iOS 9.0 - Use [NSURLSession dataTaskWithRequest:completionHandler:] (see NSURLSession.h Error with new method: No known class method for selector 'dataTaskWithRequest

layer is a part of cycle in its layer tree iOS 9 Swift 2

本秂侑毒 提交于 2019-12-05 01:28:18
When I load my view controller I'm getting this error: *** Terminating app due to uncaught exception 'CALayerInvalid', reason: 'layer <CALayer: 0x7fda42c66e30> is a part of cycle in its layer tree' I don't know why. I think I might've added a third party framework that messed with layers, but I removed it in my troubleshooting. Any insights would be great. EDIT It happens during viewDidLoad of my tableViewcontroller . I have a tableView on my second vc. I've narrowed it down to it crashing on setting the heightForRowAtIndexPath on the 4th custom cell. The cell is on a static tableView ........