OC项目-我有一辆车

//
//  PublicFile.h
//  汽车
//
//  Created by 邱学伟 on 15/7/28.
//  Copyright (c) 2015年 jerehedu. All rights reserved.
//

#ifndef ___PublicFile_h
#define ___PublicFile_h

enum _carModel{
    microCar,
    smallCar,
    familyCar,
    bigCar,
    SUV,
    MPV,
    sportCar,
    pickupCar
};

typedef enum _carModel CarModel;

typedef enum _color{
    red,
    white,
    black,
    blue,
    grey,
    yellow,
    green
}Color;

typedef struct _carSize{
    int length;
    int width;
    int high;
}CarSize;

typedef enum _gearbox{
    selfmotion,
    handmovement,
    selfAndHandMovement,
}Gearbox;

typedef enum _configuration{
    lowcon,
    middlecon,
    highcon
}Configuration;

typedef struct _time{
    int year;
    int month;
    int day;
}Time;

typedef enum _navigationSize{
    fiveInch,
    sixInch,
    sevenInch
}NavigationSize;

typedef enum _inputMode{
    handWritten,
    spell,
    fastSpell,
    handWrittenPen
}InputMode;

typedef struct _resolution{
    int left;
    int right;
}Resolution;
#endif
//
//  Screen.h
//  汽车
//
//  Created by 邱学伟 on 15/7/28.
//  Copyright (c) 2015年 jerehedu. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "PublicFile.h"
@interface Screen : NSObject
{

    NSString *_screenBrand;
    Resolution _resolution;
}

-(void)setScreenBrand:(NSString *)screenBrand;
-(NSString *)screenBrand;

-(void)resolution:(Resolution)resolution;
-(Resolution)resolution;

-(void)setScreenBrand:(NSString *)screenBrand andResolution:(Resolution)resolution;

+(instancetype)setScreenBrand:(NSString *)screenBrand andResolution:(Resolution)resolution;

-(void)printScreen;
@end
//
//  Screen.m
//  汽车
//
//  Created by 邱学伟 on 15/7/28.
//  Copyright (c) 2015年 jerehedu. All rights reserved.
//

#import "Screen.h"

@implementation Screen
-(void)setScreenBrand:(NSString *)screenBrand{
    _screenBrand=screenBrand;
}
-(NSString *)screenBrand{
    return _screenBrand;
}

-(void)resolution:(Resolution)resolution{
    _resolution=resolution;
}
-(Resolution)resolution{
    return _resolution;
}

-(void)setScreenBrand:(NSString *)screenBrand andResolution:(Resolution)resolution{
    _screenBrand=screenBrand;
    _resolution=resolution;
}

+(instancetype)setScreenBrand:(NSString *)screenBrand andResolution:(Resolution)resolution{
    Screen *screen = [Screen new];
    [screen setScreenBrand:screenBrand andResolution:resolution];
    return screen;
}
-(void)printScreen{
    NSLog(@"屏幕的品牌是:%@,分辨率为%i*%i",_screenBrand,_resolution.left,_resolution.right);
}

@end
//
//  Navigation.h
//  汽车
//
//  Created by 邱学伟 on 15/7/28.
//  Copyright (c) 2015年 jerehedu. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "PublicFile.h"
#import "Screen.h"
@interface Navigation : NSObject
{
    NSString *_brand;
    float _price;
    NavigationSize _navigationSize;
    Color _navigationColor;
    InputMode _inputMode;
    int _memory;//内存
    BOOL _backCarView;//倒车影像

    @public Screen *_screen;//屏幕类
}

-(NSString*)brand;
-(float)price;
-(NavigationSize)navigationSize;
-(Color)navigationColor;
-(InputMode)inputMode;
-(int)memory;
-(BOOL)backCarView;
-(Screen*)screen;

-(void)setBrand:(NSString *)brand setPrice:(float)price setNavigationSize:(NavigationSize)navigationSize setNavigationColor:(Color)navigationColor  setInputMode:(InputMode)inputMode setMemory:(int)memory setBackCarView:(BOOL)backCarView setScreen:(Screen*)screen;

+(instancetype)setBrand:(NSString *)brand setPrice:(float)price setNavigationSize:(NavigationSize)navigationSize setNavigationColor:(Color)navigationColor  setInputMode:(InputMode)inputMode setMemory:(int)memory setBackCarView:(BOOL)backCarView setScreen:(Screen*)screen;

