extension Array {
    func mapArray<T>(_ transform: (Array) -> T) -> T {
        return transform(self)
    }
}

Then you can pass in the Set initializer to the new mapArray function

objectArray
    .map({ $0.URL })
    .mapArray(Set.init)


+ Recent posts