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
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ | |
if (!self.imageURLString){ | |
self.imageURLString = self.sourceAvartarImageURL; | |
self.backgroundImageView.contentMode = UIViewContentModeScaleAspectFill; | |
} | |
UIImage * feedImage = [UIImage imageWithData:[NSData dataWithContentsOfURL:[NSURL URLWithString:self.imageURLString]]]; | |
dispatch_async(dispatch_get_main_queue(), ^{ | |
self.backgroundImageView.alpha = 0.0f; |
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
-(IBAction)commentButtonTapped:(id)sender { | |
if (self.commentsPostingView.hidden == YES){ | |
if (self.commentsViewController != nil){ | |
self.commentsViewController = nil; | |
[self.commentsViewController.view removeFromSuperview]; | |
[self.commentsViewController removeFromParentViewController]; | |
} | |
self.commentsViewController = [[PSHCommentsViewController alloc] init]; |
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
- (void) likeFeed { | |
UIImageView * animatedLikeImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"coverfeed-like_button"]]; | |
animatedLikeImageView.frame = CGRectMake(80.0f, 210.0f, 160.0f, 160.0f); | |
animatedLikeImageView.contentMode = UIViewContentModeScaleToFill; | |
self.animatedLikeImageView = animatedLikeImageView; | |
self.animatedLikeImageView.hidden = YES; | |
[self.view addSubview:self.animatedLikeImageView]; | |
double delayInSeconds = .3; |
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
// 1. set up the intial view with the first Feed Item | |
- (void) initFeedsPageViewController { | |
... | |
FeedItem * firstFeedItem = self.feedItemsArray[0]; | |
PSHCoverFeedPageViewController * currentPagePageViewController = [[PSHCoverFeedPageViewController alloc] init]; | |
currentPagePageViewController.feedType = firstFeedItem.type; | |
currentPagePageViewController.messageLabelString = firstFeedItem.message; |
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
2013-05-01 10:06:06.036 Home[87441:1c03] granted: 1 | |
2013-05-01 10:06:06.040 Home[87441:1303] accounts: ( | |
"type:com.apple.facebook\nidentifier: F5D9D131-7A36-4FFD-A187-A09B07DDF86F\naccountDescription: Facebook\nusername: [email protected]\nobjectID: x-coredata://92135DD2-592B-4F75-87FF-9965AE7E3B13/Account/p2\nenabledDataclasses: {(\n \"com.apple.Dataclass.Contacts\",\n \"com.apple.Dataclass.Calendars\"\n)}\nenableAndSyncableDataclasses: {(\n)}\nproperties: {\n fullname = \"Kenny Tang\";\n uid = 572733568;\n}\nparentAccount: (null)\nowningBundleID:(null)" | |
) |
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
/* | |
// expanded | |
self.expandedMenuButtonFrame = CGRectMake(120.0f, 458.0f, 90.0f, 90.0f); | |
self.expandedMessengerButtonFrame = CGRectMake(10.0f, 429.0f, 72.0f, 110.0f); | |
self.expandedLauncherButtonFrame = CGRectMake(124.0f, 306.0f, 72.0f, 110.0f); | |
self.expandedNotificationsButtonFrame = CGRectMake(240.0f, 429.0f, 72.0f, 110.0f); | |
// collapsed | |
self.collapsedButtonsFrame = CGRectMake(124.0f, 430.0f, 72.0f, 110.0f); | |
*/ |
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
- (void) animateExpandMenuButtons { | |
self.launcherButtonView.hidden = NO; | |
self.notificationsButtonView.hidden = NO; | |
self.messengerButtonView.hidden = NO; | |
self.launcherButtonLabel.hidden = NO; | |
self.notificationsButtonLabel.hidden = NO; | |
self.messengerButtonLabel.hidden = NO; | |
[UIView animateWithDuration:0.2f delay:0.0f options:UIViewAnimationOptionCurveEaseInOut animations:^{ |
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
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { | |
UITouch * touch = [touches anyObject]; | |
CGPoint touchPoint = [touch locationInView:self.view]; | |
UIView * menuView = [self.view viewWithTag:kPSHMenuViewControllerMenuButtonViewTag]; | |
if (CGRectContainsPoint(menuView.frame, touchPoint)){ | |
[self setState:UIGestureRecognizerStateBegan]; | |
self.menuViewBeingMoved = menuView; | |
}else{ |
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
- (void) menuGestureRecognizerAction:(PSHMenuGestureRecognizer*)recognizer { | |
if (recognizer.state == UIGestureRecognizerStateBegan){ | |
// began moving | |
} else if (recognizer.state == UIGestureRecognizerStateChanged){ | |
CGRect launcherButtonImageViewFrame = [self.view convertRect:self.launcherButtonImageView.frame fromView:self.launcherButtonImageView.superview]; | |
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
- (void) fetchNotifications:(FetchNotificationsSuccess)fetchNotificationsSuccess { | |
InitAccountSuccessBlock successBlock = ^{ | |
NSURL *url = [NSURL URLWithString:@"https://graph.facebook.com/me/notifications"]; | |
SLRequest * request = [SLRequest requestForServiceType:SLServiceTypeFacebook requestMethod:SLRequestMethodGET URL:url parameters:@{@"include_read":@"true"}]; | |
DDLogVerbose(@"request.URL: %@", request.URL); | |
request.account = self.facebookAccount; | |