일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- M3
- sudo docker
- service key is not registered error
- Alamofire
- SwiftUI
- codingkey
- ubuntu-desktop
- Docker Engine
- AppTransportSecurity
- aws database
- 성능효율성
- 6pillar
- ssh-remote
- perfomance efficiency
- M2
- swiftm
- swiftui keyboard dismiss
- well architected
- Alamofire.AFError.session Task Failed(error: Error Domain=NSURLErrorDomain Code=-1022
- ubuntu
- M1
- swiftui keyboard
- Apple Silicon
- Swift
- api service key error
- m4
- Linux
- Arm
- NSURLErrorDomain Code=-1022
- 가상머신
- Today
- Total
목록iOS/SwiftUI (3)
behan의 개인적인 기술 블로그
#if canImport(UIKit) extension View { func hideKeyboard() { UIApplication.shared.sendAction(#selector(UIResponder.resignFirstResponder), to: nil, from: nil, for: nil) } } #endif 생성 후 Button { locationSearchViewModel.fetchLocationSubject.send(location) hideKeyboard() } label: { Text("Search") } 버튼 action에 추가하면 keyboard 숨기기 가능
api를 호출하여 그 정보를 List로 그릴 때, 스크롤을 내리다 마지막 줄에 닿았을 때 자동으로 다음 api 정보를 받아와 리스트 밑에 이어서 그려줄 때 사용할 만한 방법 struct Item: Codable, Identifiable { var id = UUID() var name: String var party: String var age: String } extension Item: Equatable { static func == (lhs: Self, rhs: Self) -> Bool { return lhs.id == rhs.id } } 위의 구조체로 된 Array를 List로 불러올 때 Equatable 프로토콜을 추가해 lhs.id 와 rhs.id 같아질 때 리턴하도록 한다. List( [Ite..

NavigationLink를 사용하면 destination에 지정된 뷰가 미리 생성된다. 미리생성되는 것을 막기 위해서 LazyView라는 struct를 만들어 감싸 사용한다. View를 parameter로 받기 위해서는 Generic형태로 만들어야 한다. [LazyView] struct LazyView: View { let build: () -> Content init(_ build: @autoclosure @escaping () -> Content) { self.build = build } var body: Content { build() } } 사용할 때는 LazyView(SampleView()) 이런 방식으로 기존 뷰를 LazyView로 감싸서 사용한다. 이렇게하면 미리 destinationVie..