• Stars
    star
    124
  • Rank 288,207 (Top 6 %)
  • Language
    Swift
  • License
    MIT License
  • Created almost 9 years ago
  • Updated over 8 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Inspired by Fabric - Answers animation. Allows to "build" given view with pieces. Allows to "destroy" given view into pieces

ADPuzzleAnimation

CocoaPods Compatible Carthage compatible codebeat badge

Whats inside

Custom animation for UIView inspired by Fabric - Answers animation.

Easy to use

To create your first animation you need to know only about one method:

/**
 Designated initializer for puzzle animation and it's subclasses
 
 - parameter viewToAnimate: view to render into pieces
 - parameter configuration: animation configuration
 
 - returns: newly created animation instance
 */
init(viewToAnimate: UIView, configuration: PuzzleAnimationConfiguration = PuzzleAnimationConfiguration())

It's flixible - you can configure almost any parameter for the animation:

/**
 *  Defines the structure that contains configurable parameters for puzzle animation
*/
struct PuzzleAnimationConfiguration {

  /// Defines the animation velocity. Higher velocity less animation duration
  var animationVelocity: NSTimeInterval = 1

  /// Defines the delay between each piece in piece's group animation
  var pieceAnimationDelay: PuzzleAnimationDelay = defaultForwardPieceAnimationDelay

  /// Defines the delay between each group of pieces animation
  var pieceGroupAnimationDelay: PuzzleAnimationDelay = defaultForwardPieceGroupAnimationDelay

  /// Defines the animation piece's scale
  var animationScale: Double = 2.5

  /// Each piece represents square and this value represents the number of pixels of square side
  var pieceSide: CGFloat = 40
}

Handle callbacks about status to start new animation or do something else:

/// Called when animation completed, stoped or failed
/// @note You can set it any time even during the animation
public var animationCompletion: PuzzleAnimationCompletion?

Intuitive and simple interface:

/**
 Starts the animation. Makes view to animate hidden
*/
public func start()
    
/**
 Stops the animation. Removes all pieces from superview. Makes view to animate visible
 */
public func stop()

For the complete example check the viewController.swift

Easy to install

CocoaPods

To integrate ADPuzzleAnimation into your Xcode project using CocoaPods, specify it in your Podfile:

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

pod 'PuzzleAnimation', '~> 1.1.1'

Carthage

To integrate ADPuzzleAnimation into your Xcode project using Carthage, specify it in your Cartfile:

github "Antondomashnev/ADPuzzleAnimation" ~> 1.1.1

Run carthage update to build the framework and drag the built ADPuzzleAnimation.framework into your Xcode project.

More Repositories

1

ADChromePullToRefresh

ADChromePullToRefresh
Swift
266
star
2

ADMozaicCollectionViewLayout

ADMozaicCollectionViewLayout is yet another UICollectionViewLayout subclass that implements "brick", "mozaic" or Pinterest style layout.
Swift
224
star
3

FBSnapshotsViewer

A mac os application that shows the failing snapshot tests from FBSnapshotTestCase
Swift
223
star
4

ADGraphView

Objective-C
209
star
5

ADTickerLabel

An objective-c UIView which provide a mechanism to show numbers with rolling effect, like in counter
Objective-C
115
star
6

UIViewController-ScrollingStatusBar

Category for UIViewController with UIScrollView to scroll statusBar along scrollView
Objective-C
94
star
7

ADDropDownMenuView

ADDropDownMenuView is an iOS navigation drop down style view
Objective-C
80
star
8

ADPopupView

ADPopupView
Objective-C
66
star
9

ADFBRequestDialogViewController

UIViewController with FBDialog to send Facebook app request inside
Objective-C
41
star
10

ADArrowButton

Flat arrow button.
Swift
22
star
11

UIScrollViewContentAccessors

Category for UIScrollView which make easier to access UIScrollView's content properties in iOS.
Objective-C
20
star
12

ADCustomTableView

Objective-C
17
star
13

danger-missed_localizable_strings

Don't let developers to forget about the app localization
Ruby
13
star
14

socket.IO-Blocks

Category on SocketIO to use block callbacks instead of delegate callbacks.
Objective-C
11
star
15

fastlane-plugin-remove-provisioning-profile

Remove provisioning profile from your local machine
Ruby
9
star
16

fastlane-plugin-download_github_release_asset

Fastlane plugin that downloads a GitHub release's asset
Ruby
2
star
17

nabokov

Move mobile localization boringness away from you ๐Ÿƒ
Ruby
2
star
18

iOS-Hackathon-Starter-Template

A boilerplate for objective-c iOS applications
Objective-C
2
star
19

ADContactsManager

Easy-to-use wrapper for both Contacts and AddressBook frameworks
Objective-C
2
star
20

jigit

Keep you JIRA issue statuses in sync with what you're doing actually
Ruby
1
star
21

CCPolygonNode

CCNode subclass to draw polygon with texture (adopt PRKit to cocos2d v3)
C++
1
star