From 5276c03a5a27d056d964813dd5b7c60fd1fb1d6a Mon Sep 17 00:00:00 2001 From: Mark Jeschke Date: Wed, 3 Jul 2024 09:49:57 -0700 Subject: [PATCH] Added AudioKit logo to the navigation title. --- .../Sources/CookbookCommon/ContentView.swift | 25 ++++++++++++++++--- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/Cookbook/CookbookCommon/Sources/CookbookCommon/ContentView.swift b/Cookbook/CookbookCommon/Sources/CookbookCommon/ContentView.swift index f34c7a1..3331b1b 100644 --- a/Cookbook/CookbookCommon/Sources/CookbookCommon/ContentView.swift +++ b/Cookbook/CookbookCommon/Sources/CookbookCommon/ContentView.swift @@ -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) {