Latest 1.0
Homepage https://github.com/igormatyushkin014/Circle
License MIT
Platforms ios 9.0
Authors

Circle


CirclePlayer


CirclePlayer


CirclePlayer


CirclePlayer

Circle

Simplifies UIImageView animations via set of classes and extensions.

How To Get Started

  • Copy content of Source folder to your project.

or

  • Use CirclePlayer cocoapod

Requirements

  • iOS 9 and later
  • Xcode 9 and later
  • Swift 4

Usage

Let’s assume, you have set of images in your Xcode project and you’d like to use them for playing animation within UIImageView instance. How this could be done with normal UIKit approach:

imageView.animationImages = [
    UIImage(named: "image_1")!,
    UIImage(named: "image_2")!,
    UIImage(named: "image_3")!,
    UIImage(named: "image_4")!,
    UIImage(named: "image_5")!,
    UIImage(named: "image_6")!,
    UIImage(named: "image_7")!,
    UIImage(named: "image_8")!,
    // etc.
]

imageView.animationDuration = 1
imageView.animatedImageView.animationRepeatCount = 1000
imageView.animatedImageView.startAnimating()

With Circle library you can implement the same behavior by using these lines:

imageView.crl
    .prefix("image_")
    .from(1)
    .to(8)
    .duration(1)
    .repeatCount(1000)
    .start()

If images are stored in another bundle, simply mention it by using bundle method:

imageView.crl
    .bundle(Bundle(identifier: "com.test.SomeBundle"))
    .prefix("image_")
    .from(1)
    .to(180)
    .duration(1)
    .repeatCount(3)
    .start()

All methods support call chains, so you can save reference to AnimationManager object and use it to stop animation later:

let animationManager = imageView.crl
    .prefix("image_")
    .from(1)
    .to(240)
    .duration(4)
    .repeatCount(1000)
    .start()

animationManager.stop()

License

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

Latest podspec

{
    "name": "CirclePlayer",
    "version": "1.0",
    "summary": "Simplifies UIImageView animations",
    "description": "Simplifies UIImageView animations via set of classes and extensions.",
    "homepage": "https://github.com/igormatyushkin014/Circle",
    "screenshots": "https://github.com/igormatyushkin014/Circle/raw/master/Images/logo_2048_2048.png",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Igor Matyushkin": "[email protected]"
    },
    "social_media_url": "https://twitter.com/imatyushkin1",
    "platforms": {
        "ios": "9.0"
    },
    "source": {
        "git": "https://github.com/igormatyushkin014/Circle.git",
        "tag": "1.0"
    },
    "source_files": [
        "Source",
        "Source/**/*"
    ],
    "swift_version": "4.0"
}

Pin It on Pinterest

Share This