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.

Comments
  • 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
  • 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
  • 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
  • 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
  • Content length exceded for GIF

    Content length exceded for GIF

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

    opened by lfarah 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
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 Dec 28, 2022
SPLarkController - 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 965 Dec 17, 2022
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 21.2k Jan 3, 2023
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 642 Nov 17, 2022
This is a Swift based demo project to show how to make the transition Pinterest liked.

PinterestSwift Compatible with Xcode 11 / Swift 5.0 This is a Swift based demo project to show how to make the transition Pinterest 2.0+ liked. Refer

Nicholas Tau 1.9k Dec 20, 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 63 Sep 22, 2022
Now playing controller from Apple Music, Mail & Podcasts Apple's apps.

SPStorkController About Controller as in Apple Music, Podcasts and Mail apps. Help if you need customize height or suppport modal style in iOS 12. Sim

Ivan Vorobei 2.6k Jan 4, 2023
Library for smooth animation of images during transitions.

ImageTransition ImageTransition is a library for smooth animation of images during transitions. Something looks like below: e.g. UIImageView e.g. UIIm

shtnkgm 207 Dec 3, 2022
Use PanGesture to dismiss view on UIViewController and UIView

PanSlip Use PanGesture to dismiss view on UIViewController and UIView. Introduction PanSlip to UIViewController left to right right to left top to bot

DongHee Kang 101 Dec 10, 2022
A Splash view that animates and reveals its content, inspired by Twitter splash

RevealingSplashView A Splash view that animates and reveals its content, inspired by the Twitter splash. ⭐ Features Customizable reveal icon image. Cu

Chris Jimenez 1.2k Jan 4, 2023
Inspired by Fabric - Answers animation. Allows to "build" given view with pieces. Allows to "destroy" given view into pieces

ADPuzzleAnimation Whats inside Custom animation for UIView inspired by Fabric - Answers animation. Easy to use To create your first animation you need

Anton 126 Dec 25, 2022
Appstore card animation transition. UICollectionView and UITableView card expand animated transition

Appstore card animation transition. UICollectionView and UITableView card expand animated transition. This library tries to add the appstore transition to your own app. The goal is to be as simple as possible to integrate in an app while keeping the flexibility and customization alive.

appssemble 544 Dec 28, 2022
Custom-Transition - A repo about custom transition between two view controllers

Custom-Transition in SWIFT This is a repo about custom transition between two vi

Prakash Chandra Awal 0 Jan 6, 2022
Transition from any SwiftUI Text view into an inline navigation bar title when the view is scrolled off-screen, as seen in Apple's TV & TestFlight iOS apps.

SwiftUI Matched Inline Title Transition from any SwiftUI Text view into an inline navigation bar title when the view is scrolled off-screen, as seen i

Seb Jachec 19 Oct 9, 2022
UIDevice extensions that fill in the missing pieces.

UIDeviceComplete is an iOS library intended to be a collection of extensions to UIDevice that provides functionality that UIDevice currently lacks like determining which iOS device you have (i.e iPhone X, iPhone 8, iPhone SE, iPad Pro, iPhone 7 etc) or determining the screen size of the device in inches.

Nicholas Maccharoli 408 Dec 11, 2022
UIDevice extensions that fill in the missing pieces.

UIDeviceComplete UIDevice extensions that fill in the missing pieces. Whats this library about? UIDeviceComplete is an iOS library intended to be a co

Nicholas Maccharoli 408 Dec 11, 2022
JSONHelper - ✌ Convert anything into anything in one operation; JSON data into class instances, hex strings into UIColor/NSColor, y/n strings to booleans, arrays and dictionaries of these; anything you can make sense of!

JSONHelper Convert anything into anything in one operation; hex strings into UIColor/NSColor, JSON strings into class instances, y/n strings to boolea

Baris Sencan 788 Jul 19, 2022
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

Yansong Li 775 Dec 7, 2022
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 Dec 28, 2022