I used #351 link for my project. However, the duration function is no longer work. Please kindly help to fix. Thanks.
for now, click on the error. It should show automatically what the new code should look like. Then run the app again.
It doesn't support the duration now?
alertView.showError("Title", subTitle:"abc", duration: 3)
It shows
Incorrect argument label in call (have '_:subTitle:duration:', expected '_:subTitle:closeButtonTitle:') Replace 'duration' with 'closeButtonTitle'
hmm, i'm not with my macbook right now. I'll look into it this weekend. Hopefully someone else can do it sooner.
Please update. Have always loved this library. Looking forward to Swift4 update
I update the library for swift 4
pod 'SCLAlertView', :git => 'https://github.com/ahmedsafadii/SCLAlertView-Swift.git'
Thanks @ahmedsafadii , but not fixing the duration issue.
@rayhk6 what issue , I used it and it's amazing oO
try replace both file with this :)
@ahmedsafadii I still facing same issue for duration!
@Piyush08 can you share your code or screen the problem ?
@Piyush08 Please replace duration with timeout. It works for me.
Ref: https://github.com/vikmeup/SCLAlertView-Swift/blob/master/Example/SCLAlertViewExample/ViewController.swift
let alert = SCLAlertView(appearance: appearance)
let showTimeout = SCLButton.ShowTimeoutConfiguration(prefix: "(", suffix: " " + "second".localize() + ")")
_ = alert.addButton("cancel_order".localize(), backgroundColor: UIColor(hex:"FFBA00"), textColor: UIColor.white, showTimeout: showTimeout) {
}
let timeoutValue: TimeInterval = 5.0
let timeoutAction: SCLAlertView.SCLTimeoutConfiguration.ActionType = {
}
alert.showWait("", subTitle: "order_message_to_drivers".localize(), timeout: SCLAlertView.SCLTimeoutConfiguration(timeoutValue: timeoutValue, timeoutAction: timeoutAction), colorStyle: 0xFFBA00, colorTextButton: 0xFFFFFF)
Hello @ahmedsafadii ,
Can't I use same format like as duration now? Just specify second & after that dismiss automatically.
Rather than this adding button scenario.
Thank you,
@Piyush08
alertView.showInfo("", subTitle: "ABC", timeout: SCLAlertView.SCLTimeoutConfiguration(timeoutValue: 3, timeoutAction: SCLAlertView.SCLTimeoutConfiguration.ActionType = {
print("")
}))
@ahmedsafadii
still getting error as "Cannot assign to immutable expression of type 'SCLAlertView.SCLTimeoutConfiguration.ActionType.Type' (aka '(() -> ()).Type')"
@Piyush08
replace both file with this
https://github.com/vikmeup/SCLAlertView-Swift/files/1336488/Archive.zip
@ahmedsafadii I already replace this as you mentioned above
@Piyush08 can you share the alert code here ^^"
@Piyush08 the code please :3
@ahmedsafadii I already share as above image
@Piyush08 ok give me a sec
try this
@Piyush08
let timeoutAction: SCLAlertView.SCLTimeoutConfiguration.ActionType = {
// action here
}
SCLAlertView().showError("test", subTitle: "test",timeout:SCLAlertView.SCLTimeoutConfiguration(timeoutValue: 3.0, timeoutAction:timeoutAction))
@ahmedsafadii
It works!
Thanks for your quick & great help!
Happy coding!
@Piyush08 np ;)
So whats the workflow for adding this to a new Swift4 project now?
@justdan0227 create PR with changes to support Swift4, I would be happy to merge it
Most helpful comment