NEW: Master Swift design patterns with my latest book! >>

< Previous: Fixing the keyboard: NotificationCenter   Next: Project 17 >

Wrap up

I'll tell you what: I'm feeling tired and I didn't even have to learn anything to write this project – I can't imagine how tired you are! But please don't be too disheartened: this project builds the the bridge between JavaScript and Swift, and now that bridge is built you can add your own Swift functionality on top.

Some of the code isn't pleasant to work with, and certainly I wish iOS would just figure out text view insets automatically for keyboards, but you're through it now so your project is done. Even though this was a hard project, I did cut quite a few corners in this project to make the code as easy as possible, so again I want to encourage you to try creating another extension and see how Apple's example code is different from mine.

If you'd like to make improvements to this project, you could try combining a number of techniques together to make a pretty awesome app.

You're already receiving the URL of the site the user is on, so why not use UserDefaults to save the user's JavaScript for each site? You should convert the URL to a URL object in order to use its host property.

If you wanted to be really fancy, you could let users name their scripts, then select one to load using a UITableView.

You did it! Now what?

You finished another project, and I'm glad Hacking with Swift helped you. Now I need your help. Please take just a moment out of your day to tell others about Hacking with Swift so they can benefit too.

You can click below to post a tweet straight to this project. Or if you're feeling particularly generous, you can click here to link to Hacking with Swift on your website and help spread the word.

Thank you. Your support is what keeps me going!


About the author

Paul Hudson is the creator of Hacking with Swift, the most comprehensive series of Swift books in the world. He's also the editor of Swift Developer News, the maintainer of the Swift Knowledge Base, and Mario Kart world champion. OK, so that last part isn't true. If you're curious you can learn more here.

Become a Swift guru

I wrote a book called Pro Swift that's dedicated to helping you master the Swift language, and it includes seven hours of video demonstrating each technique!

< Previous: Fixing the keyboard: NotificationCenter   Next: Project 17 >
Click here to visit the Hacking with Swift store >>