Skip to content

Commit 0f66553

Browse files
Merge pull request #161 from markjeschke/markj/add-audiokit-logo-to-nav-title
Added AudioKit logo to the navigation title
2 parents c8d513f + 5276c03 commit 0f66553

File tree

1 file changed

+21
-4
lines changed

1 file changed

+21
-4
lines changed

Cookbook/CookbookCommon/Sources/CookbookCommon/ContentView.swift

+21-4
Original file line numberDiff line numberDiff line change
@@ -234,11 +234,28 @@ struct MasterView: View {
234234
}
235235
}
236236
.navigationBarTitle("AudioKit")
237+
.navigationBarTitleDisplayMode(.inline)
237238
.toolbar {
238-
Button {
239-
showingInfo = true
240-
} label: {
241-
Image(systemName: "info.circle")
239+
// This leading ToolbarItem is required to center the AudioKit logo on iPhones.
240+
ToolbarItem(placement: .topBarLeading) {
241+
Rectangle()
242+
.frame(minWidth: 30)
243+
.hidden()
244+
.accessibilityHidden(true)
245+
}
246+
ToolbarItem(placement: .principal) {
247+
Image("audiokit-logo")
248+
.resizable()
249+
.aspectRatio(contentMode: .fit)
250+
.padding(10)
251+
}
252+
ToolbarItem(placement: .topBarTrailing) {
253+
Button {
254+
showingInfo.toggle()
255+
} label: {
256+
Image(systemName: "info.circle")
257+
}
258+
.accessibilityLabel("Learn about AudioKit")
242259
}
243260
}
244261
.sheet(isPresented: $showingInfo) {

0 commit comments

Comments
 (0)