import SwiftUI /// 컨텐츠 크기 만큼 아래로 배치 되는 레이아웃 iOS 16+ struct FlowLayout: Layout { var spacing: CGFloat? = nil struct Cache { var sizes: [CGSize] = [] var spacing: [CGFloat] = [] } func makeCache(subviews: Subviews) -> Cache { let sizes = subviews.map { $0.sizeThatFits(.unspecified) } let spacing: [CGFloat] = subviews.indices.map { index in guard index != subviews.count - 1 else { return 0 } return..
탭뷰의 아이템 터치 시 탭 전환 말고 Navigation 이동 /// iOS 16 이상 버전 struct ContentView: View { @State private var isDetailViewPresented = false @State private var selectedTabIndex = 0 var body: some View { NavigationStack { TabView(selection: $selectedTabIndex) { Text("Tab 0 Content") .tabItem { Image(systemName: "0.circle.fill") Text("Tab 0") } .tag(0) Text("Tab 1 Content") .tabItem { Image(systemName: "1.circ..