{ Swift }

  • Why State update doesn't work

    | /

    Recently, some personal apps have begun to try to use SwiftUI.

    Although some simple layouts, SwiftUI is indeed very efficient in development. But in actual development, many problems will be encountered.

    1. The development concept is different from UIKit, which leads to unaccustomed.
    2. Some components only have UIKit and need to be encapsulated.
    3. There will be compatibility issues with different versions of Xcode and operating systems.
    4. Sometimes some writing methods lead to actual effects that do not meet expectations.
    5. And so on.

    I have encountered a situation where the State change does not take effect, and it is also possible that my usage is not completely correct.

  • Something About Optional Assignment

    | /

    We all know that in Swift, optional chaining is an important feature that can help us write concise and elegant code.

    However, the optional assignment derived from the optional chain may have some strange phenomena when used.

  • 浅谈当Swift中defer和inout同时起作用

    | /

    本文针对 Swiftdeferinout 以及 return 时相互影响的时候的情况进行简单的分析,目的是更好的理解 deferinout 原理以及使用场合,减少踩坑和提高debug效率。

    本文中的示例代码,均为 Swift 4.2 版本