Mercurial > public > lazybear
changeset 428:8c58ce834d95
Bug fixes and change assets
line wrap: on
line diff
--- a/LazyBear.xcodeproj/project.pbxproj Wed Jun 16 13:46:40 2021 +0200 +++ b/LazyBear.xcodeproj/project.pbxproj Fri Jun 18 12:43:17 2021 +0200 @@ -32,9 +32,12 @@ 951566EA2613A37C007C0F36 /* TradingDatesItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = 951566E92613A37C007C0F36 /* TradingDatesItem.swift */; }; 952045152610C7C600A76362 /* ConvertEpoch.swift in Sources */ = {isa = PBXBuildFile; fileRef = 952045142610C7C600A76362 /* ConvertEpoch.swift */; }; 9523ED422615BDB2006D3D6F /* phrases.json in Resources */ = {isa = PBXBuildFile; fileRef = 9523ED412615BDB2006D3D6F /* phrases.json */; }; - 9526E56B266D34DF004B84EF /* StockCharts in Frameworks */ = {isa = PBXBuildFile; productRef = 9526E56A266D34DF004B84EF /* StockCharts */; }; 9529947E2629CA3E005F0AB0 /* Search.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9529947D2629CA3E005F0AB0 /* Search.swift */; }; 952994822629CA46005F0AB0 /* SearchResponse.swift in Sources */ = {isa = PBXBuildFile; fileRef = 952994812629CA46005F0AB0 /* SearchResponse.swift */; }; + 952FC0B6267C93AE001406B1 /* ToolbarMenu.swift in Sources */ = {isa = PBXBuildFile; fileRef = 952FC0B5267C93AE001406B1 /* ToolbarMenu.swift */; }; + 952FC0B8267C97BA001406B1 /* WatchlistSheetRow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 952FC0B7267C97BA001406B1 /* WatchlistSheetRow.swift */; }; + 952FC0BA267C9A24001406B1 /* RenameListSheet.swift in Sources */ = {isa = PBXBuildFile; fileRef = 952FC0B9267C9A24001406B1 /* RenameListSheet.swift */; }; + 954572EC267A3D6A00C33A20 /* StockCharts in Frameworks */ = {isa = PBXBuildFile; productRef = 954572EB267A3D6A00C33A20 /* StockCharts */; }; 954D7EC2260BE70C00A13C50 /* SwiftlySearch in Frameworks */ = {isa = PBXBuildFile; productRef = 954D7EC1260BE70C00A13C50 /* SwiftlySearch */; }; 9550443A26111B2B000E0BCB /* HomeView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9550443926111B2B000E0BCB /* HomeView.swift */; }; 9550444326111E7A000E0BCB /* SectorRow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9550444226111E7A000E0BCB /* SectorRow.swift */; }; @@ -74,7 +77,6 @@ 95AF0FF72671320F0049C4AB /* DisplayWords.json in Resources */ = {isa = PBXBuildFile; fileRef = 95AF0FF62671320F0049C4AB /* DisplayWords.json */; }; 95AF0FF92671342E0049C4AB /* DisplayWordsModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 95AF0FF82671342E0049C4AB /* DisplayWordsModel.swift */; }; 95BB05B22670B8C3005A2029 /* KeyStatsModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 95BB05B12670B8C3005A2029 /* KeyStatsModel.swift */; }; - 95BD2FAE26341BD1008B6752 /* TextfieldAlert.swift in Sources */ = {isa = PBXBuildFile; fileRef = 95BD2FAD26341BD1008B6752 /* TextfieldAlert.swift */; }; 95BD2FB326341D36008B6752 /* BlurBackground.swift in Sources */ = {isa = PBXBuildFile; fileRef = 95BD2FB226341D36008B6752 /* BlurBackground.swift */; }; 95C22F3F26776F010014C98A /* CompanyModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 95C22F3E26776F010014C98A /* CompanyModel.swift */; }; 95C6CCD92670C3BB00E60517 /* StatsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 95C6CCD82670C3BB00E60517 /* StatsView.swift */; }; @@ -143,6 +145,9 @@ 9523ED412615BDB2006D3D6F /* phrases.json */ = {isa = PBXFileReference; lastKnownFileType = text.json; path = phrases.json; sourceTree = "<group>"; }; 9529947D2629CA3E005F0AB0 /* Search.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Search.swift; sourceTree = "<group>"; }; 952994812629CA46005F0AB0 /* SearchResponse.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SearchResponse.swift; sourceTree = "<group>"; }; + 952FC0B5267C93AE001406B1 /* ToolbarMenu.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ToolbarMenu.swift; sourceTree = "<group>"; }; + 952FC0B7267C97BA001406B1 /* WatchlistSheetRow.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WatchlistSheetRow.swift; sourceTree = "<group>"; }; + 952FC0B9267C9A24001406B1 /* RenameListSheet.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RenameListSheet.swift; sourceTree = "<group>"; }; 9550443926111B2B000E0BCB /* HomeView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HomeView.swift; sourceTree = "<group>"; }; 9550444226111E7A000E0BCB /* SectorRow.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SectorRow.swift; sourceTree = "<group>"; }; 9550444526111EE5000E0BCB /* SectorItem.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SectorItem.swift; sourceTree = "<group>"; }; @@ -183,7 +188,6 @@ 95AF0FF62671320F0049C4AB /* DisplayWords.json */ = {isa = PBXFileReference; lastKnownFileType = text.json; path = DisplayWords.json; sourceTree = "<group>"; }; 95AF0FF82671342E0049C4AB /* DisplayWordsModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DisplayWordsModel.swift; sourceTree = "<group>"; }; 95BB05B12670B8C3005A2029 /* KeyStatsModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KeyStatsModel.swift; sourceTree = "<group>"; }; - 95BD2FAD26341BD1008B6752 /* TextfieldAlert.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TextfieldAlert.swift; sourceTree = "<group>"; }; 95BD2FB226341D36008B6752 /* BlurBackground.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BlurBackground.swift; sourceTree = "<group>"; }; 95C22F3E26776F010014C98A /* CompanyModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CompanyModel.swift; sourceTree = "<group>"; }; 95C6CCD82670C3BB00E60517 /* StatsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StatsView.swift; sourceTree = "<group>"; }; @@ -225,9 +229,9 @@ files = ( 950857A7266BD12D005357BA /* BetterSafariView in Frameworks */, 958A735225E0170900FD7ECA /* CloudKit.framework in Frameworks */, - 9526E56B266D34DF004B84EF /* StockCharts in Frameworks */, 950B6F3F267643640029E447 /* StoreKit.framework in Frameworks */, 9594331326691789004A0339 /* Bazooka in Frameworks */, + 954572EC267A3D6A00C33A20 /* StockCharts in Frameworks */, 95A4B933263E9F810056F036 /* Introspect in Frameworks */, 950B6F3D267643460029E447 /* Purchases in Frameworks */, 954D7EC2260BE70C00A13C50 /* SwiftlySearch in Frameworks */, @@ -464,13 +468,15 @@ 95BD2F91263418F7008B6752 /* Helpers */ = { isa = PBXGroup; children = ( - 95BD2FAD26341BD1008B6752 /* TextfieldAlert.swift */, 9562404B263C766D00C6C511 /* WatchlistCreator.swift */, 9562404D263C7D8800C6C511 /* WatchlistCreatorClass.swift */, 95A4B92F263E9F530056F036 /* WatchlistCreatorList.swift */, 95A4B934263EA31C0056F036 /* WatchlistCreatorSearchBar.swift */, 95A4B936263EA5C20056F036 /* WatchlistCreatorRow.swift */, 95131D4A267A15490055C6DE /* WatchlistSheet.swift */, + 952FC0B7267C97BA001406B1 /* WatchlistSheetRow.swift */, + 952FC0B5267C93AE001406B1 /* ToolbarMenu.swift */, + 952FC0B9267C9A24001406B1 /* RenameListSheet.swift */, ); path = Helpers; sourceTree = "<group>"; @@ -589,8 +595,8 @@ 95A4B932263E9F810056F036 /* Introspect */, 9594331226691789004A0339 /* Bazooka */, 950857A6266BD12D005357BA /* BetterSafariView */, - 9526E56A266D34DF004B84EF /* StockCharts */, 950B6F3C267643460029E447 /* Purchases */, + 954572EB267A3D6A00C33A20 /* StockCharts */, ); productName = LazyBear; productReference = 95672B8B25DDA54700DCBE4A /* LazyBear.app */; @@ -632,8 +638,8 @@ 95A4B931263E9F810056F036 /* XCRemoteSwiftPackageReference "SwiftUI-Introspect" */, 9594331126691789004A0339 /* XCRemoteSwiftPackageReference "Bazooka" */, 950857A5266BD12D005357BA /* XCRemoteSwiftPackageReference "BetterSafariView" */, - 9526E569266D34DF004B84EF /* XCRemoteSwiftPackageReference "StockCharts" */, 950B6F3B267643460029E447 /* XCRemoteSwiftPackageReference "purchases-ios" */, + 954572EA267A3D6A00C33A20 /* XCRemoteSwiftPackageReference "StockCharts" */, ); productRefGroup = 95672B8C25DDA54700DCBE4A /* Products */; projectDirPath = ""; @@ -700,11 +706,13 @@ 95131D46267A03020055C6DE /* WatchlistCompany+CoreDataProperties.swift in Sources */, 950C36E3260FB6180081CF53 /* HapticsManager.swift in Sources */, 95FBE0DC2619CA7200440386 /* ProfileView.swift in Sources */, + 952FC0B6267C93AE001406B1 /* ToolbarMenu.swift in Sources */, 95131D4B267A15490055C6DE /* WatchlistSheet.swift in Sources */, 95CCFB5C266E842000C384A1 /* TransactionList.swift in Sources */, 95613AE1264FD34100D4CE8F /* NewsRow.swift in Sources */, 95613ADD264FC6A200D4CE8F /* ChartResponse.swift in Sources */, 9550444926111FC9000E0BCB /* StockRow.swift in Sources */, + 952FC0B8267C97BA001406B1 /* WatchlistSheetRow.swift in Sources */, 9550444326111E7A000E0BCB /* SectorRow.swift in Sources */, 95123ABE267669C6001BFAF3 /* StockSheetRow.swift in Sources */, 95613AD9264FC5A900D4CE8F /* Company.swift in Sources */, @@ -765,7 +773,7 @@ 9562404E263C7D8800C6C511 /* WatchlistCreatorClass.swift in Sources */, 950857D3266BE55F005357BA /* RowShape.swift in Sources */, 952045152610C7C600A76362 /* ConvertEpoch.swift in Sources */, - 95BD2FAE26341BD1008B6752 /* TextfieldAlert.swift in Sources */, + 952FC0BA267C9A24001406B1 /* RenameListSheet.swift in Sources */, 95CCFB60266E864C00C384A1 /* ConvertStringToDate.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; @@ -1090,12 +1098,12 @@ minimumVersion = 3.11.1; }; }; - 9526E569266D34DF004B84EF /* XCRemoteSwiftPackageReference "StockCharts" */ = { + 954572EA267A3D6A00C33A20 /* XCRemoteSwiftPackageReference "StockCharts" */ = { isa = XCRemoteSwiftPackageReference; repositoryURL = "https://github.com/denniscm190/StockCharts.git"; requirement = { kind = upToNextMajorVersion; - minimumVersion = 1.2.2; + minimumVersion = 1.2.3; }; }; 954D7EC0260BE70C00A13C50 /* XCRemoteSwiftPackageReference "SwiftlySearch" */ = { @@ -1135,9 +1143,9 @@ package = 950B6F3B267643460029E447 /* XCRemoteSwiftPackageReference "purchases-ios" */; productName = Purchases; }; - 9526E56A266D34DF004B84EF /* StockCharts */ = { + 954572EB267A3D6A00C33A20 /* StockCharts */ = { isa = XCSwiftPackageProductDependency; - package = 9526E569266D34DF004B84EF /* XCRemoteSwiftPackageReference "StockCharts" */; + package = 954572EA267A3D6A00C33A20 /* XCRemoteSwiftPackageReference "StockCharts" */; productName = StockCharts; }; 954D7EC1260BE70C00A13C50 /* SwiftlySearch */ = {
--- a/LazyBear.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved Wed Jun 16 13:46:40 2021 +0200 +++ b/LazyBear.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved Fri Jun 18 12:43:17 2021 +0200 @@ -33,8 +33,8 @@ "repositoryURL": "https://github.com/denniscm190/StockCharts.git", "state": { "branch": null, - "revision": "1fcfee1aa97771012f711306bf4a8334f442bcf6", - "version": "1.2.2" + "revision": "4911cd3aa1ab73545ff90553e4dd35513c9c47dd", + "version": "1.2.3" } }, {
Binary file LazyBear.xcodeproj/project.xcworkspace/xcuserdata/dennis.xcuserdatad/UserInterfaceState.xcuserstate has changed
--- a/LazyBear/Assets.xcassets/AppIcon.appiconset/Contents.json Wed Jun 16 13:46:40 2021 +0200 +++ b/LazyBear/Assets.xcassets/AppIcon.appiconset/Contents.json Fri Jun 18 12:43:17 2021 +0200 @@ -1,109 +1,109 @@ { "images" : [ { - "filename" : "Icon Small-40.png", + "filename" : "icon_20pt@2x-1.png", "idiom" : "iphone", "scale" : "2x", "size" : "20x20" }, { - "filename" : "Icon-20@3x.png", + "filename" : "icon_20pt@3x.png", "idiom" : "iphone", "scale" : "3x", "size" : "20x20" }, { - "filename" : "Icon Small@2x-1.png", + "filename" : "icon_29pt@2x.png", "idiom" : "iphone", "scale" : "2x", "size" : "29x29" }, { - "filename" : "Icon Small@3x.png", + "filename" : "icon_29pt@3x.png", "idiom" : "iphone", "scale" : "3x", "size" : "29x29" }, { - "filename" : "Icon Small-40@2x.png", + "filename" : "icon_40pt@2x.png", "idiom" : "iphone", "scale" : "2x", "size" : "40x40" }, { - "filename" : "Icon Small-40@3x.png", + "filename" : "icon_40pt@3x.png", "idiom" : "iphone", "scale" : "3x", "size" : "40x40" }, { - "filename" : "Icon-60@2x.png", + "filename" : "icon_60pt@2x.png", "idiom" : "iphone", "scale" : "2x", "size" : "60x60" }, { - "filename" : "Icon-60@3x.png", + "filename" : "icon_60pt@3x.png", "idiom" : "iphone", "scale" : "3x", "size" : "60x60" }, { - "filename" : "Icon-20.png", + "filename" : "icon_20pt.png", "idiom" : "ipad", "scale" : "1x", "size" : "20x20" }, { - "filename" : "Icon Small-41.png", + "filename" : "icon_20pt@2x.png", "idiom" : "ipad", "scale" : "2x", "size" : "20x20" }, { - "filename" : "Icon Small.png", + "filename" : "icon_29pt.png", "idiom" : "ipad", "scale" : "1x", "size" : "29x29" }, { - "filename" : "Icon Small@2x.png", + "filename" : "icon_29pt@2x-1.png", "idiom" : "ipad", "scale" : "2x", "size" : "29x29" }, { - "filename" : "Icon Small-42.png", + "filename" : "icon_40pt.png", "idiom" : "ipad", "scale" : "1x", "size" : "40x40" }, { - "filename" : "Icon Small-40@2x-1.png", + "filename" : "icon_40pt@2x-1.png", "idiom" : "ipad", "scale" : "2x", "size" : "40x40" }, { - "filename" : "Icon-76.png", + "filename" : "icon_76pt.png", "idiom" : "ipad", "scale" : "1x", "size" : "76x76" }, { - "filename" : "Icon-76@2x.png", + "filename" : "icon_76pt@2x.png", "idiom" : "ipad", "scale" : "2x", "size" : "76x76" }, { - "filename" : "Icon-83.5@2x.png", + "filename" : "icon_83.5@2x.png", "idiom" : "ipad", "scale" : "2x", "size" : "83.5x83.5" }, { - "filename" : "iTunes Artwork@2x.png", + "filename" : "Icon.png", "idiom" : "ios-marketing", "scale" : "1x", "size" : "1024x1024"
--- a/LazyBear/Assets.xcassets/Logos/LaunchLogo.imageset/Contents.json Wed Jun 16 13:46:40 2021 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,52 +0,0 @@ -{ - "images" : [ - { - "filename" : "LightMode.png", - "idiom" : "universal", - "scale" : "1x" - }, - { - "appearances" : [ - { - "appearance" : "luminosity", - "value" : "dark" - } - ], - "filename" : "DarkMode.png", - "idiom" : "universal", - "scale" : "1x" - }, - { - "idiom" : "universal", - "scale" : "2x" - }, - { - "appearances" : [ - { - "appearance" : "luminosity", - "value" : "dark" - } - ], - "idiom" : "universal", - "scale" : "2x" - }, - { - "idiom" : "universal", - "scale" : "3x" - }, - { - "appearances" : [ - { - "appearance" : "luminosity", - "value" : "dark" - } - ], - "idiom" : "universal", - "scale" : "3x" - } - ], - "info" : { - "author" : "xcode", - "version" : 1 - } -}
--- a/LazyBear/Assets.xcassets/Logos/default.imageset/Contents.json Wed Jun 16 13:46:40 2021 +0200 +++ b/LazyBear/Assets.xcassets/Logos/default.imageset/Contents.json Fri Jun 18 12:43:17 2021 +0200 @@ -1,15 +1,17 @@ { "images" : [ { - "filename" : "iTunes Artwork.png", + "filename" : "logo@1x.png", "idiom" : "universal", "scale" : "1x" }, { + "filename" : "logo@2x.png", "idiom" : "universal", "scale" : "2x" }, { + "filename" : "logo@3x.png", "idiom" : "universal", "scale" : "3x" }
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/LazyBear/Assets.xcassets/Logos/launchLogo.imageset/Contents.json Fri Jun 18 12:43:17 2021 +0200 @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "filename" : "launchLogo@1x.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "launchLogo@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "launchLogo@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +}
--- a/LazyBear/Assets.xcassets/Themes/Contents.json Wed Jun 16 13:46:40 2021 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,6 +0,0 @@ -{ - "info" : { - "author" : "xcode", - "version" : 1 - } -}
--- a/LazyBear/Assets.xcassets/Themes/default.colorset/Contents.json Wed Jun 16 13:46:40 2021 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,38 +0,0 @@ -{ - "colors" : [ - { - "color" : { - "color-space" : "srgb", - "components" : { - "alpha" : "1.000", - "blue" : "254", - "green" : "186", - "red" : "74" - } - }, - "idiom" : "universal" - }, - { - "appearances" : [ - { - "appearance" : "luminosity", - "value" : "dark" - } - ], - "color" : { - "color-space" : "srgb", - "components" : { - "alpha" : "1.000", - "blue" : "158", - "green" : "68", - "red" : "25" - } - }, - "idiom" : "universal" - } - ], - "info" : { - "author" : "xcode", - "version" : 1 - } -}
--- a/LazyBear/Assets.xcassets/Vectors/bearSleeping.imageset/Contents.json Wed Jun 16 13:46:40 2021 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,23 +0,0 @@ -{ - "images" : [ - { - "filename" : "bearSleeping.png", - "idiom" : "universal", - "scale" : "1x" - }, - { - "filename" : "bearSleeping@2x.png", - "idiom" : "universal", - "scale" : "2x" - }, - { - "filename" : "bearSleeping@3x.png", - "idiom" : "universal", - "scale" : "3x" - } - ], - "info" : { - "author" : "xcode", - "version" : 1 - } -}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/LazyBear/Assets.xcassets/Vectors/suitBear.imageset/Contents.json Fri Jun 18 12:43:17 2021 +0200 @@ -0,0 +1,56 @@ +{ + "images" : [ + { + "filename" : "lightSuitBear@1x.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "dark" + } + ], + "filename" : "darkSuitBear@1x.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "lightSuitBear@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "dark" + } + ], + "filename" : "darkSuitBear@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "lightSuitBear@3x.png", + "idiom" : "universal", + "scale" : "3x" + }, + { + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "dark" + } + ], + "filename" : "darkSuitBear@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +}
--- a/LazyBear/LaunchScreen.storyboard Wed Jun 16 13:46:40 2021 +0200 +++ b/LazyBear/LaunchScreen.storyboard Fri Jun 18 12:43:17 2021 +0200 @@ -16,13 +16,13 @@ <rect key="frame" x="0.0" y="0.0" width="414" height="896"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <subviews> - <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" image="LaunchLogo" translatesAutoresizingMaskIntoConstraints="NO" id="0zr-qc-AXd"> + <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" image="launchLogo" translatesAutoresizingMaskIntoConstraints="NO" id="0zr-qc-AXd" userLabel="default"> <rect key="frame" x="16" y="346" width="382" height="204"/> <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/> </imageView> </subviews> <viewLayoutGuide key="safeArea" id="Bcu-3y-fUS"/> - <color key="backgroundColor" name="LaunchBackground"/> + <color key="backgroundColor" name="launchBackground"/> </view> </viewController> <placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/> @@ -31,8 +31,8 @@ </scene> </scenes> <resources> - <image name="LaunchLogo" width="1024" height="1024"/> - <namedColor name="LaunchBackground"> + <image name="launchLogo" width="500" height="500"/> + <namedColor name="launchBackground"> <color red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> </namedColor> </resources>
--- a/LazyBear/Views/Global Helpers/RowShape.swift Wed Jun 16 13:46:40 2021 +0200 +++ b/LazyBear/Views/Global Helpers/RowShape.swift Fri Jun 18 12:43:17 2021 +0200 @@ -12,7 +12,7 @@ var body: some View { RoundedRectangle(cornerRadius: 25) - .foregroundColor(Color("CustomSecondaryBackground")) + .foregroundColor(Color("customSecondaryBackground")) .if(colorScheme == .light) { content in // Apply shadow only when is not dark mode content
--- a/LazyBear/Views/Home/Helpers/StockRow.swift Wed Jun 16 13:46:40 2021 +0200 +++ b/LazyBear/Views/Home/Helpers/StockRow.swift Fri Jun 18 12:43:17 2021 +0200 @@ -50,7 +50,7 @@ .padding(.bottom) .sheet(isPresented: $showList) { if showWatchlistSheet ?? false { - WatchlistSheet(listName: adaptListTitle(listName), companies: companies) + WatchlistSheet(listName: listName, apiCompanies: companies) .environment(\.managedObjectContext, self.moc) } else { StockSheet(listName: adaptListTitle(listName), companies: companies)
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/LazyBear/Views/Profile/Helpers/RenameListSheet.swift Fri Jun 18 12:43:17 2021 +0200 @@ -0,0 +1,69 @@ +// +// RenameListSheet.swift +// LazyBear +// +// Created by Dennis Concepción Martín on 18/6/21. +// + +import SwiftUI +import Introspect + +struct RenameListSheet: View { + var oldWatchlistName: String + @State private var newWatchlistName = String() + + @Environment(\.presentationMode) private var renameListSheetPresentationMode + @Environment(\.managedObjectContext) private var moc + @FetchRequest(entity: WatchlistCompany.entity(), sortDescriptors: []) + var watchlistCompanies: FetchedResults<WatchlistCompany> + + var body: some View { + NavigationView { + Form { + let header = "Need ideas? Try my portfolio, or banks" + Section(header: Text(header)) { + TextField("Enter a name", text: $newWatchlistName) + .introspectTextField { textField in + textField.becomeFirstResponder() + } + } + } + .navigationTitle("Rename your watchlist") + .toolbar { + ToolbarItem(placement: .navigationBarLeading) { + Button(action: { renameListSheetPresentationMode.wrappedValue.dismiss() }) { + Image(systemName: "multiply") + } + } + + ToolbarItem(placement: .navigationBarTrailing) { + if !newWatchlistName.isEmpty { + Button("Done", action: { renameWatchlist() }) + } + } + } + } + } + + /* + Rename watchlistName variable from each Core Data (WatchlistCompany) object + */ + private func renameWatchlist() { + for watchlistCompany in watchlistCompanies { + watchlistCompany.watchlistName = newWatchlistName + } + + do { + try moc.save() + renameListSheetPresentationMode.wrappedValue.dismiss() + } catch { + print(error.localizedDescription) + } + } +} + +struct RenameListSheet_Previews: PreviewProvider { + static var previews: some View { + RenameListSheet(oldWatchlistName: "Old name") + } +}
--- a/LazyBear/Views/Profile/Helpers/TextfieldAlert.swift Wed Jun 16 13:46:40 2021 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,108 +0,0 @@ -// -// TextfieldAlert.swift -// LazyBear -// -// Created by Dennis Concepción Martín on 24/4/21. -// - -import SwiftUI - -struct TextfieldAlert: View { - var watchlistName: String - - @State private var newListName: String = String() - @Binding var showRenameAction: Bool - @Binding var presentationMode: PresentationMode - - @Environment(\.managedObjectContext) private var moc - @FetchRequest(entity: WatchlistCompany.entity(), sortDescriptors: []) - var watchlistCompanies: FetchedResults<WatchlistCompany> - - var body: some View { - RoundedRectangle(cornerRadius: 15) - .frame(width: 280, height: 180) - .foregroundColor(Color(.secondarySystemBackground)) - .overlay( - VStack { - Text("Rename your list") - .font(.headline) - - Text("Enter a name") - .font(.callout) - - Spacer() - TextField("Technologies, banks...", text: $newListName) - .padding(7) - .background( - Color(.systemBackground) - .cornerRadius(7) - ) - - Divider() - - - /* - Cancel and Done buttons - */ - HStack { - Spacer() - Button(action: { - UIApplication.shared.endEditing() - self.showRenameAction = false - }) { - Text("Cancel") - .fontWeight(.semibold) - .foregroundColor(.red) - } - - Spacer() - Divider() - - Spacer() - Button(action: { renameList(newListName) }) { - Text("Done") - } - Spacer() - } - .frame(height: 25) - } - .padding() - ) - .background( - BlurBackground(style: .systemMaterial) - .clipShape(RoundedRectangle(cornerRadius: 15)) - ) - } - - /* - Rename watchlist name in Core Data - */ - private func renameList(_ newWatchlistName: String) { - let selectedWatchlist = watchlistCompanies.filter({ $0.watchlistName == watchlistName }) - for company in selectedWatchlist { - company.watchlistName = newWatchlistName - } - do { - try moc.save() - print("List updated") - UIApplication.shared.endEditing() /// Dismiss Keyboard - self.showRenameAction = false /// Dismiss action rename sheet - self.$presentationMode.wrappedValue.dismiss() /// Dismiss Modal View - } catch { - print(error.localizedDescription) - } - } -} -extension UIApplication { /// Dismiss Keyboard Extension - func endEditing() { - sendAction(#selector(UIResponder.resignFirstResponder), to: nil, from: nil, for: nil) - } -} - -struct RenameSheet_Previews: PreviewProvider { - @Environment(\.presentationMode) static var presentationMode - - static var previews: some View { - TextfieldAlert(watchlistName: "MyWatchlist", showRenameAction: .constant(true), presentationMode: presentationMode) - } -}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/LazyBear/Views/Profile/Helpers/ToolbarMenu.swift Fri Jun 18 12:43:17 2021 +0200 @@ -0,0 +1,44 @@ +// +// ToolbarMenu.swift +// LazyBear +// +// Created by Dennis Concepción Martín on 18/6/21. +// + +import SwiftUI + +struct ToolbarMenu: View { + @Binding var showRenameListSheet: Bool + @Binding var showDeleteListAlert: Bool + + @FetchRequest(entity: WatchlistCompany.entity(), sortDescriptors: []) + var watchlistCompany: FetchedResults<WatchlistCompany> + + var body: some View { + Menu { + Section { + Button(action: { showRenameListSheet = true }) { + Label("Rename list", systemImage: "square.and.pencil") + } + } + + if Set(watchlistCompany.map { $0.watchlistName }).count > 1 { /// If there are only 1 watchlist (default) -> It cannot be deleted + Section(header: Text("Secondary actions")) { + Button(action: { showDeleteListAlert = true }) { + Label("Delete list", systemImage: "trash") + } + } + } + } + label: { + Label("Options", systemImage: "ellipsis.circle") + .imageScale(.large) + } + } +} + +struct ToolbarMenu_Previews: PreviewProvider { + static var previews: some View { + ToolbarMenu(showRenameListSheet: .constant(false), showDeleteListAlert: .constant(false)) + } +}
--- a/LazyBear/Views/Profile/Helpers/WatchlistSheet.swift Wed Jun 16 13:46:40 2021 +0200 +++ b/LazyBear/Views/Profile/Helpers/WatchlistSheet.swift Fri Jun 18 12:43:17 2021 +0200 @@ -9,22 +9,23 @@ struct WatchlistSheet: View { var listName: String - var companies: [CompanyModel] + var apiCompanies: [CompanyModel] - @Environment(\.presentationMode) private var watchlistSheetPresentation + @Environment(\.presentationMode) private var watchlistSheetPresentationMode @Environment(\.managedObjectContext) private var moc - @FetchRequest(entity: WatchlistCompany.entity(), sortDescriptors: [NSSortDescriptor(key:"symbol", ascending:true)]) + @FetchRequest(entity: WatchlistCompany.entity(), sortDescriptors: []) var watchlistCompanies: FetchedResults<WatchlistCompany> - /* - NSSortDescriptor and .sorted(by: {} in ForEach must coincide. If not .onDelete is not working well. - */ + @State private var showDeleteListAlert = false + @State private var showRenameListSheet = false + var body: some View { NavigationView { VStack { List { - ForEach(companies.sorted(by: { $0.companyName < $1.companyName }), id: \.self) { company in - StockSheetRow(company: company) + ForEach(watchlistCompanies.filter { $0.watchlistName == listName }, id: \.self) { watchlistCompany in + let apiCompany = apiCompanies.first(where: { $0.symbol == watchlistCompany.symbol }) + WatchlistSheetRow(apiCompany: apiCompany!, watchlistCompany: watchlistCompany) } .onDelete(perform: deleteCompany) } @@ -33,22 +34,37 @@ .navigationBarTitleDisplayMode(.inline) .toolbar { ToolbarItem(placement: .navigationBarLeading) { - Button(action: {watchlistSheetPresentation.wrappedValue.dismiss()}) { + Button(action: {watchlistSheetPresentationMode.wrappedValue.dismiss()}) { Image(systemName: "multiply") } } + + ToolbarItem(placement: .navigationBarTrailing) { + ToolbarMenu(showRenameListSheet: $showRenameListSheet, showDeleteListAlert: $showDeleteListAlert) + } } } + .sheet(isPresented: $showRenameListSheet) { + RenameListSheet(oldWatchlistName: listName) + .environment(\.managedObjectContext, self.moc) + } + .alert(isPresented: $showDeleteListAlert) { /// Show delete list alert + Alert( + title: Text("Are you sure you want to delete this list?"), + message: Text("This action can't be undo"), + primaryButton: .destructive(Text("Delete")) { deleteList() }, + secondaryButton: .cancel() + ) + } } /* - Delete company from watchlist + Delete company from watchlist. */ private func deleteCompany(at offsets: IndexSet) { - print(watchlistCompanies) + let watchlistCompaniesFiltered = watchlistCompanies.filter { $0.watchlistName == listName } for index in offsets { - print(index) - let company = watchlistCompanies[index] + let company = watchlistCompaniesFiltered[index] moc.delete(company) } do { @@ -58,13 +74,30 @@ print(error.localizedDescription) } } + + /* + Remove entire list if it's not the last one. + */ + private func deleteList() { + let watchlistCompaniesFiltered = watchlistCompanies.filter { $0.watchlistName == listName } + for company in watchlistCompaniesFiltered { + moc.delete(company) + } + do { + try moc.save() + print("List deleted") + watchlistSheetPresentationMode.wrappedValue.dismiss() /// Dismiss view + } catch { + print(error.localizedDescription) + } + } } struct WatchlistSheet_Previews: PreviewProvider { static var previews: some View { WatchlistSheet( listName: "Most active", - companies: [CompanyModel(symbol: "aapl", companyName: "Apple Inc", latestPrice: 120.3, changePercent: 0.03, intradayPrices: [120.3])] + apiCompanies: [CompanyModel(symbol: "aapl", companyName: "Apple Inc", latestPrice: 120.3, changePercent: 0.03, intradayPrices: [120.3])] ) } }
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/LazyBear/Views/Profile/Helpers/WatchlistSheetRow.swift Fri Jun 18 12:43:17 2021 +0200 @@ -0,0 +1,66 @@ +// +// WatchlistSheetRow.swift +// LazyBear +// +// Created by Dennis Concepción Martín on 18/6/21. +// + +import SwiftUI +import StockCharts +import CoreData + +struct WatchlistSheetRow: View { + var apiCompany: CompanyModel + var watchlistCompany: WatchlistCompany + + var body: some View { + HStack { + VStack(alignment: .leading) { + Text(watchlistCompany.symbol.uppercased()) + .fontWeight(.semibold) + + Text(watchlistCompany.name.capitalized) + .font(.callout) + .fontWeight(.semibold) + .opacity(0.6) + .lineLimit(1) + } + + Spacer() + LineChartView(data: apiCompany.intradayPrices, dates: nil, hours: nil, dragGesture: false) + .frame(width: 80) + .padding(.vertical, 10) + .padding(.horizontal) + + + if let latestPrice = apiCompany.latestPrice, let changePercent = apiCompany.changePercent { + VStack(alignment: .trailing) { + Text("\(latestPrice, specifier: "%.2f")") + .foregroundColor(changePercent < 0 ? .red: .green) + .fontWeight(.semibold) + + Text("\(changePercent * 100, specifier: "%.2f")%") + .foregroundColor(changePercent < 0 ? .red: .green) + .font(.callout) + .fontWeight(.semibold) + } + } + } + } +} + +struct WatchlistSheetRow_Previews: PreviewProvider { + static let moc = NSManagedObjectContext(concurrencyType: .mainQueueConcurrencyType) + + static var previews: some View { + let watchlistCompany = WatchlistCompany(context: moc) + watchlistCompany.name = "apple inc" + watchlistCompany.symbol = "aapl" + watchlistCompany.watchlistName = "Default" + + return WatchlistSheetRow( + apiCompany: CompanyModel(symbol: "aapl", companyName: "Apple Inc", latestPrice: 120.3, changePercent: 0.03, intradayPrices: [120.3]), + watchlistCompany: watchlistCompany + ) + } +}
--- a/LazyBear/Views/Search/SearchView.swift Wed Jun 16 13:46:40 2021 +0200 +++ b/LazyBear/Views/Search/SearchView.swift Fri Jun 18 12:43:17 2021 +0200 @@ -20,7 +20,7 @@ CompanyList(searchResult: search.data) } else { VStack(alignment: .center) { - Image("bearSleeping") + Image("suitBear") .resizable() .scaledToFit() @@ -30,7 +30,7 @@ .multilineTextAlignment(.center) .padding(.bottom) - Text("Use the search bar to find your favourite company. Type the stock symbol or name, we'll find it!") + Text("Use the search bar to find your favourite company. Type the stock symbol or name, I'll find it") .multilineTextAlignment(.center) } .padding(.horizontal)