diff --git a/Drummer.xcodeproj/project.pbxproj b/Drummer.xcodeproj/project.pbxproj index 11e7684..e4a839a 100644 --- a/Drummer.xcodeproj/project.pbxproj +++ b/Drummer.xcodeproj/project.pbxproj @@ -7,47 +7,33 @@ objects = { /* Begin PBXBuildFile section */ + 30DE261421531DB100311C92 /* drumkit-5.wav in Resources */ = {isa = PBXBuildFile; fileRef = 30DE260D21531DB100311C92 /* drumkit-5.wav */; }; + 30DE261521531DB100311C92 /* drumkit-1.wav in Resources */ = {isa = PBXBuildFile; fileRef = 30DE260E21531DB100311C92 /* drumkit-1.wav */; }; + 30DE261621531DB100311C92 /* drumkit-2.wav in Resources */ = {isa = PBXBuildFile; fileRef = 30DE260F21531DB100311C92 /* drumkit-2.wav */; }; + 30DE261721531DB100311C92 /* drumkit-kick.wav in Resources */ = {isa = PBXBuildFile; fileRef = 30DE261021531DB100311C92 /* drumkit-kick.wav */; }; + 30DE261821531DB100311C92 /* drumkit-0.wav in Resources */ = {isa = PBXBuildFile; fileRef = 30DE261121531DB100311C92 /* drumkit-0.wav */; }; + 30DE261921531DB100311C92 /* drumkit-3.wav in Resources */ = {isa = PBXBuildFile; fileRef = 30DE261221531DB100311C92 /* drumkit-3.wav */; }; + 30DE261A21531DB100311C92 /* drumkit-4.wav in Resources */ = {isa = PBXBuildFile; fileRef = 30DE261321531DB100311C92 /* drumkit-4.wav */; }; 6CAB23901E29AF7100BA9DD3 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6CAB238F1E29AF7100BA9DD3 /* AppDelegate.swift */; }; 6CAB23951E29AF7100BA9DD3 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 6CAB23931E29AF7100BA9DD3 /* Main.storyboard */; }; 6CAB23971E29AF7100BA9DD3 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 6CAB23961E29AF7100BA9DD3 /* Assets.xcassets */; }; - 6CAB23B51E29B05200BA9DD3 /* drumkit0-0.wav in Resources */ = {isa = PBXBuildFile; fileRef = 6CAB23A61E29B05200BA9DD3 /* drumkit0-0.wav */; }; - 6CAB23B61E29B05200BA9DD3 /* drumkit0-1.wav in Resources */ = {isa = PBXBuildFile; fileRef = 6CAB23A71E29B05200BA9DD3 /* drumkit0-1.wav */; }; - 6CAB23B71E29B05200BA9DD3 /* drumkit0-2.wav in Resources */ = {isa = PBXBuildFile; fileRef = 6CAB23A81E29B05200BA9DD3 /* drumkit0-2.wav */; }; - 6CAB23B81E29B05200BA9DD3 /* drumkit0-3.wav in Resources */ = {isa = PBXBuildFile; fileRef = 6CAB23A91E29B05200BA9DD3 /* drumkit0-3.wav */; }; - 6CAB23B91E29B05200BA9DD3 /* drumkit0-4.wav in Resources */ = {isa = PBXBuildFile; fileRef = 6CAB23AA1E29B05200BA9DD3 /* drumkit0-4.wav */; }; - 6CAB23BA1E29B05200BA9DD3 /* drumkit0-5.wav in Resources */ = {isa = PBXBuildFile; fileRef = 6CAB23AB1E29B05200BA9DD3 /* drumkit0-5.wav */; }; - 6CAB23BB1E29B05200BA9DD3 /* drumkit0-kick.wav in Resources */ = {isa = PBXBuildFile; fileRef = 6CAB23AC1E29B05200BA9DD3 /* drumkit0-kick.wav */; }; - 6CAB23BC1E29B05200BA9DD3 /* drumkit1-0.wav in Resources */ = {isa = PBXBuildFile; fileRef = 6CAB23AE1E29B05200BA9DD3 /* drumkit1-0.wav */; }; - 6CAB23BD1E29B05200BA9DD3 /* drumkit1-1.wav in Resources */ = {isa = PBXBuildFile; fileRef = 6CAB23AF1E29B05200BA9DD3 /* drumkit1-1.wav */; }; - 6CAB23BE1E29B05200BA9DD3 /* drumkit1-2.wav in Resources */ = {isa = PBXBuildFile; fileRef = 6CAB23B01E29B05200BA9DD3 /* drumkit1-2.wav */; }; - 6CAB23BF1E29B05200BA9DD3 /* drumkit1-3.wav in Resources */ = {isa = PBXBuildFile; fileRef = 6CAB23B11E29B05200BA9DD3 /* drumkit1-3.wav */; }; - 6CAB23C01E29B05200BA9DD3 /* drumkit1-4.wav in Resources */ = {isa = PBXBuildFile; fileRef = 6CAB23B21E29B05200BA9DD3 /* drumkit1-4.wav */; }; - 6CAB23C11E29B05200BA9DD3 /* drumkit1-5.wav in Resources */ = {isa = PBXBuildFile; fileRef = 6CAB23B31E29B05200BA9DD3 /* drumkit1-5.wav */; }; - 6CAB23C21E29B05200BA9DD3 /* drumkit1-kick.wav in Resources */ = {isa = PBXBuildFile; fileRef = 6CAB23B41E29B05200BA9DD3 /* drumkit1-kick.wav */; }; 6CAB23C81E29B09000BA9DD3 /* DrumKit.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6CAB23C71E29B09000BA9DD3 /* DrumKit.swift */; }; 6CAB23CA1E29B0B500BA9DD3 /* DrummerViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6CAB23C91E29B0B500BA9DD3 /* DrummerViewController.swift */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ + 30DE260D21531DB100311C92 /* drumkit-5.wav */ = {isa = PBXFileReference; lastKnownFileType = audio.wav; path = "drumkit-5.wav"; sourceTree = ""; }; + 30DE260E21531DB100311C92 /* drumkit-1.wav */ = {isa = PBXFileReference; lastKnownFileType = audio.wav; path = "drumkit-1.wav"; sourceTree = ""; }; + 30DE260F21531DB100311C92 /* drumkit-2.wav */ = {isa = PBXFileReference; lastKnownFileType = audio.wav; path = "drumkit-2.wav"; sourceTree = ""; }; + 30DE261021531DB100311C92 /* drumkit-kick.wav */ = {isa = PBXFileReference; lastKnownFileType = audio.wav; path = "drumkit-kick.wav"; sourceTree = ""; }; + 30DE261121531DB100311C92 /* drumkit-0.wav */ = {isa = PBXFileReference; lastKnownFileType = audio.wav; path = "drumkit-0.wav"; sourceTree = ""; }; + 30DE261221531DB100311C92 /* drumkit-3.wav */ = {isa = PBXFileReference; lastKnownFileType = audio.wav; path = "drumkit-3.wav"; sourceTree = ""; }; + 30DE261321531DB100311C92 /* drumkit-4.wav */ = {isa = PBXFileReference; lastKnownFileType = audio.wav; path = "drumkit-4.wav"; sourceTree = ""; }; 6CAB238C1E29AF7100BA9DD3 /* Drummer.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Drummer.app; sourceTree = BUILT_PRODUCTS_DIR; }; 6CAB238F1E29AF7100BA9DD3 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 6CAB23941E29AF7100BA9DD3 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 6CAB23961E29AF7100BA9DD3 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 6CAB239B1E29AF7100BA9DD3 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - 6CAB23A61E29B05200BA9DD3 /* drumkit0-0.wav */ = {isa = PBXFileReference; lastKnownFileType = audio.wav; path = "drumkit0-0.wav"; sourceTree = ""; }; - 6CAB23A71E29B05200BA9DD3 /* drumkit0-1.wav */ = {isa = PBXFileReference; lastKnownFileType = audio.wav; path = "drumkit0-1.wav"; sourceTree = ""; }; - 6CAB23A81E29B05200BA9DD3 /* drumkit0-2.wav */ = {isa = PBXFileReference; lastKnownFileType = audio.wav; path = "drumkit0-2.wav"; sourceTree = ""; }; - 6CAB23A91E29B05200BA9DD3 /* drumkit0-3.wav */ = {isa = PBXFileReference; lastKnownFileType = audio.wav; path = "drumkit0-3.wav"; sourceTree = ""; }; - 6CAB23AA1E29B05200BA9DD3 /* drumkit0-4.wav */ = {isa = PBXFileReference; lastKnownFileType = audio.wav; path = "drumkit0-4.wav"; sourceTree = ""; }; - 6CAB23AB1E29B05200BA9DD3 /* drumkit0-5.wav */ = {isa = PBXFileReference; lastKnownFileType = audio.wav; path = "drumkit0-5.wav"; sourceTree = ""; }; - 6CAB23AC1E29B05200BA9DD3 /* drumkit0-kick.wav */ = {isa = PBXFileReference; lastKnownFileType = audio.wav; path = "drumkit0-kick.wav"; sourceTree = ""; }; - 6CAB23AE1E29B05200BA9DD3 /* drumkit1-0.wav */ = {isa = PBXFileReference; lastKnownFileType = audio.wav; path = "drumkit1-0.wav"; sourceTree = ""; }; - 6CAB23AF1E29B05200BA9DD3 /* drumkit1-1.wav */ = {isa = PBXFileReference; lastKnownFileType = audio.wav; path = "drumkit1-1.wav"; sourceTree = ""; }; - 6CAB23B01E29B05200BA9DD3 /* drumkit1-2.wav */ = {isa = PBXFileReference; lastKnownFileType = audio.wav; path = "drumkit1-2.wav"; sourceTree = ""; }; - 6CAB23B11E29B05200BA9DD3 /* drumkit1-3.wav */ = {isa = PBXFileReference; lastKnownFileType = audio.wav; path = "drumkit1-3.wav"; sourceTree = ""; }; - 6CAB23B21E29B05200BA9DD3 /* drumkit1-4.wav */ = {isa = PBXFileReference; lastKnownFileType = audio.wav; path = "drumkit1-4.wav"; sourceTree = ""; }; - 6CAB23B31E29B05200BA9DD3 /* drumkit1-5.wav */ = {isa = PBXFileReference; lastKnownFileType = audio.wav; path = "drumkit1-5.wav"; sourceTree = ""; }; - 6CAB23B41E29B05200BA9DD3 /* drumkit1-kick.wav */ = {isa = PBXFileReference; lastKnownFileType = audio.wav; path = "drumkit1-kick.wav"; sourceTree = ""; }; 6CAB23C71E29B09000BA9DD3 /* DrumKit.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DrumKit.swift; sourceTree = ""; }; 6CAB23C91E29B0B500BA9DD3 /* DrummerViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = DrummerViewController.swift; path = Controller/DrummerViewController.swift; sourceTree = ""; }; /* End PBXFileReference section */ @@ -103,40 +89,17 @@ 6CAB23A41E29B05200BA9DD3 /* Audio Files */ = { isa = PBXGroup; children = ( - 6CAB23A51E29B05200BA9DD3 /* drum kit 0 */, - 6CAB23AD1E29B05200BA9DD3 /* drum kit 1 */, + 30DE261121531DB100311C92 /* drumkit-0.wav */, + 30DE260E21531DB100311C92 /* drumkit-1.wav */, + 30DE260F21531DB100311C92 /* drumkit-2.wav */, + 30DE261221531DB100311C92 /* drumkit-3.wav */, + 30DE261321531DB100311C92 /* drumkit-4.wav */, + 30DE260D21531DB100311C92 /* drumkit-5.wav */, + 30DE261021531DB100311C92 /* drumkit-kick.wav */, ); path = "Audio Files"; sourceTree = ""; }; - 6CAB23A51E29B05200BA9DD3 /* drum kit 0 */ = { - isa = PBXGroup; - children = ( - 6CAB23A61E29B05200BA9DD3 /* drumkit0-0.wav */, - 6CAB23A71E29B05200BA9DD3 /* drumkit0-1.wav */, - 6CAB23A81E29B05200BA9DD3 /* drumkit0-2.wav */, - 6CAB23A91E29B05200BA9DD3 /* drumkit0-3.wav */, - 6CAB23AA1E29B05200BA9DD3 /* drumkit0-4.wav */, - 6CAB23AB1E29B05200BA9DD3 /* drumkit0-5.wav */, - 6CAB23AC1E29B05200BA9DD3 /* drumkit0-kick.wav */, - ); - path = "drum kit 0"; - sourceTree = ""; - }; - 6CAB23AD1E29B05200BA9DD3 /* drum kit 1 */ = { - isa = PBXGroup; - children = ( - 6CAB23AE1E29B05200BA9DD3 /* drumkit1-0.wav */, - 6CAB23AF1E29B05200BA9DD3 /* drumkit1-1.wav */, - 6CAB23B01E29B05200BA9DD3 /* drumkit1-2.wav */, - 6CAB23B11E29B05200BA9DD3 /* drumkit1-3.wav */, - 6CAB23B21E29B05200BA9DD3 /* drumkit1-4.wav */, - 6CAB23B31E29B05200BA9DD3 /* drumkit1-5.wav */, - 6CAB23B41E29B05200BA9DD3 /* drumkit1-kick.wav */, - ); - path = "drum kit 1"; - sourceTree = ""; - }; 6CAB23C31E29B05900BA9DD3 /* View */ = { isa = PBXGroup; children = ( @@ -189,7 +152,7 @@ isa = PBXProject; attributes = { LastSwiftUpdateCheck = 0820; - LastUpgradeCheck = 0900; + LastUpgradeCheck = 0940; ORGANIZATIONNAME = iosdecal; TargetAttributes = { 6CAB238B1E29AF7100BA9DD3 = { @@ -222,22 +185,15 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( - 6CAB23C11E29B05200BA9DD3 /* drumkit1-5.wav in Resources */, - 6CAB23BC1E29B05200BA9DD3 /* drumkit1-0.wav in Resources */, - 6CAB23BF1E29B05200BA9DD3 /* drumkit1-3.wav in Resources */, - 6CAB23BB1E29B05200BA9DD3 /* drumkit0-kick.wav in Resources */, - 6CAB23B71E29B05200BA9DD3 /* drumkit0-2.wav in Resources */, - 6CAB23BD1E29B05200BA9DD3 /* drumkit1-1.wav in Resources */, - 6CAB23B61E29B05200BA9DD3 /* drumkit0-1.wav in Resources */, - 6CAB23B81E29B05200BA9DD3 /* drumkit0-3.wav in Resources */, - 6CAB23BE1E29B05200BA9DD3 /* drumkit1-2.wav in Resources */, - 6CAB23C01E29B05200BA9DD3 /* drumkit1-4.wav in Resources */, + 30DE261A21531DB100311C92 /* drumkit-4.wav in Resources */, + 30DE261421531DB100311C92 /* drumkit-5.wav in Resources */, + 30DE261921531DB100311C92 /* drumkit-3.wav in Resources */, + 30DE261621531DB100311C92 /* drumkit-2.wav in Resources */, 6CAB23971E29AF7100BA9DD3 /* Assets.xcassets in Resources */, - 6CAB23BA1E29B05200BA9DD3 /* drumkit0-5.wav in Resources */, 6CAB23951E29AF7100BA9DD3 /* Main.storyboard in Resources */, - 6CAB23C21E29B05200BA9DD3 /* drumkit1-kick.wav in Resources */, - 6CAB23B51E29B05200BA9DD3 /* drumkit0-0.wav in Resources */, - 6CAB23B91E29B05200BA9DD3 /* drumkit0-4.wav in Resources */, + 30DE261521531DB100311C92 /* drumkit-1.wav in Resources */, + 30DE261821531DB100311C92 /* drumkit-0.wav in Resources */, + 30DE261721531DB100311C92 /* drumkit-kick.wav in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -281,6 +237,7 @@ CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_DOCUMENTATION_COMMENTS = YES; CLANG_WARN_EMPTY_BODY = YES; @@ -288,6 +245,7 @@ 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_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; @@ -337,6 +295,7 @@ CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_DOCUMENTATION_COMMENTS = YES; CLANG_WARN_EMPTY_BODY = YES; @@ -344,6 +303,7 @@ 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_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; diff --git a/Drummer.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/Drummer.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/Drummer.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/Drummer/Audio Files/drum kit 1/drumkit1-0.wav b/Drummer/Audio Files/drum kit 1/drumkit1-0.wav deleted file mode 100755 index 094d3cc..0000000 Binary files a/Drummer/Audio Files/drum kit 1/drumkit1-0.wav and /dev/null differ diff --git a/Drummer/Audio Files/drum kit 1/drumkit1-1.wav b/Drummer/Audio Files/drum kit 1/drumkit1-1.wav deleted file mode 100755 index 3840db6..0000000 Binary files a/Drummer/Audio Files/drum kit 1/drumkit1-1.wav and /dev/null differ diff --git a/Drummer/Audio Files/drum kit 1/drumkit1-2.wav b/Drummer/Audio Files/drum kit 1/drumkit1-2.wav deleted file mode 100755 index 5ac356b..0000000 Binary files a/Drummer/Audio Files/drum kit 1/drumkit1-2.wav and /dev/null differ diff --git a/Drummer/Audio Files/drum kit 1/drumkit1-3.wav b/Drummer/Audio Files/drum kit 1/drumkit1-3.wav deleted file mode 100755 index 79aea7f..0000000 Binary files a/Drummer/Audio Files/drum kit 1/drumkit1-3.wav and /dev/null differ diff --git a/Drummer/Audio Files/drum kit 1/drumkit1-4.wav b/Drummer/Audio Files/drum kit 1/drumkit1-4.wav deleted file mode 100755 index 6c2d011..0000000 Binary files a/Drummer/Audio Files/drum kit 1/drumkit1-4.wav and /dev/null differ diff --git a/Drummer/Audio Files/drum kit 1/drumkit1-5.wav b/Drummer/Audio Files/drum kit 1/drumkit1-5.wav deleted file mode 100755 index 0b19fa6..0000000 Binary files a/Drummer/Audio Files/drum kit 1/drumkit1-5.wav and /dev/null differ diff --git a/Drummer/Audio Files/drum kit 1/drumkit1-kick.wav b/Drummer/Audio Files/drum kit 1/drumkit1-kick.wav deleted file mode 100755 index da17d2c..0000000 Binary files a/Drummer/Audio Files/drum kit 1/drumkit1-kick.wav and /dev/null differ diff --git a/Drummer/Audio Files/drum kit 0/drumkit0-0.wav b/Drummer/Audio Files/drumkit-0.wav similarity index 100% rename from Drummer/Audio Files/drum kit 0/drumkit0-0.wav rename to Drummer/Audio Files/drumkit-0.wav diff --git a/Drummer/Audio Files/drum kit 0/drumkit0-1.wav b/Drummer/Audio Files/drumkit-1.wav similarity index 100% rename from Drummer/Audio Files/drum kit 0/drumkit0-1.wav rename to Drummer/Audio Files/drumkit-1.wav diff --git a/Drummer/Audio Files/drum kit 0/drumkit0-2.wav b/Drummer/Audio Files/drumkit-2.wav similarity index 100% rename from Drummer/Audio Files/drum kit 0/drumkit0-2.wav rename to Drummer/Audio Files/drumkit-2.wav diff --git a/Drummer/Audio Files/drum kit 0/drumkit0-3.wav b/Drummer/Audio Files/drumkit-3.wav similarity index 100% rename from Drummer/Audio Files/drum kit 0/drumkit0-3.wav rename to Drummer/Audio Files/drumkit-3.wav diff --git a/Drummer/Audio Files/drum kit 0/drumkit0-4.wav b/Drummer/Audio Files/drumkit-4.wav similarity index 100% rename from Drummer/Audio Files/drum kit 0/drumkit0-4.wav rename to Drummer/Audio Files/drumkit-4.wav diff --git a/Drummer/Audio Files/drum kit 0/drumkit0-5.wav b/Drummer/Audio Files/drumkit-5.wav similarity index 100% rename from Drummer/Audio Files/drum kit 0/drumkit0-5.wav rename to Drummer/Audio Files/drumkit-5.wav diff --git a/Drummer/Audio Files/drum kit 0/drumkit0-kick.wav b/Drummer/Audio Files/drumkit-kick.wav similarity index 100% rename from Drummer/Audio Files/drum kit 0/drumkit0-kick.wav rename to Drummer/Audio Files/drumkit-kick.wav diff --git a/Drummer/Controller/DrummerViewController.swift b/Drummer/Controller/DrummerViewController.swift index baf2f42..b1f30ca 100644 --- a/Drummer/Controller/DrummerViewController.swift +++ b/Drummer/Controller/DrummerViewController.swift @@ -10,19 +10,11 @@ import UIKit class DrummerViewController: UIViewController { - // Drum Kit 0 (Acoustic Drum Kit) - let drumKit0 = DrumKit(drumKitID: 0) - - // Drum Kit 1 (Electronic Drum Kit) - let drumKit1 = DrumKit(drumKitID: 1) - - // The currently selected drum kit (default = 0) - var currentDrumKit: DrumKit? + // Our DrumKit object + let drumKit = DrumKit() override func viewDidLoad() { super.viewDidLoad() - // sets the default drum kit to drumkit0 - currentDrumKit = drumKit0 } // YOUR CODE HERE diff --git a/Drummer/Model/DrumKit.swift b/Drummer/Model/DrumKit.swift index 625209e..b8bf58b 100644 --- a/Drummer/Model/DrumKit.swift +++ b/Drummer/Model/DrumKit.swift @@ -11,32 +11,16 @@ import Foundation /// Model class for drumkits (you will not need to edit this file, but it will help to read through it) class DrumKit { - /// The ID number to indicate which drum kit the user is playing - private var drumKitID: Int - - /// Filenames for the available drum sounds for drum kit 0 - private static let drumKit0AudioFileNames = ["drumkit0-0.wav", "drumkit0-1.wav", "drumkit0-2.wav", "drumkit0-3.wav", "drumkit0-4.wav", "drumkit0-5.wav", "drumkit0-kick.wav"] - - /// Filenames for the available drum sounds for drum kit 1 - private static let drumKit1AudioFileNames = ["drumkit1-0.wav", "drumkit1-1.wav", "drumkit1-2.wav", "drumkit1-3.wav", "drumkit1-4.wav", "drumkit1-5.wav", "drumkit1-kick.wav"] - - - init(drumKitID: Int) { - self.drumKitID = drumKitID - } + /// Filenames for the available drum sounds + private static let drumKitAudioFileNames = ["drumkit-0.wav", "drumkit-1.wav", "drumkit-2.wav", "drumkit-3.wav", "drumkit-4.wav", "drumkit-5.wav", "drumkit-kick.wav"] + + /// Plays the audio file for drum associated with the given tag /// /// - Parameter tag: The tag of the drum button pressed func playDrumSound(forDrumWithTag tag: Int) { - switch drumKitID { - case 0: - SystemSoundID.playSound(withFilename: DrumKit.drumKit0AudioFileNames[tag]) - case 1: - SystemSoundID.playSound(withFilename: DrumKit.drumKit1AudioFileNames[tag]) - default: - print("Error - drum kit \(drumKitID) does not exist.") - } + SystemSoundID.playSound(withFilename: DrumKit.drumKitAudioFileNames[tag]) } } diff --git a/README-images/assistant-editor.png b/README-images/assistant-editor.png new file mode 100644 index 0000000..d8ea824 Binary files /dev/null and b/README-images/assistant-editor.png differ diff --git a/README-images/corrected.png b/README-images/corrected.png index 3a2e805..4268561 100644 Binary files a/README-images/corrected.png and b/README-images/corrected.png differ diff --git a/README-images/endProduct.png b/README-images/endProduct.png index f018acc..b2063e9 100755 Binary files a/README-images/endProduct.png and b/README-images/endProduct.png differ diff --git a/README-images/part4-2.png b/README-images/part4-2.png index 044bf99..e30b978 100644 Binary files a/README-images/part4-2.png and b/README-images/part4-2.png differ diff --git a/README-images/part4-4.png b/README-images/part4-4.png index 26453cc..e80cb69 100755 Binary files a/README-images/part4-4.png and b/README-images/part4-4.png differ diff --git a/README.md b/README.md index 86c9593..bf666d6 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ In today's lab, we'll be creating a responsive UI for a simple drum pad app usin ![alt text](/README-images/overview.gif) -To get started, first clone this repository onto your own computer: +To get started, first download the lab zip file or clone this repository onto your own computer: git clone https://github.com/iosdecal/ios-decal-lab2 @@ -22,12 +22,12 @@ We have provided the following files for you to use. 2. `DrummerViewController.swift` in the `Controller` folder - this file contains the ViewController class that will connect our View created in Interface Builder to our Model. You will be adding code to this file in this lab. 3. `Main.storyboard` in the `View` folder - this is where you will be creating your UI elements (buttons, labels, etc) and AutoLayout Constraints. This file is automatically created for you each time you start a new Xcode project. 4. `Assets.xcassets` in the `View` folder - contains all of the images used in the app (we have only included app icon images, but if you'd like to add your own images to customize the app, add them here). This is another file that is automatically created for you each time you create a new Xcode project. -5. `Supporting Files` - contains all the audio clips we'll be using, as well as some other files we won't be using in today's lab (Ask a lab assistant if you want to learn about them!) +5. `Supporting Files` - contains all the audio clips we'll be using, as well as some other files we won't be using in today's lab (Ask a TA if you want to learn about them!) Once you've become familiar with the files in our app, open Interface Builder (`Main.storyboard`). ## Part 2 - Adding UI Elements to the View ## -We have a total of 7 drum sounds per drum kit provided, so we'll need to create 7 UI Buttons in our storyboard. +We have a total of 7 drum sounds, so we'll need to create 7 UI Buttons in our storyboard. Once you open your storyboard file, drag one 'Button' out from the `Object library` onto your empty View. @@ -40,6 +40,8 @@ You can edit how the button looks by opening the `Attributes Inspector`, which c ![alt text](/README-images/part2-2.png) + Try building your project now by pressing `Command + B` or the "Run" button at the top left corner of Xcode. You'll see that the UI looks different than it does in the Interface builder, and that there is a lot of extra white space. You can rotate the simulator by pressing `Hardware > Rotate` to reveal some more UI issues. To fix these problems, we will use AutoLayout! @@ -80,7 +82,10 @@ Now that you've finished the UI, we can now connect our View to our Model. (Note Now we can start connecting the UI elements we created in our Storyboard to our ViewController file so we can edit them programmatically. -**Open the Assistant Editor so that `Main.storyboard` and `DrummerViewController.swift` are both open.** "DrummerViewController" is the custom controller class associated with the view in `Main.storyboard`. Usually, you will have to set each of your ViewController's custom classes in the Identity Inspector in Interface Builder on your own, but we have done this step for you. +**Open the Assistant Editor (pictured below) so that `Main.storyboard` and `DrummerViewController.swift` are both open.** +![alt text](/assistant-editor.png) + +"DrummerViewController" is the custom controller class associated with the view in `Main.storyboard`. Usually, you will have to set each of your ViewController's custom classes in the Identity Inspector in Interface Builder on your own, but we have done this step for you. Since we wan't our drum pad buttons to play an audio clip when pressed, we'll want to create an *action* in our ViewController that will be called each time the user taps a button. @@ -106,7 +111,7 @@ Now we have an action method that will be called any time a user taps one of the **Once you've completed this step, each button should play a different sound clip.** If all buttons play the same sound clip, make sure you set the "Tag" property for each button correctly in Part 2. - + ## Grading ## -Once you've finished the lab, you can check-off using this form https://goo.gl/forms/2tdeDVlWMfREpNV02. If you weren't able to finish before 8pm, make sure to fill in the keyword question, and be sure to check-off next week at the beginning of lab. +Once you've finished the lab, you can check-off with one of the course staff. We will grade your work based off the following criteria (all requirements must be satisfied to receive credit).