Posts

Post not yet marked as solved
1 Replies
364 Views
I have a UIActivityViewController. I want to be able to pass back values from the UIActivity to the CompletionWithItemsHandler using returnedItems. In the UIActivity, I'm using a UIViewController to prompt the user for parameters. How to I set values so they are returned in returnedItems? Thanks!
Posted
by ggilley.
Last updated
.
Post not yet marked as solved
2 Replies
927 Views
I'm trying to create a network request mocking infrastructure for my iOS app. I'm using a mock URLProtocol to do this. My challenge is that I want to load custom data for each URLSession. In my setupWithError() in my unit tests, I basically do:         let config = URLSessionConfiguration.ephemeral         config.protocolClasses = [URLProtocolMock.self]         let session = URLSession(configuration: config)         APIManager.shared.session = session         <session.URLProtocolMock>.loadJSMocks(filename: "AddItemUITest.js") All of the examples I see for doing mocks this way, create static variables in the URLProtocolMock to allow configuring data. I'd like to be able to run tests in parallel, so static variables won't work. I couldn't find an obvious way to get the protocol instance from the URLSession. Is there a non-obvious way? ;-) Thanks! Greg P.S. And in the course of writing this, I realized that I have another problem with static APIManager session sharing. But that one I know how to solve :-)
Posted
by ggilley.
Last updated
.
Post not yet marked as solved
0 Replies
597 Views
In Xcode 12, you could run the debugger on PreviewProviders. That was removed in Xcode 13. Is there a way to get logs for PreviewProviders? I haven't been able to find a way and it's driving me crazy. This is worse than punched cards. At least then, you could do print statements to debug...
Posted
by ggilley.
Last updated
.
Post not yet marked as solved
0 Replies
883 Views
In the video, you show a 'Preview Assets.xcassets' for accessing preview assets. I only saw you reference adding the assets through "Development Assets". Are you using a different version than the current Xcode seed? Or is there another step I need to do to get preview-only assets? Thanks, Greg
Posted
by ggilley.
Last updated
.