project restructure, initial network types, app icons
This commit is contained in:
parent
7a1adae54c
commit
a070050cf1
BIN
AppIcon.xcf
Normal file
BIN
AppIcon.xcf
Normal file
Binary file not shown.
@ -8,9 +8,13 @@
|
||||
|
||||
/* Begin PBXBuildFile section */
|
||||
E98254BD23F9B7A90056D9D3 /* Playlist.swift in Sources */ = {isa = PBXBuildFile; fileRef = E98254BC23F9B7A90056D9D3 /* Playlist.swift */; };
|
||||
E98254C223F9FFF90056D9D3 /* PlaylistView.swift in Sources */ = {isa = PBXBuildFile; fileRef = E98254C123F9FFF90056D9D3 /* PlaylistView.swift */; };
|
||||
E98254C823FA25D20056D9D3 /* PlaylistList.swift in Sources */ = {isa = PBXBuildFile; fileRef = E98254C723FA25D20056D9D3 /* PlaylistList.swift */; };
|
||||
E98254CA23FA26600056D9D3 /* PlaylistRow.swift in Sources */ = {isa = PBXBuildFile; fileRef = E98254C923FA26600056D9D3 /* PlaylistRow.swift */; };
|
||||
E98254CC23FA2D0A0056D9D3 /* NetTypes.swift in Sources */ = {isa = PBXBuildFile; fileRef = E98254CB23FA2D0A0056D9D3 /* NetTypes.swift */; };
|
||||
E9EA690B23F9A5430012C3E8 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = E9EA690A23F9A5430012C3E8 /* AppDelegate.swift */; };
|
||||
E9EA690D23F9A5430012C3E8 /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = E9EA690C23F9A5430012C3E8 /* SceneDelegate.swift */; };
|
||||
E9EA690F23F9A5430012C3E8 /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = E9EA690E23F9A5430012C3E8 /* ContentView.swift */; };
|
||||
E9EA690F23F9A5430012C3E8 /* RootView.swift in Sources */ = {isa = PBXBuildFile; fileRef = E9EA690E23F9A5430012C3E8 /* RootView.swift */; };
|
||||
E9EA691123F9A54A0012C3E8 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = E9EA691023F9A54A0012C3E8 /* Assets.xcassets */; };
|
||||
E9EA691423F9A54B0012C3E8 /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = E9EA691323F9A54B0012C3E8 /* Preview Assets.xcassets */; };
|
||||
E9EA691723F9A54B0012C3E8 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = E9EA691523F9A54B0012C3E8 /* LaunchScreen.storyboard */; };
|
||||
@ -37,10 +41,14 @@
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
E98254BC23F9B7A90056D9D3 /* Playlist.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Playlist.swift; sourceTree = "<group>"; };
|
||||
E98254C123F9FFF90056D9D3 /* PlaylistView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PlaylistView.swift; sourceTree = "<group>"; };
|
||||
E98254C723FA25D20056D9D3 /* PlaylistList.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PlaylistList.swift; sourceTree = "<group>"; };
|
||||
E98254C923FA26600056D9D3 /* PlaylistRow.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PlaylistRow.swift; sourceTree = "<group>"; };
|
||||
E98254CB23FA2D0A0056D9D3 /* NetTypes.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NetTypes.swift; sourceTree = "<group>"; };
|
||||
E9EA690723F9A5430012C3E8 /* Music Tools.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Music Tools.app"; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
E9EA690A23F9A5430012C3E8 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
|
||||
E9EA690C23F9A5430012C3E8 /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = "<group>"; };
|
||||
E9EA690E23F9A5430012C3E8 /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = "<group>"; };
|
||||
E9EA690E23F9A5430012C3E8 /* RootView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RootView.swift; sourceTree = "<group>"; };
|
||||
E9EA691023F9A54A0012C3E8 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
|
||||
E9EA691323F9A54B0012C3E8 /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = "<group>"; };
|
||||
E9EA691623F9A54B0012C3E8 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
|
||||
@ -89,10 +97,32 @@
|
||||
E98254BF23F9BE040056D9D3 /* Network */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
E98254CB23FA2D0A0056D9D3 /* NetTypes.swift */,
|
||||
);
|
||||
path = Network;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
E98254C023F9FFDD0056D9D3 /* Views */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
E9EA690E23F9A5430012C3E8 /* RootView.swift */,
|
||||
E98254C123F9FFF90056D9D3 /* PlaylistView.swift */,
|
||||
E98254C723FA25D20056D9D3 /* PlaylistList.swift */,
|
||||
E98254C923FA26600056D9D3 /* PlaylistRow.swift */,
|
||||
);
|
||||
path = Views;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
E98254C623FA25280056D9D3 /* Application */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
E9EA691523F9A54B0012C3E8 /* LaunchScreen.storyboard */,
|
||||
E9EA690A23F9A5430012C3E8 /* AppDelegate.swift */,
|
||||
E9EA690C23F9A5430012C3E8 /* SceneDelegate.swift */,
|
||||
);
|
||||
path = Application;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
E9EA68FE23F9A5430012C3E8 = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
@ -116,13 +146,11 @@
|
||||
E9EA690923F9A5430012C3E8 /* Music Tools */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
E98254C623FA25280056D9D3 /* Application */,
|
||||
E98254C023F9FFDD0056D9D3 /* Views */,
|
||||
E98254BF23F9BE040056D9D3 /* Network */,
|
||||
E98254BE23F9BD540056D9D3 /* Model */,
|
||||
E9EA690A23F9A5430012C3E8 /* AppDelegate.swift */,
|
||||
E9EA690C23F9A5430012C3E8 /* SceneDelegate.swift */,
|
||||
E9EA690E23F9A5430012C3E8 /* ContentView.swift */,
|
||||
E9EA691023F9A54A0012C3E8 /* Assets.xcassets */,
|
||||
E9EA691523F9A54B0012C3E8 /* LaunchScreen.storyboard */,
|
||||
E9EA691823F9A54B0012C3E8 /* Info.plist */,
|
||||
E9EA691223F9A54B0012C3E8 /* Preview Content */,
|
||||
);
|
||||
@ -286,10 +314,14 @@
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
E98254CC23FA2D0A0056D9D3 /* NetTypes.swift in Sources */,
|
||||
E98254CA23FA26600056D9D3 /* PlaylistRow.swift in Sources */,
|
||||
E9EA690B23F9A5430012C3E8 /* AppDelegate.swift in Sources */,
|
||||
E9EA690D23F9A5430012C3E8 /* SceneDelegate.swift in Sources */,
|
||||
E9EA690F23F9A5430012C3E8 /* ContentView.swift in Sources */,
|
||||
E98254C823FA25D20056D9D3 /* PlaylistList.swift in Sources */,
|
||||
E9EA690F23F9A5430012C3E8 /* RootView.swift in Sources */,
|
||||
E98254BD23F9B7A90056D9D3 /* Playlist.swift in Sources */,
|
||||
E98254C223F9FFF90056D9D3 /* PlaylistView.swift in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
|
@ -20,7 +20,7 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate {
|
||||
// This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead).
|
||||
|
||||
// Create the SwiftUI view that provides the window contents.
|
||||
let contentView = ContentView()
|
||||
let contentView = RootView()
|
||||
|
||||
// Use a UIHostingController as window root view controller.
|
||||
if let windowScene = scene as? UIWindowScene {
|
@ -6,8 +6,9 @@
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "iphone",
|
||||
"size" : "20x20",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "MusicToolsIcon60.png",
|
||||
"scale" : "3x"
|
||||
},
|
||||
{
|
||||
@ -31,13 +32,15 @@
|
||||
"scale" : "3x"
|
||||
},
|
||||
{
|
||||
"idiom" : "iphone",
|
||||
"size" : "60x60",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "MusicToolsIcon120.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "iphone",
|
||||
"size" : "60x60",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "MusicToolsIcon180.png",
|
||||
"scale" : "3x"
|
||||
},
|
||||
{
|
||||
@ -71,8 +74,9 @@
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "ipad",
|
||||
"size" : "76x76",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "MusicToolsIcon76.png",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
@ -86,8 +90,9 @@
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "ios-marketing",
|
||||
"size" : "1024x1024",
|
||||
"idiom" : "ios-marketing",
|
||||
"filename" : "MusicToolsIcon1024.png",
|
||||
"scale" : "1x"
|
||||
}
|
||||
],
|
||||
|
Binary file not shown.
After Width: | Height: | Size: 20 KiB |
Binary file not shown.
After Width: | Height: | Size: 2.8 KiB |
Binary file not shown.
After Width: | Height: | Size: 3.6 KiB |
Binary file not shown.
After Width: | Height: | Size: 1.8 KiB |
Binary file not shown.
After Width: | Height: | Size: 2.1 KiB |
21
Music Tools/Assets.xcassets/PlaylistCoverImage.imageset/Contents.json
vendored
Normal file
21
Music Tools/Assets.xcassets/PlaylistCoverImage.imageset/Contents.json
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"filename" : "weird-rap.jpg",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
}
|
||||
}
|
BIN
Music Tools/Assets.xcassets/PlaylistCoverImage.imageset/weird-rap.jpg
vendored
Normal file
BIN
Music Tools/Assets.xcassets/PlaylistCoverImage.imageset/weird-rap.jpg
vendored
Normal file
Binary file not shown.
After Width: | Height: | Size: 32 KiB |
@ -8,7 +8,8 @@
|
||||
|
||||
import UIKit
|
||||
|
||||
class Playlist {
|
||||
|
||||
class Playlist: Identifiable {
|
||||
|
||||
//MARK: Properties
|
||||
|
||||
|
33
Music Tools/Network/NetTypes.swift
Normal file
33
Music Tools/Network/NetTypes.swift
Normal file
@ -0,0 +1,33 @@
|
||||
//
|
||||
// EndPointType.swift
|
||||
// Music Tools
|
||||
//
|
||||
// Created by Ellie McCarthy on 17/02/2020.
|
||||
// Copyright © 2020 Sarsoo. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
protocol EndPointType {
|
||||
var domain: URL { get }
|
||||
var path: String { get }
|
||||
var httpMethod: HTTPMethod { get }
|
||||
var task: HTTPTask { get }
|
||||
var headers: HTTPHeaders? { get }
|
||||
}
|
||||
|
||||
public enum HTTPMethod: String {
|
||||
case get = "GET"
|
||||
case post = "POST"
|
||||
case put = "PUT"
|
||||
case delete = "DELETE"
|
||||
}
|
||||
|
||||
public typealias HTTPHeaders = [String:String]
|
||||
public typealias Parameters = [String:Any]
|
||||
|
||||
public enum HTTPTask {
|
||||
case request
|
||||
|
||||
case requestParameters(bodyParameters: Parameters?, urlParameters: Parameters?)
|
||||
}
|
40
Music Tools/Views/PlaylistList.swift
Normal file
40
Music Tools/Views/PlaylistList.swift
Normal file
@ -0,0 +1,40 @@
|
||||
//
|
||||
// SwiftUIView.swift
|
||||
// Music Tools
|
||||
//
|
||||
// Created by Ellie McCarthy on 17/02/2020.
|
||||
// Copyright © 2020 Sarsoo. All rights reserved.
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
|
||||
struct PlaylistList: View {
|
||||
var playlists: Array<Playlist>
|
||||
|
||||
var body: some View {
|
||||
List(playlists) { playlist in
|
||||
PlaylistRow(playlist: playlist)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
struct PlaylistList_Previews: PreviewProvider {
|
||||
static var previews: some View {
|
||||
PlaylistList(playlists:
|
||||
[
|
||||
Playlist(name: "playlist name",
|
||||
uri: "uri",
|
||||
username: "username",
|
||||
|
||||
include_recommendations: true,
|
||||
recommendation_sample: 5,
|
||||
include_library_tracks: true,
|
||||
|
||||
parts: ["name"],
|
||||
playlist_references: ["ref name"],
|
||||
|
||||
shuffle: true)
|
||||
]
|
||||
)
|
||||
}
|
||||
}
|
39
Music Tools/Views/PlaylistRow.swift
Normal file
39
Music Tools/Views/PlaylistRow.swift
Normal file
@ -0,0 +1,39 @@
|
||||
//
|
||||
// PlaylistRow.swift
|
||||
// Music Tools
|
||||
//
|
||||
// Created by Ellie McCarthy on 17/02/2020.
|
||||
// Copyright © 2020 Sarsoo. All rights reserved.
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
|
||||
struct PlaylistRow: View {
|
||||
var playlist: Playlist
|
||||
|
||||
var body: some View {
|
||||
HStack {
|
||||
Text(playlist.name)
|
||||
Spacer()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
struct PlaylistRow_Previews: PreviewProvider {
|
||||
static var previews: some View {
|
||||
PlaylistRow(playlist:
|
||||
Playlist(name: "playlist name",
|
||||
uri: "uri",
|
||||
username: "username",
|
||||
|
||||
include_recommendations: true,
|
||||
recommendation_sample: 5,
|
||||
include_library_tracks: true,
|
||||
|
||||
parts: ["name"],
|
||||
playlist_references: ["ref name"],
|
||||
|
||||
shuffle: true)
|
||||
)
|
||||
}
|
||||
}
|
70
Music Tools/Views/PlaylistView.swift
Normal file
70
Music Tools/Views/PlaylistView.swift
Normal file
@ -0,0 +1,70 @@
|
||||
//
|
||||
// PlaylistView.swift
|
||||
// Music Tools
|
||||
//
|
||||
// Created by Ellie McCarthy on 16/02/2020.
|
||||
// Copyright © 2020 Sarsoo. All rights reserved.
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
|
||||
struct PlaylistView: View {
|
||||
var playlist: Playlist
|
||||
|
||||
var body: some View {
|
||||
|
||||
VStack(alignment: .leading) {
|
||||
Text(playlist.name)
|
||||
.font(.largeTitle)
|
||||
.multilineTextAlignment(.leading)
|
||||
Text(playlist.username)
|
||||
.foregroundColor(Color.gray)
|
||||
Image("PlaylistCoverImage")
|
||||
.resizable()
|
||||
.frame(width: 200.0, height: 200.0, alignment: .trailing)
|
||||
.cornerRadius(18)
|
||||
.padding(.bottom, 20)
|
||||
|
||||
Toggle(isOn: /*@START_MENU_TOKEN@*//*@PLACEHOLDER=Value@*/.constant(true)/*@END_MENU_TOKEN@*/) {
|
||||
Text("Spotify Recommendations")
|
||||
}
|
||||
|
||||
Stepper(value: /*@START_MENU_TOKEN@*//*@PLACEHOLDER=Value@*/.constant(4)/*@END_MENU_TOKEN@*/, in: /*@START_MENU_TOKEN@*//*@PLACEHOLDER=Range@*/1...10/*@END_MENU_TOKEN@*/){
|
||||
Text("#:")
|
||||
.foregroundColor(Color.gray)
|
||||
.multilineTextAlignment(.trailing)
|
||||
.padding(.leading, 20)
|
||||
Text("100")
|
||||
.multilineTextAlignment(.trailing)
|
||||
|
||||
}
|
||||
|
||||
Toggle(isOn: /*@START_MENU_TOKEN@*//*@PLACEHOLDER=Value@*/.constant(true)/*@END_MENU_TOKEN@*/) {
|
||||
Text("Library Tracks")
|
||||
}
|
||||
|
||||
EditButton()
|
||||
}
|
||||
.padding()
|
||||
.frame(minWidth: 0, maxWidth: .infinity, minHeight: 0, maxHeight: .infinity, alignment: .topLeading)
|
||||
}
|
||||
}
|
||||
|
||||
struct PlaylistView_Previews: PreviewProvider {
|
||||
static var previews: some View {
|
||||
PlaylistView(playlist:
|
||||
Playlist(name: "playlist name",
|
||||
uri: "uri",
|
||||
username: "username",
|
||||
|
||||
include_recommendations: true,
|
||||
recommendation_sample: 5,
|
||||
include_library_tracks: true,
|
||||
|
||||
parts: ["name"],
|
||||
playlist_references: ["ref name"],
|
||||
|
||||
shuffle: true)
|
||||
)
|
||||
}
|
||||
}
|
@ -8,7 +8,7 @@
|
||||
|
||||
import SwiftUI
|
||||
|
||||
struct ContentView: View {
|
||||
struct RootView: View {
|
||||
@State private var selection = 0
|
||||
|
||||
var body: some View {
|
||||
@ -47,8 +47,8 @@ struct ContentView: View {
|
||||
}
|
||||
}
|
||||
|
||||
struct ContentView_Previews: PreviewProvider {
|
||||
struct RootView_Previews: PreviewProvider {
|
||||
static var previews: some View {
|
||||
ContentView()
|
||||
RootView()
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user