第36月第29天 swift知识集合

1.

print(String.init(format"%s"object_getClassName(p)))

https://www.cnblogs.com/doudouyoutang/p/9760603.html

2.

extension NotificationCenter: ZYCompatible{}
extension ZY where Base: NotificationCenter {
func post(name aName: NSNotification.Name, object anObject: Any?, userInfo aUserInfo: [AnyHashable : Any]? = nil)
}

NotificationCenter.default.zy.post(name: NSNotification.Name("userLogin"), object: nil)

这样我们就可以通过命名空间将系统通知和我们的业务通知区分开来。

https://www.jianshu.com/p/1a106019785d

原文地址:https://www.cnblogs.com/javastart/p/11609082.html