Questions tagged [viewdidappear]

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

255 questions
49
votes
5 answers

react-navigation: Detect when screen, tabbar is activated / appear / focus / blur

Perviously when I wanted to make some actions when screen is opened I put them inside componentDidMount. For example I can fetch some data. like this. componentDidMount() { this.updateData(); } But with react-navigation componentDidMount occurs…
rendom
  • 2,217
  • 5
  • 29
  • 43
42
votes
3 answers

Unable to set frame correctly before viewDidAppear

I was wondering if anyone knows why when you set the frame of a subview in viewDidLoad and viewWillAppear the changes do not take affect on the screen, but if you set it in viewDidAppear they do? In my case I am loading a custom xib with two…
nacross
  • 2,053
  • 2
  • 23
  • 34
35
votes
3 answers

viewDidAppear for UITableViewCell

I usually use viewDidAppear method to do some UI stuff on the view after it finished appearing and I used this method in various situations were it was very useful, however, I need to do some UI changes on a UITableViewCell after it finished…
JAHelia
  • 4,684
  • 14
  • 52
  • 102
34
votes
8 answers

Remembering scroll position on UITableView

I have a bit of a problem with my iOS app in xcode. I have a UITableView that loads a few hundred cells. When I scroll down to a specific cell and drill down to detailedviewcontrollers and return again the master view table has returned all the way…
mylogon
  • 2,283
  • 2
  • 24
  • 39
33
votes
3 answers

Android's viewDidLoad and viewDidAppear equivalent

Does Android have an equivalent to Cocoa's viewDidLoad and viewDidAppear functions? If not, then how would I go about performing an action when a View appears? My app is a tabbed application, in which one of the tabs is a list of forum topics. I…
Code Slinger
  • 1,048
  • 1
  • 12
  • 16
27
votes
8 answers

How to do some stuff in viewDidAppear only once?

I want to check the pasteboard and show an alert if it contains specific values when the view appears. I can place the code into viewDidLoad to ensure it's only invoked once, but the problem is that the alert view shows too quickly. I know I can set…
Allen
  • 6,257
  • 4
  • 38
  • 54
25
votes
3 answers

Do I programmatically add SubViews in ViewDidAppear, ViewDidLoad, ViewWillAppear, the constructor?

I'm trying to figure out from Apple's sketchy documentation which method is the best place to be initializing and adding my Views controls to the controller's view. With winforms it's fairly straightforward, as they're always initialized inside…
Chris S
  • 62,476
  • 49
  • 214
  • 238
20
votes
2 answers

Guidelines for viewWillAppear, viewDidAppear, viewWillDisappear, viewDidDisappear

Are there any guidelines for using these methods in the right manner? In particular, I would like to know what type of code I could use inside them. For example, if I have to call a method that retrieves data from a WS, where do I have to call it?…
Lorenzo B
  • 33,006
  • 23
  • 110
  • 185
15
votes
3 answers

Flutter: Lifecycle of a Widget and Navigation

I have written a flutter plugin, that displays a camera preview and scans for barcodes. I have a Widget called ScanPage that displays the CameraPreview and navigates to a new Route when a barcode is detected. Problem: When I push a new Route…
hendra
  • 1,403
  • 2
  • 12
  • 26
13
votes
3 answers

Call Function in Underlying ViewController as Modal View Controller is Dismissed

I have a mainViewController. I call [self pushModalViewController:someViewController] which makes someViewController the active view. Now I want to call a function in mainViewController as someViewController disappears with [self…
Bryan
  • 15,409
  • 22
  • 92
  • 119
8
votes
1 answer

why the viewDidAppear is not calling?

import UIKit import SwiftyDropbox class NotesViewController: UIViewController, UITableViewDataSource, UITableViewDelegate, NotesviewDelegate { var userText:[String] = [] @IBOutlet weak var tableView: UITableView! override func viewDidLoad() { …
7
votes
3 answers

Reload and not reload if press back from different view controllers. Swift

The top three answers can solve my questions. It is hard to pick which one is the best. So, I just pick the one who is the first to answer my question. Sorry for amateur and iOSEnthusiatic. Thank you for your help. I appreciate it. ViewController…
Pak Ho Cheung
  • 1,402
  • 6
  • 19
  • 41
7
votes
1 answer

Swift - Reload UIPageViewController with new information in viewDidAppear

How to reload UIPageViewController in viewDidAppear? There, I refresh information from CoreData and I want to updated values when the view appears. I tried with function reloadInputViews(), but unsuccessfully only when you start to open pages then…
Bogdan Bogdanov
  • 902
  • 8
  • 34
  • 69
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
  • 626
  • 2
  • 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,888
  • 2
  • 36
  • 56
1
2 3
16 17