swiftUI 19

Scrumdinger 개발 06 : Updating app data

이제 서비스 단 구현을 시작하는 듯 하다.회의를 추가하고, 수정할 수 있는 기능을 구현하는데 이 기능에서 주요로 중요한 것을@State, bindings, and the source of truth 이 세가지이다.알고 있는 방법이긴 하지만,이를 어떻게 더 잘 쓸 수 있을지에 대해 생각을 해봐야겠다. Use the edit view to create a new scrum  ScrumsView.swift 코드에 @State 를 적용한다. DetailEditView를 활용하여 새로 등록할 때도 해당 화면을 활용할 수 있도록 한다.@State private var isPresentingNewScrumView = false // 생성뷰를 보여줄 지에 대한 여부 ..

iOS/App 2025.04.06

Scrumdinger 개발 03 - Managing data flow between views ~ Creating the edit view

Managing data flow between viewsSource of truthSwift property wrappers @State, @BindingThe system establishes dependencies between the data in @State and the child view that contains the @Binding. -> the system automatically updates the relevant views   Properties that you label @State are mutable, and the system observes these properties for changes in the view where you define them.@State 로 지정..

iOS/App 2025.04.02

SwiftUI 로 고차함수 예제코드

고차 함수 (Higher-Order Function)고차 함수는 다른 함수를 매개변수로 받거나, 함수 자체를 반환하는 함수를 말한다.Swift의 map, filter, reduce 같은 함수가 대표적인 고차 함수이다. 다른 함수를 매개변수로 받을 수 있다.함수를 반환할 수 있다.클로저(Closure)와 자주 사용된다. import SwiftUIstruct MyHOFView: View { let array = [1,2,3,4,5,6,7,8,9,10,11,17,18] @State private var displayedArray: [String] = [] var body: some View { VStack { HStack { ..

iOS/Swift 2025.03.19

[SwiftUI] NFC Reader, Writer example

app 개발에 대한 감을 놓치고 싶지 않아서 이것저것 샘플 코드 살펴보면서 감을 유지해야겠다 언젠가는 쓸모가 있을 것이다 우선 NFC Reader를 구현하기 위해서는 Core NFC 프레임워크를 사용해야 한다. Core NFC 프레임워크를 사용하기 위해서는 Info.plist 파일에 NFC 능력을 요청하는 Key를 추가해야 한다. Key는 NFCReaderUsageDescription NFCReaderUsageDescription This app requires access to NFC capabilities to read and write NFC tags. SwiftUI를 사용하여 NFC Reader 구현 import SwiftUI import CoreNFC struct ContentView: View..

iOS 2023.03.15
728x90