惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

D
Docker
Microsoft Azure Blog
Microsoft Azure Blog
云风的 BLOG
云风的 BLOG
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
L
LangChain Blog
P
Privacy & Cybersecurity Law Blog
Hugging Face - Blog
Hugging Face - Blog
C
CXSECURITY Database RSS Feed - CXSecurity.com
大猫的无限游戏
大猫的无限游戏
Cyberwarzone
Cyberwarzone
The Register - Security
The Register - Security
Stack Overflow Blog
Stack Overflow Blog
A
Arctic Wolf
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
T
Threatpost
The GitHub Blog
The GitHub Blog
P
Privacy International News Feed
WordPress大学
WordPress大学
U
Unit 42
S
Securelist
T
The Exploit Database - CXSecurity.com
C
Cyber Attacks, Cyber Crime and Cyber Security
P
Proofpoint News Feed
Latest news
Latest news
Hacker News: Ask HN
Hacker News: Ask HN
小众软件
小众软件
Know Your Adversary
Know Your Adversary
The Cloudflare Blog
V
Vulnerabilities – Threatpost
The Hacker News
The Hacker News
Scott Helme
Scott Helme
有赞技术团队
有赞技术团队
Security Latest
Security Latest
Google DeepMind News
Google DeepMind News
Application and Cybersecurity Blog
Application and Cybersecurity Blog
Simon Willison's Weblog
Simon Willison's Weblog
博客园 - Franky
Y
Y Combinator Blog
博客园 - 叶小钗
Security Archives - TechRepublic
Security Archives - TechRepublic
Google DeepMind News
Google DeepMind News
N
Netflix TechBlog - Medium
S
Secure Thoughts
T
Threat Research - Cisco Blogs
aimingoo的专栏
aimingoo的专栏
S
SegmentFault 最新的问题
Microsoft Security Blog
Microsoft Security Blog
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
博客园 - 司徒正美
M
MIT News - Artificial intelligence

Swift

都 vibe coding 了,为啥不把 Rust 项目 rewrite 到 Swift ? 应该怎么解读 swiftui 的崩溃报告? FoundationModels 框架实践 - V2EX Swift DocC 构建的博客 - V2EX Swift server 要支棱起来了 - V2EX 求问贴,如果在 swiftUI 中接入 MySQL C client - V2EX Swift 萌新, DispatchQueue 的一个问题 - V2EX 分享一下一个 Web 前端刚学习 Swift 时候的心得博文 - V2EX 5 分钟用 Swift 写个 ripripgrep - V2EX Swift 操作 plist 文件 使用 SwiftUI + TCA 重构 Instagram Clone:从 Flutter 到 SwiftUI 的迁移实践 激发编程激情,轻松掌握 Swift SwiftUI 分享个基于 UICollectionView 封装的数据驱动和声明式组件库 ListKit 问一个关于 CALayer 的资源释放问题 SwiftUI 的 TextEditor 在 macOS Sequoia 15.0 上输入中文时又会这样一跳一跳的了 Swift 中系统 API delegate 参数一定要在当前类实现传 self 吗 ScreenCaptureKit 里面的 SCStreamOutput 没有被顺利触发,是那个步骤错了,求解惑 - V2EX 似乎 SwiftUI app 在 macOS 15 上启动速度变快很多? - V2EX 请教一个关于 Swift 的基础小问题 - V2EX 离线 iOS app 也需要 ICP ? - V2EX 请教 SwiftUI 布局的问题 - V2EX ios 17 widget 无法正确更新 core data - V2EX 有没有 Swift ui 版本的 tailwind css? - V2EX swiftui 里,这里用 hstack,为什么是垂直布局,而不是水平布局? - V2EX 大家觉得 Swift 的参数必须按序提供怎么样? - V2EX Swift 开源的组件库好像不是很多啊 - V2EX Swift 如何像 Python 那样 崩溃了输出 backtrace 或者至少是哪行出错了。。。 - V2EX 请教一下各位 iOSer 巨佬们一个 SwiftUI sheet 组件的问题 - V2EX 请教一下各位 iOSer 巨佬们一个 SwiftUI 中 HStack 的布局问题 - V2EX swiftui 有好用的组件库吗? - V2EX 求问:苹果手机是否无法像安卓一样,可以扫描出本地的音乐? - V2EX macOS 沙盒中如何获得对任意目录的写权限? - V2EX swiftui 中的语法糖疑问 - V2EX 开发 macOS 应用无法访问用户选择的文件夹下的文件 - V2EX 弄了一个 Swift 官方教程的速览版 - V2EX 2024 年了,现在学 SwiftUI 还有必要学 UIkit 吗? - V2EX 大佬们指点下苹果生态下音频相关的这些库都是什么关系? - V2EX 升级到 Xcode 15 之后遇到的 GeneratedAssetSymbols 过不了编译这个问题 - V2EX 现在用 Swift 开发后端成熟了吗? - V2EX Composable SwiftUI - V2EX 2023 年, swiftui 使用 WKWebView 加载 html 字符串,如何自适应 frame 高度? - V2EX 用 network extension 框架开启 Tunnel,怎么能保持后台请求接口,解决请喝杯咖啡 - V2EX 学生党求问各位大佬,一个关于 ios 小组件的问题 - V2EX 比较好的 Swift UI 学习交流群 - V2EX CAID 这垃圾东西是谁在推,一边喊着保护隐私,一边想着法子来跟踪用户 - V2EX Alamofire 推荐使用吗? - V2EX 我自己是初学者想找个朋友带我一起写两个工作用的 app 有偿的 - V2EX Swift 如何优化数据加载方式? - V2EX 现在感觉 Swift 真的被 OC 拖后腿了 - V2EX
Swift 的 Optional 如何比较包装类型的关系呢? - V2EX
sl0000 · 2023-04-23 · via Swift

@nobodyknows 感谢,可能是我描述不够清晰,我其实是要做 optional<subclass>与 optional<class>的继承关系比较,而不是==

protocol OptionalProtocol {
static func wrappedType() -> Any.Type
func wrappedType() -> Any.Type
}
extension Optional: OptionalProtocol {
static func wrappedType() -> Any.Type {
return Wrapped.self
}
func wrappedType() -> Any.Type {
return Wrapped.self
}
}

class KeyValueCoding {
init() {
defaultKeyValue()
}

func defaultKeyValue() {
// let userDefault = UserDefaults.standard
let classPath = String(describing: self)
let mirror = Mirror(reflecting: self)
for child in mirror.children {
guard let label = child.label else { continue }
let fullLabel = classPath + "." + label
let type = type(of: child.value)
let value = child.value
print("\(fullLabel) \(type)")
if let wrappedType = (type as? OptionalProtocol.Type)?.wrappedType() {
print("optional \(wrappedType)")
} else {
print("not optional")
}
}
}
}