ios

iOS development topics.

iOS

iOS 8 Push Notifications: Fix registerForRemoteNotificationTypes Deprecation

Push notifications on iOS 8.

  • ios
iOS

Support Native iPhone 6 and 6 Plus Resolutions with Launch XIBs in iOS 8

By default all the apps (even compiled with Xcode 6 and iOS 8) will run in a scaled mode on both iPhone 6 & iPhone 6 plus.

iOS

Xcode: Set iOS App Display Name per Build Configuration

Having a different application name for release and development builds.

iOS

Fix fileExistsAtPath Always Returning NO in iOS 8 Cache Directories

Generating the path dynamically with NSSearchPathForDirectoriesInDomains.

iOS

NSURL URLWithString vs fileURLWithPath: Loading Local Files Correctly in iOS

A frequent mistake when playing a local video using [AVAudioPlayer initWithContentsOfURL:url] is to use URLWithString instead of fileURLWithPath.

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.

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.

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...

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.

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.

iOS

Symbolication in iOS Apps: Use dSYM and DWARF to Decode Crash Logs

Symbolification is the process of mapping machine addresses into the source code. The tricky part is that by default .DSYM file is only generated for release builds.

Swift

Create a Swift Framework That Uses C Code in Xcode

How to create a framework that uses C with Xcode

SwiftUI

Learn SwiftUI by Building a Recipe Book App for iOS & macOS

A step-by-step guide to building a modern SwiftUI Recipe Book app for iOS and macOS.

SwiftUI

SwiftUI Alerts: Fixing Bugs When Multiple Alerts Collide

SwiftUI silently ignored save error alerts once a second alert existed, and this post captures what we learned in the Advanced SwiftUI: Lessons From Mistakes series.

SwiftUI

SwiftUI @Published Crash: “Pointer Being Freed Was Not Allocated” Explained

During test teardown we hit a repeatable 'pointer being freed was not allocated' crash while deallocating a @MainActor ObservableObject, and this post explains why we treated it as a Swift runtime edge case instead of rewriting our architecture.

SwiftUI

SwiftUI @MainActor Initializers: Safe Default Parameters and Actor Isolation

After enabling stricter Swift concurrency checks, we started seeing main-actor isolation errors from @MainActor initializers that used default parameter values. This post explains why default parameter expressions are nonisolated and how to fix the pattern by moving defaults into the initializer body.

SwiftUI

DependencyContainer Malloc Crash in Tests – Post-Mortem

Under XCTest teardown we hit a repeatable 'pointer being freed was not allocated' malloc crash when deallocating async/Combine-heavy DependencyContainer and view models. This post explains what was happening and why we fixed it by deliberately leaking those objects in DEBUG tests only.

Subscribe to The infinite monkey theorem

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