개발

개발/아이오에스

objective-c ] UIView CAGradientLayer gradient - 적용하기

CAGradientLayer *gradient = [CAGradientLayer layer]; [gradient setStartPoint:CGPointMake(0.0, 0.0)]; [gradient setEndPoint: CGPointMake(1.0, 1.0)]; UIColor *color1 = [UIColor colorWithRed:5.0f/255.0f green:135.0f/255.0f blue:234.0f/255.0f alpha:1.0f]; UIColor *color2 = [UIColor colorWithRed:0.0f/255.0f green:179.0f/255.0f blue:230.0f/255.0f alpha:1.0f]; gradient.colors = @[(id)color1.CGColor, (i..

개발/아이오에스

objective-c ] UIButton border width, color 설정, 테두리 설정하기

- (void)viewWillLayoutSubviews{ [super viewWillLayoutSubviews]; self.btn_reset.layer.borderWidth = 1; self.btn_reset.layer.borderColor = [UIColor whiteColor].CGColor; self.btn_reset.layer.cornerRadius = 15.0; }

개발/아이오에스

objective - c ] 배열에서 POP() 비슷하게 동작하기

[selections addObject:[[self class] selectionStringForType:self.gameType word:selectionWords.firstObject]]; [selectionWords removeObjectAtIndex:0]; selectionWords이라는 배열에서 selectionWords.firstObject - firstObject를 뽑아내서 사용을하고, [selectionWords removeObjectAtIndex:0]; removeObjectAtIndex를 사용해서 사용한 첫번째 오브젝트를 삭제해준다. 배열에 맨 앞에를 삭제해주면서 에러가 뜰 것 같았지만 자동으로 처리를 해주는 모습을 볼 수 있었다.

개발/아이오에스

ios] leadingAnchor(trailingAnchor)와 leftAnchor(rightAnchor) 차이

UI를 코드로 작성을 하면서 leadingAnchor와 leftAnchor의 차이가 궁금해서 검색을 해봤다. 결론은 앱을 사용하는 지역에 관련된 것이다. 우리나라나 영어권의 나라들은 글을 왼쪽(left)에서 오른쪽(right)로 읽는 것이 자연스럽다. 반대로 오른쪽에서 왼쪽으로 진행 방향인 나라가 있다. 만약 leftAnchor,rightAnchor를 사용해서 뷰를 그린다면 이러한 지역에서는 반대로 보일 수 있다. 그래서 절대적으로 왼쪽과 오른쪽을 표시하는게 아니라면 leadingAnchor, trailingAnchor을 사용하는게 좋다고 한다. WWDC 2015에서 특정 요구사항(왼쪽 오른쪽 고정적으로 설정)이 없다면 leadingAnchor, trailingAnchor을 사용해야 한다고...

개발/아이오에스

ios] 에러해결 - command phasescriptexecution failed with a nonzero exit code

pod 라이브러리를 재설치 해보고 클린빌드도 해보았지만 동일했다. 해당 앱의 타겟에서 Run Script를 삭제하니 문제가 해결되었다. - 스크립트는 입력 및 출력 파일이 제공되지 않을 때 항상 실행되기 때문에 - pod을 사용하는 경우 추가 실행되는 스크립트는 필요하지 않 -음 https://stackoverflow.com/questions/53289524/xcode-10-2-1-command-phasescriptexecution-failed-with-a-nonzero-exit-code

개발/아이오에스

swift]앱에서 디바이스 환경설정 - 해당 앱 알림 설정 창 화면에 띄우는 방법

UNUserNotificationCenter.current().getNotificationSettings { (settings) in guard settings.authorizationStatus == .authorized else{ let alert = UIAlertController(title: "알림", message: "기기 내 [설정]>[앱 이름]>[알림]에서\n알림을 허용해주세요.", preferredStyle: .alert) alert.addAction(UIAlertAction(title: "취소", style: .cancel, handler: nil)) alert.addAction(UIAlertAction(title: "확인", style: .default, handler: { _ in D..

dev.jake
'개발' 카테고리의 글 목록 (4 Page)