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那么简单,而真的是可以称之为一个“生态”. 首先祭出三台经典设备 ...
随机推荐
- 搭建go开发环境
一.go下载安装 进入该网站 https://golang.google.cn/dl/ 选择相应的操作系统下载安装包 Linux/Mac OS X 安装 1.下载 go1.10.3.linux-am ...
- BZOJ 3653 主席树
思路: (抄一波公式) $$ans=min(dep[x],k)×(size[x]-1)+\sum_{y在x的子树中,且dis(x,y)<=k}(size[y]-1)$$ 顺着DFS序 按照dee ...
- ThinkPHP __PUBLIC__的定义 __ROOT__等 常用 常量的定义
'__TMPL__' => APP_TMPL_PATH, // 项目模板目录 '__ROOT__' => __ROOT__, // 当前网站地址 '__APP__' => __APP ...
- rabbit channel参数
channel.exchangeDeclare() channel.ExchangeDeclare(string exchange: "cjlTest",string type: ...
- collectionView必须点击两次才跳转
今天遇到一个很奇怪的现象:collectionView必须点击两次才能跳转.具体看代码: -(void)collectionView:(UICollectionView *)collectionVie ...
- Java实现九宫格
import java.util.Scanner; public class Sudoku { public static void main(String[] args) { System.out. ...
- SQL Server中,with as使用介绍
一.WITH AS的含义 WITH AS短语,也叫做子查询部分(subquery factoring),可以让你做很多事情,定义一个SQL片断,该SQL片断会被整个SQL语句所用到.有的时候 ...
- asp.net 正则表达式 得到图片url 得到汉字
//取图片 MatchCollection matchs = Regex.Matches(AskText,@"<img\s[^> ]*src=( ...
- java多线线程停止正确方法
//军队线程 //模拟作战双方的行为 public class ArmyRunnable implements Runnable { //volatile保证了线程可以正确的读取其他线程写入的值 // ...
- slf4j日志只输出到控制台,没输出到日志文件
最近使用SLF4J遇到了一个比较头疼的坑,日志输出到控制台没有问题,但是始终没有输出到日志文件.无论怎麽修改日志配置,始终是老样子. 有一种绝望,是各种百度.google却还是解决不了问题..直到我在 ...