zoukankan      html  css  js  c++  java
  • swift开发笔记07

    // 监听通知

    NotificationCenter.default.addObserver(self, selector: #selector(LibraryAPI.downloadImage(_:)), name: NSNotification.Name(rawValue: downloadImageNotification), object: nil)

     

    // 网络下载和主线程刷新UI

    DispatchQueue.global().async {

                        let image = self.xiaZaiTuPianWithUrl(imageUrl)

                        DispatchQueue.main.async {

                            myImageView?.image = image

                            self.persistencyManager.baoCunTuPian(image, fileName: URL(string: imageUrl)!.lastPathComponent)

                        }

                    }

     

    // 文件本地目录

    let path = NSHomeDirectory() + "/Documents/(filename)"

     

    // 枚举

    enum PokeType {

        case normal

        case fire

        case water

    }

     

    // KVO

    myImgView.addObserver(self, forKeyPath: "image", options: [], context: nil)

    override func observeValue(forKeyPath keyPath: String?, of object: Any?, change: [NSKeyValueChangeKey : Any]?, context: UnsafeMutableRawPointer?) {

            if keyPath == "image" {

                indicator.stopAnimating()

            }

        }

     

    // 

    topViewController

    (controllers[controllers.count-1] as! UINavigationController).topViewController as? DetailViewController

     

    // didSet

        var detailItem: NSDate? {

            didSet {

                // Update the view.

                configureView()

            }

        }

  • 相关阅读:
    树莓派远程监控的实现
    frp内网渗透实现ssh外网访问家里树莓派(树莓派raspbian系统+腾讯云contos7)
    Linux下远程连接断开后如何让程序继续运行
    windows 远程连接登录树莓派桌面
    树莓派设置frpc开机启动
    树莓派 raspbian Linux 系统命令行 快捷键
    MyBatis如何防止SQL注入
    Apache POI导出excel表格
    SpringBoot文件上传
    SpringBoot整合定时任务
  • 原文地址:https://www.cnblogs.com/dengchaojie/p/7326868.html
Copyright © 2011-2022 走看看