rjeprasad / rappleprogresshud Goto Github PK
View Code? Open in Web Editor NEWUniversal progress/activity indicator (Swift)
License: MIT License
Universal progress/activity indicator (Swift)
License: MIT License
Could you, please, add the completion method for failed requests.
something like:
RappleActivityIndicatorView.stopAnimating(success: false, showCompletion: true, completionLabel: "done.", completionTimeout: 1.33)
Hi there!
The library is outdated. I created a fork and updated the library.
If you want to use the library, specify
pod 'RappleProgressHUD', :git => 'https://github.com/kuzomenskyi/RappleProgressHUD', :branch => 'master'
in your Podfile.
If you are owner of the repo or contributor, please include the fixes in the library.
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.
error seems to stop when i comment out this line: view.backgroundView.layer.sublayers = nil
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
}
}
`
Hi,
RappleActivityIndicatorView.stopAnimating(showCompletion: true, completionLabel: "Completed.", completionTimeout: 2.0) get "argument passed to call that takes no arguements". Any idea ?
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...
Hi,
I'm using this library and facing issue that i need to add the HUD to my Current view and not KeyWindow, is it implemented or we need to update it?
RappleActivityIndicatorView.stopAnimation(completionIndicator: .success, completionLabel: "Problem reported successfully", completionTimeout: 1)
RappleActivityIndicatorView.stopAnimation not support a long text ,
i given completion text as "Problem reported successfully", but its showing only "Problem", don't showing remaining text.
https://drive.google.com/open?id=0B6F8mrwjwix1WW8wUWlrT2tnaUxiVjk1bFpvX0c4VURXNFdR
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)
}
`
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!
}
}`
Are you in the process of converting to Swift 3. I just tried RappleProgressHUD and finding Swift3 issues.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.