Mercurial > public > lazybear
changeset 123:a1acd9f4e8c8
Update assets
line wrap: on
line diff
--- a/LazyBear.xcodeproj/project.pbxproj Sat Feb 06 17:45:04 2021 +0100 +++ b/LazyBear.xcodeproj/project.pbxproj Sat Feb 06 20:53:28 2021 +0100 @@ -46,11 +46,11 @@ 95E411A725BEE03000A9C23F /* Watchlist.swift in Sources */ = {isa = PBXBuildFile; fileRef = 95E411A625BEE03000A9C23F /* Watchlist.swift */; }; 95E411B625BEE84E00A9C23F /* Stock.swift in Sources */ = {isa = PBXBuildFile; fileRef = 95E411B525BEE84E00A9C23F /* Stock.swift */; }; 95E411BE25BEEA6C00A9C23F /* WatchlistRow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 95E411BD25BEEA6C00A9C23F /* WatchlistRow.swift */; }; - 95ED176125CEF14E00AE34B3 /* RecentSearches.swift in Sources */ = {isa = PBXBuildFile; fileRef = 95ED176025CEF14E00AE34B3 /* RecentSearches.swift */; }; 95ED176B25CEFE1B00AE34B3 /* RecentSearch+CoreDataClass.swift in Sources */ = {isa = PBXBuildFile; fileRef = 95ED176925CEFE1B00AE34B3 /* RecentSearch+CoreDataClass.swift */; }; 95ED176C25CEFE1B00AE34B3 /* RecentSearch+CoreDataProperties.swift in Sources */ = {isa = PBXBuildFile; fileRef = 95ED176A25CEFE1B00AE34B3 /* RecentSearch+CoreDataProperties.swift */; }; 95F6C2F025BAE2ED003CF389 /* Company.swift in Sources */ = {isa = PBXBuildFile; fileRef = 95F6C2EF25BAE2ED003CF389 /* Company.swift */; }; 95F6C30925BAF7C2003CF389 /* DateSelection.swift in Sources */ = {isa = PBXBuildFile; fileRef = 95F6C30825BAF7C2003CF389 /* DateSelection.swift */; }; + 95F6CA0525CF2A4E0064E4E9 /* ViewSelector.swift in Sources */ = {isa = PBXBuildFile; fileRef = 95F6CA0425CF2A4E0064E4E9 /* ViewSelector.swift */; }; 95F6F45C25C20D8D002AC66A /* Price.swift in Sources */ = {isa = PBXBuildFile; fileRef = 95F6F45B25C20D8D002AC66A /* Price.swift */; }; 95F7CAF625ADC7B7009E0E7C /* LazyBear.xcdatamodeld in Sources */ = {isa = PBXBuildFile; fileRef = 95F7CAF425ADC7B7009E0E7C /* LazyBear.xcdatamodeld */; }; 95FE646725C2DC580052832E /* WatchlistCompany+CoreDataClass.swift in Sources */ = {isa = PBXBuildFile; fileRef = 95FE646525C2DC570052832E /* WatchlistCompany+CoreDataClass.swift */; }; @@ -100,11 +100,11 @@ 95E411A625BEE03000A9C23F /* Watchlist.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Watchlist.swift; sourceTree = "<group>"; }; 95E411B525BEE84E00A9C23F /* Stock.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Stock.swift; sourceTree = "<group>"; }; 95E411BD25BEEA6C00A9C23F /* WatchlistRow.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WatchlistRow.swift; sourceTree = "<group>"; }; - 95ED176025CEF14E00AE34B3 /* RecentSearches.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = RecentSearches.swift; path = lazybear/Views/RecentSearches.swift; sourceTree = SOURCE_ROOT; }; 95ED176925CEFE1B00AE34B3 /* RecentSearch+CoreDataClass.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "RecentSearch+CoreDataClass.swift"; sourceTree = "<group>"; }; 95ED176A25CEFE1B00AE34B3 /* RecentSearch+CoreDataProperties.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "RecentSearch+CoreDataProperties.swift"; sourceTree = "<group>"; }; 95F6C2EF25BAE2ED003CF389 /* Company.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Company.swift; sourceTree = "<group>"; }; 95F6C30825BAF7C2003CF389 /* DateSelection.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DateSelection.swift; sourceTree = "<group>"; }; + 95F6CA0425CF2A4E0064E4E9 /* ViewSelector.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = ViewSelector.swift; path = lazybear/Views/ViewSelector.swift; sourceTree = SOURCE_ROOT; }; 95F6F45B25C20D8D002AC66A /* Price.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Price.swift; sourceTree = "<group>"; }; 95F7CAF525ADC7B7009E0E7C /* LazyBear.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = LazyBear.xcdatamodel; sourceTree = "<group>"; }; 95FE646525C2DC570052832E /* WatchlistCompany+CoreDataClass.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "WatchlistCompany+CoreDataClass.swift"; sourceTree = "<group>"; }; @@ -245,7 +245,6 @@ 95E07B6D25CE95A1001718AB /* Search.swift */, 95612C4F2598D48200F7698F /* SearchBar.swift */, 95AB4A8F259DD66D0064C9C1 /* CompanyRow.swift */, - 95ED176025CEF14E00AE34B3 /* RecentSearches.swift */, ); name = Search; sourceTree = "<group>"; @@ -273,6 +272,7 @@ isa = PBXGroup; children = ( 95F6C2EF25BAE2ED003CF389 /* Company.swift */, + 95F6CA0425CF2A4E0064E4E9 /* ViewSelector.swift */, 95E07B9725CEABD4001718AB /* Stock */, 95E07B9525CEABC8001718AB /* News */, 95E07B9B25CEABFC001718AB /* Insiders */, @@ -403,7 +403,6 @@ 95FE646B25C30B880052832E /* ApiModel.swift in Sources */, 95B3552F25CD629F00BCDE8E /* TransactionCodes.swift in Sources */, 95612C512598D48200F7698F /* SearchBar.swift in Sources */, - 95ED176125CEF14E00AE34B3 /* RecentSearches.swift in Sources */, 95E411BE25BEEA6C00A9C23F /* WatchlistRow.swift in Sources */, 95078FD125BF4E640004FA75 /* CloudKitManager.swift in Sources */, 95B04EB525212369000AD27F /* ContentView.swift in Sources */, @@ -422,6 +421,7 @@ 95AB4A7D259DCC0C0064C9C1 /* CompanyModel.swift in Sources */, 95E411B625BEE84E00A9C23F /* Stock.swift in Sources */, 9520F0B225C712D000692610 /* LineChartShape.swift in Sources */, + 95F6CA0525CF2A4E0064E4E9 /* ViewSelector.swift in Sources */, 95E07BA325CEAC7D001718AB /* Transactions.swift in Sources */, 954D992525A2123B001F7F60 /* HistoricalPricesModel.swift in Sources */, 95FE646725C2DC580052832E /* WatchlistCompany+CoreDataClass.swift in Sources */,
Binary file LazyBear.xcodeproj/project.xcworkspace/xcuserdata/dennis.xcuserdatad/UserInterfaceState.xcuserstate has changed
--- a/lazybear/Assets.xcassets/AppIcon.appiconset/Contents.json Sat Feb 06 17:45:04 2021 +0100 +++ b/lazybear/Assets.xcassets/AppIcon.appiconset/Contents.json Sat Feb 06 20:53:28 2021 +0100 @@ -1,109 +1,109 @@ { "images" : [ { - "filename" : "40.png", + "filename" : "Icon-App-40x40-1.png", "idiom" : "iphone", "scale" : "2x", "size" : "20x20" }, { - "filename" : "60.png", + "filename" : "Icon-App-20x20@3x.png", "idiom" : "iphone", "scale" : "3x", "size" : "20x20" }, { - "filename" : "58.png", + "filename" : "Icon-App-29x29@2x-1.png", "idiom" : "iphone", "scale" : "2x", "size" : "29x29" }, { - "filename" : "87.png", + "filename" : "Icon-App-29x29@3x.png", "idiom" : "iphone", "scale" : "3x", "size" : "29x29" }, { - "filename" : "80.png", + "filename" : "Icon-App-40x40@2x-1.png", "idiom" : "iphone", "scale" : "2x", "size" : "40x40" }, { - "filename" : "120.png", + "filename" : "Icon-App-40x40@3x.png", "idiom" : "iphone", "scale" : "3x", "size" : "40x40" }, { - "filename" : "120-1.png", + "filename" : "Icon-App-60x60@2x.png", "idiom" : "iphone", "scale" : "2x", "size" : "60x60" }, { - "filename" : "180.png", + "filename" : "Icon-App-60x60@3x.png", "idiom" : "iphone", "scale" : "3x", "size" : "60x60" }, { - "filename" : "20.png", + "filename" : "Icon-App-20x20.png", "idiom" : "ipad", "scale" : "1x", "size" : "20x20" }, { - "filename" : "40-1.png", + "filename" : "Icon-App-20x20@2x.png", "idiom" : "ipad", "scale" : "2x", "size" : "20x20" }, { - "filename" : "29.png", + "filename" : "Icon-App-29x29.png", "idiom" : "ipad", "scale" : "1x", "size" : "29x29" }, { - "filename" : "58-1.png", + "filename" : "Icon-App-29x29@2x.png", "idiom" : "ipad", "scale" : "2x", "size" : "29x29" }, { - "filename" : "40-2.png", + "filename" : "Icon-App-40x40.png", "idiom" : "ipad", "scale" : "1x", "size" : "40x40" }, { - "filename" : "80-1.png", + "filename" : "Icon-App-40x40@2x.png", "idiom" : "ipad", "scale" : "2x", "size" : "40x40" }, { - "filename" : "76.png", + "filename" : "Icon-App-76x76.png", "idiom" : "ipad", "scale" : "1x", "size" : "76x76" }, { - "filename" : "152.png", + "filename" : "Icon-App-76x76@2x.png", "idiom" : "ipad", "scale" : "2x", "size" : "76x76" }, { - "filename" : "167.png", + "filename" : "Icon-App-83.5x83.5@2x.png", "idiom" : "ipad", "scale" : "2x", "size" : "83.5x83.5" }, { - "filename" : "1024.png", + "filename" : "icon-app-itunes-1024x1024.png", "idiom" : "ios-marketing", "scale" : "1x", "size" : "1024x1024"
--- a/lazybear/ContentView.swift Sat Feb 06 17:45:04 2021 +0100 +++ b/lazybear/ContentView.swift Sat Feb 06 20:53:28 2021 +0100 @@ -31,11 +31,11 @@ } // Third view - //Settings() - //.tabItem { - //Image(systemName: "gear") - //Text("Settings") - //} + Settings() + .tabItem { + Image(systemName: "gear") + Text("Settings") + } } } }
--- a/lazybear/Views/Company.swift Sat Feb 06 17:45:04 2021 +0100 +++ b/lazybear/Views/Company.swift Sat Feb 06 20:53:28 2021 +0100 @@ -26,7 +26,7 @@ .onAppear { saveSearch(name: name, symbol: symbol) } } } - .navigationBarTitle(symbol, displayMode: .large) + .navigationBarTitle(symbol, displayMode: .inline) .navigationBarItems(trailing: AddWatchlist(symbol: symbol, name: name)) }
--- a/lazybear/Views/News.swift Sat Feb 06 17:45:04 2021 +0100 +++ b/lazybear/Views/News.swift Sat Feb 06 20:53:28 2021 +0100 @@ -19,14 +19,13 @@ // <--------- API Job ---------> var body: some View { - Text("Business news") - .font(.title) - .fontWeight(.semibold) - .padding([.leading, .top]) - - Divider() - VStack { + Text("Business news") + .font(.title) + .fontWeight(.semibold) + .padding([.leading, .top]) + + Divider() ForEach(news, id: \.self) { new in NewsRow(new: new) }
--- a/lazybear/Views/NewsDetail.swift Sat Feb 06 17:45:04 2021 +0100 +++ b/lazybear/Views/NewsDetail.swift Sat Feb 06 20:53:28 2021 +0100 @@ -10,33 +10,40 @@ struct NewsDetail: View { @State var new: NewsModel + @Environment(\.presentationMode) var newsDetailMode var body: some View { - - VStack(alignment: .leading) { - Text(new.source ?? "-") - .font(.caption2) - - Text(new.headline ?? "-") - .font(.title) - .fontWeight(.semibold) - - ScrollView { - VStack(alignment: .leading) { - WebImage(url: URL(string: new.image ?? "")) - .resizable() - .indicator(.activity) - .scaledToFit() - - Divider() - Text(new.summary ?? "-") - Link("Read the full article", destination: URL(string: new.url ?? "")!) - .padding(.top) + NavigationView { + VStack(alignment: .leading) { + Text(new.headline ?? "-") + .font(.title) + .fontWeight(.semibold) + + Divider() + + ScrollView { + VStack(alignment: .leading) { + WebImage(url: URL(string: new.image ?? "")) + .resizable() + .indicator(.activity) + .scaledToFit() + + Divider() + Text(new.summary ?? "-") + Link("Read the full article", destination: URL(string: new.url ?? "")!) + .padding(.top) + } + } - + } + .padding() + .navigationBarTitle(new.source ?? "-", displayMode: .inline) + .toolbar { + Button(action: { self.newsDetailMode.wrappedValue.dismiss() }) { + Image(systemName: "multiply") + } } } - .padding() } }
--- a/lazybear/Views/RecentSearches.swift Sat Feb 06 17:45:04 2021 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,23 +0,0 @@ -// -// RecentSearches.swift -// LazyBear -// -// Created by Dennis Concepción Martín on 6/2/21. -// - -import SwiftUI - -struct RecentSearches: View { - var body: some View { - VStack { - Text("Recent searches") - .fontWeight(.semibold) - } - } -} - -struct RecentSearches_Previews: PreviewProvider { - static var previews: some View { - RecentSearches() - } -}
--- a/lazybear/Views/Search.swift Sat Feb 06 17:45:04 2021 +0100 +++ b/lazybear/Views/Search.swift Sat Feb 06 20:53:28 2021 +0100 @@ -22,6 +22,7 @@ NavigationView { VStack { SearchBar(searchedText: $searchedCompany) + // Searched companies List { if searchedCompany.count > 2 { ForEach(companiesData.filter({ searchedCompany.isEmpty ? true : $0.name.localizedStandardContains(searchedCompany) }), id: \.symbol) { company in @@ -30,6 +31,7 @@ .environmentObject(apiAccess) // Api info (url and token) } } else { + // Historial if searches.count > 0 { Section(header: Text("History"), footer: Button(action: { delete() }) { Text("Clear history").foregroundColor(.blue)}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lazybear/Views/ViewSelector.swift Sat Feb 06 20:53:28 2021 +0100 @@ -0,0 +1,20 @@ +// +// ViewSelector.swift +// LazyBear +// +// Created by Dennis Concepción Martín on 6/2/21. +// + +import SwiftUI + +struct ViewSelector: View { + var body: some View { + Text(/*@START_MENU_TOKEN@*/"Hello, World!"/*@END_MENU_TOKEN@*/) + } +} + +struct ViewSelector_Previews: PreviewProvider { + static var previews: some View { + ViewSelector() + } +}