Compare commits

..

No commits in common. "fb7dd47a96825bf86a51febdcc2bbe3ac77f283c" and "f3d52a23f7af1da61220fd35a037540562e19eff" have entirely different histories.

10 changed files with 621 additions and 357 deletions

2
.gitignore vendored
View File

@ -1,5 +1,3 @@
xcuserdata/
build/
.DS_Store
.fdignore
.rgignore

View File

@ -9,23 +9,24 @@
/* 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 */; };
@ -35,11 +36,12 @@
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 */
@ -55,6 +57,7 @@
85431A8C2905F4F600EE0760 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
85431A8F2905F4F600EE0760 /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = "<group>"; };
85431A912905F4F600EE0760 /* Persistence.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Persistence.swift; sourceTree = "<group>"; };
85431A942905F4F600EE0760 /* gloss.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = gloss.xcdatamodel; sourceTree = "<group>"; };
85431A9B2905F5D800EE0760 /* SwiftUIView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SwiftUIView.swift; sourceTree = "<group>"; };
8590D96629A183EE001EF84F /* AppDatabase.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDatabase.swift; sourceTree = "<group>"; };
8590D96829A18A6C001EF84F /* LineRequest.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LineRequest.swift; sourceTree = "<group>"; };
@ -76,6 +79,7 @@
85F01DFC29787B3500F317B4 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist; path = Info.plist; sourceTree = "<group>"; };
85F01DFD297A4EEA00F317B4 /* gloss.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = gloss.entitlements; sourceTree = "<group>"; };
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 */
@ -83,10 +87,11 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
854207E82BF50C310027A2E7 /* WrappingHStack in Frameworks */,
854207E22BF3E6110027A2E7 /* SwiftUIIntrospect in Frameworks */,
85B267192A780FA60028FDD1 /* ReordableViews in Frameworks */,
8514D5BF299F04710054F185 /* GRDB in Frameworks */,
85FE3EAB2B08181600666A3A /* GRDBQuery in Frameworks */,
85B2671C2A7813950028FDD1 /* SwiftUIReorderableForEach in Frameworks */,
85942EE729AD083600307621 /* Introspect in Frameworks */,
8514D5C2299F04A20054F185 /* GRDBQuery in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@ -148,6 +153,7 @@
85431A9B2905F5D800EE0760 /* SwiftUIView.swift */,
85431A8C2905F4F600EE0760 /* Assets.xcassets */,
85431A912905F4F600EE0760 /* Persistence.swift */,
85431A932905F4F600EE0760 /* gloss.xcdatamodeld */,
85431A8E2905F4F600EE0760 /* Preview Content */,
852774C029A150B100458CA7 /* Line.swift */,
);
@ -184,6 +190,7 @@
isa = PBXGroup;
children = (
85F01DFF297A4EEA00F317B4 /* AuthenticationServices.framework */,
A7BAAF4EF300457DE01C135B /* Pods_gloss.framework */,
);
name = Frameworks;
sourceTree = "<group>";
@ -206,9 +213,10 @@
name = gloss;
packageProductDependencies = (
8514D5BE299F04710054F185 /* GRDB */,
85FE3EAA2B08181600666A3A /* GRDBQuery */,
854207E12BF3E6110027A2E7 /* SwiftUIIntrospect */,
854207E72BF50C310027A2E7 /* WrappingHStack */,
8514D5C1299F04A20054F185 /* GRDBQuery */,
85942EE629AD083600307621 /* Introspect */,
85B267182A780FA60028FDD1 /* ReordableViews */,
85B2671B2A7813950028FDD1 /* SwiftUIReorderableForEach */,
);
productName = gloss;
productReference = 85431A852905F4F500EE0760 /* gloss.app */;
@ -222,7 +230,7 @@
attributes = {
BuildIndependentTargetsInParallel = 1;
LastSwiftUpdateCheck = 1320;
LastUpgradeCheck = 1430;
LastUpgradeCheck = 1420;
TargetAttributes = {
85431A842905F4F500EE0760 = {
CreatedOnToolsVersion = 13.2.1;
@ -241,8 +249,9 @@
packageReferences = (
8514D5BD299F04710054F185 /* XCRemoteSwiftPackageReference "GRDB.swift" */,
8514D5C0299F04A20054F185 /* XCRemoteSwiftPackageReference "GRDBQuery" */,
854207E02BF3E6110027A2E7 /* XCRemoteSwiftPackageReference "swiftui-introspect" */,
854207E62BF50C310027A2E7 /* XCRemoteSwiftPackageReference "WrappingHStack" */,
85942EE529AD083600307621 /* XCRemoteSwiftPackageReference "SwiftUI-Introspect" */,
85B267172A780FA60028FDD1 /* XCRemoteSwiftPackageReference "ReordableViews" */,
85B2671A2A7813950028FDD1 /* XCRemoteSwiftPackageReference "swiftui-reorderable-foreach" */,
);
productRefGroup = 85431A862905F4F500EE0760 /* Products */;
projectDirPath = "";
@ -281,6 +290,7 @@
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 */,
@ -414,6 +424,7 @@
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";
@ -428,11 +439,10 @@
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 = V8B2B34W7R;
DEVELOPMENT_TEAM = C8XWX9329P;
ENABLE_PREVIEWS = YES;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = gloss/Info.plist;
@ -441,15 +451,14 @@
INFOPLIST_KEY_UILaunchScreen_Generation = YES;
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
IPHONEOS_DEPLOYMENT_TARGET = 16.0;
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = com.aingel.gloss;
PRODUCT_BUNDLE_IDENTIFIER = com.emily.gloss;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
SUPPORTS_MACCATALYST = NO;
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO;
@ -466,11 +475,10 @@
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 = V8B2B34W7R;
DEVELOPMENT_TEAM = C8XWX9329P;
ENABLE_PREVIEWS = YES;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = gloss/Info.plist;
@ -479,15 +487,14 @@
INFOPLIST_KEY_UILaunchScreen_Generation = YES;
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
IPHONEOS_DEPLOYMENT_TARGET = 16.0;
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = com.aingel.gloss;
PRODUCT_BUNDLE_IDENTIFIER = com.emily.gloss;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
SUPPORTS_MACCATALYST = NO;
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO;
@ -537,22 +544,30 @@
minimumVersion = 0.5.1;
};
};
854207E02BF3E6110027A2E7 /* XCRemoteSwiftPackageReference "swiftui-introspect" */ = {
85942EE529AD083600307621 /* XCRemoteSwiftPackageReference "SwiftUI-Introspect" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/siteline/swiftui-introspect";
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";
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 */
@ -561,22 +576,40 @@
package = 8514D5BD299F04710054F185 /* XCRemoteSwiftPackageReference "GRDB.swift" */;
productName = GRDB;
};
854207E12BF3E6110027A2E7 /* SwiftUIIntrospect */ = {
isa = XCSwiftPackageProductDependency;
package = 854207E02BF3E6110027A2E7 /* XCRemoteSwiftPackageReference "swiftui-introspect" */;
productName = SwiftUIIntrospect;
};
854207E72BF50C310027A2E7 /* WrappingHStack */ = {
isa = XCSwiftPackageProductDependency;
package = 854207E62BF50C310027A2E7 /* XCRemoteSwiftPackageReference "WrappingHStack" */;
productName = WrappingHStack;
};
85FE3EAA2B08181600666A3A /* GRDBQuery */ = {
8514D5C1299F04A20054F185 /* 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 = "<group>";
versionGroupType = wrapper.xcdatamodel;
};
/* End XCVersionGroup section */
};
rootObject = 85431A7D2905F4F500EE0760 /* Project object */;
}

