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
| extension View { | |
| func badge<Badge: View>(_ badge: Badge, alignment: Alignment = .topTrailing) -> some View { | |
| overlay( | |
| badge | |
| .alignmentGuide(.leading, computeValue: splitDimension(\.width)) | |
| .alignmentGuide(HorizontalAlignment.center, computeValue: splitDimension(\.width)) | |
| .alignmentGuide(.trailing, computeValue: splitDimension(\.width)) | |
| .alignmentGuide(.top, computeValue: splitDimension(\.height)) | |
| .alignmentGuide(VerticalAlignment.center, computeValue: splitDimension(\.height)) | |
| .alignmentGuide(.bottom, computeValue: splitDimension(\.height)), |
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 | |
| import Combine | |
| import PlaygroundSupport | |
| struct SpringSolver { | |
| let ƛ: CGFloat | |
| let w0: CGFloat | |
| let wd: CGFloat | |
| /// Initial velocity | |
| let v0: CGFloat |
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
| struct CardHeading: View { | |
| @State private var touchZoom: Bool = false | |
| var body: some View { | |
| VStack(spacing: 0) { | |
| Image("banner") | |
| .resizable() | |
| .aspectRatio(contentMode: ContentMode.fill) | |
| .frame(minWidth: 0, maxWidth: .infinity, maxHeight: 400) | |
| .clipped() |