Skip to content

Latest commit

 

History

History

day-069

Day 69: Project 19: JavaScript Injection, Part Three

This day covers the third and final part of Project 19: JavaScript Injection in Hacking with Swift. Follow along at https://www.hackingwithswift.com/100/69.

📒 Field Notes

I previously created projects alongside Hacking with Swift in a separate repository, and you can find Project 19 here. Even better, though, I copied it over to Day 67's folder so I could extend it for 100 Days of Swift.

With that in mind, Day 69 focuses on extending the project with a set of challenges.

🥅 Challenges

Challenge 1

Add a bar button item that lets users select from a handful of pre-written example scripts, shown using a UIAlertController – at the very least your list should include the example we used in this project.

Challenges 2 and 3

You're already receiving the URL of the site the user is on, so 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.

For something bigger, let users name their scripts, then select one to load using a UITableView.

📸 Screenshots