Questions tagged [uiviewcontroller]

The UIViewController class manages the views in iOS apps and mediates the interaction between an app's views, its underlying model objects, and the overall workflow.

The UIViewController class manages the views in iOS and watch-os apps and mediates the interaction between an app's views, its underlying model objects, and the overall workflow.

View controllers are the foundation of your app’s internal structure. Every app has at least one view controller, and most apps have several. Each view controller manages a portion of your app’s user interface as well as the interactions between that interface and the underlying data. View controllers also facilitate transitions between different parts of your user interface.

To quote from the Overview of the UIViewController Class Reference:

The UIViewController class provides the fundamental view-management model for all iOS apps. You rarely instantiate UIViewController objects directly. Instead, you instantiate subclasses of the UIViewController class based on the specific task each subclass performs. A view controller manages a set of views that make up a portion of your app’s user interface. As part of the controller layer of your app, a view controller coordinates its efforts with model objects and other controller objects—including other view controllers—so your app presents a single coherent user interface.

References:

16290 questions
4
votes
2 answers

Can't connect TableView @IBOutlet to ViewController in Swift 2

I am building an app in which I want to press an annotation button and a TableViewCell will pop up. The problem is, when I try to create an @IBOutlet with control+ drag, to ViewController, it doesn't work. Also if I simply write the code : @IBOutlet…
Chris
  • 125
  • 1
  • 7
4
votes
4 answers

Dismiss view controller when the home button pressed

I am creating an application with swift. I have multiple viewControllers. When Someone in a particular viewController and press the home button, then I want to dismiss that ViewController. I don't want any action in other view controllers. I found…
Amsheer
  • 7,046
  • 8
  • 47
  • 81
4
votes
3 answers

How to dismiss a UIPresentationController by tapping its dimming view

I am using a UIPresentationController to show a custom modal. the presentation controller has a UIView dimming view animated in an out when it is being shown. The modal itself is a UIViewController added to the presentation controller's container.…
Bernd
  • 11,133
  • 11
  • 65
  • 98
4
votes
1 answer

How can I check if UIViewController "Did Dismiss"?

I would like to know, I have an UIButton in class A that does presentModalViewController:aViewController... I want to check when aViewController is dismissed. How can I do that? Thanks!
4
votes
2 answers

ModalView rotation with a thick border (like iBooks app)

controller.modalTransitionStyle = UIViewAnimationTransitionFlipFromLeft; [self presentModalViewController:controller animated:YES]; Is there any way to make it flipping with a thick border/side? (like iBooks app, when you're switching between books…
romaonthego
  • 810
  • 1
  • 8
  • 16
4
votes
1 answer

Advanced method swizzling in Objective-C, iOS 9?

The question is simple. I need the same as usually - how to replace the original method with my one but @selector(presentViewController:animated:completion:) in iOS9? It works in iOS9 simulator only, not real device. Yes this code is called but then…
4
votes
0 answers

Searching a storyboard or view hierarchy for specific child view controller by class or other tag

It's common to see example code that walks the view hierarchy from root to get a pointer to a particular view controller, like this: UITabBarController *tabBC = (UITabBarController *)self.window.rootViewController; UINavigationController *navC =…
Taryn
  • 1,670
  • 1
  • 15
  • 22
4
votes
1 answer

How do I update elements of the parent view/viewController from a ContainerView?

I have a ViewController, which holds a ContainerView. So therefore I added a class for the ViewController() and a class for the ContainerViews ViewController(). To Illustrate it in better, I have attaced a photo of my storboard scene: When I click…
Tom el Safadi
  • 6,164
  • 5
  • 49
  • 102
4
votes
1 answer

Empty space in UISplitViewController embedded in a UITabViewController

I have this view hierarchy on my storyboard: UITabBarController -> UIView + ContainerController -> SplitViewController => [MASTER: (UINavigationController -> UITableviewController -> UITableViewController), DETAIL: (UINavigationController ->…
4
votes
1 answer

Access webpage properties in Share extension

I want to access webpage properties (Title, Meta - description, URL, default image, etc) when user opens Share extension on iOS using javascript file. I am using the following code for javascript…
Purusottam
  • 611
  • 6
  • 19
4
votes
2 answers

cannot covert value type 'TableViewController.Type' to expected argument type 'UIViewController'

I am making an app with a sign up and login. I used Parse for this. I want to move the View Controller to a TableViewController if the Login/Sign Up is successful. However I am getting this error: "Cannot convert value type'TableViewController.Type'…
ojassethi
  • 379
  • 1
  • 5
  • 16
4
votes
2 answers

Why do I keep getting this error when going from ViewController to TableViewController?

I have this button in my viewController and when I press on it, it should go to the TableViewController. When I do this the app crashes and prints this error in the console. Can someone tell me what Im doing wrong? Thank you! Terminating app due…
coding22
  • 689
  • 1
  • 7
  • 28
4
votes
4 answers

edgesForExtendedLayout ignored on iOS9 when using custom animation

iOS9 seems to ignore destination view controller's edgesForExtendedLayout when implementing custom animation using UIViewControllerAnimatedTransitioning, therefore the content ends up below the navigation bar. Any idea why this is happening? I've…
Mercurial
  • 2,095
  • 4
  • 19
  • 33
4
votes
1 answer

UITableView: Scrolling to the bottom with custom/variable cell heights is inaccurate on the initial scroll

Edit: https://streamable.com/rfym will show it in action. The first time I press Scroll To Bottom, it doesn't get all the way to the bottom. I then manually get all the way to the bottom and quickly scroll all the way back up. Once I press Scroll To…
David
  • 7,028
  • 10
  • 48
  • 95
4
votes
2 answers

Delay when dismissing a viewController on iOS 9

This is for my swift based sprite kit game. It was fine on iOS 8, but i notice this delay after I started to run the game on an iOS 9 device. Before my game goes back into the game scene from a menu or some other view that was presented, there's…
Ali Hus
  • 255
  • 4
  • 10
1 2 3
99
100