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. LeetCode刷题 1. Two Sum 两数之和 详解 C++语言实现 java语言实现

    1. Two Sum 两数之和 Given an array of integers, return indices of the two numbers such that they add up ...

  2. 【CodeForces688A】Opponents

    [思路分析] 比较水的模拟题 具体见代码吧 #include<iostream> #include<cstdio> #include<algorithm> usin ...

  3. JSP页面使用EL表达式内容显示不全问题记录

    1.当EL表达式里面的值存在引号之类的字符时, ${caseparam.cp_value}的值为 {"cpage":"1","resType" ...

  4. Jmeter - 服务器性能检测

    在对系统做压力测试时,往往需要对服务的性能进行监控,包括CPU,Memory,IO,还有网络情况进行监控. Jemter有个一插件,能很好的支持这些性能监控.原理是服务器启动服务之后,测试机发起请求, ...

  5. 复习java基础第六天(IO)

    一:File 类 • 输入:读取外部数据(磁盘.光盘等存储设备的数据)到程序(内存)中.  • 输出:将程序(内存)数据输出到磁盘.光盘等存储设备中 • Java 的 IO 流主要包括输入.输出两种 ...

  6. java编程题(一)

    [程序1]    题目:古典问题:有一对兔子,从出生后第3个月起每个月都生一对兔子,小兔子长到第三个月后每个月又生一对兔子,假如兔子都不死,问每个月的兔子总数为多少? //这是一个菲波拉契数列问题 p ...

  7. 【sqli-labs】 less25 GET- Error based -All you OR&AND belong to us -string single quote(GET型基于错误的去除了or和and的单引号注入)

    加单引号 order by一下 http://localhost/sqli-labs-master/Less-25/?id=1' order by 1%23 order by 变成了der by 下面 ...

  8. java 发送http请求

    参考别人的 package test; import java.io.BufferedReader; import java.io.IOException; import java.io.InputS ...

  9. Redis-RDB持久化设置

    1.如何配置RDB持久化机制redis.conf文件,也就是/etc/redis/6379.conf,去配置持久化 save 60 1000 每隔60s,如果有超过1000个key发生了变更,那么就生 ...

  10. Python【每日一问】35

    问: 基础题: 从键盘输入4个数字,各数字采用空格分隔,对应为变量x0,y0,x1,y1.计算(x0,y0)和(x1,y1)两点之间的距离,输出结果保留1位小数. 比如,键盘输入:0 1 3 5,屏幕 ...