☄️Comets: Animating Particles in Swift

Overview

Comets

☄️ Comets: Animating Particles in Swift

Swift Version License Platform Carthage compatible

comet.gif

animation made by kevin as part of Voicy design

implements Bennet van der Linden medium Comets: Animating Particles in Swift

Example

// Customize your comet
let width = view.bounds.width
let height = view.bounds.height
let comets = [Comet(startPoint: CGPoint(x: 100, y: 0),
                    endPoint: CGPoint(x: 0, y: 100),
                    lineColor: UIColor.white.withAlphaComponent(0.2),
                    cometColor: UIColor.white),
              Comet(startPoint: CGPoint(x: 0.4 * width, y: 0),
                    endPoint: CGPoint(x: width, y: 0.8 * width),
                    lineColor: UIColor.white.withAlphaComponent(0.2),
                    cometColor: UIColor.white),
              Comet(startPoint: CGPoint(x: 0.8 * width, y: 0),
                    endPoint: CGPoint(x: width, y: 0.2 * width),
                    lineColor: UIColor.white.withAlphaComponent(0.2),
                    cometColor: UIColor.white),
              Comet(startPoint: CGPoint(x: width, y: 0.2 * height),
                    endPoint: CGPoint(x: 0, y: 0.25 * height),
                    lineColor: UIColor.white.withAlphaComponent(0.2),
                    cometColor: UIColor.white),
              Comet(startPoint: CGPoint(x: 0, y: height - 0.8 * width),
                    endPoint: CGPoint(x: 0.6 * width, y: height),
                    lineColor: UIColor.white.withAlphaComponent(0.2),
                    cometColor: UIColor.white),
              Comet(startPoint: CGPoint(x: width - 100, y: height),
                    endPoint: CGPoint(x: width, y: height - 100),
                    lineColor: UIColor.white.withAlphaComponent(0.2),
                    cometColor: UIColor.white),
              Comet(startPoint: CGPoint(x: 0, y: 0.8 * height),
                    endPoint: CGPoint(x: width, y: 0.75 * height),
                    lineColor: UIColor.white.withAlphaComponent(0.2),
                    cometColor: UIColor.white)]

// draw line track and animate
for comet in comets {
    view.layer.addSublayer(comet.drawLine())
    view.layer.addSublayer(comet.animate())
}

comet.gif

Requirements

Comets is written in Xcode 10, Swift 5.0, iOS 9.0 Required

📲 Installation

Comets is available through Cocoapods or Carthage.

Cocoapods

pod "Comets"

Carthage

github "cruisediary/Comets" ~> 0.3.1

❤️ Contribution

Pull requests are always welcomed 🏄🏼

👨‍💻 Author

cruz, [email protected]

🛡 License

Comets is available under the MIT license. See the LICENSE file for more info.

You might also like...
A fantastic Physical animation library for swift
A fantastic Physical animation library for swift

A fantastic Physical animation library for swift(Not Just Spring !!!), it is base on UIDynamic and extension to it, friendly APIs make you use it or c

 A slider widget with a popup bubble displaying the precise value selected written on Swift.
A slider widget with a popup bubble displaying the precise value selected written on Swift.

A slider widget with a popup bubble displaying the precise value selected written on Swift. We specialize in the designing and coding of

Navigation toolbar is a Swift slide-modeled UI navigation controller.
Navigation toolbar is a Swift slide-modeled UI navigation controller.

Navigation toolbar is a Swift slide-modeled UI navigation controller. We specialize in the designing and coding of custom UI for Mo

Animate easy and with less code with Swift
Animate easy and with less code with Swift

JDAnimationKit is designed to be extremely easy to use. You can animate your UI withe less lines of code. This library use internally POP framework, a

A simple animated progress bar in Swift
A simple animated progress bar in Swift

DSGradientProgressView Introduction DSGradientProgressView is a simple and customizable animated progress bar written in Swift. Inspired by GradientPr

Composable animations in Swift

Composable animations in Swift. Blog Installation Cocoapods The easiest way to get started is to use CocoaPods. Just add the following line to your Po

Gravity is a simple Swift Package Manager to add gravity to UI objects easily.
Gravity is a simple Swift Package Manager to add gravity to UI objects easily.

Gravity -- Gravity is a simple Swift Package to add gravity to UI objects easily. -- How to use: Add a new Swift Package from XCode and paste the url

Swift animation made easy
Swift animation made easy

Fluent Swift Animations made Easy Installation Add the following to your Podfile and run pod install pod 'Fluent', '~ 0.1' or add the following

Declarative chainable animations in Swift
Declarative chainable animations in Swift

Wave Declarative chainable animations in Swift ❤️ Support my apps ❤️ Push Hero - pure Swift native macOS application to test push notifications PasteP

