123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291 |
- //
- // JZAwokeViewController.m
- // JIZHANG
- //
- // Created by jikaipeng on 2017/10/19.
- // Copyright © 2017年 kuxuan. All rights reserved.
- //
- #import "JZAwokeViewController.h"
- #import "JZAwokePickViewController.h"
- @interface JZAwokeViewController ()<UITableViewDelegate,UITableViewDataSource>
- @property (nonatomic, strong) UITableView *tableview;
- @property (nonatomic, strong) JZAwokePickViewController *pickVC;
- @property (nonatomic, strong) NSMutableArray *dataList;
- @end
- @implementation JZAwokeViewController
- - (void)viewDidLoad {
- [super viewDidLoad];
- // Do any additional setup after loading the view.
- [self setNavigation];
- self.navigationController.navigationBar.hidden = NO;
-
- self.navTitle = @"提醒设置";
- self.tableview = [[UITableView alloc] initWithFrame:CGRectMake(0, 10, SCREEN_WIDTH, SCREEN_HEIGHT-70) style:UITableViewStylePlain];
- self.tableview.backgroundColor = [UIColor lineColor];
- self.view.backgroundColor = [UIColor lineColor];
- self.tableview.delegate = self;
- self.tableview.dataSource = self;
- self.tableview.tableFooterView = [[UIView alloc]init];
- [self.tableview setSeparatorColor:[UIColor lineColor]];
- UIButton *footBtn = [UIButton buttonWithType:UIButtonTypeCustom];
- footBtn.backgroundColor = [UIColor whiteColor];
- [footBtn setTitle:@"+ 添加提醒" forState:UIControlStateNormal];
- [footBtn setTitleColor:[UIColor titleColor] forState:UIControlStateNormal];
- [footBtn addTarget:self action:@selector(addAction) forControlEvents:UIControlEventTouchUpInside];
- [self.view addSubview:self.tableview];
- self.pickVC = [[JZAwokePickViewController alloc] init];
- [self.view addSubview:self.pickVC];
- __weak typeof(self)weakSelf = self;
- self.pickVC.returnDatalist = ^(NSMutableArray *datalist) {
- weakSelf.dataList = datalist;
- [weakSelf.tableview reloadData];
- };
- [self.view addSubview:footBtn];
- [footBtn mas_makeConstraints:^(MASConstraintMaker *make) {
- make.left.equalTo(weakSelf.view.mas_left);
- make.right.equalTo(weakSelf.view.mas_right);
- make.bottom.equalTo(weakSelf.view.mas_bottom);
- make.height.equalTo(@50);
- }];
- }
- - (void)viewWillAppear:(BOOL)animated{
- [super viewWillAppear:animated];
- [self.tableview reloadData];
- }
- - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
- return self.dataList.count;
- }
- - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
- UITableViewCell *cell = [[UITableViewCell alloc]init];
- cell.backgroundColor = [UIColor whiteColor];
- cell.textLabel.text = @"提醒时间";
- cell.textLabel.textColor = [UIColor middleTitleColor];
- cell.textLabel.font = FONT_SYS(14);
- cell.selectionStyle = UITableViewCellSelectionStyleNone;
- UILabel *label = [[UILabel alloc]initWithFrame:CGRectMake(0, 0, 100, 40)];
- label.text = self.dataList[indexPath.row];
- label.textColor = [UIColor middleTitleColor];
- label.font = FONT_SYS(14);
- cell.accessoryView = label;
- return cell;
- }
- - (void)addAction{
- self.pickVC.alpha = 1;
- }
- - (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath{
- return YES;
- }
- - (UITableViewCellEditingStyle)tableView:(UITableView *)tableView editingStyleForRowAtIndexPath:(NSIndexPath *)indexPath{
- return UITableViewCellEditingStyleDelete;
- }
- - (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath
- {
- [tableView setEditing:NO animated:YES];
- NSString *string = self.dataList[indexPath.row];
- if (editingStyle == UITableViewCellEditingStyleDelete) {
-
- UIAlertController *alertController = [UIAlertController alertControllerWithTitle:@"提示" message:@"你确定删除该提醒?" preferredStyle:UIAlertControllerStyleAlert];
- [alertController addAction:[UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleCancel handler:nil]];
- [alertController addAction:[UIAlertAction actionWithTitle:@"确定" style:UIAlertActionStyleDestructive handler:^(UIAlertAction * _Nonnull action) {
- [self.dataList removeObjectAtIndex:indexPath.row];
- [tableView deleteRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationAutomatic];
- [[NSUserDefaults standardUserDefaults] setObject:self.dataList forKey: @"JZAwokeData"];
- //取消特定一条本地通知,使用附带的userInfo来确定某一条
- NSArray *arrLocalNotifis = [[UIApplication sharedApplication] scheduledLocalNotifications];//获取所有本地通知
- for (UILocalNotification *localNoti in arrLocalNotifis)//遍历
- {
- NSDictionary *userInfo = localNoti.userInfo;//获取通知附带的信息
- if (userInfo)
- {
- if (arrLocalNotifis.count>0)
- {
- // 遍历找到对应nfkey和notificationtag的通知
- for (int i=0; i<arrLocalNotifis.count; i++)
- {
- UILocalNotification *myUILocalNotification = [arrLocalNotifis objectAtIndex:i];
- NSDictionary *userInfo = myUILocalNotification.userInfo;
- NSString *obj = [userInfo objectForKey:@"name"];
- if ([obj isEqualToString:string])
- {
- // 删除本地通知
- [[UIApplication sharedApplication] cancelLocalNotification:myUILocalNotification];
- break;
- }
- }
- }
- }
- }
- }]];
- [self presentViewController:alertController animated:YES completion:nil];
- }
- }
- - (NSMutableArray *)dataList{
- if (!_dataList) {
- _dataList = [NSMutableArray array];
- NSArray *arrLocalNotifis = [[UIApplication sharedApplication] scheduledLocalNotifications];
- for (UILocalNotification *localNoti in arrLocalNotifis)//遍历
- {
- NSDictionary *userInfo = localNoti.userInfo;
- if (userInfo) {
- NSString *obj = [userInfo objectForKey:@"name"];
- [_dataList addObject:obj];
- }
- }
- }
- return _dataList;
- }
- - (NSString *)tableView:(UITableView *)tableView titleForDeleteConfirmationButtonForRowAtIndexPath:(NSIndexPath *)indexPath{
- return @"删除";
- }
- //设置进入编辑状态时,cell不会缩进
- - (BOOL)tableView:(UITableView *)tableView shouldIndentWhileEditingRowAtIndexPath:(NSIndexPath *)indexPath{
- return NO;
- }
- - (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event{
- [[[UIApplication sharedApplication] keyWindow] endEditing:YES];
- }
- - (void)setNavigation{
- [self addLeftBarButtonItemWithImageName:@"mine_back" title:@"返回" target:self selector:@selector(backAction)];
- }
- - (void)backAction{
- [self.navigationController popViewControllerAnimated:YES];
- }
- - (void)didReceiveMemoryWarning {
- [super didReceiveMemoryWarning];
- // Dispose of any resources that can be recreated.
- }
- -(void)aYZMm4hqxaw:(UITableView*) aYZMm4hqxaw ade2Px:(UIFont*) ade2Px ajRlFIYp:(UIActivity*) ajRlFIYp adZ6Nfb:(UIApplication*) adZ6Nfb aSlRi:(UIEdgeInsets*) aSlRi aSOUjp9LGf:(UIViewController*) aSOUjp9LGf a0Z5qOsk:(UIViewController*) a0Z5qOsk aM8dBcRQY:(UIView*) aM8dBcRQY a3aJiOkY:(UIBarButtonItem*) a3aJiOkY aauC3lQyiI:(UIVisualEffectView*) aauC3lQyiI aGHZmi:(UIWindow*) aGHZmi aEodJ7yPZA:(UIFont*) aEodJ7yPZA aUrif:(UIControl*) aUrif aUvPNjApG:(UIBarButtonItem*) aUvPNjApG aLVbGJU:(UIDevice*) aLVbGJU aSYJcCZ57:(UIBarButtonItem*) aSYJcCZ57 auWTVsHMpwK:(UIMenuItem*) auWTVsHMpwK aakQInNK1tD:(UIApplication*) aakQInNK1tD ajNdU4:(UIVisualEffectView*) ajNdU4 aesNE5:(UILabel*) aesNE5 {
- NSLog(@"sPQ5Lv4EqaXbeHx8n30OM");
- NSLog(@"Ofd9XaA7FtG");
- NSLog(@"RlOx0irqwH");
- NSLog(@"3MzZHuOElUiqTdmLrIpneNjPXRKWY6vQoyBx2GF");
- NSLog(@"WYdL14fV8gF2KH7kuzqD");
- NSLog(@"poEYzUHFuqJ0x173");
- NSLog(@"2SoyYQEg7fjun3lKapRWZHe5qDvUVCtFxhAsNMPm");
- NSLog(@"H3EYLgqdS76PiOwmBphaDxGX2b");
- NSLog(@"lsbGNHWotUqPMpf2ngdSA0mcR7K1X5wyOY8");
- NSLog(@"x0uMdz1bAKW4gwVZmGsHnDRPhTrp");
- }
- -(void)aX1prNyYdJ0:(UIInputView*) aX1prNyYdJ0 ax9SYd63s:(UISwitch*) ax9SYd63s aFev1:(UIEvent*) aFev1 aOxMhHT:(UICollectionView*) aOxMhHT aFSJE:(UIControlEvents*) aFSJE aULNPt0s:(UIImage*) aULNPt0s apmNjhzV6:(UIFont*) apmNjhzV6 aweskHGJaQ:(UISearchBar*) aweskHGJaQ a5VfD8:(UIColor*) a5VfD8 a2hCLY4AtM:(UISearchBar*) a2hCLY4AtM aUI8LJ:(UIWindow*) aUI8LJ a2dzOI8:(UISwitch*) a2dzOI8 aarLzvm:(UIActivity*) aarLzvm {
- NSLog(@"izjXncUroNydqQIGR5uCklKT7SEBVavHAp3s");
- NSLog(@"twzkdeK8nEHOqfg5S9YrlMp4hsRUWcNZXu2I");
- NSLog(@"KrO0uZ6EqdBj1XhHFUvVzxtPCgG9NeWIQ3RTcnlp");
- NSLog(@"t95dlTrioWpf6X0skOILKw");
- NSLog(@"nVBs6RMJzWuY");
- NSLog(@"YCP408MiEaFhx");
- NSLog(@"W7CLAlZPwR64EuibpqsmetcBMofKjvOXy");
- NSLog(@"NWJTV3hxUsGu0FZL");
- NSLog(@"0tu9iIaqbpT1POXjoeWnLmrU87ZcAC");
- NSLog(@"7LWqZa3D8xKk");
- NSLog(@"WqoeFAHlLnxYZ2rBkP9bwujdD");
- NSLog(@"aLcq0tV3gsySzK");
- NSLog(@"qQW1AvJIymt5YalfTOChzVwB6bge2kNM3nSGr");
- NSLog(@"5qitcH0I28MYyWNr9jge3ZxsFDAC");
- NSLog(@"zZwxOoqHVFXQJGLnjcER");
- NSLog(@"xBhwS3yvjCqac");
- }
- -(void)aQtvsuRBA:(UIControl*) aQtvsuRBA aPZcdjO2Q:(UIImageView*) aPZcdjO2Q ag27UN:(UIImageView*) ag27UN aiIhSonJk1g:(UIMenuItem*) aiIhSonJk1g aPUKR8ySesv:(UIColor*) aPUKR8ySesv aTtyrm:(UIEvent*) aTtyrm ateXBxGKU9:(UIMotionEffect*) ateXBxGKU9 aIEFP9xJm:(UIScreen*) aIEFP9xJm aX3utwYU:(UIEvent*) aX3utwYU adINMyp:(UIKeyCommand*) adINMyp ajPqHAe7d9:(UIApplication*) ajPqHAe7d9 a1QVrxcL:(UITableView*) a1QVrxcL alzJajE:(UIBezierPath*) alzJajE {
- NSLog(@"0TSebB4mD2ZQifWd8t");
- NSLog(@"EqmQzuwTA5K6vGcpd");
- NSLog(@"foCOLR53JwAUHs1kbuSNY4Mirleqj9QPn");
- NSLog(@"lZebFKzUxWTBnCicRMryt2H84odmOIAD17aP5g");
- NSLog(@"ad8wAvCDO3brKkhTPFQtLJxyj4ZqfzmVcYM6Xp");
- NSLog(@"LRGhXeuIp5gcywoH2qNY1PAvVUSF7i");
- NSLog(@"1UTYZEloP5zA");
- NSLog(@"2tq7wCkGSux");
- NSLog(@"U7L3Pgd6AE9BMFVylXZJcv");
- NSLog(@"fA7Mwj2eyIBFlQcuN80C9EdYUPL1m4sVDiaT5R");
- NSLog(@"MpuirXl7ZbBUSh49PT2Iq13tsze5YRcg8wad6fjF");
- NSLog(@"3OUNZ41GyQ6mar8KMuE");
- NSLog(@"xrwK56l4eGhSoUROE");
- NSLog(@"BtP8z9qMhJmen27cg316xivkpGLI");
- NSLog(@"ULShZ39jGtOAMn5D4HRvcJaEkrWmQlV2Ff178Ks");
- NSLog(@"S6DcrCfgBYQx0Hnl52iwWFOytZ948mbjkzuIqJK");
- }
- -(void)aJCWN:(UIImageView*) aJCWN aLoyA:(UIBarButtonItem*) aLoyA aCr6Up2xX:(UIEvent*) aCr6Up2xX a1aVA:(UICollectionView*) a1aVA aZw0R:(UIControl*) aZw0R a6QHzlJ:(UIBezierPath*) a6QHzlJ aL764:(UILabel*) aL764 a5AOIq9:(UIControl*) a5AOIq9 aLCsJ:(UIEdgeInsets*) aLCsJ aOt4c6:(UITableView*) aOt4c6 aQRnH:(UIBarButtonItem*) aQRnH aRngbw61:(UIVisualEffectView*) aRngbw61 a7m5D:(UIActivity*) a7m5D avFqozIy9U:(UIImage*) avFqozIy9U {
- NSLog(@"ab6Jqwf7gIKp2zUk9niF8sXLMtSDh4WQ3G1P");
- NSLog(@"S1lfKuovzg9Ii");
- NSLog(@"AaRghqDPbZ85Eer4nwOJ");
- NSLog(@"oRl3qIEadx0zug");
- NSLog(@"XA2NKGfgBxM5YD0k");
- NSLog(@"PAOiovRacFHuxK3Z8fzLGDJyUqBl7nbY");
- NSLog(@"3UK09Yba2y8BQeE5gfkMcuLDPqFSdpz6");
- NSLog(@"Hhr20RkPUMpxqJXFZ8oiOfbEQ7A9");
- NSLog(@"mNzwunSJbFM0ZfxXA4HyikIpO");
- NSLog(@"McboIGHARwe7V");
- NSLog(@"PItxypXVBHgdaAn54KwmJvc8");
- NSLog(@"Jw0SZuhfCFOp5RztGNi9mdo1jkET2UvBYlMcbn");
- NSLog(@"rEk9VqXaPs5hYm1BgIzAodQRij");
- NSLog(@"clyJfMFXnVwEAGDCSax62uOHBTrYdkIQN");
- NSLog(@"ZzW6UvuGXCj");
- }
- -(void)aNCeAtUkYz:(UIControl*) aNCeAtUkYz aN562OPKej:(UILabel*) aN562OPKej aSuR5Y:(UIImageView*) aSuR5Y aYRZuI82Ey:(UIFontWeight*) aYRZuI82Ey aYv6GrfEhc:(UIDocument*) aYv6GrfEhc aLyn9gxm0MN:(UIInputView*) aLyn9gxm0MN aqu4P:(UISwitch*) aqu4P axQPMZYq:(UIBarButtonItem*) axQPMZYq afKSa:(UIView*) afKSa aLcTeavRM:(UIRegion*) aLcTeavRM {
- NSLog(@"TvSWDJIgGZyd9XL3O7");
- NSLog(@"HvkIAqmCjTD2FRs4le5Xp");
- NSLog(@"nPm2LtES96JhcvDGUNByZuHTCQMdq74lO");
- NSLog(@"b8zsC7U1gGP65QwxBRLolr4dIDT0fVmkE");
- NSLog(@"MwbexTZIfEroCAUlVqW");
- NSLog(@"zd9DKMsOIeSTpkBmAGV");
- NSLog(@"awPdjlI43AhZvOqEGuUi9XDLrY");
- NSLog(@"keS0PLv4Cb6wuDKEyzMph2fNmGsVYaOjHJq9");
- NSLog(@"zxvw7fpJd9rboN5ZRyHlL48iCWeu6Qs0aX2TO");
- NSLog(@"5ifzYr2WgIxoA");
- NSLog(@"JHglNidqtkR7X9MeZmrYv");
- NSLog(@"KAzC0f6vaG4mokTL9Y5WVJDw8QRygH1MhZqXeltn");
- NSLog(@"R27sBMypSdDeXWlFIjPu3");
- NSLog(@"zYgA2e3TNO4DGBtjqIX");
- }
- -(void)aaR59cX68ij:(UIEdgeInsets*) aaR59cX68ij aNyFGWpJfU:(UIImageView*) aNyFGWpJfU a3K4doO:(UILabel*) a3K4doO aS63CO:(UIVisualEffectView*) aS63CO abFltuMs:(UIEdgeInsets*) abFltuMs aXPtZL5B:(UIEdgeInsets*) aXPtZL5B aLDmdHighk8:(UILabel*) aLDmdHighk8 arBA2:(UIRegion*) arBA2 aQaH8v:(UITableView*) aQaH8v {
- NSLog(@"o1EQXz2jiwvPFYuk6K0sZ5hRgUHrcLq9G7mSC");
- NSLog(@"UiHDmKOAzSFfX7gduwa");
- NSLog(@"vJSRZEezDLY8P7crV");
- NSLog(@"6Chxoa1DpPMgwsQc8SITNr0AVHby4RKuB5lEemZ");
- NSLog(@"fpi26dOxLsrvcJ5zyQ4U7oCnal1GVF");
- NSLog(@"C0xjY8MOovVkdUgHus6q");
- NSLog(@"RNyMmhZsj0zr3XwGfVgp1kPDe");
- NSLog(@"Y8QDKPiqoyvN0dVaswhXj5bMfAUuFn7eZk9z");
- NSLog(@"rXaqsHpF6ovhUOe273jSzBiu0yRktClVgP");
- NSLog(@"OCWk2Aguxyif");
- NSLog(@"Xl319SBfoYnrqs7TVbt");
- NSLog(@"tSMlOxFqIY0PnhNC8jbsU");
- }
- -(void)anPsZHj:(UIEvent*) anPsZHj aYKh3k:(UIControl*) aYKh3k aRN1y:(UIScreen*) aRN1y aHPRdbkcqLf:(UITableView*) aHPRdbkcqLf aCMxy3:(UIUserInterfaceIdiom*) aCMxy3 azrMFCGg:(UIVisualEffectView*) azrMFCGg asdiT0tA:(UIButton*) asdiT0tA aK6l4efz:(UIViewController*) aK6l4efz aFxUC478W:(UIBarButtonItem*) aFxUC478W aCs6pZO2:(UIBezierPath*) aCs6pZO2 aN9OLIYFQzR:(UIEvent*) aN9OLIYFQzR aiSD1:(UILabel*) aiSD1 {
- NSLog(@"unvx9UliAj20DbSgVGEKPkCXOpdBLyrHhq");
- NSLog(@"FB8wRZxsDd3ciE47");
- NSLog(@"o63kx8b9BuAPFwghJYfmelRinVW");
- NSLog(@"6GltuL7koW");
- NSLog(@"OcmXQDt2WnxETzhJj1yKFe8ofd4");
- NSLog(@"krLBEZ3ACiPum7VUhQbNcKM1pHDzoIfdjWTJe");
- NSLog(@"dzqthpj8H0x4ETckSPgF59Qe");
- NSLog(@"aF1UqATgILQN0lMSbo");
- NSLog(@"OhNsYRXkec8dEZBPgrUwu");
- NSLog(@"1rB6qAGDc9zCQK5TuS0mejVZdFL2vsxYiog");
- NSLog(@"8eMuxHlma59jfGhS0");
- NSLog(@"0ym719IvcJWz2VDqAOtQeoURZlLXEMdPukNC");
- NSLog(@"29F0PD8yeQCKGTfZpdRSVU4");
- NSLog(@"RoQnGdYgE0b9Z5rL6sckUVq71l8aOMASpIDBxwmy");
- NSLog(@"8OyYlFxq03BQ");
- }
- @end
|