//new a white color
var c = Color(hex: "#ffffff")
View(width: 200, height: 50, backgroundColor: red, radius: 2)
//all those property you can call set function, like this👇,except width and height
View(width: 200, height: 50).setBackgroundColor(color: blue)
//you can call setSize adjust width and height
View().setSize(width: 100, height: 100)
stack is extended from View, you can call any View's function.
They are implement with UIStackView.
VStack()
HStack()
Label(width: 200, height: 50, text: "Fairy", textAlignment: TextAlignmentCenter, textColor: red, bold:1, textSize: 18)
ImageView(width: 400, height: 200, src: "fairy")
Spacer(width:1, height:40)
Basic types will be automatically converted, other Fairy objects need to implement the toNativeObj
method, the system will automatically call this method to obtain for conversion
Basic types will be automatically converted, other objects will become FARNativeWrapperInstance
-
add Fairy-Native interface in
FARNativeApi.m
- (void)testFunc:(NSDictionary *)params { }
-
call in Fairy
__Native.testFunc(param: p)
Note: You must get the Fairy object in Native before calling Fairy
- (void)setClickListener:(NSDictionary *)params {
FARObjectWrapper *wrapper = params[@"clickListener"];
wrapper callWithParams:@{@"sender": sender}];
}