jodyabney / SwiftCoding

A set of blog posts about Swift Coding

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Swift Coding

A collection of blog posts about Swift coding

I hope this set of articles is of use to you!

Photo by Drew Hays on Unsplash
Photo by Mad Rabbit Tattoo on Unsplash

For the best free guide for Swift coding use CS193p, a wholly online course focussing on SwiftUI.

Articles

Quick Guides

The UITableView Example
The Programmatic UITableView Example
init
Create a UICollectionView programmatically
Create a UITableViewCell programmatically
Zap the SceneDelegate in iOS 12 and just use the AppDelegate
Delete Storyboard (Xcode 14 Edition)

Beginner

Using a XIB File with a UIView Subclass
The Only UIStackView Guide You Will Ever Need
Imperative vs. Declarative Swift Programming
Default Arguments
Write Programmatic Constraints for Swift Projects
Ranges in Swift
Property Observers in Swift
Zip and Zip2Sequence in Swift
Overcoming Default Arguments in a Protocol
Make it snow!
Swift Lint installation
Storyboard Constraints
Simply Optionals
Functions
Overriding
Properties
TableViewTwoOneViewController
Index Out of Range Exception: The Swifty solution
For Loop
Remove elements from an array during enumeration
Enums
let or var in Swift, and why it absolutely matters
The Remainder Operator
Divide and Conquer Algorithms Using Swift
The Inspector Bar in Xcode
Create UISteppers in Swift (Tutorial)
All Your Outlets Should Be Private
Use SwiftUI Previews in UIKit
My Computer Can't Count
Connect Storyboard Objects to Code
Use Swift Package Manager to Add Dependencies
Which Way is Up? Normalized Coordinates in Swift
Swift Helper Functions
Use a Base Class or a Protocol In Swift?
Avoid Swift's Optionals Through Laziness

Easy

SEE Retain Cycles in Xcode
New Features for iOS 14: SwiftUI
|Hello, World" SwiftUI
Text Scroll with SwiftUI
|Create a Horizontally Scrolling UICollectionView with Dynamic Cell Sizes
Debug using Breakpoints in Xcode
Use lldb to Dynamically Change Code in Xcode
The Singleton
viewDidLoad() Vs. loadView()
Core Data with SwiftUI
The UINavigationController and UINavigationBar in Swift
Use Charles to Rewrite Responses Developing iOS Apps
Stack Overflow's Most Downvoted Swift Question
Using Swift's CustomStringConvertible
Segues in Swift
Visual Memory Debugger
Swift initializers
Initialising a view controller from a test using Swift
Using IBDesignable and IBInspectable in Swift
Detect iOS Shake Gestures: Swift
Create a CustomUITableViewCell in a UITableView
Handle Button Presses in CustomUITableViewCells Without Tags
Stride in Swift
Listing enum cases using CaseIterable in Swift
NSAttributedString vs NSMutableAttributedString
Overriding the default font in Swift
Common errors when using custom fonts in your iOS App
Learning UITesting using Xcode
Gradients in Swift
Using Git with Xcode
A Swift YogaKit Guide to Flexbox
A Localize Swift Tutorial
Memory leaks using the Xcode memory graph debugger
MVC in Swift
UIScrollView with Auto Layout implemented in Interface builder
Access control in Swift
FibonacciSeriesInDepth
CleanUITableViewControllers
WOOT! Supercharge Result Type using Swift's get()
What is intrinsicContentSize Anyway?
Intrinsic Content Size: Swift's Sizing Mystery
Containing Child View Controllers for iOS Apps
Lazy Loading images
Sorting Dictionaries
Fix Those Annoying Separator Lines in Swift
Coping with a long parameter list in Swift
Why Do We Call Super When Making iPhone Apps?
Why Use LayoutSubviews Anyway?
Subclass or Extend classes in Swift
Copy-On-Write
Can You Write Pure Functions in Swift?
Decode JSON Like A PRO
View Tags
Create a Custom UIAlertView in Swift
Multiple Initializers
A Basic UISearchViewController (Swift Tutorial)
Stop SPAMMING your API from a UISearchController
Views shouldn't know about threads
The UIPickerView Guide (Swift Tutorial)
SwiftUI Property Wrappers
A Mixed Economy: Xib and Storyboards
A Gradient Layer Below a UITableView
I've finally mastered Case Let
Radians Are Useful In Swift
Practical Reference Cycles in Swift
What is the @Published Property Wrapper?
Retain Cycles and Memory Management in Swift
Unwrap an Array of Optional Values Using Swift
Self or self in Swift Code
Animate a Bar Button Item using Swift
Create a UIKit UISegmented Control
Animate an Icon in Swift
What the ZSH is ZSH, and what is BASH anyway?
Subclassing a UIButton Using UIKit
Did You See This? A Measurement Class In Swift
The Lazy Variables: What and Why in Swift
Create A Working UIScrollView Programmatically
Testing Location Dependent Swift Code
Create a UINavigationController With a Gradient as a Background

