Skip to content

Instantly share code, notes, and snippets.

@keicoder
keicoder / snippet.m
Last active December 31, 2015 17:09
objective-c : UITextView 기본 세팅 : ViewDidLoad 메소드
- (void)viewDidLoad
{
[super viewDidLoad];
[[self.textView layer] setCornerRadius:10]; //텍스트 뷰 코너 곡선 적용
self.textView.textContainer.lineFragmentPadding = 20; //노트필드 패딩 (iOS 7)
//텍스트 뷰 인셋
//[self.textView setTextContainerInset:UIEdgeInsetsMake(20, 20, 20, 20)]; //iOS 7
@keicoder
keicoder / snippet.m
Last active December 31, 2015 17:09
objective-c : 텍스트 뷰에서 타이핑시 캐럿 보여주기
//show Caret on UITextView when typing
- (void)textDidChange:(id <UITextInput>)textInput
{
[self _showTextViewCaretPosition:textView];
}
- (void)textViewDidChangeSelection:(UITextView *)aTextView {
[self _showTextViewCaretPosition:aTextView];
}
@keicoder
keicoder / snippet.m
Last active December 31, 2015 17:29
objective-c : 키보드 나타날 때 텍스트 뷰 사이즈 조정
- (void)viewWillAppear:(BOOL)animated
{
[super viewWillAppear:animated];
//키보드 옵저버
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardDidShow:)
name:UIKeyboardDidShowNotification object:self.view.window];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWillHide:)
name:UIKeyboardWillHideNotification object:self.view.window];
@keicoder
keicoder / snippet.m
Last active December 31, 2015 17:29
objective-c : 지연시간 이후 키보드 팝업
// 딜레이 이후 키보드 팝 업
double delayInSeconds = 0.1;
dispatch_time_t popTime = dispatch_time(DISPATCH_TIME_NOW, delayInSeconds * NSEC_PER_SEC);
dispatch_after(popTime, dispatch_get_main_queue(), ^(void){
[self.noteTextView becomeFirstResponder];
});
@keicoder
keicoder / snippet.txt
Created December 18, 2013 12:27
devonthink : 검색 연산자
DevonThink Search operators
In the toolbar search field, as well as in both the interactive and the simple web interface, you can use standard and extended Boolean operators, parenthesis, and more to fine tune your search.
The syntax of the operators is compatible to DEVONagent and EasyFind, the Finder, Spotlight, common search engines as well as common programming languages such as C, C++, Objective-C, Java, and JavaScript. The complexity of the query is unlimited.
Case
All terms are case-insensitive. You may, if you wish, use capitalization for proper names in a query, but DEVONthink Pro Office will ignore case in interpreting the query.
@keicoder
keicoder / handy-regexes.txt
Created December 18, 2013 16:41 — forked from rotexdegba/handy-regexes.txt
regex : Remove spaces after last semi colon on each line, Remove spaces on blank lines
Remove spaces after last semi colon on each line of a php file.
find:
;[^\S\n]+$
relace with:
;
---------------------------------------------------------------------------------------
Remove spaces on blank lines
find:
^[^\S]+$
replace with:
@keicoder
keicoder / index.html
Created December 18, 2013 16:46 — forked from pheXion/index.html
HTML: Base Bootstrap
<!doctype html>
<html>
<head>
<meta charset="utf-8" />
<meta name="description" content="A description about your site" />
<meta name="keywords" content="keywords, separated, by, comma" />
<meta name="author" content="pheXion.com" />
<title>Untitled Document</title>
<link rel="shortcut icon" href="favicon.ico" />
@keicoder
keicoder / snippet.m
Last active December 31, 2015 19:38
objective-c : 아이클라우드 설정 여부 체크 : didFinishLaunchingWithOptions 메소드
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
NSUbiquitousKeyValueStore *kvoStore =
[NSUbiquitousKeyValueStore defaultStore];
NSString *stringValue = @"My String";
NSString *stringValueKey = @"MyStringKey";
BOOL boolValue = YES;
@keicoder
keicoder / snippet.m
Created December 20, 2013 03:29
objective-c : iOS7 텍스트 레터프레스 효과 적용
iOS7 텍스트 레터프레스 효과 적용
UIFont* font = [UIFont preferredFontForTextStyle:UIFontTextStyleHeadline];
UIColor* textColor = [UIColor colorWithHexString:@"#A3A3A3"]; //3B4E5A
NSDictionary *attrs = @{ NSForegroundColorAttributeName : textColor,
NSFontAttributeName : font,
NSTextEffectAttributeName : NSTextEffectLetterpressStyle};
NSAttributedString* attrString = [[NSAttributedString alloc] initWithString:note.title attributes:attrs];
cell.textLabel.attributedText = attrString;
@keicoder
keicoder / snippet.m
Created December 20, 2013 04:37
objective-c : UIActivityViewController 공유 메소드
.h
@interface AddViewController : UIViewController <MFMailComposeViewControllerDelegate, MFMessageComposeViewControllerDelegate, UIActionSheetDelegate>
.m
UIActivityViewController 공유 메소드
- (IBAction)share:(id)sender {