diff --git a/MusicPlayer/.gitignore b/MusicPlayer/.gitignore new file mode 100644 index 0000000..5e26f1d --- /dev/null +++ b/MusicPlayer/.gitignore @@ -0,0 +1,134 @@ + +# Created by https://www.toptal.com/developers/gitignore/api/swift,macos,xcode +# Edit at https://www.toptal.com/developers/gitignore?templates=swift,macos,xcode + +### macOS ### +# General +.DS_Store +.AppleDouble +.LSOverride + +# Icon must end with two \r +Icon + +# Thumbnails +._* + +# Files that might appear in the root of a volume +.DocumentRevisions-V100 +.fseventsd +.Spotlight-V100 +.TemporaryItems +.Trashes +.VolumeIcon.icns +.com.apple.timemachine.donotpresent + +# Directories potentially created on remote AFP share +.AppleDB +.AppleDesktop +Network Trash Folder +Temporary Items +.apdisk + +### Swift ### +# Xcode +# +# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore + +## User settings +xcuserdata/ + +## compatibility with Xcode 8 and earlier (ignoring not required starting Xcode 9) +*.xcscmblueprint +*.xccheckout + +## compatibility with Xcode 3 and earlier (ignoring not required starting Xcode 4) +build/ +DerivedData/ +*.moved-aside +*.pbxuser +!default.pbxuser +*.mode1v3 +!default.mode1v3 +*.mode2v3 +!default.mode2v3 +*.perspectivev3 +!default.perspectivev3 + +## Obj-C/Swift specific +*.hmap + +## App packaging +*.ipa +*.dSYM.zip +*.dSYM + +## Playgrounds +timeline.xctimeline +playground.xcworkspace + +# Swift Package Manager +# Add this line if you want to avoid checking in source code from Swift Package Manager dependencies. +# Packages/ +# Package.pins +# Package.resolved +# *.xcodeproj +# Xcode automatically generates this directory with a .xcworkspacedata file and xcuserdata +# hence it is not needed unless you have added a package configuration file to your project +# .swiftpm + +.build/ + +# CocoaPods +# We recommend against adding the Pods directory to your .gitignore. However +# you should judge for yourself, the pros and cons are mentioned at: +# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control +# Pods/ +# Add this line if you want to avoid checking in source code from the Xcode workspace +# *.xcworkspace + +# Carthage +# Add this line if you want to avoid checking in source code from Carthage dependencies. +# Carthage/Checkouts + +Carthage/Build/ + +# Accio dependency management +Dependencies/ +.accio/ + +# fastlane +# It is recommended to not store the screenshots in the git repo. +# Instead, use fastlane to re-generate the screenshots whenever they are needed. +# For more information about the recommended setup visit: +# https://docs.fastlane.tools/best-practices/source-control/#source-control + +fastlane/report.xml +fastlane/Preview.html +fastlane/screenshots/**/*.png +fastlane/test_output + +# Code Injection +# After new code Injection tools there's a generated folder /iOSInjectionProject +# https://github.com/johnno1962/injectionforxcode + +iOSInjectionProject/ + +### Xcode ### +# Xcode +# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore + + + + +## Gcc Patch +/*.gcno + +### Xcode Patch ### +*.xcodeproj/* +!*.xcodeproj/project.pbxproj +!*.xcodeproj/xcshareddata/ +!*.xcworkspace/contents.xcworkspacedata +**/xcshareddata/WorkspaceSettings.xcsettings + +# End of https://www.toptal.com/developers/gitignore/api/swift,macos,xcode diff --git a/MusicPlayer/MusicPlayer.xcodeproj/project.pbxproj b/MusicPlayer/MusicPlayer.xcodeproj/project.pbxproj new file mode 100644 index 0000000..7335278 --- /dev/null +++ b/MusicPlayer/MusicPlayer.xcodeproj/project.pbxproj @@ -0,0 +1,345 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 50; + objects = { + +/* Begin PBXBuildFile section */ + A5C6443D252B2E12001797F8 /* ViewController2.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5C6443C252B2E12001797F8 /* ViewController2.swift */; }; + A5E3581C24EB87BC00AFA7EF /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5E3581B24EB87BC00AFA7EF /* AppDelegate.swift */; }; + A5E3581E24EB87BC00AFA7EF /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5E3581D24EB87BC00AFA7EF /* SceneDelegate.swift */; }; + A5E3582024EB87BC00AFA7EF /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5E3581F24EB87BC00AFA7EF /* ViewController.swift */; }; + A5E3582324EB87BC00AFA7EF /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = A5E3582124EB87BC00AFA7EF /* Main.storyboard */; }; + A5E3582524EB87BD00AFA7EF /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = A5E3582424EB87BD00AFA7EF /* Assets.xcassets */; }; + A5E3582824EB87BD00AFA7EF /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = A5E3582624EB87BD00AFA7EF /* LaunchScreen.storyboard */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + A5C6443C252B2E12001797F8 /* ViewController2.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController2.swift; sourceTree = ""; }; + A5E3581824EB87BC00AFA7EF /* MusicPlayer.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = MusicPlayer.app; sourceTree = BUILT_PRODUCTS_DIR; }; + A5E3581B24EB87BC00AFA7EF /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + A5E3581D24EB87BC00AFA7EF /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = ""; }; + A5E3581F24EB87BC00AFA7EF /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; + A5E3582224EB87BC00AFA7EF /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + A5E3582424EB87BD00AFA7EF /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + A5E3582724EB87BD00AFA7EF /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + A5E3582924EB87BD00AFA7EF /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + A5E3581524EB87BC00AFA7EF /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + A5E3580F24EB87BC00AFA7EF = { + isa = PBXGroup; + children = ( + A5E3581A24EB87BC00AFA7EF /* MusicPlayer */, + A5E3581924EB87BC00AFA7EF /* Products */, + ); + sourceTree = ""; + }; + A5E3581924EB87BC00AFA7EF /* Products */ = { + isa = PBXGroup; + children = ( + A5E3581824EB87BC00AFA7EF /* MusicPlayer.app */, + ); + name = Products; + sourceTree = ""; + }; + A5E3581A24EB87BC00AFA7EF /* MusicPlayer */ = { + isa = PBXGroup; + children = ( + A5E3581B24EB87BC00AFA7EF /* AppDelegate.swift */, + A5E3581D24EB87BC00AFA7EF /* SceneDelegate.swift */, + A5E3581F24EB87BC00AFA7EF /* ViewController.swift */, + A5C6443C252B2E12001797F8 /* ViewController2.swift */, + A5E3582124EB87BC00AFA7EF /* Main.storyboard */, + A5E3582424EB87BD00AFA7EF /* Assets.xcassets */, + A5E3582624EB87BD00AFA7EF /* LaunchScreen.storyboard */, + A5E3582924EB87BD00AFA7EF /* Info.plist */, + ); + path = MusicPlayer; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + A5E3581724EB87BC00AFA7EF /* MusicPlayer */ = { + isa = PBXNativeTarget; + buildConfigurationList = A5E3582C24EB87BD00AFA7EF /* Build configuration list for PBXNativeTarget "MusicPlayer" */; + buildPhases = ( + A5E3581424EB87BC00AFA7EF /* Sources */, + A5E3581524EB87BC00AFA7EF /* Frameworks */, + A5E3581624EB87BC00AFA7EF /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = MusicPlayer; + productName = MusicPlayer; + productReference = A5E3581824EB87BC00AFA7EF /* MusicPlayer.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + A5E3581024EB87BC00AFA7EF /* Project object */ = { + isa = PBXProject; + attributes = { + LastSwiftUpdateCheck = 1150; + LastUpgradeCheck = 1150; + ORGANIZATIONNAME = "박세란"; + TargetAttributes = { + A5E3581724EB87BC00AFA7EF = { + CreatedOnToolsVersion = 11.5; + }; + }; + }; + buildConfigurationList = A5E3581324EB87BC00AFA7EF /* Build configuration list for PBXProject "MusicPlayer" */; + compatibilityVersion = "Xcode 9.3"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = A5E3580F24EB87BC00AFA7EF; + productRefGroup = A5E3581924EB87BC00AFA7EF /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + A5E3581724EB87BC00AFA7EF /* MusicPlayer */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + A5E3581624EB87BC00AFA7EF /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + A5E3582824EB87BD00AFA7EF /* LaunchScreen.storyboard in Resources */, + A5E3582524EB87BD00AFA7EF /* Assets.xcassets in Resources */, + A5E3582324EB87BC00AFA7EF /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + A5E3581424EB87BC00AFA7EF /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + A5E3582024EB87BC00AFA7EF /* ViewController.swift in Sources */, + A5C6443D252B2E12001797F8 /* ViewController2.swift in Sources */, + A5E3581C24EB87BC00AFA7EF /* AppDelegate.swift in Sources */, + A5E3581E24EB87BC00AFA7EF /* SceneDelegate.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXVariantGroup section */ + A5E3582124EB87BC00AFA7EF /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + A5E3582224EB87BC00AFA7EF /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + A5E3582624EB87BD00AFA7EF /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + A5E3582724EB87BD00AFA7EF /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + A5E3582A24EB87BD00AFA7EF /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + 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_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = 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_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 13.5; + MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; + MTL_FAST_MATH = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + }; + name = Debug; + }; + A5E3582B24EB87BD00AFA7EF /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + 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_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = 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_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 13.5; + MTL_ENABLE_DEBUG_INFO = NO; + MTL_FAST_MATH = YES; + SDKROOT = iphoneos; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + A5E3582D24EB87BD00AFA7EF /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_STYLE = Automatic; + INFOPLIST_FILE = MusicPlayer/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = com.sery.MusicPlayer; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + A5E3582E24EB87BD00AFA7EF /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_STYLE = Automatic; + INFOPLIST_FILE = MusicPlayer/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = com.sery.MusicPlayer; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + A5E3581324EB87BC00AFA7EF /* Build configuration list for PBXProject "MusicPlayer" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + A5E3582A24EB87BD00AFA7EF /* Debug */, + A5E3582B24EB87BD00AFA7EF /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + A5E3582C24EB87BD00AFA7EF /* Build configuration list for PBXNativeTarget "MusicPlayer" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + A5E3582D24EB87BD00AFA7EF /* Debug */, + A5E3582E24EB87BD00AFA7EF /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = A5E3581024EB87BC00AFA7EF /* Project object */; +} diff --git a/MusicPlayer/MusicPlayer.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/MusicPlayer/MusicPlayer.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..404a2e3 --- /dev/null +++ b/MusicPlayer/MusicPlayer.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/MusicPlayer/MusicPlayer.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/MusicPlayer/MusicPlayer.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/MusicPlayer/MusicPlayer.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/MusicPlayer/MusicPlayer.xcodeproj/project.xcworkspace/xcuserdata/sery270.xcuserdatad/UserInterfaceState.xcuserstate b/MusicPlayer/MusicPlayer.xcodeproj/project.xcworkspace/xcuserdata/sery270.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000..03f496e Binary files /dev/null and b/MusicPlayer/MusicPlayer.xcodeproj/project.xcworkspace/xcuserdata/sery270.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/MusicPlayer/MusicPlayer.xcodeproj/xcuserdata/sery270.xcuserdatad/xcschemes/xcschememanagement.plist b/MusicPlayer/MusicPlayer.xcodeproj/xcuserdata/sery270.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..0ba9869 --- /dev/null +++ b/MusicPlayer/MusicPlayer.xcodeproj/xcuserdata/sery270.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,14 @@ + + + + + SchemeUserState + + MusicPlayer.xcscheme_^#shared#^_ + + orderHint + 0 + + + + diff --git a/MusicPlayer/MusicPlayer/AppDelegate.swift b/MusicPlayer/MusicPlayer/AppDelegate.swift new file mode 100644 index 0000000..f986cb4 --- /dev/null +++ b/MusicPlayer/MusicPlayer/AppDelegate.swift @@ -0,0 +1,37 @@ +// +// AppDelegate.swift +// MusicPlayer +// +// Created by 박세란 on 2020/08/18. +// Copyright © 2020 박세란. All rights reserved. +// + +import UIKit + +@UIApplicationMain +class AppDelegate: UIResponder, UIApplicationDelegate { + + + + func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { + // Override point for customization after application launch. + return true + } + + // MARK: UISceneSession Lifecycle + + func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration { + // Called when a new scene session is being created. + // Use this method to select a configuration to create the new scene with. + return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role) + } + + func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set) { + // Called when the user discards a scene session. + // If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions. + // Use this method to release any resources that were specific to the discarded scenes, as they will not return. + } + + +} + diff --git a/MusicPlayer/MusicPlayer/Assets.xcassets/AppIcon.appiconset/Contents.json b/MusicPlayer/MusicPlayer/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..277e85b --- /dev/null +++ b/MusicPlayer/MusicPlayer/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,158 @@ +{ + "images" : [ + { + "filename" : "NotificationIcon@2x.png", + "idiom" : "iphone", + "scale" : "2x", + "size" : "20x20" + }, + { + "filename" : "NotificationIcon@3x.png", + "idiom" : "iphone", + "scale" : "3x", + "size" : "20x20" + }, + { + "filename" : "Icon-Small.png", + "idiom" : "iphone", + "scale" : "1x", + "size" : "29x29" + }, + { + "filename" : "Icon-Small@2x.png", + "idiom" : "iphone", + "scale" : "2x", + "size" : "29x29" + }, + { + "filename" : "Icon-Small@3x.png", + "idiom" : "iphone", + "scale" : "3x", + "size" : "29x29" + }, + { + "filename" : "Icon-40@2x.png", + "idiom" : "iphone", + "scale" : "2x", + "size" : "40x40" + }, + { + "filename" : "Icon-40@3x.png", + "idiom" : "iphone", + "scale" : "3x", + "size" : "40x40" + }, + { + "filename" : "Icon.png", + "idiom" : "iphone", + "scale" : "1x", + "size" : "57x57" + }, + { + "filename" : "Icon@2x.png", + "idiom" : "iphone", + "scale" : "2x", + "size" : "57x57" + }, + { + "filename" : "Icon-60@2x.png", + "idiom" : "iphone", + "scale" : "2x", + "size" : "60x60" + }, + { + "filename" : "Icon-60@3x.png", + "idiom" : "iphone", + "scale" : "3x", + "size" : "60x60" + }, + { + "filename" : "NotificationIcon~ipad.png", + "idiom" : "ipad", + "scale" : "1x", + "size" : "20x20" + }, + { + "filename" : "NotificationIcon~ipad@2x.png", + "idiom" : "ipad", + "scale" : "2x", + "size" : "20x20" + }, + { + "filename" : "Icon-Small.png", + "idiom" : "ipad", + "scale" : "1x", + "size" : "29x29" + }, + { + "filename" : "Icon-Small@2x.png", + "idiom" : "ipad", + "scale" : "2x", + "size" : "29x29" + }, + { + "filename" : "Icon-40.png", + "idiom" : "ipad", + "scale" : "1x", + "size" : "40x40" + }, + { + "filename" : "Icon-40@2x.png", + "idiom" : "ipad", + "scale" : "2x", + "size" : "40x40" + }, + { + "filename" : "Icon-Small-50.png", + "idiom" : "ipad", + "scale" : "1x", + "size" : "50x50" + }, + { + "filename" : "Icon-Small-50@2x.png", + "idiom" : "ipad", + "scale" : "2x", + "size" : "50x50" + }, + { + "filename" : "Icon-72.png", + "idiom" : "ipad", + "scale" : "1x", + "size" : "72x72" + }, + { + "filename" : "Icon-72@2x.png", + "idiom" : "ipad", + "scale" : "2x", + "size" : "72x72" + }, + { + "filename" : "Icon-76.png", + "idiom" : "ipad", + "scale" : "1x", + "size" : "76x76" + }, + { + "filename" : "Icon-76@2x.png", + "idiom" : "ipad", + "scale" : "2x", + "size" : "76x76" + }, + { + "filename" : "Icon-83.5@2x.png", + "idiom" : "ipad", + "scale" : "2x", + "size" : "83.5x83.5" + }, + { + "filename" : "ios-marketing.png", + "idiom" : "ios-marketing", + "scale" : "1x", + "size" : "1024x1024" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/MusicPlayer/MusicPlayer/Assets.xcassets/AppIcon.appiconset/Icon-40.png b/MusicPlayer/MusicPlayer/Assets.xcassets/AppIcon.appiconset/Icon-40.png new file mode 100644 index 0000000..8d8b6d4 Binary files /dev/null and b/MusicPlayer/MusicPlayer/Assets.xcassets/AppIcon.appiconset/Icon-40.png differ diff --git a/MusicPlayer/MusicPlayer/Assets.xcassets/AppIcon.appiconset/Icon-40@2x.png b/MusicPlayer/MusicPlayer/Assets.xcassets/AppIcon.appiconset/Icon-40@2x.png new file mode 100644 index 0000000..805d002 Binary files /dev/null and b/MusicPlayer/MusicPlayer/Assets.xcassets/AppIcon.appiconset/Icon-40@2x.png differ diff --git a/MusicPlayer/MusicPlayer/Assets.xcassets/AppIcon.appiconset/Icon-40@3x.png b/MusicPlayer/MusicPlayer/Assets.xcassets/AppIcon.appiconset/Icon-40@3x.png new file mode 100644 index 0000000..cbce3f7 Binary files /dev/null and b/MusicPlayer/MusicPlayer/Assets.xcassets/AppIcon.appiconset/Icon-40@3x.png differ diff --git a/MusicPlayer/MusicPlayer/Assets.xcassets/AppIcon.appiconset/Icon-60@2x.png b/MusicPlayer/MusicPlayer/Assets.xcassets/AppIcon.appiconset/Icon-60@2x.png new file mode 100644 index 0000000..cbce3f7 Binary files /dev/null and b/MusicPlayer/MusicPlayer/Assets.xcassets/AppIcon.appiconset/Icon-60@2x.png differ diff --git a/MusicPlayer/MusicPlayer/Assets.xcassets/AppIcon.appiconset/Icon-60@3x.png b/MusicPlayer/MusicPlayer/Assets.xcassets/AppIcon.appiconset/Icon-60@3x.png new file mode 100644 index 0000000..acc48a8 Binary files /dev/null and b/MusicPlayer/MusicPlayer/Assets.xcassets/AppIcon.appiconset/Icon-60@3x.png differ diff --git a/MusicPlayer/MusicPlayer/Assets.xcassets/AppIcon.appiconset/Icon-72.png b/MusicPlayer/MusicPlayer/Assets.xcassets/AppIcon.appiconset/Icon-72.png new file mode 100644 index 0000000..1d8555e Binary files /dev/null and b/MusicPlayer/MusicPlayer/Assets.xcassets/AppIcon.appiconset/Icon-72.png differ diff --git a/MusicPlayer/MusicPlayer/Assets.xcassets/AppIcon.appiconset/Icon-72@2x.png b/MusicPlayer/MusicPlayer/Assets.xcassets/AppIcon.appiconset/Icon-72@2x.png new file mode 100644 index 0000000..a158a97 Binary files /dev/null and b/MusicPlayer/MusicPlayer/Assets.xcassets/AppIcon.appiconset/Icon-72@2x.png differ diff --git a/MusicPlayer/MusicPlayer/Assets.xcassets/AppIcon.appiconset/Icon-76.png b/MusicPlayer/MusicPlayer/Assets.xcassets/AppIcon.appiconset/Icon-76.png new file mode 100644 index 0000000..2384ec1 Binary files /dev/null and b/MusicPlayer/MusicPlayer/Assets.xcassets/AppIcon.appiconset/Icon-76.png differ diff --git a/MusicPlayer/MusicPlayer/Assets.xcassets/AppIcon.appiconset/Icon-76@2x.png b/MusicPlayer/MusicPlayer/Assets.xcassets/AppIcon.appiconset/Icon-76@2x.png new file mode 100644 index 0000000..8d68038 Binary files /dev/null and b/MusicPlayer/MusicPlayer/Assets.xcassets/AppIcon.appiconset/Icon-76@2x.png differ diff --git a/MusicPlayer/MusicPlayer/Assets.xcassets/AppIcon.appiconset/Icon-83.5@2x.png b/MusicPlayer/MusicPlayer/Assets.xcassets/AppIcon.appiconset/Icon-83.5@2x.png new file mode 100644 index 0000000..78e342b Binary files /dev/null and b/MusicPlayer/MusicPlayer/Assets.xcassets/AppIcon.appiconset/Icon-83.5@2x.png differ diff --git a/MusicPlayer/MusicPlayer/Assets.xcassets/AppIcon.appiconset/Icon-Small-50.png b/MusicPlayer/MusicPlayer/Assets.xcassets/AppIcon.appiconset/Icon-Small-50.png new file mode 100644 index 0000000..c18f738 Binary files /dev/null and b/MusicPlayer/MusicPlayer/Assets.xcassets/AppIcon.appiconset/Icon-Small-50.png differ diff --git a/MusicPlayer/MusicPlayer/Assets.xcassets/AppIcon.appiconset/Icon-Small-50@2x.png b/MusicPlayer/MusicPlayer/Assets.xcassets/AppIcon.appiconset/Icon-Small-50@2x.png new file mode 100644 index 0000000..f41e7ca Binary files /dev/null and b/MusicPlayer/MusicPlayer/Assets.xcassets/AppIcon.appiconset/Icon-Small-50@2x.png differ diff --git a/MusicPlayer/MusicPlayer/Assets.xcassets/AppIcon.appiconset/Icon-Small.png b/MusicPlayer/MusicPlayer/Assets.xcassets/AppIcon.appiconset/Icon-Small.png new file mode 100644 index 0000000..f77764d Binary files /dev/null and b/MusicPlayer/MusicPlayer/Assets.xcassets/AppIcon.appiconset/Icon-Small.png differ diff --git a/MusicPlayer/MusicPlayer/Assets.xcassets/AppIcon.appiconset/Icon-Small@2x.png b/MusicPlayer/MusicPlayer/Assets.xcassets/AppIcon.appiconset/Icon-Small@2x.png new file mode 100644 index 0000000..9afb48d Binary files /dev/null and b/MusicPlayer/MusicPlayer/Assets.xcassets/AppIcon.appiconset/Icon-Small@2x.png differ diff --git a/MusicPlayer/MusicPlayer/Assets.xcassets/AppIcon.appiconset/Icon-Small@3x.png b/MusicPlayer/MusicPlayer/Assets.xcassets/AppIcon.appiconset/Icon-Small@3x.png new file mode 100644 index 0000000..6127d36 Binary files /dev/null and b/MusicPlayer/MusicPlayer/Assets.xcassets/AppIcon.appiconset/Icon-Small@3x.png differ diff --git a/MusicPlayer/MusicPlayer/Assets.xcassets/AppIcon.appiconset/Icon.png b/MusicPlayer/MusicPlayer/Assets.xcassets/AppIcon.appiconset/Icon.png new file mode 100644 index 0000000..0d21ad1 Binary files /dev/null and b/MusicPlayer/MusicPlayer/Assets.xcassets/AppIcon.appiconset/Icon.png differ diff --git a/MusicPlayer/MusicPlayer/Assets.xcassets/AppIcon.appiconset/Icon@2x.png b/MusicPlayer/MusicPlayer/Assets.xcassets/AppIcon.appiconset/Icon@2x.png new file mode 100644 index 0000000..a6654d0 Binary files /dev/null and b/MusicPlayer/MusicPlayer/Assets.xcassets/AppIcon.appiconset/Icon@2x.png differ diff --git a/MusicPlayer/MusicPlayer/Assets.xcassets/AppIcon.appiconset/NotificationIcon@2x.png b/MusicPlayer/MusicPlayer/Assets.xcassets/AppIcon.appiconset/NotificationIcon@2x.png new file mode 100644 index 0000000..8d8b6d4 Binary files /dev/null and b/MusicPlayer/MusicPlayer/Assets.xcassets/AppIcon.appiconset/NotificationIcon@2x.png differ diff --git a/MusicPlayer/MusicPlayer/Assets.xcassets/AppIcon.appiconset/NotificationIcon@3x.png b/MusicPlayer/MusicPlayer/Assets.xcassets/AppIcon.appiconset/NotificationIcon@3x.png new file mode 100644 index 0000000..0f6b17a Binary files /dev/null and b/MusicPlayer/MusicPlayer/Assets.xcassets/AppIcon.appiconset/NotificationIcon@3x.png differ diff --git a/MusicPlayer/MusicPlayer/Assets.xcassets/AppIcon.appiconset/NotificationIcon~ipad.png b/MusicPlayer/MusicPlayer/Assets.xcassets/AppIcon.appiconset/NotificationIcon~ipad.png new file mode 100644 index 0000000..2799bc7 Binary files /dev/null and b/MusicPlayer/MusicPlayer/Assets.xcassets/AppIcon.appiconset/NotificationIcon~ipad.png differ diff --git a/MusicPlayer/MusicPlayer/Assets.xcassets/AppIcon.appiconset/NotificationIcon~ipad@2x.png b/MusicPlayer/MusicPlayer/Assets.xcassets/AppIcon.appiconset/NotificationIcon~ipad@2x.png new file mode 100644 index 0000000..8d8b6d4 Binary files /dev/null and b/MusicPlayer/MusicPlayer/Assets.xcassets/AppIcon.appiconset/NotificationIcon~ipad@2x.png differ diff --git a/MusicPlayer/MusicPlayer/Assets.xcassets/AppIcon.appiconset/ios-marketing.png b/MusicPlayer/MusicPlayer/Assets.xcassets/AppIcon.appiconset/ios-marketing.png new file mode 100644 index 0000000..216c018 Binary files /dev/null and b/MusicPlayer/MusicPlayer/Assets.xcassets/AppIcon.appiconset/ios-marketing.png differ diff --git a/MusicPlayer/MusicPlayer/Assets.xcassets/Contents.json b/MusicPlayer/MusicPlayer/Assets.xcassets/Contents.json new file mode 100644 index 0000000..73c0059 --- /dev/null +++ b/MusicPlayer/MusicPlayer/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/MusicPlayer/MusicPlayer/Assets.xcassets/button_pause.imageset/Contents.json b/MusicPlayer/MusicPlayer/Assets.xcassets/button_pause.imageset/Contents.json new file mode 100644 index 0000000..b6ab699 --- /dev/null +++ b/MusicPlayer/MusicPlayer/Assets.xcassets/button_pause.imageset/Contents.json @@ -0,0 +1,15 @@ +{ + "images" : [ + { + "filename" : "button_pause.pdf", + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + }, + "properties" : { + "preserves-vector-representation" : true + } +} diff --git a/MusicPlayer/MusicPlayer/Assets.xcassets/button_pause.imageset/button_pause.pdf b/MusicPlayer/MusicPlayer/Assets.xcassets/button_pause.imageset/button_pause.pdf new file mode 100644 index 0000000..fe2e4f3 Binary files /dev/null and b/MusicPlayer/MusicPlayer/Assets.xcassets/button_pause.imageset/button_pause.pdf differ diff --git a/MusicPlayer/MusicPlayer/Assets.xcassets/button_play.imageset/Contents.json b/MusicPlayer/MusicPlayer/Assets.xcassets/button_play.imageset/Contents.json new file mode 100644 index 0000000..f5cbd27 --- /dev/null +++ b/MusicPlayer/MusicPlayer/Assets.xcassets/button_play.imageset/Contents.json @@ -0,0 +1,15 @@ +{ + "images" : [ + { + "filename" : "button_play.pdf", + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + }, + "properties" : { + "preserves-vector-representation" : true + } +} diff --git a/MusicPlayer/MusicPlayer/Assets.xcassets/button_play.imageset/button_play.pdf b/MusicPlayer/MusicPlayer/Assets.xcassets/button_play.imageset/button_play.pdf new file mode 100644 index 0000000..ce2dee6 Binary files /dev/null and b/MusicPlayer/MusicPlayer/Assets.xcassets/button_play.imageset/button_play.pdf differ diff --git a/MusicPlayer/MusicPlayer/Assets.xcassets/sound.dataset/Contents.json b/MusicPlayer/MusicPlayer/Assets.xcassets/sound.dataset/Contents.json new file mode 100644 index 0000000..5365345 --- /dev/null +++ b/MusicPlayer/MusicPlayer/Assets.xcassets/sound.dataset/Contents.json @@ -0,0 +1,12 @@ +{ + "data" : [ + { + "filename" : "sound.mp3", + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/MusicPlayer/MusicPlayer/Assets.xcassets/sound.dataset/sound.mp3 b/MusicPlayer/MusicPlayer/Assets.xcassets/sound.dataset/sound.mp3 new file mode 100644 index 0000000..558d405 Binary files /dev/null and b/MusicPlayer/MusicPlayer/Assets.xcassets/sound.dataset/sound.mp3 differ diff --git a/MusicPlayer/MusicPlayer/Base.lproj/LaunchScreen.storyboard b/MusicPlayer/MusicPlayer/Base.lproj/LaunchScreen.storyboard new file mode 100644 index 0000000..865e932 --- /dev/null +++ b/MusicPlayer/MusicPlayer/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/MusicPlayer/MusicPlayer/Base.lproj/Main.storyboard b/MusicPlayer/MusicPlayer/Base.lproj/Main.storyboard new file mode 100644 index 0000000..950bb6f --- /dev/null +++ b/MusicPlayer/MusicPlayer/Base.lproj/Main.storyboard @@ -0,0 +1,88 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/MusicPlayer/MusicPlayer/Info.plist b/MusicPlayer/MusicPlayer/Info.plist new file mode 100644 index 0000000..2a3483c --- /dev/null +++ b/MusicPlayer/MusicPlayer/Info.plist @@ -0,0 +1,64 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + $(PRODUCT_BUNDLE_PACKAGE_TYPE) + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1 + LSRequiresIPhoneOS + + UIApplicationSceneManifest + + UIApplicationSupportsMultipleScenes + + UISceneConfigurations + + UIWindowSceneSessionRoleApplication + + + UISceneConfigurationName + Default Configuration + UISceneDelegateClassName + $(PRODUCT_MODULE_NAME).SceneDelegate + UISceneStoryboardFile + Main + + + + + UILaunchStoryboardName + LaunchScreen + UIMainStoryboardFile + Main + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/MusicPlayer/MusicPlayer/SceneDelegate.swift b/MusicPlayer/MusicPlayer/SceneDelegate.swift new file mode 100644 index 0000000..cf847fa --- /dev/null +++ b/MusicPlayer/MusicPlayer/SceneDelegate.swift @@ -0,0 +1,53 @@ +// +// SceneDelegate.swift +// MusicPlayer +// +// Created by 박세란 on 2020/08/18. +// Copyright © 2020 박세란. All rights reserved. +// + +import UIKit + +class SceneDelegate: UIResponder, UIWindowSceneDelegate { + + var window: UIWindow? + + + func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) { + // Use this method to optionally configure and attach the UIWindow `window` to the provided UIWindowScene `scene`. + // If using a storyboard, the `window` property will automatically be initialized and attached to the scene. + // This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead). + guard let _ = (scene as? UIWindowScene) else { return } + } + + func sceneDidDisconnect(_ scene: UIScene) { + // Called as the scene is being released by the system. + // This occurs shortly after the scene enters the background, or when its session is discarded. + // Release any resources associated with this scene that can be re-created the next time the scene connects. + // The scene may re-connect later, as its session was not neccessarily discarded (see `application:didDiscardSceneSessions` instead). + } + + func sceneDidBecomeActive(_ scene: UIScene) { + // Called when the scene has moved from an inactive state to an active state. + // Use this method to restart any tasks that were paused (or not yet started) when the scene was inactive. + } + + func sceneWillResignActive(_ scene: UIScene) { + // Called when the scene will move from an active state to an inactive state. + // This may occur due to temporary interruptions (ex. an incoming phone call). + } + + func sceneWillEnterForeground(_ scene: UIScene) { + // Called as the scene transitions from the background to the foreground. + // Use this method to undo the changes made on entering the background. + } + + func sceneDidEnterBackground(_ scene: UIScene) { + // Called as the scene transitions from the foreground to the background. + // Use this method to save data, release shared resources, and store enough scene-specific state information + // to restore the scene back to its current state. + } + + +} + diff --git a/MusicPlayer/MusicPlayer/SecondViewController.swift b/MusicPlayer/MusicPlayer/SecondViewController.swift new file mode 100644 index 0000000..1f23c7c --- /dev/null +++ b/MusicPlayer/MusicPlayer/SecondViewController.swift @@ -0,0 +1,30 @@ +// +// SecondViewController.swift +// MusicPlayer +// +// Created by 박세란 on 2020/09/28. +// Copyright © 2020 박세란. All rights reserved. +// + +import UIKit + +class SecondViewController: UIViewController { + + override func viewDidLoad() { + super.viewDidLoad() + + // Do any additional setup after loading the view. + } + + + /* + // MARK: - Navigation + + // In a storyboard-based application, you will often want to do a little preparation before navigation + override func prepare(for segue: UIStoryboardSegue, sender: Any?) { + // Get the new view controller using segue.destination. + // Pass the selected object to the new view controller. + } + */ + +} diff --git a/MusicPlayer/MusicPlayer/ViewController.swift b/MusicPlayer/MusicPlayer/ViewController.swift new file mode 100644 index 0000000..d5982fa --- /dev/null +++ b/MusicPlayer/MusicPlayer/ViewController.swift @@ -0,0 +1,244 @@ +// +// ViewController.swift +// MusicPlayer +// +// Created by 박세란 on 2020/08/18. +// Copyright © 2020 박세란. All rights reserved. +// + +import UIKit +import AVFoundation + +class ViewController: UIViewController, AVAudioPlayerDelegate { + + // MARK:- PROPERTIES + var player: AVAudioPlayer! + var timer: Timer! + + // MARK: IBOutlets + //인터페이스 빌더에 올려뒀던, UI 인터페이스 요소랑 연결할 프로퍼티 + //인스턴스 프로퍼티 이므로, 인스턴스 프로퍼티 네이밍 룰을 따른다. + @IBOutlet var playPauseButton: UIButton! + @IBOutlet var timeLabel: UILabel! + @IBOutlet var progressSlider: UISlider! + + // MARK:- METHODS + // MARK: Custom method + //플레이어를 초기화하는 메서드 + func initializePlayer(){ + + guard let soundAsset: NSDataAsset = NSDataAsset(name: "sound") else{ + print("음원 파일 에셋을 가져올 수 없습니다.") + return + } + + do{ + try self.player = AVAudioPlayer(data: soundAsset.data) + self.player.delegate = self + } catch let error as NSError { + print("플레이어 초기화 실패") + print("코드 : \(error.code), 메세지 : \(error.localizedDescription)") + } + + self.progressSlider.maximumValue = Float(self.player.duration) + self.progressSlider.minimumValue = 0 + self.progressSlider.value = Float(self.player.currentTime) + } + //레이블을 매초마다 업데이트하는 메서드 + func updateTimeLableText(time: TimeInterval){ + let minute: Int = Int(time / 60) + let second: Int = Int(time.truncatingRemainder(dividingBy: 60)) + let milisecond: Int = Int(time.truncatingRemainder(dividingBy: 1) * 100) + + let timeText: String = String(format: "%02ld:%02ld:%02ld", minute,second,milisecond) + + self.timeLabel.text = timeText + } + + //타이머를 만들고 수행할 메서드 + func makeAndFireTimer() { + self.timer = Timer.scheduledTimer(withTimeInterval: 0.01, repeats: true, block: {[unowned self] + (timer: Timer) in + + if self.progressSlider.isTracking {return} + + self.updateTimeLableText(time:self.player.currentTime) + self.progressSlider.value = Float(self.player.currentTime) + }) + self.timer.fire() + } + + + //타이머를 해제할 메서드 + func invalidateTiemr(){ + self.timer.invalidate() + self.timer = nil + } + + func addViewsWithCode() { + self.addPlayPauseButton() + self.addTimeLabel() + self.addProgressSlider() + } + + func addPlayPauseButton(){ + + let button: UIButton = UIButton(type: UIButton.ButtonType.custom) + button.translatesAutoresizingMaskIntoConstraints = false + + self.view.addSubview(button) + + button.setImage(UIImage(named: "button_play"), for: UIControl.State.normal) + button.setImage(UIImage(named: "button_pause"), for: UIControl.State.selected) + + button.addTarget(self, action: #selector(self.touchUpPlayPauseButton(_:)), for: UIControl.Event.touchUpInside) + + let centerX: NSLayoutConstraint + centerX = button.centerXAnchor.constraint(equalTo: self.view.centerXAnchor) + + let centerY: NSLayoutConstraint + centerY = NSLayoutConstraint(item: button, attribute: NSLayoutConstraint.Attribute.centerY, relatedBy: NSLayoutConstraint.Relation.equal, toItem: self.view, attribute: NSLayoutConstraint.Attribute.centerY, multiplier: 0.8, constant: 0) + + let width: NSLayoutConstraint + width = button.widthAnchor.constraint(equalTo: self.view.widthAnchor, multiplier: 0.5) + + let ratio: NSLayoutConstraint + ratio = button.heightAnchor.constraint(equalTo: button.widthAnchor, multiplier: 1) + + centerX.isActive = true + centerY.isActive = true + width.isActive = true + ratio.isActive = true + + self.playPauseButton = button + } + + + func addTimeLabel(){ + let timeLabel: UILabel = UILabel() + timeLabel.translatesAutoresizingMaskIntoConstraints = false + + self.view.addSubview(timeLabel) + + timeLabel.textColor = UIColor.black + timeLabel.textAlignment = NSTextAlignment.center + timeLabel.font = UIFont.preferredFont(forTextStyle: UIFont.TextStyle.headline) + + let centerX: NSLayoutConstraint + centerX = timeLabel.centerXAnchor.constraint(equalTo:self.playPauseButton.centerXAnchor) + + let top: NSLayoutConstraint + top = timeLabel.topAnchor.constraint(equalTo: self.playPauseButton.bottomAnchor, constant: 8) + + centerX.isActive = true + top.isActive = true + + self.timeLabel = timeLabel + self.updateTimeLableText(time: 0) + } + + func addProgressSlider(){ + + let slider: UISlider = UISlider() + slider.translatesAutoresizingMaskIntoConstraints = false + + self.view.addSubview(slider) + + slider.minimumTrackTintColor = UIColor.red + + slider.addTarget(self, action: #selector(self.sliderValueChanged(_:)), for: UIControl.Event.valueChanged) + + let safeAreaGuide: UILayoutGuide = self.view.safeAreaLayoutGuide + + let centerX: NSLayoutConstraint + centerX = slider.centerXAnchor.constraint(equalTo: self.timeLabel.centerXAnchor) + + let top: NSLayoutConstraint + top = slider.topAnchor.constraint(equalTo: self.timeLabel.bottomAnchor, constant: 8) + + let leading: NSLayoutConstraint + leading = slider.leadingAnchor.constraint(equalTo: safeAreaGuide.leadingAnchor, constant: 16) + + let trailing: NSLayoutConstraint + trailing = slider.trailingAnchor.constraint(equalTo: safeAreaGuide.trailingAnchor, constant: -16) + + centerX.isActive = true + top.isActive = true + leading.isActive = true + trailing.isActive = true + + self.progressSlider = slider + } + + // MARK: AVAudioPlayerDelegate + //오디오 플레이어 디코드 + func audioPlayerDecodeErrorDidOccur(_ player: AVAudioPlayer, error: Error?) { + + guard let error: Error = error else { + print("오디오 플레이어 디코드 오류발생") + return + } + + let message: String + message = "오디오 플레이어 오류발생 \(error.localizedDescription)" + + let alert: UIAlertController = UIAlertController(title: "", message: message, preferredStyle: UIAlertController.Style.alert) + let okAction: UIAlertAction = UIAlertAction(title: "", style: UIAlertAction.Style.default) { (action: UIAlertAction) -> Void in + self.dismiss(animated: true, completion: nil) + } + + alert.addAction(okAction) + self.present(alert, animated: true, completion: nil) + } + + + //오디오 플레이어가 재생을 끝냈을때 실행할 메서드 + func audioPlayerDidFinishPlaying(_ player: AVAudioPlayer, successfully flag: Bool) { + self.playPauseButton.isSelected = false + self.progressSlider.value = 0 + self.updateTimeLableText(time: 0) + self.invalidateTiemr() + } + + + + // MARK: Life Cycle + override func viewDidLoad() { + super.viewDidLoad() + // Do any additional setup after loading the view. + self.addViewsWithCode() + self.initializePlayer() + + + } + + override func didReceiveMemoryWarning() { + super.didReceiveMemoryWarning() + } + + // MARK: IBActions + @IBAction func touchUpPlayPauseButton(_ sender: UIButton){ + + sender.isSelected = !sender.isSelected + + if sender.isSelected { + self.player!.play() + } else { + self.player!.pause() + } + + if sender.isSelected { + self.makeAndFireTimer() + } else { + self.invalidateTiemr() + // self.initializePlayer() => 버튼 누르면 처음으로 돌아감 + } + } + + @IBAction func sliderValueChanged(_ sender: UISlider) { + + self.updateTimeLableText(time: TimeInterval(sender.value)) + if sender.isTracking {return} + self.player.currentTime = TimeInterval(sender.value) + } +} diff --git a/MusicPlayer/MusicPlayer/ViewController2.swift b/MusicPlayer/MusicPlayer/ViewController2.swift new file mode 100644 index 0000000..9358d77 --- /dev/null +++ b/MusicPlayer/MusicPlayer/ViewController2.swift @@ -0,0 +1,38 @@ +// +// ViewController2.swift +// MusicPlayer +// +// Created by 박세란 on 2020/10/05. +// Copyright © 2020 박세란. All rights reserved. +// + +import UIKit + +class ViewController2: UIViewController { + + // MARK: IBOutlets + //인터페이스 빌더에 올려뒀던, UI 인터페이스 요소랑 연결할 프로퍼티 + //인스턴스 프로퍼티 이므로, 인스턴스 프로퍼티 네이밍 룰을 따른다. + @IBOutlet var playPauseButton: UIButton! + @IBOutlet var timeLabel: UILabel! + @IBOutlet var progressSlider: UISlider! + + override func viewDidLoad() { + super.viewDidLoad() + + // Do any additional setup after loading the view. + } + + override func didReceiveMemoryWarning() { + super.didReceiveMemoryWarning() + } + + @IBAction func touchUpPlayPauseButton( + _sender: UIButton) { + print("btn tapped") + } + + @IBAction func sliderValueChangedOne(_sender: UISlider) { + print("slider value changed") + } +} diff --git a/README.md b/README.md index 38eca71..07d0403 100644 --- a/README.md +++ b/README.md @@ -50,3 +50,47 @@ - XCode에서 각각의 브랜치 및 프로젝트를 생성해서 리모트에 올려두었다. 그 과정에서 불필요한 파일들도 같이 푸쉬되었는데, gitignore로 충돌을 예방할 수 있다고 한다. - [https://www.toptal.com/developers/gitignore/api/macos,swift,xcode](https://www.toptal.com/developers/gitignore/api/macos,swift,xcode) + +### 🌿 2020/08/14 월 + +- 에셋 카탈로그(Asset Catalog)란 Asstes.xcassets 폴더를 부르는 명칭이다. 이 폴더에서 애플리케이션에 사용될 다양한 에셋을 관리한다. 이는 에셋과 다양한 디바이스의 속성(디바이스의 특징, 사이즈 클래스, 주문형 리소스, 특정 타입 등)에 대한 파일의 연결을(mapping) 통해서 애플리케이션 리소스(이미지, 음악 등)에 쉽게 접근할 수 있도록 도와줍니다. + - 에셋 카탈로그의 구성 3가지 + + > Folders: 폴더 이름에 에셋 타입의 확장자가 들어간다. + + > JSON files: 속성에 대한 정보 + + > Content files : 리소스 + +- 앱 시닝(App Thinning)이란 애플리케이션이 디바이스에 설치될 때 앱 스토어와 운영체제가 그 디바이스의 특성에 맞게 설치하도록 하는 설치 최적화 기술으로, 설치용량을 최소화하고 다운로드의 속도를 향상시킨다는 장점이 있다. + - 앱 시닝(App Thinning)의 구성 3가지 + + > 슬라이싱(slicing) + + > 비트코드(bitcode) + + > 주문형 리소스(on-demand resource) + +- 슬라이싱(slicing)이란 애플리케이션이 지원하는 다양한 디바이스에 대한 여러 조각의 애플리케이션 번들(app bundle)을 생성하고 디바이스에 알맞은 조각을 전달하는 기술으로, 개발자가 iTunes Connect에 올린 에플리케이션의 전체 버전을, 앱 스토어가 각 디바이스에 최적화된 버전의 조각으로 생성하는 것이다. 앱 시닝의 기술 중 하나이다. + +### 🌿 2020/08/20 목 + +- 인터페이스 빌더로 화면을 구성해보고, 인터페이스 빌더의 객체를 코드와 연결해보았다. (IBOutlet) + +![IMG_0219B9AF2F49-1](https://user-images.githubusercontent.com/59532818/90746300-6f51d200-e30b-11ea-8685-299afba09190.jpeg) + +- 인터페이스 빌더란 쉽게 말해서 .storyboard로 끝나는 파일들이다. *이는 마치 안드로이드의 xml 파일들에 해당하는 것 같다.* 이 인터페이스 빌더를 통해 화면을 구성할 수 있다. + - 작업 영역: Main.storyBoard + - 오브젝트 라이브러리에서 특정 객체(버튼, 레이블, 슬라이드 바 등등)를 선택하여 하면에 추가할 수 있다. + - 또한 해당 객체들의 속성을 변경하여 이름, 색상, 글꼴 등등을 설정할 수 있고, 에셋을 이미지로 설정할 수 있다. +- @IBOutlet 모디파이어를 통해 인터페이스 빌더로 만들 화면, 그 화면 속의 객체들을 코드와 연결시킬 수 있다. 방법은 크게 3가지이다. *이 과정은 마치 안드로이드의 inflate하는 과정에 해당하는 것 같다*. + - 작업 영역: ViewController.swift + - 코드로 먼저 IBOutlet을 생성한 후 인터페이스 빌더의 Outlet Inspector를 통해 연결 + - 코드로 먼저 IBOutlet을 생성한 후 인터페이스 빌더에서 View Controller 우클릭 후 팝업에서 연결 + - 인터페이스 빌더에서 코드로 끌어당겨 연결 +- 주의 사항으로는, 이 연결 작업 후 프로퍼티의 이름을 변경하면 연결 정보가 깨진다. 따라서 아래 방법으로 이름을 변경해야한다. + - refactor > rename + + ![https://user-images.githubusercontent.com/59532818/90746242-6b25b480-e30b-11ea-8a2d-8a8451a22352.png](https://user-images.githubusercontent.com/59532818/90746242-6b25b480-e30b-11ea-8a2d-8a8451a22352.png) + + - 이름 변경 후, 다시 연결 작업