zoukankan      html  css  js  c++  java
  • 十月第四周

    # 十月第四周
    1.Swift的map:

    ```
    potStructs.map { PotMaterial($0) }
    ```
    https://www.cnblogs.com/muzijie/p/6542650.html

    2.Swift Precondition 预处理:
    https://www.cnblogs.com/QianChia/p/8673714.html

    3.iOS 优化ipa包,减小安装包大小:
    https://www.jianshu.com/p/a49d59b01669

    https://www.jianshu.com/p/a72d03e92c80

    4.设置页面横竖屏:

    ```
    class AppDelegate: UIResponder, UIApplicationDelegate {

    var window: UIWindow?

    // 页面的横竖屏 当前界面支持的方向(默认情况下只能竖屏,不能横屏显示)
    var interfaceOrientations: UIInterfaceOrientationMask = .portrait {
    didSet {
    // 强制设置成竖屏
    if interfaceOrientations == .portrait {
    UIDevice.current.setValue(UIDeviceOrientation.portrait.rawValue, forKey: "orientation")
    }
    // 强制设置成横屏
    else if !interfaceOrientations.contains(.portrait) {
    UIDevice.current.setValue(UIDeviceOrientation.landscapeLeft.rawValue, forKey: "orientation")
    }
    }
    }

    func application(_ application: UIApplication, supportedInterfaceOrientationsFor window: UIWindow?) -> UIInterfaceOrientationMask {
    return interfaceOrientations
    }

    // 使用
    class DetailViewController1: UIViewController {

    // Applegate对象
    let appDelegate = UIApplication.shared.delegate as! AppDelegate
    override func viewDidLoad() {
    super.viewDidLoad()
    view.backgroundColor = UIColor.white
    setupUI()
    }

    override func viewWillAppear(_ animated: Bool) {
    super.viewWillAppear(animated)
    // 该页面横竖屏切换
    appDelegate.interfaceOrientations = .allButUpsideDown
    }

    override func viewWillDisappear(_ animated: Bool) {
    // 退出页面强制竖屏
    appDelegate.interfaceOrientations = .portrait
    }
    ```
    5.didMoveToSuperView和didMoveToWindow的调用顺序:
    didMoveToSuperView -> viewWillAppear -> didMoveToWindow -> viewDidAppear

    6.正确使用可选类型:
    https://www.jianshu.com/p/448cf4f8cf65

    7.Git正确使用分支:
    不需要每次都重新拉取创建新分支,新功能才需要创建新分支。
    功能分支合到主分支要及时的删除无用的分支,以免分支太多影响管理。

    8.获取UUID:

    ```
    let UUID:String = ASIdentifierManager.shared().advertisingIdentifier.uuidString

    ```
    9.属性.classForCoder:
    编码器快捷类。

    ```
    print(self.view.classForCoder)
    ```
    输出:UIView

  • 相关阅读:
    读书笔记----软件设计原则、设计模式
    程伟杰 | 2021软件代码开发技术作业一 | 自我介绍+课程6问
    团队作业3-需求改进&系统设计
    团队项目作业2-需求规格说明书
    【Android实习】20场面试斩获大厂offer,我学会了什么
    通俗易懂,android是如何管理内存的
    关于Handler同步屏障你可能不知道的问题
    清晰图解深度分析HTTPS原理
    这一篇TCP总结请收下
    深入浅出Java线程池:源码篇
  • 原文地址:https://www.cnblogs.com/pengsi/p/9858744.html
Copyright © 2011-2022 走看看