Skip to content

Commit

Permalink
Make background .clear for the UIHostingController
Browse files Browse the repository at this point in the history
  • Loading branch information
nachonavarro committed Nov 15, 2019
1 parent 48db1f5 commit 15f6582
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
4 changes: 3 additions & 1 deletion Sources/Pages/ModelPages.swift
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,9 @@ public struct ModelPages<Data, Content>: View where Data: RandomAccessCollection
bounce: bounce,
wrap: wrap,
controllers: (0..<items.count).map { i in
UIHostingController(rootView: template(i, items[i]))
let h = UIHostingController(rootView: template(i, items[i]))
h.view.backgroundColor = .clear
return h
}
)
if self.hasControl {
Expand Down
6 changes: 5 additions & 1 deletion Sources/Pages/Pages.swift
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,11 @@ public struct Pages: View {
transitionStyle: transitionStyle,
bounce: bounce,
wrap: wrap,
controllers: pages.map { UIHostingController(rootView: $0) }
controllers: pages.map {
let h = UIHostingController(rootView: $0)
h.view.backgroundColor = .clear
return h
}
)
if self.hasControl {
PageControl(
Expand Down

0 comments on commit 15f6582

Please sign in to comment.