zhihuitang
1/18/2019 - 6:02 PM

Optional for Collection

extension Optional where Wrapped: Collection {
    var isNilOrEmpty: Bool {
        return self?.isEmpty ?? true
    }
}