Commit 20a47128 cgx

微信登录接口、账户与资料UI

1 个父辈 9ada19e9
正在显示 67 个修改的文件 包含 1211 行增加34 行删除
//
// NSObject+Extras.h
// DreamSleep
//
// Created by peter on 2022/4/19.
//
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
@interface NSObject (Extras)
@end
NS_ASSUME_NONNULL_END
//
// NSObject+Extras.m
// DreamSleep
//
// Created by peter on 2022/4/19.
//
#import "NSObject+Extras.h"
@implementation NSObject (Extras)
// 重写debugDescription, 而不是description
- (NSString *)debugDescription {
// 判断是否时NSArray 或者NSDictionary NSNumber 如果是的话直接返回 debugDescription
if ([self isKindOfClass:[NSArray class]] || [self isKindOfClass:[NSDictionary class]] || [self isKindOfClass:[NSString class]] || [self isKindOfClass:[NSNumber class]]) {
return [self debugDescription];
}
// 声明一个字典
NSMutableDictionary *dictionary = [NSMutableDictionary dictionary];
// 得到当前class的所有属性
uint count;
objc_property_t *properties = class_copyPropertyList([self class], &count);
// 循环并用KVC得到每个属性的值
for (int i = 0; i<count; i++) {
objc_property_t property = properties[i];
NSString *name = @(property_getName(property));
id value = [self valueForKey:name]?:@"nil"; // 默认值为nil字符串
[dictionary setObject:value forKey:name]; // 装载到字典里
}
// 释放
free(properties);
//return
return [NSString stringWithFormat:@"<%@: %p> -- %@", [self class], self,dictionary];
}
@end
......@@ -38,6 +38,8 @@ NS_ASSUME_NONNULL_BEGIN
+ (instancetype)btnWithTitle:(NSString *)title titleColor:(UIColor *)titleColor font:(UIFont *)font bgColor:(UIColor *)bgColor;
+ (instancetype)btnWithTitle:(NSString *)title font:(UIFont *)font;
+ (instancetype)btnWithTitle:(NSString *)title titleColor:(UIColor *)titleColor font:(UIFont *)font;
@end
NS_ASSUME_NONNULL_END
......@@ -80,4 +80,12 @@
return btn;
}
+ (instancetype)btnWithTitle:(NSString *)title titleColor:(UIColor *)titleColor font:(UIFont *)font {
UIButton *btn = [UIButton new];
[btn setTitle:title forState:UIControlStateNormal];
[btn setTitleColor:titleColor forState:UIControlStateNormal];
[btn.titleLabel setFont:font];
return btn;
}
@end
......@@ -20,7 +20,7 @@
DSLog(@"获取舒眠课程、助眠音乐列表数据接口dataDic:%@", responseObj);
completion(requestModel);
} failure:^(id _Nonnull failureInfo) {
requestModel.errCode = DSErrCodeNetFail;
requestModel.resCode = DSResCodeNetFail;
requestModel.errorInfo = failureInfo;
completion(requestModel);
}];
......
......@@ -90,8 +90,9 @@
// 授权登录的类
if ([resp isKindOfClass:[SendAuthResp class]]) {
if (resp.errCode == 0) {
SendAuthResp *resp2 = (SendAuthResp *)resp;
DSLog(@"resp2.code:%@", resp2.code);
SendAuthResp *authResp = (SendAuthResp *)resp;
DSLog(@"authResp.code:%@", authResp.code);
[[NSNotificationCenter defaultCenter] postNotificationName:WXLoginAuthNoti object:authResp.code];
} else {
DSLog(@"error:%@", resp.errStr);
}
......
......@@ -5,17 +5,31 @@
// Created by peter on 2022/4/13.
//
typedef NS_ENUM(NSInteger, DSErrCode) {
//typedef NS_ENUM(NSInteger, DSErrCode) {
// /** 网络故障 */
// DSErrCodeNetFail = -9,
// /** 业务逻辑成功 */
// DSErrCodeSuccess = -1,
// /** token验证失败 */
// DSErrCodeTokenFail = 401,
// /** 数据异常 */
// DSErrCodeDataWrong = -666,
// /** 异常数据错误,需要额外处理异常 */
// DSErrCodeNeedExtraDeal = 400022
//};
// 响应码
typedef NS_ENUM(NSInteger, DSResCode) {
/** 网络故障 */
DSErrCodeNetFail = -9,
DSResCodeNetFail = -9,
/** 业务逻辑成功 */
DSErrCodeSuccess = -1,
/** token验证失败 */
DSErrCodeTokenFail = 401,
DSResCodeSuccess = 1,
/** 业务逻辑失败 */
DSResCodeFail = -1,
/** 数据异常 */
DSErrCodeDataWrong = -666,
DSResCodeDataWrong = -666,
/** 异常数据错误,需要额外处理异常 */
DSErrCodeNeedExtraDeal = 400022
DSResCodeNeedExtraDeal = 400022
};
#import <AFNetworking/AFNetworking-umbrella.h>
......@@ -23,8 +37,10 @@ typedef NS_ENUM(NSInteger, DSErrCode) {
/// 网络请求二次封装基类
@interface DSNetworkTool : AFHTTPSessionManager
/** 响应状态码 */
@property (nonatomic, assign) DSResCode resCode;
/** 错误状态码 */
@property (nonatomic, assign) DSErrCode errCode;
//@property (nonatomic, assign) DSErrCode errCode;
///** 返回的错误信息 */
@property (nonatomic, copy) NSString *errorInfo;
......@@ -43,6 +59,23 @@ typedef NS_ENUM(NSInteger, DSErrCode) {
hasNetActivity:(BOOL)hasNetActivity
loadingInfo:(NSString *)loadingInfo
hasFailInfo:(BOOL)hasFailInfo
success:(void (^)(id responseObj))success
success:(void (^)(NSDictionary *responseObj))success
failure:(void (^)(id failureInfo))failure;
/// @param api 请求接口
/// @param params get、post请求统一使用post body
/// @param view view
/// @param hasNetActivity 是否显示网络状态指示器
/// @param loadingInfo 网络加载信息
/// @param hasFailInfo 是否有失败信息
/// @param success success
/// @param failure failure
+ (__kindof NSURLSessionDataTask *)httpPostBodyRequestWithAPI:(NSString *)api
params:(id)params
view:(UIView *)view
hasNetActivity:(BOOL)hasNetActivity
loadingInfo:(NSString *)loadingInfo
hasFailInfo:(BOOL)hasFailInfo
success:(void (^)(NSDictionary *apiDic))success
failure:(void (^)(id failure))failure;
@end
......@@ -34,7 +34,7 @@ NSString * const NetworkUnableError = @"网络不给力,请检查您的网络
hasNetActivity:(BOOL)hasNetActivity
loadingInfo:(NSString *)loadingInfo
hasFailInfo:(BOOL)hasFailInfo
success:(void (^)(id responseObj))success
success:(void (^)(NSDictionary *responseObj))success
failure:(void (^)(id failureInfo))failure
{
[[UIApplication sharedApplication] setNetworkActivityIndicatorVisible:hasNetActivity];
......@@ -76,4 +76,57 @@ NSString * const NetworkUnableError = @"网络不给力,请检查您的网络
return dataTask;
}
+ (__kindof NSURLSessionDataTask *)httpPostBodyRequestWithAPI:(NSString *)api
params:(id)params
view:(UIView *)view
hasNetActivity:(BOOL)hasNetActivity
loadingInfo:(NSString *)loadingInfo
hasFailInfo:(BOOL)hasFailInfo
success:(void (^)(NSDictionary *apiDic))success
failure:(void (^)(id failure))failure
{
[[UIApplication sharedApplication] setNetworkActivityIndicatorVisible:hasNetActivity];
if (loadingInfo) {
view ? [DSProgressHUD showProgressHUDWithInfo:loadingInfo inView:view] : [DSProgressHUD showProgressHUDWithInfo:loadingInfo];
}
NSString *urlString = [ServerURL stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]];
DSLog(@"请求链接:%@,业务参数:%@", urlString, params);
NSMutableURLRequest *request = [[AFJSONRequestSerializer serializer] requestWithMethod:@"POST" URLString:urlString parameters:nil error:nil];
NSData *jsonData = [NSJSONSerialization dataWithJSONObject:params options:NSJSONWritingPrettyPrinted error:nil];
[request setHTTPBody:jsonData];
[request addValue:@"application/json" forHTTPHeaderField:@"Content-Type"];
NSURLSessionDataTask *dataTask = [[DSNetworkTool sharedManager] dataTaskWithRequest:request uploadProgress:nil downloadProgress:nil completionHandler:^(NSURLResponse * _Nonnull response, id _Nullable responseObject, NSError * _Nullable error) {
[[UIApplication sharedApplication] setNetworkActivityIndicatorVisible:NO];
if (loadingInfo) { [DSProgressHUD dissmissProgressHUD]; }
if (responseObject) {
NSDictionary *responseDic = [NSJSONSerialization JSONObjectWithData:responseObject options:NSJSONReadingMutableContainers error:nil];
// DSLog(@"服务器返回的原始Json数据:%@", responseDic);
// 接口业务数据
NSString *apiStr = (api && [api isKindOfClass:[NSString class]]) ? api : @"";
NSDictionary *apiDataDic = responseDic[@"data"][apiStr];
if ([apiDataDic[@"res_code"] intValue] == DSResCodeSuccess) {
success(apiDataDic);
} else {
[DSProgressHUD showToast:apiDataDic[@"error"]];
return;
}
} else {
// 网络故障
DSLog(@"失败错误信息:%@", error);
if (hasFailInfo) {
NSString *alertStr = [NSString stringWithFormat:@"%ld", error.code];
view ? [DSProgressHUD showDetailInfo:alertStr inView:view] : [DSProgressHUD showDetailInfo:alertStr];
}
failure(error);
}
}];
[dataTask resume];
return dataTask;
}
@end
//
// AccountController.h
// DreamSleep
//
// Created by peter on 2022/4/19.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
/// 账户与资料页面
@interface AccountController : UIViewController
@end
NS_ASSUME_NONNULL_END
//
// AccountController.m
// DreamSleep
//
// Created by peter on 2022/4/19.
//
#import "AccountController.h"
#import "UserInfoView.h"
@interface AccountController ()
@property (nonatomic, strong) UserInfoView *userInfoView;
@end
@implementation AccountController
- (void)loadView {
self.view = self.userInfoView;
}
- (void)viewDidLoad {
[super viewDidLoad];
self.navigationItem.title = @"账户与资料";
self.view.dk_backgroundColorPicker = DKColorPickerWithKey(VCViewBG);
UIButton *closeBtn = [UIButton btnWithTitle:@"注销账号" titleColor:DSWhite font:SysFont(15)];
[closeBtn addTarget:self action:@selector(closeUserAction) forControlEvents:UIControlEventTouchUpInside];
self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:closeBtn];
}
- (void)closeUserAction {
}
#pragma mark - 导航栏日间、黑夜模式
- (NaviStyle)navigationBarStyle {
return NaviStyleDefault;
}
- (UserInfoView *)userInfoView {
if (!_userInfoView) {
_userInfoView = [[UserInfoView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, kScreenHeight - kTopHeight(0))];
}
return _userInfoView;
}
@end
......@@ -6,13 +6,14 @@
//
#import "ProfileController.h"
#import "AccountController.h"
#import "SystemSetController.h"
#import "LoginController.h"
#import "InviteController.h"
#import "PrivacyViewController.h"
#import "ProfileAlertView.h"
@interface ProfileController ()
@property (nonatomic, strong) UIView *userInfoView;
@property (nonatomic, strong) NSArray *tmpDatas;
@end
......@@ -23,7 +24,8 @@
self.navigationItem.title = @"我的";
self.tableView.dk_backgroundColorPicker = DKColorPickerWithKey(VCViewBG);
self.tmpDatas = @[@"注册登录信息", @"意见反馈", @"系统设置", @"邀请好友", @"关于我们", @"前往小程序", @"关注公众号", @"添加客服微信", @"失眠的认知行为疗法"];
self.tmpDatas = @[@"模拟用户登录", @"意见反馈", @"系统设置", @"邀请好友", @"关于我们", @"前往小程序", @"关注公众号", @"添加客服微信", @"失眠的认知行为疗法"];
self.tableView.tableHeaderView = self.userInfoView;
}
#pragma mark - 导航栏日间、黑夜模式
......@@ -54,10 +56,9 @@
[tableView deselectRowAtIndexPath:indexPath animated:YES];
switch (indexPath.row) {
case 0: // 跳转到登录页面
case 0: // 模拟跳转到登录页面
{
BaseNaviController *navi = [[BaseNaviController alloc] initWithRootViewController:[[LoginController alloc] init]];
[self presentViewController:navi animated:YES completion:nil];
[LoginUtils jumpToLoginControllerWithTarget:self];
}
break;
case 2: // 系统设置入口
......@@ -104,4 +105,28 @@
}
}
- (void)modifyAction {
// 判断是否登录成功
if ([LoginUtils getUserLoginData]) {
// 进入修改页面
AccountController *accountVC = [[AccountController alloc] init];
[self.navigationController pushViewController:accountVC animated:YES];
} else {
// 跳转到登录页面
[LoginUtils jumpToLoginControllerWithTarget:self];
}
}
- (UIView *)userInfoView {
if (!_userInfoView) {
_userInfoView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, 100)];
UIButton *btn = [UIButton btnWithTitle:@"点击修改信息" titleColor:BrandColor font:SysFont(16) bgColor:DSClearColor];
btn.frame = CGRectMake(0, 0, 150, 40);
btn.center = _userInfoView.center;
[btn addTarget:self action:@selector(modifyAction) forControlEvents:UIControlEventTouchUpInside];
[_userInfoView addSubview:btn];
}
return _userInfoView;
}
@end
......@@ -20,7 +20,7 @@
NSString *version = [NSString stringWithFormat:@"当前版本%@", [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleShortVersionString"]];
NSArray *details = @[version, @"", @"", @"10.0M"];
NSMutableArray *tmpArr = [NSMutableArray array];
for (int i = 0; i < 4; i++) {
for (int i = 0; i < titles.count; i++) {
SetModel *m = [SetModel new];
m.title = titles[i];
m.detail = details[i];
......@@ -42,7 +42,7 @@
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
self.dk_backgroundColorPicker = DKColorPickerWithColors(DSWhite, ColorFromHex(0x1F263F), DSWhite);
self.dk_backgroundColorPicker = DKColorPickerWithColors(DSWhite, CornerViewDarkColor, DSWhite);
self.accessoryView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"moreIcon"]];
self.titleLab = [UILabel dkLabWithFont:SysFont(15.0)];
......@@ -94,7 +94,7 @@
self.setDelegate = delegate;
[self cornerRadius:10];
self.scrollEnabled = NO;
self.dk_backgroundColorPicker = DKColorPickerWithColors(DSWhite, ColorFromHex(0x1F263F), DSWhite);
self.dk_backgroundColorPicker = DKColorPickerWithColors(DSWhite, CornerViewDarkColor, DSWhite);
self.separatorStyle = UITableViewCellSeparatorStyleNone;
[self.setDataSource addDataArray:self.dataArr];
self.tableFooterView = self.footView;
......
//
// UserInfoTableView.h
// DreamSleep
//
// Created by peter on 2022/4/19.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@protocol UserInfoTableViewDelegate <NSObject>
- (void)didSelectRowAtIndexPath:(NSIndexPath *)indexPath;
@end
@interface UserInfoTableView : UITableView
@property (nonatomic, weak) id<UserInfoTableViewDelegate> setDelegate;
- (instancetype)initWithFrame:(CGRect)frame delegate:(id<UserInfoTableViewDelegate>)delegate;
@end
NS_ASSUME_NONNULL_END
//
// UserInfoTableView.m
// DreamSleep
//
// Created by peter on 2022/4/19.
//
#import "UserInfoTableView.h"
#import "UserModel.h"
/// 设置自定义Cell
@interface UserCell : UITableViewCell
@property (nonatomic, strong) UILabel *titleLab;
@property (nonatomic, strong) UILabel *detailLab;
@property (nonatomic, strong) UIImageView *rightIcon;
- (void)updateUIWithModel:(UserModel *)model;
@end
@implementation UserCell
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
self.dk_backgroundColorPicker = DKColorPickerWithColors(DSWhite, CornerViewDarkColor, DSWhite);
self.accessoryView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"moreIcon"]];
self.titleLab = [UILabel dkLabWithFont:SysFont(15.0)];
[self addSubview:self.titleLab];
self.detailLab = [UILabel labWithFont:SysFont(14.0)];
self.detailLab.dk_textColorPicker = DKColorPickerWithColors(SubTitleColor, ColorFromHex(0x8C8F9D), DSWhite);
[self addSubview:self.detailLab];
}
return self;
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
self.selectedBackgroundView = [[UIView alloc] initWithFrame:self.frame];
self.selectedBackgroundView.backgroundColor = DSClearColor;
[super setSelected:selected animated:animated];
}
- (void)updateUIWithModel:(UserModel *)model {
self.titleLab.text = model.title;
self.detailLab.text = @"";
[self.titleLab sizeToFit];
[self.detailLab sizeToFit];
[self.titleLab mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(self).offset(15);
make.centerY.equalTo(self);
}];
[self.detailLab mas_makeConstraints:^(MASConstraintMaker *make) {
make.right.equalTo(self.accessoryView.mas_left).offset(-8);
make.centerY.equalTo(self);
}];
}
@end
@interface UserInfoTableView () <UITableViewDelegate>
@property (nonatomic, strong) DSDataSource *infoDataSource;
@property (nonatomic, strong) NSArray *dataArr;
@end
@implementation UserInfoTableView
- (instancetype)initWithFrame:(CGRect)frame delegate:(id<UserInfoTableViewDelegate>)delegate {
if (self = [super initWithFrame:frame style:UITableViewStylePlain]) {
self.dataArr = [UserModel getAllUserDatas];
self.setDelegate = delegate;
[self cornerRadius:10];
self.scrollEnabled = NO;
self.dk_backgroundColorPicker = DKColorPickerWithColors(DSWhite, CornerViewDarkColor, DSWhite);
self.separatorStyle = UITableViewCellSeparatorStyleNone;
[self.infoDataSource addDataArray:self.dataArr];
}
return self;
}
- (DSDataSource *)infoDataSource {
if (!_infoDataSource) {
CellConfigureBlock cellBlock = ^(UserCell * cell, UserModel * model, NSIndexPath * indexPath) {
[cell updateUIWithModel:model];
};
NSString * const userCell = @"UserCell";
_infoDataSource = [[DSDataSource alloc] initWithIdentifier:userCell datas:@[] isSection:NO configureBlock:cellBlock];
self.dataSource = _infoDataSource;
self.delegate = self;
[self registerClass:[UserCell class] forCellReuseIdentifier:userCell];
}
return _infoDataSource;
}
#pragma mark - UITableViewDelegate
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
return 50;
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
DSLog(@"indexPath:%ld", indexPath.row);
}
@end
//
// UserInfoView.h
// DreamSleep
//
// Created by peter on 2022/4/19.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface UserInfoView : UIView
@end
NS_ASSUME_NONNULL_END
//
// UserInfoView.m
// DreamSleep
//
// Created by peter on 2022/4/19.
//
#import "UserInfoView.h"
#import "UserInfoTableView.h"
#import <YYWebImage/YYWebImage.h>
@interface UserInfoView () <UserInfoTableViewDelegate>
@property (nonatomic, strong) UIButton *portraitBtn;
@property (nonatomic, strong) UserInfoTableView *userInfoTV;
@property (nonatomic, strong) UIButton *layoutBtn;
@end
@implementation UserInfoView
- (instancetype)initWithFrame:(CGRect)frame {
if (self = [super initWithFrame:frame]) {
[self.portraitBtn yy_setImageWithURL:[NSURL URLWithString:@"https://img2.ydniu.com/sleep_ssmain/face_img/1648892614555_QhXhJX.jpg"] forState:UIControlStateNormal placeholder:[UIImage imageNamed:@"portrait"]];
[self addSubview:self.userInfoTV];
[self addSubview:self.layoutBtn];
[self.layoutBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerX.equalTo(self);
make.width.equalTo(@(kScreenWidth - 30));
make.height.equalTo(@40);
make.top.equalTo(self.userInfoTV.mas_bottom).offset(100);
}];
}
return self;
}
- (void)updatePortraitAction {
}
- (void)exitAction {
}
#pragma mark - UserInfoTableViewDelegate
- (void)didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
}
- (UIButton *)portraitBtn {
if (!_portraitBtn) {
_portraitBtn = [[UIButton alloc] initWithFrame:CGRectMake(0, 83, 145, 145)];
_portraitBtn.centerX = self.centerX;
[_portraitBtn addTarget:self action:@selector(updatePortraitAction) forControlEvents:UIControlEventTouchUpInside];
_portraitBtn.imageView.contentMode = UIViewContentModeScaleAspectFit;
_portraitBtn.contentHorizontalAlignment = UIControlContentHorizontalAlignmentFill;
_portraitBtn.contentVerticalAlignment = UIControlContentVerticalAlignmentFill;
[_portraitBtn cornerRadius:145/2.0];
[self addSubview:_portraitBtn];
UIImageView *cameraIV = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"cameraIcon"]];
[self addSubview:cameraIV];
[cameraIV mas_makeConstraints:^(MASConstraintMaker *make) {
make.right.equalTo(_portraitBtn).offset(-6);
make.bottom.equalTo(_portraitBtn).offset(-6);
}];
}
return _portraitBtn;
}
- (UserInfoTableView *)userInfoTV {
if (!_userInfoTV) {
_userInfoTV = [[UserInfoTableView alloc] initWithFrame:CGRectMake(15, CGRectGetMaxY(self.portraitBtn.frame) + 60, kScreenWidth - 30, 150) delegate:self];
}
return _userInfoTV;
}
- (UIButton *)layoutBtn {
if (!_layoutBtn) {
_layoutBtn = [UIButton btnWithTitle:@"退出登录" titleColor:BrandColor font:SysFont(15)];
[_layoutBtn addTarget:self action:@selector(exitAction) forControlEvents:UIControlEventTouchUpInside];
[_layoutBtn cornerRadius:10];
_layoutBtn.dk_backgroundColorPicker = DKColorPickerWithColors(DSWhite, CornerViewDarkColor, DSWhite);
}
return _layoutBtn;
}
@end
......@@ -9,6 +9,7 @@
#import "LoginView.h"
#import "PrivacyViewController.h"
#import <AuthenticationServices/AuthenticationServices.h>
#import "UserRequestModel.h"
@interface LoginController () <LoginViewDelegate, ASAuthorizationControllerDelegate, ASAuthorizationControllerPresentationContextProviding>
@property (strong, nonatomic) LoginView *loginView;
......@@ -23,6 +24,7 @@
- (void)viewDidLoad {
[super viewDidLoad];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(wxLoginAuth:) name:WXLoginAuthNoti object:nil];
}
- (void)viewWillAppear:(BOOL)animated {
......@@ -35,6 +37,21 @@
return [self.dk_manager.themeVersion isEqualToString:DKThemeVersionNormal] ? UIStatusBarStyleDefault : UIStatusBarStyleLightContent;
}
- (void)dealloc {
[[NSNotificationCenter defaultCenter] removeObserver:self name:WXLoginAuthNoti object:nil];
}
- (void)wxLoginAuth:(NSNotification *)noti {
NSString *code = noti.object;
[UserRequestModel wxLoginWithCode:code completion:^(UserRequestModel * _Nonnull requestModel) {
if (requestModel.resCode == DSResCodeSuccess) {
[self dismissViewControllerAnimated:YES completion:nil];
} else {
[DSProgressHUD showToast:requestModel.errorInfo];
}
}];
}
#pragma mark - LoginViewDelegate
- (void)sendClickAction:(NSInteger)tag {
switch (tag) {
......@@ -170,6 +187,9 @@
case ASAuthorizationErrorUnknown:
errorMsg = @"授权请求失败未知原因";
break;
case ASAuthorizationErrorNotInteractive:
errorMsg = @"ASAuthorizationErrorNotInteractive";
break;
}
NSLog(@"controller requests:%@, errorMsg:%@", controller.authorizationRequests, errorMsg);
}
......
//
// LoginUtils.h
// DreamSleep
//
// Created by peter on 2022/4/19.
//
#import <Foundation/Foundation.h>
@class UserModel;
NS_ASSUME_NONNULL_BEGIN
/// 登录模块工具类
@interface LoginUtils : NSObject
/// 获取用户登录数据
+ (UserModel *)getUserLoginData;
+ (int)getUserID;
/// 保存用户登录数据
+ (void)saveUserLoginData:(UserModel *)model;
+ (void)jumpToLoginControllerWithTarget:(UIViewController *)target;
@end
NS_ASSUME_NONNULL_END
//
// LoginUtils.m
// DreamSleep
//
// Created by peter on 2022/4/19.
//
#import "LoginUtils.h"
#import "UserModel.h"
#import "LoginController.h"
@implementation LoginUtils
+ (UserModel *)getUserLoginData {
UserModel *userModel = [NSKeyedUnarchiver unarchiveObjectWithData:kGetUserDefaultsObj(UserBasicInfo)];
return userModel;
}
+ (int)getUserID {
UserModel *userModel = [self getUserLoginData];
return userModel.user_id;
}
+ (void)saveUserLoginData:(UserModel *)model {
NSData *userData = [NSKeyedArchiver archivedDataWithRootObject:model];
kSetUserDefaultsObj(userData, UserBasicInfo);
kUserDefaultsSynchronize;
}
+ (void)jumpToLoginControllerWithTarget:(UIViewController *)target {
if (target && [target isKindOfClass:[UIViewController class]]) {
BaseNaviController *navi = [[BaseNaviController alloc] initWithRootViewController:[[LoginController alloc] init]];
[target presentViewController:navi animated:YES completion:nil];
}
}
@end
//
// UserModel.h
// DreamSleep
//
// Created by peter on 2022/4/19.
//
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
/// 用户数据model
@interface UserModel : NSObject <NSCoding>
@property (nonatomic, copy) NSString *nick_name;
@property (nonatomic, assign) BOOL gender;
@property (nonatomic, copy) NSString *birthday;
@property (nonatomic, assign) int user_id;
@property (nonatomic, copy) NSString *token;
@property (nonatomic, copy) NSString *sid;
@property (nonatomic, copy) NSString *user_name;
@property (nonatomic, copy) NSString *face_img;
@property (nonatomic, assign) int is_access;
@property (nonatomic, copy) NSString *title;
+ (NSArray *)getAllUserDatas;
@end
NS_ASSUME_NONNULL_END
//
// UserModel.m
// DreamSleep
//
// Created by peter on 2022/4/19.
//
#import "UserModel.h"
@implementation UserModel
- (void)encodeWithCoder:(NSCoder *)aCoder {
[aCoder encodeObject:_nick_name forKey:@"nick_name"];
[aCoder encodeObject:@(_gender) forKey:@"gender"];
[aCoder encodeObject:_birthday forKey:@"birthday"];
[aCoder encodeObject:@(_user_id) forKey:@"user_id"];
[aCoder encodeObject:_token forKey:@"token"];
[aCoder encodeObject:_face_img forKey:@"face_img"];
}
- (id)initWithCoder:(NSCoder *)aDecoder {
_nick_name = [aDecoder decodeObjectForKey:@"nick_name"] ;
_gender = [[aDecoder decodeObjectForKey:@"gender"] boolValue];
_birthday = [aDecoder decodeObjectForKey:@"birthday"];
_user_id = [[aDecoder decodeObjectForKey:@"user_id"] intValue];
_token = [aDecoder decodeObjectForKey:@"token"];
_face_img = [aDecoder decodeObjectForKey:@"face_img"];
return self;
}
+ (NSArray *)getAllUserDatas {
NSArray *titles = @[@"昵称", @"性别", @"生日"];
NSMutableArray *tmpArr = [NSMutableArray array];
for (int i = 0; i < titles.count; i++) {
UserModel *m = [UserModel new];
m.title = titles[i];
[tmpArr addObject:m];
}
return [tmpArr copy];
}
@end
......@@ -6,11 +6,28 @@
//
#import "DSNetworkTool.h"
#import "UserModel.h"
NS_ASSUME_NONNULL_BEGIN
/// 用户相关请求
@interface UserRequestModel : DSNetworkTool
@property (nonatomic, strong) UserModel *userModel;
/// 微信登录请求
/// @param code 客户端微信授权用户code
/// @param completion completion
+ (NSURLSessionDataTask *)wxLoginWithCode:(NSString *)code completion:(void (^)(UserRequestModel *requestModel))completion;
/// 用户退出登录接口
/// @param completion completion
+ (NSURLSessionDataTask *)layoutRequestWithCompletion:(void (^)(UserRequestModel *requestModel))completion;
/// 用户注销账号接口
/// @param completion completion
+ (NSURLSessionDataTask *)closeUserRequestWithCompletion:(void (^)(UserRequestModel *requestModel))completion;
@end
NS_ASSUME_NONNULL_END
......@@ -6,9 +6,63 @@
//
#import "UserRequestModel.h"
#import <YYModel/YYModel.h>
@implementation UserRequestModel
+ (NSURLSessionDataTask *)wxLoginWithCode:(NSString *)code completion:(void (^)(UserRequestModel *requestModel))completion {
UserRequestModel * requestModel = [[UserRequestModel alloc] init];
NSString *api = @"wxLogin";
NSString *argStr = [NSString stringWithFormat:@"mutation{%@(code:\"%@\")}", api, code];
return [self httpPostBodyRequestWithAPI:api params:@{@"query" : argStr} view:nil hasNetActivity:YES loadingInfo:nil hasFailInfo:YES success:^(NSDictionary * _Nonnull apiDic) {
DSLog(@"微信登录接口apiDic:%@", apiDic);
requestModel.resCode = DSResCodeSuccess;
NSDictionary *resultDic = apiDic[@"result"];
UserModel *userModel = [UserModel yy_modelWithJSON:resultDic];
DSLog(@"userModel:%@", userModel.debugDescription);
// 保存用户信息
[LoginUtils saveUserLoginData:userModel];
completion(requestModel);
} failure:^(id _Nonnull failureInfo) {
requestModel.resCode = DSResCodeNetFail;
requestModel.errorInfo = failureInfo;
completion(requestModel);
}];
}
+ (NSURLSessionDataTask *)layoutRequestWithCompletion:(void (^)(UserRequestModel *requestModel))completion
{
UserRequestModel * requestModel = [[UserRequestModel alloc] init];
NSString *api = @"user_logout";
NSString *argStr = [NSString stringWithFormat:@"mutation{%@}", api];
return [self httpPostBodyRequestWithAPI:api params:@{@"query" : argStr} view:nil hasNetActivity:YES loadingInfo:nil hasFailInfo:YES success:^(NSDictionary * _Nonnull apiDic) {
DSLog(@"用户退出登录接口apiDic:%@", apiDic);
requestModel.resCode = DSResCodeSuccess;
completion(requestModel);
} failure:^(id _Nonnull failureInfo) {
requestModel.resCode = DSResCodeNetFail;
requestModel.errorInfo = failureInfo;
completion(requestModel);
}];
}
+ (NSURLSessionDataTask *)closeUserRequestWithCompletion:(void (^)(UserRequestModel *requestModel))completion
{
UserRequestModel * requestModel = [[UserRequestModel alloc] init];
NSString *api = @"close_user";
int user_id = [LoginUtils getUserID];
NSString *argStr = [NSString stringWithFormat:@"mutation{%@(user_id:%d)}", api, user_id];
return [self httpPostBodyRequestWithAPI:api params:@{@"query" : argStr} view:nil hasNetActivity:YES loadingInfo:nil hasFailInfo:YES success:^(NSDictionary * _Nonnull apiDic) {
DSLog(@"用户用户注销账户接口apiDic:%@", apiDic);
requestModel.resCode = DSResCodeSuccess;
completion(requestModel);
} failure:^(id _Nonnull failureInfo) {
requestModel.resCode = DSResCodeNetFail;
requestModel.errorInfo = failureInfo;
completion(requestModel);
}];
}
// 修改用户信息
+ (NSURLSessionDataTask *)updateUserInfoWithCompletion:(void (^)(UserRequestModel *requestModel))completion {
UserRequestModel * requestModel = [[UserRequestModel alloc] init];
......@@ -17,9 +71,10 @@
return [self httpPostBodyRequestWithParam:@{@"query" : argStr} view:nil hasNetActivity:YES loadingInfo:nil hasFailInfo:YES success:^(id _Nonnull responseObj) {
DSLog(@"修改用户接口dataDic:%@", responseObj);
requestModel.resCode = DSResCodeSuccess;
completion(requestModel);
} failure:^(id _Nonnull failureInfo) {
requestModel.errCode = DSErrCodeNetFail;
requestModel.resCode = DSResCodeNetFail;
requestModel.errorInfo = failureInfo;
completion(requestModel);
}];
......
{
"images" : [
{
"filename" : "cameraIcon.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "cameraIcon@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "cameraIcon@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"filename" : "portrait.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "portrait@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "portrait@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
......@@ -64,6 +64,8 @@
#define BGColor ColorFromHex(0xF5F7FA)
// 弹框背景黑夜深色
#define AlertDarkColor ColorFromHex(0x131724)
// 常用圆角视图黑夜深色
#define CornerViewDarkColor ColorFromHex(0x1F263F)
/** 副文案颜色 */
#define SubTextColor [UIColor colorWithHexString:@"#A0A0A0"]
......
......@@ -30,6 +30,12 @@ FOUNDATION_EXTERN NSString * const ExpireTime1;
FOUNDATION_EXTERN NSString * const StartTime2;
FOUNDATION_EXTERN NSString * const ExpireTime2;
// 通知相关
FOUNDATION_EXTERN NSString * const WXLoginAuthNoti;
// 用户基础信息
FOUNDATION_EXTERN NSString * const UserBasicInfo;
#pragma mark - 第三方平台配置
/** 微信开放平台AppID */
FOUNDATION_EXTERN NSString * const WeChatAppID;
......
......@@ -23,6 +23,10 @@ NSString * const ExpireTime1 = @"23:59:59";
NSString * const StartTime2 = @"00:00:00";
NSString * const ExpireTime2 = @"06:00:00";
NSString * const WXLoginAuthNoti = @"wxLoginAuthNoti";
NSString * const UserBasicInfo = @"UserBasicInfo";
NSString * const WeChatAppID = @"wx4cdd4760092cdfdf";
NSString * const WeChatAppSecret = @"";
NSString * const UNIVERSAL_LINK = @"https://www.cbti.cn/sleep_apple/";
......
......@@ -29,6 +29,9 @@
#endif
#pragma mark - UserDefaults
// OBJ
#define kSetUserDefaultsObj(obj, key) [[NSUserDefaults standardUserDefaults] setObject:obj forKey:key]
#define kGetUserDefaultsObj(key) [[NSUserDefaults standardUserDefaults] objectForKey:key]
// BOOL
#define kSetUserDefaultsBOOL(boolValue, key) [[NSUserDefaults standardUserDefaults] setBool:boolValue forKey:key]
#define kGetUserDefaultsBOOL(key) [[NSUserDefaults standardUserDefaults] boolForKey:key]
......
......@@ -30,4 +30,6 @@
#import "DSProgressHUD.h"
#import "LoginUtils.h"
#endif /* PrefixHeader_pch */
......@@ -11,6 +11,7 @@ target 'DreamSleep' do
pod 'MBProgressHUD', '~> 1.2.0'
pod 'YYWebImage', '~> 1.0.5'
pod 'YYImage/WebP'
pod 'YYModel', '~> 1.0.4'
end
# AFNetworking (4.0.1)
......@@ -22,4 +23,5 @@ end
# DOUAudioStreamer (0.2.16)
# MBProgressHUD (1.2.0)
# YYWebImage (1.0.5)
# YYImage/WebP
# YYImage/WebP(模拟器上目前无法运行)
# YYModel (1.0.4)
......@@ -32,6 +32,7 @@ PODS:
- YYImage/Core (1.0.4)
- YYImage/WebP (1.0.4):
- YYImage/Core
- YYModel (1.0.4)
- YYWebImage (1.0.5):
- YYCache
- YYImage
......@@ -45,6 +46,7 @@ DEPENDENCIES:
- MJRefresh (~> 3.7.5)
- YTKNetwork (~> 3.0.6)
- YYImage/WebP
- YYModel (~> 1.0.4)
- YYWebImage (~> 1.0.5)
SPEC REPOS:
......@@ -59,6 +61,7 @@ SPEC REPOS:
- YTKNetwork
- YYCache
- YYImage
- YYModel
- YYWebImage
SPEC CHECKSUMS:
......@@ -72,8 +75,9 @@ SPEC CHECKSUMS:
YTKNetwork: c16be90b06be003de9e9cd0d3b187cc8eaf35c04
YYCache: 8105b6638f5e849296c71f331ff83891a4942952
YYImage: 1e1b62a9997399593e4b9c4ecfbbabbf1d3f3b54
YYModel: 2a7fdd96aaa4b86a824e26d0c517de8928c04b30
YYWebImage: 5f7f36aee2ae293f016d418c7d6ba05c4863e928
PODFILE CHECKSUM: 462801539eac1a9c9c847595e3687fd361bff7ed
PODFILE CHECKSUM: b3d9e0300e1732ba6a625a3cac34c1a05fcefc19
COCOAPODS: 1.11.3
......@@ -32,6 +32,7 @@ PODS:
- YYImage/Core (1.0.4)
- YYImage/WebP (1.0.4):
- YYImage/Core
- YYModel (1.0.4)
- YYWebImage (1.0.5):
- YYCache
- YYImage
......@@ -45,6 +46,7 @@ DEPENDENCIES:
- MJRefresh (~> 3.7.5)
- YTKNetwork (~> 3.0.6)
- YYImage/WebP
- YYModel (~> 1.0.4)
- YYWebImage (~> 1.0.5)
SPEC REPOS:
......@@ -59,6 +61,7 @@ SPEC REPOS:
- YTKNetwork
- YYCache
- YYImage
- YYModel
- YYWebImage
SPEC CHECKSUMS:
......@@ -72,8 +75,9 @@ SPEC CHECKSUMS:
YTKNetwork: c16be90b06be003de9e9cd0d3b187cc8eaf35c04
YYCache: 8105b6638f5e849296c71f331ff83891a4942952
YYImage: 1e1b62a9997399593e4b9c4ecfbbabbf1d3f3b54
YYModel: 2a7fdd96aaa4b86a824e26d0c517de8928c04b30
YYWebImage: 5f7f36aee2ae293f016d418c7d6ba05c4863e928
PODFILE CHECKSUM: 462801539eac1a9c9c847595e3687fd361bff7ed
PODFILE CHECKSUM: b3d9e0300e1732ba6a625a3cac34c1a05fcefc19
COCOAPODS: 1.11.3
......@@ -227,6 +227,32 @@ SOFTWARE.
## YYModel
The MIT License (MIT)
Copyright (c) 2015 ibireme <ibireme@gmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
## YYWebImage
The MIT License (MIT)
......
......@@ -320,6 +320,38 @@ SOFTWARE.
<key>License</key>
<string>MIT</string>
<key>Title</key>
<string>YYModel</string>
<key>Type</key>
<string>PSGroupSpecifier</string>
</dict>
<dict>
<key>FooterText</key>
<string>The MIT License (MIT)
Copyright (c) 2015 ibireme &lt;ibireme@gmail.com&gt;
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
</string>
<key>License</key>
<string>MIT</string>
<key>Title</key>
<string>YYWebImage</string>
<key>Type</key>
<string>PSGroupSpecifier</string>
......
......@@ -8,5 +8,6 @@ ${BUILT_PRODUCTS_DIR}/Masonry/Masonry.framework
${BUILT_PRODUCTS_DIR}/YTKNetwork/YTKNetwork.framework
${BUILT_PRODUCTS_DIR}/YYCache/YYCache.framework
${BUILT_PRODUCTS_DIR}/YYImage/YYImage.framework
${BUILT_PRODUCTS_DIR}/YYModel/YYModel.framework
${BUILT_PRODUCTS_DIR}/YYWebImage/YYWebImage.framework
${BUILT_PRODUCTS_DIR}/lottie-ios/Lottie.framework
\ No newline at end of file
......@@ -7,5 +7,6 @@ ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Masonry.framework
${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/YTKNetwork.framework
${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/YYCache.framework
${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/YYImage.framework
${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/YYModel.framework
${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/YYWebImage.framework
${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Lottie.framework
\ No newline at end of file
......@@ -8,5 +8,6 @@ ${BUILT_PRODUCTS_DIR}/Masonry/Masonry.framework
${BUILT_PRODUCTS_DIR}/YTKNetwork/YTKNetwork.framework
${BUILT_PRODUCTS_DIR}/YYCache/YYCache.framework
${BUILT_PRODUCTS_DIR}/YYImage/YYImage.framework
${BUILT_PRODUCTS_DIR}/YYModel/YYModel.framework
${BUILT_PRODUCTS_DIR}/YYWebImage/YYWebImage.framework
${BUILT_PRODUCTS_DIR}/lottie-ios/Lottie.framework
\ No newline at end of file
......@@ -7,5 +7,6 @@ ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Masonry.framework
${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/YTKNetwork.framework
${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/YYCache.framework
${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/YYImage.framework
${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/YYModel.framework
${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/YYWebImage.framework
${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Lottie.framework
\ No newline at end of file
......@@ -8,5 +8,6 @@ ${BUILT_PRODUCTS_DIR}/Masonry/Masonry.framework
${BUILT_PRODUCTS_DIR}/YTKNetwork/YTKNetwork.framework
${BUILT_PRODUCTS_DIR}/YYCache/YYCache.framework
${BUILT_PRODUCTS_DIR}/YYImage/YYImage.framework
${BUILT_PRODUCTS_DIR}/YYModel/YYModel.framework
${BUILT_PRODUCTS_DIR}/YYWebImage/YYWebImage.framework
${BUILT_PRODUCTS_DIR}/lottie-ios/Lottie.framework
\ No newline at end of file
......@@ -7,5 +7,6 @@ ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Masonry.framework
${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/YTKNetwork.framework
${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/YYCache.framework
${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/YYImage.framework
${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/YYModel.framework
${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/YYWebImage.framework
${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Lottie.framework
\ No newline at end of file
......@@ -185,6 +185,7 @@ if [[ "$CONFIGURATION" == "Beta" ]]; then
install_framework "${BUILT_PRODUCTS_DIR}/YTKNetwork/YTKNetwork.framework"
install_framework "${BUILT_PRODUCTS_DIR}/YYCache/YYCache.framework"
install_framework "${BUILT_PRODUCTS_DIR}/YYImage/YYImage.framework"
install_framework "${BUILT_PRODUCTS_DIR}/YYModel/YYModel.framework"
install_framework "${BUILT_PRODUCTS_DIR}/YYWebImage/YYWebImage.framework"
install_framework "${BUILT_PRODUCTS_DIR}/lottie-ios/Lottie.framework"
fi
......@@ -198,6 +199,7 @@ if [[ "$CONFIGURATION" == "Debug" ]]; then
install_framework "${BUILT_PRODUCTS_DIR}/YTKNetwork/YTKNetwork.framework"
install_framework "${BUILT_PRODUCTS_DIR}/YYCache/YYCache.framework"
install_framework "${BUILT_PRODUCTS_DIR}/YYImage/YYImage.framework"
install_framework "${BUILT_PRODUCTS_DIR}/YYModel/YYModel.framework"
install_framework "${BUILT_PRODUCTS_DIR}/YYWebImage/YYWebImage.framework"
install_framework "${BUILT_PRODUCTS_DIR}/lottie-ios/Lottie.framework"
fi
......@@ -211,6 +213,7 @@ if [[ "$CONFIGURATION" == "Release" ]]; then
install_framework "${BUILT_PRODUCTS_DIR}/YTKNetwork/YTKNetwork.framework"
install_framework "${BUILT_PRODUCTS_DIR}/YYCache/YYCache.framework"
install_framework "${BUILT_PRODUCTS_DIR}/YYImage/YYImage.framework"
install_framework "${BUILT_PRODUCTS_DIR}/YYModel/YYModel.framework"
install_framework "${BUILT_PRODUCTS_DIR}/YYWebImage/YYWebImage.framework"
install_framework "${BUILT_PRODUCTS_DIR}/lottie-ios/Lottie.framework"
fi
......
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO
FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/AFNetworking" "${PODS_CONFIGURATION_BUILD_DIR}/DKNightVersion" "${PODS_CONFIGURATION_BUILD_DIR}/DOUAudioStreamer" "${PODS_CONFIGURATION_BUILD_DIR}/MBProgressHUD" "${PODS_CONFIGURATION_BUILD_DIR}/MJRefresh" "${PODS_CONFIGURATION_BUILD_DIR}/Masonry" "${PODS_CONFIGURATION_BUILD_DIR}/YTKNetwork" "${PODS_CONFIGURATION_BUILD_DIR}/YYCache" "${PODS_CONFIGURATION_BUILD_DIR}/YYImage" "${PODS_CONFIGURATION_BUILD_DIR}/YYWebImage" "${PODS_CONFIGURATION_BUILD_DIR}/lottie-ios" "${PODS_ROOT}/YYImage/Vendor"
FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/AFNetworking" "${PODS_CONFIGURATION_BUILD_DIR}/DKNightVersion" "${PODS_CONFIGURATION_BUILD_DIR}/DOUAudioStreamer" "${PODS_CONFIGURATION_BUILD_DIR}/MBProgressHUD" "${PODS_CONFIGURATION_BUILD_DIR}/MJRefresh" "${PODS_CONFIGURATION_BUILD_DIR}/Masonry" "${PODS_CONFIGURATION_BUILD_DIR}/YTKNetwork" "${PODS_CONFIGURATION_BUILD_DIR}/YYCache" "${PODS_CONFIGURATION_BUILD_DIR}/YYImage" "${PODS_CONFIGURATION_BUILD_DIR}/YYModel" "${PODS_CONFIGURATION_BUILD_DIR}/YYWebImage" "${PODS_CONFIGURATION_BUILD_DIR}/lottie-ios" "${PODS_ROOT}/YYImage/Vendor"
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/AFNetworking/AFNetworking.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/DKNightVersion/DKNightVersion.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/DOUAudioStreamer/DOUAudioStreamer.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/MBProgressHUD/MBProgressHUD.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/MJRefresh/MJRefresh.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/Masonry/Masonry.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/YTKNetwork/YTKNetwork.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/YYCache/YYCache.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/YYImage/YYImage.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/YYWebImage/YYWebImage.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/lottie-ios/Lottie.framework/Headers"
HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/AFNetworking/AFNetworking.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/DKNightVersion/DKNightVersion.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/DOUAudioStreamer/DOUAudioStreamer.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/MBProgressHUD/MBProgressHUD.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/MJRefresh/MJRefresh.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/Masonry/Masonry.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/YTKNetwork/YTKNetwork.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/YYCache/YYCache.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/YYImage/YYImage.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/YYModel/YYModel.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/YYWebImage/YYWebImage.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/lottie-ios/Lottie.framework/Headers"
LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks'
OTHER_LDFLAGS = $(inherited) -ObjC -l"sqlite3" -l"z" -framework "AFNetworking" -framework "AVFoundation" -framework "Accelerate" -framework "AssetsLibrary" -framework "AudioToolbox" -framework "CFNetwork" -framework "CoreAudio" -framework "CoreFoundation" -framework "CoreGraphics" -framework "DKNightVersion" -framework "DOUAudioStreamer" -framework "Foundation" -framework "ImageIO" -framework "Lottie" -framework "MBProgressHUD" -framework "MJRefresh" -framework "Masonry" -framework "MediaPlayer" -framework "MobileCoreServices" -framework "OpenGLES" -framework "QuartzCore" -framework "UIKit" -framework "YTKNetwork" -framework "YYCache" -framework "YYImage" -framework "YYWebImage"
OTHER_LDFLAGS = $(inherited) -ObjC -l"sqlite3" -l"z" -framework "AFNetworking" -framework "AVFoundation" -framework "Accelerate" -framework "AssetsLibrary" -framework "AudioToolbox" -framework "CFNetwork" -framework "CoreAudio" -framework "CoreFoundation" -framework "CoreGraphics" -framework "DKNightVersion" -framework "DOUAudioStreamer" -framework "Foundation" -framework "ImageIO" -framework "Lottie" -framework "MBProgressHUD" -framework "MJRefresh" -framework "Masonry" -framework "MediaPlayer" -framework "MobileCoreServices" -framework "OpenGLES" -framework "QuartzCore" -framework "UIKit" -framework "YTKNetwork" -framework "YYCache" -framework "YYImage" -framework "YYModel" -framework "YYWebImage"
PODS_BUILD_DIR = ${BUILD_DIR}
PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
PODS_PODFILE_DIR_PATH = ${SRCROOT}/.
......
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO
FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/AFNetworking" "${PODS_CONFIGURATION_BUILD_DIR}/DKNightVersion" "${PODS_CONFIGURATION_BUILD_DIR}/DOUAudioStreamer" "${PODS_CONFIGURATION_BUILD_DIR}/MBProgressHUD" "${PODS_CONFIGURATION_BUILD_DIR}/MJRefresh" "${PODS_CONFIGURATION_BUILD_DIR}/Masonry" "${PODS_CONFIGURATION_BUILD_DIR}/YTKNetwork" "${PODS_CONFIGURATION_BUILD_DIR}/YYCache" "${PODS_CONFIGURATION_BUILD_DIR}/YYImage" "${PODS_CONFIGURATION_BUILD_DIR}/YYWebImage" "${PODS_CONFIGURATION_BUILD_DIR}/lottie-ios" "${PODS_ROOT}/YYImage/Vendor"
FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/AFNetworking" "${PODS_CONFIGURATION_BUILD_DIR}/DKNightVersion" "${PODS_CONFIGURATION_BUILD_DIR}/DOUAudioStreamer" "${PODS_CONFIGURATION_BUILD_DIR}/MBProgressHUD" "${PODS_CONFIGURATION_BUILD_DIR}/MJRefresh" "${PODS_CONFIGURATION_BUILD_DIR}/Masonry" "${PODS_CONFIGURATION_BUILD_DIR}/YTKNetwork" "${PODS_CONFIGURATION_BUILD_DIR}/YYCache" "${PODS_CONFIGURATION_BUILD_DIR}/YYImage" "${PODS_CONFIGURATION_BUILD_DIR}/YYModel" "${PODS_CONFIGURATION_BUILD_DIR}/YYWebImage" "${PODS_CONFIGURATION_BUILD_DIR}/lottie-ios" "${PODS_ROOT}/YYImage/Vendor"
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/AFNetworking/AFNetworking.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/DKNightVersion/DKNightVersion.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/DOUAudioStreamer/DOUAudioStreamer.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/MBProgressHUD/MBProgressHUD.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/MJRefresh/MJRefresh.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/Masonry/Masonry.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/YTKNetwork/YTKNetwork.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/YYCache/YYCache.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/YYImage/YYImage.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/YYWebImage/YYWebImage.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/lottie-ios/Lottie.framework/Headers"
HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/AFNetworking/AFNetworking.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/DKNightVersion/DKNightVersion.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/DOUAudioStreamer/DOUAudioStreamer.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/MBProgressHUD/MBProgressHUD.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/MJRefresh/MJRefresh.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/Masonry/Masonry.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/YTKNetwork/YTKNetwork.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/YYCache/YYCache.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/YYImage/YYImage.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/YYModel/YYModel.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/YYWebImage/YYWebImage.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/lottie-ios/Lottie.framework/Headers"
LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks'
OTHER_LDFLAGS = $(inherited) -ObjC -l"sqlite3" -l"z" -framework "AFNetworking" -framework "AVFoundation" -framework "Accelerate" -framework "AssetsLibrary" -framework "AudioToolbox" -framework "CFNetwork" -framework "CoreAudio" -framework "CoreFoundation" -framework "CoreGraphics" -framework "DKNightVersion" -framework "DOUAudioStreamer" -framework "Foundation" -framework "ImageIO" -framework "Lottie" -framework "MBProgressHUD" -framework "MJRefresh" -framework "Masonry" -framework "MediaPlayer" -framework "MobileCoreServices" -framework "OpenGLES" -framework "QuartzCore" -framework "UIKit" -framework "YTKNetwork" -framework "YYCache" -framework "YYImage" -framework "YYWebImage"
OTHER_LDFLAGS = $(inherited) -ObjC -l"sqlite3" -l"z" -framework "AFNetworking" -framework "AVFoundation" -framework "Accelerate" -framework "AssetsLibrary" -framework "AudioToolbox" -framework "CFNetwork" -framework "CoreAudio" -framework "CoreFoundation" -framework "CoreGraphics" -framework "DKNightVersion" -framework "DOUAudioStreamer" -framework "Foundation" -framework "ImageIO" -framework "Lottie" -framework "MBProgressHUD" -framework "MJRefresh" -framework "Masonry" -framework "MediaPlayer" -framework "MobileCoreServices" -framework "OpenGLES" -framework "QuartzCore" -framework "UIKit" -framework "YTKNetwork" -framework "YYCache" -framework "YYImage" -framework "YYModel" -framework "YYWebImage"
PODS_BUILD_DIR = ${BUILD_DIR}
PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
PODS_PODFILE_DIR_PATH = ${SRCROOT}/.
......
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO
FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/AFNetworking" "${PODS_CONFIGURATION_BUILD_DIR}/DKNightVersion" "${PODS_CONFIGURATION_BUILD_DIR}/DOUAudioStreamer" "${PODS_CONFIGURATION_BUILD_DIR}/MBProgressHUD" "${PODS_CONFIGURATION_BUILD_DIR}/MJRefresh" "${PODS_CONFIGURATION_BUILD_DIR}/Masonry" "${PODS_CONFIGURATION_BUILD_DIR}/YTKNetwork" "${PODS_CONFIGURATION_BUILD_DIR}/YYCache" "${PODS_CONFIGURATION_BUILD_DIR}/YYImage" "${PODS_CONFIGURATION_BUILD_DIR}/YYWebImage" "${PODS_CONFIGURATION_BUILD_DIR}/lottie-ios" "${PODS_ROOT}/YYImage/Vendor"
FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/AFNetworking" "${PODS_CONFIGURATION_BUILD_DIR}/DKNightVersion" "${PODS_CONFIGURATION_BUILD_DIR}/DOUAudioStreamer" "${PODS_CONFIGURATION_BUILD_DIR}/MBProgressHUD" "${PODS_CONFIGURATION_BUILD_DIR}/MJRefresh" "${PODS_CONFIGURATION_BUILD_DIR}/Masonry" "${PODS_CONFIGURATION_BUILD_DIR}/YTKNetwork" "${PODS_CONFIGURATION_BUILD_DIR}/YYCache" "${PODS_CONFIGURATION_BUILD_DIR}/YYImage" "${PODS_CONFIGURATION_BUILD_DIR}/YYModel" "${PODS_CONFIGURATION_BUILD_DIR}/YYWebImage" "${PODS_CONFIGURATION_BUILD_DIR}/lottie-ios" "${PODS_ROOT}/YYImage/Vendor"
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/AFNetworking/AFNetworking.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/DKNightVersion/DKNightVersion.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/DOUAudioStreamer/DOUAudioStreamer.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/MBProgressHUD/MBProgressHUD.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/MJRefresh/MJRefresh.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/Masonry/Masonry.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/YTKNetwork/YTKNetwork.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/YYCache/YYCache.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/YYImage/YYImage.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/YYWebImage/YYWebImage.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/lottie-ios/Lottie.framework/Headers"
HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/AFNetworking/AFNetworking.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/DKNightVersion/DKNightVersion.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/DOUAudioStreamer/DOUAudioStreamer.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/MBProgressHUD/MBProgressHUD.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/MJRefresh/MJRefresh.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/Masonry/Masonry.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/YTKNetwork/YTKNetwork.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/YYCache/YYCache.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/YYImage/YYImage.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/YYModel/YYModel.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/YYWebImage/YYWebImage.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/lottie-ios/Lottie.framework/Headers"
LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks'
OTHER_LDFLAGS = $(inherited) -ObjC -l"sqlite3" -l"z" -framework "AFNetworking" -framework "AVFoundation" -framework "Accelerate" -framework "AssetsLibrary" -framework "AudioToolbox" -framework "CFNetwork" -framework "CoreAudio" -framework "CoreFoundation" -framework "CoreGraphics" -framework "DKNightVersion" -framework "DOUAudioStreamer" -framework "Foundation" -framework "ImageIO" -framework "Lottie" -framework "MBProgressHUD" -framework "MJRefresh" -framework "Masonry" -framework "MediaPlayer" -framework "MobileCoreServices" -framework "OpenGLES" -framework "QuartzCore" -framework "UIKit" -framework "YTKNetwork" -framework "YYCache" -framework "YYImage" -framework "YYWebImage"
OTHER_LDFLAGS = $(inherited) -ObjC -l"sqlite3" -l"z" -framework "AFNetworking" -framework "AVFoundation" -framework "Accelerate" -framework "AssetsLibrary" -framework "AudioToolbox" -framework "CFNetwork" -framework "CoreAudio" -framework "CoreFoundation" -framework "CoreGraphics" -framework "DKNightVersion" -framework "DOUAudioStreamer" -framework "Foundation" -framework "ImageIO" -framework "Lottie" -framework "MBProgressHUD" -framework "MJRefresh" -framework "Masonry" -framework "MediaPlayer" -framework "MobileCoreServices" -framework "OpenGLES" -framework "QuartzCore" -framework "UIKit" -framework "YTKNetwork" -framework "YYCache" -framework "YYImage" -framework "YYModel" -framework "YYWebImage"
PODS_BUILD_DIR = ${BUILD_DIR}
PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
PODS_PODFILE_DIR_PATH = ${SRCROOT}/.
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIdentifier</key>
<string>${PRODUCT_BUNDLE_IDENTIFIER}</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>${PRODUCT_NAME}</string>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>1.0.4</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>${CURRENT_PROJECT_VERSION}</string>
<key>NSPrincipalClass</key>
<string></string>
</dict>
</plist>
#import <Foundation/Foundation.h>
@interface PodsDummy_YYModel : NSObject
@end
@implementation PodsDummy_YYModel
@end
#ifdef __OBJC__
#import <UIKit/UIKit.h>
#else
#ifndef FOUNDATION_EXPORT
#if defined(__cplusplus)
#define FOUNDATION_EXPORT extern "C"
#else
#define FOUNDATION_EXPORT extern
#endif
#endif
#endif
#ifdef __OBJC__
#import <UIKit/UIKit.h>
#else
#ifndef FOUNDATION_EXPORT
#if defined(__cplusplus)
#define FOUNDATION_EXPORT extern "C"
#else
#define FOUNDATION_EXPORT extern
#endif
#endif
#endif
#import "NSObject+YYModel.h"
#import "YYClassInfo.h"
#import "YYModel.h"
FOUNDATION_EXPORT double YYModelVersionNumber;
FOUNDATION_EXPORT const unsigned char YYModelVersionString[];
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO
CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/YYModel
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
OTHER_LDFLAGS = $(inherited) -framework "CoreFoundation" -framework "Foundation"
PODS_BUILD_DIR = ${BUILD_DIR}
PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
PODS_ROOT = ${SRCROOT}
PODS_TARGET_SRCROOT = ${PODS_ROOT}/YYModel
PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates
PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier}
SKIP_INSTALL = YES
USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES
framework module YYModel {
umbrella header "YYModel-umbrella.h"
export *
module * { export * }
}
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO
CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/YYModel
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
OTHER_LDFLAGS = $(inherited) -framework "CoreFoundation" -framework "Foundation"
PODS_BUILD_DIR = ${BUILD_DIR}
PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
PODS_ROOT = ${SRCROOT}
PODS_TARGET_SRCROOT = ${PODS_ROOT}/YYModel
PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates
PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier}
SKIP_INSTALL = YES
USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES
The MIT License (MIT)
Copyright (c) 2015 ibireme <ibireme@gmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
//
// YYClassInfo.h
// YYModel <https://github.com/ibireme/YYModel>
//
// Created by ibireme on 15/5/9.
// Copyright (c) 2015 ibireme.
//
// This source code is licensed under the MIT-style license found in the
// LICENSE file in the root directory of this source tree.
//
#import <Foundation/Foundation.h>
#import <objc/runtime.h>
NS_ASSUME_NONNULL_BEGIN
/**
Type encoding's type.
*/
typedef NS_OPTIONS(NSUInteger, YYEncodingType) {
YYEncodingTypeMask = 0xFF, ///< mask of type value
YYEncodingTypeUnknown = 0, ///< unknown
YYEncodingTypeVoid = 1, ///< void
YYEncodingTypeBool = 2, ///< bool
YYEncodingTypeInt8 = 3, ///< char / BOOL
YYEncodingTypeUInt8 = 4, ///< unsigned char
YYEncodingTypeInt16 = 5, ///< short
YYEncodingTypeUInt16 = 6, ///< unsigned short
YYEncodingTypeInt32 = 7, ///< int
YYEncodingTypeUInt32 = 8, ///< unsigned int
YYEncodingTypeInt64 = 9, ///< long long
YYEncodingTypeUInt64 = 10, ///< unsigned long long
YYEncodingTypeFloat = 11, ///< float
YYEncodingTypeDouble = 12, ///< double
YYEncodingTypeLongDouble = 13, ///< long double
YYEncodingTypeObject = 14, ///< id
YYEncodingTypeClass = 15, ///< Class
YYEncodingTypeSEL = 16, ///< SEL
YYEncodingTypeBlock = 17, ///< block
YYEncodingTypePointer = 18, ///< void*
YYEncodingTypeStruct = 19, ///< struct
YYEncodingTypeUnion = 20, ///< union
YYEncodingTypeCString = 21, ///< char*
YYEncodingTypeCArray = 22, ///< char[10] (for example)
YYEncodingTypeQualifierMask = 0xFF00, ///< mask of qualifier
YYEncodingTypeQualifierConst = 1 << 8, ///< const
YYEncodingTypeQualifierIn = 1 << 9, ///< in
YYEncodingTypeQualifierInout = 1 << 10, ///< inout
YYEncodingTypeQualifierOut = 1 << 11, ///< out
YYEncodingTypeQualifierBycopy = 1 << 12, ///< bycopy
YYEncodingTypeQualifierByref = 1 << 13, ///< byref
YYEncodingTypeQualifierOneway = 1 << 14, ///< oneway
YYEncodingTypePropertyMask = 0xFF0000, ///< mask of property
YYEncodingTypePropertyReadonly = 1 << 16, ///< readonly
YYEncodingTypePropertyCopy = 1 << 17, ///< copy
YYEncodingTypePropertyRetain = 1 << 18, ///< retain
YYEncodingTypePropertyNonatomic = 1 << 19, ///< nonatomic
YYEncodingTypePropertyWeak = 1 << 20, ///< weak
YYEncodingTypePropertyCustomGetter = 1 << 21, ///< getter=
YYEncodingTypePropertyCustomSetter = 1 << 22, ///< setter=
YYEncodingTypePropertyDynamic = 1 << 23, ///< @dynamic
};
/**
Get the type from a Type-Encoding string.
@discussion See also:
https://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/ObjCRuntimeGuide/Articles/ocrtTypeEncodings.html
https://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/ObjCRuntimeGuide/Articles/ocrtPropertyIntrospection.html
@param typeEncoding A Type-Encoding string.
@return The encoding type.
*/
YYEncodingType YYEncodingGetType(const char *typeEncoding);
/**
Instance variable information.
*/
@interface YYClassIvarInfo : NSObject
@property (nonatomic, assign, readonly) Ivar ivar; ///< ivar opaque struct
@property (nonatomic, strong, readonly) NSString *name; ///< Ivar's name
@property (nonatomic, assign, readonly) ptrdiff_t offset; ///< Ivar's offset
@property (nonatomic, strong, readonly) NSString *typeEncoding; ///< Ivar's type encoding
@property (nonatomic, assign, readonly) YYEncodingType type; ///< Ivar's type
/**
Creates and returns an ivar info object.
@param ivar ivar opaque struct
@return A new object, or nil if an error occurs.
*/
- (instancetype)initWithIvar:(Ivar)ivar;
@end
/**
Method information.
*/
@interface YYClassMethodInfo : NSObject
@property (nonatomic, assign, readonly) Method method; ///< method opaque struct
@property (nonatomic, strong, readonly) NSString *name; ///< method name
@property (nonatomic, assign, readonly) SEL sel; ///< method's selector
@property (nonatomic, assign, readonly) IMP imp; ///< method's implementation
@property (nonatomic, strong, readonly) NSString *typeEncoding; ///< method's parameter and return types
@property (nonatomic, strong, readonly) NSString *returnTypeEncoding; ///< return value's type
@property (nullable, nonatomic, strong, readonly) NSArray<NSString *> *argumentTypeEncodings; ///< array of arguments' type
/**
Creates and returns a method info object.
@param method method opaque struct
@return A new object, or nil if an error occurs.
*/
- (instancetype)initWithMethod:(Method)method;
@end
/**
Property information.
*/
@interface YYClassPropertyInfo : NSObject
@property (nonatomic, assign, readonly) objc_property_t property; ///< property's opaque struct
@property (nonatomic, strong, readonly) NSString *name; ///< property's name
@property (nonatomic, assign, readonly) YYEncodingType type; ///< property's type
@property (nonatomic, strong, readonly) NSString *typeEncoding; ///< property's encoding value
@property (nonatomic, strong, readonly) NSString *ivarName; ///< property's ivar name
@property (nullable, nonatomic, assign, readonly) Class cls; ///< may be nil
@property (nullable, nonatomic, strong, readonly) NSArray<NSString *> *protocols; ///< may nil
@property (nonatomic, assign, readonly) SEL getter; ///< getter (nonnull)
@property (nonatomic, assign, readonly) SEL setter; ///< setter (nonnull)
/**
Creates and returns a property info object.
@param property property opaque struct
@return A new object, or nil if an error occurs.
*/
- (instancetype)initWithProperty:(objc_property_t)property;
@end
/**
Class information for a class.
*/
@interface YYClassInfo : NSObject
@property (nonatomic, assign, readonly) Class cls; ///< class object
@property (nullable, nonatomic, assign, readonly) Class superCls; ///< super class object
@property (nullable, nonatomic, assign, readonly) Class metaCls; ///< class's meta class object
@property (nonatomic, readonly) BOOL isMeta; ///< whether this class is meta class
@property (nonatomic, strong, readonly) NSString *name; ///< class name
@property (nullable, nonatomic, strong, readonly) YYClassInfo *superClassInfo; ///< super class's class info
@property (nullable, nonatomic, strong, readonly) NSDictionary<NSString *, YYClassIvarInfo *> *ivarInfos; ///< ivars
@property (nullable, nonatomic, strong, readonly) NSDictionary<NSString *, YYClassMethodInfo *> *methodInfos; ///< methods
@property (nullable, nonatomic, strong, readonly) NSDictionary<NSString *, YYClassPropertyInfo *> *propertyInfos; ///< properties
/**
If the class is changed (for example: you add a method to this class with
'class_addMethod()'), you should call this method to refresh the class info cache.
After called this method, `needUpdate` will returns `YES`, and you should call
'classInfoWithClass' or 'classInfoWithClassName' to get the updated class info.
*/
- (void)setNeedUpdate;
/**
If this method returns `YES`, you should stop using this instance and call
`classInfoWithClass` or `classInfoWithClassName` to get the updated class info.
@return Whether this class info need update.
*/
- (BOOL)needUpdate;
/**
Get the class info of a specified Class.
@discussion This method will cache the class info and super-class info
at the first access to the Class. This method is thread-safe.
@param cls A class.
@return A class info, or nil if an error occurs.
*/
+ (nullable instancetype)classInfoWithClass:(Class)cls;
/**
Get the class info of a specified Class.
@discussion This method will cache the class info and super-class info
at the first access to the Class. This method is thread-safe.
@param className A class name.
@return A class info, or nil if an error occurs.
*/
+ (nullable instancetype)classInfoWithClassName:(NSString *)className;
@end
NS_ASSUME_NONNULL_END
//
// YYModel.h
// YYModel <https://github.com/ibireme/YYModel>
//
// Created by ibireme on 15/5/10.
// Copyright (c) 2015 ibireme.
//
// This source code is licensed under the MIT-style license found in the
// LICENSE file in the root directory of this source tree.
//
#import <Foundation/Foundation.h>
#if __has_include(<YYModel/YYModel.h>)
FOUNDATION_EXPORT double YYModelVersionNumber;
FOUNDATION_EXPORT const unsigned char YYModelVersionString[];
#import <YYModel/NSObject+YYModel.h>
#import <YYModel/YYClassInfo.h>
#else
#import "NSObject+YYModel.h"
#import "YYClassInfo.h"
#endif
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!