├── .DS_Store ├── .github ├── FUNDING.yml └── ISSUE_TEMPLATE │ ├── bug_report.md │ ├── feature_request.md │ └── improvement-request.md ├── .gitignore ├── LICENSE ├── README.md ├── Shared ├── Assets.xcassets │ ├── AccentColor.colorset │ │ └── Contents.json │ ├── AppIcon.appiconset │ │ └── Contents.json │ └── Contents.json ├── Previewer.swift ├── ViewTemplate-dontDelete.swift ├── Views │ ├── CardWithData.swift │ ├── CardWithImage.swift │ ├── CircleGraph.swift │ ├── Colors.swift │ ├── ComparedProgress.swift │ ├── GraphView.swift │ ├── LineGraph.swift │ ├── LoadingView.swift │ ├── NeumorphButton.swift │ ├── RoundedButton.swift │ ├── SFSymbolRoundedButton.swift │ ├── SquircleGraphIcon.swift │ ├── TableCellImage.swift │ └── TwitterLike.swift └── swiftUIViewsApp.swift ├── iOS └── Info.plist ├── imgs ├── .DS_Store ├── GithubCover.jpg └── twitterLike_example.gif ├── macOS ├── Info.plist └── macOS.entitlements ├── swiftUIViews.entitlements └── swiftUIViews.xcodeproj ├── project.pbxproj ├── project.xcworkspace ├── contents.xcworkspacedata ├── xcshareddata │ └── IDEWorkspaceChecks.plist └── xcuserdata │ └── roblack.xcuserdatad │ └── UserInterfaceState.xcuserstate ├── xcshareddata └── xcschemes │ └── swiftUIViews (macOS).xcscheme └── xcuserdata └── roblack.xcuserdatad └── xcschemes └── xcschememanagement.plist /.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emin-grbo/swiftUIViews/c01d6d8698ef6940e899bbd2bc9ee6ac0ccd8f72/.DS_Store -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | github: [roblack] 4 | patreon: swiftui 5 | ko_fi: swiftui 6 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | title: "[BUG]" 5 | labels: bug 6 | assignees: roblack 7 | 8 | --- 9 | 10 | **Describe the bug** 11 | A clear and concise description of what the bug is. 12 | 13 | **To Reproduce** 14 | Steps to reproduce the behavior: 15 | 1. Go to '...' 16 | 2. Click on '....' 17 | 3. Scroll down to '....' 18 | 4. See error 19 | 20 | **Expected behavior** 21 | A clear and concise description of what you expected to happen. 22 | 23 | **Screenshots** 24 | If applicable, add screenshots to help explain your problem. 25 | 26 | **Additional context** 27 | Add any other context about the problem here. 28 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project 4 | title: "[FEATURE]" 5 | labels: enhancement 6 | assignees: roblack 7 | 8 | --- 9 | 10 | **Is your feature request related to a problem? Please describe.** 11 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] 12 | 13 | **Describe the proposed solution** 14 | A clear and concise description of what you want to happen. 15 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/improvement-request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Improvement request 3 | about: Suggest an idea for codebase improvement 4 | title: "[IMPROVEMENT]" 5 | labels: question 6 | assignees: roblack 7 | 8 | --- 9 | 10 | **Is your improvement request related to a problem? Please describe.** 11 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] 12 | 13 | **Describe the solution you'd like** 14 | A clear and concise description of what you want to happen. 15 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | 2 | # Created by https://www.toptal.com/developers/gitignore/api/xcode,swift 3 | # Edit at https://www.toptal.com/developers/gitignore?templates=xcode,swift 4 | 5 | ### Swift ### 6 | # Xcode 7 | # 8 | # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore 9 | 10 | ## User settings 11 | xcuserdata/ 12 | *.xcuserdata 13 | *.xcuserstate 14 | 15 | ## compatibility with Xcode 8 and earlier (ignoring not required starting Xcode 9) 16 | *.xcscmblueprint 17 | *.xccheckout 18 | 19 | ## compatibility with Xcode 3 and earlier (ignoring not required starting Xcode 4) 20 | build/ 21 | DerivedData/ 22 | *.moved-aside 23 | *.pbxuser 24 | !default.pbxuser 25 | *.mode1v3 26 | !default.mode1v3 27 | *.mode2v3 28 | !default.mode2v3 29 | *.perspectivev3 30 | !default.perspectivev3 31 | 32 | ## Obj-C/Swift specific 33 | *.hmap 34 | 35 | ## App packaging 36 | *.ipa 37 | *.dSYM.zip 38 | *.dSYM 39 | 40 | ## Playgrounds 41 | timeline.xctimeline 42 | playground.xcworkspace 43 | 44 | # Swift Package Manager 45 | # Add this line if you want to avoid checking in source code from Swift Package Manager dependencies. 46 | # Packages/ 47 | # Package.pins 48 | # Package.resolved 49 | # *.xcodeproj 50 | # Xcode automatically generates this directory with a .xcworkspacedata file and xcuserdata 51 | # hence it is not needed unless you have added a package configuration file to your project 52 | # .swiftpm 53 | 54 | .build/ 55 | 56 | # CocoaPods 57 | # We recommend against adding the Pods directory to your .gitignore. However 58 | # you should judge for yourself, the pros and cons are mentioned at: 59 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control 60 | # Pods/ 61 | # Add this line if you want to avoid checking in source code from the Xcode workspace 62 | # *.xcworkspace 63 | 64 | # Carthage 65 | # Add this line if you want to avoid checking in source code from Carthage dependencies. 66 | # Carthage/Checkouts 67 | 68 | Carthage/Build/ 69 | 70 | # Add this lines if you are using Accio dependency management (Deprecated since Xcode 12) 71 | # Dependencies/ 72 | # .accio/ 73 | 74 | # fastlane 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 | # After new code Injection tools there's a generated folder /iOSInjectionProject 87 | # https://github.com/johnno1962/injectionforxcode 88 | 89 | iOSInjectionProject/ 90 | 91 | ### Xcode ### 92 | # Xcode 93 | # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore 94 | 95 | 96 | 97 | 98 | ## Gcc Patch 99 | /*.gcno 100 | 101 | ### Xcode Patch ### 102 | *.xcodeproj/* 103 | !*.xcodeproj/project.pbxproj 104 | !*.xcodeproj/xcshareddata/ 105 | !*.xcworkspace/contents.xcworkspacedata 106 | **/xcshareddata/WorkspaceSettings.xcsettings 107 | 108 | # End of https://www.toptal.com/developers/gitignore/api/xcode,swift 109 | *.xcuserstate 110 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 swiftUIviews.dev 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | ![Header](https://img.shields.io/badge/platform-iOS-green.svg) 3 | ![Header](https://img.shields.io/badge/swift-5.2-orange.svg) 4 | ![Header](https://img.shields.io/badge/xCode-12.5-blue.svg) 5 | 6 | ![Header](https://github.com/roblack/swiftUIViews/blob/main/imgs/GithubCover.jpg) 7 | 8 | # swiftUIViews | [👋](swiftUIViews.dev) 9 | 10 | swiftUIviews is an online collection of beautifly designed swiftUIViews by the swift community. 11 | Feelin like contributing? Follow the instructions below! 12 | 13 | 14 | ## Contributing 15 | 16 | First of all, THANK YOU! 🎉 17 | Any type of contributions are more than welcome, no matter the skill level. 18 | 19 | I am working on a detailed WIKI for contribution instructions, but for now: 20 | - fork the repo and post the PR 21 | - try to keep the same style as for other views 22 | - use ViewTemplate.swift file as...you guessed it, a temaplate 23 | - design is paramount here, but even if the design is not up to par, i can hop in and modify it further, so no worries in regards to your design skills. 24 | - not all views will be approved to avoid over-saturation in certain types of views. So please keep that in mind 🙃 25 | -------------------------------------------------------------------------------- /Shared/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 | -------------------------------------------------------------------------------- /Shared/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 | "idiom" : "mac", 95 | "scale" : "1x", 96 | "size" : "16x16" 97 | }, 98 | { 99 | "idiom" : "mac", 100 | "scale" : "2x", 101 | "size" : "16x16" 102 | }, 103 | { 104 | "idiom" : "mac", 105 | "scale" : "1x", 106 | "size" : "32x32" 107 | }, 108 | { 109 | "idiom" : "mac", 110 | "scale" : "2x", 111 | "size" : "32x32" 112 | }, 113 | { 114 | "idiom" : "mac", 115 | "scale" : "1x", 116 | "size" : "128x128" 117 | }, 118 | { 119 | "idiom" : "mac", 120 | "scale" : "2x", 121 | "size" : "128x128" 122 | }, 123 | { 124 | "idiom" : "mac", 125 | "scale" : "1x", 126 | "size" : "256x256" 127 | }, 128 | { 129 | "idiom" : "mac", 130 | "scale" : "2x", 131 | "size" : "256x256" 132 | }, 133 | { 134 | "idiom" : "mac", 135 | "scale" : "1x", 136 | "size" : "512x512" 137 | }, 138 | { 139 | "idiom" : "mac", 140 | "scale" : "2x", 141 | "size" : "512x512" 142 | } 143 | ], 144 | "info" : { 145 | "author" : "xcode", 146 | "version" : 1 147 | } 148 | } 149 | -------------------------------------------------------------------------------- /Shared/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /Shared/Previewer.swift: -------------------------------------------------------------------------------- 1 | /* Use this view only for preview. All view data must be contained within one .swift file, 2 | but here you can place it for preview and its quite ok to leave it there. */ 3 | 4 | import SwiftUI 5 | 6 | fileprivate let lightBgColor = Color(.displayP3, red: 0.9764, green: 0.9803, blue: 0.9882, opacity: 1.0) 7 | fileprivate let darkBgColor = Color(.displayP3, red: 0.1176, green: 0.0784, blue: 0.1725, opacity: 1.0) 8 | 9 | struct Previewer: View { 10 | @Environment(\.colorScheme) var colorScheme 11 | 12 | var body: some View { 13 | 14 | let baseBGColor = colorScheme == .dark ? darkBgColor : lightBgColor 15 | 16 | ZStack { 17 | baseBGColor 18 | GraphView() // idealy you would only change this line. 19 | .frame(width: 200) 20 | } 21 | .edgesIgnoringSafeArea(.all) 22 | } 23 | } 24 | 25 | struct Previewer_Previews: PreviewProvider { 26 | static var previews: some View { 27 | Previewer() 28 | .frame(width: 500, height: 500) 29 | .previewLayout(PreviewLayout.sizeThatFits) 30 | .previewDisplayName("Preview") 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /Shared/ViewTemplate-dontDelete.swift: -------------------------------------------------------------------------------- 1 | #warning(""" 2 | CONTRIBUTORS 📣: I marked some warning below so you would know which parts to edit. 3 | It is really important to keep more or less same style of code throughout the site, 4 | so you will most likely change the code below line #45, and initialize that view on line #38. 5 | Once you are done, feel free to delete warnings in this file. 6 | Happy designing!! 7 | """) 8 | 9 | // MARK: IMPORTANT🚨 10 | /* For easy of copy/pastability, all code is in one big chunk. 11 | Be a dear and refactor this out any way you see fit 🤘 */ 12 | 13 | /* Idealy, you would NOT be using pre-defined constants in this way, so keep that in mind.*/ 14 | 15 | import SwiftUI 16 | 17 | /* Defining all constants used in the view.*/ 18 | fileprivate let lBgColor = Color(.displayP3, red: 248/255, green: 250/255, blue: 251/255, opacity: 1.0) 19 | fileprivate let dBgColor = Color(.displayP3, red: 29/255, green: 19/255, blue: 44/255, opacity: 1.0) 20 | fileprivate var defaultRadius: CGFloat = 18 21 | 22 | struct YOURVIEW: View { 23 | var body: some View { 24 | VStack { 25 | // your view 26 | } 27 | } 28 | } 29 | 30 | struct YOURVIEW_Previews: PreviewProvider { 31 | static var previews: some View { 32 | Group { 33 | YOURVIEW() 34 | .padding(100) 35 | .previewLayout(PreviewLayout.sizeThatFits) 36 | .preferredColorScheme(.light) 37 | .background(lBgColor) 38 | YOURVIEW() 39 | .padding(100) 40 | .previewLayout(PreviewLayout.sizeThatFits) 41 | .preferredColorScheme(.dark) 42 | .background(dBgColor) 43 | } 44 | } 45 | } 46 | 47 | /* 48 | Awesome Sauce! 49 | Thank you for getting one of my views, hope you are happy with it 👌 50 | Consider helping this train rollin 🚂 on my Patreon -> https://www.patreon.com/swiftui 51 | 52 | If you have any suggestions for improvements, 53 | feel free to reach me at undead.pix3l@gmail.com 54 | */ 55 | -------------------------------------------------------------------------------- /Shared/Views/CardWithData.swift: -------------------------------------------------------------------------------- 1 | // MARK: IMPORTANT🚨 2 | /* For easy of copy/pastability, all code is in one big chunk. 3 | Be a dear and refactor this out any way you see fit 🤘 */ 4 | 5 | /* Idealy, you would NOT be using pre-defined constants in this way, so keep that in mind.*/ 6 | 7 | import SwiftUI 8 | 9 | /* Defining all constants used in the view.*/ 10 | fileprivate var defaultRadius: CGFloat = 24 11 | fileprivate var basePadding: CGFloat = 16 12 | 13 | fileprivate let lBgColor = Color(.displayP3, red: 248/255, green: 250/255, blue: 251/255, opacity: 1.0) 14 | fileprivate let dBgColor = Color(.displayP3, red: 29/255, green: 19/255, blue: 44/255, opacity: 1.0) 15 | fileprivate let lShadowColor = Color(.displayP3, red: 242/255, green: 242/255, blue: 1, opacity: 1.0) 16 | fileprivate let dShadowColor = Color(.displayP3, red: 45/255, green: 26/255, blue: 88/255, opacity: 1.0) 17 | fileprivate let lBaseColor = Color(.displayP3, red: 1, green: 1, blue: 1, opacity: 1.0) 18 | fileprivate let dBaseColor = Color(.displayP3, red: 30/255, green: 17/255, blue: 44/255, opacity: 1.0) 19 | fileprivate let lTextColor = Color(.displayP3, red: 30/255, green: 21/255, blue: 49/255, opacity: 1.0) 20 | fileprivate let dTextColor = Color(.displayP3, red: 1, green: 1, blue: 1, opacity: 1.0) 21 | 22 | fileprivate let pinkAccentColor = Color(.displayP3, red: 1, green: 10/255, blue: 142/255, opacity: 1.0) 23 | 24 | fileprivate let titleFont = Font.system(size: 24, weight: .bold, design: .rounded) 25 | fileprivate let detailFont = Font.system(size: 18, weight: .semibold, design: .rounded) 26 | fileprivate let subtitleFont = Font.system(size: 16, weight: .medium, design: .rounded) 27 | 28 | struct CardWithData: View { 29 | 30 | /* 31 | Environtment is used just to make it easier to preview light and dark look in one view setup. 32 | You should create a new semantic color in the assets and use it that way 👌 33 | */ 34 | @Environment(\.colorScheme) var colorScheme 35 | 36 | var body: some View { 37 | 38 | let shadowColor = colorScheme == .dark ? dShadowColor : lShadowColor 39 | let baseColor = colorScheme == .dark ? dBaseColor : lBaseColor 40 | let textColor = colorScheme == .dark ? dTextColor : lTextColor 41 | 42 | ZStack { 43 | RoundedRectangle(cornerRadius: defaultRadius, style: .continuous) 44 | .foregroundColor(baseColor) 45 | .shadow(color: shadowColor, radius: defaultRadius) 46 | VStack(alignment: .leading) { 47 | HStack { 48 | Text("title text") 49 | .font(subtitleFont) 50 | .foregroundColor(textColor) 51 | Spacer() 52 | // MARK: Top right icon 53 | Image(systemName: "bolt.circle.fill") 54 | .resizable() 55 | .aspectRatio(contentMode: .fit) 56 | .foregroundColor(pinkAccentColor) 57 | .frame(width: 32, height: 32) 58 | } 59 | 60 | Spacer() 61 | 62 | Text("123,-") 63 | .font(titleFont) 64 | .foregroundColor(textColor) 65 | 66 | Spacer() 67 | 68 | VStack(alignment: .leading) { 69 | Text("item title") 70 | .font(titleFont) 71 | .foregroundColor(textColor) 72 | Text("item subtitle") 73 | .font(detailFont) 74 | .foregroundColor(textColor) 75 | .opacity(0.5) 76 | } 77 | } 78 | .padding(24) 79 | } 80 | .frame(height: 200) 81 | } 82 | } 83 | 84 | struct CardWithData_Previews: PreviewProvider { 85 | static var previews: some View { 86 | Group { 87 | CardWithData() 88 | .padding(100) 89 | .previewLayout(PreviewLayout.sizeThatFits) 90 | .preferredColorScheme(.light) 91 | .background(lBgColor) 92 | CardWithData() 93 | .padding(100) 94 | .previewLayout(PreviewLayout.sizeThatFits) 95 | .preferredColorScheme(.dark) 96 | .background(dBgColor) 97 | } 98 | } 99 | } 100 | 101 | /* 102 | Awesome Sauce! 103 | Thank you for getting one of my views, hope you are happy with it 👌 104 | Consider helping this train rollin 🚂 on my Patreon -> https://www.patreon.com/swiftui 105 | 106 | If you have any suggestions for improvements, 107 | feel free to reach me at undead.pix3l@gmail.com 108 | */ 109 | -------------------------------------------------------------------------------- /Shared/Views/CardWithImage.swift: -------------------------------------------------------------------------------- 1 | // MARK: IMPORTANT🚨 2 | /* For easy of copy/pastability, all code is in one big chunk. 3 | Be a dear and refactor this out any way you see fit 🤘 */ 4 | 5 | /* Idealy, you would NOT be using pre-defined constants in this way, so keep that in mind.*/ 6 | 7 | import SwiftUI 8 | 9 | /* Defining all constants used in the view.*/ 10 | fileprivate var defaultRadius: CGFloat = 24 11 | fileprivate var basePadding: CGFloat = 16 12 | 13 | fileprivate let lBgColor = Color(.displayP3, red: 248/255, green: 250/255, blue: 251/255, opacity: 1.0) 14 | fileprivate let dBgColor = Color(.displayP3, red: 29/255, green: 19/255, blue: 44/255, opacity: 1.0) 15 | fileprivate let lShadowColor = Color(.displayP3, red: 242/255, green: 242/255, blue: 1, opacity: 1.0) 16 | fileprivate let dShadowColor = Color(.displayP3, red: 45/255, green: 26/255, blue: 88/255, opacity: 1.0) 17 | fileprivate let lBaseColor = Color(.displayP3, red: 1, green: 1, blue: 1, opacity: 1.0) 18 | fileprivate let dBaseColor = Color(.displayP3, red: 30/255, green: 17/255, blue: 44/255, opacity: 1.0) 19 | fileprivate let lTextColor = Color(.displayP3, red: 30/255, green: 21/255, blue: 49/255, opacity: 1.0) 20 | fileprivate let dTextColor = Color(.displayP3, red: 1, green: 1, blue: 1, opacity: 1.0) 21 | 22 | fileprivate let pinkAccentColor = Color(.displayP3, red: 1, green: 10/255, blue: 142/255, opacity: 1.0) 23 | fileprivate let yellowAccentColor = Color(.displayP3, red: 1, green: 0.7843, blue: 0, opacity: 1.0) 24 | 25 | fileprivate let titleFont = Font.system(size: 24, weight: .bold, design: .rounded) 26 | fileprivate let detailFont = Font.system(size: 18, weight: .semibold, design: .rounded) 27 | fileprivate let subtitleFont = Font.system(size: 16, weight: .medium, design: .rounded) 28 | 29 | struct CardWithImage: View { 30 | /* 31 | Environtment is used just to make it easier to preview light and dark look in one view setup. 32 | You should create a new semantic color in the assets and use it that way 👌 33 | */ 34 | @Environment(\.colorScheme) var colorScheme 35 | 36 | var body: some View { 37 | 38 | let shadowColor = colorScheme == .dark ? dShadowColor : lShadowColor 39 | let baseColor = colorScheme == .dark ? dBaseColor : lBaseColor 40 | let textColor = colorScheme == .dark ? dTextColor : lTextColor 41 | let accent = colorScheme == .dark ? yellowAccentColor : pinkAccentColor 42 | 43 | ZStack { 44 | RoundedRectangle(cornerRadius: defaultRadius, style: .continuous) 45 | .foregroundColor(baseColor) 46 | .shadow(color: shadowColor, radius: defaultRadius) 47 | 48 | VStack { 49 | Text("title") 50 | .font(titleFont) 51 | .foregroundColor(accent) 52 | .padding(.top, basePadding) 53 | 54 | Image(systemName: "photo.fill.on.rectangle.fill") 55 | .resizable() 56 | .aspectRatio(contentMode: .fit) 57 | .foregroundColor(accent) 58 | .padding(basePadding) 59 | 60 | // MARK: Name and Category ------------------ 61 | Text("detail") 62 | .font(detailFont) 63 | .foregroundColor(textColor) 64 | Text("subtitle") 65 | .font(subtitleFont) 66 | .foregroundColor(textColor) 67 | .padding(.bottom, basePadding) 68 | .opacity(0.8) 69 | } 70 | } 71 | .frame(width: 160, height: 180) 72 | } 73 | } 74 | 75 | struct CardWithImage_Previews: PreviewProvider { 76 | static var previews: some View { 77 | Group { 78 | CardWithImage() 79 | .padding(100) 80 | .previewLayout(PreviewLayout.sizeThatFits) 81 | .preferredColorScheme(.light) 82 | .background(lBgColor) 83 | CardWithImage() 84 | .padding(100) 85 | .previewLayout(PreviewLayout.sizeThatFits) 86 | .preferredColorScheme(.dark) 87 | .background(dBgColor) 88 | } 89 | } 90 | } 91 | 92 | /* 93 | Awesome Sauce! 94 | Thank you for getting one of my views, hope you are happy with it 👌 95 | Consider helping this train rollin 🚂 on my Patreon -> https://www.patreon.com/swiftui 96 | 97 | If you have any suggestions for improvements, 98 | feel free to reach me at undead.pix3l@gmail.com 99 | */ 100 | -------------------------------------------------------------------------------- /Shared/Views/CircleGraph.swift: -------------------------------------------------------------------------------- 1 | // MARK: IMPORTANT🚨 2 | /* For easy of copy/pastability, all code is in one big chunk. 3 | Be a dear and refactor this out any way you see fit 🤘 */ 4 | 5 | /* Idealy, you would NOT be using pre-defined constants in this way, so keep that in mind.*/ 6 | 7 | import SwiftUI 8 | 9 | /* Defining all constants used in the view.*/ 10 | fileprivate let baseSize: CGFloat = 300 11 | fileprivate let lineWidth: CGFloat = 40 12 | fileprivate let shadowRadius: CGFloat = 20 13 | fileprivate let imageFontSize: CGFloat = 50 14 | fileprivate let textFontSize: CGFloat = 80 15 | fileprivate let completionStart: CGFloat = 0 16 | 17 | fileprivate let lightShadowColor = Color(.displayP3, red: 0.70, green: 0.70, blue: 1, opacity: 1.0) 18 | fileprivate let darkShadowColor = Color(.displayP3, red: 0.3137, green: 0.1294, blue: 0.6980, opacity: 1.0) 19 | fileprivate let baseAccentColor = Color(.displayP3, red: 0.39, green: 0.1, blue: 0.9, opacity: 1.0) 20 | fileprivate let shadowColor = Color(.displayP3, red: 0.9, green: 0.9, blue: 1, opacity: 1.0) 21 | //------------------- REFACTOR ABOVE THIS LINE --------------------------------------- 22 | 23 | struct CircleGraph: View { 24 | 25 | /* 26 | Environtment is used just to make it easier to preview light and dark look in one view setup. 27 | You should create a new semantic color in the assets and use it that way 👌 28 | */ 29 | @Environment(\.colorScheme) var colorScheme 30 | let value: CGFloat 31 | 32 | var body: some View { 33 | 34 | let shadowColor = colorScheme == .dark ? darkShadowColor : lightShadowColor 35 | 36 | ZStack { 37 | ZStack { 38 | Circle() 39 | .fill(Color.white) 40 | .frame(width: baseSize, height: baseSize) 41 | .shadow(color: shadowColor, radius: shadowRadius) 42 | VStack { 43 | Image(systemName: "chart.bar.fill") 44 | .font(Font.system(size: imageFontSize, weight: .black, design: .rounded)) 45 | Text("\(Int(value))") 46 | .font(Font.system(size: textFontSize, weight: .heavy, design: .rounded)) 47 | } 48 | .foregroundColor(baseAccentColor) 49 | } 50 | Circle() 51 | .trim(from: completionStart, to: value/100) 52 | .stroke(baseAccentColor, 53 | style: StrokeStyle(lineWidth: lineWidth, lineCap: CGLineCap.round)) 54 | .frame(width: baseSize + lineWidth, height: baseSize + lineWidth) 55 | .rotationEffect(.degrees(-90)) 56 | .shadow(color: shadowColor, radius: shadowRadius) 57 | } 58 | } 59 | } 60 | 61 | struct CircleGraph_Previews: PreviewProvider { 62 | struct CircleGraphDemo: View { 63 | @State var value: CGFloat = 50 64 | 65 | var body: some View { 66 | VStack { 67 | CircleGraph(value: value) 68 | .padding(.bottom, 30) 69 | 70 | Slider(value: $value, in: 0...100, step: 1) 71 | } 72 | } 73 | } 74 | 75 | static var previews: some View { 76 | Group { 77 | CircleGraphDemo(value: 50) 78 | .padding(100) 79 | .previewLayout(PreviewLayout.sizeThatFits) 80 | .preferredColorScheme(.light) 81 | 82 | CircleGraphDemo(value: 75) 83 | .padding(100) 84 | .previewLayout(PreviewLayout.sizeThatFits) 85 | .preferredColorScheme(.dark) 86 | } 87 | } 88 | } 89 | 90 | /* 91 | Awesome Sauce! 92 | Thank you for getting one of my views, hope you are happy with it 👌 93 | Consider helping this train rollin 🚂 on my Patreon -> https://www.patreon.com/swiftui 94 | 95 | If you have any suggestions for improvements, 96 | feel free to reach me at undead.pix3l@gmail.com 97 | */ 98 | -------------------------------------------------------------------------------- /Shared/Views/Colors.swift: -------------------------------------------------------------------------------- 1 | /* 2 | This is just a "holder" of sorts for colors re-used throughout the project. 3 | Like a stash? 😐 4 | */ 5 | 6 | import SwiftUI 7 | 8 | struct Colors { 9 | fileprivate let lightBaseColor = Color(.displayP3, red: 0, green: 0, blue: 0, opacity: 1.0) 10 | fileprivate let darkBaseColor = Color(.displayP3, red: 0.0666, green: 0.0274, blue: 0.1098, opacity: 1.0) 11 | 12 | fileprivate let lightBgColor = Color(.displayP3, red: 0.9764, green: 0.9803, blue: 0.9882, opacity: 1.0) 13 | fileprivate let darkBgColor = Color(.displayP3, red: 0.1176, green: 0.0784, blue: 0.1725, opacity: 1.0) 14 | 15 | fileprivate let lightShadowColor = Color(.displayP3, red: 0.95, green: 0.95, blue: 1, opacity: 1.0) 16 | fileprivate let darkShadowColor = Color(.displayP3, red: 0.1803, green: 0.0470, blue: 0.4627, opacity: 1.0) 17 | 18 | fileprivate let textColor = Color(.displayP3, red: 0.117, green: 0.125, blue: 0.192, opacity: 1.0) 19 | fileprivate let purpleAccentColor = Color(.displayP3, red: 0.39, green: 0.1, blue: 0.9, opacity: 1.0) 20 | fileprivate let pinkAccentColor = Color(.displayP3, red: 1, green: 0.04, blue: 0.56, opacity: 1.0) 21 | fileprivate let blueAccentColor = Color(.displayP3, red: 0.011, green: 0.631, blue: 0.984, opacity: 1.0) 22 | fileprivate let yellowAccent = Color(.displayP3, red: 0.9647, green: 0.7607, blue: 0.3294, opacity: 1.0) 23 | fileprivate let orangeAccent = Color(.displayP3, red: 0.9882, green: 0.4470, blue: 0.1764, opacity: 1.0) 24 | fileprivate let greenAccent = Color(.displayP3, red: 0.2156, green: 0.9607, blue: 0.7843, opacity: 1.0) 25 | } 26 | -------------------------------------------------------------------------------- /Shared/Views/ComparedProgress.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ComparedProgress.swift 3 | // swiftUIViews (iOS) 4 | // 5 | // MARK: IMPORTANT🚨 6 | /* For easy of copy/pastability, all code is in one big chunk. 7 | Be a dear and refactor this out any way you see fit 🤘 */ 8 | 9 | /* Idealy, you would NOT be using pre-defined constants in this way, so keep that in mind.*/ 10 | 11 | import SwiftUI 12 | 13 | /* Defining all constants used in the view.*/ 14 | fileprivate let lBgColor = Color(.displayP3, red: 248/255, green: 250/255, blue: 251/255, opacity: 1.0) 15 | fileprivate let dBgColor = Color(.displayP3, red: 29/255, green: 19/255, blue: 44/255, opacity: 1.0) 16 | fileprivate let lShadowColor = Color(.displayP3, red: 242/255, green: 242/255, blue: 1, opacity: 1.0) 17 | fileprivate let dShadowColor = Color(.displayP3, red: 45/255, green: 26/255, blue: 88/255, opacity: 1.0) 18 | fileprivate let lBaseColor = Color(.displayP3, red: 1, green: 1, blue: 1, opacity: 1.0) 19 | fileprivate let dBaseColor = Color(.displayP3, red: 30/255, green: 17/255, blue: 44/255, opacity: 1.0) 20 | 21 | fileprivate let pinkAccentColor = Color(.displayP3, red: 1, green: 10/255, blue: 142/255, opacity: 1.0) 22 | fileprivate let purpleAccentColor = Color(.displayP3, red: 0.39, green: 0.1, blue: 0.9, opacity: 1.0) 23 | 24 | fileprivate let detailFont = Font.system(size: 18, weight: .semibold, design: .rounded) 25 | 26 | struct ComparedProgress: View { 27 | /* 28 | Environtment is used just to make it easier to preview light and dark look in one view setup. 29 | You should create a new semantic color in the assets and use it that way 👌 30 | */ 31 | @Environment(\.colorScheme) var colorScheme 32 | 33 | var body: some View { 34 | 35 | let shadowColor = colorScheme == .dark ? dShadowColor : lShadowColor 36 | let baseColor = colorScheme == .dark ? dBaseColor : lBaseColor 37 | 38 | ZStack { 39 | RoundedRectangle(cornerRadius: 24, style: .continuous) 40 | .foregroundColor(baseColor) 41 | .shadow(color: shadowColor, radius: 24) 42 | VStack { 43 | ZStack { 44 | HStack(spacing: 0) { 45 | Capsule() 46 | .fill(pinkAccentColor) 47 | .frame(height: 8) 48 | Capsule() 49 | .fill(purpleAccentColor) 50 | .frame(height: 8) 51 | } 52 | .padding(.bottom, 16) 53 | 54 | VStack { 55 | RoundedRectangle(cornerRadius: 24) 56 | .fill(pinkAccentColor) 57 | .frame(width: 4, height: 32) 58 | RoundedRectangle(cornerRadius: 32) 59 | .fill(pinkAccentColor) 60 | .frame(width: 4, height: 6) 61 | } 62 | } 63 | Text("not bad") 64 | .font(detailFont) 65 | } 66 | .padding(50) 67 | } 68 | .padding(50) 69 | .frame(height: 100) 70 | } 71 | } 72 | 73 | struct ComparedProgress_Previews: PreviewProvider { 74 | static var previews: some View { 75 | Group { 76 | ComparedProgress() 77 | .padding(50) 78 | .previewLayout(PreviewLayout.sizeThatFits) 79 | .preferredColorScheme(.light) 80 | .background(lBgColor) 81 | ComparedProgress() 82 | .padding(50) 83 | .previewLayout(PreviewLayout.sizeThatFits) 84 | .preferredColorScheme(.dark) 85 | .background(dBgColor) 86 | } 87 | } 88 | } 89 | 90 | 91 | /* 92 | Awesome Sauce! 93 | Thank you for getting one of my views, hope you are happy with it 👌 94 | Consider helping this train rollin 🚂 on my Patreon -> https://www.patreon.com/swiftui 95 | 96 | If you have any suggestions for improvements, 97 | feel free to reach me at undead.pix3l@gmail.com 98 | */ 99 | -------------------------------------------------------------------------------- /Shared/Views/GraphView.swift: -------------------------------------------------------------------------------- 1 | // MARK: IMPORTANT🚨 2 | /* For easy of copy/pastability, all code is in one big chunk. 3 | Be a dear and refactor this out any way you see fit 🤘 */ 4 | 5 | /* Idealy, you would NOT be using pre-defined constants in this way, so keep that in mind.*/ 6 | 7 | import SwiftUI 8 | 9 | /* Defining all constants used in the view.*/ 10 | fileprivate let lightBgColor = Color(.displayP3, red: 248/255, green: 250/255, blue: 251/255, opacity: 1.0) 11 | fileprivate let darkBgColor = Color(.displayP3, red: 29/255, green: 19/255, blue: 44/255, opacity: 1.0) 12 | fileprivate let lightBaseColor = Color(.displayP3, red: 1, green: 1, blue: 1, opacity: 1.0) 13 | fileprivate let darkBaseColor = Color(.displayP3, red: 30/255, green: 17/255, blue: 44/255, opacity: 1.0) 14 | fileprivate let lShadowColor = Color(.displayP3, red: 242/255, green: 242/255, blue: 1, opacity: 1.0) 15 | fileprivate let dShadowColor = Color(.displayP3, red: 45/255, green: 26/255, blue: 88/255, opacity: 1.0) 16 | 17 | fileprivate let darkFirstColor = Color(.displayP3, red: 1, green: 10/255, blue: 142/255, opacity: 1.0) 18 | fileprivate let darkSecondColor = Color(.displayP3, red: 0.39, green: 0.1, blue: 0.9, opacity: 1.0) 19 | fileprivate let lightFirstColor = Color(.displayP3, red: 225/255, green: 225/255, blue: 255/255, opacity: 1.0) 20 | fileprivate let lightSecondColor = Color(.displayP3, red: 235/255, green: 235/255, blue: 255/255, opacity: 1.0) 21 | 22 | fileprivate let lightGradient = LinearGradient(gradient: Gradient(colors: [lightFirstColor, lightSecondColor]), 23 | startPoint: .leading, endPoint: .trailing) 24 | fileprivate let darkGradient = LinearGradient(gradient: Gradient(colors: [darkFirstColor, darkSecondColor]), 25 | startPoint: .leading, endPoint: .trailing) 26 | fileprivate let points: Array = [ 27 | 140, 28 | 90, 29 | 150, 30 | 50, 31 | 150, 32 | 90 33 | ] 34 | 35 | struct GraphView: View { 36 | /* 37 | Environtment is used just to make it easier to preview light and dark look in one view setup. 38 | You should create a new semantic color in the assets and use it that way 👌 39 | */ 40 | @Environment(\.colorScheme) var colorScheme 41 | 42 | var body: some View { 43 | 44 | let baseColor = colorScheme == .dark ? darkBaseColor : lightBaseColor 45 | let lineColor = colorScheme == .dark ? .white : darkSecondColor 46 | let gradinet = colorScheme == .dark ? darkGradient : lightGradient 47 | let shadowColor = colorScheme == .dark ? dShadowColor : lShadowColor 48 | 49 | ZStack { 50 | Rectangle() 51 | .fill(baseColor) 52 | .cornerRadius(32) 53 | GraphBase() 54 | .fill(gradinet) 55 | .mask(Rectangle().cornerRadius(32)) 56 | .opacity(0.8) 57 | GraphLine() 58 | .stroke(lineColor, style: StrokeStyle(lineWidth: 8, lineCap: CGLineCap.round)) 59 | } 60 | .frame(height: 200) 61 | .shadow(color: shadowColor, radius: 24) 62 | } 63 | } 64 | 65 | struct GraphLine: Shape { 66 | func path(in rect: CGRect) -> Path { 67 | let stepWidth = rect.width / CGFloat(points.count - 1) 68 | return Path.quadCurvedPathWithPoints(points: points, 69 | step: CGPoint(x: stepWidth, 70 | y: 1)) 71 | } 72 | } 73 | 74 | 75 | struct GraphBase: Shape { 76 | func path(in rect: CGRect) -> Path { 77 | let stepWidth = rect.width / CGFloat(points.count - 1) 78 | var path = Path.quadCurvedPathWithPoints(points: points, 79 | step: CGPoint(x: stepWidth, 80 | y: 1)) 81 | path.addLine(to: CGPoint(x: rect.maxX, y: rect.maxY)) 82 | path.addLine(to: CGPoint(x: 0, y: rect.maxY)) 83 | path.addLine(to: CGPoint(x: 0, y: 160)) 84 | 85 | return path 86 | } 87 | } 88 | 89 | extension Path { 90 | 91 | static func quadCurvedPathWithPoints(points: Array, step: CGPoint) -> Path { 92 | 93 | var path = Path() 94 | 95 | if points.count < 2 { 96 | return path 97 | } 98 | 99 | var p1 = CGPoint(x: 0, y: CGFloat(points[0]) * step.y) 100 | path.move(to: p1) 101 | 102 | for pointIndex in 1.. CGPoint { 118 | return CGPoint(x: (p1.x + p2.x) / 2,y: (p1.y + p2.y) / 2) 119 | } 120 | 121 | static func controlPointForPoints(p1: CGPoint, p2: CGPoint) -> CGPoint { 122 | 123 | var controlPoint = CGPoint.midPointForPoints(p1:p1, p2:p2) 124 | let diffY = abs(p2.y - controlPoint.y) 125 | 126 | if p1.y < p2.y { 127 | controlPoint.y += diffY 128 | } else if p1.y > p2.y { 129 | controlPoint.y -= diffY 130 | } 131 | 132 | return controlPoint 133 | } 134 | } 135 | 136 | struct GraphView_Previews: PreviewProvider { 137 | static var previews: some View { 138 | Group { 139 | GraphView() 140 | .padding(100) 141 | .previewLayout(PreviewLayout.sizeThatFits) 142 | .preferredColorScheme(.light) 143 | .background(lightBgColor) 144 | GraphView() 145 | .padding(100) 146 | .previewLayout(PreviewLayout.sizeThatFits) 147 | .preferredColorScheme(.dark) 148 | .background(darkBgColor) 149 | } 150 | } 151 | } 152 | 153 | /* 154 | Awesome Sauce! 155 | Thank you for getting one of my views, hope you are happy with it 👌 156 | Consider helping this train rollin 🚂 on my Patreon -> https://www.patreon.com/swiftui 157 | Or cup a coffee ☕️ -> https://ko-fi.com/swiftui 158 | 159 | If you have any suggestions for improvements, 160 | feel free to reach me at undead.pix3l@gmail.com 161 | */ 162 | -------------------------------------------------------------------------------- /Shared/Views/LineGraph.swift: -------------------------------------------------------------------------------- 1 | // MARK: IMPORTANT🚨 2 | /* For easy of copy/pastability, all code is in one big chunk. 3 | Be a dear and refactor this out any way you see fit 🤘 */ 4 | 5 | /* Idealy, you would NOT be using pre-defined constants in this way, so keep that in mind.*/ 6 | 7 | import SwiftUI 8 | 9 | /* Defining all constants used in the view.*/ 10 | fileprivate var defaultPadding: CGFloat = 24 11 | fileprivate var fontSize: CGFloat = 8 12 | fileprivate var lineWidth: CGFloat = 24 13 | fileprivate var defaultRadius: CGFloat = 24 14 | fileprivate var graphSmallPadding: CGFloat = 35 15 | fileprivate var graphBigPadding: CGFloat = 60 16 | fileprivate var frameSize: CGFloat = 200 17 | 18 | fileprivate var firstItem: String = "FIRST" 19 | fileprivate var secondItem: String = "SECOND" 20 | fileprivate var thirdItem: String = "THIRD" 21 | 22 | fileprivate let lBgColor = Color(.displayP3, red: 248/255, green: 250/255, blue: 251/255, opacity: 1.0) 23 | fileprivate let dBgColor = Color(.displayP3, red: 29/255, green: 19/255, blue: 44/255, opacity: 1.0) 24 | fileprivate let lShadowColor = Color(.displayP3, red: 242/255, green: 242/255, blue: 1, opacity: 1.0) 25 | fileprivate let dShadowColor = Color(.displayP3, red: 45/255, green: 26/255, blue: 88/255, opacity: 1.0) 26 | fileprivate let lBaseColor = Color(.displayP3, red: 1, green: 1, blue: 1, opacity: 1.0) 27 | fileprivate let dBaseColor = Color(.displayP3, red: 30/255, green: 17/255, blue: 44/255, opacity: 1.0) 28 | fileprivate let lTextColor = Color(.displayP3, red: 30/255, green: 21/255, blue: 49/255, opacity: 1.0) 29 | fileprivate let dTextColor = Color(.displayP3, red: 1, green: 1, blue: 1, opacity: 1.0) 30 | fileprivate let lfadedBackgroundColor = Color(.displayP3, red: 240/255, green: 242/255, blue: 246/255, opacity: 1.0) 31 | fileprivate let dfadedBackgroundColor = Color(.displayP3, red: 16/255, green: 10/255, blue: 23/255, opacity: 1.0) 32 | 33 | fileprivate let firstAccentColor = Color(.displayP3, red: 99/255, green: 25/255, blue: 229/255, opacity: 1.0) 34 | fileprivate let secondAccentColor = Color(.displayP3, red: 1, green: 10/255, blue: 142/255, opacity: 1.0) 35 | fileprivate let thirdAccentColor = Color(.displayP3, red: 2/255, green: 160/255, blue: 250/255, opacity: 1.0) 36 | 37 | struct LineGraph: View { 38 | 39 | /* 40 | Environtment is used just to make it easier to preview light and dark look in one view setup. 41 | You should create a new semantic color in the assets and use it that way 👌 42 | */ 43 | @Environment(\.colorScheme) var colorScheme 44 | 45 | var body: some View { 46 | 47 | let shadowColor = colorScheme == .dark ? dShadowColor : lShadowColor 48 | let baseColor = colorScheme == .dark ? dBaseColor : lBaseColor 49 | 50 | ZStack { 51 | RoundedRectangle(cornerRadius: defaultRadius) 52 | .foregroundColor(baseColor) 53 | .shadow(color: shadowColor, radius: defaultRadius) 54 | HStack { 55 | SingleGraph(itemAccentColor: firstAccentColor, itemTitle: firstItem, padding: graphBigPadding) 56 | Spacer(minLength: 16) 57 | SingleGraph(itemAccentColor: secondAccentColor, itemTitle: secondItem, padding: graphSmallPadding) 58 | Spacer(minLength: 16) 59 | SingleGraph(itemAccentColor: thirdAccentColor, itemTitle: thirdItem, padding: graphBigPadding) 60 | } 61 | .padding(defaultPadding) 62 | } 63 | .frame(width: frameSize, height: frameSize) 64 | .padding(.horizontal, defaultPadding) 65 | } 66 | } 67 | 68 | struct SingleGraph: View { 69 | 70 | @Environment(\.colorScheme) var colorScheme 71 | 72 | var itemAccentColor: Color 73 | var itemTitle: String 74 | var padding: CGFloat 75 | 76 | var body: some View { 77 | 78 | let textColor = colorScheme == .dark ? dTextColor : lTextColor 79 | let darkFaded = colorScheme == .dark ? dfadedBackgroundColor : lfadedBackgroundColor 80 | 81 | VStack { 82 | ZStack { 83 | GeometryReader { gr in 84 | RoundedRectangle(cornerRadius: defaultRadius, style: .continuous) 85 | .fill(darkFaded) 86 | RoundedRectangle(cornerRadius: defaultRadius, style: .continuous) 87 | .fill(itemAccentColor) 88 | .padding(.top, padding) 89 | } 90 | } 91 | .frame(width: lineWidth) 92 | 93 | Text(itemTitle) 94 | .allowsTightening(true) 95 | .font(Font.system(size: fontSize, weight: .semibold, design: .rounded)) 96 | .frame(width: lineWidth*2) 97 | .foregroundColor(textColor) 98 | } 99 | } 100 | } 101 | 102 | struct SingleGraph_Previews: PreviewProvider { 103 | static var previews: some View { 104 | Group { 105 | LineGraph() 106 | .padding(100) 107 | .previewLayout(PreviewLayout.sizeThatFits) 108 | .preferredColorScheme(.light) 109 | .background(lBgColor) 110 | LineGraph() 111 | .padding(100) 112 | .previewLayout(PreviewLayout.sizeThatFits) 113 | .preferredColorScheme(.dark) 114 | .background(dBgColor) 115 | } 116 | } 117 | } 118 | 119 | /* 120 | Awesome Sauce! 121 | Thank you for getting one of my views, hope you are happy with it 👌 122 | Consider helping this train rollin 🚂 on my Patreon -> https://www.patreon.com/swiftui 123 | 124 | If you have any suggestions for improvements, 125 | feel free to reach me at undead.pix3l@gmail.com 126 | */ 127 | -------------------------------------------------------------------------------- /Shared/Views/LoadingView.swift: -------------------------------------------------------------------------------- 1 | // MARK: IMPORTANT🚨 2 | /* For easy of copy/pastability, all code is in one big chunk. 3 | Be a dear and refactor this out any way you see fit 🤘 */ 4 | 5 | /* Idealy, you would NOT be using pre-defined constants in this way, so keep that in mind.*/ 6 | 7 | import SwiftUI 8 | 9 | /* Defining all constants used in the view.*/ 10 | fileprivate let titleFont = Font.system(size: 16, weight: .bold, design: .rounded) 11 | fileprivate var defaultRadius: CGFloat = 24 12 | 13 | fileprivate let lBgColor = Color(.displayP3, red: 248/255, green: 250/255, blue: 251/255, opacity: 1.0) 14 | fileprivate let dBgColor = Color(.displayP3, red: 29/255, green: 19/255, blue: 44/255, opacity: 1.0) 15 | fileprivate let lShadowColor = Color(.displayP3, red: 242/255, green: 242/255, blue: 1, opacity: 1.0) 16 | fileprivate let dShadowColor = Color(.displayP3, red: 45/255, green: 26/255, blue: 88/255, opacity: 1.0) 17 | fileprivate let lBaseColor = Color(.displayP3, red: 1, green: 1, blue: 1, opacity: 1.0) 18 | fileprivate let dBaseColor = Color(.displayP3, red: 30/255, green: 17/255, blue: 44/255, opacity: 1.0) 19 | fileprivate let lTextColor = Color(.displayP3, red: 30/255, green: 21/255, blue: 49/255, opacity: 1.0) 20 | fileprivate let dTextColor = Color(.displayP3, red: 1, green: 1, blue: 1, opacity: 1.0) 21 | fileprivate let lfadedBackgroundColor = Color(.displayP3, red: 240/255, green: 242/255, blue: 246/255, opacity: 1.0) 22 | fileprivate let dfadedBackgroundColor = Color(.displayP3, red: 16/255, green: 10/255, blue: 23/255, opacity: 1.0) 23 | 24 | fileprivate let graphAccentColor = Color(.displayP3, red: 0.011, green: 0.631, blue: 0.984, opacity: 1.0) 25 | 26 | struct Loader: View { 27 | /* 28 | Environtment is used just to make it easier to preview light and dark look in one view setup. 29 | You should create a new semantic color in the assets and use it that way 👌 30 | */ 31 | @Environment(\.colorScheme) var colorScheme 32 | 33 | var body: some View { 34 | 35 | let shadowColor = colorScheme == .dark ? dShadowColor : lShadowColor 36 | let baseColor = colorScheme == .dark ? dBaseColor : lBaseColor 37 | let textColor = colorScheme == .dark ? dTextColor : lTextColor 38 | let darkFaded = colorScheme == .dark ? dfadedBackgroundColor : lfadedBackgroundColor 39 | 40 | ZStack { 41 | RoundedRectangle(cornerRadius: defaultRadius, style: .continuous) 42 | .foregroundColor(baseColor) 43 | .shadow(color: shadowColor, radius: defaultRadius) 44 | VStack { 45 | HStack { 46 | Text("loading progress") 47 | .font(titleFont) 48 | .foregroundColor(textColor) 49 | Spacer() 50 | Text("70%") 51 | .font(titleFont) 52 | .foregroundColor(textColor) 53 | .opacity(0.8) 54 | } 55 | ZStack { 56 | GeometryReader { gr in 57 | RoundedRectangle(cornerRadius: defaultRadius) 58 | .fill(darkFaded) 59 | .frame(height: 16) 60 | RoundedRectangle(cornerRadius: defaultRadius) 61 | .fill(graphAccentColor) 62 | .padding(.trailing, 80) 63 | .frame(height: 16) 64 | } 65 | .frame(height: 16) 66 | } 67 | } 68 | .padding(.horizontal, 24) 69 | } 70 | .frame(height: 86) 71 | } 72 | } 73 | 74 | struct Loader_Previews: PreviewProvider { 75 | static var previews: some View { 76 | Group { 77 | Loader() 78 | .padding(100) 79 | .fixedSize() 80 | .previewLayout(PreviewLayout.sizeThatFits) 81 | .preferredColorScheme(.light) 82 | .background(lBaseColor) 83 | Loader() 84 | .padding(100) 85 | .fixedSize() 86 | .previewLayout(PreviewLayout.sizeThatFits) 87 | .preferredColorScheme(.dark) 88 | .background(dBaseColor) 89 | } 90 | } 91 | } 92 | 93 | /* 94 | Awesome Sauce! 95 | Thank you for getting one of my views, hope you are happy with it 👌 96 | Consider helping this train rollin 🚂 on my Patreon -> https://www.patreon.com/swiftui 97 | 98 | If you have any suggestions for improvements, 99 | feel free to reach me at undead.pix3l@gmail.com 100 | */ 101 | -------------------------------------------------------------------------------- /Shared/Views/NeumorphButton.swift: -------------------------------------------------------------------------------- 1 | // MARK: IMPORTANT🚨 2 | /* For easy of copy/pastability, all code is in one big chunk. 3 | Be a dear and refactor this out any way you see fit 🤘 */ 4 | 5 | /* Idealy, you would NOT be using pre-defined constants in this way, so keep that in mind.*/ 6 | 7 | import SwiftUI 8 | 9 | /* Defining all constants used in the view.*/ 10 | fileprivate let cornerRadius: CGFloat = 24 11 | fileprivate let fontSize: CGFloat = 20 12 | fileprivate let fontHorizontalPadding: CGFloat = 16 13 | fileprivate let radiusTapped: CGFloat = 4 14 | fileprivate let offsetTapped: CGFloat = 4 15 | fileprivate let radiusUntapped: CGFloat = 8 16 | fileprivate let offsetUntapped: CGFloat = 10 17 | 18 | // light mode shadows 19 | fileprivate let lightShadowLightColor = Color(.displayP3, red: 1, green: 1, blue: 1, opacity: 1.0) 20 | fileprivate let lightShadowDarkColor = Color(.displayP3, red: 0.9254, green: 0.9333, blue: 0.9411, opacity: 1.0) 21 | // dark mode shadows 22 | fileprivate let darkShadowLightColor = Color(.displayP3, red: 0.1725, green: 0.1137, blue: 0.2352, opacity: 1.0) 23 | fileprivate let darkShadowDarkColor = Color(.displayP3, red: 0.0666, green: 0.0352, blue: 0.1019, opacity: 1.0) 24 | 25 | fileprivate let lightBgColor = Color(.displayP3, red: 0.9764, green: 0.9803, blue: 0.9882, opacity: 1.0) 26 | fileprivate let darkBgColor = Color(.displayP3, red: 0.1176, green: 0.0784, blue: 0.1725, opacity: 1.0) 27 | fileprivate let textAccentColor = Color(.displayP3, red: 0.8, green: 0.8274, blue: 0.8784, opacity: 1.0) 28 | fileprivate let baseAccentColor = Color(.displayP3, red: 0.9764, green: 0.9803, blue: 0.9882, opacity: 1.0) 29 | 30 | struct NeumorphButtonStyle: ButtonStyle { 31 | // Feel free to modify this shape to something else depending on how you are using it in the app. 32 | var shape = RoundedRectangle(cornerRadius: cornerRadius, style: .continuous) 33 | 34 | func makeBody(configuration: Self.Configuration) -> some View { 35 | configuration.label 36 | .font(Font.system(size: fontSize, weight: .bold, design: .default)) 37 | .frame(maxWidth: .infinity) 38 | .padding(.horizontal, fontHorizontalPadding) 39 | .padding() 40 | .background( 41 | NeuMorphButton(isHighlighted: configuration.isPressed, shape: shape)) 42 | .foregroundColor(textAccentColor) 43 | } 44 | } 45 | 46 | struct NeuMorphButton: View { 47 | var isHighlighted: Bool 48 | var shape: S 49 | 50 | /* 51 | Environtment is used just to make it easier to preview light and dark look in one view setup. 52 | You should create a new semantic color in the assets and use it that way 👌 53 | */ 54 | @Environment(\.colorScheme) var colorScheme 55 | 56 | var body: some View { 57 | 58 | let bgColor = colorScheme == .dark ? darkBgColor : lightBgColor 59 | let lightShadow = colorScheme == .dark ? darkShadowLightColor : lightShadowLightColor 60 | let darkShadow = colorScheme == .dark ? darkShadowDarkColor : lightShadowDarkColor 61 | 62 | ZStack { 63 | if isHighlighted { 64 | shape 65 | .clipped() 66 | .foregroundColor(bgColor) 67 | .overlay( 68 | shape 69 | .stroke(bgColor, lineWidth: radiusTapped) 70 | .shadow(radius: radiusTapped, x: offsetTapped, y: offsetTapped)) 71 | .overlay( 72 | shape 73 | .stroke(bgColor, lineWidth: 4) 74 | .shadow(color: lightShadow, radius: radiusTapped, x: -offsetTapped, y: -offsetTapped)) 75 | .clipShape(shape) 76 | } else { 77 | shape 78 | .clipped() 79 | .foregroundColor(bgColor) 80 | .shadow(color: lightShadow, radius: radiusUntapped, x: -offsetUntapped, y: -offsetUntapped) 81 | .shadow(color: darkShadow, radius: radiusUntapped, x: offsetUntapped, y: offsetUntapped) 82 | } 83 | } 84 | } 85 | } 86 | 87 | struct NeumorphButtonView_Previews: PreviewProvider { 88 | static var previews: some View { 89 | Group { 90 | Button("neumorph button 👌") {} 91 | .buttonStyle(NeumorphButtonStyle()) 92 | .fixedSize() 93 | .padding(100) 94 | .previewLayout(PreviewLayout.sizeThatFits) 95 | .preferredColorScheme(.light) 96 | Button("neumorph button 👌") {} 97 | .buttonStyle(NeumorphButtonStyle()) 98 | .fixedSize() 99 | .padding(100) 100 | .previewLayout(PreviewLayout.sizeThatFits) 101 | .background(darkBgColor) 102 | .preferredColorScheme(.dark) 103 | } 104 | } 105 | } 106 | 107 | /* 108 | Awesome Sauce! 109 | Thank you for getting one of my views, hope you are happy with it 👌 110 | Consider helping this train rollin 🚂 on my Patreon -> https://www.patreon.com/swiftui 111 | 112 | If you have any suggestions for improvements, 113 | feel free to reach me at undead.pix3l@gmail.com 114 | */ 115 | -------------------------------------------------------------------------------- /Shared/Views/RoundedButton.swift: -------------------------------------------------------------------------------- 1 | // MARK: IMPORTANT🚨 2 | /* For easy of copy/pastability, all code is in one big chunk. 3 | Be a dear and refactor this out any way you see fit 🤘 */ 4 | 5 | /* Idealy, you would NOT be using pre-defined constants in this way, so keep that in mind.*/ 6 | 7 | import SwiftUI 8 | 9 | /* Defining all constants used in the view.*/ 10 | fileprivate let fontSize: CGFloat = 20 11 | fileprivate let fontHorizontalPadding: CGFloat = 16 12 | fileprivate var defaultRadius: CGFloat = 24 13 | 14 | fileprivate let lightShadowColor = Color(.displayP3, red: 0.80, green: 0.80, blue: 1, opacity: 1.0) 15 | fileprivate let darkShadowColor = Color(.displayP3, red: 0.1803, green: 0.0470, blue: 0.4627, opacity: 1.0) 16 | 17 | fileprivate let baseAccentColor = Color(.displayP3, red: 1, green: 0.04, blue: 0.56, opacity: 1.0) 18 | fileprivate let baseDarkColor = Color(.displayP3, red: 0.78, green: 0, blue: 0.45, opacity: 1.0) 19 | 20 | struct RoundedButtonStyle: ButtonStyle { 21 | func makeBody(configuration: Self.Configuration) -> some View { 22 | configuration.label 23 | .font(Font.system(size: fontSize, weight: .bold, design: .default)) 24 | .frame(maxWidth: .infinity) 25 | .padding(.horizontal, fontHorizontalPadding) 26 | .padding() 27 | .background(configuration.isPressed ? baseDarkColor : baseAccentColor) 28 | .cornerRadius(defaultRadius) 29 | .foregroundColor(.white) 30 | } 31 | } 32 | 33 | struct RoundedButton_Previews: PreviewProvider { 34 | static var previews: some View { 35 | Group { 36 | Button("rounded button") {} 37 | .buttonStyle(RoundedButtonStyle()) 38 | .fixedSize() 39 | .padding(100) 40 | .previewLayout(PreviewLayout.sizeThatFits) 41 | .preferredColorScheme(.light) 42 | 43 | Button("rounded button") {} 44 | .buttonStyle(RoundedButtonStyle()) 45 | .fixedSize() 46 | .padding(100) 47 | .previewLayout(PreviewLayout.sizeThatFits) 48 | .preferredColorScheme(.dark) 49 | } 50 | } 51 | } 52 | 53 | /* 54 | Awesome Sauce! 55 | Thank you for getting one of my views, hope you are happy with it 👌 56 | Consider helping this train rollin 🚂 on my Patreon -> https://www.patreon.com/swiftui 57 | 58 | If you have any suggestions for improvements, 59 | feel free to reach me at undead.pix3l@gmail.com 60 | */ 61 | -------------------------------------------------------------------------------- /Shared/Views/SFSymbolRoundedButton.swift: -------------------------------------------------------------------------------- 1 | // MARK: IMPORTANT🚨 2 | /* For easy of copy/pastability, all code is in one big chunk. 3 | Be a dear and refactor this out any way you see fit 🤘 */ 4 | 5 | /* Idealy, you would NOT be using pre-defined constants in this way, so keep that in mind.*/ 6 | 7 | import SwiftUI 8 | 9 | /* Defining all constants used in the view.*/ 10 | fileprivate let fontSize: CGFloat = 20 11 | fileprivate let fontHorizontalPadding: CGFloat = 16 12 | fileprivate let shadowRadius: CGFloat = 10 13 | fileprivate var defaultRadius: CGFloat = 24 14 | 15 | // browse symbols on https://sfsymbols.com or get the SFSymbols App https://developer.apple.com/sf-symbols 16 | fileprivate let buttonIconString: String = "hand.tap.fill" 17 | 18 | fileprivate let lightShadowColor = Color(.displayP3, red: 0.80, green: 0.80, blue: 1, opacity: 1.0) 19 | fileprivate let darkShadowColor = Color(.displayP3, red: 0.1803, green: 0.0470, blue: 0.4627, opacity: 1.0) 20 | 21 | fileprivate let purpleAccentColor = Color(.displayP3, red: 0.39, green: 0.1, blue: 0.9, opacity: 1.0) 22 | fileprivate let purpleAccentColorDark = Color(.displayP3, red: 0.37, green: 0.08, blue: 0.7, opacity: 1.0) 23 | 24 | struct SFSymbolButtonStyle: ButtonStyle { 25 | 26 | let sfIconString: String 27 | 28 | func makeBody(configuration: Self.Configuration) -> some View { 29 | HStack { 30 | Image(systemName: sfIconString) 31 | configuration.label 32 | .font(Font.system(size: fontSize, weight: .bold, design: .default)) 33 | } 34 | .frame(maxWidth: .infinity) 35 | .foregroundColor(.white) 36 | .padding(.horizontal, fontHorizontalPadding) 37 | .padding() 38 | .background(configuration.isPressed ? purpleAccentColorDark : purpleAccentColor) 39 | .cornerRadius(defaultRadius) 40 | } 41 | } 42 | 43 | struct SFSymbolButtonView_Previews: PreviewProvider { 44 | static var previews: some View { 45 | Group { 46 | Button("SFSymbol button") {} 47 | .buttonStyle(SFSymbolButtonStyle(sfIconString: buttonIconString)) 48 | .fixedSize() 49 | .padding(100) 50 | .previewLayout(PreviewLayout.sizeThatFits) 51 | .preferredColorScheme(.light) 52 | Button("SFSymbol button") {} 53 | .buttonStyle(SFSymbolButtonStyle(sfIconString: buttonIconString)) 54 | .fixedSize() 55 | .padding(100) 56 | .previewLayout(PreviewLayout.sizeThatFits) 57 | .preferredColorScheme(.dark) 58 | } 59 | } 60 | } 61 | 62 | /* 63 | Awesome Sauce! 64 | Thank you for getting one of my views, hope you are happy with it 👌 65 | Consider helping this train rollin 🚂 on my Patreon -> https://www.patreon.com/swiftui 66 | 67 | If you have any suggestions for improvements, 68 | feel free to reach me at undead.pix3l@gmail.com 69 | */ 70 | -------------------------------------------------------------------------------- /Shared/Views/SquircleGraphIcon.swift: -------------------------------------------------------------------------------- 1 | // MARK: IMPORTANT🚨 2 | /* For easy of copy/pastability, all code is in one big chunk. 3 | Be a dear and refactor this out any way you see fit 🤘 */ 4 | 5 | /* Idealy, you would NOT be using pre-defined constants in this way, so keep that in mind.*/ 6 | 7 | import SwiftUI 8 | 9 | /* Defining all constants used in the view.*/ 10 | fileprivate let defaultFont = Font.system(size: 32, weight: .bold, design: .rounded) 11 | fileprivate var defaultRadius: CGFloat = 24 12 | fileprivate let lineWidth: CGFloat = 12 13 | 14 | fileprivate let lightShadowColor = Color(.displayP3, red: 0.95, green: 0.95, blue: 1, opacity: 1.0) 15 | fileprivate let darkShadowColor = Color(.displayP3, red: 0.1803, green: 0.0470, blue: 0.4627, opacity: 1.0) 16 | 17 | fileprivate let yellowAccent = Color(.displayP3, red: 0.9647, green: 0.7607, blue: 0.3294, opacity: 1.0) 18 | fileprivate let orangeAccent = Color(.displayP3, red: 0.9882, green: 0.4470, blue: 0.1764, opacity: 1.0) 19 | 20 | struct SquircleGraphIcon: View { 21 | 22 | /* 23 | Environtment is used just to make it easier to preview light and dark look in one view setup. 24 | You should create a new semantic color in the assets and use it that way 👌 25 | */ 26 | @Environment(\.colorScheme) var colorScheme 27 | 28 | var body: some View { 29 | 30 | let shadowColor = colorScheme == .dark ? darkShadowColor : lightShadowColor 31 | 32 | VStack { 33 | ZStack { 34 | RoundedRectangle(cornerRadius: defaultRadius * 2, style: .continuous) 35 | .fill(yellowAccent) 36 | .shadow(color: shadowColor, radius: defaultRadius) 37 | RoundedRectangle(cornerRadius: defaultRadius * 2, style: .continuous) 38 | .trim(from: 0, to: 0.5) 39 | .stroke(orangeAccent, style: StrokeStyle(lineWidth: lineWidth, lineCap: .round)) 40 | Image(systemName: "photo.on.rectangle.angled") 41 | .font(defaultFont) 42 | .foregroundColor(.white) 43 | } 44 | .padding(120) 45 | .aspectRatio(1, contentMode: .fit) 46 | } 47 | } 48 | } 49 | 50 | struct SquircleGraphIcon_Previews: PreviewProvider { 51 | static var previews: some View { 52 | Group { 53 | SquircleGraphIcon() 54 | .previewLayout(PreviewLayout.sizeThatFits) 55 | .preferredColorScheme(.light) 56 | .frame(width: 400, height: 400) 57 | SquircleGraphIcon() 58 | .previewLayout(PreviewLayout.sizeThatFits) 59 | .preferredColorScheme(.dark) 60 | .frame(width: 400, height: 400) 61 | } 62 | } 63 | } 64 | 65 | /* 66 | Awesome Sauce! 67 | Thank you for getting one of my views, hope you are happy with it 👌 68 | Consider helping this train rollin 🚂 on my Patreon -> https://www.patreon.com/swiftui 69 | 70 | If you have any suggestions for improvements, 71 | feel free to reach me at undead.pix3l@gmail.com 72 | */ 73 | -------------------------------------------------------------------------------- /Shared/Views/TableCellImage.swift: -------------------------------------------------------------------------------- 1 | // MARK: IMPORTANT🚨 2 | /* For easy of copy/pastability, all code is in one big chunk. 3 | Be a dear and refactor this out any way you see fit 🤘 */ 4 | 5 | /* Idealy, you would NOT be using pre-defined constants in this way, so keep that in mind.*/ 6 | 7 | import SwiftUI 8 | 9 | /* Defining all constants used in the view.*/ 10 | fileprivate let titleFont = Font.system(size: 16, weight: .bold, design: .rounded) 11 | fileprivate let subTitleFont = Font.system(size: 12, weight: .bold, design: .rounded) 12 | fileprivate var defaultRadius: CGFloat = 18 13 | 14 | fileprivate let lBgColor = Color(.displayP3, red: 248/255, green: 250/255, blue: 251/255, opacity: 1.0) 15 | fileprivate let dBgColor = Color(.displayP3, red: 29/255, green: 19/255, blue: 44/255, opacity: 1.0) 16 | fileprivate let lShadowColor = Color(.displayP3, red: 242/255, green: 242/255, blue: 1, opacity: 1.0) 17 | fileprivate let dShadowColor = Color(.displayP3, red: 45/255, green: 26/255, blue: 88/255, opacity: 1.0) 18 | fileprivate let lBaseColor = Color(.displayP3, red: 1, green: 1, blue: 1, opacity: 1.0) 19 | fileprivate let dBaseColor = Color(.displayP3, red: 30/255, green: 17/255, blue: 44/255, opacity: 1.0) 20 | fileprivate let lTextColor = Color(.displayP3, red: 30/255, green: 21/255, blue: 49/255, opacity: 1.0) 21 | fileprivate let dTextColor = Color(.displayP3, red: 1, green: 1, blue: 1, opacity: 1.0) 22 | 23 | fileprivate let greenAccent = Color(.displayP3, red: 54/255, green: 244/255, blue: 199/255, opacity: 1.0) 24 | 25 | struct TableCellImage: View { 26 | /* 27 | Environtment is used just to make it easier to preview light and dark look in one view setup. 28 | You should create a new semantic color in the assets and use it that way 👌 29 | */ 30 | @Environment(\.colorScheme) var colorScheme 31 | 32 | var body: some View { 33 | 34 | let shadowColor = colorScheme == .dark ? dShadowColor : lShadowColor 35 | let baseColor = colorScheme == .dark ? dBaseColor : lBaseColor 36 | let textColor = colorScheme == .dark ? dTextColor : lTextColor 37 | 38 | ZStack { 39 | RoundedRectangle(cornerRadius: defaultRadius, style: .continuous) 40 | .foregroundColor(baseColor) 41 | .shadow(color: shadowColor, radius: defaultRadius) 42 | HStack(spacing: 16) { 43 | ZStack { 44 | RoundedRectangle(cornerRadius: defaultRadius,style: .continuous) 45 | .fill(greenAccent) 46 | .aspectRatio(1, contentMode: .fit) 47 | Image(systemName: "photo.fill") 48 | .foregroundColor(.white) 49 | .font(titleFont) 50 | } 51 | VStack(alignment: .leading, spacing: 4) { 52 | Text("cell title") 53 | .font(titleFont) 54 | .foregroundColor(textColor) 55 | Text("cell subtitle") 56 | .font(subTitleFont) 57 | .foregroundColor(textColor) 58 | .opacity(0.8) 59 | } 60 | Spacer() 61 | Image(systemName: "chevron.forward") 62 | .foregroundColor(textColor) 63 | } 64 | .frame(height: 54) 65 | .padding(.horizontal, 16) 66 | .padding(.vertical, 12) 67 | } 68 | .frame(height: 86) 69 | } 70 | } 71 | 72 | struct TableCellImage_Previews: PreviewProvider { 73 | static var previews: some View { 74 | Group { 75 | TableCellImage() 76 | .padding(100) 77 | .fixedSize() 78 | .previewLayout(PreviewLayout.sizeThatFits) 79 | .preferredColorScheme(.light) 80 | .background(lBgColor) 81 | TableCellImage() 82 | .padding(100) 83 | .fixedSize() 84 | .previewLayout(PreviewLayout.sizeThatFits) 85 | .preferredColorScheme(.dark) 86 | .background(dBgColor) 87 | } 88 | } 89 | } 90 | 91 | /* 92 | Awesome Sauce! 93 | Thank you for getting one of my views, hope you are happy with it 👌 94 | Consider helping this train rollin 🚂 on my Patreon -> https://www.patreon.com/swiftui 95 | 96 | If you have any suggestions for improvements, 97 | feel free to reach me at undead.pix3l@gmail.com 98 | */ 99 | -------------------------------------------------------------------------------- /Shared/Views/TwitterLike.swift: -------------------------------------------------------------------------------- 1 | // MARK: IMPORTANT🚨 2 | /* For easy of copy/pastability, all code is in one big chunk. 3 | Be a dear and refactor this out any way you see fit 🤘 */ 4 | 5 | /* Idealy, you would NOT be using pre-defined constants in this way, so keep that in mind.*/ 6 | 7 | import SwiftUI 8 | 9 | /* Defining all constants used in the view.*/ 10 | fileprivate var defaultRadius: CGFloat = 18 11 | 12 | fileprivate let fadedBackgroundColor = Color(.displayP3, red: 0.694, green: 0.737, blue: 0.815, opacity: 1.0) 13 | 14 | struct TwitterLike: View { 15 | 16 | @Environment(\.colorScheme) var colorScheme 17 | 18 | @State var scale: CGFloat = 0 19 | @State var textOpacity: Double = 1 20 | @State var offset: CGFloat = 0 21 | @State var isLiked = false 22 | 23 | var body: some View { 24 | let circleMaskColor = colorScheme == .dark ? Color.black : Color.white 25 | ZStack { 26 | Image(systemName: "plus") 27 | .resizable() 28 | .frame(width: 12, height: 12, alignment: .center) 29 | .font(.system(size: 16, weight: .bold, design: .rounded)) 30 | .foregroundColor(.red) 31 | .offset(x: 0, y: offset) 32 | .opacity(textOpacity) 33 | .padding(.bottom, 0) 34 | .padding(.trailing, 20) 35 | .animation(.easeInOut(duration: 1).delay(0.5)) 36 | Image(systemName: "plus") 37 | .resizable() 38 | .frame(width: 12, height: 12, alignment: .center) 39 | .font(.system(size: 16, weight: .bold, design: .rounded)) 40 | .foregroundColor(.red) 41 | .offset(x: 0, y: offset) 42 | .opacity(textOpacity) 43 | .padding(.bottom, 20) 44 | .animation(.easeInOut(duration: 1).delay(0.8)) 45 | Image(systemName: "plus") 46 | .resizable() 47 | .frame(width: 12, height: 12, alignment: .center) 48 | .font(.system(size: 16, weight: .bold, design: .rounded)) 49 | .foregroundColor(.red) 50 | .offset(x: 0, y: offset) 51 | .opacity(textOpacity) 52 | .padding(.bottom, 00) 53 | .padding(.trailing, -20) 54 | .animation(.easeInOut(duration: 1).delay(1)) 55 | Circle() 56 | .frame(width: 36, height: 36, alignment: .center) 57 | .foregroundColor(circleMaskColor) 58 | Circle() 59 | .frame(width: 35, height: 35, alignment: .center) 60 | .foregroundColor(Color.red) 61 | .scaleEffect(scale) 62 | .animation(.spring()) 63 | Circle() 64 | .frame(width: 36, height: 36, alignment: .center) 65 | .foregroundColor(circleMaskColor) 66 | .scaleEffect(scale) 67 | .animation(.spring().delay(0.3)) 68 | if !isLiked { 69 | Image(systemName: "heart") 70 | .resizable() 71 | .frame(width: 30, height: 30, alignment: .center) 72 | .foregroundColor(fadedBackgroundColor) 73 | } 74 | Image(systemName: "heart.fill") 75 | .resizable() 76 | .frame(width: 30, height: 30, alignment: .center) 77 | .foregroundColor(.red) 78 | .scaleEffect(scale) 79 | .animation(.interpolatingSpring( 80 | mass: 1, 81 | stiffness: 100, 82 | damping: 10, 83 | initialVelocity: 2).delay(0.5)) 84 | Text("+1") 85 | .foregroundColor(.white) 86 | .font(.system(size: 16, weight: .bold, design: .rounded)) 87 | .scaleEffect(scale) 88 | .animation(.interpolatingSpring( 89 | mass: 1, 90 | stiffness: 100, 91 | damping: 10, 92 | initialVelocity: 2).delay(0.5)) 93 | .opacity(textOpacity) 94 | .animation(.easeInOut(duration: 0.5).delay(1.5)) 95 | } 96 | .onTapGesture { 97 | scale = isLiked ? 0 : 1 98 | textOpacity = isLiked ? 1 : 0 99 | offset = isLiked ? 0 : -30 100 | isLiked.toggle() 101 | } 102 | } 103 | } 104 | 105 | struct TwitterLike_Previews: PreviewProvider { 106 | static var previews: some View { 107 | Group { 108 | TwitterLike() 109 | .padding(100) 110 | .fixedSize() 111 | .previewLayout(PreviewLayout.sizeThatFits) 112 | .preferredColorScheme(.light) 113 | TwitterLike() 114 | .padding(100) 115 | .fixedSize() 116 | .previewLayout(PreviewLayout.sizeThatFits) 117 | .preferredColorScheme(.dark) 118 | } 119 | } 120 | } 121 | 122 | /* 123 | Awesome Sauce! 124 | Thank you for getting one of my views, hope you are happy with it 👌 125 | Consider helping this train rollin 🚂 on my Patreon -> https://www.patreon.com/swiftui 126 | 127 | If you have any suggestions for improvements, 128 | feel free to reach me at undead.pix3l@gmail.com 129 | */ 130 | -------------------------------------------------------------------------------- /Shared/swiftUIViewsApp.swift: -------------------------------------------------------------------------------- 1 | import SwiftUI 2 | 3 | @main 4 | struct swiftUIViewsApp: App { 5 | var body: some Scene { 6 | WindowGroup { 7 | Previewer() 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /iOS/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | NSUserTrackingUsageDescription 6 | PLS gib 7 | CFBundleDevelopmentRegion 8 | $(DEVELOPMENT_LANGUAGE) 9 | CFBundleExecutable 10 | $(EXECUTABLE_NAME) 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | $(PRODUCT_NAME) 17 | CFBundlePackageType 18 | $(PRODUCT_BUNDLE_PACKAGE_TYPE) 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | UIApplicationSceneManifest 26 | 27 | UIApplicationSupportsMultipleScenes 28 | 29 | 30 | UIApplicationSupportsIndirectInputEvents 31 | 32 | UILaunchScreen 33 | 34 | UIRequiredDeviceCapabilities 35 | 36 | armv7 37 | 38 | UISupportedInterfaceOrientations 39 | 40 | UIInterfaceOrientationPortrait 41 | UIInterfaceOrientationLandscapeLeft 42 | UIInterfaceOrientationLandscapeRight 43 | 44 | UISupportedInterfaceOrientations~ipad 45 | 46 | UIInterfaceOrientationPortrait 47 | UIInterfaceOrientationPortraitUpsideDown 48 | UIInterfaceOrientationLandscapeLeft 49 | UIInterfaceOrientationLandscapeRight 50 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /imgs/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emin-grbo/swiftUIViews/c01d6d8698ef6940e899bbd2bc9ee6ac0ccd8f72/imgs/.DS_Store -------------------------------------------------------------------------------- /imgs/GithubCover.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emin-grbo/swiftUIViews/c01d6d8698ef6940e899bbd2bc9ee6ac0ccd8f72/imgs/GithubCover.jpg -------------------------------------------------------------------------------- /imgs/twitterLike_example.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emin-grbo/swiftUIViews/c01d6d8698ef6940e899bbd2bc9ee6ac0ccd8f72/imgs/twitterLike_example.gif -------------------------------------------------------------------------------- /macOS/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIconFile 10 | 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | $(PRODUCT_NAME) 17 | CFBundlePackageType 18 | $(PRODUCT_BUNDLE_PACKAGE_TYPE) 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleVersion 22 | 1 23 | LSMinimumSystemVersion 24 | $(MACOSX_DEPLOYMENT_TARGET) 25 | 26 | 27 | -------------------------------------------------------------------------------- /macOS/macOS.entitlements: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | com.apple.security.app-sandbox 6 | 7 | com.apple.security.files.user-selected.read-only 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /swiftUIViews.entitlements: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | com.apple.security.app-sandbox 6 | 7 | com.apple.security.network.client 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /swiftUIViews.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 50; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | D726D4D025EC39060044840D /* swiftUIViewsApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = D726D4BD25EC39050044840D /* swiftUIViewsApp.swift */; }; 11 | D726D4D125EC39060044840D /* swiftUIViewsApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = D726D4BD25EC39050044840D /* swiftUIViewsApp.swift */; }; 12 | D726D4D225EC39060044840D /* Previewer.swift in Sources */ = {isa = PBXBuildFile; fileRef = D726D4BE25EC39050044840D /* Previewer.swift */; }; 13 | D726D4D325EC39060044840D /* Previewer.swift in Sources */ = {isa = PBXBuildFile; fileRef = D726D4BE25EC39050044840D /* Previewer.swift */; }; 14 | D726D4D425EC39060044840D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = D726D4BF25EC39060044840D /* Assets.xcassets */; }; 15 | D726D4D525EC39060044840D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = D726D4BF25EC39060044840D /* Assets.xcassets */; }; 16 | D7277DDA26B87AB5005C6EE9 /* GraphView.swift in Sources */ = {isa = PBXBuildFile; fileRef = D7277DD926B87AB5005C6EE9 /* GraphView.swift */; }; 17 | D72B04612665618E0073CD37 /* ViewTemplate-dontDelete.swift in Sources */ = {isa = PBXBuildFile; fileRef = D72B04602665618E0073CD37 /* ViewTemplate-dontDelete.swift */; }; 18 | D759F5CC265BB3D100A4FB31 /* SquircleGraphIcon.swift in Sources */ = {isa = PBXBuildFile; fileRef = D759F5CB265BB3D100A4FB31 /* SquircleGraphIcon.swift */; }; 19 | D759F5CE265BF76000A4FB31 /* TableCellImage.swift in Sources */ = {isa = PBXBuildFile; fileRef = D759F5CD265BF76000A4FB31 /* TableCellImage.swift */; }; 20 | D759F5D0265C433E00A4FB31 /* LoadingView.swift in Sources */ = {isa = PBXBuildFile; fileRef = D759F5CF265C433E00A4FB31 /* LoadingView.swift */; }; 21 | D7630716264BB38700696726 /* RoundedButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = D7630715264BB38700696726 /* RoundedButton.swift */; }; 22 | D782EC8726681F9A00F19317 /* CardWithImage.swift in Sources */ = {isa = PBXBuildFile; fileRef = D782EC8626681F9A00F19317 /* CardWithImage.swift */; }; 23 | D7A7C7312654EBED00A77196 /* SFSymbolRoundedButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = D7A7C7302654EBED00A77196 /* SFSymbolRoundedButton.swift */; }; 24 | D7AA09AC26660440004489CD /* TwitterLike.swift in Sources */ = {isa = PBXBuildFile; fileRef = D7AA09AB26660440004489CD /* TwitterLike.swift */; }; 25 | D7EBE2E3264D22430009C7FE /* NeumorphButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = D7EBE2E2264D22430009C7FE /* NeumorphButton.swift */; }; 26 | D7EBE2E5264D3A9F0009C7FE /* LineGraph.swift in Sources */ = {isa = PBXBuildFile; fileRef = D7EBE2E4264D3A9F0009C7FE /* LineGraph.swift */; }; 27 | D7EBE2E7264D663C0009C7FE /* Colors.swift in Sources */ = {isa = PBXBuildFile; fileRef = D7EBE2E6264D663C0009C7FE /* Colors.swift */; }; 28 | D7F6D888263323200033A10C /* CircleGraph.swift in Sources */ = {isa = PBXBuildFile; fileRef = D7F6D887263323200033A10C /* CircleGraph.swift */; }; 29 | D7FABB812692FB9400ACF9F6 /* CardWithData.swift in Sources */ = {isa = PBXBuildFile; fileRef = D7FABB802692FB9400ACF9F6 /* CardWithData.swift */; }; 30 | D7FABB83269365AA00ACF9F6 /* ComparedProgress.swift in Sources */ = {isa = PBXBuildFile; fileRef = D7FABB82269365AA00ACF9F6 /* ComparedProgress.swift */; }; 31 | /* End PBXBuildFile section */ 32 | 33 | /* Begin PBXFileReference section */ 34 | D726D4BD25EC39050044840D /* swiftUIViewsApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = swiftUIViewsApp.swift; sourceTree = ""; }; 35 | D726D4BE25EC39050044840D /* Previewer.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Previewer.swift; sourceTree = ""; }; 36 | D726D4BF25EC39060044840D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 37 | D726D4C425EC39060044840D /* swiftUIViews.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = swiftUIViews.app; sourceTree = BUILT_PRODUCTS_DIR; }; 38 | D726D4C725EC39060044840D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 39 | D726D4CC25EC39060044840D /* swiftUIViews.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = swiftUIViews.app; sourceTree = BUILT_PRODUCTS_DIR; }; 40 | D726D4CE25EC39060044840D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 41 | D726D4CF25EC39060044840D /* macOS.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = macOS.entitlements; sourceTree = ""; }; 42 | D7277DD926B87AB5005C6EE9 /* GraphView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GraphView.swift; sourceTree = ""; }; 43 | D72B04602665618E0073CD37 /* ViewTemplate-dontDelete.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "ViewTemplate-dontDelete.swift"; sourceTree = ""; }; 44 | D759F5CB265BB3D100A4FB31 /* SquircleGraphIcon.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SquircleGraphIcon.swift; sourceTree = ""; }; 45 | D759F5CD265BF76000A4FB31 /* TableCellImage.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TableCellImage.swift; sourceTree = ""; }; 46 | D759F5CF265C433E00A4FB31 /* LoadingView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LoadingView.swift; sourceTree = ""; }; 47 | D7630715264BB38700696726 /* RoundedButton.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RoundedButton.swift; sourceTree = ""; }; 48 | D782EC8626681F9A00F19317 /* CardWithImage.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CardWithImage.swift; sourceTree = ""; }; 49 | D7A7C7302654EBED00A77196 /* SFSymbolRoundedButton.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SFSymbolRoundedButton.swift; sourceTree = ""; }; 50 | D7AA09AB26660440004489CD /* TwitterLike.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TwitterLike.swift; sourceTree = ""; }; 51 | D7B4C530262F5EA6005DAE03 /* swiftUIViews.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = swiftUIViews.entitlements; sourceTree = ""; }; 52 | D7EBE2E2264D22430009C7FE /* NeumorphButton.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NeumorphButton.swift; sourceTree = ""; }; 53 | D7EBE2E4264D3A9F0009C7FE /* LineGraph.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LineGraph.swift; sourceTree = ""; }; 54 | D7EBE2E6264D663C0009C7FE /* Colors.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Colors.swift; sourceTree = ""; }; 55 | D7F6D887263323200033A10C /* CircleGraph.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CircleGraph.swift; sourceTree = ""; }; 56 | D7FABB802692FB9400ACF9F6 /* CardWithData.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CardWithData.swift; sourceTree = ""; }; 57 | D7FABB82269365AA00ACF9F6 /* ComparedProgress.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ComparedProgress.swift; sourceTree = ""; }; 58 | /* End PBXFileReference section */ 59 | 60 | /* Begin PBXFrameworksBuildPhase section */ 61 | D726D4C125EC39060044840D /* Frameworks */ = { 62 | isa = PBXFrameworksBuildPhase; 63 | buildActionMask = 2147483647; 64 | files = ( 65 | ); 66 | runOnlyForDeploymentPostprocessing = 0; 67 | }; 68 | D726D4C925EC39060044840D /* Frameworks */ = { 69 | isa = PBXFrameworksBuildPhase; 70 | buildActionMask = 2147483647; 71 | files = ( 72 | ); 73 | runOnlyForDeploymentPostprocessing = 0; 74 | }; 75 | /* End PBXFrameworksBuildPhase section */ 76 | 77 | /* Begin PBXGroup section */ 78 | D726D4B725EC39050044840D = { 79 | isa = PBXGroup; 80 | children = ( 81 | D7B4C530262F5EA6005DAE03 /* swiftUIViews.entitlements */, 82 | D726D4BC25EC39050044840D /* Shared */, 83 | D726D4C625EC39060044840D /* iOS */, 84 | D726D4CD25EC39060044840D /* macOS */, 85 | D726D4C525EC39060044840D /* Products */, 86 | ); 87 | sourceTree = ""; 88 | }; 89 | D726D4BC25EC39050044840D /* Shared */ = { 90 | isa = PBXGroup; 91 | children = ( 92 | D726D4BD25EC39050044840D /* swiftUIViewsApp.swift */, 93 | D726D4BE25EC39050044840D /* Previewer.swift */, 94 | D72B04602665618E0073CD37 /* ViewTemplate-dontDelete.swift */, 95 | D726D4E825EC39A60044840D /* Views */, 96 | D726D4BF25EC39060044840D /* Assets.xcassets */, 97 | ); 98 | path = Shared; 99 | sourceTree = ""; 100 | }; 101 | D726D4C525EC39060044840D /* Products */ = { 102 | isa = PBXGroup; 103 | children = ( 104 | D726D4C425EC39060044840D /* swiftUIViews.app */, 105 | D726D4CC25EC39060044840D /* swiftUIViews.app */, 106 | ); 107 | name = Products; 108 | sourceTree = ""; 109 | }; 110 | D726D4C625EC39060044840D /* iOS */ = { 111 | isa = PBXGroup; 112 | children = ( 113 | D726D4C725EC39060044840D /* Info.plist */, 114 | ); 115 | path = iOS; 116 | sourceTree = ""; 117 | }; 118 | D726D4CD25EC39060044840D /* macOS */ = { 119 | isa = PBXGroup; 120 | children = ( 121 | D726D4CE25EC39060044840D /* Info.plist */, 122 | D726D4CF25EC39060044840D /* macOS.entitlements */, 123 | ); 124 | path = macOS; 125 | sourceTree = ""; 126 | }; 127 | D726D4E825EC39A60044840D /* Views */ = { 128 | isa = PBXGroup; 129 | children = ( 130 | D7277DD926B87AB5005C6EE9 /* GraphView.swift */, 131 | D7FABB82269365AA00ACF9F6 /* ComparedProgress.swift */, 132 | D7FABB802692FB9400ACF9F6 /* CardWithData.swift */, 133 | D782EC8626681F9A00F19317 /* CardWithImage.swift */, 134 | D7AA09AB26660440004489CD /* TwitterLike.swift */, 135 | D759F5CF265C433E00A4FB31 /* LoadingView.swift */, 136 | D759F5CD265BF76000A4FB31 /* TableCellImage.swift */, 137 | D759F5CB265BB3D100A4FB31 /* SquircleGraphIcon.swift */, 138 | D7A7C7302654EBED00A77196 /* SFSymbolRoundedButton.swift */, 139 | D7EBE2E2264D22430009C7FE /* NeumorphButton.swift */, 140 | D7EBE2E4264D3A9F0009C7FE /* LineGraph.swift */, 141 | D7630715264BB38700696726 /* RoundedButton.swift */, 142 | D7F6D887263323200033A10C /* CircleGraph.swift */, 143 | D7EBE2E6264D663C0009C7FE /* Colors.swift */, 144 | ); 145 | path = Views; 146 | sourceTree = ""; 147 | }; 148 | /* End PBXGroup section */ 149 | 150 | /* Begin PBXNativeTarget section */ 151 | D726D4C325EC39060044840D /* swiftUIViews (iOS) */ = { 152 | isa = PBXNativeTarget; 153 | buildConfigurationList = D726D4D825EC39060044840D /* Build configuration list for PBXNativeTarget "swiftUIViews (iOS)" */; 154 | buildPhases = ( 155 | D726D4C025EC39060044840D /* Sources */, 156 | D726D4C125EC39060044840D /* Frameworks */, 157 | D726D4C225EC39060044840D /* Resources */, 158 | ); 159 | buildRules = ( 160 | ); 161 | dependencies = ( 162 | ); 163 | name = "swiftUIViews (iOS)"; 164 | productName = "swiftUIViews (iOS)"; 165 | productReference = D726D4C425EC39060044840D /* swiftUIViews.app */; 166 | productType = "com.apple.product-type.application"; 167 | }; 168 | D726D4CB25EC39060044840D /* swiftUIViews (macOS) */ = { 169 | isa = PBXNativeTarget; 170 | buildConfigurationList = D726D4DB25EC39060044840D /* Build configuration list for PBXNativeTarget "swiftUIViews (macOS)" */; 171 | buildPhases = ( 172 | D726D4C825EC39060044840D /* Sources */, 173 | D726D4C925EC39060044840D /* Frameworks */, 174 | D726D4CA25EC39060044840D /* Resources */, 175 | ); 176 | buildRules = ( 177 | ); 178 | dependencies = ( 179 | ); 180 | name = "swiftUIViews (macOS)"; 181 | productName = "swiftUIViews (macOS)"; 182 | productReference = D726D4CC25EC39060044840D /* swiftUIViews.app */; 183 | productType = "com.apple.product-type.application"; 184 | }; 185 | /* End PBXNativeTarget section */ 186 | 187 | /* Begin PBXProject section */ 188 | D726D4B825EC39050044840D /* Project object */ = { 189 | isa = PBXProject; 190 | attributes = { 191 | LastSwiftUpdateCheck = 1240; 192 | LastUpgradeCheck = 1250; 193 | TargetAttributes = { 194 | D726D4C325EC39060044840D = { 195 | CreatedOnToolsVersion = 12.4; 196 | }; 197 | D726D4CB25EC39060044840D = { 198 | CreatedOnToolsVersion = 12.4; 199 | }; 200 | }; 201 | }; 202 | buildConfigurationList = D726D4BB25EC39050044840D /* Build configuration list for PBXProject "swiftUIViews" */; 203 | compatibilityVersion = "Xcode 9.3"; 204 | developmentRegion = en; 205 | hasScannedForEncodings = 0; 206 | knownRegions = ( 207 | en, 208 | Base, 209 | ); 210 | mainGroup = D726D4B725EC39050044840D; 211 | productRefGroup = D726D4C525EC39060044840D /* Products */; 212 | projectDirPath = ""; 213 | projectRoot = ""; 214 | targets = ( 215 | D726D4C325EC39060044840D /* swiftUIViews (iOS) */, 216 | D726D4CB25EC39060044840D /* swiftUIViews (macOS) */, 217 | ); 218 | }; 219 | /* End PBXProject section */ 220 | 221 | /* Begin PBXResourcesBuildPhase section */ 222 | D726D4C225EC39060044840D /* Resources */ = { 223 | isa = PBXResourcesBuildPhase; 224 | buildActionMask = 2147483647; 225 | files = ( 226 | D726D4D425EC39060044840D /* Assets.xcassets in Resources */, 227 | ); 228 | runOnlyForDeploymentPostprocessing = 0; 229 | }; 230 | D726D4CA25EC39060044840D /* Resources */ = { 231 | isa = PBXResourcesBuildPhase; 232 | buildActionMask = 2147483647; 233 | files = ( 234 | D726D4D525EC39060044840D /* Assets.xcassets in Resources */, 235 | ); 236 | runOnlyForDeploymentPostprocessing = 0; 237 | }; 238 | /* End PBXResourcesBuildPhase section */ 239 | 240 | /* Begin PBXSourcesBuildPhase section */ 241 | D726D4C025EC39060044840D /* Sources */ = { 242 | isa = PBXSourcesBuildPhase; 243 | buildActionMask = 2147483647; 244 | files = ( 245 | D7EBE2E3264D22430009C7FE /* NeumorphButton.swift in Sources */, 246 | D7FABB83269365AA00ACF9F6 /* ComparedProgress.swift in Sources */, 247 | D782EC8726681F9A00F19317 /* CardWithImage.swift in Sources */, 248 | D759F5CC265BB3D100A4FB31 /* SquircleGraphIcon.swift in Sources */, 249 | D759F5CE265BF76000A4FB31 /* TableCellImage.swift in Sources */, 250 | D7A7C7312654EBED00A77196 /* SFSymbolRoundedButton.swift in Sources */, 251 | D7EBE2E7264D663C0009C7FE /* Colors.swift in Sources */, 252 | D759F5D0265C433E00A4FB31 /* LoadingView.swift in Sources */, 253 | D7F6D888263323200033A10C /* CircleGraph.swift in Sources */, 254 | D7EBE2E5264D3A9F0009C7FE /* LineGraph.swift in Sources */, 255 | D7630716264BB38700696726 /* RoundedButton.swift in Sources */, 256 | D72B04612665618E0073CD37 /* ViewTemplate-dontDelete.swift in Sources */, 257 | D7FABB812692FB9400ACF9F6 /* CardWithData.swift in Sources */, 258 | D7277DDA26B87AB5005C6EE9 /* GraphView.swift in Sources */, 259 | D7AA09AC26660440004489CD /* TwitterLike.swift in Sources */, 260 | D726D4D225EC39060044840D /* Previewer.swift in Sources */, 261 | D726D4D025EC39060044840D /* swiftUIViewsApp.swift in Sources */, 262 | ); 263 | runOnlyForDeploymentPostprocessing = 0; 264 | }; 265 | D726D4C825EC39060044840D /* Sources */ = { 266 | isa = PBXSourcesBuildPhase; 267 | buildActionMask = 2147483647; 268 | files = ( 269 | D726D4D325EC39060044840D /* Previewer.swift in Sources */, 270 | D726D4D125EC39060044840D /* swiftUIViewsApp.swift in Sources */, 271 | ); 272 | runOnlyForDeploymentPostprocessing = 0; 273 | }; 274 | /* End PBXSourcesBuildPhase section */ 275 | 276 | /* Begin XCBuildConfiguration section */ 277 | D726D4D625EC39060044840D /* Debug */ = { 278 | isa = XCBuildConfiguration; 279 | buildSettings = { 280 | ALWAYS_SEARCH_USER_PATHS = NO; 281 | CLANG_ANALYZER_NONNULL = YES; 282 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 283 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 284 | CLANG_CXX_LIBRARY = "libc++"; 285 | CLANG_ENABLE_MODULES = YES; 286 | CLANG_ENABLE_OBJC_ARC = YES; 287 | CLANG_ENABLE_OBJC_WEAK = YES; 288 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 289 | CLANG_WARN_BOOL_CONVERSION = YES; 290 | CLANG_WARN_COMMA = YES; 291 | CLANG_WARN_CONSTANT_CONVERSION = YES; 292 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 293 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 294 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 295 | CLANG_WARN_EMPTY_BODY = YES; 296 | CLANG_WARN_ENUM_CONVERSION = YES; 297 | CLANG_WARN_INFINITE_RECURSION = YES; 298 | CLANG_WARN_INT_CONVERSION = YES; 299 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 300 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 301 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 302 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 303 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; 304 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 305 | CLANG_WARN_STRICT_PROTOTYPES = YES; 306 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 307 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 308 | CLANG_WARN_UNREACHABLE_CODE = YES; 309 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 310 | COPY_PHASE_STRIP = NO; 311 | DEBUG_INFORMATION_FORMAT = dwarf; 312 | ENABLE_STRICT_OBJC_MSGSEND = YES; 313 | ENABLE_TESTABILITY = YES; 314 | GCC_C_LANGUAGE_STANDARD = gnu11; 315 | GCC_DYNAMIC_NO_PIC = NO; 316 | GCC_NO_COMMON_BLOCKS = YES; 317 | GCC_OPTIMIZATION_LEVEL = 0; 318 | GCC_PREPROCESSOR_DEFINITIONS = ( 319 | "DEBUG=1", 320 | "$(inherited)", 321 | ); 322 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 323 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 324 | GCC_WARN_UNDECLARED_SELECTOR = YES; 325 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 326 | GCC_WARN_UNUSED_FUNCTION = YES; 327 | GCC_WARN_UNUSED_VARIABLE = YES; 328 | MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; 329 | MTL_FAST_MATH = YES; 330 | ONLY_ACTIVE_ARCH = YES; 331 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; 332 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 333 | }; 334 | name = Debug; 335 | }; 336 | D726D4D725EC39060044840D /* Release */ = { 337 | isa = XCBuildConfiguration; 338 | buildSettings = { 339 | ALWAYS_SEARCH_USER_PATHS = NO; 340 | CLANG_ANALYZER_NONNULL = YES; 341 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 342 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 343 | CLANG_CXX_LIBRARY = "libc++"; 344 | CLANG_ENABLE_MODULES = YES; 345 | CLANG_ENABLE_OBJC_ARC = YES; 346 | CLANG_ENABLE_OBJC_WEAK = YES; 347 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 348 | CLANG_WARN_BOOL_CONVERSION = YES; 349 | CLANG_WARN_COMMA = YES; 350 | CLANG_WARN_CONSTANT_CONVERSION = YES; 351 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 352 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 353 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 354 | CLANG_WARN_EMPTY_BODY = YES; 355 | CLANG_WARN_ENUM_CONVERSION = YES; 356 | CLANG_WARN_INFINITE_RECURSION = YES; 357 | CLANG_WARN_INT_CONVERSION = YES; 358 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 359 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 360 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 361 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 362 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; 363 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 364 | CLANG_WARN_STRICT_PROTOTYPES = YES; 365 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 366 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 367 | CLANG_WARN_UNREACHABLE_CODE = YES; 368 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 369 | COPY_PHASE_STRIP = NO; 370 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 371 | ENABLE_NS_ASSERTIONS = NO; 372 | ENABLE_STRICT_OBJC_MSGSEND = YES; 373 | GCC_C_LANGUAGE_STANDARD = gnu11; 374 | GCC_NO_COMMON_BLOCKS = YES; 375 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 376 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 377 | GCC_WARN_UNDECLARED_SELECTOR = YES; 378 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 379 | GCC_WARN_UNUSED_FUNCTION = YES; 380 | GCC_WARN_UNUSED_VARIABLE = YES; 381 | MTL_ENABLE_DEBUG_INFO = NO; 382 | MTL_FAST_MATH = YES; 383 | SWIFT_COMPILATION_MODE = wholemodule; 384 | SWIFT_OPTIMIZATION_LEVEL = "-O"; 385 | }; 386 | name = Release; 387 | }; 388 | D726D4D925EC39060044840D /* Debug */ = { 389 | isa = XCBuildConfiguration; 390 | buildSettings = { 391 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 392 | ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; 393 | CODE_SIGN_ENTITLEMENTS = swiftUIViews.entitlements; 394 | CODE_SIGN_STYLE = Automatic; 395 | DEVELOPMENT_TEAM = ZQCK5WLKEQ; 396 | ENABLE_PREVIEWS = YES; 397 | INFOPLIST_FILE = iOS/Info.plist; 398 | IPHONEOS_DEPLOYMENT_TARGET = 14.0; 399 | LD_RUNPATH_SEARCH_PATHS = ( 400 | "$(inherited)", 401 | "@executable_path/Frameworks", 402 | ); 403 | PRODUCT_BUNDLE_IDENTIFIER = undeadpixel.swiftUIViews; 404 | PRODUCT_NAME = swiftUIViews; 405 | SDKROOT = iphoneos; 406 | SUPPORTS_MACCATALYST = NO; 407 | SWIFT_VERSION = 5.0; 408 | TARGETED_DEVICE_FAMILY = "1,2"; 409 | }; 410 | name = Debug; 411 | }; 412 | D726D4DA25EC39060044840D /* Release */ = { 413 | isa = XCBuildConfiguration; 414 | buildSettings = { 415 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 416 | ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; 417 | CODE_SIGN_ENTITLEMENTS = swiftUIViews.entitlements; 418 | CODE_SIGN_STYLE = Automatic; 419 | DEVELOPMENT_TEAM = ZQCK5WLKEQ; 420 | ENABLE_PREVIEWS = YES; 421 | INFOPLIST_FILE = iOS/Info.plist; 422 | IPHONEOS_DEPLOYMENT_TARGET = 14.0; 423 | LD_RUNPATH_SEARCH_PATHS = ( 424 | "$(inherited)", 425 | "@executable_path/Frameworks", 426 | ); 427 | PRODUCT_BUNDLE_IDENTIFIER = undeadpixel.swiftUIViews; 428 | PRODUCT_NAME = swiftUIViews; 429 | SDKROOT = iphoneos; 430 | SUPPORTS_MACCATALYST = NO; 431 | SWIFT_VERSION = 5.0; 432 | TARGETED_DEVICE_FAMILY = "1,2"; 433 | VALIDATE_PRODUCT = YES; 434 | }; 435 | name = Release; 436 | }; 437 | D726D4DC25EC39060044840D /* Debug */ = { 438 | isa = XCBuildConfiguration; 439 | buildSettings = { 440 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 441 | ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; 442 | CODE_SIGN_ENTITLEMENTS = macOS/macOS.entitlements; 443 | CODE_SIGN_IDENTITY = "-"; 444 | CODE_SIGN_STYLE = Automatic; 445 | COMBINE_HIDPI_IMAGES = YES; 446 | DEVELOPMENT_TEAM = ZQCK5WLKEQ; 447 | ENABLE_HARDENED_RUNTIME = YES; 448 | ENABLE_PREVIEWS = YES; 449 | INFOPLIST_FILE = macOS/Info.plist; 450 | LD_RUNPATH_SEARCH_PATHS = ( 451 | "$(inherited)", 452 | "@executable_path/../Frameworks", 453 | ); 454 | MACOSX_DEPLOYMENT_TARGET = 11.0; 455 | PRODUCT_BUNDLE_IDENTIFIER = undeadpixel.swiftUIViews; 456 | PRODUCT_NAME = swiftUIViews; 457 | SDKROOT = macosx; 458 | SWIFT_VERSION = 5.0; 459 | }; 460 | name = Debug; 461 | }; 462 | D726D4DD25EC39060044840D /* Release */ = { 463 | isa = XCBuildConfiguration; 464 | buildSettings = { 465 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 466 | ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; 467 | CODE_SIGN_ENTITLEMENTS = macOS/macOS.entitlements; 468 | CODE_SIGN_IDENTITY = "-"; 469 | CODE_SIGN_STYLE = Automatic; 470 | COMBINE_HIDPI_IMAGES = YES; 471 | DEVELOPMENT_TEAM = ZQCK5WLKEQ; 472 | ENABLE_HARDENED_RUNTIME = YES; 473 | ENABLE_PREVIEWS = YES; 474 | INFOPLIST_FILE = macOS/Info.plist; 475 | LD_RUNPATH_SEARCH_PATHS = ( 476 | "$(inherited)", 477 | "@executable_path/../Frameworks", 478 | ); 479 | MACOSX_DEPLOYMENT_TARGET = 11.0; 480 | PRODUCT_BUNDLE_IDENTIFIER = undeadpixel.swiftUIViews; 481 | PRODUCT_NAME = swiftUIViews; 482 | SDKROOT = macosx; 483 | SWIFT_VERSION = 5.0; 484 | }; 485 | name = Release; 486 | }; 487 | /* End XCBuildConfiguration section */ 488 | 489 | /* Begin XCConfigurationList section */ 490 | D726D4BB25EC39050044840D /* Build configuration list for PBXProject "swiftUIViews" */ = { 491 | isa = XCConfigurationList; 492 | buildConfigurations = ( 493 | D726D4D625EC39060044840D /* Debug */, 494 | D726D4D725EC39060044840D /* Release */, 495 | ); 496 | defaultConfigurationIsVisible = 0; 497 | defaultConfigurationName = Release; 498 | }; 499 | D726D4D825EC39060044840D /* Build configuration list for PBXNativeTarget "swiftUIViews (iOS)" */ = { 500 | isa = XCConfigurationList; 501 | buildConfigurations = ( 502 | D726D4D925EC39060044840D /* Debug */, 503 | D726D4DA25EC39060044840D /* Release */, 504 | ); 505 | defaultConfigurationIsVisible = 0; 506 | defaultConfigurationName = Release; 507 | }; 508 | D726D4DB25EC39060044840D /* Build configuration list for PBXNativeTarget "swiftUIViews (macOS)" */ = { 509 | isa = XCConfigurationList; 510 | buildConfigurations = ( 511 | D726D4DC25EC39060044840D /* Debug */, 512 | D726D4DD25EC39060044840D /* Release */, 513 | ); 514 | defaultConfigurationIsVisible = 0; 515 | defaultConfigurationName = Release; 516 | }; 517 | /* End XCConfigurationList section */ 518 | }; 519 | rootObject = D726D4B825EC39050044840D /* Project object */; 520 | } 521 | -------------------------------------------------------------------------------- /swiftUIViews.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /swiftUIViews.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /swiftUIViews.xcodeproj/project.xcworkspace/xcuserdata/roblack.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emin-grbo/swiftUIViews/c01d6d8698ef6940e899bbd2bc9ee6ac0ccd8f72/swiftUIViews.xcodeproj/project.xcworkspace/xcuserdata/roblack.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /swiftUIViews.xcodeproj/xcshareddata/xcschemes/swiftUIViews (macOS).xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 43 | 45 | 51 | 52 | 53 | 54 | 60 | 62 | 68 | 69 | 70 | 71 | 73 | 74 | 77 | 78 | 79 | -------------------------------------------------------------------------------- /swiftUIViews.xcodeproj/xcuserdata/roblack.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | swiftUIViews (iOS).xcscheme_^#shared#^_ 8 | 9 | orderHint 10 | 1 11 | 12 | swiftUIViews (macOS).xcscheme_^#shared#^_ 13 | 14 | orderHint 15 | 0 16 | 17 | 18 | SuppressBuildableAutocreation 19 | 20 | D726D4CB25EC39060044840D 21 | 22 | primary 23 | 24 | 25 | 26 | 27 | 28 | --------------------------------------------------------------------------------