Skip to content

Commit

Permalink
Intitial Checkin
Browse files Browse the repository at this point in the history
  • Loading branch information
Blake Byrnes committed May 20, 2014
0 parents commit 41db92c
Show file tree
Hide file tree
Showing 36 changed files with 1,788 additions and 0 deletions.
20 changes: 20 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Xcode
.DS_Store
build/
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3
*.xcworkspace
!default.xcworkspace
xcuserdata
profile
*.moved-aside
DerivedData
.idea/
# Pods - for those of you who use CocoaPods
Pods
4 changes: 4 additions & 0 deletions Podfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
platform :ios, '6.0'

pod 'RestKit', '~> 0.23.0'
pod 'BButton'
42 changes: 42 additions & 0 deletions Podfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
PODS:
- AFNetworking (1.3.4)
- BButton (4.0.0)
- ISO8601DateFormatterValueTransformer (0.6.0):
- RKValueTransformers (~> 1.1.0)
- RestKit (0.23.1):
- RestKit/Core
- RestKit/Core (0.23.1):
- RestKit/CoreData
- RestKit/Network
- RestKit/ObjectMapping
- RestKit/CoreData (0.23.1):
- RestKit/ObjectMapping
- RestKit/Network (0.23.1):
- AFNetworking (~> 1.3.0)
- RestKit/ObjectMapping
- RestKit/Support
- SOCKit
- RestKit/ObjectMapping (0.23.1):
- ISO8601DateFormatterValueTransformer (~> 0.6.0)
- RestKit/Support
- RKValueTransformers (~> 1.1.0)
- RestKit/Support (0.23.1):
- TransitionKit (= 2.1.0)
- RKValueTransformers (1.1.0)
- SOCKit (1.1)
- TransitionKit (2.1.0)

DEPENDENCIES:
- BButton
- RestKit (~> 0.23.0)

SPEC CHECKSUMS:
AFNetworking: e403d4333a4e1956cb3fe42364c3c879f820c9a0
BButton: 70943d1d264997b4171554d0685b80dc9b19774e
ISO8601DateFormatterValueTransformer: db1acb188ffb0f87109a793977f750067c351efe
RestKit: 83a7f82ae7c92c51b59717325a0b895749ff2c97
RKValueTransformers: 286c8280b6f2570032d87d119863f32bc227799b
SOCKit: 8871d058926a6c6cc144f0c5eee82c5d0ec274a3
TransitionKit: 60b6a2cd9370e471c960b2cdf23b0b2593867625

COCOAPODS: 0.32.1
589 changes: 589 additions & 0 deletions feed.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

15 changes: 15 additions & 0 deletions feed/BFAppDelegate.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
//
// BFAppDelegate.h
// feed
//
// Created by Blake Byrnes on 5/19/14.
// Copyright (c) 2014 bluefletch. All rights reserved.
//

#import <UIKit/UIKit.h>

@interface BFAppDelegate : UIResponder <UIApplicationDelegate>

@property (strong, nonatomic) UIWindow *window;

@end
55 changes: 55 additions & 0 deletions feed/BFAppDelegate.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
//
// BFAppDelegate.m
// feed
//
// Created by Blake Byrnes on 5/19/14.
// Copyright (c) 2014 bluefletch. All rights reserved.
//

#import "BFAppDelegate.h"
#import <RestKit/RestKit.h>
#import "BButton.h"

@implementation BFAppDelegate

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
RKLogConfigureByName("RestKit/Network*", RKLogLevelTrace);
RKLogConfigureByName("RestKit/ObjectMapping", RKLogLevelTrace);

//let AFNetworking manage the activity indicator
[AFNetworkActivityIndicatorManager sharedManager].enabled = YES;


[[BButton appearance]setStyle:BButtonStyleBootstrapV3];
return YES;
}

- (void)applicationWillResignActive:(UIApplication *)application
{
// Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
// Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
}

- (void)applicationDidEnterBackground:(UIApplication *)application
{
// Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
}

- (void)applicationWillEnterForeground:(UIApplication *)application
{
// Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
}

- (void)applicationDidBecomeActive:(UIApplication *)application
{
// Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
}

- (void)applicationWillTerminate:(UIApplication *)application
{
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
}

@end
15 changes: 15 additions & 0 deletions feed/BFFeedTableViewCell.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
//
// BFFeedCellTableViewCell.h
// feed
//
// Created by Blake Byrnes on 5/20/14.
// Copyright (c) 2014 bluefletch. All rights reserved.
//

#import <UIKit/UIKit.h>

@interface BFFeedTableViewCell : UITableViewCell
@property (weak, nonatomic) IBOutlet UIImageView *profileImage;
@property (weak, nonatomic) IBOutlet UITextView *feedText;

