Giter VIP home page Giter VIP logo

rsloadingview's Introduction

RSLoadingView

Introduction

RSLoadingView bring your app to the new age of loading animations using 3D engine.

  • Written with Swift
  • Customizable
  • Using Apple's SceneKit with OpenGL
  • Include HUB feature: show full screen loading HUB with one line of code
  • Or use as standalone view
  • Configurable in interface builder

Requirements

  • Swift 4.0
  • iOS 9+

Demo

SpinAlone - base Variant

SpinAlone - base Variant

SpinAlone - inAndOut Variant; speedFactor = 2.0; lifeSpanFactor = 2.0; mainColor = UIColor.red

Twins - base Variant

Installation

RSLoadingView is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod "RSLoadingView"

Usage

import UIKit
import RSLoadingView

class ViewController: UIViewController {

  @IBAction func showLoadingHub() {
    let loadingView = RSLoadingView()
    loadingView.show(on: view)
  }

  @IBAction func showOnViewTwins() {
    let loadingView = RSLoadingView(effectType: RSLoadingView.Effect.twins)
    loadingView.show(on: view)
  }

  func hideLoadingHub() {
    RSLoadingView.hide(from: view)
  }

  @IBAction func showOnWindow() {
    let loadingView = RSLoadingView()
    loadingView.showOnKeyWindow()
  }

  func hideLoadingHubFromKeyWindow() {
    RSLoadingView.hideFromKeyWindow()
  }
  
}

Supported Effect

Effect Variants
RSLoadingSpinAlone base, inAndOut
RSLoadingTwins base
RSLoadingTriples (coming soon)

Customization

Loading View Related
Field Default Value
speedFactor 1.0
mainColor UIColor.white
colorVariation 0.0
sizeFactor 1.0
spreadingFactor 1.0
lifeSpanFactor 1.0
variantKey ""
HUB Related
Field Default Value
shouldDimBackground true
dimBackgroundColor UIColor.black.withAlphaComponent(0.6)
isBlocking true
shouldTapToDismiss false
sizeInContainer CGSize(width: 180, height: 180)

Author

Roy Ng, [email protected] @ Redso, https://www.redso.com.hk/

Linkedin: https://www.linkedin.com/in/roy-ng-19427735/

License

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

rsloadingview's People

Contributors

albinekcom avatar roytornado avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

rsloadingview's Issues

App crashed due to RSloading

most of time if there is no activity indicator showing and you call hide, it cause app to crash,
Some time it crashed at following method

 public func renderer(_ renderer: SCNSceneRenderer, updateAtTime time: TimeInterval) {
  //logger.logDebug("updateAtTime \(time)")
if isResized {
  prepareForResize()
  isResized = false
} else {
  effect.update(at: time)
}
     }

specifically on following line
effect.update(at: time)
with EXC_BAD_ACCESS (code=1, address=0xbadd6678a819bf85)

UIView.bounds must be used from main thread only

Hi, i'have some issue using your component on Xcode 10 ๐Ÿ‘

I have a new warning about Thread usage, in your method prepareForResize, the access of view.bounds is not forced on the mainThread

Any idea ?
Put Dispatch on the mainQueue ? (i'not quite sure about the performance)

Best regards

Not working on IOS 15.3.1

Hello, from the screen shots, this project looks great, but it doesn't seem to work on the latest IOS version, Please can you update the library to be compatible? Thank you

Hi Roy

When uploading to appstore "No suitable application records were found. Verify your bundle identifier 'org.cocoapods.RSLoadingView' is correct.". This error is coming. please resolve this issue asap..

Pod install Fail

on pod install, I got issue saying

[!] Unable to find a specification for RSLoadingView

Rare critical crash

Hello!

I think, you should consider either using optional with "loadingView" or apply some kind of nil

if loadingView != nil{
        loadingView.removeFromSuperview()
    }

In very rare cases, when you pop view controller without animation, while using "RSLoadingView" on both VCs your app can crash, becauseloadingView.removeFromSuperView() is called when loadingView is already nil.

Crash on Iphone 5C version 10.3.3

public func renderer(_ renderer: SCNSceneRenderer, updateAtTime time: TimeInterval) {
//logger.logDebug("updateAtTime (time)")
if isResized {
prepareForResize()
isResized = false
} else {
DispatchQueue.main.asyncAfter(deadline: .now() + 5.0) {
self.effect.update(at: time) // Crash will be happen in this line
}
}
}

Does not work on iOS 12 beta 1

Hello,

This project is really amazing.
Unfortunately, it does not run well at all on iOS 12 beta 1: background is greyed out, but nothing spins.

Good luck for that!

Regards,
Alexandre

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.