swift

Has nothing to do with Objective C .

Swift

Swift Cheat Sheet: Common Syntax, Patterns, and Shortcuts

Just a bunch of short expressions in Swift.

  • swift
Xcode

iOS Auto Layout in Xcode: Position Views Relative to Each Other

Positioning views relative to one another with auto-layout was fairly tricky until...

iOS

Stack Views on iOS 8 with Auto Layout (Without UIStackView)

While starting iOS 9 we have UIStackView, it is a little bit tricky to stack views vertically or horizontally.

Swift

Using guard in Swift to Test for Empty Strings Safely

In Swift, we have a syntax candy called 'guard'..

Xcode

Debug Auto Layout Constraints with Xcode 7’s Debug View Hierarchy

A small button named 'Debug view hierarchy', displays current view hierarchy in 3D.

Swift

VIPER Architecture in Swift: How to Decouple iOS Modules

Decouple, separate, disengage, or dissociate (something) from something else.

Swift

Fix “was deallocated while key value observers were still registered” Crashes in Swift

Debugging errors that are a result of observers being added to an object and not removed from it can be hard.

Swift

Swift Error Handling: Catching Throwing Functions with a Helper Wrapper

Recently we had a need in a general way to catch calls that can throw an exception.

Xcode

Xcode 8 Core Data: Create NSManagedObject Subclasses in a Swift Project

In Xcode 8, it is no longer possible to create NSManagedObject subclasses...

Swift

Swift 3 Compiler Segmentation Fault 11: Generics and Nested Functions Workaround

The following code is causing a compiler crash when compiled with Swift 3 and Xcode 8...

Swift

Optimize UICollectionView and UITableView Updates with Batch Inserts in Swift

Collection view is highly optimized and works great out of the box.

ReactiveSwift

ReactiveSwift: The Key Difference Between Signal and SignalProducer

A property in ReactiveSwift allows us to track its changes over time.

Swift

ReactiveSwift Playground Setup: Fix “No Such Module ‘Result’” in Xcode

According to the documentation, to use ReactiveSwift.playground the following steps must be performed...

Swift

ReactiveSwift flatten Operator: latest, concat, and merge Explained

The power of ReactiveSwift lies within its operators!

Xcode

Fix UICollectionView “Terminating with Uncaught NSException” Crashes

ne of our views that contains a UICollectionView started crashing once in a while...

Swift

Fix Unwanted Top Padding in UICollectionView on iOS 10

On iOS 10, a collection view embedded in a view has unexpected padding at the top.

RxSwift

RxSwift.Resources: Fix “Use of Unresolved Identifier 'Resources'”

RxSwift.Resources are being used to detect memory leaks during pre release tests. Solving Use of unresolved identifier 'Resources' error.

Swift

UICollectionView Self-Sizing Cells: Dynamic UILabel Layout on iOS 10

All we needed was a simple UICollectionView with just one cell that contained a label ...

iOS

Fix Auto Layout "Unable to Satisfy Constraints" for Fixed-Height Views in Cells

We needed a collection view cell that contained an image view and a label.

RxSwift

RxSwift: How to Avoid Memory Leaks with DisposeBag and Resource Tracking

RxSwift is a powerful framework and, as always, with power comes responsibility.

Swift

Create a Swift Framework That Uses C Code in Xcode

How to create a framework that uses C with Xcode

Swift

UIScrollView with Auto Layout in Code: Step-by-Step Guide for iOS 12+

It is fairly easy to use UIScrollView with the AutoLayout on iOS 12+ but only if one follows the following steps ...

Swift

When to Use [weak self] in Swift Closures (and When You Don’t Need It)

It has become pretty common among Swift experts to always use [weak self] inside of a closure to avoid retain cycles ...

Swift

XCTestCase wait Helper: Wait for Conditions Without Manual Expectations

XCTest expectations are great but it is not easy to use them.

Swift

Dependency Injection in Swift: Why and How to Inject Dependencies

Why do we need to inject dependencies and some tools that help with it...

Subscribe to The infinite monkey theorem

We fling fresh posts—no banana peels attached—straight to your inbox.