일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 | 31 |
- Firebase
- Archive
- IOS
- Realm
- UIButton
- 웹뷰
- FLUTTER
- darkmode
- Apple
- error
- Code
- JPA
- rxswift
- view
- 한글
- mac
- Git
- Swift
- appstore
- window
- stack
- Session
- MacOS
- github
- Python
- SwiftUI
- Notification
- iOS16
- 개발자
- Xcode
- Today
- Total
목록iOS, Swift/Tip, Bug, Swift Error (32)
EEYatHo 앱 깎는 이야기
NavigationBar에 버튼을 넣기위해서, UIBarButtonItem 같은 버튼을 사용할 때, tintColor가 활성화되어 이미지 색이 자동으로 바뀌곤 한다. 해당 색은 NavigationBar.tintColor 혹은 UIBarButtonItem.tintColor를 조절하여 컨트롤 할 수 있다. 하지만 텍스트나 이미지에 tintColor를 적용하고 싶지 않을 때 도 있다. 그럴 때는, 텍스트에 attribute를 입히거나, let button = UIBarButtonItem(title: "테스트텍스트", style: .done, target: self, action: #selector(testFunc)) button.setTitleTextAttributes([.foregroundColor : UI..
과거 런치스크린을 스토리보드로 하나의 뷰를 띄워주는 형태가 아닌, static image 여러개로 때우던 방식이 있었다. 그러나 이런 방식은, 다양한 스크린 크기에 대응하려면 크기마다 이미지가 있어야 하기 때문에, 번거롭고 어렵워서 Deprecated 되었다. 이런 방식이 적용된 레거시 프로젝트에서, 쓰지도 않는다고 저 LaunchImage를 삭제해버리면, 빌드시 오류가 발생한다. build setting에서 asset을 검색하고, Asset Catelog Launch Image Set Name 항목을 함께 삭제해주면 된다.
swipe back 을 끄고, 키는 것은 interactivePopGestureRecognizer로 한다. navigationController?.interactivePopGestureRecognizer?.isEnabled = true // false 하지만, back을 성공했는지 실패했는지 감지할 때는 한계가 있다. @available(iOS 7.0, *) open var interactivePopGestureRecognizer: UIGestureRecognizer? { get } interactivePopGestureRecognizer는 그저 UIGestureRecognizer이기에, 얘를 아무리 들들 볶아도 화면 전환을 성공했는지 실패했는지는 알 수 없다. * 안되는 방법1 ) target을 이용한..
ld: file too small (length=0) file '파일경로' 갑자기 시뻘건 에러가 떴다. 검색했더니 클린 빌드하란다. 했더니 해결되었다. 흠.... 이유는 모르겠다.ㅇㅁㄴㄹ 경로로 나온 파일은 전혀 건들지도 않았는데 갑자기 왜지..? ( macOS 업데이트를 해서? xcode 업데이트를 해서? fetch받은게 이상하게 꼬여서? 흠.. 😟 )
네트워크 통신을 위한 Codable 구조체 만들 때, API 스키마 보면서 타이핑 했는데, 한방에 해주는 툴이 있었다. 새삼스럽지만, 경력 많은 분들한테 뭐 배우는 거 진짜 너무 효율적인듯.. 홈페이지. https://quicktype.io/ Convert JSON to Swift, C#, TypeScript, Objective-C, Go, Java, C++ and more • quicktype { "people": [ { "name": "Atticus", "high score": 100 }, { "name": "Cleo", "high score": 900 }, { "name": "Orly" }, { "name": "Jasper" } ] } Provide sample JSON files, URLs, JS..
잘 되던 구글 로그인이 갑자기 안된다.. 에러 내용을 보니 "Code: -15.", "ID Token expired." 무슨 갑자기 왠 토큰..??? 구글 로그인 서비스 연동한거에 유효기간같은게 있나..? 삽질 삽질 하다가 컴퓨터 시간이 안맞아서.. 토큰 유효기간 계산에 오류뜨는 거였다 예전에 일찍 생활하는 습관 들이려고 컴퓨터 시간을 10분 빠르게 했더니 생긴 이슈 날짜 및 시간 설정에서, "자동으로 날짜 및 시간 설정" 체크해주면 해결
UISearchBar 선언부 lazy var searchBar: UISearchBar = { let searchbar = UISearchBar() let placeholderText = "검색어를 입력해 주세요." searchbar.placeholder = placeholderText if let textField = searchbar.value(forKey: "searchField") as? UITextField { textField.backgroundColor = .white if let font = UIFont(name: Resource.Font.NanumSquareRoundR.rawValue, size: 16) { let placeholderAttributedText = NSAttributedSt..
일반적으로 shadow랑 corner radius를 같이하면 적용이 안되는데, Cell은 비교적 쉽게 구현할 수 있다. Cell 안에서 Layout할 때, func setupLayout() { layer.shadowColor = UIColor.black.cgColor layer.shadowOpacity = 0.5 layer.shadowRadius = 10 contentView.layer.cornerRadius = 10 contentView.layer.masksToBounds = true } 이렇게, Cell 에 shadow를 넣고, Cell의 contentView에 corner radius를 넣으면 된다.