본문 바로가기

분류 전체보기188

[TCA] day 13 타이머 (Effects- Timer) 코드 전문import ComposableArchitectureimport SwiftUIprivate let readMe = """ This application demonstrates how to work with timers in the Composable Architecture. It makes use of the `.timer` method on clocks, which is a helper provided by the Swift Clocks \ library included with this library. The helper provides an `AsyncSequence`-friendly API for \ dealing with times in asynchronous code. """.. 2024. 5. 8.
[TCA] day 12 새로고침 (Effects-Refreshable) 코드 전문import ComposableArchitectureimport SwiftUIprivate let readMe = """ This application demonstrates how to make use of SwiftUI's `refreshable` API in the Composable \ Architecture. Use the "-" and "+" buttons to count up and down, and then pull down to request \ a fact about that number. There is a discardable task that is returned from the store's `.send` method representing any \ effec.. 2024. 5. 7.
[SwiftUI] TaskModifier 코드전문//// TaskModifier.swift// TIL_TCA//// Created by MaraMincho on 5/5/24.//import Foundationimport SwiftUIstruct Message: Decodable, Identifiable { let id: Int let from: String let text: String}struct TaskModifierView: View { @State private var messages = [Message]() var body: some View { NavigationView { List(messages) { message in VStack(alignment: .leading) { .. 2024. 5. 6.
[TCA] day 10 long living Effect (publisher Effect and async/await effect) 코드 전문import ComposableArchitectureimport SwiftUIimport Combineprivate let readMe = """ This application demonstrates how to handle long-living effects, for example notifications from \ Notification Center, and how to tie an effect's lifetime to the lifetime of the view. Run this application in the simulator, and take a few screenshots by going to \ *Device › Screenshot* in the menu, and obse.. 2024. 5. 5.
[알고리즘] 백준 9466 텀프로젝트 [python, swift] 텀 프로젝트 성공다국어  시간 제한메모리 제한제출정답맞힌 사람정답 비율3 초 256 MB67837171981158523.963%문제이번 가을학기에 '문제 해결' 강의를 신청한 학생들은 텀 프로젝트를 수행해야 한다. 프로젝트 팀원 수에는 제한이 없다. 심지어 모든 학생들이 동일한 팀의 팀원인 경우와 같이 한 팀만 있을 수도 있다. 프로젝트 팀을 구성하기 위해, 모든 학생들은 프로젝트를 함께하고 싶은 학생을 선택해야 한다. (단, 단 한 명만 선택할 수 있다.) 혼자 하고 싶어하는 학생은 자기 자신을 선택하는 것도 가능하다.학생들이(s1, s2, ..., sr)이라 할 때, r=1이고 s1이 s1을 선택하는 경우나, s1이 s2를 선택하고, s2가 s3를 선택하고,..., sr-1이 sr을 선택하고, sr이.. 2024. 5. 4.
[TCA] day 10 Effect 취소 (TCA @Shared, Sheet) 코드 전문import ComposableArchitectureimport SwiftUIprivate let readMe = """ This screen demonstrates how one can cancel in-flight effects in the Composable Architecture. Use the stepper to count to a number, and then tap the "Number fact" button to fetch \ a random fact about that number using an API. While the API request is in-flight, you can tap "Cancel" to cancel the effect and prevent \ i.. 2024. 5. 3.