A collection of small SwiftUI sample projects.

Overview

Simple SwiftUI logo

Twitter: @twostraws

Simple SwiftUI is a small but growing collection of iOS projects designed to provide small sample projects for SwiftUI learners to read, learn from, modify, and even use as a basis for their projects in the future.

What’s available

Each project in Simple SwiftUI is designed to stand alone as an example solution to a common starter project. This means they don’t have special frills, weird hacks, “clever code”, or similar – they are designed to get one specific job done, rather than demonstrate every possible SwiftUI view and modifier in a single project.

Right now there are just two projects available, but more will be added soon:

More projects will be added soon! The goal is to build up a collection of SwiftUI projects that do one job and do it well, all updated for the latest versions of Swift and SwiftUI so they make for ideal projects for folks to read through and find high-quality code they can learn from.

Tip: All projects here are configured to use SwiftLint as part of their build process, which helps to enforce standard coding style and conventions. SwiftLint is free to install here, and is highly recommended.

Learn how they were made

I produced these projects on livestreams as part of Hacking with Swift+ – there are videos there along with transcriptions, so you can see exactly how the apps are put together, and why I made certain choices.

Contributing

I’ll be adding more projects here in the coming weeks, but there are lots of things anyone can help with:

  • Identifying and fixing any bugs.
  • Identifying and implementing opportunities to simplify the code.
  • Identifying and improving any accessibility problems.
  • Adding tests – unit tests, UI tests, and performance tests are welcome.
  • Writing comments and other documentation designed to make the projects more easily understood.
  • Updating any old Swift or SwiftUI code, so that the projects all target the latest stable version of iOS and Xcode.
  • Ensuring all files build without warnings, including warnings issued by SwiftLint.

If you would like to contribute, please keep these things in mind:

  • The goal isn’t to pack each app with features, in fact the more code we remove the better. This means we don’t need to make every list searchable, for example – there will be a project just for that topic.
  • If there is no option but to use a workaround, e.g. for something SwiftUI doesn’t support yet, then go for it! This are real-world projects, and these projects need to reflect that.
  • If you modify code, please make sure it is thoroughly documented so that someone reading the project can understand it. This is doubly important for any workarounds.
  • If you contribute code or other assets, please make sure it’s something you wrote yourself, and that you are happy to license it under the MIT license so that others can use it freely.

Above all, please keep your code as simple as possible – if you can avoid more advanced features like generics and protocol extensions, please do.

Credits

Simple SwiftUI was made by Paul Hudson, who writes free Swift tutorials over at Hacking with Swift. All code here is released under the MIT license, which permits commercial use, modification, distribution, and private use.

Comments
  • Move Preview specific code to a better location

    Move Preview specific code to a better location

    The Preview Content folder is not just for assets, it's for any code that you want to use only in previews rather than having it compiled in the production code.

    opened by Abizern 3
  • Fix UI tests for SimpleScores with existing data

    Fix UI tests for SimpleScores with existing data

    This PR addresses UI test failures with existing data.

    To replicate test failure of testAddingNewPlayerWorks:

    • Build and run the app
    • Add max number of players (8)
    • Background the app to force the view model to save to file
    • Run the testAddingNewPlayerWorks UI test
    • Test fails due to expectation of a new player being added
    Screenshot 2022-08-04 at 18 54 09

    To replicate test failure of testDeletingAllPlayersWorks:

    • Build and run the app
    • Add at least 2 players
    • Background the app to force the view model to save to file
    • Run the testDeletingAllPlayersWorks UI test
    • Test fails due to the extra time it takes to animate the deletion of the additional players
    Screenshot 2022-08-04 at 18 56 21
    opened by atrinh0 1
  • Minor typo SimpleScores instead of SimpleNews

    Minor typo SimpleScores instead of SimpleNews

    On this readme page under the Credits section the first word should be SimpleNews instead of SimpleScores https://github.com/twostraws/simple-swiftui/blob/main/SimpleNews/README.md

    opened by hartti 1
  • Fix the issue that the search field is hidden as default is not working in SimpleNews app.

    Fix the issue that the search field is hidden as default is not working in SimpleNews app.

    In SimpleNews app, I think the reason that the search bar is not hidden at start is .searchable is attached to the whole Group. I found that moving .searchable to List makes search bar behaviour appropriately. Likewise, .refreshable is not working in loading or failed state. This also should be moved to List.

    opened by hmseo 1
  • Added unit tests for the view model.

    Added unit tests for the view model.

    Added some basic unit tests for the add/delete/reset methods in the view model. (Had to change the deployment target to iOS 15.0 to run on an older version of Xcode my laptop.)

    opened by davidsteppenbeck 1
  • Update edit button behaviour

    Update edit button behaviour

    Disable edit button when list is empty Disable edit mode upon deleting items

    Reference

    https://user-images.githubusercontent.com/16542463/166917791-16a3afec-6c59-4d2f-b5cf-c0e0abc8f1e2.MP4

    Outcome

    https://user-images.githubusercontent.com/16542463/166917814-09f1a530-f037-4c2b-8206-b7f6a530664b.mp4

    opened by atrinh0 1
  • Adds an accessibility value to item rows, indicating priority/completion

    Adds an accessibility value to item rows, indicating priority/completion

    Hi!

    This change adds an accessibility value to the item rows for todo-items, indicating their status. This helps users using an assistive technology have a better overview of an item, not requiring to go into the details to figure out an item's status.

    | Before | After | | - | - | | before | after |

    opened by BasThomas 1
  • Idea for more simple apps

    Idea for more simple apps

    There is a similar set of tools in Android. And maybe if you need ideas of what to do next, their list could be where to start.

    • Drawing
    • Notes
    • Music player
    • Gallery
    • Voice Recorder
    • Etc.

    https://simplemobiletools.com

    opened by bdirgo 0
