ios8

Xcode6, iOS8 and (void)layoutSubviews

爷,独闯天下 提交于 2019-12-18 04:52:47
问题 I have custom UILabel which works fine on iOS6 and iOS7. But on iOS8 this label's (void)layoutSubviews method never get called. I create this label with initWithFrame, so this method should be called - and it's called on another iOS versions. What happens with autoLayout system in iOS8? 回答1: I just want to add this answer because the question title may lead a lot of ppl here with similar issues (like me). With iOS 8 to 8.0.2 LayoutSubviews calls are unreliable. They may not be called ever or

Did the way how to globally import files change in Xcode 6 / iOS 8?

被刻印的时光 ゝ 提交于 2019-12-18 04:47:08
问题 I used to do my global imports (i.e. imports that would be visible to all source files in my Xcode project) in the file AppName -prefix.pch . However, now in an Xcode 6 (and iOS 8) environment, after having created a new project, this file is not automatically generated any more. My question is how to properly do global imports in Xcode 6? Can I just create my own AppName -prefix.pch and use this one eventually? Note: When using Cocoapods , a file called Pods- AppName -Bolts-prefix.pch is

Extension project templates not appearing in Xcode 6

末鹿安然 提交于 2019-12-18 04:29:17
问题 I'm not sure if I am the only one experiencing this program, but I have tried searching and have not been able to find anyone in my current situation. I downloaded Xcode 6 beta and was interested in Extension programming for iOS 8. However, I have been unable to locate the extensions in my project templates when creating a new project in Xcode, I saw a YouTube video (unrelated to extension programming) but I did notice that the option was not there for the said video. Now, I have had a look

SpriteKit and SceneKit – How to completely pause a game?

我的梦境 提交于 2019-12-18 04:21:49
问题 I succeeded to pause a scene game with this code: override func touchesBegan(touches: NSSet!, withEvent event: UIEvent!) { var touch:UITouch = touches.anyObject() as UITouch pauseText.text = "Continuer" pauseText.fontSize = 50 pauseText.position = CGPointMake(self.frame.size.width/2, self.frame.size.height/2) /* bouton play/pause */ var locationPause: CGPoint = touch.locationInNode(self) if self.nodeAtPoint(locationPause) == self.pause { println("pause") addChild(pauseText) pause

SpriteKit and SceneKit – How to completely pause a game?

 ̄綄美尐妖づ 提交于 2019-12-18 04:21:46
问题 I succeeded to pause a scene game with this code: override func touchesBegan(touches: NSSet!, withEvent event: UIEvent!) { var touch:UITouch = touches.anyObject() as UITouch pauseText.text = "Continuer" pauseText.fontSize = 50 pauseText.position = CGPointMake(self.frame.size.width/2, self.frame.size.height/2) /* bouton play/pause */ var locationPause: CGPoint = touch.locationInNode(self) if self.nodeAtPoint(locationPause) == self.pause { println("pause") addChild(pauseText) pause

why do you have to remove observer in ios8?

妖精的绣舞 提交于 2019-12-18 04:17:21
问题 After reading this post for iOS 9, I know that you don't need to removeObserver anymore. However for iOS 8, you needed to removeObserver in the deinit method of the viewController. But I can't make sense of it. If a viewController is deallocated then it's DEAD isn't? Why do we need to do a removeObserver. It being an observer is much like calling a dead person who will never pick up the phone What am I not understanding? 回答1: It's fully explained in the article you linked: The notification

application:didReceiveLocalNotification never called on ios 8

五迷三道 提交于 2019-12-18 04:17:16
问题 Is there any known problem issue with: application:didReceiveLocalNotification delegate on iOS 8? My application creates local notifications using UILocalNotification . When application is in background I get notifications, and when I click on the notification banner, it moves to my app. But this method: -(void) application:(UIApplication *)application didReceiveLocalNotification:(UILocalNotification *)notification is never called on iOS 8(Xcode 5.1.1), but works well on iOS 7 or earlier. P.S

WKWebView and UIMenuController

隐身守侯 提交于 2019-12-18 04:14:30
问题 I have an app with a WKWebView in it. In this app, I customize the options presented in the UIMenuController . The web view seems to add Copy and Define options to the menu no matter what I do. If I set myself as first responder and return NO for everything, I still get copy and define options. And I've implemented my own copy option that does special things depending on user preferences and what exactly is selected. Is there a way to remove these extra options? Update : I've filed this as

How can I prevent iOS apps from resetting after changing Camera permissions?

霸气de小男生 提交于 2019-12-18 03:23:10
问题 Currently, when I change the camera permissions for my app in Settings, then navigate back to my app, the app will force a refresh and I will lose my place in the app. I follow these steps exactly: Open an app that uses the camera permission. Navigate to some screen within the app (so you can visibly see the refresh later) Go to the Settings app, navigate to the app's settings, and toggle the camera permission Double click home and go back to the app. After a few seconds, it will refresh,

CloudKit count records

怎甘沉沦 提交于 2019-12-18 03:13:07
问题 I have a "table" that can potentially have many records, when adding a new record I need to know how many records there already are in current table as I use it in calculation of some values. The closest thing I could find is requesting all entries like this: var query : CKQuery = CKQuery(recordType: "Stars", predicate: NSPredicate(format: "mass > 0")) var request : CKQueryOperation = CKQueryOperation(query: query) var starCount = 0 request.queryCompletionBlock = { (cursor:CKQueryCursor!,