スキップしてメイン コンテンツに移動

投稿

9月, 2013の投稿を表示しています

Dispatch

Objective-C メインスレッドを止めないためにdispatch_asyncを使ってネットワーク処理をバックグラウンドで行っていた。 ネットワーク処理が完了次第メインスレッドでUIを変更するのが普通だが誤ってバックグラウンド側でUIをいじる処理を書いたら、 iPhone5 iOS6ではスクロールするたびにステータスバー...

Detect first lauch

- ( BOOL ) application :( UIApplication *) application didFinishLaunchingWithOptions :( NSDictionary *) launchOptions { if ([[ NSUserDefaults standardUserDefaults ] boolForKey :@ "HasLaunchedOnce" ]) { // app already launched } else { [[ NSUserDefaults standardUserDefaults ] setBool : YES forKey :@ "HasLaunchedOnce" ]; [[ NSUserDefaults standardUserDefaults ] synchronize ]; // This is the first launch ever } }

RNFrostedSidebar.m

// //  RNFrostedMenu.m //  RNFrostedMenu // //  Created by Ryan Nystrom on 8/13/13. //  Copyright (c) 2013 Ryan Nystrom. All rights reserved. // #define __IPHONE_OS_VERSION_SOFT_MAX_REQUIRED __IPHONE_7_0 #import "RNFrostedSidebar.h" #import <QuartzCore/QuartzCore.h> #pragma mark - Categories @implementation UIView (rn_Screenshot) - ( UIImage *)rn_screenshot {     UIGraphicsBeginImageContext ( self . bounds . size );     [ self . layer renderInContext : UIGraphicsGetCurrentContext ()];     UIImage *image = UIGraphicsGetImageFromCurrentImageContext ();     UIGraphicsEndImageContext ();     NSData *imageData = UIImageJPEGRepresentation (image, 0.75 );     image = [ UIImage imageWithData :imageData];     return image; } @end #import <Accelerate/Accelerate.h> @implementation UIImage (rn_Blur) - ( UIImage *)applyBlurW...