This file contains hidden or 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
// ↓ここで紹介されていたSwiftのコードをObjective-Cに置き換えたものです。 | |
// | |
// Autolayoutでキーボードの高さによってViewを調整する方法 | |
// http://blog.tsumikiinc.com/article/20150123_autolayout-view.html | |
// | |
// StoryboardでUITextViewのBottomのVertical Space ConstraintとbottomLayoutConstraintを接続する必要があります。 | |
// 詳細は元のBlog記事を参照ください。 | |
@property (nonatomic, weak) IBOutlet NSLayoutConstraint *bottomLayoutConstraint; |
This file contains hidden or 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)navigationController:(UINavigationController *)navigationController willShowViewController:(UIViewController *)viewController animated:(BOOL)animated | |
{ | |
[[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent]; | |
} |
This file contains hidden or 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
#import <Foundation/Foundation.h> | |
@interface MSOrderdDictionary : NSObject <NSCoding> | |
{ | |
NSMutableDictionary *dictionary; | |
NSMutableArray *array; | |
} | |
+ (id)dictionary; |
This file contains hidden or 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
#import <UIKit/UIKit.h> | |
@interface UIView (visible) | |
- (void)setVisible:(BOOL)flag; | |
- (BOOL)visible; | |
@end |
This file contains hidden or 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
CGFloat margin = 3.0; | |
CGFloat w = aView.bounds.size.width; | |
CGFloat h = aView.bounds.size.height; | |
CALayer *borderLayer = [CALayer layer]; | |
borderLayer.borderColor = [UIColor lightGrayColor].CGColor; | |
borderLayer.borderWidth = 1; | |
borderLayer.frame = CGRectMake(-margin, -margin, w + margin * 2, h + margin * 2); | |
[aView.layer addSublayer:borderLayer]; |
This file contains hidden or 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
#import <Twitter/Twitter.h> | |
#import <Social/Social.h> | |
// TWTweetComposeViewControllerの場合 (for iOS5) | |
- (IBAction)tweet:(id)sender | |
{ | |
if ([TWTweetComposeViewController canSendTweet]) { | |
// ツイート用の画面をを表示する | |
TWTweetComposeViewController* composeViewController = [[TWTweetComposeViewController alloc] init]; | |
[composeViewController setInitialText:@"Hello World!"]; |
This file contains hidden or 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
-- 2行目でタイトル、本文、ノートブックを指定してください | |
tell application "Evernote" | |
set note1 to create note title "Hello World!" with text "" notebook "TestNotebook" | |
set tag1 to tag "SmartEver" | |
assign tag1 to note1 | |
open note window with note1 | |
end tell |
This file contains hidden or 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
# カレントディレクトリ以下のファイルは644, ディレクトリは755に統一 | |
# (パーミッションを削る方向で) | |
find . -type f -print0 | xargs -0 chmod go-wx | |
find . -type f -print0 | xargs -0 chmod u-x | |
find . -type d -print0 | xargs -0 chmod go-w |
This file contains hidden or 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
//------------------------------------------------------------------------- | |
// MSBlocks.h | |
//------------------------------------------------------------------------- | |
@interface MSBlocks : NSObject | |
+ (NSArray *)array:(NSArray *)array select:(BOOL(^)(id))block; | |
+ (id)find:(NSArray *)array match:(BOOL(^)(id))block; | |
@end | |
//------------------------------------------------------------------------- | |
// MSBlocks.m |
This file contains hidden or 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
// 現在のviewControllerを閉じてanotherViewControllerに差し替える | |
NSMutableArray *viewControllers = [NSMutableArray arrayWithArray:self.navigationController.viewControllers]; | |
[viewControllers removeLastObject]; | |
[viewControllers addObject:anotherViewController]; | |
[self.navigationController setViewControllers:viewControllers animated:YES]; |
NewerOlder