From af63582d43cb562137145dcda7de359a132a7129 Mon Sep 17 00:00:00 2001 From: panqihua <1029559041@qq.com> Date: Fri, 3 Jul 2020 23:30:27 -0700 Subject: [PATCH] =?UTF-8?q?=E6=90=9C=E7=B4=A2=E6=AD=8C=E6=9B=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cloudmusic.xcodeproj/project.pbxproj | 74 ++++++- .../contents.xcworkspacedata | 2 +- cloudmusic/Alert.swift | 29 +++ cloudmusic/AppDelegate.swift | 5 +- .../Pause.imageset/Contents.json | 21 ++ .../Assets.xcassets/Pause.imageset/Pause.png | Bin 0 -> 4714 bytes .../next.imageset/Contents.json | 21 ++ .../Assets.xcassets/next.imageset/next.png | Bin 0 -> 3150 bytes .../play.imageset/Contents.json | 21 ++ .../Assets.xcassets/play.imageset/play.png | Bin 0 -> 5557 bytes .../previous.imageset/Contents.json | 21 ++ .../previous.imageset/previous.png | Bin 0 -> 3160 bytes cloudmusic/Base.lproj/Main.storyboard | 193 ++++++++++++------ cloudmusic/FirstViewController.swift | 20 -- cloudmusic/Info.plist | 7 + cloudmusic/MusicRequest.swift | 33 +++ cloudmusic/PlayController.swift | 36 ++++ cloudmusic/PlayListController.swift | 83 ++++++++ cloudmusic/SearchController.swift | 117 +++++++++++ cloudmusic/SecondViewController.swift | 20 -- .../cloudmusic.xcdatamodel/contents | 10 +- 21 files changed, 593 insertions(+), 120 deletions(-) create mode 100644 cloudmusic/Alert.swift create mode 100644 cloudmusic/Assets.xcassets/Pause.imageset/Contents.json create mode 100644 cloudmusic/Assets.xcassets/Pause.imageset/Pause.png create mode 100644 cloudmusic/Assets.xcassets/next.imageset/Contents.json create mode 100644 cloudmusic/Assets.xcassets/next.imageset/next.png create mode 100644 cloudmusic/Assets.xcassets/play.imageset/Contents.json create mode 100644 cloudmusic/Assets.xcassets/play.imageset/play.png create mode 100644 cloudmusic/Assets.xcassets/previous.imageset/Contents.json create mode 100644 cloudmusic/Assets.xcassets/previous.imageset/previous.png delete mode 100644 cloudmusic/FirstViewController.swift create mode 100644 cloudmusic/MusicRequest.swift create mode 100644 cloudmusic/PlayController.swift create mode 100644 cloudmusic/PlayListController.swift create mode 100644 cloudmusic/SearchController.swift delete mode 100644 cloudmusic/SecondViewController.swift diff --git a/cloudmusic.xcodeproj/project.pbxproj b/cloudmusic.xcodeproj/project.pbxproj index cdf5f64..28109af 100644 --- a/cloudmusic.xcodeproj/project.pbxproj +++ b/cloudmusic.xcodeproj/project.pbxproj @@ -3,20 +3,25 @@ archiveVersion = 1; classes = { }; - objectVersion = 50; + objectVersion = 52; objects = { /* Begin PBXBuildFile section */ 7151CAA824AFE14D004C4563 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7151CAA724AFE14D004C4563 /* AppDelegate.swift */; }; 7151CAAA24AFE14D004C4563 /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7151CAA924AFE14D004C4563 /* SceneDelegate.swift */; }; - 7151CAAC24AFE14D004C4563 /* FirstViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7151CAAB24AFE14D004C4563 /* FirstViewController.swift */; }; - 7151CAAE24AFE14D004C4563 /* SecondViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7151CAAD24AFE14D004C4563 /* SecondViewController.swift */; }; 7151CAB124AFE14D004C4563 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 7151CAAF24AFE14D004C4563 /* Main.storyboard */; }; 7151CAB424AFE14D004C4563 /* cloudmusic.xcdatamodeld in Sources */ = {isa = PBXBuildFile; fileRef = 7151CAB224AFE14D004C4563 /* cloudmusic.xcdatamodeld */; }; 7151CAB624AFE152004C4563 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 7151CAB524AFE152004C4563 /* Assets.xcassets */; }; 7151CAB924AFE152004C4563 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 7151CAB724AFE152004C4563 /* LaunchScreen.storyboard */; }; 7151CAC424AFE153004C4563 /* cloudmusicTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7151CAC324AFE153004C4563 /* cloudmusicTests.swift */; }; 7151CACF24AFE153004C4563 /* cloudmusicUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7151CACE24AFE153004C4563 /* cloudmusicUITests.swift */; }; + 7151CADF24AFE612004C4563 /* PlayListController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7151CADE24AFE612004C4563 /* PlayListController.swift */; }; + 7151CAEA24AFFE6B004C4563 /* Alamofire in Frameworks */ = {isa = PBXBuildFile; productRef = 7151CAE924AFFE6B004C4563 /* Alamofire */; }; + 7151CAEC24B001EF004C4563 /* MusicRequest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7151CAEB24B001EE004C4563 /* MusicRequest.swift */; }; + 7151CAEE24B00ED4004C4563 /* PlayController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7151CAED24B00ED4004C4563 /* PlayController.swift */; }; + 7151CAF024B01A6B004C4563 /* SearchController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7151CAEF24B01A6B004C4563 /* SearchController.swift */; }; + 7151CAF524B02DDA004C4563 /* SwiftyJSON in Frameworks */ = {isa = PBXBuildFile; productRef = 7151CAF424B02DDA004C4563 /* SwiftyJSON */; }; + 7151CB0124B042BC004C4563 /* Alert.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7151CB0024B042BC004C4563 /* Alert.swift */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -40,8 +45,6 @@ 7151CAA424AFE14D004C4563 /* cloudmusic.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = cloudmusic.app; sourceTree = BUILT_PRODUCTS_DIR; }; 7151CAA724AFE14D004C4563 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 7151CAA924AFE14D004C4563 /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = ""; }; - 7151CAAB24AFE14D004C4563 /* FirstViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FirstViewController.swift; sourceTree = ""; }; - 7151CAAD24AFE14D004C4563 /* SecondViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SecondViewController.swift; sourceTree = ""; }; 7151CAB024AFE14D004C4563 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 7151CAB324AFE14D004C4563 /* cloudmusic.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = cloudmusic.xcdatamodel; sourceTree = ""; }; 7151CAB524AFE152004C4563 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; @@ -53,6 +56,11 @@ 7151CACA24AFE153004C4563 /* cloudmusicUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = cloudmusicUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 7151CACE24AFE153004C4563 /* cloudmusicUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = cloudmusicUITests.swift; sourceTree = ""; }; 7151CAD024AFE153004C4563 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 7151CADE24AFE612004C4563 /* PlayListController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PlayListController.swift; sourceTree = ""; }; + 7151CAEB24B001EE004C4563 /* MusicRequest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MusicRequest.swift; sourceTree = ""; }; + 7151CAED24B00ED4004C4563 /* PlayController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PlayController.swift; sourceTree = ""; }; + 7151CAEF24B01A6B004C4563 /* SearchController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SearchController.swift; sourceTree = ""; }; + 7151CB0024B042BC004C4563 /* Alert.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Alert.swift; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -60,6 +68,8 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 7151CAF524B02DDA004C4563 /* SwiftyJSON in Frameworks */, + 7151CAEA24AFFE6B004C4563 /* Alamofire in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -105,13 +115,16 @@ children = ( 7151CAA724AFE14D004C4563 /* AppDelegate.swift */, 7151CAA924AFE14D004C4563 /* SceneDelegate.swift */, - 7151CAAB24AFE14D004C4563 /* FirstViewController.swift */, - 7151CAAD24AFE14D004C4563 /* SecondViewController.swift */, 7151CAAF24AFE14D004C4563 /* Main.storyboard */, 7151CAB524AFE152004C4563 /* Assets.xcassets */, 7151CAB724AFE152004C4563 /* LaunchScreen.storyboard */, 7151CABA24AFE152004C4563 /* Info.plist */, 7151CAB224AFE14D004C4563 /* cloudmusic.xcdatamodeld */, + 7151CADE24AFE612004C4563 /* PlayListController.swift */, + 7151CAEB24B001EE004C4563 /* MusicRequest.swift */, + 7151CAED24B00ED4004C4563 /* PlayController.swift */, + 7151CAEF24B01A6B004C4563 /* SearchController.swift */, + 7151CB0024B042BC004C4563 /* Alert.swift */, ); path = cloudmusic; sourceTree = ""; @@ -150,6 +163,10 @@ dependencies = ( ); name = cloudmusic; + packageProductDependencies = ( + 7151CAE924AFFE6B004C4563 /* Alamofire */, + 7151CAF424B02DDA004C4563 /* SwiftyJSON */, + ); productName = cloudmusic; productReference = 7151CAA424AFE14D004C4563 /* cloudmusic.app */; productType = "com.apple.product-type.application"; @@ -222,6 +239,10 @@ Base, ); mainGroup = 7151CA9B24AFE14D004C4563; + packageReferences = ( + 7151CAE824AFFE6B004C4563 /* XCRemoteSwiftPackageReference "Alamofire" */, + 7151CAF324B02DDA004C4563 /* XCRemoteSwiftPackageReference "SwiftyJSON" */, + ); productRefGroup = 7151CAA524AFE14D004C4563 /* Products */; projectDirPath = ""; projectRoot = ""; @@ -265,10 +286,13 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - 7151CAAE24AFE14D004C4563 /* SecondViewController.swift in Sources */, + 7151CB0124B042BC004C4563 /* Alert.swift in Sources */, + 7151CAEE24B00ED4004C4563 /* PlayController.swift in Sources */, + 7151CADF24AFE612004C4563 /* PlayListController.swift in Sources */, 7151CAB424AFE14D004C4563 /* cloudmusic.xcdatamodeld in Sources */, - 7151CAAC24AFE14D004C4563 /* FirstViewController.swift in Sources */, + 7151CAEC24B001EF004C4563 /* MusicRequest.swift in Sources */, 7151CAA824AFE14D004C4563 /* AppDelegate.swift in Sources */, + 7151CAF024B01A6B004C4563 /* SearchController.swift in Sources */, 7151CAAA24AFE14D004C4563 /* SceneDelegate.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; @@ -593,6 +617,38 @@ }; /* End XCConfigurationList section */ +/* Begin XCRemoteSwiftPackageReference section */ + 7151CAE824AFFE6B004C4563 /* XCRemoteSwiftPackageReference "Alamofire" */ = { + isa = XCRemoteSwiftPackageReference; + repositoryURL = "https://github.com/Alamofire/Alamofire.git"; + requirement = { + kind = upToNextMajorVersion; + minimumVersion = 5.2.1; + }; + }; + 7151CAF324B02DDA004C4563 /* XCRemoteSwiftPackageReference "SwiftyJSON" */ = { + isa = XCRemoteSwiftPackageReference; + repositoryURL = "https://github.com/SwiftyJSON/SwiftyJSON.git"; + requirement = { + kind = upToNextMajorVersion; + minimumVersion = 5.0.0; + }; + }; +/* End XCRemoteSwiftPackageReference section */ + +/* Begin XCSwiftPackageProductDependency section */ + 7151CAE924AFFE6B004C4563 /* Alamofire */ = { + isa = XCSwiftPackageProductDependency; + package = 7151CAE824AFFE6B004C4563 /* XCRemoteSwiftPackageReference "Alamofire" */; + productName = Alamofire; + }; + 7151CAF424B02DDA004C4563 /* SwiftyJSON */ = { + isa = XCSwiftPackageProductDependency; + package = 7151CAF324B02DDA004C4563 /* XCRemoteSwiftPackageReference "SwiftyJSON" */; + productName = SwiftyJSON; + }; +/* End XCSwiftPackageProductDependency section */ + /* Begin XCVersionGroup section */ 7151CAB224AFE14D004C4563 /* cloudmusic.xcdatamodeld */ = { isa = XCVersionGroup; diff --git a/cloudmusic.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/cloudmusic.xcodeproj/project.xcworkspace/contents.xcworkspacedata index 7b6535d..919434a 100644 --- a/cloudmusic.xcodeproj/project.xcworkspace/contents.xcworkspacedata +++ b/cloudmusic.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -2,6 +2,6 @@ + location = "self:"> diff --git a/cloudmusic/Alert.swift b/cloudmusic/Alert.swift new file mode 100644 index 0000000..824ac6d --- /dev/null +++ b/cloudmusic/Alert.swift @@ -0,0 +1,29 @@ +// +// Alert.swift +// cloudmusic +// +// Created by Qihua Pan on 2020/7/3. +// Copyright © 2020 Qihua Pan. All rights reserved. +// + +import UIKit +import CoreData +extension UIViewController{ + func alert(message:String,title:String="警告信息",preferredStyle:UIAlertController.Style=UIAlertController.Style.alert,style:UIAlertAction.Style=UIAlertAction.Style.destructive){ + let alertController = UIAlertController(title: title, message: message, preferredStyle: preferredStyle) + + alertController.addAction(UIAlertAction(title: "确认", style:style, handler: nil)) + + self.present(alertController, animated: true, completion: nil) + } + + //获取上下文对象 + func getContext()-> NSManagedObjectContext { + //获取总代理 + let appDelegate = UIApplication.shared.delegate as! AppDelegate + //获取托管对象总管 + //let managedObjectContect = appDelegate.persistentContainer.viewContext + //返回托管对象总管 + return appDelegate.persistentContainer.viewContext + } +} diff --git a/cloudmusic/AppDelegate.swift b/cloudmusic/AppDelegate.swift index 26b40a1..b7a103e 100644 --- a/cloudmusic/AppDelegate.swift +++ b/cloudmusic/AppDelegate.swift @@ -77,6 +77,9 @@ class AppDelegate: UIResponder, UIApplicationDelegate { } } } - + + + + } diff --git a/cloudmusic/Assets.xcassets/Pause.imageset/Contents.json b/cloudmusic/Assets.xcassets/Pause.imageset/Contents.json new file mode 100644 index 0000000..05c7bf7 --- /dev/null +++ b/cloudmusic/Assets.xcassets/Pause.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "Pause.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/cloudmusic/Assets.xcassets/Pause.imageset/Pause.png b/cloudmusic/Assets.xcassets/Pause.imageset/Pause.png new file mode 100644 index 0000000000000000000000000000000000000000..617045ce90bbae3563bfa8d25917e8b395ce7b95 GIT binary patch literal 4714 zcmeHL_ct6&+ukTqqKm#Ht0cj*ON7PhELLarURQ~-!s z649fC1d-SC{r3Iv{R7{5=bV}AzUIt*-Dj>dXU>_y>T0V}Q?gS6003$=1RQyTL;rSi z;+ru$%Bt!HNSqY36aaww#5-5Eq&NJQH&Rs*Q1cPEeM9csBam7EK;Q!a;6(%gaB(yB z;yVD~BMboS*Z=^qOaOqzGq+t&8UP^ruB&OFe6!%c?Y|EEzjr_}x$Dc#CeJZQZG8aa z6MgTv{Dy(~)q~UeJTDOj7WmlF2WDbH$D);QjegR%AD~;B-T4$!mzVJJM9F)cp*1#3sL|sgP5sX6%fMzEsK%zu!-3*fDH(l5%WKy%jmNQbkx8YM9M#&M62Y>G z=9y2`+n#|7S`9uW)I3rX$|>`(!HE~wMcu1UUy{nCe^7jvk!Z^*}o*X(f<=4=iI&48K1G2~um>Cw9of8Kpc&c94 zTG0ReL4C+%+q6oq(0K_LVA4x0@A^}OJL{&IES$A5WAcgFUPr%6pT8!asVMK$*P#_f zDo+&jDm5j2=}+oadP$Y?xa!2S+F+(o3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rA>=rnf+eZW3C+VL5$`z6`m>w9bsTWp&fmq+hNV7?GzCAUx)pLUXy zLi?vNrMffSn(8Alm653(Zr?aTa zx%hEF7d*Wix^)=ime#P^*70mT*QSLe<51vSL(*#z=eer}X12EaItM-S&LK8tSiGoi ze`jbVslob2H(*goWU~$a5@`>xp(x-A3m{Oj}RWOU{YXGY|kx%Nty-jigfOs!0{jo}i6j{wwE=`GtxrOIiu zV4sWOuO*tahUk>8m3f{g>Fgsgs6xheh1>or7hJpzR2|1(PQ9`y3?k*leF7{{-up`<7 vBZP7H{2ylR>S-_O<|>JHaQ6_>we|5vL2g8N&<#&+Gy!VL+VC1hoACbtUCdKM literal 0 HcmV?d00001 diff --git a/cloudmusic/Assets.xcassets/next.imageset/Contents.json b/cloudmusic/Assets.xcassets/next.imageset/Contents.json new file mode 100644 index 0000000..3f1e536 --- /dev/null +++ b/cloudmusic/Assets.xcassets/next.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "next.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/cloudmusic/Assets.xcassets/next.imageset/next.png b/cloudmusic/Assets.xcassets/next.imageset/next.png new file mode 100644 index 0000000000000000000000000000000000000000..873ae55bcac323f5bdb14a8db2964a5365bdcd6f GIT binary patch literal 3150 zcmeHJS5TAN7XA~8NoWBAgl#NHs%5_DHs3% z0u}_k9S3`VEeIFK7p9QvIlz6<#M%S^?%&}1N#@~jP=uX14rq8Q!{!hKga#ooE06;2PUA_NO@q{;_{L@c-X|4?K?hoLkOB z+S!}~c(IW=bx)t%3Bw7Axg`{oCix(E>{_;VJ@^UFe!eAv4@E65$H+1V)Xz>XSnF?| z%jVm&73l1jlbHFc`qyVhAE@a^aDKtx-jMZcudv zrqegq>4zoXjh2QRUO4<|z4WFwG3d&fHDP7Qc^WZm| zUe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7c^ zt%AUpEOBQYBZ3)&f!)>_vmMU2O?=-7|H<-wXpE=tej{=rm%4x0wCGR~>~aakO+q>w_{EZqsbjAk6#-wC7-ixMoEx)S8i#Zs;Ak2~67 z<9Re^OJ~?5)OJA8S0=|mlH3%7Z#>9P@o>{Irj(F-pV&?w-jGUghMW)TSL3;I%YrZ# zMte4qOv+VFO0 zkyW|~LB~eaA}yh6szAt1FB10`2&T4>&Q4CNP0pK*?kv*jHTLZ#lq|R5+7WV4nB0NS zbWgBsA!4d2@hr7HdNHvW%cpN(Z8`+n6_x6p4l^p@B`ipF5qAp|Q?=3am+qXqd)Xdr zzq3XT&tIArD>W6A^J%N0do-STA3t5dkg($uGx}M;u7HbJCLBeTRtDB2du1ldxPRB$ zJ|pSX1EmR*rr#@I9kL?ak=JEdOOoaA`nBmHyh;>2RH+kF>O)gb79~?uE*Fhg!t8!( zcdq>?10NuNFoBYpjySZk)LYC;d5nf_AOe&%4rMD^H z3UlADpnlez-R4e3G&@$f*+vOmbL>59$4?jk8cWy83#(?T^r5`6X{PKs2NE)DprY7{ zcnLQiX`#m%%GC+l~6 z3+wJu9eqSDY?=#+S({?38&rohi=WBUs^{Uqx!X($-XBl7SAI#T=0H57NcALISGhuz z&?+5NyGNOPd{gm~o8HHl+qJ2`dkK!}toL{9ll-Z2{~2&)ItRdd*4%}8sFgBj%>EX6 z+9}eD9O;dvgnM%U(7C?UbBJ|V%8=*XbZ pe>3-hP>OzFfPRQqP%t{!J2p~{qw%?8>I_E`usCglZ@_sZ{R?PFOb!45 literal 0 HcmV?d00001 diff --git a/cloudmusic/Assets.xcassets/play.imageset/Contents.json b/cloudmusic/Assets.xcassets/play.imageset/Contents.json new file mode 100644 index 0000000..222061f --- /dev/null +++ b/cloudmusic/Assets.xcassets/play.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "play.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/cloudmusic/Assets.xcassets/play.imageset/play.png b/cloudmusic/Assets.xcassets/play.imageset/play.png new file mode 100644 index 0000000000000000000000000000000000000000..54483b3175a4e611bcc259e108156b6cfe7586c1 GIT binary patch literal 5557 zcmeHr?(z;@|hn zt#6$rNq*M6I7AA*1p`N$t+AHk1n8W`pBEVE-!l3?n#Jltdp zzu&h=_~AhF>ohUo!|ha8Wl?!e|H_pSiq2Y7v^+i#7E-o2%+c#4mN`lF+mKrO(}oMG z$lMr{ZAT9SMz{|JODbR6v?;b`UZZprDfGOK?(b{!`%x*7nVwK6R%tr!mzlyoZ`ETm z!au}A4Q%<CK= zd>a|Bq^xhB(O$2Swt6O!BDX!_Ch#%Y6>`%3D$c*y12|j$U(rD^f1?NmL}Jh?Jrf)k zC4Kj2{BN%WP#CqB1OSL&FsO{S_v&PhkKYUVmqDEQ(#f!P7||Ef5E`=)7iNa!dUPff z5*$Sj01h?}4QjBj z&Vq!_!h*!#$FtnpU#D50Ybz0Vr)09}O42Q-ZR-X_)-^r(rix1C2)m^U!@7Xbhz06! zeG82*VZz-tqZg`z{;mS{n}t?Yi;uNsNl<8Ol-=1(`@pPFkf1GoQCw6q@?|E9DT^+`}@19Vteg!8faSc#p1>mKK9_yU{+B(Yp|=t11!nK zW*SOHVGKLHBM&qS`=zEU@2Yxw3%f>BKq58g&AnOfosh`!?mMjo3-1yWmG(G_oO{Et zowRKf6d|*)k`nht_L83xX!h3l(a}`m#fvjN6CXrlShkK@LoM_i^8{fulDm(ROi0Tl zc}4knr{6uF8oCWTTo>C+39bK@%fVB=llnafqjt0g9-CQEAyT5!&6)8>UO%YMds~v! zRnn!DsR({c6X05c#GfQk=>?p(Diq$+1)4|n67svJ%TqKR9UI2waf-6$2?u0fy6~42 zu<-nQ7{0}i;MTKM_+BlracD8id`IJ->=An)@!46o&HcMd*OhIfdF%rVq-OkE**t}9 zbJ#{~d#+dI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A23;=TLWG$t!0BilG3 zrX$8LqWD**$E~;^G7?o{WIiGIdwXg zeQ@1YadvavC>Ll#nnbu-;eyrREAx&U#Z>QUsZ*|-l!O(s+7)HLI$b(E${&H+jI8Y( zS<2;&E9o$N-P2~MX|*36u~jB_@T`ul;^i^-@$X*8>3VGAH#3{`+@^=?O-JMRnJ^Q_ zFi&C_N#7%c!~sA9rGY}AbPy;_JCvUO1ucD)h6+koABEDLH@5#ThX9Hv*(>^gJD9bl z9*yl5M;SsRy!G9Qp(I3j2pRAq`;+vMNTd%XfP^G^29N`hWDiOp!iy3Zh71b``Vafb pFUUjB-%pR?84!pJ3L!<1DdC}NoH+1(4;&{fU}j>4dxmjK{5SASXyX6? literal 0 HcmV?d00001 diff --git a/cloudmusic/Base.lproj/Main.storyboard b/cloudmusic/Base.lproj/Main.storyboard index 7a85710..ea904d3 100644 --- a/cloudmusic/Base.lproj/Main.storyboard +++ b/cloudmusic/Base.lproj/Main.storyboard @@ -1,102 +1,161 @@ - + + - + - - + + - - - + + + + + + + + + + + + + + + + + + + + + + - - + + + + + - - - - - - - - + + - + + + + - + - + - - + + - - - + + + - - - - - - - - - + + - + + + + + - + - + - - + + - - - - - - + + + + + + + + + + + + + + + + + + + + + + + - - + + - - + + - + - - + + + + diff --git a/cloudmusic/FirstViewController.swift b/cloudmusic/FirstViewController.swift deleted file mode 100644 index c3cb8a7..0000000 --- a/cloudmusic/FirstViewController.swift +++ /dev/null @@ -1,20 +0,0 @@ -// -// FirstViewController.swift -// cloudmusic -// -// Created by Qihua Pan on 2020/7/3. -// Copyright © 2020 Qihua Pan. All rights reserved. -// - -import UIKit - -class FirstViewController: UIViewController { - - override func viewDidLoad() { - super.viewDidLoad() - // Do any additional setup after loading the view. - } - - -} - diff --git a/cloudmusic/Info.plist b/cloudmusic/Info.plist index e7f6f58..0d2eb29 100644 --- a/cloudmusic/Info.plist +++ b/cloudmusic/Info.plist @@ -18,8 +18,15 @@ 1.0 CFBundleVersion 1 + LSApplicationCategoryType + LSRequiresIPhoneOS + NSAppTransportSecurity + + NSAllowsArbitraryLoads + + UIApplicationSceneManifest UIApplicationSupportsMultipleScenes diff --git a/cloudmusic/MusicRequest.swift b/cloudmusic/MusicRequest.swift new file mode 100644 index 0000000..a68f1a4 --- /dev/null +++ b/cloudmusic/MusicRequest.swift @@ -0,0 +1,33 @@ +// +// MusicRequest.swift +// cloudmusic +// +// Created by Qihua Pan on 2020/7/3. +// Copyright © 2020 Qihua Pan. All rights reserved. +// + +import UIKit +import Alamofire +import SwiftyJSON +//音乐接口请求 +class MusicRequest: NSObject { + + //接口服务端地址 + private static let request_host = "192.168.50.73:5000" + + //关键词搜索歌曲 + static func search(keyword:String,callback:@escaping (JSON?) -> Void ){ + let url="http://\(String(describing: request_host))/search?keywords=\(keyword)" + debugPrint("搜索请求接口地址:\(url)") + AF.request(url).responseJSON { response in + debugPrint(response) + + if let json = try? JSON(data: response.data!){ + callback(json) + }else{ + callback(nil) + } + + } + } +} diff --git a/cloudmusic/PlayController.swift b/cloudmusic/PlayController.swift new file mode 100644 index 0000000..2d68ef9 --- /dev/null +++ b/cloudmusic/PlayController.swift @@ -0,0 +1,36 @@ +// +// PlayController.swift +// cloudmusic +// +// Created by Qihua Pan on 2020/7/3. +// Copyright © 2020 Qihua Pan. All rights reserved. +// + +import UIKit + +class PlayController: UIViewController { + + + @IBOutlet weak var progress: UIProgressView! + + override func viewDidLoad() { + super.viewDidLoad() + + // Do any additional setup after loading the view. + + progress.transform = CGAffineTransform(scaleX: 1, y: 3.0) + + } + + + /* + // MARK: - Navigation + + // In a storyboard-based application, you will often want to do a little preparation before navigation + override func prepare(for segue: UIStoryboardSegue, sender: Any?) { + // Get the new view controller using segue.destination. + // Pass the selected object to the new view controller. + } + */ + +} diff --git a/cloudmusic/PlayListController.swift b/cloudmusic/PlayListController.swift new file mode 100644 index 0000000..c32f0d6 --- /dev/null +++ b/cloudmusic/PlayListController.swift @@ -0,0 +1,83 @@ +// +// PlayListController.swift +// cloudmusic +// +// Created by Qihua Pan on 2020/7/3. +// Copyright © 2020 Qihua Pan. All rights reserved. +// + +import UIKit + +class PlayListController: UIViewController { + @IBOutlet weak var table: UITableView! + + // 注意: Swift中mark注释的格式: MARK:- + // MARK:- 属性 + let cellID = "cell" + + override func viewDidLoad() { + super.viewDidLoad() + + // 设置数据源代理 + table.dataSource = self + table.delegate = self + + // 注册cell + table.register(UITableViewCell.self, forCellReuseIdentifier: cellID) + } + + + /* + // MARK: - Navigation + + // In a storyboard-based application, you will often want to do a little preparation before navigation + override func prepare(for segue: UIStoryboardSegue, sender: Any?) { + // Get the new view controller using segue.destination. + // Pass the selected object to the new view controller. + } + */ + +} + +extension PlayListController: UITableViewDataSource,UITableViewDelegate{ + + + + // MARK:- UITableViewDataSource数据源 + // 必须实现UITableViewDataSource的option修饰的必须实现的方法,否则会报错 + func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { + return 20 + } + + func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { + /* + // ---------------------------------------------------------------- + // 使用普通方式创建cell + let cellID = "cell" + + // 1.创建cell,此时cell是可选类型 + var cell = tableView.dequeueReusableCellWithIdentifier(cellID) + + // 2.判断cell是否为nil + if cell == nil { + cell = UITableViewCell(style: .Default, reuseIdentifier: cellID) + } + + // 3.设置cell数据 + cell?.textLabel?.text = "测试数据\(indexPath.row)" + + return cell! + */ + + let cell = tableView.dequeueReusableCell(withIdentifier: cellID) + + cell?.textLabel?.text = "测试数据\(indexPath.row)" + + return cell! } + + + // MARK:- UITableViewDelegate代理 + private func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) { + print("点击了\(indexPath.row)") + } +} diff --git a/cloudmusic/SearchController.swift b/cloudmusic/SearchController.swift new file mode 100644 index 0000000..1da5f32 --- /dev/null +++ b/cloudmusic/SearchController.swift @@ -0,0 +1,117 @@ +// +// SearchController.swift +// cloudmusic +// +// Created by Qihua Pan on 2020/7/3. +// Copyright © 2020 Qihua Pan. All rights reserved. +// + +import UIKit +import SwiftyJSON +import CoreData +class SearchController: UIViewController { + + // 注意: Swift中mark注释的格式: MARK:- + // MARK:- 属性 + let cellID = "cell" + //关键词 + @IBOutlet weak var keyword: UITextField! + + //搜索结果表格 + @IBOutlet weak var musicTable: UITableView! + + //搜索结果 + + var musicList:[cloudmusic.Music]=[] + + + //关键词检索歌曲 + @IBAction func search(_ sender: UIButton) { + self.textFieldShouldReturn(keyword) + if let k=keyword{ + if k.text!.count>0{ + MusicRequest.search(keyword: k.text!,callback: {(json) in + debugPrint("json:\(String(describing: json))") + if let res=json{ + if res["code"]==200{ + self.musicList=[] + for (_,subJson):(String, JSON) in res["result"]["songs"] { +// debugPrint("index=\(index),subJson=\(subJson)") + let context=self.getContext() + let music = NSEntityDescription.insertNewObject(forEntityName: "Music", into: context) as! Music + music.id=subJson["id"].int64Value + music.name=subJson["name"].stringValue + debugPrint("id=\(music.id),name=\(String(describing: music.name))") + self.musicList.append(music) + } + self.musicTable.reloadData() + self.musicTable.isHidden=false + }else{ + self.alert(message: "请求失败,请稍后再试") + } + }else{ + self.alert(message: "请求失败,请稍后再试") + } + }) + }else{ + self.alert(message: "关键词不能为空") + } + } + } + + override func viewDidLoad() { + super.viewDidLoad() + + // Do any additional setup after loading the view. + // 设置数据源代理 + self.musicTable.dataSource = self + self.musicTable.delegate = self + self.musicTable.isHidden=true + + // 注册cell + self.musicTable.register(UITableViewCell.self, forCellReuseIdentifier: cellID) + + self.keyword.delegate=self + self.keyword.returnKeyType=UIReturnKeyType.done + + + } + + + /* + // MARK: - Navigation + + // In a storyboard-based application, you will often want to do a little preparation before navigation + override func prepare(for segue: UIStoryboardSegue, sender: Any?) { + // Get the new view controller using segue.destination. + // Pass the selected object to the new view controller. + } + */ + +} + +extension SearchController: UITableViewDataSource,UITableViewDelegate{ + func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { + return musicList.count + } + + func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { + let cell = tableView.dequeueReusableCell(withIdentifier: cellID) + + cell?.textLabel?.text = "歌曲名:\(String(describing: musicList[indexPath.row].name!))" + return cell! + } + + +} + +extension SearchController:UITextFieldDelegate{ + func textFieldShouldReturn(_ textField: UITextField) -> Bool { + self.keyword.resignFirstResponder() + return true + } + + func textFieldDidEndEditing(_ textField: UITextField) { + self.search(UIButton()) + } +} diff --git a/cloudmusic/SecondViewController.swift b/cloudmusic/SecondViewController.swift deleted file mode 100644 index 9f6df4c..0000000 --- a/cloudmusic/SecondViewController.swift +++ /dev/null @@ -1,20 +0,0 @@ -// -// SecondViewController.swift -// cloudmusic -// -// Created by Qihua Pan on 2020/7/3. -// Copyright © 2020 Qihua Pan. All rights reserved. -// - -import UIKit - -class SecondViewController: UIViewController { - - override func viewDidLoad() { - super.viewDidLoad() - // Do any additional setup after loading the view. - } - - -} - diff --git a/cloudmusic/cloudmusic.xcdatamodeld/cloudmusic.xcdatamodel/contents b/cloudmusic/cloudmusic.xcdatamodeld/cloudmusic.xcdatamodel/contents index 50d2514..90c75b4 100644 --- a/cloudmusic/cloudmusic.xcdatamodeld/cloudmusic.xcdatamodel/contents +++ b/cloudmusic/cloudmusic.xcdatamodeld/cloudmusic.xcdatamodel/contents @@ -1,4 +1,10 @@ - - + + + + + + + + \ No newline at end of file