LCLiquidView
@interface LCLiquidView : UIView
LCLiquidView
exposes an LCMicroService
through a UI. An LCMicroService
attaches to a UI
in JavaScript by calling LiquidCore.attach(surface, callback)
where
surface
is a string representing the LCSurface
class canonical name
(e.g. org.liquidplayer.surfaces.console.ConsoleSurface
) and callback
is a
callback function which accepts an error
parameter. If error
is undefined
, then the
LCSurface
was attached correctly and is ready for use. Otherwise, error
is a descriptive
error message.
-
The URL of the micro service. The
URL
is mutually exclusive with thejsResource
. Use only one or the other.Note
The property is exposed through the Interface Builder in XCode and should not used programmatically.Declaration
Objective-C
@property (readwrite, strong, nonatomic) NSString *URL;
Swift
var url: String! { get set }
-
The path to a JavaScript resource file. The
jsResource
is mutually exclusive with theURL
. Use only one or the other.Note
The property is exposed through the Interface Builder in XCode and is not used programmatically.Declaration
Objective-C
@property (readwrite, strong, nonatomic) NSString *jsResource;
Swift
var jsResource: String! { get set }
-
An array of space-delimited arguments to start the micro service with.
Note
The property is exposed through the Interface Builder in XCode and is not used programmatically.Declaration
Objective-C
@property (readwrite, strong, nonatomic) NSString *arguments;
Swift
var arguments: String! { get set }
-
An array of space-delimited canonical surface names.
Note
The property is exposed through the Interface Builder in XCode and is not used programmatically.If neither the
availableSurfaces
property is set, nor-enableSurface:
called, then all registered surfaces will be available to the micro service. This property only needs to be set if surfaces are intentionally restricted.Declaration
Objective-C
@property (readwrite, strong, nonatomic) NSString *availableSurfaces;
Swift
var availableSurfaces: String! { get set }
-
Makes a surface available to the
LCMicroService
. Must be called prior to-start:
. In Interface Builder, an array of available surfaces can be provided using theavailableSurfaces
property.If neither the
availableSurfaces
property is set, nor-enableSurface:
called, then all registered surfaces will be available to the micro service. This method only needs to be called if surfaces are intentionally restricted.Declaration
Objective-C
- (void)enableSurface:(NSString *)canonicalName, ...;
-
Starts an
LCMicroService
asynchronously. In Inteface Builder, this can be auto-started using theURL
orjsResource
andarguments
properties.Declaration
Objective-C
- (LCMicroService *)start:(NSURL *)uri arguments:(NSString *)argv, ...;
Parameters
uri
The micro service URI
argv
Optional arguments loaded into
process.argv[2:]
Return Value
the
LCMicroService
-
Starts an
LCMicroService
asynchronously. In Inteface Builder, this can be auto-started using theURL
orjsResource
properties.Declaration
Objective-C
- (LCMicroService *)start:(NSURL *)uri;
Swift
func start(_ uri: URL!) -> LCMicroService!
Parameters
uri
The micro service URI
Return Value
the
LCMicroService