Giter VIP home page Giter VIP logo

rappleprogresshud's People

Contributors

amitaib avatar geappi avatar rjeprasad 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

Watchers

 avatar  avatar  avatar  avatar  avatar

rappleprogresshud's Issues

Completion for error cases.

Could you, please, add the completion method for failed requests.
something like:
RappleActivityIndicatorView.stopAnimating(success: false, showCompletion: true, completionLabel: "done.", completionTimeout: 1.33)

Swift Compiler Warnings: 'M_PI_2' is deprecated: Please use 'Double.pi / 2' or '.pi / 2' to get the value of correct type and avoid casting.

Hi,

First of all: Thank you for sharing the package, it's real nice.

After I updated xcode to version 8.3.1, I getting some compiler warnings when using 2.2.7 of your package.

Xcode gives me the following warnings: 'M_PI_2' is deprecated: Please use 'Double.pi / 2' or '.pi / 2' to get the value of correct type and avoid casting.

The warnings are located in the RappleActivityIndicatorView extension file on lines: 213, 217, 275 and 322.

stopAnimation does not show up

Hi bud,

I have attached my View layer of my current test app. I am using VIPER as the architecture. The startAnimatingWithLabel is working perfectly fine but unfortunately the stop animating with completion indicator isn't.

Can you have a look into this?

Cheers!

`//
// SongListView.swift
// ViperSpotify
//
// Created by Kevin Vugts on 5/05/17.
// Copyright © 2017 Kevin Vugts. All rights reserved.
//

import UIKit
import RappleProgressHUD

class SongListView: UIViewController
{
@IBOutlet weak var tableView: UITableView!

var songList: [SongModel] = []
var presenter: SongListPresenterProtocol?

override func viewDidLoad()
{
    super.viewDidLoad()
    presenter?.viewDidLoad()
}

}

extension SongListView: SongListViewProtocol
{
func showSongs(with songs: [SongModel])
{
songList = songs
tableView.reloadData()
}

func showError()
{
    RappleActivityIndicatorView.stopAnimation(completionIndicator: .failed, completionLabel: "Unable to retrieve songs from Spotify", completionTimeout: 1.5)
}

func showLoading()
{
    RappleActivityIndicatorView.startAnimatingWithLabel("Loading Songs")
}

func hideLoading()
{
    RappleActivityIndicatorView.stopAnimation()
}

}

extension SongListView: UITableViewDelegate, UITableViewDataSource
{
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell
{
return UITableViewCell()
}

func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int
{
    return songList.count
}

}
`

stopAnimating with completion

Hi,

RappleActivityIndicatorView.stopAnimating(showCompletion: true, completionLabel: "Completed.", completionTimeout: 2.0) get "argument passed to call that takes no arguements". Any idea ?

Use from App Delegate

Hi, really cool work - thank you!

I don't have a real issue, more a question.

How would you go about showing RappleProgressHUD from the app's AppDelegate?

It's possible to call, e.g.

RappleActivityIndicatorView.startAnimatingWithLabel("Processing...")

from didFinishLaunchingWithOptions function but nothing shows up...

update window userEnteraction

Hi, I liked RappleProgressHUD! Thank you.

In my implementation came bug.
start proress.
on the my window added new window.
hide progress.
my window doesn't userEnteraction.

fix code:
added property to file : RappleActivityIndicatorView.swift

