1
0
mirror of https://github.com/flutter/samples.git synced 2026-06-29 01:27:37 +00:00
Files
samples/add_to_app/books/ios_books
Aleksandr Lozhkovoi a6754b4515 Migrate ios_books SceneDelegate for UIScene (#2845)
Part of flutter/flutter#176957

Migrated SceneDelegate.swift to use UI scene using this guideline
https://docs.flutter.dev/release/breaking-changes/uiscenedelegate#migration-guide-for-flutter-apps
for ios_books app

<img width="1931" height="1080" alt="image"
src="https://github.com/user-attachments/assets/425f7cee-205b-4cf5-82fa-d95ff8227c1e"
/>

While testing this sample locally, I noticed a separate existing issue
in `IosBooks/ViewController.swift`: the Google Books response is
force-unwrapped. The unauthenticated request currently returns HTTP
429/quota errors in some environments, so `json["items"] as! [[String:
Any]]` can crash at runtime.

I kept this PR scoped to the UIScene migration only, but I can file or
send a separate follow-up to make the sample parse the API response
defensively, WDYT?


## Pre-launch Checklist

- [x] I read the [Flutter Style Guide] _recently_, and have followed its
advice.
- [x] I signed the [CLA].
- [x] I read the [Contributors Guide].
- [x] I have added sample code updates to the [changelog].
- [x] I updated/added relevant documentation (doc comments with `///`).


If you need help, consider asking for advice on the #hackers-devrel
channel on [Discord].

<!-- Links -->
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/master/docs/contributing/Style-guide-for-Flutter-repo.md
[CLA]: https://cla.developers.google.com/
[Discord]:
https://github.com/flutter/flutter/blob/master/docs/contributing/Chat.md
[Contributors Guide]:
https://github.com/flutter/samples/blob/main/CONTRIBUTING.md
[changelog]: ../CHANGELOG.md

Co-authored-by: Eric Windmill <eric@ericwindmill.com>
2026-06-19 16:30:12 -07:00
..