1. 无限互联熊彪的视频-时光电影项目

1.1 需求文档 - 产品部门产生

1.2 架构设计-mvc,缓存策略,可扩展,广告位预留,更新预留

1.3 业务逻辑分析-哪些人用,做什么,用户习惯收集

业务逻辑设计-类,接口,类关系

1.4 界面设计 - 美工产生

1.5 用户交互-用户体验师ue

1.6 与服务器交互-http   : 开发容易,数据包大

socket  :数据包小,适合实时交互如微信

数据交换格式-JSON :使用方便,都用这个

xml : SAX(边load边解析), DOM(一下load到内存)

1.7 接口定义-这是重点,与服务器的接口定义

1.8 开发规范 - 驼峰命名法

2. 项目架构

2.1 结构图

2.2 搭建项目框架

新建一个singleview,去掉viewcontroller

2.2.1 添加图片,工具类

注意添加图片时选择create group,不然图片读取不到,搞了多久才发现图片没读出来。

2.2.2 新建tab的几个文件

1)建立mainviewcontroller

2)AppDelegate.m中加入

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {// Override point for customization after application launch.self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] ;self.window.backgroundColor  = [UIColor redColor];[self.window makeKeyAndVisible];MainViewController *mainCtrl = [[MainViewController alloc] init];[self.window setRootViewController:mainCtrl];return YES;
}

3)prefix header

build_setting里面设置prefix header,这样就可以把需要的头文件加入了。

4)mainviewcontroller.h

@interface MainViewController : UITabBarController
{@private//自定义tabbar视图UIView *_tabBarView;//上次选中的buttonUIButton *_lastButton;
}
@end

mainviewcontroller.m

