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 controller i am calling an API of Post Method to add another entry into my previous screen Get method API. But when I dismiss the second View Controller the Get API data remains the same and when i again runs the code the data was updated on the first view controller. Can someone tell me that how to check on first view controller that my second view controller is dismissed so that i can call API there.
Perform function on Dismiss of a View Controller
1k views Asked by Taimoor Arif At
1
There are 1 answers
Related Questions in SWIFT
- Navigate after logged in with webservice
- URLSession requesting JSON array from server not working
- When using onDrag in SwiftUI on Mac how can I detect when the dragged object has been released anywhere?
- Protect OpenAI key using Firebase function
- How to correct error: "Cannot convert value of type 'MyType.Type' to expected argument type 'Binding<MyType>'"?
- How to share metadata of an audio url file to a WhatsApp conversation with friends
- Using @Bindable with a Observable type in SwiftUI
- How to make a scroll view of 9 images in a forEach loop open on image 6 if image 6 is clicked on from a grid?
- Using MTLPixelFormat.rgba16Float results in random round-off errors
- Search and highlight text of current text in PDFKit Swift
- How is passing a function as a parameter related to escaping autoclosure?
- Actionable notification api call not working in background
- Custom layout occupies all horizontal space
- Is it possible to fix slow CKAsset loading on Cloudkit?
- Thread 1: Fatal error: Unexpectedly found nil while implicitly unwrapping an Optional value - MapView.isMyLocationEnabled
Related Questions in VIEWDIDLOAD
- Ignoring actions with views in viewDidLoad
- Get rid of duplicate code of three UIViewController
- Swift Call ViewDidLoad Manually
- Change map pitch as zoom level changes in Mapbox
- View Controller lifecycle methods are not called after init()
- collectionView doesn't reloadData in viewDidLoad but it works in viewWillAppear
- Problems with Optionals
- Swift init of class
- save a image into binary data by creating a image object
- Swift OSX- View Loading Late (viewDidLoad) (applicationDidFinishLaunching)
- Swift inheritance carrying over constraints
- Multiple Labels displayed programmatically
- Perform function on Dismiss of a View Controller
- viewDidLoad() not called
- iOS 15 Beta keyWindow not available in viewDidLoad
Related Questions in PRESENTVIEWCONTROLLER
- How to present a view in didReceiveRemoteNotification?
- why preferredContentSize doesn't work when presenting UIViewController with PresentationStyle = .formSheet
- Swift: Trying to dismiss the presentation controller while transitioning already
- Navigation between two VIPER Routers doesn't work unless I dismiss
- Custom present transition for 2 nested view controllers with 2 simultaneous animations?
- Navigation controller issue after presenting a view controller
- UIView which is added as subview in UIWindow is not visible in the presented view controller
- How do I show a new/additional NSViewController in swift macOS App with no modal
- How do you dismiss the previous view controller or a controller that I want from another view controller?
- Interactive background (presenting) view controller when presenting pageSheet
- Display Transparent View on Top of Default Numeric Keyboard
- Show WebView ViewController through the xib View
- Make custom-triggered UIColorPickerViewController hug bottom of screen?
- Swift storyboard cross dissolve transition flashes different view controller
- Presenting a ViewController based on previous selected TableView Cell (Programmatically, no Storyboard)
Related Questions in VIEWDIDAPPEAR
- Inconsistent behavior in viewDidAppear Objective C
- Swift - Detect when certain table section comes into view
- Anomaly where previous view shows up briefly before new view is shown
- How to exclude UIViewControllers other than views from Swizzle Method?
- How to implement `viewDidAppear` without NSViewController?
- Perform function on Dismiss of a View Controller
- Same optional value is sometimes nil and sometimes not
- What is the equivalent of viewDidAppear in React Native
- trigger viewDidAppear in extension or how to use variable from extension in viewController?
- Swift: Reload data in UITableView element triggered in an external class
- UIPageViewController jump directly to page causes issues with instance variables
- create if statement based on certin time not working in view did appear
- How do I set the text of a label from outside of viewDidAppear?
- viewDidLoad vs viewWillAppear vs viewDidAppear parts of this code
- Presenting View Controller is too slow
Related Questions in DISMISSVIEWCONTROLLER
- How do you dismiss the previous view controller or a controller that I want from another view controller?
- Swift 5: Unbalanced calls to begin/end appearance transitions for xxViewController when i try dismiss views
- Perform function on Dismiss of a View Controller
- how to make a show a new controller after closing another controller?
- fullScreenCover Dismiss with Drag SWIFTUI
- iOS get notified in parent viewcontroller when presented viewcontroller is dimissed
- How to close multiple viewcontrollers in one time?
- Dismiss and popViewController not working when presentingViewController is UITabbarController
- How to dismiss multiple present view controllers?
- Dismiss a View Controller and present a new one in the same method - swift
- Showing ViewController's View when animating upper ViewController
- Stop Dismissing UIViewController While User finished Action in UIAlertControl
- How to dismiss viewcontroller and pop to root viewcontroller swift?
- Swift: Call a method from ViewController1 after dismissing ViewController2
- Close a modal view with a button in Swift?
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
Popular Tags
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
I got the solution for this. It didn't work by calling the API on viewDidAppear() or viewWIllAppear() . This will be done by using swift closures.
Below is the code:
On Second view Controller: