It just converted my small Swift project to Swift 3.
Here is a compiler error that I don't understand:
var onLoadedClosures: [() -> ()] = []
open func onLoaded(closure: () -> ()) {
onLoadedClosures += [closure]
}
Cannot convert value of type '[() -> ()]' to expected argument type 'inout _'.
I added the inout keyword:
open func onLoaded(closure: inout () -> ()) {
onLoadedClosures += [closure]
}
Then it works. But why does adding an element to an array require the inout keyword? Although I know what inout means.