From ea634390a66fded9a2f34639b8c446fa8e78c425 Mon Sep 17 00:00:00 2001 From: Arkadiusz Fal Date: Fri, 20 Aug 2021 00:38:31 +0200 Subject: [PATCH] Minor fixes, split files into folders --- .swiftlint.yml | 1 + {Shared => Model}/Country.swift | 0 Pearvidious.xcodeproj/project.pbxproj | 124 +++++++++++++----- .../AppSidebarNavigation.swift | 0 .../{ => Navigation}/AppTabNavigation.swift | 0 Shared/{ => Navigation}/ContentView.swift | 0 Shared/{ => Player}/Player.swift | 0 .../{ => Player}/PlayerViewController.swift | 0 Shared/{ => Player}/VideoPlayerView.swift | 0 .../{ => Playlists}/CoverSectionRowView.swift | 0 Shared/{ => Playlists}/CoverSectionView.swift | 0 Shared/{ => Playlists}/PlaylistFormView.swift | 4 +- Shared/{ => Playlists}/PlaylistsView.swift | 2 +- .../TrendingCountry.swift} | 10 +- Shared/{ => Trending}/TrendingView.swift | 6 +- Shared/{ => Videos}/DetailBadge.swift | 0 Shared/{ => Videos}/VideoView.swift | 0 Shared/{ => Videos}/VideosCellsView.swift | 0 Shared/{ => Videos}/VideosListView.swift | 0 Shared/{ => Videos}/VideosView.swift | 0 Shared/{ => Views}/PopularView.swift | 0 Shared/{ => Views}/SearchView.swift | 0 Shared/{ => Views}/SubscriptionsView.swift | 0 .../Views}/VideoContextMenuView.swift | 0 tvOS/{ => Options}/OptionsView.swift | 0 tvOS/{ => Options}/SearchOptionsView.swift | 0 26 files changed, 101 insertions(+), 46 deletions(-) rename {Shared => Model}/Country.swift (100%) rename Shared/{ => Navigation}/AppSidebarNavigation.swift (100%) rename Shared/{ => Navigation}/AppTabNavigation.swift (100%) rename Shared/{ => Navigation}/ContentView.swift (100%) rename Shared/{ => Player}/Player.swift (100%) rename Shared/{ => Player}/PlayerViewController.swift (100%) rename Shared/{ => Player}/VideoPlayerView.swift (100%) rename Shared/{ => Playlists}/CoverSectionRowView.swift (100%) rename Shared/{ => Playlists}/CoverSectionView.swift (100%) rename Shared/{ => Playlists}/PlaylistFormView.swift (98%) rename Shared/{ => Playlists}/PlaylistsView.swift (99%) rename Shared/{TrendingCountrySelection.swift => Trending/TrendingCountry.swift} (91%) rename Shared/{ => Trending}/TrendingView.swift (95%) rename Shared/{ => Videos}/DetailBadge.swift (100%) rename Shared/{ => Videos}/VideoView.swift (100%) rename Shared/{ => Videos}/VideosCellsView.swift (100%) rename Shared/{ => Videos}/VideosListView.swift (100%) rename Shared/{ => Videos}/VideosView.swift (100%) rename Shared/{ => Views}/PopularView.swift (100%) rename Shared/{ => Views}/SearchView.swift (100%) rename Shared/{ => Views}/SubscriptionsView.swift (100%) rename {tvOS => Shared/Views}/VideoContextMenuView.swift (100%) rename tvOS/{ => Options}/OptionsView.swift (100%) rename tvOS/{ => Options}/SearchOptionsView.swift (100%) diff --git a/.swiftlint.yml b/.swiftlint.yml index 7590d249..791127c4 100644 --- a/.swiftlint.yml +++ b/.swiftlint.yml @@ -1,6 +1,7 @@ parent_config: https://raw.githubusercontent.com/sindresorhus/swiftlint-config/main/.swiftlint.yml disabled_rules: + - identifier_name - opening_brace - multiline_arguments diff --git a/Shared/Country.swift b/Model/Country.swift similarity index 100% rename from Shared/Country.swift rename to Model/Country.swift diff --git a/Pearvidious.xcodeproj/project.pbxproj b/Pearvidious.xcodeproj/project.pbxproj index 777e4ed8..7995049c 100644 --- a/Pearvidious.xcodeproj/project.pbxproj +++ b/Pearvidious.xcodeproj/project.pbxproj @@ -7,7 +7,7 @@ objects = { /* Begin PBXBuildFile section */ - 3705B180267B4DFB00704544 /* TrendingCountrySelection.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3705B17F267B4DFB00704544 /* TrendingCountrySelection.swift */; }; + 3705B180267B4DFB00704544 /* TrendingCountry.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3705B17F267B4DFB00704544 /* TrendingCountry.swift */; }; 3705B182267B4E4900704544 /* TrendingCategory.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3705B181267B4E4900704544 /* TrendingCategory.swift */; }; 3705B183267B4E4900704544 /* TrendingCategory.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3705B181267B4E4900704544 /* TrendingCategory.swift */; }; 3705B184267B4E4900704544 /* TrendingCategory.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3705B181267B4E4900704544 /* TrendingCategory.swift */; }; @@ -33,8 +33,6 @@ 373CFAC226966159003CB2C6 /* CoverSectionRowView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 373CFAC126966159003CB2C6 /* CoverSectionRowView.swift */; }; 373CFAC32696616C003CB2C6 /* CoverSectionRowView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 373CFAC126966159003CB2C6 /* CoverSectionRowView.swift */; }; 373CFAC42696616C003CB2C6 /* CoverSectionRowView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 373CFAC126966159003CB2C6 /* CoverSectionRowView.swift */; }; - 373CFAC62696617C003CB2C6 /* SearchOptionsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 373CFAC52696617C003CB2C6 /* SearchOptionsView.swift */; }; - 373CFAC726966187003CB2C6 /* SearchOptionsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 373CFAC52696617C003CB2C6 /* SearchOptionsView.swift */; }; 373CFAC926966188003CB2C6 /* SearchOptionsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 373CFAC52696617C003CB2C6 /* SearchOptionsView.swift */; }; 373CFACB26966264003CB2C6 /* SearchQuery.swift in Sources */ = {isa = PBXBuildFile; fileRef = 373CFACA26966264003CB2C6 /* SearchQuery.swift */; }; 373CFACC26966264003CB2C6 /* SearchQuery.swift in Sources */ = {isa = PBXBuildFile; fileRef = 373CFACA26966264003CB2C6 /* SearchQuery.swift */; }; @@ -122,7 +120,7 @@ 37BD07BC2698AB60003EBB87 /* AppSidebarNavigation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 37BD07BA2698AB60003EBB87 /* AppSidebarNavigation.swift */; }; 37BD07BE2698AC96003EBB87 /* Defaults in Frameworks */ = {isa = PBXBuildFile; productRef = 37BD07BD2698AC96003EBB87 /* Defaults */; }; 37BD07C02698AC97003EBB87 /* Siesta in Frameworks */ = {isa = PBXBuildFile; productRef = 37BD07BF2698AC97003EBB87 /* Siesta */; }; - 37BD07C12698AD3B003EBB87 /* TrendingCountrySelection.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3705B17F267B4DFB00704544 /* TrendingCountrySelection.swift */; }; + 37BD07C12698AD3B003EBB87 /* TrendingCountry.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3705B17F267B4DFB00704544 /* TrendingCountry.swift */; }; 37BD07C32698AD4F003EBB87 /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 37BD07B42698AA4D003EBB87 /* ContentView.swift */; }; 37BD07C72698B27B003EBB87 /* Introspect in Frameworks */ = {isa = PBXBuildFile; productRef = 37BD07C62698B27B003EBB87 /* Introspect */; }; 37BD07C82698B71C003EBB87 /* AppTabNavigation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 37D4B0C32671614700C925CA /* AppTabNavigation.swift */; }; @@ -141,7 +139,7 @@ 37C7A1D5267BFD9D0010EAD6 /* SponsorBlockSegment.swift in Sources */ = {isa = PBXBuildFile; fileRef = 37C7A1D4267BFD9D0010EAD6 /* SponsorBlockSegment.swift */; }; 37C7A1D6267BFD9D0010EAD6 /* SponsorBlockSegment.swift in Sources */ = {isa = PBXBuildFile; fileRef = 37C7A1D4267BFD9D0010EAD6 /* SponsorBlockSegment.swift */; }; 37C7A1D7267BFD9D0010EAD6 /* SponsorBlockSegment.swift in Sources */ = {isa = PBXBuildFile; fileRef = 37C7A1D4267BFD9D0010EAD6 /* SponsorBlockSegment.swift */; }; - 37C7A1DA267CACF50010EAD6 /* TrendingCountrySelection.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3705B17F267B4DFB00704544 /* TrendingCountrySelection.swift */; }; + 37C7A1DA267CACF50010EAD6 /* TrendingCountry.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3705B17F267B4DFB00704544 /* TrendingCountry.swift */; }; 37C7A1DC267CE9D90010EAD6 /* Profile.swift in Sources */ = {isa = PBXBuildFile; fileRef = 37C7A1DB267CE9D90010EAD6 /* Profile.swift */; }; 37C7A1DD267CE9D90010EAD6 /* Profile.swift in Sources */ = {isa = PBXBuildFile; fileRef = 37C7A1DB267CE9D90010EAD6 /* Profile.swift */; }; 37C7A1DE267CE9D90010EAD6 /* Profile.swift in Sources */ = {isa = PBXBuildFile; fileRef = 37C7A1DB267CE9D90010EAD6 /* Profile.swift */; }; @@ -207,7 +205,7 @@ /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ - 3705B17F267B4DFB00704544 /* TrendingCountrySelection.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TrendingCountrySelection.swift; sourceTree = ""; }; + 3705B17F267B4DFB00704544 /* TrendingCountry.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TrendingCountry.swift; sourceTree = ""; }; 3705B181267B4E4900704544 /* TrendingCategory.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TrendingCategory.swift; sourceTree = ""; }; 3711403E26B206A6005B3555 /* SearchState.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SearchState.swift; sourceTree = ""; }; 3714166E267A8ACC006CA35D /* TrendingView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TrendingView.swift; sourceTree = ""; }; @@ -340,12 +338,84 @@ /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ + 371AAE2326CEB9E800901972 /* Navigation */ = { + isa = PBXGroup; + children = ( + 37BD07BA2698AB60003EBB87 /* AppSidebarNavigation.swift */, + 37D4B0C32671614700C925CA /* AppTabNavigation.swift */, + 37BD07B42698AA4D003EBB87 /* ContentView.swift */, + ); + path = Navigation; + sourceTree = ""; + }; + 371AAE2426CEBA4100901972 /* Player */ = { + isa = PBXGroup; + children = ( + 37BE0BD226A1D4780092E2DB /* Player.swift */, + 37BE0BD526A1D4A90092E2DB /* PlayerViewController.swift */, + 37BE0BCE26A0E2D50092E2DB /* VideoPlayerView.swift */, + ); + path = Player; + sourceTree = ""; + }; + 371AAE2526CEBF0B00901972 /* Trending */ = { + isa = PBXGroup; + children = ( + 3705B17F267B4DFB00704544 /* TrendingCountry.swift */, + 3714166E267A8ACC006CA35D /* TrendingView.swift */, + ); + path = Trending; + sourceTree = ""; + }; + 371AAE2626CEBF1600901972 /* Playlists */ = { + isa = PBXGroup; + children = ( + 373CFAC126966159003CB2C6 /* CoverSectionRowView.swift */, + 373CFABD26966115003CB2C6 /* CoverSectionView.swift */, + 373CFAEA26975CBF003CB2C6 /* PlaylistFormView.swift */, + 376578902685490700D4EA09 /* PlaylistsView.swift */, + ); + path = Playlists; + sourceTree = ""; + }; + 371AAE2726CEBF4700901972 /* Videos */ = { + isa = PBXGroup; + children = ( + 3748186D26A769D60084E870 /* DetailBadge.swift */, + 37F4AE7126828F0900BD60EA /* VideosCellsView.swift */, + 37AAF29926740A01007FC770 /* VideosListView.swift */, + 37754C9C26B7500000DBD602 /* VideosView.swift */, + 37D4B18B26717B3800C925CA /* VideoView.swift */, + ); + path = Videos; + sourceTree = ""; + }; + 371AAE2826CEC7D900901972 /* Views */ = { + isa = PBXGroup; + children = ( + 37AAF27D26737323007FC770 /* PopularView.swift */, + 37AAF27F26737550007FC770 /* SearchView.swift */, + 37AAF29F26741C97007FC770 /* SubscriptionsView.swift */, + 37B17D9F268A1F25006AEE9B /* VideoContextMenuView.swift */, + ); + path = Views; + sourceTree = ""; + }; + 371AAE2926CF143200901972 /* Options */ = { + isa = PBXGroup; + children = ( + 37B76E95268747C900CE5671 /* OptionsView.swift */, + 373CFAC52696617C003CB2C6 /* SearchOptionsView.swift */, + ); + path = Options; + sourceTree = ""; + }; 3748186426A762300084E870 /* Fixtures */ = { isa = PBXGroup; children = ( + 37F49BA226CAA59B00304AC0 /* Playlist+Fixtures.swift */, 3748186926A764FB0084E870 /* Thumbnail+Fixtures.swift */, 3748186526A7627F0084E870 /* Video+Fixtures.swift */, - 37F49BA226CAA59B00304AC0 /* Playlist+Fixtures.swift */, ); path = Fixtures; sourceTree = ""; @@ -405,29 +475,14 @@ 37D4B0C12671614700C925CA /* Shared */ = { isa = PBXGroup; children = ( - 37BD07BA2698AB60003EBB87 /* AppSidebarNavigation.swift */, - 37D4B0C32671614700C925CA /* AppTabNavigation.swift */, - 37BD07B42698AA4D003EBB87 /* ContentView.swift */, - 37141672267A8E10006CA35D /* Country.swift */, - 373CFAC126966159003CB2C6 /* CoverSectionRowView.swift */, - 373CFABD26966115003CB2C6 /* CoverSectionView.swift */, + 371AAE2326CEB9E800901972 /* Navigation */, + 371AAE2426CEBA4100901972 /* Player */, + 371AAE2626CEBF1600901972 /* Playlists */, + 371AAE2526CEBF0B00901972 /* Trending */, + 371AAE2726CEBF4700901972 /* Videos */, + 371AAE2826CEC7D900901972 /* Views */, 372915E52687E3B900F5A35B /* Defaults.swift */, - 3748186D26A769D60084E870 /* DetailBadge.swift */, 37D4B0C22671614700C925CA /* PearvidiousApp.swift */, - 37BE0BD226A1D4780092E2DB /* Player.swift */, - 37BE0BD526A1D4A90092E2DB /* PlayerViewController.swift */, - 373CFAEA26975CBF003CB2C6 /* PlaylistFormView.swift */, - 376578902685490700D4EA09 /* PlaylistsView.swift */, - 37AAF27D26737323007FC770 /* PopularView.swift */, - 37AAF27F26737550007FC770 /* SearchView.swift */, - 37AAF29F26741C97007FC770 /* SubscriptionsView.swift */, - 3705B17F267B4DFB00704544 /* TrendingCountrySelection.swift */, - 3714166E267A8ACC006CA35D /* TrendingView.swift */, - 37BE0BCE26A0E2D50092E2DB /* VideoPlayerView.swift */, - 37F4AE7126828F0900BD60EA /* VideosCellsView.swift */, - 37AAF29926740A01007FC770 /* VideosListView.swift */, - 37D4B18B26717B3800C925CA /* VideoView.swift */, - 37754C9C26B7500000DBD602 /* VideosView.swift */, 37D4B0C42671614800C925CA /* Assets.xcassets */, 37BD07C42698ADEE003EBB87 /* Pearvidious.entitlements */, ); @@ -466,12 +521,10 @@ 37D4B159267164AE00C925CA /* tvOS */ = { isa = PBXGroup; children = ( + 371AAE2926CF143200901972 /* Options */, 373CFAEE2697A78B003CB2C6 /* AddToPlaylistView.swift */, 37AAF2892673AB89007FC770 /* ChannelView.swift */, - 37B76E95268747C900CE5671 /* OptionsView.swift */, - 373CFAC52696617C003CB2C6 /* SearchOptionsView.swift */, 37BAB54B269B39FD00E75ED1 /* TVNavigationView.swift */, - 37B17D9F268A1F25006AEE9B /* VideoContextMenuView.swift */, 37B17DA3268A285E006AEE9B /* VideoDetailsView.swift */, 37D4B15E267164AF00C925CA /* Assets.xcassets */, 37D4B1AE26729DEB00C925CA /* Info.plist */, @@ -490,6 +543,7 @@ 37D4B1B72672CFE300C925CA /* Model */ = { isa = PBXGroup; children = ( + 37141672267A8E10006CA35D /* Country.swift */, 37AAF28F26740715007FC770 /* Channel.swift */, 37977582268922F600DD52A8 /* InvidiousAPI.swift */, 371F2F19269B43D300E4A7AB /* NavigationState.swift */, @@ -763,7 +817,7 @@ 37BD07C82698B71C003EBB87 /* AppTabNavigation.swift in Sources */, 37EAD86B267B9C5600D9E01B /* SponsorBlockAPI.swift in Sources */, 37BD07B52698AA4D003EBB87 /* ContentView.swift in Sources */, - 37C7A1DA267CACF50010EAD6 /* TrendingCountrySelection.swift in Sources */, + 37C7A1DA267CACF50010EAD6 /* TrendingCountry.swift in Sources */, 37977583268922F600DD52A8 /* InvidiousAPI.swift in Sources */, 37BE0BD626A1D4A90092E2DB /* PlayerViewController.swift in Sources */, 37754C9D26B7500000DBD602 /* VideosView.swift in Sources */, @@ -774,7 +828,6 @@ 376578852685429C00D4EA09 /* CaseIterable+Next.swift in Sources */, 3748186626A7627F0084E870 /* Video+Fixtures.swift in Sources */, 377FC7DC267A081800A6BBAF /* PopularView.swift in Sources */, - 373CFAC62696617C003CB2C6 /* SearchOptionsView.swift in Sources */, 3705B182267B4E4900704544 /* TrendingCategory.swift in Sources */, 37EAD86F267B9ED100D9E01B /* Segment.swift in Sources */, 376578892685471400D4EA09 /* Playlist.swift in Sources */, @@ -832,7 +885,6 @@ 373CFACC26966264003CB2C6 /* SearchQuery.swift in Sources */, 373CFAC32696616C003CB2C6 /* CoverSectionRowView.swift in Sources */, 37AAF29126740715007FC770 /* Channel.swift in Sources */, - 373CFAC726966187003CB2C6 /* SearchOptionsView.swift in Sources */, 37BD07BC2698AB60003EBB87 /* AppSidebarNavigation.swift in Sources */, 3748186F26A769D60084E870 /* DetailBadge.swift in Sources */, 372915E72687E3B900F5A35B /* Defaults.swift in Sources */, @@ -854,7 +906,7 @@ 37AAF2A126741C97007FC770 /* SubscriptionsView.swift in Sources */, 37D4B19826717E1500C925CA /* Video.swift in Sources */, 37D4B0E52671614900C925CA /* PearvidiousApp.swift in Sources */, - 37BD07C12698AD3B003EBB87 /* TrendingCountrySelection.swift in Sources */, + 37BD07C12698AD3B003EBB87 /* TrendingCountry.swift in Sources */, 3711404026B206A6005B3555 /* SearchState.swift in Sources */, 37BE0BD026A0E2D50092E2DB /* VideoPlayerView.swift in Sources */, 373CFAEC26975CBF003CB2C6 /* PlaylistFormView.swift in Sources */, @@ -927,7 +979,7 @@ 3711404126B206A6005B3555 /* SearchState.swift in Sources */, 379775952689365600DD52A8 /* Array+Next.swift in Sources */, 37AAF28A2673AB89007FC770 /* ChannelView.swift in Sources */, - 3705B180267B4DFB00704544 /* TrendingCountrySelection.swift in Sources */, + 3705B180267B4DFB00704544 /* TrendingCountry.swift in Sources */, 373CFACD26966264003CB2C6 /* SearchQuery.swift in Sources */, 37141675267A8E10006CA35D /* Country.swift in Sources */, 37F49BA826CB0FCE00304AC0 /* PlaylistFormView.swift in Sources */, diff --git a/Shared/AppSidebarNavigation.swift b/Shared/Navigation/AppSidebarNavigation.swift similarity index 100% rename from Shared/AppSidebarNavigation.swift rename to Shared/Navigation/AppSidebarNavigation.swift diff --git a/Shared/AppTabNavigation.swift b/Shared/Navigation/AppTabNavigation.swift similarity index 100% rename from Shared/AppTabNavigation.swift rename to Shared/Navigation/AppTabNavigation.swift diff --git a/Shared/ContentView.swift b/Shared/Navigation/ContentView.swift similarity index 100% rename from Shared/ContentView.swift rename to Shared/Navigation/ContentView.swift diff --git a/Shared/Player.swift b/Shared/Player/Player.swift similarity index 100% rename from Shared/Player.swift rename to Shared/Player/Player.swift diff --git a/Shared/PlayerViewController.swift b/Shared/Player/PlayerViewController.swift similarity index 100% rename from Shared/PlayerViewController.swift rename to Shared/Player/PlayerViewController.swift diff --git a/Shared/VideoPlayerView.swift b/Shared/Player/VideoPlayerView.swift similarity index 100% rename from Shared/VideoPlayerView.swift rename to Shared/Player/VideoPlayerView.swift diff --git a/Shared/CoverSectionRowView.swift b/Shared/Playlists/CoverSectionRowView.swift similarity index 100% rename from Shared/CoverSectionRowView.swift rename to Shared/Playlists/CoverSectionRowView.swift diff --git a/Shared/CoverSectionView.swift b/Shared/Playlists/CoverSectionView.swift similarity index 100% rename from Shared/CoverSectionView.swift rename to Shared/Playlists/CoverSectionView.swift diff --git a/Shared/PlaylistFormView.swift b/Shared/Playlists/PlaylistFormView.swift similarity index 98% rename from Shared/PlaylistFormView.swift rename to Shared/Playlists/PlaylistFormView.swift index 92bf7689..f147e41a 100644 --- a/Shared/PlaylistFormView.swift +++ b/Shared/Playlists/PlaylistFormView.swift @@ -53,7 +53,8 @@ struct PlaylistFormView: View { Spacer() - Button("Save", action: submitForm).disabled(!valid) + Button("Save", action: submitForm) + .disabled(!valid) .keyboardShortcut(.defaultAction) } } @@ -111,6 +112,7 @@ struct PlaylistFormView: View { func initializeForm() { focused = true + guard editing else { return } diff --git a/Shared/PlaylistsView.swift b/Shared/Playlists/PlaylistsView.swift similarity index 99% rename from Shared/PlaylistsView.swift rename to Shared/Playlists/PlaylistsView.swift index a0ea5dfb..fdca629d 100644 --- a/Shared/PlaylistsView.swift +++ b/Shared/Playlists/PlaylistsView.swift @@ -51,10 +51,10 @@ struct PlaylistsView: View { #if os(iOS) toolbar .font(.system(size: 14)) - .animation(nil) .padding(.horizontal) .padding(.vertical, 10) .overlay(Divider().offset(x: 0, y: -2), alignment: .topTrailing) + .transaction { t in t.animation = .none } #endif } #if os(tvOS) diff --git a/Shared/TrendingCountrySelection.swift b/Shared/Trending/TrendingCountry.swift similarity index 91% rename from Shared/TrendingCountrySelection.swift rename to Shared/Trending/TrendingCountry.swift index a535620d..04dbe7b8 100644 --- a/Shared/TrendingCountrySelection.swift +++ b/Shared/Trending/TrendingCountry.swift @@ -1,6 +1,6 @@ import SwiftUI -struct TrendingCountrySelection: View { +struct TrendingCountry: View { static let prompt = "Country Name or Code" @Binding var selectedCountry: Country? @@ -16,7 +16,7 @@ struct TrendingCountrySelection: View { VStack { #if os(macOS) HStack { - TextField("Country", text: $query, prompt: Text(TrendingCountrySelection.prompt)) + TextField("Country", text: $query, prompt: Text(TrendingCountry.prompt)) .focused($countryIsFocused) Button("Done") { selectCountryAndDismiss() } @@ -45,7 +45,7 @@ struct TrendingCountrySelection: View { } .onSubmit { selectCountryAndDismiss() } #if !os(macOS) - .searchable(text: $query, placement: searchPlacement, prompt: Text(TrendingCountrySelection.prompt)) + .searchable(text: $query, placement: searchPlacement, prompt: Text(TrendingCountry.prompt)) #endif #if os(tvOS) .background(.thinMaterial) @@ -97,8 +97,8 @@ struct TrendingCountrySelection: View { } } -struct TrendingCountrySelection_Previews: PreviewProvider { +struct TrendingCountry_Previews: PreviewProvider { static var previews: some View { - TrendingCountrySelection(selectedCountry: .constant(.pl)) + TrendingCountry(selectedCountry: .constant(.pl)) } } diff --git a/Shared/TrendingView.swift b/Shared/Trending/TrendingView.swift similarity index 95% rename from Shared/TrendingView.swift rename to Shared/Trending/TrendingView.swift index 021a27a8..ca218046 100644 --- a/Shared/TrendingView.swift +++ b/Shared/Trending/TrendingView.swift @@ -51,20 +51,20 @@ struct TrendingView: View { #if os(iOS) toolbar .font(.system(size: 14)) - .animation(nil) .padding(.horizontal) .padding(.vertical, 10) .overlay(Divider().offset(x: 0, y: -2), alignment: .topTrailing) + .transaction { t in t.animation = .none } #endif } } #if os(tvOS) .fullScreenCover(isPresented: $selectingCountry, onDismiss: { setCountry(country) }) { - TrendingCountrySelection(selectedCountry: $country) + TrendingCountry(selectedCountry: $country) } #else .sheet(isPresented: $selectingCountry, onDismiss: { setCountry(country) }) { - TrendingCountrySelection(selectedCountry: $country) + TrendingCountry(selectedCountry: $country) #if os(macOS) .frame(minWidth: 400, minHeight: 400) #endif diff --git a/Shared/DetailBadge.swift b/Shared/Videos/DetailBadge.swift similarity index 100% rename from Shared/DetailBadge.swift rename to Shared/Videos/DetailBadge.swift diff --git a/Shared/VideoView.swift b/Shared/Videos/VideoView.swift similarity index 100% rename from Shared/VideoView.swift rename to Shared/Videos/VideoView.swift diff --git a/Shared/VideosCellsView.swift b/Shared/Videos/VideosCellsView.swift similarity index 100% rename from Shared/VideosCellsView.swift rename to Shared/Videos/VideosCellsView.swift diff --git a/Shared/VideosListView.swift b/Shared/Videos/VideosListView.swift similarity index 100% rename from Shared/VideosListView.swift rename to Shared/Videos/VideosListView.swift diff --git a/Shared/VideosView.swift b/Shared/Videos/VideosView.swift similarity index 100% rename from Shared/VideosView.swift rename to Shared/Videos/VideosView.swift diff --git a/Shared/PopularView.swift b/Shared/Views/PopularView.swift similarity index 100% rename from Shared/PopularView.swift rename to Shared/Views/PopularView.swift diff --git a/Shared/SearchView.swift b/Shared/Views/SearchView.swift similarity index 100% rename from Shared/SearchView.swift rename to Shared/Views/SearchView.swift diff --git a/Shared/SubscriptionsView.swift b/Shared/Views/SubscriptionsView.swift similarity index 100% rename from Shared/SubscriptionsView.swift rename to Shared/Views/SubscriptionsView.swift diff --git a/tvOS/VideoContextMenuView.swift b/Shared/Views/VideoContextMenuView.swift similarity index 100% rename from tvOS/VideoContextMenuView.swift rename to Shared/Views/VideoContextMenuView.swift diff --git a/tvOS/OptionsView.swift b/tvOS/Options/OptionsView.swift similarity index 100% rename from tvOS/OptionsView.swift rename to tvOS/Options/OptionsView.swift diff --git a/tvOS/SearchOptionsView.swift b/tvOS/Options/SearchOptionsView.swift similarity index 100% rename from tvOS/SearchOptionsView.swift rename to tvOS/Options/SearchOptionsView.swift