//
//  MainViewController.m
//  SGMovie
//
//  Created by robin on 16/2/27.
//  Copyright © 2016年 robin. All rights reserved.
//#import "MainViewController.h"
#import "WXHLGlobalUICommon.h"#import "HomeViewController.h"
#import "NewsController.h"
#import "MovieRatingViewController.h"
#import "CinemaViewController.h"@interface MainViewController ()
- (void) _initImageView;    // _ 表示我们自己定义的方法
- (void) _initWithViewController;@end@implementation MainViewController- (id) initWithNibName : (NSString*) nibNameOrNil bundle: (NSBundle*)nibBundleOrNil
{self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];if (self ) {// 隐藏控制器的tabbarself.tabBar.hidden = YES;}return self;
}- (void)viewDidLoad {[super viewDidLoad];// Do any additional setup after loading the view.[self _initImageView];[self _initWithViewController];//UIView *transitionView = [[self.view subviews] objectAtIndex:0];//NSLog(@"transitionview:%@", transitionView);//transitionview:<UITransitionView: 0x7fa9e961f6b0; frame = (0 0; 320 568); clipsToBounds = YES; autoresize = W+H; layer = <CALayer: 0x7fa9e961faf0>>for (UIView *subView in self.view.subviews){if ([subView isKindOfClass:NSClassFromString(@"UITransitionView")]) {// 重新调整UITabbarViewController根视图的大小subView.frame = CGRectMake(subView.frame.origin.x, subView.frame.origin.y, subView.frame.size.width, IPHONE_HEIGHT);}}
}- (void) _initWithViewController
{HomeViewController *homeCtrl = [[HomeViewController alloc] init];NewsController *newsCtrl = [[NewsController alloc] init];MovieRatingViewController *ratingCtrl = [[MovieRatingViewController alloc] init];CinemaViewController *cinemaCtrl = [[CinemaViewController alloc] init];UINavigationController *homeNav = [[UINavigationController alloc] initWithRootViewController:homeCtrl];UINavigationController *newsNav = [[UINavigationController alloc] initWithRootViewController:newsCtrl];UINavigationController *ratingNav = [[UINavigationController alloc] initWithRootViewController:ratingCtrl];UINavigationController *cinemaNav = [[UINavigationController alloc] initWithRootViewController:cinemaCtrl];NSArray *ctrls = [NSArray arrayWithObjects:homeNav, newsNav, ratingNav, cinemaNav,nil];self.viewControllers = ctrls;
}- (void) _initImageView
{// 获取整个物理屏幕大小CGRect frame = WXHLApplicationBounds();// 创建tabbar_tabBarView = [[UIView alloc] initWithFrame:CGRectMake(frame.origin.x, frame.size.height-TABBAR_HEIGHT, frame.size.width, TABBAR_HEIGHT)];_tabBarView.backgroundColor = [UIColor blueColor];// 创建首页buttonUIButton *homeButton = [UIButton buttonWithType:UIButtonTypeCustom];[homeButton setFrame:CGRectMake(frame.origin.x, frame.origin.y, TABBAR_TAP_BUTTON_WIDTH, TABBAR_HEIGHT)];[homeButton setImage:[UIImage imageNamed:TABBAR_TAP_HOMEBUTTON_IMAGE] forState:UIControlStateNormal];[homeButton setImage:[UIImage imageNamed:TABBAR_TAP_HOMEBUTTON_SELECTED_IMAGE] forState:UIControlStateHighlighted];[homeButton setTag:0];homeButton.selected = YES;_lastButton = homeButton;[homeButton addTarget:self action:@selector(tapAction:) forControlEvents:UIControlEventTouchUpInside];[_tabBarView addSubview:homeButton];// 创建新闻buttonUIButton *newsButton = [UIButton buttonWithType:UIButtonTypeCustom];[newsButton setFrame:CGRectMake(frame.origin.x+TABBAR_TAP_BUTTON_WIDTH*1, frame.origin.y, TABBAR_TAP_BUTTON_WIDTH, TABBAR_HEIGHT)];[newsButton setImage:[UIImage imageNamed:TABBAR_TAP_NEWSBUTTON_IMAGE] forState:UIControlStateNormal];[newsButton setImage:[UIImage imageNamed:TABBAR_TAP_NEWSBUTTON_SELECTED_IMAGE] forState:UIControlStateHighlighted];[newsButton setTag:2];[newsButton addTarget:self action:@selector(tapAction:) forControlEvents:UIControlEventTouchUpInside];[_tabBarView addSubview:newsButton];// 添加到当前控制器到view上[self.view addSubview:_tabBarView];// 创建影评buttonUIButton *ratingButton = [UIButton buttonWithType:UIButtonTypeCustom];[ratingButton setFrame:CGRectMake(frame.origin.x+TABBAR_TAP_BUTTON_WIDTH*2, frame.origin.y, TABBAR_TAP_BUTTON_WIDTH, TABBAR_HEIGHT)];[ratingButton setImage:[UIImage imageNamed:TABBAR_TAP_RATINGBUTTON_IMAGE] forState:UIControlStateNormal];[ratingButton setImage:[UIImage imageNamed:TABBAR_TAP_RATINGBUTTON_SELECTED_IMAGE] forState:UIControlStateHighlighted];[ratingButton setTag:2];[ratingButton addTarget:self action:@selector(tapAction:) forControlEvents:UIControlEventTouchUpInside];[_tabBarView addSubview:ratingButton];// 创建电影院buttonUIButton *cinemaButton = [UIButton buttonWithType:UIButtonTypeCustom];[cinemaButton setFrame:CGRectMake(frame.origin.x+TABBAR_TAP_BUTTON_WIDTH*3, frame.origin.y, TABBAR_TAP_BUTTON_WIDTH, TABBAR_HEIGHT)];[cinemaButton setImage:[UIImage imageNamed:TABBAR_TAP_CINEMABUTTON_IMAGE] forState:UIControlStateNormal];[cinemaButton setImage:[UIImage imageNamed:TABBAR_TAP_CINEMABUTTON_SELECTED_IMAGE] forState:UIControlStateHighlighted];[cinemaButton setTag:3];[cinemaButton addTarget:self action:@selector(tapAction:) forControlEvents:UIControlEventTouchUpInside];[_tabBarView addSubview:cinemaButton];// 创建更多buttonUIButton *moreButton = [UIButton buttonWithType:UIButtonTypeCustom];[moreButton setFrame:CGRectMake(frame.origin.x+TABBAR_TAP_BUTTON_WIDTH*4, frame.origin.y, TABBAR_TAP_BUTTON_WIDTH, TABBAR_HEIGHT)];[moreButton setImage:[UIImage imageNamed:TABBAR_TAP_MOREBUTTON_IMAGE] forState:UIControlStateNormal];[moreButton setImage:[UIImage imageNamed:TABBAR_TAP_MOREBUTTON_SELECTED_IMAGE] forState:UIControlStateHighlighted];[moreButton setTag:4];[moreButton addTarget:self action:@selector(tapAction:) forControlEvents:UIControlEventTouchUpInside];[_tabBarView addSubview:moreButton];}- (void)tapAction:(UIButton*)button
{if (_lastButton != button){_lastButton.selected = NO;}_lastButton = button;button.selected = YES;self.selectedIndex = button.tag;}- (void)didReceiveMemoryWarning {[super didReceiveMemoryWarning];// Dispose of any resources that can be recreated.
}/*
#pragma mark - Navigation// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {// Get the new view controller using [segue destinationViewController].// Pass the selected object to the new view controller.
}
*/@end

5)xcode7.2 不能建立新的空工程,只能先建一个sigleview,然后把main.storyboard等删了,然后把plist的相关项删了,然后在app delegate里面加上面那几行代码。

下面就是tabbar的效果了,哈哈!