-(void)printNavigation;

-(NSString*)getNavigationSize:(NavigationSize)navigationSize;

-(NSString*)getNavigationColor:(Color)color;

-(NSString*)getInputMode:(InputMode)inputMode;

-(NSString*)getBackCarView:(BOOL)backCarView;
@end
//
//  Navigation.m
//  汽车
//
//  Created by 邱学伟 on 15/7/28.
//  Copyright (c) 2015年 jerehedu. All rights reserved.
//

#import "Navigation.h"

@implementation Navigation
-(void)setBrand:(NSString *)brand setPrice:(float)price setNavigationSize:(NavigationSize)navigationSize setNavigationColor:(Color)navigationColor  setInputMode:(InputMode)inputMode setMemory:(int)memory setBackCarView:(BOOL)backCarView setScreen:(Screen*)screen{
    _brand=brand;
    _price=price;
    _navigationSize=navigationSize;
    _navigationColor=navigationColor;
    _inputMode=inputMode;
    _memory=memory;
    _backCarView=backCarView;
    _screen=screen;
}

-(NSString*)brand{
    return _brand;
}
-(float)price{
    return _price;
}
-(NavigationSize)navigationSize{
    return _navigationSize;
}
-(Color)navigationColor{
    return _navigationColor;
}
-(InputMode)inputMode{
    return _inputMode;
}
-(int)memory{
    return _memory;
}
-(BOOL)backCarView{
    return _backCarView;
}
-(Screen*)screen{
    return _screen;
}

+(instancetype)setBrand:(NSString *)brand setPrice:(float)price setNavigationSize:(NavigationSize)navigationSize setNavigationColor:(Color)navigationColor  setInputMode:(InputMode)inputMode setMemory:(int)memory setBackCarView:(BOOL)backCarView setScreen:(Screen*)screen{
    Navigation *navigat = [Navigation new];
   [navigat setBrand:brand setPrice:price setNavigationSize:navigationSize setNavigationColor:navigationColor setInputMode:
    inputMode setMemory:memory setBackCarView:backCarView setScreen:screen];
    return navigat;

}

-(void)printNavigation{
    NSLog(@"导航器品牌是:%@,参考价格为:%f元,尺寸是:%@,颜色是:%@色,输入方式为:%@,内存是:%iG,倒车影像:%@,导航器屏幕信息:屏幕的品牌是:%@,分辨率为%i*%i",_brand,_price,[self getNavigationSize:_navigationSize],[self getNavigationColor:_navigationColor],[self getInputMode:_inputMode],_memory,[self getBackCarView:_backCarView],[_screen screenBrand],[_screen resolution].left,[_screen resolution].right);
}

-(NSString*)getNavigationSize:(NavigationSize)navigationSize{
    NSString *str = [NSString new];
    switch (navigationSize) {
        case fiveInch:
            [email protected]"5寸";
            break;
        case sixInch:
            [email protected]"6寸";
            break;
        case sevenInch:
            [email protected]"7寸";
            break;
        default:
            break;
    }
    return str;
}

-(NSString*)getNavigationColor:(Color)color{
    NSString *str = [[NSString alloc]init];
    switch (color) {
        case red:
            [email protected]"红色";
            break;
        case white:
            [email protected]"白色";
            break;
        case black:
            [email protected]"黑色";
            break;
        case blue:
            [email protected]"蓝色";
            break;
        case grey:
            [email protected]"灰色";
            break;
        case yellow:
            [email protected]"黄色";
            break;
        case green:
            [email protected]"绿色";
            break;
        default:
            break;
    }
    return str;
}

-(NSString*)getInputMode:(InputMode)inputMode{
    NSString *str = [[NSString alloc]init];
    switch (inputMode) {
        case handWritten:
            [email protected]"手写";
            break;
        case spell:
            [email protected]"拼音";
            break;
        case fastSpell:
            [email protected]"拼音查询";
            break;
        case handWrittenPen:
            [email protected]"手写笔";
            break;
        default:
            break;
    }
    return str;
}

