forked from wangbus/lemonade_alley-iphone
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from wangbus/master
Updated
- Loading branch information
Showing
49 changed files
with
4,643 additions
and
133 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Binary file modified
BIN
+14.2 KB
(110%)
...odeproj/project.xcworkspace/xcuserdata/jianshi.xcuserdatad/UserInterfaceState.xcuserstate
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// | ||
// PagesViewController.h | ||
// LemonadeAlley | ||
// | ||
// Created by James Wang on 10/22/11. | ||
// Copyright (c) 2011 __MyCompanyName__. All rights reserved. | ||
// | ||
|
||
#import <UIKit/UIKit.h> | ||
#import "WordpressPageAgent.h" | ||
#import "MBProgressHUD.h" | ||
|
||
@interface AboutViewController : UITableViewController | ||
|
||
@property (strong, nonatomic) WordpressPageAgent *wordpressPageAgent; | ||
@property (strong, nonatomic) MBProgressHUD *HUD; | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,199 @@ | ||
#import "AboutViewController.h" | ||
#import "PageViewController.h" | ||
|
||
@implementation AboutViewController | ||
@synthesize wordpressPageAgent; | ||
@synthesize HUD; | ||
|
||
- (id)initWithStyle:(UITableViewStyle)style { | ||
self = [super initWithStyle:style]; | ||
if (self) { | ||
// Custom initialization | ||
} | ||
return self; | ||
} | ||
|
||
- (void)didReceiveMemoryWarning { | ||
// Releases the view if it doesn't have a superview. | ||
[super didReceiveMemoryWarning]; | ||
|
||
// Release any cached data, images, etc that aren't in use. | ||
} | ||
|
||
#pragma mark - View lifecycle | ||
|
||
- (void)viewDidLoad { | ||
[super viewDidLoad]; | ||
self.tableView.backgroundView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"lemon_200x200.png"]]; | ||
wordpressPageAgent = [[WordpressPageAgent alloc] init]; | ||
self.parentViewController.title = @"About"; | ||
// Uncomment the following line to preserve selection between presentations. | ||
// self.clearsSelectionOnViewWillAppear = NO; | ||
|
||
// Uncomment the following line to display an Edit button in the navigation bar for this view controller. | ||
// self.navigationItem.rightBarButtonItem = self.editButtonItem; | ||
} | ||
|
||
- (void)viewDidUnload | ||
{ | ||
[super viewDidUnload]; | ||
// Release any retained subviews of the main view. | ||
// e.g. self.myOutlet = nil; | ||
} | ||
|
||
- (void)viewWillAppear:(BOOL)animated { | ||
[[NSNotificationCenter defaultCenter] addObserver:self | ||
selector:@selector(receiveDataNotification:) | ||
name:@"PagesUpdateNotification" | ||
object:nil]; | ||
[super viewWillAppear:animated]; | ||
} | ||
|
||
- (void)viewDidAppear:(BOOL)animated | ||
{ | ||
[super viewDidAppear:animated]; | ||
} | ||
|
||
- (void)viewWillDisappear:(BOOL)animated | ||
{ | ||
[super viewWillDisappear:animated]; | ||
} | ||
|
||
- (void)viewDidDisappear:(BOOL)animated | ||
{ | ||
[super viewDidDisappear:animated]; | ||
} | ||
|
||
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation | ||
{ | ||
// Return YES for supported orientations | ||
return (interfaceOrientation == UIInterfaceOrientationPortrait); | ||
} | ||
|
||
#pragma mark - Table view data source | ||
|
||
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { | ||
return 1; | ||
} | ||
|
||
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { | ||
return [[wordpressPageAgent pages] count]; | ||
} | ||
|
||
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { | ||
static NSString *CellIdentifier = @"Cell"; | ||
|
||
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; | ||
if (cell == nil) { | ||
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:CellIdentifier]; | ||
} | ||
NSUInteger row = [indexPath row]; | ||
NSDictionary *page = [[wordpressPageAgent pages] objectAtIndex:row]; | ||
|
||
NSLog(@"Page: %@", page); | ||
// Configure the cell... | ||
cell.backgroundColor = [UIColor colorWithWhite:1.0 alpha:0.8]; | ||
cell.textLabel.font = [UIFont fontWithName:@"Helvetica-Bold" size:14.0]; | ||
// cell.textLabel.textColor = [UIColor whiteColor]; | ||
cell.textLabel.text = [page objectForKey:@"name"]; | ||
// cell.detailTextLabel.font = [UIFont fontWithName:@"Noteworthy-Light" size:14.0]; | ||
cell.detailTextLabel.text = [page objectForKey:@"url"]; | ||
return cell; | ||
} | ||
|
||
- (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section { | ||
if (section == 0) { | ||
return @"Information"; | ||
} | ||
else { | ||
return @""; | ||
} | ||
} | ||
|
||
/* | ||
// Override to support conditional editing of the table view. | ||
- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath | ||
{ | ||
// Return NO if you do not want the specified item to be editable. | ||
return YES; | ||
} | ||
*/ | ||
|
||
/* | ||
// Override to support editing the table view. | ||
- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath | ||
{ | ||
if (editingStyle == UITableViewCellEditingStyleDelete) { | ||
// Delete the row from the data source | ||
[tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationFade]; | ||
} | ||
else if (editingStyle == UITableViewCellEditingStyleInsert) { | ||
// Create a new instance of the appropriate class, insert it into the array, and add a new row to the table view | ||
} | ||
} | ||
*/ | ||
|
||
/* | ||
// Override to support rearranging the table view. | ||
- (void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)fromIndexPath toIndexPath:(NSIndexPath *)toIndexPath | ||
{ | ||
} | ||
*/ | ||
|
||
/* | ||
// Override to support conditional rearranging of the table view. | ||
- (BOOL)tableView:(UITableView *)tableView canMoveRowAtIndexPath:(NSIndexPath *)indexPath | ||
{ | ||
// Return NO if you do not want the item to be re-orderable. | ||
return YES; | ||
} | ||
*/ | ||
|
||
#pragma mark - Table view delegate | ||
|
||
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { | ||
// Navigation logic may go here. Create and push another view controller. | ||
/* | ||
DetailViewController *detailViewController = [[DetailViewController alloc] initWithNibName:@"Nib name" bundle:nil]; | ||
// ... | ||
// Pass the selected object to the new view controller. | ||
[self.navigationController pushViewController:detailViewController animated:YES]; | ||
*/ | ||
} | ||
|
||
- (void) receiveDataNotification:(NSNotification *) notification { | ||
if ([[notification name] isEqualToString:@"PagesUpdateNotification"]) { | ||
NSLog (@"Successfully received the Data Update notification!"); | ||
[[self tableView] reloadData]; | ||
[HUD hide:YES]; | ||
} | ||
} | ||
|
||
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { | ||
NSLog(@"Segue identifier: %@", segue.identifier); | ||
|
||
if ([[segue identifier] isEqualToString:@"showPage"]) { | ||
NSLog(@"ShowDetails from prepareforsegue"); | ||
NSInteger row = [[self.tableView indexPathForSelectedRow] row]; | ||
NSDictionary *page = [wordpressPageAgent.pages objectAtIndex:row]; | ||
|
||
// [segue destinationViewController] is read-only, so in order to | ||
// write to that view controller you'll have to locally instantiate | ||
// it here: | ||
PageViewController *detailViewController = [segue destinationViewController]; | ||
detailViewController.page = page; | ||
|
||
// You now have a solid reference to the upcoming / destination view | ||
// controller. Example use: Allocate and initialize some property of | ||
// the destination view controller before you reach it and inject a | ||
// reference to the current view controller into the upcoming one: | ||
// upcomingViewController.someProperty = [[SomePropertyClass alloc] initWithString:@"Whatever!"]; | ||
// upcomingViewController. = [segue sourceViewController]; | ||
|
||
// Or, equivalent, but more straightforward: | ||
//upcomingViewController.initialViewController = self; | ||
} | ||
} | ||
|
||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
/* | ||
* Copyright 2010 Facebook | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
|
||
#include "Facebook.h" | ||
#include "FBDialog.h" | ||
#include "FBLoginDialog.h" | ||
#include "FBRequest.h" | ||
#include "SBJSON.h" |
Binary file added
BIN
+4.3 KB
LemonadeAlley/LemonadeAlley/FBConnect/FBDialog.bundle/images/close.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+5.42 KB
LemonadeAlley/LemonadeAlley/FBConnect/FBDialog.bundle/images/close@2x.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+226 Bytes
LemonadeAlley/LemonadeAlley/FBConnect/FBDialog.bundle/images/fbicon.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.