├── .gitignore ├── LICENSE.txt ├── MaterialDesignColor.podspec ├── Package.swift ├── README.md ├── Sample ├── Podfile ├── Sample.xcodeproj │ ├── project.pbxproj │ └── project.xcworkspace │ │ └── contents.xcworkspacedata ├── Sample.xcworkspace │ └── xcshareddata │ │ └── IDEWorkspaceChecks.plist ├── Sample │ ├── AppDelegate.swift │ ├── Base.lproj │ │ ├── LaunchScreen.xib │ │ └── Main.storyboard │ ├── Images.xcassets │ │ └── AppIcon.appiconset │ │ │ └── Contents.json │ ├── Info.plist │ ├── SwiftUIView.swift │ └── ViewController.swift └── SampleTests │ ├── Info.plist │ └── SampleTests.swift └── Sources ├── MaterialDesignColor.swift └── UIColor+Color.swift /.gitignore: -------------------------------------------------------------------------------- 1 | # Mac OS X 2 | .DS_Store 3 | 4 | # Xcode 5 | build/ 6 | .build/ 7 | *.pbxuser 8 | !default.pbxuser 9 | *.mode1v3 10 | !default.mode1v3 11 | *.mode2v3 12 | !default.mode2v3 13 | *.perspectivev3 14 | !default.perspectivev3 15 | xcuserdata 16 | *.xccheckout 17 | *.moved-aside 18 | DerivedData 19 | *.hmap 20 | *.ipa 21 | *.xcuserstate 22 | 23 | # Carthage 24 | Carthage/Build 25 | Sample/Podfile.lock 26 | Sample/Pods/* 27 | 28 | 29 | Sample/Sample.xcworkspace/contents.xcworkspacedata 30 | 31 | SampleObjectiveC/Podfile.lock 32 | SampleObjectiveC/Pods/* -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2015 - 2016 Takuya Ichise 2 | Permission is hereby granted, free of charge, to any person obtaining a copy 3 | of this software and associated documentation files (the "Software"), to deal 4 | in the Software without restriction, including without limitation the rights 5 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 6 | copies of the Software, and to permit persons to whom the Software is 7 | furnished to do so, subject to the following conditions: 8 | 9 | The above copyright notice and this permission notice shall be included in 10 | all copies or substantial portions of the Software. 11 | 12 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 13 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 14 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 15 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 16 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 17 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 18 | THE SOFTWARE. -------------------------------------------------------------------------------- /MaterialDesignColor.podspec: -------------------------------------------------------------------------------- 1 | Pod::Spec.new do |s| 2 | s.name = 'MaterialDesignColor' 3 | s.version = '2.3.8' 4 | s.license = { 5 | :type => "MIT", 6 | :text => <<-LICENSE 7 | Copyright (c) 2015 - 2021 Takuya Ichise 8 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 9 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 10 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 11 | LICENSE 12 | } 13 | s.summary = 'Color library for Swift. Currently supports Google Material Design Color' 14 | s.homepage = 'https://github.com/tichise/MaterialDesignColor' 15 | s.social_media_url = 'http://twitter.com/tichise' 16 | s.author = "Takuya Ichise" 17 | s.source = { :git => 'https://github.com/tichise/MaterialDesignColor.git', :tag => s.version } 18 | s.swift_versions = '5.0' 19 | 20 | s.ios.deployment_target = '11.0' 21 | 22 | s.source_files = 'Sources/*.swift' 23 | s.requires_arc = true 24 | 25 | end 26 | -------------------------------------------------------------------------------- /Package.swift: -------------------------------------------------------------------------------- 1 | // swift-tools-version:5.3 2 | // The swift-tools-version declares the minimum version of Swift required to build this package. 3 | import PackageDescription 4 | 5 | let package = Package( 6 | name: "MaterialDesignColor", 7 | platforms: [.iOS(.v13), 8 | .watchOS(.v6)], 9 | products: [ 10 | .library(name: "MaterialDesignColor", targets: ["MaterialDesignColor"]) 11 | ], 12 | dependencies: [], 13 | targets: [ 14 | .target(name: "MaterialDesignColor", path: "Sources"), 15 | ], 16 | swiftLanguageVersions: [.v5] 17 | ) 18 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | #### MaterialDesignColor ![CocoaPods Version](https://img.shields.io/cocoapods/v/MaterialDesignColor.svg?style=flat) ![Platform](https://img.shields.io/cocoapods/p/MaterialDesignColor.svg?style=flat) ![License](https://img.shields.io/cocoapods/l/MaterialDesignColor.svg?style=flat) 2 | 3 | ![image](https://user-images.githubusercontent.com/43707/89963217-fa82f600-dc81-11ea-895d-1ec8e1555c30.png) 4 | 5 | Color library for Swift. Currently supports [GoogleMaterialDesignColor](https://www.google.com/design/spec/style/color.html) 6 | 7 | MaterialDesignColorはGoogleがマテリアルデザインで推奨しているカラーコードを簡単に呼び出せるiOSライブラリです。 cocoapodsからダウンロードして使えます。使い方は[こちら](http://qiita.com/tichise/items/d6907d95738673e54bd8)に記載してます。 8 | 9 | #### Examples / SwiftUI 10 | 11 | ``` 12 | import SwiftUI 13 | import MaterialDesignColor 14 | 15 | @available(iOS 13.0.0, *) 16 | struct SwiftUIView: View { 17 | var body: some View { 18 | Text("hellow world").background(MaterialDesignColor.red400.suColor) 19 | } 20 | } 21 | 22 | @available(iOS 13.0.0, *) 23 | struct SwiftUIView_Previews: PreviewProvider { 24 | static var previews: some View { 25 | SwiftUIView() 26 | } 27 | } 28 | ``` 29 | 30 | #### Examples / UIKit 31 | 32 | 33 | ```html 34 | import MaterialDesignColor 35 | 36 | textLabel.textColor = MaterialDesignColor.lightGreen400 37 | ``` 38 | 39 | #### Installation (CocoaPods) 40 | `pod MaterialDesignColor` 41 | -------------------------------------------------------------------------------- /Sample/Podfile: -------------------------------------------------------------------------------- 1 | platform :ios, '11.0' 2 | 3 | target 'Sample' do 4 | use_frameworks! 5 | 6 | pod 'MaterialDesignColor', :path => '../' 7 | end 8 | -------------------------------------------------------------------------------- /Sample/Sample.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 51; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | B08585A824E3743500AF211D /* SwiftUIView.swift in Sources */ = {isa = PBXBuildFile; fileRef = B08585A724E3743500AF211D /* SwiftUIView.swift */; }; 11 | B09B7E251AFF03DF0074ACA7 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = B09B7E241AFF03DF0074ACA7 /* AppDelegate.swift */; }; 12 | B09B7E271AFF03DF0074ACA7 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = B09B7E261AFF03DF0074ACA7 /* ViewController.swift */; }; 13 | B09B7E2A1AFF03DF0074ACA7 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = B09B7E281AFF03DF0074ACA7 /* Main.storyboard */; }; 14 | B09B7E2C1AFF03DF0074ACA7 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = B09B7E2B1AFF03DF0074ACA7 /* Images.xcassets */; }; 15 | B09B7E2F1AFF03DF0074ACA7 /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = B09B7E2D1AFF03DF0074ACA7 /* LaunchScreen.xib */; }; 16 | B09B7E3B1AFF03DF0074ACA7 /* SampleTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = B09B7E3A1AFF03DF0074ACA7 /* SampleTests.swift */; }; 17 | D32DC132DC34D68586D9C2DF /* Pods_Sample.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 820591879E77770B5AEEC970 /* Pods_Sample.framework */; }; 18 | /* End PBXBuildFile section */ 19 | 20 | /* Begin PBXContainerItemProxy section */ 21 | B09B7E351AFF03DF0074ACA7 /* PBXContainerItemProxy */ = { 22 | isa = PBXContainerItemProxy; 23 | containerPortal = B09B7E171AFF03DE0074ACA7 /* Project object */; 24 | proxyType = 1; 25 | remoteGlobalIDString = B09B7E1E1AFF03DF0074ACA7; 26 | remoteInfo = Sample; 27 | }; 28 | /* End PBXContainerItemProxy section */ 29 | 30 | /* Begin PBXFileReference section */ 31 | 0C83F39A6F5E989BFD6057CD /* Pods.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.debug.xcconfig; path = "Pods/Target Support Files/Pods/Pods.debug.xcconfig"; sourceTree = ""; }; 32 | 0D2D5A7ABB1C2F1DF9E9CC9F /* 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 = ""; }; 33 | 76D11F25FAEB63FAB9EC89F6 /* 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 = ""; }; 34 | 820591879E77770B5AEEC970 /* Pods_Sample.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Sample.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 35 | 95C92F494B1F4329C28A4330 /* Pods.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.release.xcconfig; path = "Pods/Target Support Files/Pods/Pods.release.xcconfig"; sourceTree = ""; }; 36 | B08585A724E3743500AF211D /* SwiftUIView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SwiftUIView.swift; sourceTree = ""; }; 37 | B09B7E1F1AFF03DF0074ACA7 /* Sample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Sample.app; sourceTree = BUILT_PRODUCTS_DIR; }; 38 | B09B7E231AFF03DF0074ACA7 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 39 | B09B7E241AFF03DF0074ACA7 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 40 | B09B7E261AFF03DF0074ACA7 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; 41 | B09B7E291AFF03DF0074ACA7 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 42 | B09B7E2B1AFF03DF0074ACA7 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; 43 | B09B7E2E1AFF03DF0074ACA7 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = ""; }; 44 | B09B7E341AFF03DF0074ACA7 /* SampleTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = SampleTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 45 | B09B7E391AFF03DF0074ACA7 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 46 | B09B7E3A1AFF03DF0074ACA7 /* SampleTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SampleTests.swift; sourceTree = ""; }; 47 | /* End PBXFileReference section */ 48 | 49 | /* Begin PBXFrameworksBuildPhase section */ 50 | B09B7E1C1AFF03DF0074ACA7 /* Frameworks */ = { 51 | isa = PBXFrameworksBuildPhase; 52 | buildActionMask = 2147483647; 53 | files = ( 54 | D32DC132DC34D68586D9C2DF /* Pods_Sample.framework in Frameworks */, 55 | ); 56 | runOnlyForDeploymentPostprocessing = 0; 57 | }; 58 | B09B7E311AFF03DF0074ACA7 /* Frameworks */ = { 59 | isa = PBXFrameworksBuildPhase; 60 | buildActionMask = 2147483647; 61 | files = ( 62 | ); 63 | runOnlyForDeploymentPostprocessing = 0; 64 | }; 65 | /* End PBXFrameworksBuildPhase section */ 66 | 67 | /* Begin PBXGroup section */ 68 | 9A6B0AB900C45A4ECAF3399D /* Frameworks */ = { 69 | isa = PBXGroup; 70 | children = ( 71 | 820591879E77770B5AEEC970 /* Pods_Sample.framework */, 72 | ); 73 | name = Frameworks; 74 | sourceTree = ""; 75 | }; 76 | AC396C41187F44463FE1BEC7 /* Pods */ = { 77 | isa = PBXGroup; 78 | children = ( 79 | 0C83F39A6F5E989BFD6057CD /* Pods.debug.xcconfig */, 80 | 95C92F494B1F4329C28A4330 /* Pods.release.xcconfig */, 81 | 0D2D5A7ABB1C2F1DF9E9CC9F /* Pods-Sample.debug.xcconfig */, 82 | 76D11F25FAEB63FAB9EC89F6 /* Pods-Sample.release.xcconfig */, 83 | ); 84 | name = Pods; 85 | sourceTree = ""; 86 | }; 87 | B09B7E161AFF03DE0074ACA7 = { 88 | isa = PBXGroup; 89 | children = ( 90 | B09B7E211AFF03DF0074ACA7 /* Sample */, 91 | B09B7E371AFF03DF0074ACA7 /* SampleTests */, 92 | B09B7E201AFF03DF0074ACA7 /* Products */, 93 | AC396C41187F44463FE1BEC7 /* Pods */, 94 | 9A6B0AB900C45A4ECAF3399D /* Frameworks */, 95 | ); 96 | sourceTree = ""; 97 | }; 98 | B09B7E201AFF03DF0074ACA7 /* Products */ = { 99 | isa = PBXGroup; 100 | children = ( 101 | B09B7E1F1AFF03DF0074ACA7 /* Sample.app */, 102 | B09B7E341AFF03DF0074ACA7 /* SampleTests.xctest */, 103 | ); 104 | name = Products; 105 | sourceTree = ""; 106 | }; 107 | B09B7E211AFF03DF0074ACA7 /* Sample */ = { 108 | isa = PBXGroup; 109 | children = ( 110 | B09B7E241AFF03DF0074ACA7 /* AppDelegate.swift */, 111 | B09B7E261AFF03DF0074ACA7 /* ViewController.swift */, 112 | B09B7E281AFF03DF0074ACA7 /* Main.storyboard */, 113 | B09B7E2B1AFF03DF0074ACA7 /* Images.xcassets */, 114 | B09B7E2D1AFF03DF0074ACA7 /* LaunchScreen.xib */, 115 | B09B7E221AFF03DF0074ACA7 /* Supporting Files */, 116 | B08585A724E3743500AF211D /* SwiftUIView.swift */, 117 | ); 118 | path = Sample; 119 | sourceTree = ""; 120 | }; 121 | B09B7E221AFF03DF0074ACA7 /* Supporting Files */ = { 122 | isa = PBXGroup; 123 | children = ( 124 | B09B7E231AFF03DF0074ACA7 /* Info.plist */, 125 | ); 126 | name = "Supporting Files"; 127 | sourceTree = ""; 128 | }; 129 | B09B7E371AFF03DF0074ACA7 /* SampleTests */ = { 130 | isa = PBXGroup; 131 | children = ( 132 | B09B7E3A1AFF03DF0074ACA7 /* SampleTests.swift */, 133 | B09B7E381AFF03DF0074ACA7 /* Supporting Files */, 134 | ); 135 | path = SampleTests; 136 | sourceTree = ""; 137 | }; 138 | B09B7E381AFF03DF0074ACA7 /* Supporting Files */ = { 139 | isa = PBXGroup; 140 | children = ( 141 | B09B7E391AFF03DF0074ACA7 /* Info.plist */, 142 | ); 143 | name = "Supporting Files"; 144 | sourceTree = ""; 145 | }; 146 | /* End PBXGroup section */ 147 | 148 | /* Begin PBXNativeTarget section */ 149 | B09B7E1E1AFF03DF0074ACA7 /* Sample */ = { 150 | isa = PBXNativeTarget; 151 | buildConfigurationList = B09B7E3E1AFF03DF0074ACA7 /* Build configuration list for PBXNativeTarget "Sample" */; 152 | buildPhases = ( 153 | BFEE9F8A53477546E447B5D1 /* [CP] Check Pods Manifest.lock */, 154 | B09B7E1B1AFF03DF0074ACA7 /* Sources */, 155 | B09B7E1C1AFF03DF0074ACA7 /* Frameworks */, 156 | B09B7E1D1AFF03DF0074ACA7 /* Resources */, 157 | DB38808A6EA5A3023102DA8C /* [CP] Embed Pods Frameworks */, 158 | ); 159 | buildRules = ( 160 | ); 161 | dependencies = ( 162 | ); 163 | name = Sample; 164 | productName = Sample; 165 | productReference = B09B7E1F1AFF03DF0074ACA7 /* Sample.app */; 166 | productType = "com.apple.product-type.application"; 167 | }; 168 | B09B7E331AFF03DF0074ACA7 /* SampleTests */ = { 169 | isa = PBXNativeTarget; 170 | buildConfigurationList = B09B7E411AFF03DF0074ACA7 /* Build configuration list for PBXNativeTarget "SampleTests" */; 171 | buildPhases = ( 172 | B09B7E301AFF03DF0074ACA7 /* Sources */, 173 | B09B7E311AFF03DF0074ACA7 /* Frameworks */, 174 | B09B7E321AFF03DF0074ACA7 /* Resources */, 175 | ); 176 | buildRules = ( 177 | ); 178 | dependencies = ( 179 | B09B7E361AFF03DF0074ACA7 /* PBXTargetDependency */, 180 | ); 181 | name = SampleTests; 182 | productName = SampleTests; 183 | productReference = B09B7E341AFF03DF0074ACA7 /* SampleTests.xctest */; 184 | productType = "com.apple.product-type.bundle.unit-test"; 185 | }; 186 | /* End PBXNativeTarget section */ 187 | 188 | /* Begin PBXProject section */ 189 | B09B7E171AFF03DE0074ACA7 /* Project object */ = { 190 | isa = PBXProject; 191 | attributes = { 192 | LastUpgradeCheck = 1000; 193 | ORGANIZATIONNAME = tichise; 194 | TargetAttributes = { 195 | B09B7E1E1AFF03DF0074ACA7 = { 196 | CreatedOnToolsVersion = 6.3.1; 197 | DevelopmentTeam = T33NHY384Q; 198 | LastSwiftMigration = 1020; 199 | ProvisioningStyle = Automatic; 200 | }; 201 | B09B7E331AFF03DF0074ACA7 = { 202 | CreatedOnToolsVersion = 6.3.1; 203 | DevelopmentTeam = T33NHY384Q; 204 | LastSwiftMigration = 1020; 205 | TestTargetID = B09B7E1E1AFF03DF0074ACA7; 206 | }; 207 | }; 208 | }; 209 | buildConfigurationList = B09B7E1A1AFF03DE0074ACA7 /* Build configuration list for PBXProject "Sample" */; 210 | compatibilityVersion = "Xcode 10.0"; 211 | developmentRegion = en; 212 | hasScannedForEncodings = 0; 213 | knownRegions = ( 214 | en, 215 | Base, 216 | ); 217 | mainGroup = B09B7E161AFF03DE0074ACA7; 218 | productRefGroup = B09B7E201AFF03DF0074ACA7 /* Products */; 219 | projectDirPath = ""; 220 | projectRoot = ""; 221 | targets = ( 222 | B09B7E1E1AFF03DF0074ACA7 /* Sample */, 223 | B09B7E331AFF03DF0074ACA7 /* SampleTests */, 224 | ); 225 | }; 226 | /* End PBXProject section */ 227 | 228 | /* Begin PBXResourcesBuildPhase section */ 229 | B09B7E1D1AFF03DF0074ACA7 /* Resources */ = { 230 | isa = PBXResourcesBuildPhase; 231 | buildActionMask = 2147483647; 232 | files = ( 233 | B09B7E2A1AFF03DF0074ACA7 /* Main.storyboard in Resources */, 234 | B09B7E2F1AFF03DF0074ACA7 /* LaunchScreen.xib in Resources */, 235 | B09B7E2C1AFF03DF0074ACA7 /* Images.xcassets in Resources */, 236 | ); 237 | runOnlyForDeploymentPostprocessing = 0; 238 | }; 239 | B09B7E321AFF03DF0074ACA7 /* Resources */ = { 240 | isa = PBXResourcesBuildPhase; 241 | buildActionMask = 2147483647; 242 | files = ( 243 | ); 244 | runOnlyForDeploymentPostprocessing = 0; 245 | }; 246 | /* End PBXResourcesBuildPhase section */ 247 | 248 | /* Begin PBXShellScriptBuildPhase section */ 249 | BFEE9F8A53477546E447B5D1 /* [CP] Check Pods Manifest.lock */ = { 250 | isa = PBXShellScriptBuildPhase; 251 | buildActionMask = 2147483647; 252 | files = ( 253 | ); 254 | inputPaths = ( 255 | "${PODS_PODFILE_DIR_PATH}/Podfile.lock", 256 | "${PODS_ROOT}/Manifest.lock", 257 | ); 258 | name = "[CP] Check Pods Manifest.lock"; 259 | outputPaths = ( 260 | "$(DERIVED_FILE_DIR)/Pods-Sample-checkManifestLockResult.txt", 261 | ); 262 | runOnlyForDeploymentPostprocessing = 0; 263 | shellPath = /bin/sh; 264 | 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"; 265 | showEnvVarsInLog = 0; 266 | }; 267 | DB38808A6EA5A3023102DA8C /* [CP] Embed Pods Frameworks */ = { 268 | isa = PBXShellScriptBuildPhase; 269 | buildActionMask = 2147483647; 270 | files = ( 271 | ); 272 | inputFileListPaths = ( 273 | "${PODS_ROOT}/Target Support Files/Pods-Sample/Pods-Sample-frameworks-${CONFIGURATION}-input-files.xcfilelist", 274 | ); 275 | name = "[CP] Embed Pods Frameworks"; 276 | outputFileListPaths = ( 277 | "${PODS_ROOT}/Target Support Files/Pods-Sample/Pods-Sample-frameworks-${CONFIGURATION}-output-files.xcfilelist", 278 | ); 279 | runOnlyForDeploymentPostprocessing = 0; 280 | shellPath = /bin/sh; 281 | shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Sample/Pods-Sample-frameworks.sh\"\n"; 282 | showEnvVarsInLog = 0; 283 | }; 284 | /* End PBXShellScriptBuildPhase section */ 285 | 286 | /* Begin PBXSourcesBuildPhase section */ 287 | B09B7E1B1AFF03DF0074ACA7 /* Sources */ = { 288 | isa = PBXSourcesBuildPhase; 289 | buildActionMask = 2147483647; 290 | files = ( 291 | B09B7E271AFF03DF0074ACA7 /* ViewController.swift in Sources */, 292 | B09B7E251AFF03DF0074ACA7 /* AppDelegate.swift in Sources */, 293 | B08585A824E3743500AF211D /* SwiftUIView.swift in Sources */, 294 | ); 295 | runOnlyForDeploymentPostprocessing = 0; 296 | }; 297 | B09B7E301AFF03DF0074ACA7 /* Sources */ = { 298 | isa = PBXSourcesBuildPhase; 299 | buildActionMask = 2147483647; 300 | files = ( 301 | B09B7E3B1AFF03DF0074ACA7 /* SampleTests.swift in Sources */, 302 | ); 303 | runOnlyForDeploymentPostprocessing = 0; 304 | }; 305 | /* End PBXSourcesBuildPhase section */ 306 | 307 | /* Begin PBXTargetDependency section */ 308 | B09B7E361AFF03DF0074ACA7 /* PBXTargetDependency */ = { 309 | isa = PBXTargetDependency; 310 | target = B09B7E1E1AFF03DF0074ACA7 /* Sample */; 311 | targetProxy = B09B7E351AFF03DF0074ACA7 /* PBXContainerItemProxy */; 312 | }; 313 | /* End PBXTargetDependency section */ 314 | 315 | /* Begin PBXVariantGroup section */ 316 | B09B7E281AFF03DF0074ACA7 /* Main.storyboard */ = { 317 | isa = PBXVariantGroup; 318 | children = ( 319 | B09B7E291AFF03DF0074ACA7 /* Base */, 320 | ); 321 | name = Main.storyboard; 322 | sourceTree = ""; 323 | }; 324 | B09B7E2D1AFF03DF0074ACA7 /* LaunchScreen.xib */ = { 325 | isa = PBXVariantGroup; 326 | children = ( 327 | B09B7E2E1AFF03DF0074ACA7 /* Base */, 328 | ); 329 | name = LaunchScreen.xib; 330 | sourceTree = ""; 331 | }; 332 | /* End PBXVariantGroup section */ 333 | 334 | /* Begin XCBuildConfiguration section */ 335 | B09B7E3C1AFF03DF0074ACA7 /* Debug */ = { 336 | isa = XCBuildConfiguration; 337 | buildSettings = { 338 | ALWAYS_SEARCH_USER_PATHS = NO; 339 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 340 | CLANG_CXX_LIBRARY = "libc++"; 341 | CLANG_ENABLE_MODULES = YES; 342 | CLANG_ENABLE_OBJC_ARC = YES; 343 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 344 | CLANG_WARN_BOOL_CONVERSION = YES; 345 | CLANG_WARN_COMMA = YES; 346 | CLANG_WARN_CONSTANT_CONVERSION = YES; 347 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 348 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 349 | CLANG_WARN_EMPTY_BODY = YES; 350 | CLANG_WARN_ENUM_CONVERSION = YES; 351 | CLANG_WARN_INFINITE_RECURSION = YES; 352 | CLANG_WARN_INT_CONVERSION = YES; 353 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 354 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 355 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 356 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 357 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 358 | CLANG_WARN_STRICT_PROTOTYPES = YES; 359 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 360 | CLANG_WARN_UNREACHABLE_CODE = YES; 361 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 362 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 363 | COPY_PHASE_STRIP = NO; 364 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 365 | ENABLE_STRICT_OBJC_MSGSEND = YES; 366 | ENABLE_TESTABILITY = YES; 367 | GCC_C_LANGUAGE_STANDARD = gnu99; 368 | GCC_DYNAMIC_NO_PIC = NO; 369 | GCC_NO_COMMON_BLOCKS = YES; 370 | GCC_OPTIMIZATION_LEVEL = 0; 371 | GCC_PREPROCESSOR_DEFINITIONS = ( 372 | "DEBUG=1", 373 | "$(inherited)", 374 | ); 375 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 376 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 377 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 378 | GCC_WARN_UNDECLARED_SELECTOR = YES; 379 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 380 | GCC_WARN_UNUSED_FUNCTION = YES; 381 | GCC_WARN_UNUSED_VARIABLE = YES; 382 | IPHONEOS_DEPLOYMENT_TARGET = 11.0; 383 | MTL_ENABLE_DEBUG_INFO = YES; 384 | ONLY_ACTIVE_ARCH = YES; 385 | SDKROOT = iphoneos; 386 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 387 | SWIFT_SWIFT3_OBJC_INFERENCE = Off; 388 | SWIFT_VERSION = 4.0; 389 | }; 390 | name = Debug; 391 | }; 392 | B09B7E3D1AFF03DF0074ACA7 /* Release */ = { 393 | isa = XCBuildConfiguration; 394 | buildSettings = { 395 | ALWAYS_SEARCH_USER_PATHS = NO; 396 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 397 | CLANG_CXX_LIBRARY = "libc++"; 398 | CLANG_ENABLE_MODULES = YES; 399 | CLANG_ENABLE_OBJC_ARC = YES; 400 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 401 | CLANG_WARN_BOOL_CONVERSION = YES; 402 | CLANG_WARN_COMMA = YES; 403 | CLANG_WARN_CONSTANT_CONVERSION = YES; 404 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 405 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 406 | CLANG_WARN_EMPTY_BODY = YES; 407 | CLANG_WARN_ENUM_CONVERSION = YES; 408 | CLANG_WARN_INFINITE_RECURSION = YES; 409 | CLANG_WARN_INT_CONVERSION = YES; 410 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 411 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 412 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 413 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 414 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 415 | CLANG_WARN_STRICT_PROTOTYPES = YES; 416 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 417 | CLANG_WARN_UNREACHABLE_CODE = YES; 418 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 419 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 420 | COPY_PHASE_STRIP = NO; 421 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 422 | ENABLE_NS_ASSERTIONS = NO; 423 | ENABLE_STRICT_OBJC_MSGSEND = YES; 424 | GCC_C_LANGUAGE_STANDARD = gnu99; 425 | GCC_NO_COMMON_BLOCKS = YES; 426 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 427 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 428 | GCC_WARN_UNDECLARED_SELECTOR = YES; 429 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 430 | GCC_WARN_UNUSED_FUNCTION = YES; 431 | GCC_WARN_UNUSED_VARIABLE = YES; 432 | IPHONEOS_DEPLOYMENT_TARGET = 11.0; 433 | MTL_ENABLE_DEBUG_INFO = NO; 434 | SDKROOT = iphoneos; 435 | SWIFT_COMPILATION_MODE = wholemodule; 436 | SWIFT_OPTIMIZATION_LEVEL = "-O"; 437 | SWIFT_SWIFT3_OBJC_INFERENCE = Off; 438 | SWIFT_VERSION = 4.0; 439 | VALIDATE_PRODUCT = YES; 440 | }; 441 | name = Release; 442 | }; 443 | B09B7E3F1AFF03DF0074ACA7 /* Debug */ = { 444 | isa = XCBuildConfiguration; 445 | baseConfigurationReference = 0D2D5A7ABB1C2F1DF9E9CC9F /* Pods-Sample.debug.xcconfig */; 446 | buildSettings = { 447 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; 448 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 449 | CODE_SIGN_IDENTITY = "iPhone Developer"; 450 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 451 | CODE_SIGN_STYLE = Automatic; 452 | DEVELOPMENT_TEAM = T33NHY384Q; 453 | INFOPLIST_FILE = Sample/Info.plist; 454 | LD_RUNPATH_SEARCH_PATHS = ( 455 | "$(inherited)", 456 | "@executable_path/Frameworks", 457 | ); 458 | PRODUCT_BUNDLE_IDENTIFIER = "test.$(PRODUCT_NAME:rfc1034identifier)"; 459 | PRODUCT_NAME = "$(TARGET_NAME)"; 460 | PROVISIONING_PROFILE_SPECIFIER = ""; 461 | SWIFT_VERSION = 5.0; 462 | }; 463 | name = Debug; 464 | }; 465 | B09B7E401AFF03DF0074ACA7 /* Release */ = { 466 | isa = XCBuildConfiguration; 467 | baseConfigurationReference = 76D11F25FAEB63FAB9EC89F6 /* Pods-Sample.release.xcconfig */; 468 | buildSettings = { 469 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; 470 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 471 | CODE_SIGN_IDENTITY = "iPhone Developer"; 472 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 473 | CODE_SIGN_STYLE = Automatic; 474 | DEVELOPMENT_TEAM = T33NHY384Q; 475 | INFOPLIST_FILE = Sample/Info.plist; 476 | LD_RUNPATH_SEARCH_PATHS = ( 477 | "$(inherited)", 478 | "@executable_path/Frameworks", 479 | ); 480 | PRODUCT_BUNDLE_IDENTIFIER = "test.$(PRODUCT_NAME:rfc1034identifier)"; 481 | PRODUCT_NAME = "$(TARGET_NAME)"; 482 | PROVISIONING_PROFILE_SPECIFIER = ""; 483 | SWIFT_VERSION = 5.0; 484 | }; 485 | name = Release; 486 | }; 487 | B09B7E421AFF03DF0074ACA7 /* Debug */ = { 488 | isa = XCBuildConfiguration; 489 | buildSettings = { 490 | BUNDLE_LOADER = "$(TEST_HOST)"; 491 | DEVELOPMENT_TEAM = T33NHY384Q; 492 | FRAMEWORK_SEARCH_PATHS = ( 493 | "$(SDKROOT)/Developer/Library/Frameworks", 494 | "$(inherited)", 495 | ); 496 | GCC_PREPROCESSOR_DEFINITIONS = ( 497 | "DEBUG=1", 498 | "$(inherited)", 499 | ); 500 | INFOPLIST_FILE = SampleTests/Info.plist; 501 | LD_RUNPATH_SEARCH_PATHS = ( 502 | "$(inherited)", 503 | "@executable_path/Frameworks", 504 | "@loader_path/Frameworks", 505 | ); 506 | PRODUCT_BUNDLE_IDENTIFIER = "ichise.$(PRODUCT_NAME:rfc1034identifier)"; 507 | PRODUCT_NAME = "$(TARGET_NAME)"; 508 | SWIFT_VERSION = 5.0; 509 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Sample.app/Sample"; 510 | }; 511 | name = Debug; 512 | }; 513 | B09B7E431AFF03DF0074ACA7 /* Release */ = { 514 | isa = XCBuildConfiguration; 515 | buildSettings = { 516 | BUNDLE_LOADER = "$(TEST_HOST)"; 517 | DEVELOPMENT_TEAM = T33NHY384Q; 518 | FRAMEWORK_SEARCH_PATHS = ( 519 | "$(SDKROOT)/Developer/Library/Frameworks", 520 | "$(inherited)", 521 | ); 522 | INFOPLIST_FILE = SampleTests/Info.plist; 523 | LD_RUNPATH_SEARCH_PATHS = ( 524 | "$(inherited)", 525 | "@executable_path/Frameworks", 526 | "@loader_path/Frameworks", 527 | ); 528 | PRODUCT_BUNDLE_IDENTIFIER = "ichise.$(PRODUCT_NAME:rfc1034identifier)"; 529 | PRODUCT_NAME = "$(TARGET_NAME)"; 530 | SWIFT_VERSION = 5.0; 531 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Sample.app/Sample"; 532 | }; 533 | name = Release; 534 | }; 535 | /* End XCBuildConfiguration section */ 536 | 537 | /* Begin XCConfigurationList section */ 538 | B09B7E1A1AFF03DE0074ACA7 /* Build configuration list for PBXProject "Sample" */ = { 539 | isa = XCConfigurationList; 540 | buildConfigurations = ( 541 | B09B7E3C1AFF03DF0074ACA7 /* Debug */, 542 | B09B7E3D1AFF03DF0074ACA7 /* Release */, 543 | ); 544 | defaultConfigurationIsVisible = 0; 545 | defaultConfigurationName = Release; 546 | }; 547 | B09B7E3E1AFF03DF0074ACA7 /* Build configuration list for PBXNativeTarget "Sample" */ = { 548 | isa = XCConfigurationList; 549 | buildConfigurations = ( 550 | B09B7E3F1AFF03DF0074ACA7 /* Debug */, 551 | B09B7E401AFF03DF0074ACA7 /* Release */, 552 | ); 553 | defaultConfigurationIsVisible = 0; 554 | defaultConfigurationName = Release; 555 | }; 556 | B09B7E411AFF03DF0074ACA7 /* Build configuration list for PBXNativeTarget "SampleTests" */ = { 557 | isa = XCConfigurationList; 558 | buildConfigurations = ( 559 | B09B7E421AFF03DF0074ACA7 /* Debug */, 560 | B09B7E431AFF03DF0074ACA7 /* Release */, 561 | ); 562 | defaultConfigurationIsVisible = 0; 563 | defaultConfigurationName = Release; 564 | }; 565 | /* End XCConfigurationList section */ 566 | }; 567 | rootObject = B09B7E171AFF03DE0074ACA7 /* Project object */; 568 | } 569 | -------------------------------------------------------------------------------- /Sample/Sample.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Sample/Sample.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Sample/Sample/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // Sample 4 | // 5 | // Created by tichise on 2015年5月10日 15/05/10. 6 | // Copyright (c) 2015年 tichise. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | @UIApplicationMain 12 | class AppDelegate: UIResponder, UIApplicationDelegate { 13 | 14 | var window: UIWindow? 15 | 16 | 17 | fileprivate func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [AnyHashable: Any]?) -> Bool { 18 | // Override point for customization after application launch. 19 | return true 20 | } 21 | 22 | func applicationWillResignActive(_ application: UIApplication) { 23 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 24 | // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. 25 | } 26 | 27 | func applicationDidEnterBackground(_ application: UIApplication) { 28 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 29 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 30 | } 31 | 32 | func applicationWillEnterForeground(_ application: UIApplication) { 33 | // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. 34 | } 35 | 36 | func applicationDidBecomeActive(_ application: UIApplication) { 37 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 38 | } 39 | 40 | func applicationWillTerminate(_ application: UIApplication) { 41 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 42 | } 43 | 44 | 45 | } 46 | 47 | -------------------------------------------------------------------------------- /Sample/Sample/Base.lproj/LaunchScreen.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /Sample/Sample/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /Sample/Sample/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "20x20", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "20x20", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "29x29", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "29x29", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "40x40", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "40x40", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "iphone", 35 | "size" : "60x60", 36 | "scale" : "2x" 37 | }, 38 | { 39 | "idiom" : "iphone", 40 | "size" : "60x60", 41 | "scale" : "3x" 42 | } 43 | ], 44 | "info" : { 45 | "version" : 1, 46 | "author" : "xcode" 47 | } 48 | } -------------------------------------------------------------------------------- /Sample/Sample/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.1 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 2 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UIStatusBarHidden 34 | 35 | UISupportedInterfaceOrientations 36 | 37 | UIInterfaceOrientationPortrait 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /Sample/Sample/SwiftUIView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SwiftUIView.swift 3 | // Sample 4 | // 5 | // Created by tichise on 2020年8月12日 20/08/12. 6 | // Copyright © 2020 tichise. All rights reserved. 7 | // 8 | 9 | import SwiftUI 10 | import MaterialDesignColor 11 | 12 | @available(iOS 13.0.0, *) 13 | struct SwiftUIView: View { 14 | var body: some View { 15 | Text("hellow world").background(MaterialDesignColor.red400.suColor) 16 | } 17 | } 18 | 19 | @available(iOS 13.0.0, *) 20 | struct SwiftUIView_Previews: PreviewProvider { 21 | static var previews: some View { 22 | SwiftUIView() 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Sample/Sample/ViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.swift 3 | // Sample 4 | // 5 | // 6 | 7 | import UIKit 8 | import MaterialDesignColor 9 | 10 | class ViewController: UITableViewController { 11 | 12 | @IBOutlet var sampleImageView: UIImageView! 13 | @IBOutlet var sampleLabel: UILabel! 14 | 15 | var colors = [MaterialDesignColor.orange50, 16 | MaterialDesignColor.orange100, 17 | MaterialDesignColor.orange200, 18 | MaterialDesignColor.orange300, 19 | MaterialDesignColor.orange400, 20 | MaterialDesignColor.orange500, 21 | MaterialDesignColor.orange600, 22 | MaterialDesignColor.orange700, 23 | MaterialDesignColor.orange800, 24 | MaterialDesignColor.orange900] 25 | 26 | override func viewDidLoad() { 27 | super.viewDidLoad() 28 | 29 | self.view.backgroundColor = .black 30 | } 31 | 32 | override func didReceiveMemoryWarning() { 33 | super.didReceiveMemoryWarning() 34 | } 35 | 36 | override func numberOfSections(in tableView: UITableView) -> Int { 37 | return 1 38 | } 39 | 40 | override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { 41 | return colors.count 42 | } 43 | 44 | override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { 45 | let cell = tableView.dequeueReusableCell(withIdentifier: "SampleCell", for: indexPath) 46 | 47 | cell.backgroundColor = colors[indexPath.row] 48 | 49 | return cell 50 | } 51 | } 52 | 53 | -------------------------------------------------------------------------------- /Sample/SampleTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /Sample/SampleTests/SampleTests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SampleTests.swift 3 | // SampleTests 4 | // 5 | // Created by tichise on 2015年5月10日 15/05/10. 6 | // Copyright (c) 2015年 tichise. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | import XCTest 11 | 12 | class SampleTests: XCTestCase { 13 | 14 | override func setUp() { 15 | super.setUp() 16 | // Put setup code here. This method is called before the invocation of each test method in the class. 17 | } 18 | 19 | override func tearDown() { 20 | // Put teardown code here. This method is called after the invocation of each test method in the class. 21 | super.tearDown() 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Sources/MaterialDesignColor.swift: -------------------------------------------------------------------------------- 1 | // 2 | // MaterialDesignColor.swift 3 | // 4 | 5 | import UIKit 6 | 7 | public struct MaterialDesignColor { 8 | 9 | public static let red50 = colorFromHex("FFEBEE") 10 | public static let red100 = colorFromHex("FFCDD2") 11 | public static let red200 = colorFromHex("EF9A9A") 12 | public static let red300 = colorFromHex("E57373") 13 | public static let red400 = colorFromHex("EF5350") 14 | public static let red500 = colorFromHex("F44336") 15 | public static let red600 = colorFromHex("E53935") 16 | public static let red700 = colorFromHex("D32F2F") 17 | public static let red800 = colorFromHex("C62828") 18 | public static let red900 = colorFromHex("B71C1C") 19 | public static let redA100 = colorFromHex("FF8A80") 20 | public static let redA200 = colorFromHex("FF5252") 21 | public static let redA400 = colorFromHex("FF1744") 22 | public static let redA700 = colorFromHex("D50000") 23 | public static let pink50 = colorFromHex("FCE4EC") 24 | public static let pink100 = colorFromHex("F8BBD0") 25 | public static let pink200 = colorFromHex("F48FB1") 26 | public static let pink300 = colorFromHex("F06292") 27 | public static let pink400 = colorFromHex("EC407A") 28 | public static let pink500 = colorFromHex("E91E63") 29 | public static let pink600 = colorFromHex("D81B60") 30 | public static let pink700 = colorFromHex("C2185B") 31 | public static let pink800 = colorFromHex("AD1457") 32 | public static let pink900 = colorFromHex("880E4F") 33 | public static let pinkA100 = colorFromHex("FF80AB") 34 | public static let pinkA200 = colorFromHex("FF4081") 35 | public static let pinkA400 = colorFromHex("F50057") 36 | public static let pinkA700 = colorFromHex("C51162") 37 | public static let purple50 = colorFromHex("F3E5F5") 38 | public static let purple100 = colorFromHex("E1BEE7") 39 | public static let purple200 = colorFromHex("CE93D8") 40 | public static let purple300 = colorFromHex("BA68C8") 41 | public static let purple400 = colorFromHex("AB47BC") 42 | public static let purple500 = colorFromHex("9C27B0") 43 | public static let purple600 = colorFromHex("8E24AA") 44 | public static let purple700 = colorFromHex("7B1FA2") 45 | public static let purple800 = colorFromHex("6A1B9A") 46 | public static let purple900 = colorFromHex("4A148C") 47 | public static let purpleA100 = colorFromHex("EA80FC") 48 | public static let purpleA200 = colorFromHex("E040FB") 49 | public static let purpleA400 = colorFromHex("D500F9") 50 | public static let purpleA700 = colorFromHex("AA00FF") 51 | public static let deepPurple = colorFromHex("673AB7") 52 | public static let deepPurple50 = colorFromHex("EDE7F6") 53 | public static let deepPurple100 = colorFromHex("D1C4E9") 54 | public static let deepPurple200 = colorFromHex("B39DDB") 55 | public static let deepPurple300 = colorFromHex("9575CD") 56 | public static let deepPurple400 = colorFromHex("7E57C2") 57 | public static let deepPurple500 = colorFromHex("673AB7") 58 | public static let deepPurple600 = colorFromHex("5E35B1") 59 | public static let deepPurple700 = colorFromHex("512DA8") 60 | public static let deepPurple800 = colorFromHex("4527A0") 61 | public static let deepPurple900 = colorFromHex("311B92") 62 | public static let deepPurpleA100 = colorFromHex("B388FF") 63 | public static let deepPurpleA200 = colorFromHex("7C4DFF") 64 | public static let deepPurpleA400 = colorFromHex("651FFF") 65 | public static let deepPurpleA700 = colorFromHex("6200EA") 66 | public static let indigo50 = colorFromHex("E8EAF6") 67 | public static let indigo100 = colorFromHex("C5CAE9") 68 | public static let indigo200 = colorFromHex("9FA8DA") 69 | public static let indigo300 = colorFromHex("7986CB") 70 | public static let indigo400 = colorFromHex("5C6BC0") 71 | public static let indigo500 = colorFromHex("3F51B5") 72 | public static let indigo600 = colorFromHex("3949AB") 73 | public static let indigo700 = colorFromHex("303F9F") 74 | public static let indigo800 = colorFromHex("283593") 75 | public static let indigo900 = colorFromHex("1A237E") 76 | public static let indigoA100 = colorFromHex("8C9EFF") 77 | public static let indigoA200 = colorFromHex("536DFE") 78 | public static let indigoA400 = colorFromHex("3D5AFE") 79 | public static let indigoA700 = colorFromHex("304FFE") 80 | public static let blue50 = colorFromHex("E3F2FD") 81 | public static let blue100 = colorFromHex("BBDEFB") 82 | public static let blue200 = colorFromHex("90CAF9") 83 | public static let blue300 = colorFromHex("64B5F6") 84 | public static let blue400 = colorFromHex("42A5F5") 85 | public static let blue500 = colorFromHex("2196F3") 86 | public static let blue600 = colorFromHex("1E88E5") 87 | public static let blue700 = colorFromHex("1976D2") 88 | public static let blue800 = colorFromHex("1565C0") 89 | public static let blue900 = colorFromHex("0D47A1") 90 | public static let blueA100 = colorFromHex("82B1FF") 91 | public static let blueA200 = colorFromHex("448AFF") 92 | public static let blueA400 = colorFromHex("2979FF") 93 | public static let blueA700 = colorFromHex("2962FF") 94 | public static let lightBlue50 = colorFromHex("E1F5FE") 95 | public static let lightBlue100 = colorFromHex("B3E5FC") 96 | public static let lightBlue200 = colorFromHex("81D4FA") 97 | public static let lightBlue300 = colorFromHex("4FC3F7") 98 | public static let lightBlue400 = colorFromHex("29B6F6") 99 | public static let lightBlue500 = colorFromHex("03A9F4") 100 | public static let lightBlue600 = colorFromHex("039BE5") 101 | public static let lightBlue700 = colorFromHex("0288D1") 102 | public static let lightBlue800 = colorFromHex("0277BD") 103 | public static let lightBlue900 = colorFromHex("01579B") 104 | public static let lightBlueA100 = colorFromHex("80D8FF") 105 | public static let lightBlueA200 = colorFromHex("40C4FF") 106 | public static let lightBlueA400 = colorFromHex("00B0FF") 107 | public static let lightBlueA700 = colorFromHex("0091EA") 108 | public static let cyan50 = colorFromHex("E0F7FA") 109 | public static let cyan100 = colorFromHex("B2EBF2") 110 | public static let cyan200 = colorFromHex("80DEEA") 111 | public static let cyan300 = colorFromHex("4DD0E1") 112 | public static let cyan400 = colorFromHex("26C6DA") 113 | public static let cyan500 = colorFromHex("00BCD4") 114 | public static let cyan600 = colorFromHex("00ACC1") 115 | public static let cyan700 = colorFromHex("0097A7") 116 | public static let cyan800 = colorFromHex("00838F") 117 | public static let cyan900 = colorFromHex("6064") 118 | public static let cyanA100 = colorFromHex("84FFFF") 119 | public static let cyanA200 = colorFromHex("18FFFF") 120 | public static let cyanA400 = colorFromHex("00E5FF") 121 | public static let cyanA700 = colorFromHex("00B8D4") 122 | public static let teal50 = colorFromHex("E0F2F1") 123 | public static let teal100 = colorFromHex("B2DFDB") 124 | public static let teal200 = colorFromHex("80CBC4") 125 | public static let teal300 = colorFromHex("4DB6AC") 126 | public static let teal400 = colorFromHex("26A69A") 127 | public static let teal500 = colorFromHex("9688") 128 | public static let teal600 = colorFromHex("00897B") 129 | public static let teal700 = colorFromHex("00796B") 130 | public static let teal800 = colorFromHex("00695C") 131 | public static let teal900 = colorFromHex("004D40") 132 | public static let tealA100 = colorFromHex("A7FFEB") 133 | public static let tealA200 = colorFromHex("64FFDA") 134 | public static let tealA400 = colorFromHex("1DE9B6") 135 | public static let tealA700 = colorFromHex("00BFA5") 136 | public static let green50 = colorFromHex("E8F5E9") 137 | public static let green100 = colorFromHex("C8E6C9") 138 | public static let green200 = colorFromHex("A5D6A7") 139 | public static let green300 = colorFromHex("81C784") 140 | public static let green400 = colorFromHex("66BB6A") 141 | public static let green500 = colorFromHex("4CAF50") 142 | public static let green600 = colorFromHex("43A047") 143 | public static let green700 = colorFromHex("388E3C") 144 | public static let green800 = colorFromHex("2E7D32") 145 | public static let green900 = colorFromHex("1B5E20") 146 | public static let greenA100 = colorFromHex("B9F6CA") 147 | public static let greenA200 = colorFromHex("69F0AE") 148 | public static let greenA400 = colorFromHex("00E676") 149 | public static let greenA700 = colorFromHex("00C853") 150 | public static let lightGreen50 = colorFromHex("F1F8E9") 151 | public static let lightGreen100 = colorFromHex("DCEDC8") 152 | public static let lightGreen200 = colorFromHex("C5E1A5") 153 | public static let lightGreen300 = colorFromHex("AED581") 154 | public static let lightGreen400 = colorFromHex("9CCC65") 155 | public static let lightGreen500 = colorFromHex("8BC34A") 156 | public static let lightGreen600 = colorFromHex("7CB342") 157 | public static let lightGreen700 = colorFromHex("689F38") 158 | public static let lightGreen800 = colorFromHex("558B2F") 159 | public static let lightGreen900 = colorFromHex("33691E") 160 | public static let lightGreenA100 = colorFromHex("CCFF90") 161 | public static let lightGreenA200 = colorFromHex("B2FF59") 162 | public static let lightGreenA400 = colorFromHex("76FF03") 163 | public static let lightGreenA700 = colorFromHex("64DD17") 164 | public static let lime50 = colorFromHex("F9FBE7") 165 | public static let lime100 = colorFromHex("F0F4C3") 166 | public static let lime200 = colorFromHex("E6EE9C") 167 | public static let lime300 = colorFromHex("DCE775") 168 | public static let lime400 = colorFromHex("D4E157") 169 | public static let lime500 = colorFromHex("CDDC39") 170 | public static let lime600 = colorFromHex("C0CA33") 171 | public static let lime700 = colorFromHex("AFB42B") 172 | public static let lime800 = colorFromHex("9E9D24") 173 | public static let lime900 = colorFromHex("827717") 174 | public static let limeA100 = colorFromHex("F4FF81") 175 | public static let limeA200 = colorFromHex("EEFF41") 176 | public static let limeA400 = colorFromHex("C6FF00") 177 | public static let limeA700 = colorFromHex("AEEA00") 178 | public static let yellow50 = colorFromHex("FFFDE7") 179 | public static let yellow100 = colorFromHex("FFF9C4") 180 | public static let yellow200 = colorFromHex("FFF59D") 181 | public static let yellow300 = colorFromHex("FFF176") 182 | public static let yellow400 = colorFromHex("FFEE58") 183 | public static let yellow500 = colorFromHex("FFEB3B") 184 | public static let yellow600 = colorFromHex("FDD835") 185 | public static let yellow700 = colorFromHex("FBC02D") 186 | public static let yellow800 = colorFromHex("F9A825") 187 | public static let yellow900 = colorFromHex("F57F17") 188 | public static let yellowA100 = colorFromHex("FFFF8D") 189 | public static let yellowA200 = colorFromHex("FFFF00") 190 | public static let yellowA400 = colorFromHex("FFEA00") 191 | public static let yellowA700 = colorFromHex("FFD600") 192 | public static let ameber50 = colorFromHex("FFF8E1") 193 | public static let ameber100 = colorFromHex("FFECB3") 194 | public static let ameber200 = colorFromHex("FFE082") 195 | public static let ameber300 = colorFromHex("FFD54F") 196 | public static let ameber400 = colorFromHex("FFCA28") 197 | public static let ameber500 = colorFromHex("FFC107") 198 | public static let ameber600 = colorFromHex("FFB300") 199 | public static let ameber700 = colorFromHex("FFA000") 200 | public static let ameber800 = colorFromHex("FF8F00") 201 | public static let ameber900 = colorFromHex("FF6F00") 202 | public static let ameberA100 = colorFromHex("FFE57F") 203 | public static let ameberA200 = colorFromHex("FFD740") 204 | public static let ameberA400 = colorFromHex("FFC400") 205 | public static let ameberA700 = colorFromHex("FFAB00") 206 | public static let orange50 = colorFromHex("FFF3E0") 207 | public static let orange100 = colorFromHex("FFE0B2") 208 | public static let orange200 = colorFromHex("FFCC80") 209 | public static let orange300 = colorFromHex("FFB74D") 210 | public static let orange400 = colorFromHex("FFA726") 211 | public static let orange500 = colorFromHex("FF9800") 212 | public static let orange600 = colorFromHex("FB8C00") 213 | public static let orange700 = colorFromHex("F57C00") 214 | public static let orange800 = colorFromHex("EF6C00") 215 | public static let orange900 = colorFromHex("E65100") 216 | public static let orangeA100 = colorFromHex("FFD180") 217 | public static let orangeA200 = colorFromHex("FFAB40") 218 | public static let orangeA400 = colorFromHex("FF9100") 219 | public static let orangeA700 = colorFromHex("FF6D00") 220 | public static let deepOrange50 = colorFromHex("FBE9E7") 221 | public static let deepOrange100 = colorFromHex("FFCCBC") 222 | public static let deepOrange200 = colorFromHex("FFAB91") 223 | public static let deepOrange300 = colorFromHex("FF8A65") 224 | public static let deepOrange400 = colorFromHex("FF7043") 225 | public static let deepOrange500 = colorFromHex("FF5722") 226 | public static let deepOrange600 = colorFromHex("F4511E") 227 | public static let deepOrange700 = colorFromHex("E64A19") 228 | public static let deepOrange800 = colorFromHex("D84315") 229 | public static let deepOrange900 = colorFromHex("BF360C") 230 | public static let deepOrangeA100 = colorFromHex("FF9E80") 231 | public static let deepOrangeA200 = colorFromHex("FF6E40") 232 | public static let deepOrangeA400 = colorFromHex("FF3D00") 233 | public static let deepOrangeA700 = colorFromHex("DD2C00") 234 | public static let brown50 = colorFromHex("EFEBE9") 235 | public static let brown100 = colorFromHex("D7CCC8") 236 | public static let brown200 = colorFromHex("BCAAA4") 237 | public static let brown300 = colorFromHex("A1887F") 238 | public static let brown400 = colorFromHex("8D6E63") 239 | public static let brown500 = colorFromHex("795548") 240 | public static let brown600 = colorFromHex("6D4C41") 241 | public static let brown700 = colorFromHex("5D4037") 242 | public static let brown800 = colorFromHex("4E342E") 243 | public static let brown900 = colorFromHex("3E2723") 244 | public static let grey50 = colorFromHex("FAFAFA") 245 | public static let grey100 = colorFromHex("F5F5F5") 246 | public static let grey200 = colorFromHex("EEEEEE") 247 | public static let grey300 = colorFromHex("E0E0E0") 248 | public static let grey400 = colorFromHex("BDBDBD") 249 | public static let grey500 = colorFromHex("9E9E9E") 250 | public static let grey600 = colorFromHex("757575") 251 | public static let grey700 = colorFromHex("616161") 252 | public static let grey800 = colorFromHex("424242") 253 | public static let grey900 = colorFromHex("212121") 254 | public static let blueGrey50 = colorFromHex("ECEFF1") 255 | public static let blueGrey100 = colorFromHex("CFD8DC") 256 | public static let blueGrey200 = colorFromHex("B0BEC5") 257 | public static let blueGrey300 = colorFromHex("90A4AE") 258 | public static let blueGrey400 = colorFromHex("78909C") 259 | public static let blueGrey500 = colorFromHex("607D8B") 260 | public static let blueGrey600 = colorFromHex("546E7A") 261 | public static let blueGrey700 = colorFromHex("455A64") 262 | public static let blueGrey800 = colorFromHex("37474F") 263 | public static let blueGrey900 = colorFromHex("263238") 264 | 265 | static func colorFromHex(_ colorCode: String) -> UIColor { 266 | let scanner = Scanner(string: colorCode) 267 | var color: UInt32 = 0 268 | scanner.scanHexInt32(&color) 269 | 270 | let mask = 0x000000FF 271 | let r = CGFloat(Float(Int(color >> 16) & mask)/255.0) 272 | let g = CGFloat(Float(Int(color >> 8) & mask)/255.0) 273 | let b = CGFloat(Float(Int(color) & mask)/255.0) 274 | 275 | return UIColor(red: r, green: g, blue: b, alpha: 1.0) 276 | } 277 | } 278 | -------------------------------------------------------------------------------- /Sources/UIColor+Color.swift: -------------------------------------------------------------------------------- 1 | // 2 | // UIColor+Color.swift 3 | // MaterialDesignColor 4 | // 5 | // Created by tichise on 2020年8月12日 20/08/12. 6 | // 7 | 8 | import Foundation 9 | import SwiftUI 10 | 11 | @available(iOS 13.0, *) 12 | extension UIColor { 13 | 14 | public var suColor: Color { 15 | Color(self) 16 | } 17 | } 18 | --------------------------------------------------------------------------------