【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、

 

posted @ 2023-02-10 21:18  码出境界  阅读(48)  评论(0编辑  收藏  举报