gpt4 book ai didi

swift - Swift 3.1 中的方法调配

转载 作者:搜寻专家 更新时间:2023-11-01 05:34:51 25 4
gpt4 key购买 nike

现在在 Xcode (8.3b3) 中,使用 Swift 3.1,有一个新的编译器警告说方法 initialize() 将在未来的版本中被禁止,是否有方法 swizzling 的替代方法?

最佳答案

Implement method swizzling in the app delegate Instead of adding method swizzling via a class extension, simply add a method to the app delegate to be executed when application(_:didFinishLaunchingWithOptions:) is called. Depending on the classes you’re modifying, this may be sufficient and should guarantee your code is executed every time.

来源:NsHipster

关于swift - Swift 3.1 中的方法调配,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42518246/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com