Post

Replies

Boosts

Views

Activity

Reply to Looking for recommendation for s/w development machine
If you want your Mac to last for several years, and you take the longer view, then M-series chips are clearly the future. It seems likely that Apple (and other) software will become increasingly optimised for the M-series. I wouldn't consider any Intel Mac now. If you are pushed for cash, consider an Apple refurbished model? M-series chips have clear battery-life advantages. If you ever intend to use it unplugged, then that is a factor. If you're always plugged-in, then consider a Mac Mini instead.
Jun ’22
Reply to Text Alignment in SwiftUI
Use a VStack to position your content below your heading... ...then add a Spacer, to force everything to the top. struct HomeScreen: View { var body: some View { VStack { HStack{ Text("Tasks") .font(.largeTitle) .fontWeight(.bold) .frame(maxWidth: .infinity, alignment: .leading) .padding() } // TODO: your content goes here... Text("content...") Spacer() /// forces content to top } } }
Jun ’22
Reply to Button That Changes Label on Click
Try this: import SwiftUI struct ButtonTest: View { @State private var isOn = false var body: some View { Button { isOn.toggle() } label: { Image(systemName: isOn ? "star" : "star.fill") } } } struct ButtonTest_Previews: PreviewProvider { static var previews: some View { ButtonTest() } }
Jun ’22
Reply to How to create a DetailView in SwiftUI?
You have defined "viewAllArtwork" in "ArtworkDetailView" You are trying to reference it in "ArtworkDetailView_Previews", which is a completely different thing. Hence the error message. In ArtworkDetailView_Previews, you need to create a single Artwork, and pass it to the ArtworkDetailView. You have not included the code for Artwork, so I can't suggest how you create that. Typically, it would be something like: ArtworkDetailView(artwork: Artwork())
May ’22