ShoppingViewController.m 15.4 KB
Newer Older
曹云霄's avatar
曹云霄 committed
1 2 3 4 5 6 7 8 9
//
//  ShoppingViewController.m
//  Lighting
//
//  Created by 曹云霄 on 16/4/27.
//  Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//

#import "ShoppingViewController.h"
曹云霄's avatar
曹云霄 committed
10 11
#import "ShoppingTableViewCell.h"
#import "AppDelegate.h"
曹云霄's avatar
曹云霄 committed
12
#import "GenerateOrdersViewController.h"
勾芒's avatar
勾芒 committed
13
#import "ShopcarModel.h"
勾芒's avatar
勾芒 committed
14
#import "AddressModel.h"
曹云霄's avatar
曹云霄 committed
15

曹云霄's avatar
曹云霄 committed
16
@interface ShoppingViewController ()<UITableViewDelegate,UITableViewDataSource,ChangeGoodsNumberDelegate,DZNEmptyDataSetSource>
曹云霄's avatar
曹云霄 committed
17

曹云霄's avatar
曹云霄 committed
18 19

@property (weak, nonatomic) IBOutlet UITableView *shoppingTableview;
曹云霄's avatar
曹云霄 committed
20

勾芒's avatar
勾芒 committed
21 22 23 24 25 26 27



/**
 *  购物车数据源
 */
@property (nonatomic,strong) NSMutableArray *shopResponseArray;
勾芒's avatar
勾芒 committed
28 29 30



曹云霄's avatar
曹云霄 committed
31 32 33 34
@end

@implementation ShoppingViewController

曹云霄's avatar
曹云霄 committed
35 36 37 38

/**
 *  数据源
 */
勾芒's avatar
勾芒 committed
39
- (NSMutableArray *)shopResponseArray
曹云霄's avatar
曹云霄 committed
40
{
勾芒's avatar
勾芒 committed
41
    if (_shopResponseArray == nil) {
曹云霄's avatar
曹云霄 committed
42
        
勾芒's avatar
勾芒 committed
43
        _shopResponseArray = [NSMutableArray array];
曹云霄's avatar
曹云霄 committed
44
    }
勾芒's avatar
勾芒 committed
45
    return _shopResponseArray;
曹云霄's avatar
曹云霄 committed
46 47 48
}


曹云霄's avatar
曹云霄 committed
49 50 51
- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
曹云霄's avatar
曹云霄 committed
52
    
曹云霄's avatar
曹云霄 committed
53 54 55
    [self uiConfigAction];
}

勾芒's avatar
勾芒 committed
56
#pragma mark -渲染完成
57 58 59 60 61 62 63 64
- (void)viewDidAppear:(BOOL)animated
{
    [super viewDidAppear:animated];
    
    // 禁用 iOS7 返回手势
    if ([self.navigationController respondsToSelector:@selector(interactivePopGestureRecognizer)]) {
        self.navigationController.interactivePopGestureRecognizer.enabled = NO;
    }
勾芒's avatar
勾芒 committed
65 66 67
    [self.shopResponseArray removeAllObjects];
    [self InitializeState];
    [self getShoppingCardata];
68 69
}

勾芒's avatar
勾芒 committed
70
#pragma mark -视图即将消失
71 72 73 74 75 76 77 78 79
- (void)viewWillDisappear:(BOOL)animated
{
    [super viewWillDisappear:animated];
    // 开启
    if ([self.navigationController respondsToSelector:@selector(interactivePopGestureRecognizer)]) {
        self.navigationController.interactivePopGestureRecognizer.enabled = YES;
    }
}

勾芒's avatar
勾芒 committed
80 81 82 83 84 85 86 87
#pragma mark -初始化状态
- (void)InitializeState
{
    [self.settlementButton setTitle:@"去结算(0)" forState:UIControlStateNormal];
    self.allSelectedButton.selected = NO;
    self.totalpriceLabe.text = nil;
}

曹云霄's avatar
曹云霄 committed
88

