-
Notifications
You must be signed in to change notification settings - Fork 65
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
Support customisation in Objective-C #27
base: master
Are you sure you want to change the base?
Changes from 1 commit
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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
<plist version="1.0"> | ||
<dict> | ||
<key>SchemeUserState</key> | ||
<dict> | ||
<key>ARSLineProgress.xcscheme</key> | ||
<dict> | ||
<key>orderHint</key> | ||
<integer>0</integer> | ||
</dict> | ||
</dict> | ||
</dict> | ||
</plist> |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,16 +23,23 @@ public final class ARSLineProgress: NSObject { | |
Will interrupt the current .Infinite loader progress and show success animation instead. | ||
*/ | ||
public static func showSuccess() { | ||
if !statusShown { ARSStatus.show(.success) } | ||
if !statusShown { ARSStatus.show(.success, title: "") } | ||
} | ||
|
||
public static func showSuccess(title: NSString) { | ||
if !statusShown { ARSStatus.show(.success, title: title) } | ||
} | ||
|
||
/** | ||
Will interrupt the current .Infinite loader progress and show fail animation instead. | ||
*/ | ||
public static func showFail() { | ||
if !statusShown { ARSStatus.show(.fail) } | ||
if !statusShown { ARSStatus.show(.success, title: "") } | ||
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. Why |
||
} | ||
|
||
public static func showFail(title: NSString) { | ||
if !statusShown { ARSStatus.show(.success, title: title) } | ||
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. The same one here: fail method has success parameter? Why? |
||
} | ||
|
||
// MARK: Show Infinite Loader | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,9 +37,22 @@ func ars_window() -> UIWindow? { | |
return targetWindow | ||
} | ||
|
||
@discardableResult func ars_createdFrameForBackgroundView(_ backgroundView: UIView, onView view: UIView?) -> Bool { | ||
func sizeForTitle(_ title : NSString?) -> CGSize{ | ||
if title != nil{ | ||
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.
|
||
return title!.boundingRect(with:CGSize(width:0, height:0), | ||
options:NSStringDrawingOptions.usesLineFragmentOrigin, | ||
attributes:[NSFontAttributeName: UIFont.systemFont(ofSize: ARS_TITLE_SIZE)], | ||
context:nil) | ||
.size | ||
} | ||
|
||
return CGSize(width:0, height:0) | ||
} | ||
|
||
@discardableResult func ars_createdFrameForBackgroundView(_ backgroundView: UIView, title: NSString?, onView view: UIView?) -> Bool { | ||
let center: CGPoint | ||
let bounds: CGRect | ||
let lbSize = sizeForTitle(title) | ||
|
||
if view == nil { | ||
guard let window = ars_window() else { return false } | ||
|
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.
Please keep the formatting the same way it was before.