Advertisement
matt95

navigationBarItems

May 8th, 2020
1,440
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Swift 0.62 KB | None | 0 0
  1. func navigationBarItems<L, C, T>(leading: L, center: C, trailing: T) -> some View where L: View, C: View, T: View {
  2.     self.navigationBarItems(leading:
  3.         HStack{
  4.             HStack {
  5.                 leading
  6.             }
  7.             .frame(width: 100, alignment: .leading)
  8.             Spacer()
  9.             HStack {
  10.                 center
  11.             }
  12.             .frame(width: 130, alignment: .center)
  13.             Spacer()
  14.             HStack {
  15.                 trailing
  16.             }
  17.             .frame(width: 100, alignment: .trailing)
  18.         }
  19.         .frame(width: UIScreen.main.bounds.size.width-32)
  20.     )
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement