Namespaces
iOSNativeHelper
const iOSNativeHelper: {
animateWithSpring: (options?: {
animateOptions?: UIViewAnimationOptions;
animations?: () => void;
completion?: (finished?: boolean) => void;
delay?: number;
friction?: number;
mass?: number;
tension?: number;
velocity?: number;
}) => void;
applyRotateTransform: (transform: CATransform3D, x: number, y: number, z: number) => CATransform3D;
collections: {
jsArrayToNSArray: NSArray<T>;
nsArrayToJSArray: T[];
};
copyLayerProperties: (view: UIView, toView: UIView, customProperties?: {
layer?: (string | number | symbol)[];
view?: (string | number | symbol)[];
}) => void;
createUIDocumentInteractionControllerDelegate: () => NSObject;
getCurrentAppPath: () => string;
getMainScreen: () => UIScreen;
getRootViewController: () => UIViewController;
getVisibleViewController: (rootViewController: UIViewController) => UIViewController;
getWindow: () => UIWindow;
isLandscape: () => boolean;
joinPaths: (...paths: string[]) => string;
MajorVersion: number;
printCGRect: (rect: CGRect) => void;
setWindowBackgroundColor: (value: string) => void;
snapshotView: (view: UIView, scale: number) => UIImage;
} = ios;Defined in: utils/native-helper.d.ts:285
Type Declaration
animateWithSpring
animateWithSpring: (options?: {
animateOptions?: UIViewAnimationOptions;
animations?: () => void;
completion?: (finished?: boolean) => void;
delay?: number;
friction?: number;
mass?: number;
tension?: number;
velocity?: number;
}) => void;Animate views with a configurable spring effect
Parameters
| Parameter | Type | Description |
|---|---|---|
options? | { animateOptions?: UIViewAnimationOptions; animations?: () => void; completion?: (finished?: boolean) => void; delay?: number; friction?: number; mass?: number; tension?: number; velocity?: number; } | various animation settings for the spring - tension: number - friction: number - mass: number - delay: number - velocity: number - animateOptions: UIViewAnimationOptions - animations: () => void, Callback containing the property changes you want animated - completion: (finished: boolean) => void, Callback when animation is finished |
options.animateOptions? | UIViewAnimationOptions | - |
options.animations? | () => void | - |
options.completion? | (finished?: boolean) => void | - |
options.delay? | number | - |
options.friction? | number | - |
options.mass? | number | - |
options.tension? | number | - |
options.velocity? | number | - |
Returns
void
applyRotateTransform
applyRotateTransform: (transform: CATransform3D, x: number, y: number, z: number) => CATransform3D;Applies a rotation transform over X,Y and Z axis
Parameters
| Parameter | Type | Description |
|---|---|---|
transform | CATransform3D | Applies a rotation transform over X,Y and Z axis |
x | number | Rotation over X axis in degrees |
y | number | Rotation over Y axis in degrees |
z | number | Rotation over Z axis in degrees |
Returns
CATransform3D
collections
collections: {
jsArrayToNSArray: NSArray<T>;
nsArrayToJSArray: T[];
};Utilities related to iOS collections.
collections.jsArrayToNSArray()
jsArrayToNSArray<T>(str: T[]): NSArray<T>;Converts JavaScript array to NSArray.
Type Parameters
| Type Parameter |
|---|
T |
Parameters
| Parameter | Type | Description |
|---|---|---|
str | T[] | JavaScript string array to convert. |
Returns
NSArray<T>
collections.nsArrayToJSArray()
nsArrayToJSArray<T>(a: NSArray<T>): T[];Converts NSArray to JavaScript array.
Type Parameters
| Type Parameter |
|---|
T |
Parameters
| Parameter | Type | Description |
|---|---|---|
a | NSArray<T> | NSArray to convert. |
Returns
T[]
copyLayerProperties
copyLayerProperties: (view: UIView, toView: UIView, customProperties?: {
layer?: (string | number | symbol)[];
view?: (string | number | symbol)[];
}) => void;Copy layer properties from one view to another.
Parameters
| Parameter | Type | Description |
|---|---|---|
view | UIView | a view to copy layer properties to |
toView | UIView | a view to copy later properties from |
customProperties? | { layer?: (string | number | symbol)[]; view?: (string | number | symbol)[]; } | - |
customProperties.layer? | (string | number | symbol)[] | - |
customProperties.view? | (string | number | symbol)[] | - |
Returns
void
createUIDocumentInteractionControllerDelegate
createUIDocumentInteractionControllerDelegate: () => NSObject;Create a UIDocumentInteractionControllerDelegate implementation for use with UIDocumentInteractionController
Returns
NSObject
getCurrentAppPath
getCurrentAppPath: () => string;Gets the root folder for the current application. This Folder is private for the application and not accessible from Users/External apps. iOS - this folder is read-only and contains the app and all its resources.
Returns
string
getMainScreen
getMainScreen: () => UIScreen;Returns
UIScreen
getRootViewController
getRootViewController: () => UIViewController;Get the root UIViewController of the app
Returns
UIViewController
getVisibleViewController
getVisibleViewController: (rootViewController: UIViewController) => UIViewController;Gets the currently visible(topmost) UIViewController.
Parameters
| Parameter | Type | Description |
|---|---|---|
rootViewController | UIViewController | The root UIViewController instance to start searching from (normally window.rootViewController). Returns the visible UIViewController. |
Returns
UIViewController
getWindow
getWindow: () => UIWindow;Returns
UIWindow
application window.
Deprecated
Use Utils.getWindow<UIWindow>() instead.
isLandscape
isLandscape: () => boolean;Returns
boolean
Deprecated
use Application.orientation instead
Gets an information about if current mode is Landscape.
joinPaths
joinPaths: (...paths: string[]) => string;Joins an array of file paths.
Parameters
| Parameter | Type | Description |
|---|---|---|
...paths | string[] | An array of paths. Returns the joined path. |
Returns
string
MajorVersion
MajorVersion: number;Deprecated
use Utils.SDK_VERSION instead which is a float of the {major}.{minor} verison
printCGRect
printCGRect: (rect: CGRect) => void;Debug utility to insert CGRect values into logging output. Note: when printing a CGRect directly it will print blank so this helps show the values.
Parameters
| Parameter | Type | Description |
|---|---|---|
rect | CGRect | CGRect |
Returns
void
setWindowBackgroundColor
setWindowBackgroundColor: (value: string) => void;Set the window background color of base view of the app. Often this is the view shown behind opening a modal, eg: a modal scales down revealing the window color.
Parameters
| Parameter | Type | Description |
|---|---|---|
value | string | color (hex, rgb, rgba, etc.) |
Returns
void
snapshotView
snapshotView: (view: UIView, scale: number) => UIImage;Take a snapshot of a View on screen.
Parameters
| Parameter | Type | Description |
|---|---|---|
view | UIView | view to snapshot |
scale | number | screen scale |
Returns
UIImage
Deprecated
use Utils.ios instead.
- Previous
- ios
- Next
- RESOURCE_PREFIX