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 MyButtonStyle: ButtonStyle { | |
func makeBody(configuration: Configuration) -> some View { | |
configuration.label | |
.fixedSize() | |
// apply size modifiers | |
.frame(width: nil, height: 48) |
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 ExampleView: View { | |
var body: some View { | |
Text("Hello world!") | |
.foregroundColor(.blue) | |
.foregroundColor(.black) | |
} | |
} |
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 ExampleView: View { | |
var body: some View { | |
VStack(alignment: .center, spacing: 16) { | |
Text("One") | |
Text("Two") | |
Text("Three (override parent modifier)").font(.headline) | |
Text("Four") | |
} |
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
Project | Object | Fix | |
---|---|---|---|
UIToolkit | UIToolkit (class) | Rename class to UIToolkitConfiguration | |
TripBoards | TripBoards (protocol) | Rename TripBoards to TripBoardManager |
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 | |
/// Common aspect ratios | |
public enum AspectRatio: CGFloat { | |
case square = 1 | |
case threeToFour = 0.75 | |
case fourToThree = 1.75 | |
} | |
/// Fit an image to a certain aspect ratio while maintaining its aspect ratio |
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 Card: View { | |
var body: some View { | |
VStack(alignment: .leading, spacing: 8) { | |
Image("condos") | |
.resizable() | |
.clipShape(RoundedRectangle(cornerRadius: 4)) | |
Text("Condo with awesome views of downtown") |