【swift】swift语法题整理(1)
1、filter
https://www.jianshu.com/p/5d903a199acb
2、??
https://www.jianshu.com/p/510d51cc232d
3、try!
https://www.jb51.cc/swift/321716.html
4、first
https://vimsky.com/examples/usage/swift-string-first-57f76ca7dbcc68c6-ap.html
5、DispathQueue.main.async { [weak self] in
https://www.jianshu.com/p/e1e7d84e9685
https://www.cnblogs.com/jiefangzhe/p/8386487.html
https://www.sohu.com/a/380639695_208051
6、is
https://www.cnblogs.com/lxlx1798/articles/14745172.html
7、as
https://www.cnblogs.com/lxlx1798/articles/14745172.html
8、case is xxx
https://blog.csdn.net/linzhiji/article/details/128131667
9、case let a as xxx
https://blog.csdn.net/linzhiji/article/details/128131667
10、Any
https://www.jianshu.com/p/05902b338be5
11、#selector
https://blog.csdn.net/LiqunZhang/article/details/115113127
12、DispatchQueue.global(qos: .userInitiated).async {
13、_
14、DispatchQueue.main.sync {
15、#available
https://www.jianshu.com/p/da5849ffab4d
16、
func start(_ message: String, completion: @escaping () -> Void) {
17、
func start(_ message: String, completion: @escaping () throws -> MessageHandle?) {
18、
func done(completion: (() -> Void)? = nil) {
19、[Int : String]
https://www.jianshu.com/p/99646461556c
20、
var publicationMessageComposer: MessageComposer? { func compose() -> MeshMessage { return GenericDefaultTransitionTimeSetUnacknowledged(transitionTime: self.defaultTransitionTime) } let request = compose() return { return request } }
21、
定义
public convenience init(title: String?, style: UIAlertAction.Style, handler: ((UIAlertAction) -> Void)? = nil)
使用
let communicationDataAction = UIAlertAction(title: NSLocalizedString("数传通讯", comment: ""), style: .default, handler: { action in let deviceCommunicationDataVC = DeviceCommunicationDataVC.init() deviceCommunicationDataVC.hidesBottomBarWhenPushed = true deviceCommunicationDataVC.node = selectedNode self.navigationController?.pushViewController(deviceCommunicationDataVC, animated: true) })
22、
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 全程不用写代码,我用AI程序员写了一个飞机大战
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 记一次.NET内存居高不下排查解决与启示
· DeepSeek 开源周回顾「GitHub 热点速览」
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了