From 1b058af687bac9dfe8c78209fe7ba510b2d78257 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Wed, 15 May 2024 08:39:35 +0300 Subject: JuickNext: conditional layout for big screens --- Juick.xcodeproj/project.pbxproj | 65 ++++++++++++++++++++++++++++-------- JuickNext/View/ContentView.swift | 15 +++++++-- JuickNext/View/Discussions.swift | 21 ++++++++++++ JuickNext/View/DiscussionsView.swift | 21 ------------ JuickNext/View/Today.swift | 5 ++- 5 files changed, 88 insertions(+), 39 deletions(-) create mode 100644 JuickNext/View/Discussions.swift delete mode 100644 JuickNext/View/DiscussionsView.swift diff --git a/Juick.xcodeproj/project.pbxproj b/Juick.xcodeproj/project.pbxproj index 1c64483..7da0fdd 100644 --- a/Juick.xcodeproj/project.pbxproj +++ b/Juick.xcodeproj/project.pbxproj @@ -3,7 +3,7 @@ archiveVersion = 1; classes = { }; - objectVersion = 46; + objectVersion = 54; objects = { /* Begin PBXBuildFile section */ @@ -16,7 +16,7 @@ 77163ABC2A104787009BEE0E /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 77163ABB2A104787009BEE0E /* Preview Assets.xcassets */; }; 77163AC42A104AFC009BEE0E /* Today.swift in Sources */ = {isa = PBXBuildFile; fileRef = 77163AC32A104AFC009BEE0E /* Today.swift */; }; 77163AC52A104C67009BEE0E /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 77317BC6181BBE8500D60005 /* Images.xcassets */; }; - 77163AC72A10509A009BEE0E /* DiscussionsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 77163AC62A10509A009BEE0E /* DiscussionsView.swift */; }; + 77163AC72A10509A009BEE0E /* Discussions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 77163AC62A10509A009BEE0E /* Discussions.swift */; }; 772B4E6C2199811E0029706E /* Entity.m in Sources */ = {isa = PBXBuildFile; fileRef = 772B4E6B2199811E0029706E /* Entity.m */; }; 77317BAC181BBE8500D60005 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 77317BAB181BBE8500D60005 /* Foundation.framework */; }; 77317BAE181BBE8500D60005 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 77317BAD181BBE8500D60005 /* CoreGraphics.framework */; }; @@ -120,7 +120,7 @@ 77163AB72A104787009BEE0E /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 77163ABB2A104787009BEE0E /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = ""; }; 77163AC32A104AFC009BEE0E /* Today.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Today.swift; sourceTree = ""; }; - 77163AC62A10509A009BEE0E /* DiscussionsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DiscussionsView.swift; sourceTree = ""; }; + 77163AC62A10509A009BEE0E /* Discussions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Discussions.swift; sourceTree = ""; }; 772B4E6A2199811E0029706E /* Entity.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Entity.h; sourceTree = ""; }; 772B4E6B2199811E0029706E /* Entity.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = Entity.m; sourceTree = ""; }; 77317BA8181BBE8500D60005 /* Juick.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Juick.app; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -268,7 +268,7 @@ isa = PBXGroup; children = ( 77163AC32A104AFC009BEE0E /* Today.swift */, - 77163AC62A10509A009BEE0E /* DiscussionsView.swift */, + 77163AC62A10509A009BEE0E /* Discussions.swift */, 77163AB52A104786009BEE0E /* ContentView.swift */, ); path = View; @@ -560,8 +560,9 @@ 77317BA0181BBE8500D60005 /* Project object */ = { isa = PBXProject; attributes = { + BuildIndependentTargetsInParallel = YES; LastSwiftUpdateCheck = 1430; - LastUpgradeCheck = 1200; + LastUpgradeCheck = 1540; ORGANIZATIONNAME = com.juick; TargetAttributes = { 77163AB02A104786009BEE0E = { @@ -675,7 +676,7 @@ files = ( 77163AB62A104786009BEE0E /* ContentView.swift in Sources */, 77163AC42A104AFC009BEE0E /* Today.swift in Sources */, - 77163AC72A10509A009BEE0E /* DiscussionsView.swift in Sources */, + 77163AC72A10509A009BEE0E /* Discussions.swift in Sources */, 77163AB42A104786009BEE0E /* JuickApp.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; @@ -777,6 +778,7 @@ CODE_SIGN_ENTITLEMENTS = Juick/Juick.entitlements; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 177; + DEAD_CODE_STRIPPING = YES; DEBUG_INFORMATION_FORMAT = dwarf; DEVELOPMENT_ASSET_PATHS = "\"JuickNext/Preview Content\""; DEVELOPMENT_TEAM = KH4MX79ZK7; @@ -828,6 +830,7 @@ CODE_SIGN_ENTITLEMENTS = Juick/Juick.entitlements; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 177; + DEAD_CODE_STRIPPING = YES; DEBUG_INFORMATION_FORMAT = dwarf; DEVELOPMENT_ASSET_PATHS = "\"JuickNext/Preview Content\""; DEVELOPMENT_TEAM = KH4MX79ZK7; @@ -879,6 +882,7 @@ CODE_SIGN_ENTITLEMENTS = Juick/Juick.entitlements; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 177; + DEAD_CODE_STRIPPING = YES; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEVELOPMENT_ASSET_PATHS = "\"JuickNext/Preview Content\""; DEVELOPMENT_TEAM = KH4MX79ZK7; @@ -908,8 +912,9 @@ PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = auto; SUPPORTED_PLATFORMS = "iphoneos iphonesimulator macosx"; + SWIFT_COMPILATION_MODE = wholemodule; SWIFT_EMIT_LOC_STRINGS = YES; - SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + SWIFT_OPTIMIZATION_LEVEL = "-O"; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; }; @@ -920,6 +925,7 @@ baseConfigurationReference = 77D40ABB218B5CC90074E14F /* Production.xcconfig */; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; @@ -951,6 +957,7 @@ DEVELOPMENT_TEAM = KH4MX79ZK7; ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_TESTABILITY = YES; + ENABLE_USER_SCRIPT_SANDBOXING = YES; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_DYNAMIC_NO_PIC = NO; GCC_NO_COMMON_BLOCKS = YES; @@ -978,6 +985,7 @@ baseConfigurationReference = 77D40ABB218B5CC90074E14F /* Production.xcconfig */; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; @@ -1009,6 +1017,7 @@ DEVELOPMENT_TEAM = KH4MX79ZK7; ENABLE_NS_ASSERTIONS = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_USER_SCRIPT_SANDBOXING = YES; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_NO_COMMON_BLOCKS = YES; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; @@ -1019,6 +1028,7 @@ GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 13.0; SDKROOT = iphoneos; + SWIFT_COMPILATION_MODE = wholemodule; SWIFT_VERSION = 5.0; VALIDATE_PRODUCT = YES; }; @@ -1095,7 +1105,11 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; INFOPLIST_FILE = JuickPush/Info.plist; "IPHONEOS_DEPLOYMENT_TARGET[sdk=macosx*]" = 14.2; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@executable_path/../../Frameworks", + ); MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; MTL_FAST_MATH = YES; PRODUCT_BUNDLE_IDENTIFIER = com.juick.Juick.JuickPush; @@ -1127,7 +1141,11 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; INFOPLIST_FILE = JuickPush/Info.plist; "IPHONEOS_DEPLOYMENT_TARGET[sdk=macosx*]" = 14.2; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@executable_path/../../Frameworks", + ); MTL_ENABLE_DEBUG_INFO = NO; MTL_FAST_MATH = YES; PRODUCT_BUNDLE_IDENTIFIER = com.juick.Juick.JuickPush; @@ -1144,6 +1162,7 @@ baseConfigurationReference = 77D40AB8218B5BD60074E14F /* Local.xcconfig */; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; @@ -1175,6 +1194,7 @@ DEVELOPMENT_TEAM = KH4MX79ZK7; ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_TESTABILITY = YES; + ENABLE_USER_SCRIPT_SANDBOXING = YES; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_DYNAMIC_NO_PIC = NO; GCC_NO_COMMON_BLOCKS = YES; @@ -1244,7 +1264,11 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; INFOPLIST_FILE = JuickPush/Info.plist; "IPHONEOS_DEPLOYMENT_TARGET[sdk=macosx*]" = 14.2; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@executable_path/../../Frameworks", + ); MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; MTL_FAST_MATH = YES; PRODUCT_BUNDLE_IDENTIFIER = com.juick.Juick.JuickPush; @@ -1273,7 +1297,11 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; INFOPLIST_FILE = JuickTests/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 14.0; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; MTL_FAST_MATH = YES; PRODUCT_BUNDLE_IDENTIFIER = com.juick.JuickTests; @@ -1302,7 +1330,11 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; INFOPLIST_FILE = JuickTests/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 14.0; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; MTL_FAST_MATH = YES; PRODUCT_BUNDLE_IDENTIFIER = com.juick.JuickTests; @@ -1331,12 +1363,17 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; INFOPLIST_FILE = JuickTests/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 14.0; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); MTL_ENABLE_DEBUG_INFO = NO; MTL_FAST_MATH = YES; PRODUCT_BUNDLE_IDENTIFIER = com.juick.JuickTests; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; TEST_TARGET_NAME = Juick; diff --git a/JuickNext/View/ContentView.swift b/JuickNext/View/ContentView.swift index 03916fc..e77d6e7 100644 --- a/JuickNext/View/ContentView.swift +++ b/JuickNext/View/ContentView.swift @@ -9,17 +9,26 @@ import SwiftUI struct ContentView: View { + @Environment(\.horizontalSizeClass) private var size var body: some View { - TabView { + let view = (size == .compact) ? + AnyView(TabView { Today() .tabItem { Image("ei-clock") } - Text("Discussions") + Discussions() .tabItem { Image("ei-bell") } - } + }): AnyView(NavigationView { + VStack { + Text("Discussions") + Text("Discover") + Text("Chats") + } + }) + view } } diff --git a/JuickNext/View/Discussions.swift b/JuickNext/View/Discussions.swift new file mode 100644 index 0000000..20e7fa8 --- /dev/null +++ b/JuickNext/View/Discussions.swift @@ -0,0 +1,21 @@ +// +// Discussions.swift +// Juick +// +// Created by Vitaly Takmazov on 14.05.2023. +// Copyright © 2023 com.juick. All rights reserved. +// + +import SwiftUI + +struct Discussions: View { + var body: some View { + Text("Discussions") + } +} + +struct Discussions_Previews: PreviewProvider { + static var previews: some View { + Discussions() + } +} diff --git a/JuickNext/View/DiscussionsView.swift b/JuickNext/View/DiscussionsView.swift deleted file mode 100644 index b8f121b..0000000 --- a/JuickNext/View/DiscussionsView.swift +++ /dev/null @@ -1,21 +0,0 @@ -// -// DiscussionsView.swift -// Juick -// -// Created by Vitaly Takmazov on 14.05.2023. -// Copyright © 2023 com.juick. All rights reserved. -// - -import SwiftUI - -struct DiscussionsView: View { - var body: some View { - Text(/*@START_MENU_TOKEN@*/"Hello, World!"/*@END_MENU_TOKEN@*/) - } -} - -struct DiscussionsView_Previews: PreviewProvider { - static var previews: some View { - DiscussionsView() - } -} diff --git a/JuickNext/View/Today.swift b/JuickNext/View/Today.swift index aa4a205..161a353 100644 --- a/JuickNext/View/Today.swift +++ b/JuickNext/View/Today.swift @@ -9,8 +9,11 @@ import SwiftUI struct Today: View { + let title = "Today" var body: some View { - Text("Today") + NavigationView { + Text(title) + } } } -- cgit v1.2.3