{"id":25976055,"url":"https://github.com/cewitte/bookworm","last_synced_at":"2026-04-22T05:34:26.204Z","repository":{"id":280018440,"uuid":"939638659","full_name":"cewitte/Bookworm","owner":"cewitte","description":"Paul Hudson's (@twostraws) 100 Days of SwiftUI Project 11.","archived":false,"fork":false,"pushed_at":"2025-06-05T23:16:56.000Z","size":54303,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-05T23:29:58.732Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cewitte.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-02-26T21:31:04.000Z","updated_at":"2025-06-05T23:16:57.000Z","dependencies_parsed_at":"2025-06-05T23:35:47.964Z","dependency_job_id":null,"html_url":"https://github.com/cewitte/Bookworm","commit_stats":null,"previous_names":["cewitte/bookworm"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/cewitte/Bookworm","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cewitte%2FBookworm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cewitte%2FBookworm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cewitte%2FBookworm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cewitte%2FBookworm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cewitte","download_url":"https://codeload.github.com/cewitte/Bookworm/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cewitte%2FBookworm/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32122769,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-22T00:31:26.853Z","status":"online","status_checked_at":"2026-04-22T02:00:05.693Z","response_time":58,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-03-05T03:34:10.145Z","updated_at":"2026-04-22T05:34:26.199Z","avatar_url":"https://github.com/cewitte.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Bookworm\n\nPaul Hudson's ([@twostraws](https://x.com/twostraws)) 100 Days of Swift UI Project 11.\n\n## Project 11\n\nSource URL: [Bookworm: Introduction](https://www.hackingwithswift.com/books/ios-swiftui/bookworm-introduction)\n\n\"In this project we’re going to build an app to track which books you’ve read and what you thought of them, and it’s going to follow a similar theme to project 10: let’s take all the skills you’ve already mastered, then add some bonus new skills that take them all to a new level.\n\nThis time you’re going to meet `SwiftData`, which is Apple’s framework for working with databases. This project will serve as an introduction for `SwiftData`, but we’ll be going into much more detail soon.\n\nAt the same time, we’re also going to build our first custom user interface component – a star rating widget where the user can tap to leave a score for each book. This will mean introducing you to another property wrapper, called `@Binding` – trust me, it will all make sense.\"\n\n![Bookworm](/images/Bookworm_animation.gif)\n\n\u003c\u003c\u003c\u003c\u003c\u003c\u003c HEAD\n### Challenge 1\n\nBranch: `challenge-1`\n\nRight now it’s possible to select no title, author, or genre for books, which causes a problem for the detail view. Please fix this, either by forcing defaults, validating the form, or showing a default picture for unknown genres – you can choose.\n\n![Challenge 1](/images/challenge_1.gif)\n\n### Challenge 2\n\nBranch: `challenge-2`\n\nModify `ContentView` so that books rated as 1 star are highlighted somehow, such as having their name shown in red.\n\n![Challenge 2](/images/challenge_2.gif)\n\n### Challenge 3\n\nBranch: `challenge-3`\n\nAdd a new “date” attribute to the `Book` class, assigning `Date`.now to it so it gets the current date and time, then format that nicely somewhere in `DetailView`.\n\n## Accessibility support\n\nAdded Paul's code to add accessibility support:\n\n```swift\n.accessibilityElement()\n.accessibilityLabel(label)\n.accessibilityValue(rating == 1 ? \"1 star\" : \"\\(rating) stars\")\n.accessibilityAdjustableAction { direction in\n    switch direction {\n    case .increment:\n        if rating \u003c maximumRating { rating += 1 }\n    case .decrement:\n        if rating \u003e 1 { rating -= 1 }\n    default:\n        break\n    }\n}\n```\n\n\u003eThat groups all its children together, applies the label “Rating”, but then adds a value based on the current stars. It also allows that rating value to be adjusted up or down using swipes, which is much better than trying to work through lots of individual images.\n\n### Acknowledgments\n\nOriginal code created by: [Paul Hudson - @twostraws](https://x.com/twostraws) (Thank you!)\n\nMade with :heart: by [@cewitte](https://x.com/cewitte)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcewitte%2Fbookworm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcewitte%2Fbookworm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcewitte%2Fbookworm/lists"}