IOS开源项目Coding学习笔记(3):注册界面RegisterViewController
来源:互联网 发布:js ajax请求跨域问题 编辑:程序博客网 时间:2024/06/05 15:07
- (void)registerBtnClicked{
RegisterViewController *vc = [[RegisterViewController alloc] init];
UINavigationController *nav = [[BaseNavigationController alloc] initWithRootViewController:vc];
[self presentViewController:nav animated:YES completion:nil];
}
1、整个界面组成:
1.1、NavigationBar
-(void)viewWillAppear:(BOOL)animated{
[super viewWillAppear:animated];
[self.navigationController setNavigationBarHidden:NO animated:YES];
}
1.2、TPKeyboardAvoidingTableView -- 开源控件
https://github.com/michaeltyson/TPKeyboardAvoiding
2、tableView 的 footerView
- (UIView *)customFooterView{
UIView *footerV = [[UIView alloc] initWithFrame:CGRectMake(0, 0, kScreen_Width, 150)];
_footerBtn = [UIButton buttonWithStyle:StrapSuccessStyle andTitle:@"立即体验" andFrame:CGRectMake(kLoginPaddingLeftWidth, 20, kScreen_Width-kLoginPaddingLeftWidth*2, 45) target:self action:@selector(sendRegister)];
[footerV addSubview:_footerBtn]; //buttonWithStyle定制了一些通用的按钮
//主要是ReactiveCocoa的使用,暂时我也不是很明白,但是挺重要的,很多人在用,我在下面列了一些参考 //文章
RAC(self, footerBtn.enabled) = [RACSignal combineLatest:@[RACObserve(self, myRegister.email), RACObserve(self, myRegister.global_key), RACObserve(self, myRegister.j_captcha), RACObserve(self, captchaNeeded)] reduce:^id(NSString *email, NSString *global_key, NSString *j_captcha, NSNumber *captchaNeeded){
if ((captchaNeeded && captchaNeeded.boolValue) && (!j_captcha || j_captcha.length <= 0)) {
return @(NO);
}else{
return @((email && email.length > 0) && (global_key && global_key.length > 0));
}
}];
//基于网上的一个开源库https://github.com/TTTAttributedLabel/TTTAttributedLabel
UITTTAttributedLabel *lineLabel = ({
UITTTAttributedLabel *label = [[UITTTAttributedLabel alloc] init];
label.textAlignment = NSTextAlignmentCenter;
label.font = [UIFont systemFontOfSize:12];
label.textColor = [UIColor colorWithHexString:@"0x999999"];
label.numberOfLines = 0;
label.linkAttributes = kLinkAttributes;
label.activeLinkAttributes = kLinkAttributesActive;
label.delegate = self;
label;
});
NSString *tipStr = @"点击立即体验,即表示同意《coding服务条款》";
lineLabel.text = tipStr;
[lineLabel addLinkToTransitInformation:@{@"actionStr" : @"gotoServiceTermsVC"} withRange:[tipStr rangeOfString:@"《coding服务条款》"]];
CGRect footerBtnFrame = _footerBtn.frame;
lineLabel.frame = CGRectMake(CGRectGetMinX(footerBtnFrame), CGRectGetMaxY(footerBtnFrame) +12, CGRectGetWidth(footerBtnFrame), 12);
[footerV addSubview:lineLabel];
return footerV;
}
3、
点击《coding服务条款》进入一个webView界面,下一篇会分析下这个webView界面
#pragma mark VC
- (void)gotoServiceTermsVC{
NSString *pathForServiceterms = [[NSBundle mainBundle] pathForResource:@"service_terms" ofType:@"html"];
WebViewController *vc = [WebViewController webVCWithUrlStr:pathForServiceterms];
[self.navigationController pushViewController:vc animated:YES];
}
4、ReactiveCocoa 这个也是很火的一个开源框架
参考文章:
http://benbeng.leanote.com/post/ReactiveCocoaTutorial-part2
http://limboy.me/ios/2013/12/27/reactivecocoa-2.html
http://www.jianshu.com/p/1fc8c809e2c0
0 0
- IOS开源项目Coding学习笔记(3):注册界面RegisterViewController
- IOS开源项目Coding学习笔记(4):SVWebViewController: 服务条款界面
- 开源项目Coding学习笔记(1):EaseStartView --- 第一个界面
- IOS开源项目Coding学习笔记(2):IntroductionViewController (简介View)
- 开源项目之Coding-iOS
- IOS开发简单登录LoginViewController、注册RegisterViewController、UcenterViewController功能实现方法
- IOS开发简单登录LoginViewController、注册RegisterViewController、UcenterViewController功能实现方法
- IOS开发简单登录LoginViewController、注册RegisterViewController、UcenterViewController功能实现方法
- IOS开发简单登录LoginViewController、注册RegisterViewController、UcenterViewController功能实现方法
- IOS开发简单登录LoginViewController、注册RegisterViewController、UcenterViewController功能实现方法
- QT学习笔记(实现登录注册界面)
- 项目管理---git----快速使用git笔记(三)------coding.net注册和新建项目(远程仓库)
- IOS 学习 Key-value coding
- ios UI注册登录界面
- ios UI注册登录界面
- iOS登录界面和注册界面
- iOS登录界面和注册界面
- iOS开发之开源UI界面类项目总结
- 完美解决VS2003.Net fatal error LNK1201: 写入程序数据库“.pdb”时出错我的开发环境是Win7旗舰64位+VS2003.Net,经常卡pdb错误,文末给出一个完美的解决
- mongodb网络yum源
- Oracle使用row_number() over (partition order by)和DISTINCT去除重复记录
- 利用swig,在python中使用C++的类
- JSPatch库, 一个Apple官方支持的实现在线更新iOS应用的库
- IOS开源项目Coding学习笔记(3):注册界面RegisterViewController
- 阿里云centos下vpn的搭建
- 排序算法之冒泡、插入和希尔排序
- Ubuntu中设置环境变量的几种方式及区别
- svn st 状态详解
- Java数据库连接-JNDI方式- 配置Tomcat6.0 连接池 配置相关
- 动态修改background之后padding失效
- Android常见XML转义字符
- DrawerLayout设置滑动边距