FWFramework

Pod Version Pod License

中文

教程

iOS开发框架,主要解决原生开发中的常规问题和痛点,并构建模块化项目结构,方便iOS开发。

* Modular architecture design, with built-in Mediator middleware, Router routing and other components
* Supports advanced features such as Swift coroutine async, await, property annotation propertyWrapper, macro, etc.
* Easily customizable UI plug-ins, including pop-up windows, toast, empty interface, pull-down refresh, image selection and other plug-ins
* Completely replaceable network images and network request layer, compatible with SDWebImage, Alamofire, etc. by default
* Automatically updated AutoLayout chain layout, commonly used UI view components are all available
* Extensible Model, View, and Controller architecture encapsulation for quick writing of business codes
* Compatible with SwiftUI, easily implement UIKit and SwiftUI hybrid interface development
* Compatible with Swift 6, quickly write more robust, less crash-prone, and thread-safe code   
* Any replaceable fw. code prefix, commonly used Toolkit methods, Theme, multi-language processing
* Everything you want is available here

本框架中的所有 Swizzle 默认情况下不会生效,也不会影响现有项目。需要手动开启或调用才会生效。该库已在正式项目中使用,未来将继续维护和扩展。欢迎大家使用并提供宝贵意见,共同成长。

安装

推荐使用 CocoaPods 或 Swift Package Manager 安装并自动管理依赖项。

CocoaPods

本框架支持 CocoaPods,Podfile 示例

platform :ios, '13.0'
use_frameworks!

target 'Example' do
  # Import the default subspecs
  pod 'FWFramework'
  
  # Import the macro subspecs
  # pod 'FWFramework', :subspecs => ['FWFramework', 'FWPlugin/Macros']   
  # Import the specified subspecs, see the podspec file for the list of subspecs
  # pod 'FWFramework', :subspecs => ['FWFramework', 'FWSwiftUI']
end

Swift Package Manager

本框架支持 Swift Package Manager,只需添加并勾选所需的模块,Package 示例

https://github.com/lszzy/FWFramework.git

# Check and import the default submodule
import FWFramework

# Check and import the macro submodule
import FWPluginMacros
# Check and import the specified sub-modules, see the Package.swift file for the list of sub-modules
import FWSwiftUI

Api

文档位于 docs 文件夹中,只需在浏览器中打开 index.html,或运行 docs.sh 自动生成 Api 文档。

自定义代码前缀是 app 示例

public typealias APP = WrapperGlobal

extension WrapperCompatible {
	public static var app: Wrapper<Self>.Type { get { wrapperExtension } set {} }
	public var app: Wrapper<Self> { get { wrapperExtension } set {} }
}

导入默认 fw 代码前缀的示例

@_spi(FW) import FWFramework

更新日志

由于此框架不断升级、优化和扩展新功能,因此每个版本的 Api 可能会略有更改。 如果升级新版本时报告编译错误,解决方案如下

1. Just change to specify the pod version number to import, the recommended way, does not affect the project progress, upgrade to the new version only when you have time, example: pod 'FWFramework', '6.0.5'
2. Upgrade to the new version, please pay attention to the version update log

Swift

从 6.0 版本开始,它与 Swift 6 和 iOS 13+ 兼容。 5.x 版本仅与 Swift 5 兼容。迁移时,除了使用新的 API 修复编译错误外,还需要测试相关功能是否正常。 对于给您带来的不便,我们深表歉意。

Objective-C

对于 OC 兼容性,请使用 4.x 版本,兼容 iOS 11+。 后续版本的 4.x 版本只会修复错误,不会添加新功能。

Vendor

本框架使用了许多第三方库。 感谢所有第三方库的作者。 我不会在这里一一列出它们。 详情请参阅源文件的相关链接。

In the introduction of third-party libraries, in order to be compatible with existing project pod dependencies, as well as to customize changes and bug fixes of third-party libraries, and to facilitate subsequent maintenance, this framework uniformly modified the class prefix and method prefix. If there is any inconvenience during use, Please understand.
If you are the author of a third-party open source library, if this library violates your rights, please let me know, and I will immediately remove the use of the third-party open source library. 

支持

wuyong.site