iOSBrowserOptionsBuilder¶
Fluent builder for iOSBrowserOptions. Options not configured use the system default.
Kodster.InAppWebBrowser.iOS.iOSBrowserOptionsBuilder
Overview¶
iOSBrowserOptionsBuilder provides a chainable API for configuring iOSBrowserOptions.
Each With* method returns the same builder instance for fluent chaining.
Call Build() to create the final iOSBrowserOptions object.
Example¶
#if UNITY_IOS
var options = new iOSBrowserOptionsBuilder()
.WithColorScheme(iOSColorScheme.Dark)
.WithDismissButtonStyle(DismissButtonStyle.Close)
.WithPresentationStyle(PresentationStyle.PageSheet)
.Build();
iOSBrowser.Open("https://example.com", options);
#endif
Methods¶
WithReaderModeEnabled¶
Sets whether the browser presents the page in Reader Mode.
Parameters
readerModeEnabled(bool):trueto enable Reader Mode when available.
Returns
- The current
iOSBrowserOptionsBuilderinstance.
WithBarCollapsingEnabled¶
Sets whether the toolbar collapses as the user scrolls.
Parameters
barCollapsingEnabled(bool):trueto enable bar collapsing.
Returns
- The current
iOSBrowserOptionsBuilderinstance.
Remarks
- Not available on iOS 26 or later.
WithDismissButtonStyle¶
Sets the label or icon shown on the Dismiss button.
Parameters
dismissButtonStyle(DismissButtonStyle): The desired Dismiss button style.
Returns
- The current
iOSBrowserOptionsBuilderinstance.
WithPresentationStyle¶
Sets the way the browser is presented.
Parameters
presentationStyle(PresentationStyle): The desired presentation style.
Returns
- The current
iOSBrowserOptionsBuilderinstance.
WithOpenInExternalHandlerEnabled¶
public iOSBrowserOptionsBuilder WithOpenInExternalHandlerEnabled(
bool openInExternalHandlerEnabled
)
Sets whether URLs that can be handled by an external app are opened there instead of in-app.
Parameters
openInExternalHandlerEnabled(bool):trueto route matching URLs to external apps.
Returns
- The current
iOSBrowserOptionsBuilderinstance.
WithColorScheme¶
Sets the color scheme used for the browser UI.
Parameters
colorScheme(iOSColorScheme): The desired color scheme.
Returns
- The current
iOSBrowserOptionsBuilderinstance.
WithInteractiveDismissEnabled¶
Sets whether the user can dismiss the browser by tapping the app behind it.
Parameters
interactiveDismissEnabled(bool):trueto allow tap-behind dismissal.
Returns
- The current
iOSBrowserOptionsBuilderinstance.
WithPreferredContentSize¶
Sets the preferred width and height of the browser content, in points, used in a form-sheet. Negative values are clamped to 0.
Parameters
preferredContentSize(Vector2): Preferred width (x) and height (y) in points.
Returns
- The current
iOSBrowserOptionsBuilderinstance.
WithAnimationEnabled¶
Sets whether presentation and dismissal are animated.
Parameters
animationEnabled(bool):trueto animate presentation and dismissal.
Returns
- The current
iOSBrowserOptionsBuilderinstance.
WithInitialHeightPercent¶
Sets the initial height of the browser as a percentage of available screen height. Clamped to 0–100.
Parameters
initialHeightPercent(int): Initial height as a percentage of available screen height.
Returns
- The current
iOSBrowserOptionsBuilderinstance.
WithExpansionEnabled¶
Sets whether the browser can be expanded to full height.
Parameters
expansionEnabled(bool):trueto allow expansion to full height.
Returns
- The current
iOSBrowserOptionsBuilderinstance.
WithBackgroundInteractionEnabled¶
public iOSBrowserOptionsBuilder WithBackgroundInteractionEnabled(
bool backgroundInteractionEnabled
)
Sets whether the content behind the browser receives touch input.
Parameters
backgroundInteractionEnabled(bool):trueto allow background interaction.
Returns
- The current
iOSBrowserOptionsBuilderinstance.
WithGrabberVisible¶
Sets whether the grabber handle is shown at the top of the browser.
Parameters
grabberVisible(bool):trueto show the grabber handle.
Returns
- The current
iOSBrowserOptionsBuilderinstance.
WithSheetCornerRadius¶
Sets the corner radius of the browser, in points. Negative values are clamped to 0.
Parameters
sheetCornerRadius(float): Corner radius in points.
Returns
- The current
iOSBrowserOptionsBuilderinstance.
WithExpandOnScrollEnabled¶
Sets whether scrolling content expands the browser to full height.
Parameters
expandOnScrollEnabled(bool):trueto expand on scroll.
Returns
- The current
iOSBrowserOptionsBuilderinstance.
WithKeepSheetInLandscapeEnabled¶
Sets whether the browser remains a sheet in landscape orientation instead of going full-screen.
Parameters
keepSheetInLandscapeEnabled(bool):trueto keep sheet presentation in landscape.
Returns
- The current
iOSBrowserOptionsBuilderinstance.
WithTransitionStyle¶
Sets the animation style used when presenting the browser modally.
Parameters
transitionStyle(TransitionStyle): The desired transition style.
Returns
- The current
iOSBrowserOptionsBuilderinstance.
Build¶
Builds and returns an iOSBrowserOptions instance from the current configuration. Only options explicitly set via the With* methods are included; unset options remain null.
Returns
- A new
iOSBrowserOptionsinstance reflecting the builder's current state.