260 questions
0
votes
1
answer
77
views
viewDidAppear Not allowing me to edit IBOutlets [duplicate]
Hi I am very new to swift coding and attempting to make a fake progress bar with the UIProgressView.
I have code in a viewDidAppear so that once the view controller appears it starts but none of the ...
1
vote
2
answers
922
views
Inconsistent behavior in viewDidAppear Objective C
[ViewController] Calling -viewDidAppear: directly on a view controller is not supported, and may result in out-of-order callbacks and other inconsistent behavior. Use the -beginAppearanceTransition:...
-1
votes
1
answer
168
views
Swift - Detect when certain table section comes into view [duplicate]
I have a table with 7 sections - only the first 2 sections are visible when it loads.
To simplify things - how would I print "Now at section 5" when the user scrolls and gets to that section?...
0
votes
1
answer
136
views
Anomaly where previous view shows up briefly before new view is shown
I encountered this bug where my previous view in the NavigationController hierarchy incorrectly shows up briefly before my newly pushed view is loaded. I couldn't diagnose or reproduce reliably. Here ...
1
vote
1
answer
345
views
How to exclude UIViewControllers other than views from Swizzle Method?
I am trying to override viewDidAppear() methods of my custom ViewControllers and i found a solution using swizzle method. It works but when keyboard is visible, my method also gathers Keyboard ...
0
votes
2
answers
415
views
How to implement `viewDidAppear` without NSViewController?
There is a method in NSViewController called viewDidAppear. The docs say:
This method is called after the completion of any drawing and animations involved in the initial appearance of the view.
If ...
2
votes
1
answer
2k
views
Perform function on Dismiss of a View Controller
i am calling a GET(method) API on viewDidAppear function of a view controller. i am presenting a new view controller using navigation controller over my first view controller. on the second view ...
-2
votes
1
answer
87
views
Same optional value is sometimes nil and sometimes not
I have the following in my viewDidAppear:
override func viewDidAppear(_ animated: Bool) {
// Get the index based off of which tableview cell was selected in the last VC
let ...
2
votes
3
answers
927
views
What is the equivalent of viewDidAppear in React Native
Scenario:
I have a Login.js that I show as a Modal from multiple screens wherever I have placed the check to see if a user is logged in or not. After the user successfully login I change a key called ...
0
votes
2
answers
583
views
trigger viewDidAppear in extension or how to use variable from extension in viewController?
Hi I want to put the viewDidAppear in my extension, but it cannot be triggered...
see the code:
extension MyAutoWelcomViewController: VehicleMangerDelegate {
func didUpdateRdwInfo(...
0
votes
2
answers
218
views
Swift: Reload data in UITableView element triggered in an external class
I'm trying to call the reloadData() method to update a table view in an external class (different view controller), using the method viewDidDisappear().
I can already update the table view when the ...
0
votes
1
answer
68
views
UIPageViewController jump directly to page causes issues with instance variables
I'm rather new to Swift, having coded in JavaScript so much more, so I must be missing something subtle here. I have a UIPageViewController that controls 3 pages, and each page has a particular ...
1
vote
1
answer
44
views
create if statement based on certin time not working in view did appear
I want my codes background uiviewcontroller background to change depending on the hour. If the code is in the first 60 minutes of the day the background color works. However when the time goes to the ...
0
votes
0
answers
110
views
How do I set the text of a label from outside of viewDidAppear?
I'm writing a Mac (Swift) application on Xcode which gets data from a command and asynchronously changes the stringValue of some text in the window. I already figured out the asynchronous part from ...
0
votes
1
answer
306
views
viewDidLoad vs viewWillAppear vs viewDidAppear parts of this code
I am trying to work on this piece of code from a project I downloaded and trying to use in my code.
In the viewDidLoad, a pickerView is populated either by "New Puzzle" or if a user saved a game in ...
1
vote
1
answer
820
views
Presenting View Controller is too slow
I have implemented a Firebase Google login into my Swift App. I want to check in the beginning if its already a logged in user or not. I do this like that:
override func viewDidLoad() {
super....
1
vote
0
answers
72
views
Swift UITableView cellForRowAt indexPath doesn't get called on tableView.reloadData() after view appeared for second time
The summary of my problem is; when the tableView.reloadData() is called upon firestore's local changes on the first time the view loads up it works and updates as it supposed to. However, after I ...
0
votes
2
answers
101
views
problem with image animation in viewDidAppear(), any advice?
I am trying to create an animation that scrolls through a series of images. The following code does not have any animation and only the last image of the series appears on the screen. How do I fix ...
0
votes
1
answer
41
views
userDefualt not saving switch when class is segued
My swift code below which is all code no storyboard. Tries to save a switch's state using user defaults. So when the user segues to twoViewController and then segues backs to ViewController. The users ...
0
votes
1
answer
179
views
How to programmatically set a slider that controls a image views width
My code below is written in all code no storyboard. What I want to do use the slider move to change the width of the imageView pic. What I have tried below does not work. When the slider moves I want ...
-1
votes
1
answer
61
views
[Swift]: Appending NEW ITEMS ONLY to local Arrays for TableView after dismissing Previous View Controller via ViewDidAppear()
I am using parse server to pass data to TableViewController.
I am able to retrieve data and append to my local arrays using parse. The arrays use a tableView. I have another ViewController called ...
0
votes
0
answers
265
views
table.reloadData() not refreshing table when switching tabs (Swift)
I am creating a simple to do list for iOS in xcode and I have run into a problem when trying to get the table view to reload when tabs are switched. I have written this into the view controller:
...
0
votes
1
answer
113
views
Call Back in UITabBarController
I have a UITabBarController and a class named it ScreenLocker, in UITabBarController/ViewDidApear I initialize ScreenLocker with a call back, screen locker after c second or when app going to ...
-1
votes
1
answer
156
views
How to remember a ViewController's last activity when returning to it?
I'm going to try to be very detailed about this, and I hope one of you guys can help me out.
I have a Home VC with 2 lists stacked on top of each other, list #1 always shows up on top. However, if I ...
0
votes
3
answers
1k
views
setup func can't change backgroundColor in a viewController
I actually use this to switch from a ViewController to another
let vue = MAINSTORYBOARD.instantiateViewController(withIdentifier: "addhoraire") as! Addhoraire
self.present(vue, animated: true,...
0
votes
0
answers
55
views
My method is executed in twice when in view didappear
My method is executed twice when in viewdidappear()
Code
override func viewDidAppear(_ animated: Bool) {
getaccountdetails()
}
func getaccountdetails(){
if let sumacheck=...
2
votes
1
answer
285
views
UITextField underline width issue
I have a UITextField & UIButton placed inside a vertical UIStackView. Programatically, I've added a UIView to serve as an underline of the UITextField.
The problem comes when I compile the code. ...
0
votes
0
answers
36
views
I presented firebase AuthViewController in viewDidLoad and getting this error. What's the reason?
Warning: Attempt to present
on whose view is not in the
window hierarchy!
I presented firebase AuthViewController in viewDidLoad and getting this error. But when I present that ...
8
votes
2
answers
8k
views
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 lifecycle:
willMoveToSuperview
invalidateIntrinsicContentSize
...
0
votes
3
answers
190
views
viewDidLoad and viewWillAppear Uses
As per my understanding, viewDidLoad() is called when the view is created and used for things that need to happen once whereas viewWillAppear() is used for tasks that require to repeat every time a VC ...
4
votes
4
answers
737
views
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 ...
0
votes
0
answers
230
views
Delay between viewWillAppear and viewDidLoad after entering foreground
A delay of 2 seconds occurs between viewWillAppear and viewDidAppear only in one screen when application comes back from the background. Normally, there isn't a delay in this screen when the app is ...
0
votes
1
answer
42
views
Events not triggering anymore in parent ViewController when dismissing a child ViewController
I have a custom UIView built using several UIButtons. In the viewDidAppear function of a ViewController I take the subviews of this UIView and attach an addTarget to them. Everything works as expected ...
0
votes
1
answer
41
views
What is the proper way to update a news feed that frequently appears and disappears?
I appreciate the many entry points the iOS SDK offers for developers to update their UI...(viewDidLoad, viewWillAppear, viewDidAppear, UIApplicationDidBecomeActive, etc.) but oftentimes I wonder if I ...
1
vote
1
answer
287
views
Hiding an overlayed button on a Tab Bar
I am newbie in iOS and Swift. I am currently working on an application where I am required to show a tab bar with a big button in the center. Given the time constraints, what I have done is I created ...
0
votes
1
answer
171
views
UITableView display and reload behavior is out of sync
I've looked at other UITableView questions, but did not find any that matches this scenario.
I have a normal UITableViewController that accepts an array from a search form (IOW, dynamic data). The ...
70
votes
6
answers
122k
views
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();
}
...
19
votes
4
answers
15k
views
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 ...
1
vote
1
answer
997
views
navigationController?.navigationBar.isUserInteractionEnabled not working as expected
For the following viewController hierarchy, isUserInteractionEnabled doesn't appear to be working as expected.
NavigationController(ViewController A) --- pushes to ---> NavigationController(...
1
vote
1
answer
759
views
change text in arkitview via button(swift4)
My code uses arkit. All I want to do is when I change the text of the label. The change is reflected in the arkit text. Currently its not. Whatever the arkit label stays and default and never changes ...
3
votes
3
answers
1k
views
Presenting a specific view controller once immediately after launch screen closes
I have a 1-screen tutorial View Controller. I want this tutorial VC to show only once (userdefaults), but I want a smooth transition from when the launch screen finishes -> tutorial VC.
Right now - ...
0
votes
1
answer
35
views
On the value of the structure of the issue
When using input structures to create multiple save arrays, do not display the array in a custom cell.
The following is the initialization settings
struct LearnList {
var Title:String
var ...
0
votes
1
answer
137
views
Rewind segue doesn’t trigger viewdidappear
As the title goes, I have 2 view controllers connected by 2 buttons. On the first view controller, it modally segues to the second view controller via a button. On the second view controller, there is ...
7
votes
1
answer
3k
views
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 ...
2
votes
1
answer
5k
views
Flutter: Focus keyboard on back navigation
I want to focus a textField after the user navigated back with the back button in the navigation bar. How do you do that? I tried the autofocus property of the TextField widget. But this only works ...
0
votes
1
answer
173
views
UI Code in viewDidLayoutSubViews doesn't render correctly at runtime
I have recently been battling with my view controller to set the correct dimensions of a border on a UIView.
*edit, this is for a static tableview (i am using it as a form). I am aware of rounding ...
0
votes
2
answers
247
views
Can we only configure UI correctly in viewDidAppear? and not in viewWillAppear/viewDidLoad?
I have a static table view with cells that have a rounded border. I have noticed when testing on different simulators that whilst my auto layout constraints work, the border isn't always the right ...
-3
votes
1
answer
864
views
ViewDidAppear animation false
I wanted to disable animated in viewDidAppear. I've set the code below but it shows me this error:
"cannot assign to value: 'animated' is a 'let' constant"
override func viewDidAppear(_ animated: ...
0
votes
1
answer
156
views
presentViewController called infinitely in viewDidAppear
I am trying to implement a fullscreen UIImagePickerController in my app. I couldn't present the view controller in viewDidLoad because presenting view controllers on detached view controllers is ...
0
votes
1
answer
52
views
Where to call function Fill Chart Array to reduce loading time?
I am using iOS-Charts and I have a ViewController where I call the function that fills the data for the chart.
Currently I call it in from ViewDidAppear, but it takes quite long to load. Where is ...