Skip to content
Minimum implementation and execution result to each api in SwiftUI
Swift
Branch: master
Clone or download
Latest commit d65fbd2 Aug 12, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
SwiftUICatalog.xcodeproj fix Aug 11, 2019
SwiftUICatalog fix Aug 11, 2019
SwiftUICatalogTests initial commit Aug 4, 2019
SwiftUICatalogUITests initial commit Aug 4, 2019
LICENSE Create LICENSE Aug 8, 2019
README.md Update README.md Aug 12, 2019

README.md

SwiftUICatalog

Can you imagine how UI works from the API reference?

I created a catalog app showing minimum implementation and execution result for each the API.

SwiftUI has many references to get started. SwiftUI Tutorial is the best tool to know how much potential SwiftUI has. But it is a littel complex to research how to use each the API.

This app currently targets iOS and refers to https://developer.apple.com/documentation/swiftui

Requirement

  • iOS 13+
  • Xcode 11.0 beta5

Feature

  • Showing appearance of each SwiftUI component
  • Implementing minimum sample codes of each API

Usage

  1. Clone this repository
  2. Open the project in Xcode 11.0 beta5
  3. Browse APIs like the doc

Example

For example, SegmentedControl is implemented using Picker.

struct SegmentedPickerSample: View {
    var elems = ["Short", "Tall", "Grande", "Venti"]
    @State var selection: Int = 0
    
    var body: some View {
        Picker(selection: $selection, label: Text("Picker")) {
            ForEach(0..<elems.endIndex) {
                Text(self.elems[$0]).tag($0)
            }
        }.pickerStyle(SegmentedPickerStyle())
        .frame(width: 200)
    }
}

It is impemented in this file and you can immediatly run in Simulator or check in Preview.

Support status

There are some sections to categorize the APIs as follows.

https://developer.apple.com/documentation/swiftui

I'm adding them sequentially.

  • Views and Controls 80%
  • View Layout and Presentation 100%
  • Drawing and Animation 60%
  • Framework Integration
  • State and Data Flow
  • Gestures 70%
  • Previews
  • ViewModifier 0%

LICENSE

Copyright (c) 2019 Kazuhiro Hayashi

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

You can’t perform that action at this time.