All Projects → jegumhon → Urweatherview

jegumhon / Urweatherview

Licence: mit
Show the weather effects onto view written in Swift4.2

Programming Languages

swift
15916 projects

Projects that are alternatives of or similar to Urweatherview

Forecastio
A Swift library for the Forecast.io Dark Sky API
Stars: ✭ 164 (-62.64%)
Mutual labels:  weather, cocoapods, carthage
Taggerkit
🏷 TaggerKit helps you to quickly implement tags in your UIKit apps, so you can go on and test your idea without having to worry about logic and custom collection layouts.
Stars: ✭ 390 (-11.16%)
Mutual labels:  cocoapods, carthage
Arslineprogress
iOS progress bar, replacement for the default activity indicator.
Stars: ✭ 434 (-1.14%)
Mutual labels:  cocoapods, carthage
Chromacolorpicker
🎨 An intuitive iOS color picker built in Swift.
Stars: ✭ 434 (-1.14%)
Mutual labels:  cocoapods, carthage
Foldingtabbar.ios
Folding Tab Bar and Tab Bar Controller
Stars: ✭ 3,677 (+737.59%)
Mutual labels:  cocoapods, carthage
Restofire
Restofire is a protocol oriented networking client for Alamofire
Stars: ✭ 377 (-14.12%)
Mutual labels:  cocoapods, carthage
Coding Ios
CODING iOS 客户端源代码
Stars: ✭ 3,771 (+759%)
Mutual labels:  cocoapods, carthage
Ssspinnerbutton
Forget about typical stereotypic loading, It's time to change. SSSpinnerButton is an elegant button with a diffrent spinner animations.
Stars: ✭ 357 (-18.68%)
Mutual labels:  cocoapods, carthage
Gradientcircularprogress
Customizable progress indicator library in Swift
Stars: ✭ 407 (-7.29%)
Mutual labels:  cocoapods, carthage
Simpleimageviewer
A snappy image viewer with zoom and interactive dismissal transition.
Stars: ✭ 408 (-7.06%)
Mutual labels:  cocoapods, carthage
Swiftyxmlparser
Simple XML Parser implemented in Swift
Stars: ✭ 413 (-5.92%)
Mutual labels:  cocoapods, carthage
Tweetextfield
Lightweight set of text fields with nice animation and functionality. 🚀 Inspired by https://uimovement.com/ui/2524/input-field-help/
Stars: ✭ 421 (-4.1%)
Mutual labels:  cocoapods, carthage
Circularprogress
Circular progress indicator for your macOS app
Stars: ✭ 366 (-16.63%)
Mutual labels:  cocoapods, carthage
Vgplayer
📺 A simple iOS video player by Vein.
Stars: ✭ 383 (-12.76%)
Mutual labels:  cocoapods, carthage
Xcglogger
A debug log framework for use in Swift projects. Allows you to log details to the console (and optionally a file), just like you would have with NSLog() or print(), but with additional information, such as the date, function name, filename and line number.
Stars: ✭ 3,710 (+745.1%)
Mutual labels:  cocoapods, carthage
Stepslider
StepSlider its custom implementation of slider such as UISlider for preset integer values.
Stars: ✭ 391 (-10.93%)
Mutual labels:  cocoapods, carthage
Uitextfield Navigation
🏄‍♂️ UITextField-Navigation makes it easier to navigate between UITextFields and UITextViews
Stars: ✭ 436 (-0.68%)
Mutual labels:  cocoapods, carthage
Observable
The easiest way to observe values in Swift.
Stars: ✭ 346 (-21.18%)
Mutual labels:  cocoapods, carthage
Gzipswift
Swift framework that enables gzip/gunzip Data using zlib
Stars: ✭ 356 (-18.91%)
Mutual labels:  cocoapods, carthage
Viperit
Viper Framework for iOS using Swift
Stars: ✭ 404 (-7.97%)
Mutual labels:  cocoapods, carthage

URWeatherView

Awesome Swift podplatform pod poddoc license CocoaPods compatible Carthage compatible FOSSA Status

What is this for?

Showing some kinds of the weather effect, written in Swift4.2.

This code style is the Protocol Oriented Programming.

