/swift-starter-project

A Xcode Swift starter project with SwiftLint, TinyConstraints and our recommended folder structure.

Primary LanguageSwift

🚀 Quick start

  1. Install SwiftLint

    Use the Gatsby CLI to create a new site, specifying the minimal starter.

    brew install SwiftLint
  2. Open Xcode

    Open this project in Xcode

  3. Resolve Package Versions

    In Xcode, Select File -> Packages -> Resolve Package Dependencies.

    This is required to get TinyConstraints working found at: TinyConstraints: Nothing but sugar.

💻 Keyboard Shortcuts

Select Many lines Control + Shift + Click

##Find

Find in File Command + F

Find and Replace in Project Command + Shift + F

##Find and Replace Same as the above and select replace from the dropdown.

📰 Guides

  1. Apple App Launch Screen Best Practices 🔗
  2. How to localize iOS, MacOS, TVOS & WatchOS apps in XCode and Swift 🔗
  3. SwiftData Quick Start Guide 🔗
  4. Apple App Store E-Commerce Business Guide 🔗
  5. E-Commerce Fees in Apple App Store Apps 🔗
  6. Apple In-App Purchases and Subscriptions Development Guide 🔗
  7. How to reduce risk when developing Apple e-commerce apps 🔗
  8. How to build an app that uses Apple In-App Purchases and Subscriptions 🔗
  9. Free Open-Source Apple StoreKit 2 Swift Project 🔗
  10. How to Create a Website Smart App Banner for your App & App Clip. 🔗
  11. iOS Accessibility Resource Guide 🔗
  12. Debugging recommendations for XCode & Swift (iOS) 🔗
  13. Recommendations for creating a structured custom UIView in Swift 🔗
  14. Apple Metal Resources Guide 🔗

📚 Tutorials

Core

Setup

  1. How to create a SwiftLint enabled Swift Xcode Project 🔗
  2. How to add a Swift Package Manager package dependency 🔗
  3. How to add a local Swift Package in XCode 🔗

Splash Screen

  1. Apple App Launch Screen Best Practices 🔗
  2. How to create a launch screen in XCode 🔗
  3. How to stop an App build at the Launch Screen in XCode 🔗
  4. How to make an iPhone, iPad or Mac show an updated launch screen 🔗

Storyboard

  1. How to add a UI component to a storyboard in XCode 🔗
  2. How to use an image within a storyboard in XCode 🔗
  3. How to constrain a UI component in a storyboard in XCode 🔗
  4. How to constrain a UI component to the edges of a UIViewController 🔗

Debugging

  1. How to add and use a breakpoint in XCode 🔗
  2. How to view all breakpoints in XCode 🔗
  3. How to activate or deactivate breakpoints in XCode 🔗
  4. How to remove a breakpoint in XCode 🔗
  5. How to profile CPU usage using Instruments in XCode 🔗
  6. How to diagnose a hang, severe hang or freeze in XCode 🔗

Design Systems

  1. How to create a singleton in Swift 🔗
  2. How to create a styleguide in XCode & Swift 🔗

Constraints

  1. How to implement Safe Area Insets in Swift 🔗
  2. How to activate & deactivate constraints in Swift 🔗
  3. How to update constraints in Swift 🔗
  4. How to animate constraints in Swift 🔗

Notifications

  1. How to send and receive Notifications in Swift 🔗

Errors

  1. How to create custom errors in Swift 🔗
  2. How to resolve an XCode sandbox build error 🔗

Media

  1. How to add and structure local images in Swift 🔗
  2. How to add a hosted image to a view in Swift 🔗
  3. How to add a local image to a view in Swift 🔗
  4. How to add and use images as files instead of xcassets in XCode

SF Symbols

  1. How to use SF Symbols in Swift 🔗

UI Basics

  1. How to add a label to a view in Swift 🔗
  2. How to create an attributed label in Swift 🔗
  3. How to make a custom button in Swift 🔗

