changeset 226:dac0c8a7d92d

Fix bug Language CloudKit
author Dennis Concepción Martín <66180929+denniscm190@users.noreply.github.com>
date Sun, 28 Feb 2021 18:10:32 +0000
parents 1c541670fee7
children aff36490ae4d
files LazyBear.xcodeproj/project.pbxproj LazyBear.xcodeproj/project.xcworkspace/xcuserdata/dennis.xcuserdatad/UserInterfaceState.xcuserstate LazyBear/UI/NewsLanguagePicker.swift LazyBear/UI/Search.swift LazyBear/UI/Settings.swift LazyBear/UI/Watchlist.swift
diffstat 6 files changed, 14 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/LazyBear.xcodeproj/project.pbxproj	Sun Feb 28 18:10:12 2021 +0000
+++ b/LazyBear.xcodeproj/project.pbxproj	Sun Feb 28 18:10:32 2021 +0000
@@ -7,6 +7,7 @@
 	objects = {
 
 /* Begin PBXBuildFile section */
+		9508479A25EBD340000106A9 /* TestPullScroll.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9508479925EBD340000106A9 /* TestPullScroll.swift */; };
 		950B674925E99FA900BF8593 /* IconPicker.swift in Sources */ = {isa = PBXBuildFile; fileRef = 950B674825E99FA900BF8593 /* IconPicker.swift */; };
 		950B674C25E9A03E00BF8593 /* alternativeIcons.json in Resources */ = {isa = PBXBuildFile; fileRef = 950B674B25E9A03E00BF8593 /* alternativeIcons.json */; };
 		950B674F25E9A0AE00BF8593 /* IconModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 950B674E25E9A0AE00BF8593 /* IconModel.swift */; };
@@ -23,7 +24,6 @@
 		958A734225E00C9900FD7ECA /* Watchlist.swift in Sources */ = {isa = PBXBuildFile; fileRef = 958A734125E00C9900FD7ECA /* Watchlist.swift */; };
 		958A734525E00D3D00FD7ECA /* CompanyRow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 958A734425E00D3D00FD7ECA /* CompanyRow.swift */; };
 		958A734925E010F900FD7ECA /* Search.swift in Sources */ = {isa = PBXBuildFile; fileRef = 958A734825E010F900FD7ECA /* Search.swift */; };
-		958A734C25E010FF00FD7ECA /* SearchBar.swift in Sources */ = {isa = PBXBuildFile; fileRef = 958A734B25E010FF00FD7ECA /* SearchBar.swift */; };
 		958A735225E0170900FD7ECA /* CloudKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 958A735125E0170900FD7ECA /* CloudKit.framework */; };
 		958A735725E01F9E00FD7ECA /* ReadJson.swift in Sources */ = {isa = PBXBuildFile; fileRef = 958A735625E01F9E00FD7ECA /* ReadJson.swift */; };
 		958A735B25E0264E00FD7ECA /* CompanyModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 958A735A25E0264E00FD7ECA /* CompanyModel.swift */; };
@@ -54,6 +54,7 @@
 /* End PBXBuildFile section */
 
 /* Begin PBXFileReference section */