-(NSString*)getBackCarView:(BOOL)backCarView{
    NSString *str = [[NSString alloc]init];
    switch (backCarView) {
        case YES:
            [email protected]"有";
            break;
        case NO:
            [email protected]"没有";
            break;
        default:
            break;
    }
    return str;
}
@end
//
//  Car.h
//  汽车
//
//  Created by 邱学伟 on 15/7/28.
//  Copyright (c) 2015年 jerehedu. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "PublicFile.h"
#import "Navigation.h"
#import "Screen.h"
@interface Car : NSObject
{
    NSString *_brand;
    CarModel _car;
    Color _carColor;
    float _peace;
    CarSize _carSize;
    Gearbox _gearbox;
    Configuration _configuration;
    Time _time;
    int _allcoverTime;//质保年限
    float _speed;//时速
    float _oilwear;//油耗
    BOOL _skylight;//天窗
    float _oilmeter;//油表

    Navigation *_navigation;//导航
}

-(float)firingCar;

-(void)stopCar;

-(float)addOil;

-(void)setBrand:(NSString*)brand setCar:(CarModel)car setCarColor:(Color)carColor setPeace:(float)peace setSize:(CarSize)carSize setGearbox:(Gearbox)gearbox setConfiguration:(Configuration)configuration setTime:(Time)time setAllcoverTime:(int)allcoverTime setSpeed:(float)speed setOilwear:(float)oilwear setSkylight:(BOOL)skylight setOilmeter:(float)oilmeter setNavigation:(Navigation *)navigation;

+(instancetype)setBrand:(NSString*)brand setCar:(CarModel)car setCarColor:(Color)carColor setPeace:(float)peace setSize:(CarSize)carSize setGearbox:(Gearbox)gearbox setConfiguration:(Configuration)configuration setTime:(Time)time setAllcoverTime:(int)allcoverTime setSpeed:(float)speed setOilwear:(float)oilwear setSkylight:(BOOL)skylight setOilmeter:(float)oilmeter setNavigation:(Navigation *)navigation;

-(void)printCar;

-(NSString*)getCar:(CarModel)car;//获取汽车类型
-(NSString*)getCarColor:(Color)color;//获取汽车颜色
-(NSString*)getGearbox:(Gearbox)gearbox;//获取变速箱类型
-(NSString*)getConfiguration:(Configuration)configuration;//获取配置
@end
//
//  Car.m
//  汽车
//
//  Created by 邱学伟 on 15/7/28.
//  Copyright (c) 2015年 jerehedu. All rights reserved.
//

#import "Car.h"

@implementation Car

-(float)firingCar{
    _oilmeter--;
    return _oilmeter;
}

-(void)stopCar{
    NSLog(@"汽车停止");
}

-(float)addOil{
    _oilmeter++;
    return _oilmeter;
}

-(void)setBrand:(NSString*)brand setCar:(CarModel)car setCarColor:(Color)carColor setPeace:(float)peace setSize:(CarSize)carSize setGearbox:(Gearbox)gearbox setConfiguration:(Configuration)configuration setTime:(Time)time setAllcoverTime:(int)allcoverTime setSpeed:(float)speed setOilwear:(float)oilwear setSkylight:(BOOL)skylight setOilmeter:(float)oilmeter setNavigation:(Navigation *)navigation{
    _brand=brand;
    _car=car;
    _carColor=carColor;
    _peace=peace;
    _carSize=carSize;
    _gearbox=gearbox;
    _configuration=configuration;
    _time=time;
    _allcoverTime=allcoverTime;
    _speed=speed;
    _oilwear=oilwear;
    _skylight=skylight;
    _oilmeter=oilmeter;
    _navigation=navigation;

}

+(instancetype)setBrand:(NSString*)brand setCar:(CarModel)car setCarColor:(Color)carColor setPeace:(float)peace setSize:(CarSize)carSize setGearbox:(Gearbox)gearbox setConfiguration:(Configuration)configuration setTime:(Time)time setAllcoverTime:(int)allcoverTime setSpeed:(float)speed setOilwear:(float)oilwear setSkylight:(BOOL)skylight setOilmeter:(float)oilmeter setNavigation:(Navigation *)navigation{
    Car *car0=[[Car alloc]init];
    [car0 setBrand:brand setCar:car setCarColor:carColor setPeace:peace setSize:carSize setGearbox:gearbox setConfiguration:configuration setTime:time setAllcoverTime:allcoverTime setSpeed:speed setOilwear:oilwear setSkylight:skylight setOilmeter:oilmeter setNavigation:navigation];
    return car0;
}