ScrollViews & CollectionViews

  1. How to implement a UIScrollView in Swift 🔗
  2. How to create a custom carousel in Swift 🔗
  3. How to snap a carousel to position in Swift 🔗
  4. How to create a scroll indicator for a carousel in Swift 🔗
  5. How to create a UICollectionView with multiple sections in Swift 🔗
  6. How to animate changes in a UICollectionView datasource in Swift 🔗

Actors

  1. How to create and use a global actor in Swift 🔗
  2. How to use actor properties from the main actor without async/await 🔗
  3. How to update actor properties from the main actor 🔗

SwiftData

  1. SwiftData Quick Start Guide 🔗

Setup

  1. How to create or access a SwiftData Persistent Container in Swift 🔗

Modelling

  1. How to create a SwiftData Model in Swift 🔗
  2. How to add complex values to SwiftData models 🔗
  3. How to create a SwiftData model variable that does not persist 🔗

Operations

  1. How to get all SwiftData objects in Swift 🔗
  2. How to get an object from SwiftData in Swift 🔗
  3. How to know if an object already exists in SwiftData 🔗
  4. How to add an object to SwiftData in Swift 🔗
  5. How to delete an object from SwiftData in Swift 🔗
  6. How to delete all objects from SwiftData in Swift 🔗
  7. How to update an object in SwiftData in Swift 🔗

Errors

  1. SwiftData crashes when trying to access a deleted object 🔗
  2. How to solve "No exact matches in call to instance method 'setValue'" 🔗

Advanced UI

  1. How to create a UIView that dynamically adapts to its contents 🔗
  2. How to make a custom search bar in Swift. 🔗
  3. How to create a filtered search experience in Swift 🔗
  4. How to create a UICollectionView with cells that size to fit content 🔗</a
  5. How to make a custom data driven UICollectionView 🔗
  6. How to create a multi-section UICollectionViewCompositionalLayout 🔗
  7. How to create an animated progress indicator in Swift 🔗

Async / Await

  1. How to use async and await in Swift projects 🔗

Utilities

  1. How to open a URL in Safari in Swift 🔗
  2. How to observe changes in screen size in Swift 🔗
  3. How to observe device orientation changes in Swift 🔗
  4. How to get the device orientation of an iPhone or iPad in Swift 🔗
  5. How to convert a JSON object into data in Swift 🔗
  6. How to convert data into a JSON object in Swift 🔗
  7. How to send an email from an app in Swift 🔗

API / GraphQL

  1. How to setup a Swift project to make API calls in XCode. 🔗
  2. How to make an GraphQL call in Swift 🔗
  3. How to make an API call with a variable codable type in Swift 🔗

CADisplayLink

  1. How to perform animations in Metal using a CADisplayLink 🔗
  2. How to pause, resume, remove or invalidate a CADisplayLink in Swift 🔗

Bluetooth

  1. How to hide the Bluetooth Alert in Swift 🔗

Speech Recognition (Voice)

  1. How to setup speech recognition in Swift 🔗
  2. How to recognize voice commands in Swift 🔗
  3. How to continuously start and stop speech recognition in Swift 🔗

Reviews

  1. How to Request Customers to Leave a Review on the Apple App Store 🔗

App Clip

  1. How to create an App Clip in XCode 🔗
  2. How to Generate a QR Code or NFC Tag for your App Clip Experience. 🔗
  3. How to Create a Website Smart App Banner for your App & App Clip. 🔗

MAC Catalyst

  1. How to make a Mac Catalyst App Full Screen (MacOS 12+) 🔗
  2. How to archive an app with Firebase SDK using CocoaPods (Mac Catalyst) 🔗

StoreKit

Setup

  1. How to create a StoreKit Coordinator in Swift 🔗
  2. How to sync a StoreKit configuration file with App Store Connect 🔗
  3. How to setup StoreKit products in XCode 🔗
  4. How to create a StoreKit offering in XCode or App Store Connect 🔗
  5. How to convert a synced StoreKit configuration file into a local file 🔗

