IOS App for control hardware through WIFI or WEB

Hi,
I am new to this and this is my first IOS App. I am continually watching codewithchris YouTube and it is very impressive and motivate me to create an App.
I am looking for example code Swift to read and write a byte from a remote hardware (Arduino Board) through WIFI or through URL.
Example: I want to switch on a LED remotely and see the status of the LED back on my IOS App on my iPhone. Could anybody help me?

Welcome to the community @Wasa

This is a very old tutorial so I’m not sure it will work.

https://www.sparkfun.com/tutorials/152

This one may be better, it’s newer, and raywenderlich is a great resource. https://www.raywenderlich.com/2164-arduino-tutorial-integrating-bluetooth-le-and-ios-with-swift

But if I were you I’d take more time to understand iOS development before jumping into this, because this is dealing with other libraries and concepts you may not fully understand yet

Hi Mik,
Really appreciate your reply and advice. When I get a chance I’ll try to understand this and get back to you.
Many Thanks again
Kind regards
Wasa

1 Like

Hi Mik,
I tried your example and fix most of the bugs. Now finally when I am going to build, it says

“SWIFT_VERSION ‘3.0’ is unsupported, supported versions are: 4.0, 4.2, 5.0”

I have Catalina Version 10.15.4 and Xcode 11.4.1 installed in my MacBook.
Really appreciate your help in advance.

Hi Wasa,

The error means that the code you are using is too old.
The code has legacy Swift 3 syntax, but not the modern ones.
You should search for a Swift 3 to Swift 4 or 5 converter(I can’t find one, but there is an alternative method: Stack Overflow Convert from swift 3 to 5)
What you do is download Xcode 10.1, paste the legacy code, convert the code to Swift 4, open Xcode 11, paste the Swift 4 code, and optionally, convert to Swift 5.
I know that might be a bit wordy, but that’s me summarizing the StackOverflow question answer.

Best of Luck,
Ben

Great!
I’ll try and let you know the progress.
Thanks heaps Ben.