weak var curentWindow: UIWindow? var curentWindowUserInteraction: Bool?
update file: RappleAIAction.swift
/** create & start */
`
class func startPrivateAnimating() {

    if let curentWindowUserInteraction = sharedInstance.curentWindowUserInteraction {
        sharedInstance.curentWindow?.isUserInteractionEnabled = curentWindowUserInteraction
    }
    sharedInstance.curentWindow = sharedInstance.keyWindow
    sharedInstance.curentWindow?.endEditing(true)
    sharedInstance.curentWindowUserInteraction = sharedInstance.curentWindow?.isUserInteractionEnabled;
    sharedInstance.curentWindow?.isUserInteractionEnabled = false

    
    let progress = RappleActivityIndicatorView.sharedInstance
    
    NotificationCenter.default.addObserver(progress, selector: #selector(RappleActivityIndicatorView.orientationChanged), name: NSNotification.Name.UIDeviceOrientationDidChange, object: nil)
    
    sharedInstance.showProgress = false
    
    progress.createProgressBG()
    
    UIView.animate(withDuration: 0.5, animations: { () -> Void in
        
        progress.backgroundView?.alpha = 1.0
        
    }, completion: { (finished) -> Void in
        progress.createActivityIndicator()
    })
}  

//* stop & clear */
class func stopPrivateAnimating(indicator: RappleCompletion, completionLabel: String?, completionTimeout: TimeInterval) {

    if indicator == .success || indicator == .failed ||
        indicator == .incomplete || indicator == .unknown {
        
        let style = sharedInstance.attributes[RappleIndicatorStyleKey] as? String ?? RappleStyleCircle
        if style == RappleStyleApple {
            sharedInstance.progressBar?.removeFromSuperview()
            sharedInstance.activityIndicator?.removeFromSuperview()
            
            if sharedInstance.contentSqure != nil {
                var sqWidth: CGFloat = 55
                // calc center values
                var comLabel = completionLabel
                if RappleActivityIndicatorView.sharedInstance.textLabel == nil {
                    comLabel = nil
                }
                let size = sharedInstance.calcTextSize(comLabel)
                sqWidth = size.width + 20
                if sqWidth < 55 { sqWidth = 55; }
                let c = sharedInstance.contentSqure?.center
                var rect = sharedInstance.contentSqure?.frame
                rect?.size.width = sqWidth
                sharedInstance.contentSqure?.frame = rect!
                sharedInstance.contentSqure?.center = c!
            }
            
        } else if style == RappleStyleCircle {
            sharedInstance.circularActivity1?.removeFromSuperlayer()
            sharedInstance.circularActivity2?.removeFromSuperlayer()
            sharedInstance.progressLayer?.removeFromSuperlayer()
            sharedInstance.progressLayerBG?.removeFromSuperlayer()
        } else if style == RappleStyleText {
            sharedInstance.dotCount = 0
            sharedInstance.textStyleVisible = false
            var c = sharedInstance.activityLable!.center; c.y += 40
            sharedInstance.activityLable?.center = c
            sharedInstance.activityLable?.textAlignment = .center
        }
        sharedInstance.completionLabel?.removeFromSuperview()
        sharedInstance.progressLabel?.removeFromSuperview()
        sharedInstance.activityLable?.text = completionLabel
        
        sharedInstance.drawCheckMark(indicator: indicator)
        
        Timer.scheduledTimer(timeInterval: completionTimeout, target: sharedInstance, selector: #selector(RappleActivityIndicatorView.closePrivateActivityCompletion), userInfo: nil, repeats: false)
    }
    else {
        sharedInstance.textStyleVisible = false
        
        UIView.animate(withDuration: 0.5, animations: { () -> Void in
            sharedInstance.backgroundView?.alpha = 0.0
            sharedInstance.userWindow?.tintAdjustmentMode = .automatic
            sharedInstance.userWindow?.tintColorDidChange()
        }, completion: { (finished) -> Void in
            sharedInstance.clearUIs()
            sharedInstance.backgroundView?.removeFromSuperview()
            sharedInstance.backgroundView = nil
            if let curentWindowUserInteraction = sharedInstance.curentWindowUserInteraction {
                sharedInstance.curentWindow?.isUserInteractionEnabled = curentWindowUserInteraction
            }                
            if sharedInstance.attributes[RappleIndicatorStyleKey] as? String == RappleStyleText {
                sharedInstance.dotCount = 0
                sharedInstance.textStyleVisible = false
                sharedInstance.activityLable?.removeFromSuperview() // only text value is available
            }
        })
    }
    NotificationCenter.default.removeObserver(sharedInstance)
}

`

App is Crashing in File name- RappleAIPrivate.swift

I am getting crash in SDK please fix it and update SDK-

in file name - RappleAIPrivate.swift

crashing at 109 line

/** get key window */ @objc var keyWindow: UIWindow { return UIApplication.shared.keyWindow!//HERE APP IS CRASHING }

here i am going to help you

use this method to get windowsKey-

`@objc var keyWindow: UIWindow {
//return UIApplication.shared.keyWindow!
if #available(iOS 13.0, *) {
return (UIApplication.shared.connectedScenes
.filter({$0.activationState == .foregroundActive})
.map({$0 as? UIWindowScene})
.compactMap({$0})
.first?.windows
.filter({$0.isKeyWindow}).first)!
} else {
// Fallback on earlier versions
return UIApplication.shared.keyWindow!
}

}`

Swift 3

Are you in the process of converting to Swift 3. I just tried RappleProgressHUD and finding Swift3 issues.

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.