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
0 answers

Disable swipe gesture in QLPreviewController

I am trying to preview the Images/Video/PDF in UICollectionViewCell (full screen). for PDF I am trying to use the QuickLook framework. Here is what I am trying to do, CollectionView CollectiViewCell QLPreviewController.view as subview of…
4
votes
3 answers

Present UIAlertController in the currently active UIViewController

I've got a timer showing an alert when finished. This alert view should be presented in the view controller which the user is currently in. My feeling is this could be accomplished much more effective than the following: The way I'm doing this now…
nontomatic
  • 2,003
  • 2
  • 24
  • 38
4
votes
4 answers

Will multiple presentViewController method calls throughout the view controllers lead to memory leak in iOS?

I know there has been a lot of discussions occurred related to this topic. But in all discussions all have discussed with 2 view controllers (A&B). My scenario is similar but different. What will happen when there are multiple view controllers like…
4
votes
4 answers

Changing tintColor of UISearchBar inside ABPeoplePickerNavigationController

I am tyring to customize the colors a bit in a ABPeoplePickerNavigationController below is my complete code: ABPeoplePickerNavigationController *objPeoplePicker = [[ABPeoplePickerNavigationController alloc] init]; [objPeoplePicker…
Jesse Bunch
  • 6,651
  • 4
  • 36
  • 59
4
votes
2 answers

Destination's View Controller variable becoming nil after being set

Basically there is something wrong either with my code, Swift or the compiler/Xcode itself. I have 2 ViewControllers and the second one (destination) has 2 UIImage variables. First ViewController sets those 2 images in prepareForSegue like this: if…
n1tr0
  • 269
  • 4
  • 15
4
votes
1 answer

dismissViewControllerAnimated close all view controller to root [swift]

let's say I've 4 view controller page 1 ----showdetail----> page 2 ----showdetail----> page 3 ----showdetail----> page 4 I want to go back to page 3 from page 4 with self.dismissViewControllerAnimated(true, completion: nil). It works fine in iOS 9…
Aldo Lazuardi
  • 1,898
  • 2
  • 19
  • 34
4
votes
2 answers

How to destroy instance of view controller after performing segue

I use performSegueWithIdentifier to navigate between views controllers I have a tableView with multiple rows, when a row is actioned, i call a webViewController to play selected ressource with segue performSegueWithIdentifier("Play", sender:…
Khorwin
  • 445
  • 1
  • 9
  • 27
4
votes
1 answer

How to present a modal view controller on the iphone without a "current" view controller?

I'm trying to open the email view controller (MFMailComposeViewController), and everything I read suggests using presentModalViewController:animated:, which seems to need to be sent to a UIViewController. For example, in the documentation, it…
Jesse Beder
  • 33,081
  • 21
  • 109
  • 146
4
votes
1 answer

How to know if a UIVIewController is presented as Peek Preview Controller

Is there a way to know whether a UIViewController is currently being presented as a Peek Preview from a 3D touch? I don't want to create a completely new view controller but I would like to remove some controls that don't make sense when…
FrankWest
  • 365
  • 2
  • 10
4
votes
4 answers

How to achieve smooth animation when using single-step rotation / How do I get the new frame size at the start of rotation?

I'm trying to switch from two-stage rotation to one-stage rotation (to avoid the console warning, and because Apple recommend doing so because one-stage is faster). However I can't figure out how to get the new size of my view (taking into account…
JosephH
  • 37,173
  • 19
  • 130
  • 154
4
votes
2 answers

Modal without rounded corners?

I would like to create an Modal in iOS without rounded corners - the Modal represents an UIViewController in an UINavigationController. When ill try with: override func viewWillAppear(animated: Bool) { …
derdida
  • 14,784
  • 16
  • 90
  • 139
4
votes
0 answers

How to get notifications when view controller is presented modally

We're developing an SDK for external usage. One of the requirements is that we build a history detailing how the user progresses through the application, ie., what view controllers are displayed. Since this is being provided as an SDK, we really…
David Berry
  • 40,941
  • 12
  • 84
  • 95
4
votes
0 answers

UIVisualEffectView creating unwanted shadow while presenting new view

In my custom presentation transition I've created a new view controller which will pre presented on top of the current active view controller (see screenshot). Somehow there's a shadow behind the blue view controller and I have no idea where it's…
Henny Lee
  • 2,970
  • 3
  • 20
  • 37
4
votes
1 answer

iOS - Child View Controller Having "Strong" Reference To Parent View Controller

I've read a lot about retain cycles. When necessary, a parent UIViewController should always have a strong reference to its child UIViewController while the child should have a weak reference to its parent. Is this ONLY when they're referencing…
Rafi
  • 1,902
  • 3
  • 24
  • 46
4
votes
1 answer

How to use external datasource in UITableView

I have a UIViewController in which I've embedded a UITableView. If added an outlet to my ViewController class. Because I don't want the ViewController to get too heavy, I would like to put the methods of the UITableViewDataSource protocol and…
productioncoder
  • 4,225
  • 2
  • 39
  • 65
1 2 3
99
100