uiviewcontroller

Implicitly unwrapped optional in Apple methods

假装没事ソ 提交于 2020-03-03 06:49:31
问题 I'm trying to switch from Objective-C to Swift. I don't understand the point of declaring a function to return a AnyObject! instead of AnyObject? . For example: func instantiateViewControllerWithIdentifier(identifier: String) -> AnyObject! Why does this method return an implicitly unwrapped optional and not a simple optional? I get the AnyObject part, but what's the point of allowing us to avoid using the ! to unwrap the optional if it may be nil? (thus crashing the app, even if it's very

Implicitly unwrapped optional in Apple methods

核能气质少年 提交于 2020-03-03 06:49:28
问题 I'm trying to switch from Objective-C to Swift. I don't understand the point of declaring a function to return a AnyObject! instead of AnyObject? . For example: func instantiateViewControllerWithIdentifier(identifier: String) -> AnyObject! Why does this method return an implicitly unwrapped optional and not a simple optional? I get the AnyObject part, but what's the point of allowing us to avoid using the ! to unwrap the optional if it may be nil? (thus crashing the app, even if it's very

Implicitly unwrapped optional in Apple methods

天大地大妈咪最大 提交于 2020-03-03 06:49:08
问题 I'm trying to switch from Objective-C to Swift. I don't understand the point of declaring a function to return a AnyObject! instead of AnyObject? . For example: func instantiateViewControllerWithIdentifier(identifier: String) -> AnyObject! Why does this method return an implicitly unwrapped optional and not a simple optional? I get the AnyObject part, but what's the point of allowing us to avoid using the ! to unwrap the optional if it may be nil? (thus crashing the app, even if it's very

Implicitly unwrapped optional in Apple methods

人走茶凉 提交于 2020-03-03 06:49:05
问题 I'm trying to switch from Objective-C to Swift. I don't understand the point of declaring a function to return a AnyObject! instead of AnyObject? . For example: func instantiateViewControllerWithIdentifier(identifier: String) -> AnyObject! Why does this method return an implicitly unwrapped optional and not a simple optional? I get the AnyObject part, but what's the point of allowing us to avoid using the ! to unwrap the optional if it may be nil? (thus crashing the app, even if it's very

How to perform kCATransitionPush animation without any transparency / fade effects [duplicate]

假装没事ソ 提交于 2020-02-21 11:10:11
问题 This question already has answers here : Closed 7 years ago . Possible Duplicate: iPhone CATransition adds a fade to the start and end of any animation? I'm trying to duplicate the "slide up from the bottom" animation that [UIViewController presentModalViewController:animated:] performs but without calling it because I don't want a modal view. The below core animation code comes very close but appears to be changing transparency values of the views during it. At the start of the animation you

Xcode 8 Storyboards Blank

↘锁芯ラ 提交于 2020-02-16 04:09:42
问题 For some reason in Xcode 8.1, all my storyboards are now blank, with boxes around where the content used to be: I tried cleaning, deleting the Derived Data folder, and changing the size to Freeform but nothing has worked. How do I fix this? 回答1: Try these: Delete your derived data. Close xcode and clean, build again. If option 1 not work then, Copy your project to another directory/folder. Close Xcode, open project from new directly and clean, build. 来源: https://stackoverflow.com/questions

Xcode 8 Storyboards Blank

不想你离开。 提交于 2020-02-16 04:04:56
问题 For some reason in Xcode 8.1, all my storyboards are now blank, with boxes around where the content used to be: I tried cleaning, deleting the Derived Data folder, and changing the size to Freeform but nothing has worked. How do I fix this? 回答1: Try these: Delete your derived data. Close xcode and clean, build again. If option 1 not work then, Copy your project to another directory/folder. Close Xcode, open project from new directly and clean, build. 来源: https://stackoverflow.com/questions

Root View Controller Swift

醉酒当歌 提交于 2020-02-08 09:15:36
问题 I have a function in my app delegate which appends an item to an array in my a file named ViewController.swift, and then I want to reload a tableview in that same file. I attempt to do so like so: let vc = ViewController() let navigationController = UINavigationController(rootViewController: vc) window!.rootViewController = navigationController println(vc.messages) //1 vc.messages.append(message.data.message as! String) //2 vc.MessageTableView?.reloadData() The lines numbered 1,2 are where I

Root View Controller Swift

99封情书 提交于 2020-02-08 09:14:44
问题 I have a function in my app delegate which appends an item to an array in my a file named ViewController.swift, and then I want to reload a tableview in that same file. I attempt to do so like so: let vc = ViewController() let navigationController = UINavigationController(rootViewController: vc) window!.rootViewController = navigationController println(vc.messages) //1 vc.messages.append(message.data.message as! String) //2 vc.MessageTableView?.reloadData() The lines numbered 1,2 are where I

How to go back to current View Controller?

送分小仙女□ 提交于 2020-02-07 01:38:25
问题 I am implementing ECSlidingViewController in my app. Everything works fine, when I hit the menu button (UIBar) the left menu slides. But pressing the menu button again does not bring back the current ViewController . It works in the sample app, but I cannot find that line of code that brings back the current controller. Here is the code to show the menu: - (IBAction)menuButtonTapped:(id)sender { [self.slidingViewController anchorTopViewToRightAnimated:YES]; } Now I am looked everywhere for