-(void)printCar{
    NSLog(@"汽车的品牌是:%@,车型是:%@,车的颜色是:%@色,汽车的参考价格为:%f元,汽车的尺寸为:%i*%i*%i ,变速箱是:%@的,该车配置是:%@的,上市日期是:%i年%i月%i日,质保年限是:%i年,时速:%f km/h, 油耗是:%f 个油,%@ 天窗,油表 %f L,该车导航器的信息是:导航器品牌是:%@,参考价格为:%f元,尺寸是:%@,颜色是:%@色,输入方式为:%@,内存是:%iG,倒车影像:%@,导航器屏幕信息:屏幕的品牌是:%@,分辨率为%i*%i",_brand,[self getCar:_car],[self getCarColor:_carColor],_peace,_carSize.length,_carSize.width,_carSize.high,[self getGearbox:_gearbox],[self getConfiguration:_configuration],_time.year,_time.month,_time.day,_allcoverTime,_speed,_oilwear,[self getSkylight:_skylight],_oilmeter,[_navigation brand],[_navigation price],[_navigation getNavigationSize:_navigation.navigationSize],[_navigation getNavigationColor:_navigation.navigationColor],[_navigation getInputMode:_navigation.inputMode],[_navigation memory],[_navigation getBackCarView:_navigation.backCarView],_navigation->
          _screen.screenBrand,_navigation.screen.resolution.left,_navigation.screen.resolution.right);
}

-(NSString*)getCar:(CarModel)car{//获取汽车类型
    NSString *str;
    switch (car) {
        case microCar:
            [email protected]"微型车";
            break;
        case smallCar:
            [email protected]"小型车";
            break;
        case familyCar:
            [email protected]"中型车";
            break;
        case bigCar:
            [email protected]"大型车";
            break;
        case SUV:
            [email protected]"SUV";
            break;
        case MPV:
            [email protected]"MPV";
            break;
        case sportCar:
            [email protected]"跑车";
            break;
        case pickupCar:
            [email protected]"皮卡";
            break;
        default:
            break;
    }
    return str;
}

-(NSString*)getCarColor:(Color)color{//获取汽车颜色
    NSString *str;
    switch (color) {
        case red:
            [email protected]"红色";
            break;
        case white:
            [email protected]"白色";
            break;
        case black:
            [email protected]"黑色";
            break;
        case blue:
            [email protected]"蓝色";
            break;
        case grey:
            [email protected]"灰色";
            break;
        case yellow:
            [email protected]"黄色";
            break;
        case green:
            [email protected]"绿色";
            break;
        default:
            break;
    }
    return str;
}

-(NSString*)getGearbox:(Gearbox)gearbox{//获取变速箱类型
    NSString *str;
    switch (gearbox) {
        case selfmotion:
            [email protected]"自动挡";
            break;
        case handmovement:
            [email protected]"手动挡";
            break;
        case selfAndHandMovement:
            [email protected]"手自一体挡";
        default:
            break;
    }
    return str;
}

-(NSString*)getConfiguration:(Configuration)configuration{//获取配置
    NSString *str;
    switch (configuration) {
        case lowcon:
            [email protected]"低配";
            break;
        case middlecon:
            [email protected]"中配";
            break;
        case highcon:
            [email protected]"高配";
        default:
            break;
    }
    return str;
}

-(NSString*)getSkylight:(BOOL)skylight{//获取天窗配置
    NSString *str;
    switch (skylight) {
        case YES:
            [email protected]"有";
            break;
        case NO:
            [email protected]"没有";
            break;
        default:
            break;
    }
    return str;
}
@end

