// // OptionalUtil.swift // HCQuanfangtong // // Created by Apple on 2022/2/24. // Copyright © 2022 Jyp. All rights reserved. // import Foundation protocol AnyOptional { var isNil : Bool {get} var isNotNil : Bool{get} } extension Optional : AnyOptional{ var isNil : Bool{ self == nil } var isNotNil: Bool{ self != nil } } extension Optional where Wrapped == String{ var isEmptyStr : Bool{ self.isNil || self!.isEmpty } var isNotEmptyStr: Bool{ !self.isEmptyStr } }