{"id":18250574,"url":"https://github.com/urtaq/urweatherview","last_synced_at":"2025-04-06T11:10:31.951Z","repository":{"id":56925277,"uuid":"88967109","full_name":"Urtaq/URWeatherView","owner":"Urtaq","description":"Show the weather effects onto view written in Swift4.2","archived":false,"fork":false,"pushed_at":"2019-01-07T11:50:57.000Z","size":121423,"stargazers_count":448,"open_issues_count":1,"forks_count":35,"subscribers_count":11,"default_branch":"master","last_synced_at":"2024-05-29T04:51:02.886Z","etag":null,"topics":["carthage","cloud","cocoapods","dust","glsl-shaders","hot","image-kernel","lightning","lottie","rain","snow","swift","wavewarp","weather"],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Urtaq.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-04-21T09:28:48.000Z","updated_at":"2024-04-20T05:25:08.000Z","dependencies_parsed_at":"2022-08-20T22:50:30.755Z","dependency_job_id":null,"html_url":"https://github.com/Urtaq/URWeatherView","commit_stats":null,"previous_names":["jegumhon/urweatherview"],"tags_count":20,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Urtaq%2FURWeatherView","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Urtaq%2FURWeatherView/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Urtaq%2FURWeatherView/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Urtaq%2FURWeatherView/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Urtaq","download_url":"https://codeload.github.com/Urtaq/URWeatherView/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247471521,"owners_count":20944158,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["carthage","cloud","cocoapods","dust","glsl-shaders","hot","image-kernel","lightning","lottie","rain","snow","swift","wavewarp","weather"],"created_at":"2024-11-05T09:45:14.450Z","updated_at":"2025-04-06T11:10:31.929Z","avatar_url":"https://github.com/Urtaq.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# URWeatherView\n[![Awesome](https://cdn.rawgit.com/sindresorhus/awesome/d7305f38d29fed78fa85652e3a63e154dd8e8829/media/badge.svg)](https://github.com/sindresorhus/awesome) [![Swift](https://img.shields.io/badge/Swift-4.2%2B-orange.svg)](https://swift.org) [![podplatform](https://cocoapod-badges.herokuapp.com/p/URWeatherView/badge.png)](https://cocoapod-badges.herokuapp.com/p/URWeatherView/badge.png) [![pod](https://cocoapod-badges.herokuapp.com/v/URWeatherView/badge.png)](https://cocoapods.org/pods/URWeatherView) ![poddoc](https://img.shields.io/cocoapods/metrics/doc-percent/URWeatherView.svg) ![license](https://cocoapod-badges.herokuapp.com/l/URWeatherView/badge.png) [![CocoaPods compatible](https://img.shields.io/badge/CocoaPods-compatible-4BC51D.svg?style=flat)](https://github.com/CocoaPods/CocoaPods) [![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage) [![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Fjegumhon%2FURWeatherView.svg?type=shield)](https://app.fossa.io/projects/git%2Bgithub.com%2Fjegumhon%2FURWeatherView?ref=badge_shield)\n\u003c!-- ![travis](https://travis-ci.org/jegumhon/URWeatherView.svg?branch=master) [![codecov](https://codecov.io/gh/jegumhon/URWeatherView/branch/master/graph/badge.svg)](https://codecov.io/gh/jegumhon/URWeatherView) --\u003e\n\n## What is this for?\nShowing some kinds of the weather effect, written in **Swift4.2**.  \n\nThis code style is the **`Protocol Oriented Programming`**.\n\nTo show the vector animation made by After Effect, [Lottie](http://airbnb.design/lottie/) can be used instead of UIImageView.\n\n## Before using URWeatherView, Which resources do you need?\n#### 1. main image or main lottie resource (Required)\n - The weather effect's main target\n - apply tone curve filter or gradient mask\n#### 2. backgroundImage of main (Optional)\n - The weather effect's background Image\n#### 3. upperImage of main (Optional)\n - The weather effect's upper Image\n - If you want extra effect, you can use it.\n\n### Usable Weather Effects\n\n#### 1. Snow\n![sample](https://github.com/jegumhon/URWeatherView/blob/master/Artwork/URWeather_snow.gif?raw=true)\n\n#### 2. Rain\n![sample](https://github.com/jegumhon/URWeatherView/blob/master/Artwork/URWeather_rain.gif?raw=true)\n\n#### 3. Dust\n  * #1  \n![sample_dust1](https://github.com/jegumhon/URWeatherView/blob/master/Artwork/URWeather_dust1.gif?raw=true)\n  * #2  \n![sample_dust2](https://github.com/jegumhon/URWeatherView/blob/master/Artwork/URWeather_dust2.gif?raw=true)\n\n#### 4. Lightning\n![sample_lightning](https://github.com/jegumhon/URWeatherView/blob/master/Artwork/URWeather_lightning.gif?raw=true)\n\n#### 5. Hot\n![sample_hot](https://github.com/jegumhon/URWeatherView/blob/master/Artwork/URWeather_hot_with_wavewarp.gif?raw=true)\n\n#### 6. Cloudy\n![sample_cloudy](https://github.com/jegumhon/URWeatherView/blob/master/Artwork/URWeather_cloudy.gif?raw=true)\n\n## Used library stack\n#### [SpriteKit](https://developer.apple.com/spritekit/)  \n#### [CIFilter](https://github.com/airbnb/lottie-ios) \u0026  [CIKernel](https://developer.apple.com/documentation/coreimage/cikernel) \u0026 [Core Imager Kernel Language(like GLSL)](https://developer.apple.com/library/content/documentation/GraphicsImaging/Reference/CIKernelLangRef/ci_gslang_ext.html)  \n#### [Lottie](https://github.com/airbnb/lottie-ios)  \n  * I needed to apply color filter for the weather effect.  \n    So, I made custom Lottie library to get some properties from LOTAnimationView.\n  * It's [lottie-ios-extension](https://github.com/jegumhon/lottie-ios).\n\n## Requirements\n\n* iOS 10.0+\n* Swift 4.2+ (Swift 3.x version is [v0.6.4](https://github.com/jegumhon/URWeatherView/tree/0.6.4))\n\n## Installation\n\n### Cocoapods\n\nAdd the following to your `Podfile`.\n\n    pod \"URWeatherView\"\n    \n#### Dependency\n\n[lottie-ios-extension](https://github.com/jegumhon/lottie-ios)  \n(But, you don't need to care about this, when using URWeatherView. It's already included the dependency.)\n\n### Carthage\n\nAdd the following to your `Cartfile`.\n\n    github \"jegumhon/URWeatherView\"\n    \n#### Dependency\n\n[lottie-ios-extension](https://github.com/jegumhon/lottie-ios)  \n(But, you don't need to care about this, when using URWeatherView. It's already included the dependency.)\n\n## Examples\n\nSee the `Example` folder.  \nRun `pod install` and open the .xcworkspace.  \n(The Example source is made for using Carthage.  \nSo, you remove the linked frameworks in `General` of the project settings.  \nAnd then, you remove the run script of Carthage in `Build Phases` of the project settings.)  \nor  \nRun `carthage update` and open the .xcodeproj.\n\n## Usage\n\n```swift\nimport URWeatherView\n```\n\n#### 1. initialize the weather view\n```swift\n    // for example...\n        \n    // You can use the xib or storyboard to show the URWeatheView...\n    @IBOutlet var mainView: URWeatherView!\n    \n    override func viewDidLoad() {\n        super.viewDidLoad()\n        \n        // set the main Image to apply the weather effects...\n        // and set the backgroundImage, if you want to apply...\n        self.mainView.initView(mainWeatherImage: #imageLiteral(resourceName: \"buildings\"), backgroundImage: #imageLiteral(resourceName: \"bluesky.en\"))\n        \n        // or, to use Lottie, do like below..\n        // self.mainView.initView(dataNameOfLottie: \"data\", backgroundImage: #imageLiteral(resourceName: \"bluesky.en\"))\n    }\n```\n\n##### 1.1. How to use Lottie\n* You can find the detail Lottie usage guide at the [Lottie-iOS](https://github.com/airbnb/lottie-ios)\n* add the lottie files in the project, and then just use the json file name to load the Lottie View\n\n#### 2. show or remove the weather effects\n```swift\n    func showWeather() {\n        let weather: URWeatherType = .cloudy\n        self.mainView.startWeatherSceneBulk(weather, debugOption: true, additionalTask: {\n            // task what you want to do after showing the weather effect...\n        })\n    }\n    \n    func removeWeather() {\n        self.mainView.stop()\n    }\n```\n\n#### 3. 😀 Configurable parameters of URWeatherView 😀\nUsing or composing the functions in the URWeatherView, you can customize the weather effects.\nThe default configurable parameters are like below.\n* **birthRate** : The particle's birth rate. This is used in the effects. e.g. Snow, Rain, Dust, Cloud.\n* **upperImage** : The image onto the weather view. (optional)\n* **duration** : The duration(in second). applied some effects among the URWeatherView's effects.\n* **debugOption** : enable to show the debug option of SpriteKit's. Default is \"false\". This is for the SpriteKit frame checking.\n* **cloud effect's option** : especially, you can customize the cloud effect with this structure. The sample codes is included in the example codes. Or you can see the codes below.\n```swift\n    case .cloudy:\n    //    self.mainView.startWeatherSceneBulk(cell.weather, duration: 33.0, debugOption: self.segment.selectedSegmentIndex == 0)\n\n        self.mainView.initWeather()\n        self.mainView.setUpperImageEffect(customImage: nil)\n        let option = UREffectCloudOption(CGRect(x: 0.0, y: 0.5, width: 1.0, height: 0.5), angleInDegree: 0.0, movingDuration: 33.0)\n        self.mainView.startWeatherScene(cell.weather, duration: 33.0, userInfo: [URWeatherKeyCloudOption: option])\n```\n\n## To-Do\n\n- [ ] exchange the Core Image Kernel to [Metal](https://developer.apple.com/metal/).\n\n## License\n\nURWeatherView is available under the MIT license. See the [LICENSE](LICENSE) file for more info.\n\n\n[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Fjegumhon%2FURWeatherView.svg?type=large)](https://app.fossa.io/projects/git%2Bgithub.com%2Fjegumhon%2FURWeatherView?ref=badge_large)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Furtaq%2Furweatherview","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Furtaq%2Furweatherview","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Furtaq%2Furweatherview/lists"}