Creating and Modifying

  1. How to create a local StoreKit In-App Purchase in XCode 🔗
  2. How to create a local StoreKit Subscription in XCode 🔗
  3. How to add localizations to local In-App Purchases or Subscriptions 🔗
  4. How to plan price changes for local StoreKit In-App Purchases 🔗
  5. How to plan price changes for local StoreKit subscriptions 🔗
  6. How to turn on family sharing in In-App Purchases or Subscriptions 🔗
  7. How to tier subscriptions in a local StoreKit configuration file 🔗
  8. How to manage Auto-Renewable Subscriptions in XCode 🔗
  9. How to change the Subscription Renewal Rate in XCode 🔗

Offers

  1. How to create local introductory offers for subscriptions in StoreKit 🔗
  2. How to create local promotional offers for subscriptions in StoreKit 🔗
  3. How to create local offer codes for subscriptions in StoreKit 🔗
  4. How to code and test custom offer code redemption in Swift and Xcode 🔗

Gathering Information in Code

  1. How to get StoreKit In-App Purchases and Subscriptions in Swift 🔗
  2. How to get a StoreKit Subscription period in Swift 🔗
  3. How to get an Auto-Renewable Subscription's status in Swift 🔗
  4. How to get a StoreKit Subscription Introductory Offer period in Swift 🔗
  5. How to get the type of Introductory Offer in Swift 🔗
  6. How to determine if an introductory offer has been used in Swift? 🔗
  7. How to check if a Subscription is being upgraded in Swift 🔗
  8. How to get a Subscription Renewal or Expiration Date in Swift 🔗
  9. How to check if a Subscription is expiring or renewing in Swift? 🔗

UX E-Commerce Functionality

  1. How to allow users to manage a Subscription in an app in Swift 🔗
  2. How to code and test restore purchases in Swift and Xcode 🔗

Testing

  1. How to enable StoreKit testing in XCode 🔗
  2. How to code and test StoreKit purchases in Swift and XCode 🔗
  3. How to code and test localized StoreKit product names and descriptions 🔗
  4. How to test StoreKit failed purchases in Swift and XCode 🔗
  5. How to code and test refund requests in Swift and Xcode 🔗
  6. How to simulate a StoreKit Transaction refund in XCode 🔗
  7. How to code and test StoreKit pending purchases in Swift and XCode 🔗
  8. How to change StoreKit Storefront in XCode 🔗
  9. How to change StoreKit Localization in XCode 🔗
  10. How to open the StoreKit Transaction Manager in XCode 🔗
  11. How to deny or approve a pending StoreKit Transaction in XCode 🔗
  12. How to delete StoreKit Transactions in XCode 🔗
  13. How to code and test international StoreKit product prices 🔗
  14. How to enable and disable StoreKit Interrupted Purchases in XCode 🔗
  15. How to test interrupted purchases in Swift and XCode 🔗
  16. How to enable or disable StoreKit Billing Retry in XCode 🔗
  17. How to enable or disable StoreKit Fail Transactions in XCode 🔗
  18. How to enable or disable StoreKit Ask to Buy in XCode 🔗
  19. How to enable or disable the StoreKit Billing Grace Period in XCode 🔗
  20. How to simulate a price increase consent request in XCode 🔗
  21. How to test Billing Grace Period and Billing Retry for a Subscription 🔗

Errors

  1. How to solve the no active account StoreKit error in Xcode 🔗
  2. How to solve the StoreKit Finance Authentication Error in Xcode 🔗
  3. How to solve the StoreKit did not receive any products error in Xcode 🔗

App Store Connect

  1. How to access an App in App Store Connect 🔗

In-App Purchases

  1. How to access an In-App Purchase in App Store Connect 🔗
  2. How to create In-App Purchases in App Store Connect 🔗
  3. How to add localizations to In-App Purchases in App Store Connect 🔗
  4. How to plan a In-App Purchase price change in App Store Connect 🔗
  5. How to create a family plan In-App Purchase on App Store Connect 🔗

