Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove broken convenience functions: #141

Merged
merged 1 commit into from
Oct 23, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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