https://www.hackingwithswift.com/100/swiftui/18
100 Days of SwiftUI – Day 18 – Hacking with Swift
Project 1, part three You just finished building your first SwiftUI app, and all being well you were surprised by how easy it was. You might even be wondering why I spent so long talking about structs, closures, optionals, and more, when really we ended up
www.hackingwithswift.com
WeSplit은 끝입니다. 몇 가지 문제 풀이와 간단한 챌린지가 이어지네요. SwiftUI는 hard code된 chlid view의 갯수를 10개로 제한하지만, ForEach를 이용할 경우에는 갯수 제한이 없다고 합니다. ForEach란 건 어쩌면 반복문 문법이 아니라 UITableView마냥 컨테이너뷰 인 건 아닐까 하는 생각이 들었습니다.
응 아니야
/// A structure that computes views on demand from an underlying collection of
/// of identified data.
@available(iOS 13.0, OSX 10.15, tvOS 13.0, watchOS 6.0, *)
public struct ForEach<Data, ID, Content> where Data : RandomAccessCollection, ID : Hashable {
/// The collection of underlying identified data.
public var data: Data
/// A function that can be used to generate content on demand given
/// underlying data.
public var content: (Data.Element) -> Content
}
https://github.com/utrpanic/today-what-else/commit/5030c23dcf4cdb7a4a12fa4fe9bbda1a3b5372f8
Day 20. Project 2, part 1 (0) | 2020.03.06 |
---|---|
Day 19. Challenge day (0) | 2020.03.05 |
Day 17. Project 1, part two (0) | 2020.03.04 |
Day 16. Project 1, part one. (0) | 2020.01.27 |
Day 15. Swift review, day three. (0) | 2020.01.25 |
댓글 영역