Table of Contents
One of the biggest arguments for using SwiftUI for developing our Apps is the interoperability with UIKit. Although SwiftUI does a good job of providing many of UIKit’s UIView subclasses, it doesn’t have them all yet at this time.
If you have a problem making something with pure SwiftUI, you can always wrap the UIKit view and put it in the SwiftUI app in just a dozen lines of code. Fortunately, it’s not hard to create custom wrappers for a UIView that you want. It is as simple as creating a struct that conforms to UIViewRepresentable.
You should have some preliminary knowledge about UIKit to be able to go through this activity.
-
Clone the repo
git clone https://github.com/developer-academy-unina/Workshop-Integrating-UIKit-in-SwiftUI
-
Open the
.xcodeproj
file
This project is at the core of the activity presented and shows how to can create a layered and customized sheet experience in SwiftUI using UIKit component, building a non-modal experience using a UISheetPresentationController (a UIPresentationController subclass).
You've found a bug in the source code, a mistake in the documentation or maybe you'd like a new feature? Take a look at GitHub Discussions to see if it's already being discussed. You can help us by submitting an issue on GitHub. Before you create an issue, make sure to search the issue archive -- your issue may have already been addressed!
Please try to create bug reports that are:
- Reproducible. Include steps to reproduce the problem.
- Specific. Include as much detail as possible: which version, what environment, etc.
- Unique. Do not duplicate existing opened issues.
- Scoped to a Single Bug. One bug per report.
Reach out to the maintainer at one of the following places:
- GitHub Discussions
- GitHub issues
- Contact a Mentor for any other help
The original setup of this repository is by Giovanni Monaco.
For a full list of all authors and contributors, see the contributors page.
This project is licensed under the MIT License.
See LICENSE for more information.