Subscriptions

  1. How to access subscriptions in App Store Connect 🔗
  2. How to access an auto-renewable subscription in App Store Connect 🔗
  3. How to access a non-renewing subscription in App Store Connect 🔗
  4. How to create tiered subscriptions in App Store Connect 🔗
  5. How to create an auto-renewable subscription in App Store Connect 🔗
  6. How to create a non-renewing subscription in App Store Connect 🔗
  7. How to add localizations to a subscription in App Store Connect 🔗
  8. How to add localizations to a Subscription Group in App Store Connect 🔗
  9. How to create a family plan subscription on App Store Connect 🔗
  10. How to plan a subscription price change in App Store Connect 🔗
  11. How to change the duration of a Subscription in App Store Connect 🔗
  12. How to setup a subscription grace period in App Store Connect 🔗
  13. How to edit or turn off subscription grace period in App Store Connect 🔗
  14. How to create, edit and delete offers in App Store Connect 🔗

E-Commerce

Transactions & Entitlements

  1. What are Apple App Store Entitlements and how to use them 🔗
  2. What is the Apple App Store Server API? 🔗
  3. What can I use the App Store Server API for? 🔗
  4. What are Apple App Store Transactions ? 🔗
  5. What information comes with an Apple App Store Server API Transaction? 🔗
  6. How do Apple App Store Transactions work? 🔗
  7. Acquiring Customer Transactions from the Apple App Store 🔗
  8. What information comes with Apple App Store Transactions in an app? 🔗

App Store Server Notifications

  1. What are Apple App Store Server Notifications? 🔗
  2. Apple App Store Server Notifications: What you get and How to use them 🔗

Refunds

  1. How do Apple App Store Refunds work? 🔗
  2. How does Billing Retry and a Grace Period work in the Apple App Store? 🔗
  3. What is the Apple App Store Grace Period? 🔗
  4. What is Apple App Store Billing Retry? 🔗

IAP

  1. What are Apple App Store Consumable In-App Purchases? 🔗
  2. What are Apple App Store Non-Consumable In-App Purchases? 🔗
  3. What is Apple Family Sharing? 🔗
  4. Popular In-App Purchase Mechanics 🔗
  5. Examples of Consumable In-App Purchases 🔗
  6. Challenges and Benefits of In-App Purchases 🔗
  7. Examples of Non-Consumable In-App Purchases 🔗

Subscriptions

  1. What are Apple App Store Auto-Renewable Subscriptions? 🔗
  2. What are Apple App Store Non-Renewing Subscriptions? 🔗
  3. What are Apple App Store Subscription Groups? 🔗
  4. What is Apple Family Sharing? 🔗

Offers

  1. What are Apple App Store Introductory Offers? 🔗
  2. What are Apple App Store Promotional Offers? 🔗
  3. What are Apple App Store Custom Offer Codes? 🔗
  4. Combining Offers in Apple App Store Apps 🔗

Metal

Basics

  1. What is Metal in Apple's Ecosystem ? 🔗
  2. How to structure variables & functionality in shared files in Metal 🔗
  3. How to use Metal with a UIView in Swift 🔗
  4. How to change the background color of an MTKView in Swift 🔗
  5. How to draw a stroke on a primitive in Metal 🔗

Shaders

  1. How to pass variables or data to a Metal Shader in XCode 🔗
  2. How to pass data from the vertex to the fragment function in Metal 🔗
  3. How to use color interpolation in a Metal shader 🔗
  4. How to include utility functions in a Metal shader 🔗

Drawing

  1. How to draw a polygon in Metal 🔗
  2. How to code a MTKView that draws multiple shapes 🔗
  3. How to use multiple shaders to draw multiple shapes within a MTKView 🔗
  4. How to draw an outlined shape with a line width in Metal 🔗
  5. How to make a Metal fragment shader change alpha transparency 🔗
  6. How to control the anti-aliasing of an MTKView in Swift 🔗

Rendering & ANimations

  1. How to start and stop the rendering of a MTKView 🔗
  2. How to perform animations in Metal using a CADisplayLink 🔗

Errors

  1. MTKView clearcolor doesn't change transparency 🔗