├── .gitignore ├── README.md ├── SpotifyPlayer.xcodeproj ├── project.pbxproj └── project.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ └── IDEWorkspaceChecks.plist ├── SpotifyPlayer ├── Resources │ ├── Assets.xcassets │ │ ├── AppIcon.appiconset │ │ │ └── Contents.json │ │ ├── Contents.json │ │ ├── albums │ │ │ ├── 18.imageset │ │ │ │ ├── 18.png │ │ │ │ └── Contents.json │ │ │ ├── Contents.json │ │ │ ├── all.imageset │ │ │ │ ├── Contents.json │ │ │ │ └── all.png │ │ │ ├── hotel.imageset │ │ │ │ ├── Contents.json │ │ │ │ └── hotel.png │ │ │ ├── playa.imageset │ │ │ │ ├── Contents.json │ │ │ │ └── play.png │ │ │ └── playb.imageset │ │ │ │ ├── Contents.json │ │ │ │ └── playb.png │ │ ├── colors │ │ │ ├── Contents.json │ │ │ ├── gradientEnd.colorset │ │ │ │ └── Contents.json │ │ │ ├── gradientStart.colorset │ │ │ │ └── Contents.json │ │ │ ├── primaryBackgroundColor.colorset │ │ │ │ └── Contents.json │ │ │ ├── primaryTextColor.colorset │ │ │ │ └── Contents.json │ │ │ ├── secondaryBackgroundColor.colorset │ │ │ │ └── Contents.json │ │ │ ├── secondaryTextColor.colorset │ │ │ │ └── Contents.json │ │ │ ├── secondaryTintColor.colorset │ │ │ │ └── Contents.json │ │ │ └── tintColor.colorset │ │ │ │ └── Contents.json │ │ └── moby.imageset │ │ │ ├── Contents.json │ │ │ └── moby.jpg │ ├── Base.lproj │ │ ├── LaunchScreen.storyboard │ │ └── Main.storyboard │ ├── Info.plist │ └── PlayerViewController.xib └── Sources │ ├── AppDelegate.swift │ ├── Array+UIViewPropertyAnimator.swift │ ├── MusicViewController.swift │ ├── PlayerViewController.swift │ ├── TabBarController.swift │ ├── TransitionCoordinator.swift │ └── UIViewController+Utils.swift └── screenshots └── demo.gif /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | # 3 | # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore 4 | 5 | ## Build generated 6 | build/ 7 | DerivedData/ 8 | 9 | ## Various settings 10 | *.pbxuser 11 | !default.pbxuser 12 | *.mode1v3 13 | !default.mode1v3 14 | *.mode2v3 15 | !default.mode2v3 16 | *.perspectivev3 17 | !default.perspectivev3 18 | xcuserdata/ 19 | 20 | ## Other 21 | *.moved-aside 22 | *.xccheckout 23 | *.xcscmblueprint 24 | 25 | ## Obj-C/Swift specific 26 | *.hmap 27 | *.ipa 28 | *.dSYM.zip 29 | *.dSYM 30 | 31 | ## Playgrounds 32 | timeline.xctimeline 33 | playground.xcworkspace 34 | 35 | # Swift Package Manager 36 | # 37 | # Add this line if you want to avoid checking in source code from Swift Package Manager dependencies. 38 | # Packages/ 39 | # Package.pins 40 | # Package.resolved 41 | .build/ 42 | 43 | # CocoaPods 44 | # 45 | # We recommend against adding the Pods directory to your .gitignore. However 46 | # you should judge for yourself, the pros and cons are mentioned at: 47 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control 48 | # 49 | # Pods/ 50 | 51 | # Carthage 52 | # 53 | # Add this line if you want to avoid checking in source code from Carthage dependencies. 54 | # Carthage/Checkouts 55 | 56 | Carthage/Build 57 | 58 | # fastlane 59 | # 60 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the 61 | # screenshots whenever they are needed. 62 | # For more information about the recommended setup visit: 63 | # https://docs.fastlane.tools/best-practices/source-control/#source-control 64 | 65 | fastlane/report.xml 66 | fastlane/Preview.html 67 | fastlane/screenshots/**/*.png 68 | fastlane/test_output 69 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | #

SpotifyPlayer

2 | 3 | This is the demo project of the article written in [my blog](https://onswiftwings.com/posts/interactive-animations/). It shows how to create interactive animations using UIViewPropertyAnimator. 4 | 5 |

6 | 7 |

8 | -------------------------------------------------------------------------------- /SpotifyPlayer.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 50; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | E71D551E247E946D008CF42C /* MusicViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = E71D551D247E946D008CF42C /* MusicViewController.swift */; }; 11 | E747871724786D1B00606CC8 /* TransitionCoordinator.swift in Sources */ = {isa = PBXBuildFile; fileRef = E747871624786D1B00606CC8 /* TransitionCoordinator.swift */; }; 12 | E775F2AD247160F500185D17 /* PlayerViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = E775F2AC247160F500185D17 /* PlayerViewController.xib */; }; 13 | E775F2AF2471615900185D17 /* Array+UIViewPropertyAnimator.swift in Sources */ = {isa = PBXBuildFile; fileRef = E775F2AE2471615900185D17 /* Array+UIViewPropertyAnimator.swift */; }; 14 | E775F2B12471658400185D17 /* UIViewController+Utils.swift in Sources */ = {isa = PBXBuildFile; fileRef = E775F2B02471658400185D17 /* UIViewController+Utils.swift */; }; 15 | E7A04CC924706C4800ADD847 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = E7A04CC824706C4800ADD847 /* AppDelegate.swift */; }; 16 | E7A04CCD24706C4800ADD847 /* TabBarController.swift in Sources */ = {isa = PBXBuildFile; fileRef = E7A04CCC24706C4800ADD847 /* TabBarController.swift */; }; 17 | E7A04CD024706C4800ADD847 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = E7A04CCE24706C4800ADD847 /* Main.storyboard */; }; 18 | E7A04CD224706C4900ADD847 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = E7A04CD124706C4900ADD847 /* Assets.xcassets */; }; 19 | E7A04CD524706C4900ADD847 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = E7A04CD324706C4900ADD847 /* LaunchScreen.storyboard */; }; 20 | E7A04CDD24706C6500ADD847 /* PlayerViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = E7A04CDC24706C6500ADD847 /* PlayerViewController.swift */; }; 21 | /* End PBXBuildFile section */ 22 | 23 | /* Begin PBXFileReference section */ 24 | E71D551D247E946D008CF42C /* MusicViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MusicViewController.swift; sourceTree = ""; }; 25 | E747871624786D1B00606CC8 /* TransitionCoordinator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TransitionCoordinator.swift; sourceTree = ""; }; 26 | E775F2AC247160F500185D17 /* PlayerViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = PlayerViewController.xib; sourceTree = ""; }; 27 | E775F2AE2471615900185D17 /* Array+UIViewPropertyAnimator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Array+UIViewPropertyAnimator.swift"; sourceTree = ""; }; 28 | E775F2B02471658400185D17 /* UIViewController+Utils.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIViewController+Utils.swift"; sourceTree = ""; }; 29 | E7A04CC524706C4800ADD847 /* SpotifyPlayer.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SpotifyPlayer.app; sourceTree = BUILT_PRODUCTS_DIR; }; 30 | E7A04CC824706C4800ADD847 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 31 | E7A04CCC24706C4800ADD847 /* TabBarController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TabBarController.swift; sourceTree = ""; }; 32 | E7A04CCF24706C4800ADD847 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 33 | E7A04CD124706C4900ADD847 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 34 | E7A04CD424706C4900ADD847 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 35 | E7A04CD624706C4900ADD847 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 36 | E7A04CDC24706C6500ADD847 /* PlayerViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PlayerViewController.swift; sourceTree = ""; }; 37 | /* End PBXFileReference section */ 38 | 39 | /* Begin PBXFrameworksBuildPhase section */ 40 | E7A04CC224706C4800ADD847 /* Frameworks */ = { 41 | isa = PBXFrameworksBuildPhase; 42 | buildActionMask = 2147483647; 43 | files = ( 44 | ); 45 | runOnlyForDeploymentPostprocessing = 0; 46 | }; 47 | /* End PBXFrameworksBuildPhase section */ 48 | 49 | /* Begin PBXGroup section */ 50 | E7867200248AA5A80068F62A /* Sources */ = { 51 | isa = PBXGroup; 52 | children = ( 53 | E7A04CC824706C4800ADD847 /* AppDelegate.swift */, 54 | E7A04CCC24706C4800ADD847 /* TabBarController.swift */, 55 | E7A04CDC24706C6500ADD847 /* PlayerViewController.swift */, 56 | E71D551D247E946D008CF42C /* MusicViewController.swift */, 57 | E747871624786D1B00606CC8 /* TransitionCoordinator.swift */, 58 | E775F2AE2471615900185D17 /* Array+UIViewPropertyAnimator.swift */, 59 | E775F2B02471658400185D17 /* UIViewController+Utils.swift */, 60 | ); 61 | path = Sources; 62 | sourceTree = ""; 63 | }; 64 | E7867201248AA5AE0068F62A /* Resources */ = { 65 | isa = PBXGroup; 66 | children = ( 67 | E7A04CCE24706C4800ADD847 /* Main.storyboard */, 68 | E7A04CD124706C4900ADD847 /* Assets.xcassets */, 69 | E7A04CD324706C4900ADD847 /* LaunchScreen.storyboard */, 70 | E7A04CD624706C4900ADD847 /* Info.plist */, 71 | E775F2AC247160F500185D17 /* PlayerViewController.xib */, 72 | ); 73 | path = Resources; 74 | sourceTree = ""; 75 | }; 76 | E7A04CBC24706C4800ADD847 = { 77 | isa = PBXGroup; 78 | children = ( 79 | E7A04CC724706C4800ADD847 /* SpotifyPlayer */, 80 | E7A04CC624706C4800ADD847 /* Products */, 81 | ); 82 | sourceTree = ""; 83 | }; 84 | E7A04CC624706C4800ADD847 /* Products */ = { 85 | isa = PBXGroup; 86 | children = ( 87 | E7A04CC524706C4800ADD847 /* SpotifyPlayer.app */, 88 | ); 89 | name = Products; 90 | sourceTree = ""; 91 | }; 92 | E7A04CC724706C4800ADD847 /* SpotifyPlayer */ = { 93 | isa = PBXGroup; 94 | children = ( 95 | E7867200248AA5A80068F62A /* Sources */, 96 | E7867201248AA5AE0068F62A /* Resources */, 97 | ); 98 | path = SpotifyPlayer; 99 | sourceTree = ""; 100 | }; 101 | /* End PBXGroup section */ 102 | 103 | /* Begin PBXNativeTarget section */ 104 | E7A04CC424706C4800ADD847 /* SpotifyPlayer */ = { 105 | isa = PBXNativeTarget; 106 | buildConfigurationList = E7A04CD924706C4900ADD847 /* Build configuration list for PBXNativeTarget "SpotifyPlayer" */; 107 | buildPhases = ( 108 | E7A04CC124706C4800ADD847 /* Sources */, 109 | E7A04CC224706C4800ADD847 /* Frameworks */, 110 | E7A04CC324706C4800ADD847 /* Resources */, 111 | ); 112 | buildRules = ( 113 | ); 114 | dependencies = ( 115 | ); 116 | name = SpotifyPlayer; 117 | productName = Drawer; 118 | productReference = E7A04CC524706C4800ADD847 /* SpotifyPlayer.app */; 119 | productType = "com.apple.product-type.application"; 120 | }; 121 | /* End PBXNativeTarget section */ 122 | 123 | /* Begin PBXProject section */ 124 | E7A04CBD24706C4800ADD847 /* Project object */ = { 125 | isa = PBXProject; 126 | attributes = { 127 | LastSwiftUpdateCheck = 1130; 128 | LastUpgradeCheck = 1130; 129 | ORGANIZATIONNAME = "Maksym Shcheglov"; 130 | TargetAttributes = { 131 | E7A04CC424706C4800ADD847 = { 132 | CreatedOnToolsVersion = 11.3.1; 133 | }; 134 | }; 135 | }; 136 | buildConfigurationList = E7A04CC024706C4800ADD847 /* Build configuration list for PBXProject "SpotifyPlayer" */; 137 | compatibilityVersion = "Xcode 9.3"; 138 | developmentRegion = en; 139 | hasScannedForEncodings = 0; 140 | knownRegions = ( 141 | en, 142 | Base, 143 | ); 144 | mainGroup = E7A04CBC24706C4800ADD847; 145 | productRefGroup = E7A04CC624706C4800ADD847 /* Products */; 146 | projectDirPath = ""; 147 | projectRoot = ""; 148 | targets = ( 149 | E7A04CC424706C4800ADD847 /* SpotifyPlayer */, 150 | ); 151 | }; 152 | /* End PBXProject section */ 153 | 154 | /* Begin PBXResourcesBuildPhase section */ 155 | E7A04CC324706C4800ADD847 /* Resources */ = { 156 | isa = PBXResourcesBuildPhase; 157 | buildActionMask = 2147483647; 158 | files = ( 159 | E7A04CD524706C4900ADD847 /* LaunchScreen.storyboard in Resources */, 160 | E775F2AD247160F500185D17 /* PlayerViewController.xib in Resources */, 161 | E7A04CD224706C4900ADD847 /* Assets.xcassets in Resources */, 162 | E7A04CD024706C4800ADD847 /* Main.storyboard in Resources */, 163 | ); 164 | runOnlyForDeploymentPostprocessing = 0; 165 | }; 166 | /* End PBXResourcesBuildPhase section */ 167 | 168 | /* Begin PBXSourcesBuildPhase section */ 169 | E7A04CC124706C4800ADD847 /* Sources */ = { 170 | isa = PBXSourcesBuildPhase; 171 | buildActionMask = 2147483647; 172 | files = ( 173 | E7A04CCD24706C4800ADD847 /* TabBarController.swift in Sources */, 174 | E747871724786D1B00606CC8 /* TransitionCoordinator.swift in Sources */, 175 | E71D551E247E946D008CF42C /* MusicViewController.swift in Sources */, 176 | E775F2AF2471615900185D17 /* Array+UIViewPropertyAnimator.swift in Sources */, 177 | E775F2B12471658400185D17 /* UIViewController+Utils.swift in Sources */, 178 | E7A04CDD24706C6500ADD847 /* PlayerViewController.swift in Sources */, 179 | E7A04CC924706C4800ADD847 /* AppDelegate.swift in Sources */, 180 | ); 181 | runOnlyForDeploymentPostprocessing = 0; 182 | }; 183 | /* End PBXSourcesBuildPhase section */ 184 | 185 | /* Begin PBXVariantGroup section */ 186 | E7A04CCE24706C4800ADD847 /* Main.storyboard */ = { 187 | isa = PBXVariantGroup; 188 | children = ( 189 | E7A04CCF24706C4800ADD847 /* Base */, 190 | ); 191 | name = Main.storyboard; 192 | sourceTree = ""; 193 | }; 194 | E7A04CD324706C4900ADD847 /* LaunchScreen.storyboard */ = { 195 | isa = PBXVariantGroup; 196 | children = ( 197 | E7A04CD424706C4900ADD847 /* Base */, 198 | ); 199 | name = LaunchScreen.storyboard; 200 | sourceTree = ""; 201 | }; 202 | /* End PBXVariantGroup section */ 203 | 204 | /* Begin XCBuildConfiguration section */ 205 | E7A04CD724706C4900ADD847 /* Debug */ = { 206 | isa = XCBuildConfiguration; 207 | buildSettings = { 208 | ALWAYS_SEARCH_USER_PATHS = NO; 209 | CLANG_ANALYZER_NONNULL = YES; 210 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 211 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 212 | CLANG_CXX_LIBRARY = "libc++"; 213 | CLANG_ENABLE_MODULES = YES; 214 | CLANG_ENABLE_OBJC_ARC = YES; 215 | CLANG_ENABLE_OBJC_WEAK = YES; 216 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 217 | CLANG_WARN_BOOL_CONVERSION = YES; 218 | CLANG_WARN_COMMA = YES; 219 | CLANG_WARN_CONSTANT_CONVERSION = YES; 220 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 221 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 222 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 223 | CLANG_WARN_EMPTY_BODY = YES; 224 | CLANG_WARN_ENUM_CONVERSION = YES; 225 | CLANG_WARN_INFINITE_RECURSION = YES; 226 | CLANG_WARN_INT_CONVERSION = YES; 227 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 228 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 229 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 230 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 231 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 232 | CLANG_WARN_STRICT_PROTOTYPES = YES; 233 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 234 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 235 | CLANG_WARN_UNREACHABLE_CODE = YES; 236 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 237 | COPY_PHASE_STRIP = NO; 238 | DEBUG_INFORMATION_FORMAT = dwarf; 239 | ENABLE_STRICT_OBJC_MSGSEND = YES; 240 | ENABLE_TESTABILITY = YES; 241 | GCC_C_LANGUAGE_STANDARD = gnu11; 242 | GCC_DYNAMIC_NO_PIC = NO; 243 | GCC_NO_COMMON_BLOCKS = YES; 244 | GCC_OPTIMIZATION_LEVEL = 0; 245 | GCC_PREPROCESSOR_DEFINITIONS = ( 246 | "DEBUG=1", 247 | "$(inherited)", 248 | ); 249 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 250 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 251 | GCC_WARN_UNDECLARED_SELECTOR = YES; 252 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 253 | GCC_WARN_UNUSED_FUNCTION = YES; 254 | GCC_WARN_UNUSED_VARIABLE = YES; 255 | IPHONEOS_DEPLOYMENT_TARGET = 13.2; 256 | MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; 257 | MTL_FAST_MATH = YES; 258 | ONLY_ACTIVE_ARCH = YES; 259 | SDKROOT = iphoneos; 260 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; 261 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 262 | }; 263 | name = Debug; 264 | }; 265 | E7A04CD824706C4900ADD847 /* Release */ = { 266 | isa = XCBuildConfiguration; 267 | buildSettings = { 268 | ALWAYS_SEARCH_USER_PATHS = NO; 269 | CLANG_ANALYZER_NONNULL = YES; 270 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 271 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 272 | CLANG_CXX_LIBRARY = "libc++"; 273 | CLANG_ENABLE_MODULES = YES; 274 | CLANG_ENABLE_OBJC_ARC = YES; 275 | CLANG_ENABLE_OBJC_WEAK = YES; 276 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 277 | CLANG_WARN_BOOL_CONVERSION = YES; 278 | CLANG_WARN_COMMA = YES; 279 | CLANG_WARN_CONSTANT_CONVERSION = YES; 280 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 281 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 282 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 283 | CLANG_WARN_EMPTY_BODY = YES; 284 | CLANG_WARN_ENUM_CONVERSION = YES; 285 | CLANG_WARN_INFINITE_RECURSION = YES; 286 | CLANG_WARN_INT_CONVERSION = YES; 287 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 288 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 289 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 290 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 291 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 292 | CLANG_WARN_STRICT_PROTOTYPES = YES; 293 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 294 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 295 | CLANG_WARN_UNREACHABLE_CODE = YES; 296 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 297 | COPY_PHASE_STRIP = NO; 298 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 299 | ENABLE_NS_ASSERTIONS = NO; 300 | ENABLE_STRICT_OBJC_MSGSEND = YES; 301 | GCC_C_LANGUAGE_STANDARD = gnu11; 302 | GCC_NO_COMMON_BLOCKS = YES; 303 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 304 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 305 | GCC_WARN_UNDECLARED_SELECTOR = YES; 306 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 307 | GCC_WARN_UNUSED_FUNCTION = YES; 308 | GCC_WARN_UNUSED_VARIABLE = YES; 309 | IPHONEOS_DEPLOYMENT_TARGET = 13.2; 310 | MTL_ENABLE_DEBUG_INFO = NO; 311 | MTL_FAST_MATH = YES; 312 | SDKROOT = iphoneos; 313 | SWIFT_COMPILATION_MODE = wholemodule; 314 | SWIFT_OPTIMIZATION_LEVEL = "-O"; 315 | VALIDATE_PRODUCT = YES; 316 | }; 317 | name = Release; 318 | }; 319 | E7A04CDA24706C4900ADD847 /* Debug */ = { 320 | isa = XCBuildConfiguration; 321 | buildSettings = { 322 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 323 | CODE_SIGN_STYLE = Automatic; 324 | DEVELOPMENT_TEAM = 76874MD7C6; 325 | INFOPLIST_FILE = SpotifyPlayer/Resources/Info.plist; 326 | LD_RUNPATH_SEARCH_PATHS = ( 327 | "$(inherited)", 328 | "@executable_path/Frameworks", 329 | ); 330 | PRODUCT_BUNDLE_IDENTIFIER = com.sgl0v.SpotifyPlayer; 331 | PRODUCT_NAME = "$(TARGET_NAME)"; 332 | SWIFT_VERSION = 5.0; 333 | TARGETED_DEVICE_FAMILY = 1; 334 | }; 335 | name = Debug; 336 | }; 337 | E7A04CDB24706C4900ADD847 /* Release */ = { 338 | isa = XCBuildConfiguration; 339 | buildSettings = { 340 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 341 | CODE_SIGN_STYLE = Automatic; 342 | DEVELOPMENT_TEAM = 76874MD7C6; 343 | INFOPLIST_FILE = SpotifyPlayer/Resources/Info.plist; 344 | LD_RUNPATH_SEARCH_PATHS = ( 345 | "$(inherited)", 346 | "@executable_path/Frameworks", 347 | ); 348 | PRODUCT_BUNDLE_IDENTIFIER = com.sgl0v.SpotifyPlayer; 349 | PRODUCT_NAME = "$(TARGET_NAME)"; 350 | SWIFT_VERSION = 5.0; 351 | TARGETED_DEVICE_FAMILY = 1; 352 | }; 353 | name = Release; 354 | }; 355 | /* End XCBuildConfiguration section */ 356 | 357 | /* Begin XCConfigurationList section */ 358 | E7A04CC024706C4800ADD847 /* Build configuration list for PBXProject "SpotifyPlayer" */ = { 359 | isa = XCConfigurationList; 360 | buildConfigurations = ( 361 | E7A04CD724706C4900ADD847 /* Debug */, 362 | E7A04CD824706C4900ADD847 /* Release */, 363 | ); 364 | defaultConfigurationIsVisible = 0; 365 | defaultConfigurationName = Release; 366 | }; 367 | E7A04CD924706C4900ADD847 /* Build configuration list for PBXNativeTarget "SpotifyPlayer" */ = { 368 | isa = XCConfigurationList; 369 | buildConfigurations = ( 370 | E7A04CDA24706C4900ADD847 /* Debug */, 371 | E7A04CDB24706C4900ADD847 /* Release */, 372 | ); 373 | defaultConfigurationIsVisible = 0; 374 | defaultConfigurationName = Release; 375 | }; 376 | /* End XCConfigurationList section */ 377 | }; 378 | rootObject = E7A04CBD24706C4800ADD847 /* Project object */; 379 | } 380 | -------------------------------------------------------------------------------- /SpotifyPlayer.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /SpotifyPlayer.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /SpotifyPlayer/Resources/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "20x20", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "20x20", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "29x29", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "29x29", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "40x40", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "40x40", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "iphone", 35 | "size" : "60x60", 36 | "scale" : "2x" 37 | }, 38 | { 39 | "idiom" : "iphone", 40 | "size" : "60x60", 41 | "scale" : "3x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "20x20", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "size" : "20x20", 51 | "scale" : "2x" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "size" : "29x29", 56 | "scale" : "1x" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "size" : "29x29", 61 | "scale" : "2x" 62 | }, 63 | { 64 | "idiom" : "ipad", 65 | "size" : "40x40", 66 | "scale" : "1x" 67 | }, 68 | { 69 | "idiom" : "ipad", 70 | "size" : "40x40", 71 | "scale" : "2x" 72 | }, 73 | { 74 | "idiom" : "ipad", 75 | "size" : "76x76", 76 | "scale" : "1x" 77 | }, 78 | { 79 | "idiom" : "ipad", 80 | "size" : "76x76", 81 | "scale" : "2x" 82 | }, 83 | { 84 | "idiom" : "ipad", 85 | "size" : "83.5x83.5", 86 | "scale" : "2x" 87 | }, 88 | { 89 | "idiom" : "ios-marketing", 90 | "size" : "1024x1024", 91 | "scale" : "1x" 92 | } 93 | ], 94 | "info" : { 95 | "version" : 1, 96 | "author" : "xcode" 97 | } 98 | } -------------------------------------------------------------------------------- /SpotifyPlayer/Resources/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /SpotifyPlayer/Resources/Assets.xcassets/albums/18.imageset/18.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sgl0v/SpotifyPlayer/50ec158f603baf5508adccc0e8adf2cafddbafb0/SpotifyPlayer/Resources/Assets.xcassets/albums/18.imageset/18.png -------------------------------------------------------------------------------- /SpotifyPlayer/Resources/Assets.xcassets/albums/18.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "18.png" 6 | } 7 | ], 8 | "info" : { 9 | "version" : 1, 10 | "author" : "xcode" 11 | } 12 | } -------------------------------------------------------------------------------- /SpotifyPlayer/Resources/Assets.xcassets/albums/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /SpotifyPlayer/Resources/Assets.xcassets/albums/all.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "all.png" 6 | } 7 | ], 8 | "info" : { 9 | "version" : 1, 10 | "author" : "xcode" 11 | } 12 | } -------------------------------------------------------------------------------- /SpotifyPlayer/Resources/Assets.xcassets/albums/all.imageset/all.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sgl0v/SpotifyPlayer/50ec158f603baf5508adccc0e8adf2cafddbafb0/SpotifyPlayer/Resources/Assets.xcassets/albums/all.imageset/all.png -------------------------------------------------------------------------------- /SpotifyPlayer/Resources/Assets.xcassets/albums/hotel.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "hotel.png" 6 | } 7 | ], 8 | "info" : { 9 | "version" : 1, 10 | "author" : "xcode" 11 | } 12 | } -------------------------------------------------------------------------------- /SpotifyPlayer/Resources/Assets.xcassets/albums/hotel.imageset/hotel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sgl0v/SpotifyPlayer/50ec158f603baf5508adccc0e8adf2cafddbafb0/SpotifyPlayer/Resources/Assets.xcassets/albums/hotel.imageset/hotel.png -------------------------------------------------------------------------------- /SpotifyPlayer/Resources/Assets.xcassets/albums/playa.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "play.png" 6 | } 7 | ], 8 | "info" : { 9 | "version" : 1, 10 | "author" : "xcode" 11 | } 12 | } -------------------------------------------------------------------------------- /SpotifyPlayer/Resources/Assets.xcassets/albums/playa.imageset/play.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sgl0v/SpotifyPlayer/50ec158f603baf5508adccc0e8adf2cafddbafb0/SpotifyPlayer/Resources/Assets.xcassets/albums/playa.imageset/play.png -------------------------------------------------------------------------------- /SpotifyPlayer/Resources/Assets.xcassets/albums/playb.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "playb.png" 6 | } 7 | ], 8 | "info" : { 9 | "version" : 1, 10 | "author" : "xcode" 11 | } 12 | } -------------------------------------------------------------------------------- /SpotifyPlayer/Resources/Assets.xcassets/albums/playb.imageset/playb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sgl0v/SpotifyPlayer/50ec158f603baf5508adccc0e8adf2cafddbafb0/SpotifyPlayer/Resources/Assets.xcassets/albums/playb.imageset/playb.png -------------------------------------------------------------------------------- /SpotifyPlayer/Resources/Assets.xcassets/colors/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /SpotifyPlayer/Resources/Assets.xcassets/colors/gradientEnd.colorset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | }, 6 | "colors" : [ 7 | { 8 | "idiom" : "universal", 9 | "color" : { 10 | "color-space" : "srgb", 11 | "components" : { 12 | "red" : "90", 13 | "alpha" : "1.000", 14 | "blue" : "32", 15 | "green" : "58" 16 | } 17 | } 18 | } 19 | ] 20 | } -------------------------------------------------------------------------------- /SpotifyPlayer/Resources/Assets.xcassets/colors/gradientStart.colorset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | }, 6 | "colors" : [ 7 | { 8 | "idiom" : "universal", 9 | "color" : { 10 | "color-space" : "srgb", 11 | "components" : { 12 | "red" : "170", 13 | "alpha" : "1.000", 14 | "blue" : "60", 15 | "green" : "110" 16 | } 17 | } 18 | } 19 | ] 20 | } -------------------------------------------------------------------------------- /SpotifyPlayer/Resources/Assets.xcassets/colors/primaryBackgroundColor.colorset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | }, 6 | "colors" : [ 7 | { 8 | "idiom" : "universal", 9 | "color" : { 10 | "color-space" : "srgb", 11 | "components" : { 12 | "red" : "0.071", 13 | "alpha" : "1.000", 14 | "blue" : "0.071", 15 | "green" : "0.071" 16 | } 17 | } 18 | } 19 | ] 20 | } -------------------------------------------------------------------------------- /SpotifyPlayer/Resources/Assets.xcassets/colors/primaryTextColor.colorset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | }, 6 | "colors" : [ 7 | { 8 | "idiom" : "universal", 9 | "color" : { 10 | "color-space" : "srgb", 11 | "components" : { 12 | "red" : "1.000", 13 | "alpha" : "1.000", 14 | "blue" : "1.000", 15 | "green" : "1.000" 16 | } 17 | } 18 | } 19 | ] 20 | } -------------------------------------------------------------------------------- /SpotifyPlayer/Resources/Assets.xcassets/colors/secondaryBackgroundColor.colorset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | }, 6 | "colors" : [ 7 | { 8 | "idiom" : "universal", 9 | "color" : { 10 | "color-space" : "srgb", 11 | "components" : { 12 | "red" : "0.157", 13 | "alpha" : "1.000", 14 | "blue" : "0.157", 15 | "green" : "0.157" 16 | } 17 | } 18 | } 19 | ] 20 | } -------------------------------------------------------------------------------- /SpotifyPlayer/Resources/Assets.xcassets/colors/secondaryTextColor.colorset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | }, 6 | "colors" : [ 7 | { 8 | "idiom" : "universal", 9 | "color" : { 10 | "color-space" : "srgb", 11 | "components" : { 12 | "red" : "0.761", 13 | "alpha" : "1.000", 14 | "blue" : "0.761", 15 | "green" : "0.761" 16 | } 17 | } 18 | } 19 | ] 20 | } -------------------------------------------------------------------------------- /SpotifyPlayer/Resources/Assets.xcassets/colors/secondaryTintColor.colorset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | }, 6 | "colors" : [ 7 | { 8 | "idiom" : "universal", 9 | "color" : { 10 | "color-space" : "srgb", 11 | "components" : { 12 | "red" : "1.000", 13 | "alpha" : "0.200", 14 | "blue" : "1.000", 15 | "green" : "1.000" 16 | } 17 | } 18 | } 19 | ] 20 | } -------------------------------------------------------------------------------- /SpotifyPlayer/Resources/Assets.xcassets/colors/tintColor.colorset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | }, 6 | "colors" : [ 7 | { 8 | "idiom" : "universal", 9 | "color" : { 10 | "color-space" : "srgb", 11 | "components" : { 12 | "red" : "1.000", 13 | "alpha" : "1.000", 14 | "blue" : "1.000", 15 | "green" : "1.000" 16 | } 17 | } 18 | } 19 | ] 20 | } -------------------------------------------------------------------------------- /SpotifyPlayer/Resources/Assets.xcassets/moby.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "moby.jpg" 6 | } 7 | ], 8 | "info" : { 9 | "version" : 1, 10 | "author" : "xcode" 11 | } 12 | } -------------------------------------------------------------------------------- /SpotifyPlayer/Resources/Assets.xcassets/moby.imageset/moby.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sgl0v/SpotifyPlayer/50ec158f603baf5508adccc0e8adf2cafddbafb0/SpotifyPlayer/Resources/Assets.xcassets/moby.imageset/moby.jpg -------------------------------------------------------------------------------- /SpotifyPlayer/Resources/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /SpotifyPlayer/Resources/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 139 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 185 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 231 | 237 | 238 | 239 | 240 | 241 | 242 | 243 | 244 | 245 | 246 | 247 | 248 | 249 | 250 | 251 | 252 | 253 | 254 | 255 | 256 | 257 | 258 | 259 | 260 | 261 | 262 | 263 | 264 | 265 | 266 | 267 | 268 | 269 | 270 | 271 | 277 | 283 | 284 | 285 | 286 | 287 | 288 | 289 | 290 | 291 | 292 | 293 | 294 | 295 | 296 | 297 | 298 | 299 | 300 | 301 | 302 | 303 | 304 | 305 | 306 | 307 | 308 | 309 | 310 | 311 | 312 | 313 | 314 | 315 | 316 | 317 | 323 | 329 | 330 | 331 | 332 | 333 | 334 | 335 | 336 | 337 | 338 | 339 | 340 | 341 | 342 | 343 | 344 | 345 | 346 | 347 | 348 | 349 | 350 | 351 | 352 | 353 | 354 | 355 | 356 | 357 | 358 | 359 | 360 | 361 | 362 | 363 | 364 | 365 | 366 | 367 | 368 | 369 | 370 | 371 | 372 | 373 | 374 | 375 | 376 | 377 | 378 | 379 | 380 | 381 | 382 | 383 | 384 | 385 | -------------------------------------------------------------------------------- /SpotifyPlayer/Resources/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | UIStatusBarStyle 6 | UIStatusBarStyleLightContent 7 | UIViewControllerBasedStatusBarAppearance 8 | 9 | CFBundleDevelopmentRegion 10 | $(DEVELOPMENT_LANGUAGE) 11 | CFBundleExecutable 12 | $(EXECUTABLE_NAME) 13 | CFBundleIdentifier 14 | $(PRODUCT_BUNDLE_IDENTIFIER) 15 | CFBundleInfoDictionaryVersion 16 | 6.0 17 | CFBundleName 18 | $(PRODUCT_NAME) 19 | CFBundlePackageType 20 | $(PRODUCT_BUNDLE_PACKAGE_TYPE) 21 | CFBundleShortVersionString 22 | 1.0 23 | CFBundleVersion 24 | 1 25 | LSRequiresIPhoneOS 26 | 27 | UILaunchStoryboardName 28 | LaunchScreen 29 | UIMainStoryboardFile 30 | Main 31 | UIRequiredDeviceCapabilities 32 | 33 | armv7 34 | 35 | UISupportedInterfaceOrientations 36 | 37 | UIInterfaceOrientationPortrait 38 | 39 | UISupportedInterfaceOrientations~ipad 40 | 41 | UIInterfaceOrientationPortrait 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /SpotifyPlayer/Resources/PlayerViewController.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 41 | 47 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 79 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 135 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 233 | 239 | 240 | 241 | 242 | 243 | 244 | 245 | 246 | 247 | 248 | 249 | 250 | 251 | 252 | 253 | 254 | 255 | 256 | 257 | 258 | 259 | 260 | 261 | 262 | 263 | 264 | 265 | 266 | 267 | 268 | 269 | 270 | 271 | 272 | 273 | 274 | 275 | 276 | 277 | 278 | 279 | 280 | 281 | 282 | 283 | 284 | 285 | 286 | 287 | 288 | 289 | 290 | 291 | 292 | 293 | 294 | 295 | 296 | 297 | 298 | 299 | 300 | 301 | 302 | 303 | 304 | 305 | 306 | 307 | 308 | 309 | 310 | 311 | 312 | 313 | 314 | 315 | 316 | 317 | 318 | 319 | 320 | 321 | -------------------------------------------------------------------------------- /SpotifyPlayer/Sources/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // SpotifyPlayer 4 | // 5 | // Created by Maksym Shcheglov on 16/05/2020. 6 | // Copyright © 2020 Maksym Shcheglov. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | @UIApplicationMain 12 | class AppDelegate: UIResponder, UIApplicationDelegate { 13 | 14 | var window: UIWindow? 15 | 16 | func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { 17 | // Override point for customization after application launch. 18 | return true 19 | } 20 | 21 | } 22 | 23 | -------------------------------------------------------------------------------- /SpotifyPlayer/Sources/Array+UIViewPropertyAnimator.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Array+UIViewPropertyAnimator.swift 3 | // SpotifyPlayer 4 | // 5 | // Created by Maksym Shcheglov on 17/05/2020. 6 | // Copyright © 2020 Maksym Shcheglov. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | extension Array where Element: UIViewPropertyAnimator { 12 | 13 | var isReversed: Bool { 14 | set { 15 | forEach { $0.isReversed = newValue } 16 | } 17 | get { 18 | assertionFailure("The getter is not supported!") 19 | return false 20 | } 21 | } 22 | 23 | var fractionComplete: CGFloat { 24 | set { 25 | forEach { $0.fractionComplete = newValue } 26 | } 27 | get { 28 | assertionFailure("The getter is not supported!") 29 | return 0 30 | } 31 | } 32 | 33 | func startAnimations() { 34 | forEach { $0.startAnimation() } 35 | } 36 | 37 | func pauseAnimations() { 38 | forEach { $0.pauseAnimation() } 39 | } 40 | 41 | func continueAnimations(withTimingParameters parameters: UITimingCurveProvider? = nil, durationFactor: CGFloat = 0) { 42 | forEach { $0.continueAnimation(withTimingParameters: parameters, durationFactor: durationFactor) } 43 | } 44 | 45 | func reverse() { 46 | forEach { $0.isReversed = !$0.isReversed } 47 | } 48 | 49 | mutating func remove(_ element: Element) { 50 | self = self.filter { $0 != element } 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /SpotifyPlayer/Sources/MusicViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // MusicViewController.swift 3 | // SpotifyPlayer 4 | // 5 | // Created by Maksym Shcheglov on 27/05/2020. 6 | // Copyright © 2020 Maksym Shcheglov. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class MusicViewController: UITableViewController { 12 | 13 | override func viewDidLoad() { 14 | super.viewDidLoad() 15 | view.backgroundColor = UIColor(named: "primaryBackgroundColor") 16 | title = "Music" 17 | navigationController?.navigationBar.barTintColor = UIColor(named: "primaryBackgroundColor") 18 | navigationController?.navigationBar.isTranslucent = false 19 | navigationController?.navigationBar.prefersLargeTitles = true 20 | navigationController?.navigationBar.backgroundColor = UIColor(named: "primaryBackgroundColor") 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /SpotifyPlayer/Sources/PlayerViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // PlayerViewController.swift 3 | // SpotifyPlayer 4 | // 5 | // Created by Maksym Shcheglov on 16/05/2020. 6 | // Copyright © 2020 Maksym Shcheglov. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class PlayerViewController : UIViewController, UIGestureRecognizerDelegate { 12 | 13 | @IBOutlet var miniPlayerView: UIView! 14 | @IBOutlet var playerView: UIView! 15 | @IBOutlet var closeButton: UIButton! 16 | @IBOutlet var artwork: UIView! 17 | @IBOutlet var progressIndicator: UIView! 18 | private lazy var bgLayer: CALayer = { 19 | let layer = CAGradientLayer() 20 | layer.colors = [UIColor(named: "gradientStart")!.cgColor, UIColor(named: "gradientEnd")!.cgColor] 21 | return layer 22 | }() 23 | 24 | override func viewDidLoad() { 25 | super.viewDidLoad() 26 | playerView.layer.insertSublayer(bgLayer, at: 0) 27 | 28 | artwork.layer.shadowPath = UIBezierPath(rect: artwork.bounds).cgPath 29 | artwork.layer.shadowColor = UIColor.black.cgColor 30 | artwork.layer.shadowRadius = 16 31 | artwork.layer.shadowOffset = .zero 32 | artwork.layer.shadowOpacity = 0.1 33 | } 34 | 35 | override func viewDidLayoutSubviews() { 36 | super.viewDidLayoutSubviews() 37 | bgLayer.frame = playerView.bounds 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /SpotifyPlayer/Sources/TabBarController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // TabBarController.swift 3 | // SpotifyPlayer 4 | // 5 | // Created by Maksym Shcheglov on 16/05/2020. 6 | // Copyright © 2020 Maksym Shcheglov. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class TabBarController: UIViewController { 12 | private let playerViewController = PlayerViewController() 13 | @IBOutlet var tabBarContainer: UIView! 14 | @IBOutlet var tabBar: UITabBar! 15 | var shouldHideStatusBar: Bool = false 16 | private var coordinator: TransitionCoordinator! 17 | 18 | override func viewDidLoad() { 19 | super.viewDidLoad() 20 | setupUI() 21 | tabBar.selectedItem = tabBar.items?.first 22 | add(playerViewController) 23 | view.bringSubviewToFront(tabBarContainer) 24 | } 25 | 26 | override func viewDidAppear(_ animated: Bool) { 27 | super.viewDidAppear(animated) 28 | let additionalBottomInset = tabBar.bounds.height 29 | playerViewController.additionalSafeAreaInsets = UIEdgeInsets(top: 0, left: 0, bottom: additionalBottomInset, right: 0) 30 | coordinator = TransitionCoordinator(tabBarViewController: self, playerViewController: playerViewController) 31 | } 32 | 33 | override var prefersStatusBarHidden: Bool { 34 | return shouldHideStatusBar 35 | } 36 | 37 | private func setupUI() { 38 | if #available(iOS 13, *) { 39 | let appearance = tabBar.standardAppearance 40 | appearance.configureWithTransparentBackground() 41 | appearance.shadowImage = nil 42 | appearance.shadowColor = nil 43 | tabBar.standardAppearance = appearance 44 | } else { 45 | tabBar.shadowImage = UIImage() 46 | tabBar.backgroundImage = UIImage() 47 | } 48 | } 49 | 50 | } 51 | -------------------------------------------------------------------------------- /SpotifyPlayer/Sources/TransitionCoordinator.swift: -------------------------------------------------------------------------------- 1 | // 2 | // TransitionCoordinator.swift 3 | // SpotifyPlayer 4 | // 5 | // Created by Maksym Shcheglov on 22/05/2020. 6 | // Copyright © 2020 Maksym Shcheglov. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class TransitionCoordinator: NSObject { 12 | 13 | enum State: Equatable { 14 | case open 15 | case closed 16 | 17 | static prefix func !(_ state: State) -> State { 18 | return state == .open ? .closed : .open 19 | } 20 | } 21 | 22 | private weak var tabBarViewController: TabBarController! 23 | private weak var playerViewController: PlayerViewController! 24 | 25 | private lazy var panGestureRecognizer = createPanGestureRecognizer() 26 | private lazy var tapGestureRecognizer = createTapGestureRecognizer() 27 | private var runningAnimators = [UIViewPropertyAnimator]() 28 | private var state: State = .closed 29 | private var totalAnimationDistance: CGFloat { 30 | guard let playerViewController = playerViewController else { return 0 } 31 | return playerViewController.view.bounds.height - playerViewController.view.safeAreaInsets.bottom - playerViewController.miniPlayerView.bounds.height 32 | } 33 | 34 | init(tabBarViewController: TabBarController, playerViewController: PlayerViewController) { 35 | self.tabBarViewController = tabBarViewController 36 | self.playerViewController = playerViewController 37 | super.init() 38 | playerViewController.view.addGestureRecognizer(panGestureRecognizer) 39 | playerViewController.view.addGestureRecognizer(tapGestureRecognizer) 40 | updateUI(with: state) 41 | } 42 | } 43 | 44 | // MARK: Tap and Pan gestures handling 45 | extension TransitionCoordinator { 46 | 47 | @objc private func didPanPlayer(recognizer: UIPanGestureRecognizer) { 48 | switch recognizer.state { 49 | case .began: 50 | startInteractiveTransition(for: !state) 51 | case .changed: 52 | let translation = recognizer.translation(in: recognizer.view!) 53 | updateInteractiveTransition(distanceTraveled: translation.y) 54 | case .ended: 55 | let velocity = recognizer.velocity(in: recognizer.view!).y 56 | let isCancelled = isGestureCancelled(with: velocity) 57 | continueInteractiveTransition(cancel: isCancelled) 58 | case .cancelled, .failed: 59 | continueInteractiveTransition(cancel: true) 60 | default: 61 | break 62 | } 63 | } 64 | 65 | @objc private func didTapPlayer(recognizer: UITapGestureRecognizer) { 66 | animateTransition(for: !state) 67 | } 68 | 69 | // Starts transition and pauses on pan .begin 70 | private func startInteractiveTransition(for state: State) { 71 | animateTransition(for: state) 72 | runningAnimators.pauseAnimations() 73 | } 74 | 75 | // Scrubs transition on pan .changed 76 | private func updateInteractiveTransition(distanceTraveled: CGFloat) { 77 | var fraction = distanceTraveled / totalAnimationDistance 78 | if state == .open { fraction *= -1 } 79 | runningAnimators.fractionComplete = fraction 80 | } 81 | 82 | // Continues or reverse transition on pan .ended 83 | private func continueInteractiveTransition(cancel: Bool) { 84 | if cancel { 85 | runningAnimators.reverse() 86 | state = !state 87 | } 88 | 89 | runningAnimators.continueAnimations() 90 | } 91 | 92 | // Perform all animations with animators 93 | private func animateTransition(for newState: State) { 94 | state = newState 95 | runningAnimators = createTransitionAnimators(with: TransitionCoordinator.animationDuration) 96 | runningAnimators.startAnimations() 97 | } 98 | 99 | // Check if gesture is cancelled (reversed) 100 | private func isGestureCancelled(with velocity: CGFloat) -> Bool { 101 | guard velocity != 0 else { return false } 102 | 103 | let isPanningDown = velocity > 0 104 | return (state == .open && isPanningDown) || (state == .closed && !isPanningDown) 105 | } 106 | } 107 | 108 | extension TransitionCoordinator: UIGestureRecognizerDelegate { 109 | func gestureRecognizerShouldBegin(_ gestureRecognizer: UIGestureRecognizer) -> Bool { 110 | guard let tapGestureRecognizer = gestureRecognizer as? UITapGestureRecognizer else { return runningAnimators.isEmpty } 111 | 112 | guard let miniPlayerView = playerViewController.miniPlayerView, 113 | let closeButton = playerViewController.closeButton, 114 | let view = playerViewController.view else { return false } 115 | 116 | let tapLocation = tapGestureRecognizer.location(in: view) 117 | let closeButtonFrame = closeButton.convert(closeButton.frame, to: view).insetBy(dx: -8, dy: -8) 118 | 119 | return runningAnimators.isEmpty && (miniPlayerView.frame.contains(tapLocation) || closeButtonFrame.contains(tapLocation)) 120 | } 121 | 122 | private func createPanGestureRecognizer() -> UIPanGestureRecognizer { 123 | let recognizer = UIPanGestureRecognizer() 124 | recognizer.addTarget(self, action: #selector(didPanPlayer(recognizer:))) 125 | recognizer.delegate = self 126 | return recognizer 127 | } 128 | 129 | private func createTapGestureRecognizer() -> UITapGestureRecognizer { 130 | let recognizer = UITapGestureRecognizer() 131 | recognizer.addTarget(self, action: #selector(didTapPlayer(recognizer:))) 132 | recognizer.delegate = self 133 | return recognizer 134 | } 135 | 136 | } 137 | 138 | // MARK: Animators 139 | extension TransitionCoordinator { 140 | 141 | private static let animationDuration = TimeInterval(0.7) 142 | 143 | private func createTransitionAnimators(with duration: TimeInterval) -> [UIViewPropertyAnimator] { 144 | switch state { 145 | case .open: 146 | return [ 147 | openPlayerAnimator(with: duration), 148 | fadeInPlayerAnimator(with: duration), 149 | fadeOutMiniPlayerAnimator(with: duration) 150 | ] 151 | case .closed: 152 | return [ 153 | closePlayerAnimator(with: duration), 154 | fadeOutPlayerAnimator(with: duration), 155 | fadeInMiniPlayerAnimator(with: duration) 156 | ] 157 | } 158 | } 159 | 160 | private func openPlayerAnimator(with duration: TimeInterval) -> UIViewPropertyAnimator { 161 | let animator = UIViewPropertyAnimator(duration: duration, dampingRatio: 1.0) 162 | addAnimation(to: animator, animations: { 163 | self.updatePlayerContainer(with: self.state) 164 | self.updateTabBar(with: self.state) 165 | }) 166 | return animator 167 | } 168 | 169 | private func fadeInPlayerAnimator(with duration: TimeInterval) -> UIViewPropertyAnimator { 170 | let animator = UIViewPropertyAnimator(duration: duration, curve: .easeIn) 171 | addKeyframeAnimation(to: animator, withRelativeStartTime: 0.0, relativeDuration: 0.5) { 172 | self.updatePlayer(with: self.state) 173 | } 174 | animator.scrubsLinearly = false 175 | return animator 176 | } 177 | 178 | private func fadeOutMiniPlayerAnimator(with duration: TimeInterval) -> UIViewPropertyAnimator { 179 | let animator = UIViewPropertyAnimator(duration: duration, curve: .easeOut) 180 | addKeyframeAnimation(to: animator, withRelativeStartTime: 0.0, relativeDuration: 0.5) { 181 | self.updateMiniPlayer(with: self.state) 182 | } 183 | animator.scrubsLinearly = false 184 | return animator 185 | } 186 | 187 | private func closePlayerAnimator(with duration: TimeInterval) -> UIViewPropertyAnimator { 188 | let animator = UIViewPropertyAnimator(duration: duration, dampingRatio: 0.9) 189 | addAnimation(to: animator, animations: { 190 | self.updatePlayerContainer(with: self.state) 191 | self.updateTabBar(with: self.state) 192 | }) 193 | return animator 194 | } 195 | 196 | private func fadeOutPlayerAnimator(with duration: TimeInterval) -> UIViewPropertyAnimator { 197 | let animator = UIViewPropertyAnimator(duration: duration, curve: .easeOut) 198 | addKeyframeAnimation(to: animator, withRelativeStartTime: 0.5, relativeDuration: 0.5) { 199 | self.updatePlayer(with: self.state) 200 | } 201 | animator.scrubsLinearly = false 202 | return animator 203 | } 204 | 205 | private func fadeInMiniPlayerAnimator(with duration: TimeInterval) -> UIViewPropertyAnimator { 206 | let animator = UIViewPropertyAnimator(duration: duration, curve: .easeIn) 207 | addKeyframeAnimation(to: animator, withRelativeStartTime: 0.5, relativeDuration: 0.5) { 208 | self.updateMiniPlayer(with: self.state) 209 | } 210 | animator.scrubsLinearly = false 211 | return animator 212 | } 213 | 214 | private func addAnimation(to animator: UIViewPropertyAnimator, animations: @escaping () -> Void) { 215 | animator.addAnimations { animations() } 216 | animator.addCompletion({ _ in 217 | animations() 218 | self.runningAnimators.remove(animator) 219 | }) 220 | } 221 | 222 | private func addKeyframeAnimation(to animator: UIViewPropertyAnimator, withRelativeStartTime frameStartTime: Double = 0.0, relativeDuration frameDuration: Double = 1.0, animations: @escaping () -> Void) { 223 | animator.addAnimations { 224 | UIView.animateKeyframes(withDuration: 0, delay: 0, options:[], animations: { 225 | UIView.addKeyframe(withRelativeStartTime: frameStartTime, relativeDuration: frameDuration) { 226 | animations() 227 | } 228 | }) 229 | } 230 | animator.addCompletion({ _ in 231 | animations() 232 | self.runningAnimators.remove(animator) 233 | }) 234 | } 235 | } 236 | 237 | 238 | // MARK: UI state rendering 239 | extension TransitionCoordinator { 240 | 241 | private func updateUI(with state: State) { 242 | updatePlayer(with: state) 243 | updateMiniPlayer(with: state) 244 | updatePlayerContainer(with: state) 245 | updateTabBar(with: state) 246 | } 247 | 248 | private func updateTabBar(with state: State) { 249 | guard let tabBarViewController = tabBarViewController, let tabBarContainer = tabBarViewController.tabBarContainer else { return } 250 | tabBarContainer.transform = state == .closed ? .identity : CGAffineTransform(translationX: 0, y: tabBarContainer.bounds.height) 251 | tabBarViewController.shouldHideStatusBar = state == .open 252 | tabBarViewController.setNeedsStatusBarAppearanceUpdate() 253 | } 254 | 255 | private func updateMiniPlayer(with state: State) { 256 | playerViewController?.miniPlayerView.alpha = state == .open ? 0 : 1 257 | } 258 | 259 | private func updatePlayer(with state: State) { 260 | guard let playerViewController = playerViewController, 261 | let tabBarViewController = tabBarViewController else { return } 262 | 263 | playerViewController.playerView.alpha = state == .open ? 1 : 0 264 | playerViewController.view.layer.maskedCorners = [.layerMaxXMinYCorner, .layerMinXMinYCorner] 265 | let cornerRadius: CGFloat = playerViewController.view.safeAreaInsets.bottom > tabBarViewController.tabBar.bounds.height ? 20 : 0 266 | playerViewController.view.layer.cornerRadius = state == .open ? cornerRadius : 0 267 | } 268 | 269 | private func updatePlayerContainer(with state: State) { 270 | playerViewController?.view.transform = state == .open ? .identity : CGAffineTransform(translationX: 0, y: totalAnimationDistance) 271 | } 272 | } 273 | -------------------------------------------------------------------------------- /SpotifyPlayer/Sources/UIViewController+Utils.swift: -------------------------------------------------------------------------------- 1 | // 2 | // UIViewController+Utils.swift 3 | // SpotifyPlayer 4 | // 5 | // Created by Maksym Shcheglov on 17/05/2020. 6 | // Copyright © 2020 Maksym Shcheglov. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | extension UIViewController { 12 | public func add(_ child: UIViewController, insets: UIEdgeInsets = .zero) { 13 | addChild(child) 14 | view.addSubview(child.view) 15 | child.view.translatesAutoresizingMaskIntoConstraints = false 16 | NSLayoutConstraint.activate([ 17 | child.view.leadingAnchor.constraint(equalTo: view.leadingAnchor), 18 | child.view.trailingAnchor.constraint(equalTo: view.trailingAnchor), 19 | child.view.topAnchor.constraint(equalTo: view.topAnchor), 20 | child.view.bottomAnchor.constraint(equalTo: view.bottomAnchor) 21 | ]) 22 | child.didMove(toParent: self) 23 | } 24 | 25 | public func remove(_ child: UIViewController) { 26 | guard child.parent != nil else { 27 | return 28 | } 29 | 30 | child.willMove(toParent: nil) 31 | child.view.removeFromSuperview() 32 | child.removeFromParent() 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /screenshots/demo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sgl0v/SpotifyPlayer/50ec158f603baf5508adccc0e8adf2cafddbafb0/screenshots/demo.gif --------------------------------------------------------------------------------