Normal

Semaphores
Throw inside a closure
A Networking Manager with Alamofire
Use OperationQueue to Chain API Calls in Swift
Did Apple Kill UITableView? - UICollectionView Lists
Property Wrappers
Compositational Layouts
MVVM-C
MVC
VIPER
Theoretical VIPER
MVVM
MVVM RxSwift
The MVI Architecture Pattern in Swift
Using Redux and Swift
Loading Animation
The Only CAGradientLayer Guide You Will Ever Need
Combine and URLSession in UIKit
Parallel Programming with Operation and OperationQueue in Swift
Dark Mode iOS
iOS11 Compatibility
KeyPaths
Swift Package
ThreadSafeArray
ServiceLocator Pattern
StatePreservation
Cache URLResponses in Swift
MVVM Dependency Injection using Storyboards
Recreate the SwiftUI Sandwiches WWDC demo
Use SwiftUI in a Playground
Write a Network Layer in Swift
Encode Behaviors into Reusable View Controllers
Embed a UICollectionView Inside a UITableView
A UIGestureRecognizer tutorial
Decode JSON in Swift: A Full Micro-Project
Dependency Injection using Storyboards
Using Data Transfer Objects (DTO) in Swift Code
Do enum Types Conform to Hashable in Swift?
Two-phase Initialization in Swift
Annotation
Namespacing
Extensions
A Practice OAuth Token with Postman and Swift
Mocking Network Calls in Swift
hitTest(_:with:) vs point(inside:with)
Generics in Swift
How to Test Asynchronous Functions Using Expectation in Swift
downloadTask(with:completionHandler:) vs. dataTask(with:completionHandler:)
Test Driven Development (TDD) in Swift
Debug with the DEBUG preprocessor macro in Xcode
A SwiftMonkey Tutorial
If you’re using a base class in Swift, you’re doing it wrong
MVVM with RXSwift
Learning Dependency Injection using Swift
Injecting Services into Swift Apps for testing
MVVM: A Tutorial and Practical Example in Swift
Can you use Swift to replace a UIPageView with a UICollectionView?
A NSNotificationCenter implementation in Swift
An animated UIPageControl — from scratch in Swift
Your own subscript in Swift
The hidden workings of UITableView
Using NSNotificationCenter in Swift
Create your own backend while developing a Favourites Section
Handle TimeStamps
DispatchGroups to group API calls in Swift
THIS is how to store money and currency using Swift
Create a CurrencyField in SwiftUI (MINUS UIKit)
Using Type-Safe Identifiers in Swift
Create Instagram's Pinch to Zoom using Swift
Create a SwiftUI Tip Calculator
Create an Image Carousel Using Swift
iTerm
The MVP Architecture for iOS
Pass The Swift Code Review: Dictionary Edition
Play Video in a UICollectionView
Using SwiftUI Views with UIKit
The MVP iOS Architecture with Coordinators
Reuse a UITableViewCell as a UIView
Implement a Service-Oriented Architecture in Swift 5
SwiftUI Authentication
Implement Optional Protocol Methods in Swift
Idempotence
Pass Parameters in Tap Gestures
A Screaming Architecture for iOS Projects
Public Getters and Private Setters in Swift
Bézier Path and Curves Using Core Graphics
Why do we ever need to inherit from NSObject?
What Is The Difference Between The Liskov Substitution Principle and Dependency Inversion Principle?
Animate UIViewController Transitions with UIViewControllerAnimatedTransitioning
Snapshot Testing In Swift
Dynamically Change Fonts for your User (Dynamic type iOS)
Method Dispatch in Swift Protocols and Inheritance
What is a RunLoop Anyway? Swift and iOS Guide
Swift Swizzling
ERD Diagrams for Core Data in Your iOS App
Access Memory Directly in Swift
Fade the First and Last Elements in a UICollectionView
Dynamic Row Heights for a UITableView
Understanding Swift's Opaque Types
Wrap a Model View in a UINavigationController
Decoupling The Segue In Swift
Lookup UK Postcodes: Can We Use A UISearchBarDelegate?
Pinch to Zoom a UICollectionViewCell in a UICollectionView
Stop Using Swift Timers: Use CADisplayLink
Using UICollectionView and UICollectionViewDiffableDataSource
Adding Fields To A Backend Response. What Will Happen? Swift Edition.
Instruct Your View With A ViewModel: Should It Be A Class or a Struct?
Advanced Codable: Missing Fields In Arrays (Swift)

