Post

Replies

Boosts

Views

Activity

Main actor-isolated instance method 'locationManagerDidChangeAuthorization' cannot be used to satisfy nonisolated protocol requirement
I'm going through the migration to Swift 6 and I am running up with a few things. I have two view controllers which conform to the CLLocationManagerDelegate protocol. Both methods of the delegate have the same issue in my code. Below is an example of the warning received. Main actor-isolated instance method 'locationManagerDidChangeAuthorization' cannot be used to satisfy nonisolated protocol requirement; this is an error in the Swift 6 language mode
4
1
6.8k
Jul ’24
@ObservedObject Issue
I have a major issue with @ObservedObject.I have the following statement@ObservedObject var model: UserDatain a good number of views and before Beta 5, I did not have to pass this variable into the preview, nor did I have to pass his variable into other views which already have the above statement.But now I do have to and it's a mess. Is there anyway around this?
13
0
8.5k
Dec ’22
SwiftUI Gobbling Up CPU
I have beel fiddling with SwiftUI and it has taken up a huge amount of CPU %. Has anybody else experienced this? It it takes forever to build. I think I have it confused.My Xcode is shut down, but I still have two swift processes running at 98%.Something wrong here....
9
0
8.0k
Mar ’22
Apple CloudKit async function Doesn't Look Right
The function in question is the following. func records(for ids: [CKRecord.ID], desiredKeys: [CKRecord.FieldKey]? = nil) async throws -> [CKRecord.ID : Result<CKRecord, Error>] Note that the returned value looks like a dictionary of the form [CKRecord.ID : Result<CKRecord, Error>], but the input is an array of CKRecord.IDs. There are similar functions, but they return a tuple. Like the below example. func records(matching query: CKQuery, inZoneWith zoneID: CKRecordZone.ID? = nil, desiredKeys: [CKRecord.FieldKey]? = nil, resultsLimit: Int = CKQueryOperation.maximumResults) async throws -> (matchResults: [(CKRecord.ID, Result<CKRecord, Error>)], queryCursor: CKQueryOperation.Cursor?) Note that matchedResults is an array of tuples consisting of [(CKRecord.ID, Result<CKRecord, Error>)]. I would have thought that the return type in the first function would also be of the form [(CKRecord.ID, Result<CKRecord, Error>)]. What am I missing?
1
0
1.4k
Jan ’22
UIBarButtonItem With Image Breaks Constraints
I have a UIViewController wherein I set nav items, basically the title and the rightBarButtonItem. I use a SF Symbol for the image. The code is extremely simple. Here it is. func setupNavItem() {         self.navigationItem.title = "Problem in This View"                  let helpImage = UIImage(systemName: "questionmark.circle")         let rightBarItem = UIBarButtonItem(image: helpImage, style: .plain, target: self, action: #selector(showHideHelp))         navigationItem.rightBarButtonItem = rightBarItem     } When I navigate into this view, all heck breaks loose with the constraints. What gives? I'm using Xcode Version 14.0 beta 3 (14A5270f). See the constraint info below. 2022-07-18 16:58:59.998394-0400 NavBarItemExample[28793:996095] [LayoutConstraints] Unable to simultaneously satisfy constraints. Probably at least one of the constraints in the following list is one you don't want.  Try this:  (1) look at each constraint and try to figure out which you don't expect;  (2) find the code that added the unwanted constraint or constraints and fix it.      "<NSLayoutConstraint:0x600000a79810 UIImageView:0x136d28790.width <= _UIModernBarButton:0x136d274b0.width   (active)>",     "<NSLayoutConstraint:0x600000a7af80 '_UITemporaryLayoutWidth' _UIButtonBarButton:0x136d27280.width == 0   (active)>",     "<NSLayoutConstraint:0x600000a793b0 'IB_Leading_Leading' H:|-(>=11)-[_UIModernBarButton:0x136d274b0]   (active, names: '|':_UIButtonBarButton:0x136d27280 )>",     "<NSLayoutConstraint:0x600000a79400 'IB_Trailing_Trailing' H:[_UIModernBarButton:0x136d274b0]-(8)-|   (active, names: '|':_UIButtonBarButton:0x136d27280 )>" ) Will attempt to recover by breaking constraint  <NSLayoutConstraint:0x600000a79810 UIImageView:0x136d28790.width <= _UIModernBarButton:0x136d274b0.width   (active)> Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger.
3
0
1.2k
Jul ’22
NavigationStack - No Back Button
I created a very simple project with a NavigationStack and a NavigationLink as follows. Code 1. NavigationLink("Go To Next View", value: "TheView")          .navigationDestination(for: String.self) { val in Text("Value = \(val)")          } This code works fine in the simple project. But when I put this simple code into my existing app's project using a NavigationStack, it navigates to the next view fine, but there is no back button. I am updating my Apple Watch target to use SwiftUI and I want to use NavigationStack. My app does use @ObservedObject and my important data is using @Publish in a singleton class which conforms to ObservableObject. But this NavigationLink code, Code 1, is extremely simple and should work fine, but it does not. The same problem happens with the following code. Code 2 NavigationLink { NextView() } label: {     MainRowView(rowText: "Saved") } When I switch to NavigationView, Code 1 is grayed out, but Code 2 works fine and has a back button. However, as you know, NavigationView is being deprecated, so I really need to fix this or have it fixed. I can't see how this could be a problem with my code as the code snippet is so simple and worked in the simple project.
4
0
2.6k
Aug ’22
iCloud Private Relay Messes Up Map Search on macOS
I'm using my Mac and have macOS 13.0. I searched for 'Vinyl Record Shops' and 'Search Nearby' with Private Relay Enabled and the Map moved to Denver, Colorado while I am in Orlando, Florida. When I disable Private Relay, the search did take me to Orlando, Florida, but when I disabled it just now, it took me to Dallas / Ft Worth. I have 'Maintain General Location' selected. I don't have this issue with iOS 16.1 on my iPhone. Anybody else have this problem?
1
0
652
Nov ’22
CKAssets Download Even When desiredKeys Excludes Them
I have an app with a CloudKit Public Database in which a CKRecord can contain a CKAsset or two that holds the url of image data. I don't want to always obtain the image data so my desiredKeys excludes the CKAsset key in the CKRecord in that case. I use the following Swift function. var (matchResults, queryCursor) = try await database.records(matching: query, desiredKeys: desiredKeys) The desiredKeys variable could be an array of strings with the keys of CKRecord fields I want to return or nil if I want all of the data including the asset data. After I have the records, I do the following. if let imageAsset = record["ImageAsset"] as? CKAsset, let url = imageAsset.fileURL, let data = try? Data(contentsOf: url) { self.imageData = data } However, when I exclude the "ImageAsset" key from the desiredKeys array, my if let imageAsset contains the asset information. Looking at the received data, I can see that other keys that I exclude are not being downloaded, but the CKAsset url appears to be downloaded. Why? I expected that the if let would have been nil and the code within the if let would not have been executed.
3
0
988
May ’23
Apple Vision Pro Development Without the $299 Dongle?
Question. Is there a way to hook up the Apple Vision Pro to the Mac for development without using the $299 dongle? I was thinking of a USB-C cable from the battery to the Mac. Someone mentioned wireless, but usually one has to connect first.
Replies
5
Boosts
0
Views
5.2k
Activity
Jun ’24
Main actor-isolated instance method 'locationManagerDidChangeAuthorization' cannot be used to satisfy nonisolated protocol requirement
I'm going through the migration to Swift 6 and I am running up with a few things. I have two view controllers which conform to the CLLocationManagerDelegate protocol. Both methods of the delegate have the same issue in my code. Below is an example of the warning received. Main actor-isolated instance method 'locationManagerDidChangeAuthorization' cannot be used to satisfy nonisolated protocol requirement; this is an error in the Swift 6 language mode
Replies
4
Boosts
1
Views
6.8k
Activity
Jul ’24
@ObservedObject Issue
I have a major issue with @ObservedObject.I have the following statement@ObservedObject var model: UserDatain a good number of views and before Beta 5, I did not have to pass this variable into the preview, nor did I have to pass his variable into other views which already have the above statement.But now I do have to and it's a mess. Is there anyway around this?
Replies
13
Boosts
0
Views
8.5k
Activity
Dec ’22
SwiftUI Gobbling Up CPU
I have beel fiddling with SwiftUI and it has taken up a huge amount of CPU %. Has anybody else experienced this? It it takes forever to build. I think I have it confused.My Xcode is shut down, but I still have two swift processes running at 98%.Something wrong here....
Replies
9
Boosts
0
Views
8.0k
Activity
Mar ’22
Cannot Download Xcode 13.2 beta
I get the following. 403 Forbidden Anybody else have this problem?
Replies
2
Boosts
0
Views
1k
Activity
Oct ’21
Apple CloudKit async function Doesn't Look Right
The function in question is the following. func records(for ids: [CKRecord.ID], desiredKeys: [CKRecord.FieldKey]? = nil) async throws -> [CKRecord.ID : Result<CKRecord, Error>] Note that the returned value looks like a dictionary of the form [CKRecord.ID : Result<CKRecord, Error>], but the input is an array of CKRecord.IDs. There are similar functions, but they return a tuple. Like the below example. func records(matching query: CKQuery, inZoneWith zoneID: CKRecordZone.ID? = nil, desiredKeys: [CKRecord.FieldKey]? = nil, resultsLimit: Int = CKQueryOperation.maximumResults) async throws -> (matchResults: [(CKRecord.ID, Result<CKRecord, Error>)], queryCursor: CKQueryOperation.Cursor?) Note that matchedResults is an array of tuples consisting of [(CKRecord.ID, Result<CKRecord, Error>)]. I would have thought that the return type in the first function would also be of the form [(CKRecord.ID, Result<CKRecord, Error>)]. What am I missing?
Replies
1
Boosts
0
Views
1.4k
Activity
Jan ’22
UIBarButtonItem With Image Breaks Constraints
I have a UIViewController wherein I set nav items, basically the title and the rightBarButtonItem. I use a SF Symbol for the image. The code is extremely simple. Here it is. func setupNavItem() {         self.navigationItem.title = "Problem in This View"                  let helpImage = UIImage(systemName: "questionmark.circle")         let rightBarItem = UIBarButtonItem(image: helpImage, style: .plain, target: self, action: #selector(showHideHelp))         navigationItem.rightBarButtonItem = rightBarItem     } When I navigate into this view, all heck breaks loose with the constraints. What gives? I'm using Xcode Version 14.0 beta 3 (14A5270f). See the constraint info below. 2022-07-18 16:58:59.998394-0400 NavBarItemExample[28793:996095] [LayoutConstraints] Unable to simultaneously satisfy constraints. Probably at least one of the constraints in the following list is one you don't want.  Try this:  (1) look at each constraint and try to figure out which you don't expect;  (2) find the code that added the unwanted constraint or constraints and fix it.      "<NSLayoutConstraint:0x600000a79810 UIImageView:0x136d28790.width <= _UIModernBarButton:0x136d274b0.width   (active)>",     "<NSLayoutConstraint:0x600000a7af80 '_UITemporaryLayoutWidth' _UIButtonBarButton:0x136d27280.width == 0   (active)>",     "<NSLayoutConstraint:0x600000a793b0 'IB_Leading_Leading' H:|-(>=11)-[_UIModernBarButton:0x136d274b0]   (active, names: '|':_UIButtonBarButton:0x136d27280 )>",     "<NSLayoutConstraint:0x600000a79400 'IB_Trailing_Trailing' H:[_UIModernBarButton:0x136d274b0]-(8)-|   (active, names: '|':_UIButtonBarButton:0x136d27280 )>" ) Will attempt to recover by breaking constraint  <NSLayoutConstraint:0x600000a79810 UIImageView:0x136d28790.width <= _UIModernBarButton:0x136d274b0.width   (active)> Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger.
Replies
3
Boosts
0
Views
1.2k
Activity
Jul ’22
Xcode Accounts Apple ID Unexpected Status Code
I'm getting this when I go to Accounts on Xcode and click on why Apple ID. I'm getting this on the current version and latest beta of Xcode. It's very disheartening. Anybody know what causes this?
Replies
1
Boosts
0
Views
691
Activity
Jul ’22
NavigationStack - No Back Button
I created a very simple project with a NavigationStack and a NavigationLink as follows. Code 1. NavigationLink("Go To Next View", value: "TheView")          .navigationDestination(for: String.self) { val in Text("Value = \(val)")          } This code works fine in the simple project. But when I put this simple code into my existing app's project using a NavigationStack, it navigates to the next view fine, but there is no back button. I am updating my Apple Watch target to use SwiftUI and I want to use NavigationStack. My app does use @ObservedObject and my important data is using @Publish in a singleton class which conforms to ObservableObject. But this NavigationLink code, Code 1, is extremely simple and should work fine, but it does not. The same problem happens with the following code. Code 2 NavigationLink { NextView() } label: {     MainRowView(rowText: "Saved") } When I switch to NavigationView, Code 1 is grayed out, but Code 2 works fine and has a back button. However, as you know, NavigationView is being deprecated, so I really need to fix this or have it fixed. I can't see how this could be a problem with my code as the code snippet is so simple and worked in the simple project.
Replies
4
Boosts
0
Views
2.6k
Activity
Aug ’22
NavigationStack - Missing Back Buttons
I have a project where I am upgrading my Apple Watch app to use SwiftUi and the SwiftUI lifecycle. For some reason, my destination views are missing the back button (<) and the navigation title. It all works fine with NavigationView, but I definitely want to go to NavigationStack and use the new API.
Replies
5
Boosts
0
Views
1.4k
Activity
Aug ’22
How to Create Scrolling Like in the Apple Watch Workout App Using SwiftUI
This is probably a simple question, but how can one have scrolling in one's Apple Watch app like that in the Workout App using SwiftUI? The scrolling which emphasizes each item as it scrolls by. I'm trying to recall, but can't.
Replies
1
Boosts
0
Views
1.1k
Activity
Sep ’22
Mistake in Wayfinder Watch Face for Apple Watch Ultra?
I think that there is a mistake in the Wayfinder watch face for Apple Watch Ultra. Note that in my picture, longitude shows '-81.54327 W', but because W is used, longitude should be either 81.54327 W or just -81.54327.
Replies
3
Boosts
0
Views
1.9k
Activity
Sep ’22
iCloud Private Relay Messes Up Map Search on macOS
I'm using my Mac and have macOS 13.0. I searched for 'Vinyl Record Shops' and 'Search Nearby' with Private Relay Enabled and the Map moved to Denver, Colorado while I am in Orlando, Florida. When I disable Private Relay, the search did take me to Orlando, Florida, but when I disabled it just now, it took me to Dallas / Ft Worth. I have 'Maintain General Location' selected. I don't have this issue with iOS 16.1 on my iPhone. Anybody else have this problem?
Replies
1
Boosts
0
Views
652
Activity
Nov ’22
Request Help (If Possible) on Non-Sendable CloudKit Function
I have burned the midnight, no, 2 AM oil to knock out the ton of Sendable warnings on my app. I have worked the issues, but have two functions remaining where I am stuck. The functions are both CloudKit functions. One of them is shown in the image. I am at a loss on how to clear this warning. Any amount of help would be most appreciated.
Replies
1
Boosts
0
Views
627
Activity
Apr ’23
CKAssets Download Even When desiredKeys Excludes Them
I have an app with a CloudKit Public Database in which a CKRecord can contain a CKAsset or two that holds the url of image data. I don't want to always obtain the image data so my desiredKeys excludes the CKAsset key in the CKRecord in that case. I use the following Swift function. var (matchResults, queryCursor) = try await database.records(matching: query, desiredKeys: desiredKeys) The desiredKeys variable could be an array of strings with the keys of CKRecord fields I want to return or nil if I want all of the data including the asset data. After I have the records, I do the following. if let imageAsset = record["ImageAsset"] as? CKAsset, let url = imageAsset.fileURL, let data = try? Data(contentsOf: url) { self.imageData = data } However, when I exclude the "ImageAsset" key from the desiredKeys array, my if let imageAsset contains the asset information. Looking at the received data, I can see that other keys that I exclude are not being downloaded, but the CKAsset url appears to be downloaded. Why? I expected that the if let would have been nil and the code within the if let would not have been executed.
Replies
3
Boosts
0
Views
988
Activity
May ’23