From 1ad5ca05b3eaf0373210f3253a990d5726fd813f Mon Sep 17 00:00:00 2001 From: Steffan Andrews Date: Thu, 12 Aug 2021 16:22:46 -0700 Subject: [PATCH 1/2] Changed `MIDIEventLogger` Xcode project format version from 13.0 to 12.0 --- .../MIDIEventLogger.xcodeproj/project.pbxproj | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Examples/MIDIEventLogger/MIDIEventLogger.xcodeproj/project.pbxproj b/Examples/MIDIEventLogger/MIDIEventLogger.xcodeproj/project.pbxproj index cea0a12a2b..78ea8188e7 100644 --- a/Examples/MIDIEventLogger/MIDIEventLogger.xcodeproj/project.pbxproj +++ b/Examples/MIDIEventLogger/MIDIEventLogger.xcodeproj/project.pbxproj @@ -3,7 +3,7 @@ archiveVersion = 1; classes = { }; - objectVersion = 55; + objectVersion = 54; objects = { /* Begin PBXBuildFile section */ @@ -115,7 +115,7 @@ }; }; buildConfigurationList = E26A25A726C586F600FFCF40 /* Build configuration list for PBXProject "MIDIEventLogger" */; - compatibilityVersion = "Xcode 13.0"; + compatibilityVersion = "Xcode 12.0"; developmentRegion = en; hasScannedForEncodings = 0; knownRegions = ( @@ -303,6 +303,7 @@ ENABLE_HARDENED_RUNTIME = YES; ENABLE_USER_SELECTED_FILES = readonly; GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.utilities"; INFOPLIST_KEY_NSHumanReadableCopyright = ""; INFOPLIST_KEY_NSMainStoryboardFile = Main; INFOPLIST_KEY_NSPrincipalClass = NSApplication; @@ -334,6 +335,7 @@ ENABLE_HARDENED_RUNTIME = YES; ENABLE_USER_SELECTED_FILES = readonly; GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.utilities"; INFOPLIST_KEY_NSHumanReadableCopyright = ""; INFOPLIST_KEY_NSMainStoryboardFile = Main; INFOPLIST_KEY_NSPrincipalClass = NSApplication; From 52b5a5fb39e830d113730a5f55dbd79f5372e0ff Mon Sep 17 00:00:00 2001 From: Steffan Andrews Date: Thu, 12 Aug 2021 16:36:43 -0700 Subject: [PATCH 2/2] Fixed `MIDIEventLogger` build on Catalina --- .../MIDIEventLogger.xcodeproj/project.pbxproj | 6 ++++ .../MIDIEventLogger/AppDelegate.swift | 6 ++-- .../ContentView SubViews.swift | 4 +-- .../MIDIEventLogger/ContentView.swift | 3 +- .../MIDIEventLogger/Info.plist | 32 +++++++++++++++++++ 5 files changed, 45 insertions(+), 6 deletions(-) create mode 100644 Examples/MIDIEventLogger/MIDIEventLogger/Info.plist diff --git a/Examples/MIDIEventLogger/MIDIEventLogger.xcodeproj/project.pbxproj b/Examples/MIDIEventLogger/MIDIEventLogger.xcodeproj/project.pbxproj index 78ea8188e7..a6c63a4871 100644 --- a/Examples/MIDIEventLogger/MIDIEventLogger.xcodeproj/project.pbxproj +++ b/Examples/MIDIEventLogger/MIDIEventLogger.xcodeproj/project.pbxproj @@ -7,6 +7,7 @@ objects = { /* Begin PBXBuildFile section */ + E216886126C5E5A400BF7959 /* Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = E216886026C5E5A400BF7959 /* Info.plist */; }; E26A25B426C586F700FFCF40 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = E26A25B326C586F700FFCF40 /* Assets.xcassets */; }; E26A25B726C586F700FFCF40 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = E26A25B526C586F700FFCF40 /* Main.storyboard */; }; E26A25C126C5873B00FFCF40 /* HostingWindowKey.swift in Sources */ = {isa = PBXBuildFile; fileRef = E26A25BD26C5873B00FFCF40 /* HostingWindowKey.swift */; }; @@ -19,6 +20,7 @@ /* End PBXBuildFile section */ /* Begin PBXFileReference section */ + E216886026C5E5A400BF7959 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; E26A25AC26C586F600FFCF40 /* MIDIEventLogger.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = MIDIEventLogger.app; sourceTree = BUILT_PRODUCTS_DIR; }; E26A25B326C586F700FFCF40 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; E26A25B626C586F700FFCF40 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; @@ -68,6 +70,7 @@ E26A25CE26C5AD4700FFCF40 /* ContentView SubViews.swift */, E26A25BD26C5873B00FFCF40 /* HostingWindowKey.swift */, E26A25BF26C5873B00FFCF40 /* logErrors.swift */, + E216886026C5E5A400BF7959 /* Info.plist */, E26A25B326C586F700FFCF40 /* Assets.xcassets */, E26A25B526C586F700FFCF40 /* Main.storyboard */, ); @@ -142,6 +145,7 @@ files = ( E26A25B426C586F700FFCF40 /* Assets.xcassets in Resources */, E26A25B726C586F700FFCF40 /* Main.storyboard in Resources */, + E216886126C5E5A400BF7959 /* Info.plist in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -303,6 +307,7 @@ ENABLE_HARDENED_RUNTIME = YES; ENABLE_USER_SELECTED_FILES = readonly; GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_FILE = MIDIEventLogger/Info.plist; INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.utilities"; INFOPLIST_KEY_NSHumanReadableCopyright = ""; INFOPLIST_KEY_NSMainStoryboardFile = Main; @@ -335,6 +340,7 @@ ENABLE_HARDENED_RUNTIME = YES; ENABLE_USER_SELECTED_FILES = readonly; GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_FILE = MIDIEventLogger/Info.plist; INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.utilities"; INFOPLIST_KEY_NSHumanReadableCopyright = ""; INFOPLIST_KEY_NSMainStoryboardFile = Main; diff --git a/Examples/MIDIEventLogger/MIDIEventLogger/AppDelegate.swift b/Examples/MIDIEventLogger/MIDIEventLogger/AppDelegate.swift index 27c0317c56..2e5c035d85 100644 --- a/Examples/MIDIEventLogger/MIDIEventLogger/AppDelegate.swift +++ b/Examples/MIDIEventLogger/MIDIEventLogger/AppDelegate.swift @@ -44,14 +44,14 @@ class AppDelegate: NSObject, NSApplicationDelegate { window = NSWindow( contentRect: NSRect(x: 0, y: 0, - width: ContentView.kMinHeight, - height: ContentView.kMinWidth), + width: ContentView.kMinWidth, + height: ContentView.kMinHeight), styleMask: [.titled, .miniaturizable, .resizable], backing: .buffered, defer: false) // Create the SwiftUI view that provides the window contents. - window.isReleasedWhenClosed = false + window.isReleasedWhenClosed = true window.center() window.setFrameAutosaveName("Main Window") diff --git a/Examples/MIDIEventLogger/MIDIEventLogger/ContentView SubViews.swift b/Examples/MIDIEventLogger/MIDIEventLogger/ContentView SubViews.swift index 0c07f0f147..9df61e19c7 100644 --- a/Examples/MIDIEventLogger/MIDIEventLogger/ContentView SubViews.swift +++ b/Examples/MIDIEventLogger/MIDIEventLogger/ContentView SubViews.swift @@ -42,7 +42,7 @@ extension ContentView { VStack(alignment: .center, spacing: 8) { Picker("UMP Group", selection: $midiGroup) { - ForEach(0..<15+1) { + ForEach(0..<15+1, id: \.self) { let groupNum = $0 + 1 let groupNumHex = $0.hex.stringValue(padTo: 1, prefix: true) @@ -78,7 +78,7 @@ extension ContentView { VStack(alignment: .center, spacing: 8) { Picker("Channel", selection: $midiChannel) { - ForEach(0..<15+1) { + ForEach(0..<15+1, id: \.self) { let channelNum = $0 + 1 let channelNumHex = $0.hex.stringValue(padTo: 1, prefix: true) diff --git a/Examples/MIDIEventLogger/MIDIEventLogger/ContentView.swift b/Examples/MIDIEventLogger/MIDIEventLogger/ContentView.swift index d215ca5bb0..243b2e192e 100644 --- a/Examples/MIDIEventLogger/MIDIEventLogger/ContentView.swift +++ b/Examples/MIDIEventLogger/MIDIEventLogger/ContentView.swift @@ -90,7 +90,8 @@ struct ContentView: View { // wait a short delay in order to give CoreMIDI time // to set up the virtual endpoints we created in the view's init() DispatchQueue.main - .asyncAfter(deadline: .now().advanced(by: .milliseconds(500))) + .asyncAfter(deadline: DispatchTime.now() + .advanced(by: .milliseconds(500))) { setInputConnectionToVirtual() } diff --git a/Examples/MIDIEventLogger/MIDIEventLogger/Info.plist b/Examples/MIDIEventLogger/MIDIEventLogger/Info.plist new file mode 100644 index 0000000000..8aa8d0968b --- /dev/null +++ b/Examples/MIDIEventLogger/MIDIEventLogger/Info.plist @@ -0,0 +1,32 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIconFile + + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + $(PRODUCT_BUNDLE_PACKAGE_TYPE) + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1 + LSApplicationCategoryType + public.app-category.utilities + LSMinimumSystemVersion + $(MACOSX_DEPLOYMENT_TARGET) + NSMainStoryboardFile + Main + NSPrincipalClass + NSApplication + +