diff --git "a/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic.xcodeproj/project.pbxproj" "b/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic.xcodeproj/project.pbxproj" new file mode 100644 index 00000000..44fe5d46 --- /dev/null +++ "b/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic.xcodeproj/project.pbxproj" @@ -0,0 +1,647 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + BB18D5D179F573D66F16D218 /* libPods-NetMusic.a in Frameworks */ = {isa = PBXBuildFile; fileRef = FE32BBE9A4325BEFD70233F5 /* libPods-NetMusic.a */; }; + CD0E457B1A2C626300389DF4 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = CD0E457A1A2C626300389DF4 /* main.m */; }; + CD0E457E1A2C626300389DF4 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = CD0E457D1A2C626300389DF4 /* AppDelegate.m */; }; + CD0E45861A2C626300389DF4 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = CD0E45851A2C626300389DF4 /* Images.xcassets */; }; + CD0E45891A2C626300389DF4 /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = CD0E45871A2C626300389DF4 /* LaunchScreen.xib */; }; + CD0E45951A2C626300389DF4 /* NetMusicTests.m in Sources */ = {isa = PBXBuildFile; fileRef = CD0E45941A2C626300389DF4 /* NetMusicTests.m */; }; + CD0E45A31A2C63F800389DF4 /* BaseViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = CD0E45A21A2C63F800389DF4 /* BaseViewController.m */; }; + CD0E45A71A2C675D00389DF4 /* GlobalDefine.m in Sources */ = {isa = PBXBuildFile; fileRef = CD0E45A61A2C675D00389DF4 /* GlobalDefine.m */; }; + CD0E45AA1A2C798100389DF4 /* MainViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = CD0E45A91A2C798100389DF4 /* MainViewController.m */; }; + CD16851F1A2F77D800D47E45 /* ChannelViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = CD16851E1A2F77D800D47E45 /* ChannelViewController.m */; }; + CD1685261A30930A00D47E45 /* ShadeView.m in Sources */ = {isa = PBXBuildFile; fileRef = CD1685251A30930A00D47E45 /* ShadeView.m */; }; + CD16852F1A30A87500D47E45 /* QCBBaseRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = CD16852E1A30A87500D47E45 /* QCBBaseRequest.m */; }; + CD1685331A30BE7300D47E45 /* QCBBaseModel.m in Sources */ = {isa = PBXBuildFile; fileRef = CD1685321A30BE7300D47E45 /* QCBBaseModel.m */; }; + CD1685361A30BF8200D47E45 /* QCBChannelModel.m in Sources */ = {isa = PBXBuildFile; fileRef = CD1685351A30BF8200D47E45 /* QCBChannelModel.m */; }; + CD1685391A31398A00D47E45 /* QCBBaseRequest+ChannelRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = CD1685381A31398A00D47E45 /* QCBBaseRequest+ChannelRequest.m */; }; + CD327BAF1A3191D300EF5A4A /* QCBSongModel.m in Sources */ = {isa = PBXBuildFile; fileRef = CD327BAE1A3191D300EF5A4A /* QCBSongModel.m */; }; + CD327BB21A31BD4F00EF5A4A /* QCBBaseRequest+SongRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = CD327BB11A31BD4F00EF5A4A /* QCBBaseRequest+SongRequest.m */; }; + CD327BB51A3216BB00EF5A4A /* SongTableViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = CD327BB41A3216BB00EF5A4A /* SongTableViewController.m */; }; + CD327BB81A32DA0200EF5A4A /* PlayerViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = CD327BB71A32DA0200EF5A4A /* PlayerViewController.m */; }; + CD540CF51A2D882C00C5D8E1 /* UIButtonMake.m in Sources */ = {isa = PBXBuildFile; fileRef = CD540CF41A2D882C00C5D8E1 /* UIButtonMake.m */; }; + CD6EDB061A337129008333A4 /* CFNetwork.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CD6EDB051A337128008333A4 /* CFNetwork.framework */; }; + CD6EDB081A337135008333A4 /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CD6EDB071A337135008333A4 /* AudioToolbox.framework */; }; + CD6EDB0A1A33714F008333A4 /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CD6EDB091A33714F008333A4 /* AVFoundation.framework */; }; + CD6EDB0C1A337173008333A4 /* libxml2.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = CD6EDB0B1A337173008333A4 /* libxml2.dylib */; }; + CD6EDB0E1A337184008333A4 /* MediaPlayer.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CD6EDB0D1A337184008333A4 /* MediaPlayer.framework */; }; + CDC0C6751A2D591700657E55 /* CRNavigationBar.m in Sources */ = {isa = PBXBuildFile; fileRef = CDC0C6721A2D591700657E55 /* CRNavigationBar.m */; }; + CDC0C6761A2D591700657E55 /* CRNavigationController.m in Sources */ = {isa = PBXBuildFile; fileRef = CDC0C6741A2D591700657E55 /* CRNavigationController.m */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + CD0E458F1A2C626300389DF4 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = CD0E456D1A2C626300389DF4 /* Project object */; + proxyType = 1; + remoteGlobalIDString = CD0E45741A2C626300389DF4; + remoteInfo = NetMusic; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 270E8F26FFE97BE1C4BD901E /* Pods-NetMusic.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-NetMusic.debug.xcconfig"; path = "Pods/Target Support Files/Pods-NetMusic/Pods-NetMusic.debug.xcconfig"; sourceTree = ""; }; + 334E48235EBA44D1677708BB /* Pods-NetMusic.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-NetMusic.release.xcconfig"; path = "Pods/Target Support Files/Pods-NetMusic/Pods-NetMusic.release.xcconfig"; sourceTree = ""; }; + CD0E45751A2C626300389DF4 /* NetMusic.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = NetMusic.app; sourceTree = BUILT_PRODUCTS_DIR; }; + CD0E45791A2C626300389DF4 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + CD0E457A1A2C626300389DF4 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + CD0E457C1A2C626300389DF4 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; + CD0E457D1A2C626300389DF4 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; + CD0E45851A2C626300389DF4 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; + CD0E45881A2C626300389DF4 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = ""; }; + CD0E458E1A2C626300389DF4 /* NetMusicTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = NetMusicTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + CD0E45931A2C626300389DF4 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + CD0E45941A2C626300389DF4 /* NetMusicTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = NetMusicTests.m; sourceTree = ""; }; + CD0E45A11A2C63F800389DF4 /* BaseViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BaseViewController.h; sourceTree = ""; }; + CD0E45A21A2C63F800389DF4 /* BaseViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BaseViewController.m; sourceTree = ""; }; + CD0E45A51A2C675D00389DF4 /* GlobalDefine.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GlobalDefine.h; sourceTree = ""; }; + CD0E45A61A2C675D00389DF4 /* GlobalDefine.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GlobalDefine.m; sourceTree = ""; }; + CD0E45A81A2C798100389DF4 /* MainViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MainViewController.h; sourceTree = ""; }; + CD0E45A91A2C798100389DF4 /* MainViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MainViewController.m; sourceTree = ""; }; + CD16851D1A2F77D800D47E45 /* ChannelViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ChannelViewController.h; sourceTree = ""; }; + CD16851E1A2F77D800D47E45 /* ChannelViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ChannelViewController.m; sourceTree = ""; }; + CD1685241A30930A00D47E45 /* ShadeView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ShadeView.h; sourceTree = ""; }; + CD1685251A30930A00D47E45 /* ShadeView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ShadeView.m; sourceTree = ""; }; + CD16852B1A3094B400D47E45 /* ShadeViewDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ShadeViewDelegate.h; sourceTree = ""; }; + CD16852D1A30A87500D47E45 /* QCBBaseRequest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = QCBBaseRequest.h; sourceTree = ""; }; + CD16852E1A30A87500D47E45 /* QCBBaseRequest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = QCBBaseRequest.m; sourceTree = ""; }; + CD1685311A30BE7300D47E45 /* QCBBaseModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = QCBBaseModel.h; sourceTree = ""; }; + CD1685321A30BE7300D47E45 /* QCBBaseModel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = QCBBaseModel.m; sourceTree = ""; }; + CD1685341A30BF8200D47E45 /* QCBChannelModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = QCBChannelModel.h; sourceTree = ""; }; + CD1685351A30BF8200D47E45 /* QCBChannelModel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = QCBChannelModel.m; sourceTree = ""; }; + CD1685371A31398A00D47E45 /* QCBBaseRequest+ChannelRequest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "QCBBaseRequest+ChannelRequest.h"; sourceTree = ""; }; + CD1685381A31398A00D47E45 /* QCBBaseRequest+ChannelRequest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "QCBBaseRequest+ChannelRequest.m"; sourceTree = ""; }; + CD327BAD1A3191D300EF5A4A /* QCBSongModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = QCBSongModel.h; sourceTree = ""; }; + CD327BAE1A3191D300EF5A4A /* QCBSongModel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = QCBSongModel.m; sourceTree = ""; }; + CD327BB01A31BD4F00EF5A4A /* QCBBaseRequest+SongRequest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "QCBBaseRequest+SongRequest.h"; sourceTree = ""; }; + CD327BB11A31BD4F00EF5A4A /* QCBBaseRequest+SongRequest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "QCBBaseRequest+SongRequest.m"; sourceTree = ""; }; + CD327BB31A3216BB00EF5A4A /* SongTableViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SongTableViewController.h; sourceTree = ""; }; + CD327BB41A3216BB00EF5A4A /* SongTableViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SongTableViewController.m; sourceTree = ""; }; + CD327BB61A32DA0200EF5A4A /* PlayerViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PlayerViewController.h; sourceTree = ""; }; + CD327BB71A32DA0200EF5A4A /* PlayerViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PlayerViewController.m; sourceTree = ""; }; + CD540CF31A2D882C00C5D8E1 /* UIButtonMake.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UIButtonMake.h; sourceTree = ""; }; + CD540CF41A2D882C00C5D8E1 /* UIButtonMake.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UIButtonMake.m; sourceTree = ""; }; + CD6EDB051A337128008333A4 /* CFNetwork.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CFNetwork.framework; path = System/Library/Frameworks/CFNetwork.framework; sourceTree = SDKROOT; }; + CD6EDB071A337135008333A4 /* AudioToolbox.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioToolbox.framework; path = System/Library/Frameworks/AudioToolbox.framework; sourceTree = SDKROOT; }; + CD6EDB091A33714F008333A4 /* AVFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AVFoundation.framework; path = System/Library/Frameworks/AVFoundation.framework; sourceTree = SDKROOT; }; + CD6EDB0B1A337173008333A4 /* libxml2.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libxml2.dylib; path = usr/lib/libxml2.dylib; sourceTree = SDKROOT; }; + CD6EDB0D1A337184008333A4 /* MediaPlayer.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MediaPlayer.framework; path = System/Library/Frameworks/MediaPlayer.framework; sourceTree = SDKROOT; }; + CDC0C6711A2D591700657E55 /* CRNavigationBar.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CRNavigationBar.h; sourceTree = ""; }; + CDC0C6721A2D591700657E55 /* CRNavigationBar.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CRNavigationBar.m; sourceTree = ""; }; + CDC0C6731A2D591700657E55 /* CRNavigationController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CRNavigationController.h; sourceTree = ""; }; + CDC0C6741A2D591700657E55 /* CRNavigationController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CRNavigationController.m; sourceTree = ""; }; + FE32BBE9A4325BEFD70233F5 /* libPods-NetMusic.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-NetMusic.a"; sourceTree = BUILT_PRODUCTS_DIR; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + CD0E45721A2C626300389DF4 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + CD6EDB0E1A337184008333A4 /* MediaPlayer.framework in Frameworks */, + CD6EDB0C1A337173008333A4 /* libxml2.dylib in Frameworks */, + CD6EDB0A1A33714F008333A4 /* AVFoundation.framework in Frameworks */, + CD6EDB081A337135008333A4 /* AudioToolbox.framework in Frameworks */, + CD6EDB061A337129008333A4 /* CFNetwork.framework in Frameworks */, + BB18D5D179F573D66F16D218 /* libPods-NetMusic.a in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + CD0E458B1A2C626300389DF4 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 4ADF903640E57D4ECE323064 /* Pods */ = { + isa = PBXGroup; + children = ( + 270E8F26FFE97BE1C4BD901E /* Pods-NetMusic.debug.xcconfig */, + 334E48235EBA44D1677708BB /* Pods-NetMusic.release.xcconfig */, + ); + name = Pods; + sourceTree = ""; + }; + 6BD97E40131735959EAA927C /* Frameworks */ = { + isa = PBXGroup; + children = ( + CD6EDB0D1A337184008333A4 /* MediaPlayer.framework */, + CD6EDB0B1A337173008333A4 /* libxml2.dylib */, + CD6EDB091A33714F008333A4 /* AVFoundation.framework */, + CD6EDB071A337135008333A4 /* AudioToolbox.framework */, + CD6EDB051A337128008333A4 /* CFNetwork.framework */, + FE32BBE9A4325BEFD70233F5 /* libPods-NetMusic.a */, + ); + name = Frameworks; + sourceTree = ""; + }; + CD0E456C1A2C626300389DF4 = { + isa = PBXGroup; + children = ( + CD0E45771A2C626300389DF4 /* NetMusic */, + CD0E45911A2C626300389DF4 /* NetMusicTests */, + CD0E45761A2C626300389DF4 /* Products */, + 4ADF903640E57D4ECE323064 /* Pods */, + 6BD97E40131735959EAA927C /* Frameworks */, + ); + sourceTree = ""; + }; + CD0E45761A2C626300389DF4 /* Products */ = { + isa = PBXGroup; + children = ( + CD0E45751A2C626300389DF4 /* NetMusic.app */, + CD0E458E1A2C626300389DF4 /* NetMusicTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + CD0E45771A2C626300389DF4 /* NetMusic */ = { + isa = PBXGroup; + children = ( + CD16852C1A30A30B00D47E45 /* Network */, + CD1685271A30942B00D47E45 /* Views */, + CD1685201A30502200D47E45 /* models */, + CD0E45A41A2C645E00389DF4 /* Utils */, + CD0E45A01A2C639E00389DF4 /* Controllers */, + CD0E457C1A2C626300389DF4 /* AppDelegate.h */, + CD0E457D1A2C626300389DF4 /* AppDelegate.m */, + CD0E45851A2C626300389DF4 /* Images.xcassets */, + CD0E45871A2C626300389DF4 /* LaunchScreen.xib */, + CD0E45781A2C626300389DF4 /* Supporting Files */, + ); + path = NetMusic; + sourceTree = ""; + }; + CD0E45781A2C626300389DF4 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + CD0E45791A2C626300389DF4 /* Info.plist */, + CD0E457A1A2C626300389DF4 /* main.m */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; + CD0E45911A2C626300389DF4 /* NetMusicTests */ = { + isa = PBXGroup; + children = ( + CD0E45941A2C626300389DF4 /* NetMusicTests.m */, + CD0E45921A2C626300389DF4 /* Supporting Files */, + ); + path = NetMusicTests; + sourceTree = ""; + }; + CD0E45921A2C626300389DF4 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + CD0E45931A2C626300389DF4 /* Info.plist */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; + CD0E45A01A2C639E00389DF4 /* Controllers */ = { + isa = PBXGroup; + children = ( + CDC0C6701A2D591700657E55 /* CRNavigationController */, + CD0E45A11A2C63F800389DF4 /* BaseViewController.h */, + CD0E45A21A2C63F800389DF4 /* BaseViewController.m */, + CD0E45A81A2C798100389DF4 /* MainViewController.h */, + CD0E45A91A2C798100389DF4 /* MainViewController.m */, + CD16851D1A2F77D800D47E45 /* ChannelViewController.h */, + CD16851E1A2F77D800D47E45 /* ChannelViewController.m */, + CD327BB31A3216BB00EF5A4A /* SongTableViewController.h */, + CD327BB41A3216BB00EF5A4A /* SongTableViewController.m */, + CD327BB61A32DA0200EF5A4A /* PlayerViewController.h */, + CD327BB71A32DA0200EF5A4A /* PlayerViewController.m */, + ); + name = Controllers; + sourceTree = ""; + }; + CD0E45A41A2C645E00389DF4 /* Utils */ = { + isa = PBXGroup; + children = ( + CD0E45A51A2C675D00389DF4 /* GlobalDefine.h */, + CD0E45A61A2C675D00389DF4 /* GlobalDefine.m */, + CD540CF31A2D882C00C5D8E1 /* UIButtonMake.h */, + CD540CF41A2D882C00C5D8E1 /* UIButtonMake.m */, + ); + name = Utils; + sourceTree = ""; + }; + CD1685201A30502200D47E45 /* models */ = { + isa = PBXGroup; + children = ( + CD1685311A30BE7300D47E45 /* QCBBaseModel.h */, + CD1685321A30BE7300D47E45 /* QCBBaseModel.m */, + CD1685341A30BF8200D47E45 /* QCBChannelModel.h */, + CD1685351A30BF8200D47E45 /* QCBChannelModel.m */, + CD327BAD1A3191D300EF5A4A /* QCBSongModel.h */, + CD327BAE1A3191D300EF5A4A /* QCBSongModel.m */, + ); + name = models; + sourceTree = ""; + }; + CD1685271A30942B00D47E45 /* Views */ = { + isa = PBXGroup; + children = ( + CD1685241A30930A00D47E45 /* ShadeView.h */, + CD1685251A30930A00D47E45 /* ShadeView.m */, + CD16852B1A3094B400D47E45 /* ShadeViewDelegate.h */, + ); + name = Views; + sourceTree = ""; + }; + CD16852C1A30A30B00D47E45 /* Network */ = { + isa = PBXGroup; + children = ( + CD16852D1A30A87500D47E45 /* QCBBaseRequest.h */, + CD16852E1A30A87500D47E45 /* QCBBaseRequest.m */, + CD1685371A31398A00D47E45 /* QCBBaseRequest+ChannelRequest.h */, + CD1685381A31398A00D47E45 /* QCBBaseRequest+ChannelRequest.m */, + CD327BB01A31BD4F00EF5A4A /* QCBBaseRequest+SongRequest.h */, + CD327BB11A31BD4F00EF5A4A /* QCBBaseRequest+SongRequest.m */, + ); + name = Network; + sourceTree = ""; + }; + CDC0C6701A2D591700657E55 /* CRNavigationController */ = { + isa = PBXGroup; + children = ( + CDC0C6711A2D591700657E55 /* CRNavigationBar.h */, + CDC0C6721A2D591700657E55 /* CRNavigationBar.m */, + CDC0C6731A2D591700657E55 /* CRNavigationController.h */, + CDC0C6741A2D591700657E55 /* CRNavigationController.m */, + ); + path = CRNavigationController; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + CD0E45741A2C626300389DF4 /* NetMusic */ = { + isa = PBXNativeTarget; + buildConfigurationList = CD0E45981A2C626300389DF4 /* Build configuration list for PBXNativeTarget "NetMusic" */; + buildPhases = ( + D63851D3AEA18B2EA667C197 /* Check Pods Manifest.lock */, + CD0E45711A2C626300389DF4 /* Sources */, + CD0E45721A2C626300389DF4 /* Frameworks */, + CD0E45731A2C626300389DF4 /* Resources */, + 74123F2BB868C6D23E8F3000 /* Copy Pods Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = NetMusic; + productName = NetMusic; + productReference = CD0E45751A2C626300389DF4 /* NetMusic.app */; + productType = "com.apple.product-type.application"; + }; + CD0E458D1A2C626300389DF4 /* NetMusicTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = CD0E459B1A2C626300389DF4 /* Build configuration list for PBXNativeTarget "NetMusicTests" */; + buildPhases = ( + CD0E458A1A2C626300389DF4 /* Sources */, + CD0E458B1A2C626300389DF4 /* Frameworks */, + CD0E458C1A2C626300389DF4 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + CD0E45901A2C626300389DF4 /* PBXTargetDependency */, + ); + name = NetMusicTests; + productName = NetMusicTests; + productReference = CD0E458E1A2C626300389DF4 /* NetMusicTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + CD0E456D1A2C626300389DF4 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0610; + ORGANIZATIONNAME = xsdlr; + TargetAttributes = { + CD0E45741A2C626300389DF4 = { + CreatedOnToolsVersion = 6.1; + DevelopmentTeam = 6ADJ2TL5DB; + }; + CD0E458D1A2C626300389DF4 = { + CreatedOnToolsVersion = 6.1; + TestTargetID = CD0E45741A2C626300389DF4; + }; + }; + }; + buildConfigurationList = CD0E45701A2C626300389DF4 /* Build configuration list for PBXProject "NetMusic" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = CD0E456C1A2C626300389DF4; + productRefGroup = CD0E45761A2C626300389DF4 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + CD0E45741A2C626300389DF4 /* NetMusic */, + CD0E458D1A2C626300389DF4 /* NetMusicTests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + CD0E45731A2C626300389DF4 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + CD0E45891A2C626300389DF4 /* LaunchScreen.xib in Resources */, + CD0E45861A2C626300389DF4 /* Images.xcassets in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + CD0E458C1A2C626300389DF4 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXShellScriptBuildPhase section */ + 74123F2BB868C6D23E8F3000 /* Copy Pods Resources */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Copy Pods Resources"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-NetMusic/Pods-NetMusic-resources.sh\"\n"; + showEnvVarsInLog = 0; + }; + D63851D3AEA18B2EA667C197 /* Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Check Pods Manifest.lock"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n"; + showEnvVarsInLog = 0; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + CD0E45711A2C626300389DF4 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + CD16851F1A2F77D800D47E45 /* ChannelViewController.m in Sources */, + CD1685391A31398A00D47E45 /* QCBBaseRequest+ChannelRequest.m in Sources */, + CD1685331A30BE7300D47E45 /* QCBBaseModel.m in Sources */, + CDC0C6761A2D591700657E55 /* CRNavigationController.m in Sources */, + CD540CF51A2D882C00C5D8E1 /* UIButtonMake.m in Sources */, + CD0E45AA1A2C798100389DF4 /* MainViewController.m in Sources */, + CD0E45A31A2C63F800389DF4 /* BaseViewController.m in Sources */, + CD327BB51A3216BB00EF5A4A /* SongTableViewController.m in Sources */, + CD1685261A30930A00D47E45 /* ShadeView.m in Sources */, + CDC0C6751A2D591700657E55 /* CRNavigationBar.m in Sources */, + CD0E45A71A2C675D00389DF4 /* GlobalDefine.m in Sources */, + CD1685361A30BF8200D47E45 /* QCBChannelModel.m in Sources */, + CD16852F1A30A87500D47E45 /* QCBBaseRequest.m in Sources */, + CD327BB21A31BD4F00EF5A4A /* QCBBaseRequest+SongRequest.m in Sources */, + CD0E457E1A2C626300389DF4 /* AppDelegate.m in Sources */, + CD0E457B1A2C626300389DF4 /* main.m in Sources */, + CD327BAF1A3191D300EF5A4A /* QCBSongModel.m in Sources */, + CD327BB81A32DA0200EF5A4A /* PlayerViewController.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + CD0E458A1A2C626300389DF4 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + CD0E45951A2C626300389DF4 /* NetMusicTests.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + CD0E45901A2C626300389DF4 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = CD0E45741A2C626300389DF4 /* NetMusic */; + targetProxy = CD0E458F1A2C626300389DF4 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + CD0E45871A2C626300389DF4 /* LaunchScreen.xib */ = { + isa = PBXVariantGroup; + children = ( + CD0E45881A2C626300389DF4 /* Base */, + ); + name = LaunchScreen.xib; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + CD0E45961A2C626300389DF4 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_SYMBOLS_PRIVATE_EXTERN = NO; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 8.1; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + CD0E45971A2C626300389DF4 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = YES; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 8.1; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + CD0E45991A2C626300389DF4 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 270E8F26FFE97BE1C4BD901E /* Pods-NetMusic.debug.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_IDENTITY = "iPhone Developer"; + INFOPLIST_FILE = NetMusic/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 8.1; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + PRODUCT_NAME = "$(TARGET_NAME)"; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + CD0E459A1A2C626300389DF4 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 334E48235EBA44D1677708BB /* Pods-NetMusic.release.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_IDENTITY = "iPhone Developer"; + INFOPLIST_FILE = NetMusic/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 8.1; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + PRODUCT_NAME = "$(TARGET_NAME)"; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Release; + }; + CD0E459C1A2C626300389DF4 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + ); + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + INFOPLIST_FILE = NetMusicTests/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_NAME = "$(TARGET_NAME)"; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/NetMusic.app/NetMusic"; + }; + name = Debug; + }; + CD0E459D1A2C626300389DF4 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + ); + INFOPLIST_FILE = NetMusicTests/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_NAME = "$(TARGET_NAME)"; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/NetMusic.app/NetMusic"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + CD0E45701A2C626300389DF4 /* Build configuration list for PBXProject "NetMusic" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + CD0E45961A2C626300389DF4 /* Debug */, + CD0E45971A2C626300389DF4 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + CD0E45981A2C626300389DF4 /* Build configuration list for PBXNativeTarget "NetMusic" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + CD0E45991A2C626300389DF4 /* Debug */, + CD0E459A1A2C626300389DF4 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + CD0E459B1A2C626300389DF4 /* Build configuration list for PBXNativeTarget "NetMusicTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + CD0E459C1A2C626300389DF4 /* Debug */, + CD0E459D1A2C626300389DF4 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = CD0E456D1A2C626300389DF4 /* Project object */; +} diff --git "a/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic.xcodeproj/project.xcworkspace/contents.xcworkspacedata" "b/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic.xcodeproj/project.xcworkspace/contents.xcworkspacedata" new file mode 100644 index 00000000..557ca72a --- /dev/null +++ "b/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic.xcodeproj/project.xcworkspace/contents.xcworkspacedata" @@ -0,0 +1,7 @@ + + + + + diff --git "a/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic.xcworkspace/contents.xcworkspacedata" "b/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic.xcworkspace/contents.xcworkspacedata" new file mode 100644 index 00000000..c4258ab7 --- /dev/null +++ "b/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic.xcworkspace/contents.xcworkspacedata" @@ -0,0 +1,10 @@ + + + + + + + diff --git "a/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/AppDelegate.h" "b/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/AppDelegate.h" new file mode 100644 index 00000000..495230de --- /dev/null +++ "b/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/AppDelegate.h" @@ -0,0 +1,17 @@ +// +// AppDelegate.h +// NetMusic +// +// Created by xsdlr on 14/12/1. +// Copyright (c) 2014年 xsdlr. All rights reserved. +// + +#import + +@interface AppDelegate : UIResponder + +@property (strong, nonatomic) UIWindow *window; + + +@end + diff --git "a/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/AppDelegate.m" "b/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/AppDelegate.m" new file mode 100644 index 00000000..177105a1 --- /dev/null +++ "b/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/AppDelegate.m" @@ -0,0 +1,53 @@ +// +// AppDelegate.m +// NetMusic +// +// Created by xsdlr on 14/12/1. +// Copyright (c) 2014年 xsdlr. All rights reserved. +// + +#import "AppDelegate.h" +#import "MainViewController.h" +#import "CRNavigationController.h" + +@interface AppDelegate () + +@end + +@implementation AppDelegate + + +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { + self.window = [[UIWindow alloc] initWithFrame: [UIScreen mainScreen].bounds]; + self.window.rootViewController = [[CRNavigationController alloc] initWithRootViewController: [[MainViewController alloc] init]]; + [self.window makeKeyAndVisible]; + return YES; +} + +- (void)applicationWillResignActive:(UIApplication *)application { + // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. + // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. +} + +- (void)applicationDidEnterBackground:(UIApplication *)application { + // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. + // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. +} + +- (void)applicationWillEnterForeground:(UIApplication *)application { + // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. +} + +- (void)applicationDidBecomeActive:(UIApplication *)application { + // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. +} + +- (void)applicationWillTerminate:(UIApplication *)application { + // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. +} + +- (NSUInteger)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window{ + return UIInterfaceOrientationMaskPortrait | UIInterfaceOrientationMaskPortraitUpsideDown; +} + +@end diff --git "a/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/Base.lproj/LaunchScreen.xib" "b/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/Base.lproj/LaunchScreen.xib" new file mode 100644 index 00000000..0c69ae67 --- /dev/null +++ "b/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/Base.lproj/LaunchScreen.xib" @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git "a/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/BaseViewController.h" "b/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/BaseViewController.h" new file mode 100644 index 00000000..4b12f229 --- /dev/null +++ "b/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/BaseViewController.h" @@ -0,0 +1,49 @@ +// +// BaseViewController.h +// NetMusic +// +// Created by xsdlr on 14/12/1. +// Copyright (c) 2014年 xsdlr. All rights reserved. +// + +#import + +@interface BaseViewController : UIViewController +@property (weak,nonatomic) UIColor *navigationBarBackgroundColor; +@property (weak,nonatomic) UIColor *navigationBarTitleColor; +/** + * 添加普通标题栏 + * + * @param title 标题名称 + * @param color 标题颜色 + */ +- (void) addTitleViewByTitle: (NSString*) title color:(UIColor*) color; +/** + * 添加带图片的左侧按钮 + * + * @param imageName 图片名 + * @param selectedImageName 高亮图片名 + */ +- (void) addLeftButtonByImage:(NSString*) imageName + selectedImageName:(NSString *) selectedImageName; +/** + * 添加带图片的右侧按钮 + * + * @param imageName 图片名 + * @param selectedImageName 高亮图片名 + */ +- (void) addRightButtonByImage:(NSString*) imageName + selectedImageName:(NSString *) selectedImageName; +/** + * 添加带文字的左侧按钮 + * + * @param title 按钮名称 + */ +- (void) addLeftButtonByTitle:(NSString*) title; +/** + * 添加带文字的右侧按钮 + * + * @param title 按钮名称 + */ +- (void) addRightButtonByTitle:(NSString*) title; +@end \ No newline at end of file diff --git "a/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/BaseViewController.m" "b/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/BaseViewController.m" new file mode 100644 index 00000000..1225a19b --- /dev/null +++ "b/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/BaseViewController.m" @@ -0,0 +1,107 @@ +// +// BaseViewController.m +// NetMusic +// +// Created by xsdlr on 14/12/1. +// Copyright (c) 2014年 xsdlr. All rights reserved. +// + +#import "BaseViewController.h" +#import "UIButtonMake.h" + +@interface BaseViewController () +- (void) initLayout; +@end + +@implementation BaseViewController + +- (void)viewDidLoad { + [super viewDidLoad]; + [self initLayout]; +} + +- (void)didReceiveMemoryWarning { + [super didReceiveMemoryWarning]; + // Dispose of any resources that can be recreated. +} + +- (void)setNavigationBarBackgroundColor:(UIColor *)navigationBarBackgroundColor { + _navigationBarBackgroundColor = navigationBarBackgroundColor; + self.navigationController.navigationBar.backgroundColor = _navigationBarBackgroundColor; +} + +- (void)setNavigationBarTitleColor:(UIColor *)navigationBarTitleColor { + _navigationBarTitleColor = navigationBarTitleColor; + self.navigationController.navigationBar.barTintColor = _navigationBarTitleColor; +} + +- (void)initLayout { + self.automaticallyAdjustsScrollViewInsets = false; + self.view.backgroundColor = [UIColor whiteColor]; + // 设置状态栏字体颜色为白色 + [[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent]; +} + +- (UIBarButtonItem*) addButtonByImage:(NSString*) imageName selectedImageName:(NSString *) selectedImageName { + UIImage *image = [UIImage imageNamed:imageName]; + UIImage *selectedImage = [UIImage imageNamed:selectedImageName]; + UIButton *button = [UIButtonMake createWithImage:image + selectedimage:(UIImage *) selectedImage + target:self + action:@selector(leftButtonDealer:) + events:UIControlEventTouchUpInside]; + UIView *subView = [[UIView alloc] initWithFrame:button.frame]; + [subView addSubview:button]; + UIBarButtonItem *barButtonItem = [[UIBarButtonItem alloc] initWithCustomView: subView]; + return barButtonItem; +} + +- (void)addLeftButtonByImage:(NSString *)imageName selectedImageName:(NSString *)selectedImageName { + self.navigationItem.leftBarButtonItem = [self addButtonByImage:imageName selectedImageName:selectedImageName]; +} + +- (void)addRightButtonByImage:(NSString *)imageName selectedImageName:(NSString *)selectedImageName { + self.navigationItem.rightBarButtonItem = [self addButtonByImage:imageName selectedImageName:selectedImageName]; +} + +- (UIBarButtonItem*) addButtonByTitle:(NSString*) title { + UIButton *button = [UIButtonMake createWithTitle:title width:50.0f height:44.0f target:self action:@selector(leftButtonDealer:) events:UIControlEventTouchUpInside]; + UIView *subView = [[UIView alloc] initWithFrame:button.frame]; + [subView addSubview:button]; + UIBarButtonItem *barButtonItem = [[UIBarButtonItem alloc] initWithCustomView:subView]; + return barButtonItem; +} + +- (void)addLeftButtonByTitle:(NSString *)title { + self.navigationItem.leftBarButtonItem = [self addButtonByTitle:title]; +} + +- (void)addRightButtonByTitle:(NSString *)title { + self.navigationItem.rightBarButtonItem = [self addButtonByTitle:title]; +} + +- (void) leftButtonDealer: (id)sender { + NSLog(@"点击导航栏左按钮"); +} + +- (void)addTitleViewByTitle:(NSString *)title color:(UIColor *)color { + UILabel *titleLabel = [[UILabel alloc]initWithFrame:CGRectMake(0, 0 , 100, 44)]; + titleLabel.backgroundColor = [UIColor clearColor]; //设置Label背景透明 + titleLabel.font = [UIFont boldSystemFontOfSize:20]; //设置文本字体与大小 + titleLabel.textColor = color; //设置文本颜色 + titleLabel.textAlignment = NSTextAlignmentCenter; + titleLabel.text = title; + self.navigationItem.titleView = titleLabel; +} + +/* + #pragma mark - Navigation + + // In a storyboard-based application, you will often want to do a little preparation before navigation + - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { + // Get the new view controller using [segue destinationViewController]. + // Pass the selected object to the new view controller. + } + */ + +@end diff --git "a/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/CRNavigationController/CRNavigationBar.h" "b/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/CRNavigationController/CRNavigationBar.h" new file mode 100755 index 00000000..12786d70 --- /dev/null +++ "b/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/CRNavigationController/CRNavigationBar.h" @@ -0,0 +1,30 @@ +// +// CRNavigationBar.h +// CRNavigationControllerExample +// +// Created by Corey Roberts on 9/24/13. +// Copyright (c) 2013 SpacePyro Inc. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +#import + +@interface CRNavigationBar : UINavigationBar + +@end diff --git "a/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/CRNavigationController/CRNavigationBar.m" "b/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/CRNavigationController/CRNavigationBar.m" new file mode 100755 index 00000000..6996bec2 --- /dev/null +++ "b/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/CRNavigationController/CRNavigationBar.m" @@ -0,0 +1,77 @@ +// +// CRNavigationBar.m +// CRNavigationControllerExample +// +// Created by Corey Roberts on 9/24/13. +// Copyright (c) 2013 SpacePyro Inc. All rights reserved. +// + +#import "CRNavigationBar.h" + +@interface CRNavigationBar () +@property (nonatomic, strong) CALayer *colorLayer; +@end + +@implementation CRNavigationBar + +static CGFloat const kDefaultColorLayerOpacity = 0.4f; +static CGFloat const kSpaceToCoverStatusBars = 20.0f; + +- (void)setBarTintColor:(UIColor *)barTintColor { + [super setBarTintColor:barTintColor]; + + if (self.colorLayer == nil) { + self.colorLayer = [CALayer layer]; + self.colorLayer.opacity = kDefaultColorLayerOpacity; + [self.layer addSublayer:self.colorLayer]; + } + + CGFloat red, green, blue, alpha; + [barTintColor getRed:&red green:&green blue:&blue alpha:&alpha]; + + CGFloat opacity = kDefaultColorLayerOpacity; + + CGFloat minVal = MIN(MIN(red, green), blue); + + if ([self convertValue:minVal withOpacity:opacity] < 0) { + opacity = [self minOpacityForValue:minVal]; + } + + self.colorLayer.opacity = opacity; + + red = [self convertValue:red withOpacity:opacity]; + green = [self convertValue:green withOpacity:opacity]; + blue = [self convertValue:blue withOpacity:opacity]; + + red = MAX(MIN(1.0, red), 0); + green = MAX(MIN(1.0, green), 0); + blue = MAX(MIN(1.0, blue), 0); + + self.colorLayer.backgroundColor = [UIColor colorWithRed:red green:green blue:blue alpha:alpha].CGColor; +} + +- (CGFloat)minOpacityForValue:(CGFloat)value +{ + return (0.4 - 0.4 * value) / (0.6 * value + 0.4); +} + +- (CGFloat)convertValue:(CGFloat)value withOpacity:(CGFloat)opacity +{ + return 0.4 * value / opacity + 0.6 * value - 0.4 / opacity + 0.4; +} + +- (void)layoutSubviews { + [super layoutSubviews]; + + if (self.colorLayer != nil) { + self.colorLayer.frame = CGRectMake(0, 0 - kSpaceToCoverStatusBars, CGRectGetWidth(self.bounds), CGRectGetHeight(self.bounds) + kSpaceToCoverStatusBars); + + [self.layer insertSublayer:self.colorLayer atIndex:1]; + } +} + +- (void)displayColorLayer:(BOOL)display { + self.colorLayer.hidden = !display; +} + +@end diff --git "a/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/CRNavigationController/CRNavigationController.h" "b/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/CRNavigationController/CRNavigationController.h" new file mode 100755 index 00000000..174115cd --- /dev/null +++ "b/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/CRNavigationController/CRNavigationController.h" @@ -0,0 +1,30 @@ +// +// CRNavigationController.h +// CRNavigationControllerExample +// +// Created by Corey Roberts on 9/24/13. +// Copyright (c) 2013 SpacePyro Inc. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +#import + +@interface CRNavigationController : UINavigationController + +@end diff --git "a/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/CRNavigationController/CRNavigationController.m" "b/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/CRNavigationController/CRNavigationController.m" new file mode 100755 index 00000000..a7b6ec6c --- /dev/null +++ "b/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/CRNavigationController/CRNavigationController.m" @@ -0,0 +1,35 @@ +// +// CRNavigationController.m +// CRNavigationControllerExample +// +// Created by Corey Roberts on 9/24/13. +// Copyright (c) 2013 SpacePyro Inc. All rights reserved. +// + +#import "CRNavigationController.h" +#import "CRNavigationBar.h" + +@interface CRNavigationController () + +@end + +@implementation CRNavigationController + +- (id)init { + self = [super initWithNavigationBarClass:[CRNavigationBar class] toolbarClass:nil]; + if(self) { + // Custom initialization here, if needed. + } + return self; +} + +- (id)initWithRootViewController:(UIViewController *)rootViewController { + self = [super initWithNavigationBarClass:[CRNavigationBar class] toolbarClass:nil]; + if(self) { + self.viewControllers = @[rootViewController]; + } + + return self; +} + +@end diff --git "a/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/ChannelViewController.h" "b/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/ChannelViewController.h" new file mode 100644 index 00000000..1b5fa307 --- /dev/null +++ "b/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/ChannelViewController.h" @@ -0,0 +1,47 @@ +// +// ChannelViewController.h +// NetMusic +// +// Created by xsdlr on 14/12/4. +// Copyright (c) 2014年 xsdlr. All rights reserved. +// + +#import +#import "MainViewController.h" +#import "QCBChannelModel.h" + +@interface ChannelViewController : UIViewController +/** + * view的宽度 + */ +@property(assign,nonatomic) CGFloat width; + +/** + * 是否展现 + */ +@property(assign,nonatomic) BOOL isShowed; +/** + * 开关频道栏 + */ +- (void) toggleChannelView; +/** + * 添加频道信息 + * + * @param channels 频道数组 + */ +- (void) addChannels:(NSArray*) channels; +/** + * 添加单个频道信息 + * + * @param channel 频道信息 + */ +- (void) addChannel:(QCBChannelModel*) channel; +/** + * 移除所有频道信息 + */ +- (void) removeAllChannels; +/** + * 通知界面大小变化 + */ +- (void) fireResize; +@end diff --git "a/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/ChannelViewController.m" "b/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/ChannelViewController.m" new file mode 100644 index 00000000..a7c4c535 --- /dev/null +++ "b/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/ChannelViewController.m" @@ -0,0 +1,158 @@ +// +// ChannelViewController.m +// NetMusic +// +// Created by xsdlr on 14/12/4. +// Copyright (c) 2014年 xsdlr. All rights reserved. +// + +#import "ChannelViewController.h" +#import "GlobalDefine.h" +#import "QCBBaseRequest+SongRequest.h" +#import "MBProgressHUD.h" + +@interface ChannelViewController () +@property(assign,nonatomic) NSInteger radius; +@property(strong,nonatomic) UITableView *channelTable; +@property(strong,nonatomic) NSMutableArray *channelList; //频道列表 +@end + +@implementation ChannelViewController + +- (void)viewDidLoad { + [super viewDidLoad]; + _radius = 2; + _channelList = [NSMutableArray array]; + _isShowed = NO; + [self configLayout]; +} + +- (void) configLayout { + [self.view setFrame:CGRectMake(-self.width-self.radius, GlobalDefine.HeaderHight, self.width, [GlobalDefine getBodyHeight])]; + //设置阴影 + self.view.layer.shadowColor = [UIColor grayColor].CGColor; + self.view.layer.shadowOffset = CGSizeMake(self.radius,0); + self.view.layer.shadowOpacity = 0.7; + self.view.layer.shadowRadius = self.radius; + //设置毛玻璃效果 + UIVisualEffect *blurEffect; + blurEffect = [UIBlurEffect effectWithStyle:UIBlurEffectStyleLight]; + UIVisualEffectView *visualEffectView; + visualEffectView = [[UIVisualEffectView alloc] initWithEffect:blurEffect]; + visualEffectView.frame = self.view.bounds; + visualEffectView.autoresizingMask = UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth; + [self.view addSubview:visualEffectView]; + //设置频道展示table + self.channelTable = [[UITableView alloc]initWithFrame:self.view.bounds]; + self.channelTable.autoresizingMask = UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth; + self.channelTable.contentInset = UIEdgeInsetsMake(20, 0, 0, 0); + self.channelTable.separatorStyle = UITableViewCellSeparatorStyleNone; + self.channelTable.backgroundColor = [UIColor clearColor]; + self.channelTable.scrollsToTop = false; + self.channelTable.dataSource = self; + self.channelTable.delegate = self; +// self.channelTable.scrollEnabled = NO; + [self.view addSubview:self.channelTable]; + +} + +- (void)didReceiveMemoryWarning { + [super didReceiveMemoryWarning]; + // Dispose of any resources that can be recreated. +} + +- (void)toggleChannelView { + if (self.isShowed) { + [self clolseChannelView]; + } else { + [self showChannelView]; + } +} + +- (void)showChannelView { + self.isShowed = YES; + [UIView animateWithDuration:0.4f animations:^(void){ + self.view.frame = CGRectMake(0, GlobalDefine.HeaderHight, self.width, [GlobalDefine getBodyHeight]); + } completion:nil]; +} + +- (void)clolseChannelView { + self.isShowed = NO; + [UIView animateWithDuration:0.3f animations:^(void){ + self.view.frame = CGRectMake(-self.width-3, GlobalDefine.HeaderHight, self.width, [GlobalDefine getBodyHeight]); + } completion:nil]; +} + +- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { + return self.channelList.count; +} + +- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { + static NSString *CellIdentifier = @"Cell"; + UITableViewCell *cell = [tableView + dequeueReusableCellWithIdentifier:CellIdentifier]; + if(cell == nil) { + cell = [[UITableViewCell alloc] + initWithStyle:UITableViewCellStyleDefault + reuseIdentifier:CellIdentifier]; + } + //设置单元格颜色及选中后的颜色 + cell.backgroundColor = [UIColor clearColor]; + cell.textLabel.textColor = [UIColor darkGrayColor]; + cell.selectedBackgroundView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, cell.frame.size.width, cell.frame.size.height)]; + cell.selectedBackgroundView.backgroundColor = [[UIColor grayColor] colorWithAlphaComponent:0.2]; + cell.textLabel.font = [UIFont boldSystemFontOfSize:15]; + cell.textLabel.textAlignment = NSTextAlignmentCenter; + QCBChannelModel *channel = [self.channelList objectAtIndex:indexPath.row]; + cell.textLabel.text = channel.name; + return cell; +} + +- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { + [self clolseChannelView]; + QCBChannelModel *channel = [self.channelList objectAtIndex:indexPath.row]; + NSLog(@"选择频道:%@,cid:%@",channel.name,channel.channel_id); + MainViewController *superController = (MainViewController*)self.parentViewController; + [superController closeShadeView]; + //请求歌曲列表信息 + [QCBBaseRequest songList:GlobalDefine.songUrl channelId:channel.channel_id type:@"n" success:^(NSArray *songList) { + NSLog(@"获得%ld首歌曲",songList.count); + [superController setChannelId:channel.channel_id]; + [superController removeAllSongs]; + [superController addSongs:songList]; + } fail:^(NSError *error) { + NSLog(@"%@",error); + MBProgressHUD* HUD = [[MBProgressHUD alloc] initWithView:self.view]; + [self.view.superview addSubview:HUD]; + HUD.labelText = @"频道获取失败"; + HUD.mode = MBProgressHUDModeText; + [HUD showAnimated:YES whileExecutingBlock:^{ + sleep(1); + } completionBlock:^{ + [HUD removeFromSuperview]; + }]; + }]; + [self.channelTable deselectRowAtIndexPath:indexPath animated:YES];//取消选中状态 +} + +- (void)addChannels:(NSArray *)channels { + [self.channelList addObjectsFromArray:channels]; + [self.channelTable reloadData]; +} + +- (void)addChannel:(QCBChannelModel *)channel { + [self.channelList addObject:channel]; + [self.channelTable reloadData]; +} + +- (void) removeAllChannels { + [self.channelList removeAllObjects]; + [self.channelTable reloadData]; +} + +- (void)fireResize { +// [UIView animateWithDuration:0.4f animations:^(void){ + [self.view setFrame:CGRectMake(-self.width-self.radius, GlobalDefine.HeaderHight, self.width, [GlobalDefine getBodyHeight])]; +// } completion:nil]; +} +@end diff --git "a/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/GlobalDefine.h" "b/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/GlobalDefine.h" new file mode 100644 index 00000000..3952a782 --- /dev/null +++ "b/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/GlobalDefine.h" @@ -0,0 +1,73 @@ +// +// GlobalDefine.h +// NetMusic +// +// Created by xsdlr on 14/12/1. +// Copyright (c) 2014年 xsdlr. All rights reserved. +// + +#import +#import + +@interface GlobalDefine : NSObject +/** + * 屏幕宽度 + * + * @return CGFloat + */ ++(CGFloat) ScreenWidth; +/** + * 屏幕高度 + * + * @return CGFloat + */ ++(CGFloat) ScreenHeight; +/** + * 导航栏高度 + * + * @return CGFloat + */ ++(CGFloat) NavigationHight; +/** + * 状态栏高度 + * + * @return CGFloat + */ ++(CGFloat) StatusBarHeight; +/** + * 顶部栏高度(包括状态栏和导航栏) + * + * @return CGFloat + */ ++(CGFloat) HeaderHight; +/** + * 底边栏高度 + * + * @return CGFloat + */ ++(CGFloat) FooterHight; +/** + * 频道url + * + * @return NSString + */ ++(NSString*) channelUrl; +/** + * 歌曲url + * + * @return NSString + */ ++(NSString*) songUrl; +/** + * 主界面高度 + * + * @return CGFloat + */ ++(CGFloat) getBodyHeight; +/** + * 设置主界面高度 + * + * @param height CGFloat高度 + */ ++ (void) setBodyHeight:(CGFloat) height; +@end \ No newline at end of file diff --git "a/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/GlobalDefine.m" "b/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/GlobalDefine.m" new file mode 100644 index 00000000..bfaa5f58 --- /dev/null +++ "b/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/GlobalDefine.m" @@ -0,0 +1,45 @@ +// +// GlobalDefine.m +// NetMusic +// +// Created by xsdlr on 14/12/1. +// Copyright (c) 2014年 xsdlr. All rights reserved. +// + +#import "GlobalDefine.h" + +static CGFloat QCBBodyHeight; +@implementation GlobalDefine ++ (CGFloat)ScreenWidth { + return UIScreen.mainScreen.bounds.size.width; +} ++ (CGFloat)ScreenHeight { + return UIScreen.mainScreen.bounds.size.height; +} ++ (CGFloat)NavigationHight { + return 44.0f; +} ++ (CGFloat)StatusBarHeight { + return 20.0f; +} ++ (CGFloat)HeaderHight { + return self.NavigationHight + self.StatusBarHeight; +} ++ (CGFloat)FooterHight { + return 60.0f; +} ++ (NSString *)channelUrl { + return @"http://www.douban.com/j/app/radio/channels"; +} ++ (NSString *)songUrl { +// return @"http://www.douban.com/j/app/radio/people"; + return @"http://douban.fm/j/mine/playlist"; +} ++ (void) setBodyHeight:(CGFloat) height { + QCBBodyHeight = height; +} ++ (CGFloat)getBodyHeight { +// return GlobalDefine.ScreenHeight - GlobalDefine.HeaderHight; + return QCBBodyHeight; +} +@end diff --git "a/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/Images.xcassets/AppIcon.appiconset/Contents.json" "b/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/Images.xcassets/AppIcon.appiconset/Contents.json" new file mode 100644 index 00000000..706990f2 --- /dev/null +++ "b/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/Images.xcassets/AppIcon.appiconset/Contents.json" @@ -0,0 +1,72 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "3x" + }, + { + "size" : "60x60", + "idiom" : "iphone", + "filename" : "iPhone_ico@2x.png", + "scale" : "2x" + }, + { + "size" : "60x60", + "idiom" : "iphone", + "filename" : "iPhone_ico@3x.png", + "scale" : "3x" + }, + { + "idiom" : "ipad", + "size" : "29x29", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "40x40", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "40x40", + "scale" : "2x" + }, + { + "size" : "76x76", + "idiom" : "ipad", + "filename" : "ipad_icon@1x.png", + "scale" : "1x" + }, + { + "size" : "76x76", + "idiom" : "ipad", + "filename" : "ipad_icon@2x.png", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git "a/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/Images.xcassets/AppIcon.appiconset/iPhone_ico@2x.png" "b/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/Images.xcassets/AppIcon.appiconset/iPhone_ico@2x.png" new file mode 100644 index 00000000..eb129a28 Binary files /dev/null and "b/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/Images.xcassets/AppIcon.appiconset/iPhone_ico@2x.png" differ diff --git "a/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/Images.xcassets/AppIcon.appiconset/iPhone_ico@3x.png" "b/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/Images.xcassets/AppIcon.appiconset/iPhone_ico@3x.png" new file mode 100644 index 00000000..e3b6303c Binary files /dev/null and "b/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/Images.xcassets/AppIcon.appiconset/iPhone_ico@3x.png" differ diff --git "a/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/Images.xcassets/AppIcon.appiconset/ipad_icon@1x.png" "b/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/Images.xcassets/AppIcon.appiconset/ipad_icon@1x.png" new file mode 100644 index 00000000..1e049cf9 Binary files /dev/null and "b/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/Images.xcassets/AppIcon.appiconset/ipad_icon@1x.png" differ diff --git "a/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/Images.xcassets/AppIcon.appiconset/ipad_icon@2x.png" "b/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/Images.xcassets/AppIcon.appiconset/ipad_icon@2x.png" new file mode 100644 index 00000000..0f98cf01 Binary files /dev/null and "b/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/Images.xcassets/AppIcon.appiconset/ipad_icon@2x.png" differ diff --git "a/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/Images.xcassets/launch.imageset/Contents.json" "b/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/Images.xcassets/launch.imageset/Contents.json" new file mode 100644 index 00000000..ec339adc --- /dev/null +++ "b/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/Images.xcassets/launch.imageset/Contents.json" @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x", + "filename" : "launch@1x-1.png" + }, + { + "idiom" : "universal", + "scale" : "2x", + "filename" : "launch@1x.png" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git "a/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/Images.xcassets/launch.imageset/launch@1x-1.png" "b/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/Images.xcassets/launch.imageset/launch@1x-1.png" new file mode 100644 index 00000000..2aa3dcd4 Binary files /dev/null and "b/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/Images.xcassets/launch.imageset/launch@1x-1.png" differ diff --git "a/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/Images.xcassets/launch.imageset/launch@1x.png" "b/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/Images.xcassets/launch.imageset/launch@1x.png" new file mode 100644 index 00000000..2aa3dcd4 Binary files /dev/null and "b/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/Images.xcassets/launch.imageset/launch@1x.png" differ diff --git "a/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/Images.xcassets/mSkip.imageset/Contents.json" "b/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/Images.xcassets/mSkip.imageset/Contents.json" new file mode 100644 index 00000000..e1c318de --- /dev/null +++ "b/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/Images.xcassets/mSkip.imageset/Contents.json" @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x", + "filename" : "skip@1x.png" + }, + { + "idiom" : "universal", + "scale" : "2x", + "filename" : "skip@2x.png" + }, + { + "idiom" : "universal", + "scale" : "3x", + "filename" : "skip@3x.png" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git "a/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/Images.xcassets/mSkip.imageset/skip@1x.png" "b/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/Images.xcassets/mSkip.imageset/skip@1x.png" new file mode 100644 index 00000000..1882e9de Binary files /dev/null and "b/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/Images.xcassets/mSkip.imageset/skip@1x.png" differ diff --git "a/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/Images.xcassets/mSkip.imageset/skip@2x.png" "b/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/Images.xcassets/mSkip.imageset/skip@2x.png" new file mode 100644 index 00000000..4093b328 Binary files /dev/null and "b/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/Images.xcassets/mSkip.imageset/skip@2x.png" differ diff --git "a/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/Images.xcassets/mSkip.imageset/skip@3x.png" "b/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/Images.xcassets/mSkip.imageset/skip@3x.png" new file mode 100644 index 00000000..08cbfb25 Binary files /dev/null and "b/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/Images.xcassets/mSkip.imageset/skip@3x.png" differ diff --git "a/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/Images.xcassets/mSkip_prs.imageset/Contents.json" "b/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/Images.xcassets/mSkip_prs.imageset/Contents.json" new file mode 100644 index 00000000..29d8c4e0 --- /dev/null +++ "b/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/Images.xcassets/mSkip_prs.imageset/Contents.json" @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x", + "filename" : "skip_prs@1x.png" + }, + { + "idiom" : "universal", + "scale" : "2x", + "filename" : "skip_prs@2x.png" + }, + { + "idiom" : "universal", + "scale" : "3x", + "filename" : "skip_prs@3x.png" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git "a/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/Images.xcassets/mSkip_prs.imageset/skip_prs@1x.png" "b/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/Images.xcassets/mSkip_prs.imageset/skip_prs@1x.png" new file mode 100644 index 00000000..0476c659 Binary files /dev/null and "b/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/Images.xcassets/mSkip_prs.imageset/skip_prs@1x.png" differ diff --git "a/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/Images.xcassets/mSkip_prs.imageset/skip_prs@2x.png" "b/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/Images.xcassets/mSkip_prs.imageset/skip_prs@2x.png" new file mode 100644 index 00000000..33816aca Binary files /dev/null and "b/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/Images.xcassets/mSkip_prs.imageset/skip_prs@2x.png" differ diff --git "a/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/Images.xcassets/mSkip_prs.imageset/skip_prs@3x.png" "b/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/Images.xcassets/mSkip_prs.imageset/skip_prs@3x.png" new file mode 100644 index 00000000..1409bbf8 Binary files /dev/null and "b/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/Images.xcassets/mSkip_prs.imageset/skip_prs@3x.png" differ diff --git "a/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/Images.xcassets/mStart.imageset/Contents.json" "b/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/Images.xcassets/mStart.imageset/Contents.json" new file mode 100644 index 00000000..c9dec842 --- /dev/null +++ "b/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/Images.xcassets/mStart.imageset/Contents.json" @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x", + "filename" : "start@1x.png" + }, + { + "idiom" : "universal", + "scale" : "2x", + "filename" : "start@2x.png" + }, + { + "idiom" : "universal", + "scale" : "3x", + "filename" : "start@3x.png" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git "a/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/Images.xcassets/mStart.imageset/start@1x.png" "b/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/Images.xcassets/mStart.imageset/start@1x.png" new file mode 100644 index 00000000..cd87d560 Binary files /dev/null and "b/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/Images.xcassets/mStart.imageset/start@1x.png" differ diff --git "a/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/Images.xcassets/mStart.imageset/start@2x.png" "b/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/Images.xcassets/mStart.imageset/start@2x.png" new file mode 100644 index 00000000..b64beacb Binary files /dev/null and "b/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/Images.xcassets/mStart.imageset/start@2x.png" differ diff --git "a/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/Images.xcassets/mStart.imageset/start@3x.png" "b/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/Images.xcassets/mStart.imageset/start@3x.png" new file mode 100644 index 00000000..1eb15f22 Binary files /dev/null and "b/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/Images.xcassets/mStart.imageset/start@3x.png" differ diff --git "a/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/Images.xcassets/mStart_prs.imageset/Contents.json" "b/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/Images.xcassets/mStart_prs.imageset/Contents.json" new file mode 100644 index 00000000..7fc5d501 --- /dev/null +++ "b/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/Images.xcassets/mStart_prs.imageset/Contents.json" @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x", + "filename" : "start_prs@1x.png" + }, + { + "idiom" : "universal", + "scale" : "2x", + "filename" : "start_prs@2x.png" + }, + { + "idiom" : "universal", + "scale" : "3x", + "filename" : "start_prs@3x.png" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git "a/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/Images.xcassets/mStart_prs.imageset/start_prs@1x.png" "b/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/Images.xcassets/mStart_prs.imageset/start_prs@1x.png" new file mode 100644 index 00000000..e50d4046 Binary files /dev/null and "b/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/Images.xcassets/mStart_prs.imageset/start_prs@1x.png" differ diff --git "a/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/Images.xcassets/mStart_prs.imageset/start_prs@2x.png" "b/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/Images.xcassets/mStart_prs.imageset/start_prs@2x.png" new file mode 100644 index 00000000..abc7c0ac Binary files /dev/null and "b/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/Images.xcassets/mStart_prs.imageset/start_prs@2x.png" differ diff --git "a/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/Images.xcassets/mStart_prs.imageset/start_prs@3x.png" "b/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/Images.xcassets/mStart_prs.imageset/start_prs@3x.png" new file mode 100644 index 00000000..58984851 Binary files /dev/null and "b/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/Images.xcassets/mStart_prs.imageset/start_prs@3x.png" differ diff --git "a/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/Images.xcassets/mStop.imageset/Contents.json" "b/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/Images.xcassets/mStop.imageset/Contents.json" new file mode 100644 index 00000000..1b3a21af --- /dev/null +++ "b/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/Images.xcassets/mStop.imageset/Contents.json" @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x", + "filename" : "stop@1x.png" + }, + { + "idiom" : "universal", + "scale" : "2x", + "filename" : "stop@2x.png" + }, + { + "idiom" : "universal", + "scale" : "3x", + "filename" : "stop@3x.png" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git "a/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/Images.xcassets/mStop.imageset/stop@1x.png" "b/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/Images.xcassets/mStop.imageset/stop@1x.png" new file mode 100644 index 00000000..dc74f369 Binary files /dev/null and "b/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/Images.xcassets/mStop.imageset/stop@1x.png" differ diff --git "a/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/Images.xcassets/mStop.imageset/stop@2x.png" "b/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/Images.xcassets/mStop.imageset/stop@2x.png" new file mode 100644 index 00000000..52f6e311 Binary files /dev/null and "b/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/Images.xcassets/mStop.imageset/stop@2x.png" differ diff --git "a/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/Images.xcassets/mStop.imageset/stop@3x.png" "b/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/Images.xcassets/mStop.imageset/stop@3x.png" new file mode 100644 index 00000000..29b4d450 Binary files /dev/null and "b/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/Images.xcassets/mStop.imageset/stop@3x.png" differ diff --git "a/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/Images.xcassets/mStop_prs.imageset/Contents.json" "b/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/Images.xcassets/mStop_prs.imageset/Contents.json" new file mode 100644 index 00000000..a89ff282 --- /dev/null +++ "b/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/Images.xcassets/mStop_prs.imageset/Contents.json" @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x", + "filename" : "stop_prs@1x.png" + }, + { + "idiom" : "universal", + "scale" : "2x", + "filename" : "stop_prs@2x.png" + }, + { + "idiom" : "universal", + "scale" : "3x", + "filename" : "stop_prs@3x.png" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git "a/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/Images.xcassets/mStop_prs.imageset/stop_prs@1x.png" "b/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/Images.xcassets/mStop_prs.imageset/stop_prs@1x.png" new file mode 100644 index 00000000..470b0ab1 Binary files /dev/null and "b/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/Images.xcassets/mStop_prs.imageset/stop_prs@1x.png" differ diff --git "a/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/Images.xcassets/mStop_prs.imageset/stop_prs@2x.png" "b/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/Images.xcassets/mStop_prs.imageset/stop_prs@2x.png" new file mode 100644 index 00000000..deb9f1cd Binary files /dev/null and "b/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/Images.xcassets/mStop_prs.imageset/stop_prs@2x.png" differ diff --git "a/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/Images.xcassets/mStop_prs.imageset/stop_prs@3x.png" "b/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/Images.xcassets/mStop_prs.imageset/stop_prs@3x.png" new file mode 100644 index 00000000..79695c9c Binary files /dev/null and "b/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/Images.xcassets/mStop_prs.imageset/stop_prs@3x.png" differ diff --git "a/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/Images.xcassets/menu.imageset/Artboard 2@1x.png" "b/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/Images.xcassets/menu.imageset/Artboard 2@1x.png" new file mode 100644 index 00000000..d10466ec Binary files /dev/null and "b/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/Images.xcassets/menu.imageset/Artboard 2@1x.png" differ diff --git "a/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/Images.xcassets/menu.imageset/Artboard 2@2x.png" "b/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/Images.xcassets/menu.imageset/Artboard 2@2x.png" new file mode 100644 index 00000000..9a016b7a Binary files /dev/null and "b/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/Images.xcassets/menu.imageset/Artboard 2@2x.png" differ diff --git "a/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/Images.xcassets/menu.imageset/Artboard 2@3x.png" "b/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/Images.xcassets/menu.imageset/Artboard 2@3x.png" new file mode 100644 index 00000000..2c3da4be Binary files /dev/null and "b/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/Images.xcassets/menu.imageset/Artboard 2@3x.png" differ diff --git "a/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/Images.xcassets/menu.imageset/Contents.json" "b/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/Images.xcassets/menu.imageset/Contents.json" new file mode 100644 index 00000000..af4ca8ea --- /dev/null +++ "b/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/Images.xcassets/menu.imageset/Contents.json" @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x", + "filename" : "Artboard 2@1x.png" + }, + { + "idiom" : "universal", + "scale" : "2x", + "filename" : "Artboard 2@2x.png" + }, + { + "idiom" : "universal", + "scale" : "3x", + "filename" : "Artboard 2@3x.png" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git "a/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/Images.xcassets/menu_prs.imageset/Artboard 1@1x.png" "b/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/Images.xcassets/menu_prs.imageset/Artboard 1@1x.png" new file mode 100644 index 00000000..9cc3a4e9 Binary files /dev/null and "b/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/Images.xcassets/menu_prs.imageset/Artboard 1@1x.png" differ diff --git "a/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/Images.xcassets/menu_prs.imageset/Artboard 1@2x.png" "b/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/Images.xcassets/menu_prs.imageset/Artboard 1@2x.png" new file mode 100644 index 00000000..491ec157 Binary files /dev/null and "b/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/Images.xcassets/menu_prs.imageset/Artboard 1@2x.png" differ diff --git "a/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/Images.xcassets/menu_prs.imageset/Artboard 1@3x.png" "b/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/Images.xcassets/menu_prs.imageset/Artboard 1@3x.png" new file mode 100644 index 00000000..25b09b46 Binary files /dev/null and "b/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/Images.xcassets/menu_prs.imageset/Artboard 1@3x.png" differ diff --git "a/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/Images.xcassets/menu_prs.imageset/Contents.json" "b/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/Images.xcassets/menu_prs.imageset/Contents.json" new file mode 100644 index 00000000..b954eb33 --- /dev/null +++ "b/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/Images.xcassets/menu_prs.imageset/Contents.json" @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x", + "filename" : "Artboard 1@1x.png" + }, + { + "idiom" : "universal", + "scale" : "2x", + "filename" : "Artboard 1@2x.png" + }, + { + "idiom" : "universal", + "scale" : "3x", + "filename" : "Artboard 1@3x.png" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git "a/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/Info.plist" "b/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/Info.plist" new file mode 100644 index 00000000..db242451 --- /dev/null +++ "b/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/Info.plist" @@ -0,0 +1,47 @@ + + + + + UIBackgroundModes + + audio + + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + cstlab.xsdlr.$(PRODUCT_NAME:rfc1034identifier) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + LSRequiresIPhoneOS + + UILaunchStoryboardName + LaunchScreen + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIViewControllerBasedStatusBarAppearance + + + diff --git "a/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/MainViewController.h" "b/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/MainViewController.h" new file mode 100644 index 00000000..e83860be --- /dev/null +++ "b/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/MainViewController.h" @@ -0,0 +1,60 @@ +// +// MainViewController.h +// NetMusic +// +// Created by xsdlr on 14/12/1. +// Copyright (c) 2014年 xsdlr. All rights reserved. +// + +#import +#import "BaseViewController.h" +#import "ShadeView.h" +#import "QCBSongModel.h" +#import "SongTableViewController.h" + +@interface MainViewController : BaseViewController +/** + * 关闭遮罩 + */ +- (void) closeShadeView; +/** + * 添加歌曲信息 + * + * @param songs 歌曲信息数组 + */ +- (void) addSongs:(NSArray*) songs; +/** + * 添加单个歌曲 + * + * @param song 歌曲信息 + */ +- (void) addSong:(QCBSongModel*) song; +/** + * 移除所有歌曲信息 + */ +- (void) removeAllSongs; +/** + * 设置频道id + * + * @param cid 频道id + */ +- (void) setChannelId:(NSString*) cid; +/** + * 播放歌曲 + * + * @param song 歌曲 + */ +- (void) playSong:(QCBSongModel*) song; +/** + * 获得下一首歌 + * + * @return QCBSongModel + */ +- (QCBSongModel*) getNextSong; +/** + * 获得前一首歌 + * + * @return QCBSongModel + */ +- (QCBSongModel *)getPreviousSong; +@end diff --git "a/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/MainViewController.m" "b/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/MainViewController.m" new file mode 100644 index 00000000..be2c0cc5 --- /dev/null +++ "b/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/MainViewController.m" @@ -0,0 +1,179 @@ +// +// MainViewController.m +// NetMusic +// +// Created by xsdlr on 14/12/1. +// Copyright (c) 2014年 xsdlr. All rights reserved. +// + +#import +#import "MainViewController.h" +#import "ChannelViewController.h" +#include "GlobalDefine.h" +#import "QCBChannelModel.h" +#import "QCBBaseRequest+ChannelRequest.h" +#import "QCBBaseRequest+SongRequest.h" +#import "PlayerViewController.h" + +@interface MainViewController () +@property(strong,nonatomic) ChannelViewController *channelViewController; +@property(strong,nonatomic) SongTableViewController *songTableViewController; +@property(strong,nonatomic) PlayerViewController * playerViewController; +@property(strong,nonatomic) ShadeView *shadeView; + +@end + +@implementation MainViewController + +- (void)viewDidLoad { + [super viewDidLoad]; + [GlobalDefine setBodyHeight:GlobalDefine.ScreenHeight - GlobalDefine.HeaderHight]; + [self configLayout]; //配置主界面 + [self configSongTable]; + [self configLeftSideMenu]; //配置左边栏 + [self configPlayView]; + [self loadChannelData]; //加载频道数据 + [self loadSongData]; //初始化加载默认频道歌曲 + +} + +- (void)didReceiveMemoryWarning { + [super didReceiveMemoryWarning]; + // Dispose of any resources that can be recreated. +} + +- (void) leftButtonDealer: (id)sender { + if (self.channelViewController.isShowed) { + [self.shadeView removeFromSuperview]; + } else { + [self addShadeView]; + } + [self.channelViewController toggleChannelView]; +} + +- (void) configLeftSideMenu { + self.channelViewController = [ChannelViewController new]; +// self.channelViewController.delegate = self; + UIView *leftView = self.channelViewController.view; + [self.view insertSubview:leftView atIndex:2]; + self.channelViewController.width = 150.0f;//设置边栏的宽度 + [self addChildViewController:self.channelViewController]; + +} + +- (void) configSongTable { + self.songTableViewController = [SongTableViewController new]; + [self addChildViewController:self.songTableViewController]; + [self.view insertSubview:self.songTableViewController.view atIndex:0]; +} + +- (void) configPlayView { + self.playerViewController = [PlayerViewController new]; + UIView *playerView = self.playerViewController.view; + [self.view insertSubview:playerView atIndex:2]; + [self addChildViewController:self.playerViewController]; +} + +- (void) configLayout { + self.navigationBarTitleColor = [UIColor colorWithRed:0.718 green:0.117 blue:0.156 alpha:0.800]; + [self addTitleViewByTitle:@"音乐" color: [UIColor whiteColor]]; + [self addLeftButtonByImage:@"menu" selectedImageName:@"menu_prs"]; +} + +- (void) addShadeView { + self.shadeView = [[ShadeView alloc]initWithFrame:CGRectMake(0, GlobalDefine.HeaderHight, GlobalDefine.ScreenWidth, GlobalDefine.ScreenHeight-GlobalDefine.HeaderHight)]; + self.shadeView.delegate = self; + self.shadeView.backgroundColor = [UIColor clearColor]; + [self.view insertSubview:self.shadeView aboveSubview:self.songTableViewController.view]; +} + +- (void) qTouchesEnded:(NSSet *)touches withEvent:(UIEvent *)event { + if (self.channelViewController.isShowed) { + [self closeShadeView]; + [self.channelViewController toggleChannelView]; + } +} + +- (void) loadChannelData { + [QCBBaseRequest channelList:GlobalDefine.channelUrl success:^(NSArray *channelList) { + NSLog(@"频道数据加载成功"); + [self.channelViewController addChannels: channelList]; + } fail:^(NSError *error) { + NSLog(@"%@",error); + }]; +} + +- (void) loadSongData { + [QCBBaseRequest songList:GlobalDefine.songUrl channelId:@"0" type:@"n" success:^(NSArray *songList) { + NSLog(@"初始化歌曲数据加载成功"); + self.songTableViewController.channelId = @"0"; + [self.songTableViewController addSongs: songList]; + + } fail:^(NSError *error) { + NSLog(@"%@",error); + }]; +} + +- (void)closeShadeView { + [self.shadeView removeFromSuperview]; +} + +- (void)addSong:(QCBSongModel *)song { + [self.songTableViewController addSong:song]; +} + +- (void)addSongs:(NSArray *)songs { + [self.songTableViewController addSongs:songs]; +} + +- (void)removeAllSongs { + [self.songTableViewController removeAllSongs]; +} + +- (void)setChannelId:(NSString*) cid { + self.songTableViewController.channelId = [cid copy]; +} + +- (void)playSong:(QCBSongModel *)song { + //通知界面改变 + if (!self.playerViewController.isShowed) { + [GlobalDefine setBodyHeight:GlobalDefine.ScreenHeight - GlobalDefine.HeaderHight - GlobalDefine.FooterHight]; + [self.playerViewController showPlayer]; + [self.songTableViewController fireResize]; + [self.channelViewController fireResize]; + } + [self.playerViewController stop]; + [self.playerViewController setSong:song]; + [self.playerViewController play]; +} + +- (QCBSongModel *)getNextSong { + NSUInteger index = self.songTableViewController.songIndex + 1; + QCBSongModel *song = [self.songTableViewController getSongByIndex:index]; + if (song) { + [self.songTableViewController selectRowAtIndex:index]; + self.songTableViewController.songIndex = index; + } + return song; +} + +- (QCBSongModel *)getPreviousSong { + NSUInteger index = self.songTableViewController.songIndex - 1; + QCBSongModel *song = [self.songTableViewController getSongByIndex:index]; + if (song) { + [self.songTableViewController selectRowAtIndex:index]; + self.songTableViewController.songIndex = index; + } + return song; +} +/* +#pragma mark - Navigation + +// In a storyboard-based application, you will often want to do a little preparation before navigation +- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { + // Get the new view controller using [segue destinationViewController]. + // Pass the selected object to the new view controller. +} +*/ + +@end diff --git "a/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/PlayerViewController.h" "b/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/PlayerViewController.h" new file mode 100644 index 00000000..c609d0b2 --- /dev/null +++ "b/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/PlayerViewController.h" @@ -0,0 +1,39 @@ +// +// PlayerViewController.h +// NetMusic +// +// Created by xsdlr on 14/12/6. +// Copyright (c) 2014年 xsdlr. All rights reserved. +// + +#import +#import "QCBSongModel.h" + +//typedef NS_OPTIONS(NSUInteger, QCBPlayerStatus) { +// QCBPlayerStatusInit = 0 , +// QCBPlayerStatusPlaying = 1 , +// QCBPlayerStatusPause = 1<<1 +//}; + +@interface PlayerViewController : UIViewController +@property(weak,nonatomic) QCBSongModel *song; +@property(assign,nonatomic) BOOL isShowed; +/** + * 设置歌曲 + * + * @param song 歌曲 + */ +- (void)setSong:(QCBSongModel *)song; +/** + * 展示player + */ +- (void) showPlayer; +/** + * 播放音乐 + */ +- (void) play; +/** + * 停止音乐 + */ +- (void) stop; +@end diff --git "a/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/PlayerViewController.m" "b/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/PlayerViewController.m" new file mode 100644 index 00000000..211cc53c --- /dev/null +++ "b/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/PlayerViewController.m" @@ -0,0 +1,342 @@ +// +// PlayerViewController.m +// NetMusic +// +// Created by xsdlr on 14/12/6. +// Copyright (c) 2014年 xsdlr. All rights reserved. +// + +#import "PlayerViewController.h" +#include "GlobalDefine.h" +#import "QCBBaseRequest+SongRequest.h" +#import "UIButtonMake.h" +#import "MainViewController.h" +#import "MBProgressHUD.h" +#import +#import +#import +#import + +@interface PlayerViewController() +@property(assign,nonatomic) NSInteger radius; +@property(strong,nonatomic) UIImageView *imageView; +@property(strong,nonatomic) UILabel *songTitle; +@property(strong,nonatomic) UILabel *artistTitle; +@property(retain,nonatomic) NSData *albumImageData; +@property(strong,nonatomic) UIButton *toggleButton; +@property(strong,nonatomic) UIButton *skipButton; +@property(strong,nonatomic) UIView *progressBar; +@property(assign,nonatomic) BOOL isPlaying; +@property(assign,nonatomic) BOOL isPaused;//曾经被暂停 +@property(strong,nonatomic) NSString* status; +@property(strong,nonatomic) NSURL *songUrl; +@property(strong,nonatomic) NSTimer *progressUpdateTimer; +@property(assign,nonatomic) double totalSongTimeSecond;//歌曲总时长 +@property(assign,nonatomic) double currentSongTimeSecond;//当前歌曲时长 +@property (nonatomic, retain) MPMoviePlayerController *audioPlayer; +@end + +@implementation PlayerViewController + +- (void)viewDidLoad { + [super viewDidLoad]; + _radius = 3; + _isPlaying = NO; + _isShowed = NO; + _isPaused = NO; + _currentSongTimeSecond = 0; + _totalSongTimeSecond = 0; + _audioPlayer = [[MPMoviePlayerController alloc] init]; + + [self configPlayer]; + [self configLayout]; +} + +- (void) configPlayer { + [[AVAudioSession sharedInstance] setDelegate: self]; + NSError *err; + + // Initialize the AVAudioSession here. + if (![[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayback error:&err]) { + // Handle the error here. + NSLog(@"Audio Session error %@, %@", err, [err userInfo]); + } + else{ + // Since there were no errors initializing the session, we'll allow begin receiving remote control events + [[UIApplication sharedApplication] beginReceivingRemoteControlEvents]; + } + [_audioPlayer setShouldAutoplay:NO]; + [_audioPlayer setControlStyle: MPMovieControlStyleEmbedded]; + _audioPlayer.view.hidden = YES; + [self.view addSubview:_audioPlayer.view]; +} + +- (void) configLayout { + self.view.frame = CGRectMake(0, GlobalDefine.ScreenHeight, GlobalDefine.ScreenWidth, GlobalDefine.FooterHight); + + //设置阴影 + self.view.layer.shadowColor = [UIColor grayColor].CGColor; + self.view.layer.shadowOffset = CGSizeMake(0,-self.radius); + self.view.layer.shadowOpacity = 0.7; + self.view.layer.shadowRadius = self.radius; + //设置毛玻璃效果 + UIVisualEffect *blurEffect; + blurEffect = [UIBlurEffect effectWithStyle:UIBlurEffectStyleLight]; + UIVisualEffectView *visualEffectView; + visualEffectView = [[UIVisualEffectView alloc] initWithEffect:blurEffect]; + visualEffectView.frame = self.view.bounds; + visualEffectView.autoresizingMask = UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth; + [self.view addSubview:visualEffectView]; + //设置图片显示区域 + self.imageView = [[UIImageView alloc]initWithFrame:CGRectMake(0, 0, GlobalDefine.FooterHight, GlobalDefine.FooterHight)]; + self.imageView.autoresizingMask = UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth; + [self.view addSubview:self.imageView]; + //设置歌曲信息view + self.songTitle = [[UILabel alloc]initWithFrame:CGRectMake(GlobalDefine.FooterHight+5, 10, GlobalDefine.ScreenWidth-3*GlobalDefine.FooterHight, 20)]; + self.songTitle.font = [UIFont boldSystemFontOfSize:15]; + [self.view addSubview:self.songTitle]; + self.artistTitle = [[UILabel alloc]initWithFrame:CGRectMake(GlobalDefine.FooterHight+5, 30, GlobalDefine.ScreenWidth-3*GlobalDefine.FooterHight, 20)]; + self.artistTitle.font = [UIFont systemFontOfSize:10]; + [self.view addSubview:self.artistTitle]; + //设置播放按钮 + self.toggleButton = [UIButtonMake createWithImage:[UIImage imageNamed:@"mStart"] + selectedimage:[UIImage imageNamed:@"mStart_prs"] + frame:CGRectMake(GlobalDefine.ScreenWidth-2*GlobalDefine.FooterHight, 0, GlobalDefine.FooterHight, GlobalDefine.FooterHight) + target:self + action:@selector(playerToggle) + events:UIControlEventTouchUpInside]; + self.skipButton = [UIButtonMake createWithImage:[UIImage imageNamed:@"mSkip"] + selectedimage:[UIImage imageNamed:@"mSkip_prs"] + frame:CGRectMake(GlobalDefine.ScreenWidth-GlobalDefine.FooterHight, 0, GlobalDefine.FooterHight, GlobalDefine.FooterHight) + target:self + action:@selector(playerSkip) + events:UIControlEventTouchUpInside]; + [self.view addSubview:self.toggleButton]; + [self.view addSubview:self.skipButton]; + //设置进度条 + self.progressBar = [[UIView alloc]initWithFrame:CGRectMake(-GlobalDefine.ScreenWidth, GlobalDefine.FooterHight-3, GlobalDefine.ScreenWidth, 3)]; + self.progressBar.backgroundColor = [UIColor redColor]; + [self.view addSubview:self.progressBar]; + +} + +- (void) setSong:(QCBSongModel *)song { + [self showPlayer]; + _song = song; + NSString *sid = song.sid; + NSLog(@"sid:%@",sid); + self.songTitle.text = song.title; + self.artistTitle.text = song.artist; + //读取专辑图片 + NSURL *documentsDirectoryURL = [[NSFileManager defaultManager] URLForDirectory:NSDocumentDirectory inDomain:NSUserDomainMask appropriateForURL:nil create:NO error:nil]; + NSURL* filePathUrl = [documentsDirectoryURL URLByAppendingPathComponent:[NSString stringWithFormat:@"%@.jpg",sid]]; + NSData *data = [[NSData alloc]initWithContentsOfURL:filePathUrl]; + + self.songUrl = [[NSURL alloc]initWithString:song.url]; + _audioPlayer.contentURL = self.songUrl; + self.albumImageData = data; + [self changeCenterSongInfo]; + if (data) { + self.imageView.image = [[UIImage alloc] initWithData:data]; + } else { + [QCBBaseRequest downloadSongCoverPic:song.picture rename:[NSString stringWithFormat:@"%@.jpg",sid] success:^(NSURL *filePath) { + NSData *data = [[NSData alloc]initWithContentsOfURL:filePath]; + self.imageView.image = [[UIImage alloc] initWithData:data]; + } fail:^(NSError *error) { + NSLog(@"%@",error); + MBProgressHUD* HUD = [[MBProgressHUD alloc] initWithView:self.view]; + [self.view.superview addSubview:HUD]; + HUD.labelText = @"图片获取失败"; + HUD.mode = MBProgressHUDModeText; + [HUD showAnimated:YES whileExecutingBlock:^{ + sleep(2); + } completionBlock:^{ + [HUD removeFromSuperview]; + }]; + }]; + } +} + +- (void) changeCenterSongInfo { + + Class playingInfoCenter = NSClassFromString(@"MPNowPlayingInfoCenter"); + + if (playingInfoCenter) { + NSMutableDictionary *songInfo = [[NSMutableDictionary alloc] init]; + [songInfo setObject:self.song.title forKey:MPMediaItemPropertyTitle]; + [songInfo setObject:self.song.artist forKey:MPMediaItemPropertyArtist]; + [songInfo setObject:self.song.albumtitle forKey:MPMediaItemPropertyAlbumTitle]; + [songInfo setObject:[[NSNumber alloc] initWithDouble:self.currentSongTimeSecond] forKey:MPNowPlayingInfoPropertyElapsedPlaybackTime]; + [songInfo setObject:[[NSNumber alloc] initWithDouble:self.totalSongTimeSecond] forKey:MPMediaItemPropertyPlaybackDuration]; +// if (self.albumImageData) { +// MPMediaItemArtwork *albumArt = [[MPMediaItemArtwork alloc] initWithImage:[[UIImage alloc] initWithData:self.albumImageData]]; +// [songInfo setObject:albumArt forKey:MPMediaItemPropertyArtwork]; +// } + [[MPNowPlayingInfoCenter defaultCenter] setNowPlayingInfo:songInfo]; + + + } + +} + +- (void) playerToggle { + if (self.isPlaying) { + self.isPlaying = NO; + [self.toggleButton setBackgroundImage:[UIImage imageNamed:@"mStart"] forState:UIControlStateNormal]; + [self.toggleButton setBackgroundImage:[UIImage imageNamed:@"mStart_prs"] forState:UIControlStateHighlighted]; + [self.audioPlayer pause]; + self.isPaused = YES; + } else { + self.isPlaying = YES; + [self.toggleButton setBackgroundImage:[UIImage imageNamed:@"mStop"] forState:UIControlStateNormal]; + [self.toggleButton setBackgroundImage:[UIImage imageNamed:@"mStop_prs"] forState:UIControlStateHighlighted]; + if (self.isPaused) { + [self.audioPlayer prepareToPlay]; + [self.audioPlayer play]; + } else { + [self.audioPlayer prepareToPlay]; + [self.audioPlayer play]; + //实时修改进度条 + if (self.progressUpdateTimer) { + [self.progressUpdateTimer invalidate]; + self.progressUpdateTimer = nil; + } + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(playerFinish) name:MPMoviePlayerPlaybackDidFinishNotification object:nil]; + self.progressUpdateTimer = [NSTimer scheduledTimerWithTimeInterval:1 + target:self + selector:@selector(updatePlayerProgress) + userInfo:nil + repeats:YES]; + } + + } +} +//歌曲结束 +- (void) playerFinish { + if (self.totalSongTimeSecond > 0 && self.totalSongTimeSecond - self.currentSongTimeSecond <= 2) { + NSLog(@"歌曲结束"); + [[NSNotificationCenter defaultCenter] removeObserver:self name:MPMoviePlayerPlaybackDidFinishNotification object:nil]; + MainViewController* parentViewController = (MainViewController*) self.parentViewController; + QCBSongModel *nextSong = [parentViewController getNextSong]; + [self stop]; + + if (nextSong) { + self.song = nextSong; + [self play]; + } + } +} + +- (void) playerSkip { + MainViewController* parentViewController = (MainViewController*) self.parentViewController; + QCBSongModel *nextSong = [parentViewController getNextSong]; + if (nextSong) { + [self stop]; + self.song = nextSong; + [self play]; + } else { + MBProgressHUD* HUD = [[MBProgressHUD alloc] initWithView:self.view]; + [self.view.superview addSubview:HUD]; + HUD.labelText = @"歌单已播完"; + HUD.mode = MBProgressHUDModeText; + [HUD showAnimated:YES whileExecutingBlock:^{ + sleep(1); + } completionBlock:^{ + [HUD removeFromSuperview]; + }]; + } +} + +- (void) playBack { + MainViewController* parentViewController = (MainViewController*) self.parentViewController; + QCBSongModel *previousSong = [parentViewController getPreviousSong]; + if (previousSong) { + [self stop]; + self.song = previousSong; + [self play]; + } +} + +- (void) showPlayer { + self.isShowed = YES; + [UIView animateWithDuration:0.4f animations:^(void){ + self.view.frame = CGRectMake(0, GlobalDefine.ScreenHeight-GlobalDefine.FooterHight, GlobalDefine.ScreenWidth, GlobalDefine.FooterHight); + } completion:nil]; +} + +- (void) stop { + self.isPlaying = NO; + self.isPaused = NO; + if (self.audioPlayer.playbackState == MPMoviePlaybackStatePlaying || + self.audioPlayer.playbackState == MPMoviePlaybackStatePaused) { + [self.audioPlayer stop]; + } +} + +- (void) play { + self.progressBar.frame = CGRectMake(-GlobalDefine.ScreenWidth, GlobalDefine.FooterHight-3, GlobalDefine.ScreenWidth, 3); + NSDictionary *opts = [NSDictionary dictionaryWithObject:[NSNumber numberWithBool:NO] + forKey:AVURLAssetPreferPreciseDurationAndTimingKey]; + AVURLAsset *urlAsset = [AVURLAsset URLAssetWithURL:self.songUrl options:opts]; // 初始化媒体文件 + + self.totalSongTimeSecond = urlAsset.duration.value / urlAsset.duration.timescale; // 获取视频总时长,单位秒 + NSLog(@"总时长:%.0lf秒",self.totalSongTimeSecond); + [self playerToggle]; +} + +- (void) updatePlayerProgress { + + NSTimeInterval cur = self.audioPlayer.currentPlaybackTime; + double percent = 0; + if (self.totalSongTimeSecond != 0) { + percent = cur/self.totalSongTimeSecond; + self.currentSongTimeSecond = cur; + if (cur == self.totalSongTimeSecond) { + if (self.progressUpdateTimer) { + [self.progressUpdateTimer invalidate]; + self.progressUpdateTimer = nil; + } + + } + } + self.progressBar.frame = CGRectMake(-(GlobalDefine.ScreenWidth*(1-percent)), GlobalDefine.FooterHight-3, GlobalDefine.ScreenWidth, 3); + [self changeCenterSongInfo]; +} +- (void)viewDidAppear:(BOOL)animated { + [super viewDidAppear:animated]; + [[UIApplication sharedApplication] beginReceivingRemoteControlEvents]; + [self becomeFirstResponder]; +} + +- (void)viewDidDisappear:(BOOL)animated { + [[UIApplication sharedApplication] endReceivingRemoteControlEvents]; + [self resignFirstResponder]; + [super viewDidDisappear:animated]; +} + +- (void)remoteControlReceivedWithEvent:(UIEvent *)receivedEvent { + if ( receivedEvent.type == UIEventTypeRemoteControl ) { + switch (receivedEvent.subtype) { + case UIEventSubtypeRemoteControlPlay: + case UIEventSubtypeRemoteControlPause: + case UIEventSubtypeRemoteControlStop: + case UIEventSubtypeRemoteControlTogglePlayPause: + [self playerToggle]; + break; + case UIEventSubtypeRemoteControlPreviousTrack: + [self playBack]; + break; + case UIEventSubtypeRemoteControlNextTrack: + [self playerSkip]; + break; + default: + break; + } + } +} + +- (BOOL)canBecomeFirstResponder { + return YES; +} + +@end diff --git "a/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/QCBBaseModel.h" "b/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/QCBBaseModel.h" new file mode 100644 index 00000000..7fc4a70d --- /dev/null +++ "b/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/QCBBaseModel.h" @@ -0,0 +1,13 @@ +// +// QCBBaseModel.h +// NetMusic +// +// Created by xsdlr on 14/12/5. +// Copyright (c) 2014年 xsdlr. All rights reserved. +// + +#import + +@interface QCBBaseModel : NSObject + +@end diff --git "a/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/QCBBaseModel.m" "b/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/QCBBaseModel.m" new file mode 100644 index 00000000..1cf710db --- /dev/null +++ "b/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/QCBBaseModel.m" @@ -0,0 +1,15 @@ +// +// QCBBaseModel.m +// NetMusic +// +// Created by xsdlr on 14/12/5. +// Copyright (c) 2014年 xsdlr. All rights reserved. +// + +#import "QCBBaseModel.h" + +@implementation QCBBaseModel +-(void)setValue:(id)value forUndefinedKey:(NSString *)key { + NSLog(@"未知属性%@",key); +} +@end diff --git "a/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/QCBBaseRequest+ChannelRequest.h" "b/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/QCBBaseRequest+ChannelRequest.h" new file mode 100644 index 00000000..225d4c0d --- /dev/null +++ "b/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/QCBBaseRequest+ChannelRequest.h" @@ -0,0 +1,26 @@ +// +// QCBBaseRequest+ChannelRequest.h +// NetMusic +// +// Created by xsdlr on 14/12/5. +// Copyright (c) 2014年 xsdlr. All rights reserved. +// + +#import "QCBBaseRequest.h" +#import "QCBChannelModel.h" + +typedef void (^channelListSuccess)(NSArray* channelList); +typedef void (^channelListError)(NSError* error); +@interface QCBBaseRequest (ChannelRequest) +/** + * 获得频道列表 + * + * @param path 请求地址 + * @param success 成功回调 + * @param fail 失败回调 + */ ++ (void) channelList:(NSString*)path + success:(channelListSuccess) success + fail:(channelListError)fail; + +@end diff --git "a/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/QCBBaseRequest+ChannelRequest.m" "b/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/QCBBaseRequest+ChannelRequest.m" new file mode 100644 index 00000000..29265675 --- /dev/null +++ "b/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/QCBBaseRequest+ChannelRequest.m" @@ -0,0 +1,40 @@ +// +// QCBBaseRequest+ChannelRequest.m +// NetMusic +// +// Created by xsdlr on 14/12/5. +// Copyright (c) 2014年 xsdlr. All rights reserved. +// + +#import "QCBBaseRequest+ChannelRequest.h" + +@implementation QCBBaseRequest (ChannelRequest) + ++ (void)channelList:(NSString *)path + success:(channelListSuccess)success + fail:(channelListError)fail { + NSMutableArray *result = [NSMutableArray array]; + //转交全局线程 + dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 0), ^{ + [QCBBaseRequest GETRequestWithPath:path parameters:nil success:^(NSDictionary* jsonObject) { + if (jsonObject) { + NSArray *channels = [jsonObject objectForKey:@"channels"]; + if (channels) { + for (NSDictionary* dic in channels) { + QCBChannelModel *model = [QCBChannelModel new]; + [model setValuesForKeysWithDictionary:dic]; + [result addObject:model]; + } + dispatch_async(dispatch_get_main_queue(), ^{ + success(result); + }); + } + } + } fail:^(NSError* error) { + dispatch_async(dispatch_get_main_queue(), ^{ + fail(error); + }); + }]; + }); +} +@end diff --git "a/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/QCBBaseRequest+SongRequest.h" "b/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/QCBBaseRequest+SongRequest.h" new file mode 100644 index 00000000..a0e2f345 --- /dev/null +++ "b/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/QCBBaseRequest+SongRequest.h" @@ -0,0 +1,45 @@ +// +// QCBBaseRequest+SongRequest.h +// NetMusic +// +// Created by xsdlr on 14/12/5. +// Copyright (c) 2014年 xsdlr. All rights reserved. +// + +#import "QCBBaseRequest.h" +#import "QCBSongModel.h" + +typedef void (^songListSuccess)(NSArray* songList); +typedef void (^songlistError)(NSError* error); +typedef void (^songCoverPicDownloadSuccess)(NSURL* filePath); +typedef void (^songCoverPicDownloadError)(NSError* error); +@interface QCBBaseRequest (SongRequest) +/** +* 请求歌曲列表 +* +* @param path 请求地址 +* @param channelId 频道id +* @param type 类型 +* @param success 成功回调 +* @param fail 失败回调 +*/ ++ (void) songList:(NSString*)path + channelId:(NSString*) channelId + type:(NSString*) type + success:(songListSuccess) success + fail:(songlistError)fail; +/** + * 下载歌曲封面图片 + * + * @param path 图片地址 + * @param rename 图片重命名名称 + * @param success 成功回调 + * @param fail 失败回调 + * + * @return NSURLSessionDownloadTask 可通过该实例的cancel方法取消 + */ ++ (NSURLSessionDownloadTask*) downloadSongCoverPic:(NSString*) path + rename:(NSString*)rename + success:(songCoverPicDownloadSuccess) success + fail:(songCoverPicDownloadError) fail; +@end diff --git "a/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/QCBBaseRequest+SongRequest.m" "b/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/QCBBaseRequest+SongRequest.m" new file mode 100644 index 00000000..e2e57904 --- /dev/null +++ "b/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/QCBBaseRequest+SongRequest.m" @@ -0,0 +1,63 @@ +// +// QCBBaseRequest+SongRequest.m +// NetMusic +// +// Created by xsdlr on 14/12/5. +// Copyright (c) 2014年 xsdlr. All rights reserved. +// + +#import "QCBBaseRequest+SongRequest.h" + +@implementation QCBBaseRequest (SongRequest) + ++ (void)songList:(NSString *)path + channelId:(NSString *)channelId + type:(NSString *)type + success:(songListSuccess)success + fail:(songlistError)fail { + + NSDictionary* parameters = @{@"app_name":@"radio_desktop_win",@"version":@"100",@"channel":channelId,@"type":type,@"from":@"mainsite"}; + NSMutableArray *result = [NSMutableArray array]; + //转交全局线程 + dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 0), ^{ + [QCBBaseRequest GETRequestWithPath:path parameters:parameters success:^(NSDictionary *jsonObject) { + if (jsonObject) { + NSArray *songs = [jsonObject objectForKey:@"song"]; + for (NSDictionary *dic in songs) { + QCBSongModel *song = [QCBSongModel new]; + [song setValuesForKeysWithDictionary:dic]; + [result addObject:song]; + } + dispatch_async(dispatch_get_main_queue(), ^{ + success(result); + }); + } + } fail:^(NSError *error) { + dispatch_async(dispatch_get_main_queue(), ^{ + fail(error); + }); + }]; + }); + +} + ++ (NSURLSessionDownloadTask *)downloadSongCoverPic:(NSString *)path + rename:(NSString *)rename + success:(songCoverPicDownloadSuccess)success + fail:(songCoverPicDownloadError)fail { + __block NSURLSessionDownloadTask *task; + //转交全局线程 + dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 0), ^{ + task = [QCBBaseRequest downloadFile:path rename:rename success:^(NSURL *filePath) { + dispatch_async(dispatch_get_main_queue(), ^{ + success(filePath); + }); + } fail:^(NSError *error) { + dispatch_async(dispatch_get_main_queue(), ^{ + fail(error); + }); + }]; + }); + return task; +} +@end diff --git "a/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/QCBBaseRequest.h" "b/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/QCBBaseRequest.h" new file mode 100644 index 00000000..7bb024a7 --- /dev/null +++ "b/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/QCBBaseRequest.h" @@ -0,0 +1,52 @@ +// +// QCBBaseRequest.h +// NetMusic +// +// Created by xsdlr on 14/12/4. +// Copyright (c) 2014年 xsdlr. All rights reserved. +// + +#import +#import "AFNetworking.h" + +typedef void (^requestSuccess)(id jsonObject); +typedef void (^requestError)(NSError* error); +@interface QCBBaseRequest : NSObject + +/** + * GET请求 + * + * @param path 请求地址 + * @param parameters 请求参数 + * @param success 成功回调 + * @param fail 错误回调 + * + * @return AFHTTPRequestOperation 可通过该实例的cancel方法取消 + */ ++ (AFHTTPRequestOperation*) GETRequestWithPath:(NSString*) path + parameters:(NSDictionary*) parameters + success:(requestSuccess) success + fail:(requestError) fail; +/** + * 解析JSON对象 + * + * @param jsonObject 原始数据对象 + * + * @return NSDictionary 或 nil + */ ++ (NSDictionary*) parseJSON:(NSObject*) jsonObject; +/** + * 下载文件 + * + * @param path 文件地址 + * @param rename 文件重命名名称 + * @param success 成功回调 + * @param fail 失败回调 + * + * @return NSURLSessionDownloadTask 可通过该实例的cancel方法取消 + */ ++ (NSURLSessionDownloadTask*) downloadFile:(NSString*) path + rename:(NSString*) rename + success:(requestSuccess) success + fail:(requestError) fail; +@end diff --git "a/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/QCBBaseRequest.m" "b/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/QCBBaseRequest.m" new file mode 100644 index 00000000..8893de14 --- /dev/null +++ "b/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/QCBBaseRequest.m" @@ -0,0 +1,77 @@ +// +// QCBBaseRequest.m +// NetMusic +// +// Created by xsdlr on 14/12/4. +// Copyright (c) 2014年 xsdlr. All rights reserved. +// + +#import "QCBBaseRequest.h" + +@interface QCBBaseRequest() + +@end + +@implementation QCBBaseRequest + ++ (AFHTTPRequestOperationManager*) OperationManager { + AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager]; +// [manager.requestSerializer setValue:@"application/json" forKey:@"Accept"]; +// [manager.requestSerializer setValue:@"application/json" forKey:@"content-type"]; +// [manager.requestSerializer setValue:@"application/x-www-form-urlencoded" forKey:@"Accept"]; +// [manager.requestSerializer setValue:@"application/x-www-form-urlencoded" forKey:@"content-type"]; + manager.responseSerializer.acceptableContentTypes = [[NSSet alloc] initWithArray:@[@"application/json",@"application/javascript",@"application/x-www-form-urlencoded",@"charset=utf-8",@"image/*"]]; + return manager; +} + ++ (AFURLSessionManager*) SessionManager { + NSURLSessionConfiguration *configuration = [NSURLSessionConfiguration defaultSessionConfiguration]; + AFURLSessionManager *manager = [[AFURLSessionManager alloc] initWithSessionConfiguration:configuration]; + return manager; +} + ++ (AFHTTPRequestOperation *)GETRequestWithPath:(NSString *)path + parameters:(NSDictionary*) parameters + success:(requestSuccess)success + fail:(requestError)fail { + AFHTTPRequestOperation *operation = [[QCBBaseRequest OperationManager] GET:path parameters:parameters success:^(AFHTTPRequestOperation *operation, id responseObject) { + NSDictionary* dic = [QCBBaseRequest parseJSON: responseObject]; + success(dic); + } failure:^(AFHTTPRequestOperation *operation, NSError *error) { + fail(error); + }]; + return operation; +} + ++ (NSDictionary *)parseJSON:(NSObject *)jsonObject { + if ([jsonObject isKindOfClass:[NSDictionary class]]) { + return (NSDictionary*) jsonObject; + } else { + return nil; + } +} + ++ (NSURLSessionDownloadTask *)downloadFile:(NSString *)path + rename:(NSString*) rename + success:(requestSuccess)success + fail:(requestError)fail { + NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:path]]; + + NSURLSessionDownloadTask *downloadTask = [[QCBBaseRequest SessionManager] downloadTaskWithRequest:request progress:nil destination:^NSURL *(NSURL *targetPath, NSURLResponse *response) { + NSURL *documentsDirectoryURL = [[NSFileManager defaultManager] URLForDirectory:NSDocumentDirectory inDomain:NSUserDomainMask appropriateForURL:nil create:NO error:nil]; + if (rename && rename.length>0) { + return [documentsDirectoryURL URLByAppendingPathComponent:rename]; + } else { + return [documentsDirectoryURL URLByAppendingPathComponent:[response suggestedFilename]]; + } + } completionHandler:^(NSURLResponse *response, NSURL *filePath, NSError *error) { + if (!error) { + success(filePath); + } else { + fail(error); + } + }]; + [downloadTask resume]; + return downloadTask; +} +@end diff --git "a/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/QCBChannelModel.h" "b/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/QCBChannelModel.h" new file mode 100644 index 00000000..15f8e7e4 --- /dev/null +++ "b/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/QCBChannelModel.h" @@ -0,0 +1,32 @@ +// +// QCBChannelModel.h +// NetMusic +// +// Created by xsdlr on 14/12/5. +// Copyright (c) 2014年 xsdlr. All rights reserved. +// + +#import "QCBBaseModel.h" + +@interface QCBChannelModel : QCBBaseModel +/** + * 频道英文名 + */ +@property(strong,nonatomic) NSString *name_en; +/** + * 频道序号 + */ +@property(assign,nonatomic) NSInteger seq_id; +/** + * abbr_en + */ +@property(strong,nonatomic) NSString *abbr_en; +/** + * 频道id + */ +@property(strong,nonatomic) NSString *channel_id; +/** + * 频道名称 + */ +@property(strong,nonatomic) NSString *name; +@end diff --git "a/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/QCBChannelModel.m" "b/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/QCBChannelModel.m" new file mode 100644 index 00000000..2e49f4ba --- /dev/null +++ "b/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/QCBChannelModel.m" @@ -0,0 +1,13 @@ +// +// QCBChannelModel.m +// NetMusic +// +// Created by xsdlr on 14/12/5. +// Copyright (c) 2014年 xsdlr. All rights reserved. +// + +#import "QCBChannelModel.h" + +@implementation QCBChannelModel + +@end diff --git "a/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/QCBSongModel.h" "b/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/QCBSongModel.h" new file mode 100644 index 00000000..d8ec1cb3 --- /dev/null +++ "b/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/QCBSongModel.h" @@ -0,0 +1,84 @@ +// +// QCBSongModel.h +// NetMusic +// +// Created by xsdlr on 14/12/5. +// Copyright (c) 2014年 xsdlr. All rights reserved. +// + +#import "QCBBaseModel.h" + +@interface QCBSongModel : QCBBaseModel +/** + * 专辑跳转地址 + */ +@property(strong,nonatomic) NSString *album; +/** + * 专辑图片地址 + */ +@property(strong,nonatomic) NSString *picture; +/** + * 内部编号 + */ +@property(strong,nonatomic) NSString *ssid; +/** + * 艺术家 + */ +@property(strong,nonatomic) NSString *artist; +/** + * 歌曲的URL + */ +@property(strong,nonatomic) NSString *url; +/** + * 唱片公司 + */ +@property(strong,nonatomic) NSString *company; +/** + * 歌曲名 + */ +@property(strong,nonatomic) NSString *title; +/** + * 平均分数 + */ +@property(assign,nonatomic) NSInteger rating_avg; +/** + * 长度 + */ +@property(assign,nonatomic) NSInteger length; +/** + * 子类型 + */ +@property(strong,nonatomic) NSString *subtype; +/** + * 出版年份 + */ +@property(strong,nonatomic) NSString *public_time; +/** + * 歌单数量 + */ +@property(assign,nonatomic) NSInteger songlists_count; +/** + * 歌曲id + */ +@property(strong,nonatomic) NSString *sid; +/** + * 专辑id + */ +@property(strong,nonatomic) NSString *aid; +/** + * 哈希值 + */ +@property(strong,nonatomic) NSString *sha256; +/** + * 码率 + */ +@property(strong,nonatomic) NSString *kbps; +/** + * 专辑名 + */ +@property(strong,nonatomic) NSString *albumtitle; +/** + * 是否已喜欢(0为false,1为true) + */ +@property(strong,nonatomic) NSString *like; +@end diff --git "a/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/QCBSongModel.m" "b/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/QCBSongModel.m" new file mode 100644 index 00000000..d4de9380 --- /dev/null +++ "b/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/QCBSongModel.m" @@ -0,0 +1,13 @@ +// +// QCBSongModel.m +// NetMusic +// +// Created by xsdlr on 14/12/5. +// Copyright (c) 2014年 xsdlr. All rights reserved. +// + +#import "QCBSongModel.h" + +@implementation QCBSongModel + +@end diff --git "a/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/ShadeView.h" "b/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/ShadeView.h" new file mode 100644 index 00000000..e95bece5 --- /dev/null +++ "b/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/ShadeView.h" @@ -0,0 +1,14 @@ +// +// ShadeView.h +// NetMusic +// +// Created by xsdlr on 14/12/4. +// Copyright (c) 2014年 xsdlr. All rights reserved. +// + +#import +#import "ShadeViewDelegate.h" + +@interface ShadeView : UIView +@property (nonatomic, assign) id delegate; +@end diff --git "a/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/ShadeView.m" "b/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/ShadeView.m" new file mode 100644 index 00000000..29a7e788 --- /dev/null +++ "b/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/ShadeView.m" @@ -0,0 +1,26 @@ +// +// ShadeView.m +// NetMusic +// +// Created by xsdlr on 14/12/4. +// Copyright (c) 2014年 xsdlr. All rights reserved. +// + +#import "ShadeView.h" + +@implementation ShadeView + +/* +// Only override drawRect: if you perform custom drawing. +// An empty implementation adversely affects performance during animation. +- (void)drawRect:(CGRect)rect { + // Drawing code +} +*/ + +- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event { + NSLog(@"touchesEnded ShadeView"); + [super touchesEnded:touches withEvent:event]; + [self.delegate qTouchesEnded:touches withEvent:event]; +} +@end diff --git "a/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/ShadeViewDelegate.h" "b/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/ShadeViewDelegate.h" new file mode 100644 index 00000000..e333fae7 --- /dev/null +++ "b/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/ShadeViewDelegate.h" @@ -0,0 +1,19 @@ +// +// ShadeViewDelegate.h +// NetMusic +// +// Created by xsdlr on 14/12/4. +// Copyright (c) 2014年 xsdlr. All rights reserved. +// + +#import + +@protocol ShadeViewDelegate +/** + * 触摸结束 + * + * @param touches UITouch的集合 + * @param event 事件 + */ +- (void)qTouchesEnded:(NSSet *)touches withEvent:(UIEvent *)event; +@end diff --git "a/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/SongTableViewController.h" "b/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/SongTableViewController.h" new file mode 100644 index 00000000..f48069d3 --- /dev/null +++ "b/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/SongTableViewController.h" @@ -0,0 +1,55 @@ +// +// SongTableViewController.h +// NetMusic +// +// Created by xsdlr on 14/12/6. +// Copyright (c) 2014年 xsdlr. All rights reserved. +// + +#import +#import "QCBSongModel.h" + +@interface SongTableViewController : UITableViewController +/** + * 频道id + */ +@property(strong,nonatomic) NSString *channelId; +/** + * 当前歌曲下标 + */ +@property(assign,nonatomic) NSUInteger songIndex; +/** + * 添加歌曲信息 + * + * @param songs 歌曲信息数组 + */ +- (void) addSongs:(NSArray*) songs; +/** + * 添加单个歌曲 + * + * @param song 歌曲信息 + */ +- (void) addSong:(QCBSongModel*) song; +/** + * 移除所有歌曲信息 + */ +- (void) removeAllSongs; +/** + * 通知界面大小变化 + */ +- (void) fireResize; +/** + * 根据下标获得歌曲信息 + * + * @param index 下标 + * + * @return QCBSongModel 若index越界则返回nil + */ +- (QCBSongModel*) getSongByIndex:(NSUInteger) index; +/** + * 根据下标选中tableview + * + * @param index 下标 + */ +- (void) selectRowAtIndex:(NSUInteger) index; +@end diff --git "a/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/SongTableViewController.m" "b/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/SongTableViewController.m" new file mode 100644 index 00000000..9253d208 --- /dev/null +++ "b/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/SongTableViewController.m" @@ -0,0 +1,152 @@ +// +// SongTableViewController.m +// NetMusic +// +// Created by xsdlr on 14/12/6. +// Copyright (c) 2014年 xsdlr. All rights reserved. +// + +#import "SongTableViewController.h" +#include "GlobalDefine.h" +#import "QCBBaseRequest+SongRequest.h" +#import "MainViewController.h" +#import "MBProgressHUD.h" + +@interface SongTableViewController() +@property(strong,nonatomic) NSMutableArray *songList;//歌曲信息列表 +@end + +@implementation SongTableViewController + +- (void)viewDidLoad { + [super viewDidLoad]; + _songList = [NSMutableArray array]; + _songIndex = NSUIntegerMax;//初始未选择 + UITableView *view = [[UITableView alloc]initWithFrame:CGRectMake(0, GlobalDefine.HeaderHight, GlobalDefine.ScreenWidth, [GlobalDefine getBodyHeight]) style:UITableViewStylePlain]; + view.separatorStyle = UITableViewCellSeparatorStyleNone; + view.delegate = self; + view.dataSource = self; + self.view = view; + self.tableView = view; + //设置内部下拉刷新 + UIRefreshControl *refresh = [[UIRefreshControl alloc] init]; + refresh.attributedTitle = [[NSAttributedString alloc] initWithString:@"下拉刷新"]; + refresh.tintColor = [UIColor blueColor]; + [refresh addTarget:self action:@selector(pullToRefresh) forControlEvents:UIControlEventValueChanged]; + self.refreshControl = refresh; +} + +- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath { + return 60.0f; +} + +- (CGFloat)tableView:(UITableView *)tableView estimatedHeightForRowAtIndexPath:(NSIndexPath *)indexPath { + return 60.0f; +} + +- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { + return self.songList.count; +} + +- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { + static NSString *CellIdentifier = @"Cell"; + UITableViewCell *cell = [tableView + dequeueReusableCellWithIdentifier:CellIdentifier]; + if(cell == nil) { + cell = [[UITableViewCell alloc] + initWithStyle:UITableViewCellStyleSubtitle + reuseIdentifier:CellIdentifier]; + } + //设置单元格颜色及选中后的颜色 + cell.backgroundColor = [UIColor clearColor]; + cell.textLabel.textColor = [UIColor darkGrayColor]; + cell.selectedBackgroundView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, cell.frame.size.width, cell.frame.size.height)]; + cell.selectedBackgroundView.backgroundColor = [[UIColor grayColor] colorWithAlphaComponent:0.2]; + QCBSongModel *song= [self.songList objectAtIndex:indexPath.row]; + cell.textLabel.text = song.title; + cell.textLabel.font = [UIFont boldSystemFontOfSize:20]; + cell.detailTextLabel.text = [[NSString alloc] initWithFormat:@"%@ - %@",song.artist,song.albumtitle]; + cell.detailTextLabel.font = [UIFont systemFontOfSize:15]; + return cell; +} + +- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { + QCBSongModel *song = [self.songList objectAtIndex:indexPath.row]; + self.songIndex = indexPath.row; +// NSLog(@"%ld",self.songIndex); + MainViewController *parentController = (MainViewController*)self.parentViewController; + [parentController playSong: song]; +// [self.tableView deselectRowAtIndexPath:indexPath animated:YES];//取消选中状态 +// NSLog(@"%@,%@-%@",song.title,song.artist,song.albumtitle); +} + +- (void)addSong:(QCBSongModel *)song { + [self.songList addObject:song]; + [self.tableView reloadData]; +} + +- (void)addSongs:(NSArray *)songs { + [self.songList addObjectsFromArray:songs]; + [self.tableView reloadData]; +} + +- (void)removeAllSongs { + [self.songList removeAllObjects]; + [self.tableView reloadData]; +} + +- (void) pullToRefresh { + if (self.channelId) { + self.refreshControl.attributedTitle = [[NSAttributedString alloc] initWithString:@"刷新中"]; + //请求歌曲列表信息 + [QCBBaseRequest songList:GlobalDefine.songUrl channelId:self.channelId type:@"n" success:^(NSArray *songList) { + [self.refreshControl endRefreshing]; + self.refreshControl.attributedTitle = [[NSAttributedString alloc] initWithString:@"下拉刷新"]; + NSLog(@"获得%ld首歌曲",songList.count); + NSIndexSet *indexes = [NSIndexSet indexSetWithIndexesInRange: NSMakeRange(0,[songList count])]; + [self.songList insertObjects:songList atIndexes:indexes]; + [self.tableView reloadData]; + if (self.songIndex != NSUIntegerMax) { + self.songIndex += songList.count; + } + [self selectRowAtIndex:self.songIndex];//重新选中刷新前的行 + } fail:^(NSError *error) { + NSLog(@"%@",error); + [self.refreshControl endRefreshing]; + self.refreshControl.attributedTitle = [[NSAttributedString alloc] initWithString:@"下拉刷新"]; + }]; + } else { + [self.refreshControl endRefreshing]; + MBProgressHUD* HUD = [[MBProgressHUD alloc] initWithView:self.view]; + [self.view.superview addSubview:HUD]; + HUD.labelText = @"请先选择频道"; + HUD.mode = MBProgressHUDModeText; + [HUD showAnimated:YES whileExecutingBlock:^{ + sleep(1); + } completionBlock:^{ + [HUD removeFromSuperview]; + }]; + } +} + +- (void)fireResize { + [UIView animateWithDuration:0.4f animations:^(void){ + self.view.frame = CGRectMake(0, GlobalDefine.HeaderHight, GlobalDefine.ScreenWidth, [GlobalDefine getBodyHeight]); + } completion:nil]; +} + +- (QCBSongModel *)getSongByIndex:(NSUInteger)index { + if (index < self.songList.count) { + return [self.songList objectAtIndex:index]; + } else { + return nil; + } +} + +- (void)selectRowAtIndex:(NSUInteger)index { + if (index < self.songList.count) { + NSIndexPath *cellPath=[NSIndexPath indexPathForItem:index inSection:0]; + [self.tableView selectRowAtIndexPath:cellPath animated:YES scrollPosition:UITableViewScrollPositionNone]; + } +} +@end diff --git "a/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/UIButtonMake.h" "b/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/UIButtonMake.h" new file mode 100644 index 00000000..168ed718 --- /dev/null +++ "b/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/UIButtonMake.h" @@ -0,0 +1,65 @@ +// +// UIButtonMake.h +// NetMusic +// +// Created by xsdlr on 14/12/2. +// Copyright (c) 2014年 xsdlr. All rights reserved. +// + +#import +#import + +@interface UIButtonMake : NSObject +/** + * 生成普通按钮 + * + * @param title 按钮标题 + * @param width 按钮宽度 + * @param height 按钮高度 + * @param target 绑定对象 + * @param action 执行方法 + * @param events 触发事件 + * + * @return UIButton + */ ++ (UIButton *)createWithTitle:(NSString *)title + width:(CGFloat)width + height:(CGFloat) height + target:(id)target + action:(SEL)action + events:(UIControlEvents) events; +/** + * 生成带图片的按钮 + * + * @param image 按钮图片 + * @param selectedImage 高亮图片 + * @param target 绑定对象 + * @param action 执行方法 + * @param events 触发事件 + * + * @return UIButton + */ ++ (UIButton*) createWithImage: (UIImage*) image + selectedimage:(UIImage *)selectedImage + target:(id)target + action:(SEL)action + events:(UIControlEvents) events; +/** + * 生成带图片的按钮 + * + * @param image 按钮图片 + * @param selectedImage 高亮图片 + * @param frame frame大小 + * @param target 绑定对象 + * @param action 执行方法 + * @param events 触发事件 + * + * @return <#return value description#> + */ ++ (UIButton *)createWithImage:(UIImage *)image + selectedimage:(UIImage *)selectedImage + frame:(CGRect) frame + target:(id)target + action:(SEL)action + events:(UIControlEvents)events; +@end diff --git "a/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/UIButtonMake.m" "b/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/UIButtonMake.m" new file mode 100644 index 00000000..8ae87dba --- /dev/null +++ "b/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/UIButtonMake.m" @@ -0,0 +1,66 @@ +// +// UIButtonMake.m +// NetMusic +// +// Created by xsdlr on 14/12/2. +// Copyright (c) 2014年 xsdlr. All rights reserved. +// + +#import "UIButtonMake.h" + +@interface UIButtonMake() + +@end + +@implementation UIButtonMake + ++ (UIButton *)createWithTarget:(id)target + action:(SEL)action + events:(UIControlEvents) events { + UIButton *button = [[UIButton alloc] init]; + [button addTarget:target action:action forControlEvents:events]; + return button; +} + ++ (UIButton *)createWithTitle:(NSString *)title + width:(CGFloat)width + height:(CGFloat) height + target:(id)target + action:(SEL)action + events:(UIControlEvents) events{ + UIButton *button = [self createWithTarget:target action:action events:events]; + button.frame = CGRectMake(0, 0, width, height); + [button setTitle:title forState:UIControlStateNormal]; + [button setTitleColor:[UIColor colorWithRed:0.000 green:0.478 blue:1.000 alpha:1.000] forState:UIControlStateHighlighted]; +// button.titleLabel.font = [UIFont systemFontOfSize: 14.0]; + [button addTarget:target action:action forControlEvents:events]; + return button; +} + ++ (UIButton *)createWithImage:(UIImage *)image + selectedimage:(UIImage *)selectedImage + target:(id)target + action:(SEL)action + events:(UIControlEvents)events { + UIButton *button = [self createWithTarget:target action:action events:events]; + button.frame = CGRectMake(0, 0, image.size.width, image.size.height); + [button setImage:image forState:UIControlStateNormal]; + [button setImage:selectedImage forState:UIControlStateHighlighted]; + button.imageView.contentMode = UIViewContentModeScaleAspectFill; + return button; +} + ++ (UIButton *)createWithImage:(UIImage *)image + selectedimage:(UIImage *)selectedImage + frame:(CGRect) frame + target:(id)target + action:(SEL)action + events:(UIControlEvents)events { + UIButton *button = [self createWithTarget:target action:action events:events]; + button.frame = frame; + [button setBackgroundImage:image forState:UIControlStateNormal]; + [button setBackgroundImage:selectedImage forState:UIControlStateHighlighted]; + button.imageView.contentMode = UIViewContentModeScaleAspectFill; + return button; +} +@end \ No newline at end of file diff --git "a/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/main.m" "b/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/main.m" new file mode 100644 index 00000000..5233f05a --- /dev/null +++ "b/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusic/main.m" @@ -0,0 +1,16 @@ +// +// main.m +// NetMusic +// +// Created by xsdlr on 14/12/1. +// Copyright (c) 2014年 xsdlr. All rights reserved. +// + +#import +#import "AppDelegate.h" + +int main(int argc, char * argv[]) { + @autoreleasepool { + return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); + } +} diff --git "a/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusicTests/Info.plist" "b/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusicTests/Info.plist" new file mode 100644 index 00000000..3e4ec4e1 --- /dev/null +++ "b/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusicTests/Info.plist" @@ -0,0 +1,24 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + cstlab.xsdlr.$(PRODUCT_NAME:rfc1034identifier) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + + diff --git "a/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusicTests/NetMusicTests.m" "b/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusicTests/NetMusicTests.m" new file mode 100644 index 00000000..be1f0931 --- /dev/null +++ "b/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/NetMusicTests/NetMusicTests.m" @@ -0,0 +1,41 @@ +// +// NetMusicTests.m +// NetMusicTests +// +// Created by xsdlr on 14/12/1. +// Copyright (c) 2014年 xsdlr. All rights reserved. +// + +#import +#import + +@interface NetMusicTests : XCTestCase + +@end + +@implementation NetMusicTests + +- (void)setUp { + [super setUp]; + // Put setup code here. This method is called before the invocation of each test method in the class. + +} + +- (void)tearDown { + // Put teardown code here. This method is called after the invocation of each test method in the class. + [super tearDown]; +} + +- (void)testExample { + // This is an example of a functional test case. + XCTAssert(YES, @"Pass"); +} + +- (void)testPerformanceExample { + // This is an example of a performance test case. + [self measureBlock:^{ + // Put the code you want to measure the time of here. + }]; +} + +@end diff --git "a/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/Podfile" "b/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/Podfile" new file mode 100644 index 00000000..11dcd993 --- /dev/null +++ "b/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/Podfile" @@ -0,0 +1,14 @@ +# Uncomment this line to define a global platform for your project +# platform :ios, '6.0' + +source 'https://github.com/CocoaPods/Specs.git' + +target 'NetMusic' do + pod "AFNetworking", "~> 2.0" + pod 'MBProgressHUD', '~> 0.9' +end + +target 'NetMusicTests' do + +end + diff --git "a/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/Podfile.lock" "b/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/Podfile.lock" new file mode 100644 index 00000000..add093c5 --- /dev/null +++ "b/yxb144325004\347\245\201\351\231\210\346\226\214/NetMusic/Podfile.lock" @@ -0,0 +1,33 @@ +PODS: + - AFNetworking (2.5.0): + - AFNetworking/NSURLConnection + - AFNetworking/NSURLSession + - AFNetworking/Reachability + - AFNetworking/Security + - AFNetworking/Serialization + - AFNetworking/UIKit + - AFNetworking/NSURLConnection (2.5.0): + - AFNetworking/Reachability + - AFNetworking/Security + - AFNetworking/Serialization + - AFNetworking/NSURLSession (2.5.0): + - AFNetworking/Reachability + - AFNetworking/Security + - AFNetworking/Serialization + - AFNetworking/Reachability (2.5.0) + - AFNetworking/Security (2.5.0) + - AFNetworking/Serialization (2.5.0) + - AFNetworking/UIKit (2.5.0): + - AFNetworking/NSURLConnection + - AFNetworking/NSURLSession + - MBProgressHUD (0.9) + +DEPENDENCIES: + - AFNetworking (~> 2.0) + - MBProgressHUD (~> 0.9) + +SPEC CHECKSUMS: + AFNetworking: 0f54cb5d16ce38c1b76948faffb8d5fb705021c7 + MBProgressHUD: 2038dbcf3dce73215abed6001657043d53aa79a8 + +COCOAPODS: 0.34.4 diff --git "a/yxb144325004\347\245\201\351\231\210\346\226\214/Notes/Notes.xcodeproj/project.pbxproj" "b/yxb144325004\347\245\201\351\231\210\346\226\214/Notes/Notes.xcodeproj/project.pbxproj" new file mode 100644 index 00000000..8d09381d --- /dev/null +++ "b/yxb144325004\347\245\201\351\231\210\346\226\214/Notes/Notes.xcodeproj/project.pbxproj" @@ -0,0 +1,559 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + CDB089D21A1A7E5100FD2AAA /* AboutViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = CDB089D11A1A7E5100FD2AAA /* AboutViewController.m */; }; + CDB58CC01A199DCF0088CA4B /* Model.xcdatamodeld in Sources */ = {isa = PBXBuildFile; fileRef = CDB58CBE1A199DCF0088CA4B /* Model.xcdatamodeld */; }; + CDB58CC31A199E1D0088CA4B /* Note.m in Sources */ = {isa = PBXBuildFile; fileRef = CDB58CC21A199E1D0088CA4B /* Note.m */; }; + CDB58CC71A19E5E50088CA4B /* TextViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = CDB58CC61A19E5E50088CA4B /* TextViewController.m */; }; + CDB58CCA1A1A42EE0088CA4B /* ImageViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = CDB58CC91A1A42EE0088CA4B /* ImageViewController.m */; }; + CDB58CCD1A1A5CC60088CA4B /* DrawViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = CDB58CCC1A1A5CC60088CA4B /* DrawViewController.m */; }; + CDB58CD31A1A5EFC0088CA4B /* DrawView.m in Sources */ = {isa = PBXBuildFile; fileRef = CDB58CD21A1A5EFC0088CA4B /* DrawView.m */; }; + CDB58CD61A1A62590088CA4B /* PaintPath.m in Sources */ = {isa = PBXBuildFile; fileRef = CDB58CD51A1A62590088CA4B /* PaintPath.m */; }; + CDFEBAE51A199D6700EA94A0 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = CDFEBAE41A199D6700EA94A0 /* main.m */; }; + CDFEBAE81A199D6800EA94A0 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = CDFEBAE71A199D6800EA94A0 /* AppDelegate.m */; }; + CDFEBAEB1A199D6800EA94A0 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = CDFEBAEA1A199D6800EA94A0 /* ViewController.m */; }; + CDFEBAEE1A199D6800EA94A0 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = CDFEBAEC1A199D6800EA94A0 /* Main.storyboard */; }; + CDFEBAF01A199D6800EA94A0 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = CDFEBAEF1A199D6800EA94A0 /* Images.xcassets */; }; + CDFEBAF31A199D6800EA94A0 /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = CDFEBAF11A199D6800EA94A0 /* LaunchScreen.xib */; }; + CDFEBAFF1A199D6800EA94A0 /* NotesTests.m in Sources */ = {isa = PBXBuildFile; fileRef = CDFEBAFE1A199D6800EA94A0 /* NotesTests.m */; }; + ED8760657DDC2D1ECD307F05 /* libPods-Notes.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 801A90E30BE64965EA49C302 /* libPods-Notes.a */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + CDFEBAF91A199D6800EA94A0 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = CDFEBAD71A199D6700EA94A0 /* Project object */; + proxyType = 1; + remoteGlobalIDString = CDFEBADE1A199D6700EA94A0; + remoteInfo = Notes; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 0417D80DF502150C51822C2E /* Pods-Notes.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Notes.release.xcconfig"; path = "Pods/Target Support Files/Pods-Notes/Pods-Notes.release.xcconfig"; sourceTree = ""; }; + 731AF45CB63CE860E249948E /* Pods-Notes.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Notes.debug.xcconfig"; path = "Pods/Target Support Files/Pods-Notes/Pods-Notes.debug.xcconfig"; sourceTree = ""; }; + 801A90E30BE64965EA49C302 /* libPods-Notes.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-Notes.a"; sourceTree = BUILT_PRODUCTS_DIR; }; + CDB089D01A1A7E5100FD2AAA /* AboutViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AboutViewController.h; sourceTree = ""; }; + CDB089D11A1A7E5100FD2AAA /* AboutViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AboutViewController.m; sourceTree = ""; }; + CDB58CBF1A199DCF0088CA4B /* Model.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = Model.xcdatamodel; sourceTree = ""; }; + CDB58CC11A199E1D0088CA4B /* Note.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Note.h; sourceTree = ""; }; + CDB58CC21A199E1D0088CA4B /* Note.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Note.m; sourceTree = ""; }; + CDB58CC51A19E5E50088CA4B /* TextViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TextViewController.h; sourceTree = ""; }; + CDB58CC61A19E5E50088CA4B /* TextViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TextViewController.m; sourceTree = ""; }; + CDB58CC81A1A42EE0088CA4B /* ImageViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ImageViewController.h; sourceTree = ""; }; + CDB58CC91A1A42EE0088CA4B /* ImageViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ImageViewController.m; sourceTree = ""; }; + CDB58CCB1A1A5CC60088CA4B /* DrawViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DrawViewController.h; sourceTree = ""; }; + CDB58CCC1A1A5CC60088CA4B /* DrawViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DrawViewController.m; sourceTree = ""; }; + CDB58CD11A1A5EFC0088CA4B /* DrawView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DrawView.h; sourceTree = ""; }; + CDB58CD21A1A5EFC0088CA4B /* DrawView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DrawView.m; sourceTree = ""; }; + CDB58CD41A1A62590088CA4B /* PaintPath.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PaintPath.h; sourceTree = ""; }; + CDB58CD51A1A62590088CA4B /* PaintPath.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PaintPath.m; sourceTree = ""; }; + CDFEBADF1A199D6700EA94A0 /* Notes.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Notes.app; sourceTree = BUILT_PRODUCTS_DIR; }; + CDFEBAE31A199D6700EA94A0 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + CDFEBAE41A199D6700EA94A0 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + CDFEBAE61A199D6700EA94A0 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; + CDFEBAE71A199D6800EA94A0 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; + CDFEBAE91A199D6800EA94A0 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; + CDFEBAEA1A199D6800EA94A0 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; + CDFEBAED1A199D6800EA94A0 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + CDFEBAEF1A199D6800EA94A0 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; + CDFEBAF21A199D6800EA94A0 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = ""; }; + CDFEBAF81A199D6800EA94A0 /* NotesTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = NotesTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + CDFEBAFD1A199D6800EA94A0 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + CDFEBAFE1A199D6800EA94A0 /* NotesTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = NotesTests.m; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + CDFEBADC1A199D6700EA94A0 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ED8760657DDC2D1ECD307F05 /* libPods-Notes.a in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + CDFEBAF51A199D6800EA94A0 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 8398EB8B64DE051DA2C1B781 /* Pods */ = { + isa = PBXGroup; + children = ( + 731AF45CB63CE860E249948E /* Pods-Notes.debug.xcconfig */, + 0417D80DF502150C51822C2E /* Pods-Notes.release.xcconfig */, + ); + name = Pods; + sourceTree = ""; + }; + A6ADAD5E51DFC84DDF6878E4 /* Frameworks */ = { + isa = PBXGroup; + children = ( + 801A90E30BE64965EA49C302 /* libPods-Notes.a */, + ); + name = Frameworks; + sourceTree = ""; + }; + CDB58CC41A19E55E0088CA4B /* Data */ = { + isa = PBXGroup; + children = ( + CDB58CC11A199E1D0088CA4B /* Note.h */, + CDB58CC21A199E1D0088CA4B /* Note.m */, + ); + name = Data; + sourceTree = ""; + }; + CDFEBAD61A199D6700EA94A0 = { + isa = PBXGroup; + children = ( + CDFEBAE11A199D6700EA94A0 /* Notes */, + CDFEBAFB1A199D6800EA94A0 /* NotesTests */, + CDFEBAE01A199D6700EA94A0 /* Products */, + 8398EB8B64DE051DA2C1B781 /* Pods */, + A6ADAD5E51DFC84DDF6878E4 /* Frameworks */, + ); + sourceTree = ""; + }; + CDFEBAE01A199D6700EA94A0 /* Products */ = { + isa = PBXGroup; + children = ( + CDFEBADF1A199D6700EA94A0 /* Notes.app */, + CDFEBAF81A199D6800EA94A0 /* NotesTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + CDFEBAE11A199D6700EA94A0 /* Notes */ = { + isa = PBXGroup; + children = ( + CDB58CBE1A199DCF0088CA4B /* Model.xcdatamodeld */, + CDB58CC41A19E55E0088CA4B /* Data */, + CDFEBAE61A199D6700EA94A0 /* AppDelegate.h */, + CDFEBAE71A199D6800EA94A0 /* AppDelegate.m */, + CDFEBAE91A199D6800EA94A0 /* ViewController.h */, + CDFEBAEA1A199D6800EA94A0 /* ViewController.m */, + CDFEBAEC1A199D6800EA94A0 /* Main.storyboard */, + CDFEBAEF1A199D6800EA94A0 /* Images.xcassets */, + CDFEBAF11A199D6800EA94A0 /* LaunchScreen.xib */, + CDFEBAE21A199D6700EA94A0 /* Supporting Files */, + CDB58CC51A19E5E50088CA4B /* TextViewController.h */, + CDB58CC61A19E5E50088CA4B /* TextViewController.m */, + CDB58CC81A1A42EE0088CA4B /* ImageViewController.h */, + CDB58CC91A1A42EE0088CA4B /* ImageViewController.m */, + CDB58CCB1A1A5CC60088CA4B /* DrawViewController.h */, + CDB58CCC1A1A5CC60088CA4B /* DrawViewController.m */, + CDB58CD11A1A5EFC0088CA4B /* DrawView.h */, + CDB58CD21A1A5EFC0088CA4B /* DrawView.m */, + CDB58CD41A1A62590088CA4B /* PaintPath.h */, + CDB58CD51A1A62590088CA4B /* PaintPath.m */, + CDB089D01A1A7E5100FD2AAA /* AboutViewController.h */, + CDB089D11A1A7E5100FD2AAA /* AboutViewController.m */, + ); + path = Notes; + sourceTree = ""; + }; + CDFEBAE21A199D6700EA94A0 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + CDFEBAE31A199D6700EA94A0 /* Info.plist */, + CDFEBAE41A199D6700EA94A0 /* main.m */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; + CDFEBAFB1A199D6800EA94A0 /* NotesTests */ = { + isa = PBXGroup; + children = ( + CDFEBAFE1A199D6800EA94A0 /* NotesTests.m */, + CDFEBAFC1A199D6800EA94A0 /* Supporting Files */, + ); + path = NotesTests; + sourceTree = ""; + }; + CDFEBAFC1A199D6800EA94A0 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + CDFEBAFD1A199D6800EA94A0 /* Info.plist */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + CDFEBADE1A199D6700EA94A0 /* Notes */ = { + isa = PBXNativeTarget; + buildConfigurationList = CDFEBB021A199D6800EA94A0 /* Build configuration list for PBXNativeTarget "Notes" */; + buildPhases = ( + E9E654D3155A873C864FE201 /* Check Pods Manifest.lock */, + CDFEBADB1A199D6700EA94A0 /* Sources */, + CDFEBADC1A199D6700EA94A0 /* Frameworks */, + CDFEBADD1A199D6700EA94A0 /* Resources */, + 0D7351015D23A1F6B34D0111 /* Copy Pods Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = Notes; + productName = Notes; + productReference = CDFEBADF1A199D6700EA94A0 /* Notes.app */; + productType = "com.apple.product-type.application"; + }; + CDFEBAF71A199D6800EA94A0 /* NotesTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = CDFEBB051A199D6800EA94A0 /* Build configuration list for PBXNativeTarget "NotesTests" */; + buildPhases = ( + CDFEBAF41A199D6800EA94A0 /* Sources */, + CDFEBAF51A199D6800EA94A0 /* Frameworks */, + CDFEBAF61A199D6800EA94A0 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + CDFEBAFA1A199D6800EA94A0 /* PBXTargetDependency */, + ); + name = NotesTests; + productName = NotesTests; + productReference = CDFEBAF81A199D6800EA94A0 /* NotesTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + CDFEBAD71A199D6700EA94A0 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0610; + ORGANIZATIONNAME = xsdlr; + TargetAttributes = { + CDFEBADE1A199D6700EA94A0 = { + CreatedOnToolsVersion = 6.1; + }; + CDFEBAF71A199D6800EA94A0 = { + CreatedOnToolsVersion = 6.1; + TestTargetID = CDFEBADE1A199D6700EA94A0; + }; + }; + }; + buildConfigurationList = CDFEBADA1A199D6700EA94A0 /* Build configuration list for PBXProject "Notes" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = CDFEBAD61A199D6700EA94A0; + productRefGroup = CDFEBAE01A199D6700EA94A0 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + CDFEBADE1A199D6700EA94A0 /* Notes */, + CDFEBAF71A199D6800EA94A0 /* NotesTests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + CDFEBADD1A199D6700EA94A0 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + CDFEBAEE1A199D6800EA94A0 /* Main.storyboard in Resources */, + CDFEBAF31A199D6800EA94A0 /* LaunchScreen.xib in Resources */, + CDFEBAF01A199D6800EA94A0 /* Images.xcassets in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + CDFEBAF61A199D6800EA94A0 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXShellScriptBuildPhase section */ + 0D7351015D23A1F6B34D0111 /* Copy Pods Resources */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Copy Pods Resources"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-Notes/Pods-Notes-resources.sh\"\n"; + showEnvVarsInLog = 0; + }; + E9E654D3155A873C864FE201 /* Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Check Pods Manifest.lock"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n"; + showEnvVarsInLog = 0; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + CDFEBADB1A199D6700EA94A0 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + CDB58CC31A199E1D0088CA4B /* Note.m in Sources */, + CDFEBAEB1A199D6800EA94A0 /* ViewController.m in Sources */, + CDFEBAE81A199D6800EA94A0 /* AppDelegate.m in Sources */, + CDB58CD61A1A62590088CA4B /* PaintPath.m in Sources */, + CDB58CC71A19E5E50088CA4B /* TextViewController.m in Sources */, + CDB58CCD1A1A5CC60088CA4B /* DrawViewController.m in Sources */, + CDFEBAE51A199D6700EA94A0 /* main.m in Sources */, + CDB58CCA1A1A42EE0088CA4B /* ImageViewController.m in Sources */, + CDB089D21A1A7E5100FD2AAA /* AboutViewController.m in Sources */, + CDB58CC01A199DCF0088CA4B /* Model.xcdatamodeld in Sources */, + CDB58CD31A1A5EFC0088CA4B /* DrawView.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + CDFEBAF41A199D6800EA94A0 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + CDFEBAFF1A199D6800EA94A0 /* NotesTests.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + CDFEBAFA1A199D6800EA94A0 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = CDFEBADE1A199D6700EA94A0 /* Notes */; + targetProxy = CDFEBAF91A199D6800EA94A0 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + CDFEBAEC1A199D6800EA94A0 /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + CDFEBAED1A199D6800EA94A0 /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + CDFEBAF11A199D6800EA94A0 /* LaunchScreen.xib */ = { + isa = PBXVariantGroup; + children = ( + CDFEBAF21A199D6800EA94A0 /* Base */, + ); + name = LaunchScreen.xib; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + CDFEBB001A199D6800EA94A0 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_SYMBOLS_PRIVATE_EXTERN = NO; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 8.1; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + CDFEBB011A199D6800EA94A0 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = YES; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 8.1; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + CDFEBB031A199D6800EA94A0 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 731AF45CB63CE860E249948E /* Pods-Notes.debug.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + INFOPLIST_FILE = Notes/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Debug; + }; + CDFEBB041A199D6800EA94A0 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 0417D80DF502150C51822C2E /* Pods-Notes.release.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + INFOPLIST_FILE = Notes/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Release; + }; + CDFEBB061A199D6800EA94A0 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + ); + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + INFOPLIST_FILE = NotesTests/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_NAME = "$(TARGET_NAME)"; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Notes.app/Notes"; + }; + name = Debug; + }; + CDFEBB071A199D6800EA94A0 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + ); + INFOPLIST_FILE = NotesTests/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_NAME = "$(TARGET_NAME)"; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Notes.app/Notes"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + CDFEBADA1A199D6700EA94A0 /* Build configuration list for PBXProject "Notes" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + CDFEBB001A199D6800EA94A0 /* Debug */, + CDFEBB011A199D6800EA94A0 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + CDFEBB021A199D6800EA94A0 /* Build configuration list for PBXNativeTarget "Notes" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + CDFEBB031A199D6800EA94A0 /* Debug */, + CDFEBB041A199D6800EA94A0 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + CDFEBB051A199D6800EA94A0 /* Build configuration list for PBXNativeTarget "NotesTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + CDFEBB061A199D6800EA94A0 /* Debug */, + CDFEBB071A199D6800EA94A0 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + +/* Begin XCVersionGroup section */ + CDB58CBE1A199DCF0088CA4B /* Model.xcdatamodeld */ = { + isa = XCVersionGroup; + children = ( + CDB58CBF1A199DCF0088CA4B /* Model.xcdatamodel */, + ); + currentVersion = CDB58CBF1A199DCF0088CA4B /* Model.xcdatamodel */; + path = Model.xcdatamodeld; + sourceTree = ""; + versionGroupType = wrapper.xcdatamodel; + }; +/* End XCVersionGroup section */ + }; + rootObject = CDFEBAD71A199D6700EA94A0 /* Project object */; +} diff --git "a/yxb144325004\347\245\201\351\231\210\346\226\214/Notes/Notes.xcodeproj/project.xcworkspace/contents.xcworkspacedata" "b/yxb144325004\347\245\201\351\231\210\346\226\214/Notes/Notes.xcodeproj/project.xcworkspace/contents.xcworkspacedata" new file mode 100644 index 00000000..28101868 --- /dev/null +++ "b/yxb144325004\347\245\201\351\231\210\346\226\214/Notes/Notes.xcodeproj/project.xcworkspace/contents.xcworkspacedata" @@ -0,0 +1,7 @@ + + + + + diff --git "a/yxb144325004\347\245\201\351\231\210\346\226\214/Notes/Notes.xcworkspace/contents.xcworkspacedata" "b/yxb144325004\347\245\201\351\231\210\346\226\214/Notes/Notes.xcworkspace/contents.xcworkspacedata" new file mode 100644 index 00000000..df50d8e9 --- /dev/null +++ "b/yxb144325004\347\245\201\351\231\210\346\226\214/Notes/Notes.xcworkspace/contents.xcworkspacedata" @@ -0,0 +1,10 @@ + + + + + + + diff --git "a/yxb144325004\347\245\201\351\231\210\346\226\214/Notes/Notes/AboutViewController.h" "b/yxb144325004\347\245\201\351\231\210\346\226\214/Notes/Notes/AboutViewController.h" new file mode 100644 index 00000000..09fa2962 --- /dev/null +++ "b/yxb144325004\347\245\201\351\231\210\346\226\214/Notes/Notes/AboutViewController.h" @@ -0,0 +1,13 @@ +// +// AboutViewController.h +// Notes +// +// Created by xsdlr on 14/11/18. +// Copyright (c) 2014年 xsdlr. All rights reserved. +// + +#import + +@interface AboutViewController : UIViewController + +@end diff --git "a/yxb144325004\347\245\201\351\231\210\346\226\214/Notes/Notes/AboutViewController.m" "b/yxb144325004\347\245\201\351\231\210\346\226\214/Notes/Notes/AboutViewController.m" new file mode 100644 index 00000000..332676d1 --- /dev/null +++ "b/yxb144325004\347\245\201\351\231\210\346\226\214/Notes/Notes/AboutViewController.m" @@ -0,0 +1,42 @@ +// +// AboutViewController.m +// Notes +// +// Created by xsdlr on 14/11/18. +// Copyright (c) 2014年 xsdlr. All rights reserved. +// + +#import "AboutViewController.h" +#import "MBProgressHUD.h" + +@interface AboutViewController () + +@end + +@implementation AboutViewController + +- (void)viewDidLoad { + [super viewDidLoad]; + // Do any additional setup after loading the view. + + +} + +- (void)didReceiveMemoryWarning { + [super didReceiveMemoryWarning]; + // Dispose of any resources that can be recreated. +} + +- (void)viewWillAppear:(BOOL)animated { + MBProgressHUD* HUD = [[MBProgressHUD alloc] initWithView:self.view]; + [self.view addSubview:HUD]; + + HUD.labelText = @"测试版本仅用于学习"; + HUD.mode = MBProgressHUDModeText; + [HUD showAnimated:YES whileExecutingBlock:^{ + sleep(30); + } completionBlock:^{ + [HUD removeFromSuperview]; + }]; +} +@end diff --git "a/yxb144325004\347\245\201\351\231\210\346\226\214/Notes/Notes/AppDelegate.h" "b/yxb144325004\347\245\201\351\231\210\346\226\214/Notes/Notes/AppDelegate.h" new file mode 100644 index 00000000..56c22c53 --- /dev/null +++ "b/yxb144325004\347\245\201\351\231\210\346\226\214/Notes/Notes/AppDelegate.h" @@ -0,0 +1,17 @@ +// +// AppDelegate.h +// Notes +// +// Created by xsdlr on 14/11/17. +// Copyright (c) 2014年 xsdlr. All rights reserved. +// + +#import + +@interface AppDelegate : UIResponder + +@property (strong, nonatomic) UIWindow *window; + + +@end + diff --git "a/yxb144325004\347\245\201\351\231\210\346\226\214/Notes/Notes/AppDelegate.m" "b/yxb144325004\347\245\201\351\231\210\346\226\214/Notes/Notes/AppDelegate.m" new file mode 100644 index 00000000..3c6e68d6 --- /dev/null +++ "b/yxb144325004\347\245\201\351\231\210\346\226\214/Notes/Notes/AppDelegate.m" @@ -0,0 +1,48 @@ +// +// AppDelegate.m +// Notes +// +// Created by xsdlr on 14/11/17. +// Copyright (c) 2014年 xsdlr. All rights reserved. +// + +#import "AppDelegate.h" +#import + +@interface AppDelegate () + +@end + +@implementation AppDelegate + + +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { + // Override point for customization after application launch. + [MagicalRecord setupCoreDataStackWithStoreNamed: @"Model.sqlite"]; + return YES; +} + +- (void)applicationWillResignActive:(UIApplication *)application { + // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. + // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. +} + +- (void)applicationDidEnterBackground:(UIApplication *)application { + // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. + // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. +} + +- (void)applicationWillEnterForeground:(UIApplication *)application { + // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. +} + +- (void)applicationDidBecomeActive:(UIApplication *)application { + // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. +} + +- (void)applicationWillTerminate:(UIApplication *)application { + // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. + [MagicalRecord cleanUp]; +} + +@end diff --git "a/yxb144325004\347\245\201\351\231\210\346\226\214/Notes/Notes/Base.lproj/LaunchScreen.xib" "b/yxb144325004\347\245\201\351\231\210\346\226\214/Notes/Notes/Base.lproj/LaunchScreen.xib" new file mode 100644 index 00000000..a7c1b63c --- /dev/null +++ "b/yxb144325004\347\245\201\351\231\210\346\226\214/Notes/Notes/Base.lproj/LaunchScreen.xib" @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git "a/yxb144325004\347\245\201\351\231\210\346\226\214/Notes/Notes/Base.lproj/Main.storyboard" "b/yxb144325004\347\245\201\351\231\210\346\226\214/Notes/Notes/Base.lproj/Main.storyboard" new file mode 100644 index 00000000..e244f890 --- /dev/null +++ "b/yxb144325004\347\245\201\351\231\210\346\226\214/Notes/Notes/Base.lproj/Main.storyboard" @@ -0,0 +1,275 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git "a/yxb144325004\347\245\201\351\231\210\346\226\214/Notes/Notes/DrawView.h" "b/yxb144325004\347\245\201\351\231\210\346\226\214/Notes/Notes/DrawView.h" new file mode 100644 index 00000000..4c6ed2c8 --- /dev/null +++ "b/yxb144325004\347\245\201\351\231\210\346\226\214/Notes/Notes/DrawView.h" @@ -0,0 +1,18 @@ +// +// DrawView.h +// Notes +// +// Created by xsdlr on 14/11/18. +// Copyright (c) 2014年 xsdlr. All rights reserved. +// + +#import + +@interface DrawView : UIView +@property (assign,nonatomic) CGFloat width; +@property (strong,nonatomic) UIColor *color; +//清除视图 +- (BOOL) clearView; +//保存图片到文件 +- (BOOL) saveToPNGFile:(NSString*) path; +@end diff --git "a/yxb144325004\347\245\201\351\231\210\346\226\214/Notes/Notes/DrawView.m" "b/yxb144325004\347\245\201\351\231\210\346\226\214/Notes/Notes/DrawView.m" new file mode 100644 index 00000000..ff9dd1b5 --- /dev/null +++ "b/yxb144325004\347\245\201\351\231\210\346\226\214/Notes/Notes/DrawView.m" @@ -0,0 +1,83 @@ +// +// DrawView.m +// Notes +// +// Created by xsdlr on 14/11/18. +// Copyright (c) 2014年 xsdlr. All rights reserved. +// + +#import "DrawView.h" +#import "PaintPath.h" + +@interface DrawView() +@property (assign,nonatomic) CGMutablePathRef path; +@property (strong,nonatomic) NSMutableArray *pathArray; +@end + +@implementation DrawView + +- (id)initWithCoder:(NSCoder *)aDecoder { + self = [super initWithCoder:aDecoder]; + if (self) { + _width = 15.0f; + _color = [UIColor redColor]; + _path=CGPathCreateMutable(); + _pathArray = [NSMutableArray array]; + } + return self; +} + +- (void)drawRect:(CGRect)rect { + CGContextRef context=UIGraphicsGetCurrentContext(); + for (PaintPath* path in _pathArray) { + CGContextAddPath(context, path.path.CGPath); + CGContextSetLineWidth(context, path.width); + CGContextSetStrokeColorWithColor(context, [path.color CGColor]); + CGContextSetLineCap(context, kCGLineCapRound);//圆形起笔 + CGContextDrawPath(context, kCGPathStroke); + } + + if (_path) { + CGContextAddPath(context, _path); + CGContextSetLineWidth(context, _width); + CGContextSetStrokeColorWithColor(context, [_color CGColor]); + CGContextSetLineCap(context, kCGLineCapRound); + CGContextDrawPath(context, kCGPathStroke); + } + +} + +- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { + _path=CGPathCreateMutable(); + UITouch *touch=[touches anyObject]; + CGPoint location=[touch locationInView:self]; + CGPathMoveToPoint(_path, NULL, location.x, location.y); +} + +- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event { + UITouch *touch=[touches anyObject]; + CGPoint location=[touch locationInView:self]; + CGPathAddLineToPoint(_path, NULL, location.x, location.y); + [self setNeedsDisplay]; +} + +- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event { + UIBezierPath* currentPath=[UIBezierPath bezierPathWithCGPath:_path]; + PaintPath* paintPath = [[PaintPath alloc] initWithColor:_color width:_width path:currentPath]; + [_pathArray addObject:paintPath]; + CGPathRelease(_path); +} + +- (BOOL)clearView { + [_pathArray removeAllObjects]; + [self setNeedsDisplay]; + return YES; +} + +- (BOOL)saveToPNGFile:(NSString *)path { + UIGraphicsBeginImageContext(self.bounds.size); + [self.layer renderInContext:UIGraphicsGetCurrentContext()]; + UIImage *image = UIGraphicsGetImageFromCurrentImageContext(); + return [UIImagePNGRepresentation(image) writeToFile:path atomically:YES]; +} +@end diff --git "a/yxb144325004\347\245\201\351\231\210\346\226\214/Notes/Notes/DrawViewController.h" "b/yxb144325004\347\245\201\351\231\210\346\226\214/Notes/Notes/DrawViewController.h" new file mode 100644 index 00000000..d4584778 --- /dev/null +++ "b/yxb144325004\347\245\201\351\231\210\346\226\214/Notes/Notes/DrawViewController.h" @@ -0,0 +1,18 @@ +// +// DrawViewController.h +// Notes +// +// Created by xsdlr on 14/11/18. +// Copyright (c) 2014年 xsdlr. All rights reserved. +// + +#import +#import "DrawView.h" + +@interface DrawViewController : UIViewController +@property (weak, nonatomic) NSNumber* noteIndex; +@property (weak, nonatomic) id delegate; +@property (weak, nonatomic) IBOutlet DrawView *drawView; +@property (strong,nonatomic) UIColor *color; + +@end diff --git "a/yxb144325004\347\245\201\351\231\210\346\226\214/Notes/Notes/DrawViewController.m" "b/yxb144325004\347\245\201\351\231\210\346\226\214/Notes/Notes/DrawViewController.m" new file mode 100644 index 00000000..1608972e --- /dev/null +++ "b/yxb144325004\347\245\201\351\231\210\346\226\214/Notes/Notes/DrawViewController.m" @@ -0,0 +1,82 @@ +// +// DrawViewController.m +// Notes +// +// Created by xsdlr on 14/11/18. +// Copyright (c) 2014年 xsdlr. All rights reserved. +// + +#import "DrawViewController.h" +#import +#import "ViewController.h" +#import "Note.h" +#import "InfColorPickerController.h" + +@interface DrawViewController () + +@end + +@implementation DrawViewController + +Note* note = nil; +- (void)viewDidLoad { + [super viewDidLoad]; + // Do any additional setup after loading the view. + _drawView.color = self.color = [UIColor blackColor]; + ViewController *nodesListView = (ViewController *)self.delegate; + if (self.noteIndex) { + note = [nodesListView.notes objectAtIndex:[self.noteIndex integerValue]]; +// UIImage* image = [[UIImage alloc]initWithContentsOfFile: note.message]; + } +} + +- (void)didReceiveMemoryWarning { + [super didReceiveMemoryWarning]; + // Dispose of any resources that can be recreated. +} + +- (IBAction)save:(UIBarButtonItem *)sender { + NSString* imageDirPath = [[NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0] stringByAppendingString: @"/images"]; + NSFileManager *fileManager = [NSFileManager defaultManager]; + [fileManager createDirectoryAtPath:imageDirPath withIntermediateDirectories:YES attributes:nil error:nil]; + NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init]; + [dateFormatter setDateFormat: @"yyyyMMddHHmmss"]; + + NSDate* nowDate = [NSDate new]; + NSString *imageFilePath = [imageDirPath stringByAppendingFormat:@"/%@.%@", [dateFormatter stringFromDate: nowDate], @"png"]; + + if ([_drawView saveToPNGFile:imageFilePath]) { + if (!_noteIndex) { + note = [Note MR_createEntity]; + ViewController *notesListView = (ViewController *)self.delegate; + [notesListView.notes insertObject:note atIndex:0]; + } + note.message = imageFilePath; + note.time = [NSDate new]; + note.type = Note.DRAW_TYPE; + [[NSManagedObjectContext MR_defaultContext]MR_saveToPersistentStoreAndWait]; + } else { + [[[UIAlertView alloc] initWithTitle:@"错误" message:@"图片保存失败" delegate:nil cancelButtonTitle:@"确认" otherButtonTitles:nil, nil] show]; + } + + [self.navigationController popToRootViewControllerAnimated:YES]; +} + +- (IBAction)pickFontColor:(UIBarButtonItem *)sender { + InfColorPickerController* picker = [ InfColorPickerController colorPickerViewController ]; + picker.title = @"颜色"; + picker.sourceColor = self.color; + picker.delegate = self; + + [ picker presentModallyOverViewController: self ]; +} + +- (void) colorPickerControllerDidFinish: (InfColorPickerController*) picker{ + _drawView.color = self.color = picker.resultColor; + [ self dismissModalViewControllerAnimated: YES ]; +} + +- (IBAction)fontSizeChange:(UISlider *)sender { + _drawView.width = sender.value; +} +@end diff --git "a/yxb144325004\347\245\201\351\231\210\346\226\214/Notes/Notes/ImageViewController.h" "b/yxb144325004\347\245\201\351\231\210\346\226\214/Notes/Notes/ImageViewController.h" new file mode 100644 index 00000000..5ad986a7 --- /dev/null +++ "b/yxb144325004\347\245\201\351\231\210\346\226\214/Notes/Notes/ImageViewController.h" @@ -0,0 +1,16 @@ +// +// ImageViewController.h +// Notes +// +// Created by xsdlr on 14/11/17. +// Copyright (c) 2014年 xsdlr. All rights reserved. +// + +#import + +@interface ImageViewController : UIViewController +@property (weak, nonatomic) NSNumber* noteIndex; +@property (weak, nonatomic) id delegate; +@property (weak, nonatomic) IBOutlet UIImageView *imageView; + +@end diff --git "a/yxb144325004\347\245\201\351\231\210\346\226\214/Notes/Notes/ImageViewController.m" "b/yxb144325004\347\245\201\351\231\210\346\226\214/Notes/Notes/ImageViewController.m" new file mode 100644 index 00000000..96edc455 --- /dev/null +++ "b/yxb144325004\347\245\201\351\231\210\346\226\214/Notes/Notes/ImageViewController.m" @@ -0,0 +1,41 @@ +// +// ImageViewController.m +// Notes +// +// Created by xsdlr on 14/11/17. +// Copyright (c) 2014年 xsdlr. All rights reserved. +// + +#import "ImageViewController.h" +#import "ViewController.h" +#import "Note.h" + +@interface ImageViewController () + +@end + +@implementation ImageViewController + +- (void)viewDidLoad { + [super viewDidLoad]; + // Do any additional setup after loading the view. + ViewController *nodesListView = (ViewController *)self.delegate; + if (self.noteIndex != nil) { + Note* note = [nodesListView.notes objectAtIndex:[self.noteIndex integerValue]]; + if ([note.type isEqualToString: Note.IMAGE_TYPE] || [note.type isEqualToString: Note.DRAW_TYPE]) { + UIImage* image = [[UIImage alloc]initWithContentsOfFile: note.message]; + self.imageView.image = image; + } else { + [[[UIAlertView alloc] initWithTitle:@"错误" message:@"非图片信息" delegate:nil cancelButtonTitle:@"确认" otherButtonTitles:nil, nil] show]; + } + } + +} + +- (void)didReceiveMemoryWarning { + [super didReceiveMemoryWarning]; + // Dispose of any resources that can be recreated. +} + + +@end diff --git "a/yxb144325004\347\245\201\351\231\210\346\226\214/Notes/Notes/Images.xcassets/AppIcon.appiconset/Contents.json" "b/yxb144325004\347\245\201\351\231\210\346\226\214/Notes/Notes/Images.xcassets/AppIcon.appiconset/Contents.json" new file mode 100644 index 00000000..66139f88 --- /dev/null +++ "b/yxb144325004\347\245\201\351\231\210\346\226\214/Notes/Notes/Images.xcassets/AppIcon.appiconset/Contents.json" @@ -0,0 +1,72 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "3x" + }, + { + "size" : "60x60", + "idiom" : "iphone", + "filename" : "iphone@2x.png", + "scale" : "2x" + }, + { + "size" : "60x60", + "idiom" : "iphone", + "filename" : "iphone@3x.png", + "scale" : "3x" + }, + { + "idiom" : "ipad", + "size" : "29x29", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "40x40", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "40x40", + "scale" : "2x" + }, + { + "size" : "76x76", + "idiom" : "ipad", + "filename" : "ipad@1x.png", + "scale" : "1x" + }, + { + "size" : "76x76", + "idiom" : "ipad", + "filename" : "ipad@2x.png", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git "a/yxb144325004\347\245\201\351\231\210\346\226\214/Notes/Notes/Images.xcassets/AppIcon.appiconset/ipad@1x.png" "b/yxb144325004\347\245\201\351\231\210\346\226\214/Notes/Notes/Images.xcassets/AppIcon.appiconset/ipad@1x.png" new file mode 100644 index 00000000..b35b703f Binary files /dev/null and "b/yxb144325004\347\245\201\351\231\210\346\226\214/Notes/Notes/Images.xcassets/AppIcon.appiconset/ipad@1x.png" differ diff --git "a/yxb144325004\347\245\201\351\231\210\346\226\214/Notes/Notes/Images.xcassets/AppIcon.appiconset/ipad@2x.png" "b/yxb144325004\347\245\201\351\231\210\346\226\214/Notes/Notes/Images.xcassets/AppIcon.appiconset/ipad@2x.png" new file mode 100644 index 00000000..94586b67 Binary files /dev/null and "b/yxb144325004\347\245\201\351\231\210\346\226\214/Notes/Notes/Images.xcassets/AppIcon.appiconset/ipad@2x.png" differ diff --git "a/yxb144325004\347\245\201\351\231\210\346\226\214/Notes/Notes/Images.xcassets/AppIcon.appiconset/iphone@2x.png" "b/yxb144325004\347\245\201\351\231\210\346\226\214/Notes/Notes/Images.xcassets/AppIcon.appiconset/iphone@2x.png" new file mode 100644 index 00000000..44075753 Binary files /dev/null and "b/yxb144325004\347\245\201\351\231\210\346\226\214/Notes/Notes/Images.xcassets/AppIcon.appiconset/iphone@2x.png" differ diff --git "a/yxb144325004\347\245\201\351\231\210\346\226\214/Notes/Notes/Images.xcassets/AppIcon.appiconset/iphone@3x.png" "b/yxb144325004\347\245\201\351\231\210\346\226\214/Notes/Notes/Images.xcassets/AppIcon.appiconset/iphone@3x.png" new file mode 100644 index 00000000..0b3f97f7 Binary files /dev/null and "b/yxb144325004\347\245\201\351\231\210\346\226\214/Notes/Notes/Images.xcassets/AppIcon.appiconset/iphone@3x.png" differ diff --git "a/yxb144325004\347\245\201\351\231\210\346\226\214/Notes/Notes/Images.xcassets/about.imageset/Contents.json" "b/yxb144325004\347\245\201\351\231\210\346\226\214/Notes/Notes/Images.xcassets/about.imageset/Contents.json" new file mode 100644 index 00000000..b6a1fe54 --- /dev/null +++ "b/yxb144325004\347\245\201\351\231\210\346\226\214/Notes/Notes/Images.xcassets/about.imageset/Contents.json" @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x", + "filename" : "about@1x.png" + }, + { + "idiom" : "universal", + "scale" : "2x", + "filename" : "about@2x.png" + }, + { + "idiom" : "universal", + "scale" : "3x", + "filename" : "about@3x.png" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git "a/yxb144325004\347\245\201\351\231\210\346\226\214/Notes/Notes/Images.xcassets/about.imageset/about@1x.png" "b/yxb144325004\347\245\201\351\231\210\346\226\214/Notes/Notes/Images.xcassets/about.imageset/about@1x.png" new file mode 100644 index 00000000..f7cb8f0e Binary files /dev/null and "b/yxb144325004\347\245\201\351\231\210\346\226\214/Notes/Notes/Images.xcassets/about.imageset/about@1x.png" differ diff --git "a/yxb144325004\347\245\201\351\231\210\346\226\214/Notes/Notes/Images.xcassets/about.imageset/about@2x.png" "b/yxb144325004\347\245\201\351\231\210\346\226\214/Notes/Notes/Images.xcassets/about.imageset/about@2x.png" new file mode 100644 index 00000000..90e5cd77 Binary files /dev/null and "b/yxb144325004\347\245\201\351\231\210\346\226\214/Notes/Notes/Images.xcassets/about.imageset/about@2x.png" differ diff --git "a/yxb144325004\347\245\201\351\231\210\346\226\214/Notes/Notes/Images.xcassets/about.imageset/about@3x.png" "b/yxb144325004\347\245\201\351\231\210\346\226\214/Notes/Notes/Images.xcassets/about.imageset/about@3x.png" new file mode 100644 index 00000000..b3909680 Binary files /dev/null and "b/yxb144325004\347\245\201\351\231\210\346\226\214/Notes/Notes/Images.xcassets/about.imageset/about@3x.png" differ diff --git "a/yxb144325004\347\245\201\351\231\210\346\226\214/Notes/Notes/Images.xcassets/note.imageset/Contents.json" "b/yxb144325004\347\245\201\351\231\210\346\226\214/Notes/Notes/Images.xcassets/note.imageset/Contents.json" new file mode 100644 index 00000000..629358ed --- /dev/null +++ "b/yxb144325004\347\245\201\351\231\210\346\226\214/Notes/Notes/Images.xcassets/note.imageset/Contents.json" @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x", + "filename" : "note@1x.png" + }, + { + "idiom" : "universal", + "scale" : "2x", + "filename" : "note@2x.png" + }, + { + "idiom" : "universal", + "scale" : "3x", + "filename" : "note@3x.png" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git "a/yxb144325004\347\245\201\351\231\210\346\226\214/Notes/Notes/Images.xcassets/note.imageset/note@1x.png" "b/yxb144325004\347\245\201\351\231\210\346\226\214/Notes/Notes/Images.xcassets/note.imageset/note@1x.png" new file mode 100644 index 00000000..882340ff Binary files /dev/null and "b/yxb144325004\347\245\201\351\231\210\346\226\214/Notes/Notes/Images.xcassets/note.imageset/note@1x.png" differ diff --git "a/yxb144325004\347\245\201\351\231\210\346\226\214/Notes/Notes/Images.xcassets/note.imageset/note@2x.png" "b/yxb144325004\347\245\201\351\231\210\346\226\214/Notes/Notes/Images.xcassets/note.imageset/note@2x.png" new file mode 100644 index 00000000..36671e78 Binary files /dev/null and "b/yxb144325004\347\245\201\351\231\210\346\226\214/Notes/Notes/Images.xcassets/note.imageset/note@2x.png" differ diff --git "a/yxb144325004\347\245\201\351\231\210\346\226\214/Notes/Notes/Images.xcassets/note.imageset/note@3x.png" "b/yxb144325004\347\245\201\351\231\210\346\226\214/Notes/Notes/Images.xcassets/note.imageset/note@3x.png" new file mode 100644 index 00000000..5286a840 Binary files /dev/null and "b/yxb144325004\347\245\201\351\231\210\346\226\214/Notes/Notes/Images.xcassets/note.imageset/note@3x.png" differ diff --git "a/yxb144325004\347\245\201\351\231\210\346\226\214/Notes/Notes/Info.plist" "b/yxb144325004\347\245\201\351\231\210\346\226\214/Notes/Notes/Info.plist" new file mode 100644 index 00000000..2efecf16 --- /dev/null +++ "b/yxb144325004\347\245\201\351\231\210\346\226\214/Notes/Notes/Info.plist" @@ -0,0 +1,47 @@ + + + + + CFBundleDevelopmentRegion + zh_CN + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + cstlab.xsdlr.$(PRODUCT_NAME:rfc1034identifier) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + LSRequiresIPhoneOS + + UILaunchStoryboardName + LaunchScreen + UIMainStoryboardFile + Main + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git "a/yxb144325004\347\245\201\351\231\210\346\226\214/Notes/Notes/Model.xcdatamodeld/Model.xcdatamodel/contents" "b/yxb144325004\347\245\201\351\231\210\346\226\214/Notes/Notes/Model.xcdatamodeld/Model.xcdatamodel/contents" new file mode 100644 index 00000000..43314d33 --- /dev/null +++ "b/yxb144325004\347\245\201\351\231\210\346\226\214/Notes/Notes/Model.xcdatamodeld/Model.xcdatamodel/contents" @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git "a/yxb144325004\347\245\201\351\231\210\346\226\214/Notes/Notes/Note.h" "b/yxb144325004\347\245\201\351\231\210\346\226\214/Notes/Notes/Note.h" new file mode 100644 index 00000000..fd1cffb9 --- /dev/null +++ "b/yxb144325004\347\245\201\351\231\210\346\226\214/Notes/Notes/Note.h" @@ -0,0 +1,21 @@ +// +// Note.h +// Notes +// +// Created by xsdlr on 14/11/17. +// Copyright (c) 2014年 xsdlr. All rights reserved. +// + +#import +#import + +@interface Note : NSManagedObject + +@property (nonatomic, retain) NSString * message; +@property (nonatomic, retain) NSDate * time; +@property (nonatomic, retain) NSString * type; + ++ (NSString*) TEXT_TYPE; ++ (NSString*) IMAGE_TYPE; ++ (NSString*) DRAW_TYPE; +@end diff --git "a/yxb144325004\347\245\201\351\231\210\346\226\214/Notes/Notes/Note.m" "b/yxb144325004\347\245\201\351\231\210\346\226\214/Notes/Notes/Note.m" new file mode 100644 index 00000000..4b4f8466 --- /dev/null +++ "b/yxb144325004\347\245\201\351\231\210\346\226\214/Notes/Notes/Note.m" @@ -0,0 +1,27 @@ +// +// Note.m +// Notes +// +// Created by xsdlr on 14/11/17. +// Copyright (c) 2014年 xsdlr. All rights reserved. +// + +#import "Note.h" + +@implementation Note + +@dynamic message; +@dynamic time; +@dynamic type; + ++ (NSString *)TEXT_TYPE { + return @"text"; +} ++(NSString *)IMAGE_TYPE { + return @"image"; +} ++(NSString *)DRAW_TYPE { + return @"draw"; +} + +@end diff --git "a/yxb144325004\347\245\201\351\231\210\346\226\214/Notes/Notes/PaintPath.h" "b/yxb144325004\347\245\201\351\231\210\346\226\214/Notes/Notes/PaintPath.h" new file mode 100644 index 00000000..f9be570b --- /dev/null +++ "b/yxb144325004\347\245\201\351\231\210\346\226\214/Notes/Notes/PaintPath.h" @@ -0,0 +1,18 @@ +// +// PaintPath.h +// Notes +// +// Created by xsdlr on 14/11/18. +// Copyright (c) 2014年 xsdlr. All rights reserved. +// + +#import +#import + +@interface PaintPath : NSObject +@property (strong,nonatomic) UIColor* color; +@property (assign,nonatomic) CGFloat width; +@property (strong,nonatomic) UIBezierPath* path; + +- (instancetype)initWithColor:(UIColor*) color width:(CGFloat) width path:(UIBezierPath*) path; +@end diff --git "a/yxb144325004\347\245\201\351\231\210\346\226\214/Notes/Notes/PaintPath.m" "b/yxb144325004\347\245\201\351\231\210\346\226\214/Notes/Notes/PaintPath.m" new file mode 100644 index 00000000..2c003909 --- /dev/null +++ "b/yxb144325004\347\245\201\351\231\210\346\226\214/Notes/Notes/PaintPath.m" @@ -0,0 +1,19 @@ +// +// PaintPath.m +// Notes +// +// Created by xsdlr on 14/11/18. +// Copyright (c) 2014年 xsdlr. All rights reserved. +// + +#import "PaintPath.h" + +@implementation PaintPath + +- (instancetype)initWithColor:(UIColor *)color width:(CGFloat)width path:(UIBezierPath *)path { + _color = color; + _width = width; + _path = path; + return self; +} +@end diff --git "a/yxb144325004\347\245\201\351\231\210\346\226\214/Notes/Notes/TextViewController.h" "b/yxb144325004\347\245\201\351\231\210\346\226\214/Notes/Notes/TextViewController.h" new file mode 100644 index 00000000..864012a6 --- /dev/null +++ "b/yxb144325004\347\245\201\351\231\210\346\226\214/Notes/Notes/TextViewController.h" @@ -0,0 +1,15 @@ +// +// TextViewController.h +// Notes +// +// Created by xsdlr on 14/11/17. +// Copyright (c) 2014年 xsdlr. All rights reserved. +// + +#import + +@interface TextViewController : UIViewController +@property (weak, nonatomic) NSNumber* noteIndex; +@property (weak, nonatomic) id delegate; +@property (weak, nonatomic) IBOutlet UITextView *textView; +@end diff --git "a/yxb144325004\347\245\201\351\231\210\346\226\214/Notes/Notes/TextViewController.m" "b/yxb144325004\347\245\201\351\231\210\346\226\214/Notes/Notes/TextViewController.m" new file mode 100644 index 00000000..12118bc5 --- /dev/null +++ "b/yxb144325004\347\245\201\351\231\210\346\226\214/Notes/Notes/TextViewController.m" @@ -0,0 +1,53 @@ +// +// TextViewController.m +// Notes +// +// Created by xsdlr on 14/11/17. +// Copyright (c) 2014年 xsdlr. All rights reserved. +// + +#import "TextViewController.h" +#import +#import "ViewController.h" +#import "Note.h" + +@interface TextViewController () + +@end + +@implementation TextViewController + +- (void)viewDidLoad { + [super viewDidLoad]; + self.automaticallyAdjustsScrollViewInsets = NO; + // Do any additional setup after loading the view. + ViewController *nodesListView = (ViewController *)self.delegate; + if (self.noteIndex != nil) { + Note* note = [nodesListView.notes objectAtIndex:[self.noteIndex integerValue]]; + self.textView.text = note.message; + } +} + +- (void)didReceiveMemoryWarning { + [super didReceiveMemoryWarning]; + // Dispose of any resources that can be recreated. +} + +- (IBAction)save:(UIBarButtonItem *)sender { + Note* note; + ViewController *notesListView = (ViewController *)self.delegate; + if (self.noteIndex != nil) { + note = [notesListView.notes objectAtIndex:[self.noteIndex integerValue]]; + } else { + note = [Note MR_createEntity]; + [notesListView.notes insertObject:note atIndex:0]; + } + note.type = Note.TEXT_TYPE; + note.time = [NSDate new]; + note.message = self.textView.text; + [[NSManagedObjectContext MR_defaultContext]MR_saveToPersistentStoreAndWait]; + [self.navigationController popViewControllerAnimated:YES]; +} + + +@end diff --git "a/yxb144325004\347\245\201\351\231\210\346\226\214/Notes/Notes/ViewController.h" "b/yxb144325004\347\245\201\351\231\210\346\226\214/Notes/Notes/ViewController.h" new file mode 100644 index 00000000..b1f27537 --- /dev/null +++ "b/yxb144325004\347\245\201\351\231\210\346\226\214/Notes/Notes/ViewController.h" @@ -0,0 +1,18 @@ +// +// ViewController.h +// Notes +// +// Created by xsdlr on 14/11/17. +// Copyright (c) 2014年 xsdlr. All rights reserved. +// + +#import + +@interface ViewController : UIViewController + +@property (weak, nonatomic) IBOutlet UITableView *tableView; +@property (strong, nonatomic) NSMutableArray* notes; +- (IBAction)takePhoto:(UIBarButtonItem *)sender; + +@end + diff --git "a/yxb144325004\347\245\201\351\231\210\346\226\214/Notes/Notes/ViewController.m" "b/yxb144325004\347\245\201\351\231\210\346\226\214/Notes/Notes/ViewController.m" new file mode 100644 index 00000000..a8f4c232 --- /dev/null +++ "b/yxb144325004\347\245\201\351\231\210\346\226\214/Notes/Notes/ViewController.m" @@ -0,0 +1,158 @@ +// +// ViewController.m +// Notes +// +// Created by xsdlr on 14/11/17. +// Copyright (c) 2014年 xsdlr. All rights reserved. +// + +#import "ViewController.h" +#import +#import "Note.h" + +@interface ViewController () + +@end + +@implementation ViewController + +- (void)viewDidLoad { + [super viewDidLoad]; + // Do any additional setup after loading the view, typically from a nib. +// Note* note = [Note MR_createEntity]; +// note.message = @"test"; +// note.time = [NSDate new]; +// note.type = @"text"; +// [[NSManagedObjectContext MR_defaultContext]MR_saveToPersistentStoreAndWait]; + + _notes = [[NSMutableArray alloc] initWithArray:[Note MR_findAllSortedBy:@"time" ascending:NO]]; +// NSLog(@"%ld",_notes.count); +} + +- (void)didReceiveMemoryWarning { + [super didReceiveMemoryWarning]; + // Dispose of any resources that can be recreated. +} + +- (NSInteger)tableView:(UITableView *)tableView + numberOfRowsInSection:(NSInteger)section { + return self.notes.count; +} + +- (UITableViewCell *)tableView:(UITableView *)tableView + cellForRowAtIndexPath:(NSIndexPath *)indexPath { + + static NSString *CellIdentifier = @"Cell"; + UITableViewCell *cell = [tableView + dequeueReusableCellWithIdentifier:CellIdentifier]; + if(cell == nil) { + cell = [[UITableViewCell alloc] + initWithStyle:UITableViewCellStyleValue1 + reuseIdentifier:CellIdentifier]; + } + Note* note = self.notes[indexPath.row]; + NSString* type = @""; + NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init]; + [dateFormatter setDateFormat: @"yyyy-MM-dd HH:mm:ss"]; + + if ([note.type isEqualToString:Note.TEXT_TYPE]) { + type = @"文本"; + } else if ([note.type isEqualToString:Note.IMAGE_TYPE]) { + type = @"照片"; + } else if ([note.type isEqualToString:Note.DRAW_TYPE]) { + type = @"手绘"; + } else { + type = @"未定义"; + } + cell.textLabel.text = type; + cell.detailTextLabel.text = [dateFormatter stringFromDate: note.time]; + return cell; +} + +-(void)viewWillAppear:(BOOL)animated { + [super viewWillAppear:animated]; + [self.tableView reloadData]; +} + +- (void)tableView:(UITableView *)tableView +didSelectRowAtIndexPath:(NSIndexPath *)indexPath { + Note* note = [self.notes objectAtIndex:[indexPath row]]; + if ([note.type isEqualToString:Note.TEXT_TYPE]) { + [self performSegueWithIdentifier:@"textSegue" sender:[NSNumber numberWithInteger:indexPath.row]]; + } else if ([note.type isEqualToString:Note.IMAGE_TYPE]) { + [self performSegueWithIdentifier:@"imageSegue" sender:[NSNumber numberWithInteger:indexPath.row]]; + } else if ([note.type isEqualToString:Note.DRAW_TYPE]) { + [self performSegueWithIdentifier:@"imageSegue" sender:[NSNumber numberWithInteger:indexPath.row]]; + } else { + [[[UIAlertView alloc] initWithTitle:@"错误" message:@"类型不支持" delegate:nil cancelButtonTitle:@"确认" otherButtonTitles:nil, nil] show]; + } + +} + +- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender +{ + UIViewController *destination = segue.destinationViewController; + if ([segue.identifier isEqualToString:@"textSegue"]) { + [destination setValue:sender forKeyPath:@"noteIndex"]; + } else if ([segue.identifier isEqualToString:@"imageSegue"]) { + [destination setValue:sender forKeyPath:@"noteIndex"]; + } else { + [destination setValue:nil forKeyPath:@"noteIndex"]; + } + [destination setValue:self forKeyPath:@"delegate"]; +} + +- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath { + if (editingStyle == UITableViewCellEditingStyleDelete) { + Note* note = [self.notes objectAtIndex:[indexPath row]]; + [self.notes removeObjectAtIndex:[indexPath row]]; + [note MR_deleteEntity]; + [[NSManagedObjectContext MR_defaultContext]MR_saveToPersistentStoreAndWait]; + [tableView deleteRowsAtIndexPaths:[NSArray arrayWithObjects:indexPath, nil] withRowAnimation:UITableViewRowAnimationTop]; + } +} + +- (NSString *)tableView:(UITableView *)tableView titleForDeleteConfirmationButtonForRowAtIndexPath:(NSIndexPath *)indexPath { + return @"删除"; +} + +- (IBAction)takePhoto:(UIBarButtonItem *)sender { + UIImagePickerController *picker = [UIImagePickerController new]; + if([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera]) { + picker.sourceType = UIImagePickerControllerSourceTypeCamera; + picker.mediaTypes = [UIImagePickerController availableMediaTypesForSourceType:picker.sourceType]; + picker.delegate = self; + picker.allowsEditing = YES; + [self presentViewController:picker animated:YES completion:nil]; + } else { + [[[UIAlertView alloc] initWithTitle:@"错误" message:@"不支持拍照" delegate:nil cancelButtonTitle:@"确认" otherButtonTitles:nil, nil] show]; + } +} + +- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info { + UIImage *image = [info objectForKey:UIImagePickerControllerOriginalImage]; + NSString* imageDirPath = [[NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0] stringByAppendingString: @"/images"]; + NSFileManager *fileManager = [NSFileManager defaultManager]; + [fileManager createDirectoryAtPath:imageDirPath withIntermediateDirectories:YES attributes:nil error:nil]; + NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init]; + [dateFormatter setDateFormat: @"yyyyMMddHHmmss"]; + + NSDate* nowDate = [NSDate new]; + NSString *imageFilePath = [imageDirPath stringByAppendingFormat:@"/%@.%@", [dateFormatter stringFromDate: nowDate], @"jpg"]; + NSData *imageData = UIImageJPEGRepresentation(image, 1); + //插入成功 + if ([imageData writeToFile:imageFilePath atomically:YES] ) { + Note* note = [Note MR_createEntity]; + note.time = nowDate; + note.message = imageFilePath; + note.type = Note.IMAGE_TYPE; + [[NSManagedObjectContext MR_defaultContext]MR_saveToPersistentStoreAndWait]; + [self.notes insertObject:note atIndex:0]; + } else { + [[[UIAlertView alloc] initWithTitle:@"错误" message:@"图片保存失败" delegate:nil cancelButtonTitle:@"确认" otherButtonTitles:nil, nil] show]; + } + + [picker dismissViewControllerAnimated:YES completion:nil]; +} + +@end diff --git "a/yxb144325004\347\245\201\351\231\210\346\226\214/Notes/Notes/main.m" "b/yxb144325004\347\245\201\351\231\210\346\226\214/Notes/Notes/main.m" new file mode 100644 index 00000000..ee189aa3 --- /dev/null +++ "b/yxb144325004\347\245\201\351\231\210\346\226\214/Notes/Notes/main.m" @@ -0,0 +1,16 @@ +// +// main.m +// Notes +// +// Created by xsdlr on 14/11/17. +// Copyright (c) 2014年 xsdlr. All rights reserved. +// + +#import +#import "AppDelegate.h" + +int main(int argc, char * argv[]) { + @autoreleasepool { + return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); + } +} diff --git "a/yxb144325004\347\245\201\351\231\210\346\226\214/Notes/NotesTests/Info.plist" "b/yxb144325004\347\245\201\351\231\210\346\226\214/Notes/NotesTests/Info.plist" new file mode 100644 index 00000000..3e4ec4e1 --- /dev/null +++ "b/yxb144325004\347\245\201\351\231\210\346\226\214/Notes/NotesTests/Info.plist" @@ -0,0 +1,24 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + cstlab.xsdlr.$(PRODUCT_NAME:rfc1034identifier) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + + diff --git "a/yxb144325004\347\245\201\351\231\210\346\226\214/Notes/NotesTests/NotesTests.m" "b/yxb144325004\347\245\201\351\231\210\346\226\214/Notes/NotesTests/NotesTests.m" new file mode 100644 index 00000000..cbe9bf75 --- /dev/null +++ "b/yxb144325004\347\245\201\351\231\210\346\226\214/Notes/NotesTests/NotesTests.m" @@ -0,0 +1,40 @@ +// +// NotesTests.m +// NotesTests +// +// Created by xsdlr on 14/11/17. +// Copyright (c) 2014年 xsdlr. All rights reserved. +// + +#import +#import + +@interface NotesTests : XCTestCase + +@end + +@implementation NotesTests + +- (void)setUp { + [super setUp]; + // Put setup code here. This method is called before the invocation of each test method in the class. +} + +- (void)tearDown { + // Put teardown code here. This method is called after the invocation of each test method in the class. + [super tearDown]; +} + +- (void)testExample { + // This is an example of a functional test case. + XCTAssert(YES, @"Pass"); +} + +- (void)testPerformanceExample { + // This is an example of a performance test case. + [self measureBlock:^{ + // Put the code you want to measure the time of here. + }]; +} + +@end diff --git "a/yxb144325004\347\245\201\351\231\210\346\226\214/Notes/Podfile" "b/yxb144325004\347\245\201\351\231\210\346\226\214/Notes/Podfile" new file mode 100644 index 00000000..92d24fd0 --- /dev/null +++ "b/yxb144325004\347\245\201\351\231\210\346\226\214/Notes/Podfile" @@ -0,0 +1,15 @@ +# Uncomment this line to define a global platform for your project +# platform :ios, '6.0' + +source 'https://github.com/CocoaPods/Specs.git' + +target 'Notes' do + pod 'MagicalRecord', '~> 2.2' + pod 'MBProgressHUD', '~> 0.9' + pod 'InfColorPicker', '~> 0.0.1' +end + +target 'NotesTests' do + +end + diff --git "a/yxb144325004\347\245\201\351\231\210\346\226\214/Notes/Podfile.lock" "b/yxb144325004\347\245\201\351\231\210\346\226\214/Notes/Podfile.lock" new file mode 100644 index 00000000..1d058cdb --- /dev/null +++ "b/yxb144325004\347\245\201\351\231\210\346\226\214/Notes/Podfile.lock" @@ -0,0 +1,18 @@ +PODS: + - InfColorPicker (0.0.1) + - MagicalRecord (2.2): + - MagicalRecord/Core + - MagicalRecord/Core (2.2) + - MBProgressHUD (0.9) + +DEPENDENCIES: + - InfColorPicker (~> 0.0.1) + - MagicalRecord (~> 2.2) + - MBProgressHUD (~> 0.9) + +SPEC CHECKSUMS: + InfColorPicker: 80a7606343661fd227b10d15527698d469210aac + MagicalRecord: 2b471584fc9e3137f3d0a56967917baa4979e224 + MBProgressHUD: 2038dbcf3dce73215abed6001657043d53aa79a8 + +COCOAPODS: 0.34.4