This component implements transition animation to crumble view-controller into tiny pieces.

Overview

StarWars Animation

Platform License

This component implements transition animation to crumble view-controller into tiny pieces.

Yalantis

Preview

Check this project on dribbble.

Also, read how it was done in our blog

Requirements

  • iOS 8.0+
  • Xcode 8
  • Swift 4

Installing with CocoaPods

use_frameworks!
pod 'StarWars', '~> 2.0'

Usage

At first, import StarWars:

import StarWars

Then just implement class of UIViewControllerTransitioningDelegate that will return our animation form method animationControllerForDismissedController and assign it to transitioningDelegate of viewController that you want to dismiss.

override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
    let destination = segue.destinationViewController
    destination.transitioningDelegate = self
}

func animationControllerForDismissedController(dismissed: UIViewController) -> UIViewControllerAnimatedTransitioning? {
    return StarWarsGLAnimator()
}

There are also two things you can customize in the Star Wars animation: duration and sprite sizes. Let’s see how you can do this:

let animator = StarWarsGLAnimator()
animator.duration = 2
animator.spriteWidth = 8

Have fun! :)

Let us know!

We’d be really happy if you sent us links to your projects where you use our component. Just send an email to [email protected] And do let us know if you have any questions or suggestion regarding the animation.

P.S. We’re going to publish more awesomeness wrapped in code and a tutorial on how to make UI for iOS (Android) better than better. Stay tuned!

Version history

  • 1.0 Swift 2.0
  • 2.0 Adds Swift 3.0 support
  • 3.0 Adds Swift 4.0 support
  • 4.0 Adds Swift 5.0 support

License

The MIT License (MIT)

Copyright © 2018 Yalantis

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Issues
  • xCode 8 GM and Swift 3

    xCode 8 GM and Swift 3

    Any update for xCode 8 and Swift 3?

    opened by justdan0227 3
  • request for opengl objc animation code

    request for opengl objc animation code

    i read the blog that accompanied this repo about how this animation was created. i saw you originally wrote opengl one it in objc. is there any chance you have that code still and are willing to share it? i love this transition but am not going to use any swift in my current project and plan on trying to rewrite this in objc so it would speed things up tremendously for me.

    sorry if this isnt appropriate avenue to ask. didnt see a comment section on the blog:

    opened by lechium 3
  • Stars animation on intro

    Stars animation on intro

    Some improvement for stars animation on Intro screen, like flying through stars array:

        func randomizeEmitterPosition() {
            let sizeWidth = 1.0*self.bounds.size.height
            let radius =  0 + CGFloat(arc4random()) % sizeWidth;
            emitter.emitterSize = CGSizeMake(radius, radius)
            particle.birthRate = 10 + sqrt(Float(radius))
        }
    
    opened by SoundBlaster 2
  • Expose API To Obj-C

    Expose API To Obj-C

    Any chance you could add the necessary decorations to expose this lib to Obj-C? That would allow us to create a plugin for this module for github.com/nativescript.

    opened by burkeholland 2
  • Content length exceded for GIF

    Content length exceded for GIF

    https://camo.githubusercontent.com/012ac6305c18bc9484d859343d027d3edb762669/68747470733a2f2f79616c616e7469732d636f6d2e73332e616d617a6f6e6177732e636f6d2f75706c6f6164732f636b656469746f722f70696374757265732f34392f636f6e74656e745f737461725f776172732d73686f745f5f315f2e676966

    opened by lfarah 1
  • when i return StarWarsGLAnimator() it is giving me an error saying that,use of unresolved identifier.Is that a bug?

    when i return StarWarsGLAnimator() it is giving me an error saying that,use of unresolved identifier.Is that a bug?

    Report

    The more information you provide, the faster we can help you.

    ⚠️ Select what you want - a feature request or report a bug. Please remove the section you aren't interested in.

    A feature request

    What do you want to add?

    Please describe what you want to add to the component.

    How should it look like?

    Please add images.

    Report a bug

    What did you do?

    Please replace this with what you did.

    What did you expect to happen?

    Please replace this with what you expected to happen.

    What happened instead?

    Please replace this with what happened instead.

    Your Environment

    • Version of the component: insert here
    • Swift version: insert here
    • iOS version: insert here
    • Device: insert here
    • Xcode version: insert here
    • If you use Cocoapods: run pod env | pbcopy and insert here
    • If you use Carthage: run carthage version | pbcopy and insert here

    Project that demonstrates the bug

    Please add a link to a project we can download that reproduces the bug.

    opened by icodechannel 1
  • plan to support Swift 4

    plan to support Swift 4

    Do you have plan to support Swift 4?

    opened by phpmaple 1
  • Feature/swift 4.2

    Feature/swift 4.2

    Closes #12 Happy Hacktoberfest!

    opened by serejahh 1
  • View Issues

    View Issues

    After dismissing view, could not get back first view controller's View as screen returns black

    opened by Roushil 1
  • StarWarsAnimator: try to make snapshot blurEffect and corner

    StarWarsAnimator: try to make snapshot blurEffect and corner

    I try make the snapshots in dismiss animation have blurEffect and corner. let snapshot = (fromViewSnapshot!.resizableSnapshotView(from: snapshotRegion, afterScreenUpdates: false, withCapInsets: UIEdgeInsets.zero))!

    blurEffect: I just add UIVisualEffectView to fromView and then let fromViewSnapshot = fromView?.snapshotView(afterScreenUpdates: true) this work well. all snapshot blurEffect.

    but make snapshot corner I fail.

    first i just use this snapshot.layer.cornerRadius = width / 2 snapshot.layer.masksToBounds = true but this have performance problems.

    I try to solve this by use UIGraphicsGetCurrentContext clip the snapshot. by use first. clip snapshot to image like http://stackoverflow.com/questions/25444609/screenshot-in-swift-ios. then clip image. and add image to imageview. at last. add it to containerView but it not work. I do not know where is wrong.

    sorry about my poor English.

    status: invalid 
    opened by csjlengxiang 0
  • Trigger Animation Programmatically For View

    Trigger Animation Programmatically For View

    I noticed that on the Android implementation of this lib, there is an API for triggering the animation on any view...

    mTilesFrameLayout.startAnimation();
    

    Is it possible to do the same on iOS for a given View Controller? Instead of just attaching it to the segue.

    Burke

    opened by burkeholland 1
