Post

Replies

Boosts

Views

Activity

Reply to Support for Automator app in macOS
Honestly, I hope Apple keeps Automator around for years to come. I have a lot of Automator actions that I can't easily convert into Shortcuts. Also, Shortcuts lets me add Quick Actions like Automator does, but they don't appear in the Finder like the Automator ones do. I just tried it. I created a Shortcuts Quick Action, and it doesn't show up when I right-click something in the Finder. I added a new Automator QA, and it's there. Basically, if I got rid of those Automator Quick Actions I could not replace them with Shortcuts Quick Actions. There may be something I'm missing, but they don't work for me.
May ’24
Reply to We need more RAM
Yes, an M2 Ultra chip can only have up to 192GB of RAM, but this Unified Memory Architecture and is different to how it works on an Intel chip. It's supposed to be more efficient, and Apple Silicon certainly feels faster than Intel chips.
Topic: App & System Services SubTopic: Hardware Tags:
May ’24
Reply to Advice to fix my code, trying to learn how to develop in Xcode
Why do you have so much whitespace in your code? To make it more readable, cut down on the excessive use of the space character. You don't need to put Group {} around your code. You should use Group {} when you want to apply the same modifiers to the items within. For example, these are equivalent: Group { Text("1") Text("2") } .foregroundStyle(Color.green) // ... and ... Text("1") .foregroundStyle(Color.green) Text("2") .foregroundStyle(Color.green) This works for me: import SwiftUI struct ContentView: View { @State var text: Array<String> = [] @State var showSheet = false @State var textItemTemp = "" var body: some View { NavigationView { if text.count <= 1 { Text("no items") } else { List { ForEach(0...text.count - 1, id: \.self) {i in. // -- NOTE: This is 0 to (array length - 1), i.e. if array length is 10, it's 0...9 not 1...9 Text(text[i]) .contextMenu { Button(action: { text.remove(at: i) }, label: { Label("Delete", systemImage: "delete.left") }) } } } } } .navigationTitle("Idea Book") .toolbar { Button(action: { showSheet.toggle() textItemTemp = "" }, label: { Image(systemName: "plus") }) } .onChange(of: text) { save() load() } .onAppear() { save() load() } .refreshable { save() load() } .sheet(isPresented: $showSheet) { NavigationView { List { TextField("Item", text: $textItemTemp) } .navigationTitle("Add an Idea") .toolbar { Button("add") { text.append(textItemTemp) showSheet.toggle() } } } } } func save() { let temp = text.joined(separator: "/[split]/") UserDefaults.standard.set(temp, forKey: "text") } func load() { let temp = UserDefaults.standard.string(forKey: "text") ?? "" let tempArray = temp.components(separatedBy:"/[split]/") text = tempArray } } #Preview { ContentView() }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
May ’24
Reply to Simulator Not Working
What does your Xcode > Settings > Platforms tab look like? It's possible that you need to remove existing simulators and re-install them. Don't just click "Get" next to everything; remove other instances of the same version first so you end up with just one. This is my Platforms tab, and in this example I would remove the "watchOS 10.4 Simulator", then get "watchOS 10.4".
May ’24
Reply to SwiftUI iOS 17, Xcode 15.3 MapContentBuilder
I hit those warnings, too. You can ignore them until they become errors, but if you want to correct them now you can use something like this, and munge it around to fit your needs: @State private var mapPosition = MapCameraPosition.region(MKCoordinateRegion(center: CLLocationCoordinate2D(latitude: 51.507222, longitude: -0.1275), span: MKCoordinateSpan(latitudeDelta: 0.03, longitudeDelta: 0.03))) @State private var coordinates = CLLocationCoordinate2D(latitude: 51.507222, longitude: -0.1275) @State private var mapInteractionModes: MapInteractionModes = [] @State private var mapMarkerName: String = "My Marker" ... Map(position: $mapPosition) { Marker(mapMarkerName, coordinate: coordinates) } .mapStyle(.standard(elevation: .realistic)) .mapControls { MapCompass() MapScaleView() }
May ’24