Veritas 机器 |
|
您可以编写纯 Lua 代码或包含 Objective-C 语法的代码。
它已经实现了大多数 Objective-C 语法,例如 @autoreleasepool、@{}、@[]、@YES。它还扩展了 Objective-C。
该机器可以在 iOS 设备上运行。以下是一个示例:
local animation = function(view, background) [view setAlpha: 0] [UIView animateWithDuration: 0.5 animations: (^{ [view setAlpha: 1] [background setFrame: CGRectMake(0, 0, 100, 100)] })] end local theView = [[UIView alloc] initWithFrame: CGRectMake(0, 0, 100, 200)] local backgroundView = [[UIImageView alloc] initWithImage: [UIImage imageNamed: @"background"]] [theView addSubview: backgroundView] [backgroundView release] animation(theView, backgroundView)