//
//  main.m
//  汽车
//
//  Created by 邱学伟 on 15/7/28.
//  Copyright (c) 2015年 jerehedu. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "PublicFile.h"
#import "Car.h"
#import "Navigation.h"
#import "Screen.h"
/*
 使用面向对象的思想描述车类

 汽车类:
 属性:
 品牌  字符串
 车型  (枚举值:微型车、小型车、中型车、大型车、SUV、MPV、跑车、皮卡)
 颜色  (枚举值:红色、白色、黑色、蓝色、灰色、黄色、绿色…)
 参考价格    浮点
 尺寸 (结构体:长、宽、高)
 变速箱 (枚举值:自动、手动、手自一体)
 配置  (枚举:低配、中配、高配)
 上市日期  (结构体)
 质保年限   整型
 时速  浮点
 油耗    浮点
 天窗   布尔
 油表  浮点
 导航

 方法:1、成员变量的set、get方法
 2、启动  (每启动一次,油减少一点)
 3、停止
 4、加油 (油表改变)
 4、类方法得到对象
 5、类方法得到一个已经实现多个实例变量赋值的对象
 6、汽车信息展示

 导航类
 属性:
 品牌  字符串
 参考价格    浮点
 尺寸 (枚举:5英寸、6英寸、7英寸)
 颜色  (枚举值)
 输入方式 (枚举:手写、拼音、快拼查询、手写笔)
 内存  (8/16/32/64)
 倒车影像  布尔
 屏幕

 方法:1、成员变量的set、get方法
 2、对象方法多参设置
 3、类方法多参设置
 4、展示信息

 屏幕类
 属性:
 品牌  字符串
 分辨率 (例:800*480)

 方法:1、成员变量的set、get方法
 2、对象方法多参设置
 3、类方法多参设置
 4、展示信息
 */
int main(int argc, const char * argv[]) {
    @autoreleasepool {
        Navigation *navigetion1=[[Navigation alloc]init];

        Screen *screen1=[[Screen alloc]init];

        Car *car1=[[Car alloc]init];

        Resolution resolution1;
        resolution1.left=1280;
        resolution1.right=998;

        CarSize carSize1;
        carSize1.length=1024;
        carSize1.width=998;
        carSize1.high=688;

        Time time1;
        time1.year=2015;
        time1.month=9;
        time1.day=6;

        [screen1 setScreenBrand:@"三星" andResolution:resolution1];
        [screen1 printScreen];

        [navigetion1 setBrand:@"高德" setPrice:999 setNavigationSize:sixInch setNavigationColor:red setInputMode:handWritten setMemory:64 setBackCarView:YES setScreen:screen1];
        [navigetion1 printNavigation];

        [car1 setBrand:@"奔驰" setCar:SUV setCarColor:red setPeace:500000 setSize:carSize1 setGearbox:selfAndHandMovement setConfiguration:middlecon setTime:time1 setAllcoverTime:3 setSpeed:230 setOilwear:7 setSkylight:NO setOilmeter:122 setNavigation:navigetion1];
        [car1 printCar];
    }
    return 0;
}

总结:

零碎知识点的堆砌,历时接近6个小时,小错误不过最终看到自己的奔驰在屏幕上输出也算松了一口气,没事时候看看,虽然简单,代表性很强!

运行结果:

版权声明:本文为博主原创文章,未经博主允许不得转载。

时间: 2024-11-09 03:07:23

OC项目-我有一辆车的相关文章

OC项目中使用Swift

OC项目中使用Swift 本文版权归作者所有,如需转载请联系孟祥月 CSDN博客:http://blog.csdn.net/mengxiangyue 独立博客:http://mengxiangyue.com 最近公司的项目开始计划使用Swift,由于原先的工程都是使用OC编写的,不可能一下全部转换成Swift,所以采用OC与Swift混编的方式是最好的选择.这篇文章只是一个简单的介绍,并没有太高深的知识. 我新建了一个演示的OC工程,当然你可以使用你已经存在的OC的工程.如果我们想要在OC工程中

36辆车和6个赛道,筛选出最快的3辆车

问题描述:有36辆赛车和6条跑道,没有计时器的前提下,最少用几次比赛可以筛选出最快的3辆赛车? 情况1:不能标记 将36辆车分成6组,每组6辆车,每组分别进行比赛,留下每组的前3名.还有18辆车(6次) 将18辆车分成3组,每组6辆车,每组分别进行比赛,留下每组的前3名.还有9辆车(3次) 从9辆车中选择6辆进行一次比赛,留下前3名.留下的3辆车和没有参加比赛的3辆车,还有6辆车(1次) 最后6辆车比赛选出前3名(1次) 总共6+3+1+1=11次 情况2:可以标记 方法1(8次) 将36辆车分

在OC项目工程中混编Swift

