2
// RootViewController.m
5
// Created by Nathan Weiner on 6/4/10.
6
// Copyright Idea Shower, LLC 2010. All rights reserved.
9
#import "RootViewController.h"
10
#import "ExampleShareLink.h"
11
#import "ExampleShareImage.h"
12
#import "ExampleShareText.h"
13
#import "ExampleShareFile.h"
16
@implementation RootViewController
22
self.toolbarItems = [NSArray arrayWithObjects:
23
[[[UIBarButtonItem alloc] initWithTitle:SHKLocalizedString(@"Logout") style:UIBarButtonItemStyleBordered target:self action:@selector(logout)] autorelease],
29
#pragma mark Table view data source
32
// Customize the number of sections in the table view.
33
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
38
// Customize the number of rows in the table view.
39
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
45
// Customize the appearance of table view cells.
46
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
48
static NSString *CellIdentifier = @"Cell";
50
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
52
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
55
switch (indexPath.row)
58
cell.textLabel.text = SHKLocalizedString(@"Sharing a Link");
62
cell.textLabel.text = SHKLocalizedString(@"Sharing an Image");
66
cell.textLabel.text = SHKLocalizedString(@"Sharing Text");
70
cell.textLabel.text = SHKLocalizedString(@"Sharing a File");
74
// cell.textLabel.text = @"Logout of All Services";
83
#pragma mark Table view delegate
85
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
87
switch (indexPath.row)
90
[self.navigationController pushViewController:[[[ExampleShareLink alloc] initWithNibName:nil bundle:nil] autorelease] animated:YES];
95
[self.navigationController pushViewController:[[[ExampleShareImage alloc] initWithNibName:nil bundle:nil] autorelease] animated:YES];
99
[self.navigationController pushViewController:[[[ExampleShareText alloc] initWithNibName:nil bundle:nil] autorelease] animated:YES];
103
[self.navigationController pushViewController:[[[ExampleShareFile alloc] initWithNibName:nil bundle:nil] autorelease] animated:YES];
107
// [SHK logoutOfAll];
113
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
123
[[[[UIAlertView alloc] initWithTitle:SHKLocalizedString(@"Logout")
124
message:SHKLocalizedString(@"Are you sure you want to logout of all share services?")
126
cancelButtonTitle:SHKLocalizedString(@"Cancel")
127
otherButtonTitles:SHKLocalizedString(@"Logout"),nil] autorelease] show];
131
- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex
133
if (buttonIndex == alertView.firstOtherButtonIndex)