Base-ios
Base-ios 仓库包含我们在项目工作中收集和使用的有用扩展、通用类和协议。主要目标是创建一个可以重复使用的代码片段中心点。我们不断审查和丰富仓库,旨在实现最大程度的可重用性。我们充分利用响应式编程功能并将其纳入我们的项目中。为此,我们使用外部库 RxSwift、Action 和 RxDataSources 作为 base-ios 库的依赖项。
特性
- 服务:
- AppLifecycleService:通过响应式可观察对象(如“didFinishLaunchingNotification”)提供应用程序生命周期回调,而不是使用全局通知
- KeyboardService:通过响应式可观察对象(如“keyboardWillShow”)提供键盘回调,而不是使用全局通知
- ReachabilityService:通过响应式可观察对象(如“ReachableViaWiFi”)提供可达性状态
- BluetoothService:围绕 CoreBluetooth 的 CBPeripheralManager 的包装,通过响应式可观察对象提供其回调
- JSONParser:我们自己的 JSON 解析和序列化实现
- HTTPNetworking:我们自己的响应式 REST 网络通信实现,完全支持我们的 JSONParser
- UserDefaultsStorable 协议:用于分组支持 UserDefaults 存储的模型
- ViewModelBindable 协议:用于绑定 viewModels 的类和结构体(对 MVVM 架构非常有用)
- BinaryCodable 协议:用于分组支持二进制编码和解码的模型
- Queue:使用数组实现的队列
- TableModel 类:用于创建表格视图时,旨在封装表格的数据结构(将很快过时,因为它主要被 RxDataSources 外部库所取代)
- MultipleDelegating 协议:扩展高度使用的 Delegate 模式,支持多个委托(将很快过时,因为它主要被响应式可观察对象所取代)
- 第三方
- LoremSwiftum:有助于提供不同长度的随机字符串的类
- usefulness subclass of UIViewController & UIView
- binary extensions for basic data types
- Other useful extensions for basic data types, reactive types, and UIKit classes
- Other
The code base is still under active development and will continue to grow steadily. You can send requests for other useful snippets that can be integrated into the library.