曹云霄's avatar
曹云霄 committed
89 90 91
#pragma mark - UI
- (void)uiConfigAction
{
勾芒's avatar
勾芒 committed
92 93
    self.settlementButton.layer.masksToBounds = YES;
    self.settlementButton.layer.cornerRadius = kCornerRadius;
勾芒's avatar
勾芒 committed
94
    self.view.backgroundColor = kTCColor(238, 238, 238);
曹云霄's avatar
曹云霄 committed
95 96
    self.shoppingTableview.dataSource = self;
    self.shoppingTableview.delegate = self;
勾芒's avatar
勾芒 committed
97
    self.shoppingTableview.backgroundColor = [UIColor clearColor];
曹云霄's avatar
曹云霄 committed
98 99 100
    self.shoppingTableview.tableFooterView = [UIView new];
}

勾芒's avatar
勾芒 committed
101 102


勾芒's avatar
勾芒 committed
103 104 105 106 107 108 109 110 111
#pragma mark -获取购物车商品
- (void)getShoppingCardata
{
    //判断是否需要请求数据-通过当前客户ID
    if (![Shoppersmanager manager].currentCustomer) {
        
        return;
    }
    ShopCartFilter *shopcarNumber = [[ShopCartFilter alloc]init];
勾芒's avatar
勾芒 committed
112
    shopcarNumber.consumerId = [Customermanager manager].model.fid;
勾芒's avatar
勾芒 committed
113
    DataPage *Newpage = [[DataPage alloc]init];
勾芒's avatar
勾芒 committed
114 115
    Newpage.page = 1;
    Newpage.rows = 99999;
勾芒's avatar
勾芒 committed
116 117 118 119
    shopcarNumber.dp = Newpage;
    [self CreateMBProgressHUDLoding];
    [[NetworkRequestClassManager Manager] NetworkRequestWithURL:[NSString stringWithFormat:@"%@%@",ServerAddress,@"/shopcart/query"] WithRequestType:0 WithParameter:shopcarNumber WithReturnValueBlock:^(id returnValue) {
        
曹云霄's avatar
曹云霄 committed
120
        self.shoppingTableview.emptyDataSetSource = self;
勾芒's avatar
勾芒 committed
121
        [self endRefreshingForTableView:self.shoppingTableview];
勾芒's avatar
勾芒 committed
122 123
        [self RemoveMBProgressHUDLoding];
        if ([returnValue[@"code"] isEqualToNumber:@0]) {
勾芒's avatar
勾芒 committed
124
  
勾芒's avatar
勾芒 committed
125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140
            ShopCartResponse *shopcar = [[ShopCartResponse alloc]initWithDictionary:returnValue[@"data"] error:nil];
            //自定义属性
            for (TOShopcartEntity *objc in shopcar.shopcart) {
                
                ShopcarModel *model = [[ShopcarModel alloc]init];
                model.goods = objc.goods;
                model.fid = objc.fid;
                model.createName = objc.createName;
                model.createBy = objc.createBy;
                model.createDate = objc.createDate;
                model.updateName = objc.updateName;
                model.updateBy = objc.updateBy;
                model.updateDate = objc.updateDate;
                model.goodsId = objc.goodsId;
                model.goodsNum = objc.goodsNum;
                model.consumerId = objc.consumerId;
勾芒's avatar
勾芒 committed
141
                model.costPrice = objc.costPrice;
勾芒's avatar
勾芒 committed
142 143
                [self.shopResponseArray addObject:model];
            }
勾芒's avatar
勾芒 committed
144
            [self.shoppingTableview reloadData];
勾芒's avatar
勾芒 committed
145 146 147 148 149 150 151 152 153
        }else
        {
            [self ErrorMBProgressView:returnValue[@"message"]];
        }
    } WithErrorCodeBlock:^(id errorCodeValue) {
        
    } WithFailureBlock:^(id error) {
        
        [self RemoveMBProgressHUDLoding];
勾芒's avatar
勾芒 committed
154
        [self endRefreshingForTableView:self.shoppingTableview];
勾芒's avatar
勾芒 committed
155 156 157 158
    }];
}


