add iOS app source code

This commit is contained in:
2023-10-10 13:49:59 +02:00
parent ea5ea207a9
commit 96c09f4977
34 changed files with 887 additions and 0 deletions

View File

@@ -0,0 +1,393 @@
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 56;
objects = {
/* Begin PBXBuildFile section */
921EDBF82A827CF200F8965C /* libreevent_entry_controlApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 921EDBF72A827CF200F8965C /* libreevent_entry_controlApp.swift */; };
921EDBFA2A827CF200F8965C /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 921EDBF92A827CF200F8965C /* ContentView.swift */; };
921EDBFC2A827CF400F8965C /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 921EDBFB2A827CF400F8965C /* Assets.xcassets */; };
921EDBFF2A827CF400F8965C /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 921EDBFE2A827CF400F8965C /* Preview Assets.xcassets */; };
92DBBD892AA9B6A6006F6094 /* LoginView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 92DBBD882AA9B6A6006F6094 /* LoginView.swift */; };
92DBBD8C2AA9C0C5006F6094 /* CodeScanner in Frameworks */ = {isa = PBXBuildFile; productRef = 92DBBD8B2AA9C0C5006F6094 /* CodeScanner */; };
92DBBD922AA9D0AF006F6094 /* Launch Screen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 92DBBD912AA9D0AF006F6094 /* Launch Screen.storyboard */; };
/* End PBXBuildFile section */
/* Begin PBXFileReference section */
921EDBF42A827CF200F8965C /* libreevent-entry-control.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "libreevent-entry-control.app"; sourceTree = BUILT_PRODUCTS_DIR; };
921EDBF72A827CF200F8965C /* libreevent_entry_controlApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = libreevent_entry_controlApp.swift; sourceTree = "<group>"; };
921EDBF92A827CF200F8965C /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = "<group>"; };
921EDBFB2A827CF400F8965C /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
921EDBFE2A827CF400F8965C /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = "<group>"; };
92DBBD882AA9B6A6006F6094 /* LoginView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LoginView.swift; sourceTree = "<group>"; };
92DBBD912AA9D0AF006F6094 /* Launch Screen.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = "Launch Screen.storyboard"; sourceTree = "<group>"; };
92DBBD932AA9D5AD006F6094 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist; path = Info.plist; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
921EDBF12A827CF200F8965C /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
92DBBD8C2AA9C0C5006F6094 /* CodeScanner in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
921EDBEB2A827CF200F8965C = {
isa = PBXGroup;
children = (
921EDBF62A827CF200F8965C /* libreevent-entry-control */,
921EDBF52A827CF200F8965C /* Products */,
);
sourceTree = "<group>";
};
921EDBF52A827CF200F8965C /* Products */ = {
isa = PBXGroup;
children = (
921EDBF42A827CF200F8965C /* libreevent-entry-control.app */,
);
name = Products;
sourceTree = "<group>";
};
921EDBF62A827CF200F8965C /* libreevent-entry-control */ = {
isa = PBXGroup;
children = (
92DBBD932AA9D5AD006F6094 /* Info.plist */,
921EDBF72A827CF200F8965C /* libreevent_entry_controlApp.swift */,
921EDBF92A827CF200F8965C /* ContentView.swift */,
92DBBD882AA9B6A6006F6094 /* LoginView.swift */,
921EDBFB2A827CF400F8965C /* Assets.xcassets */,
921EDBFD2A827CF400F8965C /* Preview Content */,
92DBBD912AA9D0AF006F6094 /* Launch Screen.storyboard */,
);
path = "libreevent-entry-control";
sourceTree = "<group>";
};
921EDBFD2A827CF400F8965C /* Preview Content */ = {
isa = PBXGroup;
children = (
921EDBFE2A827CF400F8965C /* Preview Assets.xcassets */,
);
path = "Preview Content";
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
921EDBF32A827CF200F8965C /* libreevent-entry-control */ = {
isa = PBXNativeTarget;
buildConfigurationList = 921EDC022A827CF400F8965C /* Build configuration list for PBXNativeTarget "libreevent-entry-control" */;
buildPhases = (
921EDBF02A827CF200F8965C /* Sources */,
921EDBF12A827CF200F8965C /* Frameworks */,
921EDBF22A827CF200F8965C /* Resources */,
);
buildRules = (
);
dependencies = (
);
name = "libreevent-entry-control";
packageProductDependencies = (
92DBBD8B2AA9C0C5006F6094 /* CodeScanner */,
);
productName = "libreevent-entry-control";
productReference = 921EDBF42A827CF200F8965C /* libreevent-entry-control.app */;
productType = "com.apple.product-type.application";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
921EDBEC2A827CF200F8965C /* Project object */ = {
isa = PBXProject;
attributes = {
BuildIndependentTargetsInParallel = 1;
LastSwiftUpdateCheck = 1420;
LastUpgradeCheck = 1420;
TargetAttributes = {
921EDBF32A827CF200F8965C = {
CreatedOnToolsVersion = 14.2;
};
};
};
buildConfigurationList = 921EDBEF2A827CF200F8965C /* Build configuration list for PBXProject "libreevent-entry-control" */;
compatibilityVersion = "Xcode 14.0";
developmentRegion = en;
hasScannedForEncodings = 0;
knownRegions = (
en,
Base,
);
mainGroup = 921EDBEB2A827CF200F8965C;
packageReferences = (
92DBBD8A2AA9C0C5006F6094 /* XCRemoteSwiftPackageReference "CodeScanner" */,
);
productRefGroup = 921EDBF52A827CF200F8965C /* Products */;
projectDirPath = "";
projectRoot = "";
targets = (
921EDBF32A827CF200F8965C /* libreevent-entry-control */,
);
};
/* End PBXProject section */
/* Begin PBXResourcesBuildPhase section */
921EDBF22A827CF200F8965C /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
92DBBD922AA9D0AF006F6094 /* Launch Screen.storyboard in Resources */,
921EDBFF2A827CF400F8965C /* Preview Assets.xcassets in Resources */,
921EDBFC2A827CF400F8965C /* Assets.xcassets in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
921EDBF02A827CF200F8965C /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
92DBBD892AA9B6A6006F6094 /* LoginView.swift in Sources */,
921EDBFA2A827CF200F8965C /* ContentView.swift in Sources */,
921EDBF82A827CF200F8965C /* libreevent_entry_controlApp.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin XCBuildConfiguration section */
921EDC002A827CF400F8965C /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_NONNULL = YES;
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++20";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_ENABLE_OBJC_WEAK = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = dwarf;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
GCC_C_LANGUAGE_STANDARD = gnu11;
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
);
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 16.2;
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
};
name = Debug;
};
921EDC012A827CF400F8965C /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_NONNULL = YES;
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++20";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_ENABLE_OBJC_WEAK = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = gnu11;
GCC_NO_COMMON_BLOCKS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 16.2;
MTL_ENABLE_DEBUG_INFO = NO;
MTL_FAST_MATH = YES;
SDKROOT = iphoneos;
SWIFT_COMPILATION_MODE = wholemodule;
SWIFT_OPTIMIZATION_LEVEL = "-O";
VALIDATE_PRODUCT = YES;
};
name = Release;
};
921EDC032A827CF400F8965C /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 2;
DEVELOPMENT_ASSET_PATHS = "\"libreevent-entry-control/Preview Content\"";
DEVELOPMENT_TEAM = 8CRQNHKNVF;
ENABLE_PREVIEWS = YES;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = "libreevent-entry-control/Info.plist";
INFOPLIST_KEY_CFBundleDisplayName = libreevent;
INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.business";
INFOPLIST_KEY_NSCameraUsageDescription = "We need to scan QR codes";
INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES;
INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES;
INFOPLIST_KEY_UILaunchScreen_Generation = YES;
INFOPLIST_KEY_UILaunchStoryboardName = "Launch Screen.storyboard";
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
IPHONEOS_DEPLOYMENT_TARGET = 16.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1;
PRODUCT_BUNDLE_IDENTIFIER = "com.janishutz.libreevent-entry-control";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
};
921EDC042A827CF400F8965C /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 2;
DEVELOPMENT_ASSET_PATHS = "\"libreevent-entry-control/Preview Content\"";
DEVELOPMENT_TEAM = 8CRQNHKNVF;
ENABLE_PREVIEWS = YES;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = "libreevent-entry-control/Info.plist";
INFOPLIST_KEY_CFBundleDisplayName = libreevent;
INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.business";
INFOPLIST_KEY_NSCameraUsageDescription = "We need to scan QR codes";
INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES;
INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES;
INFOPLIST_KEY_UILaunchScreen_Generation = YES;
INFOPLIST_KEY_UILaunchStoryboardName = "Launch Screen.storyboard";
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
IPHONEOS_DEPLOYMENT_TARGET = 16.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1;
PRODUCT_BUNDLE_IDENTIFIER = "com.janishutz.libreevent-entry-control";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
921EDBEF2A827CF200F8965C /* Build configuration list for PBXProject "libreevent-entry-control" */ = {
isa = XCConfigurationList;
buildConfigurations = (
921EDC002A827CF400F8965C /* Debug */,
921EDC012A827CF400F8965C /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
921EDC022A827CF400F8965C /* Build configuration list for PBXNativeTarget "libreevent-entry-control" */ = {
isa = XCConfigurationList;
buildConfigurations = (
921EDC032A827CF400F8965C /* Debug */,
921EDC042A827CF400F8965C /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
/* Begin XCRemoteSwiftPackageReference section */
92DBBD8A2AA9C0C5006F6094 /* XCRemoteSwiftPackageReference "CodeScanner" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/twostraws/CodeScanner";
requirement = {
kind = upToNextMajorVersion;
minimumVersion = 2.0.0;
};
};
/* End XCRemoteSwiftPackageReference section */
/* Begin XCSwiftPackageProductDependency section */
92DBBD8B2AA9C0C5006F6094 /* CodeScanner */ = {
isa = XCSwiftPackageProductDependency;
package = 92DBBD8A2AA9C0C5006F6094 /* XCRemoteSwiftPackageReference "CodeScanner" */;
productName = CodeScanner;
};
/* End XCSwiftPackageProductDependency section */
};
rootObject = 921EDBEC2A827CF200F8965C /* Project object */;
}

View File

@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version = "1.0">
<FileRef
location = "self:">
</FileRef>
</Workspace>

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>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>

View File

@@ -0,0 +1,14 @@
{
"pins" : [
{
"identity" : "codescanner",
"kind" : "remoteSourceControl",
"location" : "https://github.com/twostraws/CodeScanner",
"state" : {
"revision" : "bf5d7087015620b250ee6c865b3c9039fc159d1a",
"version" : "2.3.3"
}
}
],
"version" : 2
}

View File

@@ -0,0 +1,14 @@
<?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>libreevent-entry-control.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>0</integer>
</dict>
</dict>
</dict>
</plist>

View File

@@ -0,0 +1,11 @@
{
"colors" : [
{
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 920 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 801 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.8 KiB

View File

@@ -0,0 +1,158 @@
{
"images" : [
{
"filename" : "40.png",
"idiom" : "iphone",
"scale" : "2x",
"size" : "20x20"
},
{
"filename" : "60.png",
"idiom" : "iphone",
"scale" : "3x",
"size" : "20x20"
},
{
"filename" : "29.png",
"idiom" : "iphone",
"scale" : "1x",
"size" : "29x29"
},
{
"filename" : "58.png",
"idiom" : "iphone",
"scale" : "2x",
"size" : "29x29"
},
{
"filename" : "87.png",
"idiom" : "iphone",
"scale" : "3x",
"size" : "29x29"
},
{
"filename" : "80.png",
"idiom" : "iphone",
"scale" : "2x",
"size" : "40x40"
},
{
"filename" : "120.png",
"idiom" : "iphone",
"scale" : "3x",
"size" : "40x40"
},
{
"filename" : "57.png",
"idiom" : "iphone",
"scale" : "1x",
"size" : "57x57"
},
{
"filename" : "114.png",
"idiom" : "iphone",
"scale" : "2x",
"size" : "57x57"
},
{
"filename" : "120.png",
"idiom" : "iphone",
"scale" : "2x",
"size" : "60x60"
},
{
"filename" : "180.png",
"idiom" : "iphone",
"scale" : "3x",
"size" : "60x60"
},
{
"filename" : "20.png",
"idiom" : "ipad",
"scale" : "1x",
"size" : "20x20"
},
{
"filename" : "40.png",
"idiom" : "ipad",
"scale" : "2x",
"size" : "20x20"
},
{
"filename" : "29.png",
"idiom" : "ipad",
"scale" : "1x",
"size" : "29x29"
},
{
"filename" : "58.png",
"idiom" : "ipad",
"scale" : "2x",
"size" : "29x29"
},
{
"filename" : "40.png",
"idiom" : "ipad",
"scale" : "1x",
"size" : "40x40"
},
{
"filename" : "80.png",
"idiom" : "ipad",
"scale" : "2x",
"size" : "40x40"
},
{
"filename" : "50.png",
"idiom" : "ipad",
"scale" : "1x",
"size" : "50x50"
},
{
"filename" : "100.png",
"idiom" : "ipad",
"scale" : "2x",
"size" : "50x50"
},
{
"filename" : "72.png",
"idiom" : "ipad",
"scale" : "1x",
"size" : "72x72"
},
{
"filename" : "144.png",
"idiom" : "ipad",
"scale" : "2x",
"size" : "72x72"
},
{
"filename" : "76.png",
"idiom" : "ipad",
"scale" : "1x",
"size" : "76x76"
},
{
"filename" : "152.png",
"idiom" : "ipad",
"scale" : "2x",
"size" : "76x76"
},
{
"filename" : "167.png",
"idiom" : "ipad",
"scale" : "2x",
"size" : "83.5x83.5"
},
{
"filename" : "1024.png",
"idiom" : "ios-marketing",
"scale" : "1x",
"size" : "1024x1024"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

View File

@@ -0,0 +1,6 @@
{
"info" : {
"author" : "xcode",
"version" : 1
}
}

View File

@@ -0,0 +1,106 @@
//
// ContentView.swift
// libreevent-entry-control
//
// Created by Janis Hutz on 08.08.23.
//
import SwiftUI
import CodeScanner
import AVFoundation
struct ContentView: View {
@State var isShowingLoginSheet = !UserDefaults.standard.bool(forKey: "auth")
@State var isShowingTicketValid = false
@State var isShowingError = false
@State var isShowingTicketInvalid = false
@State var isShowingCredentialsWrong = false
@State var username = ""
@State var instance = ""
@State var scanResult = ""
var body: some View {
NavigationStack {
Text(String.localizedStringWithFormat(NSLocalizedString("connectionDetails", value: "You are connected to %@ as %@", comment: "This shows connection details for the "), instance, username)).padding().font(.footnote).italic()
CodeScannerView(codeTypes: [.qr], scanMode: .continuous, simulatedData: "dsgkgjkdsagjdksagdklsadgakjs_dgf", shouldVibrateOnSuccess: true, completion: handleScanAdd).navigationTitle(NSLocalizedString("app.name", value: "libreevent", comment: "Title of the app"))
.toolbar {
Button {
UserDefaults.standard.set(false, forKey: "auth")
isShowingLoginSheet = true
} label: {
Text(NSLocalizedString("toobar.logout", value: "Log out", comment: "Logout button in toolbar on main screen"))
}
}.onAppear {
username = UserDefaults.standard.string(forKey: "email") ?? ""
instance = UserDefaults.standard.string(forKey: "url") ?? ""
}.onChange(of: isShowingLoginSheet) { newValue in
if newValue == false {
print("reloading")
username = UserDefaults.standard.string(forKey: "email") ?? ""
instance = UserDefaults.standard.string(forKey: "url") ?? ""
}
}
}.sheet(isPresented: $isShowingLoginSheet) {
LoginView(isShowingLoginSheet: $isShowingLoginSheet).interactiveDismissDisabled(true)
}.alert(NSLocalizedString("lookup.error", value: "An unknown error occurred whilst looking up data. Please try again!", comment: "Tells the user that lookup of data did not succeed"), isPresented: $isShowingError) {
Button {
isShowingError = false
} label: {
Text("Ok")
}
}.alert(NSLocalizedString("lookup.invalid", value: "Ticket is INVALID!", comment: "Tells the user that the ticket scanned is not valid"), isPresented: $isShowingTicketInvalid) {
Button {
isShowingTicketInvalid = false
} label: {
Text("Ok")
}
}.alert(NSLocalizedString("lookup.valid", value: "Ticket is VALID!", comment: "Tells the user that the ticket scanned is valid"), isPresented: $isShowingTicketValid) {
Button {
isShowingTicketValid = false
} label: {
Text("Ok")
}
}.alert(NSLocalizedString("lookup.credWrong", value: "Authentication credentials are incorrect! Please reauthenticate!", comment: "Tells the user that the authentication credentials are not valid"), isPresented: $isShowingCredentialsWrong) {
Button {
isShowingCredentialsWrong = false
} label: {
Text("Ok")
}
}
}
func handleScanAdd(result: Result<ScanResult, ScanError>) {
switch result {
case.success(let result):
var req = URLRequest(url: URL(string: UserDefaults.standard.string(forKey: "url")! + "/app/ticketLookup")!)
req.httpMethod = "POST"
let body = ["email": UserDefaults.standard.string(forKey: "email")!,
"password": UserDefaults.standard.string(forKey: "password")!,
"ticketID": result.string]
let bodyData = try? JSONSerialization.data(
withJSONObject: body,
options: []
)
req.httpBody = bodyData
req.setValue("application/json", forHTTPHeaderField: "Content-Type")
let task = URLSession.shared.dataTask(with: req) { data, res, err in
if err != nil {
isShowingError = true
}
if let data = data, let dataString = String(data: data, encoding: .utf8) {
if dataString == "ticketInvalid" {
isShowingTicketInvalid = true
} else if dataString == "wrong" {
isShowingCredentialsWrong = true
} else {
isShowingTicketValid = true
}
} else {
isShowingTicketInvalid = false
}
}
task.resume()
case.failure(let error):
print(error.localizedDescription)
}
}
}

View File

@@ -0,0 +1,5 @@
<?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/>
</plist>

View File

@@ -0,0 +1,48 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="21507" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
<device id="retina6_12" orientation="portrait" appearance="light"/>
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="21505"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
<!--View Controller-->
<scene sceneID="EHf-IW-A2E">
<objects>
<viewController id="01J-lp-oVM" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
<rect key="frame" x="0.0" y="0.0" width="393" height="852"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumFontSize="9" translatesAutoresizingMaskIntoConstraints="NO" id="obG-Y5-kRd">
<rect key="frame" x="0.0" y="832" width="393" height="0.0"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="libreevent" textAlignment="center" lineBreakMode="middleTruncation" baselineAdjustment="alignBaselines" minimumFontSize="18" translatesAutoresizingMaskIntoConstraints="NO" id="GJd-Yh-RWb">
<rect key="frame" x="0.0" y="263.66666666666669" width="393" height="43"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="36"/>
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<viewLayoutGuide key="safeArea" id="Bcu-3y-fUS"/>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstItem="Bcu-3y-fUS" firstAttribute="centerX" secondItem="obG-Y5-kRd" secondAttribute="centerX" id="5cz-MP-9tL"/>
<constraint firstItem="Bcu-3y-fUS" firstAttribute="centerX" secondItem="GJd-Yh-RWb" secondAttribute="centerX" id="Q3B-4B-g5h"/>
<constraint firstItem="obG-Y5-kRd" firstAttribute="leading" secondItem="Bcu-3y-fUS" secondAttribute="leading" constant="20" symbolic="YES" id="SfN-ll-jLj"/>
<constraint firstAttribute="bottom" secondItem="obG-Y5-kRd" secondAttribute="bottom" constant="20" id="Y44-ml-fuU"/>
<constraint firstItem="GJd-Yh-RWb" firstAttribute="centerY" secondItem="Ze5-6b-2t3" secondAttribute="bottom" multiplier="1/3" constant="1" id="moa-c2-u7t"/>
<constraint firstItem="GJd-Yh-RWb" firstAttribute="leading" secondItem="Bcu-3y-fUS" secondAttribute="leading" symbolic="YES" id="x7j-FC-K8j"/>
</constraints>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="53" y="375"/>
</scene>
</scenes>
</document>

View File

@@ -0,0 +1,94 @@
//
// LoginView.swift
// libreevent-entry-control
//
// Created by Janis Hutz on 07.09.23.
//
import SwiftUI
struct LoginView: View {
@State var url: String = UserDefaults.standard.string(forKey: "url") ?? ""
@State var username: String = UserDefaults.standard.string(forKey: "email") ?? ""
@State var password: String = ""
@State var isShowingAuthError: Bool = false
@Binding var isShowingLoginSheet: Bool
@State var isShowingIncorrect: Bool = false
@State var isLogginIn = false
var body: some View {
NavigationStack {
Spacer()
VStack {
Text(NSLocalizedString("home.title", value: "Welcome to libreevent!", comment: "Title for login page")).font(.largeTitle).bold()
Spacer().frame(height: 50)
Text("Please enter the libreevent server URL, the username and password of that user in the corresponding fields below to log in")
TextField(NSLocalizedString("url", value: "libreevent server url", comment: "The field where the user is supposed to enter the libreevent server url."), text: $url).keyboardType(.URL)
TextField(NSLocalizedString("username", value: "Username", comment: "The username entry field on login screen"), text: $username).keyboardType(.emailAddress)
SecureField(NSLocalizedString("password", value: "Password", comment: "The password entry field on login screen"), text: $password)
Button {
connect()
} label: {
Text("Sign in")
}
if isLogginIn {
Text("Logging in...").padding()
}
}
Spacer()
Text(NSLocalizedString("home.explanation", value: "libreevent entry control requires a operational libreevent server instance. Click the link below for more info", comment: "")).font(.footnote).foregroundColor(.gray).italic()
Link(destination: URL(string: "https://libreevent.janishutz.com")!) {
Text("libreevent website").font(.footnote).italic()
}
Spacer().frame(height: 30).alert(NSLocalizedString("auth.error", value: "Could not authenticate! Please check that URL is correct.", comment: "Tells the user that authentication did not succeed"), isPresented: $isShowingAuthError) {
Button {
isShowingAuthError = false
} label: {
Text("Ok")
}
}.alert(NSLocalizedString("auth.incorrect", value: "Some values are incorrect!", comment: "Tells the user that authentication did not succeed"), isPresented: $isShowingIncorrect) {
Button {
isShowingIncorrect = false
} label: {
Text("Ok")
}
}
}.padding()
}
func connect() {
isLogginIn = true
var req = URLRequest(url: URL(string: $url.wrappedValue + "/app/authenticate")!)
req.httpMethod = "POST"
let body = ["email": $username.wrappedValue, "password": $password.wrappedValue]
let bodyData = try? JSONSerialization.data(
withJSONObject: body,
options: []
)
req.httpBody = bodyData
req.setValue("application/json", forHTTPHeaderField: "Content-Type")
let task = URLSession.shared.dataTask(with: req) { data, res, err in
if err != nil {
isShowingAuthError = true
}
if let data = data, let dataString = String(data: data, encoding: .utf8) {
print(dataString)
if dataString == "authOk" {
UserDefaults.standard.set(true, forKey: "auth")
UserDefaults.standard.set($username.wrappedValue, forKey: "email")
UserDefaults.standard.set($password.wrappedValue, forKey: "password")
UserDefaults.standard.set($url.wrappedValue, forKey: "url")
isShowingLoginSheet = false
isLogginIn = false
} else {
isShowingIncorrect = true
isLogginIn = false
}
} else {
isShowingIncorrect = true
isLogginIn = false
}
}
task.resume()
}
}

View File

@@ -0,0 +1,6 @@
{
"info" : {
"author" : "xcode",
"version" : 1
}
}

View File

@@ -0,0 +1,17 @@
//
// libreevent_entry_controlApp.swift
// libreevent-entry-control
//
// Created by Janis Hutz on 08.08.23.
//
import SwiftUI
@main
struct libreevent_entry_controlApp: App {
var body: some Scene {
WindowGroup {
ContentView()
}
}
}