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
4
votes
1 answer

SFSafariViewController not in window hierarchy

I am trying to integrate google login inside my IOS APP (with Swift), but every time I run it I get the following warning/error: [10061:521185] Warning: Attempt to present UITabBarController: 0x7db35400 on SFSafariViewController: 0x7b60a2a0 whose…
user3149877
  • 135
  • 1
  • 2
  • 8
4
votes
3 answers

How to continue a function across ViewControllers using Swift?

I have a NSTimer() that starts upon a button click. If I want the timer to be displayed on a label, I can do that within the same view controller, but I would like the timer to continue and the values (1...2...3) to be displayed on the next view…
IvOS
  • 323
  • 3
  • 13
4
votes
2 answers

How get visible / current viewcontroller in non-viewcontroller class? Swift

I have information box object - "Info view". And I wanted to append this view to current VC view, sometimes directly in VC class sometimes outside VC class, ex. in my framework. I don't want always pass current VC in method argument, like class…
Artem Krachulov
  • 557
  • 6
  • 23
4
votes
2 answers

Swift delegate not working

I have a stepper in my ViewController that controls the value of a variable in my UIView. When I reset the variables to 0 in my UIView, I also want the stepper and label to reset, but they won't. I tried using a delegate, but am getting an error. …
Steve
  • 1,121
  • 1
  • 12
  • 32
4
votes
1 answer

How to change the background color of MFMailComposeViewController?

How to change the background color of MFMailComposeViewController? I tried to add mailController.view.backgroundColor = [UIColor redColor]; but the color is still white. Please help.
Cristina Sita
  • 376
  • 3
  • 9
4
votes
2 answers

"Present as Popover" segues and view size

Can anyone point to any guidance/documentation on how items should be placed in a view controller that will be displayed as a popover so that the components are appropriately positioned with auto layout? Specifically: I'm working in Xcode 8.3 with…
Neil Coffey
  • 21,615
  • 7
  • 62
  • 83
4
votes
2 answers

Show ViewController from XIB-file-Button - Swift

is there a way how to segue from a xib-file (custom TableViewCell) to another ViewController in the Main.storyboard. There's no possibility to drag a segue, like within the main storyboard. In the cell I've got a button, from where I want to change…
chrisby
  • 834
  • 7
  • 15
4
votes
2 answers

How return a value from view2 to view1 when using navigation bar

I am New to the iPhone Development. How can i carry a string value from view2 to view1 when using navigation bar. I have no problem in carrying string values from view1 to view2 to view3 to....by using pushviewcontroller But when i come back to…
4
votes
1 answer

How to make a custom Swift popup window on iPhone

I'm wanting to implement a custom popup window within an iPhone app that contains buttons and labels. One solution I've found is to simply create a hidden UIView in the same View Controller (How to make a popup window with an image SWIFT) and then…
ADRSPR
  • 111
  • 1
  • 3
  • 8
4
votes
1 answer

How to start app on another view controller after initial launch?

I'm using Swift. When my app is opened for the first time, I want it to go to the WelcomeController. However, now that the app has been launched once, I want the app to launch on a different view controller. How can I do this?
Schuey999
  • 4,706
  • 7
  • 21
  • 36
4
votes
1 answer

Pass Data Between Two View Controllers Using a Custom Tab Bar Controller Class

I am attempting to pass data from one viewcontroller to another using a Tab Bar Controller. I have implemented a custom Tab Bar Controller class. Here is my code for this class: class CustomTabBarControllerClass: UITabBarController,…
three3
  • 2,756
  • 14
  • 57
  • 85
4
votes
1 answer

child viewcontroller height zero after rotation iOS

I've been searching but can't find an answer to this issue I'm having. It seems fairly fundamental, so hopefully someone can explain, or point me towards a previous post. When adding a viewcontroller's view as a subview of another viewcontroller, I…
Scaroth
  • 187
  • 1
  • 11
4
votes
2 answers

What is the method unarchiveFromFile in GameViewController for?

When I tried to add different scenes to my game in Swift, I encountered the method unarchiveFromFile. The problem with this method is that it only works with the GameScene class. If you call it from extension SKNode { class func…
lisovaccaro
  • 32,502
  • 98
  • 258
  • 410
4
votes
2 answers

add new viewController in xCode 6

I need to add a new viewController (new file h. and m.) using xCode 6 beta. After I go to File > New > File I do not get the option to add an "Object-C class" as I used to do in xCode 5. Doing that I normally got a new h. and m. file appearing in…
Marco Bigatton
  • 41
  • 1
  • 1
  • 2
4
votes
1 answer

Nesting view controllers inside a storyboard

I'm learning how to use storyboards for iOS development and I can't seem to figure out how to manage multiple views on the same screen. I want to be able to control multiple elements on the same screen, for example a UITableView with an UIImageView…
user1177007
  • 57
  • 1
  • 4