├── NewUITest ├── .DS_Store ├── NewUITest │ ├── login_bg.png │ ├── show_home2.png │ ├── reward_bg@2x.png │ ├── show_home@2x.png │ ├── cell_home_bg@2x.png │ ├── rest_num_icon@2x.png │ ├── insurance_icon@2x.png │ ├── begin_amount_icon@2x.png │ ├── invest_limit_icon@2x.png │ ├── product_list_safety@2x.png │ ├── NewLoginView.h │ ├── MyReward_3Cell.h │ ├── HomeViewController.h │ ├── LoginViewController.h │ ├── OrderInfoDetailCell.h │ ├── ViewController.h │ ├── ProductViewController.h │ ├── OrderListViewController.h │ ├── OrderInfoDetailViewController.h │ ├── OrderList_3Cell.h │ ├── ProductList_3Cell.h │ ├── AppDelegate.h │ ├── main.m │ ├── DRSplitLineView.h │ ├── NewLoginView.m │ ├── MyReward_3Cell.m │ ├── NewHomeCell.h │ ├── DRLineProgressLayer.h │ ├── Assets.xcassets │ │ └── AppIcon.appiconset │ │ │ └── Contents.json │ ├── OrderInfoDetailViewController.m │ ├── OrderInfoDetailCell.m │ ├── LoginViewController.m │ ├── ProductProgressView.h │ ├── Info.plist │ ├── DRLineProgressView.h │ ├── DRSplitLineView.m │ ├── Base.lproj │ │ ├── LaunchScreen.storyboard │ │ └── Main.storyboard │ ├── HomeViewController.m │ ├── ViewController.m │ ├── NewHomeCell.m │ ├── ProductViewController.m │ ├── ProductList_3Cell.m │ ├── OrderList_3Cell.m │ ├── DRLineProgressLayer.m │ ├── AppDelegate.m │ ├── DRLineProgressView.m │ ├── OrderListViewController.m │ ├── ProductProgressView.m │ ├── NewLoginView.xib │ ├── MyReward_3Cell.xib │ ├── ProductList_3Cell.xib │ ├── NewHomeCell.xib │ └── OrderList_3Cell.xib ├── NewUITest.xcodeproj │ ├── xcuserdata │ │ ├── apple.xcuserdatad │ │ │ ├── xcdebugger │ │ │ │ └── Breakpoints_v2.xcbkptlist │ │ │ └── xcschemes │ │ │ │ ├── xcschememanagement.plist │ │ │ │ └── 银洲街新UI测试.xcscheme │ │ ├── kun.xcuserdatad │ │ │ └── xcschemes │ │ │ │ └── xcschememanagement.plist │ │ └── liyakun.xcuserdatad │ │ │ └── xcschemes │ │ │ ├── xcschememanagement.plist │ │ │ └── NewUITest.xcscheme │ └── project.xcworkspace │ │ ├── xcuserdata │ │ ├── apple.xcuserdatad │ │ │ └── UserInterfaceState.xcuserstate │ │ └── liyakun.xcuserdatad │ │ │ └── UserInterfaceState.xcuserstate │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ └── IDEWorkspaceChecks.plist ├── NewUITestTests │ ├── Info.plist │ └── ____UI__Tests.m └── NewUITestUITests │ ├── Info.plist │ └── ____UI__UITests.m └── README.md /NewUITest/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gitKun/NewUITest/HEAD/NewUITest/.DS_Store -------------------------------------------------------------------------------- /NewUITest/NewUITest/login_bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gitKun/NewUITest/HEAD/NewUITest/NewUITest/login_bg.png -------------------------------------------------------------------------------- /NewUITest/NewUITest/show_home2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gitKun/NewUITest/HEAD/NewUITest/NewUITest/show_home2.png -------------------------------------------------------------------------------- /NewUITest/NewUITest/reward_bg@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gitKun/NewUITest/HEAD/NewUITest/NewUITest/reward_bg@2x.png -------------------------------------------------------------------------------- /NewUITest/NewUITest/show_home@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gitKun/NewUITest/HEAD/NewUITest/NewUITest/show_home@2x.png -------------------------------------------------------------------------------- /NewUITest/NewUITest/cell_home_bg@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gitKun/NewUITest/HEAD/NewUITest/NewUITest/cell_home_bg@2x.png -------------------------------------------------------------------------------- /NewUITest/NewUITest/rest_num_icon@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gitKun/NewUITest/HEAD/NewUITest/NewUITest/rest_num_icon@2x.png -------------------------------------------------------------------------------- /NewUITest/NewUITest/insurance_icon@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gitKun/NewUITest/HEAD/NewUITest/NewUITest/insurance_icon@2x.png -------------------------------------------------------------------------------- /NewUITest/NewUITest/begin_amount_icon@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gitKun/NewUITest/HEAD/NewUITest/NewUITest/begin_amount_icon@2x.png -------------------------------------------------------------------------------- /NewUITest/NewUITest/invest_limit_icon@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gitKun/NewUITest/HEAD/NewUITest/NewUITest/invest_limit_icon@2x.png -------------------------------------------------------------------------------- /NewUITest/NewUITest/product_list_safety@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gitKun/NewUITest/HEAD/NewUITest/NewUITest/product_list_safety@2x.png -------------------------------------------------------------------------------- /NewUITest/NewUITest.xcodeproj/xcuserdata/apple.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | -------------------------------------------------------------------------------- /NewUITest/NewUITest.xcodeproj/project.xcworkspace/xcuserdata/apple.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gitKun/NewUITest/HEAD/NewUITest/NewUITest.xcodeproj/project.xcworkspace/xcuserdata/apple.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /NewUITest/NewUITest.xcodeproj/project.xcworkspace/xcuserdata/liyakun.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gitKun/NewUITest/HEAD/NewUITest/NewUITest.xcodeproj/project.xcworkspace/xcuserdata/liyakun.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /NewUITest/NewUITest/NewLoginView.h: -------------------------------------------------------------------------------- 1 | // 2 | // NewLoginView.h 3 | // 银洲街新UI测试 4 | // 5 | // Created by apple on 16/2/19. 6 | // Copyright © 2016年 kun. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface NewLoginView : UIView 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /NewUITest/NewUITest.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /NewUITest/NewUITest/MyReward_3Cell.h: -------------------------------------------------------------------------------- 1 | // 2 | // MyReward_3Cell.h 3 | // 银洲街新UI测试 4 | // 5 | // Created by apple on 16/2/29. 6 | // Copyright © 2016年 kun. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface MyReward_3Cell : UITableViewCell 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /NewUITest/NewUITest/HomeViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // HomeViewController.h 3 | // 银洲街新UI测试 4 | // 5 | // Created by apple on 16/2/17. 6 | // Copyright © 2016年 kun. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface HomeViewController : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /NewUITest/NewUITest/LoginViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // LoginViewController.h 3 | // 银洲街新UI测试 4 | // 5 | // Created by apple on 16/2/19. 6 | // Copyright © 2016年 kun. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface LoginViewController : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /NewUITest/NewUITest/OrderInfoDetailCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // OrderInfoDetailCell.h 3 | // 银洲街新UI测试 4 | // 5 | // Created by apple on 16/2/25. 6 | // Copyright © 2016年 kun. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface OrderInfoDetailCell : UITableViewCell 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /NewUITest/NewUITest/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // 银洲街新UI测试 4 | // 5 | // Created by apple on 16/2/17. 6 | // Copyright © 2016年 kun. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ViewController : UIViewController 12 | 13 | 14 | @end 15 | 16 | -------------------------------------------------------------------------------- /NewUITest/NewUITest/ProductViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ProductViewController.h 3 | // 银洲街新UI测试 4 | // 5 | // Created by apple on 16/2/23. 6 | // Copyright © 2016年 kun. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ProductViewController : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /NewUITest/NewUITest/OrderListViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // OrderListViewController.h 3 | // 银洲街新UI测试 4 | // 5 | // Created by apple on 16/2/24. 6 | // Copyright © 2016年 kun. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface OrderListViewController : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /NewUITest/NewUITest/OrderInfoDetailViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // OrderInfoDetailViewController.h 3 | // 银洲街新UI测试 4 | // 5 | // Created by apple on 16/2/25. 6 | // Copyright © 2016年 kun. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface OrderInfoDetailViewController : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /NewUITest/NewUITest.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /NewUITest/NewUITest/OrderList_3Cell.h: -------------------------------------------------------------------------------- 1 | // 2 | // OrderList_3Cell.h 3 | // 银洲街新UI测试 4 | // 5 | // Created by apple on 16/2/24. 6 | // Copyright © 2016年 kun. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface OrderList_3Cell : UITableViewCell 12 | 13 | 14 | - (void)showDataWithModel:(id)model; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /NewUITest/NewUITest/ProductList_3Cell.h: -------------------------------------------------------------------------------- 1 | // 2 | // ProductList_3Cell.h 3 | // 银洲街新UI测试 4 | // 5 | // Created by apple on 16/2/23. 6 | // Copyright © 2016年 kun. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ProductList_3Cell : UITableViewCell 12 | 13 | 14 | - (void)showProgress:(CGFloat)currentProgress; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /NewUITest/NewUITest/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // 银洲街新UI测试 4 | // 5 | // Created by apple on 16/2/17. 6 | // Copyright © 2016年 kun. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | 16 | @end 17 | 18 | -------------------------------------------------------------------------------- /NewUITest/NewUITest/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // 银洲街新UI测试 4 | // 5 | // Created by apple on 16/2/17. 6 | // Copyright © 2016年 kun. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "AppDelegate.h" 11 | 12 | int main(int argc, char * argv[]) { 13 | @autoreleasepool { 14 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /NewUITest/NewUITest/DRSplitLineView.h: -------------------------------------------------------------------------------- 1 | // 2 | // DRSplitLineView.h 3 | // 银洲街新UI测试 4 | // 5 | // Created by apple on 16/2/23. 6 | // Copyright © 2016年 kun. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface DRSplitLineView : UIView 12 | 13 | /** 线条的颜色 */ 14 | @property (nonatomic, strong) UIColor *lineColor; 15 | /** 宽度 */ 16 | @property (nonatomic, assign) CGFloat splitWidth; 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /NewUITest/NewUITest.xcodeproj/xcuserdata/kun.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | NewUITest.xcscheme_^#shared#^_ 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /NewUITest/NewUITest/NewLoginView.m: -------------------------------------------------------------------------------- 1 | // 2 | // NewLoginView.m 3 | // 银洲街新UI测试 4 | // 5 | // Created by apple on 16/2/19. 6 | // Copyright © 2016年 kun. All rights reserved. 7 | // 8 | 9 | #import "NewLoginView.h" 10 | 11 | @implementation NewLoginView 12 | 13 | /* 14 | // Only override drawRect: if you perform custom drawing. 15 | // An empty implementation adversely affects performance during animation. 16 | - (void)drawRect:(CGRect)rect { 17 | // Drawing code 18 | } 19 | */ 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /NewUITest/NewUITest/MyReward_3Cell.m: -------------------------------------------------------------------------------- 1 | // 2 | // MyReward_3Cell.m 3 | // 银洲街新UI测试 4 | // 5 | // Created by apple on 16/2/29. 6 | // Copyright © 2016年 kun. All rights reserved. 7 | // 8 | 9 | #import "MyReward_3Cell.h" 10 | 11 | @implementation MyReward_3Cell 12 | 13 | - (void)awakeFromNib { 14 | // Initialization code 15 | } 16 | 17 | - (void)setSelected:(BOOL)selected animated:(BOOL)animated { 18 | [super setSelected:selected animated:animated]; 19 | 20 | // Configure the view for the selected state 21 | } 22 | 23 | @end 24 | -------------------------------------------------------------------------------- /NewUITest/NewUITest/NewHomeCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // NewHomeCell.h 3 | // 银洲街新UI测试 4 | // 5 | // Created by apple on 16/2/17. 6 | // Copyright © 2016年 kun. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class NewHomeCell; 12 | 13 | @protocol NewHomeCellDelegate 14 | 15 | - (void)newHomeCell:(NewHomeCell *)cell clickAtBuyButton:(UIButton *)buyButton; 16 | 17 | @end 18 | 19 | @interface NewHomeCell : UITableViewCell 20 | 21 | @property (nonatomic, weak) idmDelegate; 22 | 23 | - (void)updateData:(NSObject *)model; 24 | 25 | @end 26 | -------------------------------------------------------------------------------- /NewUITest/NewUITest/DRLineProgressLayer.h: -------------------------------------------------------------------------------- 1 | // 2 | // DRLineProgressLayer.h 3 | // DRLineProgress 4 | // 5 | // Created by apple on 16/3/1. 6 | // Copyright © 2016年 kun. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | @interface DRLineProgressLayer : CALayer 13 | 14 | @property (nonatomic,assign) int total; 15 | @property (nonatomic,strong) UIColor *color; 16 | @property (nonatomic,assign) int completed; 17 | @property (nonatomic,strong) UIColor *completedColor; 18 | 19 | @property (nonatomic,assign) CGFloat radius; 20 | @property (nonatomic,assign) CGFloat innerRadius; 21 | 22 | @property CGFloat startAngle; 23 | @property CGFloat endAngle; 24 | 25 | @property (nonatomic, assign) CFTimeInterval animationDuration; 26 | 27 | @end 28 | -------------------------------------------------------------------------------- /NewUITest/NewUITest/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "60x60", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "60x60", 31 | "scale" : "3x" 32 | } 33 | ], 34 | "info" : { 35 | "version" : 1, 36 | "author" : "xcode" 37 | } 38 | } -------------------------------------------------------------------------------- /NewUITest/NewUITestTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /NewUITest/NewUITestUITests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /NewUITest/NewUITest.xcodeproj/xcuserdata/apple.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | 银洲街新UI测试.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | 184AC5C71C7448B800619980 16 | 17 | primary 18 | 19 | 20 | 184AC5E01C7448B800619980 21 | 22 | primary 23 | 24 | 25 | 184AC5EB1C7448B800619980 26 | 27 | primary 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /NewUITest/NewUITest.xcodeproj/xcuserdata/liyakun.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | NewUITest.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | 184AC5C71C7448B800619980 16 | 17 | primary 18 | 19 | 20 | 184AC5E01C7448B800619980 21 | 22 | primary 23 | 24 | 25 | 184AC5EB1C7448B800619980 26 | 27 | primary 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /NewUITest/NewUITest/OrderInfoDetailViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // OrderInfoDetailViewController.m 3 | // 银洲街新UI测试 4 | // 5 | // Created by apple on 16/2/25. 6 | // Copyright © 2016年 kun. All rights reserved. 7 | // 8 | 9 | #import "OrderInfoDetailViewController.h" 10 | 11 | @interface OrderInfoDetailViewController () 12 | 13 | @end 14 | 15 | @implementation OrderInfoDetailViewController 16 | 17 | - (void)viewDidLoad { 18 | [super viewDidLoad]; 19 | // Do any additional setup after loading the view. 20 | } 21 | 22 | - (void)didReceiveMemoryWarning { 23 | [super didReceiveMemoryWarning]; 24 | // Dispose of any resources that can be recreated. 25 | } 26 | 27 | /* 28 | #pragma mark - Navigation 29 | 30 | // In a storyboard-based application, you will often want to do a little preparation before navigation 31 | - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { 32 | // Get the new view controller using [segue destinationViewController]. 33 | // Pass the selected object to the new view controller. 34 | } 35 | */ 36 | 37 | @end 38 | -------------------------------------------------------------------------------- /NewUITest/NewUITestTests/____UI__Tests.m: -------------------------------------------------------------------------------- 1 | // 2 | // ____UI__Tests.m 3 | // 银洲街新UI测试Tests 4 | // 5 | // Created by apple on 16/2/17. 6 | // Copyright © 2016年 kun. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ____UI__Tests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation ____UI__Tests 16 | 17 | - (void)setUp { 18 | [super setUp]; 19 | // Put setup code here. This method is called before the invocation of each test method in the class. 20 | } 21 | 22 | - (void)tearDown { 23 | // Put teardown code here. This method is called after the invocation of each test method in the class. 24 | [super tearDown]; 25 | } 26 | 27 | - (void)testExample { 28 | // This is an example of a functional test case. 29 | // Use XCTAssert and related functions to verify your tests produce the correct results. 30 | } 31 | 32 | - (void)testPerformanceExample { 33 | // This is an example of a performance test case. 34 | [self measureBlock:^{ 35 | // Put the code you want to measure the time of here. 36 | }]; 37 | } 38 | 39 | @end 40 | -------------------------------------------------------------------------------- /NewUITest/NewUITest/OrderInfoDetailCell.m: -------------------------------------------------------------------------------- 1 | // 2 | // OrderInfoDetailCell.m 3 | // 银洲街新UI测试 4 | // 5 | // Created by apple on 16/2/25. 6 | // Copyright © 2016年 kun. All rights reserved. 7 | // 8 | 9 | #import "OrderInfoDetailCell.h" 10 | #import "ProductProgressView.h" 11 | 12 | @interface OrderInfoDetailCell () 13 | 14 | /** 订单编号 */ 15 | @property (weak, nonatomic) IBOutlet UILabel *orderNumberLabel; 16 | /** 订单金额 */ 17 | @property (weak, nonatomic) IBOutlet UILabel *orderAmountLabel; 18 | /** 预期收益 */ 19 | @property (weak, nonatomic) IBOutlet UILabel *expectEarningLabel; 20 | /** 下单时间 */ 21 | @property (weak, nonatomic) IBOutlet UILabel *orderTimeLabel; 22 | /** 标示订单状态的背景 */ 23 | @property (weak, nonatomic) IBOutlet ProductProgressView *statusView; 24 | /** 标记订单的状态 */ 25 | @property (weak, nonatomic) IBOutlet UILabel *statusLabel; 26 | 27 | 28 | 29 | 30 | 31 | @end 32 | 33 | 34 | @implementation OrderInfoDetailCell 35 | 36 | - (void)awakeFromNib { 37 | // Initialization code 38 | } 39 | 40 | - (void)setSelected:(BOOL)selected animated:(BOOL)animated { 41 | [super setSelected:selected animated:animated]; 42 | 43 | // Configure the view for the selected state 44 | } 45 | 46 | @end 47 | -------------------------------------------------------------------------------- /NewUITest/NewUITest/LoginViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // LoginViewController.m 3 | // 银洲街新UI测试 4 | // 5 | // Created by apple on 16/2/19. 6 | // Copyright © 2016年 kun. All rights reserved. 7 | // 8 | 9 | #import "LoginViewController.h" 10 | #import "NewLoginView.h" 11 | 12 | @interface LoginViewController () 13 | 14 | @end 15 | 16 | @implementation LoginViewController 17 | 18 | - (void)viewDidLoad { 19 | [super viewDidLoad]; 20 | NewLoginView *newView = [[[NSBundle mainBundle] loadNibNamed:@"NewLoginView" owner:self options:nil] lastObject]; 21 | newView.frame = CGRectMake(0, 64, self.view.bounds.size.width,self.view.bounds.size.height-64); 22 | [self.view addSubview:newView]; 23 | } 24 | 25 | - (void)didReceiveMemoryWarning { 26 | [super didReceiveMemoryWarning]; 27 | // Dispose of any resources that can be recreated. 28 | } 29 | 30 | /* 31 | #pragma mark - Navigation 32 | 33 | // In a storyboard-based application, you will often want to do a little preparation before navigation 34 | - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { 35 | // Get the new view controller using [segue destinationViewController]. 36 | // Pass the selected object to the new view controller. 37 | } 38 | */ 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /NewUITest/NewUITest/ProductProgressView.h: -------------------------------------------------------------------------------- 1 | // 2 | // ProductProgressView.h 3 | // 银洲街新UI测试 4 | // 5 | // Created by apple on 16/2/23. 6 | // Copyright © 2016年 kun. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ProductProgressView : UIView 12 | 13 | /** 设置绘制的进度的环形(实心圆形)的颜色 */ 14 | @property(nonatomic, strong) UIColor *trackTintColor UI_APPEARANCE_SELECTOR; 15 | /** 设置绘制进度条使用的颜色*/ 16 | @property(nonatomic, strong) UIColor *progressTintColor UI_APPEARANCE_SELECTOR; 17 | /** 外部圆环的颜色 */ 18 | @property (nonatomic, strong) UIColor *bigCircleColor UI_APPEARANCE_SELECTOR; 19 | /** 外部圆环的粗细 */ 20 | @property (nonatomic) CGFloat bigVircleWidth UI_APPEARANCE_SELECTOR; 21 | /** 设置是否按顺时针进行绘制进度条 */ 22 | @property(nonatomic) NSInteger clockwiseProgress UI_APPEARANCE_SELECTOR; // Can not use BOOL with UI_APPEARANCE_SELECTOR :-( 23 | /** 设置当前的 进度 不带动画效果*/ 24 | @property(nonatomic) CGFloat progress; 25 | 26 | /** 27 | * @brief 设置带动画效果的进度指示 28 | * 29 | * @param progress 当前产品的进度 30 | * @param animated 是否带动画 31 | * @param initialDelay 等待动画开始时间(延迟开始动画的时间) 32 | * @param duration 动画持续时间 33 | */ 34 | - (void)setProgress:(CGFloat)progress animated:(BOOL)animated initialDelay:(CFTimeInterval)initialDelay withDuration:(CFTimeInterval)duration; 35 | 36 | @end 37 | -------------------------------------------------------------------------------- /NewUITest/NewUITest/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationLandscapeLeft 37 | UIInterfaceOrientationLandscapeRight 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /NewUITest/NewUITestUITests/____UI__UITests.m: -------------------------------------------------------------------------------- 1 | // 2 | // ____UI__UITests.m 3 | // 银洲街新UI测试UITests 4 | // 5 | // Created by apple on 16/2/17. 6 | // Copyright © 2016年 kun. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ____UI__UITests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation ____UI__UITests 16 | 17 | - (void)setUp { 18 | [super setUp]; 19 | 20 | // Put setup code here. This method is called before the invocation of each test method in the class. 21 | 22 | // In UI tests it is usually best to stop immediately when a failure occurs. 23 | self.continueAfterFailure = NO; 24 | // UI tests must launch the application that they test. Doing this in setup will make sure it happens for each test method. 25 | [[[XCUIApplication alloc] init] launch]; 26 | 27 | // In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this. 28 | } 29 | 30 | - (void)tearDown { 31 | // Put teardown code here. This method is called after the invocation of each test method in the class. 32 | [super tearDown]; 33 | } 34 | 35 | - (void)testExample { 36 | // Use recording to get started writing UI tests. 37 | // Use XCTAssert and related functions to verify your tests produce the correct results. 38 | } 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /NewUITest/NewUITest/DRLineProgressView.h: -------------------------------------------------------------------------------- 1 | // 2 | // DRLineProgressView.h 3 | // DRLineProgress 4 | // 5 | // Created by apple on 16/3/1. 6 | // Copyright © 2016年 kun. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class DRLineProgressView; 12 | 13 | @protocol DRLineProgressViewDelegate 14 | @optional 15 | - (void)LineProgressViewAnimationDidStart:(DRLineProgressView *)lineProgressView; 16 | - (void)LineProgressViewAnimationDidStop:(DRLineProgressView *)lineProgressView; 17 | @end 18 | 19 | 20 | @interface DRLineProgressView : UIView 21 | 22 | /** 线条的总个数 */ 23 | @property (nonatomic,assign) int total; 24 | /** 还没有完成的线条的颜色 */ 25 | @property (nonatomic,strong) UIColor *color; 26 | 27 | @property (nonatomic,assign) int completed; 28 | /** 已完成的进度线颜色 (默认为白色) */ 29 | @property (nonatomic,strong) UIColor *completedColor; 30 | /** 外部半径 和 innerRadius 决定进度线的长短 */ 31 | @property (nonatomic,assign) CGFloat radius; 32 | /** 内部半径 和 radius 决定进度线的长度 */ 33 | @property (nonatomic,assign) CGFloat innerRadius; 34 | /** 指示器开始的位置 */ 35 | @property (nonatomic,assign) CGFloat startAngle; 36 | /** 指示器结束的位置 */ 37 | @property (nonatomic,assign) CGFloat endAngle; 38 | /** 动画进的的时间 */ 39 | @property (nonatomic, assign) CFTimeInterval animationDuration; 40 | @property (nonatomic) id mDelegate; 41 | 42 | - (void)setCompleted:(int)completed animated:(BOOL)animated; 43 | 44 | @end 45 | -------------------------------------------------------------------------------- /NewUITest/NewUITest/DRSplitLineView.m: -------------------------------------------------------------------------------- 1 | // 2 | // DRSplitLineView.m 3 | // 银洲街新UI测试 4 | // 5 | // Created by apple on 16/2/23. 6 | // Copyright © 2016年 kun. All rights reserved. 7 | // 8 | 9 | #import "DRSplitLineView.h" 10 | 11 | @implementation DRSplitLineView 12 | 13 | + (Class)layerClass { 14 | return [CAShapeLayer class]; 15 | } 16 | - (CAShapeLayer *)shapeLayer { 17 | return (CAShapeLayer *)self.layer; 18 | } 19 | - (instancetype)initWithCoder:(NSCoder *)aDecoder { 20 | self = [super initWithCoder:aDecoder]; 21 | if (self) { 22 | 23 | } 24 | return self; 25 | } 26 | - (void)setSplitWidth:(CGFloat)splitWidth { 27 | _splitWidth = splitWidth; 28 | [self setNeedsDisplay]; 29 | } 30 | 31 | - (void)drawRect:(CGRect)rect { 32 | //计算总共的分割点 33 | CGFloat vWidth = CGRectGetWidth(rect); 34 | CGFloat yPoint = CGRectGetMidY(rect); 35 | CGFloat amount = vWidth/(self.splitWidth? :6.0); 36 | //向后取整数 37 | int behindPoint = (int)amount; 38 | UIBezierPath *bezierPath = [UIBezierPath bezierPath]; 39 | for (int i = 0; i < behindPoint; i++) { 40 | [bezierPath moveToPoint:CGPointMake(i*_splitWidth, yPoint)]; 41 | if (i == behindPoint) {//奇数个点画到末尾 42 | [bezierPath addLineToPoint:CGPointMake(CGRectGetMaxX(rect), yPoint)]; 43 | break; 44 | } 45 | [bezierPath addLineToPoint:CGPointMake(++i*_splitWidth, yPoint)]; 46 | if (i == behindPoint) {//偶数个点画到最后一个点 47 | break; 48 | } 49 | } 50 | self.shapeLayer.path = bezierPath.CGPath; 51 | self.shapeLayer.lineWidth = 1; 52 | self.shapeLayer.strokeColor = self.lineColor.CGColor; 53 | } 54 | @end 55 | -------------------------------------------------------------------------------- /NewUITest/NewUITest/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /NewUITest/NewUITest/HomeViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // HomeViewController.m 3 | // 银洲街新UI测试 4 | // 5 | // Created by apple on 16/2/17. 6 | // Copyright © 2016年 kun. All rights reserved. 7 | // 8 | 9 | #import "HomeViewController.h" 10 | #import "NewHomeCell.h" 11 | 12 | @interface HomeViewController () 13 | 14 | @property (weak, nonatomic) IBOutlet UITableView *tableView; 15 | @property (nonatomic, strong) NSArray *dataArr; 16 | 17 | @end 18 | 19 | @implementation HomeViewController 20 | 21 | - (void)viewDidLoad { 22 | [super viewDidLoad]; 23 | self.automaticallyAdjustsScrollViewInsets = NO; 24 | self.title = @"homeCell"; 25 | 26 | self.dataArr = @[@(10.01)]; 27 | } 28 | 29 | - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { 30 | return 1; 31 | } 32 | - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { 33 | return _dataArr.count; 34 | } 35 | - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { 36 | NewHomeCell *cell = [tableView dequeueReusableCellWithIdentifier:@"NewHomeCellID"]; 37 | if (cell == nil) { 38 | cell = [[[NSBundle mainBundle] loadNibNamed:@"NewHomeCell" owner:self options:nil] lastObject]; 39 | } 40 | 41 | return cell; 42 | } 43 | - (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath { 44 | NewHomeCell *nCell = (NewHomeCell *)cell; 45 | [nCell updateData:nil]; 46 | } 47 | - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath { 48 | return [UIScreen mainScreen].bounds.size.width*3/4; 49 | } 50 | 51 | - (void)didReceiveMemoryWarning { 52 | [super didReceiveMemoryWarning]; 53 | // Dispose of any resources that can be recreated. 54 | } 55 | 56 | /* 57 | #pragma mark - Navigation 58 | 59 | // In a storyboard-based application, you will often want to do a little preparation before navigation 60 | - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { 61 | // Get the new view controller using [segue destinationViewController]. 62 | // Pass the selected object to the new view controller. 63 | } 64 | */ 65 | 66 | @end 67 | -------------------------------------------------------------------------------- /NewUITest/NewUITest/ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // 银洲街新UI测试 4 | // 5 | // Created by apple on 16/2/17. 6 | // Copyright © 2016年 kun. All rights reserved. 7 | // 8 | 9 | #import "ViewController.h" 10 | 11 | @interface ViewController () 12 | 13 | @property (weak, nonatomic) IBOutlet UITableView *tableView; 14 | @property (nonatomic, strong) NSArray *dataArr; 15 | 16 | @end 17 | 18 | @implementation ViewController 19 | 20 | - (void)viewDidLoad { 21 | [super viewDidLoad]; 22 | self.automaticallyAdjustsScrollViewInsets = NO; 23 | self.title = @"测试UI"; 24 | self.dataArr = @[@"homeCell",@"productProgressViw",@"orderListVC"]; 25 | } 26 | 27 | - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { 28 | return 1; 29 | } 30 | - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { 31 | return _dataArr.count; 32 | } 33 | - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { 34 | UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"MainCellID"]; 35 | if (cell == nil) { 36 | cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:@"MainCellID"]; 37 | } 38 | cell.textLabel.text = _dataArr[indexPath.row]; 39 | return cell; 40 | } 41 | 42 | - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { 43 | 44 | [self performSegueWithIdentifier:_dataArr[indexPath.row] sender:self]; 45 | [tableView deselectRowAtIndexPath:indexPath animated:NO]; 46 | } 47 | 48 | - (void)didReceiveMemoryWarning { 49 | [super didReceiveMemoryWarning]; 50 | // Dispose of any resources that can be recreated. 51 | } 52 | #pragma mark ==== 测试 53 | //图像I/O 54 | - (void)testFuncWithImageView:(UIImageView *)imageView { 55 | UIImage *image = imageView.image; 56 | //UIGraphicsBeginImageContextWithOptions(<#CGSize size#>, <#BOOL opaque#>, <#CGFloat scale#>) 57 | UIGraphicsBeginImageContextWithOptions(imageView.bounds.size, YES, 0); 58 | [image drawInRect:imageView.bounds]; 59 | image = UIGraphicsGetImageFromCurrentImageContext(); 60 | UIGraphicsEndImageContext(); 61 | imageView.image = image; 62 | } 63 | 64 | 65 | 66 | @end 67 | -------------------------------------------------------------------------------- /NewUITest/NewUITest/NewHomeCell.m: -------------------------------------------------------------------------------- 1 | // 2 | // NewHomeCell.m 3 | // 银洲街新UI测试 4 | // 5 | // Created by apple on 16/2/17. 6 | // Copyright © 2016年 kun. All rights reserved. 7 | // 8 | 9 | #import "NewHomeCell.h" 10 | #import "DRLineProgressView.h" 11 | 12 | @interface NewHomeCell () 13 | 14 | /** 当前进度指示(当前版本不需要设置进度) */ 15 | @property (weak, nonatomic) IBOutlet DRLineProgressView *progressView; 16 | /** 利率 */ 17 | @property (weak, nonatomic) IBOutlet UILabel *yieldLabel; 18 | /** 起投金额 */ 19 | @property (weak, nonatomic) IBOutlet UILabel *beginAmountLabel; 20 | /** 投资期限 */ 21 | @property (weak, nonatomic) IBOutlet UILabel *investPeriodLabel; 22 | /** 剩余分数 */ 23 | @property (weak, nonatomic) IBOutlet UILabel *restNumLabel; 24 | //动态计算的宽高 25 | /** buyButton的宽 */ 26 | @property (weak, nonatomic) IBOutlet NSLayoutConstraint *width_buyButton; 27 | /** buyButton距离底部的高度 */ 28 | @property (weak, nonatomic) IBOutlet NSLayoutConstraint *bottom_buyButton; 29 | 30 | @end 31 | 32 | @implementation NewHomeCell 33 | 34 | - (void)awakeFromNib { 35 | // Initialization code 36 | CGFloat progressViewHeight = [UIScreen mainScreen].bounds.size.width * 3 /4 - 50; 37 | _progressView.backgroundColor = [UIColor clearColor];//[UIColor colorWithRed:(0.0 / 255.0) green:(151.0 / 255.0) blue:(224.0 / 255.0) alpha:1.0];//[UIColor clearColor]; 38 | _progressView.mDelegate = self; 39 | _progressView.radius = progressViewHeight/2-3; 40 | _progressView.innerRadius = progressViewHeight/2-3-12; 41 | _progressView.color = [UIColor clearColor];//RGB(0.0, 124.0, 188.0); 42 | _progressView.total = 72; 43 | _progressView.startAngle = M_PI * 0.72; 44 | _progressView.endAngle = M_PI * 2.32; 45 | _progressView.animationDuration = 0.75; 46 | _progressView.layer.shouldRasterize = YES; 47 | 48 | //动态改变 宽高 49 | self.width_buyButton.constant = self.width_buyButton.constant*[UIScreen mainScreen].bounds.size.width/320.0; 50 | self.bottom_buyButton.constant = self.bottom_buyButton.constant*[UIScreen mainScreen].bounds.size.width*3/4.0/240; 51 | } 52 | - (void)updateData:(NSObject *)model { 53 | /* 刷新进度 */ 54 | [_progressView setCompleted:1.0*_progressView.total animated:YES]; 55 | 56 | } 57 | 58 | - (IBAction)buyButtonClick:(UIButton *)sender { 59 | if ([self.mDelegate respondsToSelector:@selector(newHomeCell:clickAtBuyButton:)]) { 60 | [self.mDelegate newHomeCell:self clickAtBuyButton:sender]; 61 | } 62 | } 63 | 64 | 65 | 66 | - (void)setSelected:(BOOL)selected animated:(BOOL)animated { 67 | [super setSelected:selected animated:animated]; 68 | 69 | // Configure the view for the selected state 70 | } 71 | 72 | @end 73 | -------------------------------------------------------------------------------- /NewUITest/NewUITest/ProductViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ProductViewController.m 3 | // 银洲街新UI测试 4 | // 5 | // Created by apple on 16/2/23. 6 | // Copyright © 2016年 kun. All rights reserved. 7 | // 8 | 9 | #import "ProductViewController.h" 10 | #import "ProductProgressView.h" 11 | #import "ProductList_3Cell.h" 12 | 13 | @interface ProductViewController () 14 | 15 | @property (weak, nonatomic) IBOutlet UITableView *tableView; 16 | 17 | @end 18 | 19 | @implementation ProductViewController 20 | 21 | - (void)viewDidLoad { 22 | [super viewDidLoad]; 23 | 24 | self.automaticallyAdjustsScrollViewInsets = NO; 25 | 26 | } 27 | - (void)testFunc1 { 28 | ProductProgressView *pud3 = [[ProductProgressView alloc] initWithFrame:CGRectMake(150, 100, 42, 42)]; 29 | pud3.trackTintColor = [UIColor grayColor]; 30 | pud3.progressTintColor = [UIColor yellowColor]; 31 | /* 是否按照顺时针进行绘制 进度 */ 32 | pud3.clockwiseProgress = YES; 33 | pud3.progress = 0.36; 34 | pud3.bigCircleColor = [UIColor whiteColor]; 35 | [self.view addSubview:pud3]; 36 | } 37 | 38 | #pragma mark ==== UITableViewDelegate && UITableViewDataSouce 39 | - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { 40 | return 1; 41 | } 42 | - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { 43 | return 30; 44 | } 45 | - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath { 46 | return 120; 47 | } 48 | - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { 49 | ProductList_3Cell *cell = [tableView dequeueReusableCellWithIdentifier:@"ProdectList_3CellID"]; 50 | if (cell == nil) { 51 | cell = [[[NSBundle mainBundle] loadNibNamed:@"ProductList_3Cell" owner:self options:nil] lastObject]; 52 | } 53 | return cell; 54 | } 55 | - (void)tableView:(UITableView *)tableView willDisplayCell:(nonnull UITableViewCell *)cell forRowAtIndexPath:(nonnull NSIndexPath *)indexPath { 56 | //优化性能 在此方法中对 cell 进行填充操作 57 | ProductList_3Cell *pCell = (ProductList_3Cell *)cell; 58 | [pCell showProgress:(arc4random()%9+1)/10.0]; 59 | if (indexPath.row == 0) { 60 | [pCell showProgress:1.0]; 61 | }else { 62 | [pCell showProgress:(arc4random()%134+1)/135.0]; 63 | } 64 | } 65 | 66 | - (void)didReceiveMemoryWarning { 67 | [super didReceiveMemoryWarning]; 68 | // Dispose of any resources that can be recreated. 69 | } 70 | 71 | /* 72 | #pragma mark - Navigation 73 | 74 | // In a storyboard-based application, you will often want to do a little preparation before navigation 75 | - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { 76 | // Get the new view controller using [segue destinationViewController]. 77 | // Pass the selected object to the new view controller. 78 | } 79 | */ 80 | 81 | @end 82 | -------------------------------------------------------------------------------- /NewUITest/NewUITest/ProductList_3Cell.m: -------------------------------------------------------------------------------- 1 | // 2 | // ProductList_3Cell.m 3 | // 银洲街新UI测试 4 | // 5 | // Created by apple on 16/2/23. 6 | // Copyright © 2016年 kun. All rights reserved. 7 | // 8 | 9 | #import "ProductList_3Cell.h" 10 | #import "ProductProgressView.h" 11 | #import "DRSplitLineView.h" 12 | 13 | @interface ProductList_3Cell () 14 | 15 | /** 名称 */ 16 | @property (weak, nonatomic) IBOutlet UILabel *productNameLabel; 17 | /** 期限 */ 18 | @property (weak, nonatomic) IBOutlet UILabel *productDeadlineLabel; 19 | /** 安全保证 */ 20 | @property (weak, nonatomic) IBOutlet UIImageView *safetyMarkImg; 21 | /** 年化收益 */ 22 | @property (weak, nonatomic) IBOutlet UILabel *yieldLabel; 23 | /** 剩余份数 */ 24 | @property (weak, nonatomic) IBOutlet UILabel *restNumLabel; 25 | /** 起购金额 */ 26 | @property (weak, nonatomic) IBOutlet UILabel *beginAmountLabel; 27 | /** 进度指示 */ 28 | @property (weak, nonatomic) IBOutlet ProductProgressView *precentProgressView; 29 | /** 分割线 */ 30 | @property (weak, nonatomic) IBOutlet DRSplitLineView *splitLineView; 31 | 32 | //动态计算行间距 33 | @property (strong, nonatomic) IBOutletCollection(NSLayoutConstraint) NSArray *space_labelsArr; 34 | 35 | 36 | @end 37 | 38 | @implementation ProductList_3Cell 39 | 40 | - (void)awakeFromNib { 41 | 42 | self.splitLineView.lineColor = [UIColor colorWithRed:100/255.0 green:100/255.0 blue:100/255.0 alpha:1]; 43 | self.splitLineView.splitWidth = 6.0; 44 | 45 | //动态计算出间距 46 | for (NSLayoutConstraint *constraint in self.space_labelsArr) { 47 | CGFloat spaceValue = ([UIScreen mainScreen].bounds.size.width-15-15-20-42)*constraint.constant/(320-15-15-20-42); 48 | NSInteger spaceIntValue = ceil(spaceValue); 49 | constraint.constant = spaceIntValue; 50 | } 51 | } 52 | 53 | 54 | - (void)showProgress:(CGFloat)currentProgress { 55 | if (currentProgress == 1.0) { 56 | self.precentProgressView.trackTintColor = [UIColor colorWithRed:100/255.0 green:100/255.0 blue:100/255.0 alpha:1]; 57 | self.precentProgressView.progressTintColor = [UIColor clearColor]; 58 | self.precentProgressView.clockwiseProgress = YES; 59 | self.precentProgressView.bigCircleColor = [UIColor whiteColor]; 60 | self.precentProgressView.bigVircleWidth = 1.5; 61 | }else { 62 | self.precentProgressView.trackTintColor = [UIColor clearColor]; 63 | self.precentProgressView.progressTintColor = [UIColor colorWithRed:219/255.0 green:29/255.0 blue:10/255.0 alpha:1]; 64 | self.precentProgressView.clockwiseProgress = YES; 65 | self.precentProgressView.bigCircleColor = [UIColor colorWithRed:219/255.0 green:29/255.0 blue:10/255.0 alpha:1]; 66 | self.precentProgressView.bigVircleWidth = 1.0; 67 | } 68 | self.precentProgressView.progress = currentProgress; 69 | 70 | } 71 | 72 | - (void)setSelected:(BOOL)selected animated:(BOOL)animated { 73 | [super setSelected:selected animated:animated]; 74 | 75 | // Configure the view for the selected state 76 | } 77 | 78 | @end 79 | -------------------------------------------------------------------------------- /NewUITest/NewUITest/OrderList_3Cell.m: -------------------------------------------------------------------------------- 1 | // 2 | // OrderList_3Cell.m 3 | // 银洲街新UI测试 4 | // 5 | // Created by apple on 16/2/24. 6 | // Copyright © 2016年 kun. All rights reserved. 7 | // 8 | 9 | #import "OrderList_3Cell.h" 10 | #import "ProductProgressView.h" 11 | 12 | @interface OrderList_3Cell () 13 | 14 | /** 订单编号 */ 15 | @property (weak, nonatomic) IBOutlet UILabel *orderNumberLabel; 16 | /** 订单金额 */ 17 | @property (weak, nonatomic) IBOutlet UILabel *orderAmountLabel; 18 | /** 预期收益 */ 19 | @property (weak, nonatomic) IBOutlet UILabel *expectEarningLabel; 20 | /** 下单时间 */ 21 | @property (weak, nonatomic) IBOutlet UILabel *orderTimeLabel; 22 | /** 标示订单状态的背景 */ 23 | @property (weak, nonatomic) IBOutlet ProductProgressView *statusView; 24 | /** 标记订单的状态 */ 25 | @property (weak, nonatomic) IBOutlet UILabel *statusLabel; 26 | /** 订单状态详情说明 */ 27 | @property (weak, nonatomic) IBOutlet UILabel *statusInfoLabel; 28 | 29 | @end 30 | 31 | @implementation OrderList_3Cell 32 | 33 | - (void)awakeFromNib { 34 | self.statusView.trackTintColor = [UIColor colorWithRed:191/255.0 green:191/255.0 blue:191/255.0 alpha:1]; 35 | self.statusView.progressTintColor = [UIColor clearColor]; 36 | self.statusView.progress = 1.0; 37 | self.statusView.bigCircleColor = [UIColor whiteColor]; 38 | self.statusView.bigVircleWidth = 1.5; 39 | self.statusLabel.text = @"下单失败"; 40 | } 41 | - (void)showDataWithModel:(id)model { 42 | switch ([[model objectForKey:@"status"] integerValue]) { 43 | case 10: 44 | { 45 | self.statusView.trackTintColor = [UIColor colorWithRed:253/255.0 green:0 blue:0 alpha:1]; 46 | self.statusLabel.text = @"已起息"; 47 | } 48 | break; 49 | case 20: 50 | { 51 | self.statusView.trackTintColor = [UIColor colorWithRed:78/255.0 green:168/255.0 blue:221/255.0 alpha:1]; 52 | self.statusLabel.text = @"付款中"; 53 | } 54 | break; 55 | case 30: 56 | { 57 | self.statusView.trackTintColor = [UIColor colorWithRed:113/255.0 green:168/255.0 blue:89/255.0 alpha:1]; 58 | self.statusLabel.text = @"已结息"; 59 | } 60 | break; 61 | case 40: 62 | { 63 | self.statusView.trackTintColor = [UIColor colorWithRed:191/255.0 green:191/255.0 blue:191/255.0 alpha:1]; 64 | if (arc4random()%2) { 65 | self.statusLabel.text = @"已结束"; 66 | }else { 67 | self.statusLabel.text = @"下单失败"; 68 | } 69 | } 70 | break; 71 | default: 72 | break; 73 | } 74 | 75 | self.orderNumberLabel.text = [model objectForKey:@"orderNum"]; 76 | } 77 | //- (void)colorsForStatusView { 78 | // UIColor *huise = [UIColor colorWithRed:191/255.0 green:191/255.0 blue:191/255.0 alpha:1]; 79 | // UIColor *hongse = [UIColor colorWithRed:253/255.0 green:0 blue:0 alpha:1]; 80 | // UIColor *lanse = [UIColor colorWithRed:78/255.0 green:168/255.0 blue:221/255.0 alpha:1]; 81 | // UIColor *lvse = [UIColor colorWithRed:113/255.0 green:168/255.0 blue:89/255.0 alpha:1]; 82 | //} 83 | 84 | - (void)setSelected:(BOOL)selected animated:(BOOL)animated { 85 | [super setSelected:selected animated:animated]; 86 | 87 | // Configure the view for the selected state 88 | } 89 | 90 | @end 91 | -------------------------------------------------------------------------------- /NewUITest/NewUITest/DRLineProgressLayer.m: -------------------------------------------------------------------------------- 1 | // 2 | // DRLineProgressLayer.m 3 | // DRLineProgress 4 | // 5 | // Created by apple on 16/3/1. 6 | // Copyright © 2016年 kun. All rights reserved. 7 | // 8 | 9 | #import "DRLineProgressLayer.h" 10 | 11 | @implementation DRLineProgressLayer 12 | 13 | - (id)initWithLayer:(id)layer { 14 | self = [super initWithLayer:layer]; 15 | if (self) { 16 | if ([layer isKindOfClass:[DRLineProgressLayer class]]) { 17 | DRLineProgressLayer *other = layer; 18 | self.total = other.total; 19 | self.color = other.color; 20 | self.completed = other.completed; 21 | self.completedColor = other.completedColor; 22 | self.radius = other.radius; 23 | self.innerRadius = other.innerRadius; 24 | self.startAngle = other.startAngle; 25 | self.endAngle = other.endAngle; 26 | self.shouldRasterize = YES; 27 | } 28 | } 29 | return self; 30 | } 31 | 32 | + (id)layer { 33 | DRLineProgressLayer *result = [[DRLineProgressLayer alloc] init]; 34 | return result; 35 | } 36 | 37 | + (BOOL)needsDisplayForKey:(NSString *)key { 38 | if ([key isEqualToString:@"completed"]) { 39 | return YES; 40 | } 41 | return [super needsDisplayForKey:key]; 42 | } 43 | 44 | - (void)drawInContext:(CGContextRef)contextRef { 45 | // CGFloat originalRadius = _radius; 46 | CGFloat totalAngle = _endAngle - _startAngle; 47 | CGRect rect = self.bounds; 48 | CGPoint cP = CGPointMake(rect.size.width/2, rect.size.height/2); 49 | CGContextSetLineJoin(contextRef, kCGLineJoinRound); 50 | CGContextSetFlatness(contextRef, 2.0); 51 | CGContextSetAllowsAntialiasing(contextRef, true); 52 | CGContextSetShouldAntialias(contextRef, true); 53 | CGContextSetInterpolationQuality(contextRef, kCGInterpolationHigh); 54 | CGContextSetLineWidth(contextRef,2.0f); //设置线条宽度 55 | 56 | for (int i = 0; i < _total; i++) { 57 | //计算初始点 58 | CGFloat x0 = cP.x + cosf(_startAngle + totalAngle*i/_total)*_innerRadius; 59 | CGFloat y0 = cP.y + sinf(_startAngle + totalAngle*i/_total)*_innerRadius; 60 | CGContextMoveToPoint(contextRef, x0, y0); 61 | //计算终点 62 | CGFloat x = cP.x + cosf(_startAngle + totalAngle*i/_total)*_radius; 63 | CGFloat y = cP.y + sinf(_startAngle + totalAngle*i/_total)*_radius; 64 | //画线 65 | CGContextAddLineToPoint(contextRef, x, y); 66 | //设置颜色 67 | CGContextSetStrokeColorWithColor(contextRef, _color.CGColor); 68 | CGContextSetFillColorWithColor(contextRef, _color.CGColor); 69 | CGContextDrawPath(contextRef, kCGPathFillStroke); 70 | } 71 | for (int i = 0; i < _completed; i++) { 72 | CGFloat x0 = cP.x + cosf(_startAngle + totalAngle*i/_total)*_innerRadius; 73 | CGFloat y0 = cP.y + sinf(_startAngle + totalAngle*i/_total)*_innerRadius; 74 | CGContextMoveToPoint(contextRef, x0, y0); 75 | CGFloat x = cP.x + cosf(_startAngle + totalAngle*i/_total)*_radius; 76 | CGFloat y = cP.y + sinf(_startAngle + totalAngle*i/_total)*_radius; 77 | CGContextAddLineToPoint(contextRef, x, y); 78 | CGContextSetStrokeColorWithColor(contextRef, _completedColor.CGColor); //设置颜色 79 | CGContextSetFillColorWithColor(contextRef, _completedColor.CGColor); 80 | CGContextDrawPath(contextRef, kCGPathFillStroke); 81 | } 82 | } 83 | 84 | 85 | @end 86 | -------------------------------------------------------------------------------- /NewUITest/NewUITest/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // 银洲街新UI测试 4 | // 5 | // Created by apple on 16/2/17. 6 | // Copyright © 2016年 kun. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | 11 | #define DRRGBA(r,g,b,a) \ 12 | [UIColor colorWithRed:r/255.0f green:g/255.0f blue:b/255.0f alpha:a] 13 | 14 | #define DRRGB(r,g,b) \ 15 | DRRGBA(r,g,b,1) 16 | 17 | @interface AppDelegate () 18 | 19 | @end 20 | 21 | @implementation AppDelegate 22 | 23 | /** 24 | * @brief 根据颜色生成纯色图片 25 | * 26 | * @param color 颜色 27 | * 28 | * @return 纯色图片 29 | */ 30 | - (UIImage *)dr_imageWithColor:(UIColor *)color { 31 | CGRect rect = CGRectMake(0.0f, 0.0f, 1.0f, 1.0f); 32 | UIGraphicsBeginImageContext(rect.size); 33 | CGContextRef context = UIGraphicsGetCurrentContext(); 34 | CGContextSetFillColorWithColor(context, [color CGColor]); 35 | CGContextFillRect(context, rect); 36 | UIImage *image = UIGraphicsGetImageFromCurrentImageContext(); 37 | UIGraphicsEndImageContext(); 38 | return image; 39 | } 40 | 41 | - (void)initNavigationBar { 42 | [[UINavigationBar appearance] setTranslucent:NO]; 43 | [[UINavigationBar appearance] setBarTintColor:DRRGB(74.0f, 74.0f, 74.0f)]; 44 | [[UINavigationBar appearance] setTintColor:[UIColor whiteColor]]; 45 | 46 | UIImage *image = [self dr_imageWithColor:DRRGB(74.0f, 74.0f, 74.0f)]; 47 | [[UINavigationBar appearance] setBackgroundImage:image 48 | forBarPosition:UIBarPositionAny 49 | barMetrics:UIBarMetricsDefault]; 50 | [[UINavigationBar appearance] setShadowImage:[UIImage new]]; 51 | 52 | [[UINavigationBar appearance] setTitleTextAttributes:@{ 53 | NSForegroundColorAttributeName: [UIColor whiteColor], 54 | NSFontAttributeName: [UIFont systemFontOfSize:20.0f] 55 | } 56 | ]; 57 | } 58 | 59 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 60 | // Override point for customization after application launch. 61 | [self initNavigationBar]; 62 | return YES; 63 | } 64 | 65 | - (void)applicationWillResignActive:(UIApplication *)application { 66 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 67 | // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. 68 | } 69 | 70 | - (void)applicationDidEnterBackground:(UIApplication *)application { 71 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 72 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 73 | } 74 | 75 | - (void)applicationWillEnterForeground:(UIApplication *)application { 76 | // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. 77 | } 78 | 79 | - (void)applicationDidBecomeActive:(UIApplication *)application { 80 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 81 | } 82 | 83 | - (void)applicationWillTerminate:(UIApplication *)application { 84 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 85 | } 86 | 87 | @end 88 | -------------------------------------------------------------------------------- /NewUITest/NewUITest.xcodeproj/xcuserdata/liyakun.xcuserdatad/xcschemes/NewUITest.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 33 | 39 | 40 | 41 | 43 | 49 | 50 | 51 | 52 | 53 | 59 | 60 | 61 | 62 | 63 | 64 | 74 | 76 | 82 | 83 | 84 | 85 | 86 | 87 | 93 | 95 | 101 | 102 | 103 | 104 | 106 | 107 | 110 | 111 | 112 | -------------------------------------------------------------------------------- /NewUITest/NewUITest/DRLineProgressView.m: -------------------------------------------------------------------------------- 1 | // 2 | // DRLineProgressView.m 3 | // DRLineProgress 4 | // 5 | // Created by apple on 16/3/1. 6 | // Copyright © 2016年 kun. All rights reserved. 7 | // 8 | 9 | #import "DRLineProgressView.h" 10 | #import "DRLineProgressLayer.h" 11 | 12 | @implementation DRLineProgressView 13 | 14 | - (id)initWithFrame:(CGRect)frame { 15 | self = [super initWithFrame:frame]; 16 | if (self) { 17 | [self _defaultInit]; 18 | } 19 | return self; 20 | } 21 | 22 | - (id)initWithCoder:(NSCoder *)aDecoder { 23 | self = [super initWithCoder:aDecoder]; 24 | if (self) { 25 | [self _defaultInit]; 26 | } 27 | return self; 28 | } 29 | 30 | - (id)init { 31 | self = [super init]; 32 | if (self) { 33 | [self _defaultInit]; 34 | } 35 | return self; 36 | } 37 | 38 | - (void)_defaultInit { 39 | self.backgroundColor = [UIColor clearColor]; 40 | self.opaque = NO; 41 | 42 | self.total = 100; 43 | self.color = [UIColor clearColor]; 44 | self.completed = 0; 45 | self.completedColor = [UIColor whiteColor]; 46 | 47 | self.radius = 30.0; 48 | self.innerRadius = 20.0; 49 | 50 | self.startAngle = 0; 51 | self.endAngle = M_PI*2; 52 | } 53 | 54 | + (Class)layerClass { 55 | return [DRLineProgressLayer class]; 56 | } 57 | 58 | - (void)setTotal:(int)total 59 | { 60 | _total = total; 61 | 62 | DRLineProgressLayer *layer = (DRLineProgressLayer *)self.layer; 63 | layer.total = total; 64 | [layer setNeedsDisplay]; 65 | } 66 | 67 | - (void)setColor:(UIColor *)color { 68 | _color = color; 69 | 70 | DRLineProgressLayer *layer = (DRLineProgressLayer *)self.layer; 71 | layer.color = color; 72 | [layer setNeedsDisplay]; 73 | } 74 | 75 | - (void)setCompletedColor:(UIColor *)completedColor { 76 | _completedColor = completedColor; 77 | 78 | DRLineProgressLayer *layer = (DRLineProgressLayer *)self.layer; 79 | layer.completedColor = completedColor; 80 | [layer setNeedsDisplay]; 81 | } 82 | 83 | -(void)setCompleted:(int)completed { 84 | [self setCompleted:completed animated:NO]; 85 | } 86 | 87 | - (void)setCompleted:(int)completed animated:(BOOL)animated { 88 | if (completed == self.completed) { 89 | return; 90 | } 91 | 92 | DRLineProgressLayer *layer = (DRLineProgressLayer *)self.layer; 93 | if (animated && self.animationDuration > 0.0f) { 94 | CABasicAnimation *animation = [CABasicAnimation animationWithKeyPath:@"completed"]; 95 | animation.duration = self.animationDuration; 96 | animation.fromValue = [NSNumber numberWithFloat:self.completed]; 97 | animation.toValue = [NSNumber numberWithFloat:completed]; 98 | animation.delegate = self; 99 | [self.layer addAnimation:animation forKey:@"currentAnimation"]; 100 | } 101 | layer.completed = completed; 102 | [layer setNeedsDisplay]; 103 | } 104 | 105 | 106 | - (void)setRadius:(CGFloat)radius { 107 | _radius = radius; 108 | 109 | DRLineProgressLayer *layer = (DRLineProgressLayer *)self.layer; 110 | layer.radius = radius; 111 | [layer setNeedsDisplay]; 112 | } 113 | 114 | - (void)setInnerRadius:(CGFloat)innerRadius { 115 | _innerRadius = innerRadius; 116 | DRLineProgressLayer *layer = (DRLineProgressLayer *)self.layer; 117 | layer.innerRadius = innerRadius; 118 | [layer setNeedsDisplay]; 119 | } 120 | 121 | - (void)setStartAngle:(CGFloat)startAngle { 122 | _startAngle = startAngle; 123 | 124 | DRLineProgressLayer *layer = (DRLineProgressLayer *)self.layer; 125 | layer.startAngle = startAngle; 126 | [layer setNeedsDisplay]; 127 | } 128 | 129 | - (void)setEndAngle:(CGFloat)endAngle { 130 | _endAngle = endAngle; 131 | 132 | DRLineProgressLayer *layer = (DRLineProgressLayer *)self.layer; 133 | layer.endAngle = endAngle; 134 | [layer setNeedsDisplay]; 135 | } 136 | 137 | - (void)setAnimationDuration:(CFTimeInterval)animationDuration { 138 | _animationDuration = animationDuration; 139 | DRLineProgressLayer *layer = (DRLineProgressLayer *)self.layer; 140 | layer.animationDuration = animationDuration; 141 | [layer setNeedsDisplay]; 142 | } 143 | 144 | #pragma mark - CAAnimationDelegate 145 | 146 | - (void)animationDidStart:(CAAnimation *)anim 147 | { 148 | if (self.mDelegate && [self.mDelegate respondsToSelector:@selector(LineProgressViewAnimationDidStart:)]) { 149 | [self.mDelegate LineProgressViewAnimationDidStart:self]; 150 | } 151 | } 152 | 153 | - (void)animationDidStop:(CAAnimation *)anim finished:(BOOL)flag 154 | { 155 | if (self.mDelegate && [self.mDelegate respondsToSelector:@selector(LineProgressViewAnimationDidStop:)]) { 156 | [self.mDelegate LineProgressViewAnimationDidStop:self]; 157 | } 158 | } 159 | 160 | @end 161 | 162 | -------------------------------------------------------------------------------- /NewUITest/NewUITest/OrderListViewController.m: -------------------------------------------------------------------------------- 1 | 2 | // 3 | // OrderListViewController.m 4 | // 银洲街新UI测试 5 | // 6 | // Created by apple on 16/2/24. 7 | // Copyright © 2016年 kun. All rights reserved. 8 | // 9 | 10 | #import "OrderListViewController.h" 11 | #import "OrderList_3Cell.h" 12 | 13 | @interface OrderListViewController () 14 | 15 | @property (weak, nonatomic) IBOutlet UITableView *tableView; 16 | 17 | @end 18 | 19 | @implementation OrderListViewController 20 | 21 | - (void)viewDidLoad { 22 | [super viewDidLoad]; 23 | [self setupRightnavigationItem]; 24 | self.automaticallyAdjustsScrollViewInsets = NO; 25 | } 26 | 27 | - (void)setupRightnavigationItem { 28 | UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom]; 29 | [button setTitle:@"截屏" forState:UIControlStateNormal]; 30 | [button sizeToFit]; 31 | [button addTarget:self action:@selector(buttonClick:) forControlEvents:UIControlEventTouchUpInside]; 32 | UIBarButtonItem *item = [[UIBarButtonItem alloc] initWithCustomView:button]; 33 | self.navigationItem.rightBarButtonItem = item; 34 | 35 | } 36 | 37 | /** 38 | * 截ScrollView的全部屏 39 | */ 40 | - (UIImage *)screenShot:(UIScrollView *)scrollView { 41 | UIImage* image = nil; 42 | UIGraphicsBeginImageContextWithOptions(scrollView.contentSize, YES, [UIScreen mainScreen].scale); 43 | 44 | //保存ScrollView当前的偏移量 45 | CGPoint savedContentOffset = scrollView.contentOffset; 46 | CGRect saveFrame = scrollView.frame; 47 | 48 | //将ScrollView的偏移量设置为(0,0) 49 | scrollView.contentOffset = CGPointZero; 50 | scrollView.frame = CGRectMake(0, 0, scrollView.contentSize.width,scrollView.contentSize.height); 51 | 52 | //在当前上下文中渲染出ScrollView 53 | [scrollView.layer renderInContext: UIGraphicsGetCurrentContext()]; 54 | //截取当前上下文生成Image 55 | image = UIGraphicsGetImageFromCurrentImageContext(); 56 | 57 | //恢复ScrollView的偏移量 58 | scrollView.contentOffset = savedContentOffset; 59 | scrollView.frame = saveFrame; 60 | 61 | UIGraphicsEndImageContext(); 62 | 63 | if (image != nil) { 64 | return image; 65 | } 66 | 67 | return nil; 68 | } 69 | /** 70 | * 点击按钮截屏 71 | */ 72 | - (void)buttonClick:(id)sender { 73 | 74 | UIImage *screenImage = [self screenShot:self.tableView]; 75 | [self tapSaveImageToIphone:screenImage]; 76 | } 77 | 78 | /** 79 | * 保存到系统相册 80 | */ 81 | - (void)tapSaveImageToIphone:(UIImage *)image{ 82 | 83 | /** 84 | * 将图片保存到iPhone本地相册 85 | * UIImage *image 图片对象 86 | * id completionTarget 响应方法对象 87 | * SEL completionSelector 方法 88 | * void *contextInfo 89 | */ 90 | UIImageWriteToSavedPhotosAlbum(image, self, @selector(image:didFinishSavingWithError:contextInfo:), nil); 91 | 92 | } 93 | 94 | - (void)image:(UIImage *)image didFinishSavingWithError:(NSError *)error contextInfo:(void *)contextInfo 95 | { 96 | if (error != NULL) { 97 | NSLog(@"%@",error); 98 | NSLog(@"保存失败"); 99 | } else { 100 | NSLog(@"截图成功,请求相册查看"); 101 | } 102 | } 103 | 104 | #pragma mark ===== UITabelViewDelegate && UITableViewDataSouce 105 | - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { 106 | return 1; 107 | } 108 | - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { 109 | return 30; 110 | } 111 | - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath { 112 | return 136; 113 | } 114 | - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { 115 | OrderList_3Cell *cell = [tableView dequeueReusableCellWithIdentifier:@"OrderList_3CellID"]; 116 | if (cell == nil) { 117 | cell = [[[NSBundle mainBundle] loadNibNamed:@"OrderList_3Cell" owner:self options:nil] lastObject]; 118 | } 119 | return cell; 120 | } 121 | - (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath { 122 | NSInteger statusValue = (indexPath.row % 4 + 1) * 10; 123 | NSString *orderNum = [NSString stringWithFormat:@"%ld",1001+indexPath.row]; 124 | NSDictionary *dict = @{@"status":@(statusValue),@"orderNum":orderNum}; 125 | OrderList_3Cell *oCell = (OrderList_3Cell *)cell; 126 | [oCell showDataWithModel:dict]; 127 | } 128 | 129 | - (void)didReceiveMemoryWarning { 130 | [super didReceiveMemoryWarning]; 131 | // Dispose of any resources that can be recreated. 132 | } 133 | 134 | /* 135 | #pragma mark - Navigation 136 | 137 | // In a storyboard-based application, you will often want to do a little preparation before navigation 138 | - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { 139 | // Get the new view controller using [segue destinationViewController]. 140 | // Pass the selected object to the new view controller. 141 | } 142 | */ 143 | 144 | @end 145 | -------------------------------------------------------------------------------- /NewUITest/NewUITest.xcodeproj/xcuserdata/apple.xcuserdatad/xcschemes/银洲街新UI测试.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 33 | 39 | 40 | 41 | 43 | 49 | 50 | 51 | 52 | 53 | 59 | 60 | 61 | 62 | 63 | 64 | 74 | 76 | 82 | 83 | 84 | 85 | 86 | 87 | 93 | 95 | 101 | 102 | 103 | 104 | 106 | 107 | 110 | 111 | 112 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # NewUITest 2 | 动画,进度指示,绘图 3 | 4 | ####自己写的2个进度指示 5 | 6 | 1、DRLineProgressView 和 DRLineProgressLayer 用到了绘图的知识 7 | 8 | 头文件如下,有兴趣的可以改用 _CAShaperLayer_ 改写 9 | 10 | ``` 11 | @interface DRLineProgressLayer : CALayer 12 | /** 总共的线条数 */ 13 | @property (nonatomic,assign) int total; 14 | @property (nonatomic,strong) UIColor *color; 15 | /** 完成的个数 */ 16 | @property (nonatomic,assign) int completed; 17 | @property (nonatomic,strong) UIColor *completedColor; 18 | /** 外半径和内半径共同决定每个进度条的长度 */ 19 | @property (nonatomic,assign) CGFloat radius; 20 | @property (nonatomic,assign) CGFloat innerRadius; 21 | /** 开始和结束的角度 (关于绘图时 开始角度 0 的起始点 为右顶点) */ 22 | @property CGFloat startAngle; 23 | @property CGFloat endAngle; 24 | 25 | @property (nonatomic, assign) CFTimeInterval animationDuration; 26 | 27 | @end 28 | 29 | ``` 30 | 31 | *核心代码* 32 | 33 | ``` 34 | - (void)drawInContext:(CGContextRef)contextRef { 35 | // CGFloat originalRadius = _radius; 36 | CGFloat totalAngle = _endAngle - _startAngle; 37 | CGRect rect = self.bounds; 38 | CGPoint cP = CGPointMake(rect.size.width/2, rect.size.height/2); 39 | CGContextSetLineJoin(contextRef, kCGLineJoinRound); 40 | CGContextSetFlatness(contextRef, 2.0); 41 | CGContextSetAllowsAntialiasing(contextRef, true); 42 | CGContextSetShouldAntialias(contextRef, true); 43 | CGContextSetInterpolationQuality(contextRef, kCGInterpolationHigh); 44 | CGContextSetLineWidth(contextRef,2.0f); //设置线条宽度 45 | 46 | for (int i = 0; i < _total; i++) { 47 | //计算初始点 48 | CGFloat x0 = cP.x + cosf(_startAngle + totalAngle*i/_total)*_innerRadius; 49 | CGFloat y0 = cP.y + sinf(_startAngle + totalAngle*i/_total)*_innerRadius; 50 | CGContextMoveToPoint(contextRef, x0, y0); 51 | //计算终点 52 | CGFloat x = cP.x + cosf(_startAngle + totalAngle*i/_total)*_radius; 53 | CGFloat y = cP.y + sinf(_startAngle + totalAngle*i/_total)*_radius; 54 | //画线 55 | CGContextAddLineToPoint(contextRef, x, y); 56 | //设置颜色 57 | CGContextSetStrokeColorWithColor(contextRef, _color.CGColor); 58 | CGContextSetFillColorWithColor(contextRef, _color.CGColor); 59 | //设置线条起点和终点的状态 (例如:圆角) 60 | //CGContextSetLineCap(contextRef, kCGLineCapRound); 61 | CGContextDrawPath(contextRef, kCGPathFillStroke); 62 | } 63 | //在这里你可以 对最后绘制出来的那条已完成的线条所在位置进行自己定制 (例如:绘制一个圆环标示一下) 64 | for (int i = 0; i < _completed; i++) { 65 | CGFloat x0 = cP.x + cosf(_startAngle + totalAngle*i/_total)*_innerRadius; 66 | CGFloat y0 = cP.y + sinf(_startAngle + totalAngle*i/_total)*_innerRadius; 67 | CGContextMoveToPoint(contextRef, x0, y0); 68 | CGFloat x = cP.x + cosf(_startAngle + totalAngle*i/_total)*_radius; 69 | CGFloat y = cP.y + sinf(_startAngle + totalAngle*i/_total)*_radius; 70 | CGContextAddLineToPoint(contextRef, x, y); 71 | CGContextSetStrokeColorWithColor(contextRef, _completedColor.CGColor); //设置颜色 72 | CGContextSetFillColorWithColor(contextRef, _completedColor.CGColor); 73 | CGContextDrawPath(contextRef, kCGPathFillStroke); 74 | } 75 | // CAShapeLayer *shapeLayer ; 76 | // [shapeLayer setLineCap:kCALineCapRound]; 77 | } 78 | ``` 79 | 80 | *绘图起始0角度如图,后面请参考此图* 81 | 82 | ![角度计算.png](https://ooo.0o0.ooo/2016/03/01/56d53f8cb0a11.png) 83 | 84 | 85 | DRLineProgressView 如下图所示 86 | 87 | ![DRProgressView.gif](https://ooo.0o0.ooo/2016/03/01/56d5408cbda39.gif) 88 | 89 | 90 | 2、ProducProgressView 91 | 92 | 核心代码 93 | 94 | ``` 95 | -(void)drawInContext:(CGContextRef)ctx { 96 | CGRect rect = self.bounds; 97 | CGPoint centerPoint = CGPointMake(rect.size.width / 2.0f, rect.size.height / 2.0f); 98 | CGFloat radius = MIN(rect.size.height-innerSpacing, rect.size.width-innerSpacing) / 2.0f; 99 | CGFloat bigRadius = MIN(rect.size.height, rect.size.width) / 2.0f; 100 | 101 | BOOL clockwise = (self.clockwiseProgress != 0); 102 | //FLT_EPSILON 表示误差值(由编译器和CUP等决定) (可以看做 0.0) 103 | CGFloat progress = MIN(self.progress, 1.0f - FLT_EPSILON); 104 | CGFloat radians = 0; 105 | //这里要注意 画图的 角度开始点是在水平方向右顶点 106 | if (clockwise) { 107 | radians = (float)((progress * 2.0f * M_PI) - M_PI_2); 108 | } else { 109 | radians = (float)(3 * M_PI_2 - (progress * 2.0f * M_PI)); 110 | } 111 | CGContextSetFillColorWithColor(ctx, self.trackTintColor.CGColor); 112 | CGMutablePathRef trackPath = CGPathCreateMutable(); 113 | CGPathMoveToPoint(trackPath, NULL, centerPoint.x, centerPoint.y); 114 | CGPathAddArc(trackPath, NULL, centerPoint.x, centerPoint.y, bigRadius, (float)(2.0f * M_PI), 0.0f, TRUE); 115 | CGPathCloseSubpath(trackPath); 116 | CGContextAddPath(ctx, trackPath); 117 | CGContextFillPath(ctx); 118 | CGPathRelease(trackPath); 119 | 120 | if (progress > 0.0f) { 121 | CGContextSetFillColorWithColor(ctx, self.progressTintColor.CGColor); 122 | CGMutablePathRef progressPath = CGPathCreateMutable(); 123 | CGPathMoveToPoint(progressPath, NULL, centerPoint.x, centerPoint.y); 124 | CGPathAddArc(progressPath, NULL, centerPoint.x, centerPoint.y, radius, (float)(3.0f * M_PI_2), radians, !clockwise); 125 | CGPathCloseSubpath(progressPath); 126 | CGContextAddPath(ctx, progressPath); 127 | CGContextFillPath(ctx); 128 | CGPathRelease(progressPath); 129 | } 130 | 131 | //画出外边的圆环 132 | CGContextSetStrokeColorWithColor(ctx, self.bigCircleColor.CGColor); 133 | CGMutablePathRef bigCirclePath = CGPathCreateMutable(); 134 | CGPathAddEllipseInRect(bigCirclePath, NULL, CGRectMake(2, 2, self.bounds.size.width-4, self.bounds.size.height-4)); 135 | CGContextAddPath(ctx, bigCirclePath); 136 | CGContextSetLineWidth(ctx, self.bigCircleWidth); 137 | CGContextStrokePath(ctx); 138 | CGPathRelease(bigCirclePath); 139 | // NSInteger fff = ceil(2.5); //取整的方法 140 | // NSLog(@"%ld",(long)fff); 141 | } 142 | ``` 143 | 效果图如下 144 | 145 | ![ProdProgressView.gif](https://ooo.0o0.ooo/2016/03/01/56d54170ed0e4.gif) 146 | 147 | ###自己写的分割线 从此告别UI切图拉伸 148 | 149 | DRSplitLineView核心代码如下 用了 *UIBezierPath*和 _CAShapeLayer_ 结合来实现的 150 | 151 | ``` 152 | - (void)drawRect:(CGRect)rect { 153 | //计算总共的分割点 154 | CGFloat vWidth = CGRectGetWidth(rect); 155 | CGFloat yPoint = CGRectGetMidY(rect); 156 | CGFloat amount = vWidth/(self.splitWidth? :6.0); 157 | //向后取整数 158 | int behindPoint = (int)amount; 159 | UIBezierPath *bezierPath = [UIBezierPath bezierPath]; 160 | for (int i = 0; i < behindPoint; i++) { 161 | [bezierPath moveToPoint:CGPointMake(i*_splitWidth, yPoint)]; 162 | if (i == behindPoint) {//奇数个点画到末尾 163 | [bezierPath addLineToPoint:CGPointMake(CGRectGetMaxX(rect), yPoint)]; 164 | break; 165 | } 166 | [bezierPath addLineToPoint:CGPointMake(++i*_splitWidth, yPoint)]; 167 | if (i == behindPoint) {//偶数个点画到最后一个点 168 | break; 169 | } 170 | } 171 | self.shapeLayer.path = bezierPath.CGPath; 172 | self.shapeLayer.lineWidth = 1; 173 | self.shapeLayer.strokeColor = self.lineColor.CGColor; 174 | } 175 | ``` 176 | 177 | 效果图如 *ProductProgreView* 效果图中的 分割线 178 | 179 | ###浅浅的说下动画 180 | 181 | 参考 DRLineProgressLayer 中的 方法 182 | 183 | ``` 184 | + (BOOL)needsDisplayForKey:(NSString *)key { 185 | if ([key isEqualToString:@"completed"]) { 186 | return YES; 187 | } 188 | return [super needsDisplayForKey:key]; 189 | } 190 | ``` 191 | 这样你就可以对自己定义的*属性*进行添加动画效果了 但是注意:如果覆盖了 CALayer 中已有的属性 例如 *progress* 属性,那么在 .m 文件中拟具有必要 添加 如下代码: 192 | 193 | ``` 194 | @dynamic progress; 195 | ``` 196 | 具体原因请自查 *@dynamic的用法* 197 | 198 | ###最不重要的 199 | 200 | 这个Demo用StoryBoard完成的 仅仅根据屏幕适配了 view 的大小 和各 view 的间距,并没有去根据 屏幕来变大或缩小字体 201 | -------------------------------------------------------------------------------- /NewUITest/NewUITest/ProductProgressView.m: -------------------------------------------------------------------------------- 1 | // 2 | // ProductProgressView.m 3 | // 银洲街新UI测试 4 | // 5 | // Created by apple on 16/2/23. 6 | // Copyright © 2016年 kun. All rights reserved. 7 | // 8 | 9 | #import "ProductProgressView.h" 10 | 11 | const CGFloat innerSpacing = 8; 12 | 13 | @interface ProductProgressLayer : CALayer 14 | 15 | /** 圆环的背景色 */ 16 | @property(nonatomic, strong) UIColor *trackTintColor; 17 | /** 当前进度的颜色 */ 18 | @property(nonatomic, strong) UIColor *progressTintColor; 19 | /** 圆环的粗细 */ 20 | @property (nonatomic) CGFloat bigCircleWidth; 21 | /** 圆环的颜色 */ 22 | @property (nonatomic, strong) UIColor *bigCircleColor; 23 | /** 当前进度值 0.0~1.0 之间 */ 24 | @property(nonatomic) CGFloat progress; 25 | /** 是否顺时针 0标示逆时针 !0标示是顺时针 */ 26 | @property(nonatomic) NSInteger clockwiseProgress; 27 | 28 | @end 29 | 30 | @implementation ProductProgressLayer 31 | 32 | @dynamic trackTintColor; 33 | @dynamic progressTintColor; 34 | @dynamic bigCircleColor; 35 | @dynamic progress; 36 | @dynamic clockwiseProgress; 37 | 38 | + (BOOL)needsDisplayForKey:(NSString *)key { 39 | if ([key isEqualToString:@"progress"]) { 40 | return YES; 41 | } else { 42 | return [super needsDisplayForKey:key]; 43 | } 44 | } 45 | 46 | -(void)drawInContext:(CGContextRef)ctx { 47 | CGRect rect = self.bounds; 48 | CGPoint centerPoint = CGPointMake(rect.size.width / 2.0f, rect.size.height / 2.0f); 49 | CGFloat radius = MIN(rect.size.height-innerSpacing, rect.size.width-innerSpacing) / 2.0f; 50 | CGFloat bigRadius = MIN(rect.size.height, rect.size.width) / 2.0f; 51 | 52 | BOOL clockwise = (self.clockwiseProgress != 0); 53 | //FLT_EPSILON 表示误差值(由编译器和CUP等决定) (可以看做 0.0) 54 | CGFloat progress = MIN(self.progress, 1.0f - FLT_EPSILON); 55 | CGFloat radians = 0; 56 | //这里要注意 画图的 角度开始点是在水平方向右顶点 57 | if (clockwise) { 58 | radians = (float)((progress * 2.0f * M_PI) - M_PI_2); 59 | } else { 60 | radians = (float)(3 * M_PI_2 - (progress * 2.0f * M_PI)); 61 | } 62 | CGContextSetFillColorWithColor(ctx, self.trackTintColor.CGColor); 63 | CGMutablePathRef trackPath = CGPathCreateMutable(); 64 | CGPathMoveToPoint(trackPath, NULL, centerPoint.x, centerPoint.y); 65 | CGPathAddArc(trackPath, NULL, centerPoint.x, centerPoint.y, bigRadius, (float)(2.0f * M_PI), 0.0f, TRUE); 66 | CGPathCloseSubpath(trackPath); 67 | CGContextAddPath(ctx, trackPath); 68 | CGContextFillPath(ctx); 69 | CGPathRelease(trackPath); 70 | 71 | if (progress > 0.0f) { 72 | CGContextSetFillColorWithColor(ctx, self.progressTintColor.CGColor); 73 | CGMutablePathRef progressPath = CGPathCreateMutable(); 74 | CGPathMoveToPoint(progressPath, NULL, centerPoint.x, centerPoint.y); 75 | CGPathAddArc(progressPath, NULL, centerPoint.x, centerPoint.y, radius, (float)(3.0f * M_PI_2), radians, !clockwise); 76 | CGPathCloseSubpath(progressPath); 77 | CGContextAddPath(ctx, progressPath); 78 | CGContextFillPath(ctx); 79 | CGPathRelease(progressPath); 80 | } 81 | 82 | //画出外边的圆环 83 | CGContextSetStrokeColorWithColor(ctx, self.bigCircleColor.CGColor); 84 | CGMutablePathRef bigCirclePath = CGPathCreateMutable(); 85 | CGPathAddEllipseInRect(bigCirclePath, NULL, CGRectMake(2, 2, self.bounds.size.width-4, self.bounds.size.height-4)); 86 | CGContextAddPath(ctx, bigCirclePath); 87 | CGContextSetLineWidth(ctx, self.bigCircleWidth); 88 | CGContextStrokePath(ctx); 89 | CGPathRelease(bigCirclePath); 90 | // NSInteger fff = ceil(2.5); //取整的方法 91 | // NSLog(@"%ld",(long)fff); 92 | } 93 | 94 | @end 95 | 96 | 97 | @implementation ProductProgressView 98 | 99 | + (void)initialize 100 | { 101 | if (self == [ProductProgressView class]) { 102 | ProductProgressView *productProgressViewAppearance = [ProductProgressView appearance]; 103 | [productProgressViewAppearance setTrackTintColor:[[UIColor whiteColor] colorWithAlphaComponent:0.3f]]; 104 | [productProgressViewAppearance setProgressTintColor:[UIColor whiteColor]]; 105 | [productProgressViewAppearance setBigCircleColor:[UIColor whiteColor]]; 106 | [productProgressViewAppearance setBigVircleWidth:1]; 107 | [productProgressViewAppearance setBackgroundColor:[UIColor clearColor]]; 108 | [productProgressViewAppearance setClockwiseProgress:YES]; 109 | } 110 | } 111 | 112 | +(Class)layerClass { 113 | return [ProductProgressLayer class]; 114 | } 115 | - (ProductProgressLayer *)productProgressLayer { 116 | return (ProductProgressLayer *)self.layer; 117 | } 118 | - (id)init { 119 | return [super initWithFrame:CGRectMake(0.0f, 0.0f, 40.0f, 40.0f)]; 120 | } 121 | - (void)didMoveToWindow { 122 | CGFloat windowContentsScale = self.window.screen.scale; 123 | self.productProgressLayer.contentsScale = windowContentsScale; 124 | [self.productProgressLayer setNeedsDisplay]; 125 | } 126 | #pragma mark - Progress 127 | 128 | - (CGFloat)progress 129 | { 130 | return self.productProgressLayer.progress; 131 | } 132 | 133 | - (void)setProgress:(CGFloat)progress { 134 | [self setProgress:progress animated:NO initialDelay:0 withDuration:0]; 135 | } 136 | 137 | 138 | - (void)setProgress:(CGFloat)progress animated:(BOOL)animated initialDelay:(CFTimeInterval)initialDelay withDuration:(CFTimeInterval)duration { 139 | [self.productProgressLayer removeAnimationForKey:@"progress"]; 140 | CGFloat pinnedProgress = MIN(MAX(progress, 0.0f), 1.0f); 141 | if (animated) { 142 | CABasicAnimation *animation = [CABasicAnimation animationWithKeyPath:@"progress"]; 143 | animation.duration = duration; 144 | animation.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]; 145 | animation.fillMode = kCAFillModeForwards; 146 | animation.fromValue = [NSNumber numberWithFloat:self.progress]; 147 | animation.toValue = [NSNumber numberWithFloat:pinnedProgress]; 148 | animation.beginTime = CACurrentMediaTime() + initialDelay; 149 | animation.delegate = self; 150 | [self.productProgressLayer addAnimation:animation forKey:@"progress"]; 151 | } else { 152 | [self.productProgressLayer setNeedsDisplay]; 153 | self.productProgressLayer.progress = pinnedProgress; 154 | } 155 | } 156 | 157 | - (void)animationDidStop:(CAAnimation *)animation finished:(BOOL)flag { 158 | NSNumber *pinnedProgressNumber = [animation valueForKey:@"toValue"]; 159 | self.productProgressLayer.progress = [pinnedProgressNumber floatValue]; 160 | } 161 | 162 | 163 | #pragma mark - UIAppearance methods 164 | 165 | - (UIColor *)trackTintColor { 166 | return self.productProgressLayer.trackTintColor; 167 | } 168 | 169 | - (void)setTrackTintColor:(UIColor *)trackTintColor { 170 | self.productProgressLayer.trackTintColor = trackTintColor; 171 | [self.productProgressLayer setNeedsDisplay]; 172 | } 173 | 174 | - (UIColor *)progressTintColor { 175 | return self.productProgressLayer.progressTintColor; 176 | } 177 | - (void)setProgressTintColor:(UIColor *)progressTintColor { 178 | self.productProgressLayer.progressTintColor = progressTintColor; 179 | [self.productProgressLayer setNeedsDisplay]; 180 | } 181 | 182 | - (UIColor *)bigCircleColor { 183 | return self.productProgressLayer.bigCircleColor; 184 | } 185 | - (void)setBigCircleColor:(UIColor *)bigCircleColor { 186 | self.productProgressLayer.bigCircleColor = bigCircleColor; 187 | [self.productProgressLayer setNeedsDisplay]; 188 | } 189 | 190 | -(void)setBigVircleWidth:(CGFloat)bigVircleWidth { 191 | self.productProgressLayer.bigCircleWidth = bigVircleWidth; 192 | [self.productProgressLayer setNeedsDisplay]; 193 | } 194 | -(CGFloat)bigVircleWidth { 195 | return self.productProgressLayer.bigCircleWidth; 196 | } 197 | 198 | - (NSInteger)clockwiseProgress { 199 | return self.productProgressLayer.clockwiseProgress; 200 | } 201 | - (void)setClockwiseProgress:(NSInteger)clockwiseProgres { 202 | self.productProgressLayer.clockwiseProgress = clockwiseProgres; 203 | [self.productProgressLayer setNeedsDisplay]; 204 | } 205 | 206 | 207 | /* 208 | // Only override drawRect: if you perform custom drawing. 209 | // An empty implementation adversely affects performance during animation. 210 | - (void)drawRect:(CGRect)rect { 211 | // Drawing code 212 | } 213 | */ 214 | 215 | @end 216 | -------------------------------------------------------------------------------- /NewUITest/NewUITest/NewLoginView.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 40 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | -------------------------------------------------------------------------------- /NewUITest/NewUITest/MyReward_3Cell.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 37 | 47 | 57 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 99 | 100 | 101 | 102 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | -------------------------------------------------------------------------------- /NewUITest/NewUITest/ProductList_3Cell.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 43 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 74 | 81 | 88 | 95 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | -------------------------------------------------------------------------------- /NewUITest/NewUITest/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 40 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | 238 | 239 | 240 | -------------------------------------------------------------------------------- /NewUITest/NewUITest/NewHomeCell.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 109 | 116 | 123 | 130 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | -------------------------------------------------------------------------------- /NewUITest/NewUITest/OrderList_3Cell.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 43 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 73 | 80 | 87 | 94 | 101 | 108 | 109 | 110 | 111 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | --------------------------------------------------------------------------------