-
Notifications
You must be signed in to change notification settings - Fork 81
Blocking progress view #30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -245,6 +245,22 @@ open class SwiftOverlays: NSObject { | |
|
||
return blocker | ||
} | ||
|
||
/** | ||
Shows *blocking* overlay *with progress view and text*,, centered in the app's main window | ||
|
||
- parameter text: Text to be shown on overlay | ||
|
||
- returns: Created overlay | ||
*/ | ||
open class func showBlockingProgressOverlay(_ text: String) -> UIProgressView { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please check how There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I missed the updateOverlayProgress part. I will make an update to return a UIView and use updateOverlayProgress accordingly. |
||
let blocker = addMainWindowBlocker() | ||
let pv = UIProgressView(progressViewStyle: .default) | ||
|
||
showGenericOverlay(blocker, text: text, accessoryView: pv) | ||
|
||
return pv | ||
} | ||
|
||
/** | ||
Removes all *blocking* overlays from application's main window | ||
|
@@ -313,11 +329,12 @@ open class SwiftOverlays: NSObject { | |
accessoryView.frame = accessoryView.frame.offsetBy(dx: padding, dy: (actualSize.height - accessoryView.frame.size.height)/2) | ||
} else { | ||
actualSize = CGSize(width: max(accessoryView.frame.size.width, label.frame.size.width) + padding * 2, | ||
height: label.frame.size.height + accessoryView.frame.size.height + padding * 3) | ||
|
||
label.frame = label.frame.offsetBy(dx: padding, dy: accessoryView.frame.size.height + padding * 2) | ||
height: label.frame.size.height + accessoryView.frame.size.height + padding * 2) | ||
|
||
accessoryView.frame = accessoryView.frame.offsetBy(dx: (actualSize.width - accessoryView.frame.size.width)/2, dy: padding) | ||
|
||
label.center.x = accessoryView.center.x | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Will this work with multi-line label? |
||
label.center.y = accessoryView.center.y + (accessoryView.frame.height * 2) + padding | ||
} | ||
|
||
// Container view | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But it returns
UIProgressView
!