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) wiggleEffect | |
{ | |
CGFloat angle = 5.0 * M_PI / 180; | |
CGAffineTransform leftWiggle = CGAffineTransformRotate(CGAffineTransformIdentity, -angle); | |
CGAffineTransform rightWiggle = CGAffineTransformRotate(CGAffineTransformIdentity, angle); | |
self.image.transform = leftWiggle; | |
[UIView beginAnimations:@"wiggle" context:(__bridge void *)(self.image)]; |
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
- (UIImage*)imageWithImage:(UIImage*)image | |
scaledToSize:(CGSize)newSize | |
cropImage:(BOOL)crop { | |
// Create a graphics image context | |
CGFloat wFactor = newSize.width / image.size.width; | |
CGFloat hFactor = newSize.height / image.size.height; | |
CGFloat maxFactor = MAX(wFactor, hFactor); | |
if (crop) { | |
UIGraphicsBeginImageContext(newSize); |
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
// | |
// FGScrollLayer.h | |
// Fall G | |
// | |
// Created by Dai Xuefeng on 23/9/12. | |
// Copyright 2012 Nofootbird. All rights reserved. | |
// | |
#import <Foundation/Foundation.h> | |
#import "cocos2d.h" |
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
- (NSString *)constructHashTagForAppCopy:(NSString *)appCopy | |
{ | |
NSRange hashRange = [appCopy rangeOfString:@"#hashtag#" options:NSCaseInsensitiveSearch]; | |
if(hashRange.location != NSNotFound) | |
{ | |
NSString *hashCopy = [self.channel objectForKey:@"hashtag"]; | |
if(!hashCopy) | |
{ | |
hashCopy = @""; | |
} |
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)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. | |
*/ | |
// FBSample logic | |
// We need to properly handle activation of the application with regards to SSO | |
// (e.g., returning from iOS 6.0 authorization dialog or from fast app switching). | |
[FBSession.activeSession handleDidBecomeActive]; | |
} |
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
//BOUNCE ANIMATION | |
-(void)beginBounceAnimation { | |
self.view.transform = CGAffineTransformScale(CGAffineTransformIdentity, 0.001, 0.001); | |
self.view.alpha = 1.0; | |
[UIView beginAnimations:nil context:nil]; | |
[UIView setAnimationDuration:0.25]; | |
[UIView setAnimationDelegate:self]; | |
[UIView setAnimationDidStopSelector:@selector(bounce1AnimationStopped)]; | |
self.view.transform = CGAffineTransformScale(CGAffineTransformIdentity, 1.1, 1.1); | |
[UIView commitAnimations]; |
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)showWithLabelMixed:(id)sender { | |
HUD = [[MBProgressHUD alloc] initWithView:self.navigationController.view]; | |
[self.navigationController.view addSubview:HUD]; | |
HUD.delegate = self; | |
HUD.labelText = @"Connecting"; | |
HUD.minSize = CGSizeMake(135.f, 135.f); | |
[HUD showWhileExecuting:@selector(myMixedTask) onTarget:self withObject:nil animated:YES]; |
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)showWithLabelDeterminate:(id)sender { | |
HUD = [[MBProgressHUD alloc] initWithView:self.navigationController.view]; | |
[self.navigationController.view addSubview:HUD]; | |
// Set determinate mode | |
HUD.mode = MBProgressHUDModeDeterminate; | |
HUD.delegate = self; | |
HUD.labelText = @"Loading"; |