This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // | |
| // Diagrams.swift | |
| // DiagramsSample | |
| // | |
| // Created by Chris Eidhof on 16.12.19. | |
| // Copyright © 2019 objc.io. All rights reserved. | |
| // | |
| import SwiftUI |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import SwiftUI | |
| struct SizeKey: PreferenceKey { | |
| static func reduce(value: inout CGSize?, nextValue: () -> CGSize?) { | |
| value = value ?? nextValue() | |
| } | |
| } | |
| struct ContentView: View { | |
| @State var width: CGFloat? = nil | |
| var body: some View { |