Simple water drops animation ๐Ÿ’ง

Related tags

Animation WaterDrops
Overview

WaterDrops

Simple water drops animation ๐Ÿ’ง

Example

override func viewDidLoad() {
     super.viewDidLoad()
     
         self.view.backgroundColor = UIColor.white
 
         // custom configuration
         let waterDropsView = WaterDropsView(frame: self.view.frame,
                                           direction: .up,
                                           dropNum: 10,
                                           color: UIColor.red.withAlphaComponent(0.7),
                                           minDropSize: 10,
                                           maxDropSize: 20,
                                           minLength: 50,
                                           maxLength: 100,
                                           minDuration: 4,
                                           maxDuration: 8)
         
         // add animation 
         waterDropsView.addAnimation()
         self.view.addSubview(waterDropsView)
}

Installation

Cocoapods

pod "WaterDrops"

Author

LeFal, [email protected]

License

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

Comments
  • ๋นŒ๋” ํŒจํ„ด ๋ฐ ์˜คํ† ๋ ˆ์ด์•„์›ƒ ๋Œ€์‘

    ๋นŒ๋” ํŒจํ„ด ๋ฐ ์˜คํ† ๋ ˆ์ด์•„์›ƒ ๋Œ€์‘

    ์•ˆ๋…•ํ•˜์„ธ์š”. ์—”๋น„๋ƒฅ ์ž…๋‹ˆ๋‹ค. iOS ๋ฐฉ์— ์˜ฌ๋ ค์ฃผ์‹  ์˜คํ”ˆ์†Œ์Šค ๋ณด๊ณ  ์ˆ˜์ •ํ•ด์„œ ํ’€๋ฆฌํ€˜ ๋ณด๋‚ด๋“œ๋ฆฝ๋‹ˆ๋‹ค. ์ผ๋‹จ ๋นŒ๋” ํŒจํ„ด ์ ์šฉํ•˜์—ฌ init์˜ ๊ฐ ์˜ต์…˜ ์„ค์ •์‹œ ํ•„์š”ํ•œ ๋ถ€๋ถ„๋งŒ ๋ฐ›์„ ์ˆ˜ ์žˆ๊ฒŒ ํ•˜์˜€์Šต๋‹ˆ๋‹ค. ๊ทธ๋ฆฌ๊ณ , frame ์„ ๋ฐ›์„์ˆ˜๋„ ์žˆ์ง€๋งŒ ์˜คํ† ๋ ˆ์ด์•„์›ƒ์„ ์‚ฌ์šฉํ–ˆ์„๋•Œ์—๋„ ๋Œ€์‘์ด ๋˜๋„๋ก ํ•˜์˜€์Šต๋‹ˆ๋‹ค. ๋งˆ์ง€๋ง‰์œผ๋กœ, ์• ๋‹ˆ๋ฉ”์ด์…˜ ์‹œ์ž‘๊ณผ ์ข…๋ฃŒ๋ฅผ ๋งŒ๋“ค์—ˆ์Šต๋‹ˆ๋‹ค. ์ข‹์€ ์†Œ์Šค ๊ฐ์‚ฌ ๋“œ๋ฆฝ๋‹ˆ๋‹ค.

    p.s ์ƒ˜ํ”Œ ํ”„๋กœ์ ํŠธ๋„ ๋งŒ๋“ค์–ด๋†จ์Šต๋‹ˆ๋‹ค ^^

    opened by krazie99 2
  • ๋ฌผ๋ฐฉ์šธ๋“ค์„ UIView ์—์„œ CASharpLayer๋กœ ๋ณ€๊ฒฝ์‹œ์ผœ๋ดค์Šต๋‹ˆ๋‹ค.

    ๋ฌผ๋ฐฉ์šธ๋“ค์„ UIView ์—์„œ CASharpLayer๋กœ ๋ณ€๊ฒฝ์‹œ์ผœ๋ดค์Šต๋‹ˆ๋‹ค.

    ์•ˆ๋…•ํ•˜์„ธ์š”!!!! ์˜ค๋žœ๋งŒ์ž…๋‹ˆ๋‹คใ…œใ…œ ์—ฐํœด๋Š” ์ž˜ ๋ณด๋‚ด์…จ๋Š”์ง€์š”

    Core Animation ๊ณต๋ถ€ํ•˜๋‹ค๊ฐ€ ๊ณต๋ถ€ํ•œ ๋‚ด์šฉ์„ LeFal ๋‹˜ ๊ป˜์„œ ๋งŒ๋“œ์‹  WaterDrops์— ์ ์šฉ์‹œํ‚ค๋ฉด ์ข‹์„๊ฑฐ ๊ฐ™์•„์„œ ํ•œ๋ฒˆ ์ˆ˜์ •ํ•ด๋ดค์Šต๋‹ˆ๋‹ค.

    ๊ธฐ์กด์— ๋ฌผ๋ฐฉ์šธ๋“ค์ด WaterDropView์˜ SubView๋“ค์ด ์—ˆ๋Š”๋ฐ, ์„ฑ๋Šฅ ์ธก๋ฉด์—์„œ ๋ฌผ๋ฐฉ์šธ๋“ค์ด UIView๊ฐ€ ์•„๋‹Œ CALayer ์˜€์œผ๋ฉด ์ข‹๋‹ค๊ณ  ์ƒ๊ฐํ•ด์„œ ๋ฌผ๋ฐฉ์šธ๋“ค์„ CASharpLayer๋กœ ๋ฐ”๊ฟ”๋ดค์Šต๋‹ˆ๋‹ค.

    ์ด๋กœ์ธํ•ด์„œ ๋‘ ๊ฐ€์ง€ ๋ณ€ํ™”๊ฐ€ ์žˆ์—ˆ์Šต๋‹ˆ๋‹ค.

    ์ฒซ์งธ๋Š” ๋ฌผ๋ฐฉ์šธ์ด ๋งŽ์•„์กŒ์„๋•Œ ๋ฉ”๋ชจ๋ฆฌ ์‚ฌ์šฉ๋Ÿ‰ ์ž…๋‹ˆ๋‹ค. lotsofdrops_before

    lotsofdrops_after

    ์‹ค์ œ ์ด๋ ‡๊ฒŒ ๊นŒ์ง€ ๋ฌผ๋ฐฉ์šธ๋“ค์„ ๋งŽ์ด ๋งŒ๋“ค์ง€๋Š” ์•Š๊ฒ ์ง€๋งŒ ๋ฌผ๋ฐฉ์šธ์ด ๋งŽ์•„ ์ง€๋ฉด ๋งŽ์ด ์งˆ์ˆ˜๋ก layer ๋ฅผ ์ƒ์„ฑํ•˜๋Š” ๊ฒƒ ๋ณด๋‹ค view ๋ฅผ ์ƒ์„ฑํ•˜๋Š” ๊ฒƒ์ด ๋ฉ”๋ชจ๋ฆฌ๋ฅผ ๋” ๋งŽ์ด ๋จน๊ฒŒ๋ฉ๋‹ˆ๋‹ค.

    ๋‘๋ฒˆ์งธ๋Š” ๋ฌผ๋ฐฉ์šธ์˜ ๋ชจ์–‘์ž…๋‹ˆ๋‹ค. before

    ์˜๋„ํ•˜์‹ ๊ฑด์ง€๋Š” ์ž˜ ๋ชจ๋ฅด๊ฒ ์ง€๋งŒ ์ „์—๋Š” ๋ฌผ๋ฐฉ์šธ ๋“ค์˜ ๋ชจ์–‘์ด ์™„์ „ ์›์ด ์•„๋‹Œ ์ฝ”๋„ˆ๊ฐ€ ๋‘ฅ๊ทผ ์ง์‚ฌ๊ฐํ˜•์˜ ๋ชจ์–‘์ด์—ˆ์Šต๋‹ˆ๋‹ค.

    after

    UIBezierPath๋ฅผ ์ด์šฉํ•ด์„œ ์ข€๋” ์„ ๋ช…ํ•œ ์›์„ ๋งŒ๋“ค์–ด๋ดค์Šต๋‹ˆ๋‹ค.

    ๋งˆ์ง€๋ง‰์œผ๋กœ ์ข‹์€ ์˜คํ”ˆ์†Œ์Šค ๊ฐ์‚ฌํ•ฉ๋‹ˆ๋‹ค :)

    opened by 5minho 1
  • ๋นŒ๋” ํŒจํ„ด ์ ์šฉ ๋ฐ ์˜คํ† ๋ ˆ์ด์•„์›ƒ ๋Œ€์‘

    ๋นŒ๋” ํŒจํ„ด ์ ์šฉ ๋ฐ ์˜คํ† ๋ ˆ์ด์•„์›ƒ ๋Œ€์‘

    ์•ˆ๋…•ํ•˜์„ธ์š”. ์—”๋น„๋ƒฅ ์ž…๋‹ˆ๋‹ค. iOS ๋ฐฉ์— ์˜ฌ๋ ค์ฃผ์‹  ์˜คํ”ˆ์†Œ์Šค ๋ณด๊ณ  ์ˆ˜์ •ํ•ด์„œ ํ’€๋ฆฌํ€˜ ๋ณด๋‚ด๋“œ๋ฆฝ๋‹ˆ๋‹ค. ์ผ๋‹จ ๋นŒ๋” ํŒจํ„ด ์ ์šฉํ•˜์—ฌ init์˜ ๊ฐ ์˜ต์…˜ ์„ค์ •์‹œ ํ•„์š”ํ•œ ๋ถ€๋ถ„๋งŒ ๋ฐ›์„ ์ˆ˜ ์žˆ๊ฒŒ ํ•˜์˜€์Šต๋‹ˆ๋‹ค. ๊ทธ๋ฆฌ๊ณ , frame ์„ ๋ฐ›์„์ˆ˜๋„ ์žˆ์ง€๋งŒ ์˜คํ† ๋ ˆ์ด์•„์›ƒ์„ ์‚ฌ์šฉํ–ˆ์„๋•Œ์—๋„ ๋Œ€์‘์ด ๋˜๋„๋ก ํ•˜์˜€์Šต๋‹ˆ๋‹ค. ๋งˆ์ง€๋ง‰์œผ๋กœ, ์• ๋‹ˆ๋ฉ”์ด์…˜ ์‹œ์ž‘๊ณผ ์ข…๋ฃŒ๋ฅผ ๋งŒ๋“ค์—ˆ์Šต๋‹ˆ๋‹ค. ์ข‹์€ ์†Œ์Šค ๊ฐ์‚ฌ ๋“œ๋ฆฝ๋‹ˆ๋‹ค.

    opened by krazie99 1
  • ์ด๋Ÿฐ๊ฒƒ๋“ค์„ ์ˆ˜์ •ํ–ˆ์Šต๋‹ˆ๋‹ค.

    ์ด๋Ÿฐ๊ฒƒ๋“ค์„ ์ˆ˜์ •ํ–ˆ์Šต๋‹ˆ๋‹ค.

    • ๊ธฐ์กด์˜ stopAnimation ํ•จ์ˆ˜์—์„œ subView๋“ค์„ ์‚ญ์ œํ•ด์„œ, ์ €๋„ subLayer๋ฅผ ์‚ญ์ œํ•˜๋Š” ๋ฐฉ์‹์œผ๋กœ ๋กœ์ง์„ ๋ณ€๊ฒฝํ–ˆ์Šต๋‹ˆ๋‹ค.

    • background์— ๊ฐ”๋‹ค ์˜ค๋‹ˆ๊นŒ ์• ๋‹ˆ๋ฉ”์ด์…˜์ด ๋ฉˆ์ถฐ๋ฒ„๋ ค์„œ ๊ทธ ๋ถ€๋ถ„์„ ์ˆ˜์ •ํ–ˆ์Šต๋‹ˆ๋‹ค.

    • random ์ˆ˜์น˜๋ฅผ ๊ตฌํ•˜๋Š” ํ•จ์ˆ˜๋ฅผ ๊ณ„์‚ฐ ํ”„๋กœํผํ‹ฐ๋กœ ๋ณ€๊ฒฝํ–ˆ์Šต๋‹ˆ๋‹ค.

    opened by 5minho 0
  • Remove randomWaterdrop function recursive call

    Remove randomWaterdrop function recursive call

    • randomWaterdrop์„ ์žฌ๊ท€ํ˜ธ์ถœ ํ•˜๋„๋ก ๋˜์–ด์žˆ๋Š” ๊ฒƒ์ด ์• ๋‹ˆ๋ฉ”์ด์…˜์˜ ๋ฐ˜๋ณต์„ ์œ„ํ•œ ๊ฒƒ์ฒ˜๋Ÿผ ๋ณด์—ฌ์ง‘๋‹ˆ๋‹ค.
    • ๋งŒ์•ฝ, waterdrop์˜ ์œ„์น˜๋ฅผ ์• ๋‹ˆ๋ฉ”์ด์…˜๋งˆ๋‹ค ๋žœ๋ค์œผ๋กœ ๋ฐ”๊ฟ”์ฃผ๋ ค๊ณ  ํ•˜์…จ๋˜ ๊ฒƒ์ด๋ผ๋ฉด ์ด ํ’€๋ฆฌํ€˜๋ฅผ ๋ฌด์‹œํ•˜์…”๋„ ๋ฉ๋‹ˆ๋‹ค!
    • ๋”ฐ๋ผ์„œ ์žฌ๊ท€ํ˜ธ์ถœ ๊ตฌ๋ฌธ์„ ์ œ๊ฑฐํ•˜๊ณ  ์• ๋‹ˆ๋ฉ”์ด์…˜์˜ repeat ์˜ต์…˜์„ ํ†ตํ•˜์—ฌ ์• ๋‹ˆ๋ฉ”์ด์…˜์„ ๋ฐ˜๋ณตํ•˜๋„๋ก ๋ณ€๊ฒฝํ•ด๋ณด์•˜์Šต๋‹ˆ๋‹ค. (์• ๋‹ˆ๋ฉ”์ด์…˜ completion handler์— ์›๋ž˜์˜ ์ƒํƒœ๋กœ ๋„ฃ์–ด์ฃผ๋Š” ๊ตฌ๋ฌธ์„ ๋นผ๋จน์—ˆ๋„ค์š”!..)
    opened by Hoontopia 0
