Skip to content

Commit

Permalink
Added AudioKit logo to the navigation title.
Browse files Browse the repository at this point in the history
  • Loading branch information
markjeschke committed Jul 3, 2024
1 parent 23e2d1f commit 5276c03
Showing 1 changed file with 21 additions and 4 deletions.
25 changes: 21 additions & 4 deletions Cookbook/CookbookCommon/Sources/CookbookCommon/ContentView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -234,11 +234,28 @@ struct MasterView: View {
}
}
.navigationBarTitle("AudioKit")
.navigationBarTitleDisplayMode(.inline)
.toolbar {
Button {
showingInfo = true
} label: {
Image(systemName: "info.circle")
// This leading ToolbarItem is required to center the AudioKit logo on iPhones.
ToolbarItem(placement: .topBarLeading) {
Rectangle()
.frame(minWidth: 30)
.hidden()
.accessibilityHidden(true)
}
ToolbarItem(placement: .principal) {
Image("audiokit-logo")
.resizable()
.aspectRatio(contentMode: .fit)
.padding(10)
}
ToolbarItem(placement: .topBarTrailing) {
Button {
showingInfo.toggle()
} label: {
Image(systemName: "info.circle")
}
.accessibilityLabel("Learn about AudioKit")
}
}
.alert("AudioKit Cookbook", isPresented: $showingInfo) {
Expand Down

0 comments on commit 5276c03

Please sign in to comment.