전체 글 (162) 썸네일형 리스트형 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.. swift] 앱 최초 실행 시 push 설정 1회성 처리 UserDefaults //앱 최초 실행 시 push 설정(푸쉬알림, 광고성 정보 수신동의 on) 1회성 func isFirstPush() -> (Bool) { let isBool = UserDefaults.standard.bool(forKey: UDataKey.InitPush) if !isBool { UserDefaults.standard.set(true, forKey: UDataKey.InitPush) } return isBool } swift] 업데이트시 마이그레이션을 위한 버전 체크 let savedVersion = UserDefaults.standard.value(forKey: "AppVersion") as? String ?? "0.0.0" if savedVersion.compare(version: "2.7.0") == .orderedAscending { //앞에 savedVersion가 뒤에 버전보다 작으면 여기 if문이 동작한다 } orderedAscending을 사용해서 2.7.3 < 2.7.10이 더 크다는 것을 체크할 수 있다. swift] UIView에 background에 image 파일 적용하기 let img = UIImage(named: "navi_bg") view.backgroundColor = UIColor(patternImage: img!) swift] SPM 만들기 - UIImage에 module의 image 선언하기 처음에는 이미지이터럴을 사용해서 선언해야겠다는 생각을 했지만 이미지이터럴은 해당 프로젝트의 번들에 있는 이미지를 참조하기 때문에 원하는 이미지를 불러 올 수 없었다. Package.swift에서 해당 타겟에 .target( name: "StudyPlan", dependencies:[], path: "StudyPlan/Sources", resources: [.process("Resources")] ) 으로 리소스를 선언해준다. 해당 리소스 폴더안에 Assets.xcassets을 넣어준다. listEditBtn.setImage(UIImage(named: "AlarmCal_btn_cal_delete", in: .module, compatibleWith: nil), for: .normal) 이 처럼 UIImag.. swift] UIbutton의 UIimage 색상변경하기 https://stackoverflow.com/questions/27163171/change-color-of-png-in-buttons-ios Change color of png in buttons - ios I've got a set of icons that I've created that are transparent white PNGs: And what I'd like to do is be able to tint them to other colors. Such as blue, grey, etc. I've noticed that 'clicked/ta... stackoverflow.com btn.setImage(name: "testImage", for: .normal) btn.setImageTintCol.. 이전 1 ··· 9 10 11 12 13 14 15 ··· 21 다음