曹云霄's avatar
曹云霄 committed
159 160 161 162

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    ShoppingTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"Shopping" forIndexPath:indexPath];
勾芒's avatar
勾芒 committed
163 164
    cell.selectionStyle = UITableViewCellSelectionStyleNone;
    cell.model = [self.shopResponseArray objectAtIndex_opple:indexPath.row];
勾芒's avatar
勾芒 committed
165
    cell.delegate = self;
勾芒's avatar
勾芒 committed
166 167
    cell.cellindex = indexPath.row;
    //cell选中回调
勾芒's avatar
勾芒 committed
168
    __weak typeof(self) weakSelf = self;
勾芒's avatar
勾芒 committed
169 170
    [cell setReturnCellblock:^(NSInteger index) {
        
勾芒's avatar
勾芒 committed
171
        [weakSelf setSelectedButton:index];
勾芒's avatar
勾芒 committed
172
    }];
勾芒's avatar
勾芒 committed
173 174
    //提示框回调
    [cell setPromptStringBlock:^(NSString *string) {
勾芒's avatar
勾芒 committed
175
        [weakSelf promptCustomerWithString:string];
勾芒's avatar
勾芒 committed
176
    }];
曹云霄's avatar
曹云霄 committed
177 178 179 180 181
    return  cell;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
勾芒's avatar
勾芒 committed
182
    return self.shopResponseArray.count;
曹云霄's avatar
曹云霄 committed
183 184 185 186 187 188 189 190 191 192 193 194 195 196 197
}


- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
    return 80;
}


- (void)tableView:(UITableView *)tableView didDeselectRowAtIndexPath:(NSIndexPath *)indexPath
{
    [self.shoppingTableview deselectRowAtIndexPath:indexPath animated:YES];
}


勾芒's avatar
勾芒 committed
198
#pragma mark -选中商品回调
勾芒's avatar
勾芒 committed
199 200 201
- (void)setSelectedButton:(NSInteger)index;
{
    ShopcarModel *model = [self.shopResponseArray objectAtIndex_opple:index];
勾芒's avatar
勾芒 committed
202
    model.isSelected = !model.isSelected;
勾芒's avatar
勾芒 committed
203 204 205 206 207 208
    
    NSInteger goodsNumber = 0;
    for (ShopcarModel *model in self.shopResponseArray) {
        if (model.isSelected) {
            goodsNumber ++;
        }
勾芒's avatar
勾芒 committed
209 210 211 212 213 214
    }
    if (goodsNumber == self.shopResponseArray.count) {
        self.allSelectedButton.selected = YES;
    }else
    {
        self.allSelectedButton.selected = NO;
勾芒's avatar
勾芒 committed
215
    }
勾芒's avatar
勾芒 committed
216
    [self CalculateSelectedGoodsAllprice];
勾芒's avatar
勾芒 committed
217
    [self.settlementButton setTitle:[NSString stringWithFormat:@"去结算(%ld)",goodsNumber] forState:UIControlStateNormal];
勾芒's avatar
勾芒 committed
218 219 220
}


