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

Overview

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.

You might also like...
Reading animation allows you to click on the different page numbers and accordingly it will animate page changes in a cool way. It has a very attractive UI and is very easy to use.
Reading animation allows you to click on the different page numbers and accordingly it will animate page changes in a cool way. It has a very attractive UI and is very easy to use.

Reading Animation Cool Reading Animation in iOS written in Swift. Preview Table of content :- Description How to add in your project Requirement Licen

ChainPageCollectionView  A custom View with two level chained collection views and fancy transition animation
ChainPageCollectionView A custom View with two level chained collection views and fancy transition animation

ChainPageCollectionView A custom View with two level chained collection views and fancy transition animation. Demo Requirements iOS 9.0+ Xcode 8 Insta

CCMRadarView uses the IBDesignable tools to make an easy customizable radar view with animation
CCMRadarView uses the IBDesignable tools to make an easy customizable radar view with animation

CCMRadarView CCMRadarView is a simple to use view that uses the new IBDesignable and IBInspectable features of XCode6 to easily configure the icon in

BWMCoverView is a very easy to use advertising the carousel view, supports circular scrolling functions such as switching, asynchronous loading of images, animation, custom is very high.
BWMCoverView is a very easy to use advertising the carousel view, supports circular scrolling functions such as switching, asynchronous loading of images, animation, custom is very high.

BWMCoverView BWMCoverView is a very easy to use advertising the carousel view, supports circular scrolling functions such as switching, asynchronous l

A lightweight loading animation that can be applied to any SwiftUI view with 1 line of code.

SimpleAFLoader A lightweight loading animation that can be applied to any SwiftUI view with 1 line of code. All animations are built using the SwiftUI

Build complex, conducted animations declaratively without manually managing state.
Build complex, conducted animations declaratively without manually managing state.

Maestro Build complex, conducted animations declaratively without manually managing state. Code struct AnimatedPieChart: View { private enum Trim

Easily build advanced custom animations on iOS.
Easily build advanced custom animations on iOS.

INTUAnimationEngine makes it easy to build advanced custom animations on iOS. INTUAnimationEngine provides a friendly interface to drive custom animat

Fluid - Use a declarative syntax to build your user interface using UIKit like SwiftUI
Fluid - Use a declarative syntax to build your user interface using UIKit like SwiftUI

Fluid Fluid is powered by ResultBuilder and a custom layout engine. You can uses

Sample way of integrating animations into a design system for iOS app projects.

Animations in Design System The project presents a sample way of integrating animations into a design system for iOS developers. Project setup A sampl

Comments
  • Correct spelling of Cocoapods in README

    Correct spelling of Cocoapods in README

    This pull requests corrects the spelling of CocoaPods šŸ¤“ https://github.com/CocoaPods/shared_resources/tree/master/media

    opened by ReadmeCritic 1
Releases(1.1.1)
Owner
Anton
Anton
Disintegration animation inspired by THAT thing Thanos did at the end of Avengers: Infinity War.

Disintegrate Disintegrate is a small library providing an animation inspired by how our favorite heroes disappeared at the end of Avengers: Infinity W

Dariusz Bukowski 67 Nov 3, 2022
Simple Interface Core Animation. Run type-safe animation sequencially or parallelly

Simple Interface Core Animation Sica can execute various animations sequentially or parallelly. Features Animation with duration and delay parallel /

CATS Open Source Softwares 1k Nov 10, 2022
An experiment for using SwiftUI's custom timing Animation to create an orbital-like animation.

Orbital-SwiftUI-Animation An experiment for using SwiftUI's custom timing curve to create an orbital-like animation. How it looks: How it works: Apply

Mostafa Abdellateef 7 Jan 2, 2023
SwiftUI-Text-Animation-Library - Text animation library for SwiftUI

āš ļø This repository is under construction. SwiftUI Text Animation Library Make yo

null 28 Jan 8, 2023
Swiftui-animation-observer - Track SwiftUI animation progress and completion via callbacks

SwiftUI Animation Observer Track SwiftUI animation progress and completion via c

Gordan GlavaÅ” 9 Nov 5, 2022
MGFlipView allows to create flipping view in easy way without worrying about flipping animation and flipping logic.

MGFlipView About If you are looking for an easy way of implement 3D flipping view, you are in the right place. MGFlipView allows to create flipping vi

Maciej GomĆ³Å‚ka 47 Sep 28, 2022
Allows a swipe on any part of the screen to start an interruptible pop animation to the previous view

Lazy Pop SwiftUI Swiping on any part of the screen starts an interruptible pop animation to the previous view. Forked from https://github.com/rishi420

Joe Hinkle 150 Dec 18, 2022
Letters animation allows you to click on different letters and accordingly it will animate letters in a cool way. It has a very attractive UI and is very easy to use.

Letters Animation Cool Letters Animation in iOS written in Swift. Preview Table of content :- Description How to add in your project Requirement Licen

MindInventory 31 Oct 4, 2022
Numbers animation allows you to click on different numbers and accordingly it will animate numbers in a cool way. It has a very attractive UI and is very easy to use.

Numbers Animation Cool Numbers Animation in iOS written in Swift. Preview Table of content :- Description How to add in your project Requirement Licen

MindInventory 31 Oct 4, 2022