Questions tagged [viewdidload]

Method in UIViewController class (Apple iOS SDK) for managing the view. Called after the controller’s view is loaded into memory.

This method is called after the view controller has loaded its associated views into memory. This method is called regardless of whether the views were stored in a nib file or created programmatically in the loadView method. This method is most commonly used to perform additional initialization steps on views that are loaded from nib files. Available in iOS 2.0 and later.

722 questions
1
vote
3 answers

Load data after viewDidLoad

I have a viewController that requires I load a whole series of images and display them on the screen, but loading those images in viewDidLoad takes a while and there is a delay before the view appears on screen. Is there a way that I could load just…
RanLearns
  • 4,086
  • 5
  • 44
  • 81
1
vote
1 answer

How to fix indexPath error in viewDIdLoad?

I have problem with indexPath.row. Inside the cellForRowAt this lines work perfect: let cell = tableView.dequeueReusableCell(withIdentifier: "MenuViewCell", for: indexPath) as! MenuViewCell let item = converters[indexPath.row] …
Ivan Kisin
  • 385
  • 1
  • 3
  • 12
1
vote
4 answers

viewDidLoad is not being called while pushing a viewController

Here am trying to navigate to another viewController by clicking on a button. It is navigating to next viewController, but viewDidLoad() is not calling here Here is the code which i wrote to navigate to another viewController on clicking on a…
1
vote
2 answers

Documentation on not calling viewDidLoad directly?

The [UIViewController viewDidLoad] method is called by the system after loading the associated view (obviously?). A common belief -- which I share -- is that viewDidLoad should not be called directly †. However, I can't find this guidance in the…
Clay Bridges
  • 11,602
  • 10
  • 68
  • 118
1
vote
1 answer

I want to make call in viewdidLoad

I want to make call to any number as soon as viewdidload is called ?
Ali
  • 10,774
  • 10
  • 56
  • 83
1
vote
2 answers

Is it possible to prepare/reset a scene before it is shown / before viewDidAppear / viewDidLoad?

I am having a viewController with a couple of animated buttons, when the user presses a button the background is blurred (animation) and a menu to choose a couple of things (which all go to a new viewController) is presented. So basically there is…
RjC
  • 827
  • 2
  • 14
  • 33
1
vote
1 answer

iPhone - viewDidUnload/viewDidLoad called inconsistently

I was doing some testing and debugging of my Iphone app today and encountered some strange behaviour. In my MainView I have two modal views and when showing one of these using presentModalViewController I noted that the viewDidUnload method of my…
pajevic
  • 4,607
  • 4
  • 39
  • 73
1
vote
0 answers

Present an animated view on top of initial view controller on startup, but not any other time the initial view controller loads?

When my app is starting up I'm showing the default LaunchScreen.storyboard and then I'm transitioning to a view controller StartupAnimation containing an animation whose first frame is identical to LaunchScreen.storyboard so that the transition…
Austin Berenyi
  • 1,013
  • 2
  • 13
  • 25
1
vote
4 answers

How to constantly get the x-position of an moving object in swift?

I have to buttons leftbutton, rightbutton both of them being SKSpriteNode(). When the user touches one of the buttons, there is a little ship that moves left and right as long as the user holds the touch. Now I need a function or anything else that…
Jush KillaB
  • 151
  • 1
  • 11
1
vote
3 answers

PickerView Default row selected but returns zero unless the picker view is moved

In my picker view I want the default row to be zero. This row has a value of 1. I want to be able to touch nothing on the view contoller except a button. I know there are similar questions but they did not work for me. override func…
Michael R.
  • 25
  • 9
1
vote
1 answer

viewDidAppear() not being called when home button is pressed then launched again

I notice that viewDidAppear is not being called when the home screen is pressed and then launched again. This is why my animation stop working after I press the home button and then launch my app again. Is there any way to fix this? override func…
Andy
  • 169
  • 10
1
vote
1 answer

ViewDidLoad is always called

I just recently started to use Swift and am facing a "weird" bug with the viewDidLoad method. My very simple app currently only has 2 viewcontrollers: MainViewController, which is the Apps entry point and serves as an overview for the data which…
Kai
  • 13
  • 4
1
vote
1 answer

iPhone view loaded many times... but never unloaded?

My iPhone app is based on a common "utility template" like Apple's own Weather app. I click on the info-button and it flips the screen around. I click on my done button... and it flips back. That part all seems to work ok. I've placed NSLog()…
Patricia
  • 289
  • 3
  • 6
1
vote
1 answer

ViewController in Xcode Playground - frame reporting double sized (viewDidLoad)

I am using a UIViewController subclass in an Xcode Swift playground. The view of the controller is apparently reporting as double-sized. Am I doing something wrong or did I stumble into a bug? When I place a yellow subview of half the width into the…
bshirley
  • 8,217
  • 1
  • 37
  • 43
1
vote
2 answers

viewDidLoad vs viewDidAppear - Name Label issues

I'm having this problem regarding the displaying and updating of the username label. User id 1 - ‘Felicia’ User id 2 - ‘Sam’ (1st screen: default user is 'Felicia') (2nd screen: when change user to 'Sam') (3rd screen: after clicking to another…
Meebfel
  • 63
  • 1
  • 13