UIViewController instance method that notifies the view controller that its view was added to a view hierarchy.
Questions tagged [viewdidappear]
261 questions
69
votes
6 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
- 3,417
- 6
- 38
- 49
43
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,013
- 2
- 25
- 37
39
votes
4 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
- 6,934
- 17
- 74
- 134
35
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,100
- 1
- 11
- 16
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,772
- 2
- 28
- 42
29
votes
9 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,745
- 5
- 41
- 59
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
- 64,770
- 52
- 221
- 239
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,216
- 24
- 116
- 190
18
votes
4 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
- 2,531
- 5
- 22
- 34
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
- 17,201
- 24
- 97
- 123
10
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() {
…

Sathish Kumar Gurunathan
- 295
- 1
- 3
- 16
7
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…

Alexander Galkin
- 73
- 1
- 6
7
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,742
- 2
- 21
- 29
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,382
- 6
- 22
- 52
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
- 882
- 11
- 36
- 79