zoukankan      html  css  js  c++  java
  • 人在千锋--网络学习之开发项目爱限免

    1、完整项目开发流程:

        产品经理做需求调研,编写需求

        产品经理完成产品原型

        项目经理开会

        美工配合产品经理出效果图,剪切图

        ios,android分析需要分配任务,项目经理制定开发进度

        服务端和客户端制定接口

        客户端根据需求完成文档

     

     2、版本控制的作用

        多人协作开发项目:每个只修改自己的模板,修改过后需要同步每个修改版本控制,每个阶段代码都有版本

        解决方法:使用版本控制工具

        工具:SVN  GIB(开源世界比较流行)

     

     3、Versions的使用

        1、连接到SVN服务器

            利用Versions工具

        2、导入新的工程

            原来的工程没有svn,可以删除原来的工程

        3、检出checkout

            检出的项目,有svn文件夹

        4、更新 upadate (一更新别人的修改)

        5、修改代码之后 commit ,版本号Base会改变

     */

     4、封装Button和UIView 

    #import <UIKit/UIKit.h>
    
    @interface ZJButton : UIButton
    //点击后 执行block
    //注意:block的属性修饰符必须是copy
    @property(copy,nonatomic)void(^action)(UIButton *button);
    
    @end
    #import "ZJButton.h"
    
    @implementation ZJButton
    
    /*
    // Only override drawRect: if you perform custom drawing.
    // An empty implementation adversely affects performance during animation.
    - (void)drawRect:(CGRect)rect {
        // Drawing code
    }
    */
    
    -(instancetype)initWithFrame:(CGRect)frame
    {
        if (self=[super initWithFrame:frame]) {
            [self addTarget:self action:@selector(btnClick:) forControlEvents:UIControlEventTouchUpInside];
        }
        return self;
    }
    //让其去转而去执行block
    -(void)btnClick:(UIButton *)button
    {
        if (self.action) {
            self.action(self);
        }
    }
    @end
    //=========================================
    #import <UIKit/UIKit.h>
    
    @interface UIView (LCQuickControl)
    //添加系统按钮  void(^action)(UIButton *button)
    -(UIButton *)addSystemButtonWithFrame:(CGRect )frame
                                    title:(NSString *)title
                                   action:(void(^)(UIButton *button))action;
    
    //添加图片按钮
    -(UIButton *)addImageButtonWithFrame:(CGRect )frame
                                   title:(NSString *)title
                              background:(NSString *)backgroud
                                   action:(void(^)(UIButton *button))action;
    
    //添加图片视图
    -(UIImageView *)addImageViewWithFrame:(CGRect)frame
                                    image:(NSString *)image;
    //添加lebel
    -(UILabel *)addLabelWithFrame:(CGRect)frame
                             text:(NSString *)text;
    @end
    
    
    #import "UIView+LCQuickControl.h"
    #import "ZJButton.h"
    
    @implementation UIView (LCQuickControl)
    //添加系统按钮
    -(UIButton *)addSystemButtonWithFrame:(CGRect)frame title:(NSString *)title action:(void (^)(UIButton *))action
    {
        ZJButton *button=[ZJButton buttonWithType:UIButtonTypeSystem];
        button.frame=frame;
        [button setTitle:title forState:UIControlStateNormal];
        button.action=action;
        [self addSubview:button];
        return button;
        
    }
    //添加图片按钮
    -(UIButton *)addImageButtonWithFrame:(CGRect )frame
                                   title:(NSString *)title
                              background:(NSString *)backgroud
                                  action:(void(^)(UIButton *button))action
    {
        ZJButton *button=[ZJButton buttonWithType:UIButtonTypeCustom];
        button.frame=frame;
        [button setTitle:title forState:UIControlStateNormal];
        [button setBackgroundImage:[UIImage imageNamed:backgroud] forState:UIControlStateNormal];
        button.action=action;
        [self addSubview:button];
        return button;
        
    }
    
    //添加图片视图
    -(UIImageView *)addImageViewWithFrame:(CGRect)frame
                                    image:(NSString *)image
    {
        UIImageView *imageView=[[UIImageView alloc]initWithFrame:frame];
        imageView.image=[UIImage imageNamed:image];
        imageView.userInteractionEnabled=YES;
        [self addSubview:imageView];
        return imageView;
    }
    
    //添加lebel
    -(UILabel *)addLabelWithFrame:(CGRect)frame
                             text:(NSString *)text
    {
        UILabel *label=[[UILabel alloc]initWithFrame:frame];
        label.text=text;
        [self addSubview:label];
        return label;
        
    }
    
    @end

    5、非常简单获取model的属性的方法

     NSDictionary *dict=[NSJSONSerialization JSONObjectWithData:responseObject options:NSJSONReadingMutableContainers error:nil];
            NSArray *appList=dict[@"applications"];
            for (NSDictionary *appDict in appList) {
                
                [self createModelCodeWithDictionary:appDict
                                    name:@"model"
                
            }
            
        } 。。。。。。
    -(void)createModelCodeWithDictionary:(NSDictionary *)dict
                                    name:(NSString *)name
    {
        printf("
    @interface %s : NSOBject
    ",name.UTF8String);
        
        for (NSString *key in dict) {
            printf("@property(nonatomic,copy)NSString *%s;
    ",key.UTF8String);
    
        }
        printf("@end
    ");
    }

  • 相关阅读:
    python 找到列表中满足条件的元素
    android activity动画anim
    Maven实战(Maven+Nexus建立私服【Linux系统】)
    linux命令
    服务端工程师入门与进阶 Java 版
    jvm字节占用空间分析
    Spark Streaming容错的改进和零数据丢失
    Spark分布式计算和RDD模型研究
    Apache Curator入门实战
    spark简单总结—短小精悍
  • 原文地址:https://www.cnblogs.com/muer126/p/4403653.html
Copyright © 2011-2022 走看看