From ac67cd11f65ed34f26f8c1af61e6eae3822fe59f Mon Sep 17 00:00:00 2001 From: cemolcay Date: Tue, 26 Jun 2018 19:53:33 +0300 Subject: [PATCH] 0.0.2 Update Swift 4 --- Example/Example.xcodeproj/project.pbxproj | 143 +++++++++++------- .../xcshareddata/IDEWorkspaceChecks.plist | 8 + Example/Mac/ViewController.swift | 2 +- Example/Podfile.lock | 12 +- Example/iOS/Base.lproj/Main.storyboard | 4 +- Example/iOS/ViewController.swift | 8 - PianoView.podspec | 4 +- PianoView.xcodeproj/project.pbxproj | 136 ++++++++++------- .../xcshareddata/IDEWorkspaceChecks.plist | 8 + Podfile.lock | 10 +- Source/PianoView.swift | 40 ++--- 11 files changed, 221 insertions(+), 154 deletions(-) create mode 100644 Example/Example.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist create mode 100644 PianoView.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist diff --git a/Example/Example.xcodeproj/project.pbxproj b/Example/Example.xcodeproj/project.pbxproj index 123a3b9..aa19246 100644 --- a/Example/Example.xcodeproj/project.pbxproj +++ b/Example/Example.xcodeproj/project.pbxproj @@ -178,7 +178,6 @@ B219CBE61E4CF7E30060A6B6 /* Frameworks */, B219CBE71E4CF7E30060A6B6 /* Resources */, 612B9F31EF392BAAA09BB781 /* [CP] Embed Pods Frameworks */, - 0AC41616056C3592CAB226A1 /* [CP] Copy Pods Resources */, ); buildRules = ( ); @@ -198,7 +197,6 @@ B29CBF3C1E41150800297BB1 /* Frameworks */, B29CBF3D1E41150800297BB1 /* Resources */, 6ED9D18A9178ED3A3268FE83 /* [CP] Embed Pods Frameworks */, - 2F8BD43995CD5CEAC8751707 /* [CP] Copy Pods Resources */, ); buildRules = ( ); @@ -218,7 +216,6 @@ B29CBF5D1E41152B00297BB1 /* Frameworks */, B29CBF5E1E41152B00297BB1 /* Resources */, EE7025CD2942D03CCBD2B051 /* [CP] Embed Pods Frameworks */, - CF48ACFF062A6F5F82F60E13 /* [CP] Copy Pods Resources */, ); buildRules = ( ); @@ -236,7 +233,7 @@ isa = PBXProject; attributes = { LastSwiftUpdateCheck = 0820; - LastUpgradeCheck = 0820; + LastUpgradeCheck = 0940; TargetAttributes = { B219CBE81E4CF7E30060A6B6 = { CreatedOnToolsVersion = 8.2.1; @@ -251,6 +248,7 @@ B29CBF5F1E41152B00297BB1 = { CreatedOnToolsVersion = 8.2.1; DevelopmentTeam = 77Y3N48SNF; + LastSwiftMigration = 0940; ProvisioningStyle = Automatic; }; }; @@ -307,45 +305,20 @@ /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ - 0AC41616056C3592CAB226A1 /* [CP] Copy Pods Resources */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "[CP] Copy Pods Resources"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-TV/Pods-TV-resources.sh\"\n"; - showEnvVarsInLog = 0; - }; - 2F8BD43995CD5CEAC8751707 /* [CP] Copy Pods Resources */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "[CP] Copy Pods Resources"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-Mac/Pods-Mac-resources.sh\"\n"; - showEnvVarsInLog = 0; - }; 612B9F31EF392BAAA09BB781 /* [CP] Embed Pods Frameworks */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputPaths = ( + "${SRCROOT}/Pods/Target Support Files/Pods-TV/Pods-TV-frameworks.sh", + "${BUILT_PRODUCTS_DIR}/MusicTheorySwift-tvOS/MusicTheorySwift.framework", + "${BUILT_PRODUCTS_DIR}/PianoView-tvOS/PianoView.framework", ); name = "[CP] Embed Pods Frameworks"; outputPaths = ( + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/MusicTheorySwift.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/PianoView.framework", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; @@ -358,9 +331,14 @@ files = ( ); inputPaths = ( + "${SRCROOT}/Pods/Target Support Files/Pods-Mac/Pods-Mac-frameworks.sh", + "${BUILT_PRODUCTS_DIR}/MusicTheorySwift-macOS/MusicTheorySwift.framework", + "${BUILT_PRODUCTS_DIR}/PianoView-macOS/PianoView.framework", ); name = "[CP] Embed Pods Frameworks"; outputPaths = ( + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/MusicTheorySwift.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/PianoView.framework", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; @@ -373,13 +351,16 @@ files = ( ); inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", ); name = "[CP] Check Pods Manifest.lock"; outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-Mac-checkManifestLockResult.txt", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n"; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; showEnvVarsInLog = 0; }; C655CFAF2F9E848FF45BB50A /* [CP] Check Pods Manifest.lock */ = { @@ -388,13 +369,16 @@ files = ( ); inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", ); name = "[CP] Check Pods Manifest.lock"; outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-iOS-checkManifestLockResult.txt", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n"; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; showEnvVarsInLog = 0; }; C699013332007A5514CF5AB4 /* [CP] Check Pods Manifest.lock */ = { @@ -403,28 +387,16 @@ files = ( ); inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", ); name = "[CP] Check Pods Manifest.lock"; outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-TV-checkManifestLockResult.txt", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n"; - showEnvVarsInLog = 0; - }; - CF48ACFF062A6F5F82F60E13 /* [CP] Copy Pods Resources */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "[CP] Copy Pods Resources"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-iOS/Pods-iOS-resources.sh\"\n"; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; showEnvVarsInLog = 0; }; EE7025CD2942D03CCBD2B051 /* [CP] Embed Pods Frameworks */ = { @@ -433,9 +405,14 @@ files = ( ); inputPaths = ( + "${SRCROOT}/Pods/Target Support Files/Pods-iOS/Pods-iOS-frameworks.sh", + "${BUILT_PRODUCTS_DIR}/MusicTheorySwift-iOS/MusicTheorySwift.framework", + "${BUILT_PRODUCTS_DIR}/PianoView-iOS/PianoView.framework", ); name = "[CP] Embed Pods Frameworks"; outputPaths = ( + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/MusicTheorySwift.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/PianoView.framework", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; @@ -622,12 +599,64 @@ B29CBF391E4114FF00297BB1 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + ONLY_ACTIVE_ARCH = YES; }; name = Debug; }; B29CBF3A1E4114FF00297BB1 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; }; name = Release; }; @@ -677,7 +706,7 @@ GCC_WARN_UNUSED_VARIABLE = YES; INFOPLIST_FILE = Mac/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks"; - MACOSX_DEPLOYMENT_TARGET = 10.10; + MACOSX_DEPLOYMENT_TARGET = 10.13; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; PRODUCT_BUNDLE_IDENTIFIER = co.prototapp.Mac; @@ -729,7 +758,7 @@ GCC_WARN_UNUSED_VARIABLE = YES; INFOPLIST_FILE = Mac/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks"; - MACOSX_DEPLOYMENT_TARGET = 10.10; + MACOSX_DEPLOYMENT_TARGET = 10.13; MTL_ENABLE_DEBUG_INFO = NO; PRODUCT_BUNDLE_IDENTIFIER = co.prototapp.Mac; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -792,7 +821,8 @@ SDKROOT = iphoneos; SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 3.0; + SWIFT_SWIFT3_OBJC_INFERENCE = On; + SWIFT_VERSION = 4.0; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Debug; @@ -842,7 +872,8 @@ PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = iphoneos; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; - SWIFT_VERSION = 3.0; + SWIFT_SWIFT3_OBJC_INFERENCE = On; + SWIFT_VERSION = 4.0; TARGETED_DEVICE_FAMILY = "1,2"; VALIDATE_PRODUCT = YES; }; diff --git a/Example/Example.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/Example/Example.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/Example/Example.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/Example/Mac/ViewController.swift b/Example/Mac/ViewController.swift index a908ad8..fda1da6 100644 --- a/Example/Mac/ViewController.swift +++ b/Example/Mac/ViewController.swift @@ -25,7 +25,7 @@ class ViewController: NSViewController { //let notes = NoteType.all.map({ Note(type: $0, octave: 0) }) //let randomNote = notes[Int(arc4random_uniform(UInt32(notes.count)))] pianoView?.deselectAll() - pianoView?.selectNote(note: Note(type: .dFlat, octave: 0)) + pianoView?.selectNote(note: Pitch(key: Key(type: .d, accidental: .flat), octave: 0)) } override func keyUp(with event: NSEvent) { diff --git a/Example/Podfile.lock b/Example/Podfile.lock index b6a7548..77de787 100644 --- a/Example/Podfile.lock +++ b/Example/Podfile.lock @@ -1,19 +1,23 @@ PODS: - - MusicTheorySwift (0.0.3) + - MusicTheorySwift (1.0.0) - PianoView (0.0.1): - MusicTheorySwift DEPENDENCIES: - PianoView (from `../`) +SPEC REPOS: + https://github.com/cocoapods/specs.git: + - MusicTheorySwift + EXTERNAL SOURCES: PianoView: :path: "../" SPEC CHECKSUMS: - MusicTheorySwift: 8003df1bf5a905120629378712156ceebebfc7d5 - PianoView: a1bdfca224033b01ae83defd918cd0a3804e4bee + MusicTheorySwift: 2102218ba959c04204f376d02f7719fe5f4cfb98 + PianoView: 4a8fbad8dfabbfd7d066b4b23d32318b4b036a39 PODFILE CHECKSUM: 53bc2ac8bc82eef033ea854dcf8f06c6d24d81d5 -COCOAPODS: 1.2.0 +COCOAPODS: 1.5.3 diff --git a/Example/iOS/Base.lproj/Main.storyboard b/Example/iOS/Base.lproj/Main.storyboard index 8b289d2..42f2cc6 100644 --- a/Example/iOS/Base.lproj/Main.storyboard +++ b/Example/iOS/Base.lproj/Main.storyboard @@ -1,11 +1,11 @@ - + - + diff --git a/Example/iOS/ViewController.swift b/Example/iOS/ViewController.swift index 9cb2341..151727e 100644 --- a/Example/iOS/ViewController.swift +++ b/Example/iOS/ViewController.swift @@ -12,13 +12,5 @@ import MusicTheorySwift class ViewController: UIViewController { @IBOutlet weak var pianoView: PianoView? - - override func touchesBegan(_ touches: Set, with event: UIEvent?) { - super.touchesBegan(touches, with: event) - let notes = NoteType.all.map({ Note(type: $0, octave: 0) }) - let randomNote = notes[Int(arc4random_uniform(UInt32(notes.count)))] - pianoView?.deselectAll() - pianoView?.selectNote(note: randomNote) - } } diff --git a/PianoView.podspec b/PianoView.podspec index 5094768..819d2ef 100644 --- a/PianoView.podspec +++ b/PianoView.podspec @@ -16,7 +16,7 @@ Pod::Spec.new do |s| # s.name = "PianoView" - s.version = "0.0.1" + s.version = "0.0.2" s.summary = "Fully custumisable piano keyboard view with `@IBDesignable` properties in swift." s.description = <<-DESC PianoView @@ -29,7 +29,7 @@ Fully custumisable piano keyboard view with `@IBDesignable` properties in swift. Requirements ---- -* Swift 3+ +* Swift 4+ * iOS 8.0+ * tvOS 9.0+ * macOS 10.9+ diff --git a/PianoView.xcodeproj/project.pbxproj b/PianoView.xcodeproj/project.pbxproj index b77f8b4..82200f4 100644 --- a/PianoView.xcodeproj/project.pbxproj +++ b/PianoView.xcodeproj/project.pbxproj @@ -168,7 +168,6 @@ B219CBD71E4CF75F0060A6B6 /* Frameworks */, B219CBD81E4CF75F0060A6B6 /* Headers */, B219CBD91E4CF75F0060A6B6 /* Resources */, - 022CC95452084267BB1966BD /* [CP] Copy Pods Resources */, ); buildRules = ( ); @@ -188,7 +187,6 @@ B29CBF091E40CFA300297BB1 /* Frameworks */, B29CBF0A1E40CFA300297BB1 /* Headers */, B29CBF0B1E40CFA300297BB1 /* Resources */, - B86C3DBCE00C7641316437FE /* [CP] Copy Pods Resources */, ); buildRules = ( ); @@ -208,7 +206,6 @@ B29CBF171E40CFB800297BB1 /* Frameworks */, B29CBF181E40CFB800297BB1 /* Headers */, B29CBF191E40CFB800297BB1 /* Resources */, - B8898A8E4628855632A627AF /* [CP] Copy Pods Resources */, ); buildRules = ( ); @@ -225,21 +222,24 @@ B29CBF021E40CF8800297BB1 /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 0820; + LastUpgradeCheck = 0940; TargetAttributes = { B219CBDA1E4CF75F0060A6B6 = { CreatedOnToolsVersion = 8.2.1; DevelopmentTeam = 77Y3N48SNF; + LastSwiftMigration = 0940; ProvisioningStyle = Automatic; }; B29CBF0C1E40CFA300297BB1 = { CreatedOnToolsVersion = 8.2.1; DevelopmentTeam = 77Y3N48SNF; + LastSwiftMigration = 0940; ProvisioningStyle = Automatic; }; B29CBF1A1E40CFB800297BB1 = { CreatedOnToolsVersion = 8.2.1; DevelopmentTeam = 77Y3N48SNF; + LastSwiftMigration = 0940; ProvisioningStyle = Automatic; }; }; @@ -288,64 +288,22 @@ /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ - 022CC95452084267BB1966BD /* [CP] Copy Pods Resources */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "[CP] Copy Pods Resources"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-PianoView TV/Pods-PianoView TV-resources.sh\"\n"; - showEnvVarsInLog = 0; - }; 2D123FDB17AC6EC5E327BEC2 /* [CP] Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", ); name = "[CP] Check Pods Manifest.lock"; outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-PianoView macOS-checkManifestLockResult.txt", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n"; - showEnvVarsInLog = 0; - }; - B86C3DBCE00C7641316437FE /* [CP] Copy Pods Resources */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "[CP] Copy Pods Resources"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-PianoView iOS/Pods-PianoView iOS-resources.sh\"\n"; - showEnvVarsInLog = 0; - }; - B8898A8E4628855632A627AF /* [CP] Copy Pods Resources */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "[CP] Copy Pods Resources"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-PianoView macOS/Pods-PianoView macOS-resources.sh\"\n"; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; showEnvVarsInLog = 0; }; EEE0EAA98CB2335CD78DDE85 /* [CP] Check Pods Manifest.lock */ = { @@ -354,13 +312,16 @@ files = ( ); inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", ); name = "[CP] Check Pods Manifest.lock"; outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-PianoView iOS-checkManifestLockResult.txt", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n"; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; showEnvVarsInLog = 0; }; FA77C0EDBC9F490D6A81E978 /* [CP] Check Pods Manifest.lock */ = { @@ -369,13 +330,16 @@ files = ( ); inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", ); name = "[CP] Check Pods Manifest.lock"; outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-PianoView TV-checkManifestLockResult.txt", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n"; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; showEnvVarsInLog = 0; }; /* End PBXShellScriptBuildPhase section */ @@ -466,7 +430,8 @@ SKIP_INSTALL = YES; SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 3.0; + SWIFT_SWIFT3_OBJC_INFERENCE = On; + SWIFT_VERSION = 4.0; TARGETED_DEVICE_FAMILY = 3; TVOS_DEPLOYMENT_TARGET = 9.0; VERSIONING_SYSTEM = "apple-generic"; @@ -524,7 +489,8 @@ SDKROOT = appletvos; SKIP_INSTALL = YES; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; - SWIFT_VERSION = 3.0; + SWIFT_SWIFT3_OBJC_INFERENCE = On; + SWIFT_VERSION = 4.0; TARGETED_DEVICE_FAMILY = 3; TVOS_DEPLOYMENT_TARGET = 9.0; VALIDATE_PRODUCT = YES; @@ -536,6 +502,33 @@ B29CBF061E40CF8800297BB1 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + ONLY_ACTIVE_ARCH = YES; PRODUCT_NAME = PianoView; }; name = Debug; @@ -543,6 +536,31 @@ B29CBF071E40CF8800297BB1 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; PRODUCT_NAME = PianoView; }; name = Release; @@ -607,7 +625,7 @@ SKIP_INSTALL = YES; SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 3.0; + SWIFT_VERSION = 4.0; TARGETED_DEVICE_FAMILY = "1,2"; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; @@ -666,7 +684,7 @@ SDKROOT = iphoneos; SKIP_INSTALL = YES; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; - SWIFT_VERSION = 3.0; + SWIFT_VERSION = 4.0; TARGETED_DEVICE_FAMILY = "1,2"; VALIDATE_PRODUCT = YES; VERSIONING_SYSTEM = "apple-generic"; @@ -735,7 +753,8 @@ SKIP_INSTALL = YES; SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 3.0; + SWIFT_SWIFT3_OBJC_INFERENCE = On; + SWIFT_VERSION = 4.0; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; }; @@ -794,7 +813,8 @@ SDKROOT = macosx; SKIP_INSTALL = YES; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; - SWIFT_VERSION = 3.0; + SWIFT_SWIFT3_OBJC_INFERENCE = On; + SWIFT_VERSION = 4.0; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; }; diff --git a/PianoView.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/PianoView.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/PianoView.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/Podfile.lock b/Podfile.lock index d2063ac..9e20e74 100644 --- a/Podfile.lock +++ b/Podfile.lock @@ -1,12 +1,16 @@ PODS: - - MusicTheorySwift (0.0.3) + - MusicTheorySwift (1.0.0) DEPENDENCIES: - MusicTheorySwift +SPEC REPOS: + https://github.com/cocoapods/specs.git: + - MusicTheorySwift + SPEC CHECKSUMS: - MusicTheorySwift: 8003df1bf5a905120629378712156ceebebfc7d5 + MusicTheorySwift: 2102218ba959c04204f376d02f7719fe5f4cfb98 PODFILE CHECKSUM: 4e0e46b00c483e6f1bc1d16fa19e11fb20a949d1 -COCOAPODS: 1.2.0 +COCOAPODS: 1.5.3 diff --git a/Source/PianoView.swift b/Source/PianoView.swift index 76e50f8..c59d288 100644 --- a/Source/PianoView.swift +++ b/Source/PianoView.swift @@ -158,10 +158,10 @@ import MusicTheorySwift #endif // MARK: - NoteType Extension -internal extension NoteType { +internal extension Key { internal var pianoKeyType: PianoKeyType { - switch self { - case .c, .d, .e, .f, .g, .a, .b: + switch accidental { + case .natural: return .white default: return .black @@ -192,7 +192,7 @@ public enum PianoKeyType { // MARK: - PianoKeyLayer public class PianoKeyLayer: CALayer { - public var note: Note + public var note: Pitch public var isSelected = false public var isHighlighted = false @@ -218,25 +218,25 @@ public class PianoKeyLayer: CALayer { public var textLayer = CATextLayer() public var type: PianoKeyType { - return note.type.pianoKeyType + return note.key.pianoKeyType } // MARK: Init - public init(note: Note) { + public init(note: Pitch) { self.note = note super.init() commonInit() } public required init?(coder aDecoder: NSCoder) { - note = Note(midiNote: 0) + note = Pitch(midiNote: 0) super.init(coder: aDecoder) commonInit() } public override init(layer: Any) { - note = Note(midiNote: 0) + note = Pitch(midiNote: 0) super.init(layer: layer) commonInit() } @@ -246,7 +246,7 @@ public class PianoKeyLayer: CALayer { addSublayer(textLayer) textLayer.alignmentMode = kCAAlignmentCenter #if os(OSX) - textLayer.contentsScale = NSScreen.main()?.backingScaleFactor ?? 1 + textLayer.contentsScale = NSScreen.main?.backingScaleFactor ?? 1 #elseif os(iOS) || os(tvOS) textLayer.contentsScale = UIScreen.main.scale #endif @@ -269,8 +269,8 @@ public class PianoKeyLayer: CALayer { textLayer.string = NSAttributedString( string: text, attributes: [ - NSForegroundColorAttributeName: textColor, - NSFontAttributeName: font + NSAttributedStringKey(rawValue: "foregroundColor"): textColor, + NSAttributedStringKey(rawValue: "font"): font ]) #if os(OSX) @@ -320,7 +320,7 @@ public class PianoKeyLayer: CALayer { private func drawGradient(in ctx: CGContext) { let size: CGSize = bounds.size - if case .black = note.type.pianoKeyType { + if case .black = note.key.pianoKeyType { let fillColor = PVColor(red: 0.379, green: 0.379, blue: 0.379, alpha: 1) let strokeColor = PVColor(red: 0, green: 0, blue: 0, alpha: 0.951) let gradient1Colors = [strokeColor.cgColor, fillColor.cgColor] @@ -544,12 +544,12 @@ public class PianoView: PVView { // MARK: Select - public func selectNote(note: Note) { + public func selectNote(note: Pitch) { pianoKeys.filter({ $0.note == note }).first?.isSelected = true draw() } - public func deselectNote(note: Note) { + public func deselectNote(note: Pitch) { pianoKeys.filter({ $0.note == note }).first?.isSelected = false draw() } @@ -561,18 +561,18 @@ public class PianoView: PVView { // MARK: Highlight - public func highlightNote(note: Note) { + public func highlightNote(note: Pitch) { pianoKeys.filter({ $0.note == note }).first?.isHighlighted = true draw() } - public func unhighlightNote(note: Note) { + public func unhighlightNote(note: Pitch) { pianoKeys.filter({ $0.note == note }).first?.isHighlighted = false draw() } - public func highlightNoteType(noteType: NoteType) { - pianoKeys.filter({ $0.note.type == noteType }).forEach({ $0.isHighlighted = true }) + public func highlightNoteType(noteType: Key) { + pianoKeys.filter({ $0.note.key == noteType }).forEach({ $0.isHighlighted = true }) } public func unhighlightAll() { @@ -589,7 +589,7 @@ public class PianoView: PVView { #endif pianoKeys.forEach({ $0.removeFromSuperlayer() }) - let startNote = Note(type: .c, octave: startOctave) + let startNote = Pitch(key: Key(type: .c), octave: startOctave) pianoKeys = Array(0..