mac上面加图片怎么这么大,有没有知道怎么变小点???

iOS项目实践之时光电影(一)相关推荐

  1. iOS 项目源码大全 github 国内外大神

    github排名https://github.com/trending,github搜索:https://github.com/search 主要工作说明: 重新整理了Xcode好用的插件,信息更详细 ...

  2. block在美团iOS的实践

    说到block,相信大部分iOS开发者都会想到retain cycle或是__block修饰的变量. 但是本文将忽略这些老生常谈的讨论,而是将重点放在美团iOS在实践中对block的应用,希望能对同行 ...

  3. 手把手教你从0到1进行Java项目实践

    手把手教你从0到1进行Java项目实践 虽说工作就是简单的事情重复做,但不是所有简单的事你都能有机会做的. 我们平日工作里,大部分时候都是在做修修补补的工作,而这也是非常重要的.做好修补工作,做好优化 ...

  4. 项目实践系列-点击生成自定义设置的二维码

    目前为止,生活中的我们到处可见一些二维码,使用微信扫一扫即可进入到另一个网络空间,这种方式方便了我们的生活,更让我们可以适应这种方式. 那么今天呢,我就个人项目经历,把点击生成自定义设置的二维码的一个 ...

  5. 华为表哥手把手教你利用Jenkins持续集成iOS项目,教不会我花式拉翔!!!

    手把手教你利用Jenkins持续集成iOS项目: 前言 众所周知,现在App的竞争已经到了用户体验为王,质量为上的白热化阶段.用户们都是很挑剔的.如果一个公司的推广团队好不容易砸了重金推广了一个APP ...

  6. 【四则运算】个人项目实践

    题目要求:像<构建之法>的人物阿超那样,花二十分钟写一个能自动生成小学四则运算题目的命令行 "软件", 分别满足下面的各种需求. 下面这些需求都可以用命令行参数的形式来 ...

  7. 2016年GitHub 排名前 100 的安卓、iOS项目简介(收藏)

    2016年GitHub 排名前 100 的安卓.iOS项目简介(收藏)   排名完全是根据 GitHub 搜索 Java 语言选择 (Best Match) 得到的结果, 然后过滤了跟 Android ...

  8. [贝聊科技]如何将 iOS 项目的编译速度提高5倍

    前言 贝聊目前开发的两款App分别是贝聊家长版和贝聊老师版,最近因为在快速迭代开发新功能,项目规模急速增长,单个端业务代码约23万行,私有库约6万行,第三方库代码约15万行,单个客户端的代码行数约60 ...

  9. 仿煎蛋iOS项目的准备(0)

    煎蛋项目的介绍: 其主要内容翻译自其他语言的网站,目的是为了让中文网友了解其他国家的信息 .煎蛋的主要栏目包括:小游戏.小学堂.发霉啦.无聊图.妹子图.走近科学.Geek.设计快读等. 1. 写这个项 ...

最新文章

  1. Django使用MySQL笔记
  2. GridView的多主键(Key)取值问题
  3. java8 升级_java8升级
  4. Http协议的请求和响应
  5. 顶尖机器学习学习路线,6个月让你的技术成为行业TOP5%
  6. 时间序列预测算法——DeepAR
  7. 非因解读|Digital Spatial Profiler 新一代高维度空间组学技术
  8. web前端入门到实战:CSS3中width值为max/min-content及fit-content的理解
  9. Fences隐藏桌面图标快捷方式箭头
  10. 计算机毕业设计Java医院医患管理系统(系统+源码+mysql数据库+Lw文档)
  11. Linux系统上安装微信 QQ , 还在用wine ? 快弃坑吧 ,xDroid尝试一下!!!
  12. opencv马赛克python实现
  13. ttl转rs232发送十六进制_电脑USB转TTL串口RS232串口模块
  14. 365天深度学习训练营-第P5周:运动鞋识别
  15. Red Hat 9.0 安装配置 zz
  16. TypeScript介绍
  17. php模板地图修改,让你一个地图拥有全部资源的修改方法
  18. PYTHON h5py库包安装及读写
  19. 面向开发者的 Android 8.0 Oreo 详细介绍
  20. linux命令之partprobe

热门文章

  1. 洛谷 P5318 【深基18.例3】查找文献(dfs bfs 板子题,同时用了unordered_map可以hash查找
  2. 对mmdetection代码设计的简单理解及代码修改
  3. Alfred无法自动粘贴
  4. 使用Markdown在CSDN写博客的一些模板
  5. Linux系统备份、还原
  6. Foxyproxy 模版匹配
  7. 如何将ZAP加入到FoxyProxy代理工具
  8. wordpress如何在网站底部添加版权声明
  9. Python 一元二次方程
  10. SpringBoot修改默认网页图标