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

Changing UIButton From different ViewController

i need to change UIButton(status, title) from another UIViewController i tried the below import UIKit class ViewController: UIViewController{ @IBOutlet var B1: UIButton! @IBOutlet var B2: UIButton! override func viewDidLoad() { …
0
votes
0 answers

ViewController reference not being maintained

I have a service class, AuthManager, that has a method in it as below: public func logoutAuth(from viewController: UIViewController, completion:((_ result: Bool) -> Void)? = nil) { let logoutString = "\(self.oAuthBaseServerURL)/logout.jsp" …
steventnorris
  • 5,656
  • 23
  • 93
  • 174
0
votes
1 answer

Why "ARFaceTrackingConfiguration.isSupported" statement is in AppDelegate, not in ViewController?

Why do ARKit engineers put ARFaceTrackingConfiguration.isSupported statement in AppDelegate.swift file but not in ViewController.swift file? class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? func application(_…
Andy Jazz
  • 49,178
  • 17
  • 136
  • 220
0
votes
1 answer

How to load UIViewController XIB inside another ViewController?

I am trying to add a UIViewController XIB to an existing ViewController, trying to create this: I have a simple ViewController and then I made a UIView with XIB... and now I am trying to use it in the new ViewController: let myVC =…
user11199876
0
votes
3 answers

Populating textField from global variable fails

I am fairly new to Swift and I am using Adafruit's Basic Chat iOS app https://github.com/adafruit/Basic-Chat that uses BLE and I am adding my own viewController and pushing that instead of the one Adafruit provides. My ViewController…
Ross Satchell
  • 341
  • 4
  • 14
0
votes
1 answer

Cannot connect Collection View to View Controller Code. 'Error unrecognized selector sent to instance'

I am trying to add a collection view to my custom view controller called "cardsViewController". When I run the build, I get the error [UIViewController collectionView:numberOfItemsInSection:]: unrecognized selector sent to instance I have connected…
theboneman14
  • 41
  • 1
  • 8
0
votes
0 answers

Exit function unintentionally dismissing two view controllers instead of one

My app has three screens: an Intro, a Main, and Calculator. Calculator is presented modally from Main. When dismissing Calculator, I want to return to Main. Instead, Calculator is dismissed and then Main is also dismissed automatically, returning…
0
votes
1 answer

In Swift code my Label is not showing up in my ViewController

When the ViewController is displayed on the phone the Label is not displayed I am new to iOS and swift, I have search YouTube extensively to no avail. In the code you can see I have made two attempts to add two labels. Not that none are showing. The…
MyerJ
  • 3
  • 3
0
votes
0 answers

Side menu drawer returns self.navigationController as nil

I want to push UIViewController on my NavigationController but when try to do it it says that NavigationController is nil. and hence i'm not able to push any view controllers on the stack. Although i can push more view controllers by clicking any…
Jaswant Singh
  • 9,900
  • 8
  • 29
  • 50
0
votes
2 answers

How to resize/fix constraints for circle on XR phone

My picture for user profile looks fine (a circle) on older versions, but it looks like an oval on my friend's XR phone. I am not sure why. Below are pics of the storyboard constraints and my code for the constraints. Oval Shaped Profile…
Elizabeth
  • 143
  • 3
  • 14
0
votes
1 answer

Reset ViewController when tab bar icon is clicked

I have 3 items in my tab bar, each linked to a separate viewController, and I want them to reset each time I switch between any of these items. How can I do this?
Luke B
  • 288
  • 2
  • 5
  • 18
0
votes
0 answers

View controller is obscured when pushing a navigation controller

I have a navigation controller and a view controller inside of the navigation controller. The view controller calls the navigation controller to push a view: `MYVC *myvc = [MYVC new]`; `[self.navigationController pushViewController:myvc …
MichaelGofron
  • 1,310
  • 4
  • 15
  • 29
0
votes
1 answer

Trouble Passing Variable Info to First VC Using Closure

I am trying to pass the data of which name was selected by the user in my ShipViewController to my ProfileViewController. I tried using closures to do so, but the title of the button in ProfileViewController (which presents the modal popover to…
Aza
  • 63
  • 10
0
votes
1 answer

Passing a huge 2d array between 2 view controllers

I usually use a segue to pass some data between 2 ViewControllers. But now I have a 2D array (About 40Meg of data and in the future it may go to over 100Meg. It's a .json file). I read a few articles that tell all the different ways. But most ways…
claudej
  • 3
  • 4
0
votes
0 answers

Transferring Image (Downloaded from Firebase) into collection View Cell on home Page

Im trying to transfer an image between two view controllers. It is a profile image of the current logged in User, if there is one. The image is successful in downloading from Firebase. It downloads on a launch screen along with the username. If…