Post

Replies

Boosts

Views

Activity

Reply to Xcode 13.2 Instantiating CLLocationButton crashes in Simulator
After removing references to the code that you don't supply... ...and tweaking what remains, this works for me: private func setupUserLocationButton() { let button = CLLocationButton() button.icon = .arrowOutline button.label = .none button.cornerRadius = 25.0 button.addTarget(self, action: #selector(userLocationButtonTapped), for: .touchUpInside) view.addSubview(button) // setting up constraints for CLLocationButton to be on the top right corner button.translatesAutoresizingMaskIntoConstraints = false NSLayoutConstraint.activate([ button.topAnchor.constraint(equalTo: view.safeAreaLayoutGuide.topAnchor, constant: 16.0), button.trailingAnchor.constraint(equalTo: view.safeAreaLayoutGuide.trailingAnchor, constant: -16.0) ]) } Maybe take it from there, and re-add your customizations, one-by-one? Xcode 13.2 (13C90) (From the Developer website, not the broken App Store version 13.2)
Dec ’21
Reply to Xcode 13.1?
There is a serious issue with the latest App Store version of Xcode 13.2. See this thread:   https://developer.apple.com/forums/thread/696504 If you want to try a fixed 13.2... The workaround is to download an updated Xcode 13.2 from Apple Developer (Applications): https://developer.apple.com/download/release/
Dec ’21
Reply to Xcode 13.2 Instantiating CLLocationButton crashes in Simulator
there is no storyboard or xib involved So why are you declaring it like this? private var userLocationButton: CLLocationButton! Rather than (say): private let userLocationButton = CLLocationButton() ...and then set up userLocationButton, rather than bothering with a separate "let button = CLLocationButton()" Alternatively... I tried setting up a new project with your Code above and everything just works fine So just use that code?
Dec ’21
Reply to Message and ringer volume.
It is very unlikely that Apple will do this. However, they have provided a mechanism for you to do it yourself... You can create the same effect, by making your own ringtones and message tones. When you record the tones, you could adjust their volume levels, to suit. You can even have per-sender message tones (with different volumes), to distinguish between more and less important senders. I use the Fission app to produce my tones... many such apps are available.
Topic: App & System Services SubTopic: General Tags:
Dec ’21
Reply to Xcode 13.2 uses 100% CPU when launch
Depending on your Mac, you probably have much more than 100% available. It's a bit like footballers who always give 110%. On an 8-core processor, you would have 1600% available. So 100% may not be as much as it seems. I want my Mac to work hard, so I was pleased to see it achieve 1200% yesterday.😀
Dec ’21
Reply to URLSession.uploadTask withFile When can file be deleted
When uploading in the background, the temporary file should be deleted (on the main thread) in the upload task's completion handler. That is, the upload task must have finished (with success or failure) before you delete the temporary file. In URLSessionTaskDelegate, that would be in: urlSession(_:task:didCompleteWithError:) (Of course, if there was an error, you might want to try again.)
Dec ’21
Reply to SwiftUi NavigationLink three view and hidden bar but not work on third
Your code does not compile. Try this: struct View1: View { var body: some View { NavigationView { NavigationLink("view2", destination : View2()) } .navigationBarTitle("") .navigationBarHidden(true) } } struct View2: View { var body: some View { VStack{ NavigationLink("view3", destination : View3()) } .navigationBarTitle("") .navigationBarHidden(true) } } struct View3: View { var body: some View { Text("Hey") .navigationBarTitle("") .navigationBarHidden(true) } }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Dec ’21
Reply to Question about IOHIDRequestAccess
This seems to be how the "System Preferences > Input Monitoring" change works. The changes are not instant, but take effect only when the app is quit and relaunched. If the app is running when the change is made in System Preferences, I see a dialog confirming this (with an option to "Quit & Reopen"). I also tried using IOHIDCheckAccess(kIOHIDRequestTypeListenEvent), but this does not give any further information.
Topic: App & System Services SubTopic: Core OS Tags:
Dec ’21
Reply to Cannot find `ArchiveByteStream` in scope
The Xcode Developer Documentation has a detailed explanations of Apple Archive, including: Decompressing Single Files Decompressing and Extracting an Archived Directory Decompressing and Parsing an Archived String Your example code snippets may have become outdated (or may just be incomplete), but it builds cleanly for me, except for the handling of the "defer" statements. import AppleArchive import System func testDecompressStream(readFileStream: ArchiveByteStream) { guard let decompressStream = ArchiveByteStream.decompressionStream(readingFrom: readFileStream) else { return } defer { try? decompressStream.close() } } Xcode 13.2 (13C90)
Topic: Programming Languages SubTopic: Swift Tags:
Dec ’21
Reply to Xcode 13.2 Instantiating CLLocationButton crashes in Simulator
After removing references to the code that you don't supply... ...and tweaking what remains, this works for me: private func setupUserLocationButton() { let button = CLLocationButton() button.icon = .arrowOutline button.label = .none button.cornerRadius = 25.0 button.addTarget(self, action: #selector(userLocationButtonTapped), for: .touchUpInside) view.addSubview(button) // setting up constraints for CLLocationButton to be on the top right corner button.translatesAutoresizingMaskIntoConstraints = false NSLayoutConstraint.activate([ button.topAnchor.constraint(equalTo: view.safeAreaLayoutGuide.topAnchor, constant: 16.0), button.trailingAnchor.constraint(equalTo: view.safeAreaLayoutGuide.trailingAnchor, constant: -16.0) ]) } Maybe take it from there, and re-add your customizations, one-by-one? Xcode 13.2 (13C90) (From the Developer website, not the broken App Store version 13.2)
Replies
Boosts
Views
Activity
Dec ’21
Reply to Xcode 13.2 and autocompletion
This autocomplete still works for me. Xcode 13.2 (13C90) (From the Developer website, not the broken App Store version 13.2) Maybe the App Store Xcode 13.2 has further issues? See https://developer.apple.com/forums/thread/696504
Replies
Boosts
Views
Activity
Dec ’21
Reply to Picker Label not showing anymore
And does my solution still work?
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Dec ’21
Reply to Xcode 13.1?
There is a serious issue with the latest App Store version of Xcode 13.2. See this thread:   https://developer.apple.com/forums/thread/696504 If you want to try a fixed 13.2... The workaround is to download an updated Xcode 13.2 from Apple Developer (Applications): https://developer.apple.com/download/release/
Replies
Boosts
Views
Activity
Dec ’21
Reply to Xcode 13.2 Instantiating CLLocationButton crashes in Simulator
there is no storyboard or xib involved So why are you declaring it like this? private var userLocationButton: CLLocationButton! Rather than (say): private let userLocationButton = CLLocationButton() ...and then set up userLocationButton, rather than bothering with a separate "let button = CLLocationButton()" Alternatively... I tried setting up a new project with your Code above and everything just works fine So just use that code?
Replies
Boosts
Views
Activity
Dec ’21
Reply to Get file path from .onDrop on macOS SwiftUI app
Did that work for you, @airbolt?
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Dec ’21
Reply to How do I pass in my custom collectionView instead of using the default collectionView?
Have you considered using a convenience initializer?
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
Dec ’21
Reply to Message and ringer volume.
It is very unlikely that Apple will do this. However, they have provided a mechanism for you to do it yourself... You can create the same effect, by making your own ringtones and message tones. When you record the tones, you could adjust their volume levels, to suit. You can even have per-sender message tones (with different volumes), to distinguish between more and less important senders. I use the Fission app to produce my tones... many such apps are available.
Topic: App & System Services SubTopic: General Tags:
Replies
Boosts
Views
Activity
Dec ’21
Reply to fireDate and repeatInterval for UNNotificationRequest
I think you would have to use two UNNotifications for this case. The first notification (start of next month, non-repeating) fires when you want the repeating notifications to start. Your handler for this notification starts the second notification (daily, repeating).
Replies
Boosts
Views
Activity
Dec ’21
Reply to Xcode 13.2 uses 100% CPU when launch
Depending on your Mac, you probably have much more than 100% available. It's a bit like footballers who always give 110%. On an 8-core processor, you would have 1600% available. So 100% may not be as much as it seems. I want my Mac to work hard, so I was pleased to see it achieve 1200% yesterday.😀
Replies
Boosts
Views
Activity
Dec ’21
Reply to URLSession.uploadTask withFile When can file be deleted
When uploading in the background, the temporary file should be deleted (on the main thread) in the upload task's completion handler. That is, the upload task must have finished (with success or failure) before you delete the temporary file. In URLSessionTaskDelegate, that would be in: urlSession(_:task:didCompleteWithError:) (Of course, if there was an error, you might want to try again.)
Replies
Boosts
Views
Activity
Dec ’21
Reply to Dark mode keeps triggering error messages
Hi @BDCConfused... first post on the forum? Try posting your code in a code block (using "Paste and Match Style"), rather than a photo or screenshot. Then it will be easier for people to help you. Why do you think your issues are related to Dark Mode?
Replies
Boosts
Views
Activity
Dec ’21
Reply to SwiftUi NavigationLink three view and hidden bar but not work on third
Your code does not compile. Try this: struct View1: View { var body: some View { NavigationView { NavigationLink("view2", destination : View2()) } .navigationBarTitle("") .navigationBarHidden(true) } } struct View2: View { var body: some View { VStack{ NavigationLink("view3", destination : View3()) } .navigationBarTitle("") .navigationBarHidden(true) } } struct View3: View { var body: some View { Text("Hey") .navigationBarTitle("") .navigationBarHidden(true) } }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Dec ’21
Reply to Question about IOHIDRequestAccess
This seems to be how the "System Preferences > Input Monitoring" change works. The changes are not instant, but take effect only when the app is quit and relaunched. If the app is running when the change is made in System Preferences, I see a dialog confirming this (with an option to "Quit & Reopen"). I also tried using IOHIDCheckAccess(kIOHIDRequestTypeListenEvent), but this does not give any further information.
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
Dec ’21
Reply to Cannot find `ArchiveByteStream` in scope
The Xcode Developer Documentation has a detailed explanations of Apple Archive, including: Decompressing Single Files Decompressing and Extracting an Archived Directory Decompressing and Parsing an Archived String Your example code snippets may have become outdated (or may just be incomplete), but it builds cleanly for me, except for the handling of the "defer" statements. import AppleArchive import System func testDecompressStream(readFileStream: ArchiveByteStream) { guard let decompressStream = ArchiveByteStream.decompressionStream(readingFrom: readFileStream) else { return } defer { try? decompressStream.close() } } Xcode 13.2 (13C90)
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Dec ’21