You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
435 B
23 lines
435 B
//
|
|
// Any+Extension.swift
|
|
// flutter_openim_sdk
|
|
//
|
|
// Created by willem on 2021/10/9.
|
|
//
|
|
|
|
import Foundation
|
|
|
|
public func typeName(_ obj: Any) -> String {
|
|
if obj is AnyClass {
|
|
return "\(obj)"
|
|
}
|
|
return "\(type(of: obj))"
|
|
}
|
|
|
|
public func safeMainAsync(_ work: @escaping @convention(block) () -> Void) {
|
|
if Thread.isMainThread {
|
|
work()
|
|
} else {
|
|
DispatchQueue.main.async(execute: work)
|
|
}
|
|
}
|
|
|