This startLoad function isn't defined in the context of a class or struct, which is what self would refer to.
You could create a class called MyLoader or something, define the function on the type and then create an instance of the type and call the startLoad function on it...
Based on that code above you'll also need a webView property on your MyLoader class, as well as a handleServerError and handleServerError method defined.
Post
Replies
Boosts
Views
Activity
Try now, it seems to have been uploaded!
You can use the Swift Playgrounds Author Template for Xcode, which you can download from here:
https://developer.apple.com/download/more/?=Swift%20Playgrounds%20Author
You'd use this, on your Mac, to create a playground book that you can distribute and run on iPads in Swift Playgrounds.
There's also a session at this year's WWDC to tell you more (and maybe show off a new way to do it?):
https://developer.apple.com/wwdc20/10654
I just ran an online class for kids where we took the Lights, Camera, Code playgrounds (after having gone through the Everyone Can Code Puzzles book -- https://books.apple.com/us/book/everyone-can-code-puzzles/id1481279769 -- with the kids) and used their infrastructure to build apps. They were getting ready to submit something for the Swift Student Challenge (but were a bit too young... you needed to be 16+ in Europe to submit.).
It's a great starting point once you've done the Learn to Code playgrounds!
You can use the Swift Playgrounds Author Template for Xcode, which you can download from here:
https://developer.apple.com/download/more/?=Swift%20Playgrounds%20Author
There's also a session at this year's WWDC to tell you more (and maybe show off a new way to do it?):
https://developer.apple.com/wwdc20/10654
Apple has a really great curriculum on the Book Store called App Development with Swift: https://books.apple.com/book/app-development-with-swift/id1465002990
I highly recommend it... it's a great way to learn the fundamentals and build some projects along the way.