From 9550790a17a7cadd23a31f6e319b074902a929c7 Mon Sep 17 00:00:00 2001 From: saint Date: Wed, 15 May 2024 11:57:41 -0400 Subject: [PATCH] added hstack wrap thing --- .gitignore | 2 + gloss.xcodeproj/project.pbxproj | 119 ++-- .../xcshareddata/swiftpm/Package.resolved | 45 +- .../xcshareddata/xcschemes/gloss.xcscheme | 2 +- .../xcdebugger/Breakpoints_v2.xcbkptlist | 72 --- .../xcschemes/xcschememanagement.plist | 106 ---- gloss/ContentView.swift | 591 +++++++++--------- gloss/gloss.entitlements | 5 +- gloss/gloss.xcdatamodeld/.xccurrentversion | 8 - .../gloss.xcdatamodel/contents | 9 - 10 files changed, 344 insertions(+), 615 deletions(-) delete mode 100644 gloss.xcodeproj/xcuserdata/saint.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist delete mode 100644 gloss.xcodeproj/xcuserdata/saint.xcuserdatad/xcschemes/xcschememanagement.plist delete mode 100644 gloss/gloss.xcdatamodeld/.xccurrentversion delete mode 100644 gloss/gloss.xcdatamodeld/gloss.xcdatamodel/contents diff --git a/.gitignore b/.gitignore index 5b27d0e..e4a67c2 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ xcuserdata/ build/ .DS_Store +.fdignore +.rgignore diff --git a/gloss.xcodeproj/project.pbxproj b/gloss.xcodeproj/project.pbxproj index 1810979..6861ff3 100644 --- a/gloss.xcodeproj/project.pbxproj +++ b/gloss.xcodeproj/project.pbxproj @@ -9,24 +9,23 @@ /* Begin PBXBuildFile section */ 8514D5BC299EFB780054F185 /* store.db in Resources */ = {isa = PBXBuildFile; fileRef = 8514D5BB299EFB780054F185 /* store.db */; }; 8514D5BF299F04710054F185 /* GRDB in Frameworks */ = {isa = PBXBuildFile; productRef = 8514D5BE299F04710054F185 /* GRDB */; }; - 8514D5C2299F04A20054F185 /* GRDBQuery in Frameworks */ = {isa = PBXBuildFile; productRef = 8514D5C1299F04A20054F185 /* GRDBQuery */; }; 852774C129A150B100458CA7 /* Line.swift in Sources */ = {isa = PBXBuildFile; fileRef = 852774C029A150B100458CA7 /* Line.swift */; }; 8528897529B2B86B003F2E16 /* CrownOfThorns.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8528897429B2B86B003F2E16 /* CrownOfThorns.swift */; }; 8528897C29BD69B2003F2E16 /* VisibilityTrackingScrollView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8528897929BD69B1003F2E16 /* VisibilityTrackingScrollView.swift */; }; 8528897D29BD69B2003F2E16 /* VisibilityTrackingModifier.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8528897A29BD69B1003F2E16 /* VisibilityTrackingModifier.swift */; }; 8528897E29BD69B2003F2E16 /* VisibilityTracker.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8528897B29BD69B2003F2E16 /* VisibilityTracker.swift */; }; + 854207E22BF3E6110027A2E7 /* SwiftUIIntrospect in Frameworks */ = {isa = PBXBuildFile; productRef = 854207E12BF3E6110027A2E7 /* SwiftUIIntrospect */; }; + 854207E82BF50C310027A2E7 /* WrappingHStack in Frameworks */ = {isa = PBXBuildFile; productRef = 854207E72BF50C310027A2E7 /* WrappingHStack */; }; 85431A892905F4F500EE0760 /* glossApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 85431A882905F4F500EE0760 /* glossApp.swift */; }; 85431A8B2905F4F500EE0760 /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 85431A8A2905F4F500EE0760 /* ContentView.swift */; }; 85431A8D2905F4F600EE0760 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 85431A8C2905F4F600EE0760 /* Assets.xcassets */; }; 85431A902905F4F600EE0760 /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 85431A8F2905F4F600EE0760 /* Preview Assets.xcassets */; }; 85431A922905F4F600EE0760 /* Persistence.swift in Sources */ = {isa = PBXBuildFile; fileRef = 85431A912905F4F600EE0760 /* Persistence.swift */; }; - 85431A952905F4F600EE0760 /* gloss.xcdatamodeld in Sources */ = {isa = PBXBuildFile; fileRef = 85431A932905F4F600EE0760 /* gloss.xcdatamodeld */; }; 85431A9C2905F5D800EE0760 /* SwiftUIView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 85431A9B2905F5D800EE0760 /* SwiftUIView.swift */; }; 8590D96729A183EE001EF84F /* AppDatabase.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8590D96629A183EE001EF84F /* AppDatabase.swift */; }; 8590D96929A18A6D001EF84F /* LineRequest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8590D96829A18A6C001EF84F /* LineRequest.swift */; }; 8590D96C29A92146001EF84F /* JsonImport.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8590D96B29A92146001EF84F /* JsonImport.swift */; }; 85942EE429ACF54A00307621 /* ScrollableView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 85942EE329ACF54A00307621 /* ScrollableView.swift */; }; - 85942EE729AD083600307621 /* Introspect in Frameworks */ = {isa = PBXBuildFile; productRef = 85942EE629AD083600307621 /* Introspect */; }; 85942EE929AD51A100307621 /* Ribbon.swift in Sources */ = {isa = PBXBuildFile; fileRef = 85942EE829AD51A100307621 /* Ribbon.swift */; }; 85942EEB29AD55A400307621 /* RibbonRequest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 85942EEA29AD55A400307621 /* RibbonRequest.swift */; }; 85942EED29AEA04200307621 /* SelectedRibbon.swift in Sources */ = {isa = PBXBuildFile; fileRef = 85942EEC29AEA04200307621 /* SelectedRibbon.swift */; }; @@ -36,12 +35,11 @@ 85942EF929B1150B00307621 /* SegDenorm.swift in Sources */ = {isa = PBXBuildFile; fileRef = 85942EF829B1150B00307621 /* SegDenorm.swift */; }; 85942EFE29B11C0B00307621 /* john_export.json in Resources */ = {isa = PBXBuildFile; fileRef = 85942EFC29B11C0A00307621 /* john_export.json */; }; 85942EFF29B11C0B00307621 /* mark_export.json in Resources */ = {isa = PBXBuildFile; fileRef = 85942EFD29B11C0B00307621 /* mark_export.json */; }; - 85B267192A780FA60028FDD1 /* ReordableViews in Frameworks */ = {isa = PBXBuildFile; productRef = 85B267182A780FA60028FDD1 /* ReordableViews */; }; - 85B2671C2A7813950028FDD1 /* SwiftUIReorderableForEach in Frameworks */ = {isa = PBXBuildFile; productRef = 85B2671B2A7813950028FDD1 /* SwiftUIReorderableForEach */; }; 85E00E7C29F34D2D00FF9E78 /* ScrollState.swift in Sources */ = {isa = PBXBuildFile; fileRef = 85E00E7B29F34D2D00FF9E78 /* ScrollState.swift */; }; 85E00E7E29F34D3700FF9E78 /* ScrollStateRequest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 85E00E7D29F34D3700FF9E78 /* ScrollStateRequest.swift */; }; 85F01DF82978787800F317B4 /* AveriaSerifLibre-Regular.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 85F01DF72978787800F317B4 /* AveriaSerifLibre-Regular.ttf */; }; 85F01DFB2978790400F317B4 /* xe-Dogma-Bold.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 85F01DFA2978790400F317B4 /* xe-Dogma-Bold.ttf */; }; + 85FE3EAB2B08181600666A3A /* GRDBQuery in Frameworks */ = {isa = PBXBuildFile; productRef = 85FE3EAA2B08181600666A3A /* GRDBQuery */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ @@ -57,7 +55,6 @@ 85431A8C2905F4F600EE0760 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 85431A8F2905F4F600EE0760 /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = ""; }; 85431A912905F4F600EE0760 /* Persistence.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Persistence.swift; sourceTree = ""; }; - 85431A942905F4F600EE0760 /* gloss.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = gloss.xcdatamodel; sourceTree = ""; }; 85431A9B2905F5D800EE0760 /* SwiftUIView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SwiftUIView.swift; sourceTree = ""; }; 8590D96629A183EE001EF84F /* AppDatabase.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDatabase.swift; sourceTree = ""; }; 8590D96829A18A6C001EF84F /* LineRequest.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LineRequest.swift; sourceTree = ""; }; @@ -79,7 +76,6 @@ 85F01DFC29787B3500F317B4 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist; path = Info.plist; sourceTree = ""; }; 85F01DFD297A4EEA00F317B4 /* gloss.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = gloss.entitlements; sourceTree = ""; }; 85F01DFF297A4EEA00F317B4 /* AuthenticationServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AuthenticationServices.framework; path = System/Library/Frameworks/AuthenticationServices.framework; sourceTree = SDKROOT; }; - A7BAAF4EF300457DE01C135B /* Pods_gloss.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_gloss.framework; sourceTree = BUILT_PRODUCTS_DIR; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -87,11 +83,10 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 85B267192A780FA60028FDD1 /* ReordableViews in Frameworks */, + 854207E82BF50C310027A2E7 /* WrappingHStack in Frameworks */, + 854207E22BF3E6110027A2E7 /* SwiftUIIntrospect in Frameworks */, 8514D5BF299F04710054F185 /* GRDB in Frameworks */, - 85B2671C2A7813950028FDD1 /* SwiftUIReorderableForEach in Frameworks */, - 85942EE729AD083600307621 /* Introspect in Frameworks */, - 8514D5C2299F04A20054F185 /* GRDBQuery in Frameworks */, + 85FE3EAB2B08181600666A3A /* GRDBQuery in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -153,7 +148,6 @@ 85431A9B2905F5D800EE0760 /* SwiftUIView.swift */, 85431A8C2905F4F600EE0760 /* Assets.xcassets */, 85431A912905F4F600EE0760 /* Persistence.swift */, - 85431A932905F4F600EE0760 /* gloss.xcdatamodeld */, 85431A8E2905F4F600EE0760 /* Preview Content */, 852774C029A150B100458CA7 /* Line.swift */, ); @@ -190,7 +184,6 @@ isa = PBXGroup; children = ( 85F01DFF297A4EEA00F317B4 /* AuthenticationServices.framework */, - A7BAAF4EF300457DE01C135B /* Pods_gloss.framework */, ); name = Frameworks; sourceTree = ""; @@ -213,10 +206,9 @@ name = gloss; packageProductDependencies = ( 8514D5BE299F04710054F185 /* GRDB */, - 8514D5C1299F04A20054F185 /* GRDBQuery */, - 85942EE629AD083600307621 /* Introspect */, - 85B267182A780FA60028FDD1 /* ReordableViews */, - 85B2671B2A7813950028FDD1 /* SwiftUIReorderableForEach */, + 85FE3EAA2B08181600666A3A /* GRDBQuery */, + 854207E12BF3E6110027A2E7 /* SwiftUIIntrospect */, + 854207E72BF50C310027A2E7 /* WrappingHStack */, ); productName = gloss; productReference = 85431A852905F4F500EE0760 /* gloss.app */; @@ -230,7 +222,7 @@ attributes = { BuildIndependentTargetsInParallel = 1; LastSwiftUpdateCheck = 1320; - LastUpgradeCheck = 1420; + LastUpgradeCheck = 1430; TargetAttributes = { 85431A842905F4F500EE0760 = { CreatedOnToolsVersion = 13.2.1; @@ -249,9 +241,8 @@ packageReferences = ( 8514D5BD299F04710054F185 /* XCRemoteSwiftPackageReference "GRDB.swift" */, 8514D5C0299F04A20054F185 /* XCRemoteSwiftPackageReference "GRDBQuery" */, - 85942EE529AD083600307621 /* XCRemoteSwiftPackageReference "SwiftUI-Introspect" */, - 85B267172A780FA60028FDD1 /* XCRemoteSwiftPackageReference "ReordableViews" */, - 85B2671A2A7813950028FDD1 /* XCRemoteSwiftPackageReference "swiftui-reorderable-foreach" */, + 854207E02BF3E6110027A2E7 /* XCRemoteSwiftPackageReference "swiftui-introspect" */, + 854207E62BF50C310027A2E7 /* XCRemoteSwiftPackageReference "WrappingHStack" */, ); productRefGroup = 85431A862905F4F500EE0760 /* Products */; projectDirPath = ""; @@ -290,7 +281,6 @@ 85942EF529B108C600307621 /* Seg.swift in Sources */, 85E00E7C29F34D2D00FF9E78 /* ScrollState.swift in Sources */, 8528897529B2B86B003F2E16 /* CrownOfThorns.swift in Sources */, - 85431A952905F4F600EE0760 /* gloss.xcdatamodeld in Sources */, 85E00E7E29F34D3700FF9E78 /* ScrollStateRequest.swift in Sources */, 85942EE929AD51A100307621 /* Ribbon.swift in Sources */, 8590D96729A183EE001EF84F /* AppDatabase.swift in Sources */, @@ -424,7 +414,6 @@ IPHONEOS_DEPLOYMENT_TARGET = 15.0; MTL_ENABLE_DEBUG_INFO = NO; MTL_FAST_MATH = YES; - ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; SWIFT_COMPILATION_MODE = wholemodule; SWIFT_OPTIMIZATION_LEVEL = "-O"; @@ -439,10 +428,11 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; CODE_SIGN_ENTITLEMENTS = gloss/gloss.entitlements; + CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; DEVELOPMENT_ASSET_PATHS = "\"gloss/Preview Content\""; - DEVELOPMENT_TEAM = C8XWX9329P; + DEVELOPMENT_TEAM = V8B2B34W7R; ENABLE_PREVIEWS = YES; GENERATE_INFOPLIST_FILE = YES; INFOPLIST_FILE = gloss/Info.plist; @@ -451,14 +441,15 @@ INFOPLIST_KEY_UILaunchScreen_Generation = YES; INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; - IPHONEOS_DEPLOYMENT_TARGET = 15.0; + IPHONEOS_DEPLOYMENT_TARGET = 16.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", ); MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = com.emily.gloss; + PRODUCT_BUNDLE_IDENTIFIER = com.aingel.gloss; PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE_SPECIFIER = ""; SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; SUPPORTS_MACCATALYST = NO; SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO; @@ -475,10 +466,11 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; CODE_SIGN_ENTITLEMENTS = gloss/gloss.entitlements; + CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; DEVELOPMENT_ASSET_PATHS = "\"gloss/Preview Content\""; - DEVELOPMENT_TEAM = C8XWX9329P; + DEVELOPMENT_TEAM = V8B2B34W7R; ENABLE_PREVIEWS = YES; GENERATE_INFOPLIST_FILE = YES; INFOPLIST_FILE = gloss/Info.plist; @@ -487,14 +479,15 @@ INFOPLIST_KEY_UILaunchScreen_Generation = YES; INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; - IPHONEOS_DEPLOYMENT_TARGET = 15.0; + IPHONEOS_DEPLOYMENT_TARGET = 16.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", ); MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = com.emily.gloss; + PRODUCT_BUNDLE_IDENTIFIER = com.aingel.gloss; PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE_SPECIFIER = ""; SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; SUPPORTS_MACCATALYST = NO; SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO; @@ -544,30 +537,22 @@ minimumVersion = 0.5.1; }; }; - 85942EE529AD083600307621 /* XCRemoteSwiftPackageReference "SwiftUI-Introspect" */ = { + 854207E02BF3E6110027A2E7 /* XCRemoteSwiftPackageReference "swiftui-introspect" */ = { isa = XCRemoteSwiftPackageReference; - repositoryURL = "https://github.com/siteline/SwiftUI-Introspect.git"; - requirement = { - kind = upToNextMajorVersion; - minimumVersion = 0.2.3; - }; - }; - 85B267172A780FA60028FDD1 /* XCRemoteSwiftPackageReference "ReordableViews" */ = { - isa = XCRemoteSwiftPackageReference; - repositoryURL = "https://github.com/gadirom/ReordableViews"; - requirement = { - branch = main; - kind = branch; - }; - }; - 85B2671A2A7813950028FDD1 /* XCRemoteSwiftPackageReference "swiftui-reorderable-foreach" */ = { - isa = XCRemoteSwiftPackageReference; - repositoryURL = "https://github.com/globulus/swiftui-reorderable-foreach"; + repositoryURL = "https://github.com/siteline/swiftui-introspect"; requirement = { kind = upToNextMajorVersion; minimumVersion = 1.0.0; }; }; + 854207E62BF50C310027A2E7 /* XCRemoteSwiftPackageReference "WrappingHStack" */ = { + isa = XCRemoteSwiftPackageReference; + repositoryURL = "https://github.com/ksemianov/WrappingHStack"; + requirement = { + kind = upToNextMajorVersion; + minimumVersion = 0.2.0; + }; + }; /* End XCRemoteSwiftPackageReference section */ /* Begin XCSwiftPackageProductDependency section */ @@ -576,40 +561,22 @@ package = 8514D5BD299F04710054F185 /* XCRemoteSwiftPackageReference "GRDB.swift" */; productName = GRDB; }; - 8514D5C1299F04A20054F185 /* GRDBQuery */ = { + 854207E12BF3E6110027A2E7 /* SwiftUIIntrospect */ = { + isa = XCSwiftPackageProductDependency; + package = 854207E02BF3E6110027A2E7 /* XCRemoteSwiftPackageReference "swiftui-introspect" */; + productName = SwiftUIIntrospect; + }; + 854207E72BF50C310027A2E7 /* WrappingHStack */ = { + isa = XCSwiftPackageProductDependency; + package = 854207E62BF50C310027A2E7 /* XCRemoteSwiftPackageReference "WrappingHStack" */; + productName = WrappingHStack; + }; + 85FE3EAA2B08181600666A3A /* GRDBQuery */ = { isa = XCSwiftPackageProductDependency; package = 8514D5C0299F04A20054F185 /* XCRemoteSwiftPackageReference "GRDBQuery" */; productName = GRDBQuery; }; - 85942EE629AD083600307621 /* Introspect */ = { - isa = XCSwiftPackageProductDependency; - package = 85942EE529AD083600307621 /* XCRemoteSwiftPackageReference "SwiftUI-Introspect" */; - productName = Introspect; - }; - 85B267182A780FA60028FDD1 /* ReordableViews */ = { - isa = XCSwiftPackageProductDependency; - package = 85B267172A780FA60028FDD1 /* XCRemoteSwiftPackageReference "ReordableViews" */; - productName = ReordableViews; - }; - 85B2671B2A7813950028FDD1 /* SwiftUIReorderableForEach */ = { - isa = XCSwiftPackageProductDependency; - package = 85B2671A2A7813950028FDD1 /* XCRemoteSwiftPackageReference "swiftui-reorderable-foreach" */; - productName = SwiftUIReorderableForEach; - }; /* End XCSwiftPackageProductDependency section */ - -/* Begin XCVersionGroup section */ - 85431A932905F4F600EE0760 /* gloss.xcdatamodeld */ = { - isa = XCVersionGroup; - children = ( - 85431A942905F4F600EE0760 /* gloss.xcdatamodel */, - ); - currentVersion = 85431A942905F4F600EE0760 /* gloss.xcdatamodel */; - path = gloss.xcdatamodeld; - sourceTree = ""; - versionGroupType = wrapper.xcdatamodel; - }; -/* End XCVersionGroup section */ }; rootObject = 85431A7D2905F4F500EE0760 /* Project object */; } diff --git a/gloss.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/gloss.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index a56e30e..1c621f2 100644 --- a/gloss.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/gloss.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -1,30 +1,12 @@ { "pins" : [ - { - "identity" : "cgmath", - "kind" : "remoteSourceControl", - "location" : "https://github.com/gadirom/CGMath", - "state" : { - "revision" : "ed3125a2d6d9a98f4a7d58a4f79fc9c159498650", - "version" : "1.0.4" - } - }, - { - "identity" : "containergeometry", - "kind" : "remoteSourceControl", - "location" : "https://github.com/gadirom/ContainerGeometry", - "state" : { - "revision" : "4e6a5916da407e48ef4458bb970508527b9e05cc", - "version" : "1.0.2" - } - }, { "identity" : "grdb.swift", "kind" : "remoteSourceControl", "location" : "https://github.com/groue/GRDB.swift.git", "state" : { "branch" : "master", - "revision" : "ba68e3b02d9ed953a0c9ff43183f856f20c9b7ce" + "revision" : "f1f8e8438ad815086b48660ddf87c788f9abe966" } }, { @@ -32,17 +14,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/groue/GRDBQuery", "state" : { - "revision" : "df514f2bd74548f94e082f3233022190e594fce4", - "version" : "0.5.1" - } - }, - { - "identity" : "reordableviews", - "kind" : "remoteSourceControl", - "location" : "https://github.com/gadirom/ReordableViews", - "state" : { - "branch" : "main", - "revision" : "636703c4f4aba60bfac7c09115516db82ea354d3" + "revision" : "be64298b4f9d70510226fa7e698aef84f41cec02", + "version" : "0.7.0" } }, { @@ -50,17 +23,17 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/siteline/SwiftUI-Introspect.git", "state" : { - "revision" : "c18951c747ab62af7c15e17a81bd37d4fd5a9979", - "version" : "0.2.3" + "revision" : "7dc5b287f8040e4ad5038739850b758e78f77808", + "version" : "1.1.4" } }, { - "identity" : "swiftui-reorderable-foreach", + "identity" : "wrappinghstack", "kind" : "remoteSourceControl", - "location" : "https://github.com/globulus/swiftui-reorderable-foreach", + "location" : "https://github.com/ksemianov/WrappingHStack", "state" : { - "revision" : "47f6ca1ad906ef2ae1f872ed34a10cc615ad99ca", - "version" : "1.0.0" + "revision" : "3300f68b6bf5f8a75ee7ca8a40f136a558053d10", + "version" : "0.2.0" } } ], diff --git a/gloss.xcodeproj/xcshareddata/xcschemes/gloss.xcscheme b/gloss.xcodeproj/xcshareddata/xcschemes/gloss.xcscheme index 14ff2e7..36beb16 100644 --- a/gloss.xcodeproj/xcshareddata/xcschemes/gloss.xcscheme +++ b/gloss.xcodeproj/xcshareddata/xcschemes/gloss.xcscheme @@ -1,6 +1,6 @@ - - - - - - - - - - - - - - - - - - - - diff --git a/gloss.xcodeproj/xcuserdata/saint.xcuserdatad/xcschemes/xcschememanagement.plist b/gloss.xcodeproj/xcuserdata/saint.xcuserdatad/xcschemes/xcschememanagement.plist deleted file mode 100644 index 5c0bfdf..0000000 --- a/gloss.xcodeproj/xcuserdata/saint.xcuserdatad/xcschemes/xcschememanagement.plist +++ /dev/null @@ -1,106 +0,0 @@ - - - - - SchemeUserState - - Associations (Playground) 1.xcscheme - - isShown - - orderHint - 12 - - Associations (Playground) 2.xcscheme - - isShown - - orderHint - 13 - - Associations (Playground).xcscheme - - isShown - - orderHint - 11 - - MyPlayground (Playground) 1.xcscheme - - isShown - - orderHint - 9 - - MyPlayground (Playground) 2.xcscheme - - isShown - - orderHint - 10 - - MyPlayground (Playground).xcscheme - - isShown - - orderHint - 8 - - Tour (Playground) 1.xcscheme - - isShown - - orderHint - 6 - - Tour (Playground) 2.xcscheme - - isShown - - orderHint - 7 - - Tour (Playground).xcscheme - - isShown - - orderHint - 5 - - TransactionObserver (Playground) 1.xcscheme - - isShown - - orderHint - 3 - - TransactionObserver (Playground) 2.xcscheme - - isShown - - orderHint - 4 - - TransactionObserver (Playground).xcscheme - - isShown - - orderHint - 1 - - gloss.xcscheme_^#shared#^_ - - orderHint - 2 - - - SuppressBuildableAutocreation - - 85431A842905F4F500EE0760 - - primary - - - - - diff --git a/gloss/ContentView.swift b/gloss/ContentView.swift index c38d57c..3a98580 100644 --- a/gloss/ContentView.swift +++ b/gloss/ContentView.swift @@ -5,17 +5,16 @@ // Created by Saint on 10/23/22. // -import SwiftUI import GRDB import GRDBQuery -import Introspect +import SwiftUIIntrospect import os -import SwiftUIReorderableForEach - +import SwiftUI +import WrappingHStack let logger = Logger(subsystem: Bundle.main.bundleIdentifier!, category: "network") -var currentId : String? -var currentOffset : CGFloat? +var currentId: String? +var currentOffset: CGFloat? var gTracker: VisibilityTracker? var printCount: Int64 = 0 @@ -24,16 +23,16 @@ var disableDrop = false // var curBook = "John" -extension UserDefaults { - public func optionalInt(forKey defaultName: String) -> Int? { +public extension UserDefaults { + func optionalInt(forKey defaultName: String) -> Int? { let defaults = self if let value = defaults.value(forKey: defaultName) { return value as? Int } - return nil + return nil } - public func optionalBool(forKey defaultName: String) -> Bool? { + func optionalBool(forKey defaultName: String) -> Bool? { let defaults = self if let value = defaults.value(forKey: defaultName) { return value as? Bool @@ -49,10 +48,8 @@ func goToRibbon(selectedRibbon: Ribbon, refresh: Binding, showOverlay: Binding, appDatabase: AppDatabase, - loading: Bool - ) + loading: Bool) { - Task { // print("SELECTED RIBBON", selectedRibbon) var scrollOffsetToSave = currentOffset @@ -60,14 +57,15 @@ func goToRibbon(selectedRibbon: Ribbon, var updatedRibbon = selectedRibbon - if (selectedRibbon.id != destRibbon.id! || loading) { + if selectedRibbon.id != destRibbon.id! || loading { print("switching ribbons") // withAnimation(.spring(response: 0.05)) { - showOverlay.wrappedValue = true + // showOverlay.wrappedValue = true + showOverlay.wrappedValue = true // } - if (loading) { + if loading { currentId = destRibbon.scrollId // currentOffset = CGFloat(destRibbon.scrollOffset) } @@ -79,18 +77,17 @@ func goToRibbon(selectedRibbon: Ribbon, // print("end setting scroll offset") refresh.wrappedValue.toggle() - var updateSelectRibbon = SelectedRibbon(id: Int64(1), ribbonId: destRibbon.id!) // print("Saving selected ribbon") // print(updateSelectRibbon) do { _ = try await appDatabase.saveSelectedRibbon(&updateSelectRibbon) - } catch { + } catch { // Print("something wrong") } } - if (!loading) { + if !loading { print("not loading") updatedRibbon.scrollOffset = Int(floor(scrollOffsetToSave!)) updatedRibbon.scrollId = scrollIdToSave! @@ -118,14 +115,14 @@ extension View { } } -struct RibbonCrown : View { +struct RibbonCrown: View { var ribbon: Ribbon - @Binding var scrollId : String? - @Binding var scrollOffset : CGFloat? - @Binding var showOverlay : Bool - @Binding var refresh : Bool - var draggedRibbon : Ribbon? - var isDragging : Bool + @Binding var scrollId: String? + @Binding var scrollOffset: CGFloat? + @Binding var showOverlay: Bool + @Binding var refresh: Bool + var draggedRibbon: Ribbon? + var isDragging: Bool var height = CGFloat(45) var xOffset = CGFloat(25) @@ -135,31 +132,27 @@ struct RibbonCrown : View { @Query(SelectedRibbonRequest()) private var sr: [Ribbon] - @State var saveOffset = CGFloat() var body: some View { - ZStack { MyIcon().frame( width: CGFloat(100 * 1.66 * scale), height: CGFloat(100 * scale), alignment: .center - ) .foregroundColor(Color(UIColor(red: 0.30, green: 0.30, blue: 0.30, alpha: 0.4))) - + ).foregroundColor(Color(UIColor(red: 0.30, green: 0.30, blue: 0.30, alpha: 0.4))) .if(draggedRibbon != nil && draggedRibbon!.id == ribbon.id && isDragging) { $0.overlay(Color(red: 0.1, green: 0.1, blue: 0.1)) } - // .offset(x: 10) + // .offset(x: 10) Text(ribbon.title) .foregroundColor(Color(UIColor(red: 0.76, green: 0.76, blue: 0.76, alpha: 1.00))) // .foregroundColor(.white)) // .foregroundColor(.black) .frame(minWidth: CGFloat(70), - maxWidth: CGFloat(70), - minHeight: height, - maxHeight: height, - alignment: .center) - + maxWidth: CGFloat(70), + minHeight: height, + maxHeight: height, + alignment: .center) .if(draggedRibbon != nil && draggedRibbon!.id == ribbon.id && isDragging) { $0.overlay(Color(red: 0.1, green: 0.1, blue: 0.1)) } @@ -174,10 +167,8 @@ struct RibbonCrown : View { // .minimumScaleFactor(0.5) // .padding([.top, .bottom], 10) .font(Font.custom("AveriaSerifLibre-Regular", size: CGFloat(10))) - } - .frame(width: CGFloat(100 * 1.66 * scale + 10 ), height:CGFloat(100 * scale + 5)) - + .frame(width: CGFloat(100 * 1.66 * scale + 10), height: CGFloat(100 * scale + 5)) } } @@ -190,18 +181,18 @@ func makeVerseView(seg: SegDenorm) -> some View { var retView = Text("") var segSplit = seg.body.components(separatedBy: ";;") let decoder = JSONDecoder() - segSplit.enumerated().forEach({ (index, item) in + for (index, item) in segSplit.enumerated() { let verse = try! decoder.decode(Verse.self, from: item.data(using: .utf8)!) retView = retView + Text(String(verse.verse)) - .font(Font.custom("AveriaSerifLibre-Regular", size: 6)) - .baselineOffset(6.0) - .foregroundColor(Color.white) + .font(Font.custom("AveriaSerifLibre-Regular", size: 6)) + .baselineOffset(6.0) + .foregroundColor(Color.white) retView = retView + Text(verse.body) - .foregroundColor(Color.white) - .font(Font.custom("AveriaSerifLibre-Regular", size: 15)) - }) + .foregroundColor(Color.white) + .font(Font.custom("AveriaSerifLibre-Regular", size: 15)) + } return retView } @@ -211,86 +202,110 @@ private struct SegRow: View { var body: some View { var retView = Text("") + // .onTapGesture { + // // selectedLine = seg.id + // // Print(selectedLine) + // Print("meow") + // // Print(verse.body) + // } var segSplit = seg.body.components(separatedBy: ";;") let decoder = JSONDecoder() // Text(segSplit[0].body) // .id(seg.id) // VStack { - // ForEach(segSplit.indices) { i in - segSplit.enumerated().forEach({ (index, item) in - let verse = try! decoder.decode(Verse.self, from: item.data(using: .utf8)!) + // ForEach(segSplit.indices) { i in + segSplit.enumerated().forEach { _, item in + let verse = try! decoder.decode(Verse.self, from: item.data(using: .utf8)!) - var attributedString: AttributedString { - // var result = AttributedString("Hello World!") - var result = AttributedString(verse.body) - // result.underlineStyle = Text.LineStyle( - // pattern: .dot, color: .white) - return result - } + var attributedString: AttributedString { + // var result = AttributedString("Hello World!") + var result = AttributedString(verse.body) + // result.underlineStyle = Text.LineStyle( + // pattern: .dot, color: .white) + return result + } - retView = retView + Text(String(ribbonId)) - //retView = retView + Text(attributedString) + retView = retView + Text(String(ribbonId)) + // retView = retView + Text(attributedString) // Text(seg.body) // .contentShape(Rectangle()) .font(Font.custom("AveriaSerifLibre-Regular", size: 10)) .baselineOffset(6.0) .foregroundColor(Color(UIColor(red: 0.76, green: 0.76, blue: 0.76, alpha: 1.00))) - - retView = retView + Text(attributedString) - // .frame(maxWidth: .infinity, alignment: .leading) - // .contentShape(Rectangle()) + retView = retView + + Text(attributedString) .foregroundColor(Color(UIColor(red: 0.76, green: 0.76, blue: 0.76, alpha: 1.00))) .font(Font.custom("AveriaSerifLibre-Regular", size: 20)) - // .listRowBackground(Color(red: 0.2, green: 0.8, blue: 0.2)) - // .listRowInsets(EdgeInsets()) - // .padding(EdgeInsets(top: 10, leading: 20, bottom: 40, trailing: 20)) - // .listRowSeparator(.hidden) - // .id(String(seg.id) + "body" + String(i)) - // .id(seg.id) - //.onTapGesture { - // selectedLine = seg.id - //Print(selectedLine) - //} + // .frame(maxWidth: .infinity, alignment: .leading) + // .contentShape(Rectangle()) - // .listRowBackground(Color(red: 0.2, green: 0.8, blue: 0.2)) - // .listRowInsets(EdgeInsets()) - // .padding(EdgeInsets(top: 10, leading: 20, bottom: 40, trailing: 20)) - // .listRowSeparator(.hidden) - // .id(String(seg.id) + "verse" + String(i)) - // .id(seg.id) - //.onTapGesture { - // selectedLine = seg.id - //Print(selectedLine) - //} - }) - // } - return retView - } -} + // .listRowBackground(Color(red: 0.2, green: 0.8, blue: 0.2)) + // .listRowInsets(EdgeInsets()) + // .padding(EdgeInsets(top: 10, leading: 20, bottom: 40, trailing: 20)) + // .listRowSeparator(.hidden) + // .id(String(seg.id) + "body" + String(i)) + // .id(seg.id) + + // .listRowBackground(Color(red: 0.2, green: 0.8, blue: 0.2)) + // .listRowInsets(EdgeInsets()) + // .padding(EdgeInsets(top: 10, leading: 20, bottom: 40, trailing: 20)) + // .listRowSeparator(.hidden) + // .id(String(seg.id) + "verse" + String(i)) + // .id(seg.id) + // .onTapGesture { + // selectedLine = seg.id + // Print(selectedLine) + // } + } + // } + + let myText = "There was a man sent from God, whose name was John. This man came for a witness, to give testimony of the light, that all men might believe through him. He was not the light, but was to give testimony of the light. That was the true light, which enlighteneth every man that cometh into this world. He was in the world, and the world was made by him, and the world knew him not." + let arrayOfText = myText.components(separatedBy: " ") + + + + var wordSelected = "" + var newView = WrappingHStack(alignment: .leading, horizontalSpacing: 3.5) { + ForEach(0.. var selectedRibbon: [Ribbon] // @Query(RibbonRequest(id: Int64(UserDefaults.standard.optionalInt(forKey: "lastRibbonId") ?? 1))) private var selectedRibbon: [Ribbon] - init() { UITableView.appearance().backgroundColor = UIColor(Color(red: 0.2, green: 0.2, blue: 0.2)) - _selectedRibbon = Query(SelectedRibbonRequest()) + _selectedRibbon = Query(SelectedRibbonRequest()) // self._scrollDelegate = State(initialValue: ScrollViewHandler()) } @@ -347,43 +360,38 @@ struct ContentView: View { // } GeometryReader { geometry in - ZStack (alignment: .top) { - VStack (alignment: .leading) { + ZStack(alignment: .top) { + VStack(alignment: .leading) { VStack { // ReorderableForEach($data, allowReordering: $reorder) { item, isDragged in ForEach(ribbons) { ribbon in RibbonCrown(ribbon: ribbon, - scrollId:$scrollId, - scrollOffset:$scrollOffset, + scrollId: $scrollId, + scrollOffset: $scrollOffset, showOverlay: $showOverlay, - refresh:$refresh, + refresh: $refresh, draggedRibbon: draggedRibbon, - isDragging: isDragging - ) - .onDrag { - self.draggedRibbon = ribbon - return NSItemProvider() - } - .onDrop(of: [.item], - delegate: DropViewDelegate(destinationItem: ribbon, - draggedItem: $draggedRibbon, - isDragging: $isDragging, - appDatabase: appDatabase) - ) - .offset(x: 6, y: 6) + isDragging: isDragging) + .onDrag { + self.draggedRibbon = ribbon + return NSItemProvider() + } + .onDrop(of: [.item], + delegate: DropViewDelegate(destinationItem: ribbon, + draggedItem: $draggedRibbon, + isDragging: $isDragging, + appDatabase: appDatabase)) + .offset(x: 6, y: 6) } - // .foregroundColor(Color(UIColor(red: 0.76, green: 0.76, blue: 0.76, alpha: 1.00))) } .frame(width: geometry.size.width, height: geometry.size.height - 100, alignment: .topLeading) .background(Color(red: 0.1, green: 0.1, blue: 0.1)) .zIndex(0) .animation(.default, value: ribbons) - .onDrop(of: [.item], - delegate: DropViewDelegate2(isDragging: $isDragging) - ) + delegate: DropViewDelegate2(isDragging: $isDragging)) // Spacer() @@ -403,10 +411,9 @@ struct ContentView: View { } .background(Color(red: 0.1, green: 0.1, blue: 0.1)) .frame(alignment: .topLeading) - //.animation(nil) + // .animation(nil) VStack { - ScrollViewReader { proxy in VisibilityTrackingScrollView(action: handleVisibilityChanged) { // ScrollView { @@ -414,21 +421,20 @@ struct ContentView: View { LazyVStack { ForEach(segs) { seg in SegRow(seg: seg, - ribbonId: selectedRibbon[0].id! - ) - .id("\(seg.id)") - .offset(x: -dragOffset) - // .offset(x: pulledOut.width) + ribbonId: selectedRibbon[0].id!) + .id("\(seg.id)") + .offset(x: -dragOffset) + // .offset(x: pulledOut.width) - .padding(EdgeInsets(top: 10, leading: 20, bottom: 40, trailing: 20)) - .trackVisibility(id: "\(seg.id)") + .padding(EdgeInsets(top: 10, leading: 20, bottom: 40, trailing: 20)) + .trackVisibility(id: "\(seg.id)") // .onChange(of: geometry.frame(in: .named("scrollView"))) { imageRect in - //Print(imageRect) - //Print(outerProxy) + // Print(imageRect) + // Print(outerProxy) // if isInView(innerRect: imageRect, isIn: outerProxy) { // visibleIndex.insert(item) - // } else { + // } else { // visibleIndex.remove(item) // } // } @@ -437,7 +443,7 @@ struct ContentView: View { .background(Color(red: 0.18, green: 0.18, blue: 0.18)) } - .onAppear() { + .onAppear { Print("APPEAR") // Print(selectedRibbon[0]) // scrollId = "3" @@ -452,28 +458,26 @@ struct ContentView: View { showOverlay: $showOverlay, appDatabase: appDatabase, loading: true) - } - .onChange(of: refresh) { target in - //if let target = target { - //gTracker!.visibleViews["123123"] = CGFloat(100) + .onChange(of: refresh) { _ in + // if let target = target { + // gTracker!.visibleViews["123123"] = CGFloat(100) // Print("ON CHANGE", gTracker!.visibleViews) // Print("removing", gTracker!.visibleViews.removeAll()) Task { DispatchQueue.main.async { Print("scroll Id target: \(scrollId)") - proxy.scrollTo(scrollId! , anchor: .top) + proxy.scrollTo(scrollId!, anchor: .top) // proxy.scrollTo(String(Int(scrollId!)! + 1)) // currentId = scrollId! // if (currentId != scrollId!) { DispatchQueue.main.asyncAfter(deadline: .now() + 0.5) { - Print(" scroll id target", scrollId) Print(" current id ", currentId) Print(gTracker!.sortedViewIDs) - if (currentId! != scrollId!) { + if currentId! != scrollId! { Print("NO MATCH") } @@ -482,7 +486,7 @@ struct ContentView: View { var curOffset = gTracker!.visibleViews[scrollId!] Print(" stats", gTracker!.visibleViews) // // setScrollOffset = CGFloat(Int(currentOffset!) * -1 + Int(scrollOffset!)) - if (curOffset != nil) { + if curOffset != nil { setScrollOffset = CGFloat(Int(scrollOffset!) - Int(curOffset!)) Print("applying scroll offset \(setScrollOffset)") // // setScrollOffset = CGFloat(Int(scrollOffset!)) @@ -494,7 +498,6 @@ struct ContentView: View { setScrollOffset = CGFloat(adjust) refresh.toggle() - } // // currentId = scrollId! @@ -507,16 +510,16 @@ struct ContentView: View { } } } - .introspectScrollView { scrollView in - Print("introspect") - // scrollView.delegate = scrollDelegate - //Print("Scroll delegate offset", scrollDelegate.scrollOffset) + .introspect(.scrollView, on: .iOS(.v13, .v14, .v15, .v16, .v17)) { scrollView in Print("introspect") + // Print("Scroll delegate offset", scrollDelegate.scrollOffset) - if (setScrollOffset != nil) { + if setScrollOffset != nil { // Print("Setting scroll offset in introspect", setScrollOffset) DispatchQueue.main.async { scrollView.contentOffset.y = scrollView.contentOffset.y + setScrollOffset! setScrollOffset = nil + + // self.showOverlay = false withAnimation { showOverlay = false } @@ -536,110 +539,107 @@ struct ContentView: View { .zIndex(1) .background(Color(red: 0.2, green: 0.2, blue: 0.2)) .frame(width: geometry.size.width - 50, height: geometry.size.height / 2 - vertSep) - .offset(x:30 , y:0) + .offset(x: 30, y: 0) .offset(x: pulledOut.width) .offset(x: viewState.width, y: viewState.height) .gesture( DragGesture() - .onChanged { gesture in + .onChanged { gesture in - if (endedDrag) { - endedDrag = false - scrollOffset = readOffset.y - 20 - // _ = Print("meow") + if endedDrag { + endedDrag = false + scrollOffset = readOffset.y - 20 + // _ = Print("meow") + } + // logger.error("hello222") + // NSLog("hellooo") + Print(viewState.width) + if abs(gesture.translation.width) > 20 { + viewState.width = gesture.translation.width + if gesture.translation.width < -50, pulledOut.width == CGFloat(0) { + dragOffset = gesture.translation.width + 50 + } + } + // offset.y = gesture.translation.width + // logger.log("hello") } - // logger.error("hello222") - // NSLog("hellooo") - Print(viewState.width) - if (abs(gesture.translation.width) > 20) { - viewState.width = gesture.translation.width - if (gesture.translation.width < -50 && pulledOut.width == CGFloat(0)) { - dragOffset = gesture.translation.width + 50 + .onEnded { _ in + endedDrag = true + var pulledOutWidth = CGFloat(0) + if viewState.width < 0 { + pulledOutWidth = CGFloat(0) + } else if abs(viewState.width + pulledOut.width) > 30 { + pulledOutWidth = CGFloat(200) + } + + withAnimation(.spring(response: 0.2)) { + pulledOut.width = pulledOutWidth + viewState = .zero + dragOffset = .zero } } - //offset.y = gesture.translation.width - // logger.log("hello") - } - .onEnded { _ in - endedDrag = true - var pulledOutWidth = CGFloat(0) - if (viewState.width < 0) { - pulledOutWidth = CGFloat(0) - } - else if abs(viewState.width + pulledOut.width ) > 30 { - pulledOutWidth = CGFloat(200) - } - - withAnimation(.spring(response: 0.2)) { - pulledOut.width = pulledOutWidth - viewState = .zero - dragOffset = .zero - } - } ) - Text("DRAG").foregroundColor(Color(UIColor(red: 0.76, green: 0.76, blue: 0.76, alpha: 1.00))) - .gesture( - DragGesture() - .onChanged { gesture in + Text("separator").foregroundColor(Color(UIColor(red: 0.76, green: 0.76, blue: 0.76, alpha: 1.00))) + .gesture( + DragGesture() + .onChanged { gesture in - vertSep = vertSep - gesture.translation.height - Print(gesture.translation.width) - Print(gesture.translation.height) + vertSep = vertSep - gesture.translation.height + Print(gesture.translation.width) + Print(gesture.translation.height) - Print("drag") + Print("drag") - //if (endedDrag) { - // endedDrag = false - // scrollOffset = readOffset.y - 20 - // // _ = Print("meow") - //} - //// logger.error("hello222") - //// NSLog("hellooo") - //Print(viewState.width) - //if (abs(gesture.translation.width) > 20) { - // viewState.width = gesture.translation.width - //} - ////offset.y = gesture.translation.width - //// logger.log("hello") - } - // .onEnded { _ in - // endedDrag = true - // var pulledOutWidth = CGFloat(0) - // if (viewState.width < 0) { - // pulledOutWidth = CGFloat(0) - // } - // else if abs(viewState.width + pulledOut.width ) > 30 { - // pulledOutWidth = CGFloat(200) - // } + // if (endedDrag) { + // endedDrag = false + // scrollOffset = readOffset.y - 20 + // // _ = Print("meow") + // } + //// logger.error("hello222") + //// NSLog("hellooo") + // Print(viewState.width) + // if (abs(gesture.translation.width) > 20) { + // viewState.width = gesture.translation.width + // } + ////offset.y = gesture.translation.width + //// logger.log("hello") + } + // .onEnded { _ in + // endedDrag = true + // var pulledOutWidth = CGFloat(0) + // if (viewState.width < 0) { + // pulledOutWidth = CGFloat(0) + // } + // else if abs(viewState.width + pulledOut.width ) > 30 { + // pulledOutWidth = CGFloat(200) + // } - // withAnimation(.spring(response: 0.2)) { - // pulledOut.width = pulledOutWidth - // viewState = .zero - // } - // } - ) + // withAnimation(.spring(response: 0.2)) { + // pulledOut.width = pulledOutWidth + // viewState = .zero + // } + // } + ) - ScrollViewReader { proxy in + ScrollViewReader { _ in VisibilityTrackingScrollView(action: handleVisibilityChanged2) { // ScrollView { LazyVStack { ForEach(segs) { seg in SegRow(seg: seg, - ribbonId: selectedRibbon[0].id! - ) - .id("\(seg.id)") - - .padding(EdgeInsets(top: 10, leading: 20, bottom: 40, trailing: 20)) - .trackVisibility(id: "\(seg.id)") + ribbonId: selectedRibbon[0].id!) + .id("\(seg.id)") + .padding(EdgeInsets(top: 10, leading: 20, bottom: 40, trailing: 20)) + .trackVisibility(id: "\(seg.id)") // .onChange(of: geometry.frame(in: .named("scrollView"))) { imageRect in - //Print(imageRect) - //Print(outerProxy) + // Print(imageRect) + // Print(outerProxy) // if isInView(innerRect: imageRect, isIn: outerProxy) { // visibleIndex.insert(item) - // } else { + // } else { // visibleIndex.remove(item) // } // } @@ -648,7 +648,7 @@ struct ContentView: View { .background(Color(red: 0.18, green: 0.18, blue: 0.18)) } - .onAppear() { + .onAppear { Print("APPEAR") // Print(selectedRibbon[0]) // scrollId = "3" @@ -663,9 +663,8 @@ struct ContentView: View { // showOverlay: $showOverlay, // appDatabase: appDatabase, // loading: true) - } - //.onChange(of: refresh) { target in + // .onChange(of: refresh) { target in // //if let target = target { // //gTracker!.visibleViews["123123"] = CGFloat(100) // // Print("ON CHANGE", gTracker!.visibleViews) @@ -693,7 +692,6 @@ struct ContentView: View { // Print("NO MATCH") // } - // // Print(" scroll offset target", scrollOffset) // Print(" current offset ", gTracker!.visibleViews[scrollId!]) // var curOffset = gTracker!.visibleViews[scrollId!] @@ -723,8 +721,8 @@ struct ContentView: View { // } // } // } - //} - //.introspectScrollView { scrollView in + // } + // .introspectScrollView { scrollView in // Print("introspect") // // scrollView.delegate = scrollDelegate // //Print("Scroll delegate offset", scrollDelegate.scrollOffset) @@ -747,81 +745,72 @@ struct ContentView: View { // // } // Print("end instrospect") - //} + // } .listStyle(PlainListStyle()) } .zIndex(1) .background(Color(red: 0.2, green: 0.2, blue: 0.2)) .frame(width: geometry.size.width - 50) - .offset(x:30 , y:0) + .offset(x: 30, y: 0) .offset(x: pulledOut.width) .offset(x: viewState.width, y: viewState.height) .gesture( DragGesture() - .onChanged { gesture in + .onChanged { gesture in - if (endedDrag) { - endedDrag = false - scrollOffset = readOffset.y - 20 - // _ = Print("meow") - } - // logger.error("hello222") - // NSLog("hellooo") - Print(viewState.width) - if (abs(gesture.translation.width) > 20) { - viewState.width = gesture.translation.width - } - //offset.y = gesture.translation.width - // logger.log("hello") - } - .onEnded { _ in - endedDrag = true - var pulledOutWidth = CGFloat(0) - if (viewState.width < 0) { - pulledOutWidth = CGFloat(0) - } - else if abs(viewState.width + pulledOut.width ) > 30 { - pulledOutWidth = CGFloat(200) + if endedDrag { + endedDrag = false + scrollOffset = readOffset.y - 20 + // _ = Print("meow") + } + // logger.error("hello222") + // NSLog("hellooo") + Print(viewState.width) + if abs(gesture.translation.width) > 20 { + viewState.width = gesture.translation.width + } + // offset.y = gesture.translation.width + // logger.log("hello") } + .onEnded { _ in + endedDrag = true + var pulledOutWidth = CGFloat(0) + if viewState.width < 0 { + pulledOutWidth = CGFloat(0) + } else if abs(viewState.width + pulledOut.width) > 30 { + pulledOutWidth = CGFloat(200) + } - withAnimation(.spring(response: 0.2)) { - pulledOut.width = pulledOutWidth - viewState = .zero + withAnimation(.spring(response: 0.2)) { + pulledOut.width = pulledOutWidth + viewState = .zero + } } - } ) - } - if (showOverlay) { + if showOverlay { Rectangle() .frame(width: geometry.size.width - 50, height: geometry.size.height + 200) - .background(.ultraThinMaterial) - //.blur(radius: 0.8) - .offset(x:30, y:-100 ) + // .blur(radius: 0.8) + .offset(x: 30, y: -100) .opacity(0.98) .transition(.opacity) // .frame(width: geometry.size.width - 50) .offset(x: pulledOut.width) .offset(x: viewState.width, y: viewState.height) - .zIndex(2) } } - } } + func handleVisibilityChanged2(_: String, change _: VisibilityChange, tracker _: VisibilityTracker) {} - func handleVisibilityChanged2(_ id: String, change: VisibilityChange, tracker: VisibilityTracker) { - } - - func handleVisibilityChanged(_ id: String, change: VisibilityChange, tracker: VisibilityTracker) { - - + func handleVisibilityChanged(_: String, change _: VisibilityChange, tracker: VisibilityTracker) { // var printRate: Int64 = 10 gTracker = tracker @@ -843,8 +832,7 @@ struct ContentView: View { // } let visibleViews2 = Array(tracker.visibleViews.keys) - if (visibleViews2.count == 0) { - + if visibleViews2.count == 0 { return } @@ -857,14 +845,14 @@ struct ContentView: View { // currentOffset = tracker.visibleViews[currentId!]! // } // } - // if (currentId != nil) { - // // if (printCount % printRate == 0) { - // // print(printCount) - // // print("cat current ID:", currentId) - // // } - // // print("got here") - // currentOffset = tracker.visibleViews[currentId!]! - // } + // if (currentId != nil) { + // // if (printCount % printRate == 0) { + // // print(printCount) + // // print("cat current ID:", currentId) + // // } + // // print("got here") + // currentOffset = tracker.visibleViews[currentId!]! + // } } } @@ -878,52 +866,48 @@ private let itemFormatter: DateFormatter = { struct DropViewDelegate2: DropDelegate { @Binding var isDragging: Bool - func dropUpdated(info: DropInfo) -> DropProposal? { + func dropUpdated(info _: DropInfo) -> DropProposal? { return DropProposal(operation: .move) } - func performDrop(info: DropInfo) -> Bool { + func performDrop(info _: DropInfo) -> Bool { isDragging = false return true } - func dropEntered(info: DropInfo) { + func dropEntered(info _: DropInfo) { isDragging = true print("SECOND DROPPPOOO") } - } struct DropViewDelegate: DropDelegate { - let destinationItem: Ribbon // @Binding var colors: [Color] @Binding var draggedItem: Ribbon? @Binding var isDragging: Bool let appDatabase: AppDatabase - func dropUpdated(info: DropInfo) -> DropProposal? { + func dropUpdated(info _: DropInfo) -> DropProposal? { return DropProposal(operation: .move) } - func dropExited(info: DropInfo) { + func dropExited(info _: DropInfo) { print("EXITED") isDragging = false } - func dropEntered(info: DropInfo) { - + func dropEntered(info _: DropInfo) { Task { isDragging = true - if (draggedItem == nil) { + if draggedItem == nil { return } if disableDrop { - return; + return } - var newRibbon = draggedItem! var newDest = destinationItem @@ -935,14 +919,13 @@ struct DropViewDelegate: DropDelegate { print("dest item") print(destinationItem) - - if (draggedItem!.id! == destinationItem.id!) { + if draggedItem!.id! == destinationItem.id! { return } newRibbon.pos = destinationItem.pos - _ = try await appDatabase.updateRibbonPosition(&newRibbon, oldPos, newPos ) + _ = try await appDatabase.updateRibbonPosition(&newRibbon, oldPos, newPos) disableDrop = true DispatchQueue.main.asyncAfter(deadline: .now() + 0.5) { disableDrop = false @@ -953,7 +936,7 @@ struct DropViewDelegate: DropDelegate { } } - func performDrop(info: DropInfo) -> Bool { + func performDrop(info _: DropInfo) -> Bool { print("PERFORMED DROPPPP") draggedItem = nil isDragging = false @@ -971,7 +954,9 @@ struct ContentView_Previews: PreviewProvider { extension View { func Print(_ vars: Any...) -> some View { - for v in vars { print(v) } + for v in vars { + print(v) + } return EmptyView() } } diff --git a/gloss/gloss.entitlements b/gloss/gloss.entitlements index 6ddec55..0c67376 100644 --- a/gloss/gloss.entitlements +++ b/gloss/gloss.entitlements @@ -1,8 +1,5 @@ - - com.apple.developer.authentication-services.autofill-credential-provider - - + diff --git a/gloss/gloss.xcdatamodeld/.xccurrentversion b/gloss/gloss.xcdatamodeld/.xccurrentversion deleted file mode 100644 index d7ba2c9..0000000 --- a/gloss/gloss.xcdatamodeld/.xccurrentversion +++ /dev/null @@ -1,8 +0,0 @@ - - - - - _XCCurrentVersionName - gloss.xcdatamodel - - diff --git a/gloss/gloss.xcdatamodeld/gloss.xcdatamodel/contents b/gloss/gloss.xcdatamodeld/gloss.xcdatamodel/contents deleted file mode 100644 index 9ed2921..0000000 --- a/gloss/gloss.xcdatamodeld/gloss.xcdatamodel/contents +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file