猫猫分享,必须精品

原创文章,欢迎转载。

转载请注明:翟乃玉的博客
地址:http://blog.csdn.net/u013357243

一:效果





二:代码

#import "ViewController.h"
#import "DemoViewController.h"@interface ViewController ()
{// 功能名称的数组NSArray *_functions;
}@end@implementation ViewController- (void)viewDidLoad
{[super viewDidLoad];_functions = @[@"吸附行为", @"推动行为", @"刚性附加行为", @"弹性附加行为", @"碰撞检測"];
}#pragma mark - 数据源方法
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{return _functions.count;
}- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{// 使用Storyboard建立的UITabeViewController,当中的Cell是已经注冊过的static NSString *ID = @"Cell";// 永远都会找到一个单元格,假设缓冲池中没有,会自己主动新建/**dequeueReusableCellWithIdentifier 直接查询可重用单元格dequeueReusableCellWithIdentifier:forIndexPath: 查询“注冊的”可重用单元格,此方法中indexPath本身没实用处* 强制推断是否注冊了单元格假设已经注冊过单元格,以上两个方法等效。假设在StoryBoard中指定了单元格的可重用标示符,单元格的优化将有系统接管,不再须要推断cell == nil*/
//    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:ID];UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:ID forIndexPath:indexPath];//    if (cell == nil) {//        NSLog(@"come here");
//
//        cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:ID];
//    }cell.textLabel.text = _functions[indexPath.row];return cell;
}#pragma mark - 代理方法
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{DemoViewController *controller = [[DemoViewController alloc] init];// 指定标题controller.title = _functions[indexPath.row];controller.function = indexPath.row;[self.navigationController pushViewController:controller animated:YES];
}
#import "DemoViewController.h"
#import "DemoView.h"
#import "SnapView.h"
#import "PushView.h"
#import "AttachmentView.h"
#import "SpringView.h"
#import "CollisionView.h"@interface DemoViewController ()@end@implementation DemoViewController//- (void)loadView
//{//    self.view = [[DemoView alloc] initWithFrame:[UIScreen mainScreen].applicationFrame];
//}- (void)viewDidLoad
{[super viewDidLoad];NSLog(@"功能代号: %d", self.function);// 在此依据实际的功能代号载入实际的视图DemoView *demoView = nil;switch (self.function) {case kDemoFunctionSnap:demoView = [[SnapView alloc] initWithFrame:self.view.bounds];break;case kDemoFunctionPush:demoView = [[PushView alloc] initWithFrame:self.view.bounds];break;case kDemoFunctionAttachment:demoView = [[AttachmentView alloc] initWithFrame:self.view.bounds];break;case kDemoFunctionSpring:demoView = [[SpringView alloc] initWithFrame:self.view.bounds];break;case kDemoFunctionCollision:demoView = [[CollisionView alloc] initWithFrame:self.view.bounds];break;default:break;}[self.view addSubview:demoView];
}@end

主要框框就这样啦。贴出了的代码只部分

三:素材代码下载地址

代码上传中。

转载于:https://www.cnblogs.com/brucemengbm/p/7360337.html

