Complete SwiftUI Docs with Examples

Related tags

Example Apps Docs
Overview

🍻 SwiftOnTap

Complete SwiftUI Docs with Examples.

Get Started | How It Works | Add Docs


Get Started

To get started,

  1. Go to swiftontap.com 👉 .
  2. Press / and search for a struct, enum, func, or any other SwiftUI symbol.
  3. Press return.

We've got it all on tap. 🚰 🍻


If you're new to SwiftUI 🤓

We get it, docs are overwhelming at first. To start, we recommend these resources (in order!)

  1. Apple's Swift book (if you're new to the language)
  2. Apple's SwiftUI tutorials, which are quite good!
  3. SwiftOnTap (these docs) once you get moving 🚴

How It Works

Who wrote all these docs?

A bunch of us SwiftUI developers have been hard at work filling Apple's documentation hole 🕳 . You can also edit these docs!


Where do the docs live?

All the docs live in one file called SwiftUI.swift. It's just a regular .swift file with lots of documentation comments 🧑‍💻 . Whenever anyone edits this file on GitHub, we automatically scan for the comments. Then it goes live to swiftontap.com!


Could this work for any .swift file?

Theoretically, yes! We've just been focused writing SwiftUI docs for now. Let us know 📧 if you want to generate your own sweet documentation site.


Add Docs

To add or edit docs,

  1. Open a pull request from github.com/SwiftOnTap/Docs. (See here to learn how!)
  2. See this Apple guide for writing great documentation comments.
  3. Sit back 🧘 , and watch your work go live!
