diff --git a/APIClient.xcodeproj/project.pbxproj b/APIClient.xcodeproj/project.pbxproj index a549a3b..1b3dcaf 100644 --- a/APIClient.xcodeproj/project.pbxproj +++ b/APIClient.xcodeproj/project.pbxproj @@ -8,6 +8,18 @@ /* Begin PBXBuildFile section */ 078B558C6C77F3C6DCDC4678 /* Pods_APIClientUITests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 82531BA6D6228998A00AB5B6 /* Pods_APIClientUITests.framework */; }; + 77260C891D05B8AD000D0916 /* KanyeRESTtests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 77260C881D05B8AD000D0916 /* KanyeRESTtests.swift */; }; + 773CA9B61D0C7082002B6ADF /* KanyeRESTUItests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 773CA9B51D0C7082002B6ADF /* KanyeRESTUItests.swift */; }; + 7741D07F1CFC30AB0059684C /* albumViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7741D07E1CFC30AA0059684C /* albumViewController.swift */; }; + 7741D0811CFC31BA0059684C /* kanyeREST.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7741D0801CFC31BA0059684C /* kanyeREST.swift */; }; + 7741D0831CFC320C0059684C /* Album.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7741D0821CFC320C0059684C /* Album.swift */; }; + 7741D0851CFC32180059684C /* track.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7741D0841CFC32180059684C /* track.swift */; }; + 7741D0871CFC35A90059684C /* trackViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7741D0861CFC35A90059684C /* trackViewController.swift */; }; + 7741D0891CFC35ED0059684C /* trackDetailViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7741D0881CFC35ED0059684C /* trackDetailViewController.swift */; }; + 7741D08B1CFC36000059684C /* albumCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7741D08A1CFC36000059684C /* albumCell.swift */; }; + 7741D08D1CFC360E0059684C /* trackCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7741D08C1CFC360E0059684C /* trackCell.swift */; }; + 7741D08F1CFC51940059684C /* APIViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7741D08E1CFC51940059684C /* APIViewController.swift */; }; + 779112D37BF8C3375F116A2A /* Pods_kanyeAPIClient.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6EF7936430B01CD740FE871A /* Pods_kanyeAPIClient.framework */; }; 872A275C1CF0D87100A988C4 /* APIResource.swift in Sources */ = {isa = PBXBuildFile; fileRef = 872A275B1CF0D87100A988C4 /* APIResource.swift */; }; 874D06591CEF295E009A494D /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 874D06581CEF295E009A494D /* AppDelegate.swift */; }; 874D065E1CEF295E009A494D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 874D065C1CEF295E009A494D /* Main.storyboard */; }; @@ -38,6 +50,20 @@ 198B23CD94C6D84016A5208A /* Pods-APIClientUITests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-APIClientUITests.release.xcconfig"; path = "Pods/Target Support Files/Pods-APIClientUITests/Pods-APIClientUITests.release.xcconfig"; sourceTree = ""; }; 4FFA0A7AA37697BD5CBC3211 /* Pods_APIClientTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_APIClientTests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 65C820A0F52E3181871F5ECA /* Pods-APIClientTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-APIClientTests.release.xcconfig"; path = "Pods/Target Support Files/Pods-APIClientTests/Pods-APIClientTests.release.xcconfig"; sourceTree = ""; }; + 6EF7936430B01CD740FE871A /* Pods_kanyeAPIClient.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_kanyeAPIClient.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 77260C871D05B8AD000D0916 /* APIClientTests-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "APIClientTests-Bridging-Header.h"; sourceTree = ""; }; + 77260C881D05B8AD000D0916 /* KanyeRESTtests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = KanyeRESTtests.swift; sourceTree = ""; }; + 773CA9B41D0C7081002B6ADF /* APIClientUITests-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "APIClientUITests-Bridging-Header.h"; sourceTree = ""; }; + 773CA9B51D0C7082002B6ADF /* KanyeRESTUItests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = KanyeRESTUItests.swift; sourceTree = ""; }; + 7741D07E1CFC30AA0059684C /* albumViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = albumViewController.swift; sourceTree = ""; }; + 7741D0801CFC31BA0059684C /* kanyeREST.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = kanyeREST.swift; sourceTree = ""; }; + 7741D0821CFC320C0059684C /* Album.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Album.swift; sourceTree = ""; }; + 7741D0841CFC32180059684C /* track.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = track.swift; sourceTree = ""; }; + 7741D0861CFC35A90059684C /* trackViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = trackViewController.swift; sourceTree = ""; }; + 7741D0881CFC35ED0059684C /* trackDetailViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = trackDetailViewController.swift; sourceTree = ""; }; + 7741D08A1CFC36000059684C /* albumCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = albumCell.swift; sourceTree = ""; }; + 7741D08C1CFC360E0059684C /* trackCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = trackCell.swift; sourceTree = ""; }; + 7741D08E1CFC51940059684C /* APIViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = APIViewController.swift; sourceTree = ""; }; 82531BA6D6228998A00AB5B6 /* Pods_APIClientUITests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_APIClientUITests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 872A275B1CF0D87100A988C4 /* APIResource.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = APIResource.swift; sourceTree = ""; }; 874D06551CEF295E009A494D /* APIClient.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = APIClient.app; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -50,11 +76,13 @@ 87EC71531CFA380F00FBDDDE /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 87EC715D1CFA381600FBDDDE /* APIClientUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = APIClientUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 87EC71611CFA381600FBDDDE /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - 93EFAB13AE62F1B6FB2683B2 /* Pods-APIClient.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-APIClient.debug.xcconfig"; path = "Pods/Target Support Files/Pods-APIClient/Pods-APIClient.debug.xcconfig"; sourceTree = ""; }; + 93EFAB13AE62F1B6FB2683B2 /* Pods-APIClient.debug.xcconfig */ = {isa = PBXFileReference; explicitFileType = text.xcconfig; includeInIndex = 1; name = "Pods-APIClient.debug.xcconfig"; path = "Pods/Target Support Files/Pods-APIClient/Pods-APIClient.debug.xcconfig"; sourceTree = ""; }; + 9A49B0E72F691C9CD26D8680 /* Pods-kanyeAPIClient.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-kanyeAPIClient.release.xcconfig"; path = "Pods/Target Support Files/Pods-kanyeAPIClient/Pods-kanyeAPIClient.release.xcconfig"; sourceTree = ""; }; + B79C3500DD6D5533959DB16E /* Pods-kanyeAPIClient.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-kanyeAPIClient.debug.xcconfig"; path = "Pods/Target Support Files/Pods-kanyeAPIClient/Pods-kanyeAPIClient.debug.xcconfig"; sourceTree = ""; }; BD8A5B3E1266D5298CABE44A /* Pods_APIClient.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_APIClient.framework; sourceTree = BUILT_PRODUCTS_DIR; }; C67B3B3E7990BE278400974F /* Pods-APIClientUITests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-APIClientUITests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-APIClientUITests/Pods-APIClientUITests.debug.xcconfig"; sourceTree = ""; }; F8B9811B1068B05E73195990 /* Pods-APIClientTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-APIClientTests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-APIClientTests/Pods-APIClientTests.debug.xcconfig"; sourceTree = ""; }; - FFE13D543A95D28F27CFBDA4 /* Pods-APIClient.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-APIClient.release.xcconfig"; path = "Pods/Target Support Files/Pods-APIClient/Pods-APIClient.release.xcconfig"; sourceTree = ""; }; + FFE13D543A95D28F27CFBDA4 /* Pods-APIClient.release.xcconfig */ = {isa = PBXFileReference; explicitFileType = text.xcconfig; includeInIndex = 1; name = "Pods-APIClient.release.xcconfig"; path = "Pods/Target Support Files/Pods-APIClient/Pods-APIClient.release.xcconfig"; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -63,6 +91,7 @@ buildActionMask = 2147483647; files = ( A526FDEE5BF2D1BC3C97B9FA /* Pods_APIClient.framework in Frameworks */, + 779112D37BF8C3375F116A2A /* Pods_kanyeAPIClient.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -88,6 +117,10 @@ 872A27571CF0D4E200A988C4 /* View Controller */ = { isa = PBXGroup; children = ( + 7741D07E1CFC30AA0059684C /* albumViewController.swift */, + 7741D0861CFC35A90059684C /* trackViewController.swift */, + 7741D0881CFC35ED0059684C /* trackDetailViewController.swift */, + 7741D08E1CFC51940059684C /* APIViewController.swift */, ); name = "View Controller"; sourceTree = ""; @@ -95,6 +128,8 @@ 872A27581CF0D4EB00A988C4 /* View */ = { isa = PBXGroup; children = ( + 7741D08A1CFC36000059684C /* albumCell.swift */, + 7741D08C1CFC360E0059684C /* trackCell.swift */, ); name = View; sourceTree = ""; @@ -103,6 +138,9 @@ isa = PBXGroup; children = ( 872A275B1CF0D87100A988C4 /* APIResource.swift */, + 7741D0801CFC31BA0059684C /* kanyeREST.swift */, + 7741D0821CFC320C0059684C /* Album.swift */, + 7741D0841CFC32180059684C /* track.swift */, ); name = Model; sourceTree = ""; @@ -132,9 +170,9 @@ 874D06561CEF295E009A494D /* Products */ = { isa = PBXGroup; children = ( - 874D06551CEF295E009A494D /* APIClient.app */, 87EC714F1CFA380F00FBDDDE /* APIClientTests.xctest */, 87EC715D1CFA381600FBDDDE /* APIClientUITests.xctest */, + 874D06551CEF295E009A494D /* APIClient.app */, ); name = Products; sourceTree = ""; @@ -156,6 +194,8 @@ isa = PBXGroup; children = ( 87EC71531CFA380F00FBDDDE /* Info.plist */, + 77260C881D05B8AD000D0916 /* KanyeRESTtests.swift */, + 77260C871D05B8AD000D0916 /* APIClientTests-Bridging-Header.h */, ); path = APIClientTests; sourceTree = ""; @@ -164,6 +204,8 @@ isa = PBXGroup; children = ( 87EC71611CFA381600FBDDDE /* Info.plist */, + 773CA9B51D0C7082002B6ADF /* KanyeRESTUItests.swift */, + 773CA9B41D0C7081002B6ADF /* APIClientUITests-Bridging-Header.h */, ); path = APIClientUITests; sourceTree = ""; @@ -177,6 +219,8 @@ 65C820A0F52E3181871F5ECA /* Pods-APIClientTests.release.xcconfig */, C67B3B3E7990BE278400974F /* Pods-APIClientUITests.debug.xcconfig */, 198B23CD94C6D84016A5208A /* Pods-APIClientUITests.release.xcconfig */, + B79C3500DD6D5533959DB16E /* Pods-kanyeAPIClient.debug.xcconfig */, + 9A49B0E72F691C9CD26D8680 /* Pods-kanyeAPIClient.release.xcconfig */, ); name = Pods; sourceTree = ""; @@ -187,6 +231,7 @@ BD8A5B3E1266D5298CABE44A /* Pods_APIClient.framework */, 4FFA0A7AA37697BD5CBC3211 /* Pods_APIClientTests.framework */, 82531BA6D6228998A00AB5B6 /* Pods_APIClientUITests.framework */, + 6EF7936430B01CD740FE871A /* Pods_kanyeAPIClient.framework */, ); name = Frameworks; sourceTree = ""; @@ -198,12 +243,12 @@ isa = PBXNativeTarget; buildConfigurationList = 874D06671CEF295E009A494D /* Build configuration list for PBXNativeTarget "APIClient" */; buildPhases = ( - 766803B31A3F89C2C74D599B /* 📦 Check Pods Manifest.lock */, + 766803B31A3F89C2C74D599B /* [CP] Check Pods Manifest.lock */, 874D06511CEF295E009A494D /* Sources */, 874D06521CEF295E009A494D /* Frameworks */, 874D06531CEF295E009A494D /* Resources */, - 63A898AB1E385BFD9CE49E01 /* 📦 Embed Pods Frameworks */, - 353BFD219018DADC12E19A38 /* 📦 Copy Pods Resources */, + 63A898AB1E385BFD9CE49E01 /* [CP] Embed Pods Frameworks */, + 353BFD219018DADC12E19A38 /* [CP] Copy Pods Resources */, ); buildRules = ( ); @@ -218,12 +263,12 @@ isa = PBXNativeTarget; buildConfigurationList = 87EC71581CFA380F00FBDDDE /* Build configuration list for PBXNativeTarget "APIClientTests" */; buildPhases = ( - 46810DD19FC8355AB5B97BE0 /* 📦 Check Pods Manifest.lock */, + 46810DD19FC8355AB5B97BE0 /* [CP] Check Pods Manifest.lock */, 87EC714B1CFA380F00FBDDDE /* Sources */, 87EC714C1CFA380F00FBDDDE /* Frameworks */, 87EC714D1CFA380F00FBDDDE /* Resources */, - 7E951D32C261E9289B04B286 /* 📦 Embed Pods Frameworks */, - 0032BF5753977F17165877AF /* 📦 Copy Pods Resources */, + 7E951D32C261E9289B04B286 /* [CP] Embed Pods Frameworks */, + 0032BF5753977F17165877AF /* [CP] Copy Pods Resources */, ); buildRules = ( ); @@ -239,12 +284,12 @@ isa = PBXNativeTarget; buildConfigurationList = 87EC71641CFA381600FBDDDE /* Build configuration list for PBXNativeTarget "APIClientUITests" */; buildPhases = ( - B1CFFA6AFE5B3BCE58836CEE /* 📦 Check Pods Manifest.lock */, + B1CFFA6AFE5B3BCE58836CEE /* [CP] Check Pods Manifest.lock */, 87EC71591CFA381600FBDDDE /* Sources */, 87EC715A1CFA381600FBDDDE /* Frameworks */, 87EC715B1CFA381600FBDDDE /* Resources */, 87EC716B1CFA3CA100FBDDDE /* 📦 Embed Pods Frameworks */, - A88CAB56517C46775BB21926 /* 📦 Copy Pods Resources */, + A88CAB56517C46775BB21926 /* [CP] Copy Pods Resources */, ); buildRules = ( ); @@ -268,6 +313,7 @@ TargetAttributes = { 874D06541CEF295E009A494D = { CreatedOnToolsVersion = 7.3.1; + DevelopmentTeam = 5NV62CF7F7; }; 87EC714E1CFA380F00FBDDDE = { CreatedOnToolsVersion = 7.3.1; @@ -327,14 +373,14 @@ /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ - 0032BF5753977F17165877AF /* 📦 Copy Pods Resources */ = { + 0032BF5753977F17165877AF /* [CP] Copy Pods Resources */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputPaths = ( ); - name = "📦 Copy Pods Resources"; + name = "[CP] Copy Pods Resources"; outputPaths = ( ); runOnlyForDeploymentPostprocessing = 0; @@ -342,14 +388,14 @@ shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-APIClientTests/Pods-APIClientTests-resources.sh\"\n"; showEnvVarsInLog = 0; }; - 353BFD219018DADC12E19A38 /* 📦 Copy Pods Resources */ = { + 353BFD219018DADC12E19A38 /* [CP] Copy Pods Resources */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputPaths = ( ); - name = "📦 Copy Pods Resources"; + name = "[CP] Copy Pods Resources"; outputPaths = ( ); runOnlyForDeploymentPostprocessing = 0; @@ -357,14 +403,14 @@ shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-APIClient/Pods-APIClient-resources.sh\"\n"; showEnvVarsInLog = 0; }; - 46810DD19FC8355AB5B97BE0 /* 📦 Check Pods Manifest.lock */ = { + 46810DD19FC8355AB5B97BE0 /* [CP] Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputPaths = ( ); - name = "📦 Check Pods Manifest.lock"; + name = "[CP] Check Pods Manifest.lock"; outputPaths = ( ); runOnlyForDeploymentPostprocessing = 0; @@ -372,14 +418,14 @@ 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; }; - 63A898AB1E385BFD9CE49E01 /* 📦 Embed Pods Frameworks */ = { + 63A898AB1E385BFD9CE49E01 /* [CP] Embed Pods Frameworks */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputPaths = ( ); - name = "📦 Embed Pods Frameworks"; + name = "[CP] Embed Pods Frameworks"; outputPaths = ( ); runOnlyForDeploymentPostprocessing = 0; @@ -387,14 +433,14 @@ shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-APIClient/Pods-APIClient-frameworks.sh\"\n"; showEnvVarsInLog = 0; }; - 766803B31A3F89C2C74D599B /* 📦 Check Pods Manifest.lock */ = { + 766803B31A3F89C2C74D599B /* [CP] Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputPaths = ( ); - name = "📦 Check Pods Manifest.lock"; + name = "[CP] Check Pods Manifest.lock"; outputPaths = ( ); runOnlyForDeploymentPostprocessing = 0; @@ -402,14 +448,14 @@ 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; }; - 7E951D32C261E9289B04B286 /* 📦 Embed Pods Frameworks */ = { + 7E951D32C261E9289B04B286 /* [CP] Embed Pods Frameworks */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputPaths = ( ); - name = "📦 Embed Pods Frameworks"; + name = "[CP] Embed Pods Frameworks"; outputPaths = ( ); runOnlyForDeploymentPostprocessing = 0; @@ -431,14 +477,14 @@ shellPath = /bin/sh; shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-APIClientUITests/Pods-APIClientUITests-frameworks.sh\""; }; - A88CAB56517C46775BB21926 /* 📦 Copy Pods Resources */ = { + A88CAB56517C46775BB21926 /* [CP] Copy Pods Resources */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputPaths = ( ); - name = "📦 Copy Pods Resources"; + name = "[CP] Copy Pods Resources"; outputPaths = ( ); runOnlyForDeploymentPostprocessing = 0; @@ -446,14 +492,14 @@ shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-APIClientUITests/Pods-APIClientUITests-resources.sh\"\n"; showEnvVarsInLog = 0; }; - B1CFFA6AFE5B3BCE58836CEE /* 📦 Check Pods Manifest.lock */ = { + B1CFFA6AFE5B3BCE58836CEE /* [CP] Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputPaths = ( ); - name = "📦 Check Pods Manifest.lock"; + name = "[CP] Check Pods Manifest.lock"; outputPaths = ( ); runOnlyForDeploymentPostprocessing = 0; @@ -468,8 +514,17 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( + 7741D0811CFC31BA0059684C /* kanyeREST.swift in Sources */, + 7741D0891CFC35ED0059684C /* trackDetailViewController.swift in Sources */, 872A275C1CF0D87100A988C4 /* APIResource.swift in Sources */, + 7741D0871CFC35A90059684C /* trackViewController.swift in Sources */, 874D06591CEF295E009A494D /* AppDelegate.swift in Sources */, + 7741D07F1CFC30AB0059684C /* albumViewController.swift in Sources */, + 7741D0831CFC320C0059684C /* Album.swift in Sources */, + 7741D0851CFC32180059684C /* track.swift in Sources */, + 7741D08B1CFC36000059684C /* albumCell.swift in Sources */, + 7741D08D1CFC360E0059684C /* trackCell.swift in Sources */, + 7741D08F1CFC51940059684C /* APIViewController.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -477,6 +532,7 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( + 77260C891D05B8AD000D0916 /* KanyeRESTtests.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -484,6 +540,7 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( + 773CA9B61D0C7082002B6ADF /* KanyeRESTUItests.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -612,10 +669,13 @@ baseConfigurationReference = 93EFAB13AE62F1B6FB2683B2 /* Pods-APIClient.debug.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_IDENTITY = "iPhone Developer"; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; INFOPLIST_FILE = APIClient/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "de.uni-heidelberg.ios-dev-kurs.APIClient"; - PRODUCT_NAME = "$(TARGET_NAME)"; + PRODUCT_NAME = APIClient; + PROVISIONING_PROFILE = ""; }; name = Debug; }; @@ -624,10 +684,13 @@ baseConfigurationReference = FFE13D543A95D28F27CFBDA4 /* Pods-APIClient.release.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_IDENTITY = "iPhone Developer"; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; INFOPLIST_FILE = APIClient/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "de.uni-heidelberg.ios-dev-kurs.APIClient"; - PRODUCT_NAME = "$(TARGET_NAME)"; + PRODUCT_NAME = APIClient; + PROVISIONING_PROFILE = ""; }; name = Release; }; @@ -636,10 +699,13 @@ baseConfigurationReference = F8B9811B1068B05E73195990 /* Pods-APIClientTests.debug.xcconfig */; buildSettings = { BUNDLE_LOADER = "$(TEST_HOST)"; + CLANG_ENABLE_MODULES = YES; INFOPLIST_FILE = APIClientTests/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "de.uni-heidelberg.ios-dev-kurs.APIClientTests"; PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OBJC_BRIDGING_HEADER = "APIClientTests/APIClientTests-Bridging-Header.h"; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/APIClient.app/APIClient"; }; name = Debug; @@ -649,10 +715,12 @@ baseConfigurationReference = 65C820A0F52E3181871F5ECA /* Pods-APIClientTests.release.xcconfig */; buildSettings = { BUNDLE_LOADER = "$(TEST_HOST)"; + CLANG_ENABLE_MODULES = YES; INFOPLIST_FILE = APIClientTests/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "de.uni-heidelberg.ios-dev-kurs.APIClientTests"; PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OBJC_BRIDGING_HEADER = "APIClientTests/APIClientTests-Bridging-Header.h"; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/APIClient.app/APIClient"; }; name = Release; @@ -661,10 +729,13 @@ isa = XCBuildConfiguration; baseConfigurationReference = C67B3B3E7990BE278400974F /* Pods-APIClientUITests.debug.xcconfig */; buildSettings = { + CLANG_ENABLE_MODULES = YES; INFOPLIST_FILE = APIClientUITests/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "de.uni-heidelberg.ios-dev-kurs.APIClientUITests"; PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OBJC_BRIDGING_HEADER = "APIClientUITests/APIClientUITests-Bridging-Header.h"; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; TEST_TARGET_NAME = APIClient; }; name = Debug; @@ -673,10 +744,12 @@ isa = XCBuildConfiguration; baseConfigurationReference = 198B23CD94C6D84016A5208A /* Pods-APIClientUITests.release.xcconfig */; buildSettings = { + CLANG_ENABLE_MODULES = YES; INFOPLIST_FILE = APIClientUITests/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "de.uni-heidelberg.ios-dev-kurs.APIClientUITests"; PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OBJC_BRIDGING_HEADER = "APIClientUITests/APIClientUITests-Bridging-Header.h"; TEST_TARGET_NAME = APIClient; }; name = Release; diff --git a/APIClient.xcodeproj/xcshareddata/xcschemes/APIClient.xcscheme b/APIClient.xcodeproj/xcshareddata/xcschemes/APIClient.xcscheme deleted file mode 100644 index 1c35036..0000000 --- a/APIClient.xcodeproj/xcshareddata/xcschemes/APIClient.xcscheme +++ /dev/null @@ -1,112 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/APIClient/APIViewController.swift b/APIClient/APIViewController.swift new file mode 100644 index 0000000..91203e5 --- /dev/null +++ b/APIClient/APIViewController.swift @@ -0,0 +1,74 @@ +// +// APIViewController.swift +// kanyeAPIClient +// +// Created by Arthur Heimbrecht on 30.5.16. +// Copyright © 2016 iOS Dev Kurs Universität Heidelberg. All rights reserved. +// + +import Foundation +import UIKit +import Freddy +import Moya + +class APIViewController: UIViewController { + + var kanyeAPI: MoyaProvider! + var target = kanyeREST.track(title: "good_morning") + var fetchedtrack: Track! + + var allalbums: [Album] = [] + var allalbumnames: [String]! + + @IBOutlet private var lyricsLabel: UILabel! + + override func viewDidLoad() { + print("didload") + kanyeAPI.request(target){ + result in + switch result { + case .Success(let response): + do { + try response.filterSuccessfulStatusCodes() + print(response) + let json = try JSON(data: response.data) + self.fetchedtrack = try Track(json: json) + self.lyricsLabel.numberOfLines = 0 + self.lyricsLabel.text = self.fetchedtrack.lyrics + let tracknalbum = self.fetchedtrack.title + " / " + self.fetchedtrack.album + self.title = tracknalbum + } catch { + print(error) + } + case .Failure(let error): + print(error) + } + } + + for albumname in allalbumnames{ + kanyeAPI.request(kanyeREST.album(title: albumname)){ + result in + //print(title) + switch result { + case .Success(let response): + do { + try response.filterSuccessfulStatusCodes() + print(response) + let json = try JSON(data: response.data) + let tracks = try json.array("result").map(Track.init) + self.allalbums.append(try Album(tracksfetched: tracks)) + print(self.allalbums[0]) + } catch { + print(error) + break + } + case .Failure(let error): + print("failure") + print(error) + break + } + } + } + + } +} \ No newline at end of file diff --git a/APIClient/Album.swift b/APIClient/Album.swift new file mode 100644 index 0000000..e30fb93 --- /dev/null +++ b/APIClient/Album.swift @@ -0,0 +1,22 @@ +// +// album.swift +// APIClient +// +// Created by Arthur Heimbrecht on 30.5.16. +// Copyright © 2016 iOS Dev Kurs Universität Heidelberg. All rights reserved. +// + +import Foundation +import Freddy + + +struct Album { + + let name: String + let tracks: [Track] + + init(tracksfetched: [Track]) throws { + tracks = tracksfetched + name = tracksfetched[0].album + } +} \ No newline at end of file diff --git a/APIClient/AppDelegate.swift b/APIClient/AppDelegate.swift index 630c3ed..f108e5c 100644 --- a/APIClient/AppDelegate.swift +++ b/APIClient/AppDelegate.swift @@ -7,16 +7,79 @@ // import UIKit +import Moya +import Freddy @UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate { - - var window: UIWindow? - - - func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { - return true - } - + + var window: UIWindow? + + /// The PokeAPI Provider representing the Server + let kanyeAPI = MoyaProvider() + + let allalbumnames = [ + "the_college_dropout", + "late_registration", + "graduation", + "808s_&_heartbreak", + "my_beautiful_dark_twisted_fantasy", + "watch_the_throne", + "yeezus", + "the_life_of_pablo" + ] + + func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { + + if let APIViewController = (window?.rootViewController as? UINavigationController)?.topViewController as? APIViewController { + print("test") + // Pass the PokeAPI Provider on to the root view controller + APIViewController.kanyeAPI = kanyeAPI + APIViewController.allalbumnames = allalbumnames + + } + + if let albumViewController = (window?.rootViewController as? UINavigationController)?.topViewController as? albumViewController { + + print("albumviewcontroller") + //print(albumnames) + var allalbums: [Album] = [] + /*for albumname in self.allalbumnames{ + kanyeAPI.request(kanyeREST.album(title: albumname)){ + result in + //print(title) + switch result { + case .Success(let response): + do { + try response.filterSuccessfulStatusCodes() + //print(response) + let json = try JSON(data: response.data) + let tracks = try json.array("result").map(Track.init) + allalbums.append(Album(tracksfetched: tracks)) + //print(self.allalbums[0]) + //print(allalbums) + } catch { + print(error) + break + } + case .Failure(let error): + print("failure") + print(error) + break + } + } + }*/ + + + albumViewController.kanyeAPI = kanyeAPI + albumViewController.allalbumnames = self.allalbumnames + //albumViewController.allalbums = allalbums + print("albums loaded") + + } + + return true + } + } diff --git a/APIClient/Base.lproj/Main.storyboard b/APIClient/Base.lproj/Main.storyboard index 69b2fbf..eb41c4b 100644 --- a/APIClient/Base.lproj/Main.storyboard +++ b/APIClient/Base.lproj/Main.storyboard @@ -1,8 +1,12 @@ - + + + + + @@ -14,31 +18,179 @@ - + - - + + - + - - + + - + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Lorem ipsum dolor sit er elit lamet, consectetaur cillium adipisicing pecu, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Nam liber te conscient to factor tum poen legum odioque civiuda. + + + + + + + + + + + + + + + - + - + diff --git a/APIClient/Info.plist b/APIClient/Info.plist index 40c6215..8874840 100644 --- a/APIClient/Info.plist +++ b/APIClient/Info.plist @@ -22,6 +22,19 @@ 1 LSRequiresIPhoneOS + NSAppTransportSecurity + + NSAllowsArbitraryLoads + + NSExceptionDomains + + kanyerest.xyz + + NSExceptionAllowsInsecureHTTPLoads + + + + UILaunchStoryboardName LaunchScreen UIMainStoryboardFile diff --git a/APIClient/Track.temp_caseinsensitive_rename.swift b/APIClient/Track.temp_caseinsensitive_rename.swift new file mode 100644 index 0000000..a354a21 --- /dev/null +++ b/APIClient/Track.temp_caseinsensitive_rename.swift @@ -0,0 +1,26 @@ +// +// track.swift +// APIClient +// +// Created by Arthur Heimbrecht on 30.5.16. +// Copyright © 2016 iOS Dev Kurs Universität Heidelberg. All rights reserved. +// + +import Foundation +import Freddy + +/// A specific Pokemon variety of a species +struct track: JSONDecodable { + + /// The visual depictions of this Pokemon + let title: String + let lyrics: String + let album: String + + init(json: JSON) throws { + self.title = try json.decode("title") + self.lyrics = try json.decode("lyrics") + self.album = try json.decode("album") + } + +} \ No newline at end of file diff --git a/APIClient/albumCell.swift b/APIClient/albumCell.swift new file mode 100644 index 0000000..ddc5501 --- /dev/null +++ b/APIClient/albumCell.swift @@ -0,0 +1,19 @@ +// +// AlbumCell.swift +// APIClient +// +// Created by Arthur Heimbrecht on 30.5.16. +// Copyright © 2016 iOS Dev Kurs Universität Heidelberg. All rights reserved. +// +import Foundation + +import UIKit + +class albumCell: UITableViewCell { + func configurewithalbum(album: Album) { + textLabel?.text = album.name + } + func configurewithstring(title: String) { + textLabel?.text = title + } +} \ No newline at end of file diff --git a/APIClient/albumViewController.swift b/APIClient/albumViewController.swift new file mode 100644 index 0000000..73894cb --- /dev/null +++ b/APIClient/albumViewController.swift @@ -0,0 +1,115 @@ +// +// albumViewController.swift +// APIClient +// +// Created by Arthur Heimbrecht on 30.5.16. +// Copyright © 2016 iOS Dev Kurs Universität Heidelberg. All rights reserved. +// + +import Foundation +import UIKit +import Freddy +import Moya + +class albumViewController: UITableViewController { + + /// The Poke API provider that handles requests for server resources + var kanyeAPI: MoyaProvider! + var allalbums: [Album] = [] + var allalbumnames: [String]? + + //var albums: [APIResource]! + + override func viewDidLoad() { + //super.viewDidLoad() + print("VC loaded") + self.title = "Kanye = God" + for albumname in self.allalbumnames!{ + kanyeAPI.request(kanyeREST.album(title: albumname)){ + result in + //print(title) + switch result { + case .Success(let response): + do { + try response.filterSuccessfulStatusCodes() + //print(response) + let json = try JSON(data: response.data) + let tracks = try json.array("result").map(Track.init) + print(tracks) + self.allalbums.append(try Album(tracksfetched: tracks)) + //print(self.allalbums[0]) + print(self.allalbums) + } catch { + print(error) + break + } + case .Failure(let error): + print("failure") + print(error) + break + } + } + } + + + print("didload") + } + + // MARK: User Interaction + + /*override func shouldPerformSegueWithIdentifier(identifier: String, sender: AnyObject?) -> Bool { + switch identifier { + case "showTracks": + if let indexPath = tableView.indexPathForSelectedRow, case .loaded = allalbums[indexPath.row] { + return true + } else { + return false + } + default: + return true + } + }*/ + + override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) { + switch segue.identifier! { + case "showTracks": + print("selected") + guard let trackViewController = segue.destinationViewController as? trackViewController else { + return + } + guard let indexPath = tableView.indexPathForSelectedRow else { + return + } + let selectedAlbum = allalbums[indexPath.row] + trackViewController.kanyeAPI = kanyeAPI + trackViewController.trackAlbum = selectedAlbum + trackViewController.alltracks = selectedAlbum.tracks + default: + break + } + } + +} + + +// MARK: - Table View Datasource + +extension albumViewController { + + override func numberOfSectionsInTableView(tableView: UITableView) -> Int {return 1} + + override func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int { + print(self.allalbumnames!.count) + return self.allalbumnames!.count + } + + override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell { + + // Obtain a cell and configure it + let cell = tableView.dequeueReusableCellWithIdentifier("albumCell", forIndexPath: indexPath) as! albumCell + let albumname = self.allalbumnames![indexPath.row] + cell.configurewithstring(albumname) + return cell + } + +} diff --git a/APIClient/kanyeREST.swift b/APIClient/kanyeREST.swift new file mode 100644 index 0000000..760bd44 --- /dev/null +++ b/APIClient/kanyeREST.swift @@ -0,0 +1,53 @@ +// +// kanyeREST.swift +// APIClient +// +// Created by Arthur Heimbrecht on 30.5.16. +// Copyright © 2016 iOS Dev Kurs Universität Heidelberg. All rights reserved. +// + +import Foundation +import Moya +import Freddy + + +enum kanyeREST: Moya.TargetType{ + + + /// MARK: Endpoints + + case album(title: String) + case track(title: String) + + + // MARK: Network Abstraction + + var baseURL: NSURL { return NSURL(string: "http://www.kanyerest.xyz/api")! } + + var path: String { + switch self { + case .album(title: let name): return "/album/\(name)" + case .track(title: let name): return "/track/\(name)" + } + } + + var method: Moya.Method { return .GET } + + var parameters: [String : AnyObject]? { + switch self { + case .album(title: let name): return ["title": name] + case .track(title: let name): return ["title": name] + default: return nil + } + } + + // TODO: Provide sample data for testing + var sampleData: NSData { + switch self { + case .album(title: let name): return "{\"result\": [{\"album\": \"\(name)\",\"title\": \"generic title no.1 \",\"lyrics\": \"bla bla\",},{\"album\": \"\(name)\",\"title\": \"generic title no. 2\",\"lyrics\": \"more bla bla\",},]}".dataUsingEncoding(NSUTF8StringEncoding)! + case .track(title: let name): return "{\"album\": \"graduation\", \"title\": \"\(name)\", \"lyrics\": \"lyrics\nyeah yeah yeah \n lyrics lyrics \n damn lyrics, i'm da best ya\", }".dataUsingEncoding(NSUTF8StringEncoding)! + default: return "".dataUsingEncoding(NSUTF8StringEncoding)! + } + } + +} \ No newline at end of file diff --git a/APIClient/track.swift b/APIClient/track.swift new file mode 100644 index 0000000..5b2127d --- /dev/null +++ b/APIClient/track.swift @@ -0,0 +1,26 @@ +// +// track.swift +// APIClient +// +// Created by Arthur Heimbrecht on 30.5.16. +// Copyright © 2016 iOS Dev Kurs Universität Heidelberg. All rights reserved. +// + +import Foundation +import Freddy + +/// A specific Pokemon variety of a species +struct Track: JSONDecodable { + + /// The visual depictions of this Pokemon + let title: String + let lyrics: String + let album: String + + public init(json: JSON) throws { + self.title = try json.decode("title") + self.lyrics = try json.decode("lyrics") + self.album = try json.decode("album") + } + +} \ No newline at end of file diff --git a/APIClient/trackCell.swift b/APIClient/trackCell.swift new file mode 100644 index 0000000..2fc8042 --- /dev/null +++ b/APIClient/trackCell.swift @@ -0,0 +1,18 @@ +// +// trackCell.swift +// APIClient +// +// Created by Arthur Heimbrecht on 30.5.16. +// Copyright © 2016 iOS Dev Kurs Universität Heidelberg. All rights reserved. +// +import Foundation + +import UIKit +import Freddy +import Moya + +class trackCell: UITableViewCell { + func configureForEntry(track: Track) { + textLabel?.text = track.title + } +} \ No newline at end of file diff --git a/APIClient/trackDetailViewController.swift b/APIClient/trackDetailViewController.swift new file mode 100644 index 0000000..2b950f0 --- /dev/null +++ b/APIClient/trackDetailViewController.swift @@ -0,0 +1,27 @@ +// +// trackDetailViewController.swift +// APIClient +// +// Created by Arthur Heimbrecht on 30.5.16. +// Copyright © 2016 iOS Dev Kurs Universität Heidelberg. All rights reserved. +// + +import UIKit +import Freddy +import Moya + + +class trackDetailViewController: UIViewController { + + var kanyeAPI: MoyaProvider! + var track: Track! + + @IBOutlet var lyricsLabel: UITextView! + + override func viewDidLoad() { + self.lyricsLabel.text = self.track!.lyrics + self.lyricsLabel.editable = false + self.title = self.track!.title + " / " + self.track!.album + } + +} \ No newline at end of file diff --git a/APIClient/trackViewController.swift b/APIClient/trackViewController.swift new file mode 100644 index 0000000..019f193 --- /dev/null +++ b/APIClient/trackViewController.swift @@ -0,0 +1,78 @@ +// +// trackViewController.swift +// APIClient +// +// Created by Arthur Heimbrecht on 30.5.16. +// Copyright © 2016 iOS Dev Kurs Universität Heidelberg. All rights reserved. +// + +import UIKit +import Freddy +import Moya + +class trackViewController: UITableViewController { + var kanyeAPI: MoyaProvider! + + var trackAlbum: Album? + var alltracks: [Track]? + + //var tracks: [APIResource]! + + // MARK: User Interaction + + /*override func shouldPerformSegueWithIdentifier(identifier: String, sender: AnyObject?) -> Bool { + switch identifier { + case "showDetail": + if let indexPath = tableView.indexPathForSelectedRow, case .loaded = tracks[indexPath.row] { + return true + } else { + return false + } + default: + return true + } + }*/ + + override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) { + switch segue.identifier! { + case "showDetail": + guard let trackDetailViewController = segue.destinationViewController as? trackDetailViewController else { + return + } + guard let indexPath = tableView.indexPathForSelectedRow else { + return + } + let selectedTrack = alltracks![indexPath.row] + trackDetailViewController.kanyeAPI = kanyeAPI + trackDetailViewController.track = selectedTrack + default: + break + } + } + +} + + +// MARK: - Table View Datasource + +extension trackViewController { + + override func numberOfSectionsInTableView(tableView: UITableView) -> Int { + return 1 + } + + override func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int { + return alltracks!.count + } + + + override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell { + + // Obtain a cell and configure it + let cell = tableView.dequeueReusableCellWithIdentifier("trackCell", forIndexPath: indexPath) as! trackCell + let track = alltracks![indexPath.row] + cell.configureForEntry(track) + return cell + } + +} diff --git a/APIClientTests/APIClientTests-Bridging-Header.h b/APIClientTests/APIClientTests-Bridging-Header.h new file mode 100644 index 0000000..1b2cb5d --- /dev/null +++ b/APIClientTests/APIClientTests-Bridging-Header.h @@ -0,0 +1,4 @@ +// +// Use this file to import your target's public headers that you would like to expose to Swift. +// + diff --git a/APIClientTests/KanyeRESTtests.swift b/APIClientTests/KanyeRESTtests.swift new file mode 100644 index 0000000..3c106d7 --- /dev/null +++ b/APIClientTests/KanyeRESTtests.swift @@ -0,0 +1,82 @@ +// +// KanyeRESTtests.swift +// kanyeAPIClient +// +// Created by Arthur Heimbrecht on 6.6.16. +// Copyright © 2016 iOS Dev Kurs Universität Heidelberg. All rights reserved. +// + +import Foundation +import Nimble +import Moya +import Freddy + +import XCTest +// Import the App module with access to all internal types and functions +@testable import kanyeAPIClient +// Nimble provides excellent testing functionality import Nimble +// Every subclass of `XCTestCase` can provide tests class YourAPITests: +class kayeAPItests : XCTestCase { + + let kanyeAPI = MoyaProvider() + + override func setUp() { + super.setUp() + // Called before the invocation of each test + } + override func tearDown() { + super.tearDown() + } + + func testDecodingTrackSampleData() { + self.continueAfterFailure = false + let data = kanyeREST.track(title: "ultimate bullshittery").sampleData + testDecodingTrackFromData(data) + } + + func testDecodingAlbumSampleData() { + self.continueAfterFailure = false + let data = kanyeREST.album(title: "ultimate bullshittery albumstyle").sampleData + testDecodingAlbumFromData(data) + } + + func testNetworkRequestForPokemonSpecies() { + let networkExpectation = expectationWithDescription("Network request") + kanyeAPI.request(.track(title: "good_morning")) { + result in + switch result { + case .Success(let response): + guard let track = self.testDecodingTrackFromData(response.data) else { return } + expect(track.title) == "good_morning" + case .Failure(let error): + fail("Request failed: \(error)") + } + networkExpectation.fulfill() + } + waitForExpectationsWithTimeout(10, handler: nil) + } + + private func testDecodingTrackFromData(data: NSData) -> Track? { + expect(try JSON(data: data)).toNot(throwError()) + guard let json = try? JSON(data: data) else { return nil } + expect(try Track(json: json)).toNot(throwError()) + guard let track = try? Track(json: json) else { return nil } + expect(track.title).toNot(beEmpty()) + expect(track.album).toNot(beEmpty()) + expect(track.lyrics).toNot(beEmpty()) + return track + } + + private func testDecodingAlbumFromData(data: NSData) -> Album? { + expect(try JSON(data: data)).toNot(throwError()) + guard let json = try? JSON(data: data) else { return nil } + expect(try json.array("result").map(Track.init)).toNot(throwError()) + guard let tracks = try? json.array("result").map(Track.init) else { return nil } + expect (try Album(tracksfetched: tracks)).toNot(throwError()) + guard let album = try? Album(tracksfetched: tracks) else { return nil } + expect(album.name).toNot(beEmpty()) + expect(album.tracks).toNot(beEmpty()) + return album + } +} +// Called after the invocation of each test \ No newline at end of file diff --git a/APIClientUITests/APIClientUITests-Bridging-Header.h b/APIClientUITests/APIClientUITests-Bridging-Header.h new file mode 100644 index 0000000..1b2cb5d --- /dev/null +++ b/APIClientUITests/APIClientUITests-Bridging-Header.h @@ -0,0 +1,4 @@ +// +// Use this file to import your target's public headers that you would like to expose to Swift. +// + diff --git a/APIClientUITests/KanyeRESTUItests.swift b/APIClientUITests/KanyeRESTUItests.swift new file mode 100644 index 0000000..af3b6b0 --- /dev/null +++ b/APIClientUITests/KanyeRESTUItests.swift @@ -0,0 +1,53 @@ +// +// KanyeRESTUItests.swift +// kanyeAPIClient +// +// Created by Arthur Heimbrecht on 11.6.16. +// Copyright © 2016 iOS Dev Kurs Universität Heidelberg. All rights reserved. +// +import Foundation + +import XCTest +import Nimble + + +class APIClientUITests: XCTestCase { + + override func setUp() { + super.setUp() + continueAfterFailure = false + XCUIApplication().launch() + waitForResponsiveness() + } + + override func tearDown() { + super.tearDown() + } + + func testNavigationThroughEntries() { + let app = XCUIApplication() + expect(app.cells.count) > 0 + // Select a pokedex entry + let albumEntryCell = app.cells.elementBoundByIndex(0) + //expect(albumEntryCell.activityIndicators.element.exists).toEventually(beFalse(), timeout: 10) + albumEntryCell.tap() + expect(app.cells.count) > 0 + let trackEntryCell = app.cells.elementBoundByIndex(0) + //expect(trackEntryCell.activityIndicators.element.exists).toEventually(beFalse(), timeout: 30) + //let selectedPokemonSpeciesName = pokemonSpeciesCell.staticTexts["pokemonSpeciesName"].label + trackEntryCell.tap() + // Expect the selected pokemon species to be displayed + let LyricsLabel = app.staticTexts["showLyrics"] + expect(LyricsLabel.label).toNot(beEmpty()) + } + + /// Call after launch for a workaround to the app's initial non-responsiveness + private func waitForResponsiveness() { + let wait = expectationWithDescription("wait") + dispatch_after(dispatch_time(DISPATCH_TIME_NOW, Int64(1 * Double(NSEC_PER_SEC))), dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_BACKGROUND, 0)) { + wait.fulfill() + } + waitForExpectationsWithTimeout(10, handler: nil) + } + +} diff --git a/Podfile b/Podfile index 3ef98ae..c7d31d2 100644 --- a/Podfile +++ b/Podfile @@ -1,6 +1,8 @@ platform :ios, '9.0' use_frameworks! +project './APIClient.xcodeproj' + pod 'Moya' pod 'Freddy' pod 'AlamofireImage' diff --git a/Podfile.lock b/Podfile.lock index ceb8ce3..ae87953 100644 --- a/Podfile.lock +++ b/Podfile.lock @@ -28,6 +28,6 @@ SPEC CHECKSUMS: Nimble: 0f3c8b8b084cda391209c3c5efbb48bedeeb920a Result: 9e75e1111c774c6ac594e14907b15057053a7959 -PODFILE CHECKSUM: 2f66579bc8ac348aedd204401ab036a31f94c666 +PODFILE CHECKSUM: a969407222de547b757c0098bf5e832265070143 -COCOAPODS: 1.0.0 +COCOAPODS: 1.0.1 diff --git a/Pods/Manifest.lock b/Pods/Manifest.lock index ceb8ce3..ae87953 100644 --- a/Pods/Manifest.lock +++ b/Pods/Manifest.lock @@ -28,6 +28,6 @@ SPEC CHECKSUMS: Nimble: 0f3c8b8b084cda391209c3c5efbb48bedeeb920a Result: 9e75e1111c774c6ac594e14907b15057053a7959 -PODFILE CHECKSUM: 2f66579bc8ac348aedd204401ab036a31f94c666 +PODFILE CHECKSUM: a969407222de547b757c0098bf5e832265070143 -COCOAPODS: 1.0.0 +COCOAPODS: 1.0.1 diff --git a/Pods/Target Support Files/Pods-APIClient/Pods-APIClient-resources.sh b/Pods/Target Support Files/Pods-APIClient/Pods-APIClient-resources.sh index e768f92..0a15615 100755 --- a/Pods/Target Support Files/Pods-APIClient/Pods-APIClient-resources.sh +++ b/Pods/Target Support Files/Pods-APIClient/Pods-APIClient-resources.sh @@ -48,8 +48,8 @@ EOM ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS} ;; *.xib) - echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib $RESOURCE_PATH --sdk ${SDKROOT}" - ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib" "$RESOURCE_PATH" --sdk "${SDKROOT}" + echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" + ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS} ;; *.framework) echo "mkdir -p ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" diff --git a/Pods/Target Support Files/Pods-APIClientTests/Pods-APIClientTests-resources.sh b/Pods/Target Support Files/Pods-APIClientTests/Pods-APIClientTests-resources.sh index e768f92..0a15615 100755 --- a/Pods/Target Support Files/Pods-APIClientTests/Pods-APIClientTests-resources.sh +++ b/Pods/Target Support Files/Pods-APIClientTests/Pods-APIClientTests-resources.sh @@ -48,8 +48,8 @@ EOM ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS} ;; *.xib) - echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib $RESOURCE_PATH --sdk ${SDKROOT}" - ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib" "$RESOURCE_PATH" --sdk "${SDKROOT}" + echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" + ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS} ;; *.framework) echo "mkdir -p ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" diff --git a/Pods/Target Support Files/Pods-APIClientUITests/Pods-APIClientUITests-resources.sh b/Pods/Target Support Files/Pods-APIClientUITests/Pods-APIClientUITests-resources.sh index e768f92..0a15615 100755 --- a/Pods/Target Support Files/Pods-APIClientUITests/Pods-APIClientUITests-resources.sh +++ b/Pods/Target Support Files/Pods-APIClientUITests/Pods-APIClientUITests-resources.sh @@ -48,8 +48,8 @@ EOM ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS} ;; *.xib) - echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib $RESOURCE_PATH --sdk ${SDKROOT}" - ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib" "$RESOURCE_PATH" --sdk "${SDKROOT}" + echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" + ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS} ;; *.framework) echo "mkdir -p ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" diff --git a/kanyeAPIClient.xcworkspace/contents.xcworkspacedata b/kanyeAPIClient.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..f7bc1ac --- /dev/null +++ b/kanyeAPIClient.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,10 @@ + + + + + + +