View File

@ -1,12 +1,30 @@
{
"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" : "f1f8e8438ad815086b48660ddf87c788f9abe966"
"revision" : "ba68e3b02d9ed953a0c9ff43183f856f20c9b7ce"
}
},
{
@ -14,8 +32,17 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/groue/GRDBQuery",
"state" : {
"revision" : "be64298b4f9d70510226fa7e698aef84f41cec02",
"version" : "0.7.0"
"revision" : "df514f2bd74548f94e082f3233022190e594fce4",
"version" : "0.5.1"
}
},
{
"identity" : "reordableviews",
"kind" : "remoteSourceControl",
"location" : "https://github.com/gadirom/ReordableViews",
"state" : {
"branch" : "main",
"revision" : "636703c4f4aba60bfac7c09115516db82ea354d3"
}
},
{
@ -23,17 +50,17 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/siteline/SwiftUI-Introspect.git",
"state" : {
"revision" : "7dc5b287f8040e4ad5038739850b758e78f77808",
"version" : "1.1.4"
"revision" : "c18951c747ab62af7c15e17a81bd37d4fd5a9979",
"version" : "0.2.3"
}
},
{
"identity" : "wrappinghstack",
"identity" : "swiftui-reorderable-foreach",
"kind" : "remoteSourceControl",
"location" : "https://github.com/ksemianov/WrappingHStack",
"location" : "https://github.com/globulus/swiftui-reorderable-foreach",
"state" : {
"revision" : "3300f68b6bf5f8a75ee7ca8a40f136a558053d10",
"version" : "0.2.0"
"revision" : "47f6ca1ad906ef2ae1f872ed34a10cc615ad99ca",
"version" : "1.0.0"
}
}
],

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1430"
LastUpgradeVersion = "1420"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"

