Skip to content

Commit

Permalink
Merge pull request #3 from ioveracker/tvOS-github-provider
Browse files Browse the repository at this point in the history
Added a github API provider in tvOS ViewController
  • Loading branch information
voidrender committed Apr 30, 2016
2 parents 04e0ea4 + 74a0322 commit 5120a36
Show file tree
Hide file tree
Showing 2 changed files with 149 additions and 1 deletion.
143 changes: 143 additions & 0 deletions Zen.xcodeproj/xcshareddata/xcschemes/Everything.xcscheme
Original file line number Diff line number Diff line change
@@ -0,0 +1,143 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0730"
version = "2.0">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "78C2BB751CC1A4CC008CD50E"
BuildableName = "iOS.app"
BlueprintName = "iOS"
ReferencedContainer = "container:Zen.xcodeproj">
</BuildableReference>
</BuildActionEntry>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "78C2BB891CC1A4CC008CD50E"
BuildableName = "iOSTests.xctest"
BlueprintName = "iOSTests"
ReferencedContainer = "container:Zen.xcodeproj">
</BuildableReference>
</BuildActionEntry>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "78C2BB9A1CC1A52B008CD50E"
BuildableName = "tvOS.app"
BlueprintName = "tvOS"
ReferencedContainer = "container:Zen.xcodeproj">
</BuildableReference>
</BuildActionEntry>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "78C2BBAA1CC1A52B008CD50E"
BuildableName = "tvOSTests.xctest"
BlueprintName = "tvOSTests"
ReferencedContainer = "container:Zen.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
codeCoverageEnabled = "YES">
<Testables>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "78C2BB751CC1A4CC008CD50E"
BuildableName = "iOS.app"
BlueprintName = "iOS"
ReferencedContainer = "container:Zen.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES"
launchAutomaticallySubstyle = "2">
<RemoteRunnable
runnableDebuggingMode = "1"
BundleIdentifier = "me.overacker.Zen"
RemotePath = "/Users/ioveracker/Library/Developer/CoreSimulator/Devices/AFF4A0A9-D0F1-47F2-88D6-CC0E4F93752D/data/Containers/Bundle/Application/63ED0E59-52CC-4D5F-BBCD-23AFCE066AF5/tvOS.app">
</RemoteRunnable>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "78C2BB751CC1A4CC008CD50E"
BuildableName = "iOS.app"
BlueprintName = "iOS"
ReferencedContainer = "container:Zen.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES"
launchAutomaticallySubstyle = "2">
<PathRunnable
runnableDebuggingMode = "0"
FilePath = "/Users/ioveracker/Library/Developer/Xcode/DerivedData/Zen-hafsywevkqeyjmfjtlctortkspal/Build/Products/Everything">
</PathRunnable>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "78C2BB751CC1A4CC008CD50E"
BuildableName = "iOS.app"
BlueprintName = "iOS"
ReferencedContainer = "container:Zen.xcodeproj">
</BuildableReference>
</MacroExpansion>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
7 changes: 6 additions & 1 deletion tvOS/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,16 @@ import Moya

class ViewController: UIViewController {

var gitHubAPI: MoyaProvider<GitHub>!

@IBOutlet weak var zenLabel: UILabel!

override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
gitHubAPI = MoyaProvider<GitHub>(plugins: [
NetworkLoggerPlugin(verbose: true, responseDataFormatter: JSONResponseDataFormatter)
])
}

override func didReceiveMemoryWarning() {
Expand All @@ -24,7 +29,7 @@ class ViewController: UIViewController {
}

@IBAction func zenButtonTriggered(sender: UIButton) {
GitHubProvider.request(.Zen) { result in
gitHubAPI.request(.Zen) { result in
switch result {
case let .Success(response):
do {
Expand Down

0 comments on commit 5120a36

Please sign in to comment.