Post

Replies

Boosts

Views

Activity

Swift how to add password to the `Passwords App`
I added a password to Keychain using Swift on macOS. All works well, and I can see it using Keychain Access, it is stored under iCloud -> Passwords. How can I see this password on the Passwords App. Is there something I need to do, maybe in Swift, to have this password in the Passwords App, not just in Keychain Access Note, I have turn on iCloud Keychain on my Mac: https://support.apple.com/en-us/109016
1
0
291
Oct ’24
Macos 12 not available after update to Xcode to Version 13.0 (13A233)
I've just update Xcode to Version 13.0 (13A233) release candidate, but now I cannot select MacOS 12 as target, nor for MacCatalyst, it only shows up to 11.3. So all the latest SwiftUI for MacOS 12 is unavailable. ios-15 is present, but not MacCatalyst 12 or even 11.4. Is there a trick or something I have to do or download, to make macos 12 available as target, like it used to do in the beta? Alternatively, is there a way to download the previous beta version. By mistake I deleted mine.
2
0
1.2k
Sep ’21
Bug in Finder, it goes crazy when I type w in the search bar.
On Macos Monterey, 12 beta7, I typed the character w in the search bar of Finder, and after a few seconds (while I was looking for the other characters to type in) it went into a locked mad spin forever. Took me a while to find a way to force quit Finder. This seems to be a real bug to me. Has anyone experienced this? Is there a quick way to force quit Finder, some magic key combinations?
0
0
648
Sep ’21
SwiftUI List section headers changed to uppercase.
I'm targeting iPad ios 14, with this test code: struct ContentView: View { 		 				@State var arr1: [String] = ["one", "two", "three"] 				@State var arr2: [String] = ["four", "five", "six"] 		 		var body: some View { 				List { 						Section(header: Text("first section")) { 								ForEach(arr1, id: \.self) { s in 										Text(s) 								} 						} 						Section(header: Text("second section")) { 								ForEach(arr2, id: \.self) { s in 										Text(s) 								} 						} 				} 		} 		} Is there a way to make the section headers display what I put in the Text, not change it to uppercase?
2
0
8.6k
Jul ’20
ProgressView not showing with expected color in macOS 11
Using xcode 12.3, target macOS 11.1. I have the following test code showing the ProgressView as black not red as expected. struct ContentView: View { 		var body: some View { 				HStack { 						Spacer() 						ProgressView().progressViewStyle(CircularProgressViewStyle(tint: .red)) 						Spacer() 				}.frame(width: 333, height: 333) 		} } Is there a way to make the ProgressView a given color? Is this another bug in SwiftUI?
2
0
1.9k
Dec ’20
Universal Clipboard not working
I've just upgraded my iMac to macos 11.1 beta and noticed that the Universal Clipboard doesn't work anymore between my mac and ios 14.3 devices. Not working when I copy on mac and try to paste on my iPhone or iPad. It used to be so useful. I followed again the instructions at: https://support.apple.com/en-us/HT209460#:~:text=On%20your%20Mac%3A%20Choose%20Apple,Handoff%2C%20then%20turn%20on%20Handoff. Is there a way to bring this functionality back?
1
0
1.1k
Dec ’20
macOS app issues with sandboxing.
I'm developing an app to parse package.swift files. When I run the following test code with "App Sandbox=NO" all works well. But I get the dreaded "xcrun: error: cannot be used within an App Sandbox" when "App Sandbox=YES". Fair enough. So what I'm trying to do is to run "swift" inside my sandbox. To do this, I added the small "swift" command file into my Assets and in my project, and using that. However I still get the same error. How can I run "swift" in my sandbox? or is there another way to parse package.swift files with "App Sandbox=YES"? import SwiftUI import Foundation struct ContentView: View { 		var body: some View { 				Text("do the test").onAppear(perform: doTest) 		} 		 		func doTest() { 				if let swiftURL = Bundle.main.url(forResource: "swift", withExtension: nil) { 						let task = Process() 						task.executableURL = URL(fileURLWithPath: swiftURL.absoluteString) 						// path to my local .cachesDirectory, where I added a Package.swift file 						// e.g. FileManager.default.urls(for: .cachesDirectory, in: .userDomainMask) 						let arg3 = "/Users/......" 						task.arguments = ["package", "--package-path", arg3, "dump-package"] 						let pipe = Pipe() 						task.standardOutput = pipe 						do { 								try task.run() 						} catch (let error) { 								print("======> error \(error.localizedDescription)") 						} 						task.waitUntilExit() 						let data = pipe.fileHandleForReading.readDataToEndOfFile() 						print("---> data:	\(data)") 				} 		} } Using Xcode 12.2 beta, macos 10.15.6 app.
0
0
907
Sep ’20
How to put a button/view on top of the SwiftUI Map?
I can't find a way to get my buttonView (just a Button) on top of the map so I can tap it. In another more complicated setup, the button somehow turnup on top and I can tap it, but this is by luck not by design. How to get my buttonView on the map so I can tap it? Xcode 12 beta-3, mac catalina, target ios 14. import Foundation import SwiftUI import MapKit import CoreLocation @main 	 struct TestMapApp: App { 		var body: some Scene { 				WindowGroup { 						MapViewer() 				} 		} } struct MapViewer: View { 		@State var cityAnno = [CityMapLocation(title: "Tokyo", subtitle: "Japan", lat: 35.685, lon: 139.7514)] 		@State var region = MKCoordinateRegion(center: CLLocationCoordinate2D(latitude: 35.685, longitude: 139.7514),span: MKCoordinateSpan(latitudeDelta: 1.0, longitudeDelta: 1.0)) 		 		var body: some View { 				Map(coordinateRegion: $region, annotationItems: cityAnno) { city in 						MapAnnotation(coordinate: city.coordinate) { 								buttonView(cityName: city.title!) 								// tried this, does not work 								// Image(systemName:"dot.circle.and.cursorarrow").foregroundColor(.white).scaleEffect(2.2) 								//	 .onTapGesture { print("----> onTapGesture") } 						} 				} 		} 		func buttonView(cityName: String) -> some View { 				Button(action: {print("----> buttonView action")}) { 						VStack { 								Text(cityName) 								Image(systemName: "dot.circle.and.cursorarrow") 						}.foregroundColor(.red).scaleEffect(1.2) 				}.frame(width: 111, height: 111) 				// tried combinations of these, without success //				.background(Color.gray).opacity(0.8) //				.border(Color.white) //				.contentShape(Rectangle()) //				.clipShape(Rectangle()) //				.zIndex(1) //				.buttonStyle(PlainButtonStyle()) //				.layoutPriority(1) //				.allowsHitTesting(true) //				.onTapGesture { //						print("----> onTapGesture") //				} 		} 		} 		class CityMapLocation: NSObject, MKAnnotation, Identifiable { 		var id = UUID().uuidString 		var title: String? 		var subtitle: String? 		dynamic var coordinate: CLLocationCoordinate2D 		 		 init(title: String?, subtitle: String?, lat: Double, lon: Double) { 				self.id = UUID().uuidString 				self.title = title 				self.subtitle = subtitle 				self.coordinate = CLLocationCoordinate2D(latitude: lat, longitude: lon) 		} 		}
0
1
1.6k
Aug ’20