sum(ofProperty:)

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

Returns the sum of the values of a given property over all the objects in the collection.

Warning

Only a property whose type conforms to the AddableType protocol can be specified.