add files apis

This commit is contained in:
lianxiang
2018-08-30 18:07:16 +08:00
parent 54e936535f
commit 3efde8e0ea
68 changed files with 1254 additions and 374 deletions
@@ -0,0 +1,13 @@
//
// RegistGetSMSCodeRequest.h
// GIGA
//
// Created by lianxiang on 2018/8/29.
// Copyright © 2018年 com.giga.ios. All rights reserved.
//
#import "GiGaBaseAPiRequest.h"
@interface RegistGetSMSCodeRequest : GiGaBaseAPiRequest
@end
@@ -0,0 +1,13 @@
//
// RegistGetSMSCodeRequest.m
// GIGA
//
// Created by lianxiang on 2018/8/29.
// Copyright © 2018年 com.giga.ios. All rights reserved.
//
#import "RegistGetSMSCodeRequest.h"
@implementation RegistGetSMSCodeRequest
@end
@@ -9,6 +9,12 @@
#import "GiGaRegistViewController.h"
#import "TTTAttributedLabel.h"
#import "GiGaWebViewController.h"
#import "NSTimer+Convenience.h"
#import "GiGaBaseAPiRequest.h"
#import "GiGaNetManager.h"
#import "MBProgressHUD.h"
#import "GiGaAttributedLabel.h"
@interface GiGaRegistViewController ()<TTTAttributedLabelDelegate>
@property (weak, nonatomic) IBOutlet UITextField *phoneNumberTextField;
@property (weak, nonatomic) IBOutlet UITextField *codeTextField;
@@ -17,7 +23,9 @@
@property (weak, nonatomic) IBOutlet UIButton *checkBtn;
@property (weak, nonatomic) IBOutlet UIButton *registBtn;
@property (weak, nonatomic) IBOutlet TTTAttributedLabel *useragreementLabel;
@property (weak, nonatomic) IBOutlet GiGaAttributedLabel *useragreementLabel;
@property(nonatomic,strong) NSTimer*timer;
@property(nonatomic) NSInteger time;
@end
@@ -26,10 +34,73 @@
- (void)viewDidLoad {
[super viewDidLoad];
self.title = @"注册";
_time = 60;
// Do any additional setup after loading the view from its nib.
[self confirmUI];
[self.sendCodeBtn addTarget:self action:@selector(sendCodeBtnAction:) forControlEvents:UIControlEventTouchUpInside];
[self.registBtn addTarget:self action:@selector(registBtnAction:) forControlEvents:UIControlEventTouchUpInside];
}
-(void)dealloc{
if (_timer) {
[_timer unfireTimer];
[_timer invalidate];
_timer = nil;
}
}
-(void)sendCodeBtnAction:(UIButton *)btn{
if (self.phoneNumberTextField.text == nil) {
GIGA_ShowToast(@"请输入手机号");
return;
}
if (![GiGaHelper isPhoneNumber:self.phoneNumberTextField.text]) {
GIGA_ShowToast(@"请输入正确手机号");
return;
}
btn.userInteractionEnabled = NO;
[self startTimer:btn];
[self sendVerifiCode:btn];
}
-(void)startTimer:(UIButton *)btn{
if (_time>0) {
_timer = [NSTimer scheduledTimerWithTimeInterval:1 count:60 callback:^{
NSString *timeStr=[NSString stringWithFormat:@"%lds",(long)self->_time];
[btn setTitle:timeStr forState:UIControlStateNormal];
self->_time--;
if (self->_time==0) {
[self.sendCodeBtn setTitle:@"发送短信" forState:UIControlStateNormal];
[btn setBackgroundColor:GIGAUIColorFromRGBA(0x28b9ff)];
self->_time =60;
btn.userInteractionEnabled = YES;
}
}];
[[NSRunLoop currentRunLoop] addTimer:self.timer forMode:NSRunLoopCommonModes];
}
}
#pragma mark 发送短信验证码
-(void)sendVerifiCode:(UIButton *)btn{
[MBProgressHUD showHUDAddedTo:self.view animated:YES];
NSString *phoneNumber = self.phoneNumberTextField.text;
NSDictionary *param = @{
@"mobile":phoneNumber
};
GiGaBaseAPiRequest *api = [GiGaBaseAPiRequest initWithRequestPath:@"msg/sms/v1/sendcode" method:RequestPostMethod parms:param];
[api requstDataWithResult:^(GiGaAPIResult *result) {
[MBProgressHUD hideHUDForView:self.view animated:YES];
GILog(@"短信获取%@",result.message);
btn.userInteractionEnabled = YES;
}];
}
-(void)confirmUI{
@@ -79,6 +150,57 @@
webView.souceType = WebSourceTypeUrlLink;
webView.url = @"http://www.youtansu.com";
[self.navigationController pushViewController:webView animated:YES];
}
#pragma mark 注册
-(void)registBtnAction:(UIButton *)btn{
if (self.phoneNumberTextField.text.length ==0) {
GIGA_ShowToast(@"请输入手机号");
return;
}
if (![GiGaHelper isPhoneNumber:self.phoneNumberTextField.text]) {
GIGA_ShowToast(@"请输入正确手机号");
return;
}
if (self.codeTextField.text.length == 0) {
GIGA_ShowToast(@"请输入验证码");
return;
}
if (!(self.passTexFied.text.length >=6 && self.passTexFied.text.length <=20) || self.passTexFied.text.length == 0) {
GIGA_ShowToast(@"请输入6~20位密码");
return;
}
[self regeist:btn];
}
//注册
-(void)regeist:(UIButton *)btn{
btn.userInteractionEnabled = NO;
NSDictionary *param = @{@"username":self.phoneNumberTextField.text,@"verifiedCode":self.codeTextField.text,@"password":self.passTexFied.text};
GiGaBaseAPiRequest *api = [GiGaBaseAPiRequest initWithRequestPath:@"sys/v1/phoneregister" method:RequestPostMethod parms:param];
[api requstDataWithResult:^(GiGaAPIResult *result) {
btn.userInteractionEnabled = YES;
GILog(@"注册->%@",result.message);
if (result.code == 0) {
NC_POST_NAME_OBJECT(kUserRegistSucccess,self.phoneNumberTextField.text);
}else if (result.code == GiGAErrorCode_USER_EXIST){
GIGA_ShowToast(@"用户已存在");
NC_POST_NAME_OBJECT(kUserRegistSucccess,self.phoneNumberTextField.text);
}else{
GIGA_ShowToast(result.message);
}
}];
}
- (void)didReceiveMemoryWarning {
@@ -42,7 +42,7 @@
</constraints>
<nil key="textColor"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<textInputTraits key="textInputTraits"/>
<textInputTraits key="textInputTraits" keyboardType="numberPad"/>
</textField>
<textField opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" placeholder="短信验证码" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="dR7-iu-Eup">
<rect key="frame" x="36" y="221" width="303" height="40"/>
@@ -51,7 +51,7 @@
</constraints>
<nil key="textColor"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<textInputTraits key="textInputTraits"/>
<textInputTraits key="textInputTraits" keyboardType="numberPad"/>
</textField>
<textField opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" placeholder="设置登录密码" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="UUC-74-fsa">
<rect key="frame" x="36" y="278" width="303" height="40"/>
@@ -60,7 +60,7 @@
</constraints>
<nil key="textColor"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<textInputTraits key="textInputTraits"/>
<textInputTraits key="textInputTraits" keyboardType="numbersAndPunctuation"/>
</textField>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="ubQ-Za-dV7">
<rect key="frame" x="36" y="211" width="303" height="1"/>
@@ -110,7 +110,7 @@
</constraints>
<state key="normal" title="注 册"/>
</button>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Vxb-TL-wDd" customClass="TTTAttributedLabel">
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Vxb-TL-wDd" customClass="GiGaAttributedLabel">
<rect key="frame" x="77" y="356" width="42" height="21"/>
<fontDescription key="fontDescription" name=".AppleSystemUIFont" family=".AppleSystemUIFont" pointSize="17"/>
<nil key="textColor"/>
+91 -14
View File
@@ -14,6 +14,9 @@
#import "WXApi.h"
#import "GiGaNetManager.h"
#import "WeiIXinApiManager.h"
#import "GiGaBaseAPiRequest.h"
#import "GiGaUser.h"
#import "GiGaServerConfig.h"
@interface GiGaUserLoginVC ()
@property (weak, nonatomic) IBOutlet UIImageView *userImagView;
@@ -24,6 +27,8 @@
@property (weak, nonatomic) IBOutlet UIButton *weiXinLoginBtn;
@property (weak, nonatomic) IBOutlet UIButton *registBtn;
@property (weak, nonatomic) IBOutlet UIImageView *wexinbtnImageView;
@property (weak, nonatomic) IBOutlet UIButton *secretBtn;
@end
@@ -35,16 +40,20 @@
// Do any additional setup after loading the view from its nib.
[self setUpX];
[self textFieldUI];
[self.view bringSubviewToFront:self.weiXinLoginBtn];
[self.registBtn addTarget:self action:@selector(registBtnAction) forControlEvents:UIControlEventTouchUpInside];
[self.loginBtn addTarget:self action:@selector(loginBtnAction:) forControlEvents:UIControlEventTouchUpInside];
[self.weiXinLoginBtn addTarget:self
action:@selector(weiXinLoginAction) forControlEvents:UIControlEventTouchUpInside];
[self.secretBtn addTarget:self action:@selector(secretBtnAction:) forControlEvents:UIControlEventTouchUpInside];
NC_ADD_TARGET_NAME_OBJECT(self, @selector(WeiXinLongIn:), kWeiXinAuthrization_Success, nil)
NC_ADD_TARGET_NAME_OBJECT(self, @selector(userRegistSuccsessNoti:), kUserRegistSucccess, nil)
if (![WXApi isWXAppInstalled]) {
self.weiXinLoginBtn.hidden = YES;
}
}
-(void)dealloc{
@@ -56,8 +65,7 @@
UIButton *rightBtn = [UIButton buttonWithType:UIButtonTypeCustom];
rightBtn.frame = CGRectMake(0, 0, 40, 40);
rightBtn.backgroundColor = [UIColor blueColor];
[rightBtn setImage:[UIImage imageNamed:@"maske_dismiss_waring"] forState:UIControlStateNormal];
[rightBtn setImage:[UIImage imageNamed:@"btn_back"] forState:UIControlStateNormal];
[rightBtn addTarget:self action:@selector(rightBtnAction) forControlEvents:UIControlEventTouchUpInside];
self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:rightBtn];
}
@@ -66,9 +74,8 @@
//self.acountTextField.attributedPlaceholder = @"";
UIView *acountView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 40, 40)];
acountView.backgroundColor = [UIColor redColor];
UIImageView *acountViewIcon = [[UIImageView alloc] initWithFrame:CGRectMake(15, 5, 16, 18)];
acountViewIcon.image = [UIImage imageNamed:@""];
UIImageView *acountViewIcon = [[UIImageView alloc] initWithFrame:CGRectMake(15,9, 12, 22)];
acountViewIcon.image = [UIImage imageNamed:@"ic_number"];
[acountView addSubview:acountViewIcon];
self.acountTextField.leftView = acountView;
self.acountTextField.leftViewMode = UITextFieldViewModeAlways;
@@ -76,9 +83,8 @@
// NSAttributedString *passholderText = [[NSAttributedString alloc] initWithString:@"密码" attributes:@{NSFontAttributeName:[UIFont systemFontOfSize:14],NSForegroundColorAttributeName:[UIColor redColor]}];
// self.passwordTextField.attributedPlaceholder = passholderText;
UIView *passView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 40, 40)];
passView.backgroundColor = [UIColor redColor];
UIImageView *passViewIcon = [[UIImageView alloc] initWithFrame:CGRectMake(15, 5, 16, 18)];
passViewIcon.image = [UIImage imageNamed:@""];
UIImageView *passViewIcon = [[UIImageView alloc] initWithFrame:CGRectMake(15, 9, 12, 22)];
passViewIcon.image = [UIImage imageNamed:@"icon_key"];
[passView addSubview:passViewIcon];
self.passwordTextField.leftView = passView;
self.passwordTextField.leftViewMode = UITextFieldViewModeAlways;
@@ -121,7 +127,7 @@
}
#pragma mark - 登录
#pragma mark 手机号登录
-(void)loginBtnAction:(UIButton *)btn{
if (self.acountTextField.text == nil) {
@@ -137,15 +143,63 @@
GIGA_ShowToast(@"密码不能为空");
return;
}
if (self.passwordTextField.text.length < 6) {
GIGA_ShowToast(@"密码长度不能小于六位字符");
return;
}
// if (self.passwordTextField.text.length < =6) {
// GIGA_ShowToast(@"密码长度不能小于六位字符");
// return;
// }
// [self dismissViewControllerAnimated:YES completion:nil];
[self loginWithAction:btn];
}
-(void)loginWithAction:(UIButton *)btn{
NSDictionary *params = @{
@"username":self.acountTextField.text,
@"password":self.passwordTextField.text
};
// GiGaBaseAPiRequest *loginApi = [GiGaBaseAPiRequest initWithRequestPath:@"sys/v1/login" method:RequestPostMethod parms:params];
//weakify(self);
// [loginApi requstDataWithResult:^(GiGaAPIResult *result) {
// GILog(@"**登陆***\n resultDic:%ld\n code:%@\n *******\n",(long)result.code,result.dic);
// if (result.success) {
// GILog(@"****登陆成功****");
// [self saveUserData];
// [self dismissViewControllerAnimated:YES completion:nil];
// }
// }];
[self.view makeToastActivity:CSToastPositionCenter];
NSString *url = [NSString stringWithFormat:@"%@sys/v1/login",[GiGaServerConfig getMainUrl]];
[GiGaNetManager userLoginrequest:url params:params completionHandler:^(NSURLResponse *response, NSDictionary *resDic, NSError * _Nullable error) {
GILog(@"%@",resDic);
[self.view hideToastActivity];
GiGaAPIResult *result = [[GiGaAPIResult alloc] initWithDictionary:resDic];
GILog(@"**登陆***\n code:%ld\n message:%@\n *******\n",result.code,result.message);
if (result.success) {
[GiGaUserDefault saveToken:resDic[@"token"]];
//埋点
[MobClick endEvent:MobClick_UserLogin];
//暂定123 登陆标志
[GiGaUserDefault saveUserId:@"123"];
GIGA_WIndowTost(@"登录成功!");
[self dismissViewControllerAnimated:YES completion:nil];
}
}];
}
-(void)saveUserData{
//埋点
[MobClick endEvent:MobClick_UserLogin];
[GiGaUserDefault saveUserId:@"123"];
[self dismissViewControllerAnimated:YES completion:nil];
}
#pragma mark - 微信登录
@@ -201,4 +255,27 @@
}
//接收注册成功通知
-(void)userRegistSuccsessNoti:(NSNotification *)noti{
self.acountTextField.text =(NSString *)noti.object;
}
//密码加密按钮
-(void)secretBtnAction:(UIButton *)btn{
btn.selected = !btn.selected;
if (btn.selected) {
//秘文
self.passwordTextField.secureTextEntry = YES;
[btn setImage:[UIImage imageNamed:@"btn_tab_notselect"] forState:UIControlStateSelected];
}else{
self.passwordTextField.secureTextEntry = NO;
[btn setImage:[UIImage imageNamed:@"btn_tab_desplay"] forState:UIControlStateNormal];
}
}
@end
+111 -110
View File
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="14113" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="14113" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<device id="retina4_7" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
@@ -7,6 +7,7 @@
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14088"/>
<capability name="Aspect ratio constraints" minToolsVersion="5.1"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
@@ -16,9 +17,11 @@
<outlet property="loginBtn" destination="8Of-JP-gMR" id="uRE-2y-IZt"/>
<outlet property="passwordTextField" destination="Y1I-OE-6t1" id="Jgj-sC-7MX"/>
<outlet property="registBtn" destination="F5p-cf-frr" id="eHE-mU-8Xf"/>
<outlet property="secretBtn" destination="Szo-8C-Zin" id="tAR-yS-dZE"/>
<outlet property="userImagView" destination="RIl-8E-GcR" id="lhE-Hq-pRn"/>
<outlet property="view" destination="i5M-Pr-FkT" id="sfx-zR-JGt"/>
<outlet property="weiXinLoginBtn" destination="dnL-WV-spY" id="UQI-ZD-Wuu"/>
<outlet property="wexinbtnImageView" destination="uG0-g6-27S" id="mVD-8D-RW1"/>
</connections>
</placeholder>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
@@ -26,148 +29,146 @@
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="RIl-8E-GcR">
<rect key="frame" x="137" y="44" width="100" height="100"/>
<color key="backgroundColor" red="0.0" green="0.47843137250000001" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="img_circle_avatar" translatesAutoresizingMaskIntoConstraints="NO" id="RIl-8E-GcR">
<rect key="frame" x="131" y="102" width="114" height="114"/>
<constraints>
<constraint firstAttribute="width" secondItem="RIl-8E-GcR" secondAttribute="height" multiplier="1:1" id="kf7-fa-NKy"/>
<constraint firstAttribute="height" constant="100" id="npT-8X-kmx"/>
<constraint firstAttribute="width" secondItem="RIl-8E-GcR" secondAttribute="height" multiplier="1:1" id="bfp-Q6-OmK"/>
</constraints>
</imageView>
<textField opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" placeholder="账号" textAlignment="natural" minimumFontSize="17" clearButtonMode="whileEditing" translatesAutoresizingMaskIntoConstraints="NO" id="Yiv-h8-4V1">
<rect key="frame" x="32" y="160" width="309" height="30"/>
<color key="backgroundColor" red="0.99607843139999996" green="0.94117647059999998" blue="0.69803921570000005" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<textField opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" placeholder="手机号码" textAlignment="natural" minimumFontSize="17" clearButtonMode="whileEditing" translatesAutoresizingMaskIntoConstraints="NO" id="Yiv-h8-4V1">
<rect key="frame" x="65" y="232" width="245" height="54"/>
<constraints>
<constraint firstAttribute="height" constant="30" id="LOI-yC-v4S"/>
<constraint firstAttribute="height" constant="54" id="593-Iu-1XC"/>
</constraints>
<nil key="textColor"/>
<fontDescription key="fontDescription" type="system" pointSize="12"/>
<textInputTraits key="textInputTraits"/>
<textInputTraits key="textInputTraits" keyboardType="numberPad"/>
</textField>
<textField opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" placeholder="密码" textAlignment="natural" minimumFontSize="17" clearButtonMode="whileEditing" translatesAutoresizingMaskIntoConstraints="NO" id="Y1I-OE-6t1">
<rect key="frame" x="33" y="224" width="309" height="30"/>
<color key="backgroundColor" red="0.99607843139999996" green="0.94117647059999998" blue="0.69803921570000005" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<textField opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" placeholder="密码" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="Y1I-OE-6t1">
<rect key="frame" x="65" y="302" width="167" height="56"/>
<constraints>
<constraint firstAttribute="height" constant="30" id="eG3-4a-G4H"/>
<constraint firstAttribute="height" constant="56" id="36A-Rk-HnV"/>
</constraints>
<nil key="textColor"/>
<fontDescription key="fontDescription" type="system" pointSize="12"/>
<textInputTraits key="textInputTraits"/>
<textInputTraits key="textInputTraits" keyboardType="numbersAndPunctuation"/>
</textField>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="qzA-vE-CGR">
<rect key="frame" x="33" y="194" width="309" height="1"/>
<color key="backgroundColor" red="0.74901960779999999" green="0.74509803919999995" blue="0.74509803919999995" alpha="1" colorSpace="calibratedRGB"/>
<rect key="frame" x="65" y="286" width="245" height="2"/>
<color key="backgroundColor" red="0.94901960784313721" green="0.94901960784313721" blue="0.94901960784313721" alpha="1" colorSpace="calibratedRGB"/>
<constraints>
<constraint firstAttribute="height" constant="1" id="Nz8-a3-phJ"/>
<constraint firstAttribute="height" constant="2" id="HWD-IP-ygd"/>
</constraints>
</view>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="ZJU-Uo-5TM">
<rect key="frame" x="33.5" y="259" width="309" height="1"/>
<color key="backgroundColor" red="0.74901960779999999" green="0.74509803919999995" blue="0.74509803919999995" alpha="1" colorSpace="calibratedRGB"/>
<rect key="frame" x="65" y="366" width="245" height="2"/>
<color key="backgroundColor" red="0.94901960780000005" green="0.94901960780000005" blue="0.94901960780000005" alpha="1" colorSpace="calibratedRGB"/>
<constraints>
<constraint firstAttribute="height" constant="1" id="NqZ-5s-7Mg"/>
<constraint firstAttribute="height" constant="2" id="xGp-5h-fFD"/>
</constraints>
</view>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="chq-bd-6sQ">
<rect key="frame" x="281" y="275" width="60" height="30"/>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="8Of-JP-gMR">
<rect key="frame" x="65" y="444" width="245" height="42"/>
<color key="backgroundColor" red="0.0" green="0.87058823529411766" blue="0.74117647058823533" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstAttribute="height" constant="30" id="3Nq-gh-4BK"/>
<constraint firstAttribute="width" constant="60" id="Pv8-8w-ASz"/>
<constraint firstAttribute="height" constant="42" id="H8S-wQ-QzQ"/>
</constraints>
<fontDescription key="fontDescription" type="boldSystem" pointSize="18"/>
<state key="normal" title=" 登 录">
<color key="titleColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</state>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Szo-8C-Zin">
<rect key="frame" x="246" y="309" width="64" height="42"/>
<constraints>
<constraint firstAttribute="height" constant="42" id="gsN-u1-wM1"/>
<constraint firstAttribute="width" constant="64" id="ulR-IN-Puf"/>
</constraints>
<state key="normal" image="btn_tab_desplay"/>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="F5p-cf-frr">
<rect key="frame" x="107" y="507" width="161" height="45"/>
<constraints>
<constraint firstAttribute="height" constant="45" id="aCl-R3-YZF"/>
<constraint firstAttribute="width" constant="161" id="hOA-ag-StR"/>
</constraints>
<fontDescription key="fontDescription" type="system" pointSize="12"/>
<state key="normal" title="创建账号">
<color key="titleColor" red="0.0" green="0.87058823529999996" blue="0.74117647060000003" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</state>
</button>
<imageView userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="btn_wechat" translatesAutoresizingMaskIntoConstraints="NO" id="uG0-g6-27S">
<rect key="frame" x="124" y="562" width="126" height="69"/>
<constraints>
<constraint firstAttribute="height" constant="69" id="5FG-M4-q1z"/>
<constraint firstAttribute="width" constant="126" id="I5z-71-H7E"/>
</constraints>
</imageView>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="dnL-WV-spY">
<rect key="frame" x="124" y="562" width="126" height="69"/>
<constraints>
<constraint firstAttribute="height" constant="69" id="fVe-TF-KZd"/>
<constraint firstAttribute="width" constant="126" id="n0O-pP-3tz"/>
</constraints>
<fontDescription key="fontDescription" name="PingFangSC-Regular" family="PingFang SC" pointSize="10"/>
<inset key="imageEdgeInsets" minX="-10" minY="2" maxX="0.0" maxY="0.0"/>
<state key="normal" title="微信账号登录" image="ic_wechat">
<color key="titleColor" red="0.73333333333333328" green="0.73333333333333328" blue="0.73333333333333328" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</state>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="chq-bd-6sQ">
<rect key="frame" x="246" y="384" width="64" height="49"/>
<constraints>
<constraint firstAttribute="width" constant="64" id="joP-Ev-vou"/>
<constraint firstAttribute="height" constant="49" id="oH5-Gs-uju"/>
</constraints>
<fontDescription key="fontDescription" type="boldSystem" pointSize="12"/>
<state key="normal" title="忘记密码">
<color key="titleColor" red="0.19801172859999999" green="0.55107868019999995" blue="0.17657151269999999" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<color key="titleColor" red="0.19215686274509802" green="0.81960784313725488" blue="0.76470588235294112" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</state>
<connections>
<action selector="forgetPassBtn:" destination="-1" eventType="touchUpInside" id="GR3-Gw-sRB"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="8Of-JP-gMR">
<rect key="frame" x="33" y="337" width="309" height="42"/>
<color key="backgroundColor" red="0.19801172859999999" green="0.55107868019999995" blue="0.17657151269999999" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstAttribute="height" constant="42" id="0l3-lV-ZMK"/>
</constraints>
<fontDescription key="fontDescription" name=".PingFangSC-Regular" family=".PingFang SC" pointSize="15"/>
<state key="normal" title=" 登 录">
<color key="titleColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</state>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="F5p-cf-frr">
<rect key="frame" x="144" y="399" width="87" height="30"/>
<constraints>
<constraint firstAttribute="width" constant="87" id="7xs-hL-39d"/>
<constraint firstAttribute="height" constant="30" id="Q2v-So-LQo"/>
</constraints>
<state key="normal" title="创建账号"/>
</button>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Qbr-kJ-U7P">
<rect key="frame" x="33" y="490" width="129" height="1"/>
<color key="backgroundColor" white="0.66666666669999997" alpha="1" colorSpace="calibratedWhite"/>
<constraints>
<constraint firstAttribute="height" constant="1" id="95X-YC-qXA"/>
</constraints>
</view>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="mxE-Tx-0Us">
<rect key="frame" x="220" y="490" width="122" height="1"/>
<color key="backgroundColor" white="0.66666666669999997" alpha="1" colorSpace="calibratedWhite"/>
<constraints>
<constraint firstAttribute="height" constant="1" id="bG5-pf-mm7"/>
</constraints>
</view>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="OR" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="5Zl-ot-dVW">
<rect key="frame" x="175.5" y="480" width="24" height="21"/>
<constraints>
<constraint firstAttribute="width" constant="24" id="2XR-pF-nnJ"/>
<constraint firstAttribute="height" constant="21" id="bg5-RC-uB6"/>
</constraints>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" white="0.66666666669999997" alpha="1" colorSpace="calibratedWhite"/>
<nil key="highlightedColor"/>
</label>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="dnL-WV-spY">
<rect key="frame" x="33" y="515" width="309" height="50"/>
<constraints>
<constraint firstAttribute="height" constant="50" id="rYQ-VZ-BLB"/>
</constraints>
<state key="normal" title="微信账号登录"/>
</button>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstItem="mxE-Tx-0Us" firstAttribute="centerY" secondItem="5Zl-ot-dVW" secondAttribute="centerY" id="3cA-BV-qmd"/>
<constraint firstItem="RIl-8E-GcR" firstAttribute="centerX" secondItem="i5M-Pr-FkT" secondAttribute="centerX" id="4eY-sT-DtU"/>
<constraint firstItem="dnL-WV-spY" firstAttribute="top" secondItem="5Zl-ot-dVW" secondAttribute="bottom" constant="14" id="65m-zQ-bWl"/>
<constraint firstItem="RIl-8E-GcR" firstAttribute="top" secondItem="i5M-Pr-FkT" secondAttribute="top" constant="44" id="6CN-xC-x9g"/>
<constraint firstItem="5Zl-ot-dVW" firstAttribute="leading" secondItem="Qbr-kJ-U7P" secondAttribute="trailing" constant="13.5" id="7Lh-zH-OQP"/>
<constraint firstItem="ZJU-Uo-5TM" firstAttribute="width" secondItem="Y1I-OE-6t1" secondAttribute="width" id="7og-vA-Mtc"/>
<constraint firstItem="chq-bd-6sQ" firstAttribute="top" secondItem="ZJU-Uo-5TM" secondAttribute="bottom" constant="15" id="7th-F3-6VD"/>
<constraint firstItem="Qbr-kJ-U7P" firstAttribute="leading" secondItem="8Of-JP-gMR" secondAttribute="leading" id="ANZ-UH-EG0"/>
<constraint firstItem="8Of-JP-gMR" firstAttribute="width" secondItem="Yiv-h8-4V1" secondAttribute="width" id="EiB-Tt-lhg"/>
<constraint firstAttribute="trailing" secondItem="chq-bd-6sQ" secondAttribute="trailing" constant="34" id="FIt-sy-fp4"/>
<constraint firstItem="8Of-JP-gMR" firstAttribute="top" secondItem="chq-bd-6sQ" secondAttribute="bottom" constant="32" id="I92-Z4-DAA"/>
<constraint firstItem="5Zl-ot-dVW" firstAttribute="centerX" secondItem="i5M-Pr-FkT" secondAttribute="centerX" id="LX6-0I-g2t"/>
<constraint firstItem="dnL-WV-spY" firstAttribute="centerX" secondItem="i5M-Pr-FkT" secondAttribute="centerX" id="Lpn-U1-2EJ"/>
<constraint firstItem="ZJU-Uo-5TM" firstAttribute="top" secondItem="Y1I-OE-6t1" secondAttribute="bottom" constant="5" id="O7c-yh-TU1"/>
<constraint firstItem="Y1I-OE-6t1" firstAttribute="width" secondItem="Yiv-h8-4V1" secondAttribute="width" id="Po4-UD-7zT"/>
<constraint firstItem="Yiv-h8-4V1" firstAttribute="top" secondItem="RIl-8E-GcR" secondAttribute="bottom" constant="16" id="PoW-PW-M0w"/>
<constraint firstItem="Yiv-h8-4V1" firstAttribute="centerX" secondItem="i5M-Pr-FkT" secondAttribute="centerX" constant="-1" id="RNt-vj-zPW"/>
<constraint firstItem="5Zl-ot-dVW" firstAttribute="top" secondItem="F5p-cf-frr" secondAttribute="bottom" constant="51" id="TfU-BV-iUe"/>
<constraint firstItem="Yiv-h8-4V1" firstAttribute="leading" secondItem="i5M-Pr-FkT" secondAttribute="leading" constant="32" id="Ux4-8Q-gMv"/>
<constraint firstItem="ZJU-Uo-5TM" firstAttribute="centerX" secondItem="i5M-Pr-FkT" secondAttribute="centerX" id="V04-2u-unZ"/>
<constraint firstItem="mxE-Tx-0Us" firstAttribute="leading" secondItem="5Zl-ot-dVW" secondAttribute="trailing" constant="20.5" id="VOs-rR-tew"/>
<constraint firstItem="qzA-vE-CGR" firstAttribute="centerX" secondItem="i5M-Pr-FkT" secondAttribute="centerX" id="WN4-SB-6Dy"/>
<constraint firstItem="mxE-Tx-0Us" firstAttribute="trailing" secondItem="8Of-JP-gMR" secondAttribute="trailing" id="aZs-4P-9iv"/>
<constraint firstItem="dnL-WV-spY" firstAttribute="width" secondItem="8Of-JP-gMR" secondAttribute="width" id="asA-dV-Wmj"/>
<constraint firstItem="Y1I-OE-6t1" firstAttribute="centerX" secondItem="i5M-Pr-FkT" secondAttribute="centerX" id="c3z-29-UwW"/>
<constraint firstItem="Qbr-kJ-U7P" firstAttribute="centerY" secondItem="5Zl-ot-dVW" secondAttribute="centerY" id="d9i-fK-2UN"/>
<constraint firstItem="qzA-vE-CGR" firstAttribute="top" secondItem="Yiv-h8-4V1" secondAttribute="bottom" constant="4" id="e5U-rz-XHX"/>
<constraint firstItem="F5p-cf-frr" firstAttribute="top" secondItem="8Of-JP-gMR" secondAttribute="bottom" constant="20" id="fJY-wF-KYT"/>
<constraint firstItem="8Of-JP-gMR" firstAttribute="centerX" secondItem="i5M-Pr-FkT" secondAttribute="centerX" id="pOm-hg-pge"/>
<constraint firstItem="Y1I-OE-6t1" firstAttribute="top" secondItem="qzA-vE-CGR" secondAttribute="bottom" constant="29" id="tBz-sj-jET"/>
<constraint firstItem="F5p-cf-frr" firstAttribute="centerX" secondItem="i5M-Pr-FkT" secondAttribute="centerX" id="uNF-sL-Kjk"/>
<constraint firstItem="qzA-vE-CGR" firstAttribute="width" secondItem="Yiv-h8-4V1" secondAttribute="width" id="ukd-Wg-7Qy"/>
<constraint firstItem="8Of-JP-gMR" firstAttribute="width" secondItem="Yiv-h8-4V1" secondAttribute="width" id="1Xh-Cl-oZI"/>
<constraint firstItem="Yiv-h8-4V1" firstAttribute="top" secondItem="RIl-8E-GcR" secondAttribute="bottom" constant="16" id="4qd-F2-kp1"/>
<constraint firstItem="chq-bd-6sQ" firstAttribute="top" secondItem="ZJU-Uo-5TM" secondAttribute="bottom" constant="16" id="68l-K4-uY8"/>
<constraint firstAttribute="trailing" secondItem="qzA-vE-CGR" secondAttribute="trailing" constant="65" id="9hg-No-Rbp"/>
<constraint firstItem="uG0-g6-27S" firstAttribute="centerX" secondItem="1vd-yc-0a5" secondAttribute="centerX" id="AYb-IB-2Uf"/>
<constraint firstItem="Szo-8C-Zin" firstAttribute="leading" secondItem="Y1I-OE-6t1" secondAttribute="trailing" constant="14" id="Ba4-21-nhi"/>
<constraint firstItem="8Of-JP-gMR" firstAttribute="centerX" secondItem="1vd-yc-0a5" secondAttribute="centerX" id="F77-OA-qbT"/>
<constraint firstItem="Y1I-OE-6t1" firstAttribute="top" secondItem="qzA-vE-CGR" secondAttribute="bottom" constant="14" id="FzB-6D-IYx"/>
<constraint firstItem="Yiv-h8-4V1" firstAttribute="leading" secondItem="1vd-yc-0a5" secondAttribute="leading" constant="65" id="H5c-S5-H7V"/>
<constraint firstItem="RIl-8E-GcR" firstAttribute="centerX" secondItem="1vd-yc-0a5" secondAttribute="centerX" id="KlR-Tg-PMd"/>
<constraint firstItem="F5p-cf-frr" firstAttribute="centerX" secondItem="1vd-yc-0a5" secondAttribute="centerX" id="MgV-ph-Nz2"/>
<constraint firstItem="ZJU-Uo-5TM" firstAttribute="width" secondItem="qzA-vE-CGR" secondAttribute="width" id="Nfi-Mk-t19"/>
<constraint firstItem="ZJU-Uo-5TM" firstAttribute="centerX" secondItem="1vd-yc-0a5" secondAttribute="centerX" id="Qub-d1-Mfd"/>
<constraint firstItem="1vd-yc-0a5" firstAttribute="bottom" secondItem="uG0-g6-27S" secondAttribute="bottom" constant="36" id="UT1-bV-WrO"/>
<constraint firstItem="dnL-WV-spY" firstAttribute="leading" secondItem="uG0-g6-27S" secondAttribute="leading" id="V8O-58-b1F"/>
<constraint firstItem="ZJU-Uo-5TM" firstAttribute="top" secondItem="Y1I-OE-6t1" secondAttribute="bottom" constant="8" id="WmU-UK-hwV"/>
<constraint firstItem="qzA-vE-CGR" firstAttribute="leading" secondItem="i5M-Pr-FkT" secondAttribute="leading" constant="65" id="ZAX-Q0-wIE"/>
<constraint firstItem="Szo-8C-Zin" firstAttribute="centerY" secondItem="Y1I-OE-6t1" secondAttribute="centerY" id="a5D-rG-Cqf"/>
<constraint firstItem="chq-bd-6sQ" firstAttribute="trailing" secondItem="ZJU-Uo-5TM" secondAttribute="trailing" id="f3g-Rk-Fbd"/>
<constraint firstItem="F5p-cf-frr" firstAttribute="top" secondItem="8Of-JP-gMR" secondAttribute="bottom" constant="21" id="hqv-KT-isO"/>
<constraint firstItem="8Of-JP-gMR" firstAttribute="top" secondItem="chq-bd-6sQ" secondAttribute="bottom" constant="11" id="kQN-mZ-Kew"/>
<constraint firstItem="Szo-8C-Zin" firstAttribute="trailing" secondItem="Yiv-h8-4V1" secondAttribute="trailing" id="py7-9K-mmp"/>
<constraint firstItem="qzA-vE-CGR" firstAttribute="top" secondItem="Yiv-h8-4V1" secondAttribute="bottom" id="uYb-wj-NLt"/>
<constraint firstItem="RIl-8E-GcR" firstAttribute="top" secondItem="1vd-yc-0a5" secondAttribute="top" constant="82" id="vOK-NT-5LM"/>
<constraint firstItem="Yiv-h8-4V1" firstAttribute="centerX" secondItem="1vd-yc-0a5" secondAttribute="centerX" id="y10-W0-LYh"/>
<constraint firstItem="Y1I-OE-6t1" firstAttribute="leading" secondItem="qzA-vE-CGR" secondAttribute="leading" id="zC7-Wr-oTQ"/>
<constraint firstItem="1vd-yc-0a5" firstAttribute="bottom" secondItem="dnL-WV-spY" secondAttribute="bottom" constant="36" id="zYe-Aa-RIJ"/>
</constraints>
<point key="canvasLocation" x="33.5" y="53.5"/>
<viewLayoutGuide key="safeArea" id="1vd-yc-0a5"/>
<point key="canvasLocation" x="10.5" y="22.5"/>
</view>
</objects>
<resources>
<image name="btn_tab_desplay" width="45" height="20"/>
<image name="btn_wechat" width="126" height="25"/>
<image name="ic_wechat" width="19" height="17"/>
<image name="img_circle_avatar" width="114" height="114"/>
</resources>
</document>
@@ -29,7 +29,7 @@
-(void)confirmUI{
[self.phoneNumberTextField setValue:[UIColor colorWithRed:153/255.0f green:153/255.0f blue:153/255.0f alpha:1] forKey:@"_placeholderLabel.textColor"];
UIView *phoneView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 40, 40)];
phoneView.backgroundColor = [UIColor redColor];
UIImageView *phoneIcon = [[UIImageView alloc] initWithFrame:CGRectMake(15, 5, 16, 18)];
@@ -38,7 +38,6 @@
self.phoneNumberTextField.leftView = phoneView;
self.phoneNumberTextField.leftViewMode = UITextFieldViewModeAlways;
[self.codeTextField setValue:[UIColor colorWithRed:153/255.0f green:153/255.0f blue:153/255.0f alpha:1] forKey:@"_placeholderLabel.textColor"];
UIView *codeView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 40, 40)];
codeView.backgroundColor = [UIColor redColor];
UIImageView *codeIcon = [[UIImageView alloc] initWithFrame:CGRectMake(15, 5, 16, 18)];
@@ -55,11 +55,13 @@
-(void)viewWillAppear:(BOOL)animated{
[super viewWillAppear:animated];
[IQKeyboardManager sharedManager].enable = NO;
[[IQKeyboardManager sharedManager] setEnableAutoToolbar:NO];
}
- (void)viewWillDisappear:(BOOL)animated{
[super viewWillDisappear:animated];
[IQKeyboardManager sharedManager].enable = YES;
[[IQKeyboardManager sharedManager] setEnableAutoToolbar:YES];
}
-(void)showFlyingCommit{
@@ -356,10 +356,7 @@
#pragma mark 开始测试
-(void)testBtnAcion:(UIButton *)btn{
// [self startMaskTime];
// return ;
BOOL isUserLogin = [GiGaUserDefault isUserLogin];
if (isUserLogin) {
@@ -447,7 +444,7 @@
UIButton *leftBtn = [UIButton buttonWithType:UIButtonTypeCustom];
leftBtn.frame = CGRectMake(0, 0, 40, 40);
leftBtn.backgroundColor = [UIColor redColor];
[leftBtn setImage:[UIImage imageNamed:@""] forState:UIControlStateNormal];
[leftBtn setImage:[UIImage imageNamed:@"btn_back"] forState:UIControlStateNormal];
[leftBtn addTarget:self action:@selector(leftBtnAction) forControlEvents:UIControlEventTouchUpInside];
self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:leftBtn];
//rightItem
@@ -465,7 +462,6 @@
BOOL isUserLogin = [GiGaUserDefault isUserLogin];
if (isUserLogin) {
GIGA_ShowToast(@"userLogin!");
GiGaMasssagesVC *masageVC= [[GiGaMasssagesVC alloc] init];
[self.navigationController pushViewController:masageVC animated:YES];
+2 -3
View File
@@ -4,7 +4,7 @@
//
// Created by lianxiang on 2018/8/14.
// Copyright © 2018年 com.giga.ios. All rights reserved.
//
//弹幕评论视图
#import "GiGaCommentView.h"
#import "Masonry.h"
@@ -81,8 +81,7 @@
make.top.mas_equalTo(self.userAvtar.mas_bottom).mas_offset(3);
make.left.mas_equalTo(self.mas_left).mas_offset(5);
}];
float width = msglabel.frame.size.width > namelabel.frame.size.width ? msglabel.frame.size.width:namelabel.frame.size.width ;
@@ -19,10 +19,9 @@
self = [super initWithFrame:frame];
if (self) {
// self.backgroundColor = [UIColor blackColor];
self.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.1];
// UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(dismissSelfViewTap)];
// [self addGestureRecognizer:tap];
UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(dismissSelfViewTap)];
[self addGestureRecognizer:tap];
[self creatInputView];
[self bringSubviewToFront:_commitInputView];
@@ -54,6 +53,7 @@
textField.backgroundColor = [UIColor lightGrayColor];
textField.clearButtonMode = UITextFieldViewModeWhileEditing;
textField.delegate = self;
textField.returnKeyType = UIReturnKeySend;
[commitView addSubview:textField];
self.inputTextField = textField;
@@ -71,7 +71,8 @@
}
-(void)dismissSelfViewTap{
[self removeFromSuperview];
//[self removeFromSuperview];
[self.inputTextField resignFirstResponder];
}
-(void)sendBtnAction:(UIButton *)btn{
@@ -95,7 +96,8 @@
self.SendCommentHandler(self.inputTextField.text);
}
[self dismissKeyboard];
if (![self.inputTextField isFirstResponder]) return;
[self dismissKeyboard];
}
@@ -138,7 +140,6 @@
// get a rect for the textView frame
CGRect commentInputViewFrame = self.commitInputView.frame;
commentInputViewFrame.origin.y = self.bounds.size.height - (keyboardBounds.size.height + commentInputViewFrame.size.height);
// animations settings
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationBeginsFromCurrentState:YES];
@@ -147,7 +148,6 @@
// set views with new info
self.commitInputView.frame = commentInputViewFrame;
[UIView commitAnimations];
+3 -1
View File
@@ -12,7 +12,9 @@
@property(nonatomic,copy) NSString *userId;
@property(nonatomic,copy) NSString *name;
@property(nonatomic,copy) NSString *avatar;
@property(nonatomic,copy) NSString *avatar;//头像
@property(nonatomic,copy) NSString *tel;
@property(nonatomic,copy) NSString *token;
@end