Skip to content

Instantly share code, notes, and snippets.

@archieedwards
Last active June 9, 2020 21:04
Show Gist options
  • Save archieedwards/cc8ecc58f5942459397a5af89636fd6f to your computer and use it in GitHub Desktop.
Save archieedwards/cc8ecc58f5942459397a5af89636fd6f to your computer and use it in GitHub Desktop.
View to show Music and Podcasts ...
struct CategoryText: View {
@Binding var currentCategoryIndex : Int
@Binding var nestedPages : [Int]
var body: some View {
HStack(spacing: 20){
Text("Music")
.font(.largeTitle).bold()
.foregroundColor(self.currentCategoryIndex == 0 ? .primary : .secondary)
.onTapGesture {
self.nestedPages = [0,0]
withAnimation(.easeIn,{
self.currentCategoryIndex = 0
})
}
Text("Podcasts")
.font(.largeTitle).bold()
.foregroundColor(self.currentCategoryIndex == 1 ? .primary : .secondary)
.onTapGesture {
self.nestedPages = [0,0]
withAnimation(.easeIn,{
self.currentCategoryIndex = 1
})
}
Spacer()
}.padding([.leading, .top])
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment