File tree Expand file tree Collapse file tree 1 file changed +17
-2
lines changed
Sources/FluidStack/ViewController Expand file tree Collapse file tree 1 file changed +17
-2
lines changed Original file line number Diff line number Diff line change @@ -216,15 +216,15 @@ open class FluidStackController: UIViewController {
216216 /**
217217 Removes the view controller displayed on most top.
218218 */
219+ @MainActor
219220 public func removeLastViewController(
220221 transition: AnyRemovingTransition ? ,
221222 completion: @MainActor @escaping ( RemovingTransitionContext . CompletionEvent ) -> Void = { _ in }
222223 ) {
223224
224- assert ( Thread . isMainThread)
225-
226225 guard let wrapperView = stackingItems. last else {
227226 Log . error ( . stack, " The last view controller was not found to remove " )
227+ completion ( . succeeded)
228228 return
229229 }
230230
@@ -236,6 +236,21 @@ open class FluidStackController: UIViewController {
236236 )
237237 }
238238
239+ @MainActor
240+ public func removeLastViewController(
241+ transition: AnyRemovingTransition ?
242+ ) async -> RemovingTransitionContext . CompletionEvent {
243+
244+ await withCheckedContinuation { continuation in
245+
246+ removeLastViewController ( transition: transition) { event in
247+ continuation. resume ( returning: event)
248+ }
249+ }
250+
251+ }
252+
253+
239254 /**
240255 Add a view controller to display.
241256 This is a primitive operation to add view controller to display.
You can’t perform that action at this time.
0 commit comments