Questions tagged [viewdidappear]

UIViewController instance method that notifies the view controller that its view was added to a view hierarchy.

255 questions
6
votes
5 answers

viewDidAppear called twice in iOS5

I'm developing an app with an UINavigatorController. I am using the method viewDidAppear in the second pushed viewController to find information in an external server. Well. While in iOS5 worked fine at the beginning, I realized that viewDidAppear…
Ibai
  • 558
  • 1
  • 7
  • 20
6
votes
3 answers

UIViewController viewDidAppear - because it was pushed or because subview was popped?

In my app, I have about a dozen different view controllers, pushed onto or popped from the stack in different orders. When a view has appeared (I'm using viewDidAppear method) I need to determine whether this is because this view has just been…
Aleks G
  • 52,841
  • 25
  • 149
  • 233
6
votes
1 answer

When presenting modally over current context, on unwind, viewDidAppear is not getting called

I have an issue with an app I'm developing. XCode version: 9.2 (9C40b) Programming language: Swift 4 Target iOS version for the app: 11.2 Scenario: I have a mainVC (ViewController) which calls a modally presented secondaryVC. After doing a…
Markussen
  • 75
  • 9
6
votes
5 answers

UIAlertController not disappearing

I am not getting what's wrong with my code. I am simply displaying an alert with "Ok" button and when user click on "Ok", then alert should go. But its not getting disappeared. Using Swift3 for programming. Is viewDidAppear() right place to put this…
NGR
  • 1,075
  • 1
  • 13
  • 38
6
votes
1 answer

Difference between viewDidAppear, viewDidLoad in iPhone/iOS?

Bottom line is, I've been working on an app, and it seems that if I place a UIAlert in viewDidLoad, it gets called twice (from a delegate method of UIImagePickerController). If I put it in viewDidAppear, it gets called once. I've looked through…
Sidwyn Koh
  • 1,702
  • 2
  • 21
  • 29
6
votes
4 answers

Correct time to call viewDidAppear manually?

I have a UITableViewController in my app, which is added to the view hierarchy directly. After the view appears, I want to scroll to a specific cell. My solution would be to call the code for scrolling in -[viewDidAppear]. According to Apple's docs…
mrueg
  • 8,065
  • 4
  • 41
  • 66
5
votes
1 answer

UIViewController's viewDidAppear not being called after a modal close

A UIViewController (View A) invokes another view controller (View B) by invoking it as a modal control. [self presentModalViewController:ViewB animated:TRUE]; And View B exists by invoking: [self dismissModalViewControllerAnimated:TRUE]; When this…
AlvinfromDiaspar
  • 5,868
  • 13
  • 63
  • 120
4
votes
3 answers

Make a custom back button for UINavigationController

I'm developping an app for iOS 4.2+. I subclassed my UINavigationController to insert two UIImageView and make the navigation bar look custom. Everything is working great but I have a little problem. I created custom UIBarButtonItem and inside my…
4
votes
2 answers

Is there any viewDidAppear method for UIView (not UIViewController)?

I need to understand when UIView appears on the screen, so I need an analogue of the viewDidAppear method. I found a UIView…
4
votes
4 answers

swift setting properties in viewDidLoad doesn't work but works in viewDidAppear

Latest XCode. I have a project in which in any storyboards/view controller setting properties such as textColor of a UILabel or backgroundColor of a UIButton in viewDidLoad doesn't work but works in viewDidAppear. What kills me is that I can't…
4
votes
2 answers

Swift iOS- How to hide label then make it appear after a certain time period

I have a label that gets hidden when a button is pressed. After a certain time period like 60 secs I want the label to reappear. I'd assume I do that in viewDidAppear, How would i do that? @IBOutlet weak var myLabel: UILabel! override func…
Lance Samaria
  • 11,429
  • 8
  • 67
  • 159
4
votes
1 answer

ViewDidAppear not executed every time app comes to foreground

Im building an IoT app using Arduino board and calling an API to check the updated pin values of the Arduino board. When i receive the update from the API i have to update my button colors to red or green according to the data i'm receiving. First…
Kegham K.
  • 1,449
  • 15
  • 31
4
votes
1 answer

Animating view on viewDidAppear not working correctly - Swift

I am trying to get a view to animate from the centre of the screen, to leave the screen after 1 second when the view loads. The problem I am having is that after a millisecond of the view being in the original (correct) position upon loading, it…
Jon Buckley
  • 117
  • 1
  • 10
4
votes
3 answers

iOS - When a UIView appears on screen what method does it call?

When a UIView appears on screen what method does it call? For example if a have a UIScrollView and I populate it with a hundred views, one under the other, what method is called by the UIViews when they are scrolled such that they appear on…
Zigglzworth
  • 6,265
  • 7
  • 59
  • 101
3
votes
2 answers

iOS Root View Controller's viewDidAppear: called while splash screen (Default.png) still on screen

In my iOS app I want to run a series of operations in my Root View Controller after it has already appeared on the screen. However, it seems that the iOS app is calling viewDidAppear while the splash screen (i.e. showing the Default.png image) is…
Jason
  • 14,035
  • 24
  • 87
  • 151
1
2
3
16 17