Releases(0.2.0)
Owner
Oh Hyungjun
Oh Hyungjun
A collection of animations for iOS. Simple, just add water animations.

DCAnimationKit A collection of animations for iOS Simply, just add water! DCAnimationKit is a category on UIView to make animations easy to perform. E

Dalton 797 Sep 23, 2022
Simple calculation to render cheap water effects.

Water Simple calculation to render cheap water effects. This simple project demonstrates : how to use Metal draw compute shader, or known as 'kernal f

Xue Yu 381 Sep 20, 2022
Add smooth water waves to your views.

WXWaveView Add pretty and smooth waves to your views! The wave can be added to any type of view. ไธญๆ–‡่ฏดๆ˜Ž e.g. Integration Cocoapods: pod 'WXWaveView' Or

Welkin Xie 347 Dec 28, 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
A simple spritesheet animation system for Raylib on Swift.

About A simple spritesheet animation system for Raylib on Swift. Aeni allows you to quickly and easily animate your spritesheet in your Raylib for Swi

Conifer 8 Oct 14, 2022
TTouchAnimatedButton is a simple and flexible animation component fully written in Swift

TTouchAnimatedButton is a simple and flexible animation component fully written in Swift. TTouchAnimatedButton is developed to make user feel button click becomes more vivid and realistic.

Nguyen Duc Thinh 2 Aug 18, 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 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
Ease is an event driven animation system that combines the observer pattern with custom spring animations as observers

Ease is an event driven animation system that combines the observer pattern with custom spring animations as observers. It's magic. Features Animate a

Robert-Hein Hooijmans 1.3k Nov 17, 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
Design and prototype customized UI, interaction, navigation, transition and animation for App Store ready Apps in Interface Builder with IBAnimatable.

Design and prototype customized UI, interaction, navigation, transition and animation for App Store ready Apps in Interface Builder with IBAnimatable.

IBAnimatable 8.6k Jan 2, 2023
A Fast Animation Engine with an Intuitive API

Kinieta An Animation Engine for iOS with an Intuitive API and Readable Code! (Written in Swift 4.0.) Why another? I decided to build an Animation Engi

Michael Michailidis 44 Sep 22, 2022
๐ŸŽจ Gradient animation effect like Instagram

Pastel ?? Gradient animation effect like Instagram Example override func viewDidLoad() { super.viewDidLoad() let pastelView = PastelView(fram

Cruz 3.4k Jan 1, 2023
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