├── .github
└── workflows
│ └── build.yml
├── .gitignore
├── .swiftlint.yml
├── .swiftpm
└── xcode
│ ├── package.xcworkspace
│ ├── contents.xcworkspacedata
│ └── xcshareddata
│ │ └── IDEWorkspaceChecks.plist
│ └── xcshareddata
│ └── xcschemes
│ └── FigmaKit.xcscheme
├── Example
└── FigmaKitExample
│ ├── .swiftlint.yml
│ ├── FigmaKitExample.xcodeproj
│ ├── project.pbxproj
│ ├── project.xcworkspace
│ │ ├── contents.xcworkspacedata
│ │ └── xcshareddata
│ │ │ └── IDEWorkspaceChecks.plist
│ └── xcshareddata
│ │ └── xcschemes
│ │ └── FigmaKitExample.xcscheme
│ ├── FigmaKitExample
│ ├── AppDelegate.swift
│ ├── Assets.xcassets
│ │ ├── AccentColor.colorset
│ │ │ └── Contents.json
│ │ ├── AppIcon.appiconset
│ │ │ └── Contents.json
│ │ ├── Contents.json
│ │ ├── ic_back.imageset
│ │ │ ├── Contents.json
│ │ │ ├── Vector.png
│ │ │ ├── Vector@2x.png
│ │ │ └── Vector@3x.png
│ │ ├── ic_eye.imageset
│ │ │ ├── Contents.json
│ │ │ ├── Vector.png
│ │ │ ├── Vector@2x.png
│ │ │ └── Vector@3x.png
│ │ ├── ic_facebook.imageset
│ │ │ ├── Contents.json
│ │ │ ├── Slice 2.png
│ │ │ ├── Slice 2@2x.png
│ │ │ └── Slice 2@3x.png
│ │ ├── ic_google.imageset
│ │ │ ├── Contents.json
│ │ │ ├── Slice 2g.png
│ │ │ ├── Slice 2g@2x.png
│ │ │ └── Slice 2g@3x.png
│ │ ├── ic_square.imageset
│ │ │ ├── Contents.json
│ │ │ ├── Rectangle 213.png
│ │ │ ├── Rectangle 213@2x.png
│ │ │ └── Rectangle 213@3x.png
│ │ ├── ic_tick.imageset
│ │ │ ├── Contents.json
│ │ │ ├── Vector 9.png
│ │ │ ├── Vector 9@2x.png
│ │ │ └── Vector 9@3x.png
│ │ ├── ic_ticked.imageset
│ │ │ ├── Contents.json
│ │ │ ├── Group 451.png
│ │ │ ├── Group 451@2x.png
│ │ │ └── Group 451@3x.png
│ │ └── register_bg.imageset
│ │ │ ├── Contents.json
│ │ │ ├── Slice 1.png
│ │ │ ├── Slice 1@2x.png
│ │ │ └── Slice 1@3x.png
│ ├── Base.lproj
│ │ ├── LaunchScreen.storyboard
│ │ └── Main.storyboard
│ ├── Extensions.swift
│ ├── Info.plist
│ ├── RegisterViewController.swift
│ ├── Resources
│ │ └── Fonts
│ │ │ ├── Roboto
│ │ │ ├── Roboto-Black.ttf
│ │ │ ├── Roboto-BlackItalic.ttf
│ │ │ ├── Roboto-Bold.ttf
│ │ │ ├── Roboto-BoldItalic.ttf
│ │ │ ├── Roboto-Italic.ttf
│ │ │ ├── Roboto-Light.ttf
│ │ │ ├── Roboto-LightItalic.ttf
│ │ │ ├── Roboto-Medium.ttf
│ │ │ ├── Roboto-MediumItalic.ttf
│ │ │ ├── Roboto-Regular.ttf
│ │ │ ├── Roboto-Thin.ttf
│ │ │ └── Roboto-ThinItalic.ttf
│ │ │ └── SFPro
│ │ │ ├── SF-Pro-Display-Black.otf
│ │ │ ├── SF-Pro-Display-BlackItalic.otf
│ │ │ ├── SF-Pro-Display-Bold.otf
│ │ │ ├── SF-Pro-Display-BoldItalic.otf
│ │ │ ├── SF-Pro-Display-Heavy.otf
│ │ │ ├── SF-Pro-Display-HeavyItalic.otf
│ │ │ ├── SF-Pro-Display-Light.otf
│ │ │ ├── SF-Pro-Display-LightItalic.otf
│ │ │ ├── SF-Pro-Display-Medium.otf
│ │ │ ├── SF-Pro-Display-MediumItalic.otf
│ │ │ ├── SF-Pro-Display-Regular.otf
│ │ │ ├── SF-Pro-Display-RegularItalic.otf
│ │ │ ├── SF-Pro-Display-Semibold.otf
│ │ │ ├── SF-Pro-Display-SemiboldItalic.otf
│ │ │ ├── SF-Pro-Display-Thin.otf
│ │ │ ├── SF-Pro-Display-ThinItalic.otf
│ │ │ ├── SF-Pro-Display-Ultralight.otf
│ │ │ ├── SF-Pro-Display-UltralightItalic.otf
│ │ │ ├── SF-Pro-Italic.ttf
│ │ │ └── SF-Pro.ttf
│ ├── SceneDelegate.swift
│ └── StartUpViewController.swift
│ ├── FigmaKitExampleTests
│ ├── FigmaKitExampleTests.swift
│ └── Info.plist
│ └── FigmaKitExampleUITests
│ ├── FigmaKitExampleUITests.swift
│ └── Info.plist
├── FigmaKit.xcworkspace
├── contents.xcworkspacedata
└── xcshareddata
│ └── IDEWorkspaceChecks.plist
├── LICENSE
├── Package.swift
├── README.md
├── Resources
├── corners.png
├── design.png
├── figma_design.png
├── fills.png
├── sample1.png
├── screenshot1.png
├── shadows.png
├── simulator.png
├── strokes.png
├── typography1.png
└── typos.png
├── Sources
└── FigmaKit
│ ├── Elements
│ ├── ColorType.swift
│ ├── Edges.swift
│ ├── Font.swift
│ ├── Helpers.swift
│ └── Strings.swift
│ ├── FigmaKit+UIView.swift
│ ├── FigmaKit.swift
│ └── Types
│ ├── Types.swift
│ ├── TypesImplement.swift
│ └── Typography.swift
├── Tests
├── FigmaKitTests
│ ├── ColorTests.swift
│ ├── FigmaKitTests.swift
│ └── XCTestManifests.swift
└── LinuxMain.swift
└── Tools
└── build.sh
/.github/workflows/build.yml:
--------------------------------------------------------------------------------
1 | name: Build
2 |
3 | on:
4 | push:
5 | branches: [ $default-branch ]
6 |
7 | jobs:
8 | build:
9 |
10 | runs-on: macos-latest
11 |
12 | steps:
13 | - uses: actions/checkout
14 | - name: Build
15 | run: swift build
16 | - name: Run tests
17 | run: swift test
18 |
--------------------------------------------------------------------------------
/.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 |
--------------------------------------------------------------------------------
/.swiftlint.yml:
--------------------------------------------------------------------------------
1 | disabled_rules: # rule identifiers to exclude from running
2 | - trailing_whitespace
3 |
--------------------------------------------------------------------------------
/.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/.swiftpm/xcode/package.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/.swiftpm/xcode/xcshareddata/xcschemes/FigmaKit.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
33 |
39 |
40 |
41 |
42 |
43 |
53 |
54 |
60 |
61 |
67 |
68 |
69 |
70 |
72 |
73 |
76 |
77 |
78 |
--------------------------------------------------------------------------------
/Example/FigmaKitExample/.swiftlint.yml:
--------------------------------------------------------------------------------
1 | disabled_rules: # rule identifiers to exclude from running
2 | - trailing_whitespace
3 |
--------------------------------------------------------------------------------
/Example/FigmaKitExample/FigmaKitExample.xcodeproj/project.pbxproj:
--------------------------------------------------------------------------------
1 | // !$*UTF8*$!
2 | {
3 | archiveVersion = 1;
4 | classes = {
5 | };
6 | objectVersion = 52;
7 | objects = {
8 |
9 | /* Begin PBXBuildFile section */
10 | EB3C65AB266A026500CED941 /* RegisterViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = EB3C65AA266A026500CED941 /* RegisterViewController.swift */; };
11 | EB3C65AD266A040D00CED941 /* Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = EB3C65AC266A040D00CED941 /* Extensions.swift */; };
12 | EB9AB1172685A92300589962 /* Roboto-Medium.ttf in Resources */ = {isa = PBXBuildFile; fileRef = EB9AB0DC2685A92300589962 /* Roboto-Medium.ttf */; };
13 | EB9AB1182685A92300589962 /* Roboto-Light.ttf in Resources */ = {isa = PBXBuildFile; fileRef = EB9AB0DD2685A92300589962 /* Roboto-Light.ttf */; };
14 | EB9AB1192685A92300589962 /* Roboto-Regular.ttf in Resources */ = {isa = PBXBuildFile; fileRef = EB9AB0DE2685A92300589962 /* Roboto-Regular.ttf */; };
15 | EB9AB11A2685A92300589962 /* Roboto-MediumItalic.ttf in Resources */ = {isa = PBXBuildFile; fileRef = EB9AB0DF2685A92300589962 /* Roboto-MediumItalic.ttf */; };
16 | EB9AB11B2685A92300589962 /* Roboto-ThinItalic.ttf in Resources */ = {isa = PBXBuildFile; fileRef = EB9AB0E02685A92300589962 /* Roboto-ThinItalic.ttf */; };
17 | EB9AB11C2685A92300589962 /* Roboto-BoldItalic.ttf in Resources */ = {isa = PBXBuildFile; fileRef = EB9AB0E12685A92300589962 /* Roboto-BoldItalic.ttf */; };
18 | EB9AB11D2685A92300589962 /* Roboto-LightItalic.ttf in Resources */ = {isa = PBXBuildFile; fileRef = EB9AB0E22685A92300589962 /* Roboto-LightItalic.ttf */; };
19 | EB9AB11E2685A92300589962 /* Roboto-Italic.ttf in Resources */ = {isa = PBXBuildFile; fileRef = EB9AB0E32685A92300589962 /* Roboto-Italic.ttf */; };
20 | EB9AB11F2685A92300589962 /* Roboto-BlackItalic.ttf in Resources */ = {isa = PBXBuildFile; fileRef = EB9AB0E42685A92300589962 /* Roboto-BlackItalic.ttf */; };
21 | EB9AB1202685A92300589962 /* Roboto-Bold.ttf in Resources */ = {isa = PBXBuildFile; fileRef = EB9AB0E52685A92300589962 /* Roboto-Bold.ttf */; };
22 | EB9AB1212685A92300589962 /* Roboto-Thin.ttf in Resources */ = {isa = PBXBuildFile; fileRef = EB9AB0E62685A92300589962 /* Roboto-Thin.ttf */; };
23 | EB9AB1222685A92300589962 /* Roboto-Black.ttf in Resources */ = {isa = PBXBuildFile; fileRef = EB9AB0E72685A92300589962 /* Roboto-Black.ttf */; };
24 | EB9AB1382685A99600589962 /* SF-Pro-Italic.ttf in Resources */ = {isa = PBXBuildFile; fileRef = EB9AB1242685A99600589962 /* SF-Pro-Italic.ttf */; };
25 | EB9AB1392685A99600589962 /* SF-Pro-Display-Thin.otf in Resources */ = {isa = PBXBuildFile; fileRef = EB9AB1252685A99600589962 /* SF-Pro-Display-Thin.otf */; };
26 | EB9AB13A2685A99600589962 /* SF-Pro-Display-SemiboldItalic.otf in Resources */ = {isa = PBXBuildFile; fileRef = EB9AB1262685A99600589962 /* SF-Pro-Display-SemiboldItalic.otf */; };
27 | EB9AB13B2685A99600589962 /* SF-Pro.ttf in Resources */ = {isa = PBXBuildFile; fileRef = EB9AB1272685A99600589962 /* SF-Pro.ttf */; };
28 | EB9AB13C2685A99600589962 /* SF-Pro-Display-RegularItalic.otf in Resources */ = {isa = PBXBuildFile; fileRef = EB9AB1282685A99600589962 /* SF-Pro-Display-RegularItalic.otf */; };
29 | EB9AB13D2685A99600589962 /* SF-Pro-Display-Light.otf in Resources */ = {isa = PBXBuildFile; fileRef = EB9AB1292685A99600589962 /* SF-Pro-Display-Light.otf */; };
30 | EB9AB13E2685A99600589962 /* SF-Pro-Display-Regular.otf in Resources */ = {isa = PBXBuildFile; fileRef = EB9AB12A2685A99600589962 /* SF-Pro-Display-Regular.otf */; };
31 | EB9AB13F2685A99600589962 /* SF-Pro-Display-Bold.otf in Resources */ = {isa = PBXBuildFile; fileRef = EB9AB12B2685A99600589962 /* SF-Pro-Display-Bold.otf */; };
32 | EB9AB1402685A99600589962 /* SF-Pro-Display-Medium.otf in Resources */ = {isa = PBXBuildFile; fileRef = EB9AB12C2685A99600589962 /* SF-Pro-Display-Medium.otf */; };
33 | EB9AB1412685A99600589962 /* SF-Pro-Display-Heavy.otf in Resources */ = {isa = PBXBuildFile; fileRef = EB9AB12D2685A99600589962 /* SF-Pro-Display-Heavy.otf */; };
34 | EB9AB1422685A99600589962 /* SF-Pro-Display-Semibold.otf in Resources */ = {isa = PBXBuildFile; fileRef = EB9AB12E2685A99600589962 /* SF-Pro-Display-Semibold.otf */; };
35 | EB9AB1432685A99600589962 /* SF-Pro-Display-MediumItalic.otf in Resources */ = {isa = PBXBuildFile; fileRef = EB9AB12F2685A99600589962 /* SF-Pro-Display-MediumItalic.otf */; };
36 | EB9AB1442685A99600589962 /* SF-Pro-Display-HeavyItalic.otf in Resources */ = {isa = PBXBuildFile; fileRef = EB9AB1302685A99600589962 /* SF-Pro-Display-HeavyItalic.otf */; };
37 | EB9AB1452685A99600589962 /* SF-Pro-Display-Ultralight.otf in Resources */ = {isa = PBXBuildFile; fileRef = EB9AB1312685A99600589962 /* SF-Pro-Display-Ultralight.otf */; };
38 | EB9AB1462685A99600589962 /* SF-Pro-Display-UltralightItalic.otf in Resources */ = {isa = PBXBuildFile; fileRef = EB9AB1322685A99600589962 /* SF-Pro-Display-UltralightItalic.otf */; };
39 | EB9AB1472685A99600589962 /* SF-Pro-Display-LightItalic.otf in Resources */ = {isa = PBXBuildFile; fileRef = EB9AB1332685A99600589962 /* SF-Pro-Display-LightItalic.otf */; };
40 | EB9AB1482685A99600589962 /* SF-Pro-Display-BlackItalic.otf in Resources */ = {isa = PBXBuildFile; fileRef = EB9AB1342685A99600589962 /* SF-Pro-Display-BlackItalic.otf */; };
41 | EB9AB1492685A99600589962 /* SF-Pro-Display-Black.otf in Resources */ = {isa = PBXBuildFile; fileRef = EB9AB1352685A99600589962 /* SF-Pro-Display-Black.otf */; };
42 | EB9AB14A2685A99600589962 /* SF-Pro-Display-ThinItalic.otf in Resources */ = {isa = PBXBuildFile; fileRef = EB9AB1362685A99600589962 /* SF-Pro-Display-ThinItalic.otf */; };
43 | EB9AB14B2685A99600589962 /* SF-Pro-Display-BoldItalic.otf in Resources */ = {isa = PBXBuildFile; fileRef = EB9AB1372685A99600589962 /* SF-Pro-Display-BoldItalic.otf */; };
44 | EB9AB14D2685AE9900589962 /* StartUpViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = EB9AB14C2685AE9900589962 /* StartUpViewController.swift */; };
45 | EBAC06652633E9E0004455BC /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = EBAC06642633E9E0004455BC /* AppDelegate.swift */; };
46 | EBAC06672633E9E0004455BC /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = EBAC06662633E9E0004455BC /* SceneDelegate.swift */; };
47 | EBAC066C2633E9E0004455BC /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = EBAC066A2633E9E0004455BC /* Main.storyboard */; };
48 | EBAC066E2633E9E1004455BC /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = EBAC066D2633E9E1004455BC /* Assets.xcassets */; };
49 | EBAC06712633E9E1004455BC /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = EBAC066F2633E9E1004455BC /* LaunchScreen.storyboard */; };
50 | EBAC067C2633E9E1004455BC /* FigmaKitExampleTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = EBAC067B2633E9E1004455BC /* FigmaKitExampleTests.swift */; };
51 | EBAC06872633E9E1004455BC /* FigmaKitExampleUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = EBAC06862633E9E1004455BC /* FigmaKitExampleUITests.swift */; };
52 | EBAC069D2633EBEF004455BC /* FigmaKit in Frameworks */ = {isa = PBXBuildFile; productRef = EBAC069C2633EBEF004455BC /* FigmaKit */; };
53 | /* End PBXBuildFile section */
54 |
55 | /* Begin PBXContainerItemProxy section */
56 | EBAC06782633E9E1004455BC /* PBXContainerItemProxy */ = {
57 | isa = PBXContainerItemProxy;
58 | containerPortal = EBAC06592633E9E0004455BC /* Project object */;
59 | proxyType = 1;
60 | remoteGlobalIDString = EBAC06602633E9E0004455BC;
61 | remoteInfo = FigmaKitExample;
62 | };
63 | EBAC06832633E9E1004455BC /* PBXContainerItemProxy */ = {
64 | isa = PBXContainerItemProxy;
65 | containerPortal = EBAC06592633E9E0004455BC /* Project object */;
66 | proxyType = 1;
67 | remoteGlobalIDString = EBAC06602633E9E0004455BC;
68 | remoteInfo = FigmaKitExample;
69 | };
70 | /* End PBXContainerItemProxy section */
71 |
72 | /* Begin PBXFileReference section */
73 | EB3C65AA266A026500CED941 /* RegisterViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RegisterViewController.swift; sourceTree = ""; };
74 | EB3C65AC266A040D00CED941 /* Extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Extensions.swift; sourceTree = ""; };
75 | EB9AB0DC2685A92300589962 /* Roboto-Medium.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "Roboto-Medium.ttf"; sourceTree = ""; };
76 | EB9AB0DD2685A92300589962 /* Roboto-Light.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "Roboto-Light.ttf"; sourceTree = ""; };
77 | EB9AB0DE2685A92300589962 /* Roboto-Regular.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "Roboto-Regular.ttf"; sourceTree = ""; };
78 | EB9AB0DF2685A92300589962 /* Roboto-MediumItalic.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "Roboto-MediumItalic.ttf"; sourceTree = ""; };
79 | EB9AB0E02685A92300589962 /* Roboto-ThinItalic.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "Roboto-ThinItalic.ttf"; sourceTree = ""; };
80 | EB9AB0E12685A92300589962 /* Roboto-BoldItalic.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "Roboto-BoldItalic.ttf"; sourceTree = ""; };
81 | EB9AB0E22685A92300589962 /* Roboto-LightItalic.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "Roboto-LightItalic.ttf"; sourceTree = ""; };
82 | EB9AB0E32685A92300589962 /* Roboto-Italic.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "Roboto-Italic.ttf"; sourceTree = ""; };
83 | EB9AB0E42685A92300589962 /* Roboto-BlackItalic.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "Roboto-BlackItalic.ttf"; sourceTree = ""; };
84 | EB9AB0E52685A92300589962 /* Roboto-Bold.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "Roboto-Bold.ttf"; sourceTree = ""; };
85 | EB9AB0E62685A92300589962 /* Roboto-Thin.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "Roboto-Thin.ttf"; sourceTree = ""; };
86 | EB9AB0E72685A92300589962 /* Roboto-Black.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "Roboto-Black.ttf"; sourceTree = ""; };
87 | EB9AB1242685A99600589962 /* SF-Pro-Italic.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "SF-Pro-Italic.ttf"; sourceTree = ""; };
88 | EB9AB1252685A99600589962 /* SF-Pro-Display-Thin.otf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "SF-Pro-Display-Thin.otf"; sourceTree = ""; };
89 | EB9AB1262685A99600589962 /* SF-Pro-Display-SemiboldItalic.otf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "SF-Pro-Display-SemiboldItalic.otf"; sourceTree = ""; };
90 | EB9AB1272685A99600589962 /* SF-Pro.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "SF-Pro.ttf"; sourceTree = ""; };
91 | EB9AB1282685A99600589962 /* SF-Pro-Display-RegularItalic.otf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "SF-Pro-Display-RegularItalic.otf"; sourceTree = ""; };
92 | EB9AB1292685A99600589962 /* SF-Pro-Display-Light.otf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "SF-Pro-Display-Light.otf"; sourceTree = ""; };
93 | EB9AB12A2685A99600589962 /* SF-Pro-Display-Regular.otf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "SF-Pro-Display-Regular.otf"; sourceTree = ""; };
94 | EB9AB12B2685A99600589962 /* SF-Pro-Display-Bold.otf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "SF-Pro-Display-Bold.otf"; sourceTree = ""; };
95 | EB9AB12C2685A99600589962 /* SF-Pro-Display-Medium.otf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "SF-Pro-Display-Medium.otf"; sourceTree = ""; };
96 | EB9AB12D2685A99600589962 /* SF-Pro-Display-Heavy.otf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "SF-Pro-Display-Heavy.otf"; sourceTree = ""; };
97 | EB9AB12E2685A99600589962 /* SF-Pro-Display-Semibold.otf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "SF-Pro-Display-Semibold.otf"; sourceTree = ""; };
98 | EB9AB12F2685A99600589962 /* SF-Pro-Display-MediumItalic.otf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "SF-Pro-Display-MediumItalic.otf"; sourceTree = ""; };
99 | EB9AB1302685A99600589962 /* SF-Pro-Display-HeavyItalic.otf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "SF-Pro-Display-HeavyItalic.otf"; sourceTree = ""; };
100 | EB9AB1312685A99600589962 /* SF-Pro-Display-Ultralight.otf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "SF-Pro-Display-Ultralight.otf"; sourceTree = ""; };
101 | EB9AB1322685A99600589962 /* SF-Pro-Display-UltralightItalic.otf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "SF-Pro-Display-UltralightItalic.otf"; sourceTree = ""; };
102 | EB9AB1332685A99600589962 /* SF-Pro-Display-LightItalic.otf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "SF-Pro-Display-LightItalic.otf"; sourceTree = ""; };
103 | EB9AB1342685A99600589962 /* SF-Pro-Display-BlackItalic.otf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "SF-Pro-Display-BlackItalic.otf"; sourceTree = ""; };
104 | EB9AB1352685A99600589962 /* SF-Pro-Display-Black.otf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "SF-Pro-Display-Black.otf"; sourceTree = ""; };
105 | EB9AB1362685A99600589962 /* SF-Pro-Display-ThinItalic.otf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "SF-Pro-Display-ThinItalic.otf"; sourceTree = ""; };
106 | EB9AB1372685A99600589962 /* SF-Pro-Display-BoldItalic.otf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "SF-Pro-Display-BoldItalic.otf"; sourceTree = ""; };
107 | EB9AB14C2685AE9900589962 /* StartUpViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = StartUpViewController.swift; sourceTree = ""; };
108 | EBAC06612633E9E0004455BC /* FigmaKitExample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = FigmaKitExample.app; sourceTree = BUILT_PRODUCTS_DIR; };
109 | EBAC06642633E9E0004455BC /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; };
110 | EBAC06662633E9E0004455BC /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = ""; };
111 | EBAC066B2633E9E0004455BC /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; };
112 | EBAC066D2633E9E1004455BC /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; };
113 | EBAC06702633E9E1004455BC /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; };
114 | EBAC06722633E9E1004455BC /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
115 | EBAC06772633E9E1004455BC /* FigmaKitExampleTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = FigmaKitExampleTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
116 | EBAC067B2633E9E1004455BC /* FigmaKitExampleTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FigmaKitExampleTests.swift; sourceTree = ""; };
117 | EBAC067D2633E9E1004455BC /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
118 | EBAC06822633E9E1004455BC /* FigmaKitExampleUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = FigmaKitExampleUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
119 | EBAC06862633E9E1004455BC /* FigmaKitExampleUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FigmaKitExampleUITests.swift; sourceTree = ""; };
120 | EBAC06882633E9E1004455BC /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
121 | EBAC06972633EA43004455BC /* FigmaKit */ = {isa = PBXFileReference; lastKnownFileType = folder; name = FigmaKit; path = ../..; sourceTree = ""; };
122 | /* End PBXFileReference section */
123 |
124 | /* Begin PBXFrameworksBuildPhase section */
125 | EBAC065E2633E9E0004455BC /* Frameworks */ = {
126 | isa = PBXFrameworksBuildPhase;
127 | buildActionMask = 2147483647;
128 | files = (
129 | EBAC069D2633EBEF004455BC /* FigmaKit in Frameworks */,
130 | );
131 | runOnlyForDeploymentPostprocessing = 0;
132 | };
133 | EBAC06742633E9E1004455BC /* Frameworks */ = {
134 | isa = PBXFrameworksBuildPhase;
135 | buildActionMask = 2147483647;
136 | files = (
137 | );
138 | runOnlyForDeploymentPostprocessing = 0;
139 | };
140 | EBAC067F2633E9E1004455BC /* Frameworks */ = {
141 | isa = PBXFrameworksBuildPhase;
142 | buildActionMask = 2147483647;
143 | files = (
144 | );
145 | runOnlyForDeploymentPostprocessing = 0;
146 | };
147 | /* End PBXFrameworksBuildPhase section */
148 |
149 | /* Begin PBXGroup section */
150 | EB9AB0A92685A92300589962 /* Resources */ = {
151 | isa = PBXGroup;
152 | children = (
153 | EB9AB0AA2685A92300589962 /* Fonts */,
154 | );
155 | path = Resources;
156 | sourceTree = "";
157 | };
158 | EB9AB0AA2685A92300589962 /* Fonts */ = {
159 | isa = PBXGroup;
160 | children = (
161 | EB9AB1232685A99600589962 /* SFPro */,
162 | EB9AB0DB2685A92300589962 /* Roboto */,
163 | );
164 | path = Fonts;
165 | sourceTree = "";
166 | };
167 | EB9AB0DB2685A92300589962 /* Roboto */ = {
168 | isa = PBXGroup;
169 | children = (
170 | EB9AB0DC2685A92300589962 /* Roboto-Medium.ttf */,
171 | EB9AB0DD2685A92300589962 /* Roboto-Light.ttf */,
172 | EB9AB0DE2685A92300589962 /* Roboto-Regular.ttf */,
173 | EB9AB0DF2685A92300589962 /* Roboto-MediumItalic.ttf */,
174 | EB9AB0E02685A92300589962 /* Roboto-ThinItalic.ttf */,
175 | EB9AB0E12685A92300589962 /* Roboto-BoldItalic.ttf */,
176 | EB9AB0E22685A92300589962 /* Roboto-LightItalic.ttf */,
177 | EB9AB0E32685A92300589962 /* Roboto-Italic.ttf */,
178 | EB9AB0E42685A92300589962 /* Roboto-BlackItalic.ttf */,
179 | EB9AB0E52685A92300589962 /* Roboto-Bold.ttf */,
180 | EB9AB0E62685A92300589962 /* Roboto-Thin.ttf */,
181 | EB9AB0E72685A92300589962 /* Roboto-Black.ttf */,
182 | );
183 | path = Roboto;
184 | sourceTree = "";
185 | };
186 | EB9AB1232685A99600589962 /* SFPro */ = {
187 | isa = PBXGroup;
188 | children = (
189 | EB9AB1272685A99600589962 /* SF-Pro.ttf */,
190 | EB9AB1242685A99600589962 /* SF-Pro-Italic.ttf */,
191 | EB9AB1252685A99600589962 /* SF-Pro-Display-Thin.otf */,
192 | EB9AB1262685A99600589962 /* SF-Pro-Display-SemiboldItalic.otf */,
193 | EB9AB1282685A99600589962 /* SF-Pro-Display-RegularItalic.otf */,
194 | EB9AB1292685A99600589962 /* SF-Pro-Display-Light.otf */,
195 | EB9AB12A2685A99600589962 /* SF-Pro-Display-Regular.otf */,
196 | EB9AB12B2685A99600589962 /* SF-Pro-Display-Bold.otf */,
197 | EB9AB12C2685A99600589962 /* SF-Pro-Display-Medium.otf */,
198 | EB9AB12D2685A99600589962 /* SF-Pro-Display-Heavy.otf */,
199 | EB9AB12E2685A99600589962 /* SF-Pro-Display-Semibold.otf */,
200 | EB9AB12F2685A99600589962 /* SF-Pro-Display-MediumItalic.otf */,
201 | EB9AB1302685A99600589962 /* SF-Pro-Display-HeavyItalic.otf */,
202 | EB9AB1312685A99600589962 /* SF-Pro-Display-Ultralight.otf */,
203 | EB9AB1322685A99600589962 /* SF-Pro-Display-UltralightItalic.otf */,
204 | EB9AB1332685A99600589962 /* SF-Pro-Display-LightItalic.otf */,
205 | EB9AB1342685A99600589962 /* SF-Pro-Display-BlackItalic.otf */,
206 | EB9AB1352685A99600589962 /* SF-Pro-Display-Black.otf */,
207 | EB9AB1362685A99600589962 /* SF-Pro-Display-ThinItalic.otf */,
208 | EB9AB1372685A99600589962 /* SF-Pro-Display-BoldItalic.otf */,
209 | );
210 | path = SFPro;
211 | sourceTree = "";
212 | };
213 | EBAC06582633E9E0004455BC = {
214 | isa = PBXGroup;
215 | children = (
216 | EBAC06972633EA43004455BC /* FigmaKit */,
217 | EBAC06632633E9E0004455BC /* FigmaKitExample */,
218 | EBAC067A2633E9E1004455BC /* FigmaKitExampleTests */,
219 | EBAC06852633E9E1004455BC /* FigmaKitExampleUITests */,
220 | EBAC06622633E9E0004455BC /* Products */,
221 | EBAC069B2633EBEF004455BC /* Frameworks */,
222 | );
223 | sourceTree = "";
224 | };
225 | EBAC06622633E9E0004455BC /* Products */ = {
226 | isa = PBXGroup;
227 | children = (
228 | EBAC06612633E9E0004455BC /* FigmaKitExample.app */,
229 | EBAC06772633E9E1004455BC /* FigmaKitExampleTests.xctest */,
230 | EBAC06822633E9E1004455BC /* FigmaKitExampleUITests.xctest */,
231 | );
232 | name = Products;
233 | sourceTree = "";
234 | };
235 | EBAC06632633E9E0004455BC /* FigmaKitExample */ = {
236 | isa = PBXGroup;
237 | children = (
238 | EB9AB0A92685A92300589962 /* Resources */,
239 | EB3C65AC266A040D00CED941 /* Extensions.swift */,
240 | EBAC06642633E9E0004455BC /* AppDelegate.swift */,
241 | EBAC06662633E9E0004455BC /* SceneDelegate.swift */,
242 | EB3C65AA266A026500CED941 /* RegisterViewController.swift */,
243 | EB9AB14C2685AE9900589962 /* StartUpViewController.swift */,
244 | EBAC066A2633E9E0004455BC /* Main.storyboard */,
245 | EBAC066D2633E9E1004455BC /* Assets.xcassets */,
246 | EBAC066F2633E9E1004455BC /* LaunchScreen.storyboard */,
247 | EBAC06722633E9E1004455BC /* Info.plist */,
248 | );
249 | path = FigmaKitExample;
250 | sourceTree = "";
251 | };
252 | EBAC067A2633E9E1004455BC /* FigmaKitExampleTests */ = {
253 | isa = PBXGroup;
254 | children = (
255 | EBAC067B2633E9E1004455BC /* FigmaKitExampleTests.swift */,
256 | EBAC067D2633E9E1004455BC /* Info.plist */,
257 | );
258 | path = FigmaKitExampleTests;
259 | sourceTree = "";
260 | };
261 | EBAC06852633E9E1004455BC /* FigmaKitExampleUITests */ = {
262 | isa = PBXGroup;
263 | children = (
264 | EBAC06862633E9E1004455BC /* FigmaKitExampleUITests.swift */,
265 | EBAC06882633E9E1004455BC /* Info.plist */,
266 | );
267 | path = FigmaKitExampleUITests;
268 | sourceTree = "";
269 | };
270 | EBAC069B2633EBEF004455BC /* Frameworks */ = {
271 | isa = PBXGroup;
272 | children = (
273 | );
274 | name = Frameworks;
275 | sourceTree = "";
276 | };
277 | /* End PBXGroup section */
278 |
279 | /* Begin PBXNativeTarget section */
280 | EBAC06602633E9E0004455BC /* FigmaKitExample */ = {
281 | isa = PBXNativeTarget;
282 | buildConfigurationList = EBAC068B2633E9E1004455BC /* Build configuration list for PBXNativeTarget "FigmaKitExample" */;
283 | buildPhases = (
284 | EBAC065D2633E9E0004455BC /* Sources */,
285 | EBAC065E2633E9E0004455BC /* Frameworks */,
286 | EBAC065F2633E9E0004455BC /* Resources */,
287 | EB590EAF26D768330028B6F0 /* ShellScript */,
288 | );
289 | buildRules = (
290 | );
291 | dependencies = (
292 | );
293 | name = FigmaKitExample;
294 | packageProductDependencies = (
295 | EBAC069C2633EBEF004455BC /* FigmaKit */,
296 | );
297 | productName = FigmaKitExample;
298 | productReference = EBAC06612633E9E0004455BC /* FigmaKitExample.app */;
299 | productType = "com.apple.product-type.application";
300 | };
301 | EBAC06762633E9E1004455BC /* FigmaKitExampleTests */ = {
302 | isa = PBXNativeTarget;
303 | buildConfigurationList = EBAC068E2633E9E1004455BC /* Build configuration list for PBXNativeTarget "FigmaKitExampleTests" */;
304 | buildPhases = (
305 | EBAC06732633E9E1004455BC /* Sources */,
306 | EBAC06742633E9E1004455BC /* Frameworks */,
307 | EBAC06752633E9E1004455BC /* Resources */,
308 | );
309 | buildRules = (
310 | );
311 | dependencies = (
312 | EBAC06792633E9E1004455BC /* PBXTargetDependency */,
313 | );
314 | name = FigmaKitExampleTests;
315 | productName = FigmaKitExampleTests;
316 | productReference = EBAC06772633E9E1004455BC /* FigmaKitExampleTests.xctest */;
317 | productType = "com.apple.product-type.bundle.unit-test";
318 | };
319 | EBAC06812633E9E1004455BC /* FigmaKitExampleUITests */ = {
320 | isa = PBXNativeTarget;
321 | buildConfigurationList = EBAC06912633E9E1004455BC /* Build configuration list for PBXNativeTarget "FigmaKitExampleUITests" */;
322 | buildPhases = (
323 | EBAC067E2633E9E1004455BC /* Sources */,
324 | EBAC067F2633E9E1004455BC /* Frameworks */,
325 | EBAC06802633E9E1004455BC /* Resources */,
326 | );
327 | buildRules = (
328 | );
329 | dependencies = (
330 | EBAC06842633E9E1004455BC /* PBXTargetDependency */,
331 | );
332 | name = FigmaKitExampleUITests;
333 | productName = FigmaKitExampleUITests;
334 | productReference = EBAC06822633E9E1004455BC /* FigmaKitExampleUITests.xctest */;
335 | productType = "com.apple.product-type.bundle.ui-testing";
336 | };
337 | /* End PBXNativeTarget section */
338 |
339 | /* Begin PBXProject section */
340 | EBAC06592633E9E0004455BC /* Project object */ = {
341 | isa = PBXProject;
342 | attributes = {
343 | LastSwiftUpdateCheck = 1240;
344 | LastUpgradeCheck = 1240;
345 | TargetAttributes = {
346 | EBAC06602633E9E0004455BC = {
347 | CreatedOnToolsVersion = 12.4;
348 | };
349 | EBAC06762633E9E1004455BC = {
350 | CreatedOnToolsVersion = 12.4;
351 | TestTargetID = EBAC06602633E9E0004455BC;
352 | };
353 | EBAC06812633E9E1004455BC = {
354 | CreatedOnToolsVersion = 12.4;
355 | TestTargetID = EBAC06602633E9E0004455BC;
356 | };
357 | };
358 | };
359 | buildConfigurationList = EBAC065C2633E9E0004455BC /* Build configuration list for PBXProject "FigmaKitExample" */;
360 | compatibilityVersion = "Xcode 9.3";
361 | developmentRegion = en;
362 | hasScannedForEncodings = 0;
363 | knownRegions = (
364 | en,
365 | Base,
366 | );
367 | mainGroup = EBAC06582633E9E0004455BC;
368 | productRefGroup = EBAC06622633E9E0004455BC /* Products */;
369 | projectDirPath = "";
370 | projectRoot = "";
371 | targets = (
372 | EBAC06602633E9E0004455BC /* FigmaKitExample */,
373 | EBAC06762633E9E1004455BC /* FigmaKitExampleTests */,
374 | EBAC06812633E9E1004455BC /* FigmaKitExampleUITests */,
375 | );
376 | };
377 | /* End PBXProject section */
378 |
379 | /* Begin PBXResourcesBuildPhase section */
380 | EBAC065F2633E9E0004455BC /* Resources */ = {
381 | isa = PBXResourcesBuildPhase;
382 | buildActionMask = 2147483647;
383 | files = (
384 | EB9AB1422685A99600589962 /* SF-Pro-Display-Semibold.otf in Resources */,
385 | EB9AB1402685A99600589962 /* SF-Pro-Display-Medium.otf in Resources */,
386 | EB9AB14A2685A99600589962 /* SF-Pro-Display-ThinItalic.otf in Resources */,
387 | EB9AB1202685A92300589962 /* Roboto-Bold.ttf in Resources */,
388 | EB9AB1222685A92300589962 /* Roboto-Black.ttf in Resources */,
389 | EB9AB1432685A99600589962 /* SF-Pro-Display-MediumItalic.otf in Resources */,
390 | EB9AB11F2685A92300589962 /* Roboto-BlackItalic.ttf in Resources */,
391 | EBAC06712633E9E1004455BC /* LaunchScreen.storyboard in Resources */,
392 | EB9AB1212685A92300589962 /* Roboto-Thin.ttf in Resources */,
393 | EB9AB1412685A99600589962 /* SF-Pro-Display-Heavy.otf in Resources */,
394 | EB9AB1462685A99600589962 /* SF-Pro-Display-UltralightItalic.otf in Resources */,
395 | EB9AB1172685A92300589962 /* Roboto-Medium.ttf in Resources */,
396 | EB9AB1472685A99600589962 /* SF-Pro-Display-LightItalic.otf in Resources */,
397 | EB9AB1182685A92300589962 /* Roboto-Light.ttf in Resources */,
398 | EB9AB13D2685A99600589962 /* SF-Pro-Display-Light.otf in Resources */,
399 | EB9AB1382685A99600589962 /* SF-Pro-Italic.ttf in Resources */,
400 | EB9AB1482685A99600589962 /* SF-Pro-Display-BlackItalic.otf in Resources */,
401 | EB9AB13C2685A99600589962 /* SF-Pro-Display-RegularItalic.otf in Resources */,
402 | EB9AB1452685A99600589962 /* SF-Pro-Display-Ultralight.otf in Resources */,
403 | EB9AB13F2685A99600589962 /* SF-Pro-Display-Bold.otf in Resources */,
404 | EB9AB11B2685A92300589962 /* Roboto-ThinItalic.ttf in Resources */,
405 | EB9AB11C2685A92300589962 /* Roboto-BoldItalic.ttf in Resources */,
406 | EB9AB13E2685A99600589962 /* SF-Pro-Display-Regular.otf in Resources */,
407 | EB9AB1192685A92300589962 /* Roboto-Regular.ttf in Resources */,
408 | EBAC066E2633E9E1004455BC /* Assets.xcassets in Resources */,
409 | EBAC066C2633E9E0004455BC /* Main.storyboard in Resources */,
410 | EB9AB11A2685A92300589962 /* Roboto-MediumItalic.ttf in Resources */,
411 | EB9AB1492685A99600589962 /* SF-Pro-Display-Black.otf in Resources */,
412 | EB9AB13A2685A99600589962 /* SF-Pro-Display-SemiboldItalic.otf in Resources */,
413 | EB9AB1442685A99600589962 /* SF-Pro-Display-HeavyItalic.otf in Resources */,
414 | EB9AB14B2685A99600589962 /* SF-Pro-Display-BoldItalic.otf in Resources */,
415 | EB9AB13B2685A99600589962 /* SF-Pro.ttf in Resources */,
416 | EB9AB11E2685A92300589962 /* Roboto-Italic.ttf in Resources */,
417 | EB9AB1392685A99600589962 /* SF-Pro-Display-Thin.otf in Resources */,
418 | EB9AB11D2685A92300589962 /* Roboto-LightItalic.ttf in Resources */,
419 | );
420 | runOnlyForDeploymentPostprocessing = 0;
421 | };
422 | EBAC06752633E9E1004455BC /* Resources */ = {
423 | isa = PBXResourcesBuildPhase;
424 | buildActionMask = 2147483647;
425 | files = (
426 | );
427 | runOnlyForDeploymentPostprocessing = 0;
428 | };
429 | EBAC06802633E9E1004455BC /* Resources */ = {
430 | isa = PBXResourcesBuildPhase;
431 | buildActionMask = 2147483647;
432 | files = (
433 | );
434 | runOnlyForDeploymentPostprocessing = 0;
435 | };
436 | /* End PBXResourcesBuildPhase section */
437 |
438 | /* Begin PBXShellScriptBuildPhase section */
439 | EB590EAF26D768330028B6F0 /* ShellScript */ = {
440 | isa = PBXShellScriptBuildPhase;
441 | buildActionMask = 2147483647;
442 | files = (
443 | );
444 | inputFileListPaths = (
445 | );
446 | inputPaths = (
447 | );
448 | outputFileListPaths = (
449 | );
450 | outputPaths = (
451 | );
452 | runOnlyForDeploymentPostprocessing = 0;
453 | shellPath = /bin/sh;
454 | shellScript = "# Type a script or drag a script file from your workspace to insert its path.\nif which swiftlint >/dev/null; then\n swiftlint\nelse\n echo \"warning: SwiftLint not installed, download from https://github.com/realm/SwiftLint\"\nfi\n";
455 | };
456 | /* End PBXShellScriptBuildPhase section */
457 |
458 | /* Begin PBXSourcesBuildPhase section */
459 | EBAC065D2633E9E0004455BC /* Sources */ = {
460 | isa = PBXSourcesBuildPhase;
461 | buildActionMask = 2147483647;
462 | files = (
463 | EB9AB14D2685AE9900589962 /* StartUpViewController.swift in Sources */,
464 | EB3C65AD266A040D00CED941 /* Extensions.swift in Sources */,
465 | EBAC06652633E9E0004455BC /* AppDelegate.swift in Sources */,
466 | EBAC06672633E9E0004455BC /* SceneDelegate.swift in Sources */,
467 | EB3C65AB266A026500CED941 /* RegisterViewController.swift in Sources */,
468 | );
469 | runOnlyForDeploymentPostprocessing = 0;
470 | };
471 | EBAC06732633E9E1004455BC /* Sources */ = {
472 | isa = PBXSourcesBuildPhase;
473 | buildActionMask = 2147483647;
474 | files = (
475 | EBAC067C2633E9E1004455BC /* FigmaKitExampleTests.swift in Sources */,
476 | );
477 | runOnlyForDeploymentPostprocessing = 0;
478 | };
479 | EBAC067E2633E9E1004455BC /* Sources */ = {
480 | isa = PBXSourcesBuildPhase;
481 | buildActionMask = 2147483647;
482 | files = (
483 | EBAC06872633E9E1004455BC /* FigmaKitExampleUITests.swift in Sources */,
484 | );
485 | runOnlyForDeploymentPostprocessing = 0;
486 | };
487 | /* End PBXSourcesBuildPhase section */
488 |
489 | /* Begin PBXTargetDependency section */
490 | EBAC06792633E9E1004455BC /* PBXTargetDependency */ = {
491 | isa = PBXTargetDependency;
492 | target = EBAC06602633E9E0004455BC /* FigmaKitExample */;
493 | targetProxy = EBAC06782633E9E1004455BC /* PBXContainerItemProxy */;
494 | };
495 | EBAC06842633E9E1004455BC /* PBXTargetDependency */ = {
496 | isa = PBXTargetDependency;
497 | target = EBAC06602633E9E0004455BC /* FigmaKitExample */;
498 | targetProxy = EBAC06832633E9E1004455BC /* PBXContainerItemProxy */;
499 | };
500 | /* End PBXTargetDependency section */
501 |
502 | /* Begin PBXVariantGroup section */
503 | EBAC066A2633E9E0004455BC /* Main.storyboard */ = {
504 | isa = PBXVariantGroup;
505 | children = (
506 | EBAC066B2633E9E0004455BC /* Base */,
507 | );
508 | name = Main.storyboard;
509 | sourceTree = "";
510 | };
511 | EBAC066F2633E9E1004455BC /* LaunchScreen.storyboard */ = {
512 | isa = PBXVariantGroup;
513 | children = (
514 | EBAC06702633E9E1004455BC /* Base */,
515 | );
516 | name = LaunchScreen.storyboard;
517 | sourceTree = "";
518 | };
519 | /* End PBXVariantGroup section */
520 |
521 | /* Begin XCBuildConfiguration section */
522 | EBAC06892633E9E1004455BC /* Debug */ = {
523 | isa = XCBuildConfiguration;
524 | buildSettings = {
525 | ALWAYS_SEARCH_USER_PATHS = NO;
526 | CLANG_ANALYZER_NONNULL = YES;
527 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
528 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
529 | CLANG_CXX_LIBRARY = "libc++";
530 | CLANG_ENABLE_MODULES = YES;
531 | CLANG_ENABLE_OBJC_ARC = YES;
532 | CLANG_ENABLE_OBJC_WEAK = YES;
533 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
534 | CLANG_WARN_BOOL_CONVERSION = YES;
535 | CLANG_WARN_COMMA = YES;
536 | CLANG_WARN_CONSTANT_CONVERSION = YES;
537 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
538 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
539 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
540 | CLANG_WARN_EMPTY_BODY = YES;
541 | CLANG_WARN_ENUM_CONVERSION = YES;
542 | CLANG_WARN_INFINITE_RECURSION = YES;
543 | CLANG_WARN_INT_CONVERSION = YES;
544 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
545 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
546 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
547 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
548 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
549 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
550 | CLANG_WARN_STRICT_PROTOTYPES = YES;
551 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
552 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
553 | CLANG_WARN_UNREACHABLE_CODE = YES;
554 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
555 | COPY_PHASE_STRIP = NO;
556 | DEBUG_INFORMATION_FORMAT = dwarf;
557 | ENABLE_STRICT_OBJC_MSGSEND = YES;
558 | ENABLE_TESTABILITY = YES;
559 | GCC_C_LANGUAGE_STANDARD = gnu11;
560 | GCC_DYNAMIC_NO_PIC = NO;
561 | GCC_NO_COMMON_BLOCKS = YES;
562 | GCC_OPTIMIZATION_LEVEL = 0;
563 | GCC_PREPROCESSOR_DEFINITIONS = (
564 | "DEBUG=1",
565 | "$(inherited)",
566 | );
567 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
568 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
569 | GCC_WARN_UNDECLARED_SELECTOR = YES;
570 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
571 | GCC_WARN_UNUSED_FUNCTION = YES;
572 | GCC_WARN_UNUSED_VARIABLE = YES;
573 | IPHONEOS_DEPLOYMENT_TARGET = 14.1;
574 | MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
575 | MTL_FAST_MATH = YES;
576 | ONLY_ACTIVE_ARCH = YES;
577 | SDKROOT = iphoneos;
578 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
579 | SWIFT_OPTIMIZATION_LEVEL = "-Onone";
580 | };
581 | name = Debug;
582 | };
583 | EBAC068A2633E9E1004455BC /* Release */ = {
584 | isa = XCBuildConfiguration;
585 | buildSettings = {
586 | ALWAYS_SEARCH_USER_PATHS = NO;
587 | CLANG_ANALYZER_NONNULL = YES;
588 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
589 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
590 | CLANG_CXX_LIBRARY = "libc++";
591 | CLANG_ENABLE_MODULES = YES;
592 | CLANG_ENABLE_OBJC_ARC = YES;
593 | CLANG_ENABLE_OBJC_WEAK = YES;
594 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
595 | CLANG_WARN_BOOL_CONVERSION = YES;
596 | CLANG_WARN_COMMA = YES;
597 | CLANG_WARN_CONSTANT_CONVERSION = YES;
598 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
599 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
600 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
601 | CLANG_WARN_EMPTY_BODY = YES;
602 | CLANG_WARN_ENUM_CONVERSION = YES;
603 | CLANG_WARN_INFINITE_RECURSION = YES;
604 | CLANG_WARN_INT_CONVERSION = YES;
605 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
606 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
607 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
608 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
609 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
610 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
611 | CLANG_WARN_STRICT_PROTOTYPES = YES;
612 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
613 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
614 | CLANG_WARN_UNREACHABLE_CODE = YES;
615 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
616 | COPY_PHASE_STRIP = NO;
617 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
618 | ENABLE_NS_ASSERTIONS = NO;
619 | ENABLE_STRICT_OBJC_MSGSEND = YES;
620 | GCC_C_LANGUAGE_STANDARD = gnu11;
621 | GCC_NO_COMMON_BLOCKS = YES;
622 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
623 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
624 | GCC_WARN_UNDECLARED_SELECTOR = YES;
625 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
626 | GCC_WARN_UNUSED_FUNCTION = YES;
627 | GCC_WARN_UNUSED_VARIABLE = YES;
628 | IPHONEOS_DEPLOYMENT_TARGET = 14.1;
629 | MTL_ENABLE_DEBUG_INFO = NO;
630 | MTL_FAST_MATH = YES;
631 | SDKROOT = iphoneos;
632 | SWIFT_COMPILATION_MODE = wholemodule;
633 | SWIFT_OPTIMIZATION_LEVEL = "-O";
634 | VALIDATE_PRODUCT = YES;
635 | };
636 | name = Release;
637 | };
638 | EBAC068C2633E9E1004455BC /* Debug */ = {
639 | isa = XCBuildConfiguration;
640 | buildSettings = {
641 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
642 | ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
643 | CODE_SIGN_STYLE = Automatic;
644 | DEVELOPMENT_TEAM = V72W5MQP85;
645 | INFOPLIST_FILE = FigmaKitExample/Info.plist;
646 | LD_RUNPATH_SEARCH_PATHS = (
647 | "$(inherited)",
648 | "@executable_path/Frameworks",
649 | );
650 | PRODUCT_BUNDLE_IDENTIFIER = com.soyo.FigmaKitExample;
651 | PRODUCT_NAME = "$(TARGET_NAME)";
652 | SWIFT_VERSION = 5.0;
653 | TARGETED_DEVICE_FAMILY = "1,2";
654 | };
655 | name = Debug;
656 | };
657 | EBAC068D2633E9E1004455BC /* Release */ = {
658 | isa = XCBuildConfiguration;
659 | buildSettings = {
660 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
661 | ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
662 | CODE_SIGN_STYLE = Automatic;
663 | DEVELOPMENT_TEAM = V72W5MQP85;
664 | INFOPLIST_FILE = FigmaKitExample/Info.plist;
665 | LD_RUNPATH_SEARCH_PATHS = (
666 | "$(inherited)",
667 | "@executable_path/Frameworks",
668 | );
669 | PRODUCT_BUNDLE_IDENTIFIER = com.soyo.FigmaKitExample;
670 | PRODUCT_NAME = "$(TARGET_NAME)";
671 | SWIFT_VERSION = 5.0;
672 | TARGETED_DEVICE_FAMILY = "1,2";
673 | };
674 | name = Release;
675 | };
676 | EBAC068F2633E9E1004455BC /* Debug */ = {
677 | isa = XCBuildConfiguration;
678 | buildSettings = {
679 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
680 | BUNDLE_LOADER = "$(TEST_HOST)";
681 | CODE_SIGN_STYLE = Automatic;
682 | DEVELOPMENT_TEAM = V72W5MQP85;
683 | INFOPLIST_FILE = FigmaKitExampleTests/Info.plist;
684 | IPHONEOS_DEPLOYMENT_TARGET = 14.4;
685 | LD_RUNPATH_SEARCH_PATHS = (
686 | "$(inherited)",
687 | "@executable_path/Frameworks",
688 | "@loader_path/Frameworks",
689 | );
690 | PRODUCT_BUNDLE_IDENTIFIER = com.soyo.FigmaKitExampleTests;
691 | PRODUCT_NAME = "$(TARGET_NAME)";
692 | SWIFT_VERSION = 5.0;
693 | TARGETED_DEVICE_FAMILY = "1,2";
694 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/FigmaKitExample.app/FigmaKitExample";
695 | };
696 | name = Debug;
697 | };
698 | EBAC06902633E9E1004455BC /* Release */ = {
699 | isa = XCBuildConfiguration;
700 | buildSettings = {
701 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
702 | BUNDLE_LOADER = "$(TEST_HOST)";
703 | CODE_SIGN_STYLE = Automatic;
704 | DEVELOPMENT_TEAM = V72W5MQP85;
705 | INFOPLIST_FILE = FigmaKitExampleTests/Info.plist;
706 | IPHONEOS_DEPLOYMENT_TARGET = 14.4;
707 | LD_RUNPATH_SEARCH_PATHS = (
708 | "$(inherited)",
709 | "@executable_path/Frameworks",
710 | "@loader_path/Frameworks",
711 | );
712 | PRODUCT_BUNDLE_IDENTIFIER = com.soyo.FigmaKitExampleTests;
713 | PRODUCT_NAME = "$(TARGET_NAME)";
714 | SWIFT_VERSION = 5.0;
715 | TARGETED_DEVICE_FAMILY = "1,2";
716 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/FigmaKitExample.app/FigmaKitExample";
717 | };
718 | name = Release;
719 | };
720 | EBAC06922633E9E1004455BC /* Debug */ = {
721 | isa = XCBuildConfiguration;
722 | buildSettings = {
723 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
724 | CODE_SIGN_STYLE = Automatic;
725 | DEVELOPMENT_TEAM = V72W5MQP85;
726 | INFOPLIST_FILE = FigmaKitExampleUITests/Info.plist;
727 | LD_RUNPATH_SEARCH_PATHS = (
728 | "$(inherited)",
729 | "@executable_path/Frameworks",
730 | "@loader_path/Frameworks",
731 | );
732 | PRODUCT_BUNDLE_IDENTIFIER = com.soyo.FigmaKitExampleUITests;
733 | PRODUCT_NAME = "$(TARGET_NAME)";
734 | SWIFT_VERSION = 5.0;
735 | TARGETED_DEVICE_FAMILY = "1,2";
736 | TEST_TARGET_NAME = FigmaKitExample;
737 | };
738 | name = Debug;
739 | };
740 | EBAC06932633E9E1004455BC /* Release */ = {
741 | isa = XCBuildConfiguration;
742 | buildSettings = {
743 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
744 | CODE_SIGN_STYLE = Automatic;
745 | DEVELOPMENT_TEAM = V72W5MQP85;
746 | INFOPLIST_FILE = FigmaKitExampleUITests/Info.plist;
747 | LD_RUNPATH_SEARCH_PATHS = (
748 | "$(inherited)",
749 | "@executable_path/Frameworks",
750 | "@loader_path/Frameworks",
751 | );
752 | PRODUCT_BUNDLE_IDENTIFIER = com.soyo.FigmaKitExampleUITests;
753 | PRODUCT_NAME = "$(TARGET_NAME)";
754 | SWIFT_VERSION = 5.0;
755 | TARGETED_DEVICE_FAMILY = "1,2";
756 | TEST_TARGET_NAME = FigmaKitExample;
757 | };
758 | name = Release;
759 | };
760 | /* End XCBuildConfiguration section */
761 |
762 | /* Begin XCConfigurationList section */
763 | EBAC065C2633E9E0004455BC /* Build configuration list for PBXProject "FigmaKitExample" */ = {
764 | isa = XCConfigurationList;
765 | buildConfigurations = (
766 | EBAC06892633E9E1004455BC /* Debug */,
767 | EBAC068A2633E9E1004455BC /* Release */,
768 | );
769 | defaultConfigurationIsVisible = 0;
770 | defaultConfigurationName = Release;
771 | };
772 | EBAC068B2633E9E1004455BC /* Build configuration list for PBXNativeTarget "FigmaKitExample" */ = {
773 | isa = XCConfigurationList;
774 | buildConfigurations = (
775 | EBAC068C2633E9E1004455BC /* Debug */,
776 | EBAC068D2633E9E1004455BC /* Release */,
777 | );
778 | defaultConfigurationIsVisible = 0;
779 | defaultConfigurationName = Release;
780 | };
781 | EBAC068E2633E9E1004455BC /* Build configuration list for PBXNativeTarget "FigmaKitExampleTests" */ = {
782 | isa = XCConfigurationList;
783 | buildConfigurations = (
784 | EBAC068F2633E9E1004455BC /* Debug */,
785 | EBAC06902633E9E1004455BC /* Release */,
786 | );
787 | defaultConfigurationIsVisible = 0;
788 | defaultConfigurationName = Release;
789 | };
790 | EBAC06912633E9E1004455BC /* Build configuration list for PBXNativeTarget "FigmaKitExampleUITests" */ = {
791 | isa = XCConfigurationList;
792 | buildConfigurations = (
793 | EBAC06922633E9E1004455BC /* Debug */,
794 | EBAC06932633E9E1004455BC /* Release */,
795 | );
796 | defaultConfigurationIsVisible = 0;
797 | defaultConfigurationName = Release;
798 | };
799 | /* End XCConfigurationList section */
800 |
801 | /* Begin XCSwiftPackageProductDependency section */
802 | EBAC069C2633EBEF004455BC /* FigmaKit */ = {
803 | isa = XCSwiftPackageProductDependency;
804 | productName = FigmaKit;
805 | };
806 | /* End XCSwiftPackageProductDependency section */
807 | };
808 | rootObject = EBAC06592633E9E0004455BC /* Project object */;
809 | }
810 |
--------------------------------------------------------------------------------
/Example/FigmaKitExample/FigmaKitExample.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Example/FigmaKitExample/FigmaKitExample.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/Example/FigmaKitExample/FigmaKitExample.xcodeproj/xcshareddata/xcschemes/FigmaKitExample.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
31 |
32 |
34 |
40 |
41 |
42 |
44 |
50 |
51 |
52 |
53 |
54 |
64 |
66 |
72 |
73 |
74 |
75 |
81 |
83 |
89 |
90 |
91 |
92 |
94 |
95 |
98 |
99 |
100 |
--------------------------------------------------------------------------------
/Example/FigmaKitExample/FigmaKitExample/AppDelegate.swift:
--------------------------------------------------------------------------------
1 | // This is free and unencumbered software released into the public domain.
2 | //
3 | // Anyone is free to copy, modify, publish, use, compile, sell, or
4 | // distribute this software, either in source code form or as a compiled
5 | // binary, for any purpose, commercial or non-commercial, and by any
6 | // means.
7 | //
8 | // In jurisdictions that recognize copyright laws, the author or authors
9 | // of this software dedicate any and all copyright interest in the
10 | // software to the public domain. We make this dedication for the benefit
11 | // of the public at large and to the detriment of our heirs and
12 | // successors. We intend this dedication to be an overt act of
13 | // relinquishment in perpetuity of all present and future rights to this
14 | // software under copyright law.
15 | //
16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19 | // IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
20 | // OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
21 | // ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22 | // OTHER DEALINGS IN THE SOFTWARE.
23 | //
24 | // For more information, please refer to
25 |
26 | import UIKit
27 |
28 | @main
29 | class AppDelegate: UIResponder, UIApplicationDelegate {
30 |
31 | func application(
32 | _ application: UIApplication,
33 | didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
34 | ) -> Bool {
35 | // Override point for customization after application launch.
36 | logFontsNames()
37 | return true
38 | }
39 |
40 | // MARK: UISceneSession Lifecycle
41 |
42 | func application(
43 | _ application: UIApplication,
44 | configurationForConnecting connectingSceneSession: UISceneSession,
45 | options: UIScene.ConnectionOptions
46 | ) -> UISceneConfiguration {
47 | // Called when a new scene session is being created.
48 | // Use this method to select a configuration to create the new scene with.
49 | return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role)
50 | }
51 |
52 | func application(
53 | _ application: UIApplication,
54 | didDiscardSceneSessions sceneSessions: Set
55 | ) {
56 | }
57 |
58 | private func logFontsNames() {
59 | for family in UIFont.familyNames.sorted() {
60 | let names = UIFont.fontNames(forFamilyName: family)
61 | print("Family: \(family) Font names: \(names)")
62 | }
63 | }
64 | }
65 |
--------------------------------------------------------------------------------
/Example/FigmaKitExample/FigmaKitExample/Assets.xcassets/AccentColor.colorset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "colors" : [
3 | {
4 | "idiom" : "universal"
5 | }
6 | ],
7 | "info" : {
8 | "author" : "xcode",
9 | "version" : 1
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/Example/FigmaKitExample/FigmaKitExample/Assets.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "iphone",
5 | "scale" : "2x",
6 | "size" : "20x20"
7 | },
8 | {
9 | "idiom" : "iphone",
10 | "scale" : "3x",
11 | "size" : "20x20"
12 | },
13 | {
14 | "idiom" : "iphone",
15 | "scale" : "2x",
16 | "size" : "29x29"
17 | },
18 | {
19 | "idiom" : "iphone",
20 | "scale" : "3x",
21 | "size" : "29x29"
22 | },
23 | {
24 | "idiom" : "iphone",
25 | "scale" : "2x",
26 | "size" : "40x40"
27 | },
28 | {
29 | "idiom" : "iphone",
30 | "scale" : "3x",
31 | "size" : "40x40"
32 | },
33 | {
34 | "idiom" : "iphone",
35 | "scale" : "2x",
36 | "size" : "60x60"
37 | },
38 | {
39 | "idiom" : "iphone",
40 | "scale" : "3x",
41 | "size" : "60x60"
42 | },
43 | {
44 | "idiom" : "ipad",
45 | "scale" : "1x",
46 | "size" : "20x20"
47 | },
48 | {
49 | "idiom" : "ipad",
50 | "scale" : "2x",
51 | "size" : "20x20"
52 | },
53 | {
54 | "idiom" : "ipad",
55 | "scale" : "1x",
56 | "size" : "29x29"
57 | },
58 | {
59 | "idiom" : "ipad",
60 | "scale" : "2x",
61 | "size" : "29x29"
62 | },
63 | {
64 | "idiom" : "ipad",
65 | "scale" : "1x",
66 | "size" : "40x40"
67 | },
68 | {
69 | "idiom" : "ipad",
70 | "scale" : "2x",
71 | "size" : "40x40"
72 | },
73 | {
74 | "idiom" : "ipad",
75 | "scale" : "1x",
76 | "size" : "76x76"
77 | },
78 | {
79 | "idiom" : "ipad",
80 | "scale" : "2x",
81 | "size" : "76x76"
82 | },
83 | {
84 | "idiom" : "ipad",
85 | "scale" : "2x",
86 | "size" : "83.5x83.5"
87 | },
88 | {
89 | "idiom" : "ios-marketing",
90 | "scale" : "1x",
91 | "size" : "1024x1024"
92 | }
93 | ],
94 | "info" : {
95 | "author" : "xcode",
96 | "version" : 1
97 | }
98 | }
99 |
--------------------------------------------------------------------------------
/Example/FigmaKitExample/FigmaKitExample/Assets.xcassets/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "info" : {
3 | "author" : "xcode",
4 | "version" : 1
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/Example/FigmaKitExample/FigmaKitExample/Assets.xcassets/ic_back.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "filename" : "Vector.png",
5 | "idiom" : "universal",
6 | "scale" : "1x"
7 | },
8 | {
9 | "filename" : "Vector@2x.png",
10 | "idiom" : "universal",
11 | "scale" : "2x"
12 | },
13 | {
14 | "filename" : "Vector@3x.png",
15 | "idiom" : "universal",
16 | "scale" : "3x"
17 | }
18 | ],
19 | "info" : {
20 | "author" : "xcode",
21 | "version" : 1
22 | },
23 | "properties" : {
24 | "template-rendering-intent" : "original"
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/Example/FigmaKitExample/FigmaKitExample/Assets.xcassets/ic_back.imageset/Vector.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/haphanquang/FigmaKit/4297a1d43ce823e89bd7913e1d1396de7aad82f8/Example/FigmaKitExample/FigmaKitExample/Assets.xcassets/ic_back.imageset/Vector.png
--------------------------------------------------------------------------------
/Example/FigmaKitExample/FigmaKitExample/Assets.xcassets/ic_back.imageset/Vector@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/haphanquang/FigmaKit/4297a1d43ce823e89bd7913e1d1396de7aad82f8/Example/FigmaKitExample/FigmaKitExample/Assets.xcassets/ic_back.imageset/Vector@2x.png
--------------------------------------------------------------------------------
/Example/FigmaKitExample/FigmaKitExample/Assets.xcassets/ic_back.imageset/Vector@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/haphanquang/FigmaKit/4297a1d43ce823e89bd7913e1d1396de7aad82f8/Example/FigmaKitExample/FigmaKitExample/Assets.xcassets/ic_back.imageset/Vector@3x.png
--------------------------------------------------------------------------------
/Example/FigmaKitExample/FigmaKitExample/Assets.xcassets/ic_eye.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "filename" : "Vector.png",
5 | "idiom" : "universal",
6 | "scale" : "1x"
7 | },
8 | {
9 | "filename" : "Vector@2x.png",
10 | "idiom" : "universal",
11 | "scale" : "2x"
12 | },
13 | {
14 | "filename" : "Vector@3x.png",
15 | "idiom" : "universal",
16 | "scale" : "3x"
17 | }
18 | ],
19 | "info" : {
20 | "author" : "xcode",
21 | "version" : 1
22 | },
23 | "properties" : {
24 | "template-rendering-intent" : "original"
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/Example/FigmaKitExample/FigmaKitExample/Assets.xcassets/ic_eye.imageset/Vector.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/haphanquang/FigmaKit/4297a1d43ce823e89bd7913e1d1396de7aad82f8/Example/FigmaKitExample/FigmaKitExample/Assets.xcassets/ic_eye.imageset/Vector.png
--------------------------------------------------------------------------------
/Example/FigmaKitExample/FigmaKitExample/Assets.xcassets/ic_eye.imageset/Vector@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/haphanquang/FigmaKit/4297a1d43ce823e89bd7913e1d1396de7aad82f8/Example/FigmaKitExample/FigmaKitExample/Assets.xcassets/ic_eye.imageset/Vector@2x.png
--------------------------------------------------------------------------------
/Example/FigmaKitExample/FigmaKitExample/Assets.xcassets/ic_eye.imageset/Vector@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/haphanquang/FigmaKit/4297a1d43ce823e89bd7913e1d1396de7aad82f8/Example/FigmaKitExample/FigmaKitExample/Assets.xcassets/ic_eye.imageset/Vector@3x.png
--------------------------------------------------------------------------------
/Example/FigmaKitExample/FigmaKitExample/Assets.xcassets/ic_facebook.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "filename" : "Slice 2.png",
5 | "idiom" : "universal",
6 | "scale" : "1x"
7 | },
8 | {
9 | "filename" : "Slice 2@2x.png",
10 | "idiom" : "universal",
11 | "scale" : "2x"
12 | },
13 | {
14 | "filename" : "Slice 2@3x.png",
15 | "idiom" : "universal",
16 | "scale" : "3x"
17 | }
18 | ],
19 | "info" : {
20 | "author" : "xcode",
21 | "version" : 1
22 | },
23 | "properties" : {
24 | "template-rendering-intent" : "original"
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/Example/FigmaKitExample/FigmaKitExample/Assets.xcassets/ic_facebook.imageset/Slice 2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/haphanquang/FigmaKit/4297a1d43ce823e89bd7913e1d1396de7aad82f8/Example/FigmaKitExample/FigmaKitExample/Assets.xcassets/ic_facebook.imageset/Slice 2.png
--------------------------------------------------------------------------------
/Example/FigmaKitExample/FigmaKitExample/Assets.xcassets/ic_facebook.imageset/Slice 2@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/haphanquang/FigmaKit/4297a1d43ce823e89bd7913e1d1396de7aad82f8/Example/FigmaKitExample/FigmaKitExample/Assets.xcassets/ic_facebook.imageset/Slice 2@2x.png
--------------------------------------------------------------------------------
/Example/FigmaKitExample/FigmaKitExample/Assets.xcassets/ic_facebook.imageset/Slice 2@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/haphanquang/FigmaKit/4297a1d43ce823e89bd7913e1d1396de7aad82f8/Example/FigmaKitExample/FigmaKitExample/Assets.xcassets/ic_facebook.imageset/Slice 2@3x.png
--------------------------------------------------------------------------------
/Example/FigmaKitExample/FigmaKitExample/Assets.xcassets/ic_google.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "filename" : "Slice 2g.png",
5 | "idiom" : "universal",
6 | "scale" : "1x"
7 | },
8 | {
9 | "filename" : "Slice 2g@2x.png",
10 | "idiom" : "universal",
11 | "scale" : "2x"
12 | },
13 | {
14 | "filename" : "Slice 2g@3x.png",
15 | "idiom" : "universal",
16 | "scale" : "3x"
17 | }
18 | ],
19 | "info" : {
20 | "author" : "xcode",
21 | "version" : 1
22 | },
23 | "properties" : {
24 | "template-rendering-intent" : "original"
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/Example/FigmaKitExample/FigmaKitExample/Assets.xcassets/ic_google.imageset/Slice 2g.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/haphanquang/FigmaKit/4297a1d43ce823e89bd7913e1d1396de7aad82f8/Example/FigmaKitExample/FigmaKitExample/Assets.xcassets/ic_google.imageset/Slice 2g.png
--------------------------------------------------------------------------------
/Example/FigmaKitExample/FigmaKitExample/Assets.xcassets/ic_google.imageset/Slice 2g@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/haphanquang/FigmaKit/4297a1d43ce823e89bd7913e1d1396de7aad82f8/Example/FigmaKitExample/FigmaKitExample/Assets.xcassets/ic_google.imageset/Slice 2g@2x.png
--------------------------------------------------------------------------------
/Example/FigmaKitExample/FigmaKitExample/Assets.xcassets/ic_google.imageset/Slice 2g@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/haphanquang/FigmaKit/4297a1d43ce823e89bd7913e1d1396de7aad82f8/Example/FigmaKitExample/FigmaKitExample/Assets.xcassets/ic_google.imageset/Slice 2g@3x.png
--------------------------------------------------------------------------------
/Example/FigmaKitExample/FigmaKitExample/Assets.xcassets/ic_square.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "filename" : "Rectangle 213.png",
5 | "idiom" : "universal",
6 | "scale" : "1x"
7 | },
8 | {
9 | "filename" : "Rectangle 213@2x.png",
10 | "idiom" : "universal",
11 | "scale" : "2x"
12 | },
13 | {
14 | "filename" : "Rectangle 213@3x.png",
15 | "idiom" : "universal",
16 | "scale" : "3x"
17 | }
18 | ],
19 | "info" : {
20 | "author" : "xcode",
21 | "version" : 1
22 | },
23 | "properties" : {
24 | "template-rendering-intent" : "original"
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/Example/FigmaKitExample/FigmaKitExample/Assets.xcassets/ic_square.imageset/Rectangle 213.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/haphanquang/FigmaKit/4297a1d43ce823e89bd7913e1d1396de7aad82f8/Example/FigmaKitExample/FigmaKitExample/Assets.xcassets/ic_square.imageset/Rectangle 213.png
--------------------------------------------------------------------------------
/Example/FigmaKitExample/FigmaKitExample/Assets.xcassets/ic_square.imageset/Rectangle 213@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/haphanquang/FigmaKit/4297a1d43ce823e89bd7913e1d1396de7aad82f8/Example/FigmaKitExample/FigmaKitExample/Assets.xcassets/ic_square.imageset/Rectangle 213@2x.png
--------------------------------------------------------------------------------
/Example/FigmaKitExample/FigmaKitExample/Assets.xcassets/ic_square.imageset/Rectangle 213@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/haphanquang/FigmaKit/4297a1d43ce823e89bd7913e1d1396de7aad82f8/Example/FigmaKitExample/FigmaKitExample/Assets.xcassets/ic_square.imageset/Rectangle 213@3x.png
--------------------------------------------------------------------------------
/Example/FigmaKitExample/FigmaKitExample/Assets.xcassets/ic_tick.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "filename" : "Vector 9.png",
5 | "idiom" : "universal",
6 | "scale" : "1x"
7 | },
8 | {
9 | "filename" : "Vector 9@2x.png",
10 | "idiom" : "universal",
11 | "scale" : "2x"
12 | },
13 | {
14 | "filename" : "Vector 9@3x.png",
15 | "idiom" : "universal",
16 | "scale" : "3x"
17 | }
18 | ],
19 | "info" : {
20 | "author" : "xcode",
21 | "version" : 1
22 | },
23 | "properties" : {
24 | "template-rendering-intent" : "original"
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/Example/FigmaKitExample/FigmaKitExample/Assets.xcassets/ic_tick.imageset/Vector 9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/haphanquang/FigmaKit/4297a1d43ce823e89bd7913e1d1396de7aad82f8/Example/FigmaKitExample/FigmaKitExample/Assets.xcassets/ic_tick.imageset/Vector 9.png
--------------------------------------------------------------------------------
/Example/FigmaKitExample/FigmaKitExample/Assets.xcassets/ic_tick.imageset/Vector 9@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/haphanquang/FigmaKit/4297a1d43ce823e89bd7913e1d1396de7aad82f8/Example/FigmaKitExample/FigmaKitExample/Assets.xcassets/ic_tick.imageset/Vector 9@2x.png
--------------------------------------------------------------------------------
/Example/FigmaKitExample/FigmaKitExample/Assets.xcassets/ic_tick.imageset/Vector 9@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/haphanquang/FigmaKit/4297a1d43ce823e89bd7913e1d1396de7aad82f8/Example/FigmaKitExample/FigmaKitExample/Assets.xcassets/ic_tick.imageset/Vector 9@3x.png
--------------------------------------------------------------------------------
/Example/FigmaKitExample/FigmaKitExample/Assets.xcassets/ic_ticked.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "filename" : "Group 451.png",
5 | "idiom" : "universal",
6 | "scale" : "1x"
7 | },
8 | {
9 | "filename" : "Group 451@2x.png",
10 | "idiom" : "universal",
11 | "scale" : "2x"
12 | },
13 | {
14 | "filename" : "Group 451@3x.png",
15 | "idiom" : "universal",
16 | "scale" : "3x"
17 | }
18 | ],
19 | "info" : {
20 | "author" : "xcode",
21 | "version" : 1
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/Example/FigmaKitExample/FigmaKitExample/Assets.xcassets/ic_ticked.imageset/Group 451.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/haphanquang/FigmaKit/4297a1d43ce823e89bd7913e1d1396de7aad82f8/Example/FigmaKitExample/FigmaKitExample/Assets.xcassets/ic_ticked.imageset/Group 451.png
--------------------------------------------------------------------------------
/Example/FigmaKitExample/FigmaKitExample/Assets.xcassets/ic_ticked.imageset/Group 451@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/haphanquang/FigmaKit/4297a1d43ce823e89bd7913e1d1396de7aad82f8/Example/FigmaKitExample/FigmaKitExample/Assets.xcassets/ic_ticked.imageset/Group 451@2x.png
--------------------------------------------------------------------------------
/Example/FigmaKitExample/FigmaKitExample/Assets.xcassets/ic_ticked.imageset/Group 451@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/haphanquang/FigmaKit/4297a1d43ce823e89bd7913e1d1396de7aad82f8/Example/FigmaKitExample/FigmaKitExample/Assets.xcassets/ic_ticked.imageset/Group 451@3x.png
--------------------------------------------------------------------------------
/Example/FigmaKitExample/FigmaKitExample/Assets.xcassets/register_bg.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "filename" : "Slice 1.png",
5 | "idiom" : "universal",
6 | "scale" : "1x"
7 | },
8 | {
9 | "filename" : "Slice 1@2x.png",
10 | "idiom" : "universal",
11 | "scale" : "2x"
12 | },
13 | {
14 | "filename" : "Slice 1@3x.png",
15 | "idiom" : "universal",
16 | "scale" : "3x"
17 | }
18 | ],
19 | "info" : {
20 | "author" : "xcode",
21 | "version" : 1
22 | },
23 | "properties" : {
24 | "template-rendering-intent" : "original"
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/Example/FigmaKitExample/FigmaKitExample/Assets.xcassets/register_bg.imageset/Slice 1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/haphanquang/FigmaKit/4297a1d43ce823e89bd7913e1d1396de7aad82f8/Example/FigmaKitExample/FigmaKitExample/Assets.xcassets/register_bg.imageset/Slice 1.png
--------------------------------------------------------------------------------
/Example/FigmaKitExample/FigmaKitExample/Assets.xcassets/register_bg.imageset/Slice 1@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/haphanquang/FigmaKit/4297a1d43ce823e89bd7913e1d1396de7aad82f8/Example/FigmaKitExample/FigmaKitExample/Assets.xcassets/register_bg.imageset/Slice 1@2x.png
--------------------------------------------------------------------------------
/Example/FigmaKitExample/FigmaKitExample/Assets.xcassets/register_bg.imageset/Slice 1@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/haphanquang/FigmaKit/4297a1d43ce823e89bd7913e1d1396de7aad82f8/Example/FigmaKitExample/FigmaKitExample/Assets.xcassets/register_bg.imageset/Slice 1@3x.png
--------------------------------------------------------------------------------
/Example/FigmaKitExample/FigmaKitExample/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 |
--------------------------------------------------------------------------------
/Example/FigmaKitExample/FigmaKitExample/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 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
--------------------------------------------------------------------------------
/Example/FigmaKitExample/FigmaKitExample/Extensions.swift:
--------------------------------------------------------------------------------
1 | // This is free and unencumbered software released into the public domain.
2 | //
3 | // Anyone is free to copy, modify, publish, use, compile, sell, or
4 | // distribute this software, either in source code form or as a compiled
5 | // binary, for any purpose, commercial or non-commercial, and by any
6 | // means.
7 | //
8 | // In jurisdictions that recognize copyright laws, the author or authors
9 | // of this software dedicate any and all copyright interest in the
10 | // software to the public domain. We make this dedication for the benefit
11 | // of the public at large and to the detriment of our heirs and
12 | // successors. We intend this dedication to be an overt act of
13 | // relinquishment in perpetuity of all present and future rights to this
14 | // software under copyright law.
15 | //
16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19 | // IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
20 | // OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
21 | // ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22 | // OTHER DEALINGS IN THE SOFTWARE.
23 | //
24 | // For more information, please refer to
25 |
26 | import Foundation
27 | import UIKit
28 |
29 | public extension UIStackView {
30 | static func vStack(spacing space: CGFloat = .zero) -> UIStackView {
31 | let stack = UIStackView()
32 | stack.axis = .vertical
33 | stack.spacing = space
34 | return stack
35 | }
36 | static func hStack(spacing space: CGFloat = .zero) -> UIStackView {
37 | let stack = UIStackView()
38 | stack.axis = .horizontal
39 | stack.spacing = space
40 | return stack
41 | }
42 |
43 | func addSpacer() {
44 | self.addArrangedSubview(UIView())
45 | }
46 | }
47 |
48 | public extension UIView {
49 | static func hLine(_ width: CGFloat = 0.5) -> UIView {
50 | let view = UIView()
51 | view.backgroundColor = UIColor.lightGray
52 | NSLayoutConstraint.activate([
53 | view.heightAnchor.constraint(equalToConstant: width)
54 | ])
55 | return view
56 | }
57 | static func vLine(_ width: CGFloat = 0.5) -> UIView {
58 | let view = UIView()
59 | view.backgroundColor = UIColor.lightGray
60 | NSLayoutConstraint.activate([
61 | view.widthAnchor.constraint(equalToConstant: width)
62 | ])
63 | return view
64 | }
65 |
66 | func addFilledSubview(_ subview: UIView) {
67 | self.addSubview(subview)
68 | subview.translatesAutoresizingMaskIntoConstraints = false
69 | NSLayoutConstraint.activate([
70 | subview.leadingAnchor.constraint(equalTo: self.leadingAnchor),
71 | subview.trailingAnchor.constraint(equalTo: self.trailingAnchor),
72 | subview.topAnchor.constraint(equalTo: self.topAnchor),
73 | subview.bottomAnchor.constraint(equalTo: self.bottomAnchor)
74 | ])
75 | }
76 |
77 | func addAutoHeightSubview(_ subview: UIView) {
78 | self.addSubview(subview)
79 | subview.translatesAutoresizingMaskIntoConstraints = false
80 | NSLayoutConstraint.activate([
81 | subview.leadingAnchor.constraint(equalTo: self.leadingAnchor),
82 | subview.trailingAnchor.constraint(equalTo: self.trailingAnchor),
83 | subview.topAnchor.constraint(equalTo: self.topAnchor)
84 | ])
85 | }
86 |
87 | func addAutoWidthSubview(_ subview: UIView) {
88 | self.addSubview(subview)
89 | subview.translatesAutoresizingMaskIntoConstraints = false
90 | NSLayoutConstraint.activate([
91 | subview.topAnchor.constraint(equalTo: self.topAnchor),
92 | subview.bottomAnchor.constraint(equalTo: self.bottomAnchor),
93 | subview.leadingAnchor.constraint(equalTo: self.leadingAnchor)
94 | ])
95 | }
96 | }
97 |
--------------------------------------------------------------------------------
/Example/FigmaKitExample/FigmaKitExample/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 | UISceneStoryboardFile
37 | Main
38 |
39 |
40 |
41 |
42 | UIApplicationSupportsIndirectInputEvents
43 |
44 | UIAppFonts
45 |
46 | Roboto-Regular.ttf
47 | Roboto-Thin.ttf
48 | Roboto-Light.ttf
49 | Roboto-Medium.ttf
50 | Roboto-Bold.ttf
51 | Roboto-Black.ttf
52 | Roboto-Italic.ttf
53 | Roboto-ThinItalic.ttf
54 | Roboto-LightItalic.ttf
55 | Roboto-MediumItalic.ttf
56 | Roboto-BoldItalic.ttf
57 | Roboto-BlackItalic.ttf
58 | SF-Pro.ttf
59 | SF-Pro-Display-Black.otf
60 | SF-Pro-Display-BlackItalic.otf
61 | SF-Pro-Display-Bold.otf
62 | SF-Pro-Display-BoldItalic.otf
63 | SF-Pro-Display-Heavy.otf
64 | SF-Pro-Display-HeavyItalic.otf
65 | SF-Pro-Display-Light.otf
66 | SF-Pro-Display-LightItalic.otf
67 | SF-Pro-Display-Medium.otf
68 | SF-Pro-Display-MediumItalic.otf
69 | SF-Pro-Display-Regular.otf
70 | SF-Pro-Display-RegularItalic.otf
71 | SF-Pro-Display-Semibold.otf
72 | SF-Pro-Display-SemiboldItalic.otf
73 | SF-Pro-Display-Thin.otf
74 | SF-Pro-Display-ThinItalic.otf
75 | SF-Pro-Display-Ultralight.otf
76 | SF-Pro-Display-UltralightItalic.otf
77 | SF-Pro-Italic.ttf
78 |
79 | UILaunchStoryboardName
80 | LaunchScreen
81 | UIMainStoryboardFile
82 | Main
83 | UIRequiredDeviceCapabilities
84 |
85 | armv7
86 |
87 | UISupportedInterfaceOrientations
88 |
89 | UIInterfaceOrientationPortrait
90 | UIInterfaceOrientationLandscapeLeft
91 | UIInterfaceOrientationLandscapeRight
92 |
93 | UISupportedInterfaceOrientations~ipad
94 |
95 | UIInterfaceOrientationPortrait
96 | UIInterfaceOrientationPortraitUpsideDown
97 | UIInterfaceOrientationLandscapeLeft
98 | UIInterfaceOrientationLandscapeRight
99 |
100 |
101 |
102 |
--------------------------------------------------------------------------------
/Example/FigmaKitExample/FigmaKitExample/RegisterViewController.swift:
--------------------------------------------------------------------------------
1 | // This is free and unencumbered software released into the public domain.
2 | //
3 | // Anyone is free to copy, modify, publish, use, compile, sell, or
4 | // distribute this software, either in source code form or as a compiled
5 | // binary, for any purpose, commercial or non-commercial, and by any
6 | // means.
7 | //
8 | // In jurisdictions that recognize copyright laws, the author or authors
9 | // of this software dedicate any and all copyright interest in the
10 | // software to the public domain. We make this dedication for the benefit
11 | // of the public at large and to the detriment of our heirs and
12 | // successors. We intend this dedication to be an overt act of
13 | // relinquishment in perpetuity of all present and future rights to this
14 | // software under copyright law.
15 | //
16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19 | // IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
20 | // OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
21 | // ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22 | // OTHER DEALINGS IN THE SOFTWARE.
23 | //
24 | // For more information, please refer to
25 |
26 | import Foundation
27 | import UIKit
28 | import FigmaKit
29 |
30 | class RegisterViewController: UIViewController {
31 | private(set) var imgBackground = UIImageView()
32 | private(set) var btnBack = UIButton(type: .system)
33 | private(set) var lblTitle = UILabel()
34 | private(set) var btnFacebook = DefaultButton(type: .system)
35 | private(set) var btnGoogle = DefaultButton(type: .system)
36 | private(set) var lblOr = UILabel()
37 | private(set) var tfUsername = InputField()
38 | private(set) var tfEmail = InputField()
39 | private(set) var tfPassword = InputField()
40 | private(set) var lblPrivacy = UILabel()
41 | private(set) var btnTick = UIButton()
42 | private(set) var btnGetStarted = DefaultButton(type: .system)
43 |
44 | private(set) var scrollView = UIScrollView()
45 |
46 | private let mainStack = UIStackView.vStack(spacing: 30)
47 | private let barStack = UIStackView.hStack()
48 | private let contentStack = UIStackView.vStack(spacing: 35)
49 | private let snsStack = UIStackView.vStack(spacing: 20)
50 | private let inputStack = UIStackView.vStack(spacing: 20)
51 | private let policyStack = UIStackView.hStack()
52 |
53 | private var ticked: Bool = false
54 |
55 | override func viewDidLoad() {
56 | super.viewDidLoad()
57 | configViews()
58 | setupLayout()
59 | setupTextFields()
60 | setupLabels()
61 | setupButtons()
62 | }
63 |
64 | override func viewWillAppear(_ animated: Bool) {
65 | super.viewWillAppear(animated)
66 | registerNotifications()
67 | }
68 |
69 | override func viewDidDisappear(_ animated: Bool) {
70 | super.viewDidDisappear(animated)
71 | scrollView.contentInset.bottom = 0
72 | }
73 |
74 | private func configViews() {
75 | view.backgroundColor = .white
76 | imgBackground.image = UIImage(named: "register_bg")
77 | scrollView.showsVerticalScrollIndicator = false
78 | scrollView.keyboardDismissMode = .interactive
79 | }
80 |
81 | private func setupLayout() {
82 | view.addAutoHeightSubview(imgBackground)
83 | view.addFilledSubview(mainStack)
84 |
85 | mainStack.layoutMargins = .init(20)
86 | mainStack.isLayoutMarginsRelativeArrangement = true
87 |
88 | mainStack.addArrangedSubview(barStack)
89 | barStack.addArrangedSubview(btnBack)
90 | NSLayoutConstraint.activate([
91 | btnBack.widthAnchor.constraint(equalToConstant: 56),
92 | btnBack.heightAnchor.constraint(equalToConstant: 56)
93 | ])
94 | barStack.addSpacer()
95 |
96 | mainStack.addArrangedSubview(scrollView)
97 |
98 | scrollView.addFilledSubview(contentStack)
99 | NSLayoutConstraint.activate([
100 | contentStack.widthAnchor.constraint(equalTo: scrollView.widthAnchor)
101 | ])
102 |
103 | contentStack.addArrangedSubview(lblTitle)
104 | contentStack.addArrangedSubview(snsStack)
105 | snsStack.addArrangedSubview(btnFacebook)
106 | snsStack.addArrangedSubview(btnGoogle)
107 |
108 | contentStack.addArrangedSubview(lblOr)
109 | contentStack.addArrangedSubview(inputStack)
110 | inputStack.addArrangedSubview(tfUsername)
111 | inputStack.addArrangedSubview(tfEmail)
112 | inputStack.addArrangedSubview(tfPassword)
113 | inputStack.addArrangedSubview(policyStack)
114 |
115 | policyStack.addArrangedSubview(lblPrivacy)
116 | policyStack.addSpacer()
117 | policyStack.addArrangedSubview(btnTick)
118 |
119 | mainStack.addArrangedSubview(btnGetStarted)
120 | }
121 |
122 | private func setupTextFields() {
123 | tfUsername.borderStyle = .none
124 | tfUsername
125 | .fill(.solid(0xF2F3F7))
126 | .corner(.all(15))
127 | .rightIcon = UIImage(named: "ic_tick")
128 | tfUsername.text = "afsar"
129 |
130 | tfEmail.borderStyle = .none
131 | tfEmail
132 | .fill(.solid(0xF2F3F7))
133 | .corner(.all(15))
134 | .rightIcon = UIImage(named: "ic_tick")
135 | tfEmail.text = "imshuvo97@gmail.com"
136 |
137 | tfPassword.borderStyle = .none
138 | tfPassword
139 | .fill(.solid(0xF2F3F7))
140 | .corner(.all(15))
141 | .rightIcon = UIImage(named: "ic_eye")
142 | tfPassword.text = "password"
143 |
144 | tfPassword.isSecureTextEntry = true
145 | }
146 |
147 | private func setupLabels() {
148 | lblTitle.typography(.system(weight: 700, style: .normal, size: 28, lineHeight: 37.8))
149 | .content("Create your account")
150 | .color(0x3F414E)
151 | lblTitle.textAlignment = .center
152 |
153 | lblOr.typography(.system(weight: 700, style: .normal, size: 14, lineHeight: 15.13, letter: 0.5))
154 | .content("OR LOG IN WITH EMAIL")
155 | .color(0xA1A4B2)
156 | lblOr.textAlignment = .center
157 |
158 | lblPrivacy
159 | .setDefault(.system(weight: 400, style: .normal, size: 14, lineHeight: 15.13, letter: 0.5), color: 0xA1A4B2)
160 | .add("i have read the ")
161 | .add("Privacy policy", color: 0x7583CA)
162 | .cleanUp()
163 | .numberOfLines = 1
164 | }
165 |
166 | private func setupButtons() {
167 | btnBack.setImage(UIImage(named: "ic_back"), for: .normal)
168 | btnBack.corner(.all(28)).stroke(.inside(0xEBEAEC, size: 1))
169 |
170 | btnFacebook
171 | .corner(.all(31))
172 | .fill(.solid(0x7583CA))
173 |
174 | btnFacebook.setTitleColor(0xF6F1FB.color, for: .normal)
175 | btnFacebook.setTitle("CONTINUE WITH FACEBOOK", for: .normal)
176 | btnFacebook.titleLabel?.typography(
177 | .system(
178 | weight: 400,
179 | style: .normal,
180 | size: 14,
181 | lineHeight: 15.13,
182 | letter: 0.5
183 | )
184 | )
185 | btnFacebook.contentEdgeInsets = .init(top: 18, left: 0, bottom: 18, right: 0)
186 | btnFacebook.setImage(UIImage(named: "ic_facebook"))
187 |
188 | btnGoogle
189 | .corner(.all(31))
190 | .stroke(.inside(0xEBEAEC, size: 1))
191 | btnGoogle.setTitleColor(0x3F414E.color, for: .normal)
192 | btnGoogle.setTitle("CONTINUE WITH GOOGLE", for: .normal)
193 | btnGoogle.titleLabel?.typography(.system(weight: 400, style: .normal, size: 14, lineHeight: 15.13, letter: 0.5))
194 | btnGoogle.contentEdgeInsets = .init(top: 18, left: 0, bottom: 18, right: 0)
195 | btnGoogle.setImage(UIImage(named: "ic_google"))
196 |
197 | btnGetStarted
198 | .corner(.all(31))
199 | .fill(.solid(0x8E97FD))
200 | .setTitleColor(0xF6F1FB.color, for: .normal)
201 |
202 | btnGetStarted.setTitle("GET STARTED", for: .normal)
203 | btnTick.setImage(UIImage(named: "ic_square"), for: .normal)
204 | btnTick.addTarget(self, action: #selector(tickMe), for: .touchUpInside)
205 | btnBack.addTarget(self, action: #selector(pop), for: .touchUpInside)
206 | }
207 |
208 | @objc
209 | private func pop() {
210 | self.navigationController?.popViewController(animated: true)
211 | }
212 |
213 | @objc
214 | private func tickMe() {
215 | ticked.toggle()
216 | if ticked {
217 | btnTick.setImage(UIImage(named: "ic_ticked"), for: .normal)
218 | } else {
219 | btnTick.setImage(UIImage(named: "ic_square"), for: .normal)
220 | }
221 | }
222 |
223 | private func registerNotifications() {
224 | NotificationCenter.default.addObserver(
225 | self,
226 | selector: #selector(keyboardWillShow),
227 | name: UIResponder.keyboardWillShowNotification, object: nil
228 | )
229 | NotificationCenter.default.addObserver(
230 | self,
231 | selector: #selector(keyboardWillHide),
232 | name: UIResponder.keyboardWillHideNotification, object: nil
233 | )
234 | }
235 |
236 | @objc
237 | private func keyboardWillShow(notification: NSNotification) {
238 | guard
239 | let keyboardFrame = notification.userInfo![UIResponder.keyboardFrameEndUserInfoKey] as? NSValue
240 | else { return }
241 | let adjustedHeight = contentStack
242 | .convert(keyboardFrame.cgRectValue, from: nil)
243 | .size
244 | .height - btnGetStarted.frame.height - mainStack.spacing
245 | scrollView.contentInset.bottom = adjustedHeight
246 | }
247 |
248 | @objc
249 | private func keyboardWillHide(notification: NSNotification) {
250 | scrollView.contentInset.bottom = 0
251 | }
252 | }
253 |
254 | class InputField: UITextField {
255 | var rightIcon: UIImage? {
256 | didSet {
257 | self.rightViewMode = .always
258 | self.rightView = UIImageView(image: rightIcon)
259 | }
260 | }
261 |
262 | override func textRect(forBounds bounds: CGRect) -> CGRect {
263 | return bounds.insetBy(dx: 20, dy: 20)
264 | }
265 | override func editingRect(forBounds bounds: CGRect) -> CGRect {
266 | return bounds.insetBy(dx: 20, dy: 20)
267 | }
268 |
269 | override func rightViewRect(forBounds bounds: CGRect) -> CGRect {
270 | var rect = super.rightViewRect(forBounds: bounds)
271 | rect.origin.x -= 27
272 | return rect
273 | }
274 | }
275 |
276 | class DefaultButton: UIButton {
277 | override var intrinsicContentSize: CGSize {
278 | return CGSize(width: super.intrinsicContentSize.width, height: 62)
279 | }
280 |
281 | @discardableResult
282 | func setImage(_ image: UIImage?) -> Self {
283 | if let image = image {
284 | self.imageView?.contentMode = .center
285 | self.setImage(image, for: .normal)
286 |
287 | self.imageEdgeInsets = UIEdgeInsets(top: 0, left: 20, bottom: 0, right: 20)
288 | self.contentHorizontalAlignment = .left
289 | self.titleEdgeInsets.left = (
290 | frame.width - (imageEdgeInsets.left + imageView!.frame.width) - titleLabel!.frame.width
291 | ) / 2
292 |
293 | bringSubviewToFront(self.imageView!)
294 | }
295 | return self
296 | }
297 | }
298 |
--------------------------------------------------------------------------------
/Example/FigmaKitExample/FigmaKitExample/Resources/Fonts/Roboto/Roboto-Black.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/haphanquang/FigmaKit/4297a1d43ce823e89bd7913e1d1396de7aad82f8/Example/FigmaKitExample/FigmaKitExample/Resources/Fonts/Roboto/Roboto-Black.ttf
--------------------------------------------------------------------------------
/Example/FigmaKitExample/FigmaKitExample/Resources/Fonts/Roboto/Roboto-BlackItalic.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/haphanquang/FigmaKit/4297a1d43ce823e89bd7913e1d1396de7aad82f8/Example/FigmaKitExample/FigmaKitExample/Resources/Fonts/Roboto/Roboto-BlackItalic.ttf
--------------------------------------------------------------------------------
/Example/FigmaKitExample/FigmaKitExample/Resources/Fonts/Roboto/Roboto-Bold.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/haphanquang/FigmaKit/4297a1d43ce823e89bd7913e1d1396de7aad82f8/Example/FigmaKitExample/FigmaKitExample/Resources/Fonts/Roboto/Roboto-Bold.ttf
--------------------------------------------------------------------------------
/Example/FigmaKitExample/FigmaKitExample/Resources/Fonts/Roboto/Roboto-BoldItalic.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/haphanquang/FigmaKit/4297a1d43ce823e89bd7913e1d1396de7aad82f8/Example/FigmaKitExample/FigmaKitExample/Resources/Fonts/Roboto/Roboto-BoldItalic.ttf
--------------------------------------------------------------------------------
/Example/FigmaKitExample/FigmaKitExample/Resources/Fonts/Roboto/Roboto-Italic.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/haphanquang/FigmaKit/4297a1d43ce823e89bd7913e1d1396de7aad82f8/Example/FigmaKitExample/FigmaKitExample/Resources/Fonts/Roboto/Roboto-Italic.ttf
--------------------------------------------------------------------------------
/Example/FigmaKitExample/FigmaKitExample/Resources/Fonts/Roboto/Roboto-Light.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/haphanquang/FigmaKit/4297a1d43ce823e89bd7913e1d1396de7aad82f8/Example/FigmaKitExample/FigmaKitExample/Resources/Fonts/Roboto/Roboto-Light.ttf
--------------------------------------------------------------------------------
/Example/FigmaKitExample/FigmaKitExample/Resources/Fonts/Roboto/Roboto-LightItalic.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/haphanquang/FigmaKit/4297a1d43ce823e89bd7913e1d1396de7aad82f8/Example/FigmaKitExample/FigmaKitExample/Resources/Fonts/Roboto/Roboto-LightItalic.ttf
--------------------------------------------------------------------------------
/Example/FigmaKitExample/FigmaKitExample/Resources/Fonts/Roboto/Roboto-Medium.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/haphanquang/FigmaKit/4297a1d43ce823e89bd7913e1d1396de7aad82f8/Example/FigmaKitExample/FigmaKitExample/Resources/Fonts/Roboto/Roboto-Medium.ttf
--------------------------------------------------------------------------------
/Example/FigmaKitExample/FigmaKitExample/Resources/Fonts/Roboto/Roboto-MediumItalic.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/haphanquang/FigmaKit/4297a1d43ce823e89bd7913e1d1396de7aad82f8/Example/FigmaKitExample/FigmaKitExample/Resources/Fonts/Roboto/Roboto-MediumItalic.ttf
--------------------------------------------------------------------------------
/Example/FigmaKitExample/FigmaKitExample/Resources/Fonts/Roboto/Roboto-Regular.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/haphanquang/FigmaKit/4297a1d43ce823e89bd7913e1d1396de7aad82f8/Example/FigmaKitExample/FigmaKitExample/Resources/Fonts/Roboto/Roboto-Regular.ttf
--------------------------------------------------------------------------------
/Example/FigmaKitExample/FigmaKitExample/Resources/Fonts/Roboto/Roboto-Thin.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/haphanquang/FigmaKit/4297a1d43ce823e89bd7913e1d1396de7aad82f8/Example/FigmaKitExample/FigmaKitExample/Resources/Fonts/Roboto/Roboto-Thin.ttf
--------------------------------------------------------------------------------
/Example/FigmaKitExample/FigmaKitExample/Resources/Fonts/Roboto/Roboto-ThinItalic.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/haphanquang/FigmaKit/4297a1d43ce823e89bd7913e1d1396de7aad82f8/Example/FigmaKitExample/FigmaKitExample/Resources/Fonts/Roboto/Roboto-ThinItalic.ttf
--------------------------------------------------------------------------------
/Example/FigmaKitExample/FigmaKitExample/Resources/Fonts/SFPro/SF-Pro-Display-Black.otf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/haphanquang/FigmaKit/4297a1d43ce823e89bd7913e1d1396de7aad82f8/Example/FigmaKitExample/FigmaKitExample/Resources/Fonts/SFPro/SF-Pro-Display-Black.otf
--------------------------------------------------------------------------------
/Example/FigmaKitExample/FigmaKitExample/Resources/Fonts/SFPro/SF-Pro-Display-BlackItalic.otf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/haphanquang/FigmaKit/4297a1d43ce823e89bd7913e1d1396de7aad82f8/Example/FigmaKitExample/FigmaKitExample/Resources/Fonts/SFPro/SF-Pro-Display-BlackItalic.otf
--------------------------------------------------------------------------------
/Example/FigmaKitExample/FigmaKitExample/Resources/Fonts/SFPro/SF-Pro-Display-Bold.otf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/haphanquang/FigmaKit/4297a1d43ce823e89bd7913e1d1396de7aad82f8/Example/FigmaKitExample/FigmaKitExample/Resources/Fonts/SFPro/SF-Pro-Display-Bold.otf
--------------------------------------------------------------------------------
/Example/FigmaKitExample/FigmaKitExample/Resources/Fonts/SFPro/SF-Pro-Display-BoldItalic.otf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/haphanquang/FigmaKit/4297a1d43ce823e89bd7913e1d1396de7aad82f8/Example/FigmaKitExample/FigmaKitExample/Resources/Fonts/SFPro/SF-Pro-Display-BoldItalic.otf
--------------------------------------------------------------------------------
/Example/FigmaKitExample/FigmaKitExample/Resources/Fonts/SFPro/SF-Pro-Display-Heavy.otf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/haphanquang/FigmaKit/4297a1d43ce823e89bd7913e1d1396de7aad82f8/Example/FigmaKitExample/FigmaKitExample/Resources/Fonts/SFPro/SF-Pro-Display-Heavy.otf
--------------------------------------------------------------------------------
/Example/FigmaKitExample/FigmaKitExample/Resources/Fonts/SFPro/SF-Pro-Display-HeavyItalic.otf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/haphanquang/FigmaKit/4297a1d43ce823e89bd7913e1d1396de7aad82f8/Example/FigmaKitExample/FigmaKitExample/Resources/Fonts/SFPro/SF-Pro-Display-HeavyItalic.otf
--------------------------------------------------------------------------------
/Example/FigmaKitExample/FigmaKitExample/Resources/Fonts/SFPro/SF-Pro-Display-Light.otf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/haphanquang/FigmaKit/4297a1d43ce823e89bd7913e1d1396de7aad82f8/Example/FigmaKitExample/FigmaKitExample/Resources/Fonts/SFPro/SF-Pro-Display-Light.otf
--------------------------------------------------------------------------------
/Example/FigmaKitExample/FigmaKitExample/Resources/Fonts/SFPro/SF-Pro-Display-LightItalic.otf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/haphanquang/FigmaKit/4297a1d43ce823e89bd7913e1d1396de7aad82f8/Example/FigmaKitExample/FigmaKitExample/Resources/Fonts/SFPro/SF-Pro-Display-LightItalic.otf
--------------------------------------------------------------------------------
/Example/FigmaKitExample/FigmaKitExample/Resources/Fonts/SFPro/SF-Pro-Display-Medium.otf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/haphanquang/FigmaKit/4297a1d43ce823e89bd7913e1d1396de7aad82f8/Example/FigmaKitExample/FigmaKitExample/Resources/Fonts/SFPro/SF-Pro-Display-Medium.otf
--------------------------------------------------------------------------------
/Example/FigmaKitExample/FigmaKitExample/Resources/Fonts/SFPro/SF-Pro-Display-MediumItalic.otf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/haphanquang/FigmaKit/4297a1d43ce823e89bd7913e1d1396de7aad82f8/Example/FigmaKitExample/FigmaKitExample/Resources/Fonts/SFPro/SF-Pro-Display-MediumItalic.otf
--------------------------------------------------------------------------------
/Example/FigmaKitExample/FigmaKitExample/Resources/Fonts/SFPro/SF-Pro-Display-Regular.otf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/haphanquang/FigmaKit/4297a1d43ce823e89bd7913e1d1396de7aad82f8/Example/FigmaKitExample/FigmaKitExample/Resources/Fonts/SFPro/SF-Pro-Display-Regular.otf
--------------------------------------------------------------------------------
/Example/FigmaKitExample/FigmaKitExample/Resources/Fonts/SFPro/SF-Pro-Display-RegularItalic.otf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/haphanquang/FigmaKit/4297a1d43ce823e89bd7913e1d1396de7aad82f8/Example/FigmaKitExample/FigmaKitExample/Resources/Fonts/SFPro/SF-Pro-Display-RegularItalic.otf
--------------------------------------------------------------------------------
/Example/FigmaKitExample/FigmaKitExample/Resources/Fonts/SFPro/SF-Pro-Display-Semibold.otf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/haphanquang/FigmaKit/4297a1d43ce823e89bd7913e1d1396de7aad82f8/Example/FigmaKitExample/FigmaKitExample/Resources/Fonts/SFPro/SF-Pro-Display-Semibold.otf
--------------------------------------------------------------------------------
/Example/FigmaKitExample/FigmaKitExample/Resources/Fonts/SFPro/SF-Pro-Display-SemiboldItalic.otf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/haphanquang/FigmaKit/4297a1d43ce823e89bd7913e1d1396de7aad82f8/Example/FigmaKitExample/FigmaKitExample/Resources/Fonts/SFPro/SF-Pro-Display-SemiboldItalic.otf
--------------------------------------------------------------------------------
/Example/FigmaKitExample/FigmaKitExample/Resources/Fonts/SFPro/SF-Pro-Display-Thin.otf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/haphanquang/FigmaKit/4297a1d43ce823e89bd7913e1d1396de7aad82f8/Example/FigmaKitExample/FigmaKitExample/Resources/Fonts/SFPro/SF-Pro-Display-Thin.otf
--------------------------------------------------------------------------------
/Example/FigmaKitExample/FigmaKitExample/Resources/Fonts/SFPro/SF-Pro-Display-ThinItalic.otf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/haphanquang/FigmaKit/4297a1d43ce823e89bd7913e1d1396de7aad82f8/Example/FigmaKitExample/FigmaKitExample/Resources/Fonts/SFPro/SF-Pro-Display-ThinItalic.otf
--------------------------------------------------------------------------------
/Example/FigmaKitExample/FigmaKitExample/Resources/Fonts/SFPro/SF-Pro-Display-Ultralight.otf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/haphanquang/FigmaKit/4297a1d43ce823e89bd7913e1d1396de7aad82f8/Example/FigmaKitExample/FigmaKitExample/Resources/Fonts/SFPro/SF-Pro-Display-Ultralight.otf
--------------------------------------------------------------------------------
/Example/FigmaKitExample/FigmaKitExample/Resources/Fonts/SFPro/SF-Pro-Display-UltralightItalic.otf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/haphanquang/FigmaKit/4297a1d43ce823e89bd7913e1d1396de7aad82f8/Example/FigmaKitExample/FigmaKitExample/Resources/Fonts/SFPro/SF-Pro-Display-UltralightItalic.otf
--------------------------------------------------------------------------------
/Example/FigmaKitExample/FigmaKitExample/Resources/Fonts/SFPro/SF-Pro-Italic.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/haphanquang/FigmaKit/4297a1d43ce823e89bd7913e1d1396de7aad82f8/Example/FigmaKitExample/FigmaKitExample/Resources/Fonts/SFPro/SF-Pro-Italic.ttf
--------------------------------------------------------------------------------
/Example/FigmaKitExample/FigmaKitExample/Resources/Fonts/SFPro/SF-Pro.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/haphanquang/FigmaKit/4297a1d43ce823e89bd7913e1d1396de7aad82f8/Example/FigmaKitExample/FigmaKitExample/Resources/Fonts/SFPro/SF-Pro.ttf
--------------------------------------------------------------------------------
/Example/FigmaKitExample/FigmaKitExample/SceneDelegate.swift:
--------------------------------------------------------------------------------
1 | // This is free and unencumbered software released into the public domain.
2 | //
3 | // Anyone is free to copy, modify, publish, use, compile, sell, or
4 | // distribute this software, either in source code form or as a compiled
5 | // binary, for any purpose, commercial or non-commercial, and by any
6 | // means.
7 | //
8 | // In jurisdictions that recognize copyright laws, the author or authors
9 | // of this software dedicate any and all copyright interest in the
10 | // software to the public domain. We make this dedication for the benefit
11 | // of the public at large and to the detriment of our heirs and
12 | // successors. We intend this dedication to be an overt act of
13 | // relinquishment in perpetuity of all present and future rights to this
14 | // software under copyright law.
15 | //
16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19 | // IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
20 | // OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
21 | // ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22 | // OTHER DEALINGS IN THE SOFTWARE.
23 | //
24 | // For more information, please refer to
25 |
26 | import UIKit
27 |
28 | class SceneDelegate: UIResponder, UIWindowSceneDelegate {
29 | var window: UIWindow?
30 |
31 | func scene(
32 | _ scene: UIScene,
33 | willConnectTo session: UISceneSession,
34 | options connectionOptions: UIScene.ConnectionOptions
35 | ) {
36 | guard (scene as? UIWindowScene) != nil else { return }
37 | }
38 |
39 | func sceneDidDisconnect(_ scene: UIScene) {
40 | }
41 |
42 | func sceneDidBecomeActive(_ scene: UIScene) {
43 | // Called when the scene has moved from an inactive state to an active state.
44 | // Use this method to restart any tasks that were paused (or not yet started) when the scene was inactive.
45 | }
46 |
47 | func sceneWillResignActive(_ scene: UIScene) {
48 | // Called when the scene will move from an active state to an inactive state.
49 | // This may occur due to temporary interruptions (ex. an incoming phone call).
50 | }
51 |
52 | func sceneWillEnterForeground(_ scene: UIScene) {
53 | // Called as the scene transitions from the background to the foreground.
54 | // Use this method to undo the changes made on entering the background.
55 | }
56 |
57 | func sceneDidEnterBackground(_ scene: UIScene) {
58 | // Called as the scene transitions from the foreground to the background.
59 | // Use this method to save data, release shared resources, and store enough scene-specific state information
60 | // to restore the scene back to its current state.
61 | }
62 | }
63 |
--------------------------------------------------------------------------------
/Example/FigmaKitExample/FigmaKitExample/StartUpViewController.swift:
--------------------------------------------------------------------------------
1 | // This is free and unencumbered software released into the public domain.
2 | //
3 | // Anyone is free to copy, modify, publish, use, compile, sell, or
4 | // distribute this software, either in source code form or as a compiled
5 | // binary, for any purpose, commercial or non-commercial, and by any
6 | // means.
7 | //
8 | // In jurisdictions that recognize copyright laws, the author or authors
9 | // of this software dedicate any and all copyright interest in the
10 | // software to the public domain. We make this dedication for the benefit
11 | // of the public at large and to the detriment of our heirs and
12 | // successors. We intend this dedication to be an overt act of
13 | // relinquishment in perpetuity of all present and future rights to this
14 | // software under copyright law.
15 | //
16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19 | // IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
20 | // OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
21 | // ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22 | // OTHER DEALINGS IN THE SOFTWARE.
23 | //
24 | // For more information, please refer to
25 |
26 | import UIKit
27 | import FigmaKit
28 |
29 | class StartUpViewController: UIViewController {
30 | private var sampleLabel = UILabel()
31 | private var codeLabel = UILabel()
32 | private var topView = UIView()
33 | private var bottomView = UIView()
34 | private var sampleButton = UIButton(type: .system)
35 |
36 | override func viewDidLoad() {
37 | super.viewDidLoad()
38 | // Do any additional setup after loading the view.
39 | layoutSampleViews()
40 | configViews()
41 | applyRichText()
42 | applySample()
43 | }
44 |
45 | func configViews() {
46 | sampleButton.setTitle("Register 👈🏻", for: .normal)
47 | sampleButton.addTarget(self, action: #selector(buttonDidTap(_:)), for: .touchUpInside)
48 | codeLabel.text = "9000 1234 5678 1234"
49 |
50 | navigationController?.navigationBar.isHidden = true
51 | navigationController?.interactivePopGestureRecognizer?.delegate = self
52 | }
53 |
54 | func applySample() {
55 | topView
56 | .corner(.mixed(20, 50, 0, 50))
57 | .fill(.linear(colors: [(0xEBEBEB, 0), (0x9EE505, 1)], alpha: 90))
58 | .stroke(.inside("#FFFFFF".alpha(90), size: 5))
59 | .shadow(.drop(0x000000, x: 0, y: 4, b: 4, s: 0, alpha: 25))
60 |
61 | bottomView
62 | .corner(.mixed(0, 0, 5, 5))
63 | .fill(.solid(0xFFFFFF, 50))
64 | .stroke(.outside(0x11111, size: 1))
65 |
66 | sampleButton
67 | .corner(.all(12))
68 | .shadow(.drop(0x000000, x: 0, y: 4, b: 4, s: 0, alpha: 25))
69 | .padding(.init(16))
70 | .tint(0xFFFFFF)
71 | .fill(
72 | .linear(
73 | colors: [(0x9EE505, 0),
74 | (0xFFAABB, 1)],
75 | start: .init(x: 0.5, y: 0),
76 | end: .init(x: 0.5, y: 1)
77 | )
78 | )
79 | .stroke(.center("#FFFFFF", size: 1))
80 | .typography(.custom("Roboto", weight: 900, style: .normal, size: 20, letter: 0))
81 |
82 | view.fill(.solid("#GGFFAA"))
83 | }
84 |
85 | func applyRichText() {
86 | let normal = Typography.custom("Roboto", weight: 400, size: 16, lineHeight: 21, letter: 1)
87 | let bold = Typography.custom("Roboto", weight: 700, style: .normal, size: 20)
88 |
89 | let foreground = 0x000000
90 | let green = 0x00FF00
91 | let grey = 0xCCCCCC
92 |
93 | sampleLabel
94 |
95 | // Mark default style
96 | .setDefault(normal, color: foreground)
97 |
98 | .add("Lorem", typography: bold, color: grey)
99 | .add(" ipsum dolor sit", typography: normal, color: green)
100 | .add(" amet ")
101 | .add("consectetur adipiscing elit", style: .underlined)
102 | .add(", sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. \n")
103 | .add("Ut enim ad minim veniam", style: .strikeThrough)
104 | .add(" quis nostrud ", typography: bold, color: foreground, background: green)
105 | .add("exercitation", style: .link("https://google.com"))
106 | .add(" ullamco laboris nisi ut aliquip ex ea commodo ")
107 | .add("consequat.", typography: bold, color: grey)
108 |
109 | // Label-wide applying should be done finally
110 | .alignment(.left)
111 |
112 | // Don't forget to clean for next use
113 | .cleanUp()
114 |
115 | let typo = Typography.custom(
116 | "Roboto",
117 | weight: 500,
118 | style: .italic,
119 | size: 13,
120 | lineHeight: 15.23,
121 | letter: 2)
122 |
123 | codeLabel
124 | .typography(typo)
125 | .alignment(.center)
126 | }
127 |
128 | func layoutSampleViews() {
129 | let stack = UIStackView()
130 | stack.axis = .vertical
131 | stack.spacing = 24
132 |
133 | stack.translatesAutoresizingMaskIntoConstraints = false
134 | stack.layoutMargins = .init(top: 10, left: 10, bottom: 10, right: 10)
135 | stack.isLayoutMarginsRelativeArrangement = true
136 |
137 | stack.addArrangedSubview(topView)
138 | stack.addArrangedSubview(sampleLabel)
139 | stack.addArrangedSubview(codeLabel)
140 | stack.addArrangedSubview(bottomView)
141 | stack.addArrangedSubview(sampleButton)
142 |
143 | view.addSubview(stack)
144 |
145 | NSLayoutConstraint.activate([
146 | topView.heightAnchor.constraint(equalToConstant: 100),
147 | bottomView.heightAnchor.constraint(equalToConstant: 30),
148 | stack.leadingAnchor.constraint(equalTo: view.leadingAnchor),
149 | stack.trailingAnchor.constraint(equalTo: view.trailingAnchor),
150 | stack.centerYAnchor.constraint(equalTo: view.centerYAnchor)
151 | ])
152 | }
153 |
154 | @objc func buttonDidTap(_ sender: UIButton) {
155 | print(sender)
156 | showRegisterVC()
157 | }
158 |
159 | private func showRegisterVC() {
160 | let registerViewController = RegisterViewController()
161 | self.navigationController?.pushViewController(registerViewController, animated: true)
162 | }
163 | }
164 |
165 | extension StartUpViewController: UIGestureRecognizerDelegate {
166 | func gestureRecognizerShouldBegin(_ gestureRecognizer: UIGestureRecognizer) -> Bool {
167 | if let navVc = navigationController {
168 | return navVc.viewControllers.count > 1
169 | }
170 | return false
171 | }
172 | }
173 |
--------------------------------------------------------------------------------
/Example/FigmaKitExample/FigmaKitExampleTests/FigmaKitExampleTests.swift:
--------------------------------------------------------------------------------
1 | // This is free and unencumbered software released into the public domain.
2 | //
3 | // Anyone is free to copy, modify, publish, use, compile, sell, or
4 | // distribute this software, either in source code form or as a compiled
5 | // binary, for any purpose, commercial or non-commercial, and by any
6 | // means.
7 | //
8 | // In jurisdictions that recognize copyright laws, the author or authors
9 | // of this software dedicate any and all copyright interest in the
10 | // software to the public domain. We make this dedication for the benefit
11 | // of the public at large and to the detriment of our heirs and
12 | // successors. We intend this dedication to be an overt act of
13 | // relinquishment in perpetuity of all present and future rights to this
14 | // software under copyright law.
15 | //
16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19 | // IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
20 | // OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
21 | // ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22 | // OTHER DEALINGS IN THE SOFTWARE.
23 | //
24 | // For more information, please refer to
25 |
26 | import XCTest
27 | @testable import FigmaKitExample
28 |
29 | class FigmaKitExampleTests: XCTestCase {
30 |
31 | override func setUpWithError() throws {
32 | // Put setup code here. This method is called before the invocation of each test method in the class.
33 | }
34 |
35 | override func tearDownWithError() throws {
36 | // Put teardown code here. This method is called after the invocation of each test method in the class.
37 | }
38 |
39 | func testExample() throws {
40 | // This is an example of a functional test case.
41 | // Use XCTAssert and related functions to verify your tests produce the correct results.
42 | }
43 |
44 | func testPerformanceExample() throws {
45 | // This is an example of a performance test case.
46 | self.measure {
47 | // Put the code you want to measure the time of here.
48 | }
49 | }
50 |
51 | }
52 |
--------------------------------------------------------------------------------
/Example/FigmaKitExample/FigmaKitExampleTests/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 |
22 |
23 |
--------------------------------------------------------------------------------
/Example/FigmaKitExample/FigmaKitExampleUITests/FigmaKitExampleUITests.swift:
--------------------------------------------------------------------------------
1 | // This is free and unencumbered software released into the public domain.
2 | //
3 | // Anyone is free to copy, modify, publish, use, compile, sell, or
4 | // distribute this software, either in source code form or as a compiled
5 | // binary, for any purpose, commercial or non-commercial, and by any
6 | // means.
7 | //
8 | // In jurisdictions that recognize copyright laws, the author or authors
9 | // of this software dedicate any and all copyright interest in the
10 | // software to the public domain. We make this dedication for the benefit
11 | // of the public at large and to the detriment of our heirs and
12 | // successors. We intend this dedication to be an overt act of
13 | // relinquishment in perpetuity of all present and future rights to this
14 | // software under copyright law.
15 | //
16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19 | // IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
20 | // OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
21 | // ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22 | // OTHER DEALINGS IN THE SOFTWARE.
23 | //
24 | // For more information, please refer to
25 |
26 | import XCTest
27 |
28 | class FigmaKitExampleUITests: XCTestCase {
29 |
30 | override func setUpWithError() throws {
31 | // Put setup code here. This method is called before the invocation of each test method in the class.
32 |
33 | // In UI tests it is usually best to stop immediately when a failure occurs.
34 | continueAfterFailure = false
35 | }
36 |
37 | override func tearDownWithError() throws {
38 | // Put teardown code here. This method is called after the invocation of each test method in the class.
39 | }
40 |
41 | func testExample() throws {
42 | // UI tests must launch the application that they test.
43 | let app = XCUIApplication()
44 | app.launch()
45 |
46 | // Use recording to get started writing UI tests.
47 | // Use XCTAssert and related functions to verify your tests produce the correct results.
48 | }
49 |
50 | func testLaunchPerformance() throws {
51 | if #available(macOS 10.15, iOS 13.0, tvOS 13.0, *) {
52 | // This measures how long it takes to launch your application.
53 | measure(metrics: [XCTApplicationLaunchMetric()]) {
54 | XCUIApplication().launch()
55 | }
56 | }
57 | }
58 | }
59 |
--------------------------------------------------------------------------------
/Example/FigmaKitExample/FigmaKitExampleUITests/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 |
22 |
23 |
--------------------------------------------------------------------------------
/FigmaKit.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
7 |
9 |
10 |
11 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/FigmaKit.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | This is free and unencumbered software released into the public domain.
2 |
3 | Anyone is free to copy, modify, publish, use, compile, sell, or
4 | distribute this software, either in source code form or as a compiled
5 | binary, for any purpose, commercial or non-commercial, and by any
6 | means.
7 |
8 | In jurisdictions that recognize copyright laws, the author or authors
9 | of this software dedicate any and all copyright interest in the
10 | software to the public domain. We make this dedication for the benefit
11 | of the public at large and to the detriment of our heirs and
12 | successors. We intend this dedication to be an overt act of
13 | relinquishment in perpetuity of all present and future rights to this
14 | software under copyright law.
15 |
16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19 | IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
20 | OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
21 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22 | OTHER DEALINGS IN THE SOFTWARE.
23 |
24 | For more information, please refer to
25 |
--------------------------------------------------------------------------------
/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 |
4 | import PackageDescription
5 |
6 | let package = Package(
7 | name: "FigmaKit",
8 | platforms: [
9 | .iOS(.v11)
10 | ],
11 | products: [
12 | // Products define the executables and libraries a package produces, and make them visible to other packages.
13 | .library(
14 | name: "FigmaKit",
15 | targets: ["FigmaKit"]),
16 | ],
17 | dependencies: [
18 | // Dependencies declare other packages that this package depends on.
19 | // .package(url: /* package url */, from: "1.0.0"),
20 | ],
21 | targets: [
22 | // Targets are the basic building blocks of a package. A target can define a module or a test suite.
23 | // Targets can depend on other targets in this package, and on products in packages this package depends on.
24 | .target(
25 | name: "FigmaKit",
26 | dependencies: []),
27 | .testTarget(
28 | name: "FigmaKitTests",
29 | dependencies: ["FigmaKit"]),
30 | ]
31 | )
32 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # FigmaKit
2 |
3 | Pixel Perfect with ease
4 |
5 | ## Features
6 |
7 | - [x] Colors, corners, shadow, strokes, fill
8 | - [x] Label attributed
9 |
10 | 
11 |
12 | ### Colors and Fill
13 |
14 | From designing
15 |
16 |
17 |
18 | to source code
19 | ```swift
20 | view
21 | .corner(.mixed(20, 50, 0, 50))
22 | .fill(.linear(colors: [(0xEBEBEB, 0), (0x9EE505, 1)], alpha: 90))
23 | .stroke(.inside(0xFFFFFF, size: 5))
24 | .shadow(.drop(0x000000, x: 0, y: 4, b: 4, s: 0, alpha: 25))
25 | ```
26 |
27 |
28 | #### Multiple corners' radius
29 |
30 |
31 |
32 | ```swift
33 | view
34 | .corner(.mixed(20, 50, 0, 50))
35 | ```
36 |
37 | #### Background
38 |
39 |
40 |
41 | ```swift
42 | view
43 | .fill(.linear(colors: [(0xEBEBEB, 0), (0x9EE505, 1)], alpha: 90))
44 | ```
45 | from gradients to solid color
46 | ```swift
47 | view
48 | .fill(.solid(0xEBEBEB))
49 | ```
50 |
51 | #### Strokes
52 |
53 |
54 |
55 | ```swift
56 | view
57 | .stroke(.inside("#FFFFFF", size: 5))
58 | ```
59 |
60 |
61 | #### Shadows
62 |
63 |
64 |
65 | ```swift
66 | topView
67 | .shadow(.drop(0x000000, x: 0, y: 4, b: 4, s: 0, alpha: 25))
68 | ```
69 |
70 | Tada! Real-life result with **pixel perfection**
71 |
72 |
73 |
74 |
75 | ### Styles
76 |
77 | #### Typography
78 | Never missmatch designing text styling
79 |
80 |
81 |
82 | as
83 | ```swift
84 | let typo = Typography.custom(
85 | "Roboto",
86 | weight: 500,
87 | style: .italic,
88 | size: 13,
89 | lineHeight: 15.23,
90 | letter: 2)
91 |
92 | codeLabel
93 | .typography(typo)
94 | .alignment(.center)
95 | ```
96 |
97 | #### Rich Text
98 | Or with multiple and complex styles in one place
99 |
100 |
101 |
102 | ```swift
103 | let normal = Typography.custom("Roboto", weight: 400, size: 16, lineHeight: 21, letter: 1)
104 | let bold = Typography.custom("Roboto", weight: 700, size: 20, style: .italic)
105 |
106 | let foreground = 0x000000
107 | let green = 0x00FF00
108 | let grey = 0xCCCCCC
109 |
110 | label
111 | // Mark default style
112 | .setDefault(normal, color: foreground)
113 |
114 | .add("Lorem", typography: bold, color: grey)
115 | .add(" ipsum dolor sit", typography: normal, color: green)
116 | .add(" amet ")
117 | .add("consectetur adipiscing elit", style: .underlined)
118 | .add(", sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. \n")
119 | .add("Ut enim ad minim veniam", style: .strikeThrough)
120 | .add(" quis nostrud ", typography: bold, color: foreground, background: green)
121 | .add("exercitation", style: .link("https://google.com"))
122 | .add(" ullamco laboris nisi ut aliquip ex ea commodo ")
123 | .add("consequat.", typography: bold, color: grey)
124 |
125 | // Label-wide applying should be done finally
126 | .alignment(.left)
127 |
128 | // Don't forget to clean for next use
129 | .cleanUp()
130 | ```
131 |
132 | ## Requirement
133 |
134 | iOS 11.0+
135 | Swift 4.0+
136 |
137 | ## Installation
138 |
139 | ### Swift Package manager
140 |
141 | - Click `File` → `Swift Packages` → `Add Package Dependency`
142 | - Enter `https://github.com/haphanquang/FigmaKit`
143 |
144 | ## Support
145 |
146 | Ask me anything at https://hapq.me/contact
147 |
148 | ## License
149 |
150 | FigmaKit is released under the Unlicense. See LICENSE for details.
151 |
--------------------------------------------------------------------------------
/Resources/corners.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/haphanquang/FigmaKit/4297a1d43ce823e89bd7913e1d1396de7aad82f8/Resources/corners.png
--------------------------------------------------------------------------------
/Resources/design.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/haphanquang/FigmaKit/4297a1d43ce823e89bd7913e1d1396de7aad82f8/Resources/design.png
--------------------------------------------------------------------------------
/Resources/figma_design.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/haphanquang/FigmaKit/4297a1d43ce823e89bd7913e1d1396de7aad82f8/Resources/figma_design.png
--------------------------------------------------------------------------------
/Resources/fills.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/haphanquang/FigmaKit/4297a1d43ce823e89bd7913e1d1396de7aad82f8/Resources/fills.png
--------------------------------------------------------------------------------
/Resources/sample1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/haphanquang/FigmaKit/4297a1d43ce823e89bd7913e1d1396de7aad82f8/Resources/sample1.png
--------------------------------------------------------------------------------
/Resources/screenshot1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/haphanquang/FigmaKit/4297a1d43ce823e89bd7913e1d1396de7aad82f8/Resources/screenshot1.png
--------------------------------------------------------------------------------
/Resources/shadows.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/haphanquang/FigmaKit/4297a1d43ce823e89bd7913e1d1396de7aad82f8/Resources/shadows.png
--------------------------------------------------------------------------------
/Resources/simulator.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/haphanquang/FigmaKit/4297a1d43ce823e89bd7913e1d1396de7aad82f8/Resources/simulator.png
--------------------------------------------------------------------------------
/Resources/strokes.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/haphanquang/FigmaKit/4297a1d43ce823e89bd7913e1d1396de7aad82f8/Resources/strokes.png
--------------------------------------------------------------------------------
/Resources/typography1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/haphanquang/FigmaKit/4297a1d43ce823e89bd7913e1d1396de7aad82f8/Resources/typography1.png
--------------------------------------------------------------------------------
/Resources/typos.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/haphanquang/FigmaKit/4297a1d43ce823e89bd7913e1d1396de7aad82f8/Resources/typos.png
--------------------------------------------------------------------------------
/Sources/FigmaKit/Elements/ColorType.swift:
--------------------------------------------------------------------------------
1 | // This is free and unencumbered software released into the public domain.
2 | //
3 | // Anyone is free to copy, modify, publish, use, compile, sell, or
4 | // distribute this software, either in source code form or as a compiled
5 | // binary, for any purpose, commercial or non-commercial, and by any
6 | // means.
7 | //
8 | // In jurisdictions that recognize copyright laws, the author or authors
9 | // of this software dedicate any and all copyright interest in the
10 | // software to the public domain. We make this dedication for the benefit
11 | // of the public at large and to the detriment of our heirs and
12 | // successors. We intend this dedication to be an overt act of
13 | // relinquishment in perpetuity of all present and future rights to this
14 | // software under copyright law.
15 | //
16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19 | // IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
20 | // OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
21 | // ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22 | // OTHER DEALINGS IN THE SOFTWARE.
23 | //
24 | // For more information, please refer to
25 |
26 | import Foundation
27 | import UIKit
28 |
29 | public protocol ColorType {
30 | var color: UIColor? { get }
31 | }
32 | extension Int: ColorType {
33 | public var color: UIColor? {
34 | return .init(hex: self)
35 | }
36 | }
37 | extension String: ColorType {
38 | public var color: UIColor? {
39 | guard !self.isEmpty else {
40 | return nil
41 | }
42 |
43 | guard self.first != "#" else {
44 | return Int(self.dropFirst(), radix: 16)?.color
45 | }
46 |
47 | return Int(self, radix: 16)?.color
48 | }
49 | }
50 |
51 | extension UIColor: ColorType {
52 | public var color: UIColor? {
53 | return self
54 | }
55 | }
56 | public extension ColorType {
57 | func alpha(_ a: CGFloat) -> ColorType? {
58 | let color = self.color
59 | return color?.withAlphaComponent(a / 100)
60 | }
61 | }
62 |
63 | public extension UIColor {
64 | convenience init(red: Int, green: Int, blue: Int, alpha: Int) {
65 | assert(red >= 0 && red <= 255, "Invalid red component")
66 | assert(green >= 0 && green <= 255, "Invalid green component")
67 | assert(blue >= 0 && blue <= 255, "Invalid blue component")
68 |
69 | self.init(red: CGFloat(red) / 255.0, green: CGFloat(green) / 255.0, blue: CGFloat(blue) / 255.0, alpha: CGFloat(alpha) / 100)
70 | }
71 |
72 | convenience init(hex: Int, alpha: Int = 100) {
73 | self.init(
74 | red: (hex >> 16) & 0xFF,
75 | green: (hex >> 8) & 0xFF,
76 | blue: hex & 0xFF,
77 | alpha: alpha
78 | )
79 | }
80 | }
81 |
--------------------------------------------------------------------------------
/Sources/FigmaKit/Elements/Edges.swift:
--------------------------------------------------------------------------------
1 | // This is free and unencumbered software released into the public domain.
2 | //
3 | // Anyone is free to copy, modify, publish, use, compile, sell, or
4 | // distribute this software, either in source code form or as a compiled
5 | // binary, for any purpose, commercial or non-commercial, and by any
6 | // means.
7 | //
8 | // In jurisdictions that recognize copyright laws, the author or authors
9 | // of this software dedicate any and all copyright interest in the
10 | // software to the public domain. We make this dedication for the benefit
11 | // of the public at large and to the detriment of our heirs and
12 | // successors. We intend this dedication to be an overt act of
13 | // relinquishment in perpetuity of all present and future rights to this
14 | // software under copyright law.
15 | //
16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19 | // IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
20 | // OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
21 | // ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22 | // OTHER DEALINGS IN THE SOFTWARE.
23 | //
24 | // For more information, please refer to
25 |
26 |
27 | import Foundation
28 | import UIKit
29 |
30 | public extension UIEdgeInsets {
31 | init(_ all: CGFloat) {
32 | self.init(top: all, left: all, bottom: all, right: all)
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/Sources/FigmaKit/Elements/Font.swift:
--------------------------------------------------------------------------------
1 | // This is free and unencumbered software released into the public domain.
2 | //
3 | // Anyone is free to copy, modify, publish, use, compile, sell, or
4 | // distribute this software, either in source code form or as a compiled
5 | // binary, for any purpose, commercial or non-commercial, and by any
6 | // means.
7 | //
8 | // In jurisdictions that recognize copyright laws, the author or authors
9 | // of this software dedicate any and all copyright interest in the
10 | // software to the public domain. We make this dedication for the benefit
11 | // of the public at large and to the detriment of our heirs and
12 | // successors. We intend this dedication to be an overt act of
13 | // relinquishment in perpetuity of all present and future rights to this
14 | // software under copyright law.
15 | //
16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19 | // IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
20 | // OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
21 | // ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22 | // OTHER DEALINGS IN THE SOFTWARE.
23 | //
24 | // For more information, please refer to
25 |
26 | import Foundation
27 | import UIKit
28 |
29 | extension Int {
30 | var fontWeight: UIFont.Weight {
31 | switch self {
32 | case 100: return .thin
33 | case 200: return .ultraLight
34 | case 300: return .light
35 | case 400: return .regular
36 | case 500: return .medium
37 | case 600: return .semibold
38 | case 700: return .bold
39 | case 800: return .heavy
40 | case 900: return .black
41 | default: return .regular
42 | }
43 | }
44 |
45 | var proxFontWeight: UIFont.Weight {
46 | return prox.fontWeight
47 | }
48 |
49 | private var prox: Int {
50 | return Int((CGFloat(self) / 100).rounded() * 100)
51 | }
52 | }
53 |
54 | extension UIFont.Weight {
55 | var name: String {
56 | switch self {
57 | case .thin: return "Thin"
58 | case .ultraLight: return "UltraLight"
59 | case .light: return "Light"
60 | case .regular: return "Regular"
61 | case .medium: return "Medium"
62 | case .semibold: return "Semibold"
63 | case .bold: return "Bold"
64 | case .heavy: return "Heavy"
65 | case .black: return "Black"
66 | default:
67 | return "Regular"
68 | }
69 | }
70 | }
71 |
--------------------------------------------------------------------------------
/Sources/FigmaKit/Elements/Helpers.swift:
--------------------------------------------------------------------------------
1 | // This is free and unencumbered software released into the public domain.
2 | //
3 | // Anyone is free to copy, modify, publish, use, compile, sell, or
4 | // distribute this software, either in source code form or as a compiled
5 | // binary, for any purpose, commercial or non-commercial, and by any
6 | // means.
7 | //
8 | // In jurisdictions that recognize copyright laws, the author or authors
9 | // of this software dedicate any and all copyright interest in the
10 | // software to the public domain. We make this dedication for the benefit
11 | // of the public at large and to the detriment of our heirs and
12 | // successors. We intend this dedication to be an overt act of
13 | // relinquishment in perpetuity of all present and future rights to this
14 | // software under copyright law.
15 | //
16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19 | // IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
20 | // OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
21 | // ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22 | // OTHER DEALINGS IN THE SOFTWARE.
23 | //
24 | // For more information, please refer to
25 |
26 | import Foundation
27 | import UIKit
28 |
29 | public extension String {
30 |
31 | }
32 |
33 | public extension CALayer {
34 | func setShadow(
35 | color: UIColor? = .black,
36 | alpha: Float = 0.5,
37 | x: CGFloat = 0,
38 | y: CGFloat = 2,
39 | blur: CGFloat = 4,
40 | spread: CGFloat = 0)
41 | {
42 | masksToBounds = false
43 | shadowColor = color?.cgColor
44 | shadowOpacity = alpha
45 | shadowOffset = CGSize(width: x, height: y)
46 | shadowRadius = blur / 2.0
47 | if spread == 0 {
48 | shadowPath = nil
49 | } else {
50 | let dx = -spread
51 | let rect = bounds.insetBy(dx: dx, dy: dx)
52 | shadowPath = UIBezierPath(rect: rect).cgPath
53 | }
54 | }
55 |
56 | func setCorner(radius: CGFloat,
57 | corner: CACornerMask) {
58 | if #available(iOS 13.0, *) {
59 | cornerRadius = radius
60 | maskedCorners = corner
61 | cornerCurve = .continuous
62 | } else {
63 | // Fallback on earlier versions
64 | }
65 | }
66 | }
67 |
--------------------------------------------------------------------------------
/Sources/FigmaKit/Elements/Strings.swift:
--------------------------------------------------------------------------------
1 | // This is free and unencumbered software released into the public domain.
2 | //
3 | // Anyone is free to copy, modify, publish, use, compile, sell, or
4 | // distribute this software, either in source code form or as a compiled
5 | // binary, for any purpose, commercial or non-commercial, and by any
6 | // means.
7 | //
8 | // In jurisdictions that recognize copyright laws, the author or authors
9 | // of this software dedicate any and all copyright interest in the
10 | // software to the public domain. We make this dedication for the benefit
11 | // of the public at large and to the detriment of our heirs and
12 | // successors. We intend this dedication to be an overt act of
13 | // relinquishment in perpetuity of all present and future rights to this
14 | // software under copyright law.
15 | //
16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19 | // IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
20 | // OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
21 | // ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22 | // OTHER DEALINGS IN THE SOFTWARE.
23 | //
24 | // For more information, please refer to
25 |
26 | import Foundation
27 | import UIKit
28 |
29 | public extension String {
30 | func normal(_ font: UIFont, color: ColorType, background: ColorType = UIColor.clear) -> NSAttributedString {
31 | let attributes: [NSAttributedString.Key: Any] = [
32 | .font: font,
33 | .foregroundColor: color.color as Any,
34 | .backgroundColor: background.color as Any
35 | ]
36 | return NSAttributedString(string: self, attributes: attributes)
37 | }
38 | func underlined(_ font: UIFont, color: ColorType, background: ColorType = UIColor.clear) -> NSAttributedString {
39 | let attributes: [NSAttributedString.Key: Any] = [
40 | .font: font,
41 | .foregroundColor: color.color as Any,
42 | .backgroundColor: background.color as Any,
43 | .underlineStyle: NSUnderlineStyle.single.rawValue
44 | ]
45 | return NSAttributedString(string: self, attributes: attributes)
46 | }
47 | func strikeThrough(_ font: UIFont, color: ColorType, background: ColorType = UIColor.clear) -> NSAttributedString {
48 | let attributes: [NSAttributedString.Key: Any] = [
49 | .font: font,
50 | .foregroundColor: color.color as Any,
51 | .backgroundColor: background.color as Any,
52 | .strikethroughStyle: NSUnderlineStyle.single.rawValue
53 | ]
54 | return NSAttributedString(string: self, attributes: attributes)
55 | }
56 | func link(url: String, font: UIFont, color: ColorType, background: ColorType = UIColor.clear) -> NSAttributedString {
57 | let attributes: [NSAttributedString.Key: Any] = [
58 | .font: font,
59 | .foregroundColor: color.color as Any,
60 | .backgroundColor: background.color as Any,
61 | .link: NSString(string: url) as Any
62 | ]
63 | return NSAttributedString(string: self, attributes: attributes)
64 | }
65 | }
66 |
67 | extension NSMutableAttributedString {
68 |
69 | }
70 |
--------------------------------------------------------------------------------
/Sources/FigmaKit/FigmaKit+UIView.swift:
--------------------------------------------------------------------------------
1 | // This is free and unencumbered software released into the public domain.
2 | //
3 | // Anyone is free to copy, modify, publish, use, compile, sell, or
4 | // distribute this software, either in source code form or as a compiled
5 | // binary, for any purpose, commercial or non-commercial, and by any
6 | // means.
7 | //
8 | // In jurisdictions that recognize copyright laws, the author or authors
9 | // of this software dedicate any and all copyright interest in the
10 | // software to the public domain. We make this dedication for the benefit
11 | // of the public at large and to the detriment of our heirs and
12 | // successors. We intend this dedication to be an overt act of
13 | // relinquishment in perpetuity of all present and future rights to this
14 | // software under copyright law.
15 | //
16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19 | // IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
20 | // OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
21 | // ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22 | // OTHER DEALINGS IN THE SOFTWARE.
23 | //
24 | // For more information, please refer to
25 |
26 | import Foundation
27 | import UIKit
28 |
29 | public extension UIView {
30 | private func getTargetView() -> FigmaView {
31 | if let figmaView = self.subviews
32 | .first(where: { $0 is FigmaView } ) {
33 | sendSubviewToBack(figmaView)
34 | return figmaView as! FigmaView
35 | }
36 |
37 | let figmaView = FigmaView(frame: self.bounds)
38 | figmaView.translatesAutoresizingMaskIntoConstraints = false
39 | self.insertSubview(figmaView, at: 0)
40 |
41 | NSLayoutConstraint.activate([
42 | figmaView.topAnchor.constraint(equalTo: self.topAnchor),
43 | figmaView.leadingAnchor.constraint(equalTo: self.leadingAnchor),
44 | figmaView.bottomAnchor.constraint(equalTo: self.bottomAnchor),
45 | figmaView.trailingAnchor.constraint(equalTo: self.trailingAnchor)
46 | ])
47 |
48 | return figmaView
49 | }
50 |
51 | @discardableResult
52 | func shadow(_ shadow: Shadow) -> Self {
53 | getTargetView().setShadow(shadow)
54 | return self
55 | }
56 |
57 | @discardableResult
58 | func corner(_ corner: CornerRadius) -> Self {
59 | getTargetView().setCorner(corner)
60 | return self
61 | }
62 |
63 | @discardableResult
64 | func stroke(_ stroke: Stroke) -> Self {
65 | getTargetView().setStroke(stroke)
66 | return self
67 | }
68 |
69 | func stroke(_ color: ColorType, size: CGFloat = 1) -> Self {
70 | getTargetView().setStroke(.inside(color, size: size))
71 | return self
72 | }
73 |
74 | @discardableResult
75 | func fill(_ type: Fill) -> Self {
76 | getTargetView().setFill(type)
77 | return self
78 | }
79 | }
80 |
81 |
82 | private class FigmaView: UIView {
83 |
84 | private let shadowLayer = CAShapeLayer()
85 | private let backgroundLayer = CAGradientLayer()
86 | private let backgroundMaskLayer = CAShapeLayer()
87 | private let strokeLayer = CAShapeLayer()
88 |
89 | private var stroke: Stroke?
90 | private var corners: CornerRadius?
91 | private var shadow: Shadow?
92 |
93 | override init(frame: CGRect) {
94 | super.init(frame: frame)
95 | shadowLayer.fillColor = UIColor.clear.cgColor
96 | backgroundMaskLayer.fillColor = UIColor.white.cgColor
97 | strokeLayer.fillColor = UIColor.clear.cgColor
98 |
99 | layer.insertSublayer(shadowLayer, at: 0)
100 | layer.insertSublayer(backgroundLayer, above: shadowLayer)
101 | layer.insertSublayer(strokeLayer, above: backgroundLayer)
102 |
103 | backgroundLayer.mask = backgroundMaskLayer
104 | backgroundColor = .clear
105 | isUserInteractionEnabled = false
106 | }
107 |
108 | required init?(coder: NSCoder) {
109 | fatalError("init(coder:) has not been implemented")
110 | }
111 |
112 | override func layoutSubviews() {
113 | super.layoutSubviews()
114 | updatePaths()
115 | backgroundLayer.frame = self.bounds
116 | }
117 |
118 | func setShadow(_ shadow: Shadow) {
119 | self.shadowLayer.fillColor = UIColor.white.cgColor
120 | self.shadowLayer
121 | .setShadow(color: shadow.color, alpha: shadow.alpha, x: shadow.x, y: shadow.y, blur: shadow.b, spread: shadow.s)
122 | }
123 |
124 | func setFill(_ fill: Fill) {
125 | let layer = self.backgroundLayer
126 | switch fill {
127 | case let .solid(color, _):
128 | layer.backgroundColor = color?.color?.cgColor
129 | self.alpha = alpha
130 | default:
131 | layer.colors = fill.colors.compactMap { $0.0?.color?.cgColor }
132 | layer.locations = fill.colors.map { NSNumber(value: Float($0.1 ?? 0)) }
133 | if let start = fill.startPoint {
134 | layer.startPoint = start
135 | }
136 | if let end = fill.endPoint {
137 | layer.endPoint = end
138 | }
139 | layer.type = fill.type
140 | }
141 | self.alpha = fill.alpha / 100
142 | updatePaths()
143 | }
144 |
145 | func setStroke(_ stroke: Stroke) {
146 | self.stroke = stroke
147 | strokeLayer.strokeColor = stroke.color?.cgColor
148 | strokeLayer.lineWidth = stroke.lineWidth
149 | updatePaths()
150 | }
151 |
152 | func setCorner(_ corner: CornerRadius) {
153 | self.corners = corner
154 | updatePaths()
155 | }
156 | }
157 |
158 | extension FigmaView {
159 | private func createPath() -> UIBezierPath {
160 | return createPathInFrame(getAdjustedFrame())
161 | }
162 |
163 | private func createShadowPath() -> UIBezierPath {
164 | return createPathInFrame(getShadowFrame())
165 | }
166 |
167 | private func createStrokePath() -> UIBezierPath {
168 | return createPathInFrame(getAdjustedFrame())
169 | }
170 |
171 | private func getAdjustedFrame() -> CGRect {
172 | var rect = self.bounds
173 | if let stroke = self.stroke, rect != .zero {
174 | rect = rect.insetBy(dx: stroke.adjustedWidth, dy: stroke.adjustedWidth)
175 | }
176 | return rect
177 | }
178 |
179 | private func updatePaths() {
180 | shadowLayer.path = self.createShadowPath().cgPath
181 | backgroundMaskLayer.path = self.createPath().cgPath
182 | strokeLayer.path = self.createStrokePath().cgPath
183 | }
184 |
185 | private func getShadowFrame() -> CGRect {
186 | var rect = self.bounds
187 | if let stroke = self.stroke {
188 | rect = rect.insetBy(dx: stroke.adjustedWidth - stroke.lineWidth / 2, dy: stroke.adjustedWidth - stroke.lineWidth / 2)
189 | }
190 | return rect
191 | }
192 |
193 | private func createPathInFrame(_ rect: CGRect) -> UIBezierPath {
194 | var topLeftRadius = CGSize.zero
195 | var topRightRadius = CGSize.zero
196 | var bottomLeftRadius = CGSize.zero
197 | var bottomRightRadius = CGSize.zero
198 |
199 | if let corners = self.corners {
200 | for corner in corners.corners {
201 | if corner.0 == .topLeft {
202 | topLeftRadius = CGSize(width: corner.1, height: corner.1)
203 | }
204 | if corner.0 == .topRight {
205 | topRightRadius = CGSize(width: corner.1, height: corner.1)
206 | }
207 | if corner.0 == .bottomLeft {
208 | bottomLeftRadius = CGSize(width: corner.1, height: corner.1)
209 | }
210 | if corner.0 == .bottomRight {
211 | bottomRightRadius = CGSize(width: corner.1, height: corner.1)
212 | }
213 | }
214 | }
215 |
216 | return UIBezierPath(shouldRoundRect: rect, topLeftRadius: topLeftRadius, topRightRadius: topRightRadius, bottomLeftRadius: bottomLeftRadius, bottomRightRadius: bottomRightRadius)
217 | }
218 | }
219 |
220 | extension UIBezierPath {
221 | convenience init(shouldRoundRect rect: CGRect, topLeftRadius: CGSize = .zero, topRightRadius: CGSize = .zero, bottomLeftRadius: CGSize = .zero, bottomRightRadius: CGSize = .zero){
222 |
223 | self.init()
224 | let path = CGMutablePath()
225 |
226 | let topLeft = rect.origin
227 | let topRight = CGPoint(x: rect.maxX, y: rect.minY)
228 | let bottomRight = CGPoint(x: rect.maxX, y: rect.maxY)
229 | let bottomLeft = CGPoint(x: rect.minX, y: rect.maxY)
230 |
231 | if topLeftRadius != .zero{
232 | path.move(to: CGPoint(x: topLeft.x + topLeftRadius.width, y: topLeft.y))
233 | } else {
234 | path.move(to: CGPoint(x: topLeft.x, y: topLeft.y))
235 | }
236 |
237 | if topRightRadius != .zero{
238 | path.addLine(to: CGPoint(x: topRight.x - topRightRadius.width, y: topRight.y))
239 | path.addCurve(
240 | to: CGPoint(x: topRight.x, y: topRight.y + topRightRadius.height),
241 | control1: CGPoint(x: topRight.x, y: topRight.y),
242 | control2: CGPoint(x: topRight.x, y: topRight.y + topRightRadius.height))
243 | } else {
244 | path.addLine(to: CGPoint(x: topRight.x, y: topRight.y))
245 | }
246 |
247 | if bottomRightRadius != .zero{
248 | path.addLine(to: CGPoint(x: bottomRight.x, y: bottomRight.y - bottomRightRadius.height))
249 | path.addCurve(
250 | to: CGPoint(x: bottomRight.x - bottomRightRadius.width, y: bottomRight.y),
251 | control1: CGPoint(x: bottomRight.x, y: bottomRight.y),
252 | control2: CGPoint(x: bottomRight.x - bottomRightRadius.width, y: bottomRight.y))
253 | } else {
254 | path.addLine(to: CGPoint(x: bottomRight.x, y: bottomRight.y))
255 | }
256 |
257 | if bottomLeftRadius != .zero{
258 | path.addLine(to: CGPoint(x: bottomLeft.x + bottomLeftRadius.width, y: bottomLeft.y))
259 | path.addCurve(
260 | to: CGPoint(x: bottomLeft.x, y: bottomLeft.y - bottomLeftRadius.height),
261 | control1: CGPoint(x: bottomLeft.x, y: bottomLeft.y),
262 | control2: CGPoint(x: bottomLeft.x, y: bottomLeft.y-bottomLeftRadius.height))
263 | } else {
264 | path.addLine(to: CGPoint(x: bottomLeft.x, y: bottomLeft.y))
265 | }
266 |
267 | if topLeftRadius != .zero{
268 | path.addLine(to: CGPoint(x: topLeft.x, y: topLeft.y + topLeftRadius.height))
269 | path.addCurve(
270 | to: CGPoint(x: topLeft.x + topLeftRadius.width, y: topLeft.y),
271 | control1: CGPoint(x: topLeft.x, y: topLeft.y),
272 | control2: CGPoint(x: topLeft.x+topLeftRadius.width, y: topLeft.y))
273 | } else {
274 | path.addLine(to: CGPoint(x: topLeft.x, y: topLeft.y))
275 | }
276 |
277 | path.closeSubpath()
278 | cgPath = path
279 | }
280 | }
281 |
--------------------------------------------------------------------------------
/Sources/FigmaKit/FigmaKit.swift:
--------------------------------------------------------------------------------
1 | // This is free and unencumbered software released into the public domain.
2 | //
3 | // Anyone is free to copy, modify, publish, use, compile, sell, or
4 | // distribute this software, either in source code form or as a compiled
5 | // binary, for any purpose, commercial or non-commercial, and by any
6 | // means.
7 | //
8 | // In jurisdictions that recognize copyright laws, the author or authors
9 | // of this software dedicate any and all copyright interest in the
10 | // software to the public domain. We make this dedication for the benefit
11 | // of the public at large and to the detriment of our heirs and
12 | // successors. We intend this dedication to be an overt act of
13 | // relinquishment in perpetuity of all present and future rights to this
14 | // software under copyright law.
15 | //
16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19 | // IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
20 | // OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
21 | // ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22 | // OTHER DEALINGS IN THE SOFTWARE.
23 | //
24 | // For more information, please refer to
25 |
26 | import Foundation
27 | import UIKit
28 |
29 | // MARK: - UIElements
30 |
31 | private struct StyleHolder {
32 | static var font: UIFont?
33 | static var color: UIColor?
34 | static var attributes: [NSAttributedString.Key: Any]?
35 | }
36 | public extension UILabel {
37 | enum TextStyle {
38 | case normal
39 | case underlined
40 | case strikeThrough
41 | case link(String)
42 | }
43 | @discardableResult
44 | func typography(_ typo: Typography) -> Self {
45 | self.font = typo.font
46 | self.numberOfLines = 0
47 | self.lineSpacing(max((typo.lineHeight - typo.font.pointSize), 0))
48 | self.letterSpacing(typo.letterSpacing)
49 | return self
50 | }
51 | @discardableResult
52 | func content(_ string: String) -> Self {
53 | self.text = string
54 | return self
55 | }
56 | @discardableResult
57 | func color(_ color: ColorType) -> Self {
58 | self.textColor = color.color
59 | return self
60 | }
61 |
62 | @discardableResult
63 | func add(_ string: NSAttributedString) -> Self {
64 | let recent = self.attributedText ?? NSAttributedString()
65 | let new = NSMutableAttributedString(attributedString: recent)
66 | new.append(string)
67 | self.attributedText = new
68 | self.invalidateIntrinsicContentSize()
69 | return self
70 | }
71 |
72 | @discardableResult
73 | func add(_ string: String, style: TextStyle = .normal, typography: Typography? = nil, color: ColorType? = nil, background: ColorType? = nil) -> Self {
74 | let font = typography?.font ?? StyleHolder.font ?? .systemFont(ofSize: 12)
75 | let color = color ?? StyleHolder.color ?? .black
76 | let background = background ?? UIColor.clear
77 | switch style {
78 | case .normal:
79 | return self.add(string.normal(font, color: color, background: background))
80 | case .underlined:
81 | return self.add(string.underlined(font, color: color, background: background))
82 | case .strikeThrough:
83 | return self.add(string.strikeThrough(font, color: color, background: background))
84 | case let .link(url):
85 | return self.add(string.link(url: url, font: font, color: color, background: background))
86 | }
87 | }
88 |
89 | @discardableResult
90 | func setDefault(_ typography: Typography, color: ColorType) -> Self {
91 | StyleHolder.font = typography.font
92 | StyleHolder.color = color.color
93 |
94 | let style = NSMutableParagraphStyle()
95 | let lineSpacing = max((typography.lineHeight - typography.font.pointSize), 0)
96 | if lineSpacing > 0 {
97 | style.lineSpacing = lineSpacing
98 | style.lineHeightMultiple = 1.0
99 | }
100 | StyleHolder.attributes = [.paragraphStyle: style]
101 |
102 | self.typography(typography)
103 | return self
104 | }
105 |
106 | @discardableResult
107 | func cleanUp() -> Self {
108 | StyleHolder.font = nil
109 | StyleHolder.color = nil
110 | StyleHolder.attributes = nil
111 | return self
112 | }
113 |
114 | @discardableResult
115 | func lineSpacing(_ value: CGFloat) -> Self {
116 | guard let attributedString = currentAttributedString() else { return self }
117 | let style = (StyleHolder.attributes?[.paragraphStyle] as? NSMutableParagraphStyle) ?? NSMutableParagraphStyle()
118 | let newAttributes: [NSAttributedString.Key: Any] = [
119 | .paragraphStyle: style as Any
120 | ]
121 | let range = NSMakeRange(0, attributedString.length)
122 | attributedString.addAttributes(newAttributes, range: range)
123 | self.attributedText = attributedString
124 | return self
125 | }
126 |
127 | @discardableResult
128 | func letterSpacing(_ value: CGFloat) -> Self {
129 | guard let attributedString = currentAttributedString() else { return self }
130 | let newAttributes: [NSAttributedString.Key: Any] = [
131 | .kern: value
132 | ]
133 | let range = NSMakeRange(0, attributedString.length)
134 | attributedString.addAttributes(newAttributes, range: range)
135 | self.attributedText = attributedString
136 | return self
137 | }
138 |
139 | @discardableResult
140 | func alignment(_ align: NSTextAlignment) -> Self {
141 | guard let attributedString = currentAttributedString() else { return self }
142 |
143 | let style = (StyleHolder.attributes?[.paragraphStyle] as? NSMutableParagraphStyle) ?? NSMutableParagraphStyle()
144 | style.alignment = align
145 | let newAttributes: [NSAttributedString.Key: Any] = [
146 | .paragraphStyle: style as Any
147 | ]
148 | let range = NSMakeRange(0, attributedString.length)
149 | attributedString.addAttributes(newAttributes, range: range)
150 | self.attributedText = attributedString
151 | return self
152 | }
153 |
154 | private func currentAttributedString() -> NSMutableAttributedString? {
155 | let attributedString: NSMutableAttributedString
156 | if let text = self.attributedText, text.length > 0 {
157 | attributedString = NSMutableAttributedString(attributedString: text)
158 | } else {
159 | guard let text = self.text else { return nil }
160 | attributedString = NSMutableAttributedString(string: text)
161 | }
162 | return attributedString
163 | }
164 | }
165 |
166 | public extension UIButton {
167 | @discardableResult
168 | func padding(_ edge: UIEdgeInsets) -> Self {
169 | self.contentEdgeInsets = edge
170 | return self
171 | }
172 |
173 | @discardableResult
174 | func tint(_ color: ColorType) -> Self {
175 | self.tintColor = color.color
176 | return self
177 | }
178 | @discardableResult
179 | func typography(_ typo: Typography) -> Self {
180 | self.titleLabel?.typography(typo)
181 | return self
182 | }
183 | }
184 |
185 |
186 | public extension UIStackView {
187 |
188 | }
189 |
--------------------------------------------------------------------------------
/Sources/FigmaKit/Types/Types.swift:
--------------------------------------------------------------------------------
1 | // This is free and unencumbered software released into the public domain.
2 | //
3 | // Anyone is free to copy, modify, publish, use, compile, sell, or
4 | // distribute this software, either in source code form or as a compiled
5 | // binary, for any purpose, commercial or non-commercial, and by any
6 | // means.
7 | //
8 | // In jurisdictions that recognize copyright laws, the author or authors
9 | // of this software dedicate any and all copyright interest in the
10 | // software to the public domain. We make this dedication for the benefit
11 | // of the public at large and to the detriment of our heirs and
12 | // successors. We intend this dedication to be an overt act of
13 | // relinquishment in perpetuity of all present and future rights to this
14 | // software under copyright law.
15 | //
16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19 | // IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
20 | // OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
21 | // ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22 | // OTHER DEALINGS IN THE SOFTWARE.
23 | //
24 | // For more information, please refer to
25 |
26 | import UIKit
27 |
28 | public protocol ShadowType {
29 | var color: UIColor? { get }
30 | var x: CGFloat { get }
31 | var y: CGFloat { get }
32 | var b: CGFloat { get }
33 | var s: CGFloat { get }
34 | var alpha: Float { get }
35 | }
36 | public protocol CornerType {
37 | var corners: [(UIRectCorner, CGFloat)] { get }
38 | }
39 | public protocol StrokeType {
40 | var color: UIColor? { get }
41 | var adjustedWidth: CGFloat { get }
42 | }
43 |
44 | public protocol FillType {
45 | var startPoint: CGPoint? { get }
46 | var endPoint: CGPoint? { get }
47 | var colors: [(ColorType?, CGFloat?)] { get }
48 | var type: CAGradientLayerType { get }
49 | var alpha: CGFloat { get }
50 | }
51 | public protocol TypographyType {
52 | var font: UIFont { get }
53 | var lineHeight: CGFloat { get }
54 | var letterSpacing: CGFloat { get }
55 | }
56 | public enum Shadow: ShadowType {
57 | case drop(ColorType?, x: CGFloat, y: CGFloat, b: CGFloat, s: CGFloat, alpha: Float)
58 | }
59 |
60 | public enum CornerRadius: CornerType {
61 | case all(CGFloat)
62 | case mixed(_ topLeft: CGFloat = .zero, _ topRight: CGFloat = .zero, _ bottomRight: CGFloat = .zero, _ bottomLeft: CGFloat = .zero)
63 | }
64 | public enum Stroke: StrokeType {
65 | case inside(ColorType?, size: CGFloat)
66 | case outside(ColorType?, size: CGFloat)
67 | case center(ColorType?, size: CGFloat)
68 | }
69 |
70 | public enum Fill: FillType {
71 | case solid(ColorType?, _ alpha: CGFloat = 100)
72 | case linear(colors: [(ColorType?, CGFloat?)], start: CGPoint? = nil, end: CGPoint? = nil, alpha: CGFloat = 100)
73 | }
74 |
--------------------------------------------------------------------------------
/Sources/FigmaKit/Types/TypesImplement.swift:
--------------------------------------------------------------------------------
1 | // This is free and unencumbered software released into the public domain.
2 | //
3 | // Anyone is free to copy, modify, publish, use, compile, sell, or
4 | // distribute this software, either in source code form or as a compiled
5 | // binary, for any purpose, commercial or non-commercial, and by any
6 | // means.
7 | //
8 | // In jurisdictions that recognize copyright laws, the author or authors
9 | // of this software dedicate any and all copyright interest in the
10 | // software to the public domain. We make this dedication for the benefit
11 | // of the public at large and to the detriment of our heirs and
12 | // successors. We intend this dedication to be an overt act of
13 | // relinquishment in perpetuity of all present and future rights to this
14 | // software under copyright law.
15 | //
16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19 | // IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
20 | // OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
21 | // ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22 | // OTHER DEALINGS IN THE SOFTWARE.
23 | //
24 | // For more information, please refer to
25 |
26 | import UIKit
27 | extension Shadow {
28 | public var color: UIColor? {
29 | switch self {
30 | case let .drop(color, _, _, _, _, _):
31 | return color?.color ?? .clear
32 | }
33 | }
34 | public var x: CGFloat {
35 | switch self {
36 | case let .drop(_, x, _, _, _, _):
37 | return x
38 | }
39 | }
40 | public var y: CGFloat {
41 | switch self {
42 | case let .drop(_, _, y, _, _, _):
43 | return y
44 | }
45 | }
46 | public var b: CGFloat {
47 | switch self {
48 | case let .drop(_, _, _, b, _, _):
49 | return b
50 | }
51 | }
52 | public var s: CGFloat {
53 | switch self {
54 | case let .drop(_, _, _, _, s, _):
55 | return s
56 | }
57 | }
58 | public var alpha: Float {
59 | switch self {
60 | case let .drop(_, _, _, _, _, alpha):
61 | return alpha / 100
62 | }
63 | }
64 |
65 | }
66 |
67 | extension CornerRadius {
68 | public var corners: [(UIRectCorner, CGFloat)] {
69 | switch self {
70 | case let .all(val):
71 | return [(.topLeft, val), (.bottomLeft, val), (.topRight, val), (.bottomRight, val)]
72 | case let .mixed(tl, tr, br, bl):
73 | return [(.topLeft, tl), (.topRight, tr), (.bottomRight, br), (.bottomLeft, bl)]
74 | }
75 | }
76 | }
77 |
78 | extension Stroke {
79 | public var color: UIColor? {
80 | switch self {
81 | case let .center(color, _): return color?.color ?? .white
82 | case let .inside(color, _): return color?.color ?? .white
83 | case let .outside(color, _): return color?.color ?? .white
84 | }
85 | }
86 |
87 | public var adjustedWidth: CGFloat {
88 | switch self {
89 | case let .inside(_, size): return size / 2
90 | case .center: return 0
91 | case let .outside(_, size): return -size / 2
92 | }
93 | }
94 |
95 | public var lineWidth: CGFloat {
96 | switch self {
97 | case let .inside(_, size): return size
98 | case let .center(_, size): return size
99 | case let .outside(_, size): return size
100 | }
101 | }
102 | }
103 |
104 | extension Fill {
105 | public var startPoint: CGPoint? {
106 | switch self {
107 | case .solid:
108 | return nil
109 | case let .linear(_, start, _, _):
110 | return start
111 | }
112 | }
113 | public var endPoint: CGPoint? {
114 | switch self {
115 | case .solid:
116 | return nil
117 | case let .linear(_, _, end, _):
118 | return end
119 | }
120 | }
121 | public var colors: [(ColorType?, CGFloat?)] {
122 | switch self {
123 | case let .solid(color, _):
124 | return [(color, nil)]
125 |
126 | case let .linear(colors, _, _, _):
127 | return colors
128 | }
129 | }
130 | public var type: CAGradientLayerType {
131 | switch self {
132 | default: return .axial
133 | }
134 | }
135 |
136 | public var alpha: CGFloat {
137 | switch self {
138 | case let .solid(_, a):
139 | return a
140 |
141 | case let .linear(_, _, _, a):
142 | return a
143 | }
144 | }
145 | }
146 |
147 |
--------------------------------------------------------------------------------
/Sources/FigmaKit/Types/Typography.swift:
--------------------------------------------------------------------------------
1 | // This is free and unencumbered software released into the public domain.
2 | //
3 | // Anyone is free to copy, modify, publish, use, compile, sell, or
4 | // distribute this software, either in source code form or as a compiled
5 | // binary, for any purpose, commercial or non-commercial, and by any
6 | // means.
7 | //
8 | // In jurisdictions that recognize copyright laws, the author or authors
9 | // of this software dedicate any and all copyright interest in the
10 | // software to the public domain. We make this dedication for the benefit
11 | // of the public at large and to the detriment of our heirs and
12 | // successors. We intend this dedication to be an overt act of
13 | // relinquishment in perpetuity of all present and future rights to this
14 | // software under copyright law.
15 | //
16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19 | // IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
20 | // OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
21 | // ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22 | // OTHER DEALINGS IN THE SOFTWARE.
23 | //
24 | // For more information, please refer to
25 |
26 | import Foundation
27 | import UIKit
28 |
29 | public enum Typography: TypographyType {
30 | case custom(String, weight: Int, style: FontStyle = .normal, size: CGFloat, lineHeight: CGFloat = 0, letter: CGFloat = 0.0)
31 | case system(weight: Int, style: FontStyle = .normal, size: CGFloat, lineHeight: CGFloat = 0, letter: CGFloat = 0.0 )
32 | case font(UIFont, lineHeight: CGFloat = 0, letter: CGFloat = 0.0)
33 | }
34 |
35 | extension Typography {
36 | public enum FontStyle: String {
37 | case normal = ""
38 | case italic = "Italic"
39 | }
40 |
41 | public var font: UIFont {
42 | switch self {
43 | case let .custom(name, weight, style, size, _, _):
44 | let fontName = name + "-" + weight.proxFontWeight.name + style.rawValue
45 | let font = UIFont(name: fontName, size: size) ?? .systemFont(ofSize: size)
46 | if style == .italic, let des = font.fontDescriptor.withSymbolicTraits(.traitItalic) {
47 | return UIFont(descriptor: des, size: 0)
48 | }
49 | return font
50 |
51 | case let .system(weight, style, size, _, _):
52 | let font = UIFont.systemFont(ofSize: size, weight: weight.fontWeight)
53 | if style == .italic, let des = font.fontDescriptor.withSymbolicTraits(.traitItalic) {
54 | return UIFont(descriptor: des, size: 0)
55 | }
56 | return font
57 |
58 | case let .font(font, _, _):
59 | return font
60 |
61 | }
62 | }
63 |
64 | public var lineHeight: CGFloat {
65 | switch self {
66 | case let .custom(_, _, _, _, lineHeight, _):
67 | return lineHeight
68 | case let .font(_, lineHeight, _):
69 | return lineHeight
70 | case let .system(_, _, _, lineHeight, _):
71 | return lineHeight
72 | }
73 | }
74 |
75 | public var letterSpacing: CGFloat {
76 | switch self {
77 | case let .custom(_, _, _, _, _, letter):
78 | return letter
79 | case let .font(_, _, letter):
80 | return letter
81 | case let .system(_, _, _, _, letter):
82 | return letter
83 | }
84 | }
85 | }
86 |
--------------------------------------------------------------------------------
/Tests/FigmaKitTests/ColorTests.swift:
--------------------------------------------------------------------------------
1 | import XCTest
2 | @testable import FigmaKit
3 |
4 | final class ColorTests: XCTestCase {
5 | func testIntColor() {
6 | XCTAssertTrue(UIColor.white == 0x000000.color)
7 | }
8 |
9 | func testStringColor() {
10 | XCTAssertTrue("#123456".color == 0x123456.color)
11 | XCTAssertTrue("123456".color == 0x123456.color)
12 | XCTAssertTrue("".color == nil)
13 | XCTAssertTrue(".".color == nil)
14 | }
15 |
16 | static var allTests = [
17 | ("testIntColor", testIntColor),
18 | ("testStringColor", testStringColor)
19 | ]
20 | }
21 |
--------------------------------------------------------------------------------
/Tests/FigmaKitTests/FigmaKitTests.swift:
--------------------------------------------------------------------------------
1 | import XCTest
2 | @testable import FigmaKit
3 |
4 | final class FigmaKitTests: XCTestCase {
5 | func testExample() {
6 | // This is an example of a functional test case.
7 | // Use XCTAssert and related functions to verify your tests produce the correct
8 | // results.
9 | XCTAssertEqual(FigmaKit().text, "Hello, World!")
10 | }
11 |
12 | static var allTests = [
13 | ("testExample", testExample),
14 | ]
15 | }
16 |
--------------------------------------------------------------------------------
/Tests/FigmaKitTests/XCTestManifests.swift:
--------------------------------------------------------------------------------
1 | import XCTest
2 |
3 | #if !canImport(ObjectiveC)
4 | public func allTests() -> [XCTestCaseEntry] {
5 | return [
6 | testCase(FigmaKitTests.allTests),
7 | ]
8 | }
9 | #endif
10 |
--------------------------------------------------------------------------------
/Tests/LinuxMain.swift:
--------------------------------------------------------------------------------
1 | import XCTest
2 |
3 | import FigmaKitTests
4 |
5 | var tests = [XCTestCaseEntry]()
6 | tests += FigmaKitTests.allTests()
7 | XCTMain(tests)
8 |
--------------------------------------------------------------------------------
/Tools/build.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash -e -u -o pipefail
2 |
3 | # Call with <…other args>
4 | SDK="$1"
5 | SCHEME="$2"
6 | shift 2
7 |
8 | cd "$(dirname "${BASH_SOURCE[0]}")/.."
9 | export PROJECT_ROOT="$(pwd)"
10 |
11 | # Set a local TMPDIR, just in case it affects the build
12 | export TMPDIR="$PROJECT_ROOT/.build/tmp"
13 | mkdir -p "$TMPDIR"
14 |
15 | # Run xcodebuild with specific folders for Derived Data and Cache.
16 | # Those will be cached upon a successful CI workflow.
17 | exec xcodebuild \
18 | -sdk $SDK \
19 | -derivedDataPath .build/derived-data/$SDK \
20 | -clonedSourcePackagesDirPath .build/swift-dependencies/$SDK \
21 | -configuration Debug \
22 | -workspace FigmaKit.xcworkspace \
23 | -scheme "$SCHEME" \
24 | ${1+"$@"} \
25 | CACHE_ROOT="$PROJECT_ROOT/.build/derived-data/$SDK/Cache"
26 |
--------------------------------------------------------------------------------