iOS Closures in Swift Building Standard Library Functions Map

robertrinca
PRO
robertrinca
Pro Student 11,315 Points

The code snippet in the Teacher's notes doesn't match what's in the video, just a FYI.

import Foundation

struct Formatter {
    static let formatter = DateFormatter()

    static func date(from string: String) -> Date? {
        formatter.dateFormat = "d MMM yyyy"
        return formatter.date(from: string)
    }
}

1 Answer