explaingit

yalantis/starwars.ios

3,770SwiftAudience · developerComplexity · 2/5LicenseSetup · easy

TLDR

StarWars.iOS is a Swift library that adds a dramatic crumble-to-dust dismiss animation to your iOS app, when a screen closes, it shatters into hundreds of scattered fragments using OpenGL rendering.

Mindmap

mindmap
  root((StarWars iOS))
    What it does
      Screen crumble effect
      Particle animation
      View dismissal
    Tech
      Swift
      OpenGL rendering
      UIKit integration
    Customization
      Fragment size
      Animation duration
    Setup
      CocoaPods install
      Delegate wiring
      iOS 8 minimum
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Add a visually striking dismiss animation to any iOS view controller with minimal code changes

USE CASE 2

Customize the fragment size and duration to create either a fine-dust or chunky-shatter look

USE CASE 3

Study OpenGL-based iOS animation as an alternative approach to standard UIKit transitions

Tech stack

SwiftiOSOpenGLCocoaPods

Getting it running

Difficulty · easy Time to first run · 30min

Requires iOS 8.0 or later, add one line to your Podfile and run pod install to get started.

MIT license, use freely for any purpose including commercial apps, just keep the copyright notice.

In plain English

StarWars.iOS is a Swift library for iOS that adds a visual transition effect to your app. When a screen is dismissed, the animation breaks it apart into a shower of tiny fragments that scatter and disappear, giving the impression that the view is crumbling into dust. The effect is rendered using OpenGL rather than the standard UIKit animation system, which is how the library achieves the particle-level detail. To add it to an iOS project, you include it as a CocoaPods dependency with one line in your Podfile. In code, you hook into the iOS transition system by implementing a delegate object that returns the library's animator when a view controller is being dismissed. Once that is wired up, the animation runs automatically whenever the screen is closed. The library exposes two settings you can adjust: the duration of the animation and the size of the individual sprite pieces the screen breaks into. Smaller sprites produce a finer, more granular crumble effect, while larger ones give a chunkier look. The defaults work out of the box without any configuration. The library requires iOS 8.0 or later and was built with Swift. The version history tracks updates through Swift 2, 3, 4, and 5 compatibility releases. It is distributed under the MIT license and was created by Yalantis, a mobile design and development studio. A blog post on the Yalantis website documents the technical choices behind the animation, comparing UIKit animations, UIDynamics, and OpenGL as approaches for this kind of visual effect.

Copy-paste prompts

Prompt 1
I've added StarWars.iOS via CocoaPods. Show me the exact Swift code to implement the crumble dismiss animation on a UIViewController, including the transition delegate setup.
Prompt 2
How do I configure StarWars.iOS so the fragments are very small for a fine dust effect and the animation lasts 1.5 seconds? Show me the property names and values to set.
Prompt 3
I want to trigger the StarWars.iOS crumble animation on a button tap rather than a swipe gesture. Write the Swift code to dismiss a view controller and play the animation programmatically.
Open on GitHub → Explain another repo

← yalantis on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.