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 best solutions below
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
- Confirmation for deleting a post in Table View Cell?
- Presenting a View Controller with a button in a UITableViewCell programmatically (Swift)
- Dismissing presented view controller returns to root view of navigation controller
- Present a ViewController as a popover
- What happens to a View Controller after it has modally presented another View Controller
- swift3: How to Present xib to viewcontroller
- UIPopoverPresentationController/UIPopoverController loses backgroundColor on interface rotation
- dismissViewControllerAnimated:completion: on iOS 8
- Presenting a XIB View Freezes
- Error while presenting a view controller
- Open UIViewController modally from tab bar with transparent background and transition style
- Why do my UICollectionView support methods only invoke when my ViewController is set as Initial View Controller?
- presentOpenInMenuFromRect not working DocumentHandler.h - QuickLook
- Push/Present a viewcontroller from right,the viewcontroller cover 3/4 part of previous viewcontroller
- How to cancel PresentViewController animation
Related Questions in VIEWDIDAPPEAR
- viewWillAppear and viewDidAppear not called while viewDidLoad called when something is in the UIViewController
- Swift - Load next view controller if already registered
- After iPad is unplugged from Mac the animation called in viewDidAppear doesn't happen
- viewDidAppear presence in code messes with layout
- trigger viewDidAppear in extension or how to use variable from extension in viewController?
- ViewDidAppear Home Button
- Sometimes there is delay between viewWillAppear and viewDidAppear, no CPU usage
- Why UIScrollView can not scroll once dragging UIButton or UILabel from storyboard
- Swift - ViewDidAppear called from another class
- Swift - Reload UIPageViewController with new information in viewDidAppear
- Why is GLKView's drawableWidth and drawableHeight not set in viewDidAppear?
- iOS viewWillAppear Error: "view is not in the window hierarchy"
- viewDidAppear and viewWillAppear not getting called on the iPad
- After segue ViewDidLoad is called but ViewWillAppear and ViewDidAppear is not being called
- viewDidAppear for UITableViewCell
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?
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)
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?
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: