diff --git a/MusicPlayer.xcodeproj/project.pbxproj b/MusicPlayer.xcodeproj/project.pbxproj index 3881347..46f6f86 100644 --- a/MusicPlayer.xcodeproj/project.pbxproj +++ b/MusicPlayer.xcodeproj/project.pbxproj @@ -8,24 +8,202 @@ /* Begin PBXBuildFile section */ 0096622D2BB14A5A00FCA65F /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0096622C2BB14A5A00FCA65F /* AppDelegate.swift */; }; - 0096622F2BB14A5A00FCA65F /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0096622E2BB14A5A00FCA65F /* SceneDelegate.swift */; }; 009662312BB14A5A00FCA65F /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 009662302BB14A5A00FCA65F /* ViewController.swift */; }; 009662342BB14A5A00FCA65F /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 009662322BB14A5A00FCA65F /* Main.storyboard */; }; 009662372BB14A5A00FCA65F /* MusicPlayer.xcdatamodeld in Sources */ = {isa = PBXBuildFile; fileRef = 009662352BB14A5A00FCA65F /* MusicPlayer.xcdatamodeld */; }; 009662392BB14A5B00FCA65F /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 009662382BB14A5B00FCA65F /* Assets.xcassets */; }; 0096623C2BB14A5B00FCA65F /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 0096623A2BB14A5B00FCA65F /* LaunchScreen.storyboard */; }; + 639E3B772F558B3350DD56BA /* Pods_MusicPlayer.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 411725AB000C22E50EBD70BA /* Pods_MusicPlayer.framework */; }; + CB0FBB7F2BC69616006290D4 /* PrivacyViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = CB0FBB7D2BC69616006290D4 /* PrivacyViewController.swift */; }; + CB0FBB802BC69616006290D4 /* PrivacyViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = CB0FBB7E2BC69616006290D4 /* PrivacyViewController.xib */; }; + CB0FBB832BC6986E006290D4 /* ServiceViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = CB0FBB812BC6986E006290D4 /* ServiceViewController.swift */; }; + CB0FBB842BC6986E006290D4 /* ServiceViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = CB0FBB822BC6986E006290D4 /* ServiceViewController.xib */; }; + CB1181452BC66E7C00586030 /* PlayerActionView.swift in Sources */ = {isa = PBXBuildFile; fileRef = CB1181442BC66E7C00586030 /* PlayerActionView.swift */; }; + CB1181482BC6874D00586030 /* SettingViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = CB1181462BC6874D00586030 /* SettingViewController.swift */; }; + CB1181492BC6874D00586030 /* SettingViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = CB1181472BC6874D00586030 /* SettingViewController.xib */; }; + CB11814C2BC68B0500586030 /* SettingTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = CB11814A2BC68B0500586030 /* SettingTableViewCell.swift */; }; + CB11814D2BC68B0500586030 /* SettingTableViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = CB11814B2BC68B0500586030 /* SettingTableViewCell.xib */; }; + CB1181502BC68DD800586030 /* AboutViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = CB11814E2BC68DD800586030 /* AboutViewController.swift */; }; + CB1181512BC68DD800586030 /* AboutViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = CB11814F2BC68DD800586030 /* AboutViewController.xib */; }; + CB1C16522BC80BF100B96AB3 /* MPMediaCenterManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = CB1C16512BC80BF100B96AB3 /* MPMediaCenterManager.swift */; }; + CB7B778F2BB50B1300C34894 /* CountTimerViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = CB7B778D2BB50B1300C34894 /* CountTimerViewController.swift */; }; + CB7B77902BB50B1300C34894 /* CountTimerViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = CB7B778E2BB50B1300C34894 /* CountTimerViewController.xib */; }; + CB7B77952BB55A4500C34894 /* PlayerViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = CB7B77932BB55A4500C34894 /* PlayerViewController.swift */; }; + CB7B77962BB55A4500C34894 /* PlayerViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = CB7B77942BB55A4500C34894 /* PlayerViewController.xib */; }; + CBAD14AB2BC3E1C3001430F9 /* MPBottomShowView.swift in Sources */ = {isa = PBXBuildFile; fileRef = CBAD14AA2BC3E1C3001430F9 /* MPBottomShowView.swift */; }; + CBAD14AD2BC3E201001430F9 /* MPBottomShowView.xib in Resources */ = {isa = PBXBuildFile; fileRef = CBAD14AC2BC3E201001430F9 /* MPBottomShowView.xib */; }; + CBBFA9132BBA71CF00057FD5 /* MusicModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = CBBFA9122BBA71CF00057FD5 /* MusicModel.swift */; }; + CBBFA9182BBA83BA00057FD5 /* MPCoreDataHandlerManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = CBBFA9172BBA83BA00057FD5 /* MPCoreDataHandlerManager.swift */; }; + CBBFA91A2BBA846600057FD5 /* CoreDataDelegete.swift in Sources */ = {isa = PBXBuildFile; fileRef = CBBFA9192BBA846600057FD5 /* CoreDataDelegete.swift */; }; + CBBFA91E2BBA9B5C00057FD5 /* Notification.swift in Sources */ = {isa = PBXBuildFile; fileRef = CBBFA91D2BBA9B5C00057FD5 /* Notification.swift */; }; + CBBFA9202BBAB88500057FD5 /* MusicViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = CBBFA91F2BBAB88500057FD5 /* MusicViewModel.swift */; }; + CBBFA9222BBAB8FD00057FD5 /* LoadDataMusic.swift in Sources */ = {isa = PBXBuildFile; fileRef = CBBFA9212BBAB8FD00057FD5 /* LoadDataMusic.swift */; }; + CBC54E562BC4D5D3003B1901 /* Breathe.mp3 in Resources */ = {isa = PBXBuildFile; fileRef = CBC54E442BC4D5D3003B1901 /* Breathe.mp3 */; }; + CBC54E572BC4D5D3003B1901 /* Shhh….mp3 in Resources */ = {isa = PBXBuildFile; fileRef = CBC54E452BC4D5D3003B1901 /* Shhh….mp3 */; }; + CBC54E582BC4D5D3003B1901 /* Shh Shh.mp3 in Resources */ = {isa = PBXBuildFile; fileRef = CBC54E462BC4D5D3003B1901 /* Shh Shh.mp3 */; }; + CBC54E592BC4D5D3003B1901 /* Mountain stream.mp3 in Resources */ = {isa = PBXBuildFile; fileRef = CBC54E482BC4D5D3003B1901 /* Mountain stream.mp3 */; }; + CBC54E5A2BC4D5D3003B1901 /* Fireplace.mp3 in Resources */ = {isa = PBXBuildFile; fileRef = CBC54E492BC4D5D3003B1901 /* Fireplace.mp3 */; }; + CBC54E5B2BC4D5D3003B1901 /* Water droplet.mp3 in Resources */ = {isa = PBXBuildFile; fileRef = CBC54E4A2BC4D5D3003B1901 /* Water droplet.mp3 */; }; + CBC54E5C2BC4D5D3003B1901 /* TV.mp3 in Resources */ = {isa = PBXBuildFile; fileRef = CBC54E4B2BC4D5D3003B1901 /* TV.mp3 */; }; + CBC54E5D2BC4D5D3003B1901 /* Chirping of Birds.mp3 in Resources */ = {isa = PBXBuildFile; fileRef = CBC54E4D2BC4D5D3003B1901 /* Chirping of Birds.mp3 */; }; + CBC54E5E2BC4D5D3003B1901 /* waterfall.mp3 in Resources */ = {isa = PBXBuildFile; fileRef = CBC54E4E2BC4D5D3003B1901 /* waterfall.mp3 */; }; + CBC54E5F2BC4D5D3003B1901 /* Beach.mp3 in Resources */ = {isa = PBXBuildFile; fileRef = CBC54E4F2BC4D5D3003B1901 /* Beach.mp3 */; }; + CBC54E602BC4D5D3003B1901 /* Call of Seagulls.mp3 in Resources */ = {isa = PBXBuildFile; fileRef = CBC54E502BC4D5D3003B1901 /* Call of Seagulls.mp3 */; }; + CBC54E612BC4D5D3003B1901 /* Cicada Chirping.mp3 in Resources */ = {isa = PBXBuildFile; fileRef = CBC54E512BC4D5D3003B1901 /* Cicada Chirping.mp3 */; }; + CBC54E622BC4D5D3003B1901 /* Nocturnal Insects.mp3 in Resources */ = {isa = PBXBuildFile; fileRef = CBC54E522BC4D5D3003B1901 /* Nocturnal Insects.mp3 */; }; + CBC54E632BC4D5D3003B1901 /* Howling Wind.mp3 in Resources */ = {isa = PBXBuildFile; fileRef = CBC54E532BC4D5D3003B1901 /* Howling Wind.mp3 */; }; + CBC54E642BC4D5D3003B1901 /* Seawater Surging.mp3 in Resources */ = {isa = PBXBuildFile; fileRef = CBC54E542BC4D5D3003B1901 /* Seawater Surging.mp3 */; }; + CBC54E652BC4D5D3003B1901 /* Summer Insects.mp3 in Resources */ = {isa = PBXBuildFile; fileRef = CBC54E552BC4D5D3003B1901 /* Summer Insects.mp3 */; }; + CBC54E672BC4D90F003B1901 /* Resource.plist in Resources */ = {isa = PBXBuildFile; fileRef = CBC54E662BC4D90F003B1901 /* Resource.plist */; }; + CBC6873E2BC24FFF0023ECA6 /* MoreViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = CBC6873C2BC24FFF0023ECA6 /* MoreViewController.swift */; }; + CBC6873F2BC24FFF0023ECA6 /* MoreViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = CBC6873D2BC24FFF0023ECA6 /* MoreViewController.xib */; }; + CBC687422BC2788D0023ECA6 /* RenameViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = CBC687402BC2788D0023ECA6 /* RenameViewController.swift */; }; + CBC687432BC2788D0023ECA6 /* RenameViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = CBC687412BC2788D0023ECA6 /* RenameViewController.xib */; }; + CBC687462BC27AE70023ECA6 /* DeleteViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = CBC687442BC27AE70023ECA6 /* DeleteViewController.swift */; }; + CBC687472BC27AE70023ECA6 /* DeleteViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = CBC687452BC27AE70023ECA6 /* DeleteViewController.xib */; }; + CBC687492BC2882B0023ECA6 /* MPTableManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = CBC687482BC2882B0023ECA6 /* MPTableManager.swift */; }; + CBC6874B2BC2B0710023ECA6 /* String.swift in Sources */ = {isa = PBXBuildFile; fileRef = CBC6874A2BC2B0710023ECA6 /* String.swift */; }; + CBCAFB5A2BB3C2A000BC6520 /* LayoutConstraint.swift in Sources */ = {isa = PBXBuildFile; fileRef = CBCAFB592BB3C2A000BC6520 /* LayoutConstraint.swift */; }; + CBCAFB5D2BB3C52100BC6520 /* HexColor.swift in Sources */ = {isa = PBXBuildFile; fileRef = CBCAFB5C2BB3C52100BC6520 /* HexColor.swift */; }; + CBCAFB5F2BB3C55500BC6520 /* DateTime.swift in Sources */ = {isa = PBXBuildFile; fileRef = CBCAFB5E2BB3C55500BC6520 /* DateTime.swift */; }; + CBCAFB612BB3C59500BC6520 /* InstanceFromNib.swift in Sources */ = {isa = PBXBuildFile; fileRef = CBCAFB602BB3C59500BC6520 /* InstanceFromNib.swift */; }; + CBCAFB632BB3C67A00BC6520 /* BaseViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = CBCAFB622BB3C67A00BC6520 /* BaseViewController.swift */; }; + CBCAFB662BB3C82C00BC6520 /* LunchViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = CBCAFB642BB3C82C00BC6520 /* LunchViewController.swift */; }; + CBCAFB672BB3C82C00BC6520 /* LunchViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = CBCAFB652BB3C82C00BC6520 /* LunchViewController.xib */; }; + CBCAFB692BB3CAC400BC6520 /* Lunch_ProgressView.swift in Sources */ = {isa = PBXBuildFile; fileRef = CBCAFB682BB3CAC400BC6520 /* Lunch_ProgressView.swift */; }; + CBCAFB6C2BB3EB4500BC6520 /* HomeViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = CBCAFB6A2BB3EB4500BC6520 /* HomeViewController.swift */; }; + CBCAFB6D2BB3EB4500BC6520 /* HomeViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = CBCAFB6B2BB3EB4500BC6520 /* HomeViewController.xib */; }; + CBCAFB6F2BB3EB7000BC6520 /* MPNavigationController.swift in Sources */ = {isa = PBXBuildFile; fileRef = CBCAFB6E2BB3EB7000BC6520 /* MPNavigationController.swift */; }; + CBCAFB712BB3EB9100BC6520 /* MPTabBarController.swift in Sources */ = {isa = PBXBuildFile; fileRef = CBCAFB702BB3EB9100BC6520 /* MPTabBarController.swift */; }; + CBCAFB732BB3EDAE00BC6520 /* MPCustomTabBar.swift in Sources */ = {isa = PBXBuildFile; fileRef = CBCAFB722BB3EDAE00BC6520 /* MPCustomTabBar.swift */; }; + CBCAFB752BB3EDCD00BC6520 /* MPCustomTabBarView.swift in Sources */ = {isa = PBXBuildFile; fileRef = CBCAFB742BB3EDCD00BC6520 /* MPCustomTabBarView.swift */; }; + CBCAFB772BB3EE4800BC6520 /* MPCustomTabBarItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = CBCAFB762BB3EE4800BC6520 /* MPCustomTabBarItem.swift */; }; + CBCAFB7C2BB3F98800BC6520 /* AddViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = CBCAFB7A2BB3F98800BC6520 /* AddViewController.swift */; }; + CBCAFB7D2BB3F98800BC6520 /* AddViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = CBCAFB7B2BB3F98800BC6520 /* AddViewController.xib */; }; + CBCAFB802BB3F99300BC6520 /* CenterViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = CBCAFB7E2BB3F99300BC6520 /* CenterViewController.swift */; }; + CBCAFB812BB3F99300BC6520 /* CenterViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = CBCAFB7F2BB3F99300BC6520 /* CenterViewController.xib */; }; + CBCAFB832BB40C1000BC6520 /* Home_HeadBannerView.swift in Sources */ = {isa = PBXBuildFile; fileRef = CBCAFB822BB40C1000BC6520 /* Home_HeadBannerView.swift */; }; + CBCAFB862BB40ED800BC6520 /* Home_RowListsTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = CBCAFB842BB40ED800BC6520 /* Home_RowListsTableViewCell.swift */; }; + CBCAFB872BB40ED800BC6520 /* Home_RowListsTableViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = CBCAFB852BB40ED800BC6520 /* Home_RowListsTableViewCell.xib */; }; + CBCAFB8A2BB40FBB00BC6520 /* Home_FirstListCollectionViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = CBCAFB882BB40FBB00BC6520 /* Home_FirstListCollectionViewCell.swift */; }; + CBCAFB8B2BB40FBB00BC6520 /* Home_FirstListCollectionViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = CBCAFB892BB40FBB00BC6520 /* Home_FirstListCollectionViewCell.xib */; }; + CBCAFB8E2BB4170000BC6520 /* Home_SecondListCollectionViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = CBCAFB8C2BB4170000BC6520 /* Home_SecondListCollectionViewCell.swift */; }; + CBCAFB8F2BB4170000BC6520 /* Home_SecondListCollectionViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = CBCAFB8D2BB4170000BC6520 /* Home_SecondListCollectionViewCell.xib */; }; + CBCAFB922BB4185700BC6520 /* Home_FourthListCollectionViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = CBCAFB902BB4185700BC6520 /* Home_FourthListCollectionViewCell.swift */; }; + CBCAFB932BB4185700BC6520 /* Home_FourthListCollectionViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = CBCAFB912BB4185700BC6520 /* Home_FourthListCollectionViewCell.xib */; }; + CBCAFB992BB4309C00BC6520 /* MPPresentationController.swift in Sources */ = {isa = PBXBuildFile; fileRef = CBCAFB982BB4309C00BC6520 /* MPPresentationController.swift */; }; + CBD5AEDE2BBBA7B600BF5A43 /* CenterTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = CBD5AEDC2BBBA7B600BF5A43 /* CenterTableViewCell.swift */; }; + CBD5AEDF2BBBA7B600BF5A43 /* CenterTableViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = CBD5AEDD2BBBA7B600BF5A43 /* CenterTableViewCell.xib */; }; + CBD5AEE12BBBE45300BF5A43 /* ImagePicker.swift in Sources */ = {isa = PBXBuildFile; fileRef = CBD5AEE02BBBE45300BF5A43 /* ImagePicker.swift */; }; + CBD958D22BB6600500666B0D /* Player_Slider.swift in Sources */ = {isa = PBXBuildFile; fileRef = CBD958D12BB6600500666B0D /* Player_Slider.swift */; }; + CBD958D42BB6942F00666B0D /* MPVolumeManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = CBD958D32BB6942F00666B0D /* MPVolumeManager.swift */; }; + CBE2C4C72BC783F700F283A7 /* MPHUD.swift in Sources */ = {isa = PBXBuildFile; fileRef = CBE2C4C62BC783F700F283A7 /* MPHUD.swift */; }; + CBE2C4C92BC7B25800F283A7 /* TableView.swift in Sources */ = {isa = PBXBuildFile; fileRef = CBE2C4C82BC7B25800F283A7 /* TableView.swift */; }; + CBE2C4CB2BC7BE5D00F283A7 /* MPNetWorkManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = CBE2C4CA2BC7BE5D00F283A7 /* MPNetWorkManager.swift */; }; + CBE477B12BB16CCC0031C14B /* Macro.swift in Sources */ = {isa = PBXBuildFile; fileRef = CBE477B02BB16CCC0031C14B /* Macro.swift */; }; + CBF13CB52BC395810025654F /* MPCustomTabBarView.xib in Resources */ = {isa = PBXBuildFile; fileRef = CBF13CB42BC395810025654F /* MPCustomTabBarView.xib */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ 009662292BB14A5A00FCA65F /* MusicPlayer.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = MusicPlayer.app; sourceTree = BUILT_PRODUCTS_DIR; }; 0096622C2BB14A5A00FCA65F /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; - 0096622E2BB14A5A00FCA65F /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = ""; }; 009662302BB14A5A00FCA65F /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; 009662332BB14A5A00FCA65F /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 009662362BB14A5A00FCA65F /* MusicPlayer.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = MusicPlayer.xcdatamodel; sourceTree = ""; }; 009662382BB14A5B00FCA65F /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 0096623B2BB14A5B00FCA65F /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 0096623D2BB14A5B00FCA65F /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 411725AB000C22E50EBD70BA /* Pods_MusicPlayer.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_MusicPlayer.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 531FB1850BFB3FBADB172069 /* Pods-MusicPlayer.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-MusicPlayer.debug.xcconfig"; path = "Target Support Files/Pods-MusicPlayer/Pods-MusicPlayer.debug.xcconfig"; sourceTree = ""; }; + CB0FBB7D2BC69616006290D4 /* PrivacyViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PrivacyViewController.swift; sourceTree = ""; }; + CB0FBB7E2BC69616006290D4 /* PrivacyViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = PrivacyViewController.xib; sourceTree = ""; }; + CB0FBB812BC6986E006290D4 /* ServiceViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ServiceViewController.swift; sourceTree = ""; }; + CB0FBB822BC6986E006290D4 /* ServiceViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = ServiceViewController.xib; sourceTree = ""; }; + CB1181442BC66E7C00586030 /* PlayerActionView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PlayerActionView.swift; sourceTree = ""; }; + CB1181462BC6874D00586030 /* SettingViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SettingViewController.swift; sourceTree = ""; }; + CB1181472BC6874D00586030 /* SettingViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = SettingViewController.xib; sourceTree = ""; }; + CB11814A2BC68B0500586030 /* SettingTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SettingTableViewCell.swift; sourceTree = ""; }; + CB11814B2BC68B0500586030 /* SettingTableViewCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = SettingTableViewCell.xib; sourceTree = ""; }; + CB11814E2BC68DD800586030 /* AboutViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AboutViewController.swift; sourceTree = ""; }; + CB11814F2BC68DD800586030 /* AboutViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = AboutViewController.xib; sourceTree = ""; }; + CB1C16512BC80BF100B96AB3 /* MPMediaCenterManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MPMediaCenterManager.swift; sourceTree = ""; }; + CB7B778D2BB50B1300C34894 /* CountTimerViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CountTimerViewController.swift; sourceTree = ""; }; + CB7B778E2BB50B1300C34894 /* CountTimerViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = CountTimerViewController.xib; sourceTree = ""; }; + CB7B77932BB55A4500C34894 /* PlayerViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PlayerViewController.swift; sourceTree = ""; }; + CB7B77942BB55A4500C34894 /* PlayerViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = PlayerViewController.xib; sourceTree = ""; }; + CBAD14AA2BC3E1C3001430F9 /* MPBottomShowView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MPBottomShowView.swift; sourceTree = ""; }; + CBAD14AC2BC3E201001430F9 /* MPBottomShowView.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = MPBottomShowView.xib; sourceTree = ""; }; + CBBFA9122BBA71CF00057FD5 /* MusicModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MusicModel.swift; sourceTree = ""; }; + CBBFA9172BBA83BA00057FD5 /* MPCoreDataHandlerManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MPCoreDataHandlerManager.swift; sourceTree = ""; }; + CBBFA9192BBA846600057FD5 /* CoreDataDelegete.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CoreDataDelegete.swift; sourceTree = ""; }; + CBBFA91D2BBA9B5C00057FD5 /* Notification.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Notification.swift; sourceTree = ""; }; + CBBFA91F2BBAB88500057FD5 /* MusicViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MusicViewModel.swift; sourceTree = ""; }; + CBBFA9212BBAB8FD00057FD5 /* LoadDataMusic.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LoadDataMusic.swift; sourceTree = ""; }; + CBC54E442BC4D5D3003B1901 /* Breathe.mp3 */ = {isa = PBXFileReference; lastKnownFileType = audio.mp3; path = Breathe.mp3; sourceTree = ""; }; + CBC54E452BC4D5D3003B1901 /* Shhh….mp3 */ = {isa = PBXFileReference; lastKnownFileType = audio.mp3; path = "Shhh….mp3"; sourceTree = ""; }; + CBC54E462BC4D5D3003B1901 /* Shh Shh.mp3 */ = {isa = PBXFileReference; lastKnownFileType = audio.mp3; path = "Shh Shh.mp3"; sourceTree = ""; }; + CBC54E482BC4D5D3003B1901 /* Mountain stream.mp3 */ = {isa = PBXFileReference; lastKnownFileType = audio.mp3; path = "Mountain stream.mp3"; sourceTree = ""; }; + CBC54E492BC4D5D3003B1901 /* Fireplace.mp3 */ = {isa = PBXFileReference; lastKnownFileType = audio.mp3; path = Fireplace.mp3; sourceTree = ""; }; + CBC54E4A2BC4D5D3003B1901 /* Water droplet.mp3 */ = {isa = PBXFileReference; lastKnownFileType = audio.mp3; path = "Water droplet.mp3"; sourceTree = ""; }; + CBC54E4B2BC4D5D3003B1901 /* TV.mp3 */ = {isa = PBXFileReference; lastKnownFileType = audio.mp3; path = TV.mp3; sourceTree = ""; }; + CBC54E4D2BC4D5D3003B1901 /* Chirping of Birds.mp3 */ = {isa = PBXFileReference; lastKnownFileType = audio.mp3; path = "Chirping of Birds.mp3"; sourceTree = ""; }; + CBC54E4E2BC4D5D3003B1901 /* waterfall.mp3 */ = {isa = PBXFileReference; lastKnownFileType = audio.mp3; path = waterfall.mp3; sourceTree = ""; }; + CBC54E4F2BC4D5D3003B1901 /* Beach.mp3 */ = {isa = PBXFileReference; lastKnownFileType = audio.mp3; path = Beach.mp3; sourceTree = ""; }; + CBC54E502BC4D5D3003B1901 /* Call of Seagulls.mp3 */ = {isa = PBXFileReference; lastKnownFileType = audio.mp3; path = "Call of Seagulls.mp3"; sourceTree = ""; }; + CBC54E512BC4D5D3003B1901 /* Cicada Chirping.mp3 */ = {isa = PBXFileReference; lastKnownFileType = audio.mp3; path = "Cicada Chirping.mp3"; sourceTree = ""; }; + CBC54E522BC4D5D3003B1901 /* Nocturnal Insects.mp3 */ = {isa = PBXFileReference; lastKnownFileType = audio.mp3; path = "Nocturnal Insects.mp3"; sourceTree = ""; }; + CBC54E532BC4D5D3003B1901 /* Howling Wind.mp3 */ = {isa = PBXFileReference; lastKnownFileType = audio.mp3; path = "Howling Wind.mp3"; sourceTree = ""; }; + CBC54E542BC4D5D3003B1901 /* Seawater Surging.mp3 */ = {isa = PBXFileReference; lastKnownFileType = audio.mp3; path = "Seawater Surging.mp3"; sourceTree = ""; }; + CBC54E552BC4D5D3003B1901 /* Summer Insects.mp3 */ = {isa = PBXFileReference; lastKnownFileType = audio.mp3; path = "Summer Insects.mp3"; sourceTree = ""; }; + CBC54E662BC4D90F003B1901 /* Resource.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Resource.plist; sourceTree = ""; }; + CBC6873C2BC24FFF0023ECA6 /* MoreViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MoreViewController.swift; sourceTree = ""; }; + CBC6873D2BC24FFF0023ECA6 /* MoreViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = MoreViewController.xib; sourceTree = ""; }; + CBC687402BC2788D0023ECA6 /* RenameViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RenameViewController.swift; sourceTree = ""; }; + CBC687412BC2788D0023ECA6 /* RenameViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = RenameViewController.xib; sourceTree = ""; }; + CBC687442BC27AE70023ECA6 /* DeleteViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DeleteViewController.swift; sourceTree = ""; }; + CBC687452BC27AE70023ECA6 /* DeleteViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = DeleteViewController.xib; sourceTree = ""; }; + CBC687482BC2882B0023ECA6 /* MPTableManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MPTableManager.swift; sourceTree = ""; }; + CBC6874A2BC2B0710023ECA6 /* String.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = String.swift; sourceTree = ""; }; + CBCAFB592BB3C2A000BC6520 /* LayoutConstraint.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LayoutConstraint.swift; sourceTree = ""; }; + CBCAFB5C2BB3C52100BC6520 /* HexColor.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HexColor.swift; sourceTree = ""; }; + CBCAFB5E2BB3C55500BC6520 /* DateTime.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DateTime.swift; sourceTree = ""; }; + CBCAFB602BB3C59500BC6520 /* InstanceFromNib.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = InstanceFromNib.swift; sourceTree = ""; }; + CBCAFB622BB3C67A00BC6520 /* BaseViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BaseViewController.swift; sourceTree = ""; }; + CBCAFB642BB3C82C00BC6520 /* LunchViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LunchViewController.swift; sourceTree = ""; }; + CBCAFB652BB3C82C00BC6520 /* LunchViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = LunchViewController.xib; sourceTree = ""; }; + CBCAFB682BB3CAC400BC6520 /* Lunch_ProgressView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Lunch_ProgressView.swift; sourceTree = ""; }; + CBCAFB6A2BB3EB4500BC6520 /* HomeViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HomeViewController.swift; sourceTree = ""; }; + CBCAFB6B2BB3EB4500BC6520 /* HomeViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = HomeViewController.xib; sourceTree = ""; }; + CBCAFB6E2BB3EB7000BC6520 /* MPNavigationController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MPNavigationController.swift; sourceTree = ""; }; + CBCAFB702BB3EB9100BC6520 /* MPTabBarController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MPTabBarController.swift; sourceTree = ""; }; + CBCAFB722BB3EDAE00BC6520 /* MPCustomTabBar.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MPCustomTabBar.swift; sourceTree = ""; }; + CBCAFB742BB3EDCD00BC6520 /* MPCustomTabBarView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MPCustomTabBarView.swift; sourceTree = ""; }; + CBCAFB762BB3EE4800BC6520 /* MPCustomTabBarItem.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MPCustomTabBarItem.swift; sourceTree = ""; }; + CBCAFB7A2BB3F98800BC6520 /* AddViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AddViewController.swift; sourceTree = ""; }; + CBCAFB7B2BB3F98800BC6520 /* AddViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = AddViewController.xib; sourceTree = ""; }; + CBCAFB7E2BB3F99300BC6520 /* CenterViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CenterViewController.swift; sourceTree = ""; }; + CBCAFB7F2BB3F99300BC6520 /* CenterViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = CenterViewController.xib; sourceTree = ""; }; + CBCAFB822BB40C1000BC6520 /* Home_HeadBannerView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Home_HeadBannerView.swift; sourceTree = ""; }; + CBCAFB842BB40ED800BC6520 /* Home_RowListsTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Home_RowListsTableViewCell.swift; sourceTree = ""; }; + CBCAFB852BB40ED800BC6520 /* Home_RowListsTableViewCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = Home_RowListsTableViewCell.xib; sourceTree = ""; }; + CBCAFB882BB40FBB00BC6520 /* Home_FirstListCollectionViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Home_FirstListCollectionViewCell.swift; sourceTree = ""; }; + CBCAFB892BB40FBB00BC6520 /* Home_FirstListCollectionViewCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = Home_FirstListCollectionViewCell.xib; sourceTree = ""; }; + CBCAFB8C2BB4170000BC6520 /* Home_SecondListCollectionViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Home_SecondListCollectionViewCell.swift; sourceTree = ""; }; + CBCAFB8D2BB4170000BC6520 /* Home_SecondListCollectionViewCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = Home_SecondListCollectionViewCell.xib; sourceTree = ""; }; + CBCAFB902BB4185700BC6520 /* Home_FourthListCollectionViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Home_FourthListCollectionViewCell.swift; sourceTree = ""; }; + CBCAFB912BB4185700BC6520 /* Home_FourthListCollectionViewCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = Home_FourthListCollectionViewCell.xib; sourceTree = ""; }; + CBCAFB982BB4309C00BC6520 /* MPPresentationController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MPPresentationController.swift; sourceTree = ""; }; + CBD5AEDC2BBBA7B600BF5A43 /* CenterTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CenterTableViewCell.swift; sourceTree = ""; }; + CBD5AEDD2BBBA7B600BF5A43 /* CenterTableViewCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = CenterTableViewCell.xib; sourceTree = ""; }; + CBD5AEE02BBBE45300BF5A43 /* ImagePicker.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ImagePicker.swift; sourceTree = ""; }; + CBD958D12BB6600500666B0D /* Player_Slider.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Player_Slider.swift; sourceTree = ""; }; + CBD958D32BB6942F00666B0D /* MPVolumeManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MPVolumeManager.swift; sourceTree = ""; }; + CBE2C4C62BC783F700F283A7 /* MPHUD.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MPHUD.swift; sourceTree = ""; }; + CBE2C4C82BC7B25800F283A7 /* TableView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TableView.swift; sourceTree = ""; }; + CBE2C4CA2BC7BE5D00F283A7 /* MPNetWorkManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MPNetWorkManager.swift; sourceTree = ""; }; + CBE477B02BB16CCC0031C14B /* Macro.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Macro.swift; sourceTree = ""; }; + CBF13CB42BC395810025654F /* MPCustomTabBarView.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = MPCustomTabBarView.xib; sourceTree = ""; }; + E2C6C85BFD4CD80DBA96D149 /* Pods-MusicPlayer.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-MusicPlayer.release.xcconfig"; path = "Target Support Files/Pods-MusicPlayer/Pods-MusicPlayer.release.xcconfig"; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -33,6 +211,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 639E3B772F558B3350DD56BA /* Pods_MusicPlayer.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -44,6 +223,8 @@ children = ( 0096622B2BB14A5A00FCA65F /* MusicPlayer */, 0096622A2BB14A5A00FCA65F /* Products */, + 56C2951BB834AC251194DEB4 /* Pods */, + 3B9616CD1FAA6632758C72E8 /* Frameworks */, ); sourceTree = ""; }; @@ -58,18 +239,351 @@ 0096622B2BB14A5A00FCA65F /* MusicPlayer */ = { isa = PBXGroup; children = ( + CBE4779F2BB16ABD0031C14B /* MP */, 0096622C2BB14A5A00FCA65F /* AppDelegate.swift */, - 0096622E2BB14A5A00FCA65F /* SceneDelegate.swift */, 009662302BB14A5A00FCA65F /* ViewController.swift */, 009662322BB14A5A00FCA65F /* Main.storyboard */, 009662382BB14A5B00FCA65F /* Assets.xcassets */, 0096623A2BB14A5B00FCA65F /* LaunchScreen.storyboard */, 0096623D2BB14A5B00FCA65F /* Info.plist */, - 009662352BB14A5A00FCA65F /* MusicPlayer.xcdatamodeld */, ); path = MusicPlayer; sourceTree = ""; }; + 3B9616CD1FAA6632758C72E8 /* Frameworks */ = { + isa = PBXGroup; + children = ( + 411725AB000C22E50EBD70BA /* Pods_MusicPlayer.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + 56C2951BB834AC251194DEB4 /* Pods */ = { + isa = PBXGroup; + children = ( + 531FB1850BFB3FBADB172069 /* Pods-MusicPlayer.debug.xcconfig */, + E2C6C85BFD4CD80DBA96D149 /* Pods-MusicPlayer.release.xcconfig */, + ); + path = Pods; + sourceTree = ""; + }; + CBBFA90F2BBA719600057FD5 /* ViewModels */ = { + isa = PBXGroup; + children = ( + CBBFA91F2BBAB88500057FD5 /* MusicViewModel.swift */, + ); + path = ViewModels; + sourceTree = ""; + }; + CBBFA9102BBA719600057FD5 /* Models */ = { + isa = PBXGroup; + children = ( + CBBFA9122BBA71CF00057FD5 /* MusicModel.swift */, + ); + path = Models; + sourceTree = ""; + }; + CBBFA9112BBA71AF00057FD5 /* DataBase */ = { + isa = PBXGroup; + children = ( + 009662352BB14A5A00FCA65F /* MusicPlayer.xcdatamodeld */, + ); + name = DataBase; + path = MusicPlayer/MP/Models/DataBase; + sourceTree = SOURCE_ROOT; + }; + CBBFA9142BBA81C400057FD5 /* Resource(资源) */ = { + isa = PBXGroup; + children = ( + CBC54E662BC4D90F003B1901 /* Resource.plist */, + CBC54E432BC4D5D3003B1901 /* Real human voice */, + CBC54E472BC4D5D3003B1901 /* Sounds of appliances */, + CBC54E4C2BC4D5D3003B1901 /* Sounds of nature */, + ); + name = "Resource(资源)"; + path = "MusicPlayer/MP/Common/Resource(资源)"; + sourceTree = SOURCE_ROOT; + }; + CBBFA9232BBABFCE00057FD5 /* Load */ = { + isa = PBXGroup; + children = ( + CBBFA9212BBAB8FD00057FD5 /* LoadDataMusic.swift */, + ); + path = Load; + sourceTree = ""; + }; + CBC54E432BC4D5D3003B1901 /* Real human voice */ = { + isa = PBXGroup; + children = ( + CBC54E442BC4D5D3003B1901 /* Breathe.mp3 */, + CBC54E452BC4D5D3003B1901 /* Shhh….mp3 */, + CBC54E462BC4D5D3003B1901 /* Shh Shh.mp3 */, + ); + path = "Real human voice"; + sourceTree = ""; + }; + CBC54E472BC4D5D3003B1901 /* Sounds of appliances */ = { + isa = PBXGroup; + children = ( + CBC54E482BC4D5D3003B1901 /* Mountain stream.mp3 */, + CBC54E492BC4D5D3003B1901 /* Fireplace.mp3 */, + CBC54E4A2BC4D5D3003B1901 /* Water droplet.mp3 */, + CBC54E4B2BC4D5D3003B1901 /* TV.mp3 */, + ); + path = "Sounds of appliances"; + sourceTree = ""; + }; + CBC54E4C2BC4D5D3003B1901 /* Sounds of nature */ = { + isa = PBXGroup; + children = ( + CBC54E4D2BC4D5D3003B1901 /* Chirping of Birds.mp3 */, + CBC54E4E2BC4D5D3003B1901 /* waterfall.mp3 */, + CBC54E4F2BC4D5D3003B1901 /* Beach.mp3 */, + CBC54E502BC4D5D3003B1901 /* Call of Seagulls.mp3 */, + CBC54E512BC4D5D3003B1901 /* Cicada Chirping.mp3 */, + CBC54E522BC4D5D3003B1901 /* Nocturnal Insects.mp3 */, + CBC54E532BC4D5D3003B1901 /* Howling Wind.mp3 */, + CBC54E542BC4D5D3003B1901 /* Seawater Surging.mp3 */, + CBC54E552BC4D5D3003B1901 /* Summer Insects.mp3 */, + ); + path = "Sounds of nature"; + sourceTree = ""; + }; + CBCAFB5B2BB3C35600BC6520 /* Protocol(公用协议) */ = { + isa = PBXGroup; + children = ( + CBCAFB602BB3C59500BC6520 /* InstanceFromNib.swift */, + CBBFA9192BBA846600057FD5 /* CoreDataDelegete.swift */, + ); + name = "Protocol(公用协议)"; + path = "MusicPlayer/MP/Common/Protocol(公用协议)"; + sourceTree = SOURCE_ROOT; + }; + CBCAFB782BB3F95300BC6520 /* Add(新增资源) */ = { + isa = PBXGroup; + children = ( + CBCAFB7A2BB3F98800BC6520 /* AddViewController.swift */, + CBCAFB7B2BB3F98800BC6520 /* AddViewController.xib */, + ); + name = "Add(新增资源)"; + path = "MusicPlayer/MP/ViewControllers/Add(新增资源)"; + sourceTree = SOURCE_ROOT; + }; + CBCAFB792BB3F97500BC6520 /* Add(新增资源) */ = { + isa = PBXGroup; + children = ( + ); + name = "Add(新增资源)"; + path = "MusicPlayer/MP/Views/Add(新增资源)"; + sourceTree = SOURCE_ROOT; + }; + CBE4779F2BB16ABD0031C14B /* MP */ = { + isa = PBXGroup; + children = ( + CBE477A22BB16ABD0031C14B /* Common */, + CBE477A32BB16ABD0031C14B /* ViewControllers */, + CBE477A82BB16ABD0031C14B /* Views */, + CBE477A02BB16ABD0031C14B /* ViewModels */, + CBE477A12BB16ABD0031C14B /* Models */, + ); + path = MP; + sourceTree = ""; + }; + CBE477A02BB16ABD0031C14B /* ViewModels */ = { + isa = PBXGroup; + children = ( + ); + path = ViewModels; + sourceTree = ""; + }; + CBE477A12BB16ABD0031C14B /* Models */ = { + isa = PBXGroup; + children = ( + CBBFA9232BBABFCE00057FD5 /* Load */, + CBBFA90F2BBA719600057FD5 /* ViewModels */, + CBBFA9102BBA719600057FD5 /* Models */, + CBBFA9112BBA71AF00057FD5 /* DataBase */, + ); + path = Models; + sourceTree = ""; + }; + CBE477A22BB16ABD0031C14B /* Common */ = { + isa = PBXGroup; + children = ( + CBE477AF2BB16C480031C14B /* Macro(宏定义与全局量) */, + CBE477AE2BB16C480031C14B /* Extension(扩展) */, + CBE477AD2BB16C480031C14B /* Tool(工具封装) */, + CBCAFB5B2BB3C35600BC6520 /* Protocol(公用协议) */, + CBBFA9142BBA81C400057FD5 /* Resource(资源) */, + ); + path = Common; + sourceTree = ""; + }; + CBE477A32BB16ABD0031C14B /* ViewControllers */ = { + isa = PBXGroup; + children = ( + CBE477A42BB16ABD0031C14B /* Base(基类-导航栏-标签栏-计时器-播放器) */, + CBE477A72BB16ABD0031C14B /* Lunch(启动页) */, + CBE477A62BB16ABD0031C14B /* Home(音乐资源列表) */, + CBCAFB782BB3F95300BC6520 /* Add(新增资源) */, + CBE477A52BB16ABD0031C14B /* Center(个人资源) */, + ); + path = ViewControllers; + sourceTree = ""; + }; + CBE477A42BB16ABD0031C14B /* Base(基类-导航栏-标签栏-计时器-播放器) */ = { + isa = PBXGroup; + children = ( + CBCAFB622BB3C67A00BC6520 /* BaseViewController.swift */, + CBCAFB6E2BB3EB7000BC6520 /* MPNavigationController.swift */, + CBCAFB702BB3EB9100BC6520 /* MPTabBarController.swift */, + CBCAFB982BB4309C00BC6520 /* MPPresentationController.swift */, + CB7B778D2BB50B1300C34894 /* CountTimerViewController.swift */, + CB7B778E2BB50B1300C34894 /* CountTimerViewController.xib */, + CB7B77932BB55A4500C34894 /* PlayerViewController.swift */, + CB7B77942BB55A4500C34894 /* PlayerViewController.xib */, + ); + path = "Base(基类-导航栏-标签栏-计时器-播放器)"; + sourceTree = ""; + }; + CBE477A52BB16ABD0031C14B /* Center(个人资源) */ = { + isa = PBXGroup; + children = ( + CBCAFB7E2BB3F99300BC6520 /* CenterViewController.swift */, + CBCAFB7F2BB3F99300BC6520 /* CenterViewController.xib */, + CBC6873C2BC24FFF0023ECA6 /* MoreViewController.swift */, + CBC6873D2BC24FFF0023ECA6 /* MoreViewController.xib */, + CBC687402BC2788D0023ECA6 /* RenameViewController.swift */, + CBC687412BC2788D0023ECA6 /* RenameViewController.xib */, + CBC687442BC27AE70023ECA6 /* DeleteViewController.swift */, + CBC687452BC27AE70023ECA6 /* DeleteViewController.xib */, + CB1181462BC6874D00586030 /* SettingViewController.swift */, + CB1181472BC6874D00586030 /* SettingViewController.xib */, + CB11814E2BC68DD800586030 /* AboutViewController.swift */, + CB11814F2BC68DD800586030 /* AboutViewController.xib */, + CB0FBB7D2BC69616006290D4 /* PrivacyViewController.swift */, + CB0FBB7E2BC69616006290D4 /* PrivacyViewController.xib */, + CB0FBB812BC6986E006290D4 /* ServiceViewController.swift */, + CB0FBB822BC6986E006290D4 /* ServiceViewController.xib */, + ); + path = "Center(个人资源)"; + sourceTree = ""; + }; + CBE477A62BB16ABD0031C14B /* Home(音乐资源列表) */ = { + isa = PBXGroup; + children = ( + CBCAFB6A2BB3EB4500BC6520 /* HomeViewController.swift */, + CBCAFB6B2BB3EB4500BC6520 /* HomeViewController.xib */, + ); + path = "Home(音乐资源列表)"; + sourceTree = ""; + }; + CBE477A72BB16ABD0031C14B /* Lunch(启动页) */ = { + isa = PBXGroup; + children = ( + CBCAFB642BB3C82C00BC6520 /* LunchViewController.swift */, + CBCAFB652BB3C82C00BC6520 /* LunchViewController.xib */, + ); + path = "Lunch(启动页)"; + sourceTree = ""; + }; + CBE477A82BB16ABD0031C14B /* Views */ = { + isa = PBXGroup; + children = ( + CBE477A92BB16ABD0031C14B /* Base(基类-导航栏-标签栏) */, + CBE477AC2BB16ABD0031C14B /* Lunch(启动页) */, + CBE477AB2BB16ABD0031C14B /* Home(音乐资源列表-播放器) */, + CBCAFB792BB3F97500BC6520 /* Add(新增资源) */, + CBE477AA2BB16ABD0031C14B /* Center(个人资源) */, + ); + path = Views; + sourceTree = ""; + }; + CBE477A92BB16ABD0031C14B /* Base(基类-导航栏-标签栏) */ = { + isa = PBXGroup; + children = ( + CBCAFB722BB3EDAE00BC6520 /* MPCustomTabBar.swift */, + CBCAFB742BB3EDCD00BC6520 /* MPCustomTabBarView.swift */, + CBF13CB42BC395810025654F /* MPCustomTabBarView.xib */, + CBCAFB762BB3EE4800BC6520 /* MPCustomTabBarItem.swift */, + CBAD14AA2BC3E1C3001430F9 /* MPBottomShowView.swift */, + CBAD14AC2BC3E201001430F9 /* MPBottomShowView.xib */, + CB1181442BC66E7C00586030 /* PlayerActionView.swift */, + ); + path = "Base(基类-导航栏-标签栏)"; + sourceTree = ""; + }; + CBE477AA2BB16ABD0031C14B /* Center(个人资源) */ = { + isa = PBXGroup; + children = ( + CBD5AEDC2BBBA7B600BF5A43 /* CenterTableViewCell.swift */, + CBD5AEDD2BBBA7B600BF5A43 /* CenterTableViewCell.xib */, + CB11814A2BC68B0500586030 /* SettingTableViewCell.swift */, + CB11814B2BC68B0500586030 /* SettingTableViewCell.xib */, + ); + path = "Center(个人资源)"; + sourceTree = ""; + }; + CBE477AB2BB16ABD0031C14B /* Home(音乐资源列表-播放器) */ = { + isa = PBXGroup; + children = ( + CBCAFB822BB40C1000BC6520 /* Home_HeadBannerView.swift */, + CBCAFB842BB40ED800BC6520 /* Home_RowListsTableViewCell.swift */, + CBCAFB852BB40ED800BC6520 /* Home_RowListsTableViewCell.xib */, + CBCAFB882BB40FBB00BC6520 /* Home_FirstListCollectionViewCell.swift */, + CBCAFB892BB40FBB00BC6520 /* Home_FirstListCollectionViewCell.xib */, + CBCAFB8C2BB4170000BC6520 /* Home_SecondListCollectionViewCell.swift */, + CBCAFB8D2BB4170000BC6520 /* Home_SecondListCollectionViewCell.xib */, + CBCAFB902BB4185700BC6520 /* Home_FourthListCollectionViewCell.swift */, + CBCAFB912BB4185700BC6520 /* Home_FourthListCollectionViewCell.xib */, + CBD958D12BB6600500666B0D /* Player_Slider.swift */, + ); + path = "Home(音乐资源列表-播放器)"; + sourceTree = ""; + }; + CBE477AC2BB16ABD0031C14B /* Lunch(启动页) */ = { + isa = PBXGroup; + children = ( + CBCAFB682BB3CAC400BC6520 /* Lunch_ProgressView.swift */, + ); + path = "Lunch(启动页)"; + sourceTree = ""; + }; + CBE477AD2BB16C480031C14B /* Tool(工具封装) */ = { + isa = PBXGroup; + children = ( + CB1C16512BC80BF100B96AB3 /* MPMediaCenterManager.swift */, + CBD958D32BB6942F00666B0D /* MPVolumeManager.swift */, + CBE2C4CA2BC7BE5D00F283A7 /* MPNetWorkManager.swift */, + CBBFA9172BBA83BA00057FD5 /* MPCoreDataHandlerManager.swift */, + CBE2C4C62BC783F700F283A7 /* MPHUD.swift */, + CBC687482BC2882B0023ECA6 /* MPTableManager.swift */, + ); + path = "Tool(工具封装)"; + sourceTree = ""; + }; + CBE477AE2BB16C480031C14B /* Extension(扩展) */ = { + isa = PBXGroup; + children = ( + CBCAFB592BB3C2A000BC6520 /* LayoutConstraint.swift */, + CBC6874A2BC2B0710023ECA6 /* String.swift */, + CBCAFB5C2BB3C52100BC6520 /* HexColor.swift */, + CBCAFB5E2BB3C55500BC6520 /* DateTime.swift */, + CBBFA91D2BBA9B5C00057FD5 /* Notification.swift */, + CBD5AEE02BBBE45300BF5A43 /* ImagePicker.swift */, + CBE2C4C82BC7B25800F283A7 /* TableView.swift */, + ); + path = "Extension(扩展)"; + sourceTree = ""; + }; + CBE477AF2BB16C480031C14B /* Macro(宏定义与全局量) */ = { + isa = PBXGroup; + children = ( + CBE477B02BB16CCC0031C14B /* Macro.swift */, + ); + path = "Macro(宏定义与全局量)"; + sourceTree = ""; + }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ @@ -77,9 +591,11 @@ isa = PBXNativeTarget; buildConfigurationList = 009662402BB14A5B00FCA65F /* Build configuration list for PBXNativeTarget "MusicPlayer" */; buildPhases = ( + B414E7BB114AD48C360264B3 /* [CP] Check Pods Manifest.lock */, 009662252BB14A5A00FCA65F /* Sources */, 009662262BB14A5A00FCA65F /* Frameworks */, 009662272BB14A5A00FCA65F /* Resources */, + AC7AD01315AAFAFE06F9CFEA /* [CP] Embed Pods Frameworks */, ); buildRules = ( ); @@ -97,6 +613,7 @@ isa = PBXProject; attributes = { BuildIndependentTargetsInParallel = 1; + CLASSPREFIX = ""; LastSwiftUpdateCheck = 1520; LastUpgradeCheck = 1520; TargetAttributes = { @@ -128,23 +645,152 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( + CBC54E5A2BC4D5D3003B1901 /* Fireplace.mp3 in Resources */, + CBC54E562BC4D5D3003B1901 /* Breathe.mp3 in Resources */, + CB11814D2BC68B0500586030 /* SettingTableViewCell.xib in Resources */, + CBCAFB812BB3F99300BC6520 /* CenterViewController.xib in Resources */, + CB1181492BC6874D00586030 /* SettingViewController.xib in Resources */, + CBC54E602BC4D5D3003B1901 /* Call of Seagulls.mp3 in Resources */, + CB7B77962BB55A4500C34894 /* PlayerViewController.xib in Resources */, + CB0FBB802BC69616006290D4 /* PrivacyViewController.xib in Resources */, + CBC54E5E2BC4D5D3003B1901 /* waterfall.mp3 in Resources */, + CBF13CB52BC395810025654F /* MPCustomTabBarView.xib in Resources */, + CBCAFB8F2BB4170000BC6520 /* Home_SecondListCollectionViewCell.xib in Resources */, + CBC54E5F2BC4D5D3003B1901 /* Beach.mp3 in Resources */, + CBC54E5D2BC4D5D3003B1901 /* Chirping of Birds.mp3 in Resources */, + CBCAFB7D2BB3F98800BC6520 /* AddViewController.xib in Resources */, + CBC54E572BC4D5D3003B1901 /* Shhh….mp3 in Resources */, 0096623C2BB14A5B00FCA65F /* LaunchScreen.storyboard in Resources */, + CBC54E5C2BC4D5D3003B1901 /* TV.mp3 in Resources */, + CBC54E592BC4D5D3003B1901 /* Mountain stream.mp3 in Resources */, + CBC54E622BC4D5D3003B1901 /* Nocturnal Insects.mp3 in Resources */, + CBCAFB672BB3C82C00BC6520 /* LunchViewController.xib in Resources */, + CB1181512BC68DD800586030 /* AboutViewController.xib in Resources */, + CBC6873F2BC24FFF0023ECA6 /* MoreViewController.xib in Resources */, + CBCAFB8B2BB40FBB00BC6520 /* Home_FirstListCollectionViewCell.xib in Resources */, + CBC54E612BC4D5D3003B1901 /* Cicada Chirping.mp3 in Resources */, + CBCAFB6D2BB3EB4500BC6520 /* HomeViewController.xib in Resources */, + CBC687432BC2788D0023ECA6 /* RenameViewController.xib in Resources */, 009662392BB14A5B00FCA65F /* Assets.xcassets in Resources */, + CBC54E672BC4D90F003B1901 /* Resource.plist in Resources */, + CBCAFB872BB40ED800BC6520 /* Home_RowListsTableViewCell.xib in Resources */, + CBC687472BC27AE70023ECA6 /* DeleteViewController.xib in Resources */, + CBC54E5B2BC4D5D3003B1901 /* Water droplet.mp3 in Resources */, + CBAD14AD2BC3E201001430F9 /* MPBottomShowView.xib in Resources */, + CBD5AEDF2BBBA7B600BF5A43 /* CenterTableViewCell.xib in Resources */, + CB7B77902BB50B1300C34894 /* CountTimerViewController.xib in Resources */, + CBCAFB932BB4185700BC6520 /* Home_FourthListCollectionViewCell.xib in Resources */, 009662342BB14A5A00FCA65F /* Main.storyboard in Resources */, + CBC54E642BC4D5D3003B1901 /* Seawater Surging.mp3 in Resources */, + CBC54E582BC4D5D3003B1901 /* Shh Shh.mp3 in Resources */, + CBC54E632BC4D5D3003B1901 /* Howling Wind.mp3 in Resources */, + CB0FBB842BC6986E006290D4 /* ServiceViewController.xib in Resources */, + CBC54E652BC4D5D3003B1901 /* Summer Insects.mp3 in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXResourcesBuildPhase section */ +/* Begin PBXShellScriptBuildPhase section */ + AC7AD01315AAFAFE06F9CFEA /* [CP] Embed Pods Frameworks */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-MusicPlayer/Pods-MusicPlayer-frameworks-${CONFIGURATION}-input-files.xcfilelist", + ); + name = "[CP] Embed Pods Frameworks"; + outputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-MusicPlayer/Pods-MusicPlayer-frameworks-${CONFIGURATION}-output-files.xcfilelist", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-MusicPlayer/Pods-MusicPlayer-frameworks.sh\"\n"; + showEnvVarsInLog = 0; + }; + B414E7BB114AD48C360264B3 /* [CP] Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", + ); + name = "[CP] Check Pods Manifest.lock"; + outputFileListPaths = ( + ); + outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-MusicPlayer-checkManifestLockResult.txt", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; + showEnvVarsInLog = 0; + }; +/* End PBXShellScriptBuildPhase section */ + /* Begin PBXSourcesBuildPhase section */ 009662252BB14A5A00FCA65F /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( + CBCAFB712BB3EB9100BC6520 /* MPTabBarController.swift in Sources */, + CBCAFB5A2BB3C2A000BC6520 /* LayoutConstraint.swift in Sources */, + CB7B778F2BB50B1300C34894 /* CountTimerViewController.swift in Sources */, + CBC687422BC2788D0023ECA6 /* RenameViewController.swift in Sources */, + CBBFA9202BBAB88500057FD5 /* MusicViewModel.swift in Sources */, + CB1C16522BC80BF100B96AB3 /* MPMediaCenterManager.swift in Sources */, + CBAD14AB2BC3E1C3001430F9 /* MPBottomShowView.swift in Sources */, + CBCAFB7C2BB3F98800BC6520 /* AddViewController.swift in Sources */, + CBD958D42BB6942F00666B0D /* MPVolumeManager.swift in Sources */, + CBCAFB752BB3EDCD00BC6520 /* MPCustomTabBarView.swift in Sources */, + CBBFA9182BBA83BA00057FD5 /* MPCoreDataHandlerManager.swift in Sources */, + CBCAFB662BB3C82C00BC6520 /* LunchViewController.swift in Sources */, + CB7B77952BB55A4500C34894 /* PlayerViewController.swift in Sources */, + CB0FBB7F2BC69616006290D4 /* PrivacyViewController.swift in Sources */, + CBBFA91A2BBA846600057FD5 /* CoreDataDelegete.swift in Sources */, + CBCAFB692BB3CAC400BC6520 /* Lunch_ProgressView.swift in Sources */, + CB11814C2BC68B0500586030 /* SettingTableViewCell.swift in Sources */, + CBCAFB832BB40C1000BC6520 /* Home_HeadBannerView.swift in Sources */, + CB1181502BC68DD800586030 /* AboutViewController.swift in Sources */, + CBCAFB5D2BB3C52100BC6520 /* HexColor.swift in Sources */, + CBD5AEDE2BBBA7B600BF5A43 /* CenterTableViewCell.swift in Sources */, + CB0FBB832BC6986E006290D4 /* ServiceViewController.swift in Sources */, + CBD5AEE12BBBE45300BF5A43 /* ImagePicker.swift in Sources */, + CBCAFB612BB3C59500BC6520 /* InstanceFromNib.swift in Sources */, + CBCAFB8A2BB40FBB00BC6520 /* Home_FirstListCollectionViewCell.swift in Sources */, + CBCAFB992BB4309C00BC6520 /* MPPresentationController.swift in Sources */, + CBBFA9222BBAB8FD00057FD5 /* LoadDataMusic.swift in Sources */, + CBCAFB732BB3EDAE00BC6520 /* MPCustomTabBar.swift in Sources */, 009662312BB14A5A00FCA65F /* ViewController.swift in Sources */, + CBE2C4C72BC783F700F283A7 /* MPHUD.swift in Sources */, + CBE2C4C92BC7B25800F283A7 /* TableView.swift in Sources */, 0096622D2BB14A5A00FCA65F /* AppDelegate.swift in Sources */, + CBCAFB922BB4185700BC6520 /* Home_FourthListCollectionViewCell.swift in Sources */, + CBCAFB772BB3EE4800BC6520 /* MPCustomTabBarItem.swift in Sources */, + CBCAFB6F2BB3EB7000BC6520 /* MPNavigationController.swift in Sources */, + CBC6873E2BC24FFF0023ECA6 /* MoreViewController.swift in Sources */, + CBCAFB862BB40ED800BC6520 /* Home_RowListsTableViewCell.swift in Sources */, + CB1181452BC66E7C00586030 /* PlayerActionView.swift in Sources */, + CBC687462BC27AE70023ECA6 /* DeleteViewController.swift in Sources */, + CB1181482BC6874D00586030 /* SettingViewController.swift in Sources */, + CBCAFB632BB3C67A00BC6520 /* BaseViewController.swift in Sources */, 009662372BB14A5A00FCA65F /* MusicPlayer.xcdatamodeld in Sources */, - 0096622F2BB14A5A00FCA65F /* SceneDelegate.swift in Sources */, + CBBFA9132BBA71CF00057FD5 /* MusicModel.swift in Sources */, + CBCAFB5F2BB3C55500BC6520 /* DateTime.swift in Sources */, + CBD958D22BB6600500666B0D /* Player_Slider.swift in Sources */, + CBCAFB802BB3F99300BC6520 /* CenterViewController.swift in Sources */, + CBC687492BC2882B0023ECA6 /* MPTableManager.swift in Sources */, + CBE477B12BB16CCC0031C14B /* Macro.swift in Sources */, + CBCAFB8E2BB4170000BC6520 /* Home_SecondListCollectionViewCell.swift in Sources */, + CBE2C4CB2BC7BE5D00F283A7 /* MPNetWorkManager.swift in Sources */, + CBCAFB6C2BB3EB4500BC6520 /* HomeViewController.swift in Sources */, + CBBFA91E2BBA9B5C00057FD5 /* Notification.swift in Sources */, + CBC6874B2BC2B0710023ECA6 /* String.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -291,19 +937,24 @@ }; 009662412BB14A5B00FCA65F /* Debug */ = { isa = XCBuildConfiguration; + baseConfigurationReference = 531FB1850BFB3FBADB172069 /* Pods-MusicPlayer.debug.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 1; - DEVELOPMENT_TEAM = 8DQD6BV6H9; + CURRENT_PROJECT_VERSION = 1.1; + DEVELOPMENT_TEAM = T93S37G27F; + ENABLE_USER_SCRIPT_SANDBOXING = NO; GENERATE_INFOPLIST_FILE = YES; INFOPLIST_FILE = MusicPlayer/Info.plist; + INFOPLIST_KEY_CFBundleDisplayName = Musicoo; INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; INFOPLIST_KEY_UILaunchStoryboardName = LaunchScreen; INFOPLIST_KEY_UIMainStoryboardFile = Main; - INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; - INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + INFOPLIST_KEY_UISupportedInterfaceOrientations = UIInterfaceOrientationPortrait; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown"; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", @@ -311,27 +962,36 @@ MARKETING_VERSION = 1.0; PRODUCT_BUNDLE_IDENTIFIER = com.lux.musicplayer.MusicPlayer; PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE_SPECIFIER = ""; + SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; + SUPPORTS_MACCATALYST = NO; + SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO; SWIFT_EMIT_LOC_STRINGS = YES; SWIFT_VERSION = 5.0; - TARGETED_DEVICE_FAMILY = "1,2"; + TARGETED_DEVICE_FAMILY = 1; }; name = Debug; }; 009662422BB14A5B00FCA65F /* Release */ = { isa = XCBuildConfiguration; + baseConfigurationReference = E2C6C85BFD4CD80DBA96D149 /* Pods-MusicPlayer.release.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 1; - DEVELOPMENT_TEAM = 8DQD6BV6H9; + CURRENT_PROJECT_VERSION = 1.1; + DEVELOPMENT_TEAM = T93S37G27F; + ENABLE_USER_SCRIPT_SANDBOXING = NO; GENERATE_INFOPLIST_FILE = YES; INFOPLIST_FILE = MusicPlayer/Info.plist; + INFOPLIST_KEY_CFBundleDisplayName = Musicoo; INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; INFOPLIST_KEY_UILaunchStoryboardName = LaunchScreen; INFOPLIST_KEY_UIMainStoryboardFile = Main; - INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; - INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + INFOPLIST_KEY_UISupportedInterfaceOrientations = UIInterfaceOrientationPortrait; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown"; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", @@ -339,9 +999,13 @@ MARKETING_VERSION = 1.0; PRODUCT_BUNDLE_IDENTIFIER = com.lux.musicplayer.MusicPlayer; PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE_SPECIFIER = ""; + SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; + SUPPORTS_MACCATALYST = NO; + SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO; SWIFT_EMIT_LOC_STRINGS = YES; SWIFT_VERSION = 5.0; - TARGETED_DEVICE_FAMILY = "1,2"; + TARGETED_DEVICE_FAMILY = 1; }; name = Release; }; diff --git a/MusicPlayer/AppDelegate.swift b/MusicPlayer/AppDelegate.swift index 2dc0355..a185125 100644 --- a/MusicPlayer/AppDelegate.swift +++ b/MusicPlayer/AppDelegate.swift @@ -7,33 +7,69 @@ import UIKit import CoreData - -@main +import AVFoundation +@_exported import IQKeyboardManagerSwift +@UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate { - - - + var window: UIWindow? func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { - // Override point for customization after application launch. + //请求通知权限 + UNUserNotificationCenter.current() + .requestAuthorization(options: [.alert, .sound, .badge]) { + (accepted, error) in + if !accepted { + print("Users are not allowed to be notified of messages.") + } + } + setAudioSupport() + IQKeyboardManager.shared.enable = true + IQKeyboardManager.shared.shouldResignOnTouchOutside = true + window = UIWindow(frame: UIScreen.main.bounds) + window?.backgroundColor = .init(hex: "#161616") + switch_lunch() 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) + //设置播放器会话状态 + private func setAudioSupport(){ + //设置会话 + let session = AVAudioSession.sharedInstance() + do { + //允许后台活跃,播放以及记录 + try session.setCategory(.playAndRecord, mode: .default) + //激活会话 + try session.setActive(true) + try session.overrideOutputAudioPort(.speaker) + } catch { + print("Failed to set type:\(error.localizedDescription)") + } + //响应后台控制 + UIApplication.shared.beginReceivingRemoteControlEvents() } - - 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. + + //MARK: - 页面跳转 + ///跳转启动页 + func switch_lunch() { + let lunchVC = LunchViewController() + //动画设置 + let transtition = CATransition() + transtition.duration = 0.8 + transtition.timingFunction = .init(name: .easeOut)//外层模糊化 + window?.layer.add(transtition, forKey: "lunch.easeOut") + window?.rootViewController = lunchVC + window?.makeKeyAndVisible() + } + ///跳转A面 + func switch_aSide() { + let tabBarVC = MPTabBarController() + //动画设置 + let transtition = CATransition() + transtition.duration = 0.8 + transtition.timingFunction = .init(name: .easeOut)//外层模糊化 + window?.layer.add(transtition, forKey: "aSide.easeOut") + window?.rootViewController = tabBarVC + window?.makeKeyAndVisible() } - // MARK: - Core Data stack - lazy var persistentContainer: NSPersistentContainer = { /* The persistent container for the application. This implementation @@ -76,6 +112,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate { } } } - } - +///访问appDelegate +let accessAppdelegate = ( UIApplication.shared.delegate as! AppDelegate) diff --git a/MusicPlayer/Assets.xcassets/AppIcon.appiconset/Contents.json b/MusicPlayer/Assets.xcassets/AppIcon.appiconset/Contents.json index 13613e3..0b8f485 100644 --- a/MusicPlayer/Assets.xcassets/AppIcon.appiconset/Contents.json +++ b/MusicPlayer/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -1,8 +1,115 @@ { "images" : [ { + "filename" : "icon-20@2x.png", "idiom" : "universal", "platform" : "ios", + "scale" : "2x", + "size" : "20x20" + }, + { + "filename" : "icon-20@3x.png", + "idiom" : "universal", + "platform" : "ios", + "scale" : "3x", + "size" : "20x20" + }, + { + "filename" : "icon-29@2x.png", + "idiom" : "universal", + "platform" : "ios", + "scale" : "2x", + "size" : "29x29" + }, + { + "filename" : "icon-29@3x.png", + "idiom" : "universal", + "platform" : "ios", + "scale" : "3x", + "size" : "29x29" + }, + { + "filename" : "icon-38@2x.png", + "idiom" : "universal", + "platform" : "ios", + "scale" : "2x", + "size" : "38x38" + }, + { + "filename" : "icon-38@3x.png", + "idiom" : "universal", + "platform" : "ios", + "scale" : "3x", + "size" : "38x38" + }, + { + "filename" : "icon-40@2x.png", + "idiom" : "universal", + "platform" : "ios", + "scale" : "2x", + "size" : "40x40" + }, + { + "filename" : "icon-40@3x.png", + "idiom" : "universal", + "platform" : "ios", + "scale" : "3x", + "size" : "40x40" + }, + { + "filename" : "icon-60@2x.png", + "idiom" : "universal", + "platform" : "ios", + "scale" : "2x", + "size" : "60x60" + }, + { + "filename" : "icon-60@3x.png", + "idiom" : "universal", + "platform" : "ios", + "scale" : "3x", + "size" : "60x60" + }, + { + "filename" : "icon-64@2x.png", + "idiom" : "universal", + "platform" : "ios", + "scale" : "2x", + "size" : "64x64" + }, + { + "filename" : "icon-64@3x.png", + "idiom" : "universal", + "platform" : "ios", + "scale" : "3x", + "size" : "64x64" + }, + { + "filename" : "icon-68@2x.png", + "idiom" : "universal", + "platform" : "ios", + "scale" : "2x", + "size" : "68x68" + }, + { + "filename" : "icon-76@2x.png", + "idiom" : "universal", + "platform" : "ios", + "scale" : "2x", + "size" : "76x76" + }, + { + "filename" : "icon-83.5@2x.png", + "idiom" : "universal", + "platform" : "ios", + "scale" : "2x", + "size" : "83.5x83.5" + }, + { + "filename" : "icon-1024.png", + "idiom" : "universal", + "platform" : "ios", + "scale" : "1x", "size" : "1024x1024" } ], diff --git a/MusicPlayer/Assets.xcassets/AppIcon.appiconset/icon-1024.png b/MusicPlayer/Assets.xcassets/AppIcon.appiconset/icon-1024.png new file mode 100644 index 0000000..b4b3da6 Binary files /dev/null and b/MusicPlayer/Assets.xcassets/AppIcon.appiconset/icon-1024.png differ diff --git a/MusicPlayer/Assets.xcassets/AppIcon.appiconset/icon-20@2x.png b/MusicPlayer/Assets.xcassets/AppIcon.appiconset/icon-20@2x.png new file mode 100644 index 0000000..7a9924f Binary files /dev/null and b/MusicPlayer/Assets.xcassets/AppIcon.appiconset/icon-20@2x.png differ diff --git a/MusicPlayer/Assets.xcassets/AppIcon.appiconset/icon-20@3x.png b/MusicPlayer/Assets.xcassets/AppIcon.appiconset/icon-20@3x.png new file mode 100644 index 0000000..abd8880 Binary files /dev/null and b/MusicPlayer/Assets.xcassets/AppIcon.appiconset/icon-20@3x.png differ diff --git a/MusicPlayer/Assets.xcassets/AppIcon.appiconset/icon-29@2x.png b/MusicPlayer/Assets.xcassets/AppIcon.appiconset/icon-29@2x.png new file mode 100644 index 0000000..f78ab20 Binary files /dev/null and b/MusicPlayer/Assets.xcassets/AppIcon.appiconset/icon-29@2x.png differ diff --git a/MusicPlayer/Assets.xcassets/AppIcon.appiconset/icon-29@3x.png b/MusicPlayer/Assets.xcassets/AppIcon.appiconset/icon-29@3x.png new file mode 100644 index 0000000..e668179 Binary files /dev/null and b/MusicPlayer/Assets.xcassets/AppIcon.appiconset/icon-29@3x.png differ diff --git a/MusicPlayer/Assets.xcassets/AppIcon.appiconset/icon-38@2x.png b/MusicPlayer/Assets.xcassets/AppIcon.appiconset/icon-38@2x.png new file mode 100644 index 0000000..a61fecd Binary files /dev/null and b/MusicPlayer/Assets.xcassets/AppIcon.appiconset/icon-38@2x.png differ diff --git a/MusicPlayer/Assets.xcassets/AppIcon.appiconset/icon-38@3x.png b/MusicPlayer/Assets.xcassets/AppIcon.appiconset/icon-38@3x.png new file mode 100644 index 0000000..ea23953 Binary files /dev/null and b/MusicPlayer/Assets.xcassets/AppIcon.appiconset/icon-38@3x.png differ diff --git a/MusicPlayer/Assets.xcassets/AppIcon.appiconset/icon-40@2x.png b/MusicPlayer/Assets.xcassets/AppIcon.appiconset/icon-40@2x.png new file mode 100644 index 0000000..bf7bf37 Binary files /dev/null and b/MusicPlayer/Assets.xcassets/AppIcon.appiconset/icon-40@2x.png differ diff --git a/MusicPlayer/Assets.xcassets/AppIcon.appiconset/icon-40@3x.png b/MusicPlayer/Assets.xcassets/AppIcon.appiconset/icon-40@3x.png new file mode 100644 index 0000000..da4ee31 Binary files /dev/null and b/MusicPlayer/Assets.xcassets/AppIcon.appiconset/icon-40@3x.png differ diff --git a/MusicPlayer/Assets.xcassets/AppIcon.appiconset/icon-60@2x.png b/MusicPlayer/Assets.xcassets/AppIcon.appiconset/icon-60@2x.png new file mode 100644 index 0000000..da4ee31 Binary files /dev/null and b/MusicPlayer/Assets.xcassets/AppIcon.appiconset/icon-60@2x.png differ diff --git a/MusicPlayer/Assets.xcassets/AppIcon.appiconset/icon-60@3x.png b/MusicPlayer/Assets.xcassets/AppIcon.appiconset/icon-60@3x.png new file mode 100644 index 0000000..809007b Binary files /dev/null and b/MusicPlayer/Assets.xcassets/AppIcon.appiconset/icon-60@3x.png differ diff --git a/MusicPlayer/Assets.xcassets/AppIcon.appiconset/icon-64@2x.png b/MusicPlayer/Assets.xcassets/AppIcon.appiconset/icon-64@2x.png new file mode 100644 index 0000000..795e996 Binary files /dev/null and b/MusicPlayer/Assets.xcassets/AppIcon.appiconset/icon-64@2x.png differ diff --git a/MusicPlayer/Assets.xcassets/AppIcon.appiconset/icon-64@3x.png b/MusicPlayer/Assets.xcassets/AppIcon.appiconset/icon-64@3x.png new file mode 100644 index 0000000..a9684b6 Binary files /dev/null and b/MusicPlayer/Assets.xcassets/AppIcon.appiconset/icon-64@3x.png differ diff --git a/MusicPlayer/Assets.xcassets/AppIcon.appiconset/icon-68@2x.png b/MusicPlayer/Assets.xcassets/AppIcon.appiconset/icon-68@2x.png new file mode 100644 index 0000000..d467694 Binary files /dev/null and b/MusicPlayer/Assets.xcassets/AppIcon.appiconset/icon-68@2x.png differ diff --git a/MusicPlayer/Assets.xcassets/AppIcon.appiconset/icon-76@2x.png b/MusicPlayer/Assets.xcassets/AppIcon.appiconset/icon-76@2x.png new file mode 100644 index 0000000..b1dbc08 Binary files /dev/null and b/MusicPlayer/Assets.xcassets/AppIcon.appiconset/icon-76@2x.png differ diff --git a/MusicPlayer/Assets.xcassets/AppIcon.appiconset/icon-83.5@2x.png b/MusicPlayer/Assets.xcassets/AppIcon.appiconset/icon-83.5@2x.png new file mode 100644 index 0000000..7041d75 Binary files /dev/null and b/MusicPlayer/Assets.xcassets/AppIcon.appiconset/icon-83.5@2x.png differ diff --git a/MusicPlayer/Assets.xcassets/Center/About'Icon.imageset/Contents.json b/MusicPlayer/Assets.xcassets/Center/About'Icon.imageset/Contents.json new file mode 100644 index 0000000..2f7f153 --- /dev/null +++ b/MusicPlayer/Assets.xcassets/Center/About'Icon.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "Group_1597880400@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "Group_1597880400@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/MusicPlayer/Assets.xcassets/Center/About'Icon.imageset/Group_1597880400@2x.png b/MusicPlayer/Assets.xcassets/Center/About'Icon.imageset/Group_1597880400@2x.png new file mode 100644 index 0000000..e26fc9c Binary files /dev/null and b/MusicPlayer/Assets.xcassets/Center/About'Icon.imageset/Group_1597880400@2x.png differ diff --git a/MusicPlayer/Assets.xcassets/Center/About'Icon.imageset/Group_1597880400@3x.png b/MusicPlayer/Assets.xcassets/Center/About'Icon.imageset/Group_1597880400@3x.png new file mode 100644 index 0000000..f51b09f Binary files /dev/null and b/MusicPlayer/Assets.xcassets/Center/About'Icon.imageset/Group_1597880400@3x.png differ diff --git a/MusicPlayer/Assets.xcassets/Center/About.imageset/Contents.json b/MusicPlayer/Assets.xcassets/Center/About.imageset/Contents.json new file mode 100644 index 0000000..5c4d3b1 --- /dev/null +++ b/MusicPlayer/Assets.xcassets/Center/About.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "Frame@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "Frame@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/MusicPlayer/Assets.xcassets/Center/About.imageset/Frame@2x.png b/MusicPlayer/Assets.xcassets/Center/About.imageset/Frame@2x.png new file mode 100644 index 0000000..2245f64 Binary files /dev/null and b/MusicPlayer/Assets.xcassets/Center/About.imageset/Frame@2x.png differ diff --git a/MusicPlayer/Assets.xcassets/Center/About.imageset/Frame@3x.png b/MusicPlayer/Assets.xcassets/Center/About.imageset/Frame@3x.png new file mode 100644 index 0000000..669c4b8 Binary files /dev/null and b/MusicPlayer/Assets.xcassets/Center/About.imageset/Frame@3x.png differ diff --git a/MusicPlayer/Assets.xcassets/Center/Add'logo.imageset/Contents.json b/MusicPlayer/Assets.xcassets/Center/Add'logo.imageset/Contents.json new file mode 100644 index 0000000..63ccbc5 --- /dev/null +++ b/MusicPlayer/Assets.xcassets/Center/Add'logo.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "Group_1171275560@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "Group_1171275560@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/MusicPlayer/Assets.xcassets/Center/Add'logo.imageset/Group_1171275560@2x.png b/MusicPlayer/Assets.xcassets/Center/Add'logo.imageset/Group_1171275560@2x.png new file mode 100644 index 0000000..5603061 Binary files /dev/null and b/MusicPlayer/Assets.xcassets/Center/Add'logo.imageset/Group_1171275560@2x.png differ diff --git a/MusicPlayer/Assets.xcassets/Center/Add'logo.imageset/Group_1171275560@3x.png b/MusicPlayer/Assets.xcassets/Center/Add'logo.imageset/Group_1171275560@3x.png new file mode 100644 index 0000000..5e77053 Binary files /dev/null and b/MusicPlayer/Assets.xcassets/Center/Add'logo.imageset/Group_1171275560@3x.png differ diff --git a/MusicPlayer/Assets.xcassets/Center/Cancel'bg.imageset/Contents.json b/MusicPlayer/Assets.xcassets/Center/Cancel'bg.imageset/Contents.json new file mode 100644 index 0000000..401fabb --- /dev/null +++ b/MusicPlayer/Assets.xcassets/Center/Cancel'bg.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "Group 22@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "Group 22@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/MusicPlayer/Assets.xcassets/Center/Cancel'bg.imageset/Group 22@2x.png b/MusicPlayer/Assets.xcassets/Center/Cancel'bg.imageset/Group 22@2x.png new file mode 100644 index 0000000..6cc75e7 Binary files /dev/null and b/MusicPlayer/Assets.xcassets/Center/Cancel'bg.imageset/Group 22@2x.png differ diff --git a/MusicPlayer/Assets.xcassets/Center/Cancel'bg.imageset/Group 22@3x.png b/MusicPlayer/Assets.xcassets/Center/Cancel'bg.imageset/Group 22@3x.png new file mode 100644 index 0000000..14e9266 Binary files /dev/null and b/MusicPlayer/Assets.xcassets/Center/Cancel'bg.imageset/Group 22@3x.png differ diff --git a/MusicPlayer/Assets.xcassets/Center/Center'bg.imageset/Contents.json b/MusicPlayer/Assets.xcassets/Center/Center'bg.imageset/Contents.json new file mode 100644 index 0000000..90946c9 --- /dev/null +++ b/MusicPlayer/Assets.xcassets/Center/Center'bg.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "Group_1171275540@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "Group_1171275540@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/MusicPlayer/Assets.xcassets/Center/Center'bg.imageset/Group_1171275540@2x.png b/MusicPlayer/Assets.xcassets/Center/Center'bg.imageset/Group_1171275540@2x.png new file mode 100644 index 0000000..17742c4 Binary files /dev/null and b/MusicPlayer/Assets.xcassets/Center/Center'bg.imageset/Group_1171275540@2x.png differ diff --git a/MusicPlayer/Assets.xcassets/Center/Center'bg.imageset/Group_1171275540@3x.png b/MusicPlayer/Assets.xcassets/Center/Center'bg.imageset/Group_1171275540@3x.png new file mode 100644 index 0000000..401942b Binary files /dev/null and b/MusicPlayer/Assets.xcassets/Center/Center'bg.imageset/Group_1171275540@3x.png differ diff --git a/MusicPlayer/Assets.xcassets/Center/Click to import'bg.imageset/Contents.json b/MusicPlayer/Assets.xcassets/Center/Click to import'bg.imageset/Contents.json new file mode 100644 index 0000000..b7d065d --- /dev/null +++ b/MusicPlayer/Assets.xcassets/Center/Click to import'bg.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "base@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "base@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/MusicPlayer/Assets.xcassets/Center/Click to import'bg.imageset/base@2x.png b/MusicPlayer/Assets.xcassets/Center/Click to import'bg.imageset/base@2x.png new file mode 100644 index 0000000..e8459e6 Binary files /dev/null and b/MusicPlayer/Assets.xcassets/Center/Click to import'bg.imageset/base@2x.png differ diff --git a/MusicPlayer/Assets.xcassets/Center/Click to import'bg.imageset/base@3x.png b/MusicPlayer/Assets.xcassets/Center/Click to import'bg.imageset/base@3x.png new file mode 100644 index 0000000..5bf88f3 Binary files /dev/null and b/MusicPlayer/Assets.xcassets/Center/Click to import'bg.imageset/base@3x.png differ diff --git a/MusicPlayer/Assets.xcassets/Center/Confirm'bg.imageset/Contents.json b/MusicPlayer/Assets.xcassets/Center/Confirm'bg.imageset/Contents.json new file mode 100644 index 0000000..8ddc620 --- /dev/null +++ b/MusicPlayer/Assets.xcassets/Center/Confirm'bg.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "Group 23@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "Group 23@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/MusicPlayer/Assets.xcassets/Center/Confirm'bg.imageset/Group 23@2x.png b/MusicPlayer/Assets.xcassets/Center/Confirm'bg.imageset/Group 23@2x.png new file mode 100644 index 0000000..3747c19 Binary files /dev/null and b/MusicPlayer/Assets.xcassets/Center/Confirm'bg.imageset/Group 23@2x.png differ diff --git a/MusicPlayer/Assets.xcassets/Center/Confirm'bg.imageset/Group 23@3x.png b/MusicPlayer/Assets.xcassets/Center/Confirm'bg.imageset/Group 23@3x.png new file mode 100644 index 0000000..606a074 Binary files /dev/null and b/MusicPlayer/Assets.xcassets/Center/Confirm'bg.imageset/Group 23@3x.png differ diff --git a/MusicPlayer/Assets.xcassets/Center/Contents.json b/MusicPlayer/Assets.xcassets/Center/Contents.json new file mode 100644 index 0000000..73c0059 --- /dev/null +++ b/MusicPlayer/Assets.xcassets/Center/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/MusicPlayer/Assets.xcassets/Center/Delete'bg.imageset/Contents.json b/MusicPlayer/Assets.xcassets/Center/Delete'bg.imageset/Contents.json new file mode 100644 index 0000000..8ddc620 --- /dev/null +++ b/MusicPlayer/Assets.xcassets/Center/Delete'bg.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "Group 23@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "Group 23@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/MusicPlayer/Assets.xcassets/Center/Delete'bg.imageset/Group 23@2x.png b/MusicPlayer/Assets.xcassets/Center/Delete'bg.imageset/Group 23@2x.png new file mode 100644 index 0000000..585b148 Binary files /dev/null and b/MusicPlayer/Assets.xcassets/Center/Delete'bg.imageset/Group 23@2x.png differ diff --git a/MusicPlayer/Assets.xcassets/Center/Delete'bg.imageset/Group 23@3x.png b/MusicPlayer/Assets.xcassets/Center/Delete'bg.imageset/Group 23@3x.png new file mode 100644 index 0000000..27ac16b Binary files /dev/null and b/MusicPlayer/Assets.xcassets/Center/Delete'bg.imageset/Group 23@3x.png differ diff --git a/MusicPlayer/Assets.xcassets/Center/Feedback.imageset/Contents.json b/MusicPlayer/Assets.xcassets/Center/Feedback.imageset/Contents.json new file mode 100644 index 0000000..5e88ec1 --- /dev/null +++ b/MusicPlayer/Assets.xcassets/Center/Feedback.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "Frame_1@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "Frame_1@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/MusicPlayer/Assets.xcassets/Center/Feedback.imageset/Frame_1@2x.png b/MusicPlayer/Assets.xcassets/Center/Feedback.imageset/Frame_1@2x.png new file mode 100644 index 0000000..4e924dd Binary files /dev/null and b/MusicPlayer/Assets.xcassets/Center/Feedback.imageset/Frame_1@2x.png differ diff --git a/MusicPlayer/Assets.xcassets/Center/Feedback.imageset/Frame_1@3x.png b/MusicPlayer/Assets.xcassets/Center/Feedback.imageset/Frame_1@3x.png new file mode 100644 index 0000000..ffe1095 Binary files /dev/null and b/MusicPlayer/Assets.xcassets/Center/Feedback.imageset/Frame_1@3x.png differ diff --git a/MusicPlayer/Assets.xcassets/Center/Go'logo.imageset/Contents.json b/MusicPlayer/Assets.xcassets/Center/Go'logo.imageset/Contents.json new file mode 100644 index 0000000..599f113 --- /dev/null +++ b/MusicPlayer/Assets.xcassets/Center/Go'logo.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "icon_arrow-left@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "icon_arrow-left@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/MusicPlayer/Assets.xcassets/Center/Go'logo.imageset/icon_arrow-left@2x.png b/MusicPlayer/Assets.xcassets/Center/Go'logo.imageset/icon_arrow-left@2x.png new file mode 100644 index 0000000..7205be3 Binary files /dev/null and b/MusicPlayer/Assets.xcassets/Center/Go'logo.imageset/icon_arrow-left@2x.png differ diff --git a/MusicPlayer/Assets.xcassets/Center/Go'logo.imageset/icon_arrow-left@3x.png b/MusicPlayer/Assets.xcassets/Center/Go'logo.imageset/icon_arrow-left@3x.png new file mode 100644 index 0000000..59f2e36 Binary files /dev/null and b/MusicPlayer/Assets.xcassets/Center/Go'logo.imageset/icon_arrow-left@3x.png differ diff --git a/MusicPlayer/Assets.xcassets/Center/MUSICOO'logo.imageset/Contents.json b/MusicPlayer/Assets.xcassets/Center/MUSICOO'logo.imageset/Contents.json new file mode 100644 index 0000000..320c9ff --- /dev/null +++ b/MusicPlayer/Assets.xcassets/Center/MUSICOO'logo.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "MUSICOO@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "MUSICOO@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/MusicPlayer/Assets.xcassets/Center/MUSICOO'logo.imageset/MUSICOO@2x.png b/MusicPlayer/Assets.xcassets/Center/MUSICOO'logo.imageset/MUSICOO@2x.png new file mode 100644 index 0000000..89acfc1 Binary files /dev/null and b/MusicPlayer/Assets.xcassets/Center/MUSICOO'logo.imageset/MUSICOO@2x.png differ diff --git a/MusicPlayer/Assets.xcassets/Center/MUSICOO'logo.imageset/MUSICOO@3x.png b/MusicPlayer/Assets.xcassets/Center/MUSICOO'logo.imageset/MUSICOO@3x.png new file mode 100644 index 0000000..fa72ce7 Binary files /dev/null and b/MusicPlayer/Assets.xcassets/Center/MUSICOO'logo.imageset/MUSICOO@3x.png differ diff --git a/MusicPlayer/Assets.xcassets/Center/More'logo.imageset/Contents.json b/MusicPlayer/Assets.xcassets/Center/More'logo.imageset/Contents.json new file mode 100644 index 0000000..f66fa84 --- /dev/null +++ b/MusicPlayer/Assets.xcassets/Center/More'logo.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "Group_1171275539@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "Group_1171275539@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/MusicPlayer/Assets.xcassets/Center/More'logo.imageset/Group_1171275539@2x.png b/MusicPlayer/Assets.xcassets/Center/More'logo.imageset/Group_1171275539@2x.png new file mode 100644 index 0000000..d3f641c Binary files /dev/null and b/MusicPlayer/Assets.xcassets/Center/More'logo.imageset/Group_1171275539@2x.png differ diff --git a/MusicPlayer/Assets.xcassets/Center/More'logo.imageset/Group_1171275539@3x.png b/MusicPlayer/Assets.xcassets/Center/More'logo.imageset/Group_1171275539@3x.png new file mode 100644 index 0000000..dc17be7 Binary files /dev/null and b/MusicPlayer/Assets.xcassets/Center/More'logo.imageset/Group_1171275539@3x.png differ diff --git a/MusicPlayer/Assets.xcassets/Center/Pop‘logo.imageset/Contents.json b/MusicPlayer/Assets.xcassets/Center/Pop‘logo.imageset/Contents.json new file mode 100644 index 0000000..3ee24a1 --- /dev/null +++ b/MusicPlayer/Assets.xcassets/Center/Pop‘logo.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "btn_square@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "btn_square@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/MusicPlayer/Assets.xcassets/Center/Pop‘logo.imageset/btn_square@2x.png b/MusicPlayer/Assets.xcassets/Center/Pop‘logo.imageset/btn_square@2x.png new file mode 100644 index 0000000..b0acad2 Binary files /dev/null and b/MusicPlayer/Assets.xcassets/Center/Pop‘logo.imageset/btn_square@2x.png differ diff --git a/MusicPlayer/Assets.xcassets/Center/Pop‘logo.imageset/btn_square@3x.png b/MusicPlayer/Assets.xcassets/Center/Pop‘logo.imageset/btn_square@3x.png new file mode 100644 index 0000000..f497fab Binary files /dev/null and b/MusicPlayer/Assets.xcassets/Center/Pop‘logo.imageset/btn_square@3x.png differ diff --git a/MusicPlayer/Assets.xcassets/Center/Privacy Policy.imageset/Contents.json b/MusicPlayer/Assets.xcassets/Center/Privacy Policy.imageset/Contents.json new file mode 100644 index 0000000..12f94d4 --- /dev/null +++ b/MusicPlayer/Assets.xcassets/Center/Privacy Policy.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "Frame_3@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "Frame_3@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/MusicPlayer/Assets.xcassets/Center/Privacy Policy.imageset/Frame_3@2x.png b/MusicPlayer/Assets.xcassets/Center/Privacy Policy.imageset/Frame_3@2x.png new file mode 100644 index 0000000..08e04c6 Binary files /dev/null and b/MusicPlayer/Assets.xcassets/Center/Privacy Policy.imageset/Frame_3@2x.png differ diff --git a/MusicPlayer/Assets.xcassets/Center/Privacy Policy.imageset/Frame_3@3x.png b/MusicPlayer/Assets.xcassets/Center/Privacy Policy.imageset/Frame_3@3x.png new file mode 100644 index 0000000..255c9fe Binary files /dev/null and b/MusicPlayer/Assets.xcassets/Center/Privacy Policy.imageset/Frame_3@3x.png differ diff --git a/MusicPlayer/Assets.xcassets/Center/Set'logo.imageset/Category@2x.png b/MusicPlayer/Assets.xcassets/Center/Set'logo.imageset/Category@2x.png new file mode 100644 index 0000000..08e2385 Binary files /dev/null and b/MusicPlayer/Assets.xcassets/Center/Set'logo.imageset/Category@2x.png differ diff --git a/MusicPlayer/Assets.xcassets/Center/Set'logo.imageset/Category@3x.png b/MusicPlayer/Assets.xcassets/Center/Set'logo.imageset/Category@3x.png new file mode 100644 index 0000000..793032a Binary files /dev/null and b/MusicPlayer/Assets.xcassets/Center/Set'logo.imageset/Category@3x.png differ diff --git a/MusicPlayer/Assets.xcassets/Center/Set'logo.imageset/Contents.json b/MusicPlayer/Assets.xcassets/Center/Set'logo.imageset/Contents.json new file mode 100644 index 0000000..869398c --- /dev/null +++ b/MusicPlayer/Assets.xcassets/Center/Set'logo.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "Category@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "Category@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/MusicPlayer/Assets.xcassets/Center/Set'mask.imageset/Contents.json b/MusicPlayer/Assets.xcassets/Center/Set'mask.imageset/Contents.json new file mode 100644 index 0000000..73ff453 --- /dev/null +++ b/MusicPlayer/Assets.xcassets/Center/Set'mask.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "Elements@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "Elements@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/MusicPlayer/Assets.xcassets/Center/Set'mask.imageset/Elements@2x.png b/MusicPlayer/Assets.xcassets/Center/Set'mask.imageset/Elements@2x.png new file mode 100644 index 0000000..004eea2 Binary files /dev/null and b/MusicPlayer/Assets.xcassets/Center/Set'mask.imageset/Elements@2x.png differ diff --git a/MusicPlayer/Assets.xcassets/Center/Set'mask.imageset/Elements@3x.png b/MusicPlayer/Assets.xcassets/Center/Set'mask.imageset/Elements@3x.png new file mode 100644 index 0000000..8d423d0 Binary files /dev/null and b/MusicPlayer/Assets.xcassets/Center/Set'mask.imageset/Elements@3x.png differ diff --git a/MusicPlayer/Assets.xcassets/Center/Share.imageset/Contents.json b/MusicPlayer/Assets.xcassets/Center/Share.imageset/Contents.json new file mode 100644 index 0000000..bec1dcc --- /dev/null +++ b/MusicPlayer/Assets.xcassets/Center/Share.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "Frame_2@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "Frame_2@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/MusicPlayer/Assets.xcassets/Center/Share.imageset/Frame_2@2x.png b/MusicPlayer/Assets.xcassets/Center/Share.imageset/Frame_2@2x.png new file mode 100644 index 0000000..6a32b0f Binary files /dev/null and b/MusicPlayer/Assets.xcassets/Center/Share.imageset/Frame_2@2x.png differ diff --git a/MusicPlayer/Assets.xcassets/Center/Share.imageset/Frame_2@3x.png b/MusicPlayer/Assets.xcassets/Center/Share.imageset/Frame_2@3x.png new file mode 100644 index 0000000..50ed16a Binary files /dev/null and b/MusicPlayer/Assets.xcassets/Center/Share.imageset/Frame_2@3x.png differ diff --git a/MusicPlayer/Assets.xcassets/Center/Terms of Use.imageset/Contents.json b/MusicPlayer/Assets.xcassets/Center/Terms of Use.imageset/Contents.json new file mode 100644 index 0000000..2d5bf9c --- /dev/null +++ b/MusicPlayer/Assets.xcassets/Center/Terms of Use.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "Frame_4@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "Frame_4@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/MusicPlayer/Assets.xcassets/Center/Terms of Use.imageset/Frame_4@2x.png b/MusicPlayer/Assets.xcassets/Center/Terms of Use.imageset/Frame_4@2x.png new file mode 100644 index 0000000..ce5cf3a Binary files /dev/null and b/MusicPlayer/Assets.xcassets/Center/Terms of Use.imageset/Frame_4@2x.png differ diff --git a/MusicPlayer/Assets.xcassets/Center/Terms of Use.imageset/Frame_4@3x.png b/MusicPlayer/Assets.xcassets/Center/Terms of Use.imageset/Frame_4@3x.png new file mode 100644 index 0000000..612a071 Binary files /dev/null and b/MusicPlayer/Assets.xcassets/Center/Terms of Use.imageset/Frame_4@3x.png differ diff --git a/MusicPlayer/Assets.xcassets/Center/empty.imageset/Contents.json b/MusicPlayer/Assets.xcassets/Center/empty.imageset/Contents.json new file mode 100644 index 0000000..61de948 --- /dev/null +++ b/MusicPlayer/Assets.xcassets/Center/empty.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "Group_1597880408@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "Group_1597880408@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/MusicPlayer/Assets.xcassets/Center/empty.imageset/Group_1597880408@2x.png b/MusicPlayer/Assets.xcassets/Center/empty.imageset/Group_1597880408@2x.png new file mode 100644 index 0000000..ee8c976 Binary files /dev/null and b/MusicPlayer/Assets.xcassets/Center/empty.imageset/Group_1597880408@2x.png differ diff --git a/MusicPlayer/Assets.xcassets/Center/empty.imageset/Group_1597880408@3x.png b/MusicPlayer/Assets.xcassets/Center/empty.imageset/Group_1597880408@3x.png new file mode 100644 index 0000000..c10e2b3 Binary files /dev/null and b/MusicPlayer/Assets.xcassets/Center/empty.imageset/Group_1597880408@3x.png differ diff --git a/MusicPlayer/Assets.xcassets/Home/Contents.json b/MusicPlayer/Assets.xcassets/Home/Contents.json new file mode 100644 index 0000000..73c0059 --- /dev/null +++ b/MusicPlayer/Assets.xcassets/Home/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/MusicPlayer/Assets.xcassets/Home/Home First'pause.imageset/Contents.json b/MusicPlayer/Assets.xcassets/Home/Home First'pause.imageset/Contents.json new file mode 100644 index 0000000..1fbd3d9 --- /dev/null +++ b/MusicPlayer/Assets.xcassets/Home/Home First'pause.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "Group_1171275452_1@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "Group_1171275452_1@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/MusicPlayer/Assets.xcassets/Home/Home First'pause.imageset/Group_1171275452_1@2x.png b/MusicPlayer/Assets.xcassets/Home/Home First'pause.imageset/Group_1171275452_1@2x.png new file mode 100644 index 0000000..2831694 Binary files /dev/null and b/MusicPlayer/Assets.xcassets/Home/Home First'pause.imageset/Group_1171275452_1@2x.png differ diff --git a/MusicPlayer/Assets.xcassets/Home/Home First'pause.imageset/Group_1171275452_1@3x.png b/MusicPlayer/Assets.xcassets/Home/Home First'pause.imageset/Group_1171275452_1@3x.png new file mode 100644 index 0000000..7858f3b Binary files /dev/null and b/MusicPlayer/Assets.xcassets/Home/Home First'pause.imageset/Group_1171275452_1@3x.png differ diff --git a/MusicPlayer/Assets.xcassets/Home/Home First'placeholder.imageset/Contents.json b/MusicPlayer/Assets.xcassets/Home/Home First'placeholder.imageset/Contents.json new file mode 100644 index 0000000..5b983e4 --- /dev/null +++ b/MusicPlayer/Assets.xcassets/Home/Home First'placeholder.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "Rectangle_40101@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "Rectangle_40101@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/MusicPlayer/Assets.xcassets/Home/Home First'placeholder.imageset/Rectangle_40101@2x.png b/MusicPlayer/Assets.xcassets/Home/Home First'placeholder.imageset/Rectangle_40101@2x.png new file mode 100644 index 0000000..1c036e7 Binary files /dev/null and b/MusicPlayer/Assets.xcassets/Home/Home First'placeholder.imageset/Rectangle_40101@2x.png differ diff --git a/MusicPlayer/Assets.xcassets/Home/Home First'placeholder.imageset/Rectangle_40101@3x.png b/MusicPlayer/Assets.xcassets/Home/Home First'placeholder.imageset/Rectangle_40101@3x.png new file mode 100644 index 0000000..16bcab7 Binary files /dev/null and b/MusicPlayer/Assets.xcassets/Home/Home First'placeholder.imageset/Rectangle_40101@3x.png differ diff --git a/MusicPlayer/Assets.xcassets/Home/Home First'play.imageset/Contents.json b/MusicPlayer/Assets.xcassets/Home/Home First'play.imageset/Contents.json new file mode 100644 index 0000000..940c4bd --- /dev/null +++ b/MusicPlayer/Assets.xcassets/Home/Home First'play.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "Group_1171275452@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "Group_1171275452@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/MusicPlayer/Assets.xcassets/Home/Home First'play.imageset/Group_1171275452@2x.png b/MusicPlayer/Assets.xcassets/Home/Home First'play.imageset/Group_1171275452@2x.png new file mode 100644 index 0000000..9067e6b Binary files /dev/null and b/MusicPlayer/Assets.xcassets/Home/Home First'play.imageset/Group_1171275452@2x.png differ diff --git a/MusicPlayer/Assets.xcassets/Home/Home First'play.imageset/Group_1171275452@3x.png b/MusicPlayer/Assets.xcassets/Home/Home First'play.imageset/Group_1171275452@3x.png new file mode 100644 index 0000000..ae59a01 Binary files /dev/null and b/MusicPlayer/Assets.xcassets/Home/Home First'play.imageset/Group_1171275452@3x.png differ diff --git a/MusicPlayer/Assets.xcassets/Home/Home Fourth'pause.imageset/Contents.json b/MusicPlayer/Assets.xcassets/Home/Home Fourth'pause.imageset/Contents.json new file mode 100644 index 0000000..5c4d3b1 --- /dev/null +++ b/MusicPlayer/Assets.xcassets/Home/Home Fourth'pause.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "Frame@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "Frame@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/MusicPlayer/Assets.xcassets/Home/Home Fourth'pause.imageset/Frame@2x.png b/MusicPlayer/Assets.xcassets/Home/Home Fourth'pause.imageset/Frame@2x.png new file mode 100644 index 0000000..26968fc Binary files /dev/null and b/MusicPlayer/Assets.xcassets/Home/Home Fourth'pause.imageset/Frame@2x.png differ diff --git a/MusicPlayer/Assets.xcassets/Home/Home Fourth'pause.imageset/Frame@3x.png b/MusicPlayer/Assets.xcassets/Home/Home Fourth'pause.imageset/Frame@3x.png new file mode 100644 index 0000000..e5a5769 Binary files /dev/null and b/MusicPlayer/Assets.xcassets/Home/Home Fourth'pause.imageset/Frame@3x.png differ diff --git a/MusicPlayer/Assets.xcassets/Home/Home Fourth'placeholder.imageset/Contents.json b/MusicPlayer/Assets.xcassets/Home/Home Fourth'placeholder.imageset/Contents.json new file mode 100644 index 0000000..8e69084 --- /dev/null +++ b/MusicPlayer/Assets.xcassets/Home/Home Fourth'placeholder.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "Rectangle_40109@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "Rectangle_40109@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/MusicPlayer/Assets.xcassets/Home/Home Fourth'placeholder.imageset/Rectangle_40109@2x.png b/MusicPlayer/Assets.xcassets/Home/Home Fourth'placeholder.imageset/Rectangle_40109@2x.png new file mode 100644 index 0000000..a73b6ab Binary files /dev/null and b/MusicPlayer/Assets.xcassets/Home/Home Fourth'placeholder.imageset/Rectangle_40109@2x.png differ diff --git a/MusicPlayer/Assets.xcassets/Home/Home Fourth'placeholder.imageset/Rectangle_40109@3x.png b/MusicPlayer/Assets.xcassets/Home/Home Fourth'placeholder.imageset/Rectangle_40109@3x.png new file mode 100644 index 0000000..d1093f3 Binary files /dev/null and b/MusicPlayer/Assets.xcassets/Home/Home Fourth'placeholder.imageset/Rectangle_40109@3x.png differ diff --git a/MusicPlayer/Assets.xcassets/Home/Home Fourth'play 1.imageset/Contents.json b/MusicPlayer/Assets.xcassets/Home/Home Fourth'play 1.imageset/Contents.json new file mode 100644 index 0000000..1ab8c19 --- /dev/null +++ b/MusicPlayer/Assets.xcassets/Home/Home Fourth'play 1.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "Group_1171275513@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "Group_1171275513@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/MusicPlayer/Assets.xcassets/Home/Home Fourth'play 1.imageset/Group_1171275513@2x.png b/MusicPlayer/Assets.xcassets/Home/Home Fourth'play 1.imageset/Group_1171275513@2x.png new file mode 100644 index 0000000..64a6f25 Binary files /dev/null and b/MusicPlayer/Assets.xcassets/Home/Home Fourth'play 1.imageset/Group_1171275513@2x.png differ diff --git a/MusicPlayer/Assets.xcassets/Home/Home Fourth'play 1.imageset/Group_1171275513@3x.png b/MusicPlayer/Assets.xcassets/Home/Home Fourth'play 1.imageset/Group_1171275513@3x.png new file mode 100644 index 0000000..8ff4a8b Binary files /dev/null and b/MusicPlayer/Assets.xcassets/Home/Home Fourth'play 1.imageset/Group_1171275513@3x.png differ diff --git a/MusicPlayer/Assets.xcassets/Home/Home Fourth'play.imageset/Contents.json b/MusicPlayer/Assets.xcassets/Home/Home Fourth'play.imageset/Contents.json new file mode 100644 index 0000000..6a4d508 --- /dev/null +++ b/MusicPlayer/Assets.xcassets/Home/Home Fourth'play.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "Vector@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "Vector@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/MusicPlayer/Assets.xcassets/Home/Home Fourth'play.imageset/Vector@2x.png b/MusicPlayer/Assets.xcassets/Home/Home Fourth'play.imageset/Vector@2x.png new file mode 100644 index 0000000..f12c195 Binary files /dev/null and b/MusicPlayer/Assets.xcassets/Home/Home Fourth'play.imageset/Vector@2x.png differ diff --git a/MusicPlayer/Assets.xcassets/Home/Home Fourth'play.imageset/Vector@3x.png b/MusicPlayer/Assets.xcassets/Home/Home Fourth'play.imageset/Vector@3x.png new file mode 100644 index 0000000..f22087e Binary files /dev/null and b/MusicPlayer/Assets.xcassets/Home/Home Fourth'play.imageset/Vector@3x.png differ diff --git a/MusicPlayer/Assets.xcassets/Home/Home Second'placeholder.imageset/Contents.json b/MusicPlayer/Assets.xcassets/Home/Home Second'placeholder.imageset/Contents.json new file mode 100644 index 0000000..a0aac2f --- /dev/null +++ b/MusicPlayer/Assets.xcassets/Home/Home Second'placeholder.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "Rectangle_40105@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "Rectangle_40105@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/MusicPlayer/Assets.xcassets/Home/Home Second'placeholder.imageset/Rectangle_40105@2x.png b/MusicPlayer/Assets.xcassets/Home/Home Second'placeholder.imageset/Rectangle_40105@2x.png new file mode 100644 index 0000000..d20956c Binary files /dev/null and b/MusicPlayer/Assets.xcassets/Home/Home Second'placeholder.imageset/Rectangle_40105@2x.png differ diff --git a/MusicPlayer/Assets.xcassets/Home/Home Second'placeholder.imageset/Rectangle_40105@3x.png b/MusicPlayer/Assets.xcassets/Home/Home Second'placeholder.imageset/Rectangle_40105@3x.png new file mode 100644 index 0000000..0860cb3 Binary files /dev/null and b/MusicPlayer/Assets.xcassets/Home/Home Second'placeholder.imageset/Rectangle_40105@3x.png differ diff --git a/MusicPlayer/Assets.xcassets/Home/Home Second'play.imageset/Contents.json b/MusicPlayer/Assets.xcassets/Home/Home Second'play.imageset/Contents.json new file mode 100644 index 0000000..a6e3ffd --- /dev/null +++ b/MusicPlayer/Assets.xcassets/Home/Home Second'play.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "Vector_1@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "Vector_1@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/MusicPlayer/Assets.xcassets/Home/Home Second'play.imageset/Vector_1@2x.png b/MusicPlayer/Assets.xcassets/Home/Home Second'play.imageset/Vector_1@2x.png new file mode 100644 index 0000000..5ec4566 Binary files /dev/null and b/MusicPlayer/Assets.xcassets/Home/Home Second'play.imageset/Vector_1@2x.png differ diff --git a/MusicPlayer/Assets.xcassets/Home/Home Second'play.imageset/Vector_1@3x.png b/MusicPlayer/Assets.xcassets/Home/Home Second'play.imageset/Vector_1@3x.png new file mode 100644 index 0000000..6337f31 Binary files /dev/null and b/MusicPlayer/Assets.xcassets/Home/Home Second'play.imageset/Vector_1@3x.png differ diff --git a/MusicPlayer/Assets.xcassets/Home/Home'banner.imageset/Contents.json b/MusicPlayer/Assets.xcassets/Home/Home'banner.imageset/Contents.json new file mode 100644 index 0000000..dc6c167 --- /dev/null +++ b/MusicPlayer/Assets.xcassets/Home/Home'banner.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "Group_1171275509@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "Group_1171275509@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/MusicPlayer/Assets.xcassets/Home/Home'banner.imageset/Group_1171275509@2x.png b/MusicPlayer/Assets.xcassets/Home/Home'banner.imageset/Group_1171275509@2x.png new file mode 100644 index 0000000..545d1dd Binary files /dev/null and b/MusicPlayer/Assets.xcassets/Home/Home'banner.imageset/Group_1171275509@2x.png differ diff --git a/MusicPlayer/Assets.xcassets/Home/Home'banner.imageset/Group_1171275509@3x.png b/MusicPlayer/Assets.xcassets/Home/Home'banner.imageset/Group_1171275509@3x.png new file mode 100644 index 0000000..959abde Binary files /dev/null and b/MusicPlayer/Assets.xcassets/Home/Home'banner.imageset/Group_1171275509@3x.png differ diff --git a/MusicPlayer/Assets.xcassets/Home/Home'bg.imageset/Contents.json b/MusicPlayer/Assets.xcassets/Home/Home'bg.imageset/Contents.json new file mode 100644 index 0000000..1057d71 --- /dev/null +++ b/MusicPlayer/Assets.xcassets/Home/Home'bg.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "背景@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "背景@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/MusicPlayer/Assets.xcassets/Home/Home'bg.imageset/背景@2x.png b/MusicPlayer/Assets.xcassets/Home/Home'bg.imageset/背景@2x.png new file mode 100644 index 0000000..e00fc3e Binary files /dev/null and b/MusicPlayer/Assets.xcassets/Home/Home'bg.imageset/背景@2x.png differ diff --git a/MusicPlayer/Assets.xcassets/Home/Home'bg.imageset/背景@3x.png b/MusicPlayer/Assets.xcassets/Home/Home'bg.imageset/背景@3x.png new file mode 100644 index 0000000..67a3141 Binary files /dev/null and b/MusicPlayer/Assets.xcassets/Home/Home'bg.imageset/背景@3x.png differ diff --git a/MusicPlayer/Assets.xcassets/ICON.imageset/Contents.json b/MusicPlayer/Assets.xcassets/ICON.imageset/Contents.json new file mode 100644 index 0000000..006a126 --- /dev/null +++ b/MusicPlayer/Assets.xcassets/ICON.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "启动图标.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "启动图标 1.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/MusicPlayer/Assets.xcassets/ICON.imageset/启动图标 1.png b/MusicPlayer/Assets.xcassets/ICON.imageset/启动图标 1.png new file mode 100644 index 0000000..ad46ca9 Binary files /dev/null and b/MusicPlayer/Assets.xcassets/ICON.imageset/启动图标 1.png differ diff --git a/MusicPlayer/Assets.xcassets/ICON.imageset/启动图标.png b/MusicPlayer/Assets.xcassets/ICON.imageset/启动图标.png new file mode 100644 index 0000000..ad46ca9 Binary files /dev/null and b/MusicPlayer/Assets.xcassets/ICON.imageset/启动图标.png differ diff --git a/MusicPlayer/Assets.xcassets/Lunch/Contents.json b/MusicPlayer/Assets.xcassets/Lunch/Contents.json new file mode 100644 index 0000000..73c0059 --- /dev/null +++ b/MusicPlayer/Assets.xcassets/Lunch/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/MusicPlayer/Assets.xcassets/Lunch/Lunch'bg.imageset/Contents.json b/MusicPlayer/Assets.xcassets/Lunch/Lunch'bg.imageset/Contents.json new file mode 100644 index 0000000..f209603 --- /dev/null +++ b/MusicPlayer/Assets.xcassets/Lunch/Lunch'bg.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "Group_1597880401@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "Group_1597880401@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/MusicPlayer/Assets.xcassets/Lunch/Lunch'bg.imageset/Group_1597880401@2x.png b/MusicPlayer/Assets.xcassets/Lunch/Lunch'bg.imageset/Group_1597880401@2x.png new file mode 100644 index 0000000..d2668a0 Binary files /dev/null and b/MusicPlayer/Assets.xcassets/Lunch/Lunch'bg.imageset/Group_1597880401@2x.png differ diff --git a/MusicPlayer/Assets.xcassets/Lunch/Lunch'bg.imageset/Group_1597880401@3x.png b/MusicPlayer/Assets.xcassets/Lunch/Lunch'bg.imageset/Group_1597880401@3x.png new file mode 100644 index 0000000..5941238 Binary files /dev/null and b/MusicPlayer/Assets.xcassets/Lunch/Lunch'bg.imageset/Group_1597880401@3x.png differ diff --git a/MusicPlayer/Assets.xcassets/Player/Auto dark'logo.imageset/Contents.json b/MusicPlayer/Assets.xcassets/Player/Auto dark'logo.imageset/Contents.json new file mode 100644 index 0000000..e2f920e --- /dev/null +++ b/MusicPlayer/Assets.xcassets/Player/Auto dark'logo.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "Group_1171275591@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "Group_1171275591@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/MusicPlayer/Assets.xcassets/Player/Auto dark'logo.imageset/Group_1171275591@2x.png b/MusicPlayer/Assets.xcassets/Player/Auto dark'logo.imageset/Group_1171275591@2x.png new file mode 100644 index 0000000..6fe7f66 Binary files /dev/null and b/MusicPlayer/Assets.xcassets/Player/Auto dark'logo.imageset/Group_1171275591@2x.png differ diff --git a/MusicPlayer/Assets.xcassets/Player/Auto dark'logo.imageset/Group_1171275591@3x.png b/MusicPlayer/Assets.xcassets/Player/Auto dark'logo.imageset/Group_1171275591@3x.png new file mode 100644 index 0000000..07fa7ce Binary files /dev/null and b/MusicPlayer/Assets.xcassets/Player/Auto dark'logo.imageset/Group_1171275591@3x.png differ diff --git a/MusicPlayer/Assets.xcassets/Player/Auto light'logo.imageset/Contents.json b/MusicPlayer/Assets.xcassets/Player/Auto light'logo.imageset/Contents.json new file mode 100644 index 0000000..96bd0ba --- /dev/null +++ b/MusicPlayer/Assets.xcassets/Player/Auto light'logo.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "Group_1171275591_1@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "Group_1171275591_1@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/MusicPlayer/Assets.xcassets/Player/Auto light'logo.imageset/Group_1171275591_1@2x.png b/MusicPlayer/Assets.xcassets/Player/Auto light'logo.imageset/Group_1171275591_1@2x.png new file mode 100644 index 0000000..4396c4a Binary files /dev/null and b/MusicPlayer/Assets.xcassets/Player/Auto light'logo.imageset/Group_1171275591_1@2x.png differ diff --git a/MusicPlayer/Assets.xcassets/Player/Auto light'logo.imageset/Group_1171275591_1@3x.png b/MusicPlayer/Assets.xcassets/Player/Auto light'logo.imageset/Group_1171275591_1@3x.png new file mode 100644 index 0000000..eac5ee8 Binary files /dev/null and b/MusicPlayer/Assets.xcassets/Player/Auto light'logo.imageset/Group_1171275591_1@3x.png differ diff --git a/MusicPlayer/Assets.xcassets/Player/Auto playing'logo.imageset/Contents.json b/MusicPlayer/Assets.xcassets/Player/Auto playing'logo.imageset/Contents.json new file mode 100644 index 0000000..e2f920e --- /dev/null +++ b/MusicPlayer/Assets.xcassets/Player/Auto playing'logo.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "Group_1171275591@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "Group_1171275591@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/MusicPlayer/Assets.xcassets/Player/Auto playing'logo.imageset/Group_1171275591@2x.png b/MusicPlayer/Assets.xcassets/Player/Auto playing'logo.imageset/Group_1171275591@2x.png new file mode 100644 index 0000000..b834084 Binary files /dev/null and b/MusicPlayer/Assets.xcassets/Player/Auto playing'logo.imageset/Group_1171275591@2x.png differ diff --git a/MusicPlayer/Assets.xcassets/Player/Auto playing'logo.imageset/Group_1171275591@3x.png b/MusicPlayer/Assets.xcassets/Player/Auto playing'logo.imageset/Group_1171275591@3x.png new file mode 100644 index 0000000..811af69 Binary files /dev/null and b/MusicPlayer/Assets.xcassets/Player/Auto playing'logo.imageset/Group_1171275591@3x.png differ diff --git a/MusicPlayer/Assets.xcassets/Player/Contents.json b/MusicPlayer/Assets.xcassets/Player/Contents.json new file mode 100644 index 0000000..73c0059 --- /dev/null +++ b/MusicPlayer/Assets.xcassets/Player/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/MusicPlayer/Assets.xcassets/Player/Dismiss dark'logo.imageset/Contents.json b/MusicPlayer/Assets.xcassets/Player/Dismiss dark'logo.imageset/Contents.json new file mode 100644 index 0000000..5c4d3b1 --- /dev/null +++ b/MusicPlayer/Assets.xcassets/Player/Dismiss dark'logo.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "Frame@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "Frame@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/MusicPlayer/Assets.xcassets/Player/Dismiss dark'logo.imageset/Frame@2x.png b/MusicPlayer/Assets.xcassets/Player/Dismiss dark'logo.imageset/Frame@2x.png new file mode 100644 index 0000000..93047c4 Binary files /dev/null and b/MusicPlayer/Assets.xcassets/Player/Dismiss dark'logo.imageset/Frame@2x.png differ diff --git a/MusicPlayer/Assets.xcassets/Player/Dismiss dark'logo.imageset/Frame@3x.png b/MusicPlayer/Assets.xcassets/Player/Dismiss dark'logo.imageset/Frame@3x.png new file mode 100644 index 0000000..9a63c2e Binary files /dev/null and b/MusicPlayer/Assets.xcassets/Player/Dismiss dark'logo.imageset/Frame@3x.png differ diff --git a/MusicPlayer/Assets.xcassets/Player/Dismiss light'logo.imageset/Contents.json b/MusicPlayer/Assets.xcassets/Player/Dismiss light'logo.imageset/Contents.json new file mode 100644 index 0000000..5c4d3b1 --- /dev/null +++ b/MusicPlayer/Assets.xcassets/Player/Dismiss light'logo.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "Frame@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "Frame@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/MusicPlayer/Assets.xcassets/Player/Dismiss light'logo.imageset/Frame@2x.png b/MusicPlayer/Assets.xcassets/Player/Dismiss light'logo.imageset/Frame@2x.png new file mode 100644 index 0000000..e61eefe Binary files /dev/null and b/MusicPlayer/Assets.xcassets/Player/Dismiss light'logo.imageset/Frame@2x.png differ diff --git a/MusicPlayer/Assets.xcassets/Player/Dismiss light'logo.imageset/Frame@3x.png b/MusicPlayer/Assets.xcassets/Player/Dismiss light'logo.imageset/Frame@3x.png new file mode 100644 index 0000000..5088bbe Binary files /dev/null and b/MusicPlayer/Assets.xcassets/Player/Dismiss light'logo.imageset/Frame@3x.png differ diff --git a/MusicPlayer/Assets.xcassets/Player/Lamp dark'logo.imageset/Contents.json b/MusicPlayer/Assets.xcassets/Player/Lamp dark'logo.imageset/Contents.json new file mode 100644 index 0000000..8755efe --- /dev/null +++ b/MusicPlayer/Assets.xcassets/Player/Lamp dark'logo.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "Group_1171275592@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "Group_1171275592@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/MusicPlayer/Assets.xcassets/Player/Lamp dark'logo.imageset/Group_1171275592@2x.png b/MusicPlayer/Assets.xcassets/Player/Lamp dark'logo.imageset/Group_1171275592@2x.png new file mode 100644 index 0000000..defc42a Binary files /dev/null and b/MusicPlayer/Assets.xcassets/Player/Lamp dark'logo.imageset/Group_1171275592@2x.png differ diff --git a/MusicPlayer/Assets.xcassets/Player/Lamp dark'logo.imageset/Group_1171275592@3x.png b/MusicPlayer/Assets.xcassets/Player/Lamp dark'logo.imageset/Group_1171275592@3x.png new file mode 100644 index 0000000..ff01d99 Binary files /dev/null and b/MusicPlayer/Assets.xcassets/Player/Lamp dark'logo.imageset/Group_1171275592@3x.png differ diff --git a/MusicPlayer/Assets.xcassets/Player/Lamp light'logo.imageset/Contents.json b/MusicPlayer/Assets.xcassets/Player/Lamp light'logo.imageset/Contents.json new file mode 100644 index 0000000..3c59bd7 --- /dev/null +++ b/MusicPlayer/Assets.xcassets/Player/Lamp light'logo.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "Group_1171275592_2@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "Group_1171275592_2@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/MusicPlayer/Assets.xcassets/Player/Lamp light'logo.imageset/Group_1171275592_2@2x.png b/MusicPlayer/Assets.xcassets/Player/Lamp light'logo.imageset/Group_1171275592_2@2x.png new file mode 100644 index 0000000..ebb69d6 Binary files /dev/null and b/MusicPlayer/Assets.xcassets/Player/Lamp light'logo.imageset/Group_1171275592_2@2x.png differ diff --git a/MusicPlayer/Assets.xcassets/Player/Lamp light'logo.imageset/Group_1171275592_2@3x.png b/MusicPlayer/Assets.xcassets/Player/Lamp light'logo.imageset/Group_1171275592_2@3x.png new file mode 100644 index 0000000..8af954a Binary files /dev/null and b/MusicPlayer/Assets.xcassets/Player/Lamp light'logo.imageset/Group_1171275592_2@3x.png differ diff --git a/MusicPlayer/Assets.xcassets/Player/Player State'Play.imageset/Contents.json b/MusicPlayer/Assets.xcassets/Player/Player State'Play.imageset/Contents.json new file mode 100644 index 0000000..569cad8 --- /dev/null +++ b/MusicPlayer/Assets.xcassets/Player/Player State'Play.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "Group_1171275566@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "Group_1171275566@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/MusicPlayer/Assets.xcassets/Player/Player State'Play.imageset/Group_1171275566@2x.png b/MusicPlayer/Assets.xcassets/Player/Player State'Play.imageset/Group_1171275566@2x.png new file mode 100644 index 0000000..349da62 Binary files /dev/null and b/MusicPlayer/Assets.xcassets/Player/Player State'Play.imageset/Group_1171275566@2x.png differ diff --git a/MusicPlayer/Assets.xcassets/Player/Player State'Play.imageset/Group_1171275566@3x.png b/MusicPlayer/Assets.xcassets/Player/Player State'Play.imageset/Group_1171275566@3x.png new file mode 100644 index 0000000..16c830d Binary files /dev/null and b/MusicPlayer/Assets.xcassets/Player/Player State'Play.imageset/Group_1171275566@3x.png differ diff --git a/MusicPlayer/Assets.xcassets/Player/Player State'pause.imageset/Contents.json b/MusicPlayer/Assets.xcassets/Player/Player State'pause.imageset/Contents.json new file mode 100644 index 0000000..2f9086d --- /dev/null +++ b/MusicPlayer/Assets.xcassets/Player/Player State'pause.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "Group_1171275600@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "Group_1171275600@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/MusicPlayer/Assets.xcassets/Player/Player State'pause.imageset/Group_1171275600@2x.png b/MusicPlayer/Assets.xcassets/Player/Player State'pause.imageset/Group_1171275600@2x.png new file mode 100644 index 0000000..55bccdf Binary files /dev/null and b/MusicPlayer/Assets.xcassets/Player/Player State'pause.imageset/Group_1171275600@2x.png differ diff --git a/MusicPlayer/Assets.xcassets/Player/Player State'pause.imageset/Group_1171275600@3x.png b/MusicPlayer/Assets.xcassets/Player/Player State'pause.imageset/Group_1171275600@3x.png new file mode 100644 index 0000000..8d38818 Binary files /dev/null and b/MusicPlayer/Assets.xcassets/Player/Player State'pause.imageset/Group_1171275600@3x.png differ diff --git a/MusicPlayer/Assets.xcassets/Player/Player'bg.imageset/Contents.json b/MusicPlayer/Assets.xcassets/Player/Player'bg.imageset/Contents.json new file mode 100644 index 0000000..d3b9116 --- /dev/null +++ b/MusicPlayer/Assets.xcassets/Player/Player'bg.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "image_294@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "image_294@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/MusicPlayer/Assets.xcassets/Player/Player'bg.imageset/image_294@2x.png b/MusicPlayer/Assets.xcassets/Player/Player'bg.imageset/image_294@2x.png new file mode 100644 index 0000000..f0263e5 Binary files /dev/null and b/MusicPlayer/Assets.xcassets/Player/Player'bg.imageset/image_294@2x.png differ diff --git a/MusicPlayer/Assets.xcassets/Player/Player'bg.imageset/image_294@3x.png b/MusicPlayer/Assets.xcassets/Player/Player'bg.imageset/image_294@3x.png new file mode 100644 index 0000000..c3fa556 Binary files /dev/null and b/MusicPlayer/Assets.xcassets/Player/Player'bg.imageset/image_294@3x.png differ diff --git a/MusicPlayer/Assets.xcassets/Player/Player'mask.imageset/Contents.json b/MusicPlayer/Assets.xcassets/Player/Player'mask.imageset/Contents.json new file mode 100644 index 0000000..f88f5bc --- /dev/null +++ b/MusicPlayer/Assets.xcassets/Player/Player'mask.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "Rectangle_40118@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "Rectangle_40118@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/MusicPlayer/Assets.xcassets/Player/Player'mask.imageset/Rectangle_40118@2x.png b/MusicPlayer/Assets.xcassets/Player/Player'mask.imageset/Rectangle_40118@2x.png new file mode 100644 index 0000000..cc111bc Binary files /dev/null and b/MusicPlayer/Assets.xcassets/Player/Player'mask.imageset/Rectangle_40118@2x.png differ diff --git a/MusicPlayer/Assets.xcassets/Player/Player'mask.imageset/Rectangle_40118@3x.png b/MusicPlayer/Assets.xcassets/Player/Player'mask.imageset/Rectangle_40118@3x.png new file mode 100644 index 0000000..f664ed8 Binary files /dev/null and b/MusicPlayer/Assets.xcassets/Player/Player'mask.imageset/Rectangle_40118@3x.png differ diff --git a/MusicPlayer/Assets.xcassets/Player/Pointer'logo.imageset/Contents.json b/MusicPlayer/Assets.xcassets/Player/Pointer'logo.imageset/Contents.json new file mode 100644 index 0000000..0aa8122 --- /dev/null +++ b/MusicPlayer/Assets.xcassets/Player/Pointer'logo.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "image_293@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "image_293@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/MusicPlayer/Assets.xcassets/Player/Pointer'logo.imageset/image_293@2x.png b/MusicPlayer/Assets.xcassets/Player/Pointer'logo.imageset/image_293@2x.png new file mode 100644 index 0000000..6eff9e9 Binary files /dev/null and b/MusicPlayer/Assets.xcassets/Player/Pointer'logo.imageset/image_293@2x.png differ diff --git a/MusicPlayer/Assets.xcassets/Player/Pointer'logo.imageset/image_293@3x.png b/MusicPlayer/Assets.xcassets/Player/Pointer'logo.imageset/image_293@3x.png new file mode 100644 index 0000000..f58b947 Binary files /dev/null and b/MusicPlayer/Assets.xcassets/Player/Pointer'logo.imageset/image_293@3x.png differ diff --git a/MusicPlayer/Assets.xcassets/Player/Thumb dark'logo.imageset/Contents.json b/MusicPlayer/Assets.xcassets/Player/Thumb dark'logo.imageset/Contents.json new file mode 100644 index 0000000..17198bb --- /dev/null +++ b/MusicPlayer/Assets.xcassets/Player/Thumb dark'logo.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "Ellipse_1176@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "Ellipse_1176@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/MusicPlayer/Assets.xcassets/Player/Thumb dark'logo.imageset/Ellipse_1176@2x.png b/MusicPlayer/Assets.xcassets/Player/Thumb dark'logo.imageset/Ellipse_1176@2x.png new file mode 100644 index 0000000..45a98ff Binary files /dev/null and b/MusicPlayer/Assets.xcassets/Player/Thumb dark'logo.imageset/Ellipse_1176@2x.png differ diff --git a/MusicPlayer/Assets.xcassets/Player/Thumb dark'logo.imageset/Ellipse_1176@3x.png b/MusicPlayer/Assets.xcassets/Player/Thumb dark'logo.imageset/Ellipse_1176@3x.png new file mode 100644 index 0000000..37c1aaa Binary files /dev/null and b/MusicPlayer/Assets.xcassets/Player/Thumb dark'logo.imageset/Ellipse_1176@3x.png differ diff --git a/MusicPlayer/Assets.xcassets/Player/Thumb light'logo.imageset/Contents.json b/MusicPlayer/Assets.xcassets/Player/Thumb light'logo.imageset/Contents.json new file mode 100644 index 0000000..17198bb --- /dev/null +++ b/MusicPlayer/Assets.xcassets/Player/Thumb light'logo.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "Ellipse_1176@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "Ellipse_1176@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/MusicPlayer/Assets.xcassets/Player/Thumb light'logo.imageset/Ellipse_1176@2x.png b/MusicPlayer/Assets.xcassets/Player/Thumb light'logo.imageset/Ellipse_1176@2x.png new file mode 100644 index 0000000..b8f5844 Binary files /dev/null and b/MusicPlayer/Assets.xcassets/Player/Thumb light'logo.imageset/Ellipse_1176@2x.png differ diff --git a/MusicPlayer/Assets.xcassets/Player/Thumb light'logo.imageset/Ellipse_1176@3x.png b/MusicPlayer/Assets.xcassets/Player/Thumb light'logo.imageset/Ellipse_1176@3x.png new file mode 100644 index 0000000..b301222 Binary files /dev/null and b/MusicPlayer/Assets.xcassets/Player/Thumb light'logo.imageset/Ellipse_1176@3x.png differ diff --git a/MusicPlayer/Assets.xcassets/Player/Timer dark'logo.imageset/Contents.json b/MusicPlayer/Assets.xcassets/Player/Timer dark'logo.imageset/Contents.json new file mode 100644 index 0000000..8af6046 --- /dev/null +++ b/MusicPlayer/Assets.xcassets/Player/Timer dark'logo.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "Group_1171275590@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "Group_1171275590@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/MusicPlayer/Assets.xcassets/Player/Timer dark'logo.imageset/Group_1171275590@2x.png b/MusicPlayer/Assets.xcassets/Player/Timer dark'logo.imageset/Group_1171275590@2x.png new file mode 100644 index 0000000..91fe40b Binary files /dev/null and b/MusicPlayer/Assets.xcassets/Player/Timer dark'logo.imageset/Group_1171275590@2x.png differ diff --git a/MusicPlayer/Assets.xcassets/Player/Timer dark'logo.imageset/Group_1171275590@3x.png b/MusicPlayer/Assets.xcassets/Player/Timer dark'logo.imageset/Group_1171275590@3x.png new file mode 100644 index 0000000..1c4d558 Binary files /dev/null and b/MusicPlayer/Assets.xcassets/Player/Timer dark'logo.imageset/Group_1171275590@3x.png differ diff --git a/MusicPlayer/Assets.xcassets/Player/Timer light'logo.imageset/Contents.json b/MusicPlayer/Assets.xcassets/Player/Timer light'logo.imageset/Contents.json new file mode 100644 index 0000000..68dd719 --- /dev/null +++ b/MusicPlayer/Assets.xcassets/Player/Timer light'logo.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "Group_1171275591_3@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "Group_1171275591_3@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/MusicPlayer/Assets.xcassets/Player/Timer light'logo.imageset/Group_1171275591_3@2x.png b/MusicPlayer/Assets.xcassets/Player/Timer light'logo.imageset/Group_1171275591_3@2x.png new file mode 100644 index 0000000..6573b38 Binary files /dev/null and b/MusicPlayer/Assets.xcassets/Player/Timer light'logo.imageset/Group_1171275591_3@2x.png differ diff --git a/MusicPlayer/Assets.xcassets/Player/Timer light'logo.imageset/Group_1171275591_3@3x.png b/MusicPlayer/Assets.xcassets/Player/Timer light'logo.imageset/Group_1171275591_3@3x.png new file mode 100644 index 0000000..1869f31 Binary files /dev/null and b/MusicPlayer/Assets.xcassets/Player/Timer light'logo.imageset/Group_1171275591_3@3x.png differ diff --git a/MusicPlayer/Assets.xcassets/Player/Timer playing'logo.imageset/Contents.json b/MusicPlayer/Assets.xcassets/Player/Timer playing'logo.imageset/Contents.json new file mode 100644 index 0000000..ad389ff --- /dev/null +++ b/MusicPlayer/Assets.xcassets/Player/Timer playing'logo.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "Group_1171275599@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "Group_1171275599@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/MusicPlayer/Assets.xcassets/Player/Timer playing'logo.imageset/Group_1171275599@2x.png b/MusicPlayer/Assets.xcassets/Player/Timer playing'logo.imageset/Group_1171275599@2x.png new file mode 100644 index 0000000..8535fdd Binary files /dev/null and b/MusicPlayer/Assets.xcassets/Player/Timer playing'logo.imageset/Group_1171275599@2x.png differ diff --git a/MusicPlayer/Assets.xcassets/Player/Timer playing'logo.imageset/Group_1171275599@3x.png b/MusicPlayer/Assets.xcassets/Player/Timer playing'logo.imageset/Group_1171275599@3x.png new file mode 100644 index 0000000..3632081 Binary files /dev/null and b/MusicPlayer/Assets.xcassets/Player/Timer playing'logo.imageset/Group_1171275599@3x.png differ diff --git a/MusicPlayer/Assets.xcassets/Player/Timer'bg.imageset/Contents.json b/MusicPlayer/Assets.xcassets/Player/Timer'bg.imageset/Contents.json new file mode 100644 index 0000000..79d4d9d --- /dev/null +++ b/MusicPlayer/Assets.xcassets/Player/Timer'bg.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "Group_1171275576@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "Group_1171275576@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/MusicPlayer/Assets.xcassets/Player/Timer'bg.imageset/Group_1171275576@2x.png b/MusicPlayer/Assets.xcassets/Player/Timer'bg.imageset/Group_1171275576@2x.png new file mode 100644 index 0000000..c7a2a10 Binary files /dev/null and b/MusicPlayer/Assets.xcassets/Player/Timer'bg.imageset/Group_1171275576@2x.png differ diff --git a/MusicPlayer/Assets.xcassets/Player/Timer'bg.imageset/Group_1171275576@3x.png b/MusicPlayer/Assets.xcassets/Player/Timer'bg.imageset/Group_1171275576@3x.png new file mode 100644 index 0000000..e9bb05b Binary files /dev/null and b/MusicPlayer/Assets.xcassets/Player/Timer'bg.imageset/Group_1171275576@3x.png differ diff --git a/MusicPlayer/Assets.xcassets/Source/Beach.imageset/Beach 1.png b/MusicPlayer/Assets.xcassets/Source/Beach.imageset/Beach 1.png new file mode 100644 index 0000000..dd010c3 Binary files /dev/null and b/MusicPlayer/Assets.xcassets/Source/Beach.imageset/Beach 1.png differ diff --git a/MusicPlayer/Assets.xcassets/Source/Beach.imageset/Beach.png b/MusicPlayer/Assets.xcassets/Source/Beach.imageset/Beach.png new file mode 100644 index 0000000..dd010c3 Binary files /dev/null and b/MusicPlayer/Assets.xcassets/Source/Beach.imageset/Beach.png differ diff --git a/MusicPlayer/Assets.xcassets/Source/Beach.imageset/Contents.json b/MusicPlayer/Assets.xcassets/Source/Beach.imageset/Contents.json new file mode 100644 index 0000000..dfd0ed3 --- /dev/null +++ b/MusicPlayer/Assets.xcassets/Source/Beach.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "Beach.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "Beach 1.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/MusicPlayer/Assets.xcassets/Source/Breathe.imageset/Breathe 1.png b/MusicPlayer/Assets.xcassets/Source/Breathe.imageset/Breathe 1.png new file mode 100644 index 0000000..5fe6b72 Binary files /dev/null and b/MusicPlayer/Assets.xcassets/Source/Breathe.imageset/Breathe 1.png differ diff --git a/MusicPlayer/Assets.xcassets/Source/Breathe.imageset/Breathe.png b/MusicPlayer/Assets.xcassets/Source/Breathe.imageset/Breathe.png new file mode 100644 index 0000000..5fe6b72 Binary files /dev/null and b/MusicPlayer/Assets.xcassets/Source/Breathe.imageset/Breathe.png differ diff --git a/MusicPlayer/Assets.xcassets/Source/Breathe.imageset/Contents.json b/MusicPlayer/Assets.xcassets/Source/Breathe.imageset/Contents.json new file mode 100644 index 0000000..89d3046 --- /dev/null +++ b/MusicPlayer/Assets.xcassets/Source/Breathe.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "Breathe.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "Breathe 1.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/MusicPlayer/Assets.xcassets/Source/Call of Seagulls.imageset/Call of Seagulls 1.png b/MusicPlayer/Assets.xcassets/Source/Call of Seagulls.imageset/Call of Seagulls 1.png new file mode 100644 index 0000000..0df8682 Binary files /dev/null and b/MusicPlayer/Assets.xcassets/Source/Call of Seagulls.imageset/Call of Seagulls 1.png differ diff --git a/MusicPlayer/Assets.xcassets/Source/Call of Seagulls.imageset/Call of Seagulls.png b/MusicPlayer/Assets.xcassets/Source/Call of Seagulls.imageset/Call of Seagulls.png new file mode 100644 index 0000000..0df8682 Binary files /dev/null and b/MusicPlayer/Assets.xcassets/Source/Call of Seagulls.imageset/Call of Seagulls.png differ diff --git a/MusicPlayer/Assets.xcassets/Source/Call of Seagulls.imageset/Contents.json b/MusicPlayer/Assets.xcassets/Source/Call of Seagulls.imageset/Contents.json new file mode 100644 index 0000000..6fee98f --- /dev/null +++ b/MusicPlayer/Assets.xcassets/Source/Call of Seagulls.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "Call of Seagulls.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "Call of Seagulls 1.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/MusicPlayer/Assets.xcassets/Source/Chirping of Birds.imageset/Chirping of Birds 1.png b/MusicPlayer/Assets.xcassets/Source/Chirping of Birds.imageset/Chirping of Birds 1.png new file mode 100644 index 0000000..c76f631 Binary files /dev/null and b/MusicPlayer/Assets.xcassets/Source/Chirping of Birds.imageset/Chirping of Birds 1.png differ diff --git a/MusicPlayer/Assets.xcassets/Source/Chirping of Birds.imageset/Chirping of Birds.png b/MusicPlayer/Assets.xcassets/Source/Chirping of Birds.imageset/Chirping of Birds.png new file mode 100644 index 0000000..c76f631 Binary files /dev/null and b/MusicPlayer/Assets.xcassets/Source/Chirping of Birds.imageset/Chirping of Birds.png differ diff --git a/MusicPlayer/Assets.xcassets/Source/Chirping of Birds.imageset/Contents.json b/MusicPlayer/Assets.xcassets/Source/Chirping of Birds.imageset/Contents.json new file mode 100644 index 0000000..1718270 --- /dev/null +++ b/MusicPlayer/Assets.xcassets/Source/Chirping of Birds.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "Chirping of Birds.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "Chirping of Birds 1.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/MusicPlayer/Assets.xcassets/Source/Cicada Chirping.imageset/Cicada Chirping 1.png b/MusicPlayer/Assets.xcassets/Source/Cicada Chirping.imageset/Cicada Chirping 1.png new file mode 100644 index 0000000..e51164f Binary files /dev/null and b/MusicPlayer/Assets.xcassets/Source/Cicada Chirping.imageset/Cicada Chirping 1.png differ diff --git a/MusicPlayer/Assets.xcassets/Source/Cicada Chirping.imageset/Cicada Chirping.png b/MusicPlayer/Assets.xcassets/Source/Cicada Chirping.imageset/Cicada Chirping.png new file mode 100644 index 0000000..e51164f Binary files /dev/null and b/MusicPlayer/Assets.xcassets/Source/Cicada Chirping.imageset/Cicada Chirping.png differ diff --git a/MusicPlayer/Assets.xcassets/Source/Cicada Chirping.imageset/Contents.json b/MusicPlayer/Assets.xcassets/Source/Cicada Chirping.imageset/Contents.json new file mode 100644 index 0000000..d650f09 --- /dev/null +++ b/MusicPlayer/Assets.xcassets/Source/Cicada Chirping.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "Cicada Chirping.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "Cicada Chirping 1.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/MusicPlayer/Assets.xcassets/Source/Contents.json b/MusicPlayer/Assets.xcassets/Source/Contents.json new file mode 100644 index 0000000..73c0059 --- /dev/null +++ b/MusicPlayer/Assets.xcassets/Source/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/MusicPlayer/Assets.xcassets/Source/End Of Days.imageset/Contents.json b/MusicPlayer/Assets.xcassets/Source/End Of Days.imageset/Contents.json new file mode 100644 index 0000000..367e7b2 --- /dev/null +++ b/MusicPlayer/Assets.xcassets/Source/End Of Days.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "组 14 拷贝@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "组 14 拷贝@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/MusicPlayer/Assets.xcassets/Source/End Of Days.imageset/组 14 拷贝@2x.png b/MusicPlayer/Assets.xcassets/Source/End Of Days.imageset/组 14 拷贝@2x.png new file mode 100644 index 0000000..42c01c7 Binary files /dev/null and b/MusicPlayer/Assets.xcassets/Source/End Of Days.imageset/组 14 拷贝@2x.png differ diff --git a/MusicPlayer/Assets.xcassets/Source/End Of Days.imageset/组 14 拷贝@3x.png b/MusicPlayer/Assets.xcassets/Source/End Of Days.imageset/组 14 拷贝@3x.png new file mode 100644 index 0000000..fa8dfcd Binary files /dev/null and b/MusicPlayer/Assets.xcassets/Source/End Of Days.imageset/组 14 拷贝@3x.png differ diff --git a/MusicPlayer/Assets.xcassets/Source/Fireplace.imageset/Contents.json b/MusicPlayer/Assets.xcassets/Source/Fireplace.imageset/Contents.json new file mode 100644 index 0000000..2546bdd --- /dev/null +++ b/MusicPlayer/Assets.xcassets/Source/Fireplace.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "Fireplace.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "Fireplace 1.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/MusicPlayer/Assets.xcassets/Source/Fireplace.imageset/Fireplace 1.png b/MusicPlayer/Assets.xcassets/Source/Fireplace.imageset/Fireplace 1.png new file mode 100644 index 0000000..a4bf56c Binary files /dev/null and b/MusicPlayer/Assets.xcassets/Source/Fireplace.imageset/Fireplace 1.png differ diff --git a/MusicPlayer/Assets.xcassets/Source/Fireplace.imageset/Fireplace.png b/MusicPlayer/Assets.xcassets/Source/Fireplace.imageset/Fireplace.png new file mode 100644 index 0000000..a4bf56c Binary files /dev/null and b/MusicPlayer/Assets.xcassets/Source/Fireplace.imageset/Fireplace.png differ diff --git a/MusicPlayer/Assets.xcassets/Source/Howling Wind.imageset/Contents.json b/MusicPlayer/Assets.xcassets/Source/Howling Wind.imageset/Contents.json new file mode 100644 index 0000000..326bdef --- /dev/null +++ b/MusicPlayer/Assets.xcassets/Source/Howling Wind.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "Howling Wind.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "Howling Wind 1.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/MusicPlayer/Assets.xcassets/Source/Howling Wind.imageset/Howling Wind 1.png b/MusicPlayer/Assets.xcassets/Source/Howling Wind.imageset/Howling Wind 1.png new file mode 100644 index 0000000..cc94f0f Binary files /dev/null and b/MusicPlayer/Assets.xcassets/Source/Howling Wind.imageset/Howling Wind 1.png differ diff --git a/MusicPlayer/Assets.xcassets/Source/Howling Wind.imageset/Howling Wind.png b/MusicPlayer/Assets.xcassets/Source/Howling Wind.imageset/Howling Wind.png new file mode 100644 index 0000000..cc94f0f Binary files /dev/null and b/MusicPlayer/Assets.xcassets/Source/Howling Wind.imageset/Howling Wind.png differ diff --git a/MusicPlayer/Assets.xcassets/Source/Mountain stream.imageset/Contents.json b/MusicPlayer/Assets.xcassets/Source/Mountain stream.imageset/Contents.json new file mode 100644 index 0000000..110fd58 --- /dev/null +++ b/MusicPlayer/Assets.xcassets/Source/Mountain stream.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "Mountain stream.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "Mountain stream 1.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/MusicPlayer/Assets.xcassets/Source/Mountain stream.imageset/Mountain stream 1.png b/MusicPlayer/Assets.xcassets/Source/Mountain stream.imageset/Mountain stream 1.png new file mode 100644 index 0000000..1779274 Binary files /dev/null and b/MusicPlayer/Assets.xcassets/Source/Mountain stream.imageset/Mountain stream 1.png differ diff --git a/MusicPlayer/Assets.xcassets/Source/Mountain stream.imageset/Mountain stream.png b/MusicPlayer/Assets.xcassets/Source/Mountain stream.imageset/Mountain stream.png new file mode 100644 index 0000000..1779274 Binary files /dev/null and b/MusicPlayer/Assets.xcassets/Source/Mountain stream.imageset/Mountain stream.png differ diff --git a/MusicPlayer/Assets.xcassets/Source/Nocturnal Insects.imageset/Contents.json b/MusicPlayer/Assets.xcassets/Source/Nocturnal Insects.imageset/Contents.json new file mode 100644 index 0000000..3b438e6 --- /dev/null +++ b/MusicPlayer/Assets.xcassets/Source/Nocturnal Insects.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "Nocturnal Insects.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "Nocturnal Insects 1.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/MusicPlayer/Assets.xcassets/Source/Nocturnal Insects.imageset/Nocturnal Insects 1.png b/MusicPlayer/Assets.xcassets/Source/Nocturnal Insects.imageset/Nocturnal Insects 1.png new file mode 100644 index 0000000..061d682 Binary files /dev/null and b/MusicPlayer/Assets.xcassets/Source/Nocturnal Insects.imageset/Nocturnal Insects 1.png differ diff --git a/MusicPlayer/Assets.xcassets/Source/Nocturnal Insects.imageset/Nocturnal Insects.png b/MusicPlayer/Assets.xcassets/Source/Nocturnal Insects.imageset/Nocturnal Insects.png new file mode 100644 index 0000000..061d682 Binary files /dev/null and b/MusicPlayer/Assets.xcassets/Source/Nocturnal Insects.imageset/Nocturnal Insects.png differ diff --git a/MusicPlayer/Assets.xcassets/Source/Seawater Surging.imageset/Contents.json b/MusicPlayer/Assets.xcassets/Source/Seawater Surging.imageset/Contents.json new file mode 100644 index 0000000..0141474 --- /dev/null +++ b/MusicPlayer/Assets.xcassets/Source/Seawater Surging.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "Seawater Surging.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "Seawater Surging 1.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/MusicPlayer/Assets.xcassets/Source/Seawater Surging.imageset/Seawater Surging 1.png b/MusicPlayer/Assets.xcassets/Source/Seawater Surging.imageset/Seawater Surging 1.png new file mode 100644 index 0000000..9979362 Binary files /dev/null and b/MusicPlayer/Assets.xcassets/Source/Seawater Surging.imageset/Seawater Surging 1.png differ diff --git a/MusicPlayer/Assets.xcassets/Source/Seawater Surging.imageset/Seawater Surging.png b/MusicPlayer/Assets.xcassets/Source/Seawater Surging.imageset/Seawater Surging.png new file mode 100644 index 0000000..9979362 Binary files /dev/null and b/MusicPlayer/Assets.xcassets/Source/Seawater Surging.imageset/Seawater Surging.png differ diff --git a/MusicPlayer/Assets.xcassets/Source/Shh Shh.imageset/Contents.json b/MusicPlayer/Assets.xcassets/Source/Shh Shh.imageset/Contents.json new file mode 100644 index 0000000..0b88947 --- /dev/null +++ b/MusicPlayer/Assets.xcassets/Source/Shh Shh.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "Shh Shh 1.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "Shh Shh.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/MusicPlayer/Assets.xcassets/Source/Shh Shh.imageset/Shh Shh 1.png b/MusicPlayer/Assets.xcassets/Source/Shh Shh.imageset/Shh Shh 1.png new file mode 100644 index 0000000..bfc8bb4 Binary files /dev/null and b/MusicPlayer/Assets.xcassets/Source/Shh Shh.imageset/Shh Shh 1.png differ diff --git a/MusicPlayer/Assets.xcassets/Source/Shh Shh.imageset/Shh Shh.png b/MusicPlayer/Assets.xcassets/Source/Shh Shh.imageset/Shh Shh.png new file mode 100644 index 0000000..bfc8bb4 Binary files /dev/null and b/MusicPlayer/Assets.xcassets/Source/Shh Shh.imageset/Shh Shh.png differ diff --git a/MusicPlayer/Assets.xcassets/Source/Shhh….imageset/Contents.json b/MusicPlayer/Assets.xcassets/Source/Shhh….imageset/Contents.json new file mode 100644 index 0000000..12ff753 --- /dev/null +++ b/MusicPlayer/Assets.xcassets/Source/Shhh….imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "Shhh….png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "Shhh… 1.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/MusicPlayer/Assets.xcassets/Source/Shhh….imageset/Shhh… 1.png b/MusicPlayer/Assets.xcassets/Source/Shhh….imageset/Shhh… 1.png new file mode 100644 index 0000000..ac41ed4 Binary files /dev/null and b/MusicPlayer/Assets.xcassets/Source/Shhh….imageset/Shhh… 1.png differ diff --git a/MusicPlayer/Assets.xcassets/Source/Shhh….imageset/Shhh….png b/MusicPlayer/Assets.xcassets/Source/Shhh….imageset/Shhh….png new file mode 100644 index 0000000..ac41ed4 Binary files /dev/null and b/MusicPlayer/Assets.xcassets/Source/Shhh….imageset/Shhh….png differ diff --git a/MusicPlayer/Assets.xcassets/Source/Summer Insects.imageset/Contents.json b/MusicPlayer/Assets.xcassets/Source/Summer Insects.imageset/Contents.json new file mode 100644 index 0000000..9516109 --- /dev/null +++ b/MusicPlayer/Assets.xcassets/Source/Summer Insects.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "Summer Insects.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "Summer Insects 1.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/MusicPlayer/Assets.xcassets/Source/Summer Insects.imageset/Summer Insects 1.png b/MusicPlayer/Assets.xcassets/Source/Summer Insects.imageset/Summer Insects 1.png new file mode 100644 index 0000000..8d6235f Binary files /dev/null and b/MusicPlayer/Assets.xcassets/Source/Summer Insects.imageset/Summer Insects 1.png differ diff --git a/MusicPlayer/Assets.xcassets/Source/Summer Insects.imageset/Summer Insects.png b/MusicPlayer/Assets.xcassets/Source/Summer Insects.imageset/Summer Insects.png new file mode 100644 index 0000000..8d6235f Binary files /dev/null and b/MusicPlayer/Assets.xcassets/Source/Summer Insects.imageset/Summer Insects.png differ diff --git a/MusicPlayer/Assets.xcassets/Source/TV.imageset/Contents.json b/MusicPlayer/Assets.xcassets/Source/TV.imageset/Contents.json new file mode 100644 index 0000000..8e86021 --- /dev/null +++ b/MusicPlayer/Assets.xcassets/Source/TV.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "TV.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "TV 1.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/MusicPlayer/Assets.xcassets/Source/TV.imageset/TV 1.png b/MusicPlayer/Assets.xcassets/Source/TV.imageset/TV 1.png new file mode 100644 index 0000000..8a4f123 Binary files /dev/null and b/MusicPlayer/Assets.xcassets/Source/TV.imageset/TV 1.png differ diff --git a/MusicPlayer/Assets.xcassets/Source/TV.imageset/TV.png b/MusicPlayer/Assets.xcassets/Source/TV.imageset/TV.png new file mode 100644 index 0000000..8a4f123 Binary files /dev/null and b/MusicPlayer/Assets.xcassets/Source/TV.imageset/TV.png differ diff --git a/MusicPlayer/Assets.xcassets/Source/Water droplet.imageset/Contents.json b/MusicPlayer/Assets.xcassets/Source/Water droplet.imageset/Contents.json new file mode 100644 index 0000000..0b94aff --- /dev/null +++ b/MusicPlayer/Assets.xcassets/Source/Water droplet.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "Water droplet.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "Water droplet 1.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/MusicPlayer/Assets.xcassets/Source/Water droplet.imageset/Water droplet 1.png b/MusicPlayer/Assets.xcassets/Source/Water droplet.imageset/Water droplet 1.png new file mode 100644 index 0000000..b101213 Binary files /dev/null and b/MusicPlayer/Assets.xcassets/Source/Water droplet.imageset/Water droplet 1.png differ diff --git a/MusicPlayer/Assets.xcassets/Source/Water droplet.imageset/Water droplet.png b/MusicPlayer/Assets.xcassets/Source/Water droplet.imageset/Water droplet.png new file mode 100644 index 0000000..b101213 Binary files /dev/null and b/MusicPlayer/Assets.xcassets/Source/Water droplet.imageset/Water droplet.png differ diff --git a/MusicPlayer/Assets.xcassets/Source/waterfall.imageset/Contents.json b/MusicPlayer/Assets.xcassets/Source/waterfall.imageset/Contents.json new file mode 100644 index 0000000..c8d28a2 --- /dev/null +++ b/MusicPlayer/Assets.xcassets/Source/waterfall.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "waterfall.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "waterfall 1.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/MusicPlayer/Assets.xcassets/Source/waterfall.imageset/waterfall 1.png b/MusicPlayer/Assets.xcassets/Source/waterfall.imageset/waterfall 1.png new file mode 100644 index 0000000..ad776a1 Binary files /dev/null and b/MusicPlayer/Assets.xcassets/Source/waterfall.imageset/waterfall 1.png differ diff --git a/MusicPlayer/Assets.xcassets/Source/waterfall.imageset/waterfall.png b/MusicPlayer/Assets.xcassets/Source/waterfall.imageset/waterfall.png new file mode 100644 index 0000000..ad776a1 Binary files /dev/null and b/MusicPlayer/Assets.xcassets/Source/waterfall.imageset/waterfall.png differ diff --git a/MusicPlayer/Assets.xcassets/TabBar/Bottom'pause.imageset/Contents.json b/MusicPlayer/Assets.xcassets/TabBar/Bottom'pause.imageset/Contents.json new file mode 100644 index 0000000..5c4d3b1 --- /dev/null +++ b/MusicPlayer/Assets.xcassets/TabBar/Bottom'pause.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "Frame@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "Frame@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/MusicPlayer/Assets.xcassets/TabBar/Bottom'pause.imageset/Frame@2x.png b/MusicPlayer/Assets.xcassets/TabBar/Bottom'pause.imageset/Frame@2x.png new file mode 100644 index 0000000..6bec3de Binary files /dev/null and b/MusicPlayer/Assets.xcassets/TabBar/Bottom'pause.imageset/Frame@2x.png differ diff --git a/MusicPlayer/Assets.xcassets/TabBar/Bottom'pause.imageset/Frame@3x.png b/MusicPlayer/Assets.xcassets/TabBar/Bottom'pause.imageset/Frame@3x.png new file mode 100644 index 0000000..60156f7 Binary files /dev/null and b/MusicPlayer/Assets.xcassets/TabBar/Bottom'pause.imageset/Frame@3x.png differ diff --git a/MusicPlayer/Assets.xcassets/TabBar/Bottom'play.imageset/Contents.json b/MusicPlayer/Assets.xcassets/TabBar/Bottom'play.imageset/Contents.json new file mode 100644 index 0000000..98f6b5f --- /dev/null +++ b/MusicPlayer/Assets.xcassets/TabBar/Bottom'play.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "Group_1171275512@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "Group_1171275512@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/MusicPlayer/Assets.xcassets/TabBar/Bottom'play.imageset/Group_1171275512@2x.png b/MusicPlayer/Assets.xcassets/TabBar/Bottom'play.imageset/Group_1171275512@2x.png new file mode 100644 index 0000000..9f70573 Binary files /dev/null and b/MusicPlayer/Assets.xcassets/TabBar/Bottom'play.imageset/Group_1171275512@2x.png differ diff --git a/MusicPlayer/Assets.xcassets/TabBar/Bottom'play.imageset/Group_1171275512@3x.png b/MusicPlayer/Assets.xcassets/TabBar/Bottom'play.imageset/Group_1171275512@3x.png new file mode 100644 index 0000000..d7cfde5 Binary files /dev/null and b/MusicPlayer/Assets.xcassets/TabBar/Bottom'play.imageset/Group_1171275512@3x.png differ diff --git a/MusicPlayer/Assets.xcassets/TabBar/Bottom'timer.imageset/Contents.json b/MusicPlayer/Assets.xcassets/TabBar/Bottom'timer.imageset/Contents.json new file mode 100644 index 0000000..bdba09e --- /dev/null +++ b/MusicPlayer/Assets.xcassets/TabBar/Bottom'timer.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "Group_1171275505@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "Group_1171275505@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/MusicPlayer/Assets.xcassets/TabBar/Bottom'timer.imageset/Group_1171275505@2x.png b/MusicPlayer/Assets.xcassets/TabBar/Bottom'timer.imageset/Group_1171275505@2x.png new file mode 100644 index 0000000..7195d13 Binary files /dev/null and b/MusicPlayer/Assets.xcassets/TabBar/Bottom'timer.imageset/Group_1171275505@2x.png differ diff --git a/MusicPlayer/Assets.xcassets/TabBar/Bottom'timer.imageset/Group_1171275505@3x.png b/MusicPlayer/Assets.xcassets/TabBar/Bottom'timer.imageset/Group_1171275505@3x.png new file mode 100644 index 0000000..e7f6e1a Binary files /dev/null and b/MusicPlayer/Assets.xcassets/TabBar/Bottom'timer.imageset/Group_1171275505@3x.png differ diff --git a/MusicPlayer/Assets.xcassets/TabBar/BottomShow'bg.imageset/Contents.json b/MusicPlayer/Assets.xcassets/TabBar/BottomShow'bg.imageset/Contents.json new file mode 100644 index 0000000..2a190de --- /dev/null +++ b/MusicPlayer/Assets.xcassets/TabBar/BottomShow'bg.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "Rectangle_12@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "Rectangle_12@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/MusicPlayer/Assets.xcassets/TabBar/BottomShow'bg.imageset/Rectangle_12@2x.png b/MusicPlayer/Assets.xcassets/TabBar/BottomShow'bg.imageset/Rectangle_12@2x.png new file mode 100644 index 0000000..a66c42c Binary files /dev/null and b/MusicPlayer/Assets.xcassets/TabBar/BottomShow'bg.imageset/Rectangle_12@2x.png differ diff --git a/MusicPlayer/Assets.xcassets/TabBar/BottomShow'bg.imageset/Rectangle_12@3x.png b/MusicPlayer/Assets.xcassets/TabBar/BottomShow'bg.imageset/Rectangle_12@3x.png new file mode 100644 index 0000000..f9f300e Binary files /dev/null and b/MusicPlayer/Assets.xcassets/TabBar/BottomShow'bg.imageset/Rectangle_12@3x.png differ diff --git a/MusicPlayer/Assets.xcassets/TabBar/BottomShow'logo.imageset/Contents.json b/MusicPlayer/Assets.xcassets/TabBar/BottomShow'logo.imageset/Contents.json new file mode 100644 index 0000000..4d305b3 --- /dev/null +++ b/MusicPlayer/Assets.xcassets/TabBar/BottomShow'logo.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "Ellipse_2@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "Ellipse_2@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/MusicPlayer/Assets.xcassets/TabBar/BottomShow'logo.imageset/Ellipse_2@2x.png b/MusicPlayer/Assets.xcassets/TabBar/BottomShow'logo.imageset/Ellipse_2@2x.png new file mode 100644 index 0000000..f6b73d4 Binary files /dev/null and b/MusicPlayer/Assets.xcassets/TabBar/BottomShow'logo.imageset/Ellipse_2@2x.png differ diff --git a/MusicPlayer/Assets.xcassets/TabBar/BottomShow'logo.imageset/Ellipse_2@3x.png b/MusicPlayer/Assets.xcassets/TabBar/BottomShow'logo.imageset/Ellipse_2@3x.png new file mode 100644 index 0000000..05364fc Binary files /dev/null and b/MusicPlayer/Assets.xcassets/TabBar/BottomShow'logo.imageset/Ellipse_2@3x.png differ diff --git a/MusicPlayer/Assets.xcassets/TabBar/Center 1.imageset/Contents.json b/MusicPlayer/Assets.xcassets/TabBar/Center 1.imageset/Contents.json new file mode 100644 index 0000000..d9195ce --- /dev/null +++ b/MusicPlayer/Assets.xcassets/TabBar/Center 1.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "Group_1171275511@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "Group_1171275511@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/MusicPlayer/Assets.xcassets/TabBar/Center 1.imageset/Group_1171275511@2x.png b/MusicPlayer/Assets.xcassets/TabBar/Center 1.imageset/Group_1171275511@2x.png new file mode 100644 index 0000000..d12b716 Binary files /dev/null and b/MusicPlayer/Assets.xcassets/TabBar/Center 1.imageset/Group_1171275511@2x.png differ diff --git a/MusicPlayer/Assets.xcassets/TabBar/Center 1.imageset/Group_1171275511@3x.png b/MusicPlayer/Assets.xcassets/TabBar/Center 1.imageset/Group_1171275511@3x.png new file mode 100644 index 0000000..7ecc03a Binary files /dev/null and b/MusicPlayer/Assets.xcassets/TabBar/Center 1.imageset/Group_1171275511@3x.png differ diff --git a/MusicPlayer/Assets.xcassets/TabBar/Center.imageset/Contents.json b/MusicPlayer/Assets.xcassets/TabBar/Center.imageset/Contents.json new file mode 100644 index 0000000..d9195ce --- /dev/null +++ b/MusicPlayer/Assets.xcassets/TabBar/Center.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "Group_1171275511@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "Group_1171275511@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/MusicPlayer/Assets.xcassets/TabBar/Center.imageset/Group_1171275511@2x.png b/MusicPlayer/Assets.xcassets/TabBar/Center.imageset/Group_1171275511@2x.png new file mode 100644 index 0000000..b6b517a Binary files /dev/null and b/MusicPlayer/Assets.xcassets/TabBar/Center.imageset/Group_1171275511@2x.png differ diff --git a/MusicPlayer/Assets.xcassets/TabBar/Center.imageset/Group_1171275511@3x.png b/MusicPlayer/Assets.xcassets/TabBar/Center.imageset/Group_1171275511@3x.png new file mode 100644 index 0000000..cb40fd1 Binary files /dev/null and b/MusicPlayer/Assets.xcassets/TabBar/Center.imageset/Group_1171275511@3x.png differ diff --git a/MusicPlayer/Assets.xcassets/TabBar/Contents.json b/MusicPlayer/Assets.xcassets/TabBar/Contents.json new file mode 100644 index 0000000..73c0059 --- /dev/null +++ b/MusicPlayer/Assets.xcassets/TabBar/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/MusicPlayer/Assets.xcassets/TabBar/Home 1.imageset/Contents.json b/MusicPlayer/Assets.xcassets/TabBar/Home 1.imageset/Contents.json new file mode 100644 index 0000000..dda42ab --- /dev/null +++ b/MusicPlayer/Assets.xcassets/TabBar/Home 1.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "Group_1171275514@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "Group_1171275514@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/MusicPlayer/Assets.xcassets/TabBar/Home 1.imageset/Group_1171275514@2x.png b/MusicPlayer/Assets.xcassets/TabBar/Home 1.imageset/Group_1171275514@2x.png new file mode 100644 index 0000000..db621b3 Binary files /dev/null and b/MusicPlayer/Assets.xcassets/TabBar/Home 1.imageset/Group_1171275514@2x.png differ diff --git a/MusicPlayer/Assets.xcassets/TabBar/Home 1.imageset/Group_1171275514@3x.png b/MusicPlayer/Assets.xcassets/TabBar/Home 1.imageset/Group_1171275514@3x.png new file mode 100644 index 0000000..76f74a8 Binary files /dev/null and b/MusicPlayer/Assets.xcassets/TabBar/Home 1.imageset/Group_1171275514@3x.png differ diff --git a/MusicPlayer/Assets.xcassets/TabBar/Home.imageset/Contents.json b/MusicPlayer/Assets.xcassets/TabBar/Home.imageset/Contents.json new file mode 100644 index 0000000..2cdd1c3 --- /dev/null +++ b/MusicPlayer/Assets.xcassets/TabBar/Home.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "Group_1171275510@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "Group_1171275510@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/MusicPlayer/Assets.xcassets/TabBar/Home.imageset/Group_1171275510@2x.png b/MusicPlayer/Assets.xcassets/TabBar/Home.imageset/Group_1171275510@2x.png new file mode 100644 index 0000000..39ce5dd Binary files /dev/null and b/MusicPlayer/Assets.xcassets/TabBar/Home.imageset/Group_1171275510@2x.png differ diff --git a/MusicPlayer/Assets.xcassets/TabBar/Home.imageset/Group_1171275510@3x.png b/MusicPlayer/Assets.xcassets/TabBar/Home.imageset/Group_1171275510@3x.png new file mode 100644 index 0000000..88f7abf Binary files /dev/null and b/MusicPlayer/Assets.xcassets/TabBar/Home.imageset/Group_1171275510@3x.png differ diff --git a/MusicPlayer/Assets.xcassets/TabBar/TabBar'bg.imageset/Contents.json b/MusicPlayer/Assets.xcassets/TabBar/TabBar'bg.imageset/Contents.json new file mode 100644 index 0000000..33b1008 --- /dev/null +++ b/MusicPlayer/Assets.xcassets/TabBar/TabBar'bg.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "Rectangle_161123843@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "Rectangle_161123843@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/MusicPlayer/Assets.xcassets/TabBar/TabBar'bg.imageset/Rectangle_161123843@2x.png b/MusicPlayer/Assets.xcassets/TabBar/TabBar'bg.imageset/Rectangle_161123843@2x.png new file mode 100644 index 0000000..94e75ba Binary files /dev/null and b/MusicPlayer/Assets.xcassets/TabBar/TabBar'bg.imageset/Rectangle_161123843@2x.png differ diff --git a/MusicPlayer/Assets.xcassets/TabBar/TabBar'bg.imageset/Rectangle_161123843@3x.png b/MusicPlayer/Assets.xcassets/TabBar/TabBar'bg.imageset/Rectangle_161123843@3x.png new file mode 100644 index 0000000..5e9d984 Binary files /dev/null and b/MusicPlayer/Assets.xcassets/TabBar/TabBar'bg.imageset/Rectangle_161123843@3x.png differ diff --git a/MusicPlayer/Base.lproj/LaunchScreen.storyboard b/MusicPlayer/Base.lproj/LaunchScreen.storyboard index 865e932..42fb16d 100644 --- a/MusicPlayer/Base.lproj/LaunchScreen.storyboard +++ b/MusicPlayer/Base.lproj/LaunchScreen.storyboard @@ -1,8 +1,11 @@ - - + + + - + + + @@ -13,8 +16,19 @@ - + + + + + + + + + + + + @@ -22,4 +36,10 @@ + + + + + + diff --git a/MusicPlayer/Info.plist b/MusicPlayer/Info.plist index dd3c9af..87b37da 100644 --- a/MusicPlayer/Info.plist +++ b/MusicPlayer/Info.plist @@ -2,24 +2,17 @@ - UIApplicationSceneManifest - - UIApplicationSupportsMultipleScenes - - UISceneConfigurations - - UIWindowSceneSessionRoleApplication - - - UISceneConfigurationName - Default Configuration - UISceneDelegateClassName - $(PRODUCT_MODULE_NAME).SceneDelegate - UISceneStoryboardFile - Main - - - - + UIViewControllerBasedStatusBarAppearance + + UIStatusBarStyle + UIStatusBarStyleLightContent + NSMicrophoneUsageDescription + "Musicoo" requires you to turn on the microphone to recognize surrounding decibels and automatically turn on white noise for you. Do you allow this application to obtain your microphone permissions? + NSPhotoLibraryUsageDescription + "Musicoo" requires opening your album to obtain photos, which are used to add your custom white noise. Do you want to allow this application to obtain your album permissions? + UIBackgroundModes + + audio + diff --git a/MusicPlayer/MP/Common/Extension(扩展)/DateTime.swift b/MusicPlayer/MP/Common/Extension(扩展)/DateTime.swift new file mode 100644 index 0000000..9399560 --- /dev/null +++ b/MusicPlayer/MP/Common/Extension(扩展)/DateTime.swift @@ -0,0 +1,31 @@ +// +// DateTime.swift +// MusicPlayer +// +// Created by Mr.Zhou on 2024/3/27. +// + +import Foundation +@_exported import SwiftDate +//MARK: - Date扩展 +extension Date { + ///获取当前时区时间点 + func timeZone() -> Date{ + //设置源日期时区 + let sourceTimeZone = NSTimeZone(abbreviation: "UTC") + //或GMT + //设置转换后的目标日期时区 + let destinationTimeZone = NSTimeZone.local as NSTimeZone + //得到源日期与世界标准时间的偏移量 + let sourceGMTOffset = sourceTimeZone?.secondsFromGMT(for: self) + + //目标日期与本地时区的偏移量 + let destinationGMTOffset = destinationTimeZone.secondsFromGMT(for: self) + + //得到时间偏移量的差值 + let interval = TimeInterval((destinationGMTOffset ) - (sourceGMTOffset ?? 0)) + //转为现在时间 + let destinationDateNow = Date(timeInterval: interval, since: self) + return destinationDateNow + } +} diff --git a/MusicPlayer/MP/Common/Extension(扩展)/HexColor.swift b/MusicPlayer/MP/Common/Extension(扩展)/HexColor.swift new file mode 100644 index 0000000..8eef8a0 --- /dev/null +++ b/MusicPlayer/MP/Common/Extension(扩展)/HexColor.swift @@ -0,0 +1,75 @@ +// +// HexColor.swift +// MusicPlayer +// +// Created by Mr.Zhou on 2024/3/27. +// + +import Foundation +//MARK: - Color扩展 +extension UIColor { + /// String -> UIColor + convenience init(hex: String,alpha:CGFloat? = 1) { + let string = hex.trimmingCharacters(in: .whitespacesAndNewlines) + let scanner = Scanner(string: string) + + if string.hasPrefix("#") { + scanner.scanLocation = 1 + } + + var color: UInt32 = 0 + scanner.scanHexInt32(&color) + + let mask = 0x000000FF + let r = Int(color >> 16) & mask + let g = Int(color >> 8) & mask + let b = Int(color) & mask + + let red = CGFloat(r) / 255.0 + let green = CGFloat(g) / 255.0 + let blue = CGFloat(b) / 255.0 + + self.init(red: red, green: green, blue: blue, alpha: alpha!) + } + /// UIColor -> String + var hextoString: String? { + var red: CGFloat = 0 + var green: CGFloat = 0 + var blue: CGFloat = 0 + var alpha: CGFloat = 0 + + let multiplier = CGFloat(255.999999) + + guard self.getRed(&red, green: &green, blue: &blue, alpha: &alpha) else { + return nil + } + + if alpha == 1.0 { + return String( + format: "#%02lX%02lX%02lX", + Int(red * multiplier), + Int(green * multiplier), + Int(blue * multiplier) + ) + } + else { + return String( + format: "#%02lX%02lX%02lX%02lX", + Int(red * multiplier), + Int(green * multiplier), + Int(blue * multiplier), + Int(alpha * multiplier) + ) + } + } + //返回随机颜色 + class var randomColor:UIColor{ + get { + let red = CGFloat (arc4random()%256)/255.0 + let green = CGFloat (arc4random()%256)/255.0 + let blue = CGFloat (arc4random()%256)/255.0 + return UIColor (red: red, green: green, blue: blue, alpha: 1.0) + } + } +} + diff --git a/MusicPlayer/MP/Common/Extension(扩展)/ImagePicker.swift b/MusicPlayer/MP/Common/Extension(扩展)/ImagePicker.swift new file mode 100644 index 0000000..c81c968 --- /dev/null +++ b/MusicPlayer/MP/Common/Extension(扩展)/ImagePicker.swift @@ -0,0 +1,188 @@ +// +// ImagePicker.swift +// MusicPlayer +// +// Created by Mr.Zhou on 2024/4/2. +// + +import Foundation +import AVFoundation +import Photos +///扩展图片选择器 +extension UIImagePickerControllerDelegate where Self:UIViewController{ + ///从相册选择 + func getAlbum(){ + let ImagePicker = UIImagePickerController() + //设置代理 + ImagePicker.delegate = self as? UIImagePickerControllerDelegate & UINavigationControllerDelegate + //允许编辑 + ImagePicker.allowsEditing = true + //设置图片源(照片库) + ImagePicker.sourceType = .photoLibrary + self.Albumpermissions { + //允许 + //模态弹出IamgePickerView + DispatchQueue.main.async { + self.present(ImagePicker, animated: true, completion: nil) + } + } deniedBlock: { + self.album() + } + } + ///照相机 + func getCamera() { + guard UIImagePickerController.isSourceTypeAvailable(.camera) else { + //是模拟机 + print("Is a virtual machine") + return + } + //是真机 + let ImagePicker = UIImagePickerController() + //设置代理 + ImagePicker.delegate = self as? UIImagePickerControllerDelegate & UINavigationControllerDelegate + //允许编辑 + ImagePicker.allowsEditing = true + //设置图片源(照相) + ImagePicker.sourceType = .camera + self.Camerapermissions { + //模态弹出IamgePickerView + DispatchQueue.main.async { + self.present(ImagePicker, animated: true, completion: nil) + } + } deniedBlock: { + self.camera() + } + } + ///选择视频 + func getVideo(){ + let ImagePicker = UIImagePickerController() + //设置代理 + ImagePicker.delegate = self as? UIImagePickerControllerDelegate & UINavigationControllerDelegate + //禁止编辑 + ImagePicker.allowsEditing = false + //设置来源 + ImagePicker.sourceType = .photoLibrary + //设置显示视频文件 + ImagePicker.mediaTypes = ["public.movie"] + + self.Albumpermissions { + //允许 + //模态弹出IamgePickerView + DispatchQueue.main.async { + self.present(ImagePicker, animated: true, completion: nil) + } + } deniedBlock: { + self.video() + } + } + // 相机权限 + private func Camerapermissions(authorizedBlock: (() -> Void)?, deniedBlock: (() -> Void)?) { + let authStatus = AVCaptureDevice.authorizationStatus(for: AVMediaType.video) + + // .notDetermined .authorized .restricted .denied + if authStatus == .notDetermined { + // 第一次触发授权 alert + AVCaptureDevice.requestAccess(for: .video, completionHandler: { (granted: Bool) in + self.Camerapermissions(authorizedBlock: authorizedBlock, deniedBlock: deniedBlock) + }) + } else if authStatus == .authorized { + if authorizedBlock != nil { + authorizedBlock!() + } + } else { + if deniedBlock != nil { + deniedBlock!() + } + } + } + // 相册权限 + private func Albumpermissions(authorizedBlock: (() -> Void)?, deniedBlock: (() -> Void)?) { + let authStatus = PHPhotoLibrary.authorizationStatus() + + // .notDetermined .authorized .restricted .denied + if authStatus == .notDetermined { + // 第一次触发授权 alert + PHPhotoLibrary.requestAuthorization { (status:PHAuthorizationStatus) -> Void in + self.Albumpermissions(authorizedBlock: authorizedBlock, deniedBlock: deniedBlock) + } + } else if authStatus == .authorized { + if authorizedBlock != nil { + authorizedBlock!() + } + } else { + if deniedBlock != nil { + deniedBlock!() + } + } + } + private func album(){ + DispatchQueue.main.async { + //次要处理 + let alertController = UIAlertController(title: "Access album permission request", message: "“Musicoo”currently does not have permission to access the album and cannot obtain album data. If you want to use the photo album function, please click “Settings” to allow this App to obtain permission to access the photo album", preferredStyle: .alert) + let CancelAction = UIAlertAction(title:"Cancel", style: .cancel) { (Cancel) in + + } + let OKAction = UIAlertAction(title: "Settings", style: .default) { (action) in + let url = URL(string: UIApplication.openSettingsURLString) + if let url = url,UIApplication.shared.canOpenURL(url){ + if #available(iOS 10, *) { + UIApplication.shared.open(url, options: [:]) { (success) in + } + }else{ + UIApplication.shared.canOpenURL(url) + } + } + } + alertController.addAction(CancelAction) + alertController.addAction(OKAction) + self.present(alertController, animated: true, completion: nil) + } + } + private func camera(){ + DispatchQueue.main.async { + //次要处理 + let alertController = UIAlertController(title: "Access camera permission request", message: "“Musicoo”does not have access to the camera, and cannot call camera functions. If you want to use the camera function, please click “Settings” to allow this App to gain access to the camera", preferredStyle: .alert) + let CancelAction = UIAlertAction(title:"Cancel", style: .cancel) { (Cancel) in + + } + let OKAction = UIAlertAction(title: "Settings", style: .default) { (action) in + let url = URL(string: UIApplication.openSettingsURLString) + if let url = url,UIApplication.shared.canOpenURL(url){ + if #available(iOS 10, *) { + UIApplication.shared.open(url, options: [:]) { (success) in + } + }else{ + UIApplication.shared.canOpenURL(url) + } + } + } + alertController.addAction(CancelAction) + alertController.addAction(OKAction) + self.present(alertController, animated: true, completion: nil) + } + } + private func video(){ + DispatchQueue.main.async { + //次要处理 + let alertController = UIAlertController(title: "Access album permission request", message: "“Musicoo” needs to open your album to get the photos that will be used to add your custom white noise. Please go to ”Settings“ to turn on this permission!", preferredStyle: .alert) + let CancelAction = UIAlertAction(title:"Cancel", style: .cancel) { (Cancel) in + + } + let OKAction = UIAlertAction(title: "Settings", style: .default) { (action) in + let url = URL(string: UIApplication.openSettingsURLString) + if let url = url,UIApplication.shared.canOpenURL(url){ + if #available(iOS 10, *) { + UIApplication.shared.open(url, options: [:]) { (success) in + } + }else{ + UIApplication.shared.canOpenURL(url) + } + } + } + alertController.addAction(CancelAction) + alertController.addAction(OKAction) + self.present(alertController, animated: true, completion: nil) + } + } +} + diff --git a/MusicPlayer/MP/Common/Extension(扩展)/LayoutConstraint.swift b/MusicPlayer/MP/Common/Extension(扩展)/LayoutConstraint.swift new file mode 100644 index 0000000..22e5caf --- /dev/null +++ b/MusicPlayer/MP/Common/Extension(扩展)/LayoutConstraint.swift @@ -0,0 +1,85 @@ +// +// LayoutConstraint.swift +// MusicPlayer +// +// Created by Mr.Zhou on 2024/3/27. +// + +import UIKit +import Foundation +//全局导入SnapKit库 +@_exported import SnapKit +//MARK: - 约束布局适配扩展 +extension NSLayoutConstraint { + ///是否等比调整约束 + @IBInspectable var adapterScreen: Bool { + get { + return true + } + set { + if newValue { + self.constant = self.constant * width + } + + } + } + + /// 更改乘数约束 + /// - Parameter multiplier: 比例值 + /// - Returns: 更新后的约束 + func setMultiplier(multiplier:CGFloat) -> NSLayoutConstraint { + NSLayoutConstraint.deactivate([self]) + let newConstraint = NSLayoutConstraint( + item: firstItem as Any, + attribute: firstAttribute, + relatedBy: relation, + toItem: secondItem, + attribute: secondAttribute, + multiplier: multiplier, + constant: constant) + newConstraint.priority = priority + newConstraint.shouldBeArchived = self.shouldBeArchived + newConstraint.identifier = self.identifier + NSLayoutConstraint.activate([newConstraint]) + return newConstraint + } +} +//MARK: - CALayer扩展 +extension CALayer { + ///设置边线颜色 + var borderUIColor: UIColor { + get { + return UIColor(cgColor: self.borderColor!) + } set { + self.borderColor = newValue.cgColor + } + } +} +//MARK: - UIView扩展 +extension UIView { + ///圆角值 + @IBInspectable var cornerRadius: CGFloat { + get { + return layer.cornerRadius + } set { + layer.masksToBounds = (newValue > 0) + layer.cornerRadius = newValue * width + } + } + ///边线宽度 + @IBInspectable var borderWidth: CGFloat { + get { + return layer.borderWidth + } set { + layer.borderWidth = newValue + } + } + ///边线颜色 + @IBInspectable var borderColor: UIColor { + get { + return layer.borderUIColor + } set { + layer.borderColor = newValue.cgColor + } + } +} diff --git a/MusicPlayer/MP/Common/Extension(扩展)/Notification.swift b/MusicPlayer/MP/Common/Extension(扩展)/Notification.swift new file mode 100644 index 0000000..3f6ad73 --- /dev/null +++ b/MusicPlayer/MP/Common/Extension(扩展)/Notification.swift @@ -0,0 +1,70 @@ +// +// Notification.swift +// MusicPlayer +// +// Created by Mr.Zhou on 2024/4/1. +// + +import Foundation +///通知关键词协议 +protocol NotificationKey { + associatedtype Keys: RawRepresentable +} +///将RawValue转化为字符串 +extension NotificationKey where Keys.RawValue == String { + ///发通知 + static func post(notificationName key:Keys, object:Any? = nil) { + let rawValue = key.rawValue + NotificationCenter.default.post(name: NSNotification.Name(rawValue), object: object) + } + ///监听通知 + static func add(observer: AnyObject, selector: Selector, notificationName key: Keys, object:Any? = nil) { + let rawValue = key.rawValue + NotificationCenter.default.addObserver(observer, selector: selector, name: NSNotification.Name(rawValue), object: object) + } + ///移除通知 + static func remove(observer: AnyObject, notificationName key: Keys, object:Any? = nil) { + let rawValue = key.rawValue + NotificationCenter.default.removeObserver(observer, name: NSNotification.Name(rawValue), object: object) + } +} +//MARK: - 扩写通知 +extension NotificationCenter{ + struct notificationKey:NotificationKey { + ///关键词 + enum Keys:String { + ///切换taBarItem + case switch_tabBarItem + ///倒计时过程(携带时间值) + case time_times + ///音量值改变 + case volume_change + ///启动音乐播放器 + case play_music + ///终止音乐播放器与倒计时 + case stop_music + ///暂停音乐播放器 + case pause_music + ///继续音乐播放器 + case resume_music + ///开启麦克风监听 + case open_monitor + ///关闭麦克风监听 + case stop_monitor + ///新增音乐选择页 + case new_choice + ///音乐创建成功 + case creat_music + ///音乐实体为空 + case null_music + ///收起音乐展示框 + case close_show + ///显示音乐展示框 + case display_show + ///隐藏音乐展示框 + case hidden_show + ///音乐实体重命名 + case rename_music + } + } +} diff --git a/MusicPlayer/MP/Common/Extension(扩展)/String.swift b/MusicPlayer/MP/Common/Extension(扩展)/String.swift new file mode 100644 index 0000000..10540ca --- /dev/null +++ b/MusicPlayer/MP/Common/Extension(扩展)/String.swift @@ -0,0 +1,23 @@ +// +// String.swift +// MusicPlayer +// +// Created by Mr.Zhou on 2024/4/7. +// + +import Foundation +extension String { + /// 字符串转类type + func classFromString() -> AnyClass? { + // 获swift中的命名空间名 + var name = Bundle.main.object(forInfoDictionaryKey: "CFBundleExecutable") as? String + // 如果包名中有'-'横线这样的字符,在拿到包名后,还需要把包名的'-'转换成'_'下横线 + name = name?.replacingOccurrences(of: "-", with: "_") + // 拼接命名空间和类名,”包名.类名“ + let fullClassName = name! + "." + self + // 因为NSClassFromString()返回的AnyClass?,需要给个默认值返回! + let anyClass: AnyClass? = NSClassFromString(fullClassName) + // 类type + return anyClass + } +} diff --git a/MusicPlayer/MP/Common/Extension(扩展)/TableView.swift b/MusicPlayer/MP/Common/Extension(扩展)/TableView.swift new file mode 100644 index 0000000..5030f6d --- /dev/null +++ b/MusicPlayer/MP/Common/Extension(扩展)/TableView.swift @@ -0,0 +1,33 @@ +// +// TableView.swift +// MusicPlayer +// +// Created by Mr.Zhou on 2024/4/11. +// + +import UIKit + +extension UITableView { + /// tableView刷新时触发(适用单独section) + /// - Parameter count: 显示cell数量 + func showMessage(_ count:Int, title:String = "No data"){ + if count == 0 { + let view = UIView() + view.frame = frame + view.backgroundColor = .clear + //显示图片 + let imageView = UIImageView(image: UIImage(named: "empty")) + imageView.contentMode = .scaleAspectFill + view.addSubview(imageView) + imageView.snp.makeConstraints { make in + make.centerX.equalToSuperview() + make.centerY.equalToSuperview().multipliedBy(0.9) + make.width.equalTo(211*width) + make.height.equalTo(172*width) + } + backgroundView = view + }else{ + backgroundView = nil + } + } +} diff --git a/MusicPlayer/MP/Common/Macro(宏定义与全局量)/Macro.swift b/MusicPlayer/MP/Common/Macro(宏定义与全局量)/Macro.swift new file mode 100644 index 0000000..b95efec --- /dev/null +++ b/MusicPlayer/MP/Common/Macro(宏定义与全局量)/Macro.swift @@ -0,0 +1,99 @@ +// +// Macro.swift +// MusicPlayer +// +// Created by Mr.Zhou on 2024/3/25. +// +import UIKit +import Foundation +import AVFoundation +//MARK: - 常用宏定义 +///屏幕宽 +let screen_Width = UIScreen.main.bounds.width +///屏幕高 +let screen_Height = UIScreen.main.bounds.height +///像素比值 +let width = screen_Width / 375 +///状态栏高度 +#if __IPHONE_13_0 +let statusBarHeight:CGFloat = UIApplication.shared.windows.first?.windowScene?.statusBarManager?.statusBarFrame.size.height +#else +let statusBarHeight:CGFloat = UIApplication.shared.statusBarFrame.size.height +#endif +///状态栏和导航栏的总高度 +let navAndstatusBarHeight = statusBarHeight + 44 +///判断是否是刘海屏 +let iphoneX = ((statusBarHeight != 20) ? true : false) +///获取版本号 +let LOCAL_RELEASE_VERSION = Bundle.main.infoDictionary!["CFBundleShortVersionString"] as! String +///获取程序名字 +let App_Name = Bundle.main.infoDictionary!["CFBundleDisplayName"] as! String +///获取手机型号 +let Phone_Model = UIDevice.current.model +///系统版本号 +let System_Version = UIDevice.current.systemVersion +///获取当前系统语言 +let Language_first_local = NSLocale.preferredLanguages.first! +///底部安全区域 +let bottomPadding = UIApplication.shared.keyWindow?.safeAreaInsets.bottom ?? 0 +///隐私政策网址 +let privacyUrl:URL = .init(string: "https://musicoo.app/privacy")! +///用户协议网址 +let serviceUrl:URL = .init(string: "https://musicoo.app/terms")! +//MARK: - 全局变量与方法 +///总事件闭包 +typealias ActionBlock = () -> Void? +///全局模态弹出类型 +var MPModalType:MPPresentModal = .Timer +///转时分值 +func setTimesToMinSeconds(_ time:TimeInterval) -> String { + //设置分钟 + let min = Int(time / 60) + let second = Int(time.truncatingRemainder(dividingBy: 60)) + return "\(min < 10 ? "0\(min)":"\(min)"):\(second < 10 ? "0\(second)":"\(second)")" +} +///转分值 +func setTimesToMins(_ time:TimeInterval) -> String { + //设置分钟 + let min = Int(time / 60) + return "\(min < 10 ? "0\(min)":"\(min)")" +} +///获取麦克风权限 +func authorize(observe:UIViewController) -> Bool{ + let status = AVCaptureDevice.authorizationStatus(for: AVMediaType.audio) + switch status { + case .authorized: + return true + case .notDetermined: + // 请求授权 + AVCaptureDevice.requestAccess(for: AVMediaType.audio, completionHandler: {(status) in + DispatchQueue.main.async(execute: {() -> Void in + _ = authorize(observe: observe) + }) + }) + default: () + DispatchQueue.main.async(execute: { () -> Void in + let alertController = UIAlertController(title: "Get Microphone Access",message: "“Musicoo” asks you to turn on your microphone to recognize the decibels around you and turns on white noise for you automatically. Please go to the “Settings” page to turn on the microphone permission",preferredStyle: .alert) + let cancelAction = UIAlertAction(title:"Cancel", style: .cancel, handler:nil) + let settingsAction = UIAlertAction(title:"Settings", style: .default, handler: { + (action) -> Void in + let url = URL(string: UIApplication.openSettingsURLString) + if let url = url, UIApplication.shared.canOpenURL(url) { + if #available(iOS 10, *) { + UIApplication.shared.open(url, options: [:], + completionHandler: { + (success) in + }) + } else { + UIApplication.shared.openURL(url) + } + } + }) + alertController.addAction(cancelAction) + alertController.addAction(settingsAction) + observe.present(alertController, animated: true) + }) + } + return false +} + diff --git a/MusicPlayer/MP/Common/Protocol(公用协议)/CoreDataDelegete.swift b/MusicPlayer/MP/Common/Protocol(公用协议)/CoreDataDelegete.swift new file mode 100644 index 0000000..1244d15 --- /dev/null +++ b/MusicPlayer/MP/Common/Protocol(公用协议)/CoreDataDelegete.swift @@ -0,0 +1,91 @@ +// +// CoreDataDelegete.swift +// MusicPlayer +// +// Created by Mr.Zhou on 2024/4/1. +// + +import Foundation +import CoreData +// MARK: - CoreDataManageableDelegate 数据库管理协议 +///数据库管理协议,继承NSFetchRequestResult,方便调用更多方法 +protocol MPCoreDataManageableDelegate: NSFetchRequestResult { + ///实体名 + static var entityName: String { get } +} +///扩展数据库管理协议,继承NSManagedObject时,默认实现以下内容 +extension MPCoreDataManageableDelegate where Self: NSManagedObject { + //根据类名设置实体名 + static var entityName: String { + return String(describing: self) + } + //标准检索 + static var fetchRequest: NSFetchRequest { + return NSFetchRequest(entityName: entityName) + } +} +// MARK: - CoreDataOperationDelegate 数据库操作协议 +///数据库操作协议,创建,查询,删除,保存等 +protocol MPCoreDataOperationDelegate { + //关联一个继承CoreDataManageableDelegate协议的实体,与泛型相似 + associatedtype ManagedObject: MPCoreDataManageableDelegate, NSManagedObject + //创建实体 + static func create() -> ManagedObject + //查询指定条件实体 + static func fetch(_ predicate:NSPredicate) -> [ManagedObject] + //查询全部实体 + static func fetchAll() -> [ManagedObject] + //删除实体 + static func delete(_ object: ManagedObject) + //表保存 + static func save() +} +///扩展数据库操作协议,默认实现协议方法 +extension MPCoreDataOperationDelegate { + + /// 创建实体 + /// - Returns: 返回的实体 + static func create() -> ManagedObject { + //创建一个对应的实体 + guard let entity = NSEntityDescription.entity(forEntityName: ManagedObject.entityName, in: MPCoreDataHandlerManager.shared.context) else { + fatalError("Failed to find entity description for \(ManagedObject.entityName)") + } + return ManagedObject(entity: entity, insertInto: MPCoreDataHandlerManager.shared.context) + } + + /// 查询指定条件实体 + /// - Parameter predicate: 条件语句 + /// - Returns: 返回结果数组 + static func fetch(_ predicate:NSPredicate) -> [ManagedObject] { + let fetchRequest = ManagedObject.fetchRequest + fetchRequest.predicate = predicate + do { + return try MPCoreDataHandlerManager.shared.context.fetch(fetchRequest) + } catch { + print("Failed to fetch \(ManagedObject.entityName): \(error)") + return [] + } + } + + /// 查询全部实体 + /// - Returns: 返回结果数组 + static func fetchAll() -> [ManagedObject] { + do { + return try MPCoreDataHandlerManager.shared.context.fetch(ManagedObject.fetchRequest) + } catch { + print("Failed to fetch \(ManagedObject.entityName): \(error)") + return [] + } + } + /// 从表删除实体 + /// - Parameter object: 指定的实体 + static func delete(_ object: ManagedObject) { + MPCoreDataHandlerManager.shared.context.delete(object) + save() + } + + /// 表执行保存 + static func save() { + MPCoreDataHandlerManager.shared.saveContext() + } +} diff --git a/MusicPlayer/MP/Common/Protocol(公用协议)/InstanceFromNib.swift b/MusicPlayer/MP/Common/Protocol(公用协议)/InstanceFromNib.swift new file mode 100644 index 0000000..c8de30e --- /dev/null +++ b/MusicPlayer/MP/Common/Protocol(公用协议)/InstanceFromNib.swift @@ -0,0 +1,18 @@ +// +// InstanceFromNib.swift +// MusicPlayer +// +// Created by Mr.Zhou on 2024/3/27. +// + +import Foundation +//MARK: - Xib协议扩展 +///返回View的xib 协议 +protocol instanceFromNibDelegate { +} +extension instanceFromNibDelegate where Self:UIView{ + ///获取UIView的xib + static func instanceFromNib() -> Self{ + return Bundle.main.loadNibNamed(String(describing: Self.self), owner: nil, options: nil)?.first as! Self + } +} diff --git a/MusicPlayer/MP/Common/Resource(资源)/Resource.plist b/MusicPlayer/MP/Common/Resource(资源)/Resource.plist new file mode 100644 index 0000000..7e12c34 --- /dev/null +++ b/MusicPlayer/MP/Common/Resource(资源)/Resource.plist @@ -0,0 +1,294 @@ + + + + + + identifier + voice-1 + title + Breathe + duration + 6 + cover + Breathe + author + Unknown + album + 1 + isLocal + + path + Breathe + + + identifier + voice-2 + title + Shhh… + duration + 215 + cover + Shhh… + author + Unknown + album + 1 + isLocal + + path + Shhh… + + + identifier + voice-3 + title + Shh Shh + duration + 36 + cover + Shh Shh + author + Unknown + album + 1 + isLocal + + path + Shh Shh + + + identifier + voice-4 + title + Mountain stream + duration + 51 + cover + Mountain stream + author + Unknown + album + 2 + isLocal + + path + Mountain stream + + + identifier + voice-5 + title + Fireplace + duration + 109 + cover + Fireplace + author + Unknown + album + 2 + isLocal + + path + Fireplace + + + identifier + voice-6 + title + Water droplet + duration + 31 + cover + Water droplet + author + Unknown + album + 2 + isLocal + + path + Water droplet + + + identifier + voice-7 + title + TV + duration + 9 + cover + TV + author + Unknown + album + 2 + isLocal + + path + TV + + + identifier + voice-8 + title + Chirping of Birds + duration + 76 + cover + Chirping of Birds + author + Unknown + album + 3 + isLocal + + path + Chirping of Birds + + + identifier + voice-9 + title + waterfall + duration + 59 + cover + waterfall + author + Unknown + album + 3 + isLocal + + path + waterfall + + + identifier + voice-10 + title + Beach + duration + 116 + cover + Beach + author + Unknown + album + 3 + isLocal + + path + Beach + + + identifier + voice-11 + title + Call of Seagulls + duration + 78 + cover + Call of Seagulls + author + Unknown + album + 3 + isLocal + + path + Call of Seagulls + + + identifier + voice-12 + title + Cicada Chirping + duration + 120 + cover + Cicada Chirping + author + Unknown + album + 3 + isLocal + + path + Cicada Chirping + + + identifier + voice-13 + title + Nocturnal Insects + duration + 59 + cover + Nocturnal Insects + author + Unknown + album + 3 + isLocal + + path + Nocturnal Insects + + + identifier + voice-14 + title + Howling Wind + duration + 63 + cover + Howling Wind + author + Unknown + album + 3 + isLocal + + path + Howling Wind + + + identifier + voice-15 + title + Seawater Surging + duration + 97 + cover + Seawater Surging + author + Unknown + album + 3 + isLocal + + path + Seawater Surging + + + identifier + voice-16 + title + Summer Insects + duration + 17 + cover + Summer Insects + author + Unknown + album + 3 + isLocal + + path + Summer Insects + + + diff --git a/MusicPlayer/MP/Common/Tool(工具封装)/MPCoreDataHandlerManager.swift b/MusicPlayer/MP/Common/Tool(工具封装)/MPCoreDataHandlerManager.swift new file mode 100644 index 0000000..04da1b9 --- /dev/null +++ b/MusicPlayer/MP/Common/Tool(工具封装)/MPCoreDataHandlerManager.swift @@ -0,0 +1,48 @@ +// +// MPCoreDataHandlerManager.swift +// MusicPlayer +// +// Created by Mr.Zhou on 2024/4/1. +// + +import Foundation +import CoreData + +///CoreData数据库处理器 +class MPCoreDataHandlerManager { + //单例工具 + static let shared = MPCoreDataHandlerManager() + //数据仓库 + private lazy var persistentContainer: NSPersistentContainer = { + //数据仓库名为XXX.cdatamodeld中的XXX + let container = NSPersistentContainer(name: "MusicPlayer") + container.loadPersistentStores { (_, error) in + if let error = error { + //加载数据仓库失败 + fatalError("Failed to load persistent stores: \(error)") + }else { + //加载数据仓库成功 + print("Successfully to load persistent stores") + } + } + return container + }() + //托管(映射)对象空间 + var context: NSManagedObjectContext { + return persistentContainer.viewContext + } + //保存对象空间 + func saveContext() { + //检索对象空间是否进行了更新 + if context.hasChanges { + do { + //保存对象空间 + try context.save() + } catch { + //保存失败 + let nserror = error as NSError + fatalError("Unresolved error \(nserror), \(nserror.userInfo)") + } + } + } +} diff --git a/MusicPlayer/MP/Common/Tool(工具封装)/MPHUD.swift b/MusicPlayer/MP/Common/Tool(工具封装)/MPHUD.swift new file mode 100644 index 0000000..3a1da77 --- /dev/null +++ b/MusicPlayer/MP/Common/Tool(工具封装)/MPHUD.swift @@ -0,0 +1,84 @@ +// +// MPHUD.swift +// MusicPlayer +// +// Created by Mr.Zhou on 2024/4/11. +// + +import UIKit +import SVProgressHUD +///二次封装hud +class MPHUD: NSObject { + //HUD输出状态 + enum status { + ///成功 + case success + ///失败 + case error + ///只显示文字 + case onlyText + ///过程 + case progress + ///加载数据 + case loading + } + ///文本HUD + static func text(_ text:String?,delay:TimeInterval,completion:(() -> Void)?){ + showWithStatus(hudStatus: .onlyText, text: text, delay: delay, completion: completion) + } + + ///等待HUD + static func progress(_ text:String?,delay:TimeInterval,completion:(() -> Void)?){ + showWithStatus(hudStatus: .progress, text: text, delay: delay, completion: completion) + } + ///数据HUD + static func loading(_ delay:TimeInterval,completion:(() -> Void)?){ + showWithStatus(hudStatus: .loading, text: nil, delay: delay, completion: completion) + } + ///成功HUD + static func success(_ text:String?,delay:TimeInterval,completion:(() -> Void)?){ + showWithStatus(hudStatus: .success, text: text, delay: delay, completion: completion) + } + ///错误HUD + static func error(_ text:String?,delay:TimeInterval,completion:(() -> Void)?){ + showWithStatus(hudStatus: .error, text: text, delay: delay, completion: completion) + } + //立刻隐藏当前HUD + static func hideNow() { + SVProgressHUD.dismiss() + } + + /// 展示HUD + /// - Parameters: + /// - status: HUD状态 + /// - text: 显示文本 + /// - delay: 显示时常 + static func showWithStatus(hudStatus status: status, text: String?, delay: TimeInterval ,completion:(() -> Void)?) { + SVProgressHUD.setDefaultStyle(.light) + SVProgressHUD.setDefaultMaskType(.clear) + SVProgressHUD.setBackgroundColor(.white) + SVProgressHUD.setOffsetFromCenter(.init(horizontal: 0, vertical: 0)) + switch status { + case .success: + SVProgressHUD.showSuccess(withStatus: text) + SVProgressHUD.setMinimumSize(CGSize(width: 100 * width, height: 80 * width)) + case .error: + SVProgressHUD.showError(withStatus: text) + case .onlyText: + SVProgressHUD.setOffsetFromCenter(.init(horizontal: 0, vertical: (screen_Height / 2) - 85 * width)) + SVProgressHUD.setMinimumSize(CGSize(width: 100 * width, height: 40 * width)) + SVProgressHUD.show(UIImage(), status: text) + case .loading: + SVProgressHUD.setBackgroundColor(.white) + SVProgressHUD.show() + default: + SVProgressHUD.show(withStatus: text) + } + SVProgressHUD.dismiss(withDelay: delay) { + guard let completion = completion else{ + return + } + completion() + } + } +} diff --git a/MusicPlayer/MP/Common/Tool(工具封装)/MPMediaCenterManager.swift b/MusicPlayer/MP/Common/Tool(工具封装)/MPMediaCenterManager.swift new file mode 100644 index 0000000..464e81c --- /dev/null +++ b/MusicPlayer/MP/Common/Tool(工具封装)/MPMediaCenterManager.swift @@ -0,0 +1,620 @@ +// +// MPMediaCenterManager.swift +// MusicPlayer +// +// Created by Mr.Zhou on 2024/4/11. +// + +import Foundation +import AVFoundation +import MediaPlayer +///播放器播放事件类型 +enum MPPlayerPlayActionType:Int { + ///正常播放 + case Normal = 0 + ///倒计时播放(用户添加倒计时) + case CountTime = 1 +} +///播放器播放状态 +enum MPPlayerStateType:Int { + ///未播放 + case Null = 0 + ///播放中 + case Playing = 1 + ///暂停 + case Pause = 2 +} +///倒计时状态 +enum MPTimerType:Int { + ///未启动 + case UnActivity = 0 + ///运行中 + case Playing = 1 + ///暂停中 + case Suspend = 2 +} +///倒计时规格等级 +enum MPCountTimerLevel:Int, CaseIterable { + case OFF = 0 + case _10 = 1 + case _20 = 2 + case _30 = 3 + case _60 = 4 + case _90 = 5 + ///标题 + var title:String{ + switch self { + case .OFF: + return "OFF" + case ._10: + return "10" + case ._20: + return "20" + case ._30: + return "30" + case ._60: + return "60" + case ._90: + return "90" + } + } + ///实际数值(分) + var mins:Int{ + switch self { + case .OFF: + return 0 + case ._10: + return 10 + case ._20: + return 20 + case ._30: + return 30 + case ._60: + return 60 + case ._90: + return 90 + } + } +} + + +///多媒体控制器(播放控制器,倒计时控制器,麦克风管理器) +class MPMediaCenterManager { + ///控制器单例 + static let shared = MPMediaCenterManager() + //MARK: - 各项工具 + //音乐播放器 + private var player:AVPlayer? + //远程控制中心 + private var center:MPRemoteCommandCenter? + //GCD倒计时器 + private var countTimer: DispatchSourceTimer? + //监听器(需要获取麦克风权限),通过监听器实时获取周遭分贝 + private var monitor:AVAudioRecorder? + //监听器设置参数字典 + private var monitorSetingsDic:[String : Any]? + //GCD监听计时器 + private var monitorTimer: DispatchSourceTimer? + + //MARK: - 实体与状态值 + ///音乐实体 + private var music:MusicModel? + ///获取音乐实体 + func getMusic() -> MusicModel?{ + return music + } + ///更改音乐实体 + func setMusic(_ music:MusicModel?) { + self.music = music + } + ///播放器播放方法 + private var playActionType:MPPlayerPlayActionType = .Normal + ///播放器播放状态(默认未播放) + private var playerState:MPPlayerStateType = .Null + ///获取播放器播放状态 + func getPlayerState() -> MPPlayerStateType { + return playerState + } + ///倒计时运行状态(默认未启动) + private var countTimeType:MPTimerType = .UnActivity + ///倒计时规格 (默认为OFF) + private var countTimerLevel:MPCountTimerLevel = .OFF + ///获取倒计时规格值 + func getCountTimerLevel() -> MPCountTimerLevel { + return countTimerLevel + } + ///监听器计时状态 + private var monitorTimerType:MPTimerType = .UnActivity + ///监听器是否活跃 + private var isMonitorActivity:Bool = false + //隐藏管理器初始化方法 + private init() { + //初始化时获取上次运行app时存入的最后一首音乐(保存的内容为音乐实体的identifier,具备唯一性) + let lastTitle = UserDefaults.standard.string(forKey: "Last") ?? "" + let last = MusicModel.fetch(.init(format: "identifier==%@", lastTitle)).first + //更新音乐实体(可选性) + music = last + // 添加观察者,监听播放结束事件 + NotificationCenter.default.addObserver(self, selector: #selector(playerDidFinishPlaying), name: .AVPlayerItemDidPlayToEndTime, object: player?.currentItem) + + //初始化监听器字典并添加设置参数 + monitorSetingsDic = + [ + //音频格式 + AVFormatIDKey:NSNumber(value: kAudioFormatLinearPCM), + //录音的声道数,立体声为双声道 + AVNumberOfChannelsKey: 2, + //录音质量 + AVEncoderAudioQualityKey : AVAudioQuality.max.rawValue, + //采样位数 + AVLinearPCMBitDepthKey:NSNumber(value:16), + AVEncoderBitRateKey : 320000, + //录音器每秒采集的录音样本数 + AVSampleRateKey : 44100.0 + ] + } + + //管理器销毁时 + deinit { + //解除监听 + NotificationCenter.default.removeObserver(self) + //释放播放器 + player = nil + //释放倒计时器 + countTimer?.cancel() + countTimer = nil + //释放监听器 + monitor = nil + monitorTimer?.cancel() + monitorTimer = nil + } + //MARK: - 播放器与倒计时器 + /// 启动播放器 + /// - Parameters: + /// - music: 音乐实体 + /// - actionType: 播放方法(正常播放/倒计时播发) + /// - countLevel: 如果倒计时播放则填入倒计时规格 + func playerStart(_ music:MusicModel, actionType:MPPlayerPlayActionType, countLevel: MPCountTimerLevel = .OFF) { + //检索倒计时器状态 + switch countTimeType { + case .UnActivity://未启动计时器 + break + case .Playing://计时器运行中 + if countTimer != nil { + //倒计时器具备实例,处于rsume中,可以直接销毁 + countTimer!.cancel() + countTimer = nil + } + case .Suspend://计时器暂停中,销毁计时器 + if countTimer != nil { + //倒计时器具备实例,处于suspend中,可以直接销毁 + countTimer!.resume() + countTimer!.cancel() + countTimer = nil + } + } + //检索当前音乐播放器状态 + switch playerState { + case .Null://未播放,跳过 + break + case .Playing://播放中 + //销毁播放器 + if player != nil { + player!.pause() + player = nil + } + //发送停止音乐播放通知 + NotificationCenter.notificationKey.post(notificationName: .stop_music) + case .Pause://暂停中 + //销毁播放器 + if player != nil { + player = nil + } + //发送停止音乐播放通知 + NotificationCenter.notificationKey.post(notificationName: .stop_music) + } + //更新播放方法 + playActionType = actionType + //检索播放方法 + switch playActionType { + case .Normal://正常播放 + playMusic(music) + case .CountTime://倒计时播放 + //更新倒计时规格 + countTimerLevel = countLevel + countTimerStart(Double(countLevel.mins*60), music: music) + } + } + //倒计时播放时触发 + private func countTimerStart(_ totalTimes:TimeInterval, music:MusicModel) { +// //检索倒计时器状态 +// switch countTimeType { +// case .UnActivity://未启动计时器 +// break +// case .Playing://计时器运行中 +// if countTimer != nil { +// //倒计时器具备实例,处于rsume中,可以直接销毁 +// countTimer!.cancel() +// countTimer = nil +// } +// case .Suspend://计时器暂停中,销毁计时器 +// if countTimer != nil { +// //倒计时器具备实例,处于suspend中,可以直接销毁 +// countTimer!.resume() +// countTimer!.cancel() +// countTimer = nil +// } +// } + //创建倒计时器队列 + let queue = DispatchQueue(label: "com.MPCountTimer.queue") + //创建倒计时器 + countTimer = DispatchSource.makeTimerSource(queue: queue) + //设置计时器的起始时间以及触发事件频率为一秒一次 + countTimer!.schedule(deadline: .now(), repeating: .seconds(1)) + //将总时间值赋予times + var times = totalTimes + //计时器设置触发事件 + countTimer!.setEventHandler(handler: { + [weak self] in + //判断时间值是否归零 + if times > 0 { + //未归0,倒计时-1 + times -= 1 + //打印倒计时 + print(setTimesToMinSeconds(times)) + //发布时间值变化通知 + NotificationCenter.notificationKey.post(notificationName: .time_times, object: times) + }else { + //执行结束事件 + self?.playerStop() + } + }) + //启动倒计时器 + countTimeType = .Playing + countTimer!.resume() + print("The CountTimer has started.") + //调用音乐播放器 + playMusic(music) + } + + //启动播放器 + private func playMusic(_ music:MusicModel) { + //根据音乐实体类型 + self.music = music + player_play(self.music!.isLocal ? musicLocal():musicDocument()) + } + //音乐为本地文件 + private func musicLocal() -> URL { + //本地文件,mp3格式 + let url:URL = .init(fileURLWithPath: Bundle.main.path(forResource: music!.path, ofType: "mp3")!) + return url + } + //音乐为沙盒文件 + private func musicDocument() -> URL { + var url:URL! + //用户上传文件,文件路径设置为沙盒 + let directory = NSSearchPathForDirectoriesInDomains(.documentDirectory, .userDomainMask, true).first! + //获取沙盒中的数据 + let vedioUrl = URL(fileURLWithPath:URL(fileURLWithPath: directory).appendingPathComponent((music!.path)).path) + //检索路径是否安全授权 + let authozied = vedioUrl.startAccessingSecurityScopedResource() + if authozied == true { + //允许安全访问路径,调出文件协调器解码并获取真实文件地址 + let fileCoordinator = NSFileCoordinator() + fileCoordinator.coordinate(readingItemAt: vedioUrl, options: .withoutChanges, error: nil) { (newUrl) in + url = newUrl + } + }else { + //未能获取安全授权,强制获取 + url = vedioUrl + } + //停止安全访问权限 + vedioUrl.stopAccessingSecurityScopedResource() + return url + } + //播放音乐 + private func player_play(_ url:URL) { + //检索真实路径对应的文件是否存在 + if FileManager.default.fileExists(atPath: url.path) == true { + //当前路径的文件正式存在 + //初始化播放器 + let playerItem = AVPlayerItem(url: url) + //创建AVPlayer + player = AVPlayer(playerItem: playerItem) + //正式播放 + player?.play() + playerState = .Playing + //启动远程中心并配置相关内容 + setCommandCenter(music!) + //发送播放器启动通知 + NotificationCenter.notificationKey.post(notificationName: .play_music) + //更新最后一次播放内容 + music!.lastTime = Date().timeZone() + MusicModel.save() + UserDefaults.standard.set(music!.identifier, forKey: "Last") + }else { + //文件不存在,通知用户删除该音乐实体 + print("Couldn't find the file.") + playerState = .Null + music = nil + //发送音乐缺失通知 + NotificationCenter.notificationKey.post(notificationName: .null_music) + } + } + ///暂停播放器 + func playerPause() { + //检索播放状态,是否进行中 + guard playerState == .Playing, let player = player else { + //未处于播放中 + print("Player is not in playing") + return + } + //处于播放中,检索播放方法 + switch playActionType { + case .Normal://正常播放 + player_pause(player) + case .CountTime://倒计时播放 + //检索倒计时器状态,是否进行中 + guard countTimeType == .Playing, let countTimer = countTimer else { + //倒计时器未运行 + print("CountTimer is not playing") + return + } + //倒计时运行中,暂停倒计时 + countTimer.suspend() + countTimeType = .Suspend + //暂停播放 + player_pause(player) + } + } + //暂停播放 + private func player_pause(_ player:AVPlayer) { + //暂停播放器 + player.pause() + //切换播放器状态 + playerState = .Pause + //发布音乐暂停公告 + NotificationCenter.notificationKey.post(notificationName: .pause_music) + } + ///继续播放器 + func playerResume() { + //检索播放状态,是否暂停中 + guard playerState == .Pause, let player = player else { + //未处于暂停中 + print("Player is not paused") + return + } + //处于暂停中,检索播放方法 + switch playActionType { + case .Normal://正常播放 + player_resume(player) + case .CountTime://倒计时播放 + //检索倒计时器状态,是否暂停中 + guard countTimeType == .Suspend, let countTimer = countTimer else { + //倒计时器未暂停 + print("CountTimer is not paused") + return + } + //倒计时暂停中,运行倒计时 + countTimer.resume() + countTimeType = .Playing + //继续播放 + player_resume(player) + } + } + //继续播放 + private func player_resume(_ player:AVPlayer) { + //继续播放器 + player.play() + //切换播放器状态 + playerState = .Playing + //发布音乐继续公告 + NotificationCenter.notificationKey.post(notificationName: .resume_music) + } + ///停止播放器 + func playerStop() { + //检索播放状态,是否已启动 + guard playerState != .Null, let player = player else { + //未启动 + print("Player is not started") + return + } + //处于启动中,检索播放方法 + switch playActionType { + case .Normal://正常播放 + player_stop(player) + case .CountTime://倒计时播放 + //检索倒计时器状态,是否已启动 + guard countTimeType != .UnActivity, let countTimer = countTimer else { + //倒计时器未启动 + print("CountTimer is not started") + return + } + //倒计时器已启动,终止倒计时 + if countTimeType == .Suspend { + countTimer.resume() + } + countTimer.cancel() + self.countTimer = nil + //当计时器终止后,将计时等级回正为off + countTimerLevel = .OFF + //停止音乐播放 + player_stop(player) + } + } + //停止播放 + private func player_stop(_ player:AVPlayer) { + player.pause() + self.player = nil + playerState = .Null + //回正播放类型 + playActionType = .Normal + //发送停止音乐播放通知 + NotificationCenter.notificationKey.post(notificationName: .stop_music) + } + //播放器停止 + @objc private func playerDidFinishPlaying() { + guard playerState == .Playing, let player = player else { + return + } + // 重置播放时间到开始 + player.seek(to: CMTime.zero) + // 继续播放 + player.play() + } + //MARK: - 远程中心 + private func setCommandCenter(_ music:MusicModel) { + // 实例化远程控制中心 + center = MPRemoteCommandCenter.shared() + + //设置控制中心各项操作 + //播放 + center!.playCommand.addTarget(handler: { [weak self] (event) in + guard let self = self else { return .noActionableNowPlayingItem} + if self.music != nil { + + return .success + }else { + return .noActionableNowPlayingItem + } + }) + //暂停 + center!.pauseCommand.addTarget(handler: { [weak self] (event) in + guard let self = self else { return .noActionableNowPlayingItem} + if self.music != nil { + + return .success + }else { + return .noActionableNowPlayingItem + } + }) + //设置info字典信息 + var info = [String:Any]() + //展示标题 + info[MPMediaItemPropertyTitle] = music.title ?? "" + //设置艺术家 +// info[MPMediaItemPropertyArtist] = "" + //设置专辑 +// info[MPMediaItemPropertyAlbumTitle] = "" + //设置歌曲时长 +// info[MPMediaItemPropertyPlaybackDuration] = 0 + //设置歌曲封面 + if let image = UIImage(data: music.cover) { + info[MPMediaItemPropertyArtwork] = MPMediaItemArtwork(boundsSize: image.size, requestHandler: { size in + return image + }) + } + //更新远程中心 + MPNowPlayingInfoCenter.default().nowPlayingInfo = info + } + //MARK: - 麦克风监听器 + ///开启监听器 + func openMonitor(_ decibels:Double) { + //优先检索倒计时器和播放器状态 + if countTimeType != .UnActivity || playerState != .Null { + //有一项处于启动中,终止该事件 + playerStop() + } + //检索监听器计时状态 + switch monitorTimerType { + case .UnActivity://未启动监听器计时 + break + case .Playing://监听器计时运行中 + if monitorTimer != nil { + //倒计时器具备实例,处于rsume中,可以直接销毁 + monitorTimer!.cancel() + monitorTimer = nil + } + case .Suspend://监听器计时暂停中 + if monitorTimer != nil { + //倒计时器具备实例,处于suspend中,可以直接销毁 + monitorTimer!.resume() + monitorTimer!.cancel() + monitorTimer = nil + } + } + //创建计时器队列 + let queue = DispatchQueue(label: "com.MPMonitorTimer.queue") + //实例化监听器计时 + monitorTimer = DispatchSource.makeTimerSource(queue: queue) + //设置计时器的起始时间以及触发事件频率为一秒一次 + monitorTimer!.schedule(deadline: .now(), repeating: .seconds(1)) + //计时器设置触发事件 + monitorTimer!.setEventHandler(handler: { + [weak self] in + guard let self = self else { return } + //每秒触发一次监听器,获取当前麦克风分贝值 + let currentDecibels = checkDecibels() + //根据分贝值大小,判断是否启动音乐播放器 + if currentDecibels > decibels { + guard let music = self.music else { + return + } + //启动十分钟计时器 + playerStart(music, actionType: .CountTime, countLevel: ._10) + //停止监听器 + stopMonitor() + } + }) + //先删除监听器缓存内容,并释放监听器 + monitor?.deleteRecording() + monitor = nil + var url:URL? + let path = NSSearchPathForDirectoriesInDomains(.documentDirectory, .userDomainMask, true)[0] + "/play" + //生成空路径 + if #available(iOS 16.0, *) { + url = URL(filePath: path) + } else { + url = URL(fileURLWithPath: path) + } + //重新实例化监听器 + do { + //初始化监听器 + monitor = try AVAudioRecorder(url: url!, settings: monitorSetingsDic!) + //开启仪表计数功能 + monitor!.isMeteringEnabled = true + //准备监听 + monitor!.prepareToRecord() + //开始监听 + monitor!.record() + //启动监听器计时 + monitorTimerType = .Playing + isMonitorActivity = true + monitorTimer!.resume() + //发送开启监听通知 + NotificationCenter.notificationKey.post(notificationName: .open_monitor) + print("The monitor has open.") + } catch let error { + print("Monitor initialization failure:\(error.localizedDescription)") + } + } + ///终止监听器运行 + func stopMonitor() { + guard let timer = monitorTimer, let monitor = monitor else { return } + //停止并销毁计时器和监听器 + if monitorTimerType == .Suspend { + timer.resume() + } + timer.cancel() + self.monitorTimer = nil + monitorTimerType = .UnActivity + isMonitorActivity = false + monitor.stop() + self.monitor = nil + //发送关闭监听通知 + NotificationCenter.notificationKey.post(notificationName: .stop_monitor) + print("The monitor has stoped") + + } + //检测麦克风音量 + private func checkDecibels() -> Double{ + // 刷新音量数据 + monitor!.updateMeters() + let power = monitor!.peakPower(forChannel: 0) + //获取分贝 基本在0-1之间 可能超过1 + let decibels:Double = pow(Double(10), Double(0.05*power)) + print("Current decibels: \(decibels)") + return decibels + } +} + diff --git a/MusicPlayer/MP/Common/Tool(工具封装)/MPNetWorkManager.swift b/MusicPlayer/MP/Common/Tool(工具封装)/MPNetWorkManager.swift new file mode 100644 index 0000000..bf6ef76 --- /dev/null +++ b/MusicPlayer/MP/Common/Tool(工具封装)/MPNetWorkManager.swift @@ -0,0 +1,57 @@ +// +// MPNetWorkManager.swift +// MusicPlayer +// +// Created by Mr.Zhou on 2024/4/11. +// + +import UIKit +import Network +///网络状况管理器 +class MPNetWorkManager: NSObject { + //单例工具 + static let shared = MPNetWorkManager() + //私有初始化 + private override init() { + super.init() + } + ///检查网络状况 + func requestNetworkPermission(oberve:UIViewController, completeHanlder:ActionBlock?) { + let monitor = NWPathMonitor() + monitor.pathUpdateHandler = { path in + switch path.status { + case .satisfied: + DispatchQueue.main.async { + guard completeHanlder != nil else { + return + } + completeHanlder!() + } + default://网络权限出现问题 + DispatchQueue.main.async { + //次要处理 + let alertController = UIAlertController(title: "Access network request", message: "”Musicoo“ needs to be loaded via a network request. Please click “Settings” to allow this application to gain access to the network.", preferredStyle: .alert) + let CancelAction = UIAlertAction(title:"Cancel", style: .cancel) { (Cancel) in + + } + let OKAction = UIAlertAction(title: "Settings", style: .default) { (action) in + let url = URL(string: UIApplication.openSettingsURLString) + if let url = url,UIApplication.shared.canOpenURL(url){ + if #available(iOS 10, *) { + UIApplication.shared.open(url, options: [:]) { (success) in + } + }else{ + UIApplication.shared.canOpenURL(url) + } + } + } + alertController.addAction(CancelAction) + alertController.addAction(OKAction) + oberve.present(alertController, animated: true, completion: nil) + } + } + } + let queue = DispatchQueue(label: "MPNetWorkManager") + monitor.start(queue: queue) + } +} diff --git a/MusicPlayer/MP/Common/Tool(工具封装)/MPTableManager.swift b/MusicPlayer/MP/Common/Tool(工具封装)/MPTableManager.swift new file mode 100644 index 0000000..4bb4649 --- /dev/null +++ b/MusicPlayer/MP/Common/Tool(工具封装)/MPTableManager.swift @@ -0,0 +1,100 @@ +// +// MPTableManager.swift +// MusicPlayer +// +// Created by Mr.Zhou on 2024/4/7. +// + +import UIKit +///tableViewCell配置闭包(index-索引路径,tableView-当前表格,在VC中实现cell实体) +typealias TableViewCellConfigureBlock = (_ index:IndexPath, _ tableView:UITableView) -> UITableViewCell +///tableViewCell点击闭包(index-索引路径,tableView-当前表格,在VC中实现点击方法) +typealias TableViewCellDidSelectBlock = (_ index:IndexPath, _ tableView:UITableView) -> Void +///tableView通用控制器 +class MPTableManager:NSObject { + ///包含组行的数据组 + private var sectionAndItems:[[Any]]? + ///cell注册id组(与数据组组数相同) + private var cellIdentifiers:[String]? + //配置闭包 + private var configureCellBlock:TableViewCellConfigureBlock! + //选中闭包 + private var didSelectBlock:TableViewCellDidSelectBlock? + + /// 自定义UITableView控制器初始化方法 + /// - Parameters: + /// - sectionItems: 包含组行的二维数组数据 + /// - cellIdentifier: cell注册ID组(与sectionItems中的组数相同) + /// - configureCellBlock: cell配置闭包 + /// - didSelectBlock: cell点击事件闭包 + init(_ sectionItems: [[Any]]?, cellIdentifiers: [String]?, configureCellBlock: TableViewCellConfigureBlock?, didSelectBlock: TableViewCellDidSelectBlock?) { + super.init() + self.sectionAndItems = sectionItems + self.cellIdentifiers = cellIdentifiers + self.configureCellBlock = configureCellBlock + self.didSelectBlock = didSelectBlock + } + //获取索引指定的数据 + private func item(_ indexPath: IndexPath) -> Any? { + if let items = sectionAndItems?[indexPath.section] { + return items[indexPath.row] + }else { + return nil + } + } + //为tableView注册delegate,datasource,以及cell,自适应高度 + func handleTableViewDataSourceAndDelegate(_ tableView: UITableView?, rowHeight:CGFloat = 0) { + guard let table = tableView else { + print("TableView is null") + return + } + table.dataSource = self + table.delegate = self + table.rowHeight = rowHeight != 0 ? rowHeight:UITableView.automaticDimension + table.estimatedRowHeight = 200 + guard cellIdentifiers != nil else { + return + } + cellIdentifiers!.forEach { item in + //判断未注册 + guard table.dequeueReusableCell(withIdentifier: item) == nil else { return } + //判断是否存在nib文件 + if let _ = Bundle.main.path(forResource: item, ofType: "nib") { + //nib注册 + table.register(.init(nibName: item, bundle: nil), forCellReuseIdentifier: item) + }else { + //cell注册 + table.register(item.classFromString().self, forCellReuseIdentifier: item) + } + } + } +} +//MARK: - tableView的实现 +extension MPTableManager:UITableViewDataSource, UITableViewDelegate { + //返回组 + func numberOfSections(in tableView: UITableView) -> Int { + guard sectionAndItems != nil else { + return 0 + } + return sectionAndItems!.count + } + //返回行 + func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { + guard let items = sectionAndItems?[section] else { + return 0 + } + return items.count + } + //实现cell + func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { + let cell = configureCellBlock(indexPath, tableView) + return cell + } + //点击事件 + func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { + guard didSelectBlock != nil else { + return + } + didSelectBlock!(indexPath, tableView) + } +} diff --git a/MusicPlayer/MP/Common/Tool(工具封装)/MPVolumeManager.swift b/MusicPlayer/MP/Common/Tool(工具封装)/MPVolumeManager.swift new file mode 100644 index 0000000..2dca603 --- /dev/null +++ b/MusicPlayer/MP/Common/Tool(工具封装)/MPVolumeManager.swift @@ -0,0 +1,81 @@ +// +// MPVolumeManager.swift +// MusicPlayer +// +// Created by Mr.Zhou on 2024/3/29. +// + +import Foundation +import UIKit +import MediaPlayer +import AVFoundation +///音量控制器(获取修改系统音量) +class MPVolumeManager:NSObject { + static let shared = MPVolumeManager() + //系统音量控制View + private var volumeView:MPVolumeView? + //自定义渐变色Slider + private var systemVolumeSlider: UISlider? + private override init() { + super.init() + //为音频会话添加KVO监听 + AVAudioSession.sharedInstance().addObserver(self, forKeyPath: "outputVolume", options: [.old, .new], context: nil) + } + deinit { + //移除所有监听 + AVAudioSession.sharedInstance().removeObserver(self, forKeyPath: "outputVolume") + } + //重新持有系统volum控制器 + func createVolume() { + volumeView = .init() + // 添加音量视图到界面,但隐藏它 + volumeView!.frame = CGRect(x: -100, y: -100, width: 0, height: 0) + UIApplication.shared.windows.first?.addSubview(volumeView!) + // 查找系统音量滑块 + for view in volumeView!.subviews { + if let slider = view as? UISlider { + systemVolumeSlider = slider + break + } + } + } + //销毁系统volum控制器 + func destroyVolume() { + guard volumeView != nil else { + return + } + volumeView!.removeFromSuperview() + systemVolumeSlider = nil + volumeView = nil + } + //设置系统音量 + func setVolume(_ volume: Float) { + systemVolumeSlider?.setValue(volume, animated: false) + } + //获取系统音量 + func getVolume() -> Float { + //获取AVAudioSession + getSystemVolume() + } + //获取系统音量 + private func getSystemVolume() -> Float{ + let audioSession = AVAudioSession.sharedInstance() + do { + try audioSession.setActive(true) + return audioSession.outputVolume + } catch { + print("Error getting system volume: \(error.localizedDescription)") + return 0.0 + } + } + //KVO + override func observeValue(forKeyPath keyPath: String?, of object: Any?, change: [NSKeyValueChangeKey : Any]?, context: UnsafeMutableRawPointer?) { + if keyPath == "outputVolume" { + if let volume = change?[.newKey] as? Float { + + //将获得volume值通知传出 + NotificationCenter.notificationKey.post(notificationName: .volume_change, object: volume) + } + } + } +} diff --git a/MusicPlayer/MusicPlayer.xcdatamodeld/.xccurrentversion b/MusicPlayer/MP/Models/DataBase/MusicPlayer.xcdatamodeld/.xccurrentversion similarity index 100% rename from MusicPlayer/MusicPlayer.xcdatamodeld/.xccurrentversion rename to MusicPlayer/MP/Models/DataBase/MusicPlayer.xcdatamodeld/.xccurrentversion diff --git a/MusicPlayer/MP/Models/DataBase/MusicPlayer.xcdatamodeld/MusicPlayer.xcdatamodel/contents b/MusicPlayer/MP/Models/DataBase/MusicPlayer.xcdatamodeld/MusicPlayer.xcdatamodel/contents new file mode 100644 index 0000000..91b9118 --- /dev/null +++ b/MusicPlayer/MP/Models/DataBase/MusicPlayer.xcdatamodeld/MusicPlayer.xcdatamodel/contents @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/MusicPlayer/MP/Models/Load/LoadDataMusic.swift b/MusicPlayer/MP/Models/Load/LoadDataMusic.swift new file mode 100644 index 0000000..742c0dc --- /dev/null +++ b/MusicPlayer/MP/Models/Load/LoadDataMusic.swift @@ -0,0 +1,107 @@ +// +// LoadDataMusic.swift +// MusicPlayer +// +// Created by Mr.Zhou on 2024/4/1. +// + +import UIKit +///音乐数据集合控制器 +class LoadDataMusic: NSObject { + static let shared = LoadDataMusic() + ///全部音乐资源 + var alllistMusics:[MusicViewModel] = [] + ///用户上传资源 + var userlistMusics:[MusicViewModel] = [] + ///本地全部资源 + var locallistMusics:[MusicViewModel] = [] + ///首页展示-第0层(本地三条加一条用户最后播放数据) + var homeZeroMusics:[MusicViewModel] = [] + ///首页展示-第1层(本地数据,ablum为1) + var homeFirstMusics:[MusicViewModel] = [] + ///首页展示-第2层(本地数据,ablum为2) + var homeSecondMusics:[MusicViewModel] = [] + ///首页展示-第3层(本地数据,ablum为3) + var homeThirdMusics:[[MusicViewModel]] = [] + private override init() { + super.init() + if (UserDefaults.standard.bool(forKey: "FirstBulid")) == false { + //配置本地数据 + plistDatatoModel() + UserDefaults.standard.set(true, forKey: "FirstBulid") + print("Create data successfully") + } + } + + /// 数据配置 + /// - Parameter complete: 当模型组配置完成后执行该事件 + public func reloadListData() { + //清空各项数组内容 + alllistMusics = [] + userlistMusics = [] + locallistMusics = [] + homeZeroMusics = [] + homeFirstMusics = [] + homeSecondMusics = [] + homeThirdMusics = [] + //重新装填数据 + let all = MusicModel.fetchAll() + all.forEach { item in + //筛选本地与用户上传数据 + if item.isLocal == true { + locallistMusics.append(.init(item)) + + }else { + userlistMusics.append(.init(item)) + } + //全部数据 + alllistMusics.append(.init(item)) + } + //分类展示数据 + homeFirstMusics = locallistMusics.filter{($0.type == .First)} + homeSecondMusics = locallistMusics.filter{($0.type == .Second)} + homeThirdMusics = convertToTwoArray(locallistMusics.filter{($0.type == .Third)}, raw: 3) + //取出固定内容 + homeZeroMusics.append(homeThirdMusics.last!.last!) + homeZeroMusics.append(homeSecondMusics.last!) + homeZeroMusics.append(homeFirstMusics.last!) + if userlistMusics.count != 0 { + homeZeroMusics.append(userlistMusics.last!) + } + } + //获取本地资源Plist,并转化为音乐模型数组 + private func plistDatatoModel() { + let plistPath = Bundle.main.path(forResource: "Resource", ofType: "plist")! + let dictArray = NSArray(contentsOfFile: plistPath) + dictArray?.forEach({ (item) in + let dict = item as! [String : AnyObject] + let music = MusicModel.create() + music.identifier = dict["identifier"] as? String + music.title = dict["title"] as? String + music.duration = dict["duration"] as! Double + music.cover = UIImage(named: dict["cover"] as! String)!.pngData()! + music.author = dict["author"] as? String + music.album = dict["album"] as! Int16 + music.isLocal = dict["isLocal"] as! Bool + music.path = dict["path"] as! String + music.creationTime = Date().timeZone() + }) + MusicModel.save() + } + + /// 将一维音乐数组转为二维音乐数组 + /// - Parameters: + /// - array: 原音乐数组 + /// - raw: 分割个数 + /// - Returns: 返回的二维数组 + private func convertToTwoArray(_ array:[MusicViewModel], raw:Int) -> [[MusicViewModel]] { + let twoDArray = stride(from: 0, to: array.count, by: raw).map { (index) -> [MusicViewModel] in + if (index + raw) > array.count { + return Array(array[index...]) + } else { + return Array(array[index.. (TimeInterval,UIImage,String){ + //长度 + var duration:TimeInterval = 0 + let time = asset.duration +// if #available(iOS 16, *) { +// do { +// time = try await asset.load(.duration) +// } catch { +// print("Conversion to time failed") +// } +// }else { +// time = asset.duration +// } + duration = CMTimeGetSeconds(time) + //获取第一帧 + let gen = AVAssetImageGenerator(asset: asset) + gen.appliesPreferredTrackTransform = true + //获取时间点 + let firstTime = CMTimeMakeWithSeconds(0.0, preferredTimescale: 1) + var actualTime:CMTime = CMTimeMakeWithSeconds(0, preferredTimescale: 0) + var firstImage:UIImage! + do { + //获取第一帧作为封面 + let image = try gen.copyCGImage(at: firstTime, actualTime: &actualTime) + firstImage = UIImage(cgImage: image) + } catch { + //获取失败 + print("Failed to get file the first image") + //给予初始值 + firstImage = .init(named: "End Of Days") + } + //获取地址最后一组内容作为标题 + let title:String = url.lastPathComponent + return (duration,firstImage,title) + } +} diff --git a/MusicPlayer/MP/ViewControllers/Add(新增资源)/AddViewController.xib b/MusicPlayer/MP/ViewControllers/Add(新增资源)/AddViewController.xib new file mode 100644 index 0000000..7c3e980 --- /dev/null +++ b/MusicPlayer/MP/ViewControllers/Add(新增资源)/AddViewController.xib @@ -0,0 +1,101 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/MusicPlayer/MP/ViewControllers/Base(基类-导航栏-标签栏-计时器-播放器)/BaseViewController.swift b/MusicPlayer/MP/ViewControllers/Base(基类-导航栏-标签栏-计时器-播放器)/BaseViewController.swift new file mode 100644 index 0000000..7a3248c --- /dev/null +++ b/MusicPlayer/MP/ViewControllers/Base(基类-导航栏-标签栏-计时器-播放器)/BaseViewController.swift @@ -0,0 +1,45 @@ +// +// BaseViewController.swift +// MusicPlayer +// +// Created by Mr.Zhou on 2024/3/27. +// + +import UIKit +///基类页面 +class BaseViewController: UIViewController { + ///音乐文件缺失 + var nullMusicAction:ActionBlock? + override func viewDidLoad() { + super.viewDidLoad() + //背景颜色黑色 + view.backgroundColor = .init(hex: "#151718") + navigationController?.navigationBar.isTranslucent = true + tabBarController?.tabBar.isTranslucent = true + //隐藏导航栏 + navigationController?.setNavigationBarHidden(true, animated: false) + } + //音乐文件缺失 + @objc func fileMissAction(_ sender:Notification) { + DispatchQueue.main.async { + [weak self] in + //弹出删除音乐框 + let alert = UIAlertController(title: "Missing Files", message: "The current music file is missing and will remove remove the music from the catalog. If you want to continue using the music file, please re-import it!", preferredStyle: .alert) + let okAction = UIAlertAction(title: "OK", style: .destructive) { [weak self] (_) in + guard let music = MPMediaCenterManager.shared.getMusic() else { + return + } + //从表中删除当前音乐实体 + MusicModel.delete(music) + MPMediaCenterManager.shared.setMusic(nil) + //执行删除闭包 + guard self?.nullMusicAction != nil else { + return + } + self?.nullMusicAction!() + } + alert.addAction(okAction) + self?.present(alert, animated: true) + } + } +} diff --git a/MusicPlayer/MP/ViewControllers/Base(基类-导航栏-标签栏-计时器-播放器)/CountTimerViewController.swift b/MusicPlayer/MP/ViewControllers/Base(基类-导航栏-标签栏-计时器-播放器)/CountTimerViewController.swift new file mode 100644 index 0000000..3ae2211 --- /dev/null +++ b/MusicPlayer/MP/ViewControllers/Base(基类-导航栏-标签栏-计时器-播放器)/CountTimerViewController.swift @@ -0,0 +1,106 @@ +// +// CountTimerViewController.swift +// MusicPlayer +// +// Created by Mr.Zhou on 2024/3/28. +// + +import UIKit + +class CountTimerViewController: UIViewController { + @IBOutlet weak var timesLabel: UILabel! + @IBOutlet weak var contentView: UIView! + //多项选择器 + private lazy var segmentedView:UISegmentedControl = { + //获取需要展示的内容 + let titles:[String] = timeLevels.map{($0.title)} + //创建一个SegmentedControl + let segmentedView:UISegmentedControl = .init(items: titles) + //设置选中Item颜色块 + if #available(iOS 13.0, *) { + segmentedView.selectedSegmentTintColor = .init(hex: "#80F988") + } else { + segmentedView.tintColor = .init(hex: "#80F988") + } + //设置分割线颜色 + segmentedView.setDividerImage(UIImage(), forLeftSegmentState: .normal, rightSegmentState: .normal, barMetrics: .default) + //设置文字颜色 + segmentedView.setTitleTextAttributes([.foregroundColor:UIColor(hex: "#FFFFFF", alpha: 0.8), .font:UIFont.systemFont(ofSize: 14, weight: .medium)], for: .normal) + segmentedView.setTitleTextAttributes([.foregroundColor:UIColor(hex: "#000000"), .font:UIFont.systemFont(ofSize: 14, weight: .heavy)], for: .selected) + //添加点击事件 + segmentedView.addTarget(self, action: #selector(switchTimesAction(_ :)), for: .valueChanged) + return segmentedView + }() + //倒计时规模组 + private lazy var timeLevels:[MPCountTimerLevel] = { + var array:[MPCountTimerLevel] = [] + for item in MPCountTimerLevel.allCases { + array.append(item) + } + return array + }() + override func viewDidLoad() { + super.viewDidLoad() + //设置圆角 + view.layer.masksToBounds = true + view.layer.maskedCorners = [.layerMinXMinYCorner, .layerMaxXMinYCorner] + view.layer.cornerRadius = 18*width + //添加多项选择器 + contentView.addSubview(segmentedView) + segmentedView.snp.makeConstraints { make in + make.width.equalTo(330*width) + make.height.equalTo(38*width) + make.center.equalToSuperview() + } + //根据当前倒计时器设置选中项 + segmentedView.selectedSegmentIndex = MPMediaCenterManager.shared.getCountTimerLevel().rawValue + } + override func viewWillAppear(_ animated: Bool) { + super.viewWillAppear(animated) + //添加通知 + NotificationCenter.notificationKey.add(observer: self, selector: #selector(timesAction(_ :)), notificationName: .time_times) + NotificationCenter.notificationKey.add(observer: self, selector: #selector(completeAction(_ :)), notificationName: .stop_music) + } + deinit { + //移除所有通知 + NotificationCenter.default.removeObserver(self) + } + //切换计时值 + @objc private func switchTimesAction(_ sender: UISegmentedControl) { + //获取切换后的倒计时规模 + let selectedIndex = sender.selectedSegmentIndex + let value = timeLevels[selectedIndex] + //判断该倒计时规模是否成立 + if value != .OFF { + guard let music = MPMediaCenterManager.shared.getMusic() else { + //没有音乐实体,取消倒计时 + print("No Data Music") + return + } + //启动倒计时器 + MPMediaCenterManager.shared.playerStart(music, actionType: .CountTime, countLevel: value) + }else { + //停止倒计时,数值归0 + MPMediaCenterManager.shared.playerStop() + } + } + + + //计时值变化事件 + @objc private func timesAction(_ sender:Notification) { + DispatchQueue.main.async { + [weak self] in + guard let self = self else { return } + let time = sender.object as! TimeInterval + timesLabel.text = "Count down "+setTimesToMinSeconds(time) + } + } + //计时结束事件 + @objc private func completeAction(_ sender:Notification) { + DispatchQueue.main.async { + [weak self] in + guard let self = self else { return } + timesLabel.text = "Timing off" + } + } +} diff --git a/MusicPlayer/MP/ViewControllers/Base(基类-导航栏-标签栏-计时器-播放器)/CountTimerViewController.xib b/MusicPlayer/MP/ViewControllers/Base(基类-导航栏-标签栏-计时器-播放器)/CountTimerViewController.xib new file mode 100644 index 0000000..5b280ba --- /dev/null +++ b/MusicPlayer/MP/ViewControllers/Base(基类-导航栏-标签栏-计时器-播放器)/CountTimerViewController.xib @@ -0,0 +1,102 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/MusicPlayer/MP/ViewControllers/Base(基类-导航栏-标签栏-计时器-播放器)/MPNavigationController.swift b/MusicPlayer/MP/ViewControllers/Base(基类-导航栏-标签栏-计时器-播放器)/MPNavigationController.swift new file mode 100644 index 0000000..c0b8c56 --- /dev/null +++ b/MusicPlayer/MP/ViewControllers/Base(基类-导航栏-标签栏-计时器-播放器)/MPNavigationController.swift @@ -0,0 +1,73 @@ +// +// MPNavigationController.swift +// MusicPlayer +// +// Created by Mr.Zhou on 2024/3/27. +// + +import UIKit +///通用导航栏 +class MPNavigationController: UINavigationController { + override init(rootViewController: UIViewController) { + super.init(rootViewController: rootViewController) + if #available(iOS 15, *) { + let navBar = UINavigationBarAppearance() + navBar.titleTextAttributes = [NSAttributedString.Key.foregroundColor:UIColor.white, NSAttributedString.Key.font : UIFont.systemFont(ofSize: 20, weight: .heavy)] + navBar.backgroundEffect = nil + navBar.shadowColor = nil + //消除导航栏分割线 + navBar.configureWithTransparentBackground() + navBar.backgroundColor = .clear + rootViewController.navigationController?.navigationBar.scrollEdgeAppearance = navBar + rootViewController.navigationController?.navigationBar.standardAppearance = navBar + } + rootViewController.navigationController?.navigationBar.isTranslucent = false + rootViewController.navigationController?.navigationBar.shadowImage = UIImage() + //自定义导航栏颜色 + rootViewController.navigationController?.navigationBar.barTintColor = .clear + //设置导航栏标题颜色 + rootViewController.navigationController?.navigationBar.titleTextAttributes = [NSAttributedString.Key.foregroundColor:UIColor.white, NSAttributedString.Key.font : UIFont.systemFont(ofSize: 20, weight: .heavy)] + rootViewController.navigationController?.navigationBar.tintColor = .white + let item = UIBarButtonItem(title: "", style: .plain, target: self, action: nil) + item.tintColor = .white + rootViewController.navigationItem.backBarButtonItem = item + } + required init?(coder aDecoder: NSCoder) { + fatalError("init(coder:) has not been implemented") + } + override init(nibName nibNameorNil:String?,bundle nibBundleOrNil:Bundle?){ + super.init(nibName:nibNameorNil,bundle:nibBundleOrNil) + } + //重写pushViewController + //每一次push都会执行这个方法,push之前设置viewController的hidesBottomBarWhenPushed + override func pushViewController(_ viewController: UIViewController, animated: Bool) { + viewController.hidesBottomBarWhenPushed = true + NotificationCenter.notificationKey.post(notificationName: .hidden_show) + super.pushViewController(viewController, animated: true) + viewController.hidesBottomBarWhenPushed = false + } + //重写popViewController + //每一次对viewController进行push的时候,会把viewController放入一个栈中 + //每一次对viewController进行pop的时候,会把viewController从栈中移除 + override func popViewController(animated: Bool) -> UIViewController? { + guard self.children.count != 1 else { + //特殊情况,当用户连续触发pop事件时进行容错处理 + return super.popViewController(animated: true) + } + guard self.children.count == 2 else { + //如果viewController栈中存在的ViewController的个数超过两个,对要返回到的上一级的界面设置hidesBottomBarWhenPushed = true + //把tabbar进行隐藏 + let count = self.children.count-2 + let controller = self.children[count] + controller.hidesBottomBarWhenPushed = true + NotificationCenter.notificationKey.post(notificationName: .hidden_show) + return super.popViewController(animated: true) + } + //如果viewController栈中存在的ViewController的个数为两个,再返回上一级界面就是根界面了 + //那么要对tabbar进行显示 + let controller:UIViewController = self.children[0] + controller.hidesBottomBarWhenPushed = false + NotificationCenter.notificationKey.post(notificationName: .display_show) + return super.popViewController(animated: true) + } +} diff --git a/MusicPlayer/MP/ViewControllers/Base(基类-导航栏-标签栏-计时器-播放器)/MPPresentationController.swift b/MusicPlayer/MP/ViewControllers/Base(基类-导航栏-标签栏-计时器-播放器)/MPPresentationController.swift new file mode 100644 index 0000000..7790a81 --- /dev/null +++ b/MusicPlayer/MP/ViewControllers/Base(基类-导航栏-标签栏-计时器-播放器)/MPPresentationController.swift @@ -0,0 +1,73 @@ +// +// MPPresentationController.swift +// MusicPlayer +// +// Created by Mr.Zhou on 2024/3/27. +// + +import UIKit +///自定义模态弹出类型 +enum MPPresentModal{ + ///倒计时选择框 + case Timer + ///新增选项框 + case Choice + ///重命名 + case Rename + ///删除 + case Delete +} + +///自定义模态弹出控制器 +class MPPresentationController: UIPresentationController { + //蒙板 + fileprivate lazy var maskView: UIView = { + let corverView = UIView() + return corverView + }() + // MARK: - 系统回调(重载) + override func containerViewWillLayoutSubviews() { + super.containerViewWillLayoutSubviews() + //根据模态状态确定弹出控制器的布局 + switch MPModalType { + case .Timer: + presentedView?.snp.makeConstraints({ (make) in + make.left.right.bottom.equalToSuperview() + make.height.equalTo(180*width) + }) + case .Choice: + presentedView?.snp.makeConstraints({ (make) in + make.bottom.left.right.equalToSuperview() + make.height.equalTo(165*width) + }) + case .Rename: + presentedView?.snp.makeConstraints({ (make) in + make.center.equalToSuperview() + make.width.equalTo(270*width) + make.height.equalTo(178*width) + }) + case .Delete: + presentedView?.snp.makeConstraints({ (make) in + make.center.equalToSuperview() + make.width.equalTo(270*width) + make.height.equalTo(122*width) + }) + } + //添加蒙版 + setMask() + } + // 添加蒙版 + fileprivate func setMask() -> Void { + // 添加蒙版 + containerView?.insertSubview(maskView, at: 0) + //设置蒙版的属性 + maskView.backgroundColor = UIColor(white: 0.0, alpha: 0.8) + maskView.frame = containerView!.bounds + let tap = UITapGestureRecognizer(target: self, action: #selector(maskClick(_:))) + maskView.addGestureRecognizer(tap) + } + //蒙板点击事件 + @objc fileprivate func maskClick(_ sender:UITapGestureRecognizer){ + presentedViewController.dismiss(animated: true, completion: nil) + } +} diff --git a/MusicPlayer/MP/ViewControllers/Base(基类-导航栏-标签栏-计时器-播放器)/MPTabBarController.swift b/MusicPlayer/MP/ViewControllers/Base(基类-导航栏-标签栏-计时器-播放器)/MPTabBarController.swift new file mode 100644 index 0000000..d15c4c1 --- /dev/null +++ b/MusicPlayer/MP/ViewControllers/Base(基类-导航栏-标签栏-计时器-播放器)/MPTabBarController.swift @@ -0,0 +1,246 @@ +// +// MPTabBarController.swift +// MusicPlayer +// +// Created by Mr.Zhou on 2024/3/27. +// + +import UIKit +///通用标签栏 +class MPTabBarController: UITabBarController { + //自定义tabBar + private lazy var customTabBar:MPCustomTabBar = .init(frame: .init(x: 0, y: 0, width: screen_Width, height: 72*width)) + //底部音乐展示View(默认隐藏) + private lazy var bottomView:MPBottomShowView = .instanceFromNib() + //底部bottomShowView的展示状态 + private var isbottomShow:Bool = false{ + willSet{ + if isbottomShow != newValue { + switch_bottomShow(newValue) + } + //填充音乐数据 + if newValue == true { + guard let music = MPMediaCenterManager.shared.getMusic() else { + print("No Data Music") + return + } + bottomView.coverImageView.image = UIImage(data: music.cover) + bottomView.titleLabel.text = music.title + bottomView.subtitleLabel.text = setTimesToMinSeconds(music.duration) + } + } + } + override func viewDidLoad() { + super.viewDidLoad() + tabBar.isHidden = true + self.setValue(customTabBar, forKey: "tabBar") + //创建标签子控制器 + let homeVC = MPNavigationController(rootViewController: HomeViewController()) + let centerVC = MPNavigationController(rootViewController: CenterViewController()) + //添加子控制器 + viewControllers = [homeVC,centerVC] + //禁止系统tabBaritem触发 + tabBar.items?.forEach({ item in + item.isEnabled = false + }) + tabBar.barTintColor = .clear + UITabBar.appearance().backgroundColor = .clear + tabBar.shadowImage = UIImage() + // tabBar.shadowImage = image(UIColor.red) // 修改线条颜色 + tabBar.backgroundImage = UIImage() + + view.addSubview(bottomView) + //将展示View设置在主窗口下方之外,避免用户察觉 + bottomView.snp.makeConstraints { make in + make.centerX.equalToSuperview() + make.bottom.equalToSuperview().offset(82*width) + make.width.equalTo(351*width) + make.height.equalTo(82*width) + } + //实现展示View的事件闭包 + //倒计时 + bottomView.modalTimerBlock = { + [weak self] in + self?.modalTimer() + } + //切换播放器状态 + bottomView.switchPlayerBlock = { + [weak self] in + self?.switchState() + } + //前往播放器 + bottomView.pushPlayerBlock = { + [weak self] in + self?.pushPlayer() + } + //在页面展示前,获取播放器是否存在历史播放(最后一次播放),并视情况展示View + isbottomShow = MPMediaCenterManager.shared.getMusic() != nil + //监听通知 + NotificationCenter.notificationKey.add(observer: self, selector: #selector(switchAction(_:)), notificationName: .switch_tabBarItem) + NotificationCenter.notificationKey.add(observer: self, selector: #selector(timesAction(_ :)), notificationName: .time_times) + NotificationCenter.notificationKey.add(observer: self, selector: #selector(playMusicAction(_ :)), notificationName: .play_music) + NotificationCenter.notificationKey.add(observer: self, selector: #selector(pauseMusicAction(_ :)), notificationName: .pause_music) + NotificationCenter.notificationKey.add(observer: self, selector: #selector(resumeMusicAction(_ :)), notificationName: .resume_music) + NotificationCenter.notificationKey.add(observer: self, selector: #selector(stopMusicAction(_ :)), notificationName: .stop_music) + NotificationCenter.notificationKey.add(observer: self, selector: #selector(closeBottonViewAction(_ :)), notificationName: .close_show) + NotificationCenter.notificationKey.add(observer: self, selector: #selector(displayBottomViewAction(_ :)), notificationName: .display_show) + NotificationCenter.notificationKey.add(observer: self, selector: #selector(hiddenBottomViewAction(_ :)), notificationName: .hidden_show) + NotificationCenter.notificationKey.add(observer: self, selector: #selector(renameMusicAction(_ :)), notificationName: .rename_music) + } + override func viewWillAppear(_ animated: Bool) { + super.viewWillAppear(animated) + } + override func viewWillDisappear(_ animated: Bool) { + super.viewWillDisappear(animated) + + } + deinit { + //移除所有监听 + NotificationCenter.default.removeObserver(self) + } + override func viewWillLayoutSubviews() { + super.viewWillLayoutSubviews() + //将展示View设置到最上层 + view.bringSubviewToFront(bottomView) + } + //底部BottomView的切换动画 + private func switch_bottomShow(_ state:Bool) { + UIView.animate(withDuration: 0.3) { + [weak self] in + guard let self = self else { return } + if state { + //向上展示 + bottomView.transform = .init(translationX: 0, y: -139*width) + }else { + //向下隐藏 + bottomView.transform = .identity + } + } + } +} +//MARK: - 事件处理 +extension MPTabBarController: UIViewControllerTransitioningDelegate { + //切换事件 + @objc private func switchAction(_ sender:Notification) { + let tag = sender.object as! Int + selectedIndex = tag + } + //弹出计时器 + private func modalTimer() { + MPModalType = .Timer + let timerVC = CountTimerViewController() + timerVC.transitioningDelegate = self + timerVC.modalPresentationStyle = .custom + present(timerVC, animated: true) + } + //切换播放器状态 + private func switchState() { + guard let music = MPMediaCenterManager.shared.getMusic() else { + //播放器未能持有音乐实体 + print("No Data Music") + return + } + switch MPMediaCenterManager.shared.getPlayerState() { + case .Null://启动播放 + MPMediaCenterManager.shared.playerStart(music, actionType: .Normal) + case .Playing://暂停播放 + MPMediaCenterManager.shared.playerPause() + case .Pause://继续播放 + MPMediaCenterManager.shared.playerResume() + } + } + //前往播放器 + private func pushPlayer() { + print("Go to player") + //模态弹出 + let playerVC = PlayerViewController() + present(playerVC, animated: true) + } + func presentationController(forPresented presented: UIViewController, presenting: UIViewController?, source: UIViewController) -> UIPresentationController? { + return MPPresentationController(presentedViewController: presented, presenting: presenting) + } +} +//MARK: - 监听触发 +extension MPTabBarController { + //计时值变化事件 + @objc private func timesAction(_ sender:Notification) { + DispatchQueue.main.async { + [weak self] in + guard let self = self else { return } + //隐藏按钮,展示View + bottomView.timerBtn.isHidden = true + bottomView.timerView.isHidden = false + let time = sender.object as! TimeInterval + bottomView.timerLabel.text = setTimesToMinSeconds(time) + } + } + + //启动音乐播放器 + @objc private func playMusicAction(_ sender:Notification) { + DispatchQueue.main.async { + [weak self] in + guard let self = self else { return } + isbottomShow = true + bottomView.stateBtn.isSelected = true + } + } + //暂停音乐播放器 + @objc private func pauseMusicAction(_ sender:Notification) { + DispatchQueue.main.async { + [weak self] in + guard let self = self else { return } + bottomView.stateBtn.isSelected = false + } + } + //继续音乐播放器 + @objc private func resumeMusicAction(_ sender:Notification) { + DispatchQueue.main.async { + [weak self] in + guard let self = self else { return } + bottomView.stateBtn.isSelected = true + } + } + //终止音乐播放器 + @objc private func stopMusicAction(_ sender:Notification) { + DispatchQueue.main.async { + [weak self] in + guard let self = self else { return } + bottomView.stateBtn.isSelected = false + bottomView.timerLabel.text = "Time" + //展示按钮,隐藏View + bottomView.timerBtn.isHidden = false + bottomView.timerView.isHidden = true + } + } + //播放音乐被删除 + @objc private func closeBottonViewAction(_ sender:Notification) { + DispatchQueue.main.async { + [weak self] in + guard let self = self else { return } + isbottomShow = false + } + } + //展示音乐播放框(ishidden调整) + @objc private func displayBottomViewAction(_ sender:Notification) { + DispatchQueue.main.async { + [weak self] in + guard let self = self else { return } + bottomView.isHidden = false + } + } + //隐藏音乐播放框(ishidden调整) + @objc private func hiddenBottomViewAction(_ sender:Notification) { + DispatchQueue.main.async { + [weak self] in + guard let self = self else { return } + bottomView.isHidden = true + } + } + @objc private func renameMusicAction(_ sender:Notification) { + DispatchQueue.main.async { + [weak self] in + guard let self = self else { return } + isbottomShow = isbottomShow + } + } +} diff --git a/MusicPlayer/MP/ViewControllers/Base(基类-导航栏-标签栏-计时器-播放器)/PlayerViewController.swift b/MusicPlayer/MP/ViewControllers/Base(基类-导航栏-标签栏-计时器-播放器)/PlayerViewController.swift new file mode 100644 index 0000000..315d1f9 --- /dev/null +++ b/MusicPlayer/MP/ViewControllers/Base(基类-导航栏-标签栏-计时器-播放器)/PlayerViewController.swift @@ -0,0 +1,403 @@ +// +// PlayerViewController.swift +// MusicPlayer +// +// Created by Mr.Zhou on 2024/3/28. +// + +import UIKit +///播放器显示状态 +enum PlayerState { + case Dark + case Light + ///对应的按钮背景色 + var buttonBGColor:UIColor{ + switch self { + case .Dark: + return .init(hex: "#FFFFFF", alpha: 0.15) + case .Light: + return .init(hex: "#F2F2F2") + } + } + ///页面背景色 + var viewBGColor:UIColor{ + switch self { + case .Dark: + return .init(hex: "#000000") + case .Light: + return .init(hex: "#FFFFFF") + } + } + ///文本字体颜色 + var textColor:UIColor{ + switch self { + case .Dark: + return .init(hex: "#FFFFFF") + case .Light: + return .init(hex: "#000000") + } + } + ///滑块图片 + var thumbImage:UIImage{ + switch self { + case .Dark: + return UIImage(named: "Thumb dark'logo")! + case .Light: + return UIImage(named: "Thumb light'logo")! + } + } + ///滑轨颜色集合 + var minTrackColors:[UIColor]{ + switch self { + case .Dark: + return [UIColor(hex: "#FFFFFF", alpha: 0.3), UIColor(hex: "#FFFFFF", alpha: 0.3)] + case .Light: + return [UIColor(hex: "#80F988", alpha: 0.2), UIColor(hex: "#80F988", alpha: 0.2)] + } + } + ///毛玻璃效果 + var effctView:UIBlurEffect{ + switch self { + case .Dark: + if #available(iOS 13.0, *) { + return UIBlurEffect(style: .systemThickMaterialDark) + } else { + return UIBlurEffect(style: .dark) + } + case .Light: + return UIBlurEffect(style: .light) + } + } +} +///播放器页面 +@objcMembers class PlayerViewController: BaseViewController { + @IBOutlet weak var disMissBtn: UIButton! + @IBOutlet weak var titleLabel: UILabel! + @IBOutlet weak var effectView: UIVisualEffectView! + @IBOutlet weak var backImageView: UIImageView! + @IBOutlet weak var coverImageView: UIImageView! + @IBOutlet weak var nameLabel: UILabel! + @IBOutlet weak var slider: Player_Slider!{ + didSet{ + slider.thumbImage = state.thumbImage + slider.trackHeight = 10*width + slider.minTrackColors = state.minTrackColors + slider.minTrackLocations = [0.0,1.0] + slider.maxTrackColors = state.minTrackColors + slider.maxTrackLocations = [0.0,1.0] + slider.setNeedsDisplay() + } + } + @IBOutlet weak var volumeLabel: UILabel! + @IBOutlet weak var lampView: PlayerActionView!{ + didSet{ + lampView.darkImage = UIImage(named: "Lamp dark'logo") + lampView.lightImage = UIImage(named: "Lamp light'logo") + lampView.isDark = true + lampView.isPlaying = false + lampView.addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(lampActionClick(_ :)))) + } + } + @IBOutlet weak var timerView: PlayerActionView!{ + didSet{ + timerView.darkImage = UIImage(named: "Timer dark'logo") + timerView.lightImage = UIImage(named: "Timer light'logo") + timerView.playingImage = UIImage(named: "Timer playing'logo") + timerView.isDark = true + timerView.isPlaying = false + timerView.addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(timerActionClick(_ :)))) + } + } + @IBOutlet weak var timerLabel: UILabel! + @IBOutlet weak var autoView: PlayerActionView!{ + didSet{ + autoView.darkImage = UIImage(named: "Auto dark'logo") + autoView.lightImage = UIImage(named: "Auto light'logo") + autoView.playingImage = UIImage(named: "Auto playing'logo") + autoView.isDark = true + autoView.isPlaying = false + autoView.addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(autoActionClick(_ :)))) + } + } + @IBOutlet weak var playBtn: UIButton! + @IBOutlet weak var maskView: UIImageView! + //图片旋转计时器 + private var timer:CADisplayLink! + //播放器页面显示状态,默认为黑夜(切换后对于页面内容作出改变) + private lazy var state:PlayerState = .Dark{ + didSet{ + setUpState(state) + } + } + //当前系统音量 + private lazy var volume:Float = 0{ + didSet{ + //更新label值 + volumeLabel.text = String(format: "Volume:%.2f", volume*100) + //调整slider + let value = volume + slider.value = value + } + } + //指定自动播放需要的分贝值 + private lazy var decibels:Float = 0.5 + override func viewDidLoad() { + super.viewDidLoad() + view.backgroundColor = state.viewBGColor + playBtn.isSelected = MPMediaCenterManager.shared.getPlayerState() == .Playing + //启动音量绑定 + MPVolumeManager.shared.createVolume() + //设置音量 + volume = MPVolumeManager.shared.getVolume() + if let music = MPMediaCenterManager.shared.getMusic() { + //设置音乐展示 + nameLabel.text = music.title + coverImageView.image = UIImage(data: music.cover) + backImageView.image = UIImage(data: music.cover) + } + lampView.backgroundColor = state.buttonBGColor + timerView.backgroundColor = state.buttonBGColor + autoView.backgroundColor = state.buttonBGColor + + //触发音乐缺失闭包 + nullMusicAction = { + [weak self] in + //退出该页面 + self?.navigationController?.popViewController(animated: true) + } + //初始化计时器 + timer = CADisplayLink(target: self, selector: #selector(coverRotationalAction(_ :))) + //一秒执行多少次 + timer.preferredFramesPerSecond = 20 + //开辟线程 + timer.add(to: RunLoop.current, forMode: .common) + timer.isPaused = true + addNotification() + } + override func viewWillAppear(_ animated: Bool) { + super.viewWillAppear(animated) + //根据播放器状态设置计时器状态 + timer.isPaused = !(MPMediaCenterManager.shared.getPlayerState() == .Playing) + } + override func viewWillDisappear(_ animated: Bool) { + super.viewWillDisappear(animated) + //停止监听器 + MPMediaCenterManager.shared.stopMonitor() + } + deinit { + //移除所有通知 + NotificationCenter.default.removeObserver(self) + //销毁音量绑定 + MPVolumeManager.shared.destroyVolume() + //销毁帧计时器 + timer = nil + } + //添加通知与监听 + private func addNotification() { + //添加通知 + NotificationCenter.notificationKey.add(observer: self, selector: #selector(timesAction(_ :)), notificationName: .time_times) + NotificationCenter.notificationKey.add(observer: self, selector: #selector(volumeChangeAction(_ :)), notificationName: .volume_change) + NotificationCenter.notificationKey.add(observer: self, selector: #selector(playMusicAction(_ :)), notificationName: .play_music) + NotificationCenter.notificationKey.add(observer: self, selector: #selector(pauseMusicAction(_ :)), notificationName: .pause_music) + NotificationCenter.notificationKey.add(observer: self, selector: #selector(resumeMusicAction(_ :)), notificationName: .resume_music) + NotificationCenter.notificationKey.add(observer: self, selector: #selector(stopMusicAction(_ :)), notificationName: .stop_music) + NotificationCenter.notificationKey.add(observer: self, selector: #selector(fileMissAction(_ :)), notificationName: .null_music) + NotificationCenter.notificationKey.add(observer: self, selector: #selector(openMonitorAction(_ :)), notificationName: .open_monitor) + NotificationCenter.notificationKey.add(observer: self, selector: #selector(stopMonitorAction(_ :)), notificationName: .stop_monitor) + } +} +//MARK: - 交互事件 +extension PlayerViewController { + //退出事件 + @IBAction func disMissAction(_ sender: UIButton) { + dismiss(animated: true) + } + //手动调整音量 + @IBAction func sliderVolumeAction(_ sender: Player_Slider) { + let value = sender.value + MPVolumeManager.shared.setVolume(value) + } + //切换页面显示状态 + @objc private func lampActionClick(_ sender: PlayerActionView) { + if state == .Dark { + state = .Light + }else { + state = .Dark + } + } + //设置倒计时 + @objc private func timerActionClick(_ sender: PlayerActionView) { + //关闭麦克风监听器 + MPMediaCenterManager.shared.stopMonitor() + MPModalType = .Timer + let timerVC = CountTimerViewController() + timerVC.transitioningDelegate = self + timerVC.modalPresentationStyle = .custom + present(timerVC, animated: true) + } + //自动播放(当环境分贝超过指定值时播放) + @objc private func autoActionClick(_ sender: PlayerActionView) { + guard authorize(observe: self) == true else { + print("No Microphone Access") + return + } + if autoView.isPlaying { + //关闭麦克风监听器 + MPMediaCenterManager.shared.stopMonitor() + }else { + //启动监听器 + MPMediaCenterManager.shared.openMonitor(0.5) + } + } + //播放/暂停 + @IBAction func playClick(_ sender: UIButton) { + //关闭麦克风监听器 + MPMediaCenterManager.shared.stopMonitor() + guard let music = MPMediaCenterManager.shared.getMusic() else { + //播放器未能持有音乐实体 + print("No Data Music") + return + } + switch MPMediaCenterManager.shared.getPlayerState() { + case .Null://启动播放 + MPMediaCenterManager.shared.playerStart(music, actionType: .Normal) + case .Playing://暂停播放 + MPMediaCenterManager.shared.playerPause() + case .Pause://继续播放 + MPMediaCenterManager.shared.playerResume() + } + } +} +//MARK: - 业务处理 +extension PlayerViewController: UIViewControllerTransitioningDelegate { + //声音值切换 + @objc fileprivate func volumeChangeAction(_ sender:Notification) { + guard let value = sender.object as? Float else { + return + } + volume = value + } + //页面状态切换 + private func setUpState(_ state:PlayerState) { + view.backgroundColor = state.viewBGColor + //黑夜展示背景图,白天隐藏 + backImageView.isHidden = !(state == .Dark) + maskView.isHidden = !(state == .Dark) + titleLabel.textColor = state.textColor + //调整毛玻璃 + effectView.effect = state.effctView + nameLabel.textColor = state.textColor + slider.thumbImage = state.thumbImage + slider.minTrackColors = state.minTrackColors + slider.maxTrackColors = state.minTrackColors + slider.setNeedsDisplay() + volumeLabel.textColor = state.textColor + //更改按钮的背景色 + disMissBtn.backgroundColor = state.buttonBGColor + lampView.backgroundColor = state.buttonBGColor + timerView.backgroundColor = state.buttonBGColor + autoView.backgroundColor = state.buttonBGColor + //更改按钮的高亮 + disMissBtn.isSelected = !(state == .Dark) + lampView.isDark = (state == .Dark) + timerView.isDark = (state == .Dark) + autoView.isDark = (state == .Dark) + } + + //计时值变化事件 + @objc private func timesAction(_ sender:Notification) { + DispatchQueue.main.async { + [weak self] in + guard let self = self else { return } + let time = sender.object as! TimeInterval + timerView.isPlaying = true + timerLabel.isHidden = false + timerLabel.text = setTimesToMins(time) + } + } + //计时结束事件 + @objc private func completeAction(_ sender:Notification) { + DispatchQueue.main.async { + [weak self] in + guard let self = self else { return } + timerView.isPlaying = false + timerLabel.isHidden = true + timerLabel.text = "00" + } + } + //启动音乐播放器 + @objc private func playMusicAction(_ sender:Notification) { + DispatchQueue.main.async { + [weak self] in + guard let self = self else { return } + playBtn.isSelected = true + autoView.isPlaying = false + //旋转图片 + coverImageView.transform = .identity + timer.isPaused = false + } + } + //暂停音乐播放器 + @objc private func pauseMusicAction(_ sender:Notification) { + DispatchQueue.main.async { + [weak self] in + guard let self = self else { return } + playBtn.isSelected = false + timer.isPaused = true + } + } + //继续音乐播放器 + @objc private func resumeMusicAction(_ sender:Notification) { + DispatchQueue.main.async { + [weak self] in + guard let self = self else { return } + playBtn.isSelected = true + timer.isPaused = false + } + } + //终止音乐播放器 + @objc private func stopMusicAction(_ sender:Notification) { + DispatchQueue.main.async { + [weak self] in + guard let self = self else { return } + playBtn.isSelected = false + timerView.isPlaying = false + timerLabel.isHidden = true + timerLabel.text = "00" + timer.isPaused = true + coverImageView.transform = .identity + } + } + //开启麦克风监听器 + @objc private func openMonitorAction(_ sender:Notification) { + DispatchQueue.main.async { + [weak self] in + guard let self = self else { return } + autoView.isPlaying = true + } + } + //关闭麦克风监听器 + @objc private func stopMonitorAction(_ sender:Notification) { + DispatchQueue.main.async { + [weak self] in + guard let self = self else { return } + autoView.isPlaying = false + } + } + + //计时器事件-封面图片随着音乐播放器状态旋转自身 + @objc private func coverRotationalAction(_ link:CADisplayLink) { + //当音乐播放器启动后,使得封面图片无限旋转,当音乐播放器暂停/结束后,图片会回正 + DispatchQueue.main.async { + [weak self] in + guard let self = self else { return } + let angle = CGFloat.pi / 200 + coverImageView.transform = coverImageView.transform.rotated(by: angle) + } + + } + + func presentationController(forPresented presented: UIViewController, presenting: UIViewController?, source: UIViewController) -> UIPresentationController? { + return MPPresentationController(presentedViewController: presented, presenting: presenting) + } +} diff --git a/MusicPlayer/MP/ViewControllers/Base(基类-导航栏-标签栏-计时器-播放器)/PlayerViewController.xib b/MusicPlayer/MP/ViewControllers/Base(基类-导航栏-标签栏-计时器-播放器)/PlayerViewController.xib new file mode 100644 index 0000000..e5ba2ef --- /dev/null +++ b/MusicPlayer/MP/ViewControllers/Base(基类-导航栏-标签栏-计时器-播放器)/PlayerViewController.xib @@ -0,0 +1,409 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/MusicPlayer/MP/ViewControllers/Center(个人资源)/AboutViewController.swift b/MusicPlayer/MP/ViewControllers/Center(个人资源)/AboutViewController.swift new file mode 100644 index 0000000..1369589 --- /dev/null +++ b/MusicPlayer/MP/ViewControllers/Center(个人资源)/AboutViewController.swift @@ -0,0 +1,32 @@ +// +// AboutViewController.swift +// MusicPlayer +// +// Created by Mr.Zhou on 2024/4/10. +// + +import UIKit + +class AboutViewController: BaseViewController { + @IBOutlet weak var versionView: UIView!{ + didSet{ + let tap = UITapGestureRecognizer(target: self, action: #selector(versionClick)) + versionView.addGestureRecognizer(tap) + versionView.isUserInteractionEnabled = true + } + } + override func viewDidLoad() { + super.viewDidLoad() + + } + @objc private func versionClick(){ + let eventAlert = UIAlertController(title: "Version Update", message: "is the latest Version", preferredStyle: .alert) + let canelAction = UIAlertAction(title: "Cancel", style: .cancel,handler: nil) + eventAlert.addAction(canelAction) + self.present(eventAlert, animated: true, completion: nil) + } + @IBAction func popClick(_ sender: UIButton) { + navigationController?.popViewController(animated: true) + } + +} diff --git a/MusicPlayer/MP/ViewControllers/Center(个人资源)/AboutViewController.xib b/MusicPlayer/MP/ViewControllers/Center(个人资源)/AboutViewController.xib new file mode 100644 index 0000000..d22771e --- /dev/null +++ b/MusicPlayer/MP/ViewControllers/Center(个人资源)/AboutViewController.xib @@ -0,0 +1,169 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/MusicPlayer/MP/ViewControllers/Center(个人资源)/CenterViewController.swift b/MusicPlayer/MP/ViewControllers/Center(个人资源)/CenterViewController.swift new file mode 100644 index 0000000..2855bdc --- /dev/null +++ b/MusicPlayer/MP/ViewControllers/Center(个人资源)/CenterViewController.swift @@ -0,0 +1,194 @@ +// +// CenterViewController.swift +// MusicPlayer +// +// Created by Mr.Zhou on 2024/3/27. +// + +import UIKit +///个人中心 +class CenterViewController: BaseViewController { + @IBOutlet weak var tableView: UITableView!{ + didSet{ + if #available(iOS 15.0, *) { + tableView.sectionHeaderTopPadding = 0 + } + tableView.estimatedRowHeight = 200 + tableView.rowHeight = UITableView.automaticDimension + //扩充tableView滚动范围 + tableView.contentInset = .init(top: 27*width, left: 0, bottom: 100*width, right: 0) + tableView.dataSource = self + tableView.delegate = self + tableView.register(UINib(nibName: CenterTableViewCellID, bundle: nil), forCellReuseIdentifier: CenterTableViewCellID) + } + } + @IBOutlet weak var noticeView: UIView! + private let CenterTableViewCellID = "CenterTableViewCell" + override func viewDidLoad() { + super.viewDidLoad() + view.backgroundColor = .init(hex: "#000000") + //触发音乐缺失闭包 + nullMusicAction = { + [weak self] in + //刷新页面 + self?.reload() + } + } + override func viewWillAppear(_ animated: Bool) { + super.viewWillAppear(animated) + + NotificationCenter.notificationKey.add(observer: self, selector: #selector(successfullCreateAction), notificationName: .creat_music) + NotificationCenter.notificationKey.add(observer: self, selector: #selector(fileMissAction(_ :)), notificationName: .null_music) + reload() + } + override func viewWillDisappear(_ animated: Bool) { + super.viewWillDisappear(animated) + + NotificationCenter.default.removeObserver(self) + } + //刷新数据源 + private func reload() { + LoadDataMusic.shared.reloadListData() + //检索用户上传音乐是否为空 + if LoadDataMusic.shared.userlistMusics.count == 0 { + //展示提醒框 + noticeView.isHidden = false + }else { + noticeView.isHidden = true + } + tableView.showMessage(LoadDataMusic.shared.userlistMusics.count) + tableView.reloadData() + } + //收到音乐库更新通知 + @objc private func successfullCreateAction() { + DispatchQueue.main.async { + [weak self] in + self?.reload() + } + } + //前往设置页 + @IBAction func setActionClick(_ sender: UIButton) { + let setVC = SettingViewController() + navigationController?.pushViewController(setVC, animated: true) + } + //上传新视频/音频 + @IBAction func addClick(_ sender: UIButton) { + MPModalType = .Choice + let addVC = AddViewController() + addVC.modalPresentationStyle = .custom + addVC.transitioningDelegate = self + present(addVC, animated: true) + } +} +//MARK: - tableView +extension CenterViewController: UITableViewDataSource, UITableViewDelegate { + func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { + return LoadDataMusic.shared.userlistMusics.count + } + func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { + let cell = tableView.dequeueReusableCell(withIdentifier: CenterTableViewCellID, for: indexPath) as! CenterTableViewCell + cell.musicView = LoadDataMusic.shared.userlistMusics[indexPath.row] + cell.moreBlock = { + [weak self] (sender) in + self?.moreAction(sender, music: LoadDataMusic.shared.userlistMusics[indexPath.row]) + } + return cell + } + func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { + let music = LoadDataMusic.shared.userlistMusics[indexPath.row].music + //检索当前音乐状态 + guard MPMediaCenterManager.shared.getMusic()?.identifier != music.identifier else { + //同一首,检索是否播放中 + switch MPMediaCenterManager.shared.getPlayerState() { + case .Null://没有播放 + MPMediaCenterManager.shared.playerStart(music, actionType: .Normal) + case .Playing://播放中 + break + case .Pause://继续播放 + MPMediaCenterManager.shared.playerResume() + } + reload() + return + } + //新的一首 + MPMediaCenterManager.shared.playerStart(music, actionType: .Normal) + reload() + } +} +//MARK: - Popover +extension CenterViewController: UIPopoverPresentationControllerDelegate, UIViewControllerTransitioningDelegate { + //不指定返回样式 + func adaptivePresentationStyle(for controller: UIPresentationController) -> UIModalPresentationStyle { + return .none + } + //更多操作 + private func moreAction(_ sender:UIButton, music:MusicViewModel) { + //展示对应位置的popover弹窗 + let moreVC = MoreViewController() + //设置moreVC的真实大小 + moreVC.preferredContentSize = .init(width: 130*width, height: 65*width) + moreVC.modalPresentationStyle = .popover + moreVC.renameBlock = { + [weak self] in + self?.renameAction(music) + } + moreVC.deleteBlock = { + [weak self] in + self?.deleteAction(music) + } + let popoverVC = moreVC.popoverPresentationController + popoverVC?.delegate = self + //设置锚点视图 + popoverVC?.sourceView = sender + popoverVC?.backgroundColor = .init(hex: "#434343") + //设置箭头指示方向 + popoverVC?.permittedArrowDirections = .right + present(moreVC, animated: true) + } + //弹出重命名框 + private func renameAction(_ music:MusicViewModel) { + MPModalType = .Rename + let renameVC = RenameViewController() + renameVC.renameBlock = { + [weak self] (name) in + music.music.title = name + MusicModel.save() + //判断是否是当前播放音乐 + if music.music.identifier == MPMediaCenterManager.shared.getMusic()?.identifier { + //同步调整 + MPMediaCenterManager.shared.setMusic(music.music) + NotificationCenter.notificationKey.post(notificationName: .rename_music) + } + //更新 + self?.reload() + } + renameVC.transitioningDelegate = self + renameVC.modalPresentationStyle = .custom + present(renameVC, animated: true) + } + //弹出删除框 + private func deleteAction(_ music:MusicViewModel) { + MPModalType = .Delete + let deleteVC = DeleteViewController() + deleteVC.deleteBlock = { + [weak self] in + //判断是否是当前播放音乐 + if music.music.identifier == MPMediaCenterManager.shared.getMusic()?.identifier { + MPMediaCenterManager.shared.setMusic(nil) + //暂停播放 + MPMediaCenterManager.shared.playerStop() + //发布通知让音乐展示框消失 + NotificationCenter.notificationKey.post(notificationName: .close_show) + } + MusicModel.delete(music.music) + //更新 + self?.reload() + } + deleteVC.transitioningDelegate = self + deleteVC.modalPresentationStyle = .custom + present(deleteVC, animated: true) + } + func presentationController(forPresented presented: UIViewController, presenting: UIViewController?, source: UIViewController) -> UIPresentationController? { + return MPPresentationController(presentedViewController: presented, presenting: presenting) + } +} diff --git a/MusicPlayer/MP/ViewControllers/Center(个人资源)/CenterViewController.xib b/MusicPlayer/MP/ViewControllers/Center(个人资源)/CenterViewController.xib new file mode 100644 index 0000000..9076108 --- /dev/null +++ b/MusicPlayer/MP/ViewControllers/Center(个人资源)/CenterViewController.xib @@ -0,0 +1,185 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/MusicPlayer/MP/ViewControllers/Center(个人资源)/DeleteViewController.swift b/MusicPlayer/MP/ViewControllers/Center(个人资源)/DeleteViewController.swift new file mode 100644 index 0000000..2b043c6 --- /dev/null +++ b/MusicPlayer/MP/ViewControllers/Center(个人资源)/DeleteViewController.swift @@ -0,0 +1,29 @@ +// +// DeleteViewController.swift +// MusicPlayer +// +// Created by Mr.Zhou on 2024/4/7. +// + +import UIKit + +class DeleteViewController: UIViewController { + var deleteBlock:ActionBlock? + override func viewDidLoad() { + super.viewDidLoad() + + // Do any additional setup after loading the view. + } + @IBAction func deleteClick(_ sender: UIButton) { + dismiss(animated: true) { + [weak self] in + if self?.deleteBlock != nil { + self?.deleteBlock!() + } + } + } + @IBAction func cancelClick(_ sender: UIButton) { + dismiss(animated: true) + } + +} diff --git a/MusicPlayer/MP/ViewControllers/Center(个人资源)/DeleteViewController.xib b/MusicPlayer/MP/ViewControllers/Center(个人资源)/DeleteViewController.xib new file mode 100644 index 0000000..fff8f3b --- /dev/null +++ b/MusicPlayer/MP/ViewControllers/Center(个人资源)/DeleteViewController.xib @@ -0,0 +1,125 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/MusicPlayer/MP/ViewControllers/Center(个人资源)/MoreViewController.swift b/MusicPlayer/MP/ViewControllers/Center(个人资源)/MoreViewController.swift new file mode 100644 index 0000000..8d9d1c7 --- /dev/null +++ b/MusicPlayer/MP/ViewControllers/Center(个人资源)/MoreViewController.swift @@ -0,0 +1,41 @@ +// +// MoreViewController.swift +// MusicPlayer +// +// Created by Mr.Zhou on 2024/4/7. +// + +import UIKit +///更多操作 +class MoreViewController: UIViewController { + var renameBlock:ActionBlock? + var deleteBlock:ActionBlock? + override func viewDidLoad() { + super.viewDidLoad() + + // Do any additional setup after loading the view. + } + //对音乐重命名 + @IBAction func renameClick(_ sender: UIButton) { + dismiss(animated: true) { + [weak self] in + guard let self = self else { return } + guard renameBlock != nil else { + return + } + renameBlock!() + } + } + //删除音乐 + @IBAction func deleteClick(_ sender: UIButton) { + dismiss(animated: true) { + [weak self] in + guard let self = self else { return } + guard deleteBlock != nil else { + return + } + deleteBlock!() + } + } + +} diff --git a/MusicPlayer/MP/ViewControllers/Center(个人资源)/MoreViewController.xib b/MusicPlayer/MP/ViewControllers/Center(个人资源)/MoreViewController.xib new file mode 100644 index 0000000..b9c3f1a --- /dev/null +++ b/MusicPlayer/MP/ViewControllers/Center(个人资源)/MoreViewController.xib @@ -0,0 +1,78 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/MusicPlayer/MP/ViewControllers/Center(个人资源)/PrivacyViewController.swift b/MusicPlayer/MP/ViewControllers/Center(个人资源)/PrivacyViewController.swift new file mode 100644 index 0000000..d91fc3d --- /dev/null +++ b/MusicPlayer/MP/ViewControllers/Center(个人资源)/PrivacyViewController.swift @@ -0,0 +1,24 @@ +// +// PrivacyViewController.swift +// MusicPlayer +// +// Created by Mr.Zhou on 2024/4/10. +// + +import UIKit +import WebKit +///隐私政策 +class PrivacyViewController: BaseViewController { + @IBOutlet weak var webView: WKWebView! + + override func viewDidLoad() { + super.viewDidLoad() + //创建一个请求 + let request = URLRequest(url: privacyUrl) + webView.load(request) + } + @IBAction func popClick(_ sender: UIButton) { + navigationController?.popViewController(animated: true) + } + +} diff --git a/MusicPlayer/MP/ViewControllers/Center(个人资源)/PrivacyViewController.xib b/MusicPlayer/MP/ViewControllers/Center(个人资源)/PrivacyViewController.xib new file mode 100644 index 0000000..3e7f13e --- /dev/null +++ b/MusicPlayer/MP/ViewControllers/Center(个人资源)/PrivacyViewController.xib @@ -0,0 +1,97 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/MusicPlayer/MP/ViewControllers/Center(个人资源)/RenameViewController.swift b/MusicPlayer/MP/ViewControllers/Center(个人资源)/RenameViewController.swift new file mode 100644 index 0000000..509c554 --- /dev/null +++ b/MusicPlayer/MP/ViewControllers/Center(个人资源)/RenameViewController.swift @@ -0,0 +1,45 @@ +// +// RenameViewController.swift +// MusicPlayer +// +// Created by Mr.Zhou on 2024/4/7. +// + +import UIKit + +class RenameViewController: UIViewController, UITextFieldDelegate { + @IBOutlet weak var textField: UITextField!{ + didSet{ + textField.attributedPlaceholder = NSAttributedString(string: "Placeholder", attributes: [NSAttributedString.Key.foregroundColor:UIColor.init(hex: "#EBEBF5"), NSAttributedString.Key.font : UIFont.systemFont(ofSize: 13, weight: .regular)]) + textField.delegate = self + } + } + var renameBlock:((String) -> Void)? + override func viewDidLoad() { + super.viewDidLoad() + + // Do any additional setup after loading the view. + } + func textField(_ textField: UITextField, shouldChangeCharactersIn range: NSRange, replacementString string: String) -> Bool { + let text = (textField.text! as NSString).replacingCharacters(in: range, with: string) + guard text.count <= 60 else { + return false + } + return true + } + @IBAction func confirmClick(_ sender: UIButton) { + guard let text = textField.text, text != "" else { + return + } + dismiss(animated: true) { + [weak self] in + if self?.renameBlock != nil { + self?.renameBlock!(text) + } + } + } + @IBAction func cancelClick(_ sender: UIButton) { + dismiss(animated: true) + } + +} diff --git a/MusicPlayer/MP/ViewControllers/Center(个人资源)/RenameViewController.xib b/MusicPlayer/MP/ViewControllers/Center(个人资源)/RenameViewController.xib new file mode 100644 index 0000000..0028f4c --- /dev/null +++ b/MusicPlayer/MP/ViewControllers/Center(个人资源)/RenameViewController.xib @@ -0,0 +1,197 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/MusicPlayer/MP/ViewControllers/Center(个人资源)/ServiceViewController.swift b/MusicPlayer/MP/ViewControllers/Center(个人资源)/ServiceViewController.swift new file mode 100644 index 0000000..389a020 --- /dev/null +++ b/MusicPlayer/MP/ViewControllers/Center(个人资源)/ServiceViewController.swift @@ -0,0 +1,23 @@ +// +// ServiceViewController.swift +// MusicPlayer +// +// Created by Mr.Zhou on 2024/4/10. +// + +import UIKit +import WebKit +///用户服务协议 +class ServiceViewController: BaseViewController { + @IBOutlet weak var webView: WKWebView! + + override func viewDidLoad() { + super.viewDidLoad() + //创建一个请求 + let request = URLRequest(url: serviceUrl) + webView.load(request) + } + @IBAction func popClick(_ sender: UIButton) { + navigationController?.popViewController(animated: true) + } +} diff --git a/MusicPlayer/MP/ViewControllers/Center(个人资源)/ServiceViewController.xib b/MusicPlayer/MP/ViewControllers/Center(个人资源)/ServiceViewController.xib new file mode 100644 index 0000000..df08831 --- /dev/null +++ b/MusicPlayer/MP/ViewControllers/Center(个人资源)/ServiceViewController.xib @@ -0,0 +1,97 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/MusicPlayer/MP/ViewControllers/Center(个人资源)/SettingViewController.swift b/MusicPlayer/MP/ViewControllers/Center(个人资源)/SettingViewController.swift new file mode 100644 index 0000000..02c70b1 --- /dev/null +++ b/MusicPlayer/MP/ViewControllers/Center(个人资源)/SettingViewController.swift @@ -0,0 +1,88 @@ +// +// SettingViewController.swift +// MusicPlayer +// +// Created by Mr.Zhou on 2024/4/10. +// + +import UIKit + +class SettingViewController: BaseViewController { + @IBOutlet weak var tableView: UITableView!{ + didSet{ + if #available(iOS 15.0, *) { + tableView.sectionHeaderTopPadding = 0 + } + tableView.rowHeight = 70*width + tableView.dataSource = self + tableView.delegate = self + tableView.register(UINib(nibName: SettingTableViewCellID, bundle: nil), forCellReuseIdentifier: SettingTableViewCellID) + } + } + private let SettingTableViewCellID = "SettingTableViewCell" + private lazy var titles:[String] = ["About","Feedback","Share","Privacy Policy","Terms of Use"] + override func viewDidLoad() { + super.viewDidLoad() + + // Do any additional setup after loading the view. + } + @IBAction func popClick(_ sender: UIButton) { + navigationController?.popViewController(animated: true) + } +} +//MARK: - tableView +extension SettingViewController: UITableViewDataSource, UITableViewDelegate { + func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { + return titles.count + } + func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { + let cell = tableView.dequeueReusableCell(withIdentifier: SettingTableViewCellID, for: indexPath) as! SettingTableViewCell + cell.title = titles[indexPath.row] + return cell + } + func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { + switch indexPath.row { + case 0://About + let aboutVC = AboutViewController() + navigationController?.pushViewController(aboutVC, animated: true) + case 1://Feedback + let alert = UIAlertController(title: "Feedback", message: "If you have any comments or suggestions, please contact us at the following e-mail address", preferredStyle: .actionSheet) + let email = UIAlertAction(title: "support@musicoo.app", style: .default) { (_) in + //将邮箱复制到剪切板中 + UIPasteboard.general.string = "support@musicoo.app" + MPHUD.text("Successfully copied the e-mail address to the clipboard", delay: 1.0, completion: nil) + } + alert.addAction(email) + let cancel = UIAlertAction(title: "Cancel", style: .cancel) + alert.addAction(cancel) + present(alert, animated: true) + case 2://Share + //设置分享文本 + let text = App_Name + //分享图片icon + let image = UIImage(named: "ICON") + //设置分享路径 + let url = URL(string: "https://musicoo.app/") + let activityItems = [text,image as Any,url as Any] + //弹出分享框 + let activityViewController = UIActivityViewController(activityItems: activityItems, applicationActivities:nil) + present(activityViewController, animated: true, completion: nil) + //分享结束后的回调 + activityViewController.completionWithItemsHandler = { [weak self] ( activityType, isCompleted, returnedItems, error) -> Void in + print(isCompleted ? "Share Success":"Share Failure") + } + case 3: + MPNetWorkManager.shared.requestNetworkPermission(oberve: self) { + [weak self] in + let privacyVC = PrivacyViewController() + self?.navigationController?.pushViewController(privacyVC, animated: true) + } + default: + MPNetWorkManager.shared.requestNetworkPermission(oberve: self) { + [weak self] in + let serviceVC = ServiceViewController() + self?.navigationController?.pushViewController(serviceVC, animated: true) + } + } + } +} diff --git a/MusicPlayer/MP/ViewControllers/Center(个人资源)/SettingViewController.xib b/MusicPlayer/MP/ViewControllers/Center(个人资源)/SettingViewController.xib new file mode 100644 index 0000000..0912f4e --- /dev/null +++ b/MusicPlayer/MP/ViewControllers/Center(个人资源)/SettingViewController.xib @@ -0,0 +1,97 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/MusicPlayer/MP/ViewControllers/Home(音乐资源列表)/HomeViewController.swift b/MusicPlayer/MP/ViewControllers/Home(音乐资源列表)/HomeViewController.swift new file mode 100644 index 0000000..473cf55 --- /dev/null +++ b/MusicPlayer/MP/ViewControllers/Home(音乐资源列表)/HomeViewController.swift @@ -0,0 +1,106 @@ +// +// HomeViewController.swift +// MusicPlayer +// +// Created by Mr.Zhou on 2024/3/27. +// + +import UIKit + +class HomeViewController: BaseViewController { + @IBOutlet weak var tableView: UITableView!{ + didSet{ + if #available(iOS 15.0, *) { + tableView.sectionHeaderTopPadding = 0 + } + tableView.contentInsetAdjustmentBehavior = .never + tableView.estimatedRowHeight = 200 + tableView.rowHeight = UITableView.automaticDimension + tableView.tableHeaderView = headView + //额外加载一段下边距 + tableView.contentInset = .init(top: 0, left: 0, bottom: 100*width, right: 0) + tableView.dataSource = self + tableView.delegate = self + tableView.register(UINib(nibName: Home_RowListsTableViewCellID, bundle: nil), forCellReuseIdentifier: Home_RowListsTableViewCellID) + } + } + private lazy var headView:Home_HeadBannerView = .init(frame: .init(x: 0, y: 0, width: screen_Width, height: 135*width)) + private let Home_RowListsTableViewCellID = "Home_RowListsTableViewCell" + //组头标题 + private lazy var sectionTitles:[String] = ["", MusicShowType.First.title, MusicShowType.Second.title, MusicShowType.Third.title] + + override func viewDidLoad() { + super.viewDidLoad() + //触发音乐缺失闭包 + nullMusicAction = { + [weak self] in + //刷新页面 + self?.reload() + } + } + override func viewWillAppear(_ animated: Bool) { + super.viewWillAppear(animated) + + //添加通知 + NotificationCenter.notificationKey.add(observer: self, selector: #selector(fileMissAction(_ :)), notificationName: .null_music) +// NotificationCenter.notificationKey.add(observer: self, selector: #selector(switchPlayerStateAction(_ :)), notificationName: .play_music) +// NotificationCenter.notificationKey.add(observer: self, selector: #selector(switchPlayerStateAction(_ :)), notificationName: .stop_music) +// NotificationCenter.notificationKey.add(observer: self, selector: #selector(switchPlayerStateAction(_ :)), notificationName: .resume_music) +// NotificationCenter.notificationKey.add(observer: self, selector: #selector(switchPlayerStateAction(_ :)), notificationName: .pause_music) + reload() + } + override func viewWillDisappear(_ animated: Bool) { + super.viewWillDisappear(animated) + //移除所有通知 + NotificationCenter.default.removeObserver(self) + + } + deinit { + + } + //刷新渲染页面 + private func reload() { + LoadDataMusic.shared.reloadListData() + tableView.reloadData() + } +// //当音乐播放器状态改变时 +// @objc private func switchPlayerStateAction(_ sender:Notification) { +// //刷新页面内容 +// tableView.reloadData() +// } +} +//MARK: - tableView +extension HomeViewController:UITableViewDataSource, UITableViewDelegate { + func numberOfSections(in tableView: UITableView) -> Int { + return sectionTitles.count + } + func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { + return 1 + } + func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { + let cell = tableView.dequeueReusableCell(withIdentifier: Home_RowListsTableViewCellID, for: indexPath) as! Home_RowListsTableViewCell + cell.layout = .init(rawValue: indexPath.section) ?? .Zero + return cell + } + //设置组头View + func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? { + let sectionView:UIView = .init(frame: .init(x: 0, y: 0, width: screen_Width, height: 40*width)) + sectionView.backgroundColor = .clear + //添加一个Label + let label = UILabel() + label.textColor = .white + label.font = .systemFont(ofSize: 20, weight: .regular) + label.text = sectionTitles[section] + sectionView.addSubview(label) + label.snp.makeConstraints { make in + make.left.equalToSuperview().offset(16*width) + make.top.equalToSuperview() + } + return sectionView + } + //设置组头View高度 + func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat { + return section != 0 ? 40*width:0 + } +} + diff --git a/MusicPlayer/MP/ViewControllers/Home(音乐资源列表)/HomeViewController.xib b/MusicPlayer/MP/ViewControllers/Home(音乐资源列表)/HomeViewController.xib new file mode 100644 index 0000000..b522ab4 --- /dev/null +++ b/MusicPlayer/MP/ViewControllers/Home(音乐资源列表)/HomeViewController.xib @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/MusicPlayer/MP/ViewControllers/Lunch(启动页)/LunchViewController.swift b/MusicPlayer/MP/ViewControllers/Lunch(启动页)/LunchViewController.swift new file mode 100644 index 0000000..ba0796b --- /dev/null +++ b/MusicPlayer/MP/ViewControllers/Lunch(启动页)/LunchViewController.swift @@ -0,0 +1,61 @@ +// +// LunchViewController.swift +// MusicPlayer +// +// Created by Mr.Zhou on 2024/3/27. +// + +import UIKit +///启动页 +class LunchViewController: UIViewController { + @IBOutlet weak var progressView: Lunch_ProgressView!{ + didSet{ + progressView.layer.masksToBounds = true + } + } + //帧计时器 + private var timer:CADisplayLink! + //最大计时值 + private lazy var maxTimes:TimeInterval = 5 + //当前计时值 + private lazy var currentTimes:TimeInterval = 0 + override func viewDidLoad() { + super.viewDidLoad() + view.backgroundColor = .init(hex: "#000000") + timer = CADisplayLink(target: self, selector: #selector(timerActionClick(_ :))) + //一秒执行多少次 + timer.preferredFramesPerSecond = 20 + //开辟线程 + timer.add(to: RunLoop.current, forMode: .common) + //启动计时器 + timer.isPaused = false + } + deinit { + //销毁计时器 + timer.invalidate() + timer = nil + } + //计时器执行事件 + @objc fileprivate func timerActionClick(_ link:CADisplayLink) { + if maxTimes > currentTimes { + //未加载完 + currentTimes += 0.05 + let value = currentTimes/maxTimes + DispatchQueue.main.async { + [weak self] in + guard let self = self else {return} + //设置进度条 + progressView.setProgress(value) + } + }else { + DispatchQueue.main.async { + [weak self] in + guard let self = self else {return} + //停止计时器 + timer.isPaused = true + //加载完毕,判断并跳转 + accessAppdelegate.switch_aSide() + } + } + } +} diff --git a/MusicPlayer/MP/ViewControllers/Lunch(启动页)/LunchViewController.xib b/MusicPlayer/MP/ViewControllers/Lunch(启动页)/LunchViewController.xib new file mode 100644 index 0000000..befa3a1 --- /dev/null +++ b/MusicPlayer/MP/ViewControllers/Lunch(启动页)/LunchViewController.xib @@ -0,0 +1,95 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/MusicPlayer/MP/Views/Base(基类-导航栏-标签栏)/MPBottomShowView.swift b/MusicPlayer/MP/Views/Base(基类-导航栏-标签栏)/MPBottomShowView.swift new file mode 100644 index 0000000..3f13703 --- /dev/null +++ b/MusicPlayer/MP/Views/Base(基类-导航栏-标签栏)/MPBottomShowView.swift @@ -0,0 +1,73 @@ +// +// MPBottomShowView.swift +// MusicPlayer +// +// Created by Mr.Zhou on 2024/4/8. +// + +import UIKit +///底部当前播放音乐展示View(播放器音乐存在时显现) +class MPBottomShowView: UIView, instanceFromNibDelegate { + @IBOutlet weak var backImageView: UIImageView!{ + didSet{ + backImageView.isUserInteractionEnabled = true + backImageView.addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(pushPlayerActionClick(_ :)))) + } + } + @IBOutlet weak var coverImageView: UIImageView! + @IBOutlet weak var titleLabel: UILabel! + @IBOutlet weak var subtitleLabel: UILabel! + //播放器状态 + @IBOutlet weak var stateBtn: UIButton! + //倒计时按钮(常态显示,倒计时隐藏) + @IBOutlet weak var timerBtn: UIButton! + //倒计时View(常态隐藏,倒计时显示) + @IBOutlet weak var timerView: UIView!{ + didSet{ + timerView.layer.masksToBounds = false + timerView.isUserInteractionEnabled = true + timerView.addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(timerActionClick(_ :)))) + } + } + //倒计时Label(常态隐藏,倒计时显示) + @IBOutlet weak var timerLabel: UILabel! + //弹出计时器闭包 + var modalTimerBlock:ActionBlock? + //前往播放器页面闭包 + var pushPlayerBlock:ActionBlock? + //切换播放器状态包 + var switchPlayerBlock:ActionBlock? + override func awakeFromNib() { + super.awakeFromNib() + + } + //MARK: - 交互事件 + //弹出计时器 + @IBAction func timerClick(_ sender: UIButton) { + guard modalTimerBlock != nil else { + return + } + modalTimerBlock!() + } + //启动播放/暂停播放 + @IBAction func switchStateClick(_ sender: UIButton) { + guard switchPlayerBlock != nil else { + return + } + switchPlayerBlock!() + } + //弹出计时选择器 + @objc private func timerActionClick(_ sender:UITapGestureRecognizer) { + guard modalTimerBlock != nil else { + return + } + modalTimerBlock!() + } + //前往播放器页面 + @objc private func pushPlayerActionClick(_ sender:UITapGestureRecognizer) { + guard pushPlayerBlock != nil else { + return + } + pushPlayerBlock!() + } +} diff --git a/MusicPlayer/MP/Views/Base(基类-导航栏-标签栏)/MPBottomShowView.xib b/MusicPlayer/MP/Views/Base(基类-导航栏-标签栏)/MPBottomShowView.xib new file mode 100644 index 0000000..54a3ea3 --- /dev/null +++ b/MusicPlayer/MP/Views/Base(基类-导航栏-标签栏)/MPBottomShowView.xib @@ -0,0 +1,225 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/MusicPlayer/MP/Views/Base(基类-导航栏-标签栏)/MPCustomTabBar.swift b/MusicPlayer/MP/Views/Base(基类-导航栏-标签栏)/MPCustomTabBar.swift new file mode 100644 index 0000000..8433a44 --- /dev/null +++ b/MusicPlayer/MP/Views/Base(基类-导航栏-标签栏)/MPCustomTabBar.swift @@ -0,0 +1,36 @@ +// +// MPCustomTabBar.swift +// MusicPlayer +// +// Created by Mr.Zhou on 2024/3/27. +// + +import UIKit +///自定义taBar +class MPCustomTabBar: UITabBar { + //tabBarView + fileprivate lazy var tabBarView:MPCustomTabBarView = { + let tabBarView:MPCustomTabBarView = .instanceFromNib() + return tabBarView + }() + + override init(frame: CGRect) { + super.init(frame: frame) + self.addSubview(tabBarView) + backgroundColor = .clear + tabBarView.snp.makeConstraints { make in + make.left.right.bottom.equalToSuperview() + make.height.equalTo(72*width) + } + } + override func layoutSubviews() { + super.layoutSubviews() + //将tabBarView置于顶层 + self.bringSubviewToFront(tabBarView) + } + required init?(coder: NSCoder) { + super.init(coder: coder) + } + + +} diff --git a/MusicPlayer/MP/Views/Base(基类-导航栏-标签栏)/MPCustomTabBarItem.swift b/MusicPlayer/MP/Views/Base(基类-导航栏-标签栏)/MPCustomTabBarItem.swift new file mode 100644 index 0000000..eb84cef --- /dev/null +++ b/MusicPlayer/MP/Views/Base(基类-导航栏-标签栏)/MPCustomTabBarItem.swift @@ -0,0 +1,53 @@ +// +// MPCustomTabBarItem.swift +// MusicPlayer +// +// Created by Mr.Zhou on 2024/3/27. +// + +import UIKit +///自定义tabBarItem +class MPCustomTabBarItem: UIView { + //icon图片 + fileprivate lazy var iconImageView:UIImageView = { + let imageView:UIImageView = .init() + imageView.contentMode = .scaleAspectFill + return imageView + }() + //展示的内容 + var title:String!{ + didSet{ + iconImageView.image = UIImage(named: title) + } + } + ///选中状态 + var isSelected:Bool = false{ + didSet{ + if isSelected { + //选中 + iconImageView.image = UIImage(named: title + " 1") + }else{ + //未选中 + iconImageView.image = UIImage(named: title) + } + } + } + override init(frame: CGRect) { + super.init(frame: frame) + setUpLayout() + } + + required init?(coder: NSCoder) { + super.init(coder: coder) + setUpLayout() + } + //MARK: - 布局实现 + fileprivate func setUpLayout() { + backgroundColor = .clear + addSubview(iconImageView) + iconImageView.snp.makeConstraints { make in + make.width.height.equalToSuperview() + make.center.equalToSuperview() + } + } +} diff --git a/MusicPlayer/MP/Views/Base(基类-导航栏-标签栏)/MPCustomTabBarView.swift b/MusicPlayer/MP/Views/Base(基类-导航栏-标签栏)/MPCustomTabBarView.swift new file mode 100644 index 0000000..7dd0333 --- /dev/null +++ b/MusicPlayer/MP/Views/Base(基类-导航栏-标签栏)/MPCustomTabBarView.swift @@ -0,0 +1,69 @@ +// +// MPCustomTabBarView.swift +// MusicPlayer +// +// Created by Mr.Zhou on 2024/3/27. +// + +import UIKit +///自定义tabBarView +class MPCustomTabBarView: UIView, instanceFromNibDelegate { + @IBOutlet weak var bgImageView: UIImageView!{ + didSet{ + bgImageView.layer.masksToBounds = true + bgImageView.layer.cornerRadius = 24*width + bgImageView.layer.maskedCorners = [.layerMinXMinYCorner,.layerMaxXMinYCorner] + } + } + @IBOutlet var tabBarItems: [MPCustomTabBarItem]!{ + didSet{ + //添加点击事件 + tabBarItems.forEach { item in + item.isUserInteractionEnabled = true + item.title = titles[item.tag] + item.addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(switchActionClick(_ :)))) + } + } + } + private lazy var titles:[String] = ["Home","Center"] + //当前选中item(默认为首位) + private lazy var selectedItem:Int = 0 + override func awakeFromNib() { + super.awakeFromNib() + setUpLayout() + } + override init(frame: CGRect) { + super.init(frame: frame) + setUpLayout() + } + + required init?(coder: NSCoder) { + super.init(coder: coder) + } + deinit { + } + //布局 + private func setUpLayout() { + backgroundColor = .clear + //超出部分不切除 + layer.masksToBounds = false + //默认首位item处于选中状态 + tabBarItems[0].isSelected = true + } + //点击事件 + @objc private func switchActionClick(_ sender:UITapGestureRecognizer) { + endEditing(true) + let tag = sender.view?.tag ?? 0 + //根据tag值传送 + guard selectedItem != tag else { + //无效点击 + return + } + tabBarItems.forEach { item in + item.isSelected = item.tag == tag + } + selectedItem = tag + //发送页面切换通知 + NotificationCenter.notificationKey.post(notificationName: .switch_tabBarItem, object: tag) + } +} diff --git a/MusicPlayer/MP/Views/Base(基类-导航栏-标签栏)/MPCustomTabBarView.xib b/MusicPlayer/MP/Views/Base(基类-导航栏-标签栏)/MPCustomTabBarView.xib new file mode 100644 index 0000000..5cbfc6a --- /dev/null +++ b/MusicPlayer/MP/Views/Base(基类-导航栏-标签栏)/MPCustomTabBarView.xib @@ -0,0 +1,81 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/MusicPlayer/MP/Views/Base(基类-导航栏-标签栏)/PlayerActionView.swift b/MusicPlayer/MP/Views/Base(基类-导航栏-标签栏)/PlayerActionView.swift new file mode 100644 index 0000000..c9d0de1 --- /dev/null +++ b/MusicPlayer/MP/Views/Base(基类-导航栏-标签栏)/PlayerActionView.swift @@ -0,0 +1,79 @@ +// +// PlayerActionView.swift +// MusicPlayer +// +// Created by Mr.Zhou on 2024/4/10. +// + +import UIKit +///播放器各事项View +class PlayerActionView: UIView { + //常规图片(展示dark和light状态的图片) + private lazy var normalImageView:UIImageView = { + let imageView:UIImageView = .init() + imageView.contentMode = .scaleAspectFill + return imageView + }() + //运行时图片(当功能运行时图片,视图最上层) + private lazy var playingImageView:UIImageView = { + let imageView:UIImageView = .init() + imageView.contentMode = .scaleAspectFill + return imageView + }() + //dark状态下图片 + var darkImage:UIImage! + //light状态下图片 + var lightImage:UIImage! + //playing状态下图片 + var playingImage:UIImage! + //是dark还是light? + var isDark:Bool = true{ + didSet{ + normalImageView.image = isDark ? darkImage:lightImage + } + } + //是否运行时 + var isPlaying:Bool = false{ + didSet{ + playingImageView.image = playingImage + normalImageView.isHidden = isPlaying + playingImageView.isHidden = !isPlaying + } + } + override init(frame: CGRect) { + super.init(frame: frame) + setUpLayout() + } + override func awakeFromNib() { + super.awakeFromNib() + setUpLayout() + } + required init?(coder: NSCoder) { + super.init(coder: coder) +// setUpLayout() + } + override func layoutSubviews() { + super.layoutSubviews() + //xib加载完成后,设置圆角 + layer.masksToBounds = true + layer.cornerRadius = frame.size.width/2 + } + + //约束加载 + private func setUpLayout() { + isUserInteractionEnabled = true + addSubview(normalImageView) + normalImageView.snp.makeConstraints { make in + make.center.equalToSuperview() + make.width.height.equalTo(26*width) + } + normalImageView.isHidden = false + addSubview(playingImageView) + playingImageView.snp.makeConstraints { make in + make.center.equalToSuperview() + make.width.height.equalTo(26*width) + } + playingImageView.isHidden = true + } + +} diff --git a/MusicPlayer/MP/Views/Center(个人资源)/CenterTableViewCell.swift b/MusicPlayer/MP/Views/Center(个人资源)/CenterTableViewCell.swift new file mode 100644 index 0000000..175edac --- /dev/null +++ b/MusicPlayer/MP/Views/Center(个人资源)/CenterTableViewCell.swift @@ -0,0 +1,50 @@ +// +// CenterTableViewCell.swift +// MusicPlayer +// +// Created by Mr.Zhou on 2024/4/2. +// + +import UIKit + +class CenterTableViewCell: UITableViewCell { + @IBOutlet weak var coverImageView: UIImageView! + @IBOutlet weak var titleLabel: UILabel! + @IBOutlet weak var durationLabel: UILabel! + var musicView:MusicViewModel!{ + didSet{ + coverImageView.image = musicView.cover + titleLabel.text = musicView.title + durationLabel.text = musicView.duration + //判断当前音乐是否播放中,是不是这首音乐 + guard MPMediaCenterManager.shared.getPlayerState() == .Playing, MPMediaCenterManager.shared.getMusic()?.identifier == musicView.music.identifier else { + //展示未播放状态 + titleLabel.textColor = .init(hex: "#FFFFFF") + durationLabel.textColor = .init(hex: "#FFFFFF") + return + } + //展示播放状态 + titleLabel.textColor = .init(hex: "#80F988") + durationLabel.textColor = .init(hex: "#80F988") + } + } + var moreBlock:((UIButton) -> Void)? + override func awakeFromNib() { + super.awakeFromNib() + selectionStyle = .none + } + + override func setSelected(_ selected: Bool, animated: Bool) { + super.setSelected(selected, animated: animated) + + // Configure the view for the selected state + } + //更多操作 + @IBAction func moreClick(_ sender: UIButton) { + guard moreBlock != nil else { + return + } + moreBlock!(sender) + } + +} diff --git a/MusicPlayer/MP/Views/Center(个人资源)/CenterTableViewCell.xib b/MusicPlayer/MP/Views/Center(个人资源)/CenterTableViewCell.xib new file mode 100644 index 0000000..0cc576d --- /dev/null +++ b/MusicPlayer/MP/Views/Center(个人资源)/CenterTableViewCell.xib @@ -0,0 +1,135 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/MusicPlayer/MP/Views/Center(个人资源)/SettingTableViewCell.swift b/MusicPlayer/MP/Views/Center(个人资源)/SettingTableViewCell.swift new file mode 100644 index 0000000..408e482 --- /dev/null +++ b/MusicPlayer/MP/Views/Center(个人资源)/SettingTableViewCell.swift @@ -0,0 +1,30 @@ +// +// SettingTableViewCell.swift +// MusicPlayer +// +// Created by Mr.Zhou on 2024/4/10. +// + +import UIKit + +class SettingTableViewCell: UITableViewCell { + @IBOutlet weak var iconImageView: UIImageView! + @IBOutlet weak var titleLabel: UILabel! + var title:String!{ + didSet{ + iconImageView.image = UIImage(named: title) + titleLabel.text = title + } + } + override func awakeFromNib() { + super.awakeFromNib() + selectionStyle = .none + } + + override func setSelected(_ selected: Bool, animated: Bool) { + super.setSelected(selected, animated: animated) + + // Configure the view for the selected state + } + +} diff --git a/MusicPlayer/MP/Views/Center(个人资源)/SettingTableViewCell.xib b/MusicPlayer/MP/Views/Center(个人资源)/SettingTableViewCell.xib new file mode 100644 index 0000000..e32ecef --- /dev/null +++ b/MusicPlayer/MP/Views/Center(个人资源)/SettingTableViewCell.xib @@ -0,0 +1,121 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/MusicPlayer/MP/Views/Home(音乐资源列表-播放器)/Home_FirstListCollectionViewCell.swift b/MusicPlayer/MP/Views/Home(音乐资源列表-播放器)/Home_FirstListCollectionViewCell.swift new file mode 100644 index 0000000..3b9ca98 --- /dev/null +++ b/MusicPlayer/MP/Views/Home(音乐资源列表-播放器)/Home_FirstListCollectionViewCell.swift @@ -0,0 +1,38 @@ +// +// Home_FirstListCollectionViewCell.swift +// MusicPlayer +// +// Created by Mr.Zhou on 2024/3/27. +// + +import UIKit +///首页音乐第一行展示列表Cell +class Home_FirstListCollectionViewCell: UICollectionViewCell { + @IBOutlet weak var coverImageView: UIImageView! + @IBOutlet weak var stateBtn: UIButton! + @IBOutlet weak var titleLabel: UILabel! + @IBOutlet weak var subtitleLabel: UILabel! + var musicView:MusicViewModel!{ + didSet{ + coverImageView.image = musicView.cover + titleLabel.text = musicView.title + subtitleLabel.text = musicView.duration + //判断当前音乐是否播放中,是不是这首音乐 + guard MPMediaCenterManager.shared.getPlayerState() == .Playing, MPMediaCenterManager.shared.getMusic()?.identifier == musicView.music.identifier else { + //展示未播放状态 + titleLabel.textColor = .init(hex: "#FFFFFF") + subtitleLabel.textColor = .init(hex: "#FFFFFF") + stateBtn.isSelected = false + return + } + //展示播放状态 + titleLabel.textColor = .init(hex: "#80F988") + subtitleLabel.textColor = .init(hex: "#80F988") + stateBtn.isSelected = true + } + } + override func awakeFromNib() { + super.awakeFromNib() + } + +} diff --git a/MusicPlayer/MP/Views/Home(音乐资源列表-播放器)/Home_FirstListCollectionViewCell.xib b/MusicPlayer/MP/Views/Home(音乐资源列表-播放器)/Home_FirstListCollectionViewCell.xib new file mode 100644 index 0000000..483b625 --- /dev/null +++ b/MusicPlayer/MP/Views/Home(音乐资源列表-播放器)/Home_FirstListCollectionViewCell.xib @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/MusicPlayer/MP/Views/Home(音乐资源列表-播放器)/Home_FourthListCollectionViewCell.swift b/MusicPlayer/MP/Views/Home(音乐资源列表-播放器)/Home_FourthListCollectionViewCell.swift new file mode 100644 index 0000000..0d9b507 --- /dev/null +++ b/MusicPlayer/MP/Views/Home(音乐资源列表-播放器)/Home_FourthListCollectionViewCell.swift @@ -0,0 +1,41 @@ +// +// Home_FourthListCollectionViewCell.swift +// MusicPlayer +// +// Created by Mr.Zhou on 2024/3/27. +// + +import UIKit +///首页音乐第四行展示列表Cell +class Home_FourthListCollectionViewCell: UICollectionViewCell { + @IBOutlet weak var coverImageView: UIImageView! + @IBOutlet weak var titleLabel: UILabel! + @IBOutlet weak var subtitleLabel: UILabel! + @IBOutlet weak var shieldView: UIView! + @IBOutlet weak var stateBtn: UIButton! + var musicView:MusicViewModel!{ + didSet{ + coverImageView.image = musicView.cover + titleLabel.text = musicView.title + subtitleLabel.text = musicView.duration + //判断当前音乐是否播放中,是不是这首音乐 + guard MPMediaCenterManager.shared.getPlayerState() == .Playing, MPMediaCenterManager.shared.getMusic()?.identifier == musicView.music.identifier else { + //展示未播放状态 + titleLabel.textColor = .init(hex: "#FFFFFF") + subtitleLabel.textColor = .init(hex: "#FFFFFF") + stateBtn.isSelected = false + shieldView.isHidden = true + return + } + //展示播放状态 + titleLabel.textColor = .init(hex: "#80F988") + subtitleLabel.textColor = .init(hex: "#80F988") + stateBtn.isSelected = true + shieldView.isHidden = false + } + } + override func awakeFromNib() { + super.awakeFromNib() + + } +} diff --git a/MusicPlayer/MP/Views/Home(音乐资源列表-播放器)/Home_FourthListCollectionViewCell.xib b/MusicPlayer/MP/Views/Home(音乐资源列表-播放器)/Home_FourthListCollectionViewCell.xib new file mode 100644 index 0000000..6590dbc --- /dev/null +++ b/MusicPlayer/MP/Views/Home(音乐资源列表-播放器)/Home_FourthListCollectionViewCell.xib @@ -0,0 +1,156 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/MusicPlayer/MP/Views/Home(音乐资源列表-播放器)/Home_HeadBannerView.swift b/MusicPlayer/MP/Views/Home(音乐资源列表-播放器)/Home_HeadBannerView.swift new file mode 100644 index 0000000..8eb72c4 --- /dev/null +++ b/MusicPlayer/MP/Views/Home(音乐资源列表-播放器)/Home_HeadBannerView.swift @@ -0,0 +1,36 @@ +// +// Home_HeadBannerView.swift +// MusicPlayer +// +// Created by Mr.Zhou on 2024/3/27. +// + +import UIKit +///首页顶部标题View +class Home_HeadBannerView: UIView { + //banner + private lazy var bannerImageView:UIImageView = { + let imageView:UIImageView = .init(image: .init(named: "Home'banner")) + imageView.contentMode = .scaleAspectFill + return imageView + }() + override init(frame: CGRect) { + super.init(frame: frame) + setUpLayout() + } + + required init?(coder: NSCoder) { + super.init(coder: coder) + setUpLayout() + } + //约束加载 + private func setUpLayout() { + addSubview(bannerImageView) + bannerImageView.snp.makeConstraints { make in + make.left.equalToSuperview().offset(16*width) + make.height.equalTo(78*width) + make.width.equalTo(324*width) + make.top.equalToSuperview().offset(20*width) + } + } +} diff --git a/MusicPlayer/MP/Views/Home(音乐资源列表-播放器)/Home_RowListsTableViewCell.swift b/MusicPlayer/MP/Views/Home(音乐资源列表-播放器)/Home_RowListsTableViewCell.swift new file mode 100644 index 0000000..ce4ba2a --- /dev/null +++ b/MusicPlayer/MP/Views/Home(音乐资源列表-播放器)/Home_RowListsTableViewCell.swift @@ -0,0 +1,190 @@ +// +// Home_RowListsTableViewCell.swift +// MusicPlayer +// +// Created by Mr.Zhou on 2024/3/27. +// + +import UIKit +//HomeTableViewcell展示类型 +enum HomeRowCellLayout: Int { + case Zero = 0 + case First = 1 + case Second = 2 + case Third = 3 + //collectionView的高度 + var height:CGFloat{ + switch self { + case .Zero: + return 140*width + case .First: + return 163*width + case .Second: + return 163*width + case .Third: + return 215*width + } + } + //collecitonViewCell的Size + var size:CGSize{ + switch self { + case .Zero: + return .init(width: 166*width, height: 140*width) + case .First: + return .init(width: 108*width, height: 118*width) + case .Second: + return .init(width: 108*width, height: 118*width) + case .Third: + return .init(width: 340*width, height: 54*width) + } + } + //collectionViewCell的外边距 + var edgeInsets:UIEdgeInsets{ + switch self { + case .Zero: + return .init(top: 0, left: 16*width, bottom: 0, right: 16*width) + case .First: + return .init(top: 0, left: 16*width, bottom: 45*width, right: 16*width) + case .Second: + return .init(top: 0, left: 16*width, bottom: 45*width, right: 16*width) + case .Third: + return .init(top: 0, left: 16*width, bottom: 17*width, right: 16*width) + } + } + //collectionViewCell的组距 + var columnDistance:CGFloat{ + return 17*width + } + //collectionViewCell的列距 + var rowDistance:CGFloat{ + return 8*width + } +} +class Home_RowListsTableViewCell: UITableViewCell { + @IBOutlet weak var collectionView: UICollectionView!{ + didSet{ + collectionView.contentInsetAdjustmentBehavior = .never + collectionView.dataSource = self + collectionView.delegate = self + collectionView.register(UINib(nibName: Home_FirstListCollectionViewCellID, bundle: nil), forCellWithReuseIdentifier: Home_FirstListCollectionViewCellID) + collectionView.register(UINib(nibName: Home_SecondListCollectionViewCellID, bundle: nil), forCellWithReuseIdentifier: Home_SecondListCollectionViewCellID) + collectionView.register(UINib(nibName: Home_FourthListCollectionViewCellID, bundle: nil), forCellWithReuseIdentifier: Home_FourthListCollectionViewCellID) + } + } + @IBOutlet weak var heightConstraint: NSLayoutConstraint! + var layout:HomeRowCellLayout = .Zero { + didSet{ + heightConstraint.constant = layout.height + collectionView.reloadData() + } + } + fileprivate let Home_FirstListCollectionViewCellID = "Home_FirstListCollectionViewCell" + fileprivate let Home_SecondListCollectionViewCellID = "Home_SecondListCollectionViewCell" + fileprivate let Home_FourthListCollectionViewCellID = "Home_FourthListCollectionViewCell" + override func awakeFromNib() { + super.awakeFromNib() + selectionStyle = .none + //添加通知 + NotificationCenter.notificationKey.add(observer: self, selector: #selector(switchPlayerStateAction(_ :)), notificationName: .play_music) + NotificationCenter.notificationKey.add(observer: self, selector: #selector(switchPlayerStateAction(_ :)), notificationName: .stop_music) + NotificationCenter.notificationKey.add(observer: self, selector: #selector(switchPlayerStateAction(_ :)), notificationName: .resume_music) + NotificationCenter.notificationKey.add(observer: self, selector: #selector(switchPlayerStateAction(_ :)), notificationName: .pause_music) + } + deinit{ + //移除所有通知 + NotificationCenter.default.removeObserver(self) + } + override func setSelected(_ selected: Bool, animated: Bool) { + super.setSelected(selected, animated: animated) + + // Configure the view for the selected state + } + //当音乐播放器状态改变时 + @objc private func switchPlayerStateAction(_ sender:Notification) { + //回归主线程 + DispatchQueue.main.async { + [weak self] in + //刷新页面内容 + self?.collectionView.reloadData() + } + } +} +//MARK: - collectionView处理 +extension Home_RowListsTableViewCell:UICollectionViewDataSource, UICollectionViewDelegate, UICollectionViewDelegateFlowLayout { + func numberOfSections(in collectionView: UICollectionView) -> Int { + return layout != .Third ? 1:3 + } + func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { + switch layout { + case .Zero: + return LoadDataMusic.shared.homeZeroMusics.count + case .First: + return LoadDataMusic.shared.homeFirstMusics.count + case .Second: + return LoadDataMusic.shared.homeSecondMusics.count + default: + return LoadDataMusic.shared.homeThirdMusics[section].count + } + } + func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { + switch layout { + case .Zero: + let cell = collectionView.dequeueReusableCell(withReuseIdentifier: Home_FirstListCollectionViewCellID, for: indexPath) as! Home_FirstListCollectionViewCell + cell.musicView = LoadDataMusic.shared.homeZeroMusics[indexPath.row] + return cell + case .First: + let cell = collectionView.dequeueReusableCell(withReuseIdentifier: Home_SecondListCollectionViewCellID, for: indexPath) as! Home_SecondListCollectionViewCell + cell.musicView = LoadDataMusic.shared.homeFirstMusics[indexPath.row] + return cell + case .Second: + let cell = collectionView.dequeueReusableCell(withReuseIdentifier: Home_SecondListCollectionViewCellID, for: indexPath) as! Home_SecondListCollectionViewCell + cell.musicView = LoadDataMusic.shared.homeSecondMusics[indexPath.row] + return cell + default: + let cell = collectionView.dequeueReusableCell(withReuseIdentifier: Home_FourthListCollectionViewCellID, for: indexPath) as! Home_FourthListCollectionViewCell + cell.musicView = LoadDataMusic.shared.homeThirdMusics[indexPath.section][indexPath.row] + return cell + } + } + func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize { + return layout.size + } + func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, insetForSectionAt section: Int) -> UIEdgeInsets { + return layout.edgeInsets + } + func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, minimumLineSpacingForSectionAt section: Int) -> CGFloat { + return layout.rowDistance + } + func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, minimumInteritemSpacingForSectionAt section: Int) -> CGFloat { + return layout.columnDistance + } + func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) { + var music:MusicModel! + switch layout { + case .Zero: + //获取一首音乐 + music = LoadDataMusic.shared.homeZeroMusics[indexPath.row].music + case .First: + music = LoadDataMusic.shared.homeFirstMusics[indexPath.row].music + case .Second: + music = LoadDataMusic.shared.homeSecondMusics[indexPath.row].music + default: + music = LoadDataMusic.shared.homeThirdMusics[indexPath.section][indexPath.row].music + } + //检索当前音乐状态 + guard MPMediaCenterManager.shared.getMusic()?.identifier != music.identifier else { + //同一首,检索是否播放中 + switch MPMediaCenterManager.shared.getPlayerState() { + case .Null://没有播放 + MPMediaCenterManager.shared.playerStart(music, actionType: .Normal) + case .Playing://播放中 + break + case .Pause://继续播放 + MPMediaCenterManager.shared.playerResume() + } + return + } + //新的一首 + MPMediaCenterManager.shared.playerStart(music, actionType: .Normal) + } +} diff --git a/MusicPlayer/MP/Views/Home(音乐资源列表-播放器)/Home_RowListsTableViewCell.xib b/MusicPlayer/MP/Views/Home(音乐资源列表-播放器)/Home_RowListsTableViewCell.xib new file mode 100644 index 0000000..bd7ce1c --- /dev/null +++ b/MusicPlayer/MP/Views/Home(音乐资源列表-播放器)/Home_RowListsTableViewCell.xib @@ -0,0 +1,62 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/MusicPlayer/MP/Views/Home(音乐资源列表-播放器)/Home_SecondListCollectionViewCell.swift b/MusicPlayer/MP/Views/Home(音乐资源列表-播放器)/Home_SecondListCollectionViewCell.swift new file mode 100644 index 0000000..6f8dad5 --- /dev/null +++ b/MusicPlayer/MP/Views/Home(音乐资源列表-播放器)/Home_SecondListCollectionViewCell.swift @@ -0,0 +1,38 @@ +// +// Home_SecondListCollectionViewCell.swift +// MusicPlayer +// +// Created by Mr.Zhou on 2024/3/27. +// + +import UIKit +///首页音乐第二/三行展示列表Cell +class Home_SecondListCollectionViewCell: UICollectionViewCell { + @IBOutlet weak var coverImageView: UIImageView! + @IBOutlet weak var titleLabel: UILabel! + @IBOutlet weak var subtitleLabel: UILabel! + @IBOutlet weak var shieldView: UIView! + var musicView:MusicViewModel!{ + didSet{ + coverImageView.image = musicView.cover + titleLabel.text = musicView.title + subtitleLabel.text = musicView.duration + //判断当前音乐是否播放中,是不是这首音乐 + guard MPMediaCenterManager.shared.getPlayerState() == .Playing, MPMediaCenterManager.shared.getMusic()?.identifier == musicView.music.identifier else { + //展示未播放状态 + titleLabel.textColor = .init(hex: "#FFFFFF") + subtitleLabel.textColor = .init(hex: "#FFFFFF") + shieldView.isHidden = true + return + } + //展示播放状态 + titleLabel.textColor = .init(hex: "#80F988") + subtitleLabel.textColor = .init(hex: "#80F988") + shieldView.isHidden = false + } + } + override func awakeFromNib() { + super.awakeFromNib() + layer.masksToBounds = false + } +} diff --git a/MusicPlayer/MP/Views/Home(音乐资源列表-播放器)/Home_SecondListCollectionViewCell.xib b/MusicPlayer/MP/Views/Home(音乐资源列表-播放器)/Home_SecondListCollectionViewCell.xib new file mode 100644 index 0000000..5a0cde8 --- /dev/null +++ b/MusicPlayer/MP/Views/Home(音乐资源列表-播放器)/Home_SecondListCollectionViewCell.xib @@ -0,0 +1,119 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/MusicPlayer/MP/Views/Home(音乐资源列表-播放器)/Player_Slider.swift b/MusicPlayer/MP/Views/Home(音乐资源列表-播放器)/Player_Slider.swift new file mode 100644 index 0000000..6deb551 --- /dev/null +++ b/MusicPlayer/MP/Views/Home(音乐资源列表-播放器)/Player_Slider.swift @@ -0,0 +1,143 @@ +// +// Player_Slider.swift +// MusicPlayer +// +// Created by Mr.Zhou on 2024/3/29. +// + +import UIKit + +///音量控制Slider +class Player_Slider: UISlider { + //滑块图片 + var thumbImage:UIImage! + //滑轨槽高度 + var trackHeight: CGFloat = 5 + //进度渐变色 + var minTrackColors: [UIColor]! + //槽位渐变色 + var maxTrackColors:[UIColor]! + //进度渐变色定位列表(与渐变色数量保持一致) + var minTrackLocations:[CGFloat]! + //槽位渐变色定位列表(与渐变色数量保持一致) + var maxTrackLocations:[CGFloat]! + + //初始化 + init(frame:CGRect, trackHeight: CGFloat, minTrackColors: [UIColor]!, maxTrackColors: [UIColor]!, minTrackLocations: [CGFloat]!, maxTrackLocations: [CGFloat]!) { + super.init(frame: frame) + self.trackHeight = trackHeight + self.minTrackColors = minTrackColors + self.maxTrackColors = maxTrackColors + self.minTrackLocations = minTrackLocations + self.maxTrackLocations = maxTrackLocations + setUpLayout() + } + + required init?(coder: NSCoder) { + super.init(coder: coder) + } + override func awakeFromNib() { + super.awakeFromNib() + trackHeight = bounds.size.height + setUpLayout() + } + private func setUpLayout() { + layer.masksToBounds = false + + } + //重写绘制方法 + override func draw(_ rect: CGRect) { + //设置滑块图片 + if thumbImage != nil { + setThumbImage(thumbImage, for: .normal) + } + //设置进度图片 + let minTrackImg = makeTrackImage(rect: rect, colors: minTrackColors, locations: minTrackLocations) + setMinimumTrackImage(minTrackImg, for: .normal) + // 设置槽位 + let maxTrackImg = makeTrackImage(rect: rect, colors: maxTrackColors, locations: maxTrackLocations) + setMaximumTrackImage(maxTrackImg, for: .normal) + } + + /// 滑块设置 + /// - Parameters: + /// - rect: 滑块大小 + /// - color: 滑块颜色 + /// - Returns: 返回的滑块图片 + private func makeThumbImage(rect: CGRect, color:UIColor) -> UIImage { + let lineWidth: CGFloat = 2 + //开始绘制 + UIGraphicsBeginImageContextWithOptions(rect.size, false, 0) + //填充内部颜色 + color.setFill() + //曲线路径 + let oval = UIBezierPath(ovalIn: rect) + //填充路径 + oval.fill() + //设置路径颜色为白色 + UIColor.white.setStroke() + //路径宽度 + oval.lineWidth = lineWidth + oval.stroke() + //转为图片 + let thumbImg = UIGraphicsGetImageFromCurrentImageContext()! + //转化结束 + UIGraphicsEndImageContext() + return thumbImg + } + + + /// 生成滑轨图片 + /// - Parameters: + /// - rect: 滑轨大小 + /// - colors: 颜色列表 + /// - locations: 位置分布列表 + /// - Returns: 生成的图片 + private func makeTrackImage(rect: CGRect, colors:[UIColor], locations:[CGFloat]) -> UIImage { + let rect = CGRect(x: rect.minX, y: rect.minY, width: rect.width, height: self.trackHeight) + //开始绘制 + UIGraphicsBeginImageContextWithOptions(rect.size, false, 0) + let ctx = UIGraphicsGetCurrentContext()! + // 创建并设置路径 + let cornerRadius: CGFloat = rect.height * 0.5 + let path = UIBezierPath(roundedRect: rect, cornerRadius: cornerRadius).cgPath + // 添加路径到图形上下文 + ctx.addPath(path) + ctx.clip() + // 使用rgb颜色空间 + let colorSpace = CGColorSpaceCreateDeviceRGB() + //获取cgcolors + var cgColors:[CGColor] = [] + colors.forEach { item in + cgColors.append(item.cgColor) + } + // 定义渐变色 + let gradient:CGGradient = CGGradient(colorsSpace: colorSpace, colors: cgColors as CFArray, locations: locations)! + // 渐变开始位置 + let start = CGPoint(x: self.bounds.minX, y: self.bounds.minY) + // 渐变结束位置 + let end = CGPoint(x: self.bounds.maxX, y: self.bounds.minY) + // 绘制渐变 + ctx.drawLinearGradient(gradient, start: start, end: end, options: .drawsBeforeStartLocation) + //转为图片 + let trackImg = UIGraphicsGetImageFromCurrentImageContext()! + UIGraphicsEndImageContext() + return trackImg + } + // 重写【thumb】显示区域 方法 + override func thumbRect(forBounds bounds: CGRect, trackRect rect: CGRect, value: Float) -> CGRect { + let rect = super.thumbRect(forBounds: bounds, trackRect: rect, value: value) + // 设置thumb投影效果 + // (这样设置的投影效果,如果调用setValue(_:animated:)的时候,animated参数为true,会有阴影和thumb不同步的问题,目前还不知到怎么解决) + self.layer.shadowColor = UIColor.black.cgColor + self.layer.shadowOffset = CGSize(width: 0, height: 0) + self.layer.shadowOpacity = 0.15 + self.layer.shadowRadius = 3 + self.layer.shadowPath = UIBezierPath(cgPath: CGPath(ellipseIn: rect.insetBy(dx: 3, dy: 3), transform: nil)).cgPath + return rect + } + // 重写【track】显示区域 方法 + override func trackRect(forBounds bounds: CGRect) -> CGRect { + return CGRect(x: 0, y: 0, width: bounds.width, height: self.trackHeight) + } +} diff --git a/MusicPlayer/MP/Views/Lunch(启动页)/Lunch_ProgressView.swift b/MusicPlayer/MP/Views/Lunch(启动页)/Lunch_ProgressView.swift new file mode 100644 index 0000000..997dbf6 --- /dev/null +++ b/MusicPlayer/MP/Views/Lunch(启动页)/Lunch_ProgressView.swift @@ -0,0 +1,94 @@ +// +// Lunch_ProgressView.swift +// MusicPlayer +// +// Created by Mr.Zhou on 2024/3/27. +// + +import UIKit + +class Lunch_ProgressView: UIView { + struct Constant { + //进度条宽度 + static let lineWidth: CGFloat = 6*width + //进度槽颜色 + static let trackColor:UIColor = .init(hex: "#FFFFFF") + //进度条颜色 + static let progressColors:[CGColor] = [ + UIColor(red: 0.109, green: 0.784, blue: 0.932, alpha: 1).cgColor, + UIColor(red: 0.412, green: 0.996, blue: 0.451, alpha: 1).cgColor, + UIColor(red: 0.796, green: 0.839, blue: 0.294, alpha: 1).cgColor + ] + } + //渐变层 + private var gradientLayer:CAGradientLayer! + //进度槽 + private var trackLayer:CAShapeLayer! + //进度条路径(水平线) + private var path:UIBezierPath! + override init(frame: CGRect) { + super.init(frame: frame) + setUpLayers() + } + + required init?(coder: NSCoder) { + super.init(coder: coder) + setUpLayers() + } + override func layoutSubviews() { + super.layoutSubviews() + } + override func draw(_ rect: CGRect) { + //初始化圆角矩形路径 + path = UIBezierPath() + //获取起点 + let startPoint = CGPoint(x: bounds.minX, y: bounds.maxY) + //获取终点 + let endPoint = CGPoint(x: bounds.maxX, y: bounds.maxY) + //路径起始点 + path.move(to: startPoint) + //增加路线 + path.addLine(to: endPoint) + //初始化进度槽 + trackLayer = .init() + //路径宽 + trackLayer.lineWidth = bounds.height + trackLayer.fillColor = UIColor.clear.cgColor + //路径颜色 + trackLayer.strokeColor = Constant.trackColor.cgColor + //设置起始点 + trackLayer.strokeStart = 0 + //设置当前点 + trackLayer.strokeEnd = 0 + //路径端口为圆形 + trackLayer.lineCap = .round + trackLayer.path = path.cgPath + layer.addSublayer(trackLayer) + //初始化渐变色进度条 + gradientLayer = .init() + //渐变层大小 + gradientLayer.frame = .init(x: 0, y: -2, width: bounds.size.width, height: bounds.size.height+1) +// gradientLayer.shadowPath = trackLayer.path + //渐变层颜色 + gradientLayer.colors = Constant.progressColors + //渐变层起始点 + gradientLayer.startPoint = .init(x: 0, y: 1) + //渐变层终点 + gradientLayer.endPoint = .init(x: 1, y: 1) + layer.addSublayer(gradientLayer) + //渐变层遮罩 + gradientLayer.mask = trackLayer + } + //layer添加 + private func setUpLayers() { + backgroundColor = .init(hex: "#FFFFFF", alpha: 0.15) + } + /// 渐变色执行方法 + /// - Parameter progress: 进度值 + func setProgress(_ progress: CGFloat) { + if progress <= 1 { + //进度条动画 + trackLayer.strokeEnd = progress + } + } +} diff --git a/MusicPlayer/MusicPlayer.xcdatamodeld/MusicPlayer.xcdatamodel/contents b/MusicPlayer/MusicPlayer.xcdatamodeld/MusicPlayer.xcdatamodel/contents deleted file mode 100644 index 50d2514..0000000 --- a/MusicPlayer/MusicPlayer.xcdatamodeld/MusicPlayer.xcdatamodel/contents +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff --git a/MusicPlayer/SceneDelegate.swift b/MusicPlayer/SceneDelegate.swift deleted file mode 100644 index 02293ba..0000000 --- a/MusicPlayer/SceneDelegate.swift +++ /dev/null @@ -1,55 +0,0 @@ -// -// SceneDelegate.swift -// MusicPlayer -// -// Created by aaa on 2024/3/25. -// - -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 necessarily 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. - - // Save changes in the application's managed object context when the application transitions to the background. - (UIApplication.shared.delegate as? AppDelegate)?.saveContext() - } - - -} -