swift-toolkit icon indicating copy to clipboard operation
swift-toolkit copied to clipboard

Restart SwiftUI rewrite

Open stevenzeck opened this issue 1 year ago • 11 comments
trafficstars

This PR is a soft restart of rewriting the TestApp using SwiftUI. It's based on the other swiftui branch, but with minimal changes. None of the code that is changed affects the behavior of the UIKit version and thus can be safely merged into develop.

One thing that is changed for the UIKit version is the iOS Deployment Target now being 16.0.

  • To switch to the SwiftUI based UI, comment out @UIApplicationMain in AppDelegate.swift and uncomment out @main in TestApp.swift.

stevenzeck avatar Jun 29 '24 20:06 stevenzeck

@mickael-menu Any thoughts about the iOS Deployment Target? This build will fail unless we change some SwiftUI code to be iOS 14 compatible (if that's even possible), or bump it up to iOS 15+.

stevenzeck avatar Jun 29 '24 21:06 stevenzeck

Thanks @stevenzeck! We can definitely up the minimum iOS version to 15 or 16 for the Test App. The toolkit must stay at iOS 13 though.

mickael-menu avatar Jul 01 '24 11:07 mickael-menu

Updated to 16. I'm happy with this now.

stevenzeck avatar Jul 02 '24 01:07 stevenzeck

when i try the command "make spm" in your branch, it has error:

ninja@ninja-baidu ~/D/u/TestApp (rewrite-swiftui)> make spm
xcodegen generate Parsing project spec failed: Invalid version: make: *** [spm] Error 1

do you know how to fix this?

CunningMonkey avatar Aug 06 '24 05:08 CunningMonkey

You should be using make dev for this branch, but both that and make spm should work. What version of xcodegen do you have installed? I'm on 2.42. Since I upgraded the iOS version to 16, it might fail on older versions.

stevenzeck avatar Aug 06 '24 22:08 stevenzeck

Hi. Is this PR still in progress? I can help with SwiftUI refactoring in this PR or I can start my own PR

FuzzzzyBoy avatar Oct 12 '24 09:10 FuzzzzyBoy

Hey @FuzzzzyBoy, yep it's still in progress. Any help would be greatly appreciated. Whichever way is easier for you.

stevenzeck avatar Oct 13 '24 02:10 stevenzeck

Read PR more carefully - have some ideas. Maybe easy and fast way make several PR one per each screen instead of full rewrite? what do you think?

FuzzzzyBoy avatar Oct 13 '24 10:10 FuzzzzyBoy

Yes I actually think doing these changes iteratively in many smaller PRs would be more convenient. For example:

  1. PRs to convert XIB and Storyboards of individual screens to SwiftUI.
  2. Once every screen is in SwiftUI, refactor the global UIKit navigation to SwiftUI.

mickael-menu avatar Oct 13 '24 14:10 mickael-menu

I was trying to avoid keeping a separate swiftui branch up to date with develop while also incorporating Swift UI updates. That's what was happening here.

We can try that again though. Just need to be responsive to PRs and review suggestions.

stevenzeck avatar Oct 13 '24 15:10 stevenzeck

https://github.com/readium/swift-toolkit/pull/492 - for example add PR with only about screen refactoring

FuzzzzyBoy avatar Oct 14 '24 18:10 FuzzzzyBoy