Advertisement
Guest User

Untitled

a guest
Oct 15th, 2019
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.25 KB | None | 0 0
  1. func calcSize<T: View>(views: [T], fitting: CGSize) -> CGSize {
  2. let stack = HStack(spacing: 0) {
  3. ForEach(views.indices) {r in views[r]}
  4. }
  5. let renderer = UIHostingController(rootView: stack)
  6. return renderer.sizeThatFits(in: fitting)
  7. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement