Do not use interface builder for production code; instead, override -loadView. Use autolayout when possible.
/*!
* Method comment.
#pragma mark - UITableViewDelegate delegate | |
- (void)scrollViewDidScroll:(UIScrollView *)scrollView { | |
if (scrollView.contentOffset.y < -160.0f){ | |
dispatch_once(&pullToDismissLock, ^{ | |
CGRect destFrame = self.notificationsTableView.frame; | |
destFrame.origin.y = destFrame.size.height; | |
[UIView animateWithDuration:0.4f delay:0.0f options:UIViewAnimationOptionCurveEaseOut animations:^{ |
NSMutableDictionary* pulsePatternsDict = [@{} mutableCopy]; | |
NSMutableArray* pulsePatternsArray = [@[] mutableCopy]; | |
// beat for 100 times | |
for (NSInteger i=0; i<100; i++){ | |
[pulsePatternsArray addObject:@(YES)]; // vibrate for 100ms | |
[pulsePatternsArray addObject:@(100)]; | |
[pulsePatternsArray addObject:@(NO)]; //stop for 1200ms * 0.3 | |
[pulsePatternsArray addObject:@(1200*0.3)]; |
#import "PSHCoverFeedViewController.h" | |
#import "PSHFacebookDataService.h" | |
#import "PSHCoverFeedPageViewController.h" | |
#import "PSHMenuViewController.h" | |
#import "PSHMessagingViewController.h" | |
#import "FeedItem.h" | |
#import "ItemSource.h" | |
@interface PSHCoverFeedViewController ()<UIPageViewControllerDataSource, PSHMenuViewControllerDelegate, PSHCoverFeedPageViewControllerDelegate, PSHMessagingViewControllerDelegate> |
#import "FeedItem.h" | |
#import "ItemSource.h" | |
#import "PSHCoverFeedPageViewController.h" | |
#import "PSHCoverFeedViewController.h" | |
#import "PSHFacebookDataService.h" | |
#import "PSHMenuViewController.h" | |
#import "PSHMessagingViewController.h" | |
@interface PSHCoverFeedViewController () < | |
UIPageViewControllerDataSource, |
- (void)viewDidLoad | |
{ | |
[super viewDidLoad]; | |
CGRect screenBounds = [[UIScreen mainScreen] bounds]; | |
self.view.frame = screenBounds; | |
self.navigationController.navigationBarHidden = YES; | |
self.navigationItem.hidesBackButton = YES; | |
self.dateFormatter = [[NSDateFormatter alloc] init]; | |
[self.dateFormatter setDateFormat:@"MMMM d"]; |
- (void)viewDidLoad | |
{ | |
[super viewDidLoad]; | |
// animate menus | |
[self animateMenuOnStart]; | |
[self.menuViewController animateHideMenuButtons]; | |
} | |
- (void)didReceiveMemoryWarning |
- (void)setupViewFrameBounds | |
{ | |
CGRect screenBounds = [[UIScreen mainScreen] bounds]; | |
self.view.frame = screenBounds; | |
} | |
- (void)setupNavigationBar | |
{ | |
self.navigationController.navigationBarHidden = YES; | |
self.navigationItem.hidesBackButton = YES; |
- (NSDateFormatter*)dateFormatter | |
{ | |
if (!_dateFormatter) { | |
_dateFormatter = [[NSDateFormatter alloc] init]; | |
[_dateFormatter setDateFormat:@"MMMM d"]; | |
} | |
return _dateFormatter; | |
} |
// | |
// PSHCoverFeedViewController.m | |
// SocialHome | |
// | |
// Created by Kenny Tang on 4/14/13. | |
// Copyright (c) 2013 corgitoergosum.net. All rights reserved. | |
// | |
#import "PSHCoverFeedViewController.h" | |
#import "PSHFacebookDataService.h" |