(素材源代码) 猫猫学iOS 之UIDynamic重力、弹性碰撞吸附等现象牛逼Demo相关推荐

  1. (素材源码) 猫猫学iOS 之UIDynamic重力、弹性碰撞吸附等现象PS有惊喜

    猫猫分享,必须精品 原创文章,欢迎转载.转载请注明:翟乃玉的博客 地址:http://blog.csdn.net/u013357243 一:效果 二:代码 #import "ViewCont ...

  2. (素材源代码)猫猫学IOS(四)UI之半小时搞定Tom猫

    下载地址:http://download.csdn.net/detail/u013357243/8514915 以下是执行图片展示 制作思路以及代码解析 猫猫学IOS(四)UI之半小时搞定Tom猫这里 ...

  3. (素材源码) 猫猫学IOS(五)UI之360等下载管理器九宫格UI

    猫猫分享,必须精品 先看效果 代码学习地址: 猫猫学IOS(五)UI之360等下载管理器九宫格UI 猫猫学IOS(五)UI之360等下载管理器九宫格UI http://blog.csdn.net/u0 ...

  4. 猫猫学IOS(四)UI之半小时搞定Tom猫

    话不多说 先上效果 项目源码素材下载地址: Tom猫游戏代码iOS 素材http://blog.csdn.net/u013357243/article/details/44457357 效果图 曾经风 ...

  5. 猫猫学IOS(六)UI之iOS热门游戏_超级猜图

    猫猫分享,必须精品 素材地址:http://blog.csdn.net/u013357243/article/details/44539069 原创文章,欢迎转载.转载请注明:翟乃玉的博客 地址:ht ...

  6. 猫猫学iOS(五十五)多线程网络之图片下载框架之SDWebImage

    猫猫分享,必须精品 原创文章,欢迎转载.转载请注明:翟乃玉的博客 地址:http://blog.csdn.net/u013357243?viewmode=contents 效果: 代码: - (NSA ...

  7. 猫猫学iOS 之微博项目实战(2)微博主框架-自己定义导航控制器NavigationController

    猫猫分享.必须精品 原创文章,欢迎转载.转载请注明:翟乃玉的博客 地址:http://blog.csdn.net/u013357243? viewmode=contents 一:加入导航控制器 上一篇 ...

  8. 猫猫学iOS之最近的反思

    其实很早以前就想写点了,虽然猫猫现在还是学生,但是就自学方面,猫猫觉得自己水平还可以--注意,我不是大神,我只是一名小小的菜猫... 首先简单说一下自己吧,本人猫猫,真名看博客名字,目前大四,自学编程 ...

  9. (素材源码)猫猫学IOS(十六)UI之XIB自定义Cell实现团购UI

    猫猫分享,必须精品 素材代码地址:http://download.csdn.net/detail/u013357243/8572001 原文地址:http://blog.csdn.net/u01335 ...

最新文章

  1. 原创 | 斯坦福Machine Learning with Graphs 学习笔记(第一讲)
  2. python入门指南bl-入门 第一个python可视化程序 基于pyqt5
  3. TensorFlow 最小二乘法拟合
  4. java中Robot
  5. static函数的申明
  6. 作者:胡卫生(1964-),男,博士,上海交通大学教授、博士生导师,主要研究方向为下一代光接入网、光交换、光网络等。...
  7. jQuery EasyUI combobox多选及赋值
  8. 7. namp工具的基础了解
  9. 如何用手机实现高精度定位导航
  10. web显示实时时间动态刷新
  11. Rap2 模拟接口 常见规则示例
  12. 使用busybox制作rootfs
  13. SEO中的简单代码优化
  14. 【牛客网-公司真题-前端入门篇】——小米秋招笔试-前端
  15. 软件测试适合女生吗?我30岁了能学会吗?我大专毕业能做吗?
  16. input元素及属性
  17. 集体智慧编程——垃圾邮件过滤器(贝叶斯)-Python实现
  18. mysql修行练级之mysql新手入门常用命令
  19. Unity3d 获取场景中摄像头视频流,实现直播效果(无需代码)
  20. 正则表达式 re.findall 用法,包含正则规则讲解

热门文章

  1. 小程序开发实战学习笔记
  2. 网站遭遇CC及DDOS攻击紧急处理方案
  3. 初识Qt Creator
  4. easy_install 安装
  5. PXE实现无人值守无盘安装Linux
  6. 使用IKE预共享密钥配置IPsec
  7. MYSQL 表锁情况查看
  8. Android 开发之多线程处理、Handler 详解
  9. 'SVN更新' has encountered a problem :An internal error occurred during: svn错误
  10. Android Studio failed to resolve .....