FRANotificationsTableViewController.m revision 2229ffbfe08c2cd606c305f8934e627548002c9e
2229ffbfe08c2cd606c305f8934e627548002c9eCraig McDonnell/*
2229ffbfe08c2cd606c305f8934e627548002c9eCraig McDonnell * The contents of this file are subject to the terms of the Common Development and
2229ffbfe08c2cd606c305f8934e627548002c9eCraig McDonnell * Distribution License (the License). You may not use this file except in compliance with the
2229ffbfe08c2cd606c305f8934e627548002c9eCraig McDonnell * License.
2229ffbfe08c2cd606c305f8934e627548002c9eCraig McDonnell *
2229ffbfe08c2cd606c305f8934e627548002c9eCraig McDonnell * You can obtain a copy of the License at legal/CDDLv1.0.txt. See the License for the
2229ffbfe08c2cd606c305f8934e627548002c9eCraig McDonnell * specific language governing permission and limitations under the License.
2229ffbfe08c2cd606c305f8934e627548002c9eCraig McDonnell *
2229ffbfe08c2cd606c305f8934e627548002c9eCraig McDonnell * When distributing Covered Software, include this CDDL Header Notice in each file and include
2229ffbfe08c2cd606c305f8934e627548002c9eCraig McDonnell * the License file at legal/CDDLv1.0.txt. If applicable, add the following below the CDDL
2229ffbfe08c2cd606c305f8934e627548002c9eCraig McDonnell * Header, with the fields enclosed by brackets [] replaced by your own identifying
2229ffbfe08c2cd606c305f8934e627548002c9eCraig McDonnell * information: "Portions copyright [year] [name of copyright owner]".
2229ffbfe08c2cd606c305f8934e627548002c9eCraig McDonnell *
2229ffbfe08c2cd606c305f8934e627548002c9eCraig McDonnell * Copyright 2016 ForgeRock AS.
2229ffbfe08c2cd606c305f8934e627548002c9eCraig McDonnell */
2229ffbfe08c2cd606c305f8934e627548002c9eCraig McDonnell
2229ffbfe08c2cd606c305f8934e627548002c9eCraig McDonnell#import "FRANotificationsTableViewController.h"
2229ffbfe08c2cd606c305f8934e627548002c9eCraig McDonnell#import "FRANotificationTableViewCell.h"
2229ffbfe08c2cd606c305f8934e627548002c9eCraig McDonnell
2229ffbfe08c2cd606c305f8934e627548002c9eCraig McDonnell@implementation FRANotificationsTableViewController
2229ffbfe08c2cd606c305f8934e627548002c9eCraig McDonnell
2229ffbfe08c2cd606c305f8934e627548002c9eCraig McDonnell- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
2229ffbfe08c2cd606c305f8934e627548002c9eCraig McDonnell // Present notifications as a flat list not broken down into sections
2229ffbfe08c2cd606c305f8934e627548002c9eCraig McDonnell return 1;
2229ffbfe08c2cd606c305f8934e627548002c9eCraig McDonnell}
2229ffbfe08c2cd606c305f8934e627548002c9eCraig McDonnell
2229ffbfe08c2cd606c305f8934e627548002c9eCraig McDonnell- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
2229ffbfe08c2cd606c305f8934e627548002c9eCraig McDonnell // TODO: Return count of active notifications
2229ffbfe08c2cd606c305f8934e627548002c9eCraig McDonnell return 2;
2229ffbfe08c2cd606c305f8934e627548002c9eCraig McDonnell}
2229ffbfe08c2cd606c305f8934e627548002c9eCraig McDonnell
2229ffbfe08c2cd606c305f8934e627548002c9eCraig McDonnell- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
2229ffbfe08c2cd606c305f8934e627548002c9eCraig McDonnell // TODO: Lookup relevant notification from SQLite DB
2229ffbfe08c2cd606c305f8934e627548002c9eCraig McDonnell static NSString *CellIdentifier = @"NotificationCell";
2229ffbfe08c2cd606c305f8934e627548002c9eCraig McDonnell FRANotificationTableViewCell* cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath];
2229ffbfe08c2cd606c305f8934e627548002c9eCraig McDonnell // cell.image = ...
2229ffbfe08c2cd606c305f8934e627548002c9eCraig McDonnell cell.issuer.text = @"ForgeRock";
2229ffbfe08c2cd606c305f8934e627548002c9eCraig McDonnell cell.shortDescription.text = @"Authorization request";
2229ffbfe08c2cd606c305f8934e627548002c9eCraig McDonnell cell.time.text = @"3 min ago";
2229ffbfe08c2cd606c305f8934e627548002c9eCraig McDonnell [cell layoutIfNeeded];
2229ffbfe08c2cd606c305f8934e627548002c9eCraig McDonnell return cell;
2229ffbfe08c2cd606c305f8934e627548002c9eCraig McDonnell}
2229ffbfe08c2cd606c305f8934e627548002c9eCraig McDonnell
2229ffbfe08c2cd606c305f8934e627548002c9eCraig McDonnell@end