View File

@ -0,0 +1,72 @@
<?xml version="1.0" encoding="UTF-8"?>
<Bucket
uuid = "2FEB6A3D-6E5D-4217-8815-CC53223502A6"
type = "1"
version = "2.0">
<Breakpoints>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
uuid = "19620363-AF5F-4353-862D-4E40746274F5"
shouldBeEnabled = "No"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "gloss/ContentView.swift"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "572"
endingLineNumber = "572"
landmarkName = "body"
landmarkType = "24">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
uuid = "A3202903-6BE5-4879-8970-4CE7B825E6DD"
shouldBeEnabled = "No"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "gloss/ContentView.swift"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "574"
endingLineNumber = "574"
landmarkName = "body"
landmarkType = "24">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
uuid = "DCBFFF14-138E-43D2-BA78-A5265A13CD4F"
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "gloss/ContentView.swift"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "465"
endingLineNumber = "465"
landmarkName = "body"
landmarkType = "24">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
uuid = "1FDEB1B0-A696-4F5A-86AB-30728070E82F"
shouldBeEnabled = "No"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "gloss/ContentView.swift"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "433"
endingLineNumber = "433"
landmarkName = "body"
landmarkType = "24">
</BreakpointContent>
</BreakpointProxy>
</Breakpoints>
</Bucket>

View File

@ -0,0 +1,106 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>SchemeUserState</key>
<dict>
<key>Associations (Playground) 1.xcscheme</key>
<dict>
<key>isShown</key>
<false/>
<key>orderHint</key>
<integer>12</integer>
</dict>
<key>Associations (Playground) 2.xcscheme</key>
<dict>
<key>isShown</key>
<false/>
<key>orderHint</key>
<integer>13</integer>
</dict>
<key>Associations (Playground).xcscheme</key>
<dict>
<key>isShown</key>
<false/>
<key>orderHint</key>
<integer>11</integer>
</dict>
<key>MyPlayground (Playground) 1.xcscheme</key>
<dict>
<key>isShown</key>
<false/>
<key>orderHint</key>
<integer>9</integer>
</dict>
<key>MyPlayground (Playground) 2.xcscheme</key>
<dict>
<key>isShown</key>
<false/>
<key>orderHint</key>
<integer>10</integer>
</dict>
<key>MyPlayground (Playground).xcscheme</key>
<dict>
<key>isShown</key>
<false/>
<key>orderHint</key>
<integer>8</integer>
</dict>
<key>Tour (Playground) 1.xcscheme</key>
<dict>
<key>isShown</key>
<false/>
<key>orderHint</key>
<integer>6</integer>
</dict>
<key>Tour (Playground) 2.xcscheme</key>
<dict>
<key>isShown</key>
<false/>
<key>orderHint</key>
<integer>7</integer>
</dict>
<key>Tour (Playground).xcscheme</key>
<dict>
<key>isShown</key>
<false/>
<key>orderHint</key>
<integer>5</integer>
</dict>
<key>TransactionObserver (Playground) 1.xcscheme</key>
<dict>
<key>isShown</key>
<false/>
<key>orderHint</key>
<integer>3</integer>
</dict>
<key>TransactionObserver (Playground) 2.xcscheme</key>
<dict>
<key>isShown</key>
<false/>
<key>orderHint</key>
<integer>4</integer>
</dict>
<key>TransactionObserver (Playground).xcscheme</key>
<dict>
<key>isShown</key>
<false/>
<key>orderHint</key>
<integer>1</integer>
</dict>
<key>gloss.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>2</integer>
</dict>
</dict>
<key>SuppressBuildableAutocreation</key>
<dict>
<key>85431A842905F4F500EE0760</key>
<dict>
<key>primary</key>
<true/>
</dict>
</dict>
</dict>
</plist>

