pkluz / pkhud Goto Github PK
View Code? Open in Web Editor NEWA Swift based reimplementation of the Apple HUD (Volume, Ringer, Rotation,…) for iOS 8.
License: MIT License
A Swift based reimplementation of the Apple HUD (Volume, Ringer, Rotation,…) for iOS 8.
License: MIT License
Hello, it seems like the compiler is complaining about missing the NSCoder parameter in the init method in Xcode's latest beta. Is this something you're planning to fix or do you need a hand with it? All the best!
Would be awesome to see a CocoaPods release of this lib, as soon as CocoaPods (officially) supports Swift libraries.
http://guides.cocoapods.org/making/making-a-cocoapod.html
The problem is we have two hide() methods with fully optional set of arguments. Because of that compiler can't decide which one to use for HUD.hide() call.
Hi,
i just stumbled upon an issue which looks like it's related to PKHUD.
Having the following scenario:
Application uses UITabBarController, UISplitViewController and several UINavigationController.
Doing fast rotations and popping View Controllers via Back Button of an UINavigationBar
at the same time, leads to broken window sizes - but only if a HUD was displayed at some point before.
I can see in Reveal that PKHUD stays in the View hierarchy with a hidden PKHUD.Window, long after it's usage:
If I toggle the hidden status in Reveal off and back on, the view is fixed immediately. If I do the same test without any PKHUD shown before, rotation is always fine.
I am not manipulating the View hierarchy on my own, nor changing the RootViewController anywhere. I did a grep on the Pods, except PKHUD non of them is working on the RootViewController (other pods are more data related things, like Alamofire, Realm etc).
Sadly I am currently unable to provide a demo project right now, because it's a quite big and complex App scenario (60k+ LoC).
Any suggestions? My educated guess would be, that manually removing the PKHUD.window() should fix this..
Edit: Just as a side note regarding the additional UIWindow in PKHUD, you are aware of the memory issue it creates with @3 retina screens?
Also note that windows use a lot of RAM, especially on 3x retina screens. Having more than one of them is going to reduce the amount of memory the rest of your application can use before receiving low memory warnings and eventually being killed.
http://stackoverflow.com/a/26706490/844907
This might become critical in scenarios where a database like Realm is used, which uses memory mapping. From their current limitations:
Any single Realm file cannot be larger than the amount of memory your application would be allowed to map in iOS — this changes per device, and depends on how fragmented the memory space is at that point in time (there is a radar open about this issue: rdar://17119975). If you need to store more data, you can map it over multiple Realm files.
https://realm.io/docs/swift/latest/#current-limitations
So, unnecessarily reducing the already limited memory by using an additional UIWindow doesn't sound good.
Probably related to #79 and fixed with it as well (= wait for next version).
As a workaround I am going to destroy the UIWindow PKHUD creates after presentation has finished.
Cheers,
Frederik
Hi @pkluz,
the project contains a podspec file but the I cannot find the project on CocoaPods. Do you know the reason?
When will the latest PKHUD version be updated on cocoapods.org?
Is it possible to have it not display over whole screen just in collectionViewCell?
NSForwarding: warning: object 0x17404b610 of class 'PKHUD.PKHUD' does not implement methodSignatureForSelector: -- trouble ahead
Unrecognized selector -[PKHUD.PKHUD hideAnimated]
Hi,
I want hide PKHUDErrorView faster then timer fire, when user clicked on X. UITapGestureRecognizer added to MBHUDErrorView not working. How I can do this?
Pods/PKHUD/PKHUD/PKHUDContentView.swift:132:30: Initializer does not override a designated initializer from its superclass
Pods/PKHUD/PKHUD/PKHUDContentView.swift:38:19: Missing argument for parameter 'coder' in call
Pods/PKHUD/PKHUD/PKHUDContentView.swift:73:19: Missing argument for parameter 'coder' in call
Pods/PKHUD/PKHUD/Window.swift:69:39: Missing argument label 'completion:' in call
As discussed in this pull request: #5
I'm still receiving an warning:
2014-09-16 14:29:47.912 PKHUD Demo[50313:10503170] <PKHUD.FrameView 0x7fa053e609d0> is being asked to animate its opacity. This will cause the effect to appear broken until opacity returns to 1.
It appears PKHUD is trying to animate the Alpha of the FrameView, while it's a subclass of UIVisualEffectView. The documentation of the VisualEffectView states the following:
Setting the Correct Alpha Value
When using the UIVisualEffectView class, avoid alpha values that are less than 1.
Creating views that are partially transparent causes the system to combine the view
and all the associated subviews during an offscreen render pass. UIVisualEffectView
objects need to be combined as part of the content they are layered on top of in order
to look correct. Setting the alpha to less than 1 on the visual effect view or any of its
superviews causes many effects to look incorrect or not show up at all.
So to solve this notification, the alpha fading must be done differently.
Any suggestions?
Cheers,
//Michael
On views where the status bar is hidden, showing the loader will also
makes the status bar appear and offsets the view behind it. do you know how to prevent it from appearing?
First, thanks for a great framework!
I am using Xcode 6.2 and adding this to a Swift-based app project.
I have included the Xcode project from a git clone today as a sub-project in my main project. Then I added in the framework to my project. So far so good.
I can run the app in the simulator.
But when I try to run the app on a real device, I get:
dyld: Library not loaded: @rpath/PKHUD.framework/PKHUD
Referenced from: /private/var/mobile/Containers/Bundle/Application/ED9F903F-610B-4955-AE35-C306FA088868/Jeeves.app/Jeeves
Reason: image not found
(lldb)
Any ideas on the reason for this?
Hey!
I'm using PKHUD
to present a brief dialog to inform them of a feature, but for some reason when PKHUD
displays the hud, the status bar changes from .LightContent
to .Default
. Anyway to correct this so it stays white?
My current code:
PKHUD.sharedHUD.contentView = PKHUDTextView(text: "Text")
PKHUD.sharedHUD.dimsBackground = false
PKHUD.sharedHUD.show()
PKHUD.sharedHUD.hide(afterDelay: 2.0)
I would appreciate any help!
Warning when running:
<PKHUD.FrameView 0x7fe412755080> is being asked to animate its opacity. This will cause the effect to appear broken until opacity returns to 1.
First of all,thanks for such a excellent library which we can show HUD alert beautifully.
Thanks for the developer who write such a great library
I found something that,this app seen dont support for iphone 6 or 6 plus resolution
When i tried to run in iphone 6,it resolution show in iphone 5 screen.
Any help please?
Should be converted to support iOS 9 & Swift 2 & Xcode 7.
Trying to display an error view using the default PKHUDErrorView
I got this error:
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[CASpringAnimation setInitialVelocity:]: unrecognized selector sent to instance 0x170621f40'
More especifically -[PKHUDErrorView springyRotationAnimation:]
at animation.initialVelocity = 0.5
I'm using cocoa pods and xcode 7.0.1
Any chance this is coming?
The syntax seems to have changed and the demo is not working
Tracing through a debug, it seems that the userInfo that contains the completion block is nil after the delay.
The code I used (replacing the demo code):
@IBAction func showTextHUD(sender: AnyObject) {
HUD.show(.Label("Text."))
HUD.hide(afterDelay: 2, completion: { (complete) -> Void in
print("here")
})
}
Swift 2 has changed in this version, and the project no longer compiles.
Can this be used via bridge, if so how?
Hello,
when ill try to use your Hud i am always getting the following error:
<PKHUD.FrameView 0x7faae2eb1950> is being asked to animate its opacity. This will cause the effect to appear broken until opacity returns to 1.
Ill try to close the Hud if the Server gets a response after a Alamofire POST request.
Is this a bug? Or another problem here?
Thanks in advance.
I see that people are getting warnings about animating opacity, but that it appears to be a non-issue. However, I'm also seeing Unbalanced calls to begin/end appearance transitions for <PKHUD.WindowRootViewController: 0x15f819cc0>.
My usage is very simple, and I'm not changing view controllers or anything unexpected. Is anyone else seeing this?
HUD.show(.LabeledProgress(title: NSLocalizedString("Please Wait", comment: "HUD title"), subtitle: nil))
and later,
HUD.hide()
func switchRootViewController(rootViewController: UIViewController, animated: Bool, completion: (() -> Void)?) {
if let window = UIApplication.sharedApplication().keyWindow {
if animated {
UIView.transitionWithView(window, duration: 0.5, options: .TransitionCrossDissolve, animations: {
let oldState: Bool = UIView.areAnimationsEnabled()
UIView.setAnimationsEnabled(false)
window.rootViewController = rootViewController
UIView.setAnimationsEnabled(oldState)
}, completion: { (finished: Bool) -> () in
if (completion != nil) {
HUD.hide(false)
completion!()
}
})
} else {
window.rootViewController = rootViewController
}
}
}
Above is a function that I called to switch a rootViewController.
When my app switches its rootViewController while PKHUD is showing, it switches back to a previous rootViewController as soon as the PKHUD is hidden. Any suggestions to avoid this issue?
The code doesn't compile under Xcode 6.2 Swift 1.2.
Any plans on implementing support for the new version?
I've installed using Cocoapods, and my app written in swift.
Everything works fine in the simulator but when loading on a device, it crashes with the following error.
dyld: Library not loaded: @rpath/PKHUD.framework/PKHUD
Referenced from: /var/mobile/Containers/Bundle/Application/457898E0-D0D7-4733-AE87-3AA67134785A/forexer.app/forexer
Reason: image not found
I've tried adding the framework to the 'copy bundle resources' but that doesn't even build.
Any suggestions?
This is a nice extension, but I find it painfully difficult to use.
Not sure how swift works, but I don't want to type sharedHud
I would like it to work more like this https://github.com/relatedcode/ProgressHUD
It should be PKHUD.show("String")
then PKHUD.success
And at least give me a chance to put a title in the error for god sakes.
Why not support CocoaPods?
Unable to find a specification for PKHUD
I've found that on the swift-2.0 branch, the PKHUDAssets class causes the fatal error on line 20 when returning an image from the bundle. I'm not sure why, I copied the entire PKHUD folder into my project so I have Images.xcassets and everything. I've checked and the bundle for the PKHUDAssests class is being returned correctly (I think). But for some reason the UIImage is returned as nil..
I know it says "for IOS 8" twice, but... will it run in IOS 7?
If the answer is yes: do you recommend using CocoaSeeds?
If the answer is no: do you recommend a similar library?
Please add completion block to hide(animated: Bool)
Right now the code reads:
windowLevel = UIWindowLevelNormal + 1.0
this forces every other application to use a windowLevel strictly between [0.0,1.0)
, which seems
unnecessarily restrictive. Alert
is at 2000.0
and StatusBar
is at 1000.0
.
Hi,
the framework looks so awesome.
But I have problems to use it:
I downloaded the newest .zip from 04/12/2014.
Unzip the files.
Drag & Drop the folder "PKHUD" to my existing swift xcode project.
Then I go to my "AppDelegate.swift" and adding on the top, right under the "import UIKIT" a new line:
import PKHUD
The compiler show me an error: "No such module PKHUD".
What do I wrong?
[By the way the standalone Demo-versions works perfect. I think I have just a little problem, to import the PKHUD.]
I'm using the new Xcode 6.1.1 from the Mac App Store, no beta.
And OS X 10.10.1 Yosemite.
I have a tab bar based app. When I want to present the progress HUD I only want to block the interaction with the VC in which the user is performing an operation. I want to block the interaction with that VC, but not with the tab bar.
I would like to be able to specify the view/vc to present the HUD on top of.
Thanks
<PKHUD.FrameView 0x7f999a78e2f0> is being asked to animate its opacity. This will cause the effect to appear broken until opacity returns to 1.
When switching to deployment target 8.0 i get error:
Module file's minimum deployment target is ios9.0 v9.0: PKHUD.framework/Modules/PKHUD.swiftmodule/x86_64.swiftmodule
Any suggesting to work both in 8 & 9?
Thanks in advance
I imported the PKHUD for my project using CocoaPods and PKHUDStatusProgressView.Swift file was not found.
Can you fix that? Thanks!
It appears that the progress view options are indeterminate progress views - a spinner that provides no indication of when the task is meant to be completed. Do you expect to add any additional determinate progress options, like those in existing Objective-C implementations of progress displays like MBProgressHUD?
Hello,
I would like to use your awesome code for my app but I want it to be compatible with iOS 7. Is it possible ?
Thank you very much
How to install manually?
The API changed and the README still reflects the old API usage.
It's quite strange that Xcode console log message, I don't know why?
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.