Just For Fun - tiny easy apps, refresher for swift basics

Overview

Stanford Swift Education - Very Basic - Refresher

Some useful hints:

Outlet types:

  • Outlet
  • Action
  • Outlet Collection with Index - very useful

Debugger

  • lldb: po - print out object
  • lldb: p object - formated print out object

Stride

Swift has a helpful stride(), which lets you move from one value to another using any increment – and even lets you specify whether the upper bound is exclusive or inclusive.

stride(from:to:by:) counts from the start point up to by excluding the to parameter. If you want to count up and including the to parameter, you should use stride(from:through:by:)

stride(from:to:by:) Code Example
for i in stride(from: 0, to: 0.5, by: 0.1) {
    print(i)
}

Assert

One level up from print() are assertions, which are debug-only checks that will force your app to crash if a specific condition isn't true.

This is different from print(), which would remain in your code if you shipped it, albeit mostly invisible. In fact, because calls to assert() are ignored in release builds of your app, you can do complex checks:

assert() Code Example
assert(myReallySlowMethod() == true, "The slow method returned false, which is a bad thing!")

Protocols

Normally any protocol implementor must implement all the methods/properties in the protocol. However, it is possible to mark some methods in a protocol optional.

Any protocol that has optional methods must be marked @objc.

In a class, inits must be marked required (or otherwise a subclass might not conform)

You might also like...
Custom emojis are a fun way to bring more life and customizability to your apps.
Custom emojis are a fun way to bring more life and customizability to your apps.

Custom emojis are a fun way to bring more life and customizability to your apps. They're available in some of the most popular apps, such as Slack, Di

Develop simple and fun Augmented Reality (AR) iOS apps
Develop simple and fun Augmented Reality (AR) iOS apps

AR-Dice Simple and fun to use iOS app made to make Augmented reality (AR) be in

Painless custom transitioning. Easy extend, easy setup, just focus on animations.

TransitionManager Painless custom transitioning. Easy extend, easy setup, just focus on animations. Installation CocoaPods You can use CocoaPods to in

A fun, easy-to-use tab bar navigation controller for iOS.
A fun, easy-to-use tab bar navigation controller for iOS.

CircleBar Don’t you, sometimes, miss fun user interfaces? Truth is, we do. Sure, you can't use them in enterprise apps for obvious reasons, but if you

A fun, easy-to-use tab bar navigation controller for iOS.
A fun, easy-to-use tab bar navigation controller for iOS.

CircleBar Don’t you, sometimes, miss fun user interfaces? Truth is, we do. Sure, you can't use them in enterprise apps for obvious reasons, but if you

A tiny and easy to use Swift class to encrypt strings using HMAC algorithms.

#Sweet HMAC SweetHMAC is a tiny and easy to use Swift class to encrypt strings using HMAC algorithms. A special thanks to jernejstrasner for shared HM

A tiny and easy to use Swift class to encrypt strings using HMAC algorithms.

#Sweet HMAC SweetHMAC is a tiny and easy to use Swift class to encrypt strings using HMAC algorithms. A special thanks to jernejstrasner for shared HM

Soundable is a tiny library that uses AVFoundation to manage the playing of sounds in iOS applications in a simple and easy way

Soundable is a tiny library that uses AVFoundation to manage the playing of sounds in iOS applications in a simple and easy way. You can play

Create a beautiful Onabording for your iOS/iPadOS apps in just a few minutes.
Create a beautiful Onabording for your iOS/iPadOS apps in just a few minutes.

Create a beautiful Onabording for your iOS/iPadOS apps in just a few minutes.

Dogs - A fun exploration of using Clean Swift methodology (VIP) to build a simple app
Dogs - A fun exploration of using Clean Swift methodology (VIP) to build a simple app

Dogs A fun exploration of using Clean Swift methodology (VIP) to build a simple app Was following the directory structure and templates as described i

Punctual - Swift dates, more fun. Heavily inspired by ObjectiveSugar

Punctual Swift dates, more fun. Heavily inspired by ObjectiveSugar Installation Punctual is available through the Swift Package Manager! Just add this

An easy way to add a shimmering effect to any view with just one line of code. It is useful as an unobtrusive loading indicator.
An easy way to add a shimmering effect to any view with just one line of code. It is useful as an unobtrusive loading indicator.

LoadingShimmer An easy way to add a shimmering effect to any view with just single line of code. It is useful as an unobtrusive loading indicator. Thi

Easy quiz just for reviewing structures and MVC
Easy quiz just for reviewing structures and MVC