View File

@ -5,16 +5,17 @@
// Created by Saint on 10/23/22.
//
import SwiftUI
import GRDB
import GRDBQuery
import SwiftUIIntrospect
import Introspect
import os
import SwiftUI
import WrappingHStack
import SwiftUIReorderableForEach
let logger = Logger(subsystem: Bundle.main.bundleIdentifier!, category: "network")
var currentId: String?
var currentOffset: CGFloat?
var currentId : String?
var currentOffset : CGFloat?
var gTracker: VisibilityTracker<String>?
var printCount: Int64 = 0
@ -23,8 +24,8 @@ var disableDrop = false
// var curBook = "John"
public extension UserDefaults {
func optionalInt(forKey defaultName: String) -> Int? {
extension UserDefaults {
public func optionalInt(forKey defaultName: String) -> Int? {
let defaults = self
if let value = defaults.value(forKey: defaultName) {
return value as? Int
@ -32,7 +33,7 @@ public extension UserDefaults {
return nil
}
func optionalBool(forKey defaultName: String) -> Bool? {
public func optionalBool(forKey defaultName: String) -> Bool? {
let defaults = self
if let value = defaults.value(forKey: defaultName) {
return value as? Bool
@ -48,8 +49,10 @@ func goToRibbon(selectedRibbon: Ribbon,
refresh: Binding<Bool>,
showOverlay: Binding<Bool>,
appDatabase: AppDatabase,
loading: Bool)
loading: Bool
)
{
Task {
// print("SELECTED RIBBON", selectedRibbon)
var scrollOffsetToSave = currentOffset
@ -57,15 +60,14 @@ 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
// }
if loading {
if (loading) {
currentId = destRibbon.scrollId
// currentOffset = CGFloat(destRibbon.scrollOffset)
}
@ -77,6 +79,7 @@ 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)
@ -87,7 +90,7 @@ func goToRibbon(selectedRibbon: Ribbon,
}
}
if !loading {
if (!loading) {
print("not loading")
updatedRibbon.scrollOffset = Int(floor(scrollOffsetToSave!))
updatedRibbon.scrollId = scrollIdToSave!
@ -115,14 +118,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)
@ -132,15 +135,16 @@ 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)))
.contentShape(.dragPreview, RoundedRectangle(cornerRadius: 32))
) .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)) }
@ -156,6 +160,7 @@ struct RibbonCrown: View {
maxHeight: height,
alignment: .center)
.if(draggedRibbon != nil && draggedRibbon!.id == ribbon.id && isDragging) { $0.overlay(Color(red: 0.1, green: 0.1, blue: 0.1)) }
// .if(!isDragging || draggedRibbon == nil || draggedRibbon!.id != ribbon.id) { $0.background(Color(red: 0.1, green: 0.1, blue: 0.1)) }
@ -169,8 +174,10 @@ 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))
}
}
@ -183,7 +190,7 @@ func makeVerseView(seg: SegDenorm) -> some View {
var retView = Text("")
var segSplit = seg.body.components(separatedBy: ";;")
let decoder = JSONDecoder()
for (index, item) in segSplit.enumerated() {
segSplit.enumerated().forEach({ (index, item) in
let verse = try! decoder.decode(Verse.self, from: item.data(using: .utf8)!)
retView = retView + Text(String(verse.verse))
@ -194,7 +201,7 @@ func makeVerseView(seg: SegDenorm) -> some View {
retView = retView + Text(verse.body)
.foregroundColor(Color.white)
.font(Font.custom("AveriaSerifLibre-Regular", size: 15))
}
})
return retView
}
@ -203,36 +210,48 @@ private struct SegRow: View {
var ribbonId: Int64
var body: some View {
var retView = Text("")
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)!)
// var attributedString: AttributedString {
// // var result = AttributedString("Hello World!")
// var result = AttributedString(verse.verse)
// // 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)
// // 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(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)
// .foregroundColor(Color(UIColor(red: 0.76, green: 0.76, blue: 0.76, alpha: 1.00)))
// .font(Font.custom("AveriaSerifLibre-Regular", size: 20))
// // .frame(maxWidth: .infinity, alignment: .leading)
// // .contentShape(Rectangle())
retView = retView + Text(attributedString)
// .frame(maxWidth: .infinity, alignment: .leading)
// .contentShape(Rectangle())
.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)
//}
// .listRowBackground(Color(red: 0.2, green: 0.8, blue: 0.2))
// .listRowInsets(EdgeInsets())
@ -240,72 +259,30 @@ private struct SegRow: View {
// .listRowSeparator(.hidden)
// .id(String(seg.id) + "verse" + String(i))
// .id(seg.id)
// .onTapGesture {
//.onTapGesture {
// selectedLine = seg.id
// Print(selectedLine)
//Print(selectedLine)
//}
})
// }
var segSplit = seg.body.components(separatedBy: ";;")
let decoder = JSONDecoder()
var retView = WrappingHStack(alignment: .leading, horizontalSpacing: 3.5) {
// segSplit.enumerated().forEach { _, item in
ForEach(0..<segSplit.count, id: \.self) { segIndex in
let verse = try! decoder.decode(Verse.self, from: segSplit[segIndex].data(using: .utf8)!)
let arrayOfText = verse.body.components(separatedBy: " ")
ForEach(0..<arrayOfText.count, id: \.self) { index in
HStack (spacing: 2) {
if index == 0 {
Text(String(verse.verse))
.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)))
}
Text(arrayOfText[index])
.foregroundColor(Color(UIColor(red: 0.76, green: 0.76, blue: 0.76, alpha: 1.00)))
.font(Font.custom("AveriaSerifLibre-Regular", size: 20))
.foregroundColor(Color.white)
.padding(.horizontal, 0)
.onTapGesture {
Print(arrayOfText[index])
Print(index)
}
}
// .if( index == 0 ) { $0.offset(x: -6) }
}
}
}
return retView
}
}
struct ContentView: View {
@State var viewState = CGSize.zero
@State var pulledOut = CGSize.zero
@State var taskTitle: String = "FIRST DOGGG"
@State var curBook: String = "Matthew"
@State var selectedLine: Int64?
@State var taskTitle : String = "FIRST DOGGG"
@State var curBook : String = "Matthew"
@State var selectedLine : Int64?
@State var thisScrollView: UIScrollView?
@State var thisScrollView : UIScrollView?
@State var scrollUpdate = false
@State var initLoad = false
// set this to scroll to area
@State var scrollId: String?
@State var scrollId : String?
@State var scrollOffset: CGFloat?
@State var setScrollOffset: CGFloat?
@ -313,6 +290,7 @@ struct ContentView: View {
@State var vertSep = CGFloat(20)
@Environment(\.appDatabase) private var appDatabase
@Query(SegDenormRequest(book: "bible.mark")) private var segs: [SegDenorm]
@ -338,11 +316,13 @@ struct ContentView: View {
@State var reorder = true
@Query(RibbonRequest()) private var ribbons: [Ribbon]
@Query<SelectedRibbonRequest> 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())
@ -367,18 +347,19 @@ 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)
isDragging: isDragging
)
.onDrag {
self.draggedRibbon = ribbon
return NSItemProvider()
@ -387,18 +368,22 @@ struct ContentView: View {
delegate: DropViewDelegate(destinationItem: ribbon,
draggedItem: $draggedRibbon,
isDragging: $isDragging,
appDatabase: appDatabase))
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()
@ -418,9 +403,10 @@ 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 {
@ -428,7 +414,8 @@ struct ContentView: View {
LazyVStack {
ForEach(segs) { seg in
SegRow(seg: seg,
ribbonId: selectedRibbon[0].id!)
ribbonId: selectedRibbon[0].id!
)
.id("\(seg.id)")
.offset(x: -dragOffset)
// .offset(x: pulledOut.width)
@ -437,8 +424,8 @@ struct ContentView: View {
.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 {
@ -450,7 +437,7 @@ struct ContentView: View {
.background(Color(red: 0.18, green: 0.18, blue: 0.18))
}
.onAppear {
.onAppear() {
Print("APPEAR")
// Print(selectedRibbon[0])
// scrollId = "3"
@ -465,26 +452,28 @@ struct ContentView: View {
showOverlay: $showOverlay,
appDatabase: appDatabase,
loading: true)
}
.onChange(of: refresh) { _ in
// if let target = target {
// gTracker!.visibleViews["123123"] = CGFloat(100)
.onChange(of: refresh) { target 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")
}
@ -493,7 +482,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!))
@ -505,6 +494,7 @@ struct ContentView: View {
setScrollOffset = CGFloat(adjust)
refresh.toggle()
}
// // currentId = scrollId!
@ -517,16 +507,16 @@ struct ContentView: View {
}
}
}
.introspect(.scrollView, on: .iOS(.v13, .v14, .v15, .v16, .v17)) { scrollView in Print("introspect")
// Print("Scroll delegate offset", scrollDelegate.scrollOffset)
.introspectScrollView { scrollView in
Print("introspect")
// scrollView.delegate = scrollDelegate
//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
}
@ -546,14 +536,14 @@ 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
if endedDrag {
if (endedDrag) {
endedDrag = false
scrollOffset = readOffset.y - 20
// _ = Print("meow")
@ -561,21 +551,22 @@ struct ContentView: View {
// logger.error("hello222")
// NSLog("hellooo")
Print(viewState.width)
if abs(gesture.translation.width) > 20 {
if (abs(gesture.translation.width) > 20) {
viewState.width = gesture.translation.width
if gesture.translation.width < -50, pulledOut.width == CGFloat(0) {
if (gesture.translation.width < -50 && pulledOut.width == CGFloat(0)) {
dragOffset = gesture.translation.width + 50
}
}
// offset.y = gesture.translation.width
//offset.y = gesture.translation.width
// logger.log("hello")
}
.onEnded { _ in
endedDrag = true
var pulledOutWidth = CGFloat(0)
if viewState.width < 0 {
if (viewState.width < 0) {
pulledOutWidth = CGFloat(0)
} else if abs(viewState.width + pulledOut.width) > 30 {
}
else if abs(viewState.width + pulledOut.width ) > 30 {
pulledOutWidth = CGFloat(200)
}
@ -587,7 +578,7 @@ struct ContentView: View {
}
)
Text("separator").foregroundColor(Color(UIColor(red: 0.76, green: 0.76, blue: 0.76, alpha: 1.00)))
Text("DRAG").foregroundColor(Color(UIColor(red: 0.76, green: 0.76, blue: 0.76, alpha: 1.00)))
.gesture(
DragGesture()
.onChanged { gesture in
@ -598,17 +589,17 @@ struct ContentView: View {
Print("drag")
// if (endedDrag) {
//if (endedDrag) {
// endedDrag = false
// scrollOffset = readOffset.y - 20
// // _ = Print("meow")
// }
//}
//// logger.error("hello222")
//// NSLog("hellooo")
// Print(viewState.width)
// if (abs(gesture.translation.width) > 20) {
//Print(viewState.width)
//if (abs(gesture.translation.width) > 20) {
// viewState.width = gesture.translation.width
// }
//}
////offset.y = gesture.translation.width
//// logger.log("hello")
}
@ -629,21 +620,23 @@ struct ContentView: View {
// }
)
ScrollViewReader { _ in
ScrollViewReader { proxy in
VisibilityTrackingScrollView(action: handleVisibilityChanged2) {
// ScrollView {
LazyVStack {
ForEach(segs) { seg in
SegRow(seg: seg,
ribbonId: selectedRibbon[0].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 {
@ -655,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"
@ -670,8 +663,9 @@ 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)
@ -699,6 +693,7 @@ struct ContentView: View {
// Print("NO MATCH")
// }
// // Print(" scroll offset target", scrollOffset)
// Print(" current offset ", gTracker!.visibleViews[scrollId!])
// var curOffset = gTracker!.visibleViews[scrollId!]
@ -728,8 +723,8 @@ struct ContentView: View {
// }
// }
// }
// }
// .introspectScrollView { scrollView in
//}
//.introspectScrollView { scrollView in
// Print("introspect")
// // scrollView.delegate = scrollDelegate
// //Print("Scroll delegate offset", scrollDelegate.scrollOffset)
@ -752,20 +747,20 @@ 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
if endedDrag {
if (endedDrag) {
endedDrag = false
scrollOffset = readOffset.y - 20
// _ = Print("meow")
@ -773,18 +768,19 @@ struct ContentView: View {
// logger.error("hello222")
// NSLog("hellooo")
Print(viewState.width)
if abs(gesture.translation.width) > 20 {
if (abs(gesture.translation.width) > 20) {
viewState.width = gesture.translation.width
}
// offset.y = gesture.translation.width
//offset.y = gesture.translation.width
// logger.log("hello")
}
.onEnded { _ in
endedDrag = true
var pulledOutWidth = CGFloat(0)
if viewState.width < 0 {
if (viewState.width < 0) {
pulledOutWidth = CGFloat(0)
} else if abs(viewState.width + pulledOut.width) > 30 {
}
else if abs(viewState.width + pulledOut.width ) > 30 {
pulledOutWidth = CGFloat(200)
}
@ -794,30 +790,38 @@ struct ContentView: View {
}
}
)
}
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<String>) {}
func handleVisibilityChanged(_: String, change _: VisibilityChange, tracker: VisibilityTracker<String>) {
func handleVisibilityChanged2(_ id: String, change: VisibilityChange, tracker: VisibilityTracker<String>) {
}
func handleVisibilityChanged(_ id: String, change: VisibilityChange, tracker: VisibilityTracker<String>) {
// var printRate: Int64 = 10
gTracker = tracker
@ -839,7 +843,8 @@ struct ContentView: View {
// }
let visibleViews2 = Array(tracker.visibleViews.keys)
if visibleViews2.count == 0 {
if (visibleViews2.count == 0) {
return
}
@ -873,48 +878,52 @@ 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
@ -926,13 +935,14 @@ 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
@ -943,7 +953,7 @@ struct DropViewDelegate: DropDelegate {
}
}
func performDrop(info _: DropInfo) -> Bool {
func performDrop(info: DropInfo) -> Bool {
print("PERFORMED DROPPPP")
draggedItem = nil
isDragging = false
@ -961,9 +971,7 @@ 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()
}
}

View File

@ -1,5 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict/>
<dict>
<key>com.apple.developer.authentication-services.autofill-credential-provider</key>
<true/>
</dict>
</plist>

View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>_XCCurrentVersionName</key>
<string>gloss.xcdatamodel</string>
</dict>
</plist>

View File

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<model type="com.apple.IDECoreDataModeler.DataModel" documentVersion="1.0" lastSavedToolsVersion="1" systemVersion="11A491" minimumToolsVersion="Automatic" sourceLanguage="Swift" usedWithCloudKit="false" userDefinedModelVersionIdentifier="">
<entity name="Item" representedClassName="Item" syncable="YES" codeGenerationType="class">
<attribute name="timestamp" optional="YES" attributeType="Date" usesScalarValueType="NO"/>
</entity>
<elements>
<element name="Item" positionX="-63" positionY="-18" width="128" height="44"/>
</elements>
</model>