Comments
  • The relationship between the website and SwiftUI.swift main file is confusing

    The relationship between the website and SwiftUI.swift main file is confusing

    TL;DR

    I would like to contribute, but I am not sure how exactly the SwiftUI.swift translates into the website.

    In the SwiftUI.swift file, it seems like there is an extension for every single existing Swift API, with copied paste documentation from Apple's Documentation. Obviously, the point of this project is to replace them with better, detailed, step by step documentation. But not all the methods in SwiftUI.swift shows up on the website. Will they automatically show up once the documentation is edited, or is this a manual process?

    By the way, should we break up the SwiftUI.swift file into subfiles, organizing by the SwiftUI component type? Because it is kind of painful when all the previews on Github doesn't work.

    opened by jevonmao 5
  • fix redacted example

    fix redacted example

    Hello, the current example of RedactionReasons produces such a rendering:

    Screenshot 2021-04-17 at 20 34 55

    I think adding a VStack would create the desired output. Or do you think it would be distracting?

    Screenshot 2021-04-17 at 20 35 46

    I added a VStack in this PR, let me know what you think.

    opened by denisenepraunig 1
  • Very nice documentation, but expected to add MacOS support.

    Very nice documentation, but expected to add MacOS support.

    On macOS, some SwiftUI controls are displayed differently, and there are also some controls that can only be used on their respective platforms on macOS and iOS. I hope they can be more comprehensively reflected in the document.

    such as:

    
    #if os(macOS)
    Settings {
    Text("Settings here.")
    }
    #endif
    

    English is not my native language; please excuse typing errors.

    opened by Jinxiansen 1
  • Correct the description of when you can access and mutate state prope…

    Correct the description of when you can access and mutate state prope…

    …rties to align with what's in Apple's official documentation.

    This is what it says in Apples documentation for @frozen @propertyWrapper struct State<Value>

    You should only access a state property from inside the view’s body, or from methods called by it. For this reason, declare your state properties as private, to prevent clients of your view from accessing them. It is safe to mutate state properties from any thread.

    I tried to rephrase the wording in Apples documentation as not to plagiarize, but I since Apple's documentation is already very concise, I feel like I just added fluff to something that was already clear. I'm open to suggestions regarding rephrasing.

    This edit should clarify two points:

    1. Accessing a state property is actually more strict than using the main thread. It should only be accessed from the call to the view's body.
    2. Modifying state is actually completely permissive and can be accessed from any thread.
    opened by alycedaw 1
  • Update `DefaultTabViewStyle()` and `PageTabViewStyle()` to use static `.automatic` and `.page` instead

    Update `DefaultTabViewStyle()` and `PageTabViewStyle()` to use static `.automatic` and `.page` instead

    The new static APIs introduced in Swift 5.5 allow us to use the static versions to create a TabViewStyle. We should prefer this more concise swifty version.

    opened by andybezaire 0
  • Small Fix RedactionReasons Example

    Small Fix RedactionReasons Example

    Hello, the current example of RedactionReasons produces such a rendering:

    Screenshot 2021-04-17 at 20 34 55

    I think adding a VStack would create the desired output. Or do you think it would be distracting?

    Screenshot 2021-04-17 at 20 35 46

    I added a VStack in this PR, let me know what you think.

    opened by denisenepraunig 0
  • Dark Mode

    Dark Mode

    Hi

    I am iOS developer and I saw swiftontap.com new. Its a great documentation tool and helped me a lot. Thank you very much for your works.

    Also I have suggestion to add Dark Mode support on https://swiftontap.com Many developers use the dark mode and it is very difficult to focus on a light background. Thanks

    opened by HsynKcmn 0
  • RotationGesture code example should be ContentView

    RotationGesture code example should be ContentView

    The RotationGesture symbol code example uses RotationGestureView (see https://swiftontap.com/rotationgesture)

    This should be updated to ContentView to be thematically consistent with other pages.

    opened by a-moss 0
Releases(v1.0.31)
Owner
null
Tipsy - Bill splitting and tip calculating App developed during iOS & Swift classes - The Complete App Development Bootcamp

Tipsy ?? Bill splitting and tip calculating App developed during iOS & Swift cla

Rayana Prata 1 Jan 27, 2022
Simple examples that help you get started with Appwrite + Apple with SwiftUI (=❤️)

Appwrite's Apple Playground ?? Appwrite playground is a simple way to explore the Appwrite API & Appwrite Apple SDK. Use the source code of this repos

Appwrite 28 Nov 22, 2022
Simple examples that help you get started with Appwrite + Swift for Server (=❤️)

Playground for Swift Simple examples that help you get started with Appwrite + Swift (= ❤️ ) This is Appwrite server side integration with Swift. For

Appwrite 24 Dec 10, 2022
Combine explanation + examples

Combine Playground These repository contains a Xcode Playground that goes over the basics of Combine and presents usage examples for the main componen

Andrés Pesate 2 Dec 29, 2021
 Sample iOS App - A collection of examples and patterns for Unit Testing, UI Testing, handling Result/Optionals, writing documentation

 Sample iOS App - A collection of examples and patterns for Unit Testing, UI Testing, handling Result/Optionals, writing documentation, and more

Soojin Ro 206 Dec 9, 2022
📏 A set of advanced compositional layouts for UICollectionView with examples

compositional-layouts-kit If you like the project, please give it a star ⭐ It will show the creator your appreciation and help others to discover the

Astemir Eleev 378 Dec 27, 2022
IOS Swift : Explain Higher-order Function Examples

IOS Swift : Explain Higher-order Function Examples

Aya Baghdadi 0 Feb 20, 2022
SwiftUI Project built using the fundamentals of SwiftUI that I have learned.

GhibliLog About: I wanted to test my ability to create an application with a responsive SwiftUI interface that would format and display data pulled fr

Daniel Whitehorn 0 Nov 9, 2021
Todolist-swiftui - An example of using SwiftUI with CoreData

todolist-swiftui An example of using SwiftUI with CoreData Installation Install

null 0 Dec 30, 2021
Challenge-swiftui-space - Project for SwiftUI Dev Sprints on Devpass

SwiftUI Challenge - Space App ?? Neste desafio, desenvolveremos a interface de u

Devpass 7 Dec 27, 2022
'SwiftUI Apps' application that made with SwiftUI

SwiftUI Apps 'SwiftUI Apps' application that made with SwiftUI, which includes many sample applications, was made by Hamit Seyrek, the founder of the

Hamit SEYREK 12 Oct 15, 2022
Concept for organizing View and Data layers within SwiftUI App

SwiftUI MVVM Concept It is not about how to create Lists and Charts and View design. It's about possibility how to organize View and Data layers withi

Igor 16 May 16, 2022
Demonstrates hosting SwiftUI in a UISplitViewController to gain the sidebar style in Mac Catalyst

Really trivial example showing how to wrap SwiftUI in a UISplitViewController, so that you can use the correct sidebar background style when building for macOS.

Steven Troughton-Smith 68 Oct 26, 2022
Advanced Catalyst Example with sidebar, list view, SwiftUI detail view, toolbar & AppKit bundle

Advanced Catalyst Example This is an example of a Catalyst app using a three-column layout, with a primary toolbar. It includes topics such as: Drag &

Steven Troughton-Smith 219 Dec 8, 2022
This is a sample project that supplements the tutorial written over at my blog on 'Building a music recognization app in SwiftUI with ShazamKit'

Shazam-Kit-Tutorial This is a sample project that supplements the tutorial written over at my blog on 'Building a music recognization app in SwiftUI w

Swapnanil Dhol 7 Mar 17, 2022
RxFlow With SwiftUI (List To Detail)

RxFlow With SwiftUI (List To Detail) About RxFlow + SwiftUI Very Simple Example [List View] -> [Detail View] Navigation System : UIKit + RxFlow UI : S

jinreol kim 6 Apr 4, 2022
SwiftUi Facebook clone

Facebook mobile redesign IOS Building Facebook UI redesign concept using SwiftUi. ?? Design by : Lilya Vysotskaja App screenshots Code by : ilies ould

ilies ouldmenouer 11 Oct 18, 2022
Demo app for SwiftUI state management

StateObject vs ObservedObject Demo Demo app for SwiftUI state management Run the app and push 3 buttons to increase each counter. Toggle one of the to

Serhii Kyrylenko 0 Oct 13, 2021