1 Star 1 Fork 0

baishiyun / BSYFancybox

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
OneTableViewController.m 3.85 KB
一键复制 编辑 原始数据 按行查看 历史
baishiyun 提交于 2015-04-24 18:12 . BSYFancybox
//
// OneTableViewController.m
// BSYFancybox
//
// Created by mac on 15/4/24.
// Copyright (c) 2015年 mac. All rights reserved.
//
#import "OneTableViewController.h"
#import "BSYItem.h"
@interface OneTableViewController ()
@end
@implementation OneTableViewController
- (void)viewDidLoad {
[super viewDidLoad];
self.title = @"首页";
self.tableView.tableFooterView=[[UIView alloc]init];
self.Item = [[BSYItem alloc]init];
self.navigationItem.leftBarButtonItem = [self.Item addLeft:@"返回"];
[self.Item.left addTarget:self action:@selector(backClick) forControlEvents:UIControlEventTouchUpInside];
}
-(void)backClick
{
[self dismissViewControllerAnimated:YES completion:nil];
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
#pragma mark - Table view data source
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
#warning Potentially incomplete method implementation.
// Return the number of sections.
return 3;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
#warning Incomplete method implementation.
// Return the number of rows in the section.
return 1;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *ID = @"cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:ID];
if (!cell) {
cell = [[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:ID];
}
if (indexPath.section==0) {
cell.imageView.image = [UIImage imageNamed:@"camera"];
cell.textLabel.text = @"Override to support conditional editing of the table view.";
}else if (indexPath.section==1){
cell.imageView.image = [UIImage imageNamed:@"draw"];
cell.textLabel.text = @"Override to support conditional editing";
}else
{
cell.imageView.image = [UIImage imageNamed:@"gallery"];
cell.textLabel.text = @"Override to support ";
}
// Configure the cell...
return cell;
}
-(CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section
{
return 40;
}
/*
// Override to support conditional editing of the table view.
- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath {
// Return NO if you do not want the specified item to be editable.
return YES;
}
*/
/*
// Override to support editing the table view.
- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath {
if (editingStyle == UITableViewCellEditingStyleDelete) {
// Delete the row from the data source
[tableView deleteRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationFade];
} else if (editingStyle == UITableViewCellEditingStyleInsert) {
// Create a new instance of the appropriate class, insert it into the array, and add a new row to the table view
}
}
*/
/*
// Override to support rearranging the table view.
- (void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)fromIndexPath toIndexPath:(NSIndexPath *)toIndexPath {
}
*/
/*
// Override to support conditional rearranging of the table view.
- (BOOL)tableView:(UITableView *)tableView canMoveRowAtIndexPath:(NSIndexPath *)indexPath {
// Return NO if you do not want the item to be re-orderable.
return YES;
}
*/
/*
#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
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/baishiyun/BSYFancybox.git
git@gitee.com:baishiyun/BSYFancybox.git
baishiyun
BSYFancybox
BSYFancybox
master

搜索帮助