Skip to content

Commit

Permalink
[chore]: add comment describing SwiftUIScreen's background color over…
Browse files Browse the repository at this point in the history
…ride (#278)
  • Loading branch information
n8chur authored Mar 29, 2024
1 parent 8a9e6ef commit 15d7d29
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions WorkflowSwiftUIExperimental/Sources/SwiftUIScreen.swift
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,10 @@ private final class ModeledHostingController<Model, Content: View>: UIHostingCon
override func viewDidLoad() {
super.viewDidLoad()

// `UIHostingController`'s provides a system background color by default. In order to
// support `SwiftUIScreen`s being composed in contexts where it is composed within another
// view controller where a transparent background is more desirable, we set the background
// to clear to allow this kind of flexibility.
view.backgroundColor = .clear

setNeedsLayoutBeforeFirstLayoutIfNeeded()
Expand Down

0 comments on commit 15d7d29

Please sign in to comment.