Questions tagged [viewcontroller]

viewcontroller is a design pattern which is a hybrid of the view and controller components of the MVC architecture

A viewcontroller responds to events by dispatching calls to a mapping table which matches views and controllers with each event target. It is implemented as an object in many frameworks, including:

2792 questions
3
votes
3 answers

Swift - How to get notified after removeFromSuperview() has been called?

I have two view controllers. The firstVC is being loaded when the app launches, then if a certain button was tapped then secondVC is being called using this code: let popOverVC = UIStoryboard(name: "Main", bundle:…
Marton Zeisler
  • 199
  • 3
  • 15
3
votes
1 answer

MVVM with inheritance between views and viewcontrollers

How can we extend a view with ExtJs MVVM pattern ? What is the correct way to extend a view that has a viewcontroller bound to it ? I have a base view with its viewcontroller, and I would like to extend it, like in this fiddle. The problem is that…
Lorenz Meyer
  • 19,166
  • 22
  • 75
  • 121
3
votes
2 answers

How to pop the previous view controller from a navigation stack?

I use the navigation controller to push from view to view, but I don't pop any of the views that I push. So as I load a view I would like to pop the previous one from the stack. Code for pushing views: var identities = [String]() identities = ["A",…
3
votes
1 answer

IOS: first tap not working just after loading view

I have noted recently that each of my app view has one particular bug/behaviour: if user taps too fast on a UI component when the view appears, the tap is simply ignored. If the user wait a bit before tapping, the tap works. Storyboard is used for…
stephane
  • 172
  • 14
3
votes
0 answers

UIPageViewController in Container not displaying other View Controllers

Ok, could someone please help with my Swift code that I'm trying to fix. I have read other question on here similar to mine but to no avail unfortunately. The problem is that I have a UIPageViewController in a Container but when I test it on the…
3
votes
3 answers

Swift 3 - Close current ViewController and Open new ViewController

I've gone through a tad amount of SO posts about this but none of them clearly state how to get this done in Swift 3. Simply put, I need to close the current view that is displayed and open a new view controller. Such that the only view controller…
Jay
  • 4,873
  • 7
  • 72
  • 137
3
votes
1 answer

Setting UILabel text from rootViewController

I have two view controllers 1.rootviewController 2.myStatusDisplayViewController. I have c stack call back function which returns a c string.That particular call back function calls a function in my rootviewcontroller. In my rootview controller I…
Jeeva
  • 1,791
  • 2
  • 23
  • 42
3
votes
0 answers

Resizing height of formsheet presentation on an iPhone

By using UIAdaptivePresentationControllerDelegate, I was able to get a view controller presented in the style of form sheet. Setting the preferredContentSize can change the width of the vc but not the height, why? screenshot of preferredContentSize…
3
votes
2 answers

Calling parent View Controller function from a subview

I have a parent ViewController with two subview controllers. When I load the parent view controller it will display two of the subviews. I can also swipe left or right to slide subviews. I now have a requirement to add a button on subviews. On…
confused human
  • 401
  • 8
  • 23
3
votes
3 answers

ViewController segue and login

I'm new to Swift (and programming in general). I'm having some difficulties in Xcode with the login feature. What I want is that the user should be logged in if no errors was returned and the user should be sent to another controller. I've read some…
Joesoes
  • 31
  • 1
  • 8
3
votes
5 answers

Segue from LaunchScreen to a viewController in Main.Storyboard?

I got some logic I want to do in my LaunchScreen, and if the check is alright, I want to segue to a viewController and if not I want to segue to another, is that possible?
Recusiwe
  • 1,594
  • 4
  • 31
  • 54
3
votes
1 answer

Dismissing view controllers

If I switch between several views in my app only by using presentViewController or pushViewController and without using dismissViewController or popViewController, Can I dismiss presented view controllers at a later stage ? Thanks in advance for any…
3
votes
1 answer

How to transfer/display an image from CollectionView to another ViewController

I have looked up many examples and tried to incorporate but have been unsuccessful. In my CollectionView (That has been placed in a ViewController), I'd like to select a cell and push the cell image to another ViewController. The images have been…
Ojay
  • 61
  • 12
3
votes
4 answers

how to get a viewcontroller's storyboard id/name

In my app, there are three storyboard. What I'd like to know is how to get a storyboard id/name in a viewcontroller code since UIStoryBoard init func takes first parameter name: String. where it stored and how to access it?
user584819
  • 1,509
  • 3
  • 12
  • 8
3
votes
2 answers

Combined View Controller? Or TableViewController with multiple sections?

I am pretty new to iOS application development (primarily a game developer so I use Unity more than anything) ... So I have been searching for this answer in multiple places and perhaps I dont even really know how to properly ask it but I will try…