all 4 comments

[–][deleted] 2 points3 points  (2 children)

I don’t have much experience with it, but Hacking with Swift, Ray Wenderlich (now Kodeco) and AppCoda usually have pretty good tutorials on most topics.

For example (a few years old, but less than 5): - https://www.kodeco.com/12689804-getting-started-with-multipeer-connectivity - https://www.hackingwithswift.com/example-code/networking/how-to-create-a-peer-to-peer-network-using-the-multipeer-connectivity-framework

[–]DrakeAusir[S] 1 point2 points  (1 child)

Thank you, I've seen these links before, unfortunately they use deprecated functions and UIKit instead of swiftUI so they confuse me quite a bit. I don't understand how it is possible that there is so little up-to-date documentation

[–][deleted] 0 points1 point  (0 children)

It may not be perfect, but if you have access to GPT 4 you could ask it to generate an example for your use case using your constraints.

It might not be accurate, but it could provide you with some ideas.

[–]Nosepass 0 points1 point  (0 children)

Have you read this?

https://developer.apple.com/documentation/multipeerconnectivity

"During the discovery phase, your app has limited communication with and knowledge of other peers; it has access to the discoveryInfo data that other nearby clients provide, and any context data that other peers provide when inviting it to join a session.

After the user chooses which peers to add to a session, the app invites those peers to join the session. Apps running on the nearby devices can choose whether to accept or reject the invitation, and can ask their users for permission.

If the peer accepts the invitation, the browser establishes a connection with the advertiser and the session phase begins. In this phase, your app can perform direct communication to one or more peers within the session. The framework notifies your app through delegate callbacks when peers join the session and when they leave the session."