用 Swift 實現的動畫框架:RazzleDazzle

jopen 9年前發布 | 13K 次閱讀 Apple Swift開發 RazzleDazzle

IFTTT 開源了一個用 Swift 實現的動畫框架,非常合適用在 App 的初次展示上。

RazzleDazzleis a simple AutoLayout-friendly keyframe animation framework for iOS, written in Swift. Perfect for scrolling app intros.

RazzleDazzle

RazzleDazzlegrew from JazzHands, an Objective-C scrolling keyframe animations library by IFTTT.

JazzHands is used extensively in IF and DO for iPhone and iPad, most famously in the app intro.

What'sRazzleDazzlefor?

Scrolling App Intro Animations

RazzleDazzleis the easiest way to add scrollview-powered animations to the app intro of your Swift app. If you're adding a scrolling intro to your Objective-C app, check out JazzHands!

For some examples of how JazzHands andRazzleDazzlecan be used in practice, check out the intros of both IF and DO for iPhone and iPad, as well as the scrolling animations of the buttons in the DO apps by IFTTT.

Easy Paging Scrollview Layouts in an AutoLayout World

RazzleDazzle'skeep(view: onPage:)function of theAnimatedPagingScrollViewControlleris a super easy way to lay out a paging scroll view that does what you expect it to when your app is rotated or used in the new split-screen iPad views of iOS9, a notoriously tricky aspect of getting your apps fully AutoLayout-ready.RazzleDazzlesets up an AutoLayout-friendly paging scroll view controller for you, and all you need to do to make your layout respond properly to any view size changes is tellRazzleDazzlewhich page you'd like things on.

As a bonus, because it's built on top of the animations library, you can even tellRazzleDazzlethat you'd like one of your views to show up on multiple pages while other views scroll past, with a single call tokeep(view: onPages:).

Installation

Carthage

RazzleDazzleis available through Carthage. To install it, simply add the following line to yourCartfile:

github "IFTTT/RazzleDazzle"

CocoaPods

RazzleDazzleis also available through CocoaPods. To install it, simply add the following line to yourPodfile:

pod "RazzleDazzle"

BecauseRazzleDazzleis written in Swift, be sure to adduse_frameworks!at the top of your Podfile.

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
use_frameworks!

pod 'RazzleDazzle'

項目主頁:http://www.baiduhome.net/lib/view/home/1437708263037

 本文由用戶 jopen 自行上傳分享,僅供網友學習交流。所有權歸原作者,若您的權利被侵害,請聯系管理員。
 轉載本站原創文章,請注明出處,并保留原始鏈接、圖片水印。
 本站是一個以用戶分享為主的開源技術平臺,歡迎各類分享!