ios设计一部WindowsPhone手机

main.m

#import <Foundation/Foundation.h>
#import "WindowsPhone.h"
int main(int argc, const char * argv[])
{ WindowsPhone * phone = [WindowsPhone new];
phone->_color = WindowsPhoneColorGolden;
phone->_size = 3.5;
NSLog(@"%@",phone);
[phone cameraWithFlashLightSatuts:WindowsPhoneFlashLightStatusOpen]; @autoreleasepool { // insert code here...
//NSLog(@"Hello, World!"); }
return 0;
}

WindowsPhone.h

#import <Foundation/Foundation.h>

enum WindowsPhoneSize
{
WindowsPhoneSize3Point5,//屏幕尺寸3.5
WindowsPhoneSize4Point0,//屏幕尺寸4.0
WindowsPhoneSize5Point5,//屏幕尺寸5.5
WindowsPhoneSize6Point0 //屏幕尺寸6.5
};
typedef enum WindowsPhoneSize WindowsPhoneSize; enum WindowsPhoneColor
{
WindowsPhoneColorWhite,//用来存储WidowsPhone的颜色白色
WindowsPhoneColorGolden,//用来存储WindowsPhone的颜色土豪金
WindowsPhoneColorBlack //用来存储WindowsPhone的颜色黑色
}; typedef enum WindowsPhoneColor WindowsPhoneColor; enum WindowsPhoneFlashLightStatus
{
WindowsPhoneFlashLightStatusOpen,//闪关灯开
WindowsPhoneFlashLightStatusClose,//闪光灯关
WindowsPhoneFlashLightStatusAuto//自己主动模式
}; typedef enum WindowsPhoneFlashLightStatus WindowsPhoneFlashLightStatus; //记录电影播放的状态
enum WindowsPhoneFilmPlayStatus
{
WindowsPhoneFilmPlayStatusStart,//状态:開始播放
WindowsPhoneFilmPlayStatusPause,//状态:暂停播放
WindowsPhoneFilmPlayStatusFastSpeed,//状态:快进
WindowsPhoneFilmPlayStatusSlowSpeed, //状态:快退
WindowsPhoneFilmPlayStatusLastFilm,//状态:上一部
WindowsPhoneFilmPlayStatusNextFilm //状态:下一部 }; typedef enum WindowsPhoneFilmPlayStatus WindowsPhoneFilmPlayStatus; @interface WindowsPhone : NSObject
{
@public
/**用来存储WindowsPhone的颜色*/
WindowsPhoneColor _color; /**用来存储WindowsPhone的尺寸大小*/
float _size; /**用来存储WindowsPhone cpu的大小*/
float _cpu;
/**用来存储WindowsPhone ram内部存储的大小*/
float _ram;
} //setter 方法
-(void)setWindowsPhoneSize:(float)size; /**打开闪光灯*/
-(void)openFlashLight; /**关闭闪光灯*/
-(void)closeFlashLight; /**自己主动模式*/
-(void)flaseLightAuto; /**拍照*/
-(void)cameraWithFlashLightSatuts:(WindowsPhoneFlashLightStatus)flashLightStatus;
/**看电影*/
-(void)filmWithPlayStatus:(WindowsPhoneFilmPlayStatus)WindowsPhoneFilmPlayStatus;
/**发邮件*/
-(void)sendEmail; @end

WindowsPhone.m

#import "WindowsPhone.h"

@implementation WindowsPhone
/**打开闪光灯*/
-(void)openFlashLight
{
//打开闪光灯
NSLog(@"打开闪光灯");
} /**关闭闪光灯*/
-(void)closeFlashLight
{
//关闭闪光灯
NSLog(@"关闭闪光灯");
}
/**自己主动模式*/
-(void)flaseLightAuto
{
//自己主动模式
NSLog(@"自己主动模式");
}
//拍照
-(void)cameraWithFlashLightSatuts:(WindowsPhoneFlashLightStatus)flashLightStatus
{
//self keyword 谁调用指的就是谁 能够实现类的内部方法的调用
if(flashLightStatus == WindowsPhoneFlashLightStatusOpen)
{
[self openFlashLight];
//打开摄像头
}
else if(flashLightStatus==WindowsPhoneFlashLightStatusClose)
{
[self closeFlashLight];
//关闭摄像头
}
else
{
[self flaseLightAuto];
//自己主动模式
} NSLog(@"拍照了! 笑一个!");
//用switch来实现这个功能
/*
switch(flashLightStatus)
{
case WindowsPhoneFlashLightStatusOpen:
[self openFlashLight];
break;
case WindowsPhoneFlashLightStatusClose:
[self closeFlashLight];
break;
case WindowsPhoneFlashLightStatusAuto:
[self flaseLightAuto];
break;
default:
break;
}
*/ } //看电影
-(void)filmWithPlayStatus:(WindowsPhoneFilmPlayStatus)WindowsPhoneFilmPlayStatus
{
if(WindowsPhoneFilmPlayStatus == WindowsPhoneFilmPlayStatusStart){
//開始播放电影
NSLog(@"開始播放电影");
}
else if (WindowsPhoneFilmPlayStatus == WindowsPhoneFilmPlayStatusPause)
{
//暂停播放
NSLog(@"暂停播放");
}
else if(WindowsPhoneFilmPlayStatus == WindowsPhoneFilmPlayStatusFastSpeed)
{
//快进
NSLog(@"快进");
}
else if(WindowsPhoneFilmPlayStatus == WindowsPhoneFilmPlayStatusSlowSpeed)
{
//快退
NSLog(@"快退");
}
else if(WindowsPhoneFilmPlayStatus==WindowsPhoneFilmPlayStatusLastFilm)
{
//上一部电影
NSLog(@"播放上一部电影");
}
else if(WindowsPhoneFilmPlayStatus == WindowsPhoneFilmPlayStatusNextFilm)
{
//下一部电影
NSLog(@"播放下一部电影");
}
else
{
//退出
NSLog(@"退出");
} }
//setter 方法
-(void)setWindowsPhoneSize:(float)size
{
_size = 3.5;
} //重写description方法
//这里重写方法要注意是重写的是对象方法还是类的方法
//用来调试 -(NSString *)description
{
return [NSString stringWithFormat:@"size = %f cpu = %f ram = %f ",_size,_cpu,_ram];
}
@end

ios设计一部WindowsPhone手机的更多相关文章

  1. 设计一部iphone手机用面向对象的方法

    main.m //编辑字体大小command + < //编译执行快捷键 com + R #import <Foundation/Foundation.h> #import &quo ...

  2. 学习iOS设计--iOS8的颜色、文字和布局学习

    在去年,Apple针对新时代用户彻底更新了其设计语言.现在的设计语言相对之前大为简化,能够让设计师将精力集中到动画和功能上,而不是繁复的视觉细节上. 很多人都曾问过我:设计应当如何入门?成为一名优秀设 ...

  3. 非官方的iOS设计指南

    非官方的iOS设计指南 有时候为iOS设计app并不是一件简单的事,但是如果你能找到正确的最新的苹果设备信息,并按照正确的方向,那么为iOS设计app或许会变得简单容易些. 关于这些指南 这些指南描述 ...

  4. iOS系统下 的手机屏幕尺寸 分辨率 及系统版本 总结

    今天  我对iOS系统下 的手机屏幕尺寸 分辨率 及系统版本做了一次系统总结 供大家参考. 首先 是系统:    随着iOS 系统不断升级,现在已经到iOS7.0了, 并且TA有了很多新变化,最震撼的 ...

  5. 【译】UI设计基础(UI Design Basics)--为iOS设计(Design for iOS)(二)

    2.1 为iOS设计(Design for iOS) iOS体现以下主题: 遵从:UI帮助用户理解界面内容并与内容交互,但绝不会与内容相互冲突. 清晰:文本在任何尺寸下都是清晰易读,图标精确易懂,装饰 ...

  6. 学习ios设计(1)

    两年前,苹果为现代的使用者完全改变了设计语言.对于设计者来说,这使得他们更容易关注动画和功能而不是其他的细枝末节. 我已经被问过很多次怎样开始设计或者是有什么捷径可以成为更好的设计师.虽然没有银弹,然 ...

  7. iOS设计指南

    备忘:iOS设计指南:http://www.ui.cn/detail/32167.html

  8. iOS设计 - 一款APP从设计稿到切图过程概述

    这篇文章站在GUI设计师的角度概述了APP从项目启动到切片输出的过程,相当于工作流程的介绍.这里写的不是一种规范,只是一种工作方法,加上技术的更新是非常快的,大家在具体工作中,一定要灵活运用. 这里我 ...

  9. Android,ios,WP三大手机系统对比

    从前,我以为.一个手机系统只是一个系统的UI风格,没什么不同的.然而,在我混合使用这三个手机系统之后,才明白,一个手机系统远不只一个UI那么简单,而真的是可以称之为一个“生态”. 首先祭出三台经典设备 ...

随机推荐

  1. NYOJ999 师傅又被妖怪抓走了

    只记得当下的眼疼 , ok 各种数据也试了 , 就是 他娘的不对 , 我也是醉了 . 也是日了最野的狗 附上日了哮天犬的代码 , 这个题 先放放, 一段时间后再试试 , 明天开始状态压缩吧 .为期两天 ...

  2. BZOJ 3679 数位DP

    思路: f[i][j]表示i位数乘积为j的方案数 j的取值最多5000多种,那就开个map存一下好了 f[i][mp[k*rec[j]]]+=f[i-1][j]; //By SiriusRen #in ...

  3. create-react-app 引入ant design 及 使用 less

    全局引入: 第一步:全局安装 create-react-app npm install create-react-app -g 第二步:安装 yarn npm install -g yarn 第三步: ...

  4. 复习java基础第二天(异常处理)

    一.常见的异常类型: public class TestException { public static void main(String[] args) { int i = 10; //数学异常: ...

  5. dubbo之负载均衡

    在集群负载均衡时,Dubbo提供了多种均衡策略,缺省为random随机调用. Random LoadBalance 随机,按权重设置随机概率. 在一个截面上碰撞的概率高,但调用量越大分布越均匀,而且按 ...

  6. 三维重建7:Visual SLAM算法笔记

    VSLAM研究了几十年,新的东西不是很多,三维重建的VSLAM方法可以用一篇文章总结一下. 此文是一个好的视觉SLAM综述,对视觉SLAM总结比较全面,是SLAM那本书的很好的补充.介绍了基于滤波器的 ...

  7. css3基础篇三

    CSS3 文本阴影 在 CSS3 中,text-shadow 可向文本应用阴影. 您能够规定水平阴影.垂直阴影.模糊距离,以及阴影的颜色: 实例 向标题添加阴影: h1 { text-shadow: ...

  8. (转)C#开发微信门户及应用(4)--关注用户列表及详细信息管理

    http://www.cnblogs.com/wuhuacong/p/3695213.html 在上个月的对C#开发微信门户及应用做了介绍,写过了几篇的随笔进行分享,由于时间关系,间隔了一段时间没有继 ...

  9. HDU_5690_快速幂,同余的性质

    All X Time Limit: 2000/1000 MS (Java/Others)     Memory Limit: 65536/65536 K (Java/Others) Problem D ...

  10. Java时间日期格式转换Date转String和String转Date

    Java时间格式转换大全 import java.text.*; import java.util.Calendar; public class VeDate { /** * 获取现在时间 * * @ ...