Swift Talk Episode 32 Note
I watched Swift Talk episode 32, View Models at Kickstarter. The video demonstrates how to create View Model. The View Model is very well defined. Simple example, and very clear explanation!
The following is my note for it.
Array
vsArraySlice
split(batchSize:)
function.Swift.min()
- Use startIndex and endIndex.
ArraySlice
is not guaranteed that it starts from index 0.stride()
function requires that index is integer type, meaning type should beStrideable
.Collection
protocol doesn’t haveElement
type.Iterator.Element
.Collection
’s subscript returnSubsequence
type.- Use
IndexDistance
instead ofInt
forsplit(batchSize:)
parameter. dump()
function.