Closed K1NXZ closed 2 years ago
I haven’t looked deeply into the UIHostingConfiguration
yet but I imagine that might be difficult to backport actually. It requires a lot more understanding and access (I think) to the underlying SwiftUI components. But I’ll definitely explore it.
I have been working on a CollectionList
custom layout view that could solve these types of issues, but its still a WIP.
I'll strikeout the above as I completely mis-remembered what UIHostingConfiguration
was.
I did actually see this mentioned at WWDC I recall now, and its pretty nice to make it easier for UIKit users to bring SwiftUI into their code. However, that's not exactly the purpose of this library. This feels more like I'd be back porting UIKit in order to support this.
That being said, I am (as mentioned above) working on something related to UICollectionView
that does require me to wrap SwiftUI view's in cells. So if there is even a lightweight version of this that could be useful in this library, I'll include it and let you know 👍
Good news @K1NXZ, I managed to get most of this working already. I have intentionally left out much of the UIContentConfiguration
APIs since they're only useful if we also backport the whole iOS 14+ API they introduced for configuring cells, which would be a lot of effort.
But I think this still provides a useful and familiar API that should make it just as easy to integrate SwiftUI into cells.
I will test this more thoroughly for a while, but it's looking quite promising. If you have time, I'd love if you could test it out on the branch hosting
Its looking good so far 👍
Merged and released #6 – v1.1.0
Looking great! Unfortunately I didn't have time to test it out yet. I will look into it ASAP.
Looking great! Unfortunately I didn't have time to test it out yet. I will look into it ASAP.
Just tested it, its working pretty well! Good job.
Good to hear! Any issues please raise so I can take a look. Thanks!
@shaps80 do you know how easy it would be to get this working with UITableViewCell
too?
@shaps80 do you know how easy it would be to get this working with
UITableViewCell
too?
@lukeredpath I don't imagine it's very different at all. If you 'copy' the existing implementation I've provided for collection view you are welcome to contribute to the library.
I will eventually get around to it myself, but I don't have time atm.
@lukeredpath good news, 1.6.0 is out now and includes this for you 👍
That’s awesome. Thank you.
Any plans to backport UIHostingConfiguration added in iOS 16 would be great for the beginning to configure cells with SwiftUI.