+		9508479925EBD340000106A9 /* TestPullScroll.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TestPullScroll.swift; sourceTree = "<group>"; };
 		950B674825E99FA900BF8593 /* IconPicker.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = IconPicker.swift; sourceTree = "<group>"; };
 		950B674B25E9A03E00BF8593 /* alternativeIcons.json */ = {isa = PBXFileReference; lastKnownFileType = text.json; path = alternativeIcons.json; sourceTree = "<group>"; };
 		950B674E25E9A0AE00BF8593 /* IconModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = IconModel.swift; sourceTree = "<group>"; };
@@ -73,7 +74,6 @@
 		958A734125E00C9900FD7ECA /* Watchlist.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Watchlist.swift; sourceTree = "<group>"; };
 		958A734425E00D3D00FD7ECA /* CompanyRow.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CompanyRow.swift; sourceTree = "<group>"; };
 		958A734825E010F900FD7ECA /* Search.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Search.swift; sourceTree = "<group>"; };
-		958A734B25E010FF00FD7ECA /* SearchBar.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SearchBar.swift; sourceTree = "<group>"; };
 		958A734E25E016FD00FD7ECA /* LazyBear.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = LazyBear.entitlements; sourceTree = "<group>"; };
 		958A735125E0170900FD7ECA /* CloudKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CloudKit.framework; path = System/Library/Frameworks/CloudKit.framework; sourceTree = SDKROOT; };
 		958A735625E01F9E00FD7ECA /* ReadJson.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReadJson.swift; sourceTree = "<group>"; };
@@ -120,6 +120,7 @@
 		950BA46D25E9450B00D065EF /* Tests */ = {
 			isa = PBXGroup;
 			children = (
+				9508479925EBD340000106A9 /* TestPullScroll.swift */,
 			);
 			path = Tests;
 			sourceTree = "<group>";
@@ -213,7 +214,6 @@
 				958A734125E00C9900FD7ECA /* Watchlist.swift */,
 				958A734425E00D3D00FD7ECA /* CompanyRow.swift */,
 				958A734825E010F900FD7ECA /* Search.swift */,
-				958A734B25E010FF00FD7ECA /* SearchBar.swift */,
 				958A735E25E0311B00FD7ECA /* Settings.swift */,
 				95F0460725E9704F006A5A17 /* ThemePicker.swift */,
 				95F0460A25E970DB006A5A17 /* NewsLanguagePicker.swift */,
@@ -337,6 +337,7 @@
 				95B3E09F25E127D7007EFDE3 /* Request.swift in Sources */,
 				95F045FE25E96AA1006A5A17 /* NewsLanguageModel.swift in Sources */,
 				95BFAE5425E2C52300A70EC3 /* HistoricalPriceModel.swift in Sources */,
+				9508479A25EBD340000106A9 /* TestPullScroll.swift in Sources */,
 				95BFAE5825E2C5A700A70EC3 /* HistoricalPriceView.swift in Sources */,
 				9549D63625E191520085C3CD /* Normalize.swift in Sources */,
 				95672B9125DDA54700DCBE4A /* ContentView.swift in Sources */,
@@ -348,7 +349,6 @@
 				958A734525E00D3D00FD7ECA /* CompanyRow.swift in Sources */,
 				95ABDD3525E166BA00310776 /* NewsView.swift in Sources */,
 				95672B9B25DDA54800DCBE4A /* LazyBear.xcdatamodeld in Sources */,
-				958A734C25E010FF00FD7ECA /* SearchBar.swift in Sources */,
 				95F0460B25E970DB006A5A17 /* NewsLanguagePicker.swift in Sources */,
 				95ABDD3125E1602D00310776 /* PriceView.swift in Sources */,
 				95BFAE4B25E2AEA000A70EC3 /* HUD.swift in Sources */,
Binary file LazyBear.xcodeproj/project.xcworkspace/xcuserdata/dennis.xcuserdatad/UserInterfaceState.xcuserstate has changed
--- a/LazyBear/UI/NewsLanguagePicker.swift	Sun Feb 28 18:10:12 2021 +0000
+++ b/LazyBear/UI/NewsLanguagePicker.swift	Sun Feb 28 18:10:32 2021 +0000
@@ -13,9 +13,9 @@
     
     var body: some View {
         Picker("News language", selection: $language) {
-            ForEach(newsLanguages, id: \.self) { language in
+            ForEach(newsLanguages, id: \.name) { language in
                 Text("\(language.flag) \(language.name)")
-                    .tag(language.code)
+                    .tag(language.name)
             }
         }
         .onChange(of: language, perform: { language in
--- a/LazyBear/UI/Search.swift	Sun Feb 28 18:10:12 2021 +0000
+++ b/LazyBear/UI/Search.swift	Sun Feb 28 18:10:32 2021 +0000
@@ -16,6 +16,9 @@
     var body: some View {
         NavigationView {
             let colorNumber = ["1", "2", "3", "4", "5"]
+            // Iterate over and over through this list to print the color for every row
+            // Color names are from 1 to 5
+            
             let list = filterList()
             List(list.indices, id: \.self) { i in
                 let name = list[i].securityName ?? "-"
@@ -23,6 +26,7 @@
                 NavigationLink(destination: CompanyView(hudManager: hudManager, name: name, symbol: symbol)
                                 .navigationTitle(symbol)
                 ) {
+                    // Pass color number to the row
                     CompanyRow(symbol: symbol, name: name, rowNumber: i % colorNumber.count)
                 }
             }
--- a/LazyBear/UI/Settings.swift	Sun Feb 28 18:10:12 2021 +0000
+++ b/LazyBear/UI/Settings.swift	Sun Feb 28 18:10:32 2021 +0000
@@ -19,7 +19,7 @@
         NavigationView {
             Form {
                 let theme = userSettings.first?.theme ?? "Default"
-                let language = userSettings.first?.newsLanguage ?? "en"
+                let language = userSettings.first?.newsLanguage ?? "English"
                 ThemePicker(theme: theme)
                 NewsLanguagePicker(language: language)
                 NavigationLink(destination: IconPicker()) {
--- a/LazyBear/UI/Watchlist.swift	Sun Feb 28 18:10:12 2021 +0000
+++ b/LazyBear/UI/Watchlist.swift	Sun Feb 28 18:10:32 2021 +0000
@@ -15,6 +15,8 @@
     
     var body: some View {
         NavigationView {
+            // Iterate over and over through this list to print the color for every row
+            // Color names are from 1 to 5
             let colorNumber = ["1", "2", "3", "4", "5"]
             List {
                 ForEach(companies.indices) { i in
@@ -23,6 +25,7 @@
                     NavigationLink(destination: CompanyView(hudManager: hudManager, name: name, symbol: symbol)
                                     .navigationTitle(symbol)
                     ) {
+                        // Pass color number to the row
                         CompanyRow(symbol: symbol, name: name, rowNumber: i % colorNumber.count)
                     }
                 }