要运行示例项目,首先克隆仓库,然后在 Example 目录下运行 pod install
。
AloeUtils 通过 CocoaPods 提供。要安装它,只需将以下行添加到您的 Podfile。
pod "AloeUtils"
import AloeUtils
let moveView = UIView(frame: CGRectMake(0, 0, 100, 100))
AloeTween.doTween(0.2, ease: .InCirc) { (val) -> () in
// val 0.0〜1.0
moveView.transform = CGAffineTransformMakeTranslation(200*val, 200*val)
}
import AloeUtils
AloeChain()
.wait(0.5) // wait
.call{ () -> () in
// func
}
.add(0.3, ease: .None) { (val) -> () in
// tween
}
.execute() // execute
import AloeUtils
let imageUrl = "http://〜"
AloeImage.instance.loadImage(imageUrl, callback: { (image, key, useCache) -> () in
let imageView = UIImageView(image: image)
self.view.addSubview(imageView)
}) { () -> () in
print("fail load image")
}
// clearCache
AloeImage.instance.clearImageCache()
AloeLocation.instance.requestCurrentLocation({ (lat, lng) -> () in
// success
}) { (status) -> () in
// fail
}
let cameraService = AloeCameraService()
private func startCameraCapture(){
cameraService.setup(AloeCameraServicePosition.Back)
cameraService.delegate = self
cameraService.start()
}
func onOutputBuffer(ciImage: CIImage) {
let image = UIImage(CIImage: ciImage)
print("image size.width:\(image.size.width)")
}
yu kawase, [email protected]
AloeUtils 在 MIT 许可下可用。查看 LICENSE 文件获取更多信息。