To show the vector animation made by After Effect, Lottie can be used instead of UIImageView.

Before using URWeatherView, Which resources do you need?

1. main image or main lottie resource (Required)

  • The weather effect's main target
  • apply tone curve filter or gradient mask

2. backgroundImage of main (Optional)

  • The weather effect's background Image

3. upperImage of main (Optional)

  • The weather effect's upper Image
  • If you want extra effect, you can use it.

Usable Weather Effects

1. Snow

sample

2. Rain

sample

3. Dust

  • #1
    sample_dust1
  • #2
    sample_dust2

4. Lightning

sample_lightning

5. Hot

sample_hot

6. Cloudy

sample_cloudy

Used library stack

SpriteKit

CIFilter & CIKernel & Core Imager Kernel Language(like GLSL)

Lottie

  • I needed to apply color filter for the weather effect.
    So, I made custom Lottie library to get some properties from LOTAnimationView.
  • It's lottie-ios-extension.

Requirements

  • iOS 10.0+
  • Swift 4.2+ (Swift 3.x version is v0.6.4)

Installation

Cocoapods

Add the following to your Podfile.

pod "URWeatherView"

Dependency

lottie-ios-extension
(But, you don't need to care about this, when using URWeatherView. It's already included the dependency.)

Carthage

Add the following to your Cartfile.

github "jegumhon/URWeatherView"

Dependency

lottie-ios-extension
(But, you don't need to care about this, when using URWeatherView. It's already included the dependency.)

Examples

See the Example folder.
Run pod install and open the .xcworkspace.
(The Example source is made for using Carthage.
So, you remove the linked frameworks in General of the project settings.
And then, you remove the run script of Carthage in Build Phases of the project settings.)
or
Run carthage update and open the .xcodeproj.

Usage

import URWeatherView

1. initialize the weather view

    // for example...
        
    // You can use the xib or storyboard to show the URWeatheView...
    @IBOutlet var mainView: URWeatherView!
    
    override func viewDidLoad() {
        super.viewDidLoad()
        
        // set the main Image to apply the weather effects...
        // and set the backgroundImage, if you want to apply...
        self.mainView.initView(mainWeatherImage: #imageLiteral(resourceName: "buildings"), backgroundImage: #imageLiteral(resourceName: "bluesky.en"))
        
        // or, to use Lottie, do like below..
        // self.mainView.initView(dataNameOfLottie: "data", backgroundImage: #imageLiteral(resourceName: "bluesky.en"))
    }
1.1. How to use Lottie
  • You can find the detail Lottie usage guide at the Lottie-iOS
  • add the lottie files in the project, and then just use the json file name to load the Lottie View

2. show or remove the weather effects

    func showWeather() {
        let weather: URWeatherType = .cloudy
        self.mainView.startWeatherSceneBulk(weather, debugOption: true, additionalTask: {
            // task what you want to do after showing the weather effect...
        })
    }
    
    func removeWeather() {
        self.mainView.stop()
    }

3. 😀 Configurable parameters of URWeatherView 😀

Using or composing the functions in the URWeatherView, you can customize the weather effects. The default configurable parameters are like below.

  • birthRate : The particle's birth rate. This is used in the effects. e.g. Snow, Rain, Dust, Cloud.
  • upperImage : The image onto the weather view. (optional)
  • duration : The duration(in second). applied some effects among the URWeatherView's effects.
  • debugOption : enable to show the debug option of SpriteKit's. Default is "false". This is for the SpriteKit frame checking.
  • 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.
    case .cloudy:
    //    self.mainView.startWeatherSceneBulk(cell.weather, duration: 33.0, debugOption: self.segment.selectedSegmentIndex == 0)

        self.mainView.initWeather()
        self.mainView.setUpperImageEffect(customImage: nil)
        let option = UREffectCloudOption(CGRect(x: 0.0, y: 0.5, width: 1.0, height: 0.5), angleInDegree: 0.0, movingDuration: 33.0)
        self.mainView.startWeatherScene(cell.weather, duration: 33.0, userInfo: [URWeatherKeyCloudOption: option])

To-Do

  • [ ] exchange the Core Image Kernel to Metal.

License

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

FOSSA Status

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].