曹云霄's avatar
曹云霄 committed
221 222 223
#pragma mark -结算
- (IBAction)settlementButtonClick:(UIButton *)sender {
    
勾芒's avatar
勾芒 committed
224 225 226 227 228 229 230 231 232 233 234
    NSMutableArray *array = [NSMutableArray array];
    for (ShopcarModel *model in self.shopResponseArray) {
        if (model.isSelected) {
            [array addObject:model];
        }
    }
    if (array.count == 0) {
        
        [self ErrorMBProgressView:@"没有选中任何商品"];
        return;
    }
勾芒's avatar
勾芒 committed
235 236 237
    
    //商品总信息占位
     ShopcarModel*ZhanweiModel = [[ShopcarModel alloc]init];
勾芒's avatar
勾芒 committed
238
    [array addObject:ZhanweiModel];
勾芒's avatar
勾芒 committed
239
    
曹云霄's avatar
曹云霄 committed
240
    GenerateOrdersViewController *generateOrder = [[self getStoryboardWithName] instantiateViewControllerWithIdentifier:@"generateorders"];
勾芒's avatar
勾芒 committed
241
    generateOrder.settlementGoodsdatas = array;
勾芒's avatar
勾芒 committed
242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279
    //清除已经生成订单的商品
    [generateOrder setDelecteSelectedGoods:^(NSArray *goodsCode) {
        
        DeleteCartRequest *delecteGoods = [[DeleteCartRequest alloc]init];
        delecteGoods.cartIds = goodsCode;
        [[NetworkRequestClassManager Manager] NetworkRequestWithURL:[NSString stringWithFormat:@"%@%@",ServerAddress,@"/shopcart/delete"] WithRequestType:0 WithParameter:delecteGoods WithReturnValueBlock:^(id returnValue) {
            
            [self RemoveMBProgressHUDLoding];
            if ([returnValue[@"code"] isEqualToNumber:@0]) {
                
                [self QueryShoppingCarNumber];
                //商品cell
                NSMutableArray *cellArray = [NSMutableArray array];
                //删除商品
                for (int i=0; i<self.shopResponseArray.count; i++) {
                    ShopcarModel *model = [self.shopResponseArray objectAtIndex_opple:i];
                    if ([goodsCode containsObject:model.fid]) {
                        [self.shopResponseArray removeObject:model];
                        NSIndexPath *indexpath = [NSIndexPath indexPathForRow:i inSection:0];
                        [cellArray addObject:indexpath];
                    }
                }
                //删除cell
                [self.shoppingTableview deleteRowsAtIndexPaths:cellArray withRowAnimation:UITableViewRowAnimationTop];
            }else
            {
                [self ErrorMBProgressView:returnValue[@"message"]];
            }
            
        } WithErrorCodeBlock:^(id errorCodeValue) {
            
            
        } WithFailureBlock:^(id error) {
            
            [self RemoveMBProgressHUDLoding];
        }];
    }];
    
曹云霄's avatar
曹云霄 committed
280
    [self.navigationController pushViewController:generateOrder animated:YES];
曹云霄's avatar
曹云霄 committed
281
}
曹云霄's avatar
曹云霄 committed
282

曹云霄's avatar
曹云霄 committed
283
#pragma mark -全选
勾芒's avatar
勾芒 committed
284
- (IBAction)allSelectedButtonClick:(UIButton *)sender {
曹云霄's avatar
曹云霄 committed
285
    
勾芒's avatar
勾芒 committed
286 287 288 289 290 291 292 293 294 295 296 297
    sender.selected = !sender.selected;
    if (sender.selected) {
        
        //全部选中
        for (ShoppingTableViewCell *cell in self.shoppingTableview.visibleCells) {
            
            cell.selectedButton.selected = YES;
        }
        for (ShopcarModel *model in self.shopResponseArray) {
            
            model.isSelected = YES;
        }
勾芒's avatar
勾芒 committed
298
        [self.settlementButton setTitle:[NSString stringWithFormat:@"去结算(%ld)",self.shopResponseArray.count] forState:UIControlStateNormal];
勾芒's avatar
勾芒 committed
299

勾芒's avatar
勾芒 committed
300 301 302 303 304 305 306 307 308 309 310
    }else
    {
        //取消全部选中
        for (ShoppingTableViewCell *cell in self.shoppingTableview.visibleCells) {
            
            cell.selectedButton.selected = NO;
        }
        for (ShopcarModel *model in self.shopResponseArray) {
            
            model.isSelected = NO;
        }
勾芒's avatar
勾芒 committed
311
        [self.settlementButton setTitle:@"去结算(0)" forState:UIControlStateNormal];
勾芒's avatar
勾芒 committed
312
    }
勾芒's avatar
勾芒 committed
313 314
    //计算总金额
    [self CalculateSelectedGoodsAllprice];
曹云霄's avatar
曹云霄 committed
315 316
}

