pushdeer/ios/PushDeer-iOS/PushDeer/Tool/CommonUtils.swift

27 lines
781 B
Swift
Raw Normal View History

//
// CommonUtils.swift
// PushDeer
//
// Created by HEXT on 2022/9/11.
//
import Foundation
/// ****
/// - Parameter emptiable: , Collection , : String / Array / Dictionary / Set / Data
/// - Returns: nil true
func isEmpty<T: Collection>(_ emptiable: T?) -> Bool {
if emptiable == nil || emptiable!.isEmpty {
return true
} else {
return false
}
}
/// ****
/// - Parameter emptiable: , Collection , : String / Array / Dictionary / Set / Data
/// - Returns: nil false
func isNotEmpty<T: Collection>(_ emptiable: T?) -> Bool {
return !isEmpty(emptiable)
}