[Solved] Calling viewDidLoad in UITextField [closed]

Call generateDummyTransactions() from sendButton’s IBAction method and then fetch the textField’s text there, i.e. class VC: UIViewController { @IBOutlet weak var providerForm: UITextField! @IBAction func onTapSendButton(_ sender: UIButton) { self.generateDummyTransactions() } func generateDummyTransactions() { if let text = self.providerForm.text { //use text here… } } } solved Calling viewDidLoad in UITextField [closed]

[Solved] Why it print out an empty array instead of the array appended with values for the first time in viewDidLoad()?

The call to API.Tag.observeTagPool is asynchronous and it will finish after fetchTagPool() has returned the empty self.tagArr. You need to change fetchTagPool to return the value through a callback function like this: override func viewDidLoad() { super.viewDidLoad() // Note: This will print AA after viewDidLoad finishes // Use trailing closure syntax to pass the trailing … Read more

[Solved] Is it true that using view controllers and viewDidLoad method for implementing my methods? [closed]

You don’t have to use (performSelector:withObject:afterDelay:) all the time ! Say you have two methods implemented in your viewController : -(void) firstMethod { //do stuff here } -(void) secondMethod { //do stuff here } you can call those methods this way : – (void)viewDidLoad { [super viewDidLoad]; [self firstMethod]; [self secondMethod]; } Now what we … Read more