勾芒's avatar
勾芒 committed
317 318 319
#pragma mark -计算选中后的商品总金额
- (void)CalculateSelectedGoodsAllprice
{
勾芒's avatar
勾芒 committed
320
    CGFloat allPrice = 0;
勾芒's avatar
勾芒 committed
321 322
    for (ShopcarModel *model in self.shopResponseArray) {
        if (model.isSelected) {
勾芒's avatar
勾芒 committed
323
            allPrice += ([model.costPrice floatValue]?[model.costPrice floatValue]:[model.goods.tagPrice floatValue]) * model.goodsNum;
勾芒's avatar
勾芒 committed
324 325
        }
    }
勾芒's avatar
勾芒 committed
326
    self.totalpriceLabe.text = [NSString stringWithFormat:@"¥%.2f",allPrice];
勾芒's avatar
勾芒 committed
327 328
}

曹云霄's avatar
曹云霄 committed
329

勾芒's avatar
勾芒 committed
330 331 332
#pragma mark -删除选中商品
- (IBAction)delecteSelectedGoods:(UIButton *)sender {

勾芒's avatar
勾芒 committed
333 334 335 336 337 338
    
    [self CreateMBProgressHUDLoding];
    DeleteCartRequest *delecteGoods = [[DeleteCartRequest alloc]init];
    //code数组
    NSMutableArray *codeArr = [NSMutableArray array];
    //需要删除的cell数组indexpath
勾芒's avatar
勾芒 committed
339
    NSMutableArray *delecteArray = [NSMutableArray array];
勾芒's avatar
勾芒 committed
340 341
    //模型数组
    NSMutableArray *delectemodel = [NSMutableArray array];
勾芒's avatar
勾芒 committed
342 343 344 345
    for (int i=0; i<self.shopResponseArray.count; i++) {
        
        ShopcarModel *model = [self.shopResponseArray objectAtIndex_opple:i];
        if (model.isSelected) {
勾芒's avatar
勾芒 committed
346 347 348
            
            [codeArr addObject:model.fid];
            [delectemodel addObject:model];
勾芒's avatar
勾芒 committed
349 350 351 352
            NSIndexPath *indexpath = [NSIndexPath indexPathForRow:i inSection:0];
            [delecteArray addObject:indexpath];
        }
    }
勾芒's avatar
勾芒 committed
353 354 355 356 357 358 359 360 361 362 363
    //没有选中任何商品
    if (codeArr.count == 0) {
        [self RemoveMBProgressHUDLoding];
        return;
    }
    delecteGoods.cartIds = codeArr;
    [[NetworkRequestClassManager Manager] NetworkRequestWithURL:[NSString stringWithFormat:@"%@%@",ServerAddress,@"/shopcart/delete"] WithRequestType:0 WithParameter:delecteGoods WithReturnValueBlock:^(id returnValue) {
        
        [self RemoveMBProgressHUDLoding];
        if ([returnValue[@"code"] isEqualToNumber:@0]) {
            
勾芒's avatar
勾芒 committed
364
            [self QueryShoppingCarNumber];
勾芒's avatar
勾芒 committed
365 366 367 368 369
            //删除商品
            for (ShopcarModel *model in delectemodel) {
                [self.shopResponseArray removeObject:model];
            }
            [self.shoppingTableview deleteRowsAtIndexPaths:delecteArray withRowAnimation:UITableViewRowAnimationLeft];
曹云霄's avatar
曹云霄 committed
370 371 372
            dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
                [self.shoppingTableview reloadData];
            });
勾芒's avatar
勾芒 committed
373
            [self SuccessMBProgressView:@"删除成功"];
勾芒's avatar
勾芒 committed
374 375 376
            [self CalculateSelectedGoodsAllprice];
            self.allSelectedButton.selected = NO;
            [self.settlementButton setTitle:@"去结算(0)" forState:UIControlStateNormal];
勾芒's avatar
勾芒 committed
377 378 379 380
        }else
        {
            [self ErrorMBProgressView:returnValue[@"message"]];
        }
勾芒's avatar
勾芒 committed
381

勾芒's avatar
勾芒 committed
382 383 384 385 386 387 388
    } WithErrorCodeBlock:^(id errorCodeValue) {
        
        
    } WithFailureBlock:^(id error) {
        
        [self RemoveMBProgressHUDLoding];
    }];
