WTArchitectViewDelegate Protocol Reference
Conforms to | NSObject |
---|---|
Declared in | WTArchitectView.h |
Overview
The WTArchitectViewDelegate offers the possibility to either react on events that are triggered inside the ARchitect World or events that are triggerd because of some interaction with the WTArchitectView.
Authorization Requests
– architectView:didFailToAuthorizeRestrictedAppleiOSSDKAPIs:
This method is called when the SDK detects an not authorized iOS SDK API usage. Based on the error message, the user can be asked to allow access to certain restricted APIs. See WTAuthorizationRequestManager for more information.
- (void)architectView:(WTArchitectView *)architectView didFailToAuthorizeRestrictedAppleiOSSDKAPIs:(NSError *)error
Parameters
architectView |
The architect view that tried to access a restriced API and failed |
---|---|
error |
An error object containing more information which APIs are not accessible. |
Declared In
WTArchitectView.h
ARchitect World
– architectView:didFinishLoadArchitectWorldNavigation:
This method is called when the provided architect world url finished loading. The resulting navigation object contains the original load url as well as the final resolved url.
- (void)architectView:(WTArchitectView *)architectView didFinishLoadArchitectWorldNavigation:(WTNavigation *)navigation
Parameters
architectView |
The architect view that finished loading. |
---|---|
navigation |
The navigation that finished loading. |
Declared In
WTArchitectView.h
– architectView:didFailToLoadArchitectWorldNavigation:withError:
This method is called when the provided architect world url failed to load.
- (void)architectView:(WTArchitectView *)architectView didFailToLoadArchitectWorldNavigation:(WTNavigation *)navigation withError:(NSError *)error
Parameters
architectView |
The ArchitectView which failed to load the url. |
---|---|
navigation |
The navigation which failed to load. |
error |
An error object containing more informations why the load did fail. |
Declared In
WTArchitectView.h
– architectView:receivedJSONObject:
This method is called whenever the WTArchitectView received a JSON object. JSON objects can be send in Architect Worlds using the function AR.platform.sendJSONObject()
.
The object that is passed to this JS function is a JS object.
A simple usage would be: AR.platform.sendJSONObject({action: “present_details”, details: {title: “some_text”, description: “some_text”}});
- (void)architectView:(WTArchitectView *)architectView receivedJSONObject:(NSDictionary *)jsonObject
Parameters
architectView |
The architect view that received the JSON object |
---|---|
jsonObject |
The JSON object that was sent in JS |
Declared In
WTArchitectView.h
– architectView:invokedURL:
This method offers the possibility to react on events that are triggered inside the ARchitect World. To initiate such an event, the ARchitect World simply has to make an request for an url with the “architectsdk://” scheme. E.g.: architectsdk://opendetails?id=123.
- (void)architectView:(WTArchitectView *)architectView invokedURL:(NSURL *)URL
Parameters
architectView |
The WTArchitectView object which invoked the url. |
---|---|
URL |
The url which was called in javascript. |
Declared In
WTArchitectView.h
Screen capturing
– architectView:didCaptureScreenWithContext:
This method is called when the WTArchitectView did finish capturing a screenshot
- (void)architectView:(WTArchitectView *)architectView didCaptureScreenWithContext:(NSDictionary *)context
Parameters
architectView |
The ArchitectView which generated the screenshot. |
---|---|
context |
A NSDictionary, containig at least CaptureMode (Key = WTScreenshotCaptureMode) and SavingMode (Key = WTScreenshotSaveMode). Optional objects are given for the different SaveModes. |
Discussion
The context contains different objects depending on the SaveMode. SaveMode PhotoLibrary contains the two standard objects (CaptureMode & SaveMode). SaveMode PhotoLibrary contains additional a UIImage object (the Screenshot, Key = WTScreenshotKey). SaveMode BundleDirectory contains a NSString object representing the file path in the bundle (Key = WTScreenshotPath).
Declared In
WTArchitectView.h
– architectView:didFailCaptureScreenWithError:
This method is called when the WTArchitectView couldn’t finish capturing a screenshot
- (void)architectView:(WTArchitectView *)architectView didFailCaptureScreenWithError:(NSError *)error
Parameters
architectView |
The ArchitectView which couldn’t finish the capturing. |
---|---|
error |
A NSError, providing more information on what was failing. |
Declared In
WTArchitectView.h
View controller presentation
– presentViewController:forArchitectView:
This method is called every time the architect view want’s to present a view controller.
- (BOOL)presentViewController:(UIViewController *)viewController forArchitectView:(WTArchitectView *)architectView
Parameters
viewController |
The view controller that is about to be presented |
---|---|
architectView |
The architect view that initiates this view controller presentation |
Return Value
YES if the architect view is allowed to present the view controller, NO otherwise.
Discussion
Return NO if the ArchitectView is currently forbidden to present a view controller. The view controller presentation is not resumed at any other time.
Declared In
WTArchitectView.h
– presentingViewControllerForViewControllerPresentationInArchitectView:
This method is called every time the architect view want’s to present a view controller.
- (UIViewController *)presentingViewControllerForViewControllerPresentationInArchitectView:(WTArchitectView *)architectView
Parameters
architectView |
The architect view which want’s to present a view controller. |
---|
Return Value
A view controller which can be used for presentation.
Discussion
if nil is returned or the method is not implemented, the architect view tries to grab an appropriate view controller from the current view controller hierarchy.
Declared In
WTArchitectView.h
– architectView:willPresentViewController:onViewController:
This method is called every time the architect view presents a view controller on top of itself. If the architect view is presented using a navigation controller, additional view controller will be pushed onto the navigation controller stack. On all other controller (e.g. tab bar controller) a modal presentation will be used.
- (void)architectView:(WTArchitectView *)architectView willPresentViewController:(UIViewController *)presentedViewController onViewController:(UIViewController *)presentingViewController
Parameters
architectView |
The architect view which is about to present a view controller. |
---|---|
presentedViewController |
The view controller which will be presented. |
presentingViewController |
The view controller which will present the new view controller. This can be an internally created view controller or the view controller which was returned from the presentingViewControllerForViewControllerPresentationInArchitectView: delegate method. |
Discussion
Use this method to e.g. stype the UI elements on the presented view controller or change the modal presentation style.
Declared In
WTArchitectView.h
– shouldArchitectView:presentViewControllerAnimated:
This method is called to determine if the given view controller should be presented animated or not.
- (BOOL)shouldArchitectView:(WTArchitectView *)architectView presentViewControllerAnimated:(UIViewController *)viewController
Parameters
architectView |
The architect view which is about to present a view controller. |
---|---|
viewController |
The view controller that is about to be presented. |
Return Value
YES if the view controller should be presented animated, NO otherwise.
Declared In
WTArchitectView.h
– architectView:didPresentViewController:onViewController:
This method is called every time the architect view finished presenting a view controller.
- (void)architectView:(WTArchitectView *)architectView didPresentViewController:(UIViewController *)presentedViewController onViewController:(UIViewController *)presentingViewController
Parameters
architectView |
The architect view that finished presenting a view controller. |
---|---|
presentedViewController |
The view controller that was presented. |
presentingViewController |
The view controller that presented the view controller. |
Declared In
WTArchitectView.h
Safari view controller presentation
– shouldArchitectViewPresentSafariViewControllerInReaderModeIfAvailable:
This method is called to determine if SFSafariViewController should be presented with enabled reader mode if available.
- (BOOL)shouldArchitectViewPresentSafariViewControllerInReaderModeIfAvailable:(WTArchitectView *)architectView
Parameters
architectView |
The architect view that is about to present the SFSafariViewController. |
---|
Return Value
YES if Safari view controller should be presented with enabled reader mode if available, NO otherwise.
Discussion
If this method is not implemented, SFSafariViewController will be presented with reader mode enabled = YES if available.
Declared In
WTArchitectView.h
– activityItemsForURL:title:usedBySafariViewController:
This method is called every time SFSafariViewController is about to show UIActivityViewController after the user taps the action button.
- (NSArray<UIActivity*> *)activityItemsForURL:(NSURL *)URL title:(nullable NSString *)title usedBySafariViewController:(SFSafariViewController *)safariViewController
Parameters
URL |
the URL of the web page. |
---|---|
title |
the title of the web page. |
safariViewController |
the Safari view controller that is about to show the UIActivityViewController. |
Return Value
An array of UIActivity instances that will be appended to UIActivityViewController.
Discussion
The return value of this method is directly forwarded to the internal SFSafariViewControllerDelegate implementation.
Declared In
WTArchitectView.h
Sensor calibration
– architectViewNeedsDeviceSensorCalibration:
This method is called when the iOS SDK needs to calibrate device sensors.
- (void)architectViewNeedsDeviceSensorCalibration:(WTArchitectView *)architectView
Parameters
architectView |
The architect view that needs sensor calibration. |
---|
Discussion
Use this method to either show a custom UI that indicates that the user should calibrate it’s device or, if WTStartupConfiguration shouldUseSystemDeviceSensorCalibrationDisplay is set to YES, to prepare your application properly for the system calibration screen.
Declared In
WTArchitectView.h
– architectViewFinishedDeviceSensorsCalibration:
This method is called once the sensor calibration is accurate enough to deliver proper device sensor values.
- (void)architectViewFinishedDeviceSensorsCalibration:(WTArchitectView *)architectView
Parameters
architectView |
The architect view that finished sensor calibration. |
---|
Declared In
WTArchitectView.h
– architectView:didSwitchToActiveCaptureDevicePosition:
This method is called whenever the WTArchitectView switched to a different capture device position.
- (void)architectView:(WTArchitectView *)architectView didSwitchToActiveCaptureDevicePosition:(AVCaptureDevicePosition)activeCaptureDevicePosition
Parameters
architectView |
The architect view that changed capture device position |
---|---|
activeCaptureDevicePosition |
the capture device position that is now active. |
Discussion
This method can be helpful in case the capture device position was changed at runtime through the AR.hardware.camera.position property and the native code needs to adopt to these changes.
Declared In
WTArchitectView.h
– architectView:didRequestPrompt:
This method is called when code in the JavaScript file calls ‘prompt()’
- (NSString *)architectView:(WTArchitectView *)architectView didRequestPrompt:(NSString *)prompt
Parameters
architectView |
The architect view that tried to access a restriced API and failed |
---|---|
prompt |
Prompt text requested |
Declared In
WTArchitectView.h
– architectView:didRequestConfirmPanelWithMessage:
This method is called when code in the JavaScript file calls ‘confirm()’
- (BOOL)architectView:(WTArchitectView *)architectView didRequestConfirmPanelWithMessage:(NSString *)message
Parameters
architectView |
The architect view that tried to access a restriced API and failed |
---|---|
message |
Message to display on panel |
Declared In
WTArchitectView.h
– architectView:didRequestAlertWithMessage:
This method is called when code in the JavaScript file calls ‘alert()’
- (void)architectView:(WTArchitectView *)architectView didRequestAlertWithMessage:(NSString *)message
Parameters
architectView |
The architect view that tried to access a restriced API and failed |
---|---|
message |
Message to display on alert |
Declared In
WTArchitectView.h