viewcontroller

Difference between a Scene and a View in iOS

陌路散爱 提交于 2019-12-03 03:23:17
I'm new to iOS I'm having trouble understanding the difference between scene and a view. Unfortunately Apple's documentation isn't helping me. I read that a scene is what you see on the screen. But isn't that what a view is? Are these two interchangeable terms? If not what are the differences, both functionality and best practice? How does a ViewController come into play for both of these? Any explanations or links are much appreciated. Kunal Balani In simple terms: View A UIView is a rectangular area that is displayed on the screen. ViewController A collection of Views displayed on the screen

Difference between presentModalViewController and presentViewController?

亡梦爱人 提交于 2019-12-03 01:19:29
In iOS 5 SDK, there're two methods of UIViewController, presentModalViewController:animated: and presentViewController:animated:completion:. What's the difference between these two method? The documentation says: The presentViewController:animated:completion: method is the preferred way to present a modal view as of iOS 5.0. If I use a presentModalViewController:animated in iOS 5, will it causes a bug? Are they functionally-same? Daniel They seem to do the same thing as apple documentation points out, as of iOS 5.0 presentViewController is the preferred way to present view controllers, it

dismissViewController: not working

邮差的信 提交于 2019-12-03 00:38:23
I have a view controller called vc0 which is presented like this: [self presentViewController: vc1 animated: YES completion: nil]; And in vc1 I have a button to present another view controller: [self presentViewController: vc2 animated: YES completion: nil]; Then in vc2, I have a button to dismiss the view controller: [self dismissViewControllerAnimated:YES completion: ^{ // over here I call one method in vc1 } And as expected it returns back to vc1.. however there is a button in vc1 to go back to vc0 by dismissing the view controller like this: [self dismissViewControllerAnimated:YES

Deleted class drops error message unknown>:0: error: no such file or directory:

耗尽温柔 提交于 2019-12-02 22:40:01
So me and some friends working on a bitbucket project and already realized that bitbucket sometimes doesn't sync all the files. But here is what happened: I continued working and created an class, I basically copied an old View Controller (called WelcomescreenViewController.swift -> CreateAccountViewController.swift ) and made some adjustments in the main storyboard. Here I deleted all the old outlets in the new one and then made an own class for it as ViewController and connected it with it in the main storyboard. What now happened is that there were some problems and I reverted everything

MultipleControllers in one view

橙三吉。 提交于 2019-12-02 20:55:43
问题 I am basically trying to add two view controllers to one controller. I created a view based application called "MultipleViews". After that i add two controller classes "RedView.h" and "BlueView.h" with their own xibs. I am able to add the views of both the controllers to "MutipleViewsViewController" by the method [self.view addSubview:red.view] . Both the views are displayed properly. The problem is when I add a button to the red and blue controllers. Whenever I click the button it says

Pass data from two UItextfields to new view controller

血红的双手。 提交于 2019-12-02 19:24:00
问题 I am a bit stuck on trying to pass data from two UITextfields on one viewcontroller to another viewcontroller. Basically I got the items below: ViewController.h #import <UIKit/UIKit.h> @interface ViewController : UIViewController { IBOutlet UITextfield *Textfield1; IBOutlet UITextfield *Textfield2; } -(IBAction)GoNextView:(id)sender; @end ViewController.m @interface ViewController () @end @implementation ViewController (IBAction)GoNextView:(id)sender { SecondView *second = [[SecondView alloc]

iPhone - designing my own viewController transition

六眼飞鱼酱① 提交于 2019-12-02 18:55:54
My app have a bunch of viewControllers and I am trying to design my own animation transition from one viewController to the other. I have found this - (void)transitionFromViewController:(UIViewController *)fromViewController toViewController:(UIViewController *)toViewController duration:(NSTimeInterval)duration options:(UIViewAnimationOptions)options animations:(void (^)(void))animations completion:(void (^)(BOOL finished))completion but this does not appear to allow designing my own transition curve. What I want is to create effects like elastic bouncing when the new viewControllers hits the

Get attribute of viewcontroller created with storyboard

依然范特西╮ 提交于 2019-12-02 18:19:08
问题 I'm currently learning swift and I'm trying to learn of instanciation from storyboard works, but the error I'm facing now isn't documented very much. I created a viewcontroller in my main storyboard and I specified it's type as a custom class I called previously SimpleNewsViewController , here's the code of my class, it is'nt complicated: class SimpleNewsViewController: UIViewController { @IBOutlet weak var myImage: UIImageView! @IBOutlet weak var myLabel: UILabel! @IBOutlet weak var myText:

How do I create a view controller file after creating a new view controller?

梦想与她 提交于 2019-12-02 17:02:32
I am developing a tabbed application. When I create a new view controller and link it to the tab bar controller, unlike the other two default view controllers, this one has no viewcontroller.swift file. How can I create this file? I am using Xcode 6 and developing the app in Swift. Correct, when you drag a view controller object onto your storyboard in order to create a new scene, it doesn't automatically make the new class for you, too. Having added a new view controller scene to your storyboard, you then have to: Create a UIViewController subclass. For example, go to your target's folder in

MultipleControllers in one view

余生颓废 提交于 2019-12-02 11:42:21
I am basically trying to add two view controllers to one controller. I created a view based application called "MultipleViews". After that i add two controller classes "RedView.h" and "BlueView.h" with their own xibs. I am able to add the views of both the controllers to "MutipleViewsViewController" by the method [self.view addSubview:red.view] . Both the views are displayed properly. The problem is when I add a button to the red and blue controllers. Whenever I click the button it says unrecognized selector sent to instance even though I linked the buttons with their functions properly. Am i