├── .github ├── logo.png ├── example1.png ├── example2.png └── example3.png ├── SwiftUI by Examples ├── SwiftUI by Examples │ ├── Assets.xcassets │ │ ├── Contents.json │ │ ├── thumbnails │ │ │ ├── Contents.json │ │ │ ├── 2612_wide_250x141_2x.imageset │ │ │ │ ├── 2612_wide_250x141_2x.jpg │ │ │ │ └── Contents.json │ │ │ ├── 2640_wide_250x141_2x.imageset │ │ │ │ ├── 2640_wide_250x141_2x.jpg │ │ │ │ └── Contents.json │ │ │ ├── 2645_wide_250x141_2x.imageset │ │ │ │ ├── 2645_wide_250x141_2x.jpg │ │ │ │ └── Contents.json │ │ │ ├── 2649_wide_250x141_2x.imageset │ │ │ │ ├── 2649_wide_250x141_2x.jpg │ │ │ │ └── Contents.json │ │ │ ├── 2672_wide_250x141_2x.imageset │ │ │ │ ├── 2672_wide_250x141_2x.jpg │ │ │ │ └── Contents.json │ │ │ ├── 2676_wide_250x141_2x.imageset │ │ │ │ ├── 2676_wide_250x141_2x.jpg │ │ │ │ └── Contents.json │ │ │ ├── 2682_wide_250x141_2x.imageset │ │ │ │ ├── 2682_wide_250x141_2x.jpg │ │ │ │ └── Contents.json │ │ │ ├── 2684_wide_250x141_2x.imageset │ │ │ │ ├── 2684_wide_250x141_2x.jpg │ │ │ │ └── Contents.json │ │ │ └── 2949_wide_250x141_2x.imageset │ │ │ │ ├── 2949_wide_250x141_2x.jpg │ │ │ │ └── Contents.json │ │ └── AppIcon.appiconset │ │ │ ├── Icon-App-20x20@1x.png │ │ │ ├── Icon-App-20x20@2x.png │ │ │ ├── Icon-App-20x20@3x.png │ │ │ ├── Icon-App-29x29@1x.png │ │ │ ├── Icon-App-29x29@2x.png │ │ │ ├── Icon-App-29x29@3x.png │ │ │ ├── Icon-App-40x40@1x.png │ │ │ ├── Icon-App-40x40@2x.png │ │ │ ├── Icon-App-40x40@3x.png │ │ │ ├── Icon-App-60x60@2x.png │ │ │ ├── Icon-App-60x60@3x.png │ │ │ ├── Icon-App-76x76@1x.png │ │ │ ├── Icon-App-76x76@2x.png │ │ │ ├── ItunesArtwork@2x.png │ │ │ ├── Icon-App-83.5x83.5@2x.png │ │ │ └── Contents.json │ ├── Preview Content │ │ └── Preview Assets.xcassets │ │ │ └── Contents.json │ ├── StepperView.swift │ ├── ToggleView.swift │ ├── ExampleCell.swift │ ├── SegmentedControlView.swift │ ├── TextView.swift │ ├── AnimationView.swift │ ├── DatePickerView.swift │ ├── TextFieldView.swift │ ├── VideoCell.swift │ ├── ButtonsView.swift │ ├── SliderView.swift │ ├── Base.lproj │ │ └── LaunchScreen.storyboard │ ├── AppDelegate.swift │ ├── VideoListView.swift │ ├── GestureView.swift │ ├── VideoDetailsView.swift │ ├── HexagonParameters.swift │ ├── Info.plist │ ├── AlertView.swift │ ├── BadgeView.swift │ ├── SceneDelegate.swift │ ├── ExampleListView.swift │ └── Video.swift └── SwiftUI by Examples.xcodeproj │ ├── project.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ └── IDEWorkspaceChecks.plist │ └── project.pbxproj ├── Configuration └── SampleCode.xcconfig ├── LICENSE ├── README.md └── .gitignore /.github/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/artemnovichkov/SwiftUI-by-Examples/HEAD/.github/logo.png -------------------------------------------------------------------------------- /.github/example1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/artemnovichkov/SwiftUI-by-Examples/HEAD/.github/example1.png -------------------------------------------------------------------------------- /.github/example2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/artemnovichkov/SwiftUI-by-Examples/HEAD/.github/example2.png -------------------------------------------------------------------------------- /.github/example3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/artemnovichkov/SwiftUI-by-Examples/HEAD/.github/example3.png -------------------------------------------------------------------------------- /SwiftUI by Examples/SwiftUI by Examples/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /SwiftUI by Examples/SwiftUI by Examples/Assets.xcassets/thumbnails/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /SwiftUI by Examples/SwiftUI by Examples/Preview Content/Preview Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /SwiftUI by Examples/SwiftUI by Examples/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/artemnovichkov/SwiftUI-by-Examples/HEAD/SwiftUI by Examples/SwiftUI by Examples/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png -------------------------------------------------------------------------------- /SwiftUI by Examples/SwiftUI by Examples/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/artemnovichkov/SwiftUI-by-Examples/HEAD/SwiftUI by Examples/SwiftUI by Examples/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png -------------------------------------------------------------------------------- /SwiftUI by Examples/SwiftUI by Examples/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/artemnovichkov/SwiftUI-by-Examples/HEAD/SwiftUI by Examples/SwiftUI by Examples/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png -------------------------------------------------------------------------------- /SwiftUI by Examples/SwiftUI by Examples/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/artemnovichkov/SwiftUI-by-Examples/HEAD/SwiftUI by Examples/SwiftUI by Examples/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png -------------------------------------------------------------------------------- /SwiftUI by Examples/SwiftUI by Examples/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/artemnovichkov/SwiftUI-by-Examples/HEAD/SwiftUI by Examples/SwiftUI by Examples/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png -------------------------------------------------------------------------------- /SwiftUI by Examples/SwiftUI by Examples/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/artemnovichkov/SwiftUI-by-Examples/HEAD/SwiftUI by Examples/SwiftUI by Examples/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png -------------------------------------------------------------------------------- /SwiftUI by Examples/SwiftUI by Examples/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/artemnovichkov/SwiftUI-by-Examples/HEAD/SwiftUI by Examples/SwiftUI by Examples/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png -------------------------------------------------------------------------------- /SwiftUI by Examples/SwiftUI by Examples/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/artemnovichkov/SwiftUI-by-Examples/HEAD/SwiftUI by Examples/SwiftUI by Examples/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png -------------------------------------------------------------------------------- /SwiftUI by Examples/SwiftUI by Examples/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/artemnovichkov/SwiftUI-by-Examples/HEAD/SwiftUI by Examples/SwiftUI by Examples/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png -------------------------------------------------------------------------------- /SwiftUI by Examples/SwiftUI by Examples/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/artemnovichkov/SwiftUI-by-Examples/HEAD/SwiftUI by Examples/SwiftUI by Examples/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png -------------------------------------------------------------------------------- /SwiftUI by Examples/SwiftUI by Examples/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/artemnovichkov/SwiftUI-by-Examples/HEAD/SwiftUI by Examples/SwiftUI by Examples/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png -------------------------------------------------------------------------------- /SwiftUI by Examples/SwiftUI by Examples/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/artemnovichkov/SwiftUI-by-Examples/HEAD/SwiftUI by Examples/SwiftUI by Examples/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png -------------------------------------------------------------------------------- /SwiftUI by Examples/SwiftUI by Examples/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/artemnovichkov/SwiftUI-by-Examples/HEAD/SwiftUI by Examples/SwiftUI by Examples/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png -------------------------------------------------------------------------------- /SwiftUI by Examples/SwiftUI by Examples/Assets.xcassets/AppIcon.appiconset/ItunesArtwork@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/artemnovichkov/SwiftUI-by-Examples/HEAD/SwiftUI by Examples/SwiftUI by Examples/Assets.xcassets/AppIcon.appiconset/ItunesArtwork@2x.png -------------------------------------------------------------------------------- /SwiftUI by Examples/SwiftUI by Examples/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/artemnovichkov/SwiftUI-by-Examples/HEAD/SwiftUI by Examples/SwiftUI by Examples/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png -------------------------------------------------------------------------------- /SwiftUI by Examples/SwiftUI by Examples.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /SwiftUI by Examples/SwiftUI by Examples/Assets.xcassets/thumbnails/2612_wide_250x141_2x.imageset/2612_wide_250x141_2x.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/artemnovichkov/SwiftUI-by-Examples/HEAD/SwiftUI by Examples/SwiftUI by Examples/Assets.xcassets/thumbnails/2612_wide_250x141_2x.imageset/2612_wide_250x141_2x.jpg -------------------------------------------------------------------------------- /SwiftUI by Examples/SwiftUI by Examples/Assets.xcassets/thumbnails/2640_wide_250x141_2x.imageset/2640_wide_250x141_2x.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/artemnovichkov/SwiftUI-by-Examples/HEAD/SwiftUI by Examples/SwiftUI by Examples/Assets.xcassets/thumbnails/2640_wide_250x141_2x.imageset/2640_wide_250x141_2x.jpg -------------------------------------------------------------------------------- /SwiftUI by Examples/SwiftUI by Examples/Assets.xcassets/thumbnails/2645_wide_250x141_2x.imageset/2645_wide_250x141_2x.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/artemnovichkov/SwiftUI-by-Examples/HEAD/SwiftUI by Examples/SwiftUI by Examples/Assets.xcassets/thumbnails/2645_wide_250x141_2x.imageset/2645_wide_250x141_2x.jpg -------------------------------------------------------------------------------- /SwiftUI by Examples/SwiftUI by Examples/Assets.xcassets/thumbnails/2649_wide_250x141_2x.imageset/2649_wide_250x141_2x.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/artemnovichkov/SwiftUI-by-Examples/HEAD/SwiftUI by Examples/SwiftUI by Examples/Assets.xcassets/thumbnails/2649_wide_250x141_2x.imageset/2649_wide_250x141_2x.jpg -------------------------------------------------------------------------------- /SwiftUI by Examples/SwiftUI by Examples/Assets.xcassets/thumbnails/2672_wide_250x141_2x.imageset/2672_wide_250x141_2x.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/artemnovichkov/SwiftUI-by-Examples/HEAD/SwiftUI by Examples/SwiftUI by Examples/Assets.xcassets/thumbnails/2672_wide_250x141_2x.imageset/2672_wide_250x141_2x.jpg -------------------------------------------------------------------------------- /SwiftUI by Examples/SwiftUI by Examples/Assets.xcassets/thumbnails/2676_wide_250x141_2x.imageset/2676_wide_250x141_2x.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/artemnovichkov/SwiftUI-by-Examples/HEAD/SwiftUI by Examples/SwiftUI by Examples/Assets.xcassets/thumbnails/2676_wide_250x141_2x.imageset/2676_wide_250x141_2x.jpg -------------------------------------------------------------------------------- /SwiftUI by Examples/SwiftUI by Examples/Assets.xcassets/thumbnails/2682_wide_250x141_2x.imageset/2682_wide_250x141_2x.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/artemnovichkov/SwiftUI-by-Examples/HEAD/SwiftUI by Examples/SwiftUI by Examples/Assets.xcassets/thumbnails/2682_wide_250x141_2x.imageset/2682_wide_250x141_2x.jpg -------------------------------------------------------------------------------- /SwiftUI by Examples/SwiftUI by Examples/Assets.xcassets/thumbnails/2684_wide_250x141_2x.imageset/2684_wide_250x141_2x.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/artemnovichkov/SwiftUI-by-Examples/HEAD/SwiftUI by Examples/SwiftUI by Examples/Assets.xcassets/thumbnails/2684_wide_250x141_2x.imageset/2684_wide_250x141_2x.jpg -------------------------------------------------------------------------------- /SwiftUI by Examples/SwiftUI by Examples/Assets.xcassets/thumbnails/2949_wide_250x141_2x.imageset/2949_wide_250x141_2x.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/artemnovichkov/SwiftUI-by-Examples/HEAD/SwiftUI by Examples/SwiftUI by Examples/Assets.xcassets/thumbnails/2949_wide_250x141_2x.imageset/2949_wide_250x141_2x.jpg -------------------------------------------------------------------------------- /SwiftUI by Examples/SwiftUI by Examples/Assets.xcassets/thumbnails/2612_wide_250x141_2x.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "2612_wide_250x141_2x.jpg" 6 | } 7 | ], 8 | "info" : { 9 | "version" : 1, 10 | "author" : "xcode" 11 | } 12 | } -------------------------------------------------------------------------------- /SwiftUI by Examples/SwiftUI by Examples/Assets.xcassets/thumbnails/2640_wide_250x141_2x.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "2640_wide_250x141_2x.jpg" 6 | } 7 | ], 8 | "info" : { 9 | "version" : 1, 10 | "author" : "xcode" 11 | } 12 | } -------------------------------------------------------------------------------- /SwiftUI by Examples/SwiftUI by Examples/Assets.xcassets/thumbnails/2645_wide_250x141_2x.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "2645_wide_250x141_2x.jpg" 6 | } 7 | ], 8 | "info" : { 9 | "version" : 1, 10 | "author" : "xcode" 11 | } 12 | } -------------------------------------------------------------------------------- /SwiftUI by Examples/SwiftUI by Examples/Assets.xcassets/thumbnails/2649_wide_250x141_2x.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "2649_wide_250x141_2x.jpg" 6 | } 7 | ], 8 | "info" : { 9 | "version" : 1, 10 | "author" : "xcode" 11 | } 12 | } -------------------------------------------------------------------------------- /SwiftUI by Examples/SwiftUI by Examples/Assets.xcassets/thumbnails/2672_wide_250x141_2x.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "2672_wide_250x141_2x.jpg" 6 | } 7 | ], 8 | "info" : { 9 | "version" : 1, 10 | "author" : "xcode" 11 | } 12 | } -------------------------------------------------------------------------------- /SwiftUI by Examples/SwiftUI by Examples/Assets.xcassets/thumbnails/2676_wide_250x141_2x.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "2676_wide_250x141_2x.jpg" 6 | } 7 | ], 8 | "info" : { 9 | "version" : 1, 10 | "author" : "xcode" 11 | } 12 | } -------------------------------------------------------------------------------- /SwiftUI by Examples/SwiftUI by Examples/Assets.xcassets/thumbnails/2682_wide_250x141_2x.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "2682_wide_250x141_2x.jpg" 6 | } 7 | ], 8 | "info" : { 9 | "version" : 1, 10 | "author" : "xcode" 11 | } 12 | } -------------------------------------------------------------------------------- /SwiftUI by Examples/SwiftUI by Examples/Assets.xcassets/thumbnails/2684_wide_250x141_2x.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "2684_wide_250x141_2x.jpg" 6 | } 7 | ], 8 | "info" : { 9 | "version" : 1, 10 | "author" : "xcode" 11 | } 12 | } -------------------------------------------------------------------------------- /SwiftUI by Examples/SwiftUI by Examples/Assets.xcassets/thumbnails/2949_wide_250x141_2x.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "2949_wide_250x141_2x.jpg" 6 | } 7 | ], 8 | "info" : { 9 | "version" : 1, 10 | "author" : "xcode" 11 | } 12 | } -------------------------------------------------------------------------------- /SwiftUI by Examples/SwiftUI by Examples.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /SwiftUI by Examples/SwiftUI by Examples/StepperView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // StepperView.swift 3 | // SwiftUI by Examples 4 | // 5 | // Created by Artem Novichkov on 10/06/2019. 6 | // Copyright © 2019 Artem Novichkov. All rights reserved. 7 | // 8 | 9 | import SwiftUI 10 | 11 | struct StepperView: View { 12 | 13 | @State var value = 0 14 | 15 | var body: some View { 16 | Stepper(value: $value, step: 1) { 17 | Text("\(self.value)") 18 | } 19 | .padding() 20 | } 21 | } 22 | 23 | #if DEBUG 24 | struct StepperView_Previews: PreviewProvider { 25 | static var previews: some View { 26 | StepperView() 27 | } 28 | } 29 | #endif 30 | -------------------------------------------------------------------------------- /Configuration/SampleCode.xcconfig: -------------------------------------------------------------------------------- 1 | // 2 | // See LICENSE folder for this sample’s licensing information. 3 | // 4 | // SampleCode.xcconfig 5 | // 6 | 7 | // The `SAMPLE_CODE_DISAMBIGUATOR` configuration is to make it easier to build 8 | // and run a sample code project. Once you set your project's development team, 9 | // you'll have a unique bundle identifier. This is because the bundle identifier 10 | // is derived based on the 'SAMPLE_CODE_DISAMBIGUATOR' value. Do not use this 11 | // approach in your own projects—it's only useful for sample code projects because 12 | // they are frequently downloaded and don't have a development team set. 13 | SAMPLE_CODE_DISAMBIGUATOR=${DEVELOPMENT_TEAM} 14 | -------------------------------------------------------------------------------- /SwiftUI by Examples/SwiftUI by Examples/ToggleView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ToggleView.swift 3 | // SwiftUI by Examples 4 | // 5 | // Created by Artem Novichkov on 10/06/2019. 6 | // Copyright © 2019 Artem Novichkov. All rights reserved. 7 | // 8 | 9 | import SwiftUI 10 | 11 | struct ToggleView: View { 12 | 13 | @State var isEnabled = false 14 | 15 | var body: some View { 16 | Toggle(isOn: $isEnabled) { 17 | Text(isEnabled ? "is On" : "is Off") 18 | } 19 | .padding() 20 | } 21 | } 22 | 23 | #if DEBUG 24 | struct ToggleView_Previews: PreviewProvider { 25 | static var previews: some View { 26 | ToggleView() 27 | } 28 | } 29 | #endif 30 | -------------------------------------------------------------------------------- /SwiftUI by Examples/SwiftUI by Examples/ExampleCell.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ExampleCell.swift 3 | // SwiftUI by Examples 4 | // 5 | // Created by Artem Novichkov on 09/06/2019. 6 | // Copyright © 2019 Artem Novichkov. All rights reserved. 7 | // 8 | 9 | import SwiftUI 10 | 11 | struct ExampleCell : View { 12 | 13 | let title: String 14 | let subtitle: String 15 | 16 | var body: some View { 17 | VStack(alignment: .leading) { 18 | Text(title) 19 | Text(subtitle) 20 | .font(.subheadline) 21 | } 22 | } 23 | } 24 | 25 | #if DEBUG 26 | struct ExampleCell_Previews : PreviewProvider { 27 | static var previews: some View { 28 | ExampleCell(title: "Title", subtitle: "Subtitle") 29 | } 30 | } 31 | #endif 32 | -------------------------------------------------------------------------------- /SwiftUI by Examples/SwiftUI by Examples/SegmentedControlView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SegmentedControlView.swift 3 | // SwiftUI by Examples 4 | // 5 | // Created by Artem Novichkov on 10/06/2019. 6 | // Copyright © 2019 Artem Novichkov. All rights reserved. 7 | // 8 | 9 | import SwiftUI 10 | 11 | struct SegmentedControlView: View { 12 | 13 | @State var index = 0 14 | var elements = ["Easy", "Normal", "Hard"] 15 | 16 | var body: some View { 17 | VStack { 18 | Text(elements[index]) 19 | SegmentedControl(selection: $index) { 20 | ForEach(0.. 4 | SwiftUI 5 |