Challenging

TypeErasure
TwoWayBinding
Track My Movement: A RxSwift Project
Secure iOS Apps Through App Pinning
Create Flexible Components in Swift
Animate Swift's button labels
Function Currying (and Uncurrying) in Swift
Monad, Functor and Applicative Swift Functions
Make All Your Swift UIKit Views a UITableView
Custom UIViewController Animations - EASY iOS Guide

Core Data
The Core Data Stack: Persistent Store Types
Learning the Basics of Core Data
Core Data: Using Codable
NSPredicate with Core Data
Core Data Basics: Testing

Tips

What Is The Difference Between @escaping and @nonescaping Closures in Swift
Throw or Rethrow that Error?
How Implicit Return Types Removed that Annoying Swift Inconsistency
Code snippets
Playgrounds
Parse JSON without knowing the type
Get a Comma Separated List From An Array
That little Swift Bug: Protocol Customization Points
Shorthand Parameters in Swift

Theory

Kruskal's Algorithm
WWDC Notes: Keynote
WWDC Notes: Platforms
Semantic Versioning
SOLID principles
Writing FIRST Swift Tests
Union Find
Favor composition over inheritance — in Swift
Tries
LinkedLists
KVO vs NotificationCenter
The iOS App Development Process
Linked Lists and LL Algorithms in Swift

Design Patterns

The Mediator Design Pattern
The Single Responsibility Principle
The Factory Pattern
The Façade Design Pattern in Swift
The Adaptor Design Pattern
The Iterator Design Pattern in Swift
The Chain of Responsibility Pattern in Swift
The Decorator Design Pattern in Swift
The Builder Design Pattern In Swift

LeetCode

Leetcode Weekly Contest 194 Swift solutions
Leetcode Weekly Contest 195 Swift solutions
Leetcode Weekly Contest 197 Swift solutions
Leetcode Weekly Contest 216 Swift solutions
Leetcode Weekly Contest 217 Swift solutions
PrefixSum
Using an Array as a built in index for LeetCode problems
Swift: Using BFS for LeetCode problems
Swift: Using Depth-First Search for LeetCode Problems
Swift: DP (draft)
Swift: Playgrounds are Worthwhile for LeetCode
Two Sum / Three Sum (draft)
Avoid Playgrounds, for Swift LeetCode challenges
URLify Create A URL From A String in Swift

Get in touch

I'm usually around on Twitter

Feel free to sign up to my newsletter

About

A set of blog posts about Swift Coding


Languages

Language:Swift 98.7%Language:Makefile 0.8%Language:Ruby 0.5%Language:Objective-C 0.0%Language:Java 0.0%Language:Shell 0.0%Language:Python 0.0%