diff --git a/.gitignore b/.gitignore index c097faa..e7cedd5 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,11 @@ # Mac OS X .DS_Store +# Swift Package Manager +.build/ +.swiftpm/ +Package.resolved + # Xcode build/ *.pbxuser diff --git a/Package.swift b/Package.swift index faa03af..c8608dd 100644 --- a/Package.swift +++ b/Package.swift @@ -1,19 +1,24 @@ -// swift-tools-version:5.4 -// The swift-tools-version declares the minimum version of Swift required to build this package. +// swift-tools-version:5.9 import PackageDescription let package = Package( name: "MaterialDesignSymbol", - platforms: [.iOS(.v10), - .watchOS(.v3)], + platforms: [ + .iOS(.v16), + .watchOS(.v9) + ], products: [ .library(name: "MaterialDesignSymbol", targets: ["MaterialDesignSymbol"]) ], - dependencies: [], targets: [ - .target(name: "MaterialDesignSymbol", - resources: [ - .process("Resources")]) + .target( + name: "MaterialDesignSymbol", + resources: [.process("Resources")] + ), + .testTarget( + name: "MaterialDesignSymbolTests", + dependencies: ["MaterialDesignSymbol"] + ) ], swiftLanguageVersions: [.v5] ) diff --git a/Sample/Podfile b/Sample/Podfile deleted file mode 100644 index 3def06d..0000000 --- a/Sample/Podfile +++ /dev/null @@ -1,9 +0,0 @@ -target 'Sample' do - use_frameworks! - - pod 'MaterialDesignSymbol', :path => '../' - - target 'SampleTests' do - inherit! :search_paths - end -end diff --git a/Sample/Sample.xcodeproj/project.pbxproj b/Sample/Sample.xcodeproj/project.pbxproj deleted file mode 100644 index 3d5c95c..0000000 --- a/Sample/Sample.xcodeproj/project.pbxproj +++ /dev/null @@ -1,591 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 51; - objects = { - -/* Begin PBXBuildFile section */ - 35727C4CE93902FBBCB4A42A /* Pods_SampleTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 160FC79E5080AA0454247CAD /* Pods_SampleTests.framework */; }; - B0426D512514EF5400AB4739 /* SwiftUIViewFor13.swift in Sources */ = {isa = PBXBuildFile; fileRef = B0426D502514EF5400AB4739 /* SwiftUIViewFor13.swift */; }; - B0426D712514F4A800AB4739 /* SwiftUIViewFor14.swift in Sources */ = {isa = PBXBuildFile; fileRef = B0426D702514F4A800AB4739 /* SwiftUIViewFor14.swift */; }; - B085859524E1939A00AF211D /* SampleView.swift in Sources */ = {isa = PBXBuildFile; fileRef = B085859424E1939A00AF211D /* SampleView.swift */; }; - B09B7E251AFF03DF0074ACA7 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = B09B7E241AFF03DF0074ACA7 /* AppDelegate.swift */; }; - B09B7E271AFF03DF0074ACA7 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = B09B7E261AFF03DF0074ACA7 /* ViewController.swift */; }; - B09B7E2A1AFF03DF0074ACA7 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = B09B7E281AFF03DF0074ACA7 /* Main.storyboard */; }; - B09B7E2C1AFF03DF0074ACA7 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = B09B7E2B1AFF03DF0074ACA7 /* Images.xcassets */; }; - B09B7E2F1AFF03DF0074ACA7 /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = B09B7E2D1AFF03DF0074ACA7 /* LaunchScreen.xib */; }; - B09B7E3B1AFF03DF0074ACA7 /* SampleTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = B09B7E3A1AFF03DF0074ACA7 /* SampleTests.swift */; }; - C2FB3EC8657116283267F9C6 /* Pods_Sample.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8C49C8C5B3B72A8EFAA975BD /* Pods_Sample.framework */; }; -/* End PBXBuildFile section */ - -/* Begin PBXContainerItemProxy section */ - B09B7E351AFF03DF0074ACA7 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = B09B7E171AFF03DE0074ACA7 /* Project object */; - proxyType = 1; - remoteGlobalIDString = B09B7E1E1AFF03DF0074ACA7; - remoteInfo = Sample; - }; -/* End PBXContainerItemProxy section */ - -/* Begin PBXFileReference section */ - 0185E2EB172C88AD1648D935 /* Pods-SampleTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SampleTests.release.xcconfig"; path = "Pods/Target Support Files/Pods-SampleTests/Pods-SampleTests.release.xcconfig"; sourceTree = ""; }; - 160FC79E5080AA0454247CAD /* Pods_SampleTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_SampleTests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - 8C49C8C5B3B72A8EFAA975BD /* Pods_Sample.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Sample.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - B0426D502514EF5400AB4739 /* SwiftUIViewFor13.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SwiftUIViewFor13.swift; sourceTree = ""; }; - B0426D702514F4A800AB4739 /* SwiftUIViewFor14.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SwiftUIViewFor14.swift; sourceTree = ""; }; - B085859424E1939A00AF211D /* SampleView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SampleView.swift; sourceTree = ""; }; - B09B7E1F1AFF03DF0074ACA7 /* Sample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Sample.app; sourceTree = BUILT_PRODUCTS_DIR; }; - B09B7E231AFF03DF0074ACA7 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - B09B7E241AFF03DF0074ACA7 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; - B09B7E261AFF03DF0074ACA7 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; - B09B7E291AFF03DF0074ACA7 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; - B09B7E2B1AFF03DF0074ACA7 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; - B09B7E2E1AFF03DF0074ACA7 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = ""; }; - B09B7E341AFF03DF0074ACA7 /* SampleTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = SampleTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; - B09B7E391AFF03DF0074ACA7 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - B09B7E3A1AFF03DF0074ACA7 /* SampleTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SampleTests.swift; sourceTree = ""; }; - B4B57DBE4984CDAD2E6E98AB /* Pods-SampleTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SampleTests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-SampleTests/Pods-SampleTests.debug.xcconfig"; sourceTree = ""; }; - C24790F417D7C5AA97C48D74 /* Pods-Sample.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Sample.release.xcconfig"; path = "Pods/Target Support Files/Pods-Sample/Pods-Sample.release.xcconfig"; sourceTree = ""; }; - D2224B8B160B94611AE69EAB /* Pods-Sample.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Sample.debug.xcconfig"; path = "Pods/Target Support Files/Pods-Sample/Pods-Sample.debug.xcconfig"; sourceTree = ""; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - B09B7E1C1AFF03DF0074ACA7 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - C2FB3EC8657116283267F9C6 /* Pods_Sample.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - B09B7E311AFF03DF0074ACA7 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 35727C4CE93902FBBCB4A42A /* Pods_SampleTests.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 9A6B0AB900C45A4ECAF3399D /* Frameworks */ = { - isa = PBXGroup; - children = ( - 8C49C8C5B3B72A8EFAA975BD /* Pods_Sample.framework */, - 160FC79E5080AA0454247CAD /* Pods_SampleTests.framework */, - ); - name = Frameworks; - sourceTree = ""; - }; - AC396C41187F44463FE1BEC7 /* Pods */ = { - isa = PBXGroup; - children = ( - D2224B8B160B94611AE69EAB /* Pods-Sample.debug.xcconfig */, - C24790F417D7C5AA97C48D74 /* Pods-Sample.release.xcconfig */, - B4B57DBE4984CDAD2E6E98AB /* Pods-SampleTests.debug.xcconfig */, - 0185E2EB172C88AD1648D935 /* Pods-SampleTests.release.xcconfig */, - ); - name = Pods; - sourceTree = ""; - }; - B09B7E161AFF03DE0074ACA7 = { - isa = PBXGroup; - children = ( - B09B7E211AFF03DF0074ACA7 /* Sample */, - B09B7E371AFF03DF0074ACA7 /* SampleTests */, - B09B7E201AFF03DF0074ACA7 /* Products */, - AC396C41187F44463FE1BEC7 /* Pods */, - 9A6B0AB900C45A4ECAF3399D /* Frameworks */, - ); - sourceTree = ""; - }; - B09B7E201AFF03DF0074ACA7 /* Products */ = { - isa = PBXGroup; - children = ( - B09B7E1F1AFF03DF0074ACA7 /* Sample.app */, - B09B7E341AFF03DF0074ACA7 /* SampleTests.xctest */, - ); - name = Products; - sourceTree = ""; - }; - B09B7E211AFF03DF0074ACA7 /* Sample */ = { - isa = PBXGroup; - children = ( - B09B7E241AFF03DF0074ACA7 /* AppDelegate.swift */, - B09B7E261AFF03DF0074ACA7 /* ViewController.swift */, - B085859424E1939A00AF211D /* SampleView.swift */, - B09B7E281AFF03DF0074ACA7 /* Main.storyboard */, - B09B7E2B1AFF03DF0074ACA7 /* Images.xcassets */, - B09B7E2D1AFF03DF0074ACA7 /* LaunchScreen.xib */, - B09B7E221AFF03DF0074ACA7 /* Supporting Files */, - B0426D502514EF5400AB4739 /* SwiftUIViewFor13.swift */, - B0426D702514F4A800AB4739 /* SwiftUIViewFor14.swift */, - ); - path = Sample; - sourceTree = ""; - }; - B09B7E221AFF03DF0074ACA7 /* Supporting Files */ = { - isa = PBXGroup; - children = ( - B09B7E231AFF03DF0074ACA7 /* Info.plist */, - ); - name = "Supporting Files"; - sourceTree = ""; - }; - B09B7E371AFF03DF0074ACA7 /* SampleTests */ = { - isa = PBXGroup; - children = ( - B09B7E3A1AFF03DF0074ACA7 /* SampleTests.swift */, - B09B7E381AFF03DF0074ACA7 /* Supporting Files */, - ); - path = SampleTests; - sourceTree = ""; - }; - B09B7E381AFF03DF0074ACA7 /* Supporting Files */ = { - isa = PBXGroup; - children = ( - B09B7E391AFF03DF0074ACA7 /* Info.plist */, - ); - name = "Supporting Files"; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - B09B7E1E1AFF03DF0074ACA7 /* Sample */ = { - isa = PBXNativeTarget; - buildConfigurationList = B09B7E3E1AFF03DF0074ACA7 /* Build configuration list for PBXNativeTarget "Sample" */; - buildPhases = ( - BFEE9F8A53477546E447B5D1 /* [CP] Check Pods Manifest.lock */, - B09B7E1B1AFF03DF0074ACA7 /* Sources */, - B09B7E1C1AFF03DF0074ACA7 /* Frameworks */, - B09B7E1D1AFF03DF0074ACA7 /* Resources */, - DB38808A6EA5A3023102DA8C /* [CP] Embed Pods Frameworks */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = Sample; - productName = Sample; - productReference = B09B7E1F1AFF03DF0074ACA7 /* Sample.app */; - productType = "com.apple.product-type.application"; - }; - B09B7E331AFF03DF0074ACA7 /* SampleTests */ = { - isa = PBXNativeTarget; - buildConfigurationList = B09B7E411AFF03DF0074ACA7 /* Build configuration list for PBXNativeTarget "SampleTests" */; - buildPhases = ( - 65BD20F9F60E6266E8CB0EFC /* [CP] Check Pods Manifest.lock */, - B09B7E301AFF03DF0074ACA7 /* Sources */, - B09B7E311AFF03DF0074ACA7 /* Frameworks */, - B09B7E321AFF03DF0074ACA7 /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - B09B7E361AFF03DF0074ACA7 /* PBXTargetDependency */, - ); - name = SampleTests; - productName = SampleTests; - productReference = B09B7E341AFF03DF0074ACA7 /* SampleTests.xctest */; - productType = "com.apple.product-type.bundle.unit-test"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - B09B7E171AFF03DE0074ACA7 /* Project object */ = { - isa = PBXProject; - attributes = { - LastSwiftUpdateCheck = 0730; - LastUpgradeCheck = 1200; - ORGANIZATIONNAME = tichise; - TargetAttributes = { - B09B7E1E1AFF03DF0074ACA7 = { - CreatedOnToolsVersion = 6.3.1; - LastSwiftMigration = 1020; - }; - B09B7E331AFF03DF0074ACA7 = { - CreatedOnToolsVersion = 6.3.1; - LastSwiftMigration = 1020; - TestTargetID = B09B7E1E1AFF03DF0074ACA7; - }; - }; - }; - buildConfigurationList = B09B7E1A1AFF03DE0074ACA7 /* Build configuration list for PBXProject "Sample" */; - compatibilityVersion = "Xcode 10.0"; - developmentRegion = en; - hasScannedForEncodings = 0; - knownRegions = ( - en, - Base, - ); - mainGroup = B09B7E161AFF03DE0074ACA7; - productRefGroup = B09B7E201AFF03DF0074ACA7 /* Products */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - B09B7E1E1AFF03DF0074ACA7 /* Sample */, - B09B7E331AFF03DF0074ACA7 /* SampleTests */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXResourcesBuildPhase section */ - B09B7E1D1AFF03DF0074ACA7 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - B09B7E2A1AFF03DF0074ACA7 /* Main.storyboard in Resources */, - B09B7E2F1AFF03DF0074ACA7 /* LaunchScreen.xib in Resources */, - B09B7E2C1AFF03DF0074ACA7 /* Images.xcassets in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - B09B7E321AFF03DF0074ACA7 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXShellScriptBuildPhase section */ - 65BD20F9F60E6266E8CB0EFC /* [CP] Check Pods Manifest.lock */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - "${PODS_PODFILE_DIR_PATH}/Podfile.lock", - "${PODS_ROOT}/Manifest.lock", - ); - name = "[CP] Check Pods Manifest.lock"; - outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-SampleTests-checkManifestLockResult.txt", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; - showEnvVarsInLog = 0; - }; - BFEE9F8A53477546E447B5D1 /* [CP] Check Pods Manifest.lock */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - "${PODS_PODFILE_DIR_PATH}/Podfile.lock", - "${PODS_ROOT}/Manifest.lock", - ); - name = "[CP] Check Pods Manifest.lock"; - outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-Sample-checkManifestLockResult.txt", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; - showEnvVarsInLog = 0; - }; - DB38808A6EA5A3023102DA8C /* [CP] Embed Pods Frameworks */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-Sample/Pods-Sample-frameworks-${CONFIGURATION}-input-files.xcfilelist", - ); - name = "[CP] Embed Pods Frameworks"; - outputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-Sample/Pods-Sample-frameworks-${CONFIGURATION}-output-files.xcfilelist", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Sample/Pods-Sample-frameworks.sh\"\n"; - showEnvVarsInLog = 0; - }; -/* End PBXShellScriptBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ - B09B7E1B1AFF03DF0074ACA7 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - B09B7E271AFF03DF0074ACA7 /* ViewController.swift in Sources */, - B0426D712514F4A800AB4739 /* SwiftUIViewFor14.swift in Sources */, - B085859524E1939A00AF211D /* SampleView.swift in Sources */, - B0426D512514EF5400AB4739 /* SwiftUIViewFor13.swift in Sources */, - B09B7E251AFF03DF0074ACA7 /* AppDelegate.swift in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - B09B7E301AFF03DF0074ACA7 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - B09B7E3B1AFF03DF0074ACA7 /* SampleTests.swift in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin PBXTargetDependency section */ - B09B7E361AFF03DF0074ACA7 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = B09B7E1E1AFF03DF0074ACA7 /* Sample */; - targetProxy = B09B7E351AFF03DF0074ACA7 /* PBXContainerItemProxy */; - }; -/* End PBXTargetDependency section */ - -/* Begin PBXVariantGroup section */ - B09B7E281AFF03DF0074ACA7 /* Main.storyboard */ = { - isa = PBXVariantGroup; - children = ( - B09B7E291AFF03DF0074ACA7 /* Base */, - ); - name = Main.storyboard; - sourceTree = ""; - }; - B09B7E2D1AFF03DF0074ACA7 /* LaunchScreen.xib */ = { - isa = PBXVariantGroup; - children = ( - B09B7E2E1AFF03DF0074ACA7 /* Base */, - ); - name = LaunchScreen.xib; - sourceTree = ""; - }; -/* End PBXVariantGroup section */ - -/* Begin XCBuildConfiguration section */ - B09B7E3C1AFF03DF0074ACA7 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = 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_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_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_STRICT_OBJC_MSGSEND = YES; - ENABLE_TESTABILITY = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_DYNAMIC_NO_PIC = NO; - GCC_NO_COMMON_BLOCKS = YES; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - GCC_SYMBOLS_PRIVATE_EXTERN = NO; - 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 = 12.0; - MTL_ENABLE_DEBUG_INFO = YES; - ONLY_ACTIVE_ARCH = YES; - SDKROOT = iphoneos; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_SWIFT3_OBJC_INFERENCE = Off; - SWIFT_VERSION = 4.0; - }; - name = Debug; - }; - B09B7E3D1AFF03DF0074ACA7 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = 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_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_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_NS_ASSERTIONS = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - 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 = 12.0; - MTL_ENABLE_DEBUG_INFO = NO; - SDKROOT = iphoneos; - SWIFT_COMPILATION_MODE = wholemodule; - SWIFT_OPTIMIZATION_LEVEL = "-O"; - SWIFT_SWIFT3_OBJC_INFERENCE = Off; - SWIFT_VERSION = 4.0; - VALIDATE_PRODUCT = YES; - }; - name = Release; - }; - B09B7E3F1AFF03DF0074ACA7 /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = D2224B8B160B94611AE69EAB /* Pods-Sample.debug.xcconfig */; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - CODE_SIGN_IDENTITY = "iPhone Developer"; - DEVELOPMENT_TEAM = T33NHY384Q; - INFOPLIST_FILE = Sample/Info.plist; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - ); - PRODUCT_BUNDLE_IDENTIFIER = sample; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 5.0; - }; - name = Debug; - }; - B09B7E401AFF03DF0074ACA7 /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = C24790F417D7C5AA97C48D74 /* Pods-Sample.release.xcconfig */; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - CODE_SIGN_IDENTITY = "iPhone Developer"; - DEVELOPMENT_TEAM = T33NHY384Q; - INFOPLIST_FILE = Sample/Info.plist; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - ); - PRODUCT_BUNDLE_IDENTIFIER = sample; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 5.0; - }; - name = Release; - }; - B09B7E421AFF03DF0074ACA7 /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = B4B57DBE4984CDAD2E6E98AB /* Pods-SampleTests.debug.xcconfig */; - buildSettings = { - BUNDLE_LOADER = "$(TEST_HOST)"; - DEVELOPMENT_TEAM = T33NHY384Q; - FRAMEWORK_SEARCH_PATHS = ( - "$(SDKROOT)/Developer/Library/Frameworks", - "$(inherited)", - ); - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - INFOPLIST_FILE = SampleTests/Info.plist; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - "@loader_path/Frameworks", - ); - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 5.0; - TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Sample.app/Sample"; - }; - name = Debug; - }; - B09B7E431AFF03DF0074ACA7 /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 0185E2EB172C88AD1648D935 /* Pods-SampleTests.release.xcconfig */; - buildSettings = { - BUNDLE_LOADER = "$(TEST_HOST)"; - DEVELOPMENT_TEAM = T33NHY384Q; - FRAMEWORK_SEARCH_PATHS = ( - "$(SDKROOT)/Developer/Library/Frameworks", - "$(inherited)", - ); - INFOPLIST_FILE = SampleTests/Info.plist; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - "@loader_path/Frameworks", - ); - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 5.0; - TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Sample.app/Sample"; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - B09B7E1A1AFF03DE0074ACA7 /* Build configuration list for PBXProject "Sample" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - B09B7E3C1AFF03DF0074ACA7 /* Debug */, - B09B7E3D1AFF03DF0074ACA7 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - B09B7E3E1AFF03DF0074ACA7 /* Build configuration list for PBXNativeTarget "Sample" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - B09B7E3F1AFF03DF0074ACA7 /* Debug */, - B09B7E401AFF03DF0074ACA7 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - B09B7E411AFF03DF0074ACA7 /* Build configuration list for PBXNativeTarget "SampleTests" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - B09B7E421AFF03DF0074ACA7 /* Debug */, - B09B7E431AFF03DF0074ACA7 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = B09B7E171AFF03DE0074ACA7 /* Project object */; -} diff --git a/Sample/Sample.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/Sample/Sample.xcodeproj/project.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index a80c038..0000000 --- a/Sample/Sample.xcodeproj/project.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/Sample/Sample.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/Sample/Sample.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist deleted file mode 100644 index 18d9810..0000000 --- a/Sample/Sample.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +++ /dev/null @@ -1,8 +0,0 @@ - - - - - IDEDidComputeMac32BitWarning - - - diff --git a/Sample/Sample/AppDelegate.swift b/Sample/Sample/AppDelegate.swift deleted file mode 100644 index 17e3164..0000000 --- a/Sample/Sample/AppDelegate.swift +++ /dev/null @@ -1,34 +0,0 @@ -// -// AppDelegate.swift -// Sample -// -// Created by tichise on 2015年5月10日 15/05/10. -// Copyright (c) 2015年 tichise. All rights reserved. -// - -import UIKit - -@UIApplicationMain -class AppDelegate: UIResponder, UIApplicationDelegate { - - var window: UIWindow? - - func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { - return true - } - - func applicationWillResignActive(_ application: UIApplication) { - } - - func applicationDidEnterBackground(_ application: UIApplication) { - } - - func applicationWillEnterForeground(_ application: UIApplication) { - } - - func applicationDidBecomeActive(_ application: UIApplication) { - } - - func applicationWillTerminate(_ application: UIApplication) { - } -} diff --git a/Sample/Sample/Base.lproj/LaunchScreen.xib b/Sample/Sample/Base.lproj/LaunchScreen.xib deleted file mode 100644 index f18f645..0000000 --- a/Sample/Sample/Base.lproj/LaunchScreen.xib +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - - - - - - - - - - - diff --git a/Sample/Sample/Base.lproj/Main.storyboard b/Sample/Sample/Base.lproj/Main.storyboard deleted file mode 100644 index ef627e0..0000000 --- a/Sample/Sample/Base.lproj/Main.storyboard +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Sample/Sample/Images.xcassets/AppIcon.appiconset/Contents.json b/Sample/Sample/Images.xcassets/AppIcon.appiconset/Contents.json deleted file mode 100644 index 19882d5..0000000 --- a/Sample/Sample/Images.xcassets/AppIcon.appiconset/Contents.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "images" : [ - { - "idiom" : "iphone", - "size" : "20x20", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "size" : "20x20", - "scale" : "3x" - }, - { - "idiom" : "iphone", - "size" : "29x29", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "size" : "29x29", - "scale" : "3x" - }, - { - "idiom" : "iphone", - "size" : "40x40", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "size" : "40x40", - "scale" : "3x" - }, - { - "idiom" : "iphone", - "size" : "60x60", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "size" : "60x60", - "scale" : "3x" - }, - { - "idiom" : "ios-marketing", - "size" : "1024x1024", - "scale" : "1x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} \ No newline at end of file diff --git a/Sample/Sample/Info.plist b/Sample/Sample/Info.plist deleted file mode 100644 index 6c48029..0000000 --- a/Sample/Sample/Info.plist +++ /dev/null @@ -1,38 +0,0 @@ - - - - - CFBundleDevelopmentRegion - en - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - $(PRODUCT_NAME) - CFBundlePackageType - APPL - CFBundleShortVersionString - 1.0 - CFBundleSignature - ???? - CFBundleVersion - 1 - LSRequiresIPhoneOS - - UILaunchStoryboardName - LaunchScreen - UIMainStoryboardFile - Main - UIRequiredDeviceCapabilities - - armv7 - - UISupportedInterfaceOrientations - - UIInterfaceOrientationPortrait - - - diff --git a/Sample/Sample/SampleView.swift b/Sample/Sample/SampleView.swift deleted file mode 100644 index f5a509d..0000000 --- a/Sample/Sample/SampleView.swift +++ /dev/null @@ -1,28 +0,0 @@ -// -// SampleView.swift -// Sample -// -// Created by tichise on 2020年8月10日 20/08/10. -// Copyright © 2020 tichise. All rights reserved. -// - -import SwiftUI -import MaterialDesignSymbol - -@available(iOS 14.0.0, *) -struct SampleView: View { - - var body: some View { - VStack { - Image(materialDesignIcon: .work48px, size: 50) - Image(materialDesignIcon: .album24px, size: 30, color: .green) - } - } -} - -@available(iOS 14.0.0, *) -struct SampleView_Previews: PreviewProvider { - static var previews: some View { - SampleView() - } -} diff --git a/Sample/Sample/SwiftUIViewFor13.swift b/Sample/Sample/SwiftUIViewFor13.swift deleted file mode 100644 index 8fc9036..0000000 --- a/Sample/Sample/SwiftUIViewFor13.swift +++ /dev/null @@ -1,28 +0,0 @@ -// -// SwiftUIViewFor13.swift -// Sample -// -// Created by tichise on 2020年9月18日 20/09/18. -// Copyright © 2020 tichise. All rights reserved. -// - -import SwiftUI -import MaterialDesignSymbol - -@available(iOS 13.0.0, *) -struct SwiftUIViewFor13: View { - - var body: some View { - VStack { - Image(materialDesignIcon: .album24px, size: 30, uiColor: .green) - Image(materialDesignIcon: .album24px, size: 30) - } - } -} - -@available(iOS 13.0.0, *) -struct SwiftUIViewFor13_Previews: PreviewProvider { - static var previews: some View { - SwiftUIViewFor13() - } -} diff --git a/Sample/Sample/SwiftUIViewFor14.swift b/Sample/Sample/SwiftUIViewFor14.swift deleted file mode 100644 index a4e3f92..0000000 --- a/Sample/Sample/SwiftUIViewFor14.swift +++ /dev/null @@ -1,28 +0,0 @@ -// -// SwiftUIViewFor14.swift -// Sample -// -// Created by tichise on 2020年9月18日 20/09/18. -// Copyright © 2020 tichise. All rights reserved. -// - -import SwiftUI -import MaterialDesignSymbol - -@available(iOS 14.0.0, *) -struct SwiftUIViewFor14: View { - - var body: some View { - VStack { - Image(materialDesignIcon: .album48px, size: 30) - Image(materialDesignIcon: .album24px, size: 30, color: .green) - } - } -} - -@available(iOS 14.0.0, *) -struct SwiftUIViewFor14_Previews: PreviewProvider { - static var previews: some View { - SwiftUIViewFor14() - } -} diff --git a/Sample/Sample/ViewController.swift b/Sample/Sample/ViewController.swift deleted file mode 100644 index f8146fa..0000000 --- a/Sample/Sample/ViewController.swift +++ /dev/null @@ -1,31 +0,0 @@ -// -// ViewController.swift -// Sample -// -// Created by tichise on 2015年5月10日 15/05/10. -// Copyright (c) 2015年 tichise. All rights reserved. -// - -import UIKit -import MaterialDesignSymbol - -class ViewController: UIViewController { - - @IBOutlet var sampleImageView: UIImageView! - @IBOutlet var sampleLabel: UILabel! - - override func viewDidLoad() { - super.viewDidLoad() - - // UIImage - self.sampleImageView.image = MaterialDesignSymbol(icon: .viewHeadline48px, size: 30).image() - - // String - sampleLabel.font = MaterialDesignFont.fontOfSize(20) - sampleLabel.text = MaterialDesignIconEnum.clear48px.rawValue - } - - override func didReceiveMemoryWarning() { - super.didReceiveMemoryWarning() - } -} diff --git a/Sample/SampleTests/Info.plist b/Sample/SampleTests/Info.plist deleted file mode 100644 index ba72822..0000000 --- a/Sample/SampleTests/Info.plist +++ /dev/null @@ -1,24 +0,0 @@ - - - - - CFBundleDevelopmentRegion - en - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - $(PRODUCT_NAME) - CFBundlePackageType - BNDL - CFBundleShortVersionString - 1.0 - CFBundleSignature - ???? - CFBundleVersion - 1 - - diff --git a/Sample/SampleTests/SampleTests.swift b/Sample/SampleTests/SampleTests.swift deleted file mode 100644 index 89ef67f..0000000 --- a/Sample/SampleTests/SampleTests.swift +++ /dev/null @@ -1,40 +0,0 @@ -// -// SampleTests.swift -// SampleTests -// -// Created by tichise on 2015年5月10日 15/05/10. -// Copyright (c) 2015年 tichise. All rights reserved. -// - -import UIKit -import XCTest -import MaterialDesignSymbol - -class SampleTests: XCTestCase { - - override func setUp() { - super.setUp() - } - - override func tearDown() { - super.tearDown() - } - - func testImage() { - - let symbol = MaterialDesignSymbol(text: MaterialDesignIcon.list48px, size: 25) - symbol.addAttribute(attributeName: NSAttributedString.Key.foregroundColor, value: UIColor.red) - let iconImage = symbol.image(size: CGSize(width: 25, height: 25)) - - XCTAssertTrue(iconImage.size.width > 0) - XCTAssertTrue(iconImage.size.height > 0) - } - - func testFont() { - let titleLabel = UILabel.init() - titleLabel.font = MaterialDesignFont.fontOfSize(20) - titleLabel.text = MaterialDesignIcon.list48px - - XCTAssertEqual(titleLabel.text?.count, 1) - } -} diff --git a/SampleSPM/SampleSPM.xcodeproj/project.pbxproj b/SampleSPM/SampleSPM.xcodeproj/project.pbxproj index c714451..e201b4b 100644 --- a/SampleSPM/SampleSPM.xcodeproj/project.pbxproj +++ b/SampleSPM/SampleSPM.xcodeproj/project.pbxproj @@ -211,7 +211,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 15.0; + IPHONEOS_DEPLOYMENT_TARGET = 16.0; MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; MTL_FAST_MATH = YES; ONLY_ACTIVE_ARCH = YES; @@ -266,7 +266,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 15.0; + IPHONEOS_DEPLOYMENT_TARGET = 16.0; MTL_ENABLE_DEBUG_INFO = NO; MTL_FAST_MATH = YES; SDKROOT = iphoneos; @@ -292,7 +292,7 @@ INFOPLIST_KEY_UILaunchScreen_Generation = YES; INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; - IPHONEOS_DEPLOYMENT_TARGET = 14.0; + IPHONEOS_DEPLOYMENT_TARGET = 16.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", @@ -322,7 +322,7 @@ INFOPLIST_KEY_UILaunchScreen_Generation = YES; INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; - IPHONEOS_DEPLOYMENT_TARGET = 14.0; + IPHONEOS_DEPLOYMENT_TARGET = 16.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", diff --git a/SampleSPM/SampleSPM/ContentView.swift b/SampleSPM/SampleSPM/ContentView.swift index 2dd0503..8cc58da 100644 --- a/SampleSPM/SampleSPM/ContentView.swift +++ b/SampleSPM/SampleSPM/ContentView.swift @@ -12,11 +12,19 @@ struct ContentView: View { var body: some View { VStack { - Text("test") - Image(materialDesignIcon: .album48px, size: 30) - Image(materialDesignIcon: .album24px, size: 30, color: .green) + Text("MaterialDesignSymbol Sample") + + Image(uiImage: MaterialDesignSymbol(icon: .album48px, size: 30).image()) + + Image(uiImage: createColoredIcon()) } } + + private func createColoredIcon() -> UIImage { + let symbol = MaterialDesignSymbol(icon: .album24px, size: 30) + symbol.addAttribute(foregroundColor: .green) + return symbol.image() + } } struct ContentView_Previews: PreviewProvider { diff --git a/Tests/MaterialDesignSymbolTests/MaterialDesignSymbolTests.swift b/Tests/MaterialDesignSymbolTests/MaterialDesignSymbolTests.swift new file mode 100644 index 0000000..5b34881 --- /dev/null +++ b/Tests/MaterialDesignSymbolTests/MaterialDesignSymbolTests.swift @@ -0,0 +1,230 @@ +import XCTest +@testable import MaterialDesignSymbol + +final class MaterialDesignSymbolTests: XCTestCase { + + // MARK: - MaterialDesignFont Tests + + func testFontSharedInstance() { + let font1 = MaterialDesignFont.shared + let font2 = MaterialDesignFont.shared + XCTAssertTrue(font1.fontOfSize(20).fontName == font2.fontOfSize(20).fontName) + } + + func testFontLoading() { + let font = MaterialDesignFont.shared.fontOfSize(24) + XCTAssertNotNil(font, "Font should load successfully") + XCTAssertEqual(font.fontName, "material-design-icons") + } + + func testFontSize() { + let fontSize: CGFloat = 32 + let font = MaterialDesignFont.shared.fontOfSize(fontSize) + XCTAssertEqual(font.pointSize, fontSize) + } + + func testFontDifferentSizes() { + let sizes: [CGFloat] = [12, 24, 36, 48, 72] + for size in sizes { + let font = MaterialDesignFont.shared.fontOfSize(size) + XCTAssertEqual(font.pointSize, size) + } + } + + func testLoadFontMethod() { + MaterialDesignFont.shared.loadFont() + let font = MaterialDesignFont.shared.fontOfSize(20) + XCTAssertNotNil(font) + } + + // MARK: - FontLoader Tests + + func testFontLoaderWithInvalidFont() { + XCTAssertThrowsError(try FontLoader.loadFont("non-existent-font")) { error in + XCTAssertTrue(error is FontError) + XCTAssertEqual(error as? FontError, .invalidFontFile) + } + } + + func testFontErrorCases() { + let errors: [FontError] = [ + .invalidFontFile, + .fontPathNotFound, + .initFontError, + .registerFailed + ] + XCTAssertEqual(errors.count, 4) + } + + // MARK: - MaterialDesignSymbol Initialization Tests + + func testSymbolInitWithEnum() { + let symbol = MaterialDesignSymbol(icon: .home48px, size: 30) + XCTAssertNotNil(symbol) + } + + func testSymbolInitWithText() { + let symbol = MaterialDesignSymbol(text: MaterialDesignIconEnum.home48px.rawValue, size: 30) + XCTAssertNotNil(symbol) + } + + func testSymbolInitWithDifferentSizes() { + let sizes: [CGFloat] = [16, 24, 32, 48, 64] + for size in sizes { + let symbol = MaterialDesignSymbol(icon: .home48px, size: size) + let image = symbol.image() + XCTAssertEqual(image.size.width, size) + XCTAssertEqual(image.size.height, size) + } + } + + // MARK: - Image Generation Tests + + func testImageGeneration() { + let symbol = MaterialDesignSymbol(icon: .home48px, size: 30) + let image = symbol.image() + XCTAssertTrue(image.size.width > 0) + XCTAssertTrue(image.size.height > 0) + } + + func testImageGenerationWithSize() { + let symbol = MaterialDesignSymbol(icon: .home48px, size: 30) + let size = CGSize(width: 50, height: 50) + let image = symbol.image(size: size) + XCTAssertEqual(image.size.width, size.width) + XCTAssertEqual(image.size.height, size.height) + } + + func testImageGenerationWithCustomSize() { + let symbol = MaterialDesignSymbol(icon: .settings48px, size: 24) + let customSize = CGSize(width: 100, height: 100) + let image = symbol.image(size: customSize) + XCTAssertEqual(image.size.width, 100) + XCTAssertEqual(image.size.height, 100) + } + + func testImageWithColor() { + let symbol = MaterialDesignSymbol(icon: .home48px, size: 30) + symbol.addAttribute(foregroundColor: .red) + let image = symbol.image() + XCTAssertTrue(image.size.width > 0) + } + + func testImageWithMultipleColors() { + let colors: [UIColor] = [.red, .blue, .green, .black, .white] + for color in colors { + let symbol = MaterialDesignSymbol(icon: .home48px, size: 30) + symbol.addAttribute(foregroundColor: color) + let image = symbol.image() + XCTAssertTrue(image.size.width > 0) + } + } + + // MARK: - Attribute Tests + + func testAddAttributeWithKey() { + let symbol = MaterialDesignSymbol(icon: .home48px, size: 30) + symbol.addAttribute(attributeName: .kern, value: 1.0) + let image = symbol.image() + XCTAssertTrue(image.size.width > 0) + } + + func testAddMultipleAttributes() { + let symbol = MaterialDesignSymbol(icon: .home48px, size: 30) + symbol.addAttribute(attributeName: .foregroundColor, value: UIColor.red) + symbol.addAttribute(attributeName: .kern, value: 2.0) + symbol.addAttribute(attributeName: .baselineOffset, value: 5.0) + let image = symbol.image() + XCTAssertTrue(image.size.width > 0) + } + + func testAddForegroundColorAttribute() { + let symbol = MaterialDesignSymbol(icon: .menu48px, size: 24) + symbol.addAttribute(foregroundColor: .blue) + let image = symbol.image() + XCTAssertNotNil(image) + } + + // MARK: - MaterialDesignIconEnum Tests + + func testIconEnumHasRawValue() { + let icon = MaterialDesignIconEnum.home48px + XCTAssertFalse(icon.rawValue.isEmpty) + } + + func testIconEnumRawValueIsUnicode() { + let icon = MaterialDesignIconEnum.home48px + XCTAssertEqual(icon.rawValue.count, 1) + } + + func testMultipleIcons() { + let icons: [MaterialDesignIconEnum] = [ + .home48px, + .settings48px, + .search48px, + .menu48px, + .add48px, + .delete48px + ] + + for icon in icons { + let symbol = MaterialDesignSymbol(icon: icon, size: 24) + let image = symbol.image() + XCTAssertTrue(image.size.width > 0, "Image for \(icon) should be generated") + } + } + + func testIconEnum24pxVariants() { + let icons: [MaterialDesignIconEnum] = [ + .home24px, + .settings24px, + .search24px + ] + + for icon in icons { + XCTAssertFalse(icon.rawValue.isEmpty) + } + } + + // MARK: - MaterialDesignIcon (Deprecated) Tests + + func testDeprecatedMaterialDesignIconExists() { + // Verify the deprecated struct exists for backward compatibility + let _ = MaterialDesignIcon.self + } + + func testDeprecatedIconStaticProperties() { + // Test that static properties still work + let iconText = MaterialDesignIcon.home48px + XCTAssertFalse(iconText.isEmpty) + XCTAssertEqual(iconText.count, 1) + } + + // MARK: - Edge Cases + + func testVerySmallSize() { + let symbol = MaterialDesignSymbol(icon: .home48px, size: 1) + let image = symbol.image() + XCTAssertEqual(image.size.width, 1) + } + + func testVeryLargeSize() { + let symbol = MaterialDesignSymbol(icon: .home48px, size: 500) + let image = symbol.image() + XCTAssertEqual(image.size.width, 500) + } + + func testMinimumValidSize() { + let symbol = MaterialDesignSymbol(icon: .home48px, size: 30) + let image = symbol.image(size: CGSize(width: 1, height: 1)) + XCTAssertEqual(image.size.width, 1) + XCTAssertEqual(image.size.height, 1) + } + + func testNonSquareImageSize() { + let symbol = MaterialDesignSymbol(icon: .home48px, size: 30) + let image = symbol.image(size: CGSize(width: 100, height: 50)) + XCTAssertEqual(image.size.width, 100) + XCTAssertEqual(image.size.height, 50) + } +}