WWCD 24 > What’s new in Xcode 16 에서 소개된 preview 관련 API 두개..! [1] @Previewable - @Previewable 은 #Preview body 내에서 사용하는 매크로 (iOS 17+)- 이 매크로는 #Preview body 내에서 @State property 를 선언할 수 있게 해줌 (예전에는 dynamic property 를 들고 있는 뷰의 동작을 테스트하기 위해 별도의 wrapper view 를 만들고 @State property 를 선언했음) AS ISimport SwiftUIstruct SomeView: View { @Binding var text: String var body: some View { Te..
Swift 6 에서 'Typed throws' 를 사용할 수 있다. - Swift Proposal: SE-0413- WWDC 24 > What’s new in Swift [1] 개념 AS IS기존의 에러 처리 방식이다. catch 블럭에 전달되는 에러는 type erased 되기 때문에 이런 식으로 구체 타입 체크를 했다. 이런 방식을 'UnTyped throws' 라고 한다. TO BE 이제 'Typed throws' 방식도 지원된다! 이렇게 function 이 throw 할 에러의 구체타입을 지정할 수 있다. (하나의 구체 타입만 사용한다면) 그럼 type erasure 가 안되고catch 블럭으로 들어오는 에러는 구체타입이다. [2] 실습 [3] 참고 1) API 에서 t..
[ 문서 ]- 공식 문서 > templates. - workshop > Bonus 2. Templates [ tuist scaffold ]tuist 는 tuist scaffold 라는 명령어를 제공하는데, 프로젝트 자동생성을 도와주는 명령어입니다.tuist scaffold name_of_template --name Name 이 명령어는 Tuist/Templates 경로에 저장되어있는 템플릿을 사용하고,템플릿은 manifest 파일과 Stencil file 을 결합하여 만듭니다. 자세히 말하자면, 1) Tuist/Templates 하위에 name_of_template 디렉토리 만들기. 2) 해당 디렉토리에 name_of_template.swift 파일 두기.3) name_of_template.swif..
[1] AsyncSequence - iterator 를 통해 elements 에 접근하는 Sequence 와 동일한 개념. 대신 asynchronous 하게 element 를 접근한다는 점이 Sequence 와 다름. 영어가 더 깔끔한 듯.. ? ‘AsyncSequence is a protocol which resembles Sequence and allows you to iterate over a sequence of values asynchronously.’ - iterator 의 next() 를 호출하거나 for await loops 를 사용해서 elements 에 접근할 수 있음 - AsyncSequence 프로토콜의 requirement 를 간략히 적어보자면 다음과 같음 protocol As..
[1] @TaskLocal 이란 ? @TaskLocal 은 특정 Task 와 Child Tasks 들끼리 값을 공유할 수 있게 해주는 프로퍼티 래퍼입니다. 이 값은 특정 Task 랑 Child Tasks 에만 국한되어서 전파됩니다. 즉 상위 Task 및 다른 독립적인 Task 에는 영향을 주지 않습니다. @TaskLocal 를 통해 전역상태를 피하면서도, 관련된 작업들 간에 상태를 안전하게 공유할 수 있습니다. [2] TaskLocal 선언하기 static 이나 global 프로퍼티로 선언되어야합니다. (global 은 Swift 6 이상부터 가능하다고 하네요) [3] TaskLocal 에 값을 바인딩 하기 task-local 에 직접적으로 value 를 set 할 수 없습니다. ..
Layout 프로토콜을 채택해서 Custom Layout 을 주로 만들지만 (문서, 예제 - WheelLayout )이 글처럼 SizeLogger 를 만들 수도 있다. 좋은 아이디어! struct SizeLogger: Layout { let label: String func sizeThatFits(proposal: ProposedViewSize, subviews: Subviews, cache: inout ()) -> CGSize { let result = subviews[0].sizeThatFits(proposal) print(label, proposal, result) return result } func placeSubview..
iOS 17 부터 scrollClipDisabled 모디파이어를 쓸 수 있다. ScrollView 는 기본적으로 contents 를 scrollView bounds 에 맞게 clip 하기 때문에ScrollView 안에 들어가는 뷰에 shadow 를 주면 짤리게 된다.그 때 이 모디파이어를 사용해서 shadow 를 안짤리게 할 수 있다. [ 문서에 나오는 예제 ] scrollClipDisabled > true (디폴트값) scrollClipDisabled > false [ 하위버전 ] 그럼 하위버전에서는 어떻게 shadow 가 안짤리게 할까 ? ScrollView 자체에 shadow 를 주면 된다. (동일하게 동작함) ScrollView(.horizontal) { ..
Timer 쓸 때, 편하게 썼던 autoconnect 는 ConnectablePublisher 의 메소드이다. ConnectablePublisher 에 대해 자세히 알아보자. [1] ConnectablePublisherConnectablePublisher 는 connection 을 명확히 지정할 수 있는 publisher 이다. 즉 connect 메소드를 직접 호출하기 전까지 값을 방출하지 않는다. 값이 방출되기 전에 추가적인 configuration 이나 setup 이 필요할 때,구독자들이 다 준비된 후 이벤트를 방출하고 싶을 때유용하다. autoconnect 는 connection , disconnection 을 자동으로 해주는 메소드이다. [2] ConnectablePublisher..
TCA 를 보다가 context 를 live, preview, test 로 구분하는 것을 봤다. ProcessInfo.processInfo.environment["XCODE_RUNNING_FOR_PREVIEWS"] == "1"이면 프리뷰 빌드인 지 알 수 있다고 한다. (참고) [ TCA 코드 ]https://github.com/pointfreeco/swift-dependencies/blob/2ee34c93c717700eb58ab945fd0444cebe8a646f/Sources/Dependencies/DependencyValues.swift#L304 swift-dependencies/Sources/Dependencies/DependencyValues.swift at 2ee34c93c717700eb..
https://developer.apple.com/apple-intelligence/ Apple Intelligence for DevelopersApple Intelligence is the personal intelligence system that puts powerful generative models right at the core of your iPhone, iPad, and Mac and powers incredible new features to help users communicate, work, and express themselves.developer.apple.com ㄴ Image PlayGround 는 세션도 없는데 아직도 여기 링크 추가안됨 😭 Genmoji 라도 해보자 ..
- Total
- Today
- Yesterday
- Flutter 로딩
- Flutter Spacer
- Django FCM
- Python Type Hint
- flutter dynamic link
- 구글 Geocoding API
- 플러터 얼럿
- Django Heroku Scheduler
- drf custom error
- 장고 Custom Management Command
- METAL
- SerializerMethodField
- flutter deep link
- github actions
- Django Firebase Cloud Messaging
- cocoapod
- ipad multitasking
- Dart Factory
- flutter build mode
- PencilKit
- Sketch 누끼
- Flutter Clipboard
- DRF APIException
- 장고 URL querystring
- flutter 앱 출시
- Flutter Text Gradient
- Flutter getter setter
- 플러터 싱글톤
- ribs
- Watch App for iOS App vs Watch App
| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 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 | 31 |