AloeUtils 0.1.5

AloeUtils 0.1.5

TestsTested
LangLanguage SwiftSwift
License MIT
ReleasedLast Release Mar 2016
SPMSupports SPM

Maintained by yukawase.



AloeUtils 0.1.5

  • By
  • yu kawase

AloeUtils

Usage

To run the example project, clone the repo, and run pod install from the Example directory first.

Requirements

  • iOS 8.0+ / Mac OS X 10.9+ / watchOS 2
  • Xcode 7.0+

Dependencies

Installation

AloeUtils is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod "AloeUtils"

Usage

Tween

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)
}

Chain

import AloeUtils

AloeChain()
.wait(0.5) // wait
.call{ () -> () in
    // func
}
.add(0.3, ease: .None) { (val) -> () in
    // tween
}
.execute() // execute

LoadImage & cache

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()

Location

AloeLocation.instance.requestCurrentLocation({ (lat, lng) -> () in
    // success

}) { (status) -> () in
    // fail

}

CameraCapture

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)")
}

Author

yu kawase, [email protected]

License

AloeUtils is available under the MIT license. See the LICENSE file for more info.

aloeutils