Skip to content

Commit

Permalink
Remove broken convenience functions: (#141)
Browse files Browse the repository at this point in the history
* `presentInView` doesn't work right in iOS 17.
* `presentHidden` might still work, but is inconsistent with `presentInView` now gone.
  • Loading branch information
tcobbs-bentley authored Oct 23, 2023
1 parent 5880e87 commit cd114d9
Showing 1 changed file with 5 additions and 22 deletions.
27 changes: 5 additions & 22 deletions Sources/ITwinMobile/ITMApplication.swift
Original file line number Diff line number Diff line change
Expand Up @@ -564,10 +564,14 @@ open class ITMApplication: NSObject, WKUIDelegate, WKNavigationDelegate {

/// Show or hide the iTwin Mobile app.
///
/// __Note:__ The mobile backend can only be launched once during each execution of an application. Because
/// of this, once an ``ITMApplication`` instance has been created, it must never be deleted. Use this function
/// to hide the UI while maintaining the ``ITMApplication`` instance.
///
/// If the view is valid, iTwin Mobile app is added in active state.
/// If the view is nil, iTwin Mobile app is hidden and set as dormant.
/// Override this function in a subclass in order to add custom behavior.
/// - Parameter view: View to which to add the iTwin Mobile app, or nil to hid the iTwin Mobile app.
/// - Parameter view: View to which to add the iTwin Mobile app, or nil to hide the iTwin Mobile app.
@MainActor
open func addApplicationToView(_ view: UIView?) {
guard let parentView = view ?? Self.topView else {
Expand Down Expand Up @@ -599,27 +603,6 @@ open class ITMApplication: NSObject, WKUIDelegate, WKNavigationDelegate {
}
}

/// Present the iTwin Mobile app in the given view, filling it completely.
///
/// Override this function in a subclass in order to add custom behavior.
/// - Note: The actual presentation happens in MainActor, so this may return before that is done.
/// - Parameter view: View in which to present the iTiwn Mobile app.
open func presentInView(_ view: UIView) {
Task { @MainActor in
addApplicationToView(view)
}
}

/// Hide the iTwin Mobile app and set it as dormant.
///
/// Override this function in a subclass in order to add custom behavior.
/// - Note: The actual hiding happens in MainActor, so this may return before that is done.
open func presentHidden() {
Task { @MainActor in
addApplicationToView(nil)
}
}

// MARK: WKUIDelegate Methods

/// See `WKUIDelegate` documentation.
Expand Down

0 comments on commit cd114d9

Please sign in to comment.