From 2bb59743e7e3ab9022a5385b309a24a1b6da3e94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20G=C3=BCnner?= Date: Tue, 28 Mar 2023 18:59:55 +0200 Subject: [PATCH 01/10] =?UTF-8?q?=F0=9F=9A=A7=20Here=20we=20go:=20macOS=20?= =?UTF-8?q?Switch=20UI=20(WIP)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Implemented UI Menu Navigation --- .gitignore | 51 +++ .../CheckIP.xcodeproj/project.pbxproj | 341 ++++++++++++++++++ .../contents.xcworkspacedata | 7 + .../xcshareddata/IDEWorkspaceChecks.plist | 8 + .../AccentColor.colorset/Contents.json | 11 + .../AppIcon.appiconset/Contents.json | 58 +++ .../CheckIP/Assets.xcassets/Contents.json | 6 + CheckIP.MacOS/CheckIP/CheckIP.entitlements | 10 + CheckIP.MacOS/CheckIP/CheckIPApp.swift | 17 + CheckIP.MacOS/CheckIP/ContentView.swift | 110 ++++++ .../Preview Assets.xcassets/Contents.json | 6 + README.md | 3 + 12 files changed, 628 insertions(+) create mode 100644 CheckIP.MacOS/CheckIP.xcodeproj/project.pbxproj create mode 100644 CheckIP.MacOS/CheckIP.xcodeproj/project.xcworkspace/contents.xcworkspacedata create mode 100644 CheckIP.MacOS/CheckIP.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist create mode 100644 CheckIP.MacOS/CheckIP/Assets.xcassets/AccentColor.colorset/Contents.json create mode 100644 CheckIP.MacOS/CheckIP/Assets.xcassets/AppIcon.appiconset/Contents.json create mode 100644 CheckIP.MacOS/CheckIP/Assets.xcassets/Contents.json create mode 100644 CheckIP.MacOS/CheckIP/CheckIP.entitlements create mode 100644 CheckIP.MacOS/CheckIP/CheckIPApp.swift create mode 100644 CheckIP.MacOS/CheckIP/ContentView.swift create mode 100644 CheckIP.MacOS/CheckIP/Preview Content/Preview Assets.xcassets/Contents.json diff --git a/.gitignore b/.gitignore index bccfd0e..0e7a567 100644 --- a/.gitignore +++ b/.gitignore @@ -386,3 +386,54 @@ Temporary Items # iCloud generated files *.icloud CheckIP.Windows/Setup/Output/ + + +### macOS ### +# General +.DS_Store +.AppleDouble +.LSOverride + +# Icon must end with two \r +Icon + + +# Thumbnails +._* + +# Files that might appear in the root of a volume +.DocumentRevisions-V100 +.fseventsd +.Spotlight-V100 +.TemporaryItems +.Trashes +.VolumeIcon.icns +.com.apple.timemachine.donotpresent + +# Directories potentially created on remote AFP share +.AppleDB +.AppleDesktop +Network Trash Folder +Temporary Items +.apdisk + +### macOS Patch ### +# iCloud generated files +*.icloud + +### Xcode ### +## User settings +xcuserdata/ + +## Xcode 8 and earlier +*.xcscmblueprint +*.xccheckout + +### Xcode Patch ### +*.xcodeproj/* +!*.xcodeproj/project.pbxproj +!*.xcodeproj/xcshareddata/ +!*.xcodeproj/project.xcworkspace/ +!*.xcworkspace/contents.xcworkspacedata +/*.gcno +**/xcshareddata/WorkspaceSettings.xcsettings diff --git a/CheckIP.MacOS/CheckIP.xcodeproj/project.pbxproj b/CheckIP.MacOS/CheckIP.xcodeproj/project.pbxproj new file mode 100644 index 0000000..d59cf57 --- /dev/null +++ b/CheckIP.MacOS/CheckIP.xcodeproj/project.pbxproj @@ -0,0 +1,341 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 56; + objects = { + +/* Begin PBXBuildFile section */ + 7743E54B29D31D2C002AA6EA /* CheckIPApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7743E54A29D31D2C002AA6EA /* CheckIPApp.swift */; }; + 7743E54D29D31D2C002AA6EA /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7743E54C29D31D2C002AA6EA /* ContentView.swift */; }; + 7743E54F29D31D2D002AA6EA /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 7743E54E29D31D2D002AA6EA /* Assets.xcassets */; }; + 7743E55229D31D2D002AA6EA /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 7743E55129D31D2D002AA6EA /* Preview Assets.xcassets */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + 7743E54729D31D2C002AA6EA /* CheckIP.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = CheckIP.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 7743E54A29D31D2C002AA6EA /* CheckIPApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CheckIPApp.swift; sourceTree = ""; }; + 7743E54C29D31D2C002AA6EA /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = ""; }; + 7743E54E29D31D2D002AA6EA /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 7743E55129D31D2D002AA6EA /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = ""; }; + 7743E55329D31D2D002AA6EA /* CheckIP.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = CheckIP.entitlements; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 7743E54429D31D2C002AA6EA /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 7743E53E29D31D2C002AA6EA = { + isa = PBXGroup; + children = ( + 7743E54929D31D2C002AA6EA /* CheckIP */, + 7743E54829D31D2C002AA6EA /* Products */, + ); + sourceTree = ""; + }; + 7743E54829D31D2C002AA6EA /* Products */ = { + isa = PBXGroup; + children = ( + 7743E54729D31D2C002AA6EA /* CheckIP.app */, + ); + name = Products; + sourceTree = ""; + }; + 7743E54929D31D2C002AA6EA /* CheckIP */ = { + isa = PBXGroup; + children = ( + 7743E54A29D31D2C002AA6EA /* CheckIPApp.swift */, + 7743E54C29D31D2C002AA6EA /* ContentView.swift */, + 7743E54E29D31D2D002AA6EA /* Assets.xcassets */, + 7743E55329D31D2D002AA6EA /* CheckIP.entitlements */, + 7743E55029D31D2D002AA6EA /* Preview Content */, + ); + path = CheckIP; + sourceTree = ""; + }; + 7743E55029D31D2D002AA6EA /* Preview Content */ = { + isa = PBXGroup; + children = ( + 7743E55129D31D2D002AA6EA /* Preview Assets.xcassets */, + ); + path = "Preview Content"; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 7743E54629D31D2C002AA6EA /* CheckIP */ = { + isa = PBXNativeTarget; + buildConfigurationList = 7743E55629D31D2D002AA6EA /* Build configuration list for PBXNativeTarget "CheckIP" */; + buildPhases = ( + 7743E54329D31D2C002AA6EA /* Sources */, + 7743E54429D31D2C002AA6EA /* Frameworks */, + 7743E54529D31D2C002AA6EA /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = CheckIP; + productName = CheckIP; + productReference = 7743E54729D31D2C002AA6EA /* CheckIP.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 7743E53F29D31D2C002AA6EA /* Project object */ = { + isa = PBXProject; + attributes = { + BuildIndependentTargetsInParallel = 1; + LastSwiftUpdateCheck = 1420; + LastUpgradeCheck = 1420; + TargetAttributes = { + 7743E54629D31D2C002AA6EA = { + CreatedOnToolsVersion = 14.2; + }; + }; + }; + buildConfigurationList = 7743E54229D31D2C002AA6EA /* Build configuration list for PBXProject "CheckIP" */; + compatibilityVersion = "Xcode 14.0"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 7743E53E29D31D2C002AA6EA; + productRefGroup = 7743E54829D31D2C002AA6EA /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 7743E54629D31D2C002AA6EA /* CheckIP */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 7743E54529D31D2C002AA6EA /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 7743E55229D31D2D002AA6EA /* Preview Assets.xcassets in Resources */, + 7743E54F29D31D2D002AA6EA /* Assets.xcassets in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 7743E54329D31D2C002AA6EA /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 7743E54D29D31D2C002AA6EA /* ContentView.swift in Sources */, + 7743E54B29D31D2C002AA6EA /* CheckIPApp.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin XCBuildConfiguration section */ + 7743E55429D31D2D002AA6EA /* 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; + MACOSX_DEPLOYMENT_TARGET = 13.1; + MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; + MTL_FAST_MATH = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = macosx; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + }; + name = Debug; + }; + 7743E55529D31D2D002AA6EA /* 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; + MACOSX_DEPLOYMENT_TARGET = 13.1; + MTL_ENABLE_DEBUG_INFO = NO; + MTL_FAST_MATH = YES; + SDKROOT = macosx; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + }; + name = Release; + }; + 7743E55729D31D2D002AA6EA /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + CODE_SIGN_ENTITLEMENTS = CheckIP/CheckIP.entitlements; + CODE_SIGN_STYLE = Automatic; + COMBINE_HIDPI_IMAGES = YES; + CURRENT_PROJECT_VERSION = 1; + DEVELOPMENT_ASSET_PATHS = "\"CheckIP/Preview Content\""; + DEVELOPMENT_TEAM = QHSR4A4M65; + ENABLE_HARDENED_RUNTIME = YES; + ENABLE_PREVIEWS = YES; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_KEY_NSHumanReadableCopyright = ""; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/../Frameworks", + ); + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = dev.valnoxy.CheckIP; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_VERSION = 5.0; + }; + name = Debug; + }; + 7743E55829D31D2D002AA6EA /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + CODE_SIGN_ENTITLEMENTS = CheckIP/CheckIP.entitlements; + CODE_SIGN_STYLE = Automatic; + COMBINE_HIDPI_IMAGES = YES; + CURRENT_PROJECT_VERSION = 1; + DEVELOPMENT_ASSET_PATHS = "\"CheckIP/Preview Content\""; + DEVELOPMENT_TEAM = QHSR4A4M65; + ENABLE_HARDENED_RUNTIME = YES; + ENABLE_PREVIEWS = YES; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_KEY_NSHumanReadableCopyright = ""; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/../Frameworks", + ); + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = dev.valnoxy.CheckIP; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_VERSION = 5.0; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 7743E54229D31D2C002AA6EA /* Build configuration list for PBXProject "CheckIP" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 7743E55429D31D2D002AA6EA /* Debug */, + 7743E55529D31D2D002AA6EA /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 7743E55629D31D2D002AA6EA /* Build configuration list for PBXNativeTarget "CheckIP" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 7743E55729D31D2D002AA6EA /* Debug */, + 7743E55829D31D2D002AA6EA /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 7743E53F29D31D2C002AA6EA /* Project object */; +} diff --git a/CheckIP.MacOS/CheckIP.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/CheckIP.MacOS/CheckIP.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..919434a --- /dev/null +++ b/CheckIP.MacOS/CheckIP.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/CheckIP.MacOS/CheckIP.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/CheckIP.MacOS/CheckIP.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/CheckIP.MacOS/CheckIP.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/CheckIP.MacOS/CheckIP/Assets.xcassets/AccentColor.colorset/Contents.json b/CheckIP.MacOS/CheckIP/Assets.xcassets/AccentColor.colorset/Contents.json new file mode 100644 index 0000000..eb87897 --- /dev/null +++ b/CheckIP.MacOS/CheckIP/Assets.xcassets/AccentColor.colorset/Contents.json @@ -0,0 +1,11 @@ +{ + "colors" : [ + { + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/CheckIP.MacOS/CheckIP/Assets.xcassets/AppIcon.appiconset/Contents.json b/CheckIP.MacOS/CheckIP/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..3f00db4 --- /dev/null +++ b/CheckIP.MacOS/CheckIP/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,58 @@ +{ + "images" : [ + { + "idiom" : "mac", + "scale" : "1x", + "size" : "16x16" + }, + { + "idiom" : "mac", + "scale" : "2x", + "size" : "16x16" + }, + { + "idiom" : "mac", + "scale" : "1x", + "size" : "32x32" + }, + { + "idiom" : "mac", + "scale" : "2x", + "size" : "32x32" + }, + { + "idiom" : "mac", + "scale" : "1x", + "size" : "128x128" + }, + { + "idiom" : "mac", + "scale" : "2x", + "size" : "128x128" + }, + { + "idiom" : "mac", + "scale" : "1x", + "size" : "256x256" + }, + { + "idiom" : "mac", + "scale" : "2x", + "size" : "256x256" + }, + { + "idiom" : "mac", + "scale" : "1x", + "size" : "512x512" + }, + { + "idiom" : "mac", + "scale" : "2x", + "size" : "512x512" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/CheckIP.MacOS/CheckIP/Assets.xcassets/Contents.json b/CheckIP.MacOS/CheckIP/Assets.xcassets/Contents.json new file mode 100644 index 0000000..73c0059 --- /dev/null +++ b/CheckIP.MacOS/CheckIP/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/CheckIP.MacOS/CheckIP/CheckIP.entitlements b/CheckIP.MacOS/CheckIP/CheckIP.entitlements new file mode 100644 index 0000000..f2ef3ae --- /dev/null +++ b/CheckIP.MacOS/CheckIP/CheckIP.entitlements @@ -0,0 +1,10 @@ + + + + + com.apple.security.app-sandbox + + com.apple.security.files.user-selected.read-only + + + diff --git a/CheckIP.MacOS/CheckIP/CheckIPApp.swift b/CheckIP.MacOS/CheckIP/CheckIPApp.swift new file mode 100644 index 0000000..28aca81 --- /dev/null +++ b/CheckIP.MacOS/CheckIP/CheckIPApp.swift @@ -0,0 +1,17 @@ +// +// CheckIPApp.swift +// CheckIP +// +// Created by Jonas Günner on 28.03.23. +// + +import SwiftUI + +@main +struct CheckIPApp: App { + var body: some Scene { + WindowGroup { + ContentView() + } + } +} diff --git a/CheckIP.MacOS/CheckIP/ContentView.swift b/CheckIP.MacOS/CheckIP/ContentView.swift new file mode 100644 index 0000000..3321b58 --- /dev/null +++ b/CheckIP.MacOS/CheckIP/ContentView.swift @@ -0,0 +1,110 @@ +// +// ContentView.swift +// CheckIP +// +// Created by Jonas Günner on 28.03.23. +// + +import SwiftUI + +struct Option: Hashable { + let title: String + let imageName: String +} + +struct ContentView: View { + @State var currentOption = 0 + + let options: [Option] = [ + .init(title: "Fetch", imageName: "magnifyingglass"), + .init(title: "My IP", imageName: "location.fill"), + .init(title: "About", imageName: "info.circle"), + ] + + var body: some View { + NavigationView () { + ListView( + options: options, + currentSelection: $currentOption + ) + + switch currentOption { + case 0: + FetchView() + case 1: + MyIPView() + case 2: + AboutView() + default: + FetchView() + } + } + .frame(minWidth: 600, minHeight: 400) + } +} + +struct ListView: View { + let options: [Option] + @Binding var currentSelection: Int + + var body: some View { + VStack { + let current = options[currentSelection] + ForEach(options, id: \.self) { option in + HStack { + Image(systemName: option.imageName) + .resizable() + .aspectRatio(contentMode: .fit) + .frame(width: 20) + Text(option.title) + .foregroundColor(current == option ? + Color(.red) : Color(.white)) + + Spacer() + } + .padding() + .onTapGesture { + switch (option.title) { + case "Fetch": + self.currentSelection = 0 + case "My IP": + self.currentSelection = 1 + case "About": + self.currentSelection = 2 + default: + self.currentSelection = 0 + } + } + } + Spacer() + Text("Debug Build\nMy pp is burning") + .foregroundColor(Color.red) + .multilineTextAlignment(TextAlignment.center) + Spacer() + } + } +} + +struct FetchView: View { + var body: some View { + Text("Main View yay") + } +} + +struct MyIPView: View { + var body: some View { + Text("Main View yay") + } +} + +struct AboutView: View { + var body: some View { + Text("Main View yay") + } +} + +struct ContentView_Previews: PreviewProvider { + static var previews: some View { + ContentView() + } +} diff --git a/CheckIP.MacOS/CheckIP/Preview Content/Preview Assets.xcassets/Contents.json b/CheckIP.MacOS/CheckIP/Preview Content/Preview Assets.xcassets/Contents.json new file mode 100644 index 0000000..73c0059 --- /dev/null +++ b/CheckIP.MacOS/CheckIP/Preview Content/Preview Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/README.md b/README.md index f6ab3d3..5c4bb0d 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,7 @@ [![Android](https://img.shields.io/badge/Android-Xamarin-brightgreen.svg)](https://github.com/valnoxy/checkip/tree/main/CheckIP.Mobile) [![iOS](https://img.shields.io/badge/iOS-Xamarin-green)](https://github.com/valnoxy/checkip/tree/main/CheckIP.Mobile) +[![macOS](https://img.shields.io/badge/macOS-Swift-orange)](https://github.com/valnoxy/checkip/tree/main/CheckIP.MacOS) [![Windows](https://img.shields.io/badge/Windows-WPF-blue)](https://github.com/valnoxy/checkip/tree/main/CheckIP.Windows) [![License](https://img.shields.io/badge/license-GNU%20General%20Public%20License-purple)](/LICENSE) @@ -12,6 +13,8 @@
WPF Version: 2.2.1
+ Swift (macOS) Version: 0.0.1-dev (WIP) +
Xamarin Version: 2.1.0-alpha2
Report Bug From 95513812a10f376604a9b6770bd34ff3e278d1a1 Mon Sep 17 00:00:00 2001 From: valnoxy Date: Thu, 30 Mar 2023 02:44:35 +0200 Subject: [PATCH 02/10] =?UTF-8?q?=E2=9A=92=EF=B8=8F=20Bye=20Swift,=20Hello?= =?UTF-8?q?=20Avalonia!?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Removed Swift project - Implemented WinUI Style - Implemented MainWindow & Fetch IP --- CheckIP.Avalonia/App.axaml | 9 + CheckIP.Avalonia/App.axaml.cs | 24 ++ CheckIP.Avalonia/CheckIP.Avalonia.csproj | 32 ++ CheckIP.Avalonia/CheckIP.Avalonia.sln | 25 ++ CheckIP.Avalonia/MainWindow.axaml | 48 +++ CheckIP.Avalonia/MainWindow.axaml.cs | 29 ++ CheckIP.Avalonia/Pages/FetchIP.axaml | 178 +++++++++ CheckIP.Avalonia/Pages/FetchIP.axaml.cs | 156 ++++++++ CheckIP.Avalonia/Pages/MyIP.axaml | 8 + CheckIP.Avalonia/Pages/MyIP.axaml.cs | 13 + CheckIP.Avalonia/Program.cs | 21 ++ CheckIP.Avalonia/Roots.xml | 5 + CheckIP.Avalonia/app.manifest | 18 + .../CheckIP.xcodeproj/project.pbxproj | 341 ------------------ .../contents.xcworkspacedata | 7 - .../xcshareddata/IDEWorkspaceChecks.plist | 8 - .../AccentColor.colorset/Contents.json | 11 - .../AppIcon.appiconset/Contents.json | 58 --- .../CheckIP/Assets.xcassets/Contents.json | 6 - CheckIP.MacOS/CheckIP/CheckIP.entitlements | 10 - CheckIP.MacOS/CheckIP/CheckIPApp.swift | 17 - CheckIP.MacOS/CheckIP/ContentView.swift | 110 ------ .../Preview Assets.xcassets/Contents.json | 6 - CheckIP.Windows/CheckIP/CheckIP.csproj | 1 + README.md | 4 +- 25 files changed, 569 insertions(+), 576 deletions(-) create mode 100644 CheckIP.Avalonia/App.axaml create mode 100644 CheckIP.Avalonia/App.axaml.cs create mode 100644 CheckIP.Avalonia/CheckIP.Avalonia.csproj create mode 100644 CheckIP.Avalonia/CheckIP.Avalonia.sln create mode 100644 CheckIP.Avalonia/MainWindow.axaml create mode 100644 CheckIP.Avalonia/MainWindow.axaml.cs create mode 100644 CheckIP.Avalonia/Pages/FetchIP.axaml create mode 100644 CheckIP.Avalonia/Pages/FetchIP.axaml.cs create mode 100644 CheckIP.Avalonia/Pages/MyIP.axaml create mode 100644 CheckIP.Avalonia/Pages/MyIP.axaml.cs create mode 100644 CheckIP.Avalonia/Program.cs create mode 100644 CheckIP.Avalonia/Roots.xml create mode 100644 CheckIP.Avalonia/app.manifest delete mode 100644 CheckIP.MacOS/CheckIP.xcodeproj/project.pbxproj delete mode 100644 CheckIP.MacOS/CheckIP.xcodeproj/project.xcworkspace/contents.xcworkspacedata delete mode 100644 CheckIP.MacOS/CheckIP.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist delete mode 100644 CheckIP.MacOS/CheckIP/Assets.xcassets/AccentColor.colorset/Contents.json delete mode 100644 CheckIP.MacOS/CheckIP/Assets.xcassets/AppIcon.appiconset/Contents.json delete mode 100644 CheckIP.MacOS/CheckIP/Assets.xcassets/Contents.json delete mode 100644 CheckIP.MacOS/CheckIP/CheckIP.entitlements delete mode 100644 CheckIP.MacOS/CheckIP/CheckIPApp.swift delete mode 100644 CheckIP.MacOS/CheckIP/ContentView.swift delete mode 100644 CheckIP.MacOS/CheckIP/Preview Content/Preview Assets.xcassets/Contents.json diff --git a/CheckIP.Avalonia/App.axaml b/CheckIP.Avalonia/App.axaml new file mode 100644 index 0000000..ef54d75 --- /dev/null +++ b/CheckIP.Avalonia/App.axaml @@ -0,0 +1,9 @@ + + + + + + diff --git a/CheckIP.Avalonia/App.axaml.cs b/CheckIP.Avalonia/App.axaml.cs new file mode 100644 index 0000000..0a8f901 --- /dev/null +++ b/CheckIP.Avalonia/App.axaml.cs @@ -0,0 +1,24 @@ +using Avalonia; +using Avalonia.Controls.ApplicationLifetimes; +using Avalonia.Markup.Xaml; + +namespace CheckIP.Avalonia +{ + public partial class App : Application + { + public override void Initialize() + { + AvaloniaXamlLoader.Load(this); + } + + public override void OnFrameworkInitializationCompleted() + { + if (ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop) + { + desktop.MainWindow = new MainWindow(); + } + + base.OnFrameworkInitializationCompleted(); + } + } +} \ No newline at end of file diff --git a/CheckIP.Avalonia/CheckIP.Avalonia.csproj b/CheckIP.Avalonia/CheckIP.Avalonia.csproj new file mode 100644 index 0000000..02ba6fa --- /dev/null +++ b/CheckIP.Avalonia/CheckIP.Avalonia.csproj @@ -0,0 +1,32 @@ + + + WinExe + net6.0 + enable + true + app.manifest + + + + + + + + + + + + + + + + + + + + + + MyIP.axaml + + + diff --git a/CheckIP.Avalonia/CheckIP.Avalonia.sln b/CheckIP.Avalonia/CheckIP.Avalonia.sln new file mode 100644 index 0000000..f172ca8 --- /dev/null +++ b/CheckIP.Avalonia/CheckIP.Avalonia.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.5.33424.131 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CheckIP.Avalonia", "CheckIP.Avalonia.csproj", "{57F17352-350D-4782-A1E4-2BE2058A6FC1}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {57F17352-350D-4782-A1E4-2BE2058A6FC1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {57F17352-350D-4782-A1E4-2BE2058A6FC1}.Debug|Any CPU.Build.0 = Debug|Any CPU + {57F17352-350D-4782-A1E4-2BE2058A6FC1}.Release|Any CPU.ActiveCfg = Release|Any CPU + {57F17352-350D-4782-A1E4-2BE2058A6FC1}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {DC062FDC-5E50-44F3-AD32-429F8BAF58B6} + EndGlobalSection +EndGlobal diff --git a/CheckIP.Avalonia/MainWindow.axaml b/CheckIP.Avalonia/MainWindow.axaml new file mode 100644 index 0000000..e1624b9 --- /dev/null +++ b/CheckIP.Avalonia/MainWindow.axaml @@ -0,0 +1,48 @@ + + + + + + + + + + + + + + + + + diff --git a/CheckIP.Avalonia/MainWindow.axaml.cs b/CheckIP.Avalonia/MainWindow.axaml.cs new file mode 100644 index 0000000..48503ab --- /dev/null +++ b/CheckIP.Avalonia/MainWindow.axaml.cs @@ -0,0 +1,29 @@ +using Avalonia.Controls; +using FluentAvalonia.Core; +using FluentAvalonia.UI.Controls; +using System; + +namespace CheckIP.Avalonia +{ + public partial class MainWindow : CoreWindow + { + public MainWindow() + { + InitializeComponent(); + + var nv = this.FindControl("RootNavigation"); + nv.SelectionChanged += OnNVSample2SelectionChanged; + nv.SelectedItem = nv.MenuItems.ElementAt(0); + } + + private void OnNVSample2SelectionChanged(object sender, NavigationViewSelectionChangedEventArgs e) + { + if (e.SelectedItem is NavigationViewItem nvi) + { + var smpPage = $"CheckIP.Avalonia.Pages.{nvi.Tag}"; + var pg = Activator.CreateInstance(Type.GetType(smpPage)); + (sender as NavigationView).Content = pg; + } + } + } +} \ No newline at end of file diff --git a/CheckIP.Avalonia/Pages/FetchIP.axaml b/CheckIP.Avalonia/Pages/FetchIP.axaml new file mode 100644 index 0000000..de5df0a --- /dev/null +++ b/CheckIP.Avalonia/Pages/FetchIP.axaml @@ -0,0 +1,178 @@ + + +