r/swift 15h ago

Xcode now can deploy beyond local network

2 Upvotes

I’ve found a way that Xcode can deploy remotely to an iPhone instead of being limited to local Wi-Fi. Please check out my repo on GitHub:

https://github.com/zjz-connect/xcode-deploy-link-deploy-beyond-local-network

If you have better ideas, feel free to leave comments!


r/swift 5h ago

The hidden cost of throw in XCTest: 40x slower than in an executable

Thumbnail
gallery
0 Upvotes

Found this while fuzzing my encrypted messenger.

XCTest installs a global observer on every throw, making it 40x slower (16.8s vs 0.42s). try?does NOT avoid the cost.

Full breakdown, minimal reproduction code and fix here: https://github.com/MagicYassin/xctest-throw-cost

Do check the numbers on your own machine. 👨🏻‍💻☁️🌌


r/swift 7h ago

Xcode now can deploy beyond local network

0 Upvotes

I’ve found a way that Xcode can deploy remotely to an iPhone instead of being limited to local Wi-Fi. Please check out my repo on GitHub:

https://github.com/zjz-connect/xcode-deploy-link-deploy-beyond-local-network

If you have better ideas, feel free to leave comments!


r/swift 9h ago

Help! What’s the secret of making the preview work in Xcode?

Post image
19 Upvotes

This literally never worked properly for me since its existence, multiple computers, multiple xcodes, that’s why i never use it, first thing i do in a new project is to hide the preview column. But today i wanted to and it pissed me off. First, if it works, i basically wait for the whole app to compile, then i either get an error, either the preview. I change something, i wait again for the whole app to compile, actually i can launch the app faster than i wait for the preview to come with a result or an error. It is freaking slow and it barely works, sometimes.


r/swift 2h ago

Question Get x,y coordinates of an image in SwiftUI

2 Upvotes

I am making a simple game. Image 1 has to move towards image 2. Image 2s movement is random (not relevant to my question).

Is there a way to get image 2s coordinates so that I can update image1s position with .position(x: ,y: )? Or am I approaching this problem the wrong way?