Comments
  • Error while run the Example project

    Error while run the Example project

    image

    Showing All Messages :-1: /Comets-master/Example/Pods/Pods/Target Support Files/Pods-Example/Pods-Example.debug.xcconfig: unable to open file (in target "Example" in project "Example") (in target 'Example')

    opened by libern 1
  • Add comet example

    Add comet example

    simulator screen shot - iphone xr - 2018-10-22 at 00 18 17

    iPhone XR simulated for add example #2

    How to use

    // Customize your comet
    let width = view.bounds.width
    let height = view.bounds.height
    let comets = [Comet(startPoint: CGPoint(x: 100, y: 0),
                        endPoint: CGPoint(x: 0, y: 100),
                        lineColor: UIColor.white.withAlphaComponent(0.2)),
                  Comet(startPoint: CGPoint(x: 0.4 * width, y: 0),
                        endPoint: CGPoint(x: width, y: 0.8 * width),
                        lineColor: UIColor.white.withAlphaComponent(0.2)),
                  Comet(startPoint: CGPoint(x: 0.8 * width, y: 0),
                        endPoint: CGPoint(x: width, y: 0.2 * width),
                        lineColor: UIColor.white.withAlphaComponent(0.2)),
                  Comet(startPoint: CGPoint(x: width, y: 0.2 * height),
                        endPoint: CGPoint(x: 0, y: 0.25 * height),
                        lineColor: UIColor.white.withAlphaComponent(0.2)),
                  Comet(startPoint: CGPoint(x: 0, y: height - 0.8 * width),
                        endPoint: CGPoint(x: 0.6 * width, y: height),
                        lineColor: UIColor.white.withAlphaComponent(0.2)),
                  Comet(startPoint: CGPoint(x: width - 100, y: height),
                        endPoint: CGPoint(x: width, y: height - 100),
                        lineColor: UIColor.white.withAlphaComponent(0.2)),
                  Comet(startPoint: CGPoint(x: 0, y: 0.8 * height),
                        endPoint: CGPoint(x: width, y: 0.75 * height),
                        lineColor: UIColor.white.withAlphaComponent(0.2))]
            
    // draw track and animate
    for comet in comets {
        view.layer.addSublayer(comet.drawLine())
        view.layer.addSublayer(comet.animate())
    }
    
    opened by cruisediary 0
Releases(0.3.1)
Owner
Cruz
🏄🏼 Open Source | iOS & Swift 📱+ ⛵️ engineer at @hyperconnect
Cruz
This library for animating text. Developed with SwiftUI. This library supports iOS/macOS.

AnimateText This library for animating text. Developed with SwiftUI. This library supports iOS/macOS. Screenshot AnimateText.mp4 Example https://fabul

jasu 123 Jan 2, 2023
A DSL to make animation easy on iOS with Swift.

This project is highly inspired by JHChainableAnimations, If you project is developed with Objective-C, use JHChainableAnimations instead. With DKChai

Draven 1.9k Dec 9, 2022
A Swift library to take the power of UIView.animateWithDuration(_:, animations:...) to a whole new level - layers, springs, chain-able animations and mixing view and layer animations together!

ver 2.0 NB! Breaking changes in 2.0 - due to a lot of requests EasyAnimation does NOT automatically install itself when imported. You need to enable i

Marin Todorov 3k Dec 27, 2022
Elegant SVG animation kit for swift

Elephant This is SVG animation presentation kit for iOS. Example You can run example app. Please open Example-iOS/Elephant-iOS.xcworkspace! Usage You

Kazumasa Shimomura 127 Dec 14, 2022
Gemini is rich scroll based animation framework for iOS, written in Swift.

Overview What is the Gemini? Gemini is rich scroll based animation framework for iOS, written in Swift. You can easily use GeminiCollectionView, which

Shohei Yokoyama 3k Dec 27, 2022
Swift interpolation for gesture-driven animations

Interpolate Interpolate is a powerful Swift interpolation framework for creating interactive gesture-driven animations. Usage The ?? idea of Interpola

Roy Marmelstein 1.8k Dec 20, 2022
Pulse animation for iOS written with Swift.

Pulsator Pulse animation for iOS written with Swift. Great For: Pulses of Bluetooth, BLE, beacons (iBeacon), etc. Map Annotations Installation CocoaPo

Shuichi Tsutsumi 1.3k Jan 6, 2023
A library to simplify iOS animations in Swift.

Updated for Swift 4.2 Requires Xcode 10 and Swift 4.2. Installation Drop in the Spring folder to your Xcode project (make sure to enable "Copy items i

Meng To 14k Jan 3, 2023
Better Easing for SpriteKit in Swift

This easing library began life as a port of buddingmonkey's Objective C SpriteKit Easing library to Swift. This library extends upon the basic easing

Craig Grummitt 110 Dec 17, 2022
Swift library for choreographing animations on the screen.

Spruce iOS Animation Library (and Android) What is it? Spruce is a lightweight animation library that helps choreograph the animations on the screen.

WillowTree, LLC 3.4k Jan 3, 2023