How do I scan for all devices on a network using Swift?

Hi.

I'm developing a remote control app, and I want to implement a feature where the user can scan for all televisions on the local network to connect to one, then this will be displayed in a Table View.

So is there any way of listing all devices found on the local network?

Thanks.

Answered by Claude31 in 683031022

I would implement a LAN scanner:

https://stackoverflow.com/questions/26996537/list-of-connected-devices-to-local-wifi-network

You could ping the local IP (usually starting 192.168.) and see who's responding.

h t t p s : / / w ww.chriswrites.com/how-to-find-ip-addresses-of-devices-on-your-local-network/

Accepted Answer

I would implement a LAN scanner:

https://stackoverflow.com/questions/26996537/list-of-connected-devices-to-local-wifi-network

You could ping the local IP (usually starting 192.168.) and see who's responding.

h t t p s : / / w ww.chriswrites.com/how-to-find-ip-addresses-of-devices-on-your-local-network/

How do I scan for all devices on a network using Swift?
 
 
Q