Commit 6a62d1f5 by xuning

手机号登录、验证码登录UI

parent 229b1a8c
...@@ -7,6 +7,10 @@ ...@@ -7,6 +7,10 @@
objects = { objects = {
/* Begin PBXBuildFile section */ /* Begin PBXBuildFile section */
7981EAB72B6E669000F357E7 /* UIScrollView+XVAdd.m in Sources */ = {isa = PBXBuildFile; fileRef = 7981EAB62B6E669000F357E7 /* UIScrollView+XVAdd.m */; };
7981EABA2B6E670200F357E7 /* UIView+XVAdd.m in Sources */ = {isa = PBXBuildFile; fileRef = 7981EAB92B6E670200F357E7 /* UIView+XVAdd.m */; };
7981EABD2B6E675F00F357E7 /* NSString+XVAdd.m in Sources */ = {isa = PBXBuildFile; fileRef = 7981EABC2B6E675F00F357E7 /* NSString+XVAdd.m */; };
7981EAC42B6E800900F357E7 /* XVInputFieldView.m in Sources */ = {isa = PBXBuildFile; fileRef = 7981EAC22B6E800900F357E7 /* XVInputFieldView.m */; };
799DF0C62B6BD8AF00680907 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 799DF0C52B6BD8AF00680907 /* AppDelegate.m */; }; 799DF0C62B6BD8AF00680907 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 799DF0C52B6BD8AF00680907 /* AppDelegate.m */; };
799DF0D12B6BD8B100680907 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 799DF0D02B6BD8B100680907 /* Assets.xcassets */; }; 799DF0D12B6BD8B100680907 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 799DF0D02B6BD8B100680907 /* Assets.xcassets */; };
799DF0D42B6BD8B100680907 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 799DF0D22B6BD8B100680907 /* LaunchScreen.storyboard */; }; 799DF0D42B6BD8B100680907 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 799DF0D22B6BD8B100680907 /* LaunchScreen.storyboard */; };
...@@ -21,7 +25,6 @@ ...@@ -21,7 +25,6 @@
799DF10F2B6D25B400680907 /* UINavigation+SXFixSpace.m in Sources */ = {isa = PBXBuildFile; fileRef = 799DF10C2B6D25B400680907 /* UINavigation+SXFixSpace.m */; }; 799DF10F2B6D25B400680907 /* UINavigation+SXFixSpace.m in Sources */ = {isa = PBXBuildFile; fileRef = 799DF10C2B6D25B400680907 /* UINavigation+SXFixSpace.m */; };
799DF1102B6D25B400680907 /* UIBarButtonItem+SXCreate.m in Sources */ = {isa = PBXBuildFile; fileRef = 799DF10D2B6D25B400680907 /* UIBarButtonItem+SXCreate.m */; }; 799DF1102B6D25B400680907 /* UIBarButtonItem+SXCreate.m in Sources */ = {isa = PBXBuildFile; fileRef = 799DF10D2B6D25B400680907 /* UIBarButtonItem+SXCreate.m */; };
799DF1112B6D25B400680907 /* NSObject+SXRuntime.m in Sources */ = {isa = PBXBuildFile; fileRef = 799DF10E2B6D25B400680907 /* NSObject+SXRuntime.m */; }; 799DF1112B6D25B400680907 /* NSObject+SXRuntime.m in Sources */ = {isa = PBXBuildFile; fileRef = 799DF10E2B6D25B400680907 /* NSObject+SXRuntime.m */; };
799DF1152B6D284100680907 /* XVInputFieldView.m in Sources */ = {isa = PBXBuildFile; fileRef = 799DF1142B6D284100680907 /* XVInputFieldView.m */; };
799DF11A2B6D2B3200680907 /* XVLoginViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 799DF1192B6D2B3200680907 /* XVLoginViewController.m */; }; 799DF11A2B6D2B3200680907 /* XVLoginViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 799DF1192B6D2B3200680907 /* XVLoginViewController.m */; };
FA5E55D5A48FDC04BA4CCD08 /* Pods_fastservice.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 08D109EE60B32403F3655A70 /* Pods_fastservice.framework */; }; FA5E55D5A48FDC04BA4CCD08 /* Pods_fastservice.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 08D109EE60B32403F3655A70 /* Pods_fastservice.framework */; };
/* End PBXBuildFile section */ /* End PBXBuildFile section */
...@@ -30,6 +33,14 @@ ...@@ -30,6 +33,14 @@
08D109EE60B32403F3655A70 /* Pods_fastservice.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_fastservice.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 08D109EE60B32403F3655A70 /* Pods_fastservice.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_fastservice.framework; sourceTree = BUILT_PRODUCTS_DIR; };
0A560A1F356C4AB4EE319B53 /* Pods-fastservice.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-fastservice.debug.xcconfig"; path = "Target Support Files/Pods-fastservice/Pods-fastservice.debug.xcconfig"; sourceTree = "<group>"; }; 0A560A1F356C4AB4EE319B53 /* Pods-fastservice.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-fastservice.debug.xcconfig"; path = "Target Support Files/Pods-fastservice/Pods-fastservice.debug.xcconfig"; sourceTree = "<group>"; };
6102ECAEC07A0BE24F1B6143 /* Pods-fastservice.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-fastservice.release.xcconfig"; path = "Target Support Files/Pods-fastservice/Pods-fastservice.release.xcconfig"; sourceTree = "<group>"; }; 6102ECAEC07A0BE24F1B6143 /* Pods-fastservice.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-fastservice.release.xcconfig"; path = "Target Support Files/Pods-fastservice/Pods-fastservice.release.xcconfig"; sourceTree = "<group>"; };
7981EAB52B6E669000F357E7 /* UIScrollView+XVAdd.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "UIScrollView+XVAdd.h"; sourceTree = "<group>"; };
7981EAB62B6E669000F357E7 /* UIScrollView+XVAdd.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "UIScrollView+XVAdd.m"; sourceTree = "<group>"; };
7981EAB82B6E670200F357E7 /* UIView+XVAdd.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "UIView+XVAdd.h"; sourceTree = "<group>"; };
7981EAB92B6E670200F357E7 /* UIView+XVAdd.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "UIView+XVAdd.m"; sourceTree = "<group>"; };
7981EABB2B6E675F00F357E7 /* NSString+XVAdd.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "NSString+XVAdd.h"; sourceTree = "<group>"; };
7981EABC2B6E675F00F357E7 /* NSString+XVAdd.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "NSString+XVAdd.m"; sourceTree = "<group>"; };
7981EAC22B6E800900F357E7 /* XVInputFieldView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = XVInputFieldView.m; sourceTree = "<group>"; };
7981EAC32B6E800900F357E7 /* XVInputFieldView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XVInputFieldView.h; sourceTree = "<group>"; };
799DF0C12B6BD8AF00680907 /* fastservice.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = fastservice.app; sourceTree = BUILT_PRODUCTS_DIR; }; 799DF0C12B6BD8AF00680907 /* fastservice.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = fastservice.app; sourceTree = BUILT_PRODUCTS_DIR; };
799DF0C42B6BD8AF00680907 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; }; 799DF0C42B6BD8AF00680907 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; };
799DF0C52B6BD8AF00680907 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = "<group>"; }; 799DF0C52B6BD8AF00680907 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = "<group>"; };
...@@ -58,8 +69,6 @@ ...@@ -58,8 +69,6 @@
799DF10C2B6D25B400680907 /* UINavigation+SXFixSpace.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UINavigation+SXFixSpace.m"; sourceTree = "<group>"; }; 799DF10C2B6D25B400680907 /* UINavigation+SXFixSpace.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UINavigation+SXFixSpace.m"; sourceTree = "<group>"; };
799DF10D2B6D25B400680907 /* UIBarButtonItem+SXCreate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIBarButtonItem+SXCreate.m"; sourceTree = "<group>"; }; 799DF10D2B6D25B400680907 /* UIBarButtonItem+SXCreate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIBarButtonItem+SXCreate.m"; sourceTree = "<group>"; };
799DF10E2B6D25B400680907 /* NSObject+SXRuntime.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSObject+SXRuntime.m"; sourceTree = "<group>"; }; 799DF10E2B6D25B400680907 /* NSObject+SXRuntime.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSObject+SXRuntime.m"; sourceTree = "<group>"; };
799DF1132B6D284100680907 /* XVInputFieldView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XVInputFieldView.h; sourceTree = "<group>"; };
799DF1142B6D284100680907 /* XVInputFieldView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XVInputFieldView.m; sourceTree = "<group>"; };
799DF1182B6D2B3200680907 /* XVLoginViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XVLoginViewController.h; sourceTree = "<group>"; }; 799DF1182B6D2B3200680907 /* XVLoginViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XVLoginViewController.h; sourceTree = "<group>"; };
799DF1192B6D2B3200680907 /* XVLoginViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XVLoginViewController.m; sourceTree = "<group>"; }; 799DF1192B6D2B3200680907 /* XVLoginViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XVLoginViewController.m; sourceTree = "<group>"; };
/* End PBXFileReference section */ /* End PBXFileReference section */
...@@ -85,6 +94,15 @@ ...@@ -85,6 +94,15 @@
path = Pods; path = Pods;
sourceTree = "<group>"; sourceTree = "<group>";
}; };
7981EABE2B6E7B3700F357E7 /* View */ = {
isa = PBXGroup;
children = (
7981EAC32B6E800900F357E7 /* XVInputFieldView.h */,
7981EAC22B6E800900F357E7 /* XVInputFieldView.m */,
);
path = View;
sourceTree = "<group>";
};
799DF0B82B6BD8AE00680907 = { 799DF0B82B6BD8AE00680907 = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
...@@ -142,6 +160,12 @@ ...@@ -142,6 +160,12 @@
children = ( children = (
799DF0E02B6BDA1300680907 /* BRPlaceholderTextView.h */, 799DF0E02B6BDA1300680907 /* BRPlaceholderTextView.h */,
799DF0E12B6BDA1300680907 /* BRPlaceholderTextView.m */, 799DF0E12B6BDA1300680907 /* BRPlaceholderTextView.m */,
7981EAB52B6E669000F357E7 /* UIScrollView+XVAdd.h */,
7981EAB62B6E669000F357E7 /* UIScrollView+XVAdd.m */,
7981EAB82B6E670200F357E7 /* UIView+XVAdd.h */,
7981EAB92B6E670200F357E7 /* UIView+XVAdd.m */,
7981EABB2B6E675F00F357E7 /* NSString+XVAdd.h */,
7981EABC2B6E675F00F357E7 /* NSString+XVAdd.m */,
); );
path = Categpry; path = Categpry;
sourceTree = "<group>"; sourceTree = "<group>";
...@@ -189,7 +213,6 @@ ...@@ -189,7 +213,6 @@
799DF0F12B6BDA1400680907 /* Base */ = { 799DF0F12B6BDA1400680907 /* Base */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
799DF1122B6D281000680907 /* View */,
799DF0F22B6BDA1400680907 /* Controller */, 799DF0F22B6BDA1400680907 /* Controller */,
); );
path = Base; path = Base;
...@@ -219,18 +242,10 @@ ...@@ -219,18 +242,10 @@
path = "UINavigation+SXFixSpace"; path = "UINavigation+SXFixSpace";
sourceTree = "<group>"; sourceTree = "<group>";
}; };
799DF1122B6D281000680907 /* View */ = {
isa = PBXGroup;
children = (
799DF1132B6D284100680907 /* XVInputFieldView.h */,
799DF1142B6D284100680907 /* XVInputFieldView.m */,
);
path = View;
sourceTree = "<group>";
};
799DF1162B6D2B1300680907 /* Login */ = { 799DF1162B6D2B1300680907 /* Login */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
7981EABE2B6E7B3700F357E7 /* View */,
799DF1172B6D2B1B00680907 /* Controller */, 799DF1172B6D2B1B00680907 /* Controller */,
); );
path = Login; path = Login;
...@@ -386,13 +401,16 @@ ...@@ -386,13 +401,16 @@
isa = PBXSourcesBuildPhase; isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( files = (
7981EAB72B6E669000F357E7 /* UIScrollView+XVAdd.m in Sources */,
799DF1042B6D220300680907 /* XVBaseViewController.m in Sources */, 799DF1042B6D220300680907 /* XVBaseViewController.m in Sources */,
799DF0C62B6BD8AF00680907 /* AppDelegate.m in Sources */, 799DF0C62B6BD8AF00680907 /* AppDelegate.m in Sources */,
799DF1112B6D25B400680907 /* NSObject+SXRuntime.m in Sources */, 799DF1112B6D25B400680907 /* NSObject+SXRuntime.m in Sources */,
799DF1152B6D284100680907 /* XVInputFieldView.m in Sources */, 7981EABA2B6E670200F357E7 /* UIView+XVAdd.m in Sources */,
7981EABD2B6E675F00F357E7 /* NSString+XVAdd.m in Sources */,
799DF0F72B6BDA1400680907 /* BRPlaceholderTextView.m in Sources */, 799DF0F72B6BDA1400680907 /* BRPlaceholderTextView.m in Sources */,
799DF0F82B6BDA1400680907 /* NSString+Unicode.m in Sources */, 799DF0F82B6BDA1400680907 /* NSString+Unicode.m in Sources */,
799DF0D72B6BD8B100680907 /* main.m in Sources */, 799DF0D72B6BD8B100680907 /* main.m in Sources */,
7981EAC42B6E800900F357E7 /* XVInputFieldView.m in Sources */,
799DF11A2B6D2B3200680907 /* XVLoginViewController.m in Sources */, 799DF11A2B6D2B3200680907 /* XVLoginViewController.m in Sources */,
799DF0FB2B6BDA1400680907 /* WRNavigationBar.m in Sources */, 799DF0FB2B6BDA1400680907 /* WRNavigationBar.m in Sources */,
799DF1102B6D25B400680907 /* UIBarButtonItem+SXCreate.m in Sources */, 799DF1102B6D25B400680907 /* UIBarButtonItem+SXCreate.m in Sources */,
...@@ -539,7 +557,7 @@ ...@@ -539,7 +557,7 @@
GCC_PREFIX_HEADER = "$(SRCROOT)/fastservice/PrefixHeader.pch"; GCC_PREFIX_HEADER = "$(SRCROOT)/fastservice/PrefixHeader.pch";
GENERATE_INFOPLIST_FILE = YES; GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = fastservice/Info.plist; INFOPLIST_FILE = fastservice/Info.plist;
INFOPLIST_KEY_CFBundleDisplayName = "$(PRODUCT_NAME)"; INFOPLIST_KEY_CFBundleDisplayName = "快服务";
INFOPLIST_KEY_NSLocationWhenInUseUsageDescription = "此APP需要访问您的位置,用于展示当前定位"; INFOPLIST_KEY_NSLocationWhenInUseUsageDescription = "此APP需要访问您的位置,用于展示当前定位";
INFOPLIST_KEY_NSPhotoLibraryUsageDescription = "此APP需要访问您的相册,用于上传附件"; INFOPLIST_KEY_NSPhotoLibraryUsageDescription = "此APP需要访问您的相册,用于上传附件";
INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES;
...@@ -572,7 +590,7 @@ ...@@ -572,7 +590,7 @@
GCC_PREFIX_HEADER = "$(SRCROOT)/fastservice/PrefixHeader.pch"; GCC_PREFIX_HEADER = "$(SRCROOT)/fastservice/PrefixHeader.pch";
GENERATE_INFOPLIST_FILE = YES; GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = fastservice/Info.plist; INFOPLIST_FILE = fastservice/Info.plist;
INFOPLIST_KEY_CFBundleDisplayName = "$(PRODUCT_NAME)"; INFOPLIST_KEY_CFBundleDisplayName = "快服务";
INFOPLIST_KEY_NSLocationWhenInUseUsageDescription = "此APP需要访问您的位置,用于展示当前定位"; INFOPLIST_KEY_NSLocationWhenInUseUsageDescription = "此APP需要访问您的位置,用于展示当前定位";
INFOPLIST_KEY_NSPhotoLibraryUsageDescription = "此APP需要访问您的相册,用于上传附件"; INFOPLIST_KEY_NSPhotoLibraryUsageDescription = "此APP需要访问您的相册,用于上传附件";
INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES;
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
#import <AvoidCrash.h> #import <AvoidCrash.h>
#import <IQKeyboardManager/IQKeyboardManager.h> #import <IQKeyboardManager/IQKeyboardManager.h>
#import "XVLoginViewController.h" #import "XVLoginViewController.h"
#import "XVNaviViewController.h"
@interface AppDelegate () @interface AppDelegate ()
...@@ -29,10 +30,12 @@ ...@@ -29,10 +30,12 @@
// 设置主窗口,并设置根控制器 // 设置主窗口,并设置根控制器
self.window = [[UIWindow alloc]initWithFrame:[UIScreen mainScreen].bounds]; self.window = [[UIWindow alloc]initWithFrame:[UIScreen mainScreen].bounds];
XVLoginViewController *vc = [[XVLoginViewController alloc]init]; XVLoginViewController *vc = [[XVLoginViewController alloc]init];
XVNaviViewController *navi = [[XVNaviViewController alloc]initWithRootViewController:vc];
self.window.rootViewController = vc; self.window.rootViewController = navi;
self.window.backgroundColor = [UIColor redColor]; self.window.backgroundColor = [UIColor redColor];
[self.window makeKeyAndVisible]; [self.window makeKeyAndVisible];
......
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "closeeyes@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "closeeyes@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "openeyes@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "openeyes@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "order_check box@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "order_check box@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "order_checkSelect@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "order_checkSelect@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "right.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
//
// XVInputFieldView.m
// fastservice
//
// Created by xuning on 2/2/24.
// Copyright © 2024 FastService. All rights reserved.
//
#import "XVInputFieldView.h"
@implementation XVInputFieldView
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
// Drawing code
}
*/
@end
//
// NSString+XVAdd.h
// fastservice
//
// Created by xuning on 2/3/24.
// Copyright © 2024 FastService. All rights reserved.
//
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
@interface NSString (XVAdd)
-(CGFloat)getSpaceLabelHeightwithSpeace:(CGFloat)lineSpeace withFont:(UIFont*)font withWidth:(CGFloat)width;
/**
获取指定宽度width,字体大小fontSize,字符串value的高度
@param text 文本
@param font 字体大小
@param width 限制字符串显示区域的宽度
@return 返回的高度
*/
- (CGFloat)heightForString:(NSString *)text font:(UIFont *)font width:(CGFloat)width;
/**
* 计算当前字符串的size
*
* @param font 使用的字体
* @param maxSize 最大的size
*
* @return 需要的最小size
*/
- (CGSize)sizeWithFont:(UIFont *)font maxSize:(CGSize)maxSize;
@end
NS_ASSUME_NONNULL_END
//
// NSString+XVAdd.m
// fastservice
//
// Created by xuning on 2/3/24.
// Copyright © 2024 FastService. All rights reserved.
//
#import "NSString+XVAdd.h"
@implementation NSString (XVAdd)
- (CGFloat)heightForString:(NSString *)text font:(UIFont *)font width:(CGFloat)width {
NSDictionary *attributes = @{NSFontAttributeName : font};
CGSize sizeToFit = [text boundingRectWithSize:CGSizeMake(width, MAXFLOAT) options:NSStringDrawingUsesLineFragmentOrigin attributes:attributes context:nil].size;
return sizeToFit.height;
}
/**
* 计算当前字符串的size
*
* @param font 使用的字体
* @param maxSize 最大的size
*
* @return 需要的最小size
*/
- (CGSize)sizeWithFont:(UIFont *)font maxSize:(CGSize)maxSize
{
CGSize size = CGSizeZero;
if ([self respondsToSelector:@selector(boundingRectWithSize:options:attributes:context:)]) {
size = [self boundingRectWithSize:maxSize options:NSStringDrawingUsesLineFragmentOrigin attributes:@{NSFontAttributeName : font} context:nil].size;
}
//额外增加一个点,防止计算误差
return CGSizeMake(size.width + 1, size.height);
}
/**
* 计算富文本字体高度
*
* @param lineSpeace 行高
* @param font 字体
* @param width 字体所占宽度
*
* @return 富文本高度
*/
-(CGFloat)getSpaceLabelHeightwithSpeace:(CGFloat)lineSpeace withFont:(UIFont*)font withWidth:(CGFloat)width {
NSMutableParagraphStyle *paraStyle = [[NSMutableParagraphStyle alloc] init];
// paraStyle.lineBreakMode = NSLineBreakByCharWrapping;
/** 行高 */
paraStyle.lineSpacing = lineSpeace;
// NSKernAttributeName字体间距
NSDictionary *dic = @{NSFontAttributeName:font, NSParagraphStyleAttributeName:paraStyle};
CGSize size = [self boundingRectWithSize:CGSizeMake(width,MAXFLOAT) options:NSStringDrawingUsesLineFragmentOrigin attributes:dic context:nil].size;
return size.height;
}
@end
// //
// XVInputFieldView.h // UIScrollView+XVAdd.h
// fastservice // fastservice
// //
// Created by xuning on 2/2/24. // Created by xuning on 2/3/24.
// Copyright © 2024 FastService. All rights reserved. // Copyright © 2024 FastService. All rights reserved.
// //
...@@ -10,7 +10,12 @@ ...@@ -10,7 +10,12 @@
NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_BEGIN
@interface XVInputFieldView : UIView @interface UICollectionView (XVAdd)
@end
@interface UIScrollView (XVAdd)
@end @end
......
//
// UIScrollView+XVAdd.m
// fastservice
//
// Created by xuning on 2/3/24.
// Copyright © 2024 FastService. All rights reserved.
//
#import "UIScrollView+XVAdd.h"
@implementation UICollectionView (XVAdd)
- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer {
if ([self panBack:gestureRecognizer]) {
return YES;
}
return NO;
}
-(BOOL)gestureRecognizerShouldBegin:(UIGestureRecognizer *)gestureRecognizer {
if ([self panBack:gestureRecognizer]) {
return NO;
}
return YES;
}
- (BOOL)panBack:(UIGestureRecognizer *)gestureRecognizer {
if (gestureRecognizer == self.panGestureRecognizer) {
UIPanGestureRecognizer *pan = (UIPanGestureRecognizer *)gestureRecognizer;
CGPoint point = [pan translationInView:self];
UIGestureRecognizerState state = gestureRecognizer.state;
if (UIGestureRecognizerStateBegan == state || UIGestureRecognizerStatePossible == state) {
CGPoint location = [gestureRecognizer locationInView:self];
if (point.x > 0 && location.x < 90 && self.contentOffset.x <= 0) {
return YES;
}
}
}
return NO;
}
@end
@implementation UIScrollView (XVAdd)
- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer {
if ([self panBack:gestureRecognizer]) {
return YES;
}
return NO;
}
-(BOOL)gestureRecognizerShouldBegin:(UIGestureRecognizer *)gestureRecognizer {
if ([self panBack:gestureRecognizer]) {
return NO;
}
return YES;
}
- (BOOL)panBack:(UIGestureRecognizer *)gestureRecognizer {
if (gestureRecognizer == self.panGestureRecognizer) {
UIPanGestureRecognizer *pan = (UIPanGestureRecognizer *)gestureRecognizer;
CGPoint point = [pan translationInView:self];
UIGestureRecognizerState state = gestureRecognizer.state;
if (UIGestureRecognizerStateBegan == state || UIGestureRecognizerStatePossible == state) {
CGPoint location = [gestureRecognizer locationInView:self];
if (point.x > 0 && location.x < 90 && self.contentOffset.x <= 0) {
return YES;
}
}
}
return NO;
}
@end
//
// UIView+XVAdd.h
// fastservice
//
// Created by xuning on 2/3/24.
// Copyright © 2024 FastService. All rights reserved.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface UIView (XVAdd)
#pragma mark - 设置部分圆角
/**
* 设置部分圆角(绝对布局)
*
* @param corners 需要设置为圆角的角 UIRectCornerTopLeft | UIRectCornerTopRight | UIRectCornerBottomLeft | UIRectCornerBottomRight | UIRectCornerAllCorners
* @param radii 需要设置的圆角大小 例如 CGSizeMake(20.0f, 20.0f)
*/
- (void)addRoundedCorners:(UIRectCorner)corners
withRadii:(CGSize)radii;
/**
* 设置部分圆角(相对布局)
*
* @param corners 需要设置为圆角的角 UIRectCornerTopLeft | UIRectCornerTopRight | UIRectCornerBottomLeft | UIRectCornerBottomRight | UIRectCornerAllCorners
* @param radii 需要设置的圆角大小 例如 CGSizeMake(20.0f, 20.0f)
* @param rect 需要设置的圆角view的rect
*/
- (void)addRoundedCorners:(UIRectCorner)corners
withRadii:(CGSize)radii
viewRect:(CGRect)rect;
@end
@interface UILabel (XVAdd)
/**
便利构造函数
@param text text description
@param color color description
@param alignment alignment description
@param size size description
@return YDLable
*/
- (instancetype)initWithText:(NSString *)text textColor:(UIColor *)color textAlignment:(NSTextAlignment)alignment fontSize:(CGFloat)size;
/**
* 改变行间距
*/
+ (void)changeLineSpaceForLabel:(UILabel *)label WithSpace:(float)space;
/**
* 改变字间距
*/
+ (void)changeWordSpaceForLabel:(UILabel *)label WithSpace:(float)space;
/**
* 改变行间距和字间距
*/
+ (void)changeSpaceForLabel:(UILabel *)label withLineSpace:(float)lineSpace WordSpace:(float)wordSpace;
@end
@interface UIButton (XVAdd)
/**
自定义响应边界 UIEdgeInsetsMake(-3, -4, -5, -6). 表示扩大
例如: self.btn.hitEdgeInsets = UIEdgeInsetsMake(-3, -4, -5, -6);
*/
@property(nonatomic, assign) UIEdgeInsets hitEdgeInsets;
/**
自定义响应边界 自定义的边界的范围 范围扩大3.0,frame 必须是确定的!
如果没有效果,请打印frame
例如:self.btn.hitScale = 3.0;
*/
@property(nonatomic, assign) CGFloat hitScale;
/*
自定义响应边界 自定义的宽度的范围 范围扩大3.0 frame 必须是确定的!
如果没有效果,请打印frame
例如:self.btn.hitWidthScale = 3.0;
*/
@property(nonatomic, assign) CGFloat hitWidthScale;
/*
自定义响应边界 自定义的高度的范围 范围扩大3.0 frame 必须是确定的!
如果没有效果,请打印frame
例如:self.btn.hitHeightScale = 3.0;
*/
@property(nonatomic, assign) CGFloat hitHeightScale;
/**
便利构造函数
@param title title description
@param size size description
@param titleColor titleColor description
@param imageName imageName description
@param selectedImgName selectedImgName description
@param backgroundColor backgroundColor description
@return YDButton
*/
- (instancetype)initWithTitle:(NSString *)title fontSize:(CGFloat)size titleColor:(UIColor *)titleColor normalImageName:(NSString *)imageName selectedImgName:(NSString *)selectedImgName backgroundColor:(UIColor *)backgroundColor;
- (instancetype)initWithTitle:(NSString *)title fontSize:(CGFloat)size normalTitleColor:(UIColor *)normalTitleColor selectTitleColor:(UIColor *)selectTitleColor normalImgColor:(UIColor *)normalImgColor selectedImgColor:(UIColor *)selectedImgColor;
- (instancetype)initWithTitle:(NSString *)title fontSize:(CGFloat)size titleColor:(UIColor *)titleColor bgColor:(UIColor *)bgColor;
- (instancetype)initWithNormalImageName:(NSString *)imageName selectedImgName:(NSString *)selectedImgName;
// 设置左字右图
- (void)setForceRightToLeft:(CGFloat)spacing forState:(UIControlState)state;
@end
@interface UIImageView (XVAdd)
/**
便利构造函数
@param imageNamed imageName description
@return YDImageView
*/
- (instancetype)initWithImageName:(NSString *)imageNamed;
@end
NS_ASSUME_NONNULL_END
//
// XVInputFieldView.h
// fastservice
//
// Created by xuning on 2/3/24.
// Copyright © 2024 FastService. All rights reserved.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
typedef enum : NSUInteger {
InputTypeNumber,
InputTypeText,
InputTypePassword,
InputTypeCode,
InputTypeSmsCode,
} InputType;
@interface XVInputFieldView : UIView
@property (nonatomic, strong) UILabel *titleLabel;
@property (nonatomic, strong) UITextField *textField;
@property (nonatomic, strong) UIButton *eyesButton;
@property (nonatomic, strong) UIButton *smsCodeButton;
@property (nonatomic,copy) void(^textEditingChanged)(NSString *obj);
/// 创建
/// @param type 类型
/// @param placeholder placeholder description
- (instancetype)initWithType:(InputType)type placeholder:(NSString *)placeholder;
@end
NS_ASSUME_NONNULL_END
//
// XVInputFieldView.m
// fastservice
//
// Created by xuning on 2/3/24.
// Copyright © 2024 FastService. All rights reserved.
//
#import "XVInputFieldView.h"
@interface XVInputFieldView()<UITextFieldDelegate>
@property (nonatomic, strong) UIView *lineView;
@property (nonatomic, strong) UIImageView *imageView;
@property (nonatomic,assign) InputType type;
@end
@implementation XVInputFieldView
- (instancetype)initWithType:(InputType)type placeholder:(NSString *)placeholder {
if (self = [super init]) {
self.type = type;
self.textField.placeholder = placeholder;
[self setupUI];
}
return self;
}
- (void)setupUI {
self.backgroundColor = [UIColor whiteColor];
[self addSubview:self.textField];
[self.textField mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerY.mas_equalTo(self);
make.left.mas_equalTo(self).mas_offset(0);
make.right.mas_equalTo(self).mas_offset(0);
make.width.mas_lessThanOrEqualTo(SCREEN_WIDTH-60);
make.height.mas_equalTo(44);
}];
[self addSubview:self.lineView];
[self.lineView mas_makeConstraints:^(MASConstraintMaker *make) {
make.bottom.mas_equalTo(self);
make.height.mas_equalTo(0.5);
make.left.mas_equalTo(self).mas_offset(0);
make.right.mas_equalTo(self).mas_offset(0);
}];
if(self.type == InputTypePassword) {
self.textField.secureTextEntry = YES;
[self addSubview:self.eyesButton];
[self.eyesButton sizeToFit];
[self.eyesButton mas_makeConstraints:^(MASConstraintMaker *make) {
make.right.mas_equalTo(self).mas_offset(-7);
make.centerY.mas_equalTo(self.textField);
}];
}
if(self.type == InputTypeSmsCode) {
[self addSubview:self.smsCodeButton];
[self.smsCodeButton sizeToFit];
[self.smsCodeButton mas_makeConstraints:^(MASConstraintMaker *make) {
make.right.mas_equalTo(self).mas_offset(-7);
make.centerY.mas_equalTo(self.textField);
make.height.mas_equalTo(28);
make.width.mas_equalTo(self.smsCodeButton.width + 10);
}];
kViewBorderRadius(self.smsCodeButton, 4, 0, [UIColor clearColor]);
}
if(self.type == InputTypeNumber) {
self.textField.keyboardType = UIKeyboardTypeNumberPad;
}
}
#pragma mark - UITextFieldDelegate
- (BOOL)textFieldShouldBeginEditing:(UITextField *)textField {
[textField addTarget:self action:@selector(handlerTextFieldEndEdit:) forControlEvents:UIControlEventEditingChanged];
return YES; // 当前 textField 可以编辑
}
- (void)handlerTextFieldEndEdit:(UITextField *)textField {
if (self.textEditingChanged) {
self.textEditingChanged(textField.text);
}
}
- (UITextField *)textField {
if (_textField == nil) {
_textField = [[UITextField alloc]init];
[_textField setValue: kHexRGB(0x737272) forKeyPath:@"placeholderLabel.textColor"];
[_textField setValue:[UIFont systemFontOfSize:14] forKeyPath:@"placeholderLabel.font"];
_textField.font = [UIFont systemFontOfSize:14.0f];
_textField.textColor = [UIColor blackColor];
_textField.delegate = self;
}
return _textField;
}
- (UIView *)lineView {
if (_lineView == nil) {
_lineView = [[UIView alloc]init];
_lineView.backgroundColor = EF_3_COLOR;
}
return _lineView;
}
- (UIButton *)eyesButton {
if(_eyesButton == nil) {
_eyesButton = [[UIButton alloc]initWithNormalImageName:@"closeeyes" selectedImgName:@"openeyes"];
_eyesButton.hitEdgeInsets = UIEdgeInsetsMake(-10, -10, -10, -10);
WS(weakSelf);
[_eyesButton addBlockForControlEvents:UIControlEventTouchUpInside block:^(UIButton *sender) {
sender.selected = !sender.selected;
weakSelf.textField.secureTextEntry = !weakSelf.textField.secureTextEntry;
}];
}
return _eyesButton;
}
- (UIButton *)smsCodeButton {
if(_smsCodeButton == nil) {
_smsCodeButton = [[UIButton alloc]initWithTitle:@"获取验证码" fontSize:14 titleColor:[UIColor whiteColor] bgColor:BB_3_COLOR];
}
return _smsCodeButton;
}
- (UIImageView *)imageView {
if (_imageView == nil) {
_imageView = [[UIImageView alloc]init];
}
return _imageView;
}
@end
...@@ -22,6 +22,9 @@ ...@@ -22,6 +22,9 @@
#import "UINavigation+SXFixSpace.h" #import "UINavigation+SXFixSpace.h"
#import "UIBarButtonItem+SXCreate.h" #import "UIBarButtonItem+SXCreate.h"
#import "UIScrollView+XVAdd.h"
#import "UIView+XVAdd.h"
#import "NSString+XVAdd.h"
#endif #endif
...@@ -38,6 +41,27 @@ ...@@ -38,6 +41,27 @@
#define kRandomColor KRGB(arc4random_uniform(256), arc4random_uniform(256), arc4random_uniform(256)) #define kRandomColor KRGB(arc4random_uniform(256), arc4random_uniform(256), arc4random_uniform(256))
#define COLOR_THEMEGRENN [UIColor colorWithHexString:@"#4EB97B"] #define COLOR_THEMEGRENN [UIColor colorWithHexString:@"#4EB97B"]
#define BLUE_COLOR [UIColor colorWithHexString:@"#4290E5"]
#define YELLOW_COLOR [UIColor colorWithHexString:@"#edb10f"]
#define PURPLE_COLOR [UIColor colorWithHexString:@"#9E5BCA"]
#define RED_COLOR [UIColor colorWithHexString:@"#f25555"]
#define FONT_1_COLOR [UIColor colorWithHexString:@"#3D3B4F"]
#define FONT_2_COLOR [UIColor colorWithHexString:@"#707070"]
#define FONT_3_COLOR [UIColor colorWithHexString:@"#8a8a8a"]
#define FONT_4_COLOR [UIColor colorWithHexString:@"#bcbcbc"]
#define FONT_5_COLOR [UIColor colorWithHexString:@"#cfcfcf"]
#define FONT_6_COLOR [UIColor colorWithHexString:@"#7D7D7D"]
#define FONT_7_COLOR [UIColor colorWithHexString:@"#9B9B9B"]
#define FONT_8_COLOR [UIColor colorWithHexString:@"#666666"]
#define BG_1_COLOR [UIColor colorWithHexString:@"#e9e9e9"]
#define BG_2_COLOR [UIColor colorWithHexString:@"#f2f2f2"]
#define BG_3_COLOR [UIColor colorWithHexString:@"#fafafa"]
#define BB_3_COLOR [UIColor colorWithHexString:@"#BBBBBB"]
#define EF_3_COLOR [UIColor colorWithHexString:@"#efefef"]
#define B2_3_COLOR [UIColor colorWithHexString:@"#b2b2b2"]
#define DEFAULT_BACKGROUND_COLOR kHexRGB(0xf8f8f8) #define DEFAULT_BACKGROUND_COLOR kHexRGB(0xf8f8f8)
#define kViewBorderRadius(View, Radius, Width, Color)\ #define kViewBorderRadius(View, Radius, Width, Color)\
...@@ -47,6 +71,7 @@ ...@@ -47,6 +71,7 @@
[View.layer setBorderColor:[Color CGColor]]; [View.layer setBorderColor:[Color CGColor]];
#define widthScale ([UIScreen mainScreen].bounds.size.width/375.0f) #define widthScale ([UIScreen mainScreen].bounds.size.width/375.0f)
#define heightScale ([UIScreen mainScreen].bounds.size.height/844.0f)
#define SCREEN_HEIGHT [[UIScreen mainScreen] bounds].size.height #define SCREEN_HEIGHT [[UIScreen mainScreen] bounds].size.height
#define SCREEN_WIDTH [[UIScreen mainScreen] bounds].size.width #define SCREEN_WIDTH [[UIScreen mainScreen] bounds].size.width
//状态栏高度 //状态栏高度
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment