ios设计一部WindowsPhone手机
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手机的更多相关文章
- 设计一部iphone手机用面向对象的方法
main.m //编辑字体大小command + < //编译执行快捷键 com + R #import <Foundation/Foundation.h> #import &quo ...
- 学习iOS设计--iOS8的颜色、文字和布局学习
在去年,Apple针对新时代用户彻底更新了其设计语言.现在的设计语言相对之前大为简化,能够让设计师将精力集中到动画和功能上,而不是繁复的视觉细节上. 很多人都曾问过我:设计应当如何入门?成为一名优秀设 ...
- 非官方的iOS设计指南
非官方的iOS设计指南 有时候为iOS设计app并不是一件简单的事,但是如果你能找到正确的最新的苹果设备信息,并按照正确的方向,那么为iOS设计app或许会变得简单容易些. 关于这些指南 这些指南描述 ...
- iOS系统下 的手机屏幕尺寸 分辨率 及系统版本 总结
今天 我对iOS系统下 的手机屏幕尺寸 分辨率 及系统版本做了一次系统总结 供大家参考. 首先 是系统: 随着iOS 系统不断升级,现在已经到iOS7.0了, 并且TA有了很多新变化,最震撼的 ...
- 【译】UI设计基础(UI Design Basics)--为iOS设计(Design for iOS)(二)
2.1 为iOS设计(Design for iOS) iOS体现以下主题: 遵从:UI帮助用户理解界面内容并与内容交互,但绝不会与内容相互冲突. 清晰:文本在任何尺寸下都是清晰易读,图标精确易懂,装饰 ...
- 学习ios设计(1)
两年前,苹果为现代的使用者完全改变了设计语言.对于设计者来说,这使得他们更容易关注动画和功能而不是其他的细枝末节. 我已经被问过很多次怎样开始设计或者是有什么捷径可以成为更好的设计师.虽然没有银弹,然 ...
- iOS设计指南
备忘:iOS设计指南:http://www.ui.cn/detail/32167.html
- iOS设计 - 一款APP从设计稿到切图过程概述
这篇文章站在GUI设计师的角度概述了APP从项目启动到切片输出的过程,相当于工作流程的介绍.这里写的不是一种规范,只是一种工作方法,加上技术的更新是非常快的,大家在具体工作中,一定要灵活运用. 这里我 ...
- Android,ios,WP三大手机系统对比
从前,我以为.一个手机系统只是一个系统的UI风格,没什么不同的.然而,在我混合使用这三个手机系统之后,才明白,一个手机系统远不只一个UI那么简单,而真的是可以称之为一个“生态”. 首先祭出三台经典设备 ...
随机推荐
- oen /var/run/nginx.pid failed
nginx: [error] open() "/var/run/nginx.pid" failed (2: No such file or directory) [root@TES ...
- Scala学习1————scala开发环境搭建(windows 10)
Scala开发环境搭建 先讲几点我学习scala的目的或者原因吧: JVM在企业中的霸主地位,Scala也是JVM上的语言,很有可能未来会从Java过度到Scala也不是不可能. 先进的函数式编程和面 ...
- oracle命令行登录(默认用户名和密码)
oracle数据库安装成功之后会有默认的用户名和密码,之前因为没有整理,每次用的时候都要百度很麻烦,所以现在把这些都整理一下,也方便以后使用: 使用scott用户连接:使用sys用户连接:使用syst ...
- [转]Java web 开发 获取用户ip
如果通过了多级反向代理的话,X-Forwarded-For的值并不止一个,而是一串IP值,那么真正的用户端的真实IP则是取X-Forwarded-For中第一个非unknown的有效IP字符串. pu ...
- informix 通过ADO或ODBC连接提取数据时出现中文乱码的解决方法
最近在做一个项目,是对INFORMIX数据库的数据进行大数据分析,INFORMIX数据库数据有上亿条,没有linux的Root权限和informix数据的生产权限,只能读取.客户要求结果显示在内网wi ...
- Android第三方微博、无线传输、动画特效、商城应用等源码
Android精选源码 Android汽车助手源码 一个酷炫的Android特效源码 新浪微博的第三方客户端.UI遵循Material Design. Android实现旋转木马布局多种效果 Andr ...
- Excel 批量出来数据
try { string sheetname = TextBox1.Text.Trim(); HttpPostedFile upLoadPostFile = FileUpload1.PostedFil ...
- Centos6.6 安装Memcached
一.环境介绍 1)Centos6.4 2) memcached-1.4.24 二.部署安装 计划具体部署步骤: 步骤1:安装 步骤2:配置 步骤3:运行 步骤4:检查 现在开始: 1)安装 $ yum ...
- 10--C++多态
C++多态 C++多态技术 摘要 本文描述了C++中的各种多态性.重点阐述了面向对象的动态多态和基于模板的静态多态,并初步探讨了两种技术的结合使用. 关键词 多态 继续 虚函数 模板 宏 函 ...
- MVC 返回404,返回图片,流到数组,apk信息
return HttpNotFound(); byte[] buffer0 = QRCode(); return File(buffer0, @"image/jpeg"); // ...