Questions tagged [viewdidappear]

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

261 questions
7
votes
3 answers

How can I call the ViewDidAppear only one time?

When the user start the app I want it show the stockholm.xib and It does here: -(void)viewDidAppear:(BOOL)animated{ [super viewDidAppear:animated]; NSUserDefaults *startPage =[NSUserDefaults standardUserDefaults]; NSString *page…
hafhadg3
  • 636
  • 3
  • 7
  • 15
7
votes
3 answers

How to add an animation to the UIView in viewDidAppear?

I tried to add a animation to viewDidLoad and viewDidAppear, but it doesn't work: - (void)viewDidAppear:(BOOL)animated{ [UIView beginAnimations:@"transition" context:NULL]; [UIView setAnimationTransition:110 forView:self.view cache:YES]; [UIView…
Flocked
  • 1,898
  • 2
  • 36
  • 57
7
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,185
  • 4
  • 44
  • 66
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
  • 568
  • 1
  • 7
  • 21
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
  • 56,435
  • 29
  • 168
  • 265
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
  • 164
  • 1
  • 13
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,230
  • 2
  • 15
  • 44
5
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…
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
  • 6,611
  • 13
  • 75
  • 140
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
  • 17,576
  • 18
  • 108
  • 256
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,589
  • 22
  • 40
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
  • 12
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,645
  • 9
  • 68
  • 107
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,517
  • 25
  • 92
  • 153
1
2
3
17 18