Gorgeous Swift nested-class-in-closure-literal approach to delegates:
gist.github.com/austinzheng/8f
Nice, . (but why the [self]?)
Conversation
Replying to
Is that pattern matching in the delegate? Looks quite similar to Scala.
1
Unfortunately, no, that's just the function syntax. No pattern matching function heads in Swift.
Replying to
Reminds me of long-ago Java programming...
(descriptively, not judgmentally)
1
Replying to
I wondered the same thing re self.
Pardon the ignorance tho, but I fail to see the benefit of this.
1
It runs just fine without the [self], I'd say chalk it up to 'not yet refactored before code review'
1
Show replies
Replying to
why not make the ParentClass conform to the protocol? (Or is it just an experiment?)
1
1
2
Show replies
Replying to
1
For me, a visual guide that says instantly "this class is not instantiated, extended, etc, outside this one line"
1
Replying to
Immediately thought of using it this way gist.github.com/ryancumley/d37 for an iOS 7 project with no UIAlertController
1
1





