Skip to content

[6.0.0] - 2024-10-09

Compare
Choose a tag to compare
@lszzy lszzy released this 09 Oct 03:19
· 49 commits to master since this release

Added

  • Compatible with Swift 6, code marks MainActor, Sendable, nonisolated, etc., easy to write safer code
  • Compatible with iOS 18, ViewIntrospect adds iOS 18 related variables
  • Refactor the proportional scaling implementation scheme, and related methods support non-main thread calls
  • Add SendableValue object to solve the problem of passing parameters of any object Sendable
  • Add observe method related to Message starting with safe, used for main thread calling listener handle
  • Add ProtectedValue, LockingProtocol and other thread safety tool classes
  • Add MainActor.runDeinit method to uniformly handle deinit calling main thread code problems
  • Router, JSBridge component related methods mark MainActor main thread calls, need to migrate and adapt
  • Remove the methods marked as deprecated in version 5.x, please use the new API to replace the implementation, need to migrate and adapt
  • Refactor the height acquisition methods of the global status bar, navigation bar, tab bar, etc., and give priority to dynamic acquisition and caching

Migrate

  1. To adapt to Swift 6, you need to fix the compilation errors of related codes after marking MainActor, Sendable, and nonisolated, and you need to migrate and adapt
  2. To adapt to iOS 18, if you use the ViewIntrospect component, you need to adapt to v18 related variables, and you need to migrate and adapt
  3. To adapt to Plugin, you need to synchronously mark MainActor, Sendable, etc. when implementing custom Plugins, and you need to migrate and adapt
  4. If the main thread needs to call the Message-related observe listener handle, please migrate to the corresponding method starting with safe
  5. If you need to handle the problem of deinit calling the main thread code, please migrate to use the MainActor.runDeinit method
  6. If the main project opens Swift 6 compilation, HTTPRequest request subclasses, etc. need to be synchronously marked as @unchecked Sendable
  7. The obsolete methods of version 5.x have been removed. Please use the new Api to replace the implementation (such as chain=>layoutChain, etc.), and you need to migrate and adapt
  8. After fixing the compilation error, you need to test whether the related functions are normal (such as the height of the status bar, navigation bar, MainActor related functions, etc.)
  9. For more usage examples, please refer to the Example project

Added

  • 兼容Swift 6,代码标记MainActor、Sendable、nonisolated等,轻松编写更安全的代码
  • 兼容iOS 18,ViewIntrospect新增iOS 18相关变量
  • 重构等比例缩放实现方案,相关方法支持非主线程调用
  • 新增SendableValue对象,用于解决任意对象Sendable传参问题
  • 新增safe开头Message相关observe方法,用于主线程调用监听句柄
  • 新增ProtectedValue、LockingProtocol等处理线程安全工具类
  • 新增MainActor.runDeinit方法统一处理deinit调用主线程代码问题
  • Router、JSBridge组件相关方法标记MainActor主线程调用,需迁移适配
  • 移除5.x版本标记为废弃的方法,请使用新API替换实现,需迁移适配
  • 重构全局状态栏、导航栏、标签栏等高度获取方法,优先动态获取并缓存

Migrate

  1. 适配Swift 6,需修复标记MainActor、Sendable、nonisolated后相关代码编译错误,需迁移适配
  2. 适配iOS 18,如使用ViewIntrospect组件需适配v18相关变量,需迁移适配
  3. 适配Plugin,自定义Plugin实现时需同步标记MainActor、Sendable等,需迁移适配
  4. 如需主线程调用Message相关observe监听句柄,请迁移使用safe开头对应方法
  5. 如需处理deinit调用主线程代码问题,请迁移使用MainActor.runDeinit方法
  6. 主项目如开启Swift 6编译,HTTPRequest请求子类等需同步标记为@unchecked Sendable
  7. 5.x版本废弃方法已移除,请使用新Api替换实现(如chain=>layoutChain等),需迁移适配
  8. 修复编译错误后,需同步测试相关功能是否正常(如状态栏、导航栏等高度、MainActor相关功能等)
  9. 更多使用示例,请参考Example项目