├── asset
└── preview.jpg
├── swiftui-design-system-demo
├── Assets.xcassets
│ ├── Contents.json
│ └── AppIcon.appiconset
│ │ └── Contents.json
├── DesignSystem
│ ├── Assets
│ │ ├── Icon.xcassets
│ │ │ ├── Contents.json
│ │ │ ├── upload.imageset
│ │ │ │ ├── dark.png
│ │ │ │ ├── dark-1.png
│ │ │ │ ├── light.png
│ │ │ │ ├── dark@2x-1.png
│ │ │ │ ├── dark@2x.png
│ │ │ │ ├── dark@3x-1.png
│ │ │ │ ├── dark@3x.png
│ │ │ │ ├── light@2x.png
│ │ │ │ ├── light@3x.png
│ │ │ │ └── Contents.json
│ │ │ └── upload-highlight.imageset
│ │ │ │ ├── highlight.png
│ │ │ │ ├── highlight@2x.png
│ │ │ │ ├── highlight@3x.png
│ │ │ │ └── Contents.json
│ │ ├── CircleIcon.xcassets
│ │ │ ├── Contents.json
│ │ │ ├── circle-plus.imageset
│ │ │ │ ├── dark.png
│ │ │ │ ├── dark-1.png
│ │ │ │ ├── dark@2x.png
│ │ │ │ ├── dark@3x.png
│ │ │ │ ├── dark@2x-1.png
│ │ │ │ ├── dark@3x-1.png
│ │ │ │ ├── lightThin.png
│ │ │ │ ├── lightThin@2x.png
│ │ │ │ ├── lightThin@3x.png
│ │ │ │ └── Contents.json
│ │ │ └── circle-plus-light.imageset
│ │ │ │ ├── dark-1.png
│ │ │ │ ├── dark@2x-1.png
│ │ │ │ ├── dark@3x-1.png
│ │ │ │ ├── lightThin.png
│ │ │ │ ├── lightThin-1.png
│ │ │ │ ├── lightThin@2x.png
│ │ │ │ ├── lightThin@3x.png
│ │ │ │ ├── lightThin@2x-1.png
│ │ │ │ ├── lightThin@3x-1.png
│ │ │ │ └── Contents.json
│ │ ├── ColorPalette.xcassets
│ │ │ ├── Contents.json
│ │ │ ├── darkPrimary.colorset
│ │ │ │ └── Contents.json
│ │ │ ├── lightPrimary.colorset
│ │ │ │ └── Contents.json
│ │ │ ├── brandPrimary.colorset
│ │ │ │ └── Contents.json
│ │ │ ├── gray.colorset
│ │ │ │ └── Contents.json
│ │ │ ├── themePrimary.colorset
│ │ │ │ └── Contents.json
│ │ │ ├── contrastPrimary.colorset
│ │ │ │ └── Contents.json
│ │ │ ├── themeSecondary.colorset
│ │ │ │ └── Contents.json
│ │ │ └── contrastSecondary.colorset
│ │ │ │ └── Contents.json
│ │ └── asset
│ │ │ ├── icon
│ │ │ ├── dark.png
│ │ │ ├── light.png
│ │ │ ├── dark@2x.png
│ │ │ ├── dark@3x.png
│ │ │ ├── light@2x.png
│ │ │ ├── light@3x.png
│ │ │ ├── highlight.png
│ │ │ ├── highlight@2x.png
│ │ │ └── highlight@3x.png
│ │ │ └── circle-icon
│ │ │ ├── dark.png
│ │ │ ├── dark@2x.png
│ │ │ ├── dark@3x.png
│ │ │ ├── lightThin.png
│ │ │ ├── lightThin@2x.png
│ │ │ └── lightThin@3x.png
│ ├── Typography.swift
│ └── ColorPalatte.swift
├── Preview Content
│ └── Preview Assets.xcassets
│ │ └── Contents.json
├── Helper
│ └── AliasHelper.swift
├── AppDelegate.swift
├── Base.lproj
│ └── LaunchScreen.storyboard
├── Info.plist
├── SceneDelegate.swift
├── ContentView.swift
└── Component
│ └── Button.swift
├── swiftui-design-system-demo.xcodeproj
├── project.xcworkspace
│ ├── contents.xcworkspacedata
│ └── xcshareddata
│ │ └── IDEWorkspaceChecks.plist
└── project.pbxproj
├── readme.md
└── .gitignore
/asset/preview.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vince19972/SwiftUI-Design-System-Demo/HEAD/asset/preview.jpg
--------------------------------------------------------------------------------
/swiftui-design-system-demo/Assets.xcassets/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "info" : {
3 | "version" : 1,
4 | "author" : "xcode"
5 | }
6 | }
--------------------------------------------------------------------------------
/swiftui-design-system-demo/DesignSystem/Assets/Icon.xcassets/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "info" : {
3 | "version" : 1,
4 | "author" : "xcode"
5 | }
6 | }
--------------------------------------------------------------------------------
/swiftui-design-system-demo/DesignSystem/Assets/CircleIcon.xcassets/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "info" : {
3 | "version" : 1,
4 | "author" : "xcode"
5 | }
6 | }
--------------------------------------------------------------------------------
/swiftui-design-system-demo/Preview Content/Preview Assets.xcassets/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "info" : {
3 | "version" : 1,
4 | "author" : "xcode"
5 | }
6 | }
--------------------------------------------------------------------------------
/swiftui-design-system-demo/DesignSystem/Assets/ColorPalette.xcassets/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "info" : {
3 | "version" : 1,
4 | "author" : "xcode"
5 | }
6 | }
--------------------------------------------------------------------------------
/swiftui-design-system-demo/DesignSystem/Assets/asset/icon/dark.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vince19972/SwiftUI-Design-System-Demo/HEAD/swiftui-design-system-demo/DesignSystem/Assets/asset/icon/dark.png
--------------------------------------------------------------------------------
/swiftui-design-system-demo/DesignSystem/Assets/asset/icon/light.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vince19972/SwiftUI-Design-System-Demo/HEAD/swiftui-design-system-demo/DesignSystem/Assets/asset/icon/light.png
--------------------------------------------------------------------------------
/swiftui-design-system-demo/DesignSystem/Assets/asset/icon/dark@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vince19972/SwiftUI-Design-System-Demo/HEAD/swiftui-design-system-demo/DesignSystem/Assets/asset/icon/dark@2x.png
--------------------------------------------------------------------------------
/swiftui-design-system-demo/DesignSystem/Assets/asset/icon/dark@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vince19972/SwiftUI-Design-System-Demo/HEAD/swiftui-design-system-demo/DesignSystem/Assets/asset/icon/dark@3x.png
--------------------------------------------------------------------------------
/swiftui-design-system-demo/DesignSystem/Assets/asset/icon/light@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vince19972/SwiftUI-Design-System-Demo/HEAD/swiftui-design-system-demo/DesignSystem/Assets/asset/icon/light@2x.png
--------------------------------------------------------------------------------
/swiftui-design-system-demo/DesignSystem/Assets/asset/icon/light@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vince19972/SwiftUI-Design-System-Demo/HEAD/swiftui-design-system-demo/DesignSystem/Assets/asset/icon/light@3x.png
--------------------------------------------------------------------------------
/swiftui-design-system-demo/DesignSystem/Assets/asset/icon/highlight.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vince19972/SwiftUI-Design-System-Demo/HEAD/swiftui-design-system-demo/DesignSystem/Assets/asset/icon/highlight.png
--------------------------------------------------------------------------------
/swiftui-design-system-demo/DesignSystem/Assets/asset/circle-icon/dark.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vince19972/SwiftUI-Design-System-Demo/HEAD/swiftui-design-system-demo/DesignSystem/Assets/asset/circle-icon/dark.png
--------------------------------------------------------------------------------
/swiftui-design-system-demo/DesignSystem/Assets/asset/icon/highlight@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vince19972/SwiftUI-Design-System-Demo/HEAD/swiftui-design-system-demo/DesignSystem/Assets/asset/icon/highlight@2x.png
--------------------------------------------------------------------------------
/swiftui-design-system-demo/DesignSystem/Assets/asset/icon/highlight@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vince19972/SwiftUI-Design-System-Demo/HEAD/swiftui-design-system-demo/DesignSystem/Assets/asset/icon/highlight@3x.png
--------------------------------------------------------------------------------
/swiftui-design-system-demo/DesignSystem/Assets/asset/circle-icon/dark@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vince19972/SwiftUI-Design-System-Demo/HEAD/swiftui-design-system-demo/DesignSystem/Assets/asset/circle-icon/dark@2x.png
--------------------------------------------------------------------------------
/swiftui-design-system-demo/DesignSystem/Assets/asset/circle-icon/dark@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vince19972/SwiftUI-Design-System-Demo/HEAD/swiftui-design-system-demo/DesignSystem/Assets/asset/circle-icon/dark@3x.png
--------------------------------------------------------------------------------
/swiftui-design-system-demo/DesignSystem/Assets/asset/circle-icon/lightThin.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vince19972/SwiftUI-Design-System-Demo/HEAD/swiftui-design-system-demo/DesignSystem/Assets/asset/circle-icon/lightThin.png
--------------------------------------------------------------------------------
/swiftui-design-system-demo/DesignSystem/Assets/asset/circle-icon/lightThin@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vince19972/SwiftUI-Design-System-Demo/HEAD/swiftui-design-system-demo/DesignSystem/Assets/asset/circle-icon/lightThin@2x.png
--------------------------------------------------------------------------------
/swiftui-design-system-demo/DesignSystem/Assets/asset/circle-icon/lightThin@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vince19972/SwiftUI-Design-System-Demo/HEAD/swiftui-design-system-demo/DesignSystem/Assets/asset/circle-icon/lightThin@3x.png
--------------------------------------------------------------------------------
/swiftui-design-system-demo/DesignSystem/Assets/Icon.xcassets/upload.imageset/dark.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vince19972/SwiftUI-Design-System-Demo/HEAD/swiftui-design-system-demo/DesignSystem/Assets/Icon.xcassets/upload.imageset/dark.png
--------------------------------------------------------------------------------
/swiftui-design-system-demo/DesignSystem/Assets/Icon.xcassets/upload.imageset/dark-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vince19972/SwiftUI-Design-System-Demo/HEAD/swiftui-design-system-demo/DesignSystem/Assets/Icon.xcassets/upload.imageset/dark-1.png
--------------------------------------------------------------------------------
/swiftui-design-system-demo/DesignSystem/Assets/Icon.xcassets/upload.imageset/light.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vince19972/SwiftUI-Design-System-Demo/HEAD/swiftui-design-system-demo/DesignSystem/Assets/Icon.xcassets/upload.imageset/light.png
--------------------------------------------------------------------------------
/swiftui-design-system-demo/DesignSystem/Assets/Icon.xcassets/upload.imageset/dark@2x-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vince19972/SwiftUI-Design-System-Demo/HEAD/swiftui-design-system-demo/DesignSystem/Assets/Icon.xcassets/upload.imageset/dark@2x-1.png
--------------------------------------------------------------------------------
/swiftui-design-system-demo/DesignSystem/Assets/Icon.xcassets/upload.imageset/dark@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vince19972/SwiftUI-Design-System-Demo/HEAD/swiftui-design-system-demo/DesignSystem/Assets/Icon.xcassets/upload.imageset/dark@2x.png
--------------------------------------------------------------------------------
/swiftui-design-system-demo/DesignSystem/Assets/Icon.xcassets/upload.imageset/dark@3x-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vince19972/SwiftUI-Design-System-Demo/HEAD/swiftui-design-system-demo/DesignSystem/Assets/Icon.xcassets/upload.imageset/dark@3x-1.png
--------------------------------------------------------------------------------
/swiftui-design-system-demo/DesignSystem/Assets/Icon.xcassets/upload.imageset/dark@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vince19972/SwiftUI-Design-System-Demo/HEAD/swiftui-design-system-demo/DesignSystem/Assets/Icon.xcassets/upload.imageset/dark@3x.png
--------------------------------------------------------------------------------
/swiftui-design-system-demo/DesignSystem/Assets/Icon.xcassets/upload.imageset/light@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vince19972/SwiftUI-Design-System-Demo/HEAD/swiftui-design-system-demo/DesignSystem/Assets/Icon.xcassets/upload.imageset/light@2x.png
--------------------------------------------------------------------------------
/swiftui-design-system-demo/DesignSystem/Assets/Icon.xcassets/upload.imageset/light@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vince19972/SwiftUI-Design-System-Demo/HEAD/swiftui-design-system-demo/DesignSystem/Assets/Icon.xcassets/upload.imageset/light@3x.png
--------------------------------------------------------------------------------
/swiftui-design-system-demo/DesignSystem/Assets/CircleIcon.xcassets/circle-plus.imageset/dark.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vince19972/SwiftUI-Design-System-Demo/HEAD/swiftui-design-system-demo/DesignSystem/Assets/CircleIcon.xcassets/circle-plus.imageset/dark.png
--------------------------------------------------------------------------------
/swiftui-design-system-demo/DesignSystem/Assets/CircleIcon.xcassets/circle-plus.imageset/dark-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vince19972/SwiftUI-Design-System-Demo/HEAD/swiftui-design-system-demo/DesignSystem/Assets/CircleIcon.xcassets/circle-plus.imageset/dark-1.png
--------------------------------------------------------------------------------
/swiftui-design-system-demo/DesignSystem/Assets/CircleIcon.xcassets/circle-plus.imageset/dark@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vince19972/SwiftUI-Design-System-Demo/HEAD/swiftui-design-system-demo/DesignSystem/Assets/CircleIcon.xcassets/circle-plus.imageset/dark@2x.png
--------------------------------------------------------------------------------
/swiftui-design-system-demo/DesignSystem/Assets/CircleIcon.xcassets/circle-plus.imageset/dark@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vince19972/SwiftUI-Design-System-Demo/HEAD/swiftui-design-system-demo/DesignSystem/Assets/CircleIcon.xcassets/circle-plus.imageset/dark@3x.png
--------------------------------------------------------------------------------
/swiftui-design-system-demo/DesignSystem/Assets/Icon.xcassets/upload-highlight.imageset/highlight.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vince19972/SwiftUI-Design-System-Demo/HEAD/swiftui-design-system-demo/DesignSystem/Assets/Icon.xcassets/upload-highlight.imageset/highlight.png
--------------------------------------------------------------------------------
/swiftui-design-system-demo/DesignSystem/Assets/CircleIcon.xcassets/circle-plus.imageset/dark@2x-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vince19972/SwiftUI-Design-System-Demo/HEAD/swiftui-design-system-demo/DesignSystem/Assets/CircleIcon.xcassets/circle-plus.imageset/dark@2x-1.png
--------------------------------------------------------------------------------
/swiftui-design-system-demo/DesignSystem/Assets/CircleIcon.xcassets/circle-plus.imageset/dark@3x-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vince19972/SwiftUI-Design-System-Demo/HEAD/swiftui-design-system-demo/DesignSystem/Assets/CircleIcon.xcassets/circle-plus.imageset/dark@3x-1.png
--------------------------------------------------------------------------------
/swiftui-design-system-demo/DesignSystem/Assets/CircleIcon.xcassets/circle-plus.imageset/lightThin.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vince19972/SwiftUI-Design-System-Demo/HEAD/swiftui-design-system-demo/DesignSystem/Assets/CircleIcon.xcassets/circle-plus.imageset/lightThin.png
--------------------------------------------------------------------------------
/swiftui-design-system-demo.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/swiftui-design-system-demo/DesignSystem/Assets/CircleIcon.xcassets/circle-plus-light.imageset/dark-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vince19972/SwiftUI-Design-System-Demo/HEAD/swiftui-design-system-demo/DesignSystem/Assets/CircleIcon.xcassets/circle-plus-light.imageset/dark-1.png
--------------------------------------------------------------------------------
/swiftui-design-system-demo/DesignSystem/Assets/CircleIcon.xcassets/circle-plus.imageset/lightThin@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vince19972/SwiftUI-Design-System-Demo/HEAD/swiftui-design-system-demo/DesignSystem/Assets/CircleIcon.xcassets/circle-plus.imageset/lightThin@2x.png
--------------------------------------------------------------------------------
/swiftui-design-system-demo/DesignSystem/Assets/CircleIcon.xcassets/circle-plus.imageset/lightThin@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vince19972/SwiftUI-Design-System-Demo/HEAD/swiftui-design-system-demo/DesignSystem/Assets/CircleIcon.xcassets/circle-plus.imageset/lightThin@3x.png
--------------------------------------------------------------------------------
/swiftui-design-system-demo/DesignSystem/Assets/Icon.xcassets/upload-highlight.imageset/highlight@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vince19972/SwiftUI-Design-System-Demo/HEAD/swiftui-design-system-demo/DesignSystem/Assets/Icon.xcassets/upload-highlight.imageset/highlight@2x.png
--------------------------------------------------------------------------------
/swiftui-design-system-demo/DesignSystem/Assets/Icon.xcassets/upload-highlight.imageset/highlight@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vince19972/SwiftUI-Design-System-Demo/HEAD/swiftui-design-system-demo/DesignSystem/Assets/Icon.xcassets/upload-highlight.imageset/highlight@3x.png
--------------------------------------------------------------------------------
/swiftui-design-system-demo/DesignSystem/Assets/CircleIcon.xcassets/circle-plus-light.imageset/dark@2x-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vince19972/SwiftUI-Design-System-Demo/HEAD/swiftui-design-system-demo/DesignSystem/Assets/CircleIcon.xcassets/circle-plus-light.imageset/dark@2x-1.png
--------------------------------------------------------------------------------
/swiftui-design-system-demo/DesignSystem/Assets/CircleIcon.xcassets/circle-plus-light.imageset/dark@3x-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vince19972/SwiftUI-Design-System-Demo/HEAD/swiftui-design-system-demo/DesignSystem/Assets/CircleIcon.xcassets/circle-plus-light.imageset/dark@3x-1.png
--------------------------------------------------------------------------------
/swiftui-design-system-demo/DesignSystem/Assets/CircleIcon.xcassets/circle-plus-light.imageset/lightThin.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vince19972/SwiftUI-Design-System-Demo/HEAD/swiftui-design-system-demo/DesignSystem/Assets/CircleIcon.xcassets/circle-plus-light.imageset/lightThin.png
--------------------------------------------------------------------------------
/swiftui-design-system-demo/DesignSystem/Assets/CircleIcon.xcassets/circle-plus-light.imageset/lightThin-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vince19972/SwiftUI-Design-System-Demo/HEAD/swiftui-design-system-demo/DesignSystem/Assets/CircleIcon.xcassets/circle-plus-light.imageset/lightThin-1.png
--------------------------------------------------------------------------------
/swiftui-design-system-demo/DesignSystem/Assets/CircleIcon.xcassets/circle-plus-light.imageset/lightThin@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vince19972/SwiftUI-Design-System-Demo/HEAD/swiftui-design-system-demo/DesignSystem/Assets/CircleIcon.xcassets/circle-plus-light.imageset/lightThin@2x.png
--------------------------------------------------------------------------------
/swiftui-design-system-demo/DesignSystem/Assets/CircleIcon.xcassets/circle-plus-light.imageset/lightThin@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vince19972/SwiftUI-Design-System-Demo/HEAD/swiftui-design-system-demo/DesignSystem/Assets/CircleIcon.xcassets/circle-plus-light.imageset/lightThin@3x.png
--------------------------------------------------------------------------------
/swiftui-design-system-demo/DesignSystem/Assets/CircleIcon.xcassets/circle-plus-light.imageset/lightThin@2x-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vince19972/SwiftUI-Design-System-Demo/HEAD/swiftui-design-system-demo/DesignSystem/Assets/CircleIcon.xcassets/circle-plus-light.imageset/lightThin@2x-1.png
--------------------------------------------------------------------------------
/swiftui-design-system-demo/DesignSystem/Assets/CircleIcon.xcassets/circle-plus-light.imageset/lightThin@3x-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vince19972/SwiftUI-Design-System-Demo/HEAD/swiftui-design-system-demo/DesignSystem/Assets/CircleIcon.xcassets/circle-plus-light.imageset/lightThin@3x-1.png
--------------------------------------------------------------------------------
/swiftui-design-system-demo.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/swiftui-design-system-demo/Helper/AliasHelper.swift:
--------------------------------------------------------------------------------
1 | //
2 | // AliasHelper.swift
3 | // swiftui-design-system-demo
4 | //
5 | // Created by 邵名浦 on 2019/9/4.
6 | // Copyright © 2019 vinceshao. All rights reserved.
7 | //
8 |
9 | import SwiftUI
10 |
11 | struct StyleAlias {
12 | typealias BorderStyle = (color:Color, width:CGFloat, cornerRadius:CGFloat)
13 | }
14 |
15 |
--------------------------------------------------------------------------------
/readme.md:
--------------------------------------------------------------------------------
1 | # SwiftUI and Design System Demo
2 |
3 | 
4 |
5 | This is the demo code of how to build design system with `SwiftUI`. The detail tutorial article is posted on following three platforms:
6 |
7 | 1. [vinceshao.com](https://www.vinceshao.com/blog/how-to-build-design-system-with-swift-ui)
8 | 2. [freeCodeCamp](https://www.freecodecamp.org/news/how-to-build-design-system-with-swiftui/)
9 | 3. [DEV](https://dev.to/vince19972/how-to-build-design-system-with-swiftui-58h5)
10 |
11 | Welcome to report any issues or provide feedbacks!
--------------------------------------------------------------------------------
/swiftui-design-system-demo/DesignSystem/Assets/Icon.xcassets/upload-highlight.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "highlight.png",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "filename" : "highlight@2x.png",
11 | "scale" : "2x"
12 | },
13 | {
14 | "idiom" : "universal",
15 | "filename" : "highlight@3x.png",
16 | "scale" : "3x"
17 | }
18 | ],
19 | "info" : {
20 | "version" : 1,
21 | "author" : "xcode"
22 | }
23 | }
--------------------------------------------------------------------------------
/swiftui-design-system-demo/DesignSystem/Assets/ColorPalette.xcassets/darkPrimary.colorset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "info" : {
3 | "version" : 1,
4 | "author" : "xcode"
5 | },
6 | "colors" : [
7 | {
8 | "idiom" : "universal",
9 | "color" : {
10 | "color-space" : "srgb",
11 | "components" : {
12 | "red" : "0.110",
13 | "alpha" : "1.000",
14 | "blue" : "0.118",
15 | "green" : "0.110"
16 | }
17 | }
18 | },
19 | {
20 | "idiom" : "universal",
21 | "appearances" : [
22 | {
23 | "appearance" : "luminosity",
24 | "value" : "dark"
25 | }
26 | ],
27 | "color" : {
28 | "color-space" : "srgb",
29 | "components" : {
30 | "red" : "0.110",
31 | "alpha" : "1.000",
32 | "blue" : "0.118",
33 | "green" : "0.110"
34 | }
35 | }
36 | }
37 | ]
38 | }
--------------------------------------------------------------------------------
/swiftui-design-system-demo/DesignSystem/Assets/ColorPalette.xcassets/lightPrimary.colorset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "info" : {
3 | "version" : 1,
4 | "author" : "xcode"
5 | },
6 | "colors" : [
7 | {
8 | "idiom" : "universal",
9 | "color" : {
10 | "color-space" : "srgb",
11 | "components" : {
12 | "red" : "0.980",
13 | "alpha" : "1.000",
14 | "blue" : "0.980",
15 | "green" : "0.980"
16 | }
17 | }
18 | },
19 | {
20 | "idiom" : "universal",
21 | "appearances" : [
22 | {
23 | "appearance" : "luminosity",
24 | "value" : "dark"
25 | }
26 | ],
27 | "color" : {
28 | "color-space" : "srgb",
29 | "components" : {
30 | "red" : "0.980",
31 | "alpha" : "1.000",
32 | "blue" : "0.980",
33 | "green" : "0.980"
34 | }
35 | }
36 | }
37 | ]
38 | }
--------------------------------------------------------------------------------
/swiftui-design-system-demo/DesignSystem/Assets/ColorPalette.xcassets/brandPrimary.colorset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "info" : {
3 | "version" : 1,
4 | "author" : "xcode"
5 | },
6 | "colors" : [
7 | {
8 | "idiom" : "universal",
9 | "color" : {
10 | "color-space" : "srgb",
11 | "components" : {
12 | "red" : "0x58",
13 | "alpha" : "1.000",
14 | "blue" : "0xE2",
15 | "green" : "0x2B"
16 | }
17 | }
18 | },
19 | {
20 | "idiom" : "universal",
21 | "appearances" : [
22 | {
23 | "appearance" : "luminosity",
24 | "value" : "light"
25 | }
26 | ],
27 | "color" : {
28 | "color-space" : "srgb",
29 | "components" : {
30 | "red" : "0x58",
31 | "alpha" : "1.000",
32 | "blue" : "0xE2",
33 | "green" : "0x2B"
34 | }
35 | }
36 | },
37 | {
38 | "idiom" : "universal",
39 | "appearances" : [
40 | {
41 | "appearance" : "luminosity",
42 | "value" : "dark"
43 | }
44 | ],
45 | "color" : {
46 | "color-space" : "srgb",
47 | "components" : {
48 | "red" : "0x92",
49 | "alpha" : "1.000",
50 | "blue" : "0xFF",
51 | "green" : "0x5B"
52 | }
53 | }
54 | }
55 | ]
56 | }
--------------------------------------------------------------------------------
/swiftui-design-system-demo/DesignSystem/Assets/ColorPalette.xcassets/gray.colorset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "info" : {
3 | "version" : 1,
4 | "author" : "xcode"
5 | },
6 | "colors" : [
7 | {
8 | "idiom" : "universal",
9 | "color" : {
10 | "color-space" : "srgb",
11 | "components" : {
12 | "red" : "0.557",
13 | "alpha" : "1.000",
14 | "blue" : "0.576",
15 | "green" : "0.557"
16 | }
17 | }
18 | },
19 | {
20 | "idiom" : "universal",
21 | "appearances" : [
22 | {
23 | "appearance" : "luminosity",
24 | "value" : "light"
25 | }
26 | ],
27 | "color" : {
28 | "color-space" : "srgb",
29 | "components" : {
30 | "red" : "0.557",
31 | "alpha" : "1.000",
32 | "blue" : "0.576",
33 | "green" : "0.557"
34 | }
35 | }
36 | },
37 | {
38 | "idiom" : "universal",
39 | "appearances" : [
40 | {
41 | "appearance" : "luminosity",
42 | "value" : "dark"
43 | }
44 | ],
45 | "color" : {
46 | "color-space" : "srgb",
47 | "components" : {
48 | "red" : "0.557",
49 | "alpha" : "1.000",
50 | "blue" : "0.576",
51 | "green" : "0.557"
52 | }
53 | }
54 | }
55 | ]
56 | }
--------------------------------------------------------------------------------
/swiftui-design-system-demo/DesignSystem/Assets/ColorPalette.xcassets/themePrimary.colorset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "info" : {
3 | "version" : 1,
4 | "author" : "xcode"
5 | },
6 | "colors" : [
7 | {
8 | "idiom" : "universal",
9 | "color" : {
10 | "color-space" : "srgb",
11 | "components" : {
12 | "red" : "0xFA",
13 | "alpha" : "1.000",
14 | "blue" : "0xFA",
15 | "green" : "0xFA"
16 | }
17 | }
18 | },
19 | {
20 | "idiom" : "universal",
21 | "appearances" : [
22 | {
23 | "appearance" : "luminosity",
24 | "value" : "light"
25 | }
26 | ],
27 | "color" : {
28 | "color-space" : "srgb",
29 | "components" : {
30 | "red" : "0xFA",
31 | "alpha" : "1.000",
32 | "blue" : "0xFA",
33 | "green" : "0xFA"
34 | }
35 | }
36 | },
37 | {
38 | "idiom" : "universal",
39 | "appearances" : [
40 | {
41 | "appearance" : "luminosity",
42 | "value" : "dark"
43 | }
44 | ],
45 | "color" : {
46 | "color-space" : "srgb",
47 | "components" : {
48 | "red" : "0x1C",
49 | "alpha" : "1.000",
50 | "blue" : "0x1E",
51 | "green" : "0x1C"
52 | }
53 | }
54 | }
55 | ]
56 | }
--------------------------------------------------------------------------------
/swiftui-design-system-demo/DesignSystem/Assets/ColorPalette.xcassets/contrastPrimary.colorset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "info" : {
3 | "version" : 1,
4 | "author" : "xcode"
5 | },
6 | "colors" : [
7 | {
8 | "idiom" : "universal",
9 | "color" : {
10 | "color-space" : "srgb",
11 | "components" : {
12 | "red" : "0x1C",
13 | "alpha" : "1.000",
14 | "blue" : "0x1E",
15 | "green" : "0x1C"
16 | }
17 | }
18 | },
19 | {
20 | "idiom" : "universal",
21 | "appearances" : [
22 | {
23 | "appearance" : "luminosity",
24 | "value" : "light"
25 | }
26 | ],
27 | "color" : {
28 | "color-space" : "srgb",
29 | "components" : {
30 | "red" : "0x1C",
31 | "alpha" : "1.000",
32 | "blue" : "0x1E",
33 | "green" : "0x1C"
34 | }
35 | }
36 | },
37 | {
38 | "idiom" : "universal",
39 | "appearances" : [
40 | {
41 | "appearance" : "luminosity",
42 | "value" : "dark"
43 | }
44 | ],
45 | "color" : {
46 | "color-space" : "srgb",
47 | "components" : {
48 | "red" : "0xFA",
49 | "alpha" : "1.000",
50 | "blue" : "0xFA",
51 | "green" : "0xFA"
52 | }
53 | }
54 | }
55 | ]
56 | }
--------------------------------------------------------------------------------
/swiftui-design-system-demo/DesignSystem/Assets/ColorPalette.xcassets/themeSecondary.colorset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "info" : {
3 | "version" : 1,
4 | "author" : "xcode"
5 | },
6 | "colors" : [
7 | {
8 | "idiom" : "universal",
9 | "color" : {
10 | "color-space" : "srgb",
11 | "components" : {
12 | "red" : "0.843",
13 | "alpha" : "1.000",
14 | "blue" : "0.843",
15 | "green" : "0.843"
16 | }
17 | }
18 | },
19 | {
20 | "idiom" : "universal",
21 | "appearances" : [
22 | {
23 | "appearance" : "luminosity",
24 | "value" : "light"
25 | }
26 | ],
27 | "color" : {
28 | "color-space" : "srgb",
29 | "components" : {
30 | "red" : "0.843",
31 | "alpha" : "1.000",
32 | "blue" : "0.843",
33 | "green" : "0.843"
34 | }
35 | }
36 | },
37 | {
38 | "idiom" : "universal",
39 | "appearances" : [
40 | {
41 | "appearance" : "luminosity",
42 | "value" : "dark"
43 | }
44 | ],
45 | "color" : {
46 | "color-space" : "srgb",
47 | "components" : {
48 | "red" : "0.388",
49 | "alpha" : "1.000",
50 | "blue" : "0.400",
51 | "green" : "0.388"
52 | }
53 | }
54 | }
55 | ]
56 | }
--------------------------------------------------------------------------------
/swiftui-design-system-demo/DesignSystem/Assets/ColorPalette.xcassets/contrastSecondary.colorset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "info" : {
3 | "version" : 1,
4 | "author" : "xcode"
5 | },
6 | "colors" : [
7 | {
8 | "idiom" : "universal",
9 | "color" : {
10 | "color-space" : "srgb",
11 | "components" : {
12 | "red" : "0.388",
13 | "alpha" : "1.000",
14 | "blue" : "0.400",
15 | "green" : "0.388"
16 | }
17 | }
18 | },
19 | {
20 | "idiom" : "universal",
21 | "appearances" : [
22 | {
23 | "appearance" : "luminosity",
24 | "value" : "light"
25 | }
26 | ],
27 | "color" : {
28 | "color-space" : "srgb",
29 | "components" : {
30 | "red" : "0.388",
31 | "alpha" : "1.000",
32 | "blue" : "0.400",
33 | "green" : "0.388"
34 | }
35 | }
36 | },
37 | {
38 | "idiom" : "universal",
39 | "appearances" : [
40 | {
41 | "appearance" : "luminosity",
42 | "value" : "dark"
43 | }
44 | ],
45 | "color" : {
46 | "color-space" : "srgb",
47 | "components" : {
48 | "red" : "0.843",
49 | "alpha" : "1.000",
50 | "blue" : "0.843",
51 | "green" : "0.843"
52 | }
53 | }
54 | }
55 | ]
56 | }
--------------------------------------------------------------------------------
/swiftui-design-system-demo/AppDelegate.swift:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.swift
3 | // swiftui-design-system-demo
4 | //
5 | // Created by 邵名浦 on 2019/9/3.
6 | // Copyright © 2019 vinceshao. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | @UIApplicationMain
12 | class AppDelegate: UIResponder, UIApplicationDelegate {
13 |
14 |
15 |
16 | func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
17 | // Override point for customization after application launch.
18 | return true
19 | }
20 |
21 | // MARK: UISceneSession Lifecycle
22 |
23 | func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration {
24 | // Called when a new scene session is being created.
25 | // Use this method to select a configuration to create the new scene with.
26 | return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role)
27 | }
28 |
29 | func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set) {
30 | // Called when the user discards a scene session.
31 | // If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions.
32 | // Use this method to release any resources that were specific to the discarded scenes, as they will not return.
33 | }
34 |
35 |
36 | }
37 |
38 |
--------------------------------------------------------------------------------
/swiftui-design-system-demo/Base.lproj/LaunchScreen.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 |
--------------------------------------------------------------------------------
/swiftui-design-system-demo/Assets.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 | "idiom" : "ipad",
45 | "size" : "20x20",
46 | "scale" : "1x"
47 | },
48 | {
49 | "idiom" : "ipad",
50 | "size" : "20x20",
51 | "scale" : "2x"
52 | },
53 | {
54 | "idiom" : "ipad",
55 | "size" : "29x29",
56 | "scale" : "1x"
57 | },
58 | {
59 | "idiom" : "ipad",
60 | "size" : "29x29",
61 | "scale" : "2x"
62 | },
63 | {
64 | "idiom" : "ipad",
65 | "size" : "40x40",
66 | "scale" : "1x"
67 | },
68 | {
69 | "idiom" : "ipad",
70 | "size" : "40x40",
71 | "scale" : "2x"
72 | },
73 | {
74 | "idiom" : "ipad",
75 | "size" : "76x76",
76 | "scale" : "1x"
77 | },
78 | {
79 | "idiom" : "ipad",
80 | "size" : "76x76",
81 | "scale" : "2x"
82 | },
83 | {
84 | "idiom" : "ipad",
85 | "size" : "83.5x83.5",
86 | "scale" : "2x"
87 | },
88 | {
89 | "idiom" : "ios-marketing",
90 | "size" : "1024x1024",
91 | "scale" : "1x"
92 | }
93 | ],
94 | "info" : {
95 | "version" : 1,
96 | "author" : "xcode"
97 | }
98 | }
--------------------------------------------------------------------------------
/swiftui-design-system-demo/DesignSystem/Assets/Icon.xcassets/upload.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "dark.png",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "filename" : "dark-1.png",
11 | "appearances" : [
12 | {
13 | "appearance" : "luminosity",
14 | "value" : "light"
15 | }
16 | ],
17 | "scale" : "1x"
18 | },
19 | {
20 | "idiom" : "universal",
21 | "filename" : "light.png",
22 | "appearances" : [
23 | {
24 | "appearance" : "luminosity",
25 | "value" : "dark"
26 | }
27 | ],
28 | "scale" : "1x"
29 | },
30 | {
31 | "idiom" : "universal",
32 | "filename" : "dark@2x.png",
33 | "scale" : "2x"
34 | },
35 | {
36 | "idiom" : "universal",
37 | "filename" : "dark@2x-1.png",
38 | "appearances" : [
39 | {
40 | "appearance" : "luminosity",
41 | "value" : "light"
42 | }
43 | ],
44 | "scale" : "2x"
45 | },
46 | {
47 | "idiom" : "universal",
48 | "filename" : "light@2x.png",
49 | "appearances" : [
50 | {
51 | "appearance" : "luminosity",
52 | "value" : "dark"
53 | }
54 | ],
55 | "scale" : "2x"
56 | },
57 | {
58 | "idiom" : "universal",
59 | "filename" : "dark@3x.png",
60 | "scale" : "3x"
61 | },
62 | {
63 | "idiom" : "universal",
64 | "filename" : "dark@3x-1.png",
65 | "appearances" : [
66 | {
67 | "appearance" : "luminosity",
68 | "value" : "light"
69 | }
70 | ],
71 | "scale" : "3x"
72 | },
73 | {
74 | "idiom" : "universal",
75 | "filename" : "light@3x.png",
76 | "appearances" : [
77 | {
78 | "appearance" : "luminosity",
79 | "value" : "dark"
80 | }
81 | ],
82 | "scale" : "3x"
83 | }
84 | ],
85 | "info" : {
86 | "version" : 1,
87 | "author" : "xcode"
88 | }
89 | }
--------------------------------------------------------------------------------
/swiftui-design-system-demo/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | $(DEVELOPMENT_LANGUAGE)
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | $(PRODUCT_BUNDLE_PACKAGE_TYPE)
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleVersion
20 | 1
21 | LSRequiresIPhoneOS
22 |
23 | UIApplicationSceneManifest
24 |
25 | UIApplicationSupportsMultipleScenes
26 |
27 | UISceneConfigurations
28 |
29 | UIWindowSceneSessionRoleApplication
30 |
31 |
32 | UISceneConfigurationName
33 | Default Configuration
34 | UISceneDelegateClassName
35 | $(PRODUCT_MODULE_NAME).SceneDelegate
36 |
37 |
38 |
39 |
40 | UILaunchStoryboardName
41 | LaunchScreen
42 | UIRequiredDeviceCapabilities
43 |
44 | armv7
45 |
46 | UISupportedInterfaceOrientations
47 |
48 | UIInterfaceOrientationPortrait
49 | UIInterfaceOrientationLandscapeLeft
50 | UIInterfaceOrientationLandscapeRight
51 |
52 | UISupportedInterfaceOrientations~ipad
53 |
54 | UIInterfaceOrientationPortrait
55 | UIInterfaceOrientationPortraitUpsideDown
56 | UIInterfaceOrientationLandscapeLeft
57 | UIInterfaceOrientationLandscapeRight
58 |
59 |
60 |
61 |
--------------------------------------------------------------------------------
/swiftui-design-system-demo/DesignSystem/Assets/CircleIcon.xcassets/circle-plus.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "dark.png",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "filename" : "dark-1.png",
11 | "appearances" : [
12 | {
13 | "appearance" : "luminosity",
14 | "value" : "light"
15 | }
16 | ],
17 | "scale" : "1x"
18 | },
19 | {
20 | "idiom" : "universal",
21 | "filename" : "lightThin.png",
22 | "appearances" : [
23 | {
24 | "appearance" : "luminosity",
25 | "value" : "dark"
26 | }
27 | ],
28 | "scale" : "1x"
29 | },
30 | {
31 | "idiom" : "universal",
32 | "filename" : "dark@2x.png",
33 | "scale" : "2x"
34 | },
35 | {
36 | "idiom" : "universal",
37 | "filename" : "dark@2x-1.png",
38 | "appearances" : [
39 | {
40 | "appearance" : "luminosity",
41 | "value" : "light"
42 | }
43 | ],
44 | "scale" : "2x"
45 | },
46 | {
47 | "idiom" : "universal",
48 | "filename" : "lightThin@2x.png",
49 | "appearances" : [
50 | {
51 | "appearance" : "luminosity",
52 | "value" : "dark"
53 | }
54 | ],
55 | "scale" : "2x"
56 | },
57 | {
58 | "idiom" : "universal",
59 | "filename" : "dark@3x.png",
60 | "scale" : "3x"
61 | },
62 | {
63 | "idiom" : "universal",
64 | "filename" : "dark@3x-1.png",
65 | "appearances" : [
66 | {
67 | "appearance" : "luminosity",
68 | "value" : "light"
69 | }
70 | ],
71 | "scale" : "3x"
72 | },
73 | {
74 | "idiom" : "universal",
75 | "filename" : "lightThin@3x.png",
76 | "appearances" : [
77 | {
78 | "appearance" : "luminosity",
79 | "value" : "dark"
80 | }
81 | ],
82 | "scale" : "3x"
83 | }
84 | ],
85 | "info" : {
86 | "version" : 1,
87 | "author" : "xcode"
88 | }
89 | }
--------------------------------------------------------------------------------
/swiftui-design-system-demo/DesignSystem/Assets/CircleIcon.xcassets/circle-plus-light.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "lightThin.png",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "filename" : "lightThin-1.png",
11 | "appearances" : [
12 | {
13 | "appearance" : "luminosity",
14 | "value" : "light"
15 | }
16 | ],
17 | "scale" : "1x"
18 | },
19 | {
20 | "idiom" : "universal",
21 | "filename" : "dark-1.png",
22 | "appearances" : [
23 | {
24 | "appearance" : "luminosity",
25 | "value" : "dark"
26 | }
27 | ],
28 | "scale" : "1x"
29 | },
30 | {
31 | "idiom" : "universal",
32 | "filename" : "lightThin@2x-1.png",
33 | "scale" : "2x"
34 | },
35 | {
36 | "idiom" : "universal",
37 | "filename" : "lightThin@2x.png",
38 | "appearances" : [
39 | {
40 | "appearance" : "luminosity",
41 | "value" : "light"
42 | }
43 | ],
44 | "scale" : "2x"
45 | },
46 | {
47 | "idiom" : "universal",
48 | "filename" : "dark@2x-1.png",
49 | "appearances" : [
50 | {
51 | "appearance" : "luminosity",
52 | "value" : "dark"
53 | }
54 | ],
55 | "scale" : "2x"
56 | },
57 | {
58 | "idiom" : "universal",
59 | "filename" : "lightThin@3x.png",
60 | "scale" : "3x"
61 | },
62 | {
63 | "idiom" : "universal",
64 | "filename" : "lightThin@3x-1.png",
65 | "appearances" : [
66 | {
67 | "appearance" : "luminosity",
68 | "value" : "light"
69 | }
70 | ],
71 | "scale" : "3x"
72 | },
73 | {
74 | "idiom" : "universal",
75 | "filename" : "dark@3x-1.png",
76 | "appearances" : [
77 | {
78 | "appearance" : "luminosity",
79 | "value" : "dark"
80 | }
81 | ],
82 | "scale" : "3x"
83 | }
84 | ],
85 | "info" : {
86 | "version" : 1,
87 | "author" : "xcode"
88 | }
89 | }
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Xcode
2 | #
3 | # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore
4 |
5 | ## User settings
6 | xcuserdata/
7 |
8 | ## compatibility with Xcode 8 and earlier (ignoring not required starting Xcode 9)
9 | *.xcscmblueprint
10 | *.xccheckout
11 |
12 | ## compatibility with Xcode 3 and earlier (ignoring not required starting Xcode 4)
13 | build/
14 | DerivedData/
15 | *.moved-aside
16 | *.pbxuser
17 | !default.pbxuser
18 | *.mode1v3
19 | !default.mode1v3
20 | *.mode2v3
21 | !default.mode2v3
22 | *.perspectivev3
23 | !default.perspectivev3
24 |
25 | ## Obj-C/Swift specific
26 | *.hmap
27 |
28 | ## App packaging
29 | *.ipa
30 | *.dSYM.zip
31 | *.dSYM
32 |
33 | ## Playgrounds
34 | timeline.xctimeline
35 | playground.xcworkspace
36 |
37 | # Swift Package Manager
38 | #
39 | # Add this line if you want to avoid checking in source code from Swift Package Manager dependencies.
40 | # Packages/
41 | # Package.pins
42 | # Package.resolved
43 | # *.xcodeproj
44 | #
45 | # Xcode automatically generates this directory with a .xcworkspacedata file and xcuserdata
46 | # hence it is not needed unless you have added a package configuration file to your project
47 | # .swiftpm
48 |
49 | .build/
50 |
51 | # CocoaPods
52 | #
53 | # We recommend against adding the Pods directory to your .gitignore. However
54 | # you should judge for yourself, the pros and cons are mentioned at:
55 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
56 | #
57 | # Pods/
58 | #
59 | # Add this line if you want to avoid checking in source code from the Xcode workspace
60 | # *.xcworkspace
61 |
62 | # Carthage
63 | #
64 | # Add this line if you want to avoid checking in source code from Carthage dependencies.
65 | # Carthage/Checkouts
66 |
67 | Carthage/Build/
68 |
69 | # Accio dependency management
70 | Dependencies/
71 | .accio/
72 |
73 | # fastlane
74 | #
75 | # It is recommended to not store the screenshots in the git repo.
76 | # Instead, use fastlane to re-generate the screenshots whenever they are needed.
77 | # For more information about the recommended setup visit:
78 | # https://docs.fastlane.tools/best-practices/source-control/#source-control
79 |
80 | fastlane/report.xml
81 | fastlane/Preview.html
82 | fastlane/screenshots/**/*.png
83 | fastlane/test_output
84 |
85 | # Code Injection
86 | #
87 | # After new code Injection tools there's a generated folder /iOSInjectionProject
88 | # https://github.com/johnno1962/injectionforxcode
89 |
90 | iOSInjectionProject/
91 |
--------------------------------------------------------------------------------
/swiftui-design-system-demo/DesignSystem/Typography.swift:
--------------------------------------------------------------------------------
1 | //
2 | // Typography.swift
3 | // swiftui-design-system-demo
4 | //
5 | // Created by 邵名浦 on 2019/9/3.
6 | // Copyright © 2019 vinceshao. All rights reserved.
7 | //
8 |
9 | import SwiftUI
10 |
11 | ///
12 | // MARK: Base typography materials
13 | ///
14 | struct TokenTypography {
15 |
16 | ///
17 | // 1. Prepare base materials
18 | ///
19 |
20 | /// a. Level 1 base settings
21 | private enum FontSize: CGFloat {
22 | case
23 | small = 12,
24 | medium = 17,
25 | large = 28
26 | }
27 | private enum FontFamily: String {
28 | case
29 | HelveticaNeue = "HelveticaNeue",
30 | Georgia = "Georgia"
31 | }
32 |
33 | /// b. Level 2 tokens
34 | enum FontSizeToken: CGFloat {
35 | case
36 | caption,
37 | body,
38 | title
39 |
40 | func getValue() -> CGFloat {
41 | switch self {
42 | case .caption:
43 | return FontSize.small.rawValue
44 | case .body:
45 | return FontSize.medium.rawValue
46 | case .title:
47 | return FontSize.large.rawValue
48 | }
49 | }
50 | }
51 | enum FontFamilyToken: String {
52 | case
53 | main,
54 | sub
55 |
56 | func getValue() -> String {
57 | switch self {
58 | case .main:
59 | return FontFamily.HelveticaNeue.rawValue
60 | case .sub:
61 | return FontFamily.Georgia.rawValue
62 | }
63 | }
64 | }
65 |
66 | ///
67 | // 2. Expose data
68 | ///
69 | let mainFont: Font!
70 | let subFont: Font!
71 |
72 | init() {
73 | self.mainFont = Font.custom(FontFamilyToken.main.getValue(), size: FontSizeToken.body.getValue())
74 | self.subFont = Font.custom(FontFamilyToken.sub.getValue(), size: FontSizeToken.caption.getValue())
75 | }
76 | }
77 |
78 | /// Helper functions
79 | extension TokenTypography {
80 | public func sizingFont(font: FontFamilyToken, size: FontSizeToken) -> Font {
81 | return Font.custom(font.getValue(), size: size.getValue())
82 | }
83 | }
84 |
85 | ///
86 | // MARK: Expose Typography to Font struct
87 | ///
88 | /// ------
89 | /// To set environment Font, please chain setting
90 | /// `.environment(\.font, Font.Typography.mainFont)`
91 | /// to entry View of the app.
92 | /// ------
93 | ///
94 | extension Font {
95 | static let Typography = TokenTypography()
96 | }
97 |
--------------------------------------------------------------------------------
/swiftui-design-system-demo/DesignSystem/ColorPalatte.swift:
--------------------------------------------------------------------------------
1 | //
2 | // ColorPalatte.swift
3 | // swiftui-design-system-demo
4 | //
5 | // Created by 邵名浦 on 2019/9/3.
6 | // Copyright © 2019 vinceshao. All rights reserved.
7 | //
8 |
9 | import SwiftUI
10 |
11 | ///
12 | // MARK: Base color palette materials
13 | ///
14 |
15 | /// 1. Level 2 base
16 | struct BaseColor {
17 | /// dynamic color sets (with dark and light mode)
18 | let contrastPrimary = Color("contrastPrimary")
19 | let contrastSecondary = Color("contrastSecondary")
20 | let themePrimary = Color("themePrimary")
21 | let themeSecondary = Color("themeSecondary")
22 | let brandPrimary = Color("brandPrimary")
23 |
24 | /// staic color sets (not updating along with color mode)
25 | let darkPrimary = Color("darkPrimary")
26 | let lightPrimary = Color("lightPrimary")
27 | let gray = Color("gray")
28 | }
29 |
30 | /// 2. Level 3 tokens
31 | struct TokenColor {
32 | let baseColor = BaseColor()
33 |
34 | let highlight: Color!
35 | let inactive: Color!
36 |
37 | let textDefault: Color!
38 | let textTheme: Color!
39 | let textNote: Color!
40 | let textHighlight: Color!
41 | let textLight: Color!
42 |
43 | let buttonTheme: Color!
44 | let buttonContrast: Color!
45 | let buttonHighlight: Color!
46 |
47 | let backgroundDefault: Color!
48 | let backgroundTheme: Color!
49 |
50 | init() {
51 | /// themePrimary
52 | self.textTheme = baseColor.themePrimary
53 | self.buttonTheme = baseColor.themePrimary
54 | self.backgroundTheme = baseColor.themePrimary
55 |
56 | /// themeSecondary
57 | self.textNote = baseColor.themeSecondary
58 |
59 | /// contrastPrimary
60 | self.buttonContrast = baseColor.contrastPrimary
61 | self.textDefault = baseColor.contrastPrimary
62 | self.backgroundDefault = baseColor.contrastPrimary
63 |
64 | /// brand
65 | self.highlight = baseColor.brandPrimary
66 | self.buttonHighlight = baseColor.brandPrimary
67 | self.textHighlight = baseColor.brandPrimary
68 |
69 | /// lightPrimary
70 | self.textLight = baseColor.lightPrimary
71 |
72 | /// gray
73 | self.inactive = baseColor.gray
74 | }
75 | }
76 |
77 | ///
78 | // MARK: Add palatte to Color struct
79 | ///
80 | ///
81 | /// Base colors are not exposed at same layer as Color.Token but inside of which,
82 | /// because we encourage using Token colors instead of Base colors in most cases.
83 | ///
84 | extension Color {
85 | static let Token = TokenColor()
86 | }
87 |
--------------------------------------------------------------------------------
/swiftui-design-system-demo/SceneDelegate.swift:
--------------------------------------------------------------------------------
1 | //
2 | // SceneDelegate.swift
3 | // swiftui-design-system-demo
4 | //
5 | // Created by 邵名浦 on 2019/9/3.
6 | // Copyright © 2019 vinceshao. All rights reserved.
7 | //
8 |
9 | import UIKit
10 | import SwiftUI
11 |
12 | class SceneDelegate: UIResponder, UIWindowSceneDelegate {
13 |
14 | var window: UIWindow?
15 |
16 |
17 | func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {
18 | // Use this method to optionally configure and attach the UIWindow `window` to the provided UIWindowScene `scene`.
19 | // If using a storyboard, the `window` property will automatically be initialized and attached to the scene.
20 | // This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead).
21 |
22 | // Use a UIHostingController as window root view controller
23 | if let windowScene = scene as? UIWindowScene {
24 | let window = UIWindow(windowScene: windowScene)
25 | window.rootViewController = UIHostingController(rootView: ContentView().environment(\.font, Font.Typography.mainFont).background(Color.blue))
26 | self.window = window
27 | window.makeKeyAndVisible()
28 | }
29 | }
30 |
31 | func sceneDidDisconnect(_ scene: UIScene) {
32 | // Called as the scene is being released by the system.
33 | // This occurs shortly after the scene enters the background, or when its session is discarded.
34 | // Release any resources associated with this scene that can be re-created the next time the scene connects.
35 | // The scene may re-connect later, as its session was not neccessarily discarded (see `application:didDiscardSceneSessions` instead).
36 | }
37 |
38 | func sceneDidBecomeActive(_ scene: UIScene) {
39 | // Called when the scene has moved from an inactive state to an active state.
40 | // Use this method to restart any tasks that were paused (or not yet started) when the scene was inactive.
41 | }
42 |
43 | func sceneWillResignActive(_ scene: UIScene) {
44 | // Called when the scene will move from an active state to an inactive state.
45 | // This may occur due to temporary interruptions (ex. an incoming phone call).
46 | }
47 |
48 | func sceneWillEnterForeground(_ scene: UIScene) {
49 | // Called as the scene transitions from the background to the foreground.
50 | // Use this method to undo the changes made on entering the background.
51 | }
52 |
53 | func sceneDidEnterBackground(_ scene: UIScene) {
54 | // Called as the scene transitions from the foreground to the background.
55 | // Use this method to save data, release shared resources, and store enough scene-specific state information
56 | // to restore the scene back to its current state.
57 | }
58 |
59 |
60 | }
61 |
62 |
--------------------------------------------------------------------------------
/swiftui-design-system-demo/ContentView.swift:
--------------------------------------------------------------------------------
1 | //
2 | // ContentView.swift
3 | // swiftui-design-system-demo
4 | //
5 | // Created by 邵名浦 on 2019/9/3.
6 | // Copyright © 2019 vinceshao. All rights reserved.
7 | //
8 |
9 | import SwiftUI
10 |
11 | struct ContentView: View {
12 |
13 | /// Level 2 buttons
14 | let CircleButtonPrimary = TokenButton(circleButtonType: .primary, buttonIcon: "circle-plus")
15 | let CircleButtonSupport = TokenButton(circleButtonType: .support, buttonIcon: "circle-plus-light")
16 | let IconButton = TokenButton(buttonIcon: "upload")
17 | let CapsuleButton = TokenButton(capsuleText: "Save")
18 | let TextButton = TokenButton(buttonText: "select")
19 |
20 | var body: some View {
21 |
22 | /// Suffix modifier buttons
23 | var TextButtonActiveDemo = TokenButton(buttonText: "select")
24 | var IconButtonHighlightDemo = TokenButton(buttonIcon: "upload")
25 |
26 | return GeometryReader { geometry in
27 | VStack(alignment: .center, spacing: 24) {
28 |
29 | Spacer()
30 |
31 | Text("Demonstration of buttons")
32 | .font(Font.Typography.sizingFont(font: .sub, size: .body))
33 | .foregroundColor(Color.Token.textTheme)
34 |
35 | Spacer()
36 |
37 | /// Level 1 usage
38 | /*
39 | Button(action: {}) {
40 | TokenButtonLabel(name: "circle-plus", iconSize: .medium)
41 | }.buttonStyle(TokenButtonStyle(iconSize: .medium, backgroundColor: .theme))
42 |
43 |
44 | Button(action: {}) {
45 | TokenButtonLabel(text: "select")
46 | }.buttonStyle(TokenButtonStyle(textColor: .highlight))
47 | */
48 |
49 |
50 | /// Level 2 usage
51 | Button(action:{}) {
52 | self.CircleButtonPrimary.buttonLabel
53 | }.buttonStyle(self.CircleButtonPrimary.buttonStyle)
54 |
55 | Button(action:{}) {
56 | self.CircleButtonSupport.buttonLabel
57 | }.buttonStyle(self.CircleButtonSupport.buttonStyle)
58 |
59 | Button(action:{}) {
60 | self.IconButton.buttonLabel
61 | }.buttonStyle(self.IconButton.buttonStyle)
62 |
63 | Button(action:{}) {
64 | self.CapsuleButton.buttonLabel
65 | }.buttonStyle(self.CapsuleButton.buttonStyle)
66 |
67 | Button(action:{}) {
68 | self.TextButton.buttonLabel
69 | }.buttonStyle(self.TextButton.buttonStyle)
70 |
71 | /*
72 | /// Active modifier demo
73 | Button(action:{}) {
74 | TextButtonActiveDemo.buttonLabel
75 | }.buttonStyle(TextButtonActiveDemo.buttonStyle)
76 |
77 | Button(action:{}) {
78 | TextButtonActiveDemo.buttonLabel
79 | }.buttonStyle(TextButtonActiveDemo.buttonStyle.activate(.off))
80 |
81 | /// Highlight modifier demo
82 | Button(action:{}) {
83 | IconButtonHighlightDemo.buttonLabel
84 | }.buttonStyle(IconButtonHighlightDemo.buttonStyle)
85 |
86 | Button(action:{}) {
87 | IconButtonHighlightDemo.buttonLabel.highlight(.on)
88 | }.buttonStyle(IconButtonHighlightDemo.buttonStyle)
89 | */
90 |
91 | Spacer()
92 | }
93 | }
94 | }
95 | }
96 |
97 | #if DEBUG
98 | struct ContentView_Previews: PreviewProvider {
99 | static var previews: some View {
100 | ContentView()
101 | .environment(\.font, Font.Typography.mainFont)
102 | .environment(\.colorScheme, .light)
103 | .background(Color.blue)
104 | }
105 | }
106 | #endif
107 |
--------------------------------------------------------------------------------
/swiftui-design-system-demo/Component/Button.swift:
--------------------------------------------------------------------------------
1 | //
2 | // Button.swift
3 | // swiftui-design-system-demo
4 | //
5 | // Created by 邵名浦 on 2019/9/4.
6 | // Copyright © 2019 vinceshao. All rights reserved.
7 | //
8 |
9 | import SwiftUI
10 |
11 | /// Helper function
12 | private func getOpacityValue(_ isPressed: Bool) -> Double {
13 | let isPressedOpacity = 0.8
14 | return isPressed ? isPressedOpacity : 1
15 | }
16 |
17 | ///
18 | ///
19 | // MARK: Token Button
20 | ///
21 | ///
22 | struct TokenButton {
23 | var buttonLabel: TokenButtonLabel
24 | var buttonStyle: TokenButtonStyle
25 |
26 | ///
27 | // Circle Button
28 | ///
29 | private var circleBtnType: CircleBtnType! = .primary
30 | private var circleBtnIcon: String! = "circle-plus"
31 | /// Circle Button
32 | init(circleButtonType: CircleBtnType, buttonIcon: String) {
33 | /// Get required properties
34 | var backgroundColor: TokenButtonStyle.BackgroundColor! = .theme
35 | var borderStyle: TokenButtonStyle.BorderStyle! = .none
36 | var iconSize: IconSize! = .medium
37 |
38 | /// Background Color config
39 | switch circleButtonType {
40 | case .primary:
41 | backgroundColor = .theme
42 | case .support:
43 | backgroundColor = .clear
44 | }
45 |
46 | /// Border Style config
47 | switch circleButtonType {
48 | case .support:
49 | borderStyle = .regular
50 | default:
51 | borderStyle = .none
52 | }
53 |
54 | /// Button Size config
55 | switch circleButtonType {
56 | case .primary:
57 | iconSize = CircleBtnSize.medium.getIconSize()
58 | case .support:
59 | iconSize = CircleBtnSize.small.getIconSize()
60 | }
61 |
62 | /// Initialization
63 | self.circleBtnType = circleButtonType
64 | self.circleBtnIcon = buttonIcon
65 | self.buttonLabel = TokenButtonLabel(name: circleBtnIcon, iconSize: iconSize)
66 | self.buttonStyle = TokenButtonStyle(iconSize: iconSize, backgroundColor: backgroundColor, border: borderStyle)
67 | }
68 |
69 | ///
70 | // Icon Button
71 | ///
72 | private var iconBtnType: IconBtnType! = .action
73 | private var iconBtnIcon: String! = "upload"
74 | /// Icon Button
75 | init(iconButtonType: IconBtnType = .tool, buttonIcon: String) {
76 | var iconSize: IconSize! = .medium
77 |
78 | /// Button size
79 | switch iconButtonType {
80 | case .action:
81 | iconSize = IconBtnSize.large.getIconSize()
82 | case .tool:
83 | iconSize = IconBtnSize.medium.getIconSize()
84 | }
85 |
86 | /// Initialization
87 | self.iconBtnType = iconButtonType
88 | self.iconBtnIcon = buttonIcon
89 | self.buttonLabel = TokenButtonLabel(name: iconBtnIcon, iconSize: iconSize)
90 | self.buttonStyle = TokenButtonStyle(iconSize: iconSize)
91 | }
92 |
93 | ///
94 | // Capsule Button
95 | ///
96 | private var capsuleBtnText: String! = "Save"
97 | /// Capsule Button
98 | init(capsuleText: String) {
99 | self.capsuleBtnText = capsuleText
100 | self.buttonLabel = TokenButtonLabel(text: capsuleText)
101 | self.buttonStyle = TokenButtonStyle(backgroundColor: .highlight, textColor: .light)
102 | }
103 |
104 | ///
105 | // Text Button
106 | ///
107 | private var textBtnText: String! = "select"
108 | /// Text Button
109 | init(buttonText: String) {
110 | self.textBtnText = buttonText
111 | self.buttonLabel = TokenButtonLabel(text: buttonText)
112 | self.buttonStyle = TokenButtonStyle(textColor: .highlight)
113 | }
114 | }
115 | extension TokenButton {
116 | /// Global properties
117 | enum IconSize: CGFloat, Equatable {
118 | case extraLarge = 80
119 | case large = 64
120 | case medium = 48
121 | case small = 40
122 | case mini = 28
123 | }
124 | enum ButtonType {
125 | case circle, icon, capsule, text
126 | }
127 | enum StateSwitch {
128 | case off, on
129 | }
130 | /// Circle button
131 | enum CircleBtnType: Equatable {
132 | case primary, support
133 | }
134 | enum CircleBtnSize: Equatable {
135 | case medium, small
136 |
137 | func getIconSize() -> IconSize {
138 | switch self {
139 | case .medium:
140 | return IconSize.large
141 | case .small:
142 | return IconSize.medium
143 | }
144 | }
145 | }
146 | /// Icon button
147 | enum IconBtnType: Equatable {
148 | case tool, action
149 | }
150 | enum IconBtnSize: Equatable {
151 | case large, medium
152 |
153 | func getIconSize() -> IconSize {
154 | switch self {
155 | case .large:
156 | return IconSize.small
157 | case .medium:
158 | return IconSize.mini
159 | }
160 | }
161 | }
162 | }
163 |
164 |
165 |
166 |
167 | ///
168 | ///
169 | // MARK: Button Label
170 | ///
171 | ///
172 | struct TokenButtonLabel: View {
173 | /// Global properties
174 | private let labelType: LabelTypes
175 | private var iconName: String?
176 |
177 | /// State properties
178 | var isHighlighted = false
179 |
180 | ///
181 | // Icon Type
182 | ///
183 | private var iconSize: TokenButton.IconSize?
184 | /// Icon Type
185 | init(name: String, iconSize: TokenButton.IconSize) {
186 | self.labelType = .icon
187 | self.iconName = name
188 | self.iconSize = iconSize
189 | }
190 |
191 | ///
192 | // Text Type
193 | ///
194 | private var btnText: String?
195 | /// Text Type
196 | init(text: String) {
197 | self.labelType = .text
198 | self.btnText = text
199 | }
200 |
201 | /// Helper function
202 | func getView() -> some View {
203 | var renderView: AnyView!
204 | let highlightSuffix = isHighlighted ? "-highlight" : ""
205 |
206 | switch labelType {
207 | case .icon:
208 | let iconString = "\(iconName!)\(highlightSuffix)"
209 |
210 | renderView = AnyView(
211 | Image("\(iconString)")
212 | .resizable()
213 | .aspectRatio(contentMode: .fill)
214 | .frame(width: iconSize!.rawValue, height: iconSize!.rawValue, alignment: .center)
215 | )
216 | case .text:
217 | renderView = AnyView(
218 | Text("\(btnText!)")
219 | .font(Font.Typography.sizingFont(font: .main, size: .body))
220 | )
221 | }
222 |
223 | return renderView
224 | }
225 |
226 | ///
227 | // Rendering View
228 | ///
229 | var body: some View {
230 | getView()
231 | }
232 | }
233 |
234 | extension TokenButtonLabel {
235 | enum LabelTypes {
236 | case icon, text
237 | }
238 | enum TextColor {
239 | case highlight, main
240 |
241 | func getColor() -> Color {
242 | switch self {
243 | case .highlight:
244 | return Color.Token.textHighlight
245 | case .main:
246 | return Color.Token.textDefault
247 | }
248 | }
249 | }
250 | }
251 |
252 | /// State modifier
253 | extension TokenButtonLabel {
254 | /// Pass highlightSwitch argument bonded with @State variable in order to trigger updates
255 | mutating func highlight(_ highlightSwitch: TokenButton.StateSwitch) -> Self {
256 | self.isHighlighted = highlightSwitch == .on ? true : false
257 | return self
258 | }
259 | }
260 |
261 |
262 |
263 | ///
264 | ///
265 | // MARK: Button Style
266 | ///
267 | ///
268 | struct TokenButtonStyle: ButtonStyle {
269 | /// Global properties
270 | private let styleType: StyleType
271 | private var iconSize: TokenButton.IconSize?
272 | private var backgroundColor: Color?
273 | private var borderStyle: StyleAlias.BorderStyle?
274 | private var textColor: Color?
275 |
276 | /// State properties
277 | var isActive = true
278 |
279 | /// Circle Icon Button
280 | init(iconSize: TokenButton.IconSize,
281 | backgroundColor: BackgroundColor,
282 | border: BorderStyle? = .none) {
283 | self.styleType = .circleIcon
284 | self.iconSize = iconSize
285 | self.borderStyle = border == .none
286 | ? (Color.clear, 0, 0)
287 | : (Color.Token.buttonTheme, CGFloat(2), 12)
288 | self.backgroundColor = backgroundColor.getColor()
289 | }
290 |
291 | /// Icon Button
292 | init(iconSize: TokenButton.IconSize) {
293 | self.styleType = .icon
294 | self.iconSize = iconSize
295 | }
296 |
297 | /// Capsule Button
298 | init(backgroundColor: BackgroundColor, textColor: TextColor) {
299 | self.styleType = .capsule
300 | self.backgroundColor = backgroundColor.getColor()
301 | self.textColor = textColor.getColor()
302 | }
303 |
304 | /// Text Button
305 | init(textColor: TextColor) {
306 | self.styleType = .text
307 | self.textColor = textColor.getColor()
308 | }
309 |
310 | /// Rendering Button Style
311 | func makeBody(configuration: Self.Configuration) -> some View {
312 | var renderView: AnyView!
313 | let verticalMargin = CapsuleValue.verticalMargin.rawValue
314 | let horizontalMargin = CapsuleValue.horizontalMargin.rawValue
315 |
316 | switch styleType {
317 | case .circleIcon:
318 | renderView = AnyView(configuration.label
319 | .background(backgroundColor!)
320 | .frame(width: iconSize!.rawValue, height: iconSize!.rawValue, alignment: .center)
321 | .clipShape(RoundedRectangle(cornerRadius: iconSize!.rawValue))
322 | .overlay(RoundedRectangle(cornerRadius: iconSize!.rawValue)
323 | .stroke(borderStyle!.color, lineWidth: borderStyle!.width))
324 | )
325 | case .icon:
326 | renderView = AnyView(configuration.label
327 | .frame(width: iconSize!.rawValue, height: iconSize!.rawValue, alignment: .center)
328 | .aspectRatio(contentMode: .fill)
329 | )
330 | case .capsule:
331 | renderView = AnyView(configuration.label
332 | .padding(.init(top: verticalMargin, leading: horizontalMargin, bottom: verticalMargin, trailing: horizontalMargin))
333 | .foregroundColor(textColor!)
334 | .background(backgroundColor!)
335 | .cornerRadius(horizontalMargin)
336 | )
337 | case .text:
338 | renderView = AnyView(configuration.label
339 | .padding(.init(top: verticalMargin, leading: horizontalMargin, bottom: verticalMargin, trailing: horizontalMargin))
340 | .foregroundColor(textColor!)
341 | )
342 | }
343 |
344 | return renderView.opacity(getOpacityValue(configuration.isPressed || !isActive))
345 | }
346 | }
347 |
348 | extension TokenButtonStyle {
349 | enum StyleType {
350 | case circleIcon, icon, capsule, text
351 | }
352 | enum MaskShape {
353 | case circle, capsule
354 | }
355 | enum BorderStyle {
356 | case regular
357 | }
358 | enum TextColor {
359 | case highlight, light, theme
360 |
361 | func getColor() -> Color {
362 | switch self {
363 | case .highlight:
364 | return Color.Token.textHighlight
365 | case .light:
366 | return Color.Token.textLight
367 | case .theme:
368 | return Color.Token.textTheme
369 | }
370 | }
371 | }
372 | enum BackgroundColor {
373 | case theme, contrast, clear, highlight
374 |
375 | func getColor() -> Color {
376 | switch self {
377 | case .theme:
378 | return Color.Token.buttonTheme
379 | case .contrast:
380 | return Color.Token.buttonContrast
381 | case .clear:
382 | return Color.clear
383 | case .highlight:
384 | return Color.Token.buttonHighlight
385 | }
386 | }
387 | }
388 | enum CapsuleValue: CGFloat {
389 | case height = 44
390 | case horizontalMargin = 32
391 | case verticalMargin = 16
392 | }
393 | }
394 |
395 | /// State modifier
396 | extension TokenButtonStyle {
397 | /// Pass highlightSwitch argument bonded with @State variable in order to trigger updates
398 | mutating func activate(_ activeSwitch: TokenButton.StateSwitch) -> Self {
399 | self.isActive = activeSwitch == .on ? true : false
400 | return self
401 | }
402 | }
403 |
404 |
--------------------------------------------------------------------------------
/swiftui-design-system-demo.xcodeproj/project.pbxproj:
--------------------------------------------------------------------------------
1 | // !$*UTF8*$!
2 | {
3 | archiveVersion = 1;
4 | classes = {
5 | };
6 | objectVersion = 50;
7 | objects = {
8 |
9 | /* Begin PBXBuildFile section */
10 | 8A5198F5231ECA6A0053FED4 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8A5198F4231ECA6A0053FED4 /* AppDelegate.swift */; };
11 | 8A5198F7231ECA6A0053FED4 /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8A5198F6231ECA6A0053FED4 /* SceneDelegate.swift */; };
12 | 8A5198F9231ECA6A0053FED4 /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8A5198F8231ECA6A0053FED4 /* ContentView.swift */; };
13 | 8A5198FB231ECA6A0053FED4 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 8A5198FA231ECA6A0053FED4 /* Assets.xcassets */; };
14 | 8A5198FE231ECA6B0053FED4 /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 8A5198FD231ECA6A0053FED4 /* Preview Assets.xcassets */; };
15 | 8A519901231ECA6B0053FED4 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 8A5198FF231ECA6B0053FED4 /* LaunchScreen.storyboard */; };
16 | 8A51990C231F0A360053FED4 /* Typography.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8A51990B231F0A360053FED4 /* Typography.swift */; };
17 | 8A51990E231F28710053FED4 /* ColorPalette.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 8A51990D231F28710053FED4 /* ColorPalette.xcassets */; };
18 | 8A519910231F29990053FED4 /* ColorPalatte.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8A51990F231F29990053FED4 /* ColorPalatte.swift */; };
19 | 8A519912231FF0A30053FED4 /* Button.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8A519911231FF0A30053FED4 /* Button.swift */; };
20 | 8A519915231FFA7A0053FED4 /* AliasHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8A519914231FFA7A0053FED4 /* AliasHelper.swift */; };
21 | 8A519917231FFEDC0053FED4 /* CircleIcon.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 8A519916231FFEDC0053FED4 /* CircleIcon.xcassets */; };
22 | 8A519919231FFFD80053FED4 /* Icon.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 8A519918231FFFD80053FED4 /* Icon.xcassets */; };
23 | /* End PBXBuildFile section */
24 |
25 | /* Begin PBXFileReference section */
26 | 8A5198F1231ECA6A0053FED4 /* swiftui-design-system-demo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "swiftui-design-system-demo.app"; sourceTree = BUILT_PRODUCTS_DIR; };
27 | 8A5198F4231ECA6A0053FED4 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; };
28 | 8A5198F6231ECA6A0053FED4 /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = ""; };
29 | 8A5198F8231ECA6A0053FED4 /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = ""; };
30 | 8A5198FA231ECA6A0053FED4 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; };
31 | 8A5198FD231ECA6A0053FED4 /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = ""; };
32 | 8A519900231ECA6B0053FED4 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; };
33 | 8A519902231ECA6B0053FED4 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
34 | 8A51990B231F0A360053FED4 /* Typography.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Typography.swift; sourceTree = ""; };
35 | 8A51990D231F28710053FED4 /* ColorPalette.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = ColorPalette.xcassets; sourceTree = ""; };
36 | 8A51990F231F29990053FED4 /* ColorPalatte.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ColorPalatte.swift; sourceTree = ""; };
37 | 8A519911231FF0A30053FED4 /* Button.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Button.swift; sourceTree = ""; };
38 | 8A519914231FFA7A0053FED4 /* AliasHelper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AliasHelper.swift; sourceTree = ""; };
39 | 8A519916231FFEDC0053FED4 /* CircleIcon.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = CircleIcon.xcassets; sourceTree = ""; };
40 | 8A519918231FFFD80053FED4 /* Icon.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Icon.xcassets; sourceTree = ""; };
41 | /* End PBXFileReference section */
42 |
43 | /* Begin PBXFrameworksBuildPhase section */
44 | 8A5198EE231ECA6A0053FED4 /* Frameworks */ = {
45 | isa = PBXFrameworksBuildPhase;
46 | buildActionMask = 2147483647;
47 | files = (
48 | );
49 | runOnlyForDeploymentPostprocessing = 0;
50 | };
51 | /* End PBXFrameworksBuildPhase section */
52 |
53 | /* Begin PBXGroup section */
54 | 8A5198E8231ECA690053FED4 = {
55 | isa = PBXGroup;
56 | children = (
57 | 8A5198F3231ECA6A0053FED4 /* swiftui-design-system-demo */,
58 | 8A5198F2231ECA6A0053FED4 /* Products */,
59 | );
60 | sourceTree = "";
61 | };
62 | 8A5198F2231ECA6A0053FED4 /* Products */ = {
63 | isa = PBXGroup;
64 | children = (
65 | 8A5198F1231ECA6A0053FED4 /* swiftui-design-system-demo.app */,
66 | );
67 | name = Products;
68 | sourceTree = "";
69 | };
70 | 8A5198F3231ECA6A0053FED4 /* swiftui-design-system-demo */ = {
71 | isa = PBXGroup;
72 | children = (
73 | 8A519913231FFA680053FED4 /* Helper */,
74 | 8A519909231F0A170053FED4 /* Component */,
75 | 8A519908231F0A020053FED4 /* DesignSystem */,
76 | 8A5198F4231ECA6A0053FED4 /* AppDelegate.swift */,
77 | 8A5198F6231ECA6A0053FED4 /* SceneDelegate.swift */,
78 | 8A5198F8231ECA6A0053FED4 /* ContentView.swift */,
79 | 8A5198FA231ECA6A0053FED4 /* Assets.xcassets */,
80 | 8A5198FF231ECA6B0053FED4 /* LaunchScreen.storyboard */,
81 | 8A519902231ECA6B0053FED4 /* Info.plist */,
82 | 8A5198FC231ECA6A0053FED4 /* Preview Content */,
83 | );
84 | path = "swiftui-design-system-demo";
85 | sourceTree = "";
86 | };
87 | 8A5198FC231ECA6A0053FED4 /* Preview Content */ = {
88 | isa = PBXGroup;
89 | children = (
90 | 8A5198FD231ECA6A0053FED4 /* Preview Assets.xcassets */,
91 | );
92 | path = "Preview Content";
93 | sourceTree = "";
94 | };
95 | 8A519908231F0A020053FED4 /* DesignSystem */ = {
96 | isa = PBXGroup;
97 | children = (
98 | 8A51990A231F0A1F0053FED4 /* Assets */,
99 | 8A51990B231F0A360053FED4 /* Typography.swift */,
100 | 8A51990F231F29990053FED4 /* ColorPalatte.swift */,
101 | );
102 | path = DesignSystem;
103 | sourceTree = "";
104 | };
105 | 8A519909231F0A170053FED4 /* Component */ = {
106 | isa = PBXGroup;
107 | children = (
108 | 8A519911231FF0A30053FED4 /* Button.swift */,
109 | );
110 | path = Component;
111 | sourceTree = "";
112 | };
113 | 8A51990A231F0A1F0053FED4 /* Assets */ = {
114 | isa = PBXGroup;
115 | children = (
116 | 8A51990D231F28710053FED4 /* ColorPalette.xcassets */,
117 | 8A519916231FFEDC0053FED4 /* CircleIcon.xcassets */,
118 | 8A519918231FFFD80053FED4 /* Icon.xcassets */,
119 | );
120 | path = Assets;
121 | sourceTree = "";
122 | };
123 | 8A519913231FFA680053FED4 /* Helper */ = {
124 | isa = PBXGroup;
125 | children = (
126 | 8A519914231FFA7A0053FED4 /* AliasHelper.swift */,
127 | );
128 | path = Helper;
129 | sourceTree = "";
130 | };
131 | /* End PBXGroup section */
132 |
133 | /* Begin PBXNativeTarget section */
134 | 8A5198F0231ECA6A0053FED4 /* swiftui-design-system-demo */ = {
135 | isa = PBXNativeTarget;
136 | buildConfigurationList = 8A519905231ECA6B0053FED4 /* Build configuration list for PBXNativeTarget "swiftui-design-system-demo" */;
137 | buildPhases = (
138 | 8A5198ED231ECA6A0053FED4 /* Sources */,
139 | 8A5198EE231ECA6A0053FED4 /* Frameworks */,
140 | 8A5198EF231ECA6A0053FED4 /* Resources */,
141 | );
142 | buildRules = (
143 | );
144 | dependencies = (
145 | );
146 | name = "swiftui-design-system-demo";
147 | productName = "swiftui-design-system-demo";
148 | productReference = 8A5198F1231ECA6A0053FED4 /* swiftui-design-system-demo.app */;
149 | productType = "com.apple.product-type.application";
150 | };
151 | /* End PBXNativeTarget section */
152 |
153 | /* Begin PBXProject section */
154 | 8A5198E9231ECA690053FED4 /* Project object */ = {
155 | isa = PBXProject;
156 | attributes = {
157 | LastSwiftUpdateCheck = 1100;
158 | LastUpgradeCheck = 1100;
159 | ORGANIZATIONNAME = vinceshao;
160 | TargetAttributes = {
161 | 8A5198F0231ECA6A0053FED4 = {
162 | CreatedOnToolsVersion = 11.0;
163 | };
164 | };
165 | };
166 | buildConfigurationList = 8A5198EC231ECA690053FED4 /* Build configuration list for PBXProject "swiftui-design-system-demo" */;
167 | compatibilityVersion = "Xcode 9.3";
168 | developmentRegion = en;
169 | hasScannedForEncodings = 0;
170 | knownRegions = (
171 | en,
172 | Base,
173 | );
174 | mainGroup = 8A5198E8231ECA690053FED4;
175 | productRefGroup = 8A5198F2231ECA6A0053FED4 /* Products */;
176 | projectDirPath = "";
177 | projectRoot = "";
178 | targets = (
179 | 8A5198F0231ECA6A0053FED4 /* swiftui-design-system-demo */,
180 | );
181 | };
182 | /* End PBXProject section */
183 |
184 | /* Begin PBXResourcesBuildPhase section */
185 | 8A5198EF231ECA6A0053FED4 /* Resources */ = {
186 | isa = PBXResourcesBuildPhase;
187 | buildActionMask = 2147483647;
188 | files = (
189 | 8A519919231FFFD80053FED4 /* Icon.xcassets in Resources */,
190 | 8A519901231ECA6B0053FED4 /* LaunchScreen.storyboard in Resources */,
191 | 8A519917231FFEDC0053FED4 /* CircleIcon.xcassets in Resources */,
192 | 8A5198FE231ECA6B0053FED4 /* Preview Assets.xcassets in Resources */,
193 | 8A5198FB231ECA6A0053FED4 /* Assets.xcassets in Resources */,
194 | 8A51990E231F28710053FED4 /* ColorPalette.xcassets in Resources */,
195 | );
196 | runOnlyForDeploymentPostprocessing = 0;
197 | };
198 | /* End PBXResourcesBuildPhase section */
199 |
200 | /* Begin PBXSourcesBuildPhase section */
201 | 8A5198ED231ECA6A0053FED4 /* Sources */ = {
202 | isa = PBXSourcesBuildPhase;
203 | buildActionMask = 2147483647;
204 | files = (
205 | 8A5198F5231ECA6A0053FED4 /* AppDelegate.swift in Sources */,
206 | 8A519912231FF0A30053FED4 /* Button.swift in Sources */,
207 | 8A5198F7231ECA6A0053FED4 /* SceneDelegate.swift in Sources */,
208 | 8A51990C231F0A360053FED4 /* Typography.swift in Sources */,
209 | 8A519915231FFA7A0053FED4 /* AliasHelper.swift in Sources */,
210 | 8A519910231F29990053FED4 /* ColorPalatte.swift in Sources */,
211 | 8A5198F9231ECA6A0053FED4 /* ContentView.swift in Sources */,
212 | );
213 | runOnlyForDeploymentPostprocessing = 0;
214 | };
215 | /* End PBXSourcesBuildPhase section */
216 |
217 | /* Begin PBXVariantGroup section */
218 | 8A5198FF231ECA6B0053FED4 /* LaunchScreen.storyboard */ = {
219 | isa = PBXVariantGroup;
220 | children = (
221 | 8A519900231ECA6B0053FED4 /* Base */,
222 | );
223 | name = LaunchScreen.storyboard;
224 | sourceTree = "";
225 | };
226 | /* End PBXVariantGroup section */
227 |
228 | /* Begin XCBuildConfiguration section */
229 | 8A519903231ECA6B0053FED4 /* Debug */ = {
230 | isa = XCBuildConfiguration;
231 | buildSettings = {
232 | ALWAYS_SEARCH_USER_PATHS = NO;
233 | CLANG_ANALYZER_NONNULL = YES;
234 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
235 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
236 | CLANG_CXX_LIBRARY = "libc++";
237 | CLANG_ENABLE_MODULES = YES;
238 | CLANG_ENABLE_OBJC_ARC = YES;
239 | CLANG_ENABLE_OBJC_WEAK = YES;
240 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
241 | CLANG_WARN_BOOL_CONVERSION = YES;
242 | CLANG_WARN_COMMA = YES;
243 | CLANG_WARN_CONSTANT_CONVERSION = YES;
244 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
245 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
246 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
247 | CLANG_WARN_EMPTY_BODY = YES;
248 | CLANG_WARN_ENUM_CONVERSION = YES;
249 | CLANG_WARN_INFINITE_RECURSION = YES;
250 | CLANG_WARN_INT_CONVERSION = YES;
251 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
252 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
253 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
254 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
255 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
256 | CLANG_WARN_STRICT_PROTOTYPES = YES;
257 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
258 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
259 | CLANG_WARN_UNREACHABLE_CODE = YES;
260 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
261 | COPY_PHASE_STRIP = NO;
262 | DEBUG_INFORMATION_FORMAT = dwarf;
263 | ENABLE_STRICT_OBJC_MSGSEND = YES;
264 | ENABLE_TESTABILITY = YES;
265 | GCC_C_LANGUAGE_STANDARD = gnu11;
266 | GCC_DYNAMIC_NO_PIC = NO;
267 | GCC_NO_COMMON_BLOCKS = YES;
268 | GCC_OPTIMIZATION_LEVEL = 0;
269 | GCC_PREPROCESSOR_DEFINITIONS = (
270 | "DEBUG=1",
271 | "$(inherited)",
272 | );
273 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
274 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
275 | GCC_WARN_UNDECLARED_SELECTOR = YES;
276 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
277 | GCC_WARN_UNUSED_FUNCTION = YES;
278 | GCC_WARN_UNUSED_VARIABLE = YES;
279 | IPHONEOS_DEPLOYMENT_TARGET = 13.0;
280 | MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
281 | MTL_FAST_MATH = YES;
282 | ONLY_ACTIVE_ARCH = YES;
283 | SDKROOT = iphoneos;
284 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
285 | SWIFT_OPTIMIZATION_LEVEL = "-Onone";
286 | };
287 | name = Debug;
288 | };
289 | 8A519904231ECA6B0053FED4 /* Release */ = {
290 | isa = XCBuildConfiguration;
291 | buildSettings = {
292 | ALWAYS_SEARCH_USER_PATHS = NO;
293 | CLANG_ANALYZER_NONNULL = YES;
294 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
295 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
296 | CLANG_CXX_LIBRARY = "libc++";
297 | CLANG_ENABLE_MODULES = YES;
298 | CLANG_ENABLE_OBJC_ARC = YES;
299 | CLANG_ENABLE_OBJC_WEAK = YES;
300 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
301 | CLANG_WARN_BOOL_CONVERSION = YES;
302 | CLANG_WARN_COMMA = YES;
303 | CLANG_WARN_CONSTANT_CONVERSION = YES;
304 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
305 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
306 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
307 | CLANG_WARN_EMPTY_BODY = YES;
308 | CLANG_WARN_ENUM_CONVERSION = YES;
309 | CLANG_WARN_INFINITE_RECURSION = YES;
310 | CLANG_WARN_INT_CONVERSION = YES;
311 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
312 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
313 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
314 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
315 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
316 | CLANG_WARN_STRICT_PROTOTYPES = YES;
317 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
318 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
319 | CLANG_WARN_UNREACHABLE_CODE = YES;
320 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
321 | COPY_PHASE_STRIP = NO;
322 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
323 | ENABLE_NS_ASSERTIONS = NO;
324 | ENABLE_STRICT_OBJC_MSGSEND = YES;
325 | GCC_C_LANGUAGE_STANDARD = gnu11;
326 | GCC_NO_COMMON_BLOCKS = YES;
327 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
328 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
329 | GCC_WARN_UNDECLARED_SELECTOR = YES;
330 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
331 | GCC_WARN_UNUSED_FUNCTION = YES;
332 | GCC_WARN_UNUSED_VARIABLE = YES;
333 | IPHONEOS_DEPLOYMENT_TARGET = 13.0;
334 | MTL_ENABLE_DEBUG_INFO = NO;
335 | MTL_FAST_MATH = YES;
336 | SDKROOT = iphoneos;
337 | SWIFT_COMPILATION_MODE = wholemodule;
338 | SWIFT_OPTIMIZATION_LEVEL = "-O";
339 | VALIDATE_PRODUCT = YES;
340 | };
341 | name = Release;
342 | };
343 | 8A519906231ECA6B0053FED4 /* Debug */ = {
344 | isa = XCBuildConfiguration;
345 | buildSettings = {
346 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
347 | CODE_SIGN_STYLE = Automatic;
348 | DEVELOPMENT_ASSET_PATHS = "swiftui-design-system-demo/Preview\\ Content";
349 | DEVELOPMENT_TEAM = Z22M485WLJ;
350 | ENABLE_PREVIEWS = YES;
351 | INFOPLIST_FILE = "swiftui-design-system-demo/Info.plist";
352 | LD_RUNPATH_SEARCH_PATHS = (
353 | "$(inherited)",
354 | "@executable_path/Frameworks",
355 | );
356 | PRODUCT_BUNDLE_IDENTIFIER = "com.vinceshao.swiftui-design-system-demo";
357 | PRODUCT_NAME = "$(TARGET_NAME)";
358 | SWIFT_VERSION = 5.0;
359 | TARGETED_DEVICE_FAMILY = "1,2";
360 | };
361 | name = Debug;
362 | };
363 | 8A519907231ECA6B0053FED4 /* Release */ = {
364 | isa = XCBuildConfiguration;
365 | buildSettings = {
366 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
367 | CODE_SIGN_STYLE = Automatic;
368 | DEVELOPMENT_ASSET_PATHS = "swiftui-design-system-demo/Preview\\ Content";
369 | DEVELOPMENT_TEAM = Z22M485WLJ;
370 | ENABLE_PREVIEWS = YES;
371 | INFOPLIST_FILE = "swiftui-design-system-demo/Info.plist";
372 | LD_RUNPATH_SEARCH_PATHS = (
373 | "$(inherited)",
374 | "@executable_path/Frameworks",
375 | );
376 | PRODUCT_BUNDLE_IDENTIFIER = "com.vinceshao.swiftui-design-system-demo";
377 | PRODUCT_NAME = "$(TARGET_NAME)";
378 | SWIFT_VERSION = 5.0;
379 | TARGETED_DEVICE_FAMILY = "1,2";
380 | };
381 | name = Release;
382 | };
383 | /* End XCBuildConfiguration section */
384 |
385 | /* Begin XCConfigurationList section */
386 | 8A5198EC231ECA690053FED4 /* Build configuration list for PBXProject "swiftui-design-system-demo" */ = {
387 | isa = XCConfigurationList;
388 | buildConfigurations = (
389 | 8A519903231ECA6B0053FED4 /* Debug */,
390 | 8A519904231ECA6B0053FED4 /* Release */,
391 | );
392 | defaultConfigurationIsVisible = 0;
393 | defaultConfigurationName = Release;
394 | };
395 | 8A519905231ECA6B0053FED4 /* Build configuration list for PBXNativeTarget "swiftui-design-system-demo" */ = {
396 | isa = XCConfigurationList;
397 | buildConfigurations = (
398 | 8A519906231ECA6B0053FED4 /* Debug */,
399 | 8A519907231ECA6B0053FED4 /* Release */,
400 | );
401 | defaultConfigurationIsVisible = 0;
402 | defaultConfigurationName = Release;
403 | };
404 | /* End XCConfigurationList section */
405 | };
406 | rootObject = 8A5198E9231ECA690053FED4 /* Project object */;
407 | }
408 |
--------------------------------------------------------------------------------