Re:Swift, the new way to build iOS Apps. Here's how
by gress on Wednesday June 04, 2014 @11:56AM
(#7846313)
Yeah - the central point is that there aren't really caveats about Swift being simpler than objective-c. It's not perfect, but Objective-C has a much greater number of rough edges so is strictly harder for new users.
I remember initially struggling with the stuff in ML in the first year at university, I got it but I and many others had an initial struggle. I think that at least for beginners and maybe those coming from runtime duck typed languages Python, PHP, Ruby etc. it will be more of a barrier than you think.
For #1 in Objective C you inherit from NSObject (or a subclass thereof) for every class anyway so it is in all the examples and it isn't something that you need to do especially for a protocol.
For #2 yes of course you can have an array of a generic type but firstly you need to understand enough about the type system to create your array in that form and secondly what you get out will <AnyType> objects rather than <id>'s which get automatically cast to whatever you assign them to. But I do like the idiom for downcasting using as?:
[0] Excerpt From: Apple Inc. “The Swift Programming Language.” iBooks. https://itun.es/gb/jEUH0.l