I want to define like this:
public var reloadFRCsNeedToPerformWhenFail = [()->()]()
but I get an error
Like this:
public var reloadFRCsNeedToPerformWhenFail : [()->()] = []
If you use a type alias to make ()->()
a type, you can do it your way:
public typealias VoidVoid = ()->()
public var reloadFRCsNeedToPerformWhenFail = [VoidVoid]()
Or, forego the []
shortcut notation and use the full generic:
public var reloadFRCsNeedToPerformWhenFail = Array<()->()>()
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With