일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 |
- codility
- 끄니
- 반려동물
- 태그를 입력해 주세요.
- ios
- 아기고양이
- CountDiv
- 고양이
- objective-c
- paper craft
- 끈끈이주걱
- 고양이 산책
- 애완동물
- 명랑이
- UIAlertView addSubView
- 식충식물
- 스파르탄
- paper-replika
- 블루베리
- creative park
- PassingCars
- 실생묘
- 산책묘
- 세팔
- Blueberry
- UIAlertView setFrame
- cephalotus
- 세팔로투스
- 종이모형
- Wall-E
- Today
- Total
목록전체 글 (46)
꼼시월드
/// max binary gap 구하기 func maxBinaryGap(_ input: Int) -> Int { let binaryString = String(input, radix: 2) print("[input] \(binaryString)") var maxGap: Int = 0 var gapCounter: Int = 0 binaryString.forEach { if $0 == "1" { if gapCounter != 0 { maxGap = max(maxGap, gapCounter) } gapCounter = 0 } else { gapCounter += 1 } } print ("[result] \(maxGap)") return maxGap } maxBinaryGap(2) maxBinaryGap(52..
int solution(int A, int B, int K) { double a = A; double b = B; int ret = floor(b/K) - floor((a - 1)/K); // b의 몫 - a보다 작은수의 몫 return ret; } int / int 는 소수점을 버리는 점을 주의해야 한다
https://codility.com/c/intro/demoQQDY3P-6DY int solution(NSMutableArray *A) { // write your code in Objective-C 2.0 int east = 0, west = 0; for (NSNumber *num in A) { int dir = [num intValue]; (dir) ? west++ : east++; } int wc = 0; int ec = 0; int ret = 0; for (int i = 0 ; i 1000000000) re..
alertview의 프레임 사이즈를 조절하기 위해서 아래의 코드를 사용해봤는데 프레임 사이즈가 전혀 조절이 되지 않았다. UIAlertView *myAlertView = [[UIAlertView alloc]initWithFrame:CGRectMake(x, y, width, height)]; ios7에서는 키를 이용하여 alertview에 "accessoryView"를 키로 하고 값에 UIView 속성의 뷰를 넣어주면 alertview의 프레임 사이즈가 늘어나는데, 내부의 title, messeage, accessoryView의 레이어들을 이용하여 alertview의 사이즈를 조절하는것같다. //alertview에 넣을 뷰 UIImageView *imageView = [[UIImageView alloc]i..
소스코드 NSArray *arr = @[ @{@"name": @"kim", @"profile": @{@"type": @1} }, @{@"name": @"jung", @"profile": @{@"type": @1} }, @{@"name": @"park", @"profile": @{@"type": @2} }, @{@"name": @"hong", @"profile": @{@"type": @2} }, ]; //ascending:YES 오름차순 :NO 내림차순 NSSortDescriptor *typeDescriptor = [NSSortDescriptor sortDescriptorWithKey:@"profile.type" ascending:NO]; NSArray *sortedArray = [arr sortedArr..
출처 : http://stackoverflow.com/questions/5559652/how-do-i-detect-the-orientation-of-the-device-on-ios if UIViewController: if (UIDeviceOrientationIsLandscape(self.interfaceOrientation)) { // } if UIView: if (UIDeviceOrientationIsLandscape([UIApplication sharedApplication].statusBarOrientation)) { // } UIDevice.h: #define UIDeviceOrientationIsPortrait(orientation) ((orientation) == UIDeviceOrienta..
카카오톡, 마이피플, 라인 앱 설치여부 확인하기-(void)canOpenInviteAppURL{ NSString *kakaotalk = [NSString stringWithFormat:@"%@",@"kakaolink://"]; NSString *mypeople = [NSString stringWithFormat:@"%@",@"myp://"]; NSString *line = [NSString stringWithFormat:@"%@",@"line://"]; BOOL isInstalledKakaoTalk = [[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:kakaotalk]]; BOOL isInstalledMyPeople = [[UIApp..
ios에서 라인 앱이 설치되었는지 확인하려면 아래 메소드를 이용하면 된다. -(BOOL)canOpenLine{ NSString *lineURL = @"line://"; return [[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:lineURL]]; } 설치유무에 따라서 BOOL 값을 리턴한다. 아래와 같이 사용하면 내가 만든 앱에서 라인앱을 실행하여 원하는 메시지나 이미지를 보낼 수 있다. -(IBAction)lineInvite:(id)sender{ if(![self canOpenLine]){ return; } NSString *textString = @"라인 친구에세 보낼 메시지"; NSString *LINEUrlString = [..