@end
34 changes: 34 additions & 0 deletions feed/BFFeedTableViewCell.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
//
// BFFeedCellTableViewCell.m
// feed
//
// Created by Blake Byrnes on 5/20/14.
// Copyright (c) 2014 bluefletch. All rights reserved.
//

#import "BFFeedTableViewCell.h"

@implementation BFFeedTableViewCell

- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
if (self) {
// Initialization code
}
return self;
}

- (void)awakeFromNib
{
// Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated
{
[super setSelected:selected animated:animated];

// Configure the view for the selected state
}

@end
14 changes: 14 additions & 0 deletions feed/BFFeedTableViewController.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
//
// BFFeedTableViewController.h
// feed
//
// Created by Blake Byrnes on 5/20/14.
// Copyright (c) 2014 bluefletch. All rights reserved.
//

#import <UIKit/UIKit.h>

@interface BFFeedTableViewController : UITableViewController

@property (strong) NSArray *feed;
@end
154 changes: 154 additions & 0 deletions feed/BFFeedTableViewController.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,154 @@
//
// BFFeedTableViewController.m
// feed
//
// Created by Blake Byrnes on 5/20/14.
// Copyright (c) 2014 bluefletch. All rights reserved.
//

#import "BFFeedTableViewController.h"
#import "BFFeedTableViewCell.h"
#import "BFPost.h"
#import <AFNetworking/AFNetworking.h>
#import "BFObjectManager.h"

@interface BFFeedTableViewController ()
@property (readwrite, nonatomic) BFFeedTableViewCell *metricsCell;

@end

@implementation BFFeedTableViewController

- (id)initWithStyle:(UITableViewStyle)style
{
self = [super initWithStyle:style];
if (self) {
// Custom initialization
}
return self;
}

- (void)viewDidLoad
{
[super viewDidLoad];

self.title = @"BF Feed";
self.navigationController.navigationBarHidden = false;
self.navigationItem.hidesBackButton = true;
}

- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}

#pragma mark - Table view data source

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
// Return the number of sections.
return 1;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
// Return the number of rows in the section.
return self.feed.count;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
BFFeedTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"feedCell" forIndexPath:indexPath];

[self configureCell:cell atIndexPath:indexPath];
return cell;
}
- (void)configureCell:(BFFeedTableViewCell *)cell atIndexPath:(NSIndexPath *)indexPath
{
//protection against overflow
BFPost *post = self.feed[indexPath.row];
cell.feedText.text = post.postText;
[cell.profileImage setImageWithURL:[NSURL URLWithString:post.postUser.imageUrl relativeToURL:[NSURL URLWithString:BFObjectManager.baseURL]]];
}

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath;
{
if (!self.metricsCell) {
self.metricsCell = [self.tableView dequeueReusableCellWithIdentifier:@"feedCell"];
}
// We need to adjust the metrics cell's frame to handle table width changes (e.g. rotations).
CGRect theFrame = self.metricsCell.frame;
theFrame.size.width = self.tableView.bounds.size.width;
self.metricsCell.frame = theFrame;

// Set up the metrics cell using real populated content.
[self configureCell:self.metricsCell atIndexPath:indexPath];

// Force a layout.
//Layout and Autolayout update UIView
[ self.metricsCell setNeedsUpdateConstraints];
[ self.metricsCell updateConstraintsIfNeeded];
[ self.metricsCell.contentView setNeedsLayout];
[ self.metricsCell.contentView layoutIfNeeded];

// Get the layout size - we ignore the width - in the fact the width _could_ conceivably be zero.
// Note: Using content view is intentional.
CGSize theSize = [self.metricsCell.contentView systemLayoutSizeFittingSize:UILayoutFittingCompressedSize];

return (theSize.height + 1);
}
- (CGFloat)tableView:(UITableView *)tableView estimatedHeightForRowAtIndexPath:(NSIndexPath *)indexPath
{
return UITableViewAutomaticDimension;
}
/*
// 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:@[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 - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
// Get the new view controller using [segue destinationViewController].
// Pass the selected object to the new view controller.
}
*/

@end
14 changes: 14 additions & 0 deletions feed/BFLoginViewController.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
//
// BFLoginController.h
// feed
//
// Created by Blake Byrnes on 5/20/14.
// Copyright (c) 2014 bluefletch. All rights reserved.
//

#import <UIKit/UIKit.h>

@interface BFLoginViewController : UIViewController<UITextFieldDelegate>
- (IBAction)loginClicked;

@end
Loading

0 comments on commit 41db92c

Please sign in to comment.