https://github.com/chicio/use-uikit-in-swiftui
An example of UIViewRepresentable and UIViewControllerRepresentable create for my blog post "Use UIKit components in SwiftUI: UIViewControllerRepresentable and UIViewRepresentable" :iphone::baby_chick:
https://github.com/chicio/use-uikit-in-swiftui
Last synced: about 1 year ago
JSON representation
An example of UIViewRepresentable and UIViewControllerRepresentable create for my blog post "Use UIKit components in SwiftUI: UIViewControllerRepresentable and UIViewRepresentable" :iphone::baby_chick:
- Host: GitHub
- URL: https://github.com/chicio/use-uikit-in-swiftui
- Owner: chicio
- License: mit
- Created: 2020-05-20T16:44:51.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2021-12-28T08:34:07.000Z (over 4 years ago)
- Last Synced: 2025-04-23T15:15:00.151Z (about 1 year ago)
- Language: Swift
- Homepage: https://www.fabrizioduroni.it/blog/
- Size: 73.2 KB
- Stars: 8
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Use UIKit In SwiftUI
[](https://raw.githubusercontent.com/chicio/Use-UIKit-In-SwiftUI/master/LICENSE.md)
[](https://img.shields.io/badge/platforms-iOS-orange.svg)
A sample project for my blog post post [Use UIKit components in SwiftUI: UIViewControllerRepresentable and UIViewRepresentable](https://www.fabrizioduroni.it/2020/07/02/expose-uikit-to-swiftui/), where I show
how you can use UIKit based components inside a SwiftUI project.
### Description
This is a quote from the post:
> ... But as a consequence of the fact that UIKit has been with us [for almost twelve years](https://en.wikipedia.org/wiki/IOS_SDK) and there are millions of apps already publish on the app store, a lot of developers have tons of UKit based library and custom components. Another interesting point is the fact that at the moment of this writing a lot of UIKit components from the iOS SDK are [missing a counterpart in SwiftUI](https://www.hackingwithswift.com/quick-start/swiftui/answering-the-big-question-should-you-learn-swiftui-uikit-or-both "uikit missing swiftui").
Anyway, you are just starting to develop a new app and you want to create it in SwiftUI (targeting only for iOS 13 because, you know, SwiftUI is compatible only with it :laughing:) without losing the ability to speed up you development by reusing your UIKit based libraries and components. Is there a solution to this problem? Yes!! :relaxed:
In this post I will show you how you can leverage the power of `UIViewRepresentable` and `UIViewControllerRepresentable` protocols to expose your UIKit views and controller as standard SwiftUI components...
Click on the link above to read the posts.