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. php 制作略缩图

    一.需求 最近公司的项目中有个需求,就是用户上传自己的微信二维码,然后系统会自动将用户的微信二维码合并到产品中 二.分析 因为该系统是手机端的,所以从用户端的体验出发,用户当然是直接在微信上保存二维码 ...

  2. php函数 array_values()

    array_values() 函数返回一个包含给定数组中所有键值的数组,但不保留键名. 提示:被返回的数组将使用数值键,从 0 开始并以 1 递增. $a=array("Name" ...

  3. mvc.global.asax事件

    1.global.asax文件概述 global.asax这个文件包含全局应用程序事件的事件处理程序.它响应应用程序级别和会话级别事件的代码. 运行时, Global.asax 将被编译成一个动态生成 ...

  4. 2015 多校赛 第二场 1006 (hdu 5305)

    Problem Description There are n people and m pairs of friends. For every pair of friends, they can c ...

  5. D - Replacement

    Problem description Little Petya very much likes arrays consisting of n integers, where each of them ...

  6. python2.X现在不能安装Django了:Collecting django Using cached Django-2.0.tar.gz

    使用pip安装django2: pip install django 报错: Collecting django  Using cached Django-2.0.tar.gz    Complete ...

  7. MVC异步上传图片到本地/服务器

    这两天朋友问我,有没有异步上传图片到本地/服务器这种demo,他有用, 我就想,好吧, 那刚好周末了,整理一套出来. 主要用到的是jquery uploadify 这个juqery的插件 ,可以无刷新 ...

  8. spring 九种设计模式

    spring中常用的设计模式达到九种,我们举例说明: 第一种:简单工厂 又叫做静态工厂方法(StaticFactory Method)模式,但不属于23种GOF设计模式之一. 简单工厂模式的实质是由一 ...

  9. 关于Core里的 StartUp里的方法的理解。

    public class Startup { public Startup(IConfiguration configuration) { Configuration = configuration; ...

  10. WM消息大全

    消息名 消息值 说明 WM_CREATE 0x0001 应用程序创建一个窗口 WM_DESTROY 0x0002 一个窗口被销毁 WM_MOVE 0x0003 移动一个窗口 WM_SIZE 0x000 ...