From 2aff14cc8c5637646efe33d817b0ce3d98a7eee5 Mon Sep 17 00:00:00 2001 From: Jason R Tibbetts Date: Tue, 16 Feb 2021 23:13:43 -0500 Subject: [PATCH] #46: Added a Service struct to the SwiftUI target. --- SwiftDiscogs.xcodeproj/project.pbxproj | 4 ++++ SwiftUIDiscogs/MainView.swift | 2 +- SwiftUIDiscogs/Service.swift | 17 +++++++++++++++++ 3 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 SwiftUIDiscogs/Service.swift diff --git a/SwiftDiscogs.xcodeproj/project.pbxproj b/SwiftDiscogs.xcodeproj/project.pbxproj index 5281d33..d7454cc 100644 --- a/SwiftDiscogs.xcodeproj/project.pbxproj +++ b/SwiftDiscogs.xcodeproj/project.pbxproj @@ -210,6 +210,7 @@ 96D5B7182497388500B555AC /* Stylobate.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 96D5B6D12495E23300B555AC /* Stylobate.framework */; }; 96D5B7192497388500B555AC /* Stylobate.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 96D5B6D12495E23300B555AC /* Stylobate.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 96D5B71C24973DB200B555AC /* DiscogsClient.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96D5B71B24973DB200B555AC /* DiscogsClient.swift */; }; + 96D5B71E2498A25900B555AC /* Service.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96D5B71D2498A25900B555AC /* Service.swift */; }; 96E044A22089A93E008F1FE4 /* CollectionAndTableViewControllerTestBase.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96E044A12089A93E008F1FE4 /* CollectionAndTableViewControllerTestBase.swift */; }; 96E8CCE020E33396001C5381 /* DiscogsDisplay.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96E8CCDF20E33396001C5381 /* DiscogsDisplay.swift */; }; 96EA0DE0225EDF220072F09F /* ArtistBioViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96EA0DDF225EDF220072F09F /* ArtistBioViewController.swift */; }; @@ -523,6 +524,7 @@ 96D5B70A2497361700B555AC /* SwiftUIDiscogsUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SwiftUIDiscogsUITests.swift; sourceTree = ""; }; 96D5B70C2497361700B555AC /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 96D5B71B24973DB200B555AC /* DiscogsClient.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DiscogsClient.swift; sourceTree = ""; }; + 96D5B71D2498A25900B555AC /* Service.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Service.swift; sourceTree = ""; }; 96E044A12089A93E008F1FE4 /* CollectionAndTableViewControllerTestBase.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CollectionAndTableViewControllerTestBase.swift; sourceTree = ""; }; 96E8CCDF20E33396001C5381 /* DiscogsDisplay.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DiscogsDisplay.swift; sourceTree = ""; }; 96EA0DDF225EDF220072F09F /* ArtistBioViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ArtistBioViewController.swift; sourceTree = ""; }; @@ -1123,6 +1125,7 @@ 96D5B6F32497361700B555AC /* LaunchScreen.storyboard */, 96D5B6F02497361700B555AC /* Preview Content */, 96D5B6E92497361200B555AC /* SwiftUIDiscogs.xcdatamodeld */, + 96D5B71D2498A25900B555AC /* Service.swift */, ); path = SwiftUIDiscogs; sourceTree = ""; @@ -1749,6 +1752,7 @@ 96D5B6EB2497361200B555AC /* SwiftUIDiscogs.xcdatamodeld in Sources */, 96D5B6ED2497361200B555AC /* MainView.swift in Sources */, 96D5B6E82497361200B555AC /* SceneDelegate.swift in Sources */, + 96D5B71E2498A25900B555AC /* Service.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/SwiftUIDiscogs/MainView.swift b/SwiftUIDiscogs/MainView.swift index cda5635..9aeb1ac 100644 --- a/SwiftUIDiscogs/MainView.swift +++ b/SwiftUIDiscogs/MainView.swift @@ -7,7 +7,7 @@ struct MainView: View { @State private var searchTerms: String = "" var body: some View { - VStack { + VStack(alignment: .center, spacing: 20.0) { TextField("Search Discogs", text: $searchTerms) Text("Searching for \(searchTerms)") } diff --git a/SwiftUIDiscogs/Service.swift b/SwiftUIDiscogs/Service.swift new file mode 100644 index 0000000..b988291 --- /dev/null +++ b/SwiftUIDiscogs/Service.swift @@ -0,0 +1,17 @@ +// +// Service.swift +// SwiftUIDiscogs +// +// Created by Jason R Tibbetts on 6/16/20. +// Copyright © 2020 Poikile Creations. All rights reserved. +// + +import Foundation + +public struct Service { + + public var username: String + + public var baseUrl: URL + +}