// // PayAlert.m // smartRhino // // Created by niuzhen on 2020/4/30. // Copyright © 2020 tederen. All rights reserved. // #import "PayAlert.h" #import "PayAlertCell.h" static UINib *ViewNib = nil; @interface PayAlert() @end @implementation PayAlert + (instancetype)share { if (ViewNib == nil) { ViewNib = [UINib nibWithNibName:@"PayAlert" bundle:nil]; } PayAlert *alert = [[ViewNib instantiateWithOwner:nil options:nil] lastObject]; [alert setFrame:CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT)]; alert.bgColor = [UIColor clearColor]; alert.tableView.delegate = alert; alert.tableView.dataSource = alert; [alert.disBtn addTarget:alert action:@selector(dismiss) forControlEvents:UIControlEventTouchUpInside]; alert.Constant.constant = 190 + 30 + 70 * 3; [alert.tableView reloadData]; return alert; } - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { return 3; } - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath { return [PayAlertCell configCellHeight]; } - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { PayAlertCell * cell = [PayAlertCell configCell:tableView indexPath:indexPath]; return cell; } - (void)show { [super show]; } - (void)dismiss { [self dismissWithAnimation:kAlertAnimationBottom]; } @end