Post

Replies

Boosts

Views

Activity

Reply to Pass swift func result to func
Sorry, I copied the autofill.. Here's the definition... func get(request: RESTRequest, listener: RESTOperation.ResultListener?) -> RESTOperation And here's "RestOperation.ResultListener... open class AmplifyOperation<Request: AmplifyOperationRequest, Success, Failure: AmplifyError>: AsynchronousOperation {     /// The concrete Request associated with this operation     public typealias Request = Request     /// The concrete Success type associated with this operation     public typealias Success = Success     /// The concrete Failure type associated with this operation     public typealias Failure = Failure     /// Convenience typealias defining the `Result`s dispatched by this operation     public typealias OperationResult = Result<Success, Failure>     /// Convenience typealias for the `listener` callback submitted during Operation creation     public typealias ResultListener = (OperationResult) -> Void Hoping that helps clarify things? I didn't post all the code as it's not mine...
Topic: Programming Languages SubTopic: Swift Tags:
Nov ’21
Reply to Pass swift func result to func
Thanks @claude31. Any example code you can give here would be much appreciated.. For more clarity, currently my code looks like this... Amplify.API.get (request:request) { result in switch result { case .success(let data): // Do success stuff case .failure(let apiError): // Do failure stuff } } I'm looking to handle that switch block in another function. So I need to change the above to something like this below (with obviously the correct syntax. Example code here would be helpful... Amplify.API.get (request:request) { myFunction(result, myParam1, myParam2) } It believe it may have something to do with the listener parameter from the Amplify.API.get function definition but I'm not sure how to do that while still adding in my parameters to my function call.
Topic: Programming Languages SubTopic: Swift Tags:
Nov ’21
Reply to An unspecified error occurred. A device with number '0e904c6d3**********83a9' already exists on this team.
I am having the same problem with a new project I created. My device, on the developer portal, seems to be stuck in "processing". It's been 24 hours. Exact error in the Xcode Signing & Capabilities tab in my project shows 2 error under status.. A device with number 'XXXX801C' already exists on this team. Provisioning profile "iOS Team Provisioning Profile: [my project bundle]" doesn't include the currently selected device "Etep iPhone" (identifier XXXX8801C).
May ’25
Reply to Device with Number Already exists on this Team
I was finally bale to resolve this by removing all the devices on the developer portal. I had the option (alert at the top of the screen in the devices section of the portal) to update my list of devices on my developer account. Many of these devices were very old so I chose to go through and remove devices. Luckily my new iPhone that was stuck in processing was also there. So I was able to remove it as well. Once I did this, I was able to get Xcode to register the device properly. I'm wondering if my account as a whole was stuck in limbo because I hadn't gone through and cleaned up the device list? Long shot theory but thought I would put it out there. Of course, if you have a new account, or this option isn't available, this solution won't work. Would look forward to hearing if there are any other solutions out there for future.
May ’25
Reply to MapKit with MKTileOverlay Crashes After a Time
I've done some more experimenting. I'm now creating overlays for each timestamp (12 of them) along with the renderers. I then set all renderer alpha to 0 except the one which overlay I want to show at that moment which I set to 0.5 alpha. Then I just cycle through the overlays setting their renderer's alpha. Makes for a very smooth animation. Then every minute I reload the data, remove all the overlays, and create new ones with the new data. In production I'd do this every 10 minutes but to test this I do it every 60 seconds. This bug is still coming up. Again it takes about 20 to 60 minutes for it to occur. I then tried removing the MapView from its superview and remove all the overlays, and the delegate. I can confirm it is removed by monitoring the memory usage. I then create a new MapView and add it to my ViewController's view as a subView and then remake all the overlays for that new mapView. Memory usage is stable over the testing period. I figured this would clear out any issue with Metal holding on to things. But after about an hour. Same issue. I'm not sure how to proceed now. This is really starting to seem like a bug? I hate to point at that as the issue but I'm at a loss what to do next? I snagged two captures of the gpu debug screen. The numbers on the right I'm not certain what they mean but hoping that might point to something? First, is the image of the GPU hud when I first start things going. Next is the image when the app crashes.
Jun ’25