FRANotificationsTableViewController.m revision 3cb6a584a87fa8fec140b0bb20dd91731d13e751
/*
* The contents of this file are subject to the terms of the Common Development and
* Distribution License (the License). You may not use this file except in compliance with the
* License.
*
* You can obtain a copy of the License at legal/CDDLv1.0.txt. See the License for the
* specific language governing permission and limitations under the License.
*
* When distributing Covered Software, include this CDDL Header Notice in each file and include
* the License file at legal/CDDLv1.0.txt. If applicable, add the following below the CDDL
* Header, with the fields enclosed by brackets [] replaced by your own identifying
* information: "Portions copyright [year] [name of copyright owner]".
*
* Copyright 2016 ForgeRock AS.
*/
#import "FRAIdentityDatabase.h"
#import "FRANotification.h"
#import "FRANotificationsTableViewController.h"
#import "FRANotificationViewController.h"
#import "FRANotificationTableViewCell.h"
#import "FRAPushMechanism.h"
NSString * const FRANotificationsTableViewControllerStoryboardIdentifer = @"NotificationsTableViewController";
NSString * const FRANotificationsTableViewControllerShowNotificationsSegue = @"showNotificationSegue";
/*!
* Private interface.
*/
@interface FRANotificationsTableViewController ()
/*!
* Timer for updating age of notifications.
*/
@end
[super viewWillAppear:animated];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(handleIdentityDatabaseChanged:) name:FRAIdentityDatabaseChangedNotification object:nil];
self.timer = [NSTimer scheduledTimerWithTimeInterval:1.0 target:self selector:@selector(timerCallback:) userInfo:nil repeats:YES];
}
}
}
FRANotificationViewController *controller = (FRANotificationViewController *)segue.destinationViewController;
}
}
return NUMBER_OF_SECTIONS;
}
if (section == PENDING_SECTION_INDEX) {
} else {
}
}
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
UIColor* dashboardRed = [UIColor colorWithRed:169.0/255.0 green:68.0/255.0 blue:66.0/255.0 alpha:1.0];
FRANotificationTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath];
cell.image.image = [[UIImage imageNamed:@"PendingIcon"] imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate];
return cell;
FRANotificationTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath];
if (notification.isApproved) {
cell.image.image = [[UIImage imageNamed:@"ApprovedIcon"] imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate];
} else if (notification.isDenied) {
cell.image.image = [[UIImage imageNamed:@"DeniedIcon"] imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate];
} else if (notification.isExpired) {
cell.image.image = [[UIImage imageNamed:@"DeniedIcon"] imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate];
}
return cell;
} else {
}
}
- (NSIndexPath *)tableView:(UITableView *)tableView willSelectRowAtIndexPath:(NSIndexPath *)indexPath {
return indexPath;
} else {
return nil;
}
}
-(void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath {
// make table cell separator lines full width (normally, they leave a ~10% gap at the left edge)
}
}
}
- (NSArray *)pendingNotifications {
if (notification.isPending) {
}
}
return pendingNotifications;
}
/*!
* Sorts notifications in reverse chronological order.
*/
[notifications sortUsingComparator:^NSComparisonResult(FRANotification* first, FRANotification* second) {
}];
}
- (NSArray *)completedNotifications {
if (!notification.isPending) {
}
}
return completedNotifications;
}
}
}
@end