Releases(4.0)
Owner
Yalantis
Knowledge is power and the way to get power is by sharing knowledge. We are open source because this is a smart way to live, work and play.
Yalantis
Custom animation transition for present modal view controller

ZFDragableModalTransition Usage - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { TaskDetailViewController *detailViewControl

Amornchai Kanokpullwad 2.5k Jan 4, 2022
Appstore card animation transition. UICollectionView and UITableView card expand animated transition for iOS

appstore-card-transition Appstore card animation transition. UICollectionView and UITableView card expand animated transition. This library tries to a

appssemble 499 Jan 13, 2022
A UIKit custom transition that simulates an elastic drag.This is the Objective-C Version of Elastic Transition written in Swift by lkzhao

ElasticTransition ObjC Version This is the Objective-C Version of Elastic Transition written in Swift by lkzhao https://github.com/lkzhao/ElasticTrans

Matteo Tagliafico 397 Aug 18, 2021
A custom modal transition that presents a controller with an expanding effect while sliding out the presenter remnants.

DAExpandAnimation A custom modal transition that presents a controller with an expanding effect while sliding out the presenter remnants. Screenshot I

Denis Avdeev 584 Nov 23, 2021
A custom modal transition that presents and dismiss a controller with an expanding bubble effect.

A custom modal transition that presents and dismiss a controller inside an expanding and shrinking bubble. Screenshot Usage Install through CocoaPods:

Andrea Mazzini 3.3k Jan 4, 2022
Custom transition between controllers. Settings controller for your iOS app.

SPLarkController About Transition between controllers to top. You can change animatable height after presentation controller. For presentation and dis

Ivan Vorobei 897 Dec 23, 2021
A custom zooming transition animation for UIViewController

RMPZoomTransitionAnimator Overview RMPZoomTransitionAnimator provide a custom transition zooming animation. Not only UICollectionView, this is possibl

Recruit Marketing Partners Co.,Ltd 1.7k Dec 24, 2021
UIViewController extension to present view / view controller as bottom-half modal.

UIViewController extension to present view / view controller as bottom-half modal. Installation CocoaPods pod 'SemiModalViewController' Swift Package

muyexi 79 Dec 9, 2021
Zoom transition that animates the entire view heirarchy. Used extensively in the Zola iOS application.

ZOZolaZoomTransition ZOZolaZoomTransition is a zoom transition that animates the entire view heirarchy. It is used extensively in the Zola iOS applica

Zola 914 Jan 7, 2022
Custom presenters and better view controller presentation for iOS

PresenterKit Custom presenters and better view controller presentation for iOS Requirements Xcode 12.0+ Swift 5.3+ iOS 11.0+ SwiftLint Installation Co

Jesse Squires 561 Nov 21, 2021
AlertTransition is a extensible library for making view controller transitions, especially for alert transitions.

AlertTransition AlertTransition is a extensible library for making view controller transitions, especially for alert transitions. Overview AlertTransi

Loopeer 571 Dec 22, 2021
A UIKit custom transition that simulates an elastic drag. Written in Swift.

ElasticTransition (Swift 3) A UIKit custom modal transition that simulates an elastic drag. Written in Swift. ###Thanks to Matt Garnett (@c-o-l-o-r) f

Luke Zhao 2.2k Dec 17, 2021
An iOS transition for controllers based on material design.

JTMaterialTransition An iOS transition for controllers based on material design. Installation With CocoaPods, add this line to your Podfile. pod 'JTMa

Jonathan Vukovich-Tribouharet 968 Jan 4, 2022
Screen transition with safe and clean code.

Presenter Screen transition with safe and clean code. With Presenter, you can… Assure that the ViewController's requirements are met, such as a ViewMo

Muukii 14 Aug 25, 2020
Elegant transition library for iOS & tvOS

Hero is a library for building iOS view controller transitions. It provides a declarative layer on top of the UIKit's cumbersome transition APIs—makin

Hero Transitions 20.6k Jan 12, 2022
A delightful way to transition between visual styles in your iOS applications.

What is Gagat? Gagat is a small Swift library that makes it easy to add a delightful, interactive way to switch between two different themes in your i

Tim Andersson 880 Dec 27, 2021
A library to recreate the iOS Apple Music now playing transition

DeckTransition DeckTransition is an attempt to recreate the card-like transition found in the iOS 10 Apple Music and iMessage apps. Hereʼs a GIF showi

Harshil Shah 2.2k Jan 5, 2022
Simple and elegant Dropdown Transition

Simple and elegant dropdown transition for iOS Why? I needed to perform the dropdown transition in the app I was building and I've found many great li

Aidar Nugmanoff 59 Dec 22, 2021
Custom interactive transition like Apple Music iOS App (iOS 9). written in Swift.

MusicPlayerTransition Custom interactive transition like Apple Music iOS App. written in Swift. Demo See demo on Appetize.io Using Transition Animator

Airin 640 Dec 29, 2021