Owner
Paul Hudson
Creator of Hacking with Swift, author of books about iOS, macOS, watchOS, and tvOS, public speaker, Rubik's cube enthusiast, and herder of my kids.
Paul Hudson
VCore is a Swift collection containing objects, functions, and extensions that I use for all my projects

VCore Table of Contents Description Library Structure Architecture Gateway Demo Installation Versioning Contact Description VCore is a Swift collectio

Vakhtang Kontridze 33 Nov 22, 2022
Remember there's no such thing as a small act of kindness. Every act creates a ripple with no logical end.

Ripple is a small convenience to create ripples in your app. With just a line of code, you can do beautiful things. Code There are two types of ripple

Ramon Gilabert 87 May 15, 2022
A collection of bugs present in the SwiftUI beta.

Gosh Darn Bugs! GoshDarnBugs is a collection of... you guessed it, bugs. Usage Clone the repository. Open GoshDarnBugs.xcodeproj Click Run. Why? Swift

SwiftUIX 33 Aug 28, 2021
Base projects for Devpass' Dev Sprints

Animations Challenge - Finance App ?? In this challenge, you will develop micro-interactions, screen transitions, and reusable animations with best pr

Devpass 3 Oct 10, 2022
Simple IOS App About KSA Leaders and Future Projects.

KSA-App Simple IOS App About KSA Leaders and Future Projects. This project made by Swift and SwiftUI. The Project Applies the following: Reusable comp

Ruba Yahya 3 Oct 3, 2022
ChainPageCollectionView A custom View with two level chained collection views and fancy transition animation

ChainPageCollectionView A custom View with two level chained collection views and fancy transition animation. Demo Requirements iOS 9.0+ Xcode 8 Insta

Yansong Li 775 Dec 7, 2022
List a collection of items in a horizontally scrolling view. A scaling factor controls the size of the items relative to the center.

CAROUSEL List a collection of items in a horizontally scrolling view. A scaling factor controls the size of the items relative to the center. We speci

Ramotion 557 Dec 31, 2022
A collection of animations for iOS. Simple, just add water animations.

DCAnimationKit A collection of animations for iOS Simply, just add water! DCAnimationKit is a category on UIView to make animations easy to perform. E

Dalton 797 Sep 23, 2022
SamuraiTransition is an open source Swift based library providing a collection of ViewController transitions featuring a number of neat “cutting” animations.

SamuraiTransiton is a ViewController transition framework in Swift. It is an animation as if Samurai cut out the screen with a sword. transition types

hachinobu 273 Dec 29, 2022
This repo contains swift collection of gui, games, menu, animations, music, payment, etc... for iOS, macOS, watchOS and tvOS

Swift-Collections About: This repo contains a collection of projects built using swift and objective-c Contains projects for macOS iOS iPad watchOS tv

Krisna Pranav 6 Nov 15, 2022
SwiftUI animated image view that works on iOS and layout just as SwiftUI.Image

SwiftUI.AnimatedImage SwiftUI animated image view that works on iOS and layout just as SwiftUI.Image Screen.Recording.2021-07-31.at.02.18.33.mov Insta

Marcin Krzyzanowski 50 Oct 14, 2022
SwiftUI-Text-Animation-Library - Text animation library for SwiftUI

⚠️ This repository is under construction. SwiftUI Text Animation Library Make yo

null 28 Jan 8, 2023
Swiftui-animation-observer - Track SwiftUI animation progress and completion via callbacks

SwiftUI Animation Observer Track SwiftUI animation progress and completion via c

Gordan Glavaš 9 Nov 5, 2022
SwiftUI project demonstrating Custom coded confetti animation for checkout page

Confetti-Checkout SwiftUI project demonstrating Custom coded confetti animation for checkout page NOTE: CAEmitterLayer is not used but all the confett

Waseem akram 29 Sep 28, 2022
Fortune spinning wheel library built using SwiftUI, supports dynamic content.

Fortune Wheel Fortune spinning wheel ?? library built using SwiftUI, supports dynamic content. Preview - Spin Wheel ⚙️ CocoaPods Installation FortuneW

Sameer Nawaz 51 Dec 23, 2022
Incognito animation made with SwiftUI

IncognitoSwiftUI Incognito animation made with SwiftUI Incognito Mode / Private Browsing Private browsing is a privacy feature in some web browsers. W

Shreyas Bhike 7 Sep 4, 2022
SwiftUI Animation

Hey there Hi, I'm Arvind Patel, a iOS Developer ?? from India. Beside's programming, I enjoy eating food and Watching Movies. I'm a creative problem s

Arvind Patel 582 Jan 8, 2023
SwiftUI Package for Configurable Confetti Animation 🎉

?? ConfettiSwiftUI ?? Swift package for displaying configurable confetti animation. Find the demo project here. Installation: It requires iOS 14 and X

Simon Bachmann 737 Jan 8, 2023