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

Adding admob to base appdelegate so it can be persistent thoughout all views

I want to add admob to the base app delegate so that I can have a persistent ad that will show though out all views instead of refreshing the every time i change the view Controllers. "bannerView_.rootViewController = self;" is the problem i do not…
MrSavage
  • 41
  • 2
4
votes
3 answers

Alternative for ViewBag in MVC3

I have a MVC3 web application where I need to implement a database search functionality. I am creating a ViewModel class for my search form so that I get the search parameters from View to controller. I can successfully get all my search parameters…
ACS
  • 443
  • 4
  • 15
4
votes
2 answers

Can I skip creating a separate pointer when setting my viewController?

Why do I need to create a pointer just to allocate memory and then release it immediately? In other words, can't I just do this: self.viewController = [[HelloWorldViewController alloc] initWithNibName:@"HelloWorldViewController" bundle:[NSBundle…
Matt
  • 685
  • 1
  • 8
  • 16
4
votes
1 answer

programmatically present a new view controller in swift/programmatically give a class an Identifier

I've already created a simple app that uses the storyboard to present a new page/class. However, I would like to do the same thing, programmatically. My initial ViewController.swift file looks like this: import UIKit class ViewController:…
VK1
  • 1,676
  • 4
  • 28
  • 51
4
votes
2 answers

UIView setCenter problem

I'm having a lot of trouble doing something very simple. I have a viewController and a subViewController, both with views loaded from nibs. For clarification the parent view is sized 1024 by 748 and the subView is 640 by 480 in the nibs. On the…
donalbain
  • 1,158
  • 15
  • 31
4
votes
2 answers

What goes in the View and what goes in the View Controller?

I am new to programming for the iPhone and this will be my first question here. I have experience with different languages like php/java/c++. My question is about ViewControllers and views in iOS. I have started a project which will contain several…
Jasper
  • 175
  • 1
  • 1
  • 7
4
votes
1 answer

How can i set a new Root viewController in Swift 4?

I am a rookie in Swift. I have a initial viewController within a navigationController. Inside that is a tableView. When i click on the add button item in the NavigationBar a new viewController is present modaly. Now i click a another button in the…
Jurie
  • 117
  • 1
  • 7
4
votes
0 answers

How to open a specific view controller from a button on today extension

I am trying to open a specific view controller by tapping a button on my today extension. But it only takes me to my initial view controller but I need to go to my second view controller. Here is my code when the button taps @IBAction func…
Nathan Lorenz
  • 153
  • 1
  • 11
4
votes
3 answers

Same view controller loads twice

I've read several posts on this issue but none of them solved my problem. I'm coding an app where I have to click on a button ("Prepare") to go to the following ViewController. When the button is clicked, it also passes data between the two view…
BedWolf
  • 43
  • 1
  • 4
4
votes
3 answers

Implement swipe to navigate back with no navigation bar in Swift 3.0

Here is my view controller: I have no navigation bar but a back button which takes user back to previous view controller. What i want to implement is swipe to navigate back. I have searched a lot but did not find any help with proper description.…
user7950465
4
votes
4 answers

Swift 3 / Xcode 8.2 - switch view in viewDidLoad not working

I want to switch the ViewController on load when the user is already logged in. The problem: The view didnt change when user is equal to "true"... Thank you in advance!! override func viewDidLoad() { super.viewDidLoad() var user: String? …
KMax
  • 65
  • 1
  • 6
4
votes
1 answer

Dismiss all none current views

I have been following along a video tutorial that is teaching me about programmatically creating an iOS App without storyboards. It is going well and I like most of the things about it, however I have a slight problem. I am only half way through and…
JamesG
  • 1,552
  • 8
  • 39
  • 86
4
votes
2 answers

How to get parent View/Fragment from a Control

How can I retrieve the View/Fragment a sap.ui.core.Control belongs to? BR Chris
cschuff
  • 5,502
  • 7
  • 36
  • 52
4
votes
3 answers

Presenting AVPlayerViewController StatusBar Makes UI Jump

On button press I'm presenting an AVPlayerViewController: func playVideoPressed(sender: UIButton){ let videoURL = NSURL(string: "someUrl") let player = AVPlayer(URL: videoURL!) let playerViewController = AVPlayerViewController() …
4
votes
1 answer

Pass data back from a popover view controller on iPhone

How can I pass data back from a PopoverViewController to the main view controller on an iPhone? I know I'm doing something terribly wrong but I cannot figure it out. Here is the code: PopoverViewController.swift protocol…
fs_tigre
  • 10,650
  • 13
  • 73
  • 146