Commit c9ab3f78 cgx

登录页面UI

1 个父辈 6c756bce
正在显示 48 个修改的文件 包含 592 行增加143 行删除
...@@ -34,6 +34,9 @@ ...@@ -34,6 +34,9 @@
D0506B1B2805500E00229278 /* SafeHelperCollectionViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = D0506B1A2805500E00229278 /* SafeHelperCollectionViewCell.m */; }; D0506B1B2805500E00229278 /* SafeHelperCollectionViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = D0506B1A2805500E00229278 /* SafeHelperCollectionViewCell.m */; };
D070509A28071BAF006D72E1 /* DSNetworkTool.m in Sources */ = {isa = PBXBuildFile; fileRef = D070509928071BAF006D72E1 /* DSNetworkTool.m */; }; D070509A28071BAF006D72E1 /* DSNetworkTool.m in Sources */ = {isa = PBXBuildFile; fileRef = D070509928071BAF006D72E1 /* DSNetworkTool.m */; };
D07F9DE927F4683B0036372F /* DKColorTable.txt in Resources */ = {isa = PBXBuildFile; fileRef = D07F9DE827F4683B0036372F /* DKColorTable.txt */; }; D07F9DE927F4683B0036372F /* DKColorTable.txt in Resources */ = {isa = PBXBuildFile; fileRef = D07F9DE827F4683B0036372F /* DKColorTable.txt */; };
D0878F48280BD18F005F1B7F /* LoginView.m in Sources */ = {isa = PBXBuildFile; fileRef = D0878F47280BD18F005F1B7F /* LoginView.m */; };
D0878F4C280BEFF9005F1B7F /* UILabel+YBAttributeTextTapAction.m in Sources */ = {isa = PBXBuildFile; fileRef = D0878F4B280BEFF9005F1B7F /* UILabel+YBAttributeTextTapAction.m */; };
D0878F4F280C087E005F1B7F /* LoginController.m in Sources */ = {isa = PBXBuildFile; fileRef = D0878F4E280C087E005F1B7F /* LoginController.m */; };
D091BBB72808F9DA00487A50 /* BreathTextView.m in Sources */ = {isa = PBXBuildFile; fileRef = D091BBB62808F9DA00487A50 /* BreathTextView.m */; }; D091BBB72808F9DA00487A50 /* BreathTextView.m in Sources */ = {isa = PBXBuildFile; fileRef = D091BBB62808F9DA00487A50 /* BreathTextView.m */; };
D091BBBB2809079600487A50 /* NSString+Extras.m in Sources */ = {isa = PBXBuildFile; fileRef = D091BBBA2809079600487A50 /* NSString+Extras.m */; }; D091BBBB2809079600487A50 /* NSString+Extras.m in Sources */ = {isa = PBXBuildFile; fileRef = D091BBBA2809079600487A50 /* NSString+Extras.m */; };
D0930F122801124E006B497A /* BaseNaviController.m in Sources */ = {isa = PBXBuildFile; fileRef = D0930F112801124E006B497A /* BaseNaviController.m */; }; D0930F122801124E006B497A /* BaseNaviController.m in Sources */ = {isa = PBXBuildFile; fileRef = D0930F112801124E006B497A /* BaseNaviController.m */; };
...@@ -129,6 +132,12 @@ ...@@ -129,6 +132,12 @@
D070509928071BAF006D72E1 /* DSNetworkTool.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DSNetworkTool.m; sourceTree = "<group>"; }; D070509928071BAF006D72E1 /* DSNetworkTool.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DSNetworkTool.m; sourceTree = "<group>"; };
D07F9D0627F45CB20036372F /* DKNightVersion.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = DKNightVersion.framework; sourceTree = BUILT_PRODUCTS_DIR; }; D07F9D0627F45CB20036372F /* DKNightVersion.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = DKNightVersion.framework; sourceTree = BUILT_PRODUCTS_DIR; };
D07F9DE827F4683B0036372F /* DKColorTable.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = DKColorTable.txt; sourceTree = "<group>"; }; D07F9DE827F4683B0036372F /* DKColorTable.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = DKColorTable.txt; sourceTree = "<group>"; };
D0878F46280BD18F005F1B7F /* LoginView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LoginView.h; sourceTree = "<group>"; };
D0878F47280BD18F005F1B7F /* LoginView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = LoginView.m; sourceTree = "<group>"; };
D0878F4A280BEFF9005F1B7F /* UILabel+YBAttributeTextTapAction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UILabel+YBAttributeTextTapAction.h"; sourceTree = "<group>"; };
D0878F4B280BEFF9005F1B7F /* UILabel+YBAttributeTextTapAction.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UILabel+YBAttributeTextTapAction.m"; sourceTree = "<group>"; };
D0878F4D280C087E005F1B7F /* LoginController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LoginController.h; sourceTree = "<group>"; };
D0878F4E280C087E005F1B7F /* LoginController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = LoginController.m; sourceTree = "<group>"; };
D091BBB52808F9DA00487A50 /* BreathTextView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = BreathTextView.h; sourceTree = "<group>"; }; D091BBB52808F9DA00487A50 /* BreathTextView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = BreathTextView.h; sourceTree = "<group>"; };
D091BBB62808F9DA00487A50 /* BreathTextView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = BreathTextView.m; sourceTree = "<group>"; }; D091BBB62808F9DA00487A50 /* BreathTextView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = BreathTextView.m; sourceTree = "<group>"; };
D091BBB82809024100487A50 /* DreamSleepBeta.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = DreamSleepBeta.entitlements; sourceTree = "<group>"; }; D091BBB82809024100487A50 /* DreamSleepBeta.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = DreamSleepBeta.entitlements; sourceTree = "<group>"; };
...@@ -358,6 +367,7 @@ ...@@ -358,6 +367,7 @@
D04567AD27F6D0F4009F0A82 /* Profile */ = { D04567AD27F6D0F4009F0A82 /* Profile */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
D0CE3D80280A532D00D8B02D /* UserLogin */,
D04B3DBC27F6F8090022F8DF /* Profile.storyboard */, D04B3DBC27F6F8090022F8DF /* Profile.storyboard */,
D04B3DBE27F6F82D0022F8DF /* ProfileController.h */, D04B3DBE27F6F82D0022F8DF /* ProfileController.h */,
D04B3DBF27F6F82D0022F8DF /* ProfileController.m */, D04B3DBF27F6F82D0022F8DF /* ProfileController.m */,
...@@ -369,6 +379,15 @@ ...@@ -369,6 +379,15 @@
path = Profile; path = Profile;
sourceTree = "<group>"; sourceTree = "<group>";
}; };
D0878F49280BEFF9005F1B7F /* YBAttributeTextTapAction */ = {
isa = PBXGroup;
children = (
D0878F4A280BEFF9005F1B7F /* UILabel+YBAttributeTextTapAction.h */,
D0878F4B280BEFF9005F1B7F /* UILabel+YBAttributeTextTapAction.m */,
);
path = YBAttributeTextTapAction;
sourceTree = "<group>";
};
D0930F142801874B006B497A /* DSNavigationTools */ = { D0930F142801874B006B497A /* DSNavigationTools */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
...@@ -458,6 +477,17 @@ ...@@ -458,6 +477,17 @@
path = PrivacyPolicy; path = PrivacyPolicy;
sourceTree = "<group>"; sourceTree = "<group>";
}; };
D0CE3D80280A532D00D8B02D /* UserLogin */ = {
isa = PBXGroup;
children = (
D0878F46280BD18F005F1B7F /* LoginView.h */,
D0878F47280BD18F005F1B7F /* LoginView.m */,
D0878F4D280C087E005F1B7F /* LoginController.h */,
D0878F4E280C087E005F1B7F /* LoginController.m */,
);
path = UserLogin;
sourceTree = "<group>";
};
D0E65FF32807A654006562F2 /* HYBUnicodeReadable */ = { D0E65FF32807A654006562F2 /* HYBUnicodeReadable */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
...@@ -477,6 +507,7 @@ ...@@ -477,6 +507,7 @@
D01814D927FFD91100583D4E /* DataSource */, D01814D927FFD91100583D4E /* DataSource */,
D01814CA27FFCBAF00583D4E /* CWCarousel */, D01814CA27FFCBAF00583D4E /* CWCarousel */,
D0E65FF32807A654006562F2 /* HYBUnicodeReadable */, D0E65FF32807A654006562F2 /* HYBUnicodeReadable */,
D0878F49280BEFF9005F1B7F /* YBAttributeTextTapAction */,
D0E9408227FE96A900D57495 /* WechatOpenSDK_1.9.2_NoPay */, D0E9408227FE96A900D57495 /* WechatOpenSDK_1.9.2_NoPay */,
); );
path = Vendors; path = Vendors;
...@@ -726,10 +757,12 @@ ...@@ -726,10 +757,12 @@
D0C09EE028007E5F00709D4C /* BreatheController.m in Sources */, D0C09EE028007E5F00709D4C /* BreatheController.m in Sources */,
D0C50B4627FD66FB00DC68F0 /* DSConstUtil.m in Sources */, D0C50B4627FD66FB00DC68F0 /* DSConstUtil.m in Sources */,
D01814D227FFCBAF00583D4E /* CWFlowLayout.m in Sources */, D01814D227FFCBAF00583D4E /* CWFlowLayout.m in Sources */,
D0878F48280BD18F005F1B7F /* LoginView.m in Sources */,
D0E660052807D02C006562F2 /* UserRequestModel.m in Sources */, D0E660052807D02C006562F2 /* UserRequestModel.m in Sources */,
D0930F1B2801874B006B497A /* UINavigationController+Pop.m in Sources */, D0930F1B2801874B006B497A /* UINavigationController+Pop.m in Sources */,
D0506B1528051ED400229278 /* SafeSleepModel.m in Sources */, D0506B1528051ED400229278 /* SafeSleepModel.m in Sources */,
D01814D527FFCCFA00583D4E /* HomeTableView.m in Sources */, D01814D527FFCCFA00583D4E /* HomeTableView.m in Sources */,
D0878F4C280BEFF9005F1B7F /* UILabel+YBAttributeTextTapAction.m in Sources */,
D0F80907280431100097899F /* UILabel+Extras.m in Sources */, D0F80907280431100097899F /* UILabel+Extras.m in Sources */,
D04B3DAC27F6EEB50022F8DF /* DSTabBarController.m in Sources */, D04B3DAC27F6EEB50022F8DF /* DSTabBarController.m in Sources */,
D0C50B4F27FD832300DC68F0 /* LeadView.m in Sources */, D0C50B4F27FD832300DC68F0 /* LeadView.m in Sources */,
...@@ -746,6 +779,7 @@ ...@@ -746,6 +779,7 @@
D0E65FFC2807A654006562F2 /* NSSet+HYBUnicodeReadable.m in Sources */, D0E65FFC2807A654006562F2 /* NSSet+HYBUnicodeReadable.m in Sources */,
D0C50B3C27FD2EFD00DC68F0 /* PrivacyViewController.m in Sources */, D0C50B3C27FD2EFD00DC68F0 /* PrivacyViewController.m in Sources */,
D0930F122801124E006B497A /* BaseNaviController.m in Sources */, D0930F122801124E006B497A /* BaseNaviController.m in Sources */,
D0878F4F280C087E005F1B7F /* LoginController.m in Sources */,
D0930F1A2801874B006B497A /* UIViewController+Swizzling.m in Sources */, D0930F1A2801874B006B497A /* UIViewController+Swizzling.m in Sources */,
D0F808FE280421C20097899F /* ThreeMinuteController.m in Sources */, D0F808FE280421C20097899F /* ThreeMinuteController.m in Sources */,
D01814E8280020F900583D4E /* CWPageControl.m in Sources */, D01814E8280020F900583D4E /* CWPageControl.m in Sources */,
...@@ -923,7 +957,7 @@ ...@@ -923,7 +957,7 @@
"$(inherited)", "$(inherited)",
"$(PROJECT_DIR)/DreamSleep/Vendors/WechatOpenSDK_1.9.2_NoPay", "$(PROJECT_DIR)/DreamSleep/Vendors/WechatOpenSDK_1.9.2_NoPay",
); );
MARKETING_VERSION = 1.0; MARKETING_VERSION = 1.1.0;
OTHER_LDFLAGS = ( OTHER_LDFLAGS = (
"$(inherited)", "$(inherited)",
"-Objc", "-Objc",
...@@ -957,7 +991,7 @@ ...@@ -957,7 +991,7 @@
GENERATE_INFOPLIST_FILE = YES; GENERATE_INFOPLIST_FILE = YES;
HEADER_SEARCH_PATHS = "$(inherited)/**"; HEADER_SEARCH_PATHS = "$(inherited)/**";
INFOPLIST_FILE = DreamSleep/DSConfig/Info.plist; INFOPLIST_FILE = DreamSleep/DSConfig/Info.plist;
INFOPLIST_KEY_CFBundleDisplayName = "小梦睡眠-Dev"; INFOPLIST_KEY_CFBundleDisplayName = "小梦睡眠";
INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES;
INFOPLIST_KEY_UILaunchStoryboardName = LaunchScreen; INFOPLIST_KEY_UILaunchStoryboardName = LaunchScreen;
INFOPLIST_KEY_UIStatusBarHidden = YES; INFOPLIST_KEY_UIStatusBarHidden = YES;
...@@ -972,7 +1006,7 @@ ...@@ -972,7 +1006,7 @@
"$(inherited)", "$(inherited)",
"$(PROJECT_DIR)/DreamSleep/Vendors/WechatOpenSDK_1.9.2_NoPay", "$(PROJECT_DIR)/DreamSleep/Vendors/WechatOpenSDK_1.9.2_NoPay",
); );
MARKETING_VERSION = 1.0; MARKETING_VERSION = 1.1.0;
OTHER_LDFLAGS = ( OTHER_LDFLAGS = (
"$(inherited)", "$(inherited)",
"-Objc", "-Objc",
...@@ -1064,7 +1098,7 @@ ...@@ -1064,7 +1098,7 @@
GENERATE_INFOPLIST_FILE = YES; GENERATE_INFOPLIST_FILE = YES;
HEADER_SEARCH_PATHS = "$(inherited)/**"; HEADER_SEARCH_PATHS = "$(inherited)/**";
INFOPLIST_FILE = DreamSleep/DSConfig/Info.plist; INFOPLIST_FILE = DreamSleep/DSConfig/Info.plist;
INFOPLIST_KEY_CFBundleDisplayName = "小梦睡眠-Dev"; INFOPLIST_KEY_CFBundleDisplayName = "小梦睡眠-Beta";
INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES;
INFOPLIST_KEY_UILaunchStoryboardName = LaunchScreen; INFOPLIST_KEY_UILaunchStoryboardName = LaunchScreen;
INFOPLIST_KEY_UIStatusBarHidden = YES; INFOPLIST_KEY_UIStatusBarHidden = YES;
...@@ -1079,7 +1113,7 @@ ...@@ -1079,7 +1113,7 @@
"$(inherited)", "$(inherited)",
"$(PROJECT_DIR)/DreamSleep/Vendors/WechatOpenSDK_1.9.2_NoPay", "$(PROJECT_DIR)/DreamSleep/Vendors/WechatOpenSDK_1.9.2_NoPay",
); );
MARKETING_VERSION = 1.0; MARKETING_VERSION = 1.1.0;
OTHER_LDFLAGS = ( OTHER_LDFLAGS = (
"$(inherited)", "$(inherited)",
"-Objc", "-Objc",
......
...@@ -32,6 +32,10 @@ NS_ASSUME_NONNULL_BEGIN ...@@ -32,6 +32,10 @@ NS_ASSUME_NONNULL_BEGIN
* @param sizeToFit 是否按尺寸调整 * @param sizeToFit 是否按尺寸调整
*/ */
- (void)adjustLayoutWithType:(UIButtonLayoutType)type midSpace:(CGFloat)midSpace sizeToFit:(BOOL)sizeToFit; - (void)adjustLayoutWithType:(UIButtonLayoutType)type midSpace:(CGFloat)midSpace sizeToFit:(BOOL)sizeToFit;
+ (instancetype)btnWithTitle:(NSString *)title titleColor:(UIColor *)titleColor font:(UIFont *)font bgColor:(UIColor *)bgColor;
+ (instancetype)btnWithTitle:(NSString *)title font:(UIFont *)font;
@end @end
NS_ASSUME_NONNULL_END NS_ASSUME_NONNULL_END
...@@ -55,4 +55,20 @@ ...@@ -55,4 +55,20 @@
[self setImageEdgeInsets:imageEdgeInset]; [self setImageEdgeInsets:imageEdgeInset];
} }
+ (instancetype)btnWithTitle:(NSString *)title titleColor:(UIColor *)titleColor font:(UIFont *)font bgColor:(UIColor *)bgColor {
UIButton *btn = [UIButton new];
[btn setTitle:title forState:UIControlStateNormal];
[btn setTitleColor:titleColor forState:UIControlStateNormal];
[btn.titleLabel setFont:font];
[btn setBackgroundColor:bgColor];
return btn;
}
+ (instancetype)btnWithTitle:(NSString *)title font:(UIFont *)font {
UIButton *btn = [UIButton new];
[btn setTitle:title forState:UIControlStateNormal];
[btn.titleLabel setFont:font];
return btn;
}
@end @end
...@@ -23,5 +23,7 @@ NS_ASSUME_NONNULL_BEGIN ...@@ -23,5 +23,7 @@ NS_ASSUME_NONNULL_BEGIN
- (UIViewController *)ds_viewController; - (UIViewController *)ds_viewController;
- (void)debugViewShowBorder; - (void)debugViewShowBorder;
- (void)cornerRadius:(CGFloat)radius;
@end @end
NS_ASSUME_NONNULL_END NS_ASSUME_NONNULL_END
...@@ -68,4 +68,9 @@ ...@@ -68,4 +68,9 @@
self.layer.borderWidth = 2; self.layer.borderWidth = 2;
} }
- (void)cornerRadius:(CGFloat)radius {
self.layer.cornerRadius = radius;
self.layer.masksToBounds = YES;
}
@end @end
...@@ -9,7 +9,6 @@ ...@@ -9,7 +9,6 @@
#import "HeaderDataModel.h" #import "HeaderDataModel.h"
#import "ThreeMinuteController.h" #import "ThreeMinuteController.h"
#import "BreatheController.h" #import "BreatheController.h"
#import "WXApi.h"
@interface DsMiddleView () @interface DsMiddleView ()
@property (nonatomic, strong) UIButton *unityBtn; @property (nonatomic, strong) UIButton *unityBtn;
...@@ -78,16 +77,6 @@ ...@@ -78,16 +77,6 @@
breatheVC.title = sender.tag == 1 ? @"均衡呼吸法" : @"舒睡4-7-8呼吸法"; breatheVC.title = sender.tag == 1 ? @"均衡呼吸法" : @"舒睡4-7-8呼吸法";
[self.ds_viewController.navigationController pushViewController:breatheVC animated:YES]; [self.ds_viewController.navigationController pushViewController:breatheVC animated:YES];
} }
#pragma mark - 模拟微信登录
// // 构造SendAuthReq结构体
// SendAuthReq* req = [[SendAuthReq alloc] init];
// req.scope = @"snsapi_userinfo";
// req.state = @"123";
// // 第三方向微信终端发送一个SendAuthReq消息结构
// [WXApi sendReq:req completion:^(BOOL success) {
// DSLog(@"调起微信成功...");
// }];
} }
@end @end
...@@ -110,7 +110,7 @@ ...@@ -110,7 +110,7 @@
- (UIButton *)timerBtn { - (UIButton *)timerBtn {
if (!_timerBtn) { if (!_timerBtn) {
_timerBtn = [UIButton new]; _timerBtn = [UIButton new];
[_timerBtn dk_setImage:DKImagePickerWithNames(@"timerIcon", @"timerIcon_dk") forState:UIControlStateNormal]; [_timerBtn dk_setImage:DKImagePickerWithNames(@"timerIcon", @"timerIcon_dk", @"timerIcon_dk") forState:UIControlStateNormal];
[_timerBtn addTarget:self action:@selector(timerSetting:) forControlEvents:UIControlEventTouchUpInside]; [_timerBtn addTarget:self action:@selector(timerSetting:) forControlEvents:UIControlEventTouchUpInside];
} }
return _timerBtn; return _timerBtn;
......
...@@ -42,7 +42,7 @@ ...@@ -42,7 +42,7 @@
// 切换到主tabvc // 切换到主tabvc
UIStoryboard * mainStoryBoard =[UIStoryboard storyboardWithName:@"Main" bundle:nil]; UIStoryboard * mainStoryBoard =[UIStoryboard storyboardWithName:@"Main" bundle:nil];
[UIView transitionWithView:DSKeyWindow [UIView transitionWithView:DSKeyWindow
duration:0.3 duration:0.5
options:UIViewAnimationOptionTransitionFlipFromLeft options:UIViewAnimationOptionTransitionFlipFromLeft
animations:^{ animations:^{
DSKeyWindow.rootViewController = [mainStoryBoard instantiateViewControllerWithIdentifier:@"mainSB"]; DSKeyWindow.rootViewController = [mainStoryBoard instantiateViewControllerWithIdentifier:@"mainSB"];
......
...@@ -38,12 +38,12 @@ ...@@ -38,12 +38,12 @@
titleColor = ColorFromHex(0x333333); titleColor = ColorFromHex(0x333333);
bgColor = DSWhite; bgColor = DSWhite;
barTintColor = DSWhite; barTintColor = DSWhite;
// naviBar.barStyle = UIBarStyleDefault; // naviBar.barStyle = UIBarStyleDefault;
} else if (style == NaviStyleDark) { } else if (style == NaviStyleDark) {
titleColor = DSWhite; titleColor = DSWhite;
bgColor = DarkColor; bgColor = DarkColor;
barTintColor = DarkColor; barTintColor = DarkColor;
// naviBar.barStyle = UIBarStyleBlack; // naviBar.barStyle = UIBarStyleBlack;
} }
// 设置导航栏title颜色、导航栏背景色、隐藏分割线 // 设置导航栏title颜色、导航栏背景色、隐藏分割线
...@@ -95,7 +95,11 @@ ...@@ -95,7 +95,11 @@
UIViewController* topVC = self.topViewController; UIViewController* topVC = self.topViewController;
if ([topVC respondsToSelector:@selector(navigationBarStyle)]) { if ([topVC respondsToSelector:@selector(navigationBarStyle)]) {
NaviStyle sty = (NaviStyle)[topVC performSelector:@selector(navigationBarStyle)]; NaviStyle sty = (NaviStyle)[topVC performSelector:@selector(navigationBarStyle)];
if (sty == NaviStyleDefault) { barStyle = UIStatusBarStyleLightContent; } if (sty == NaviStyleDefault) {
barStyle = UIStatusBarStyleLightContent;
} else if (sty == NaviStyleDark) {
barStyle = UIStatusBarStyleLightContent;
}
} }
return barStyle; return barStyle;
} }
......
...@@ -7,9 +7,9 @@ ...@@ -7,9 +7,9 @@
#import "ProfileController.h" #import "ProfileController.h"
#import "SystemSetController.h" #import "SystemSetController.h"
#import <AuthenticationServices/AuthenticationServices.h> #import "LoginController.h"
@interface ProfileController () <ASAuthorizationControllerDelegate, ASAuthorizationControllerPresentationContextProviding> @interface ProfileController ()
@property (nonatomic, strong) NSArray *tmpDatas; @property (nonatomic, strong) NSArray *tmpDatas;
@end @end
...@@ -20,12 +20,17 @@ ...@@ -20,12 +20,17 @@
self.navigationItem.title = @"我的"; self.navigationItem.title = @"我的";
self.tableView.dk_backgroundColorPicker = DKColorPickerWithKey(VCViewBG); self.tableView.dk_backgroundColorPicker = DKColorPickerWithKey(VCViewBG);
self.tmpDatas = @[@"注册登录信息", @"意见反馈", @"系统设置", @"邀请好友", @"关于我们", @"前往小程序", @"关注公众号", @"添加客服微信", @"失眠的认知行为疗法", @"模拟Apple登录"]; self.tmpDatas = @[@"注册登录信息", @"意见反馈", @"系统设置", @"邀请好友", @"关于我们", @"前往小程序", @"关注公众号", @"添加客服微信", @"失眠的认知行为疗法"];
} }
#pragma mark - 导航栏默认模式 #pragma mark - 导航栏默认模式
//- (NaviStyle)navigationBarStyle {
// return NaviStyleDefault;
//}
#pragma mark - 导航栏日间、黑夜模式
- (NaviStyle)navigationBarStyle { - (NaviStyle)navigationBarStyle {
return NaviStyleDefault; return [self.dk_manager.themeVersion isEqualToString:DKThemeVersionNormal] ? NaviStyleLight : NaviStyleDark;
} }
#pragma mark - Table view data source #pragma mark - Table view data source
...@@ -46,15 +51,16 @@ ...@@ -46,15 +51,16 @@
[tableView deselectRowAtIndexPath:indexPath animated:YES]; [tableView deselectRowAtIndexPath:indexPath animated:YES];
switch (indexPath.row) { switch (indexPath.row) {
case 2: // 系统设置入口 case 0: // 跳转到登录页面
{ {
SystemSetController *sysVC = [SystemSetController new]; BaseNaviController *navi = [[BaseNaviController alloc] initWithRootViewController:[[LoginController alloc] init]];
[self.navigationController pushViewController:sysVC animated:YES]; [self presentViewController:navi animated:YES completion:nil];
} }
break; break;
case 9: // 模拟苹果登录 case 2: // 系统设置入口
{ {
[self handleAuthrization]; SystemSetController *sysVC = [SystemSetController new];
[self.navigationController pushViewController:sysVC animated:YES];
} }
break; break;
default: default:
...@@ -62,116 +68,4 @@ ...@@ -62,116 +68,4 @@
} }
} }
#pragma mark - 点击苹果登录授权按钮
- (void)handleAuthrization {
if (@available(iOS 13.0, *)) {
// 基于用户的Apple ID授权用户,生成用户授权请求的一种机制
ASAuthorizationAppleIDProvider *appleIDProvider = [ASAuthorizationAppleIDProvider new];
// 创建新的AppleID 授权请求
ASAuthorizationAppleIDRequest *request = appleIDProvider.createRequest;
// 在用户授权期间请求的联系信息
request.requestedScopes = @[ASAuthorizationScopeFullName, ASAuthorizationScopeEmail];
// 由ASAuthorizationAppleIDProvider创建的授权请求 管理授权请求的控制器
ASAuthorizationController *controller = [[ASAuthorizationController alloc] initWithAuthorizationRequests:@[request]];
// 设置授权控制器通知授权请求的成功与失败的代理
controller.delegate = self;
// 设置提供 展示上下文的代理,在这个上下文中 系统可以展示授权界面给用户
controller.presentationContextProvider = self;
// 在控制器初始化期间启动授权流
[controller performRequests];
}
}
#pragma mark - ASAuthorizationControllerDelegate
#pragma mark - 授权成功地回调
- (void)authorizationController:(ASAuthorizationController *)controller didCompleteWithAuthorization:(ASAuthorization *)authorization API_AVAILABLE(ios(13.0)) {
NSLog(@"%s", __FUNCTION__);
NSLog(@"%@", controller);
NSLog(@"%@", authorization);
NSLog(@"authorization.credential:%@", authorization.credential);
if ([authorization.credential isKindOfClass:[ASAuthorizationAppleIDCredential class]]) {
ASAuthorizationAppleIDCredential *credential = authorization.credential;
NSLog(@"credential = %@", credential);
NSString *state = credential.state;
NSString *userID = credential.user;
NSPersonNameComponents *fullName = credential.fullName;
NSString *email = credential.email;
NSString *authorizationCode = [[NSString alloc] initWithData:credential.authorizationCode encoding:NSUTF8StringEncoding]; // 验证 token
NSString *identityToken = [[NSString alloc] initWithData:credential.identityToken encoding:NSUTF8StringEncoding]; // 用户 token
ASUserDetectionStatus realUserStatus = credential.realUserStatus;
NSArray *authorizedScopes = credential.authorizedScopes;
NSLog(@"ios登陆成功 state: %@\nuserID: %@\nfullName: %@\nemail: %@\nauthorizationCode: %@\nidentityToken: %@\nrealUserStatus: %@\nauthorizedScopes: %@",
state,
userID,
fullName,
email,
authorizationCode,
identityToken,
@(realUserStatus),
authorizedScopes);
// // 用户登录使用ASAuthorizationAppleIDCredential
// ASAuthorizationAppleIDCredential *appleIDCredential = authorization.credential;
// // 用户ID: user,苹果用户唯一标识,该值在同一个开发者账号下的所有 App 下是一样的。
// NSString *user = appleIDCredential.user;
// // 使用钥匙串的方式保存用户的唯一信息
// NSString *bundleId = [NSBundle mainBundle].bundleIdentifier;
//
// // 验证数据: identityToken , authorizationCode ,用于服务端验证授权请求的合法性。
// NSString *authorizationCode = [[NSString alloc] initWithData:appleIDCredential.authorizationCode encoding:NSUTF8StringEncoding];
// NSString *identityToken = [[NSString alloc] initWithData:appleIDCredential.identityToken encoding:NSUTF8StringEncoding];
//
// NSLog(@"user:%@, bundleId:%@, authorizationCode:%@, identityToken:%@", user, bundleId, authorizationCode, identityToken);
// 通过钥匙串保存用户授权信息
// [SAMKeychain setPassword:user forService:bundleId account:ShareCurrentIdentifier];
} else if ([authorization.credential isKindOfClass:[ASPasswordCredential class]]) {
// 用户登录使用现有的密码凭证
ASPasswordCredential *passwordCredential = authorization.credential;
// 密码凭证对象的用户标识 用户的唯一标识
NSString *user = passwordCredential.user;
// 密码凭证对象的密码
NSString *password = passwordCredential.password;
NSLog(@"user:%@, password:%@", user, password);
} else {
NSLog(@"授权信息均不符");
}
}
#pragma mark - 授权失败的回调
- (void)authorizationController:(ASAuthorizationController *)controller didCompleteWithError:(NSError *)error API_AVAILABLE(ios(13.0)) {
NSLog(@"%s", __FUNCTION__);
NSLog(@"错误信息:%@", error);
NSString *errorMsg = nil;
switch (error.code) {
case ASAuthorizationErrorCanceled:
errorMsg = @"用户取消了授权请求";
break;
case ASAuthorizationErrorFailed:
errorMsg = @"授权请求失败";
break;
case ASAuthorizationErrorInvalidResponse:
errorMsg = @"授权请求响应无效";
break;
case ASAuthorizationErrorNotHandled:
errorMsg = @"未能处理授权请求";
break;
case ASAuthorizationErrorUnknown:
errorMsg = @"授权请求失败未知原因";
break;
}
NSLog(@"controller requests:%@, errorMsg:%@", controller.authorizationRequests, errorMsg);
}
#pragma mark - ASAuthorizationControllerPresentationContextProviding
#pragma mark - 告诉代理应该在哪个window 展示内容给用户
- (ASPresentationAnchor)presentationAnchorForAuthorizationController:(ASAuthorizationController *)controller API_AVAILABLE(ios(13.0)){
NSLog(@"调用展示window方法:%s", __FUNCTION__);
// 返回window
return self.view.window;
}
@end @end
...@@ -22,16 +22,24 @@ ...@@ -22,16 +22,24 @@
UIButton *btn = [[UIButton alloc] initWithFrame:CGRectMake(20, 100, 100, 40)]; UIButton *btn = [[UIButton alloc] initWithFrame:CGRectMake(20, 100, 100, 40)];
[btn setTitle:@"用户协议" forState:UIControlStateNormal]; [btn setTitle:@"用户协议" forState:UIControlStateNormal];
[btn debugViewShowBorder];
[btn setTitleColor:DSRed forState:UIControlStateNormal]; [btn setTitleColor:DSRed forState:UIControlStateNormal];
[btn addTarget:self action:@selector(privicyAction) forControlEvents:UIControlEventTouchUpInside]; [btn addTarget:self action:@selector(privicyAction) forControlEvents:UIControlEventTouchUpInside];
[self.view addSubview:btn]; [self.view addSubview:btn];
UIButton *darkBtn = [[UIButton alloc] initWithFrame:CGRectMake(20, 200, 100, 40)];
[darkBtn setTitle:@"黑夜模式" forState:UIControlStateNormal];
[darkBtn debugViewShowBorder];
[darkBtn setTitleColor:DSRed forState:UIControlStateNormal];
[darkBtn addTarget:self action:@selector(darkBtnAction) forControlEvents:UIControlEventTouchUpInside];
[self.view addSubview:darkBtn];
} }
- (void)privicyAction { - (void)privicyAction {
[self.navigationController pushViewController:[[PrivacyViewController alloc] initWithTitle:@"用户协议" link:[NSURL URLWithString:UserServiceAgreement] isDetail:YES] animated:YES]; [self.navigationController pushViewController:[[PrivacyViewController alloc] initWithTitle:@"用户协议" link:[NSURL URLWithString:UserServiceAgreement] isDetail:YES] animated:YES];
} }
- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event { - (void)darkBtnAction {
// 模拟切换黑夜模式 // 模拟切换黑夜模式
if ([self.dk_manager.themeVersion isEqualToString:DKThemeVersionNight]) { if ([self.dk_manager.themeVersion isEqualToString:DKThemeVersionNight]) {
self.dk_manager.themeVersion = DKThemeVersionNormal; self.dk_manager.themeVersion = DKThemeVersionNormal;
......
//
// LoginController.h
// DreamSleep
//
// Created by peter on 2022/4/17.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface LoginController : UIViewController
@end
NS_ASSUME_NONNULL_END
//
// LoginController.m
// DreamSleep
//
// Created by peter on 2022/4/17.
//
#import "LoginController.h"
#import "LoginView.h"
#import "PrivacyViewController.h"
#import <AuthenticationServices/AuthenticationServices.h>
@interface LoginController () <LoginViewDelegate, ASAuthorizationControllerDelegate, ASAuthorizationControllerPresentationContextProviding>
@property (strong, nonatomic) LoginView *loginView;
@end
@implementation LoginController
- (void)loadView {
self.view = self.loginView;
}
- (void)viewDidLoad {
[super viewDidLoad];
}
- (void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
self.navigationController.navigationBarHidden = YES;
}
#pragma mark - 设置状态栏文字颜色
- (UIStatusBarStyle)preferredStatusBarStyle {
return [self.dk_manager.themeVersion isEqualToString:DKThemeVersionNormal] ? UIStatusBarStyleDefault : UIStatusBarStyleLightContent;
}
#pragma mark - LoginViewDelegate
- (void)sendClickAction:(NSInteger)tag {
switch (tag) {
case 1: // 微信登录
{
// 构造SendAuthReq结构体
SendAuthReq* req = [[SendAuthReq alloc] init];
req.scope = @"snsapi_userinfo";
req.state = @"123";
// 第三方向微信终端发送一个SendAuthReq消息结构
[WXApi sendReq:req completion:^(BOOL success) {
DSLog(@"调起微信成功...");
}];
}
break;
case 2: // Apple登录
{
if (@available(iOS 13.0, *)) {
// 基于用户的Apple ID授权用户,生成用户授权请求的一种机制
ASAuthorizationAppleIDProvider *appleIDProvider = [ASAuthorizationAppleIDProvider new];
// 创建新的AppleID 授权请求
ASAuthorizationAppleIDRequest *request = appleIDProvider.createRequest;
// 在用户授权期间请求的联系信息
request.requestedScopes = @[ASAuthorizationScopeFullName, ASAuthorizationScopeEmail];
// 由ASAuthorizationAppleIDProvider创建的授权请求 管理授权请求的控制器
ASAuthorizationController *controller = [[ASAuthorizationController alloc] initWithAuthorizationRequests:@[request]];
// 设置授权控制器通知授权请求的成功与失败的代理
controller.delegate = self;
// 设置提供 展示上下文的代理,在这个上下文中 系统可以展示授权界面给用户
controller.presentationContextProvider = self;
// 在控制器初始化期间启动授权流
[controller performRequests];
}
}
break;
case 3: // 随便看看
{
[self dismissViewControllerAnimated:YES completion:nil];
}
break;
case 4: // 许可协议
{
[self.navigationController pushViewController:[[PrivacyViewController alloc] initWithTitle:@"用户服务协议" link:[NSURL URLWithString:UserServiceAgreement] isDetail:YES] animated:YES];
}
break;
case 5: // 隐私保护指引
{
[self.navigationController pushViewController:[[PrivacyViewController alloc] initWithTitle:@"隐私政策" link:[NSURL URLWithString:PrivacyPolicy] isDetail:YES] animated:YES];
}
break;
default:
break;
}
}
#pragma mark - ASAuthorizationControllerDelegate
#pragma mark - 授权成功地回调
- (void)authorizationController:(ASAuthorizationController *)controller didCompleteWithAuthorization:(ASAuthorization *)authorization API_AVAILABLE(ios(13.0)) {
NSLog(@"%s", __FUNCTION__);
NSLog(@"%@", controller);
NSLog(@"%@", authorization);
NSLog(@"authorization.credential:%@", authorization.credential);
if ([authorization.credential isKindOfClass:[ASAuthorizationAppleIDCredential class]]) {
ASAuthorizationAppleIDCredential *credential = authorization.credential;
NSLog(@"credential = %@", credential);
NSString *state = credential.state;
NSString *userID = credential.user;
NSPersonNameComponents *fullName = credential.fullName;
NSString *email = credential.email;
NSString *authorizationCode = [[NSString alloc] initWithData:credential.authorizationCode encoding:NSUTF8StringEncoding]; // 验证 token
NSString *identityToken = [[NSString alloc] initWithData:credential.identityToken encoding:NSUTF8StringEncoding]; // 用户 token
ASUserDetectionStatus realUserStatus = credential.realUserStatus;
NSArray *authorizedScopes = credential.authorizedScopes;
NSLog(@"ios登陆成功 state: %@\nuserID: %@\nfullName: %@\nemail: %@\nauthorizationCode: %@\nidentityToken: %@\nrealUserStatus: %@\nauthorizedScopes: %@",
state,
userID,
fullName,
email,
authorizationCode,
identityToken,
@(realUserStatus),
authorizedScopes);
// // 用户登录使用ASAuthorizationAppleIDCredential
// ASAuthorizationAppleIDCredential *appleIDCredential = authorization.credential;
// // 用户ID: user,苹果用户唯一标识,该值在同一个开发者账号下的所有 App 下是一样的。
// NSString *user = appleIDCredential.user;
// // 使用钥匙串的方式保存用户的唯一信息
// NSString *bundleId = [NSBundle mainBundle].bundleIdentifier;
//
// // 验证数据: identityToken , authorizationCode ,用于服务端验证授权请求的合法性。
// NSString *authorizationCode = [[NSString alloc] initWithData:appleIDCredential.authorizationCode encoding:NSUTF8StringEncoding];
// NSString *identityToken = [[NSString alloc] initWithData:appleIDCredential.identityToken encoding:NSUTF8StringEncoding];
//
// NSLog(@"user:%@, bundleId:%@, authorizationCode:%@, identityToken:%@", user, bundleId, authorizationCode, identityToken);
// 通过钥匙串保存用户授权信息
// [SAMKeychain setPassword:user forService:bundleId account:ShareCurrentIdentifier];
} else if ([authorization.credential isKindOfClass:[ASPasswordCredential class]]) {
// 用户登录使用现有的密码凭证
ASPasswordCredential *passwordCredential = authorization.credential;
// 密码凭证对象的用户标识 用户的唯一标识
NSString *user = passwordCredential.user;
// 密码凭证对象的密码
NSString *password = passwordCredential.password;
NSLog(@"user:%@, password:%@", user, password);
} else {
NSLog(@"授权信息均不符");
}
}
#pragma mark - 授权失败的回调
- (void)authorizationController:(ASAuthorizationController *)controller didCompleteWithError:(NSError *)error API_AVAILABLE(ios(13.0)) {
NSLog(@"%s", __FUNCTION__);
NSLog(@"错误信息:%@", error);
NSString *errorMsg = nil;
switch (error.code) {
case ASAuthorizationErrorCanceled:
errorMsg = @"用户取消了授权请求";
break;
case ASAuthorizationErrorFailed:
errorMsg = @"授权请求失败";
break;
case ASAuthorizationErrorInvalidResponse:
errorMsg = @"授权请求响应无效";
break;
case ASAuthorizationErrorNotHandled:
errorMsg = @"未能处理授权请求";
break;
case ASAuthorizationErrorUnknown:
errorMsg = @"授权请求失败未知原因";
break;
}
NSLog(@"controller requests:%@, errorMsg:%@", controller.authorizationRequests, errorMsg);
}
#pragma mark - ASAuthorizationControllerPresentationContextProviding
#pragma mark - 告诉代理应该在哪个window 展示内容给用户
- (ASPresentationAnchor)presentationAnchorForAuthorizationController:(ASAuthorizationController *)controller API_AVAILABLE(ios(13.0)){
NSLog(@"调用展示window方法:%s", __FUNCTION__);
// 返回window
return self.view.window;
}
- (LoginView *)loginView {
if (!_loginView) {
_loginView = [[LoginView alloc] initWithDelegate:self];
}
return _loginView;
}
@end
//
// LoginView.h
// DreamSleep
//
// Created by peter on 2022/4/17.
//
#import <UIKit/UIKit.h>
#import "WXApi.h"
NS_ASSUME_NONNULL_BEGIN
@protocol LoginViewDelegate <NSObject>
- (void)sendClickAction:(NSInteger)tag;
@end
@interface LoginView : UIView
@property (nonatomic, weak) id<LoginViewDelegate> delegate;
- (instancetype)initWithDelegate:(id<LoginViewDelegate>)delegate;
/// 根据后台接口显示/隐藏苹果登录按钮并更新约束
/// @param state BOOL
- (void)updateAppleLoginState:(BOOL)state;
@end
NS_ASSUME_NONNULL_END
{
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"filename" : "allowed.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "allowed@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "allowed@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"filename" : "bg_login_normal.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "bg_login_normal@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "bg_login_normal@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"filename" : "bg_login_normal_dk.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "bg_login_normal_dk@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "bg_login_normal_dk@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"filename" : "ic_apple_login.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "ic_apple_login@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "ic_apple_login@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"filename" : "ic_apple_login_dk.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "ic_apple_login_dk@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "ic_apple_login_dk@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"filename" : "unallowed.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "unallowed@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "unallowed@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"filename" : "wechat.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "wechat@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "wechat@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
...@@ -16,4 +16,7 @@ NORMAL NIGHT RED ...@@ -16,4 +16,7 @@ NORMAL NIGHT RED
#333333 #FFFFFF #000000 TEXT #333333 #FFFFFF #000000 TEXT
#AAAAAA #FFFFFF #000000 SubTEXT #AAAAAA #FFFFFF #000000 SubTEXT
#FFFFFF #333333 #000000 APPLE_TEXT
//
// UILabel+YBAttributeTextTapAction.h
//
// Created by LYB on 16/7/1.
// Copyright © 2016年 LYB. All rights reserved.
//
#import <UIKit/UIKit.h>
@protocol YBAttributeTapActionDelegate <NSObject>
@optional
/**
* YBAttributeTapActionDelegate
*
* @param string 点击的字符串
* @param range 点击的字符串range
* @param index 点击的字符在数组中的index
*/
- (void)yb_tapAttributeInLabel:(UILabel *)label
string:(NSString *)string
range:(NSRange)range
index:(NSInteger)index;
@end
@interface UILabel (YBAttributeTextTapAction)
/**
* 是否打开点击效果,默认是打开
*/
@property (nonatomic, assign) BOOL enabledTapEffect;
/**
* 点击高亮色 默认是[UIColor lightGrayColor] 需打开enabledTapEffect才有效
*/
@property (nonatomic, strong) UIColor * tapHighlightedColor;
/**
* 是否扩大点击范围,默认是打开
*/
@property (nonatomic, assign) BOOL enlargeTapArea;
/**
* 给文本添加点击事件Block回调
*
* @param strings 需要添加的字符串数组
* @param tapClick 点击事件回调
*/
- (void)yb_addAttributeTapActionWithStrings:(NSArray <NSString *> *)strings
tapClicked:(void (^) (UILabel * label, NSString *string, NSRange range, NSInteger index))tapClick;
/**
* 给文本添加点击事件delegate回调
*
* @param strings 需要添加的字符串数组
* @param delegate delegate
*/
- (void)yb_addAttributeTapActionWithStrings:(NSArray <NSString *> *)strings
delegate:(id <YBAttributeTapActionDelegate> )delegate;
/**
* 根据range给文本添加点击事件Block回调
*
* @param ranges 需要添加的Range字符串数组
* @param tapClick 点击事件回调
*/
- (void)yb_addAttributeTapActionWithRanges:(NSArray <NSString *> *)ranges
tapClicked:(void (^) (UILabel * label, NSString *string, NSRange range, NSInteger index))tapClick;
/**
* 根据range给文本添加点击事件delegate回调
*
* @param ranges 需要添加的Range字符串数组
* @param delegate delegate
*/
- (void)yb_addAttributeTapActionWithRanges:(NSArray <NSString *> *)ranges
delegate:(id <YBAttributeTapActionDelegate> )delegate;
/**
* 删除label上的点击事件
*/
- (void)yb_removeAttributeTapActions;
@end
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!