6 | 7 |

8 | 9 | Xcode 11 10 | 11 | 12 | Swift 5.1 13 | 14 |

15 | 16 | SwiftUI is a simple way to build user interfaces across all Apple platforms with the power of Swift. I'm going to fill the repo with useful examples of SwiftUI. Stay tuned! 17 | 18 |

19 | SwiftUI 20 | SwiftUI 21 | SwiftUI 22 |

23 | 24 | ## Features 25 | 26 | - Texts 27 | - Text fields 28 | - Buttons 29 | - Toggle 30 | - DatePicker 31 | - Slider 32 | - Stepper 33 | - Segmented Control 34 | - Alert 35 | - Action sheet 36 | - Gestures 37 | - Animations 38 | - Editable list 39 | - Drawing shapes 40 | 41 | ## Author 42 | 43 | Artem Novichkov, novichkoff93@gmail.com 44 | 45 | ## License 46 | 47 | SwiftUI by Examples is available under the MIT license. See the LICENSE file for more info. 48 | -------------------------------------------------------------------------------- /SwiftUI by Examples/SwiftUI by Examples/VideoCell.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ListView.swift 3 | // SwiftUI by Examples 4 | // 5 | // Created by Artem Novichkov on 05/06/2019. 6 | // Copyright © 2019 Artem Novichkov. All rights reserved. 7 | // 8 | 9 | import SwiftUI 10 | import Combine 11 | 12 | struct VideoCell: View { 13 | 14 | let video: Video 15 | 16 | var body: some View { 17 | NavigationButton(destination: VideoDetailsView(video: video)) { 18 | HStack { 19 | Image(video.thumbnail) 20 | .frame(width: 30, height: 30, alignment: .center) 21 | .cornerRadius(8) 22 | VStack(alignment: .leading) { 23 | Text(video.title) 24 | Text(video.description) 25 | .font(.subheadline) 26 | } 27 | if video.isFavorite { 28 | Image(systemName: "star.fill") 29 | .foregroundColor(.yellow) 30 | } 31 | } 32 | } 33 | } 34 | } 35 | 36 | #if DEBUG 37 | struct VideoCell_Previews: PreviewProvider { 38 | static var previews: some View { 39 | let store = VideoStore() 40 | return Group { 41 | VideoCell(video: store.videos[0]) 42 | VideoCell(video: store.videos[1]) 43 | } 44 | } 45 | } 46 | #endif 47 | -------------------------------------------------------------------------------- /SwiftUI by Examples/SwiftUI by Examples/ButtonsView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ButtonsView.swift 3 | // SwiftUI by Examples 4 | // 5 | // Created by Artem Novichkov on 10/06/2019. 6 | // Copyright © 2019 Artem Novichkov. All rights reserved. 7 | // 8 | 9 | import SwiftUI 10 | 11 | struct ButtonsView: View { 12 | 13 | var body: some View { 14 | 15 | VStack(spacing: 16) { 16 | Button(action: { 17 | print("tap") 18 | }, label: { 19 | Text("Tap") 20 | }) 21 | .padding() 22 | .foregroundColor(.white) 23 | .background(Color.green, cornerRadius: 12) 24 | NavigationButton(destination: TextFieldView()) { 25 | Text("Navigation") 26 | } 27 | .padding() 28 | .foregroundColor(.white) 29 | .background(Color.green, cornerRadius: 12) 30 | PresentationButton(destination: TextFieldView(), label: { 31 | Text("Presentation") 32 | }) 33 | .padding() 34 | .foregroundColor(.white) 35 | .background(Color.green, cornerRadius: 12) 36 | } 37 | 38 | } 39 | } 40 | 41 | #if DEBUG 42 | struct ButtonsView_Previews: PreviewProvider { 43 | static var previews: some View { 44 | ButtonsView() 45 | } 46 | } 47 | #endif 48 | -------------------------------------------------------------------------------- /SwiftUI by Examples/SwiftUI by Examples/SliderView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SliderView.swift 3 | // SwiftUI by Examples 4 | // 5 | // Created by Artem Novichkov on 10/06/2019. 6 | // Copyright © 2019 Artem Novichkov. All rights reserved. 7 | // 8 | 9 | import SwiftUI 10 | 11 | struct SliderView: View { 12 | 13 | @State var celsius: Double = 0 14 | 15 | private var text: String { 16 | return "\(celsius, fractionDigits: 1) Celsius is \(celsius * 9 / 5 + 32, fractionDigits: 1) Fahrenheit" 17 | } 18 | 19 | var body: some View { 20 | VStack { 21 | Slider(value: $celsius, from: -100, through: 100, by: 0.1) 22 | Text(text) 23 | } 24 | .padding() 25 | } 26 | } 27 | 28 | extension NumberFormatter { 29 | 30 | static let custom: NumberFormatter = { 31 | let formatter = NumberFormatter() 32 | formatter.minimumFractionDigits = 1 33 | formatter.maximumFractionDigits = 1 34 | return formatter 35 | }() 36 | } 37 | 38 | extension String.StringInterpolation { 39 | 40 | mutating func appendInterpolation(_ number: Double, fractionDigits: Int) { 41 | if let result = NumberFormatter.custom.string(for: number) { 42 | appendLiteral(result) 43 | } 44 | } 45 | } 46 | 47 | #if DEBUG 48 | struct SliderView_Previews: PreviewProvider { 49 | static var previews: some View { 50 | SliderView() 51 | } 52 | } 53 | #endif 54 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | # 3 | # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore 4 | 5 | ## Build generated 6 | build/ 7 | DerivedData/ 8 | 9 | ## Various settings 10 | *.pbxuser 11 | !default.pbxuser 12 | *.mode1v3 13 | !default.mode1v3 14 | *.mode2v3 15 | !default.mode2v3 16 | *.perspectivev3 17 | !default.perspectivev3 18 | xcuserdata/ 19 | 20 | ## Other 21 | *.moved-aside 22 | *.xccheckout 23 | *.xcscmblueprint 24 | 25 | ## Obj-C/Swift specific 26 | *.hmap 27 | *.ipa 28 | *.dSYM.zip 29 | *.dSYM 30 | 31 | ## Playgrounds 32 | timeline.xctimeline 33 | playground.xcworkspace 34 | 35 | # Swift Package Manager 36 | # 37 | # Add this line if you want to avoid checking in source code from Swift Package Manager dependencies. 38 | # Packages/ 39 | # Package.pins 40 | # Package.resolved 41 | .build/ 42 | 43 | # CocoaPods 44 | # 45 | # We recommend against adding the Pods directory to your .gitignore. However 46 | # you should judge for yourself, the pros and cons are mentioned at: 47 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control 48 | # 49 | # Pods/ 50 | 51 | # Carthage 52 | # 53 | # Add this line if you want to avoid checking in source code from Carthage dependencies. 54 | # Carthage/Checkouts 55 | 56 | Carthage/Build 57 | 58 | # fastlane 59 | # 60 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the 61 | # screenshots whenever they are needed. 62 | # For more information about the recommended setup visit: 63 | # https://docs.fastlane.tools/best-practices/source-control/#source-control 64 | 65 | fastlane/report.xml 66 | fastlane/Preview.html 67 | fastlane/screenshots/**/*.png 68 | fastlane/test_output 69 | -------------------------------------------------------------------------------- /SwiftUI by Examples/SwiftUI by Examples/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /SwiftUI by Examples/SwiftUI by Examples/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // SwiftUI by Examples 4 | // 5 | // Created by Artem Novichkov on 05/06/2019. 6 | // Copyright © 2019 Artem Novichkov. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | @UIApplicationMain 12 | class AppDelegate: UIResponder, UIApplicationDelegate { 13 | 14 | func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { 15 | // Override point for customization after application launch. 16 | return true 17 | } 18 | 19 | func applicationWillTerminate(_ application: UIApplication) { 20 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 21 | } 22 | 23 | // MARK: UISceneSession Lifecycle 24 | 25 | func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration { 26 | // Called when a new scene session is being created. 27 | // Use this method to select a configuration to create the new scene with. 28 | return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role) 29 | } 30 | 31 | func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set) { 32 | // Called when the user discards a scene session. 33 | // If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions. 34 | // Use this method to release any resources that were specific to the discarded scenes, as they will not return. 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /SwiftUI by Examples/SwiftUI by Examples/VideoListView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ListView.swift 3 | // SwiftUI by Examples 4 | // 5 | // Created by Artem Novichkov on 05/06/2019. 6 | // Copyright © 2019 Artem Novichkov. All rights reserved. 7 | // 8 | 9 | import SwiftUI 10 | import Combine 11 | 12 | struct VideoListView: View { 13 | 14 | @State var showFavoritesOnly = false 15 | 16 | @EnvironmentObject private var store: VideoStore 17 | 18 | var body: some View { 19 | NavigationView { 20 | List { 21 | Section { 22 | Toggle(isOn: $showFavoritesOnly) { 23 | Text("Favorites only") 24 | } 25 | Button(action: addRandomVideo) { 26 | Text("Add random video") 27 | } 28 | } 29 | Section { 30 | ForEach(store.videos) { video in 31 | if !self.showFavoritesOnly || video.isFavorite { 32 | VideoCell(video: video) 33 | } 34 | } 35 | .onDelete(perform: delete) 36 | } 37 | } 38 | .navigationBarTitle(Text("WWDC 2019")) 39 | .navigationBarItems(leading: PresentationButton(destination: BadgeView(), label: { Image(systemName: "info") })) 40 | .listStyle(.grouped) 41 | } 42 | } 43 | 44 | func addRandomVideo() { 45 | if let video = store.videos.randomElement() { 46 | store.videos.append(video) 47 | } 48 | } 49 | 50 | func delete(at offsets: IndexSet) { 51 | for offset in offsets { 52 | store.videos.remove(at: offset) 53 | } 54 | } 55 | } 56 | 57 | #if DEBUG 58 | struct ListView_Previews: PreviewProvider { 59 | static var previews: some View { 60 | VideoListView() 61 | } 62 | } 63 | #endif 64 | -------------------------------------------------------------------------------- /SwiftUI by Examples/SwiftUI by Examples/GestureView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // GestureView.swift 3 | // SwiftUI by Examples 4 | // 5 | // Created by Artem Novichkov on 10/06/2019. 6 | // Copyright © 2019 Artem Novichkov. All rights reserved. 7 | // 8 | 9 | import SwiftUI 10 | 11 | struct GestureView: View { 12 | 13 | @State var isDetectingTap = false 14 | @State var isDetectingDoubleTap = false 15 | @GestureState var isDetectingLongPress = false 16 | @State var numberOfTaps = 0 17 | 18 | var body: some View { 19 | let tap = TapGesture().onEnded { 20 | self.isDetectingTap.toggle() 21 | } 22 | let press = LongPressGesture(minimumDuration: 2) 23 | .updating($isDetectingLongPress) { currentState, gestureState, _ in 24 | gestureState = currentState 25 | } 26 | .onChanged { _ in 27 | self.numberOfTaps += 1 28 | } 29 | return VStack { 30 | Text("Tap") 31 | .font(.largeTitle) 32 | Circle() 33 | .fill(isDetectingTap ? Color.red : Color.blue) 34 | .frame(width: 100, height: 100, alignment: .center) 35 | .gesture(tap) 36 | Text("Double tap") 37 | .font(.largeTitle) 38 | Circle() 39 | .fill(isDetectingDoubleTap ? Color.red : Color.blue) 40 | .frame(width: 100, height: 100, alignment: .center) 41 | .tapAction(count: 2) { 42 | self.isDetectingDoubleTap.toggle() 43 | } 44 | Text("Long press count: \(numberOfTaps)") 45 | .font(.largeTitle) 46 | Circle() 47 | .fill(isDetectingLongPress ? Color.yellow : Color.green) 48 | .frame(width: 100, height: 100, alignment: .center) 49 | .gesture(press) 50 | } 51 | } 52 | } 53 | 54 | #if DEBUG 55 | struct GestureView_Previews: PreviewProvider { 56 | static var previews: some View { 57 | GestureView() 58 | } 59 | } 60 | #endif 61 | -------------------------------------------------------------------------------- /SwiftUI by Examples/SwiftUI by Examples/VideoDetailsView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // DetailsView.swift 3 | // SwiftUI by Examples 4 | // 5 | // Created by Artem Novichkov on 05/06/2019. 6 | // Copyright © 2019 Artem Novichkov. All rights reserved. 7 | // 8 | 9 | import SwiftUI 10 | 11 | struct VideoDetailsView: View { 12 | 13 | @EnvironmentObject private var store: VideoStore 14 | @State private var zoomed = false 15 | 16 | var video: Video 17 | 18 | var index: Int { 19 | return store.videos.firstIndex { $0.id == video.id }! 20 | } 21 | 22 | var body: some View { 23 | VStack { 24 | Image(video.thumbnail) 25 | .resizable() 26 | .aspectRatio(contentMode: zoomed ? .fill : .fit) 27 | .tapAction { 28 | withAnimation { 29 | self.zoomed.toggle() 30 | } 31 | } 32 | .navigationBarTitle(Text(video.title), displayMode: .inline) 33 | HStack { 34 | Text("Overview") 35 | .font(.title) 36 | Button(action: { 37 | self.store.videos[self.index].isFavorite.toggle() 38 | }) { 39 | if self.store.videos[index].isFavorite { 40 | Image(systemName: "star.fill") 41 | .foregroundColor(.yellow) 42 | } 43 | else { 44 | Image(systemName: "star") 45 | .foregroundColor(.gray) 46 | } 47 | } 48 | } 49 | Text(video.description) 50 | .lineLimit(nil) 51 | .padding() 52 | } 53 | } 54 | } 55 | 56 | #if DEBUG 57 | struct DetailsView_Previews: PreviewProvider { 58 | static var previews: some View { 59 | let store = VideoStore() 60 | return NavigationView { 61 | VideoDetailsView(video: Video.all[0]) 62 | .environmentObject(store) 63 | } 64 | } 65 | } 66 | #endif 67 | -------------------------------------------------------------------------------- /SwiftUI by Examples/SwiftUI by Examples/HexagonParameters.swift: -------------------------------------------------------------------------------- 1 | // 2 | // HexagonParameters.swift 3 | // SwiftUI by Examples 4 | // 5 | // Created by Artem Novichkov on 08/06/2019. 6 | // Copyright © 2019 Artem Novichkov. All rights reserved. 7 | // 8 | 9 | import SwiftUI 10 | 11 | struct HexagonParameters { 12 | struct Segment { 13 | let useWidth: (CGFloat, CGFloat, CGFloat) 14 | let xFactors: (CGFloat, CGFloat, CGFloat) 15 | let useHeight: (CGFloat, CGFloat, CGFloat) 16 | let yFactors: (CGFloat, CGFloat, CGFloat) 17 | } 18 | 19 | static let adjustment: CGFloat = 0.085 20 | static let points = [ 21 | Segment( 22 | useWidth: (1.00, 1.00, 1.00), 23 | xFactors: (0.60, 0.40, 0.50), 24 | useHeight: (1.00, 1.00, 0.00), 25 | yFactors: (0.05, 0.05, 0.00) 26 | ), 27 | Segment( 28 | useWidth: (1.00, 1.00, 0.00), 29 | xFactors: (0.05, 0.00, 0.00), 30 | useHeight: (1.00, 1.00, 1.00), 31 | yFactors: (0.20 + adjustment, 0.30 + adjustment, 0.25 + adjustment) 32 | ), 33 | Segment( 34 | useWidth: (1.00, 1.00, 0.00), 35 | xFactors: (0.00, 0.05, 0.00), 36 | useHeight: (1.00, 1.00, 1.00), 37 | yFactors: (0.70 - adjustment, 0.80 - adjustment, 0.75 - adjustment) 38 | ), 39 | Segment( 40 | useWidth: (1.00, 1.00, 1.00), 41 | xFactors: (0.40, 0.60, 0.50), 42 | useHeight: (1.00, 1.00, 1.00), 43 | yFactors: (0.95, 0.95, 1.00) 44 | ), 45 | Segment( 46 | useWidth: (1.00, 1.00, 1.00), 47 | xFactors: (0.95, 1.00, 1.00), 48 | useHeight: (1.00, 1.00, 1.00), 49 | yFactors: (0.80 - adjustment, 0.70 - adjustment, 0.75 - adjustment) 50 | ), 51 | Segment( 52 | useWidth: (1.00, 1.00, 1.00), 53 | xFactors: (1.00, 0.95, 1.00), 54 | useHeight: (1.00, 1.00, 1.00), 55 | yFactors: (0.30 + adjustment, 0.20 + adjustment, 0.25 + adjustment) 56 | ) 57 | ] 58 | } 59 | -------------------------------------------------------------------------------- /SwiftUI by Examples/SwiftUI by Examples/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | SwiftUI 15 | CFBundlePackageType 16 | $(PRODUCT_BUNDLE_PACKAGE_TYPE) 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | LSRequiresIPhoneOS 22 | 23 | UIApplicationSceneManifest 24 | 25 | UIApplicationSupportsMultipleScenes 26 | 27 | UISceneConfigurations 28 | 29 | UIWindowSceneSessionRoleApplication 30 | 31 | 32 | UILaunchStoryboardName 33 | LaunchScreen 34 | UISceneConfigurationName 35 | Default Configuration 36 | UISceneDelegateClassName 37 | $(PRODUCT_MODULE_NAME).SceneDelegate 38 | 39 | 40 | 41 | 42 | UILaunchStoryboardName 43 | LaunchScreen 44 | UIRequiredDeviceCapabilities 45 | 46 | armv7 47 | 48 | UISupportedInterfaceOrientations 49 | 50 | UIInterfaceOrientationPortrait 51 | UIInterfaceOrientationLandscapeLeft 52 | UIInterfaceOrientationLandscapeRight 53 | 54 | UISupportedInterfaceOrientations~ipad 55 | 56 | UIInterfaceOrientationPortrait 57 | UIInterfaceOrientationPortraitUpsideDown 58 | UIInterfaceOrientationLandscapeLeft 59 | UIInterfaceOrientationLandscapeRight 60 | 61 | 62 | 63 | -------------------------------------------------------------------------------- /SwiftUI by Examples/SwiftUI by Examples/AlertView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AlertView.swift 3 | // SwiftUI by Examples 4 | // 5 | // Created by Artem Novichkov on 10/06/2019. 6 | // Copyright © 2019 Artem Novichkov. All rights reserved. 7 | // 8 | 9 | import SwiftUI 10 | 11 | struct AlertView: View { 12 | 13 | @State var showAlert = false 14 | @State var showSheet = false 15 | 16 | private var alert: Alert { 17 | Alert(title: "Title", 18 | message: "Message", 19 | primaryButton: .destructive(Text("Cancel")), 20 | secondaryButton: .default(Text("Done"))) 21 | } 22 | 23 | private var sheet: ActionSheet { 24 | ActionSheet(title: "Title", message: "Message", buttons: [.default(Text("Option 1"), onTrigger: { 25 | self.showSheet = false 26 | }), 27 | .default(Text("Option 2")), 28 | .cancel()]) 29 | } 30 | 31 | var body: some View { 32 | VStack { 33 | Button(action: { 34 | self.showAlert = true 35 | }) { 36 | Text("Show alert") 37 | } 38 | .presentation($showAlert) { 39 | alert 40 | } 41 | Button(action: { 42 | self.showSheet = true 43 | }) { 44 | Text("Show action sheet") 45 | } 46 | .presentation(showSheet ? sheet : nil) 47 | } 48 | } 49 | } 50 | 51 | extension ActionSheet { 52 | 53 | init(title: String, message: String, buttons: [ActionSheet.Button] = [.cancel()]) { 54 | self.init(title: Text(title), message: Text(message), buttons: buttons) 55 | } 56 | } 57 | 58 | 59 | extension Alert { 60 | 61 | init(title: String, message: String, primaryButton: Alert.Button, secondaryButton: Alert.Button) { 62 | self.init(title: Text(title), message: Text(message), primaryButton: primaryButton, secondaryButton: secondaryButton) 63 | } 64 | } 65 | 66 | #if DEBUG 67 | struct AlertView_Previews: PreviewProvider { 68 | static var previews: some View { 69 | AlertView() 70 | } 71 | } 72 | #endif 73 | -------------------------------------------------------------------------------- /SwiftUI by Examples/SwiftUI by Examples/BadgeView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // BadgeView.swift 3 | // SwiftUI by Examples 4 | // 5 | // Created by Artem Novichkov on 08/06/2019. 6 | // Copyright © 2019 Artem Novichkov. All rights reserved. 7 | // 8 | 9 | import SwiftUI 10 | 11 | struct BadgeView: View { 12 | 13 | private static let gradientStart = Color(red: 239.0 / 255, green: 120.0 / 255, blue: 221.0 / 255) 14 | private static let gradientEnd = Color(red: 239.0 / 255, green: 172.0 / 255, blue: 120.0 / 255) 15 | private static let gradient = LinearGradient(gradient: .init(colors: [gradientStart, gradientEnd]), 16 | startPoint: .init(x: 0.5, y: 0), 17 | endPoint: .init(x: 0.5, y: 0.6) 18 | ) 19 | 20 | var body: some View { 21 | GeometryReader { geometry in 22 | Path { path in 23 | var width: CGFloat = min(geometry.size.width, geometry.size.height) 24 | let height = width 25 | let xScale: CGFloat = 0.832 26 | let xOffset = (width * (1.0 - xScale)) / 2.0 27 | width *= xScale 28 | path.move(to: .init(x: xOffset + width * 0.95, 29 | y: height * (0.20 + HexagonParameters.adjustment))) 30 | 31 | HexagonParameters.points.forEach { 32 | path.addLine(to: .init(x: xOffset + width * $0.useWidth.0 * $0.xFactors.0, 33 | y: height * $0.useHeight.0 * $0.yFactors.0)) 34 | 35 | path.addQuadCurve(to: .init(x: xOffset + width * $0.useWidth.1 * $0.xFactors.1, 36 | y: height * $0.useHeight.1 * $0.yFactors.1), 37 | control: .init(x: xOffset + width * $0.useWidth.2 * $0.xFactors.2, 38 | y: height * $0.useHeight.2 * $0.yFactors.2)) 39 | } 40 | } 41 | .fill(Self.gradient) 42 | .aspectRatio(1, contentMode: .fit) 43 | } 44 | } 45 | } 46 | 47 | #if DEBUG 48 | struct BadgeView_Previews : PreviewProvider { 49 | static var previews: some View { 50 | BadgeView() 51 | } 52 | } 53 | #endif 54 | -------------------------------------------------------------------------------- /SwiftUI by Examples/SwiftUI by Examples/SceneDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SceneDelegate.swift 3 | // SwiftUI by Examples 4 | // 5 | // Created by Artem Novichkov on 05/06/2019. 6 | // Copyright © 2019 Artem Novichkov. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | import SwiftUI 11 | 12 | class SceneDelegate: UIResponder, UIWindowSceneDelegate { 13 | 14 | var window: UIWindow? 15 | 16 | 17 | func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) { 18 | // Use this method to optionally configure and attach the UIWindow `window` to the provided UIWindowScene `scene`. 19 | // If using a storyboard, the `window` property will automatically be initialized and attached to the scene. 20 | // This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead). 21 | 22 | // Use a UIHostingController as window root view controller 23 | let window = UIWindow(frame: UIScreen.main.bounds) 24 | window.rootViewController = UIHostingController(rootView: ExampleListView()) 25 | self.window = window 26 | window.makeKeyAndVisible() 27 | } 28 | 29 | func sceneDidDisconnect(_ scene: UIScene) { 30 | // Called as the scene is being released by the system. 31 | // This occurs shortly after the scene enters the background, or when its session is discarded. 32 | // Release any resources associated with this scene that can be re-created the next time the scene connects. 33 | // The scene may re-connect later, as its session was not neccessarily discarded (see `application:didDiscardSceneSessions` instead). 34 | } 35 | 36 | func sceneDidBecomeActive(_ scene: UIScene) { 37 | // Called when the scene has moved from an inactive state to an active state. 38 | // Use this method to restart any tasks that were paused (or not yet started) when the scene was inactive. 39 | } 40 | 41 | func sceneWillResignActive(_ scene: UIScene) { 42 | // Called when the scene will move from an active state to an inactive state. 43 | // This may occur due to temporary interruptions (ex. an incoming phone call). 44 | } 45 | 46 | func sceneWillEnterForeground(_ scene: UIScene) { 47 | // Called as the scene transitions from the background to the foreground. 48 | // Use this method to undo the changes made on entering the background. 49 | } 50 | 51 | func sceneDidEnterBackground(_ scene: UIScene) { 52 | // Called as the scene transitions from the foreground to the background. 53 | // Use this method to save data, release shared resources, and store enough scene-specific state information 54 | // to restore the scene back to its current state. 55 | } 56 | 57 | 58 | } 59 | 60 | -------------------------------------------------------------------------------- /SwiftUI by Examples/SwiftUI by Examples/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "size" : "20x20", 5 | "idiom" : "iphone", 6 | "filename" : "Icon-App-20x20@2x.png", 7 | "scale" : "2x" 8 | }, 9 | { 10 | "size" : "20x20", 11 | "idiom" : "iphone", 12 | "filename" : "Icon-App-20x20@3x.png", 13 | "scale" : "3x" 14 | }, 15 | { 16 | "size" : "29x29", 17 | "idiom" : "iphone", 18 | "filename" : "Icon-App-29x29@1x.png", 19 | "scale" : "1x" 20 | }, 21 | { 22 | "size" : "29x29", 23 | "idiom" : "iphone", 24 | "filename" : "Icon-App-29x29@2x.png", 25 | "scale" : "2x" 26 | }, 27 | { 28 | "size" : "29x29", 29 | "idiom" : "iphone", 30 | "filename" : "Icon-App-29x29@3x.png", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "size" : "40x40", 35 | "idiom" : "iphone", 36 | "filename" : "Icon-App-40x40@2x.png", 37 | "scale" : "2x" 38 | }, 39 | { 40 | "size" : "40x40", 41 | "idiom" : "iphone", 42 | "filename" : "Icon-App-40x40@3x.png", 43 | "scale" : "3x" 44 | }, 45 | { 46 | "size" : "60x60", 47 | "idiom" : "iphone", 48 | "filename" : "Icon-App-60x60@2x.png", 49 | "scale" : "2x" 50 | }, 51 | { 52 | "size" : "60x60", 53 | "idiom" : "iphone", 54 | "filename" : "Icon-App-60x60@3x.png", 55 | "scale" : "3x" 56 | }, 57 | { 58 | "size" : "20x20", 59 | "idiom" : "ipad", 60 | "filename" : "Icon-App-20x20@1x.png", 61 | "scale" : "1x" 62 | }, 63 | { 64 | "size" : "20x20", 65 | "idiom" : "ipad", 66 | "filename" : "Icon-App-20x20@2x.png", 67 | "scale" : "2x" 68 | }, 69 | { 70 | "size" : "29x29", 71 | "idiom" : "ipad", 72 | "filename" : "Icon-App-29x29@1x.png", 73 | "scale" : "1x" 74 | }, 75 | { 76 | "size" : "29x29", 77 | "idiom" : "ipad", 78 | "filename" : "Icon-App-29x29@2x.png", 79 | "scale" : "2x" 80 | }, 81 | { 82 | "size" : "40x40", 83 | "idiom" : "ipad", 84 | "filename" : "Icon-App-40x40@1x.png", 85 | "scale" : "1x" 86 | }, 87 | { 88 | "size" : "40x40", 89 | "idiom" : "ipad", 90 | "filename" : "Icon-App-40x40@2x.png", 91 | "scale" : "2x" 92 | }, 93 | { 94 | "size" : "76x76", 95 | "idiom" : "ipad", 96 | "filename" : "Icon-App-76x76@1x.png", 97 | "scale" : "1x" 98 | }, 99 | { 100 | "size" : "76x76", 101 | "idiom" : "ipad", 102 | "filename" : "Icon-App-76x76@2x.png", 103 | "scale" : "2x" 104 | }, 105 | { 106 | "size" : "83.5x83.5", 107 | "idiom" : "ipad", 108 | "filename" : "Icon-App-83.5x83.5@2x.png", 109 | "scale" : "2x" 110 | }, 111 | { 112 | "size" : "1024x1024", 113 | "idiom" : "ios-marketing", 114 | "filename" : "ItunesArtwork@2x.png", 115 | "scale" : "1x" 116 | } 117 | ], 118 | "info" : { 119 | "version" : 1, 120 | "author" : "xcode" 121 | } 122 | } -------------------------------------------------------------------------------- /SwiftUI by Examples/SwiftUI by Examples/ExampleListView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ExampleListView.swift 3 | // SwiftUI by Examples 4 | // 5 | // Created by Artem Novichkov on 09/06/2019. 6 | // Copyright © 2019 Artem Novichkov. All rights reserved. 7 | // 8 | 9 | import SwiftUI 10 | 11 | struct ExampleListView: View { 12 | var body: some View { 13 | NavigationView { 14 | List { 15 | Section(header: Text("Controls")) { 16 | NavigationButton(destination: TextView()) { 17 | ExampleCell(title: "Texts", subtitle: "A view that displays one or more lines of read-only text.") 18 | } 19 | NavigationButton(destination: TextFieldView()) { 20 | ExampleCell(title: "Text fields", subtitle: "A control that displays an editable text interface.") 21 | } 22 | NavigationButton(destination: ButtonsView()) { 23 | ExampleCell(title: "Buttons", subtitle: "A control that performs an action when triggered.") 24 | } 25 | } 26 | Section(header: Text("Value selectors")) { 27 | NavigationButton(destination: ToggleView()) { 28 | ExampleCell(title: "Toggle", subtitle: "A control that toggles between on and off states.") 29 | } 30 | NavigationButton(destination: DatePickerView()) { 31 | ExampleCell(title: "DatePicker", subtitle: "A control for selecting an absolute date.") 32 | } 33 | NavigationButton(destination: SliderView()) { 34 | ExampleCell(title: "Slider", subtitle: "A control for selecting a value from a bounded linear range of values.") 35 | } 36 | NavigationButton(destination: StepperView()) { 37 | ExampleCell(title: "Stepper", subtitle: "A control used to perform semantic increment and decrement actions.") 38 | } 39 | NavigationButton(destination: SegmentedControlView()) { 40 | ExampleCell(title: "Segmented Control", subtitle: "A control for selecting from a set of options.") 41 | } 42 | } 43 | Section(header: Text("Others")) { 44 | NavigationButton(destination: AlertView()) { 45 | ExampleCell(title: "Alert", subtitle: "A container for an alert presentation.") 46 | } 47 | NavigationButton(destination: GestureView()) { 48 | ExampleCell(title: "Gestures", subtitle: "Use gesture modifiers to add interactivity to your app.") 49 | } 50 | NavigationButton(destination: AnimationView()) { 51 | ExampleCell(title: "Animations", subtitle: "Animate views.") 52 | } 53 | NavigationButton(destination: VideoListView().environmentObject(VideoStore())) { 54 | ExampleCell(title: "List", subtitle: "Example of editable list") 55 | } 56 | NavigationButton(destination: BadgeView()) { 57 | ExampleCell(title: "Drawing shapes", subtitle: "Using path for custom shapes") 58 | } 59 | } 60 | } 61 | .listStyle(.grouped) 62 | .navigationBarTitle(Text("SwiftUI by Examples")) 63 | } 64 | } 65 | } 66 | 67 | #if DEBUG 68 | struct ExampleListView_Previews: PreviewProvider { 69 | static var previews: some View { 70 | ExampleListView() 71 | } 72 | } 73 | #endif 74 | -------------------------------------------------------------------------------- /SwiftUI by Examples/SwiftUI by Examples/Video.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Animal.swift 3 | // SwiftUI by Examples 4 | // 5 | // Created by Artem Novichkov on 05/06/2019. 6 | // Copyright © 2019 Artem Novichkov. All rights reserved. 7 | // 8 | 9 | import SwiftUI 10 | import Combine 11 | 12 | class VideoStore: BindableObject { 13 | 14 | var videos: [Video] = Video.all { 15 | didSet { 16 | didChange.send(()) 17 | } 18 | } 19 | 20 | var didChange = PassthroughSubject() 21 | } 22 | 23 | struct Video: Identifiable { 24 | 25 | let id = UUID() 26 | let title: String 27 | let description: String 28 | let thumbnail: String 29 | var isFavorite: Bool = false 30 | 31 | static let all: [Video] = [.init(title: "Implementing Dark Mode on iOS", 32 | description: "Hear from the UIKit engineering team about the principles and concepts that anchor Dark Mode on iOS. Get introduced to the principles of enhancing your app with this new appearance using dynamic colors and images, and add an experience that people are sure to love.", 33 | thumbnail: "2949_wide_250x141_2x"), 34 | .init(title: "Introducing Sign In with Apple", 35 | description: "Sign In with Apple is the fast, easy way for people to sign in to apps using the Apple IDs they already have. Learn how easy it is to add a Sign In with Apple button to your app or website to acquire new customers and benefit from the built-in security, antifraud, and privacy that Sign In with Apple provides.", 36 | thumbnail: "2645_wide_250x141_2x"), 37 | .init(title: "Introducing Parameters for Shortcuts", 38 | description: "Parameters take Siri Shortcuts to the next level, enabling an interactive voice experience in Siri with follow-up questions, and allowing people to customize shortcuts in the Shortcuts app, now built into iOS. Walk through setting up your shortcuts to take advantage of parameters and learn how your shortcuts can pass output to other actions when creating multi-step shortcuts in the Shortcuts app.", 39 | thumbnail: "2649_wide_250x141_2x"), 40 | .init(title: "Introducing PencilKit", 41 | description: "Meet PencilKit, Apple's feature-rich drawing and annotation framework. With just a few lines of code, you can add a full drawing experience to your app — with access to a canvas, responsive inks, rich tool palette and drawing model. Hear the technical details that make a great Apple Pencil experience. Learn about the new screenshot editor and how you can adopt just a few small APIs to enable your full content to be captured beyond the size of the screen, with or without your app's user interface.", 42 | 43 | thumbnail: "2682_wide_250x141_2x"), 44 | .init(title: "SwiftUI Essentials", 45 | description: "Take your first deep-dive into building an app with SwiftUI. Learn about Views and how they work. From basic controls to sophisticated containers like lists and navigation stacks, SwiftUI enables the creation of great user interfaces, faster and more easily. See how basic controls like Button are both simple yet versatile. Discover how to compose these pieces into larger, full-featured user interfaces that facilitate building great apps with SwiftUI. Build your SwiftUI skills as you learn the essentials of Apple's new declarative framework.", 46 | thumbnail: "2672_wide_250x141_2x"), 47 | .init(title: "Designing for Privacy", 48 | description: "Privacy is a more important issue than ever for your users. Learn about new features and privacy engineering techniques that can help you earn customer trust, create more personal experiences, and improve user engagement.", 49 | thumbnail: "2640_wide_250x141_2x"), 50 | .init(title: "Create ML for Object Detection and Sound Classification", 51 | description: "Create ML enables you to create, evaluate, and test powerful, production-class Core ML models. See how easy it is to create your own Object Detection and Sound Classification models for use in your apps. Learn strategies for balancing your training data to achieve great model accuracy.", 52 | thumbnail: "2612_wide_250x141_2x"), 53 | .init(title: "Delivering Optimized Metal Apps and Games", 54 | description: "Optimizing performance, memory, and bandwidth are important considerations for resource-intensive Metal apps and games. Learn key best practices to streamline your rendering and attain high frame rates. Understand powerful tools that can help you pinpoint expensive or unexpected GPU work. Dive into GPU capabilities that can yield performance gains and get expert guidance about using memory efficiently.", thumbnail: "2676_wide_250x141_2x"), 55 | .init(title: "Metal for Pro Apps", 56 | description: "Metal is the platform-optimized graphics and compute framework at the heart of GPU acceleration on Apple platforms. Learn key aspects of the Metal architecture that support the techniques for modern high-performance pro applications and workflows. Learn how to leverage Metal capabilities to optimize performance and maintain a steady frame rate in video editing pipelines. Understand how to leverage CPU and GPU parallelism, and dive into best practices for efficient data throughput.", 57 | thumbnail: "2684_wide_250x141_2x")] 58 | } 59 | -------------------------------------------------------------------------------- /SwiftUI by Examples/SwiftUI by Examples.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 50; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 060DBBEB22AE7E2B00D3A09F /* StepperView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 060DBBEA22AE7E2B00D3A09F /* StepperView.swift */; }; 11 | 060DBBED22AE7EE600D3A09F /* SegmentedControlView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 060DBBEC22AE7EE600D3A09F /* SegmentedControlView.swift */; }; 12 | 060DBBEF22AE80DC00D3A09F /* AlertView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 060DBBEE22AE80DC00D3A09F /* AlertView.swift */; }; 13 | 060DBBF122AE891300D3A09F /* GestureView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 060DBBF022AE891300D3A09F /* GestureView.swift */; }; 14 | 060DBBF322AEB7A600D3A09F /* AnimationView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 060DBBF222AEB7A600D3A09F /* AnimationView.swift */; }; 15 | 068FA18722AD716100FFF648 /* ExampleListView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 068FA18622AD716100FFF648 /* ExampleListView.swift */; }; 16 | 068FA18922AD717E00FFF648 /* ExampleCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 068FA18822AD717E00FFF648 /* ExampleCell.swift */; }; 17 | 068FA18B22AD73D300FFF648 /* TextView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 068FA18A22AD73D300FFF648 /* TextView.swift */; }; 18 | 068FA18D22AD765300FFF648 /* TextFieldView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 068FA18C22AD765300FFF648 /* TextFieldView.swift */; }; 19 | 068FA18F22AD80CD00FFF648 /* ButtonsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 068FA18E22AD80CD00FFF648 /* ButtonsView.swift */; }; 20 | 068FA19122AD86DA00FFF648 /* SliderView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 068FA19022AD86DA00FFF648 /* SliderView.swift */; }; 21 | 068FA19322AE7A9900FFF648 /* ToggleView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 068FA19222AE7A9900FFF648 /* ToggleView.swift */; }; 22 | 068FA19522AE7B7000FFF648 /* DatePickerView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 068FA19422AE7B7000FFF648 /* DatePickerView.swift */; }; 23 | 06E548C022ABA53600794057 /* VideoCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 06E548BF22ABA53600794057 /* VideoCell.swift */; }; 24 | 06E548C222ABA5F000794057 /* VideoDetailsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 06E548C122ABA5F000794057 /* VideoDetailsView.swift */; }; 25 | 06E548C422ABAB1E00794057 /* BadgeView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 06E548C322ABAB1E00794057 /* BadgeView.swift */; }; 26 | 06E548C622ABAB6A00794057 /* HexagonParameters.swift in Sources */ = {isa = PBXBuildFile; fileRef = 06E548C522ABAB6A00794057 /* HexagonParameters.swift */; }; 27 | 06FB7FAF22A822C600E0B8C5 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 06FB7FAE22A822C600E0B8C5 /* AppDelegate.swift */; }; 28 | 06FB7FB122A822C600E0B8C5 /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 06FB7FB022A822C600E0B8C5 /* SceneDelegate.swift */; }; 29 | 06FB7FB322A822C600E0B8C5 /* VideoListView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 06FB7FB222A822C600E0B8C5 /* VideoListView.swift */; }; 30 | 06FB7FB522A822C700E0B8C5 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 06FB7FB422A822C700E0B8C5 /* Assets.xcassets */; }; 31 | 06FB7FB822A822C700E0B8C5 /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 06FB7FB722A822C700E0B8C5 /* Preview Assets.xcassets */; }; 32 | 06FB7FBB22A822C700E0B8C5 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 06FB7FB922A822C700E0B8C5 /* LaunchScreen.storyboard */; }; 33 | 06FB7FC722A8269800E0B8C5 /* Video.swift in Sources */ = {isa = PBXBuildFile; fileRef = 06FB7FC622A8269800E0B8C5 /* Video.swift */; }; 34 | /* End PBXBuildFile section */ 35 | 36 | /* Begin PBXFileReference section */ 37 | 060DBBEA22AE7E2B00D3A09F /* StepperView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StepperView.swift; sourceTree = ""; }; 38 | 060DBBEC22AE7EE600D3A09F /* SegmentedControlView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SegmentedControlView.swift; sourceTree = ""; }; 39 | 060DBBEE22AE80DC00D3A09F /* AlertView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AlertView.swift; sourceTree = ""; }; 40 | 060DBBF022AE891300D3A09F /* GestureView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GestureView.swift; sourceTree = ""; }; 41 | 060DBBF222AEB7A600D3A09F /* AnimationView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AnimationView.swift; sourceTree = ""; }; 42 | 068FA18622AD716100FFF648 /* ExampleListView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ExampleListView.swift; sourceTree = ""; }; 43 | 068FA18822AD717E00FFF648 /* ExampleCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ExampleCell.swift; sourceTree = ""; }; 44 | 068FA18A22AD73D300FFF648 /* TextView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TextView.swift; sourceTree = ""; }; 45 | 068FA18C22AD765300FFF648 /* TextFieldView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TextFieldView.swift; sourceTree = ""; }; 46 | 068FA18E22AD80CD00FFF648 /* ButtonsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ButtonsView.swift; sourceTree = ""; }; 47 | 068FA19022AD86DA00FFF648 /* SliderView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SliderView.swift; sourceTree = ""; }; 48 | 068FA19222AE7A9900FFF648 /* ToggleView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ToggleView.swift; sourceTree = ""; }; 49 | 068FA19422AE7B7000FFF648 /* DatePickerView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DatePickerView.swift; sourceTree = ""; }; 50 | 06E548BF22ABA53600794057 /* VideoCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VideoCell.swift; sourceTree = ""; }; 51 | 06E548C122ABA5F000794057 /* VideoDetailsView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = VideoDetailsView.swift; sourceTree = ""; }; 52 | 06E548C322ABAB1E00794057 /* BadgeView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BadgeView.swift; sourceTree = ""; }; 53 | 06E548C522ABAB6A00794057 /* HexagonParameters.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HexagonParameters.swift; sourceTree = ""; }; 54 | 06FB7FAB22A822C600E0B8C5 /* SwiftUI by Examples.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "SwiftUI by Examples.app"; sourceTree = BUILT_PRODUCTS_DIR; }; 55 | 06FB7FAE22A822C600E0B8C5 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 56 | 06FB7FB022A822C600E0B8C5 /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = ""; }; 57 | 06FB7FB222A822C600E0B8C5 /* VideoListView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VideoListView.swift; sourceTree = ""; }; 58 | 06FB7FB422A822C700E0B8C5 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 59 | 06FB7FB722A822C700E0B8C5 /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = ""; }; 60 | 06FB7FBA22A822C700E0B8C5 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 61 | 06FB7FBC22A822C700E0B8C5 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 62 | 06FB7FC322A8233700E0B8C5 /* SampleCode.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = SampleCode.xcconfig; sourceTree = ""; }; 63 | 06FB7FC622A8269800E0B8C5 /* Video.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Video.swift; sourceTree = ""; }; 64 | /* End PBXFileReference section */ 65 | 66 | /* Begin PBXFrameworksBuildPhase section */ 67 | 06FB7FA822A822C600E0B8C5 /* Frameworks */ = { 68 | isa = PBXFrameworksBuildPhase; 69 | buildActionMask = 2147483647; 70 | files = ( 71 | ); 72 | runOnlyForDeploymentPostprocessing = 0; 73 | }; 74 | /* End PBXFrameworksBuildPhase section */ 75 | 76 | /* Begin PBXGroup section */ 77 | 06FB7FA222A822C600E0B8C5 = { 78 | isa = PBXGroup; 79 | children = ( 80 | 06FB7FC222A8233700E0B8C5 /* Configuration */, 81 | 06FB7FAD22A822C600E0B8C5 /* SwiftUI by Examples */, 82 | 06FB7FAC22A822C600E0B8C5 /* Products */, 83 | ); 84 | sourceTree = ""; 85 | }; 86 | 06FB7FAC22A822C600E0B8C5 /* Products */ = { 87 | isa = PBXGroup; 88 | children = ( 89 | 06FB7FAB22A822C600E0B8C5 /* SwiftUI by Examples.app */, 90 | ); 91 | name = Products; 92 | sourceTree = ""; 93 | }; 94 | 06FB7FAD22A822C600E0B8C5 /* SwiftUI by Examples */ = { 95 | isa = PBXGroup; 96 | children = ( 97 | 06FB7FAE22A822C600E0B8C5 /* AppDelegate.swift */, 98 | 06FB7FB022A822C600E0B8C5 /* SceneDelegate.swift */, 99 | 06FB7FC622A8269800E0B8C5 /* Video.swift */, 100 | 06FB7FB222A822C600E0B8C5 /* VideoListView.swift */, 101 | 06E548BF22ABA53600794057 /* VideoCell.swift */, 102 | 06E548C122ABA5F000794057 /* VideoDetailsView.swift */, 103 | 06E548C522ABAB6A00794057 /* HexagonParameters.swift */, 104 | 06E548C322ABAB1E00794057 /* BadgeView.swift */, 105 | 06FB7FB422A822C700E0B8C5 /* Assets.xcassets */, 106 | 06FB7FB922A822C700E0B8C5 /* LaunchScreen.storyboard */, 107 | 06FB7FBC22A822C700E0B8C5 /* Info.plist */, 108 | 06FB7FB622A822C700E0B8C5 /* Preview Content */, 109 | 068FA18622AD716100FFF648 /* ExampleListView.swift */, 110 | 068FA18822AD717E00FFF648 /* ExampleCell.swift */, 111 | 068FA18A22AD73D300FFF648 /* TextView.swift */, 112 | 068FA18C22AD765300FFF648 /* TextFieldView.swift */, 113 | 068FA18E22AD80CD00FFF648 /* ButtonsView.swift */, 114 | 068FA19022AD86DA00FFF648 /* SliderView.swift */, 115 | 068FA19222AE7A9900FFF648 /* ToggleView.swift */, 116 | 068FA19422AE7B7000FFF648 /* DatePickerView.swift */, 117 | 060DBBEA22AE7E2B00D3A09F /* StepperView.swift */, 118 | 060DBBEC22AE7EE600D3A09F /* SegmentedControlView.swift */, 119 | 060DBBEE22AE80DC00D3A09F /* AlertView.swift */, 120 | 060DBBF022AE891300D3A09F /* GestureView.swift */, 121 | 060DBBF222AEB7A600D3A09F /* AnimationView.swift */, 122 | ); 123 | path = "SwiftUI by Examples"; 124 | sourceTree = ""; 125 | }; 126 | 06FB7FB622A822C700E0B8C5 /* Preview Content */ = { 127 | isa = PBXGroup; 128 | children = ( 129 | 06FB7FB722A822C700E0B8C5 /* Preview Assets.xcassets */, 130 | ); 131 | path = "Preview Content"; 132 | sourceTree = ""; 133 | }; 134 | 06FB7FC222A8233700E0B8C5 /* Configuration */ = { 135 | isa = PBXGroup; 136 | children = ( 137 | 06FB7FC322A8233700E0B8C5 /* SampleCode.xcconfig */, 138 | ); 139 | name = Configuration; 140 | path = ../Configuration; 141 | sourceTree = ""; 142 | }; 143 | /* End PBXGroup section */ 144 | 145 | /* Begin PBXNativeTarget section */ 146 | 06FB7FAA22A822C600E0B8C5 /* SwiftUI by Examples */ = { 147 | isa = PBXNativeTarget; 148 | buildConfigurationList = 06FB7FBF22A822C700E0B8C5 /* Build configuration list for PBXNativeTarget "SwiftUI by Examples" */; 149 | buildPhases = ( 150 | 06FB7FA722A822C600E0B8C5 /* Sources */, 151 | 06FB7FA822A822C600E0B8C5 /* Frameworks */, 152 | 06FB7FA922A822C600E0B8C5 /* Resources */, 153 | ); 154 | buildRules = ( 155 | ); 156 | dependencies = ( 157 | ); 158 | name = "SwiftUI by Examples"; 159 | productName = "SwiftUI by Examples"; 160 | productReference = 06FB7FAB22A822C600E0B8C5 /* SwiftUI by Examples.app */; 161 | productType = "com.apple.product-type.application"; 162 | }; 163 | /* End PBXNativeTarget section */ 164 | 165 | /* Begin PBXProject section */ 166 | 06FB7FA322A822C600E0B8C5 /* Project object */ = { 167 | isa = PBXProject; 168 | attributes = { 169 | LastSwiftUpdateCheck = 1100; 170 | LastUpgradeCheck = 1100; 171 | ORGANIZATIONNAME = "Artem Novichkov"; 172 | TargetAttributes = { 173 | 06FB7FAA22A822C600E0B8C5 = { 174 | CreatedOnToolsVersion = 11.0; 175 | }; 176 | }; 177 | }; 178 | buildConfigurationList = 06FB7FA622A822C600E0B8C5 /* Build configuration list for PBXProject "SwiftUI by Examples" */; 179 | compatibilityVersion = "Xcode 9.3"; 180 | developmentRegion = en; 181 | hasScannedForEncodings = 0; 182 | knownRegions = ( 183 | en, 184 | Base, 185 | ); 186 | mainGroup = 06FB7FA222A822C600E0B8C5; 187 | productRefGroup = 06FB7FAC22A822C600E0B8C5 /* Products */; 188 | projectDirPath = ""; 189 | projectRoot = ""; 190 | targets = ( 191 | 06FB7FAA22A822C600E0B8C5 /* SwiftUI by Examples */, 192 | ); 193 | }; 194 | /* End PBXProject section */ 195 | 196 | /* Begin PBXResourcesBuildPhase section */ 197 | 06FB7FA922A822C600E0B8C5 /* Resources */ = { 198 | isa = PBXResourcesBuildPhase; 199 | buildActionMask = 2147483647; 200 | files = ( 201 | 06FB7FBB22A822C700E0B8C5 /* LaunchScreen.storyboard in Resources */, 202 | 06FB7FB822A822C700E0B8C5 /* Preview Assets.xcassets in Resources */, 203 | 06FB7FB522A822C700E0B8C5 /* Assets.xcassets in Resources */, 204 | ); 205 | runOnlyForDeploymentPostprocessing = 0; 206 | }; 207 | /* End PBXResourcesBuildPhase section */ 208 | 209 | /* Begin PBXSourcesBuildPhase section */ 210 | 06FB7FA722A822C600E0B8C5 /* Sources */ = { 211 | isa = PBXSourcesBuildPhase; 212 | buildActionMask = 2147483647; 213 | files = ( 214 | 068FA18922AD717E00FFF648 /* ExampleCell.swift in Sources */, 215 | 060DBBEF22AE80DC00D3A09F /* AlertView.swift in Sources */, 216 | 060DBBED22AE7EE600D3A09F /* SegmentedControlView.swift in Sources */, 217 | 068FA18B22AD73D300FFF648 /* TextView.swift in Sources */, 218 | 068FA18D22AD765300FFF648 /* TextFieldView.swift in Sources */, 219 | 06E548C622ABAB6A00794057 /* HexagonParameters.swift in Sources */, 220 | 068FA19522AE7B7000FFF648 /* DatePickerView.swift in Sources */, 221 | 06FB7FAF22A822C600E0B8C5 /* AppDelegate.swift in Sources */, 222 | 06E548C422ABAB1E00794057 /* BadgeView.swift in Sources */, 223 | 068FA18F22AD80CD00FFF648 /* ButtonsView.swift in Sources */, 224 | 06FB7FB122A822C600E0B8C5 /* SceneDelegate.swift in Sources */, 225 | 06FB7FB322A822C600E0B8C5 /* VideoListView.swift in Sources */, 226 | 060DBBEB22AE7E2B00D3A09F /* StepperView.swift in Sources */, 227 | 06E548C222ABA5F000794057 /* VideoDetailsView.swift in Sources */, 228 | 060DBBF122AE891300D3A09F /* GestureView.swift in Sources */, 229 | 06FB7FC722A8269800E0B8C5 /* Video.swift in Sources */, 230 | 068FA18722AD716100FFF648 /* ExampleListView.swift in Sources */, 231 | 06E548C022ABA53600794057 /* VideoCell.swift in Sources */, 232 | 060DBBF322AEB7A600D3A09F /* AnimationView.swift in Sources */, 233 | 068FA19322AE7A9900FFF648 /* ToggleView.swift in Sources */, 234 | 068FA19122AD86DA00FFF648 /* SliderView.swift in Sources */, 235 | ); 236 | runOnlyForDeploymentPostprocessing = 0; 237 | }; 238 | /* End PBXSourcesBuildPhase section */ 239 | 240 | /* Begin PBXVariantGroup section */ 241 | 06FB7FB922A822C700E0B8C5 /* LaunchScreen.storyboard */ = { 242 | isa = PBXVariantGroup; 243 | children = ( 244 | 06FB7FBA22A822C700E0B8C5 /* Base */, 245 | ); 246 | name = LaunchScreen.storyboard; 247 | sourceTree = ""; 248 | }; 249 | /* End PBXVariantGroup section */ 250 | 251 | /* Begin XCBuildConfiguration section */ 252 | 06FB7FBD22A822C700E0B8C5 /* Debug */ = { 253 | isa = XCBuildConfiguration; 254 | baseConfigurationReference = 06FB7FC322A8233700E0B8C5 /* SampleCode.xcconfig */; 255 | buildSettings = { 256 | ALWAYS_SEARCH_USER_PATHS = NO; 257 | CLANG_ANALYZER_NONNULL = YES; 258 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 259 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 260 | CLANG_CXX_LIBRARY = "libc++"; 261 | CLANG_ENABLE_MODULES = YES; 262 | CLANG_ENABLE_OBJC_ARC = YES; 263 | CLANG_ENABLE_OBJC_WEAK = YES; 264 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 265 | CLANG_WARN_BOOL_CONVERSION = YES; 266 | CLANG_WARN_COMMA = YES; 267 | CLANG_WARN_CONSTANT_CONVERSION = YES; 268 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 269 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 270 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 271 | CLANG_WARN_EMPTY_BODY = YES; 272 | CLANG_WARN_ENUM_CONVERSION = YES; 273 | CLANG_WARN_INFINITE_RECURSION = YES; 274 | CLANG_WARN_INT_CONVERSION = YES; 275 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 276 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 277 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 278 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 279 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 280 | CLANG_WARN_STRICT_PROTOTYPES = YES; 281 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 282 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 283 | CLANG_WARN_UNREACHABLE_CODE = YES; 284 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 285 | COPY_PHASE_STRIP = NO; 286 | DEBUG_INFORMATION_FORMAT = dwarf; 287 | ENABLE_STRICT_OBJC_MSGSEND = YES; 288 | ENABLE_TESTABILITY = YES; 289 | GCC_C_LANGUAGE_STANDARD = gnu11; 290 | GCC_DYNAMIC_NO_PIC = NO; 291 | GCC_NO_COMMON_BLOCKS = YES; 292 | GCC_OPTIMIZATION_LEVEL = 0; 293 | GCC_PREPROCESSOR_DEFINITIONS = ( 294 | "DEBUG=1", 295 | "$(inherited)", 296 | ); 297 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 298 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 299 | GCC_WARN_UNDECLARED_SELECTOR = YES; 300 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 301 | GCC_WARN_UNUSED_FUNCTION = YES; 302 | GCC_WARN_UNUSED_VARIABLE = YES; 303 | IPHONEOS_DEPLOYMENT_TARGET = 13.0; 304 | MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; 305 | MTL_FAST_MATH = YES; 306 | ONLY_ACTIVE_ARCH = YES; 307 | SDKROOT = iphoneos; 308 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; 309 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 310 | }; 311 | name = Debug; 312 | }; 313 | 06FB7FBE22A822C700E0B8C5 /* Release */ = { 314 | isa = XCBuildConfiguration; 315 | baseConfigurationReference = 06FB7FC322A8233700E0B8C5 /* SampleCode.xcconfig */; 316 | buildSettings = { 317 | ALWAYS_SEARCH_USER_PATHS = NO; 318 | CLANG_ANALYZER_NONNULL = YES; 319 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 320 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 321 | CLANG_CXX_LIBRARY = "libc++"; 322 | CLANG_ENABLE_MODULES = YES; 323 | CLANG_ENABLE_OBJC_ARC = YES; 324 | CLANG_ENABLE_OBJC_WEAK = YES; 325 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 326 | CLANG_WARN_BOOL_CONVERSION = YES; 327 | CLANG_WARN_COMMA = YES; 328 | CLANG_WARN_CONSTANT_CONVERSION = YES; 329 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 330 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 331 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 332 | CLANG_WARN_EMPTY_BODY = YES; 333 | CLANG_WARN_ENUM_CONVERSION = YES; 334 | CLANG_WARN_INFINITE_RECURSION = YES; 335 | CLANG_WARN_INT_CONVERSION = YES; 336 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 337 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 338 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 339 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 340 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 341 | CLANG_WARN_STRICT_PROTOTYPES = YES; 342 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 343 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 344 | CLANG_WARN_UNREACHABLE_CODE = YES; 345 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 346 | COPY_PHASE_STRIP = NO; 347 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 348 | ENABLE_NS_ASSERTIONS = NO; 349 | ENABLE_STRICT_OBJC_MSGSEND = YES; 350 | GCC_C_LANGUAGE_STANDARD = gnu11; 351 | GCC_NO_COMMON_BLOCKS = YES; 352 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 353 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 354 | GCC_WARN_UNDECLARED_SELECTOR = YES; 355 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 356 | GCC_WARN_UNUSED_FUNCTION = YES; 357 | GCC_WARN_UNUSED_VARIABLE = YES; 358 | IPHONEOS_DEPLOYMENT_TARGET = 13.0; 359 | MTL_ENABLE_DEBUG_INFO = NO; 360 | MTL_FAST_MATH = YES; 361 | SDKROOT = iphoneos; 362 | SWIFT_COMPILATION_MODE = wholemodule; 363 | SWIFT_OPTIMIZATION_LEVEL = "-O"; 364 | VALIDATE_PRODUCT = YES; 365 | }; 366 | name = Release; 367 | }; 368 | 06FB7FC022A822C700E0B8C5 /* Debug */ = { 369 | isa = XCBuildConfiguration; 370 | baseConfigurationReference = 06FB7FC322A8233700E0B8C5 /* SampleCode.xcconfig */; 371 | buildSettings = { 372 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 373 | CODE_SIGN_STYLE = Automatic; 374 | DEVELOPMENT_ASSET_PATHS = "\"SwiftUI by Examples\"/Preview\\ Content"; 375 | ENABLE_PREVIEWS = YES; 376 | INFOPLIST_FILE = "SwiftUI by Examples/Info.plist"; 377 | LD_RUNPATH_SEARCH_PATHS = ( 378 | "$(inherited)", 379 | "@executable_path/Frameworks", 380 | ); 381 | PRODUCT_BUNDLE_IDENTIFIER = "com.artemnovichkov.SwiftUI-by-Examples"; 382 | PRODUCT_NAME = "$(TARGET_NAME)"; 383 | SWIFT_VERSION = 5.0; 384 | TARGETED_DEVICE_FAMILY = "1,2"; 385 | }; 386 | name = Debug; 387 | }; 388 | 06FB7FC122A822C700E0B8C5 /* Release */ = { 389 | isa = XCBuildConfiguration; 390 | baseConfigurationReference = 06FB7FC322A8233700E0B8C5 /* SampleCode.xcconfig */; 391 | buildSettings = { 392 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 393 | CODE_SIGN_STYLE = Automatic; 394 | DEVELOPMENT_ASSET_PATHS = "\"SwiftUI by Examples\"/Preview\\ Content"; 395 | ENABLE_PREVIEWS = YES; 396 | INFOPLIST_FILE = "SwiftUI by Examples/Info.plist"; 397 | LD_RUNPATH_SEARCH_PATHS = ( 398 | "$(inherited)", 399 | "@executable_path/Frameworks", 400 | ); 401 | PRODUCT_BUNDLE_IDENTIFIER = "com.artemnovichkov.SwiftUI-by-Examples"; 402 | PRODUCT_NAME = "$(TARGET_NAME)"; 403 | SWIFT_VERSION = 5.0; 404 | TARGETED_DEVICE_FAMILY = "1,2"; 405 | }; 406 | name = Release; 407 | }; 408 | /* End XCBuildConfiguration section */ 409 | 410 | /* Begin XCConfigurationList section */ 411 | 06FB7FA622A822C600E0B8C5 /* Build configuration list for PBXProject "SwiftUI by Examples" */ = { 412 | isa = XCConfigurationList; 413 | buildConfigurations = ( 414 | 06FB7FBD22A822C700E0B8C5 /* Debug */, 415 | 06FB7FBE22A822C700E0B8C5 /* Release */, 416 | ); 417 | defaultConfigurationIsVisible = 0; 418 | defaultConfigurationName = Release; 419 | }; 420 | 06FB7FBF22A822C700E0B8C5 /* Build configuration list for PBXNativeTarget "SwiftUI by Examples" */ = { 421 | isa = XCConfigurationList; 422 | buildConfigurations = ( 423 | 06FB7FC022A822C700E0B8C5 /* Debug */, 424 | 06FB7FC122A822C700E0B8C5 /* Release */, 425 | ); 426 | defaultConfigurationIsVisible = 0; 427 | defaultConfigurationName = Release; 428 | }; 429 | /* End XCConfigurationList section */ 430 | }; 431 | rootObject = 06FB7FA322A822C600E0B8C5 /* Project object */; 432 | } 433 | --------------------------------------------------------------------------------