InsectQY / CommonSetting

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

CommonSetting

CI Status Version License Platform

一行代码集成通用设置页面,支持配置文件和代码两种方式初始化

Swift 版本

Use

最少你只需要一行代码就能集成 CommonSetting,以下两种方式选择其中一种即可。

使用配置文件初始化(推荐)

  1. 导入头文件
#import <CommonSetting/QYCommonSetting.h>
  1. 在主工程中创建一个 MySetting.json 文件,配置需要自定义的参数
{
    "appId": "上架到 App Store 时的 appId",
    "privacyPolicy": "隐私政策地址",
    "userAgreement": "用户协议地址",
    "feedbackEmail": "用于联系我们时显示的 email",
    "shareIcon": "分享用的 Icon 名称,若不配置则默认使用 AppIcon",
    "aboutIcon": "关于界面用的 Icon 名称,若不配置则默认使用 AppIcon",
    "copyright": "版权信息",
    "introduce": [
        {
            "title" : "标题",
            "subTitle" : "副标题",
            "imageName": "图片名称"
        
        },
        {
            "title" : "标题",
            "subTitle" : "副标题",
            "imageName": "图片名称"
        }
    ]
}
  1. 初始化控制器
QYCommonSettingViewController *vc = [[QYCommonSettingViewController alloc]init];
  1. 将其加入导航控制器中
[self.navigationController pushViewController:vc animated:YES];

或者

[[UINavigationController alloc]initWithRootViewController:vc];

使用代码初始化

  1. 导入头文件

  2. 初始化 QYSettings 对象

- (instancetype)initWithAppId:(NSString *)appId
                privacyPolicy:(NSString *)privacyPolicy
                userAgreement:(NSString *)userAgreement
                feedbackEmail:(NSString *)feedbackEmail
                    shareIcon:(NSString *)shareIcon
                    aboutIcon:(NSString *)aboutIcon
                    copyright:(NSString *)copyright
                    introduce:(NSArray<QYIntroduce *> *)introduce;
  1. 初始化控制器
QYCommonSettingViewController *vc = [[QYCommonSettingViewController alloc]init];
  1. 将其加入导航控制器中
[self.navigationController pushViewController:vc animated:YES];

或者

[[UINavigationController alloc]initWithRootViewController:vc];

Requirements

iOS 9.0+

Installation

CommonSetting is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod 'CommonSetting'

License

CommonSetting is available under the MIT license. See the LICENSE file for more info.

About

License:MIT License


Languages

Language:Objective-C 93.4%Language:Ruby 6.6%