Quizzler Our Goal The goal of this tutorial is to take you one step further in your journey of becoming an app developer. We are going to introduce yo

An easy way to add a shimmering effect to any view with just one line of code. It is useful as an unobtrusive loading indicator.
An easy way to add a shimmering effect to any view with just one line of code. It is useful as an unobtrusive loading indicator.

LoadingShimmer An easy way to add a shimmering effect to any view with just single line of code. It is useful as an unobtrusive loading indicator. Thi

The purpose of the color game is to find the right color without getting distracted. It is as difficult as it is fun.
The purpose of the color game is to find the right color without getting distracted. It is as difficult as it is fun.

Color Game The purpose of the color game is to find the right color without getting distracted. It is as difficult as it is fun. Getting Started Insta

The purpose of the color game is to find the right color without getting distracted. It is as difficult as it is fun.
The purpose of the color game is to find the right color without getting distracted. It is as difficult as it is fun.

Color Game The purpose of the color game is to find the right color without getting distracted. It is as difficult as it is fun. Getting Started Insta

Mouse Finder is a fun replacement for the system Finder icon in the Dock.
Mouse Finder is a fun replacement for the system Finder icon in the Dock.

Mouse Finder Mouse Finder is a fun replacement for the system Finder icon in the Dock. It mostly works exactly like the system icon, with one importan

A fun project that fetches film data from IMDB

OMDb A fun project that fetches film data from IMDB To Run Get yourself an API key from here. You may need to wait several minutes for your API key to

Fun GridScrollView written in SwiftUI + Combine, bridging between UIKit
Fun GridScrollView written in SwiftUI + Combine, bridging between UIKit

BSZoomGridScrollView BSZoomGridScrollView is a powerful, pure swift iOS UI framework that provides the awesome grid scrollview containing your image a

Owner
Anton Veldanov
Anton Veldanov
🍮 A collection of Swift snippets to be used in Xcode

Swift Snippets ❤️ Support my app ❤️ Push Hero - pure Swift native macOS application to test push notifications PastePal - Pasteboard, note and shortcu

Khoa 156 Dec 24, 2022
An Xcode playground showcasing the new features in Swift 4.0.

What’s new in Swift 4 An Xcode playground showcasing the new features in Swift 4.0. As seen in the What’s New in Swift session at WWDC 2017. Written b

Ole Begemann 1.8k Dec 23, 2022
A Swift library for efficient highlighting, indenting, and querying the structure of language syntax.

Neon A Swift library for efficient highlighting, indenting, and querying the structure of language syntax. It features: Minimal text invalidation Supp

Chime 214 Dec 28, 2022
Show the confetti only when the user is having fun, and if not having fun, don't show it.

SPConfetti - A simple solution to show the confetti to the user. Smoothly starts and stops. Allow set multiply diffrent particles at once. You can chang

Ivan Vorobei 225 Dec 30, 2022
Just a tiny library to make using GCD easier and intuitive

## Build Status Branch Status master develop Dispatch Note: Dispatch requires swift 3.0. Use version 1.0.0 for swift 2.3 or version 0.9.8 for swift 2.

João Mourato 178 Jun 29, 2022
Swift playground teaching basics of buffer overflow vulnerability and ARM64 assembly by exploiting vulnerable app on ARM64 emulator (WWDC22 Swift Student Challenge Winner)

Pwnground Project overview Pwnground is a project created as my submission for WWDC22 Swift Student Challenge (winner). It is an interactive Swift Pla

Bartłomiej Pluta 4 Aug 8, 2022
Swift Programming Basics - Collections, Variables & Constants

Dicee What I learned in this module How to clone an existing Xcode project from GitHub. Create an app with behaviour and functionality. Create links b

null 0 Jan 9, 2022
In this mini app covered the concepts like basics of SwiftUI and Navigations and Animations and List with CRUD functions and MVVM and App Launch and App icons adding and also applied persistence using UserDefaults Concept.

TodoList In this application used the concepts from the beginner level project of SwiftUI_Evolve_1 The following concepts covered in this mini app Swi

Sivaram Yadav 2 Dec 4, 2021
A sample project that provides the basics to create an interactive VR experience on iOS

VR_Toolkit_iOS A sample project that provides a basic toolkit to create an interactive VR experience on iOS. Written in Swift 2.0 using SceneKit. We a

Arthur Swiniarski 85 Apr 6, 2022
OIDCLite implements the basics of getting a token using Apple's ASWebAuthenticationSession

OIDCLite While there are a few good Swift packages for Open ID Connect out there, most are /very/ heavyweight and can get quite complex. For projects

Joel Rennich 7 Apr 20, 2022