勾芒's avatar
勾芒 committed
389
}
曹云霄's avatar
曹云霄 committed
390 391


勾芒's avatar
勾芒 committed
392

勾芒's avatar
勾芒 committed
393
#pragma mark -改变商品数量
勾芒's avatar
勾芒 committed
394
- (void)ChangeGoodsNumber:(int)goodsNumber WithcostPrice:(CGFloat)costprice Withcellindex:(NSInteger)cellindex
勾芒's avatar
勾芒 committed
395
{
勾芒's avatar
勾芒 committed
396
    [self CreateMBProgressHUDLoding];
勾芒's avatar
勾芒 committed
397 398 399 400 401 402 403
    //保存商品数量
    ShopcarModel *model = [self.shopResponseArray objectAtIndex_opple:cellindex];
    model.goodsNum = goodsNumber;
//    [self.shopResponseArray replaceObjectAtIndex:cellindex withObject:model];
    
    //保存成交价格
    ShopcarModel *Newmodel = [self.shopResponseArray objectAtIndex_opple:cellindex];
勾芒's avatar
勾芒 committed
404
    Newmodel.costPrice = [NSNumber numberWithFloat:costprice];
勾芒's avatar
勾芒 committed
405 406
//    [self.shopResponseArray replaceObjectAtIndex:cellindex withObject:Newmodel];
    
勾芒's avatar
勾芒 committed
407 408 409 410 411 412 413
    
    ////在服务器保存数量、成交价
    //购物车ID
    NSString *carid = [[self.shopResponseArray objectAtIndex_opple:cellindex] fid];
    //商品id
    NSString *goodsis = [[[self.shopResponseArray objectAtIndex_opple:cellindex] goods] fid];
    //成交价
勾芒's avatar
勾芒 committed
414
    NSString *costpriceString = [NSString stringWithFormat:@"%.2f",costprice];
勾芒's avatar
勾芒 committed
415 416 417 418
    //商品数量
    NSString *goodsNumberString = [NSString stringWithFormat:@"%d",goodsNumber];
    [[NetworkRequestClassManager Manager] NetworkWithDictionaryRequestWithURL:[NSString stringWithFormat:@"%@%@%@/%@/%@/%@",ServerAddress,@"/shopcart/updateCostPrice/",carid,goodsis,costpriceString,goodsNumberString] WithRequestType:1 WithParameter:nil WithReturnValueBlock:^(id returnValue) {
        
勾芒's avatar
勾芒 committed
419
        [self RemoveMBProgressHUDLoding];
勾芒's avatar
勾芒 committed
420 421
        if ([returnValue[@"code"] isEqualToNumber:@0]) {
            NSLog(@"写入服务器成功");
勾芒's avatar
勾芒 committed
422
            [self CalculateSelectedGoodsAllprice];
勾芒's avatar
勾芒 committed
423
            [self QueryShoppingCarNumber];
勾芒's avatar
勾芒 committed
424 425 426 427 428 429 430 431 432
        }
        
    } WithErrorCodeBlock:^(id errorCodeValue) {
        
        
    } WithFailureBlock:^(id error) {
       
        NSLog(@"%@",error);
        NSLog(@"写入服务器失败");
勾芒's avatar
勾芒 committed
433
        [self RemoveMBProgressHUDLoding];
勾芒's avatar
勾芒 committed
434
    }];
勾芒's avatar
勾芒 committed
435
}
曹云霄's avatar
曹云霄 committed
436 437


曹云霄's avatar
曹云霄 committed
438 439 440 441 442 443 444 445 446 447 448 449
#pragma mark -友好界面
- (UIImage *)imageForEmptyDataSet:(UIScrollView *)scrollView
{
    return kNoDataImage;
}


- (NSAttributedString *)titleForEmptyDataSet:(UIScrollView *)scrollView
{
    return [[NSAttributedString alloc]initWithString:@"暂无数据" attributes:nil];
}

勾芒's avatar
勾芒 committed
450

勾芒's avatar
勾芒 committed
451 452


曹云霄's avatar
曹云霄 committed
453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468
- (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