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

Could not cast value of type 'AppName.AppDelegate'

I've a ViewController which is named mapViewController. Inside that controller I've a button which is a play button. If the button is clicked a boolean named "Play" will change from false to true. Let's jump to the point of this thread: Once I…
Putte
  • 328
  • 2
  • 17
0
votes
0 answers

I seem to have a retain cycle with a weak delegate

I'm using a networker inside of a view controller. The networker has a weak delegate reference to the view controller. After a view controller is dismissed I kick off a timer to check whether the vc has been released. I noticed that it's not being…
MichaelGofron
  • 1,310
  • 4
  • 15
  • 29
0
votes
1 answer

Use of undeclared type 'PostTableViewCell'

Can't seem to figure out why I'm getting this error. I've attached two pieces of code below, any help is very appreciated private func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: IndexPath) -> UITableViewCell { var…
Tom
  • 13
  • 3
0
votes
1 answer

Detect which viewController presented the SideMenu and implement proper functionality for its presentation

I'm using the following pod for my SideMenu functionality. Now, if I opened it from XYZ viewController and selected the row which again opens the XYZ viewController, the page is being pushed, but instead, I want the SideMenu to be dismissed, no to…
Emma V.
  • 99
  • 1
  • 8
0
votes
1 answer

Can't instantiate view controller Swift

My code worked well so far. I do not see what I could change to make it bug like that. When I want to return the user to the home page, it works, but a few seconds after the previous ViewController reappears on the screen. I've tried to change "as!…
itinous
  • 1
  • 3
0
votes
1 answer

using TabBarController

I'm developing a TabBarController application in iPhone. In the First tab (Lets Say Tab1), I navigate the viewControllers for example (view1, view2, view3), now I'm on view3 of Tab1, then I switch the tab and do some work there. Now when I get back…
Arsalan
  • 3
  • 1
0
votes
2 answers

How to show many view controllers without many xibs

Say I want to show 300 words, one in a page, connected by Swipe Gesture or Button. It is definitely feasible to create 300 view controllers in the storyboard and connect them together. But is there a better/faster way to do this without numerous…
0
votes
3 answers

Add Information / Details to a TableView row

I have a TableView with items on the first ViewController. When I click on a row i perform a segue to display a second ViewController with a TextField on it. Now i want to write Informations to the TextField and link that information to the selected…
Winz
  • 29
  • 8
0
votes
0 answers

Display a viewcontroller in Xcode/swift using if else for login

I want a to have a conditional if statement to be run when the button is clicked. Basically, it will be if CodigoError is different from 0000 i want to stay in the same view controller which is the login, but if it's correct i want to display the…
0
votes
2 answers

Using didSet causes function to be run multiple times

In order to obtain values from a previous viewController, I use a didSet on a structure. class ReviewViewController: UIViewController, UITextFieldDelegate { var detailBuilding: Building? { didSet { configureView() } } override…
RufusV
  • 408
  • 3
  • 17
0
votes
0 answers

Different view controllers loading same text

I am a beginner in swift and programming in general and I am trying to make a quiz app and I want the app to go from a start screen, to s selection menu, and then to the quiz screen. The problem is when I press the second category button, it brings…
0
votes
1 answer

Present View within UITabBarController & UINavigationController Programmatically

We are working on an iOS app, which has a RootVC, where 4 TABs placed programmatically, each Tab has a separate ViewController. One of the Tabs responsible for search. When the user taps the search button on this specific ViewController, we'd like…
0
votes
1 answer

How do I store a calculated result in UserDefaults to display in a "results" View controller

First time poster so sorry for the incorrect format/length of the question. I am building an app in Xcode that allows users to input various inputs among numerous view controllers and then have output in a single view controller with results…
0
votes
1 answer

Can't set delegate between ViewController and SKScene

I want to set delegate between my GameViewController and SKScene file but facing error. My goal is to call method from SKScene file. Error is : Value of type 'GameScene' has no member 'gameViewControllerDelegate' What am i doing wrong ? Thanks in…
Emin Turk
  • 350
  • 3
  • 13
0
votes
4 answers

Please help: UINavigationController and view controllers memory management

I have a strange problem with a method is called each time a button is pressed: - (void)launcherView:(TTLauncherView*)lnchr didSelectItem:(TTLauncherItem*)itm { MyObject* obj = ... MyViewController* detailView = [[MyViewController alloc] init];…
Dmitri Sologoubenko
  • 2,909
  • 1
  • 23
  • 27