All Projects → onurersel → Anim

onurersel / Anim

Licence: mit
Swift animation library for iOS, tvOS and macOS.

Programming Languages

swift
15916 projects
swift4
162 projects

Projects that are alternatives of or similar to Anim

Iso8601
ISO8601 date parser and writer
Stars: ✭ 213 (-59.04%)
Mutual labels:  tvos, cocoapods, carthage
Datez
📆 Breeze through Date, DateComponents, and TimeInterval with Swift!
Stars: ✭ 254 (-51.15%)
Mutual labels:  tvos, cocoapods, carthage
Theanimation
Type-safe CAAnimation wrapper. It makes preventing to set wrong type values.
Stars: ✭ 214 (-58.85%)
Mutual labels:  tvos, cocoapods, carthage
Svprogresshud
A clean and lightweight progress HUD for your iOS and tvOS app.
Stars: ✭ 12,339 (+2272.88%)
Mutual labels:  tvos, cocoapods, carthage
Web3.swift
A pure swift Ethereum Web3 library
Stars: ✭ 295 (-43.27%)
Mutual labels:  tvos, cocoapods, carthage
Cocoalumberjack
A fast & simple, yet powerful & flexible logging framework for Mac and iOS
Stars: ✭ 12,584 (+2320%)
Mutual labels:  tvos, cocoapods, carthage
Googlereporter
Easily integrate with Google Analytics in your iOS app
Stars: ✭ 479 (-7.88%)
Mutual labels:  tvos, cocoapods, carthage
Contentful.swift
A delightful Swift interface to Contentful's content delivery API.
Stars: ✭ 132 (-74.62%)
Mutual labels:  tvos, cocoapods, carthage
Jgprogresshud
An elegant and simple progress HUD for iOS and tvOS, compatible with Swift and ObjC.
Stars: ✭ 3,110 (+498.08%)
Mutual labels:  tvos, cocoapods, carthage
Audioindicatorbars
AIB indicates for your app users which audio is playing. Just like the Podcasts app.
Stars: ✭ 279 (-46.35%)
Mutual labels:  tvos, cocoapods, carthage
Cdmarkdownkit
An extensive Swift framework providing simple and customizable markdown parsing.
Stars: ✭ 158 (-69.62%)
Mutual labels:  tvos, cocoapods, carthage
Misterfusion
MisterFusion is Swift DSL for AutoLayout. It is the extremely clear, but concise syntax, in addition, can be used in both Swift and Objective-C. Support Safe Area and Size Class.
Stars: ✭ 314 (-39.62%)
Mutual labels:  tvos, cocoapods, carthage
Color
Color utilities for macOS, iOS, tvOS, and watchOS
Stars: ✭ 145 (-72.12%)
Mutual labels:  tvos, cocoapods, carthage
L10n Swift
Localization of the application with ability to change language "on the fly" and support for plural form in any language.
Stars: ✭ 177 (-65.96%)
Mutual labels:  tvos, cocoapods, carthage
Ducttape
📦 KeyPath dynamicMemberLookup based syntax sugar for Swift.
Stars: ✭ 138 (-73.46%)
Mutual labels:  tvos, cocoapods, carthage
Amplitude Ios
Native iOS/tvOS/macOS SDK
Stars: ✭ 216 (-58.46%)
Mutual labels:  tvos, cocoapods, carthage
Fontawesome.swift
Use FontAwesome in your Swift projects
Stars: ✭ 1,513 (+190.96%)
Mutual labels:  tvos, cocoapods, carthage
Sqift
Powerful Swift wrapper for SQLite
Stars: ✭ 119 (-77.12%)
Mutual labels:  tvos, cocoapods, carthage
Gemini
Gemini is rich scroll based animation framework for iOS, written in Swift.
Stars: ✭ 2,965 (+470.19%)
Mutual labels:  cocoapods, carthage, animation-library
Functionkit
A framework for functional types and operations designed to fit naturally into Swift.
Stars: ✭ 302 (-41.92%)
Mutual labels:  tvos, cocoapods, carthage
anim: Swift animation library for iOS, tvOS and macOS.

CocoaPods Carthage compatible Build Status codecov.io codebeat badge

anim is an animation library written in Swift with a simple, declarative API in mind.

// moves box to 100,100 with default settings
anim {
    self.box.frame.origin = CGPoint(x:100, y:100)
}
// after that, waits 100 ms
.wait(0.1)
// moves box to 0,0 after waiting
.then {
    self.box.frame.origin = CGPoint(x:0, y:0)
}
// displays message after all animations are done
.callback {
    print("Just finished moving 📦 around.")
}

It supports a bunch of easing functions and chaining multiple animations. It's a wrapper on Apple's UIViewPropertyAnimator on its core, and falls back to UIView.animate on versions before iOS and tvOS 10. It uses NSAnimationContext on macOS.

Examples

Example projects are available at examples/ folder and as targets on XCode project.

Bonfire Profile Menu Message
Installation

Cocoapods

pod 'anim'

Carthage

github "onurersel/anim"

Manually

Or simply drag the swift files inside src/ folder into your project.


API

For complete documentation, visit http://onurersel.github.io/anim/.

Initialize animations with anim constructor.

// Initialize with default settings
anim {
    // animation block
}
// or initialize with it's own settings
anim { (settings) -> (animClosure) in
    settings.delay = 1
    settings.duration = 0.7
    settings.ease = .easeInOutBack

    return {
        // animation block
    }
}
// or initialize layout constraint animations just by passing the parent view
anim(constraintParent: self.view) {
    // animation block
}

anim(constraintParent: self.view) { (settings) -> (animClosure) in
    // settings...
    return {
        // animation block
    }
}

// you don't need to call layoutIfNeeded() before or inside the
// animation blocks, it's handled by anim
//
// for example to update constant value of a constraint,
// you can just change it inside the animation block
let width: NSLayoutConstraint //...
anim(constraintParent: self.view) {
    width.constant = 100 // new value
}
// that's it!

Chain animations with then function.

anim {}
.then{
    // next animation block
}
anim {}
.then { (settings) -> animClosure in
    settings.duration = 1
    return {
        // next animation block
    }
}
anim {}
.then(constraintParent: self.view) {
    // chaining constraint animations
}
.then(constraintParent: self.view) { (settings) -> animClosure in
    settings.duration = 1
    return {
        // next animation block for constraints
    }
}

Wait between animation steps with wait function.

anim{}.wait(0.25).then{} //...

Insert callbacks between animation steps with .callback function.

anim{}
.callback {
    // custom block
}
.then{} //...

Stop animations with stop function.

let animation = anim{}.then{} // ...
animation.stop()

Default settings

You can change default animation settings through anim.defaultSettings property.

anim.defaultSettings.ease = .easeInOutCubic

Easing

anim.Ease exposes a bunch of easing options.


License

anim is released under the MIT license. See LICENSE for details.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].