diff --git a/BEMCheckBox Demo App SwiftUI/BEMCheckBox Demo App SwiftUI.xcodeproj/project.pbxproj b/BEMCheckBox Demo App SwiftUI/BEMCheckBox Demo App SwiftUI.xcodeproj/project.pbxproj new file mode 100644 index 0000000..3c915c7 --- /dev/null +++ b/BEMCheckBox Demo App SwiftUI/BEMCheckBox Demo App SwiftUI.xcodeproj/project.pbxproj @@ -0,0 +1,357 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 77; + objects = { + +/* Begin PBXBuildFile section */ + CBAFA0312DBEA9AB005297AF /* BEMCheckBox in Frameworks */ = {isa = PBXBuildFile; productRef = CBAFA0302DBEA9AB005297AF /* BEMCheckBox */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + CBAFA0152DBDD3B6005297AF /* BEMCheckBox Demo App SwiftUI.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "BEMCheckBox Demo App SwiftUI.app"; sourceTree = BUILT_PRODUCTS_DIR; }; +/* End PBXFileReference section */ + +/* Begin PBXFileSystemSynchronizedRootGroup section */ + CBAFA0172DBDD3B6005297AF /* BEMCheckBox Demo App SwiftUI */ = { + isa = PBXFileSystemSynchronizedRootGroup; + path = "BEMCheckBox Demo App SwiftUI"; + sourceTree = ""; + }; +/* End PBXFileSystemSynchronizedRootGroup section */ + +/* Begin PBXFrameworksBuildPhase section */ + CBAFA0122DBDD3B6005297AF /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + CBAFA0312DBEA9AB005297AF /* BEMCheckBox in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + CBAFA00C2DBDD3B6005297AF = { + isa = PBXGroup; + children = ( + CBAFA0172DBDD3B6005297AF /* BEMCheckBox Demo App SwiftUI */, + CBAFA0162DBDD3B6005297AF /* Products */, + ); + sourceTree = ""; + }; + CBAFA0162DBDD3B6005297AF /* Products */ = { + isa = PBXGroup; + children = ( + CBAFA0152DBDD3B6005297AF /* BEMCheckBox Demo App SwiftUI.app */, + ); + name = Products; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + CBAFA0142DBDD3B6005297AF /* BEMCheckBox Demo App SwiftUI */ = { + isa = PBXNativeTarget; + buildConfigurationList = CBAFA0232DBDD3B8005297AF /* Build configuration list for PBXNativeTarget "BEMCheckBox Demo App SwiftUI" */; + buildPhases = ( + CBAFA0112DBDD3B6005297AF /* Sources */, + CBAFA0122DBDD3B6005297AF /* Frameworks */, + CBAFA0132DBDD3B6005297AF /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + fileSystemSynchronizedGroups = ( + CBAFA0172DBDD3B6005297AF /* BEMCheckBox Demo App SwiftUI */, + ); + name = "BEMCheckBox Demo App SwiftUI"; + packageProductDependencies = ( + CBAFA0302DBEA9AB005297AF /* BEMCheckBox */, + ); + productName = "BEMCheckBox Demo App SwiftUI"; + productReference = CBAFA0152DBDD3B6005297AF /* BEMCheckBox Demo App SwiftUI.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + CBAFA00D2DBDD3B6005297AF /* Project object */ = { + isa = PBXProject; + attributes = { + BuildIndependentTargetsInParallel = 1; + LastSwiftUpdateCheck = 1620; + LastUpgradeCheck = 1620; + TargetAttributes = { + CBAFA0142DBDD3B6005297AF = { + CreatedOnToolsVersion = 16.2; + }; + }; + }; + buildConfigurationList = CBAFA0102DBDD3B6005297AF /* Build configuration list for PBXProject "BEMCheckBox Demo App SwiftUI" */; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = CBAFA00C2DBDD3B6005297AF; + minimizedProjectReferenceProxies = 1; + packageReferences = ( + CBAFA02F2DBEA9AB005297AF /* XCRemoteSwiftPackageReference "BEMCheckBox" */, + ); + preferredProjectObjectVersion = 77; + productRefGroup = CBAFA0162DBDD3B6005297AF /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + CBAFA0142DBDD3B6005297AF /* BEMCheckBox Demo App SwiftUI */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + CBAFA0132DBDD3B6005297AF /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + CBAFA0112DBDD3B6005297AF /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin XCBuildConfiguration section */ + CBAFA0212DBDD3B8005297AF /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; + 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; + ENABLE_USER_SCRIPT_SANDBOXING = YES; + GCC_C_LANGUAGE_STANDARD = gnu17; + 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 = 18.2; + LOCALIZATION_PREFERS_STRING_CATALOGS = YES; + MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; + MTL_FAST_MATH = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = "DEBUG $(inherited)"; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + }; + name = Debug; + }; + CBAFA0222DBDD3B8005297AF /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; + 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; + ENABLE_USER_SCRIPT_SANDBOXING = YES; + GCC_C_LANGUAGE_STANDARD = gnu17; + 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 = 18.2; + LOCALIZATION_PREFERS_STRING_CATALOGS = YES; + MTL_ENABLE_DEBUG_INFO = NO; + MTL_FAST_MATH = YES; + SDKROOT = iphoneos; + SWIFT_COMPILATION_MODE = wholemodule; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + CBAFA0242DBDD3B8005297AF /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + DEVELOPMENT_ASSET_PATHS = "\"BEMCheckBox Demo App SwiftUI/Preview Content\""; + DEVELOPMENT_TEAM = 9VG278DXB2; + ENABLE_PREVIEWS = YES; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES; + INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; + INFOPLIST_KEY_UILaunchScreen_Generation = YES; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = "com.example.BEMCheckBox-Demo-App-SwiftUI"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + CBAFA0252DBDD3B8005297AF /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + DEVELOPMENT_ASSET_PATHS = "\"BEMCheckBox Demo App SwiftUI/Preview Content\""; + DEVELOPMENT_TEAM = 9VG278DXB2; + ENABLE_PREVIEWS = YES; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES; + INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; + INFOPLIST_KEY_UILaunchScreen_Generation = YES; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = "com.example.BEMCheckBox-Demo-App-SwiftUI"; + 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 */ + CBAFA0102DBDD3B6005297AF /* Build configuration list for PBXProject "BEMCheckBox Demo App SwiftUI" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + CBAFA0212DBDD3B8005297AF /* Debug */, + CBAFA0222DBDD3B8005297AF /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + CBAFA0232DBDD3B8005297AF /* Build configuration list for PBXNativeTarget "BEMCheckBox Demo App SwiftUI" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + CBAFA0242DBDD3B8005297AF /* Debug */, + CBAFA0252DBDD3B8005297AF /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + +/* Begin XCRemoteSwiftPackageReference section */ + CBAFA02F2DBEA9AB005297AF /* XCRemoteSwiftPackageReference "BEMCheckBox" */ = { + isa = XCRemoteSwiftPackageReference; + repositoryURL = "https://github.com/Boris-Em/BEMCheckBox"; + requirement = { + branch = master; + kind = branch; + }; + }; +/* End XCRemoteSwiftPackageReference section */ + +/* Begin XCSwiftPackageProductDependency section */ + CBAFA0302DBEA9AB005297AF /* BEMCheckBox */ = { + isa = XCSwiftPackageProductDependency; + package = CBAFA02F2DBEA9AB005297AF /* XCRemoteSwiftPackageReference "BEMCheckBox" */; + productName = BEMCheckBox; + }; +/* End XCSwiftPackageProductDependency section */ + }; + rootObject = CBAFA00D2DBDD3B6005297AF /* Project object */; +} diff --git a/BEMCheckBox Demo App SwiftUI/BEMCheckBox Demo App SwiftUI.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/BEMCheckBox Demo App SwiftUI/BEMCheckBox Demo App SwiftUI.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..919434a --- /dev/null +++ b/BEMCheckBox Demo App SwiftUI/BEMCheckBox Demo App SwiftUI.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/BEMCheckBox Demo App SwiftUI/BEMCheckBox Demo App SwiftUI.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/BEMCheckBox Demo App SwiftUI/BEMCheckBox Demo App SwiftUI.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved new file mode 100644 index 0000000..8f7f783 --- /dev/null +++ b/BEMCheckBox Demo App SwiftUI/BEMCheckBox Demo App SwiftUI.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -0,0 +1,15 @@ +{ + "originHash" : "95406832be66774020bd32c184d266b83fe49ece2de417937bd14a878ca3f8d1", + "pins" : [ + { + "identity" : "bemcheckbox", + "kind" : "remoteSourceControl", + "location" : "https://github.com/Boris-Em/BEMCheckBox", + "state" : { + "branch" : "master", + "revision" : "a3292ebae9f0c2737b0c90281219dced2ce51ac8" + } + } + ], + "version" : 3 +} diff --git a/BEMCheckBox Demo App SwiftUI/BEMCheckBox Demo App SwiftUI/Assets.xcassets/AccentColor.colorset/Contents.json b/BEMCheckBox Demo App SwiftUI/BEMCheckBox Demo App SwiftUI/Assets.xcassets/AccentColor.colorset/Contents.json new file mode 100644 index 0000000..eb87897 --- /dev/null +++ b/BEMCheckBox Demo App SwiftUI/BEMCheckBox Demo App SwiftUI/Assets.xcassets/AccentColor.colorset/Contents.json @@ -0,0 +1,11 @@ +{ + "colors" : [ + { + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/BEMCheckBox Demo App SwiftUI/BEMCheckBox Demo App SwiftUI/Assets.xcassets/AppIcon.appiconset/Contents.json b/BEMCheckBox Demo App SwiftUI/BEMCheckBox Demo App SwiftUI/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..2305880 --- /dev/null +++ b/BEMCheckBox Demo App SwiftUI/BEMCheckBox Demo App SwiftUI/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,35 @@ +{ + "images" : [ + { + "idiom" : "universal", + "platform" : "ios", + "size" : "1024x1024" + }, + { + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "dark" + } + ], + "idiom" : "universal", + "platform" : "ios", + "size" : "1024x1024" + }, + { + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "tinted" + } + ], + "idiom" : "universal", + "platform" : "ios", + "size" : "1024x1024" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/BEMCheckBox Demo App SwiftUI/BEMCheckBox Demo App SwiftUI/Assets.xcassets/Contents.json b/BEMCheckBox Demo App SwiftUI/BEMCheckBox Demo App SwiftUI/Assets.xcassets/Contents.json new file mode 100644 index 0000000..73c0059 --- /dev/null +++ b/BEMCheckBox Demo App SwiftUI/BEMCheckBox Demo App SwiftUI/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/BEMCheckBox Demo App SwiftUI/BEMCheckBox Demo App SwiftUI/BEMCheckBox_Demo_App_SwiftUIApp.swift b/BEMCheckBox Demo App SwiftUI/BEMCheckBox Demo App SwiftUI/BEMCheckBox_Demo_App_SwiftUIApp.swift new file mode 100644 index 0000000..76cafdb --- /dev/null +++ b/BEMCheckBox Demo App SwiftUI/BEMCheckBox Demo App SwiftUI/BEMCheckBox_Demo_App_SwiftUIApp.swift @@ -0,0 +1,17 @@ +// +// BEMCheckBox_Demo_App_SwiftUIApp.swift +// BEMCheckBox Demo App SwiftUI +// +// Created by Sam Brink on 4/26/25. +// + +import SwiftUI + +@main +struct BEMCheckBox_Demo_App_SwiftUIApp: App { + var body: some Scene { + WindowGroup { + ContentView() + } + } +} diff --git a/BEMCheckBox Demo App SwiftUI/BEMCheckBox Demo App SwiftUI/CheckBoxSettings.swift b/BEMCheckBox Demo App SwiftUI/BEMCheckBox Demo App SwiftUI/CheckBoxSettings.swift new file mode 100644 index 0000000..0bdc610 --- /dev/null +++ b/BEMCheckBox Demo App SwiftUI/BEMCheckBox Demo App SwiftUI/CheckBoxSettings.swift @@ -0,0 +1,26 @@ +// +// CheckBoxSettings.swift +// BEMCheckBox Demo App SwiftUI +// +// Created by Sam Brink on 4/27/25. +// + +import Foundation +import BEMCheckBox + +enum StrokeType: Int { + case stroke + case fill +} + +class CheckBoxSettings: ObservableObject { + static let shared = CheckBoxSettings() + + @Published var boxType: BEMCheckBox.BoxType = .square + @Published var strokeType: StrokeType = .stroke + @Published var animationDuration: CGFloat = 0.5 + @Published var lineWidth: CGFloat = 1.0 + + var thickness: CGFloat = 0.1 + +} diff --git a/BEMCheckBox Demo App SwiftUI/BEMCheckBox Demo App SwiftUI/ContentView.swift b/BEMCheckBox Demo App SwiftUI/BEMCheckBox Demo App SwiftUI/ContentView.swift new file mode 100644 index 0000000..636f51c --- /dev/null +++ b/BEMCheckBox Demo App SwiftUI/BEMCheckBox Demo App SwiftUI/ContentView.swift @@ -0,0 +1,37 @@ +// +// ContentView.swift +// BEMCheckBox Demo App SwiftUI +// +// Created by Sam Brink on 4/26/25. +// + +import SwiftUI + +struct ContentView: View { + // @State private var selection: Int = 0 + let nTexts: Int = 30 + + var body: some View { + TabView() { + //TabView(selection: $selection) { + ListView2(texts: generateNTexts(n: nTexts)) + .tabItem { + Image(systemName: "bubble.left.fill") + Text("Texts") + } + + //.tag(0) + + CheckBoxSettingsView() + .tabItem { + Image(systemName: "gear") + Text("Box settings") + } + //.tag(1) + } + } +} + +#Preview { + ContentView() +} diff --git a/BEMCheckBox Demo App SwiftUI/BEMCheckBox Demo App SwiftUI/Preview Content/Preview Assets.xcassets/Contents.json b/BEMCheckBox Demo App SwiftUI/BEMCheckBox Demo App SwiftUI/Preview Content/Preview Assets.xcassets/Contents.json new file mode 100644 index 0000000..73c0059 --- /dev/null +++ b/BEMCheckBox Demo App SwiftUI/BEMCheckBox Demo App SwiftUI/Preview Content/Preview Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/BEMCheckBox Demo App SwiftUI/BEMCheckBox Demo App SwiftUI/TextMessage.swift b/BEMCheckBox Demo App SwiftUI/BEMCheckBox Demo App SwiftUI/TextMessage.swift new file mode 100644 index 0000000..46486d3 --- /dev/null +++ b/BEMCheckBox Demo App SwiftUI/BEMCheckBox Demo App SwiftUI/TextMessage.swift @@ -0,0 +1,35 @@ +// +// Text.swift +// BEMCheckBox Demo App SwiftUI +// +// Created by Sam Brink on 4/27/25. +// + +import Foundation + +let emojis = ["🔞", "🦕", "🗿", "🧌"] +let messages = [ + "He's soooo old", + "Do you want to go to jimmys?", + "That's so stupid", + "Stop trolling me" +] + +class TextMessage: Identifiable { + let id = UUID() + var emoji: String + var message: String + + init() { + self.emoji = emojis.randomElement()! + self.message = messages.randomElement()! + } +} + +func generateNTexts(n: Int) -> [TextMessage] { + var output: [TextMessage] = [] + for _ in 0...n { + output.append(TextMessage()) + } + return output +} diff --git a/BEMCheckBox Demo App SwiftUI/BEMCheckBox Demo App SwiftUI/Views/BEMCheckBoxView.swift b/BEMCheckBox Demo App SwiftUI/BEMCheckBox Demo App SwiftUI/Views/BEMCheckBoxView.swift new file mode 100644 index 0000000..f7d0a24 --- /dev/null +++ b/BEMCheckBox Demo App SwiftUI/BEMCheckBox Demo App SwiftUI/Views/BEMCheckBoxView.swift @@ -0,0 +1,60 @@ +// +// File.swift +// BEMCheckBox Demo App SwiftUI +// +// Created by Sam Brink on 4/28/25. +// + +import Foundation +import SwiftUI +import BEMCheckBox + +struct BEMCheckBoxView: View { + @ObservedObject private var settings = CheckBoxSettings.shared + let width: CGFloat + let height: CGFloat + + init(width: CGFloat = 30, height: CGFloat = 30) { + self.width = width + self.height = height + } + + var body: some View { + Checkbox( + boxType: settings.boxType, + strokeType: settings.strokeType, + animationDuration: settings.animationDuration, + lineWidth: settings.lineWidth + ) + .frame(width: width, height: height) + } +} + +struct Checkbox: UIViewRepresentable { + var boxType: BEMCheckBox.BoxType + var strokeType: StrokeType + var animationDuration: CGFloat + var lineWidth: CGFloat + + func makeUIView(context: Context) -> BEMCheckBox { + BEMCheckBox(frame: .zero) + } + + func updateUIView(_ box: BEMCheckBox, context: Context) { + box.boxType = boxType + box.animationDuration = animationDuration + box.lineWidth = lineWidth + + // Setting stroke vs. fill + box.tintColor = UIColor.lightGray + box.onTintColor = UIColor(red: 0, green: 122.0/255.0, blue: 255.0/255.0, alpha: 1) + switch strokeType { + case .stroke: + box.onFillColor = UIColor.clear + box.onCheckColor = UIColor(red: 0, green: 122.0/255.0, blue: 255.0/255.0, alpha: 1) + case .fill: + box.onFillColor = UIColor(red: 0, green: 122.0/255.0, blue: 255.0/255.0, alpha: 1) + box.onCheckColor = UIColor.white + } + } +} diff --git a/BEMCheckBox Demo App SwiftUI/BEMCheckBox Demo App SwiftUI/Views/CheckBoxSettingsView.swift b/BEMCheckBox Demo App SwiftUI/BEMCheckBox Demo App SwiftUI/Views/CheckBoxSettingsView.swift new file mode 100644 index 0000000..879d310 --- /dev/null +++ b/BEMCheckBox Demo App SwiftUI/BEMCheckBox Demo App SwiftUI/Views/CheckBoxSettingsView.swift @@ -0,0 +1,159 @@ +// +// CheckBoxSettingsView.swift +// BEMCheckBox Demo App SwiftUI +// +// Created by Sam Brink on 4/27/25. +// + +import Foundation +import SwiftUI +import BEMCheckBox + +struct CheckBoxSettingsView: View { + + private func safeAreaBottomInset() -> CGFloat { + UIApplication.shared.windows.first?.safeAreaInsets.bottom ?? 0 + } + + var body: some View { + VStack { + // Text("Your Text Box Settings") + + SettingsTopHalfView() + .frame(maxWidth: .infinity) + .frame(maxHeight: .infinity) + SettingsBottomHalfView() + .frame(maxWidth: .infinity) + .frame(maxHeight: .infinity) + .background(Color(.systemBlue)) + } + .ignoresSafeArea(edges: .top) // …but only under the top‐notch area + .padding(.bottom, safeAreaBottomInset()) + } + +} + +struct SettingsTopHalfView: View { + var body: some View { + BEMCheckBoxView(width: 70, height: 70) + } +} + +struct SettingsBottomHalfView: View { + @State private var strokeTypeSelection = 0 + @State private var boxStyleSelection = 0 + @State private var animationDuration = 0.5 + @State private var lineWidth = 0.5 + + let labelWidth: CGFloat = 180 + + var body: some View { + VStack { + + Spacer() + + // MARK: Picker hstack + HStack { + Spacer(minLength: 20) + + Picker( + "Stroke Type", + selection: Binding( + get: { CheckBoxSettings.shared.strokeType }, + set: { CheckBoxSettings.shared.strokeType = $0 } + ) + ) { + Text("Stroke").tag(StrokeType.stroke) + Text("Fill").tag(StrokeType.fill) + } + .pickerStyle(.segmented) + // .padding(4) + .background(Color.white) + .clipShape(Capsule()) + + Spacer(minLength: 60) + // Spacer() + // Spacer() + + Picker( + "Box Style", + selection: Binding( + get: { CheckBoxSettings.shared.boxType }, + set: { CheckBoxSettings.shared.boxType = $0 } + ) + ) { + Text("Circle").tag(BEMCheckBox.BoxType.circle) + Text("Square").tag(BEMCheckBox.BoxType.square) + } + .pickerStyle(.segmented) + //.padding() + .background(Color.white) + .clipShape(Capsule()) + + Spacer(minLength: 20) + } + + // Spacer() + // Spacer() + Spacer() + + HStack { + Text("Animation Duration") + .frame(width: labelWidth, alignment: .leading) + Spacer(minLength: 20) + + Slider( + value: Binding( + get: { CGFloat(CheckBoxSettings.shared.animationDuration) }, + set: { newVal in CheckBoxSettings.shared.animationDuration = CGFloat(newVal) } + ), + in: 0.5...2, + step: 0.1 + ){ + // this is the `label:` closure + EmptyView() + } minimumValueLabel: { + Text("0.5") + } maximumValueLabel: { + Text("2") + } + .accentColor(Color.white) + //.frame(maxWidth: .infinity) + + } + .padding(.horizontal) + Spacer() + + HStack { + Text("Line width") + .frame(width: labelWidth, alignment: .leading) + Slider( + value: Binding( + get: { CGFloat(CheckBoxSettings.shared.lineWidth) }, + set: { newVal in CheckBoxSettings.shared.lineWidth = CGFloat(newVal) } + ), + in: 1...4, + step: 0.1 + ){ + EmptyView() + } minimumValueLabel: { + Text("1") + } maximumValueLabel: { + Text("4") + } + //.frame(maxWidth: .infinity) + } + .padding(.horizontal) + + //TODO: Add button + Spacer() + Spacer() + } + + // Spacer(minLength: 40) + } +} + +#Preview { + CheckBoxSettingsView() +} diff --git a/BEMCheckBox Demo App SwiftUI/BEMCheckBox Demo App SwiftUI/Views/ListView.swift b/BEMCheckBox Demo App SwiftUI/BEMCheckBox Demo App SwiftUI/Views/ListView.swift new file mode 100644 index 0000000..e3d556f --- /dev/null +++ b/BEMCheckBox Demo App SwiftUI/BEMCheckBox Demo App SwiftUI/Views/ListView.swift @@ -0,0 +1,29 @@ +// +// File.swift +// BEMCheckBox Demo App SwiftUI +// +// Created by Sam Brink on 4/27/25. +// + +import Foundation +import SwiftUI + +struct ListView2: View { + let texts: [TextMessage] + + var body: some View { + VStack { + Text("Check off texts that you think have the matching emoji!") + .multilineTextAlignment(.center) + List { + ForEach(texts) { text in + TextRowItemView(text: text) + } + } + } + } +} + +#Preview { + ListView2(texts: generateNTexts(n: 30)) +} diff --git a/BEMCheckBox Demo App SwiftUI/BEMCheckBox Demo App SwiftUI/Views/TextRowItemView.swift b/BEMCheckBox Demo App SwiftUI/BEMCheckBox Demo App SwiftUI/Views/TextRowItemView.swift new file mode 100644 index 0000000..7aead64 --- /dev/null +++ b/BEMCheckBox Demo App SwiftUI/BEMCheckBox Demo App SwiftUI/Views/TextRowItemView.swift @@ -0,0 +1,27 @@ +// +// TextRowItemView.swift +// BEMCheckBox Demo App SwiftUI +// +// Created by Sam Brink on 4/27/25. +// + +import Foundation +import SwiftUI +import BEMCheckBox +import UIKit + +struct TextRowItemView: View { + let text: TextMessage + + var body: some View { + HStack { + BEMCheckBoxView() + Text(text.message + text.emoji) + } + } +} + + +#Preview { + TextRowItemView(text: TextMessage()) +}