Latest0.1.0
Homepagehttps://github.com/darkzero/DZAnimatedGift
LicenseMIT
Platformsios 9.3
Authors

CI Status
Version
License
Platform

中文版

Example

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

Requirements

XCode

Installation

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

pod 'DZAnimatedGift'

Sample

at first, Import framework

import DZAnimatedGift

Simple

Add one image to screen

DZAnimatedGift.addGift(image: "heart_pink",
                       at: CGPoint(x:sender.frame.midX, y:sender.frame.midY),
                       absolutePath: points,
                       duration: drand48()+2.0);

or

DZAnimatedGift.addGift(image: "heart_pink",
                       at: CGPoint(x:sender.frame.midX, y:sender.frame.midY),
                       relativePath: points,
                       duration: drand48()+2.0);

About the Parameter

image: String               // the image of gift
at: CGPoint                 // start point of the animation
absolutePath: [[CGPoint]]   // path of the animation(absolute in view)
relativePath: [[CGPoint]]   // path of the animation(relative of the start point)
                            // the [[CGPoint]] should be like
                            // [[endPoint, ctrlPoint], [endPoint, ctrlPoint], ...]
                            // or only endPoint like
                            // [[endPoint], [endPoint], ...]
                            // or mix
                            // [[endPoint, ctrlPoint], [endPoint], ...]
duration: CGFloat           // duration of the animation

Simple

Complex

let queue = DZAnimatedGift.createQueue(name: "QueueName", inView: self.view);
let width       = 64*[0.6, 0.8, 1.0, 1.2].random();
let duration    = 1.5*[0.7, 0.8, 0.9, 1.0, 1.2].random();
let g = GiftObject(image: "heart_pink",
                   startPoint: startPoint,
                   path: points,
                   duration: duration,
                   relative: true,
                   size: CGSize(width: width, height: width));
queue.add(object: g);

Complex

Author

darkzero, [email protected]
iOS developer, working in Tokyo

License

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

Latest podspec

{
    "name": "DZAnimatedGift",
    "version": "0.1.0",
    "summary": "Show gift animated on screen.",
    "description": "* 0.1.0nRelease 0.1.0, please see readme",
    "homepage": "https://github.com/darkzero/DZAnimatedGift",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "darkzero": "[email protected]"
    },
    "source": {
        "git": "https://github.com/darkzero/DZAnimatedGift.git",
        "tag": "0.1.0"
    },
    "platforms": {
        "ios": "9.3"
    },
    "source_files": "DZAnimatedGift/Classes/**/*",
    "pushed_with_swift_version": "4.0"
}

Pin It on Pinterest

Share This