IOS 3

Refreshable: 당겨서 새로고침 적용하기

UIKit에서의 UIRefreshControl이 있다면 SwiftUI에서는 refreshable 수정자를 통해 쉽게 처리할 수 있습니다.  사용법 refreshable 적용:refreshable 모디파이어는 List나 ScrollView와 같은 스크롤 가능한 뷰에 적용할 수 있습니다. 사용자가 뷰를 아래로 당길 때 실행할 비동기 작업을 정의합니다.import SwiftUIstruct ContentView: View { @State private var items = ["Item 1", "Item 2", "Item 3"] var body: some View { List(items, id: \.self) { item in Text(item) } ..

카테고리 없음 2025.02.05

UIRefreshControl: UITableView와 UICollectionView에서 아래로 당겨 새로고침 하기

사용법1. UIRefreshControl 초기화 및 설정:let refreshControl = UIRefreshControl()refreshControl.addTarget(self, action: #selector(handleRefresh), for: .valueChanged) 2. 테이블 뷰 또는 컬렉션 뷰에 추가:UITableView의 경우:tableView.refreshControl = refreshControlUICollectionView의 경우:collectionView.refreshControl = refreshControl 새로고침 동작 처리 메서드 구현 예시@objc private func pullToRefresh() { self.collectionView.reloadData() Dis..

카테고리 없음 2025.02.04

iPhone 화면 크기 정리: iPhone 12 부터 iPhone 16 시리즈까지

iPhone의 다양한 모델에 대한 크기 정보를 제공하는 Use Your Loaf 사이트에서 각 기종별로 자세한 내용을 확인하실 수 있습니다. 아래에 각 모델별 링크를 정리해 드립니다.iPhone 12 시리즈 크기 정보iPhone 12 Mini: 5.4인치 (2340 x 1080 픽셀)iPhone 12 / 12 Pro: 6.1인치 (2532 x 1170 픽셀)iPhone 12 Pro Max: 6.7인치 (2778 x 1284 픽셀)상세한 크기 정보는 iPhone 12 Screen Sizes에서 확인하실 수 있습니다.iPhone 13 시리즈 크기 정보iPhone 13 Mini: 5.4인치 (2340 x 1080 픽셀)iPhone 13 / 13 Pro: 6.1인치 (2532 x 1170 픽셀)iPhone 13..

카테고리 없음 2025.01.20