北京天宇联科技有限责任公司—T语言Ios开发命名规范

T语言(ttyu software language )是一种通过定义的方式自动生成原生态的android、ios和自适应各浏览的h5的web页面的三合一的软件开发语言。T语言是一种简单的,易于使用的开发软件。T语言运用TC简单开发。

TC简单开发是国内首款免费多线程的图形界面脚本制作开发工具软件,支持中英文双语言编写脚本程序,综合脚本开发工具,可以说TC开脚本界先河 ,是免费脚本开发制作工具的首选。通过制作脚本,可以让TC简单开发代替您的双手,自动执行一系列鼠标键

动作。能陪伴你每日每夜的脚本开发工具,简单,轻松,强大,一个开发工具可以开发windows,安卓两个平台的应用 。在制作脚本时可以支持多种脚本功能语句,包括键盘按键动作、鼠标点击动作、鼠标移动动作、控制动作、输入字符串动作、延迟动作等。每个动作都可以进行循环,你可以定义热键中止动作的循环,也可以自己定义循环的次数或者循环的时间 。

     T语言在开发los时,有一定的自己的命名规范。

1.控件命名:

解释:必须后面加控件的类型。而且起的名字必须有意义,尽量用英文。且首字母为小写。其余每个单词的首字母为大写

 1.1按钮命名

@property (nonatomic, strong) UIButton *loginButton;

1.2图片命名

@property (nonatomic, strong) UIImageView *myImageView;

1.3标签命名

@property (nonatomic, strong) UIlabel *phoneLable;

其余同上

1.4文本输入框

@property (strong, nonatomic) UITextField*passWordTextField;

1.5 列表

@property (strong, nonatomic) UITableView *myTableView;

     1.6选择控制器

@property (strong, nonatomic) UISegmentedControl*mySegmentedController;

     1.7时间选择器

@property (strong, nonatomic) UIPickerView *myPickerView;

 

    2.所有方法名;

解释:名字必须要有意义。

2.1.点击事件

2.1.1按钮点击

按钮点击:按钮的名字加Clicked:

[loginButton addTarget:self action:@selector(loginButtonClicked:)forControlEvents:UIControlEventTouchUpInside];

2.1.2 单机手势点击事件

UIGestureRecognizer*singleGestureRecognizer = [[UIGestureRecognizer alloc] initWithTarget:selfaction:@selector(singleGestureRecognizerClick:)];

 

2.1.3  进入视图:必须加入Vc

    HomeViewController *homeVc =[[HomeViewController alloc] init];

[selfpresentViewController:homeVc animated:YES completion:nil];

2.2.其他处理详细在demo中

3.创建.h

列子:看当前视图所继承的。

3.1  继承ViewController

HomeViewController.h

 

3.2  继承View

HomeView.h

 3.3继承NSObject

如果是model。命名必须加model

其他:待定

    4.颜色 :使用#dede# 格式

    5.图片 :禁止中文 ,可以拼音。后缀名为png。 所有图标均要2x(5s) 和3x(6s)

         loginRegister_account@2x.png  

6.代码规范

要求:

l  每个变量要注释

l  每个方法名要注释

l  每个所定义变量名空行

l  方法与方法之间空行

 示例:demo

 #import "ViewController.h"

#import "Masonry.h"

 @interface ViewController ()<UITableViewDataSource,UITableViewDelegate>

 /*1.与第一行最后一行空一行,  定义每个控件空一行*

  2.变量必须加注释/

 

//视图

@property (strongnonatomicUIView *containterView;

 

//可变数组

@property (strongnonatomicNSMutableArray *modelArr;

 

//显示消息按钮

@property (strongnonatomicUIButton *showMessageButton;

 

//列表

@property (strongnonatomicUITableView *tableView;

 

@end

 

@implementation ViewController

 

#pragma mark - life cycle 生命周期

- (instancetype)initWithDictionary:(NSDictionary *)dictionary

{

    if (self =[super init]) {

       

    }

    return self;

}

/*注意方法与方法之间空格*/

- (void)viewDidLoad {

    [super viewDidLoad];   

    [self initHeaderBar];

    [self initData];

    [self initAdditionalControl];   

}

 

//导航栏处理

- (void)initHeaderBar

{

 

}

 

//返回视图

- (void)backView

{

   

}

 

//初使数据

- (void)initData

{

    //这里进行网络请求,下拉刷新和上啦加载(ps:这里按照项目根据逻辑处理)

    [self sendHttp];

    [self addPullDownRefresh];

    [self addTopPullLoading];

}

 

//发送网络请求

- (void)sendHttp

{

   

}

 

//下拉刷新

- (void)addPullDownRefresh

{

   

}

 

//上拉加载

- (void)addTopPullLoading

{

   

}

 

//加入视图

- (void)initAdditionalControl

{

// 必须用__weak 修饰,只要是用到block块,自己掉用自己,必须进行修饰。

    [self.view addSubview:self.showMessageButton];

    [self.view mas_makeConstraints:^(MASConstraintMaker *make) {

        ;

    }];

   

    [self.view addSubview:self.tableView];

    [self.tableView mas_makeConstraints:^(MASConstraintMaker *make) {

        ;

    }];   

}

 

#pragma mark - event response点击事件

- (void)showMessageButtonClick:(id)sender

{

    ;

}

 

#pragma mark – UITableViewCellDelegate i代理方法

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section

{   

    return 10;

}

 

- (UITableViewCell *)tableView:(UITableView *)tableViewcellForRowAtIndexPath:(NSIndexPath *)indexPath

{   

    static NSString *cellId= @"cellId";

    UITableViewCell *cell= [tableView dequeueReusableCellWithIdentifier:cellId];

    if (!cell) {

        cell = [[UITableViewCell allocinitWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:cellId];

    }   

    return cell;   

}

 

#pragma mark - getter and setter 懒加载

- (UIView *)containterView

{

    if (!_containterView) {

        _containterView =[[UIView allocinit];

        _containterView.backgroundColor =[UIColor clearColor];

    }

    return _containterView;

}

 

- (NSMutableArray *)modelArr

{

    if (!_modelArr) {

        _modelArr =[[NSMutableArray allocinit];

    }

    return _modelArr;

}

 

-(UIButton *)showMessageButton

{

    if (_showMessageButton == nil) {

        _showMessageButton = [[UIButton allocinit];

        _showMessageButton.backgroundColor = [UIColor redColor];

        [_showMessageButton addTarget:self action:@selector(showMessageButtonClick:)forControlEvents:UIControlEventTouchUpInside];

    }

    return _showMessageButton;

}

 

-(UITableView *)tableView

{

    if (_tableView == nil) {

        _tableView =[[UITableView allocinitWithFrame:self.view.frame style:UITableViewStylePlain];

        _tableView.delegate = self;

        _tableView.dataSource = self;

    }

    return _tableView;

}

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值