斯坦福大学公开课iOS 7第六讲Attributor多MVC与选项卡结构

斯坦福的 iOS7 开发课第六讲源码,真的是个不错的老项目,挺适合复习Objective-CMVC

Attributor 项目的亮点是多MVC模块的拆分,加上UITabBarController实现的选项卡结构,整个架构蛮清晰的。适合那种想搞懂 iOS 多页面组织方式的你。

项目里的Attributor1文件夹,包含了完整的.h/.m源码,还有Storyboard。结构一看就明白,逻辑也清晰,照着跑一遍,调试几下,学得挺快。

讲真,用UITabBarController配合UINavigationController,就能轻松搞定常见的底部选项卡切换,响应也快,代码也简单。比如,你可以让“设置”、“个人中心”这些界面分别归到不同 Tab 里,还能各自维护自己的导航栈。

MVC之间的跳转和数据传递是重点,Attributor 里面得比较清爽,控制器之间通信不绕,适合参考。如果你之前总卡在多个页面数据共享的问题,这项目刚好可以看看。

哦对了,如果你想看更多选项卡相关的实现,比如jQuery风格、Android布局、iOS自定义底栏啥的,下面这些链接挺实用:

如果你是 iOS 开发刚起步,或者想捡回Objective-C的语感,这份源码还挺值得一看。跑通一遍,你会发现——原来多控制器配合 Tab 结构也没那么难。

zip
Atrributor1.zip 预估大小:21个文件
folder
Atrributor1 文件夹
folder
Atrributor1 文件夹
file
main.m 331B
file
ViewController.m 3KB
file
AppDelegate.h 274B
file
.DS_Store 6KB
file
Info.plist 1KB
folder
Images.xcassets 文件夹
folder
AppIcon.appiconset 文件夹
file
Contents.json 585B
file
AppDelegate.m 2KB
file
TextStatsViewController.m 2KB
file
TextStatsViewController.h 294B
file
ViewController.h 212B
folder
Base.lproj 文件夹
file
LaunchScreen.xib 4KB
file
Main.storyboard 16KB
folder
Atrributor1Tests 文件夹
file
Info.plist 762B
file
Atrributor1Tests.m 868B
file
.DS_Store 6KB
folder
Atrributor1.xcodeproj 文件夹
folder
project.xcworkspace 文件夹
file
contents.xcworkspacedata 156B
folder
xcuserdata 文件夹
folder
yangmu.xcuserdatad 文件夹
file
UserInterfaceState.xcuserstate 22KB
file
project.pbxproj 16KB
folder
xcuserdata 文件夹
folder
yangmu.xcuserdatad 文件夹
folder
xcschemes 文件夹
file
xcschememanagement.plist 573B
file
Atrributor1.xcscheme 4KB
folder
xcdebugger 文件夹
file
Breakpoints_v2.xcbkptlist 91B
zip 文件大小:37.72KB