sum(ofProperty:)

func sum<T: AddableType>(ofProperty property: String) -> T

Returns the sum of the given property for objects in the collection, or nil if the collection is empty.

Warning

Only names of properties of a type conforming to the AddableType protocol can be used.