1.创建一个OC项目工程,然后在Build Settings中找到如下字段,修改. 2.然后在项目中创建swift文件,如果系统提示是否需要创建桥接文件的时候,点击确定. 然后在Build Settings,查找swift, 如图所示,会显示两个文件,一个上桥接文件(在项目工程中可见), 另一个是swift编译的.h文件(在项目工程中不可见), 但是可以使用按住Option+点击的方式进入查看. 3. 新建的swift类必须继承自NSObject或其子类,(NSObject是所有类的子类). 否

在OC项目中添加Swift文件并实现混合编程

对于已经工作的开发者,并不适合也没有条件从一个全新的swift项目开始,进行开发. 虽然网上关于swift和oc混合编程的教程比较多,但是大多是基于 swift项目的,所以对咱们 OCer的参考价值有一定折扣. 现在swift虽然仍然存在很多缺陷,但是鉴于苹果的强势,是时候在项目中把简单的功能交给swift了,给自己,给项目,给swift一个缓冲区,都是极好的. 说了这么多,开始上代码. 现在的背景是: 已经有一个oc项目了,我想要加入 swfit,并且实现 oc调用 swift ,swift调

iOS 中 OC项目使用swift第三方工具(OC、swift 混合)

OC项目引入swift, 1.建立 bridge 文件:在OC工程中新建swift文件,确认创建时,会提示建立 一个 项目名-bridging-header.h 文件. 2,建立 bridge 文件之后,在其中引入要用的 文件名  import 例如使用Charts 时: @import Charts; Charts : 各种统计图形(饼状图.折线图.柱状图等等)工具,流畅好用,效果给力. 3,在工程中需要用到第三方的时候,引入该 bridge 文件即可:

天津爆炸对车市影响多大?近万辆车受损、进出口暂停

受爆炸影响,全球第四大港口——天津港暂停了所有进出口业务.这个过程中,物流公司的运力调配,将成为评价爆炸对汽车行业影响的关键. 爆炸发生后的第一个周末,一汽丰田泰达工厂的员工收到了一条关于延长3天假期的通知,同样距离爆炸地点约70公里外的西青工厂的员工也收到了相应的停产 通知,因为它们需要泰达工厂提供的零部件.相对一汽丰田,其他依赖于天津港的汽车企业正在迅速转换港口,迅速降低影响. 一汽丰田产能受影响 对于7月份跑赢大盘的一汽丰田而言,这场爆炸或将使其错失“乘胜追击”的机会.而泰达工厂的修复速度

驭势科技吴甘沙:无人驾驶车已经不是你熟悉的那辆车

作为与人工智能和人们出行息息相关的应用场景之一,自动驾驶汽车正在被越来越多的人所关注.然而,2018年3月19日,Uber无人车路测时撞死了违章通过马路的行人,而当时车上其实有一名操作人员:随后在3月29日的NVIDIA GTC 2018大会上,NVIDIA CEO黄仁勋宣布叫停公共道路上的无人驾驶路测.随着智能汽车以及相关技术和厂商的不断投入.发展,自动驾驶汽车特别是无人驾驶汽车的未来越来越受到人们的憧憬.然而,在现实与理想之间,无人驾驶正徘徊在十字路口. 现在公认的两种实现全自动驾驶又称无人

2020 OC项目集成flutter

看了网上基本上都是相同套路,但是到我这就不行了,终于解决了, 主要就是profile文件编写, 1.在oc项目的同级目录项创建flutter模块 就是在oc项目的父级目录下,执行 flutter create --template module flutter_module 2.在oc项目中创建profile文件 pod init 3.修改profile文件 尽量使用相对路径 #新添加的代码 flutter_application_path = '../my_flutter' load File

用Swift重写公司OC项目(Day1)--程序的AppIcon与LaunchImage如何设置

公司之前的APP呢经过了两次重写,都是使用OC由本人独立开发的,不过这些东西我都不好意思说是自己写的,真心的一个字:丑!!! 客观原因来说主要是公司要的特别急,而且注重的是功能而非效果,公司的美工之前也没做过APP之类的工作;但是从主观方面来说还是对自己的要求有些低了,所以,这两天思考许久,打算在公司的事情不多的闲暇点的时间学习写Swift,顺带把之前的项目再次重写一下. 闲话不说了,先创建一个swift的项目 创建完毕之后,退出程序,因为我们这里使用cocoapod来管理项目,至于cocoap