Mercurial > public > stock-charts
changeset 57:1621702163f0
Update DemoProject
author | Dennis Concepción Martín <66180929+denniscm190@users.noreply.github.com> |
---|---|
date | Mon, 03 May 2021 17:36:17 +0200 |
parents | 68a32dc9861f |
children | 0dde4e54bb7b |
files | DemoProject/DemoProject.xcodeproj/project.pbxproj DemoProject/DemoProject.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved DemoProject/DemoProject.xcodeproj/project.xcworkspace/xcuserdata/dennis.xcuserdatad/UserInterfaceState.xcuserstate DemoProject/DemoProject/ContentView.swift DemoProject/DemoProject/Home.swift DemoProject/DemoProject/View1.swift DemoProject/DemoProject/View2.swift StockCharts.xcodeproj/project.xcworkspace/xcuserdata/dennis.xcuserdatad/UserInterfaceState.xcuserstate |
diffstat | 8 files changed, 175 insertions(+), 61 deletions(-) [+] |
line wrap: on
line diff
--- a/DemoProject/DemoProject.xcodeproj/project.pbxproj Mon May 03 17:01:43 2021 +0200 +++ b/DemoProject/DemoProject.xcodeproj/project.pbxproj Mon May 03 17:36:17 2021 +0200 @@ -3,7 +3,7 @@ archiveVersion = 1; classes = { }; - objectVersion = 50; + objectVersion = 52; objects = { /* Begin PBXBuildFile section */ @@ -11,7 +11,9 @@ 95770BE1263C5F85003FA924 /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 95770BE0263C5F85003FA924 /* ContentView.swift */; }; 95770BE3263C5F86003FA924 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 95770BE2263C5F86003FA924 /* Assets.xcassets */; }; 95770BE6263C5F86003FA924 /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 95770BE5263C5F86003FA924 /* Preview Assets.xcassets */; }; - 95770BEE263C5FCD003FA924 /* Home.swift in Sources */ = {isa = PBXBuildFile; fileRef = 95770BED263C5FCD003FA924 /* Home.swift */; }; + 95770BEE263C5FCD003FA924 /* View1.swift in Sources */ = {isa = PBXBuildFile; fileRef = 95770BED263C5FCD003FA924 /* View1.swift */; }; + 9584AA90264048AD00626769 /* StockCharts in Frameworks */ = {isa = PBXBuildFile; productRef = 9584AA8F264048AD00626769 /* StockCharts */; }; + 9584AA92264048D700626769 /* View2.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9584AA91264048D700626769 /* View2.swift */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ @@ -21,7 +23,8 @@ 95770BE2263C5F86003FA924 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; }; 95770BE5263C5F86003FA924 /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = "<group>"; }; 95770BE7263C5F86003FA924 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; }; - 95770BED263C5FCD003FA924 /* Home.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Home.swift; sourceTree = "<group>"; }; + 95770BED263C5FCD003FA924 /* View1.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = View1.swift; sourceTree = "<group>"; }; + 9584AA91264048D700626769 /* View2.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = View2.swift; sourceTree = "<group>"; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -29,6 +32,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 9584AA90264048AD00626769 /* StockCharts in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -56,7 +60,8 @@ children = ( 95770BDE263C5F85003FA924 /* DemoProjectApp.swift */, 95770BE0263C5F85003FA924 /* ContentView.swift */, - 95770BED263C5FCD003FA924 /* Home.swift */, + 95770BED263C5FCD003FA924 /* View1.swift */, + 9584AA91264048D700626769 /* View2.swift */, 95770BE2263C5F86003FA924 /* Assets.xcassets */, 95770BE7263C5F86003FA924 /* Info.plist */, 95770BE4263C5F86003FA924 /* Preview Content */, @@ -89,6 +94,7 @@ ); name = DemoProject; packageProductDependencies = ( + 9584AA8F264048AD00626769 /* StockCharts */, ); productName = DemoProject; productReference = 95770BDB263C5F85003FA924 /* DemoProject.app */; @@ -118,6 +124,7 @@ ); mainGroup = 95770BD2263C5F85003FA924; packageReferences = ( + 9584AA8E264048AD00626769 /* XCRemoteSwiftPackageReference "StockCharts" */, ); productRefGroup = 95770BDC263C5F85003FA924 /* Products */; projectDirPath = ""; @@ -146,8 +153,9 @@ buildActionMask = 2147483647; files = ( 95770BE1263C5F85003FA924 /* ContentView.swift in Sources */, - 95770BEE263C5FCD003FA924 /* Home.swift in Sources */, + 95770BEE263C5FCD003FA924 /* View1.swift in Sources */, 95770BDF263C5F85003FA924 /* DemoProjectApp.swift in Sources */, + 9584AA92264048D700626769 /* View2.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -336,6 +344,25 @@ defaultConfigurationName = Release; }; /* End XCConfigurationList section */ + +/* Begin XCRemoteSwiftPackageReference section */ + 9584AA8E264048AD00626769 /* XCRemoteSwiftPackageReference "StockCharts" */ = { + isa = XCRemoteSwiftPackageReference; + repositoryURL = "https://github.com/denniscm190/StockCharts.git"; + requirement = { + branch = main; + kind = branch; + }; + }; +/* End XCRemoteSwiftPackageReference section */ + +/* Begin XCSwiftPackageProductDependency section */ + 9584AA8F264048AD00626769 /* StockCharts */ = { + isa = XCSwiftPackageProductDependency; + package = 9584AA8E264048AD00626769 /* XCRemoteSwiftPackageReference "StockCharts" */; + productName = StockCharts; + }; +/* End XCSwiftPackageProductDependency section */ }; rootObject = 95770BD3263C5F85003FA924 /* Project object */; }
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/DemoProject/DemoProject.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved Mon May 03 17:36:17 2021 +0200 @@ -0,0 +1,16 @@ +{ + "object": { + "pins": [ + { + "package": "StockCharts", + "repositoryURL": "https://github.com/denniscm190/StockCharts.git", + "state": { + "branch": "main", + "revision": "63798e38d49dfd38625aae730b6d062fbc6288f2", + "version": null + } + } + ] + }, + "version": 1 +}
Binary file DemoProject/DemoProject.xcodeproj/project.xcworkspace/xcuserdata/dennis.xcuserdatad/UserInterfaceState.xcuserstate has changed
--- a/DemoProject/DemoProject/ContentView.swift Mon May 03 17:01:43 2021 +0200 +++ b/DemoProject/DemoProject/ContentView.swift Mon May 03 17:36:17 2021 +0200 @@ -10,9 +10,13 @@ struct ContentView: View { var body: some View { TabView { - Home(data: generateSampleData(500)) + View1(data: generateSampleData(500)) .tabItem { - Label("Line chart", systemImage: "chart.bar.xaxis") + Label("View 1", systemImage: "1.circle") + } + View2(data: generateSampleData(200)) + .tabItem { + Label("View 2", systemImage: "2.circle") } } }
--- a/DemoProject/DemoProject/Home.swift Mon May 03 17:01:43 2021 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,54 +0,0 @@ -// -// Home.swift -// DemoProject -// -// Created by Dennis Concepción Martín on 30/4/21. -// - -import SwiftUI -import StockCharts - -struct Home: View { - var data: [Double] - var dates: [String]? - var hours: [String]? - - var range = ["5D", "1M", "3M", "1Y", "5Y"] - @State private var selectedRange = "3M" - - var body: some View { - NavigationView { - VStack(alignment: .leading) { - Text("Apple Inc") - .font(.title3) - .padding([.horizontal, .bottom]) - - Picker("Select a range", selection: $selectedRange) { - ForEach(range, id: \.self) { - Text($0) - } - } - .pickerStyle(SegmentedPickerStyle()) - .padding(.horizontal) - - ChartView(data: data, dates: dates, hours: hours) - .padding(.vertical) - } - .navigationTitle("AAPL") - .toolbar { - ToolbarItem(placement: .navigationBarTrailing) { - Button(action: {}) { - Image(systemName: "star") - } - } - - ToolbarItem(placement: .navigationBarLeading) { - Button(action: {}) { - Image(systemName: "plus.circle") - } - } - } - } - .navigationViewStyle(StackNavigationViewStyle()) - } -}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/DemoProject/DemoProject/View1.swift Mon May 03 17:36:17 2021 +0200 @@ -0,0 +1,58 @@ +// +// View1.swift +// DemoProject +// +// Created by Dennis Concepción Martín on 30/4/21. +// + +import SwiftUI +import StockCharts + +struct View1: View { + var data: [Double] + var dates: [String]? + var hours: [String]? + + var range = ["5D", "1M", "3M", "1Y", "5Y"] + @State private var selectedRange = "3M" + + var body: some View { + NavigationView { + VStack(alignment: .leading) { + Text("Apple Inc") + .font(.title3) + .padding([.horizontal, .bottom]) + + Picker("Select a range", selection: $selectedRange) { + ForEach(range, id: \.self) { + Text($0) + } + } + .pickerStyle(SegmentedPickerStyle()) + .padding(.horizontal) + + ChartView(data: data, dates: dates, hours: hours) + .padding(.vertical) + + List(1..<7) { i in + Text("Item \(i)") + } + } + .navigationTitle("AAPL") + .toolbar { + ToolbarItem(placement: .navigationBarTrailing) { + Button(action: {}) { + Image(systemName: "star") + } + } + + ToolbarItem(placement: .navigationBarLeading) { + Button(action: {}) { + Image(systemName: "plus.circle") + } + } + } + } + .navigationViewStyle(StackNavigationViewStyle()) + } +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/DemoProject/DemoProject/View2.swift Mon May 03 17:36:17 2021 +0200 @@ -0,0 +1,63 @@ +// +// View2.swift +// DemoProject +// +// Created by Dennis Concepción Martín on 3/5/21. +// + +import SwiftUI +import StockCharts + +struct View2: View { + var data: [Double] + + var body: some View { + NavigationView { + List { + ForEach((1..<4)) { _ in + ScrollView(.horizontal, showsIndicators: false) { + HStack(spacing: 20) { + ForEach((1..<10)) { _ in + ItemView2(data: data) + } + } + .padding() + } + .frame(height: 250) + .listRowInsets(EdgeInsets()) + } + } + .navigationTitle("View2") + .navigationBarTitleDisplayMode(.inline) + } + } +} + +struct ItemView2: View { + var data: [Double] + + + var body: some View { + RoundedRectangle(cornerRadius: 15) + .foregroundColor(Color(.secondarySystemBackground)) + .frame(width: 205, height: 230) + .overlay( + VStack(alignment: .leading) { + Group { + Text("AAPL") + .font(.title2) + .fontWeight(.semibold) + .padding(.top) + + Text("Apple Inc") + .font(.headline) + + } + .padding(.leading) + ChartView(data: data, dates: nil, hours: nil) + .padding(.bottom) + .clipShape(RoundedRectangle(cornerRadius: 15)) + } + ) + } +}