From nilcoalescing.com
Reading and setting color scheme in SwiftUI
0 0
While reading the current color scheme is quite easy in SwiftUI, setting a color scheme requires us to carefully consider what effect we are trying to achieve.
on Sep 18
From nilcoalescing.com
Sorting arrays in Swift using comparison operators as closures
0 1
Sorting arrays in Swift can be made more concise and readable by using comparison operators as closures in the sorted(by:) method.
on Aug 30
From nilcoalescing.com
Using @Observable in SwiftUI views
0 1
Discover how to use the @Observable macro in SwiftUI and its advantages over ObservableObject, such as more efficient view updates and simplified code management.
on Aug 23
From nilcoalescing.com
Dynamic dates with monospaced digits in SwiftUI
0 0
Display a self-updating date and time inside a SwiftUI Text view and prevent the UI from moving as the digits in the date change.
on Aug 16
From nilcoalescing.com
0 1
This post explains how to use recursive enums in Swift, including the indirect keyword, to effectively model and manage complex, hierarchical data structures.
on Aug 15
From nilcoalescing.com
Set custom actions for links in Text views
0 1
Customize actions for links inside Text views in SwiftUI by using openURL environment value.
on Aug 14
From nilcoalescing.com
Delay an async Task in Swift using the new clock APIs
0 1
Make use of the new clock APIs in Swift 5.7 to delay an async task by a certain duration without calling the old method that accepts nanoseconds.
on Aug 11
From nilcoalescing.com
Customizing the appearance of symbol images in SwiftUI
0 0
Learn how to adjust size, color, rendering modes, variable values, and design variants of SF Symbols in SwiftUI apps.
on Aug 9
From nilcoalescing.com
Rendering quadratic Bézier curves with Metal
0 0
A simple method for rendering quadratic Bézier curves on the GPU in Metal without pre-processing geometry.
on Aug 5
From nilcoalescing.com
Count the number of objects that pass a test in Swift using count(where:)
0 0
Efficiently count the number of elements in a sequence that satisfy the given condition with the new count(where:) method introduced in Swift 6.
on Aug 2
From nilcoalescing.com
Label loop statements to control execution of nested loops | Swift Gems
0 0
100+ tips to take your Swift code to the next level.
on Jul 24
From nilcoalescing.com
Detect focused window on macOS
0 0
Make use of ControlActiveState value in the environment to customize the appearance of key window on macOS in SwiftUI.
on Jun 30
From nilcoalescing.com
Wrapping text within another view in SwiftUI
0 0
Using the overlay() modifier in SwiftUI, we can elegantly wrap text within another view, ensuring the text is positioned and sized relative to the primary content.
on Jun 28
From nilcoalescing.com
Using Measurements from Foundation for values in Swift Charts
0 0
Build a bar chart using data with values of type Measurement<UnitDuration> that doesn't conform to Plottable by default.
on Jun 26
From nilcoalescing.com
Area chart with a dimming layer up to the current point in time
0 0
Create a chart with the Swift Charts framework to show UV index throughout the day inspired by the iOS Weather app that dims the area up to the current time.
on Jun 26
From nilcoalescing.com
Fill bar marks with gradient in Swift Charts
0 0
Add a gradient to a bar chart that stretches from top to bottom of the plot area rather than filling each individual mark.
on Jun 26
From nilcoalescing.com
Defining custom scenes in SwiftUI
0 0
SwiftUI custom scenes enable the creation of modular, maintainable code, allowing for precise management of complex user interfaces and behavior across different platforms.
on Jun 26
From nilcoalescing.com
Responding to keyboard modifiers on macOS in SwiftUI
0 0
Take advantage of the new macOS 15 API to update SwiftUI views when modified keys are pressed.
on Jun 25
From nilcoalescing.com
Enhanced replace transition for SF Symbols in iOS 18
0 0
Leverage the new magic replace symbol effect in iOS 18 for smooth transitions of slashes and badges in SF Symbols.
on Jun 25
From nilcoalescing.com
Present a form sheet in SwiftUI
0 0
Starting from iPadOS 18, SwiftUI now allows us to present a form sheet, similar to UIModalPresentationStyle.formSheet.
on Jun 24
From nilcoalescing.com
Creating gradient on polylines in SwiftUI MapKit
0 0
Learn how to use MapKit and SwiftUI to apply a gradient that follows a polyline, enhancing the visual appeal of your maps.
on Jun 6
From nilcoalescing.com
Compare arrays based on custom criteria
0 0
When we need to compare arrays based on custom criteria in Swift, we can use elementsEqual(_:by:) method. It allows us to define custom comparison logic with a closure, offering more flexibility than using == operator.
on Jun 3
From nilcoalescing.com
Scenes types in a SwiftUI Mac app
0 0
Discover how to leverage SwiftUI's versatile scene types, like WindowGroup, DocumentGroup, Settings, Window, and MenuBarExtra, to create efficient and dynamic macOS applications.
on May 28
From nilcoalescing.com
Auto-convert JSON snake case to Swift camel case properties
0 0
Use convertFromSnakeCase in JSONDecoder to automatically map JSON snake case keys to Swift camel case properties, simplifying model definitions and ensuring naming consistency.
on May 20
From nilcoalescing.com
Starting and growing your own technical blog
0 0
I recently gave a talk at Code Camp Wellington on how starting a technical blog can transform your career development. Since it wasn't recorded, I've summarized my insights in this post to inspire others to share their technical knowledge online.
on May 18
From nilcoalescing.com
React to network status updates in SwiftUI using AsyncSequence
0 0
Learn how to wrap NWPathMonitor into an async sequence for real-time network status updates in your SwiftUI views.
on May 16
From nilcoalescing.com
Streamline multi-criteria data sorting and organization with tuples
0 1
Swift's tuples are a convenient way to group multiple values, and their true utility shines with the language's built-in ability to compare tuples.
on May 15
From nilcoalescing.com
Sending trial notifications with provisional authorization on iOS
0 0
By taking advantage of provisional authorization for notifications, we can provide a gentle introduction to our app's notifications without upfront permission from the user.
on Mar 19
From nilcoalescing.com
User-friendly descriptions and recovery suggestions for custom errors in Swift
0 0
Guide users through resolving issues and make your Swift applications more intuitive and supportive by defining user-friendly descriptions and recovery suggestions for custom errors.
on Feb 18
From nilcoalescing.com
Double column navigation in a SwiftUI document app
0 0
Change the style of navigation view in document based apps, by hiding the default view and adding our own.
on Feb 6
From nilcoalescing.com
Use cases for self, Self and Self.self in Swift
0 0
Explore the practical applications and distinctions of self, Self, and Self.self in Swift, clarifying their roles in instance referencing, protocol conformance, and metatype access.
on Jan 28
From nilcoalescing.com
Case insensitive string comparison in Swift
0 0
Discover how string comparison methods from Foundation outperform basic case conversion, ensuring precise, efficient, and culturally aware comparisons in our applications.
on Jan 23
From nilcoalescing.com
Pattern matching for custom types in Swift
0 0
Define custom logic for matching different types of data in switch cases by overloading the Swift pattern matching operator (~=).
on Dec 22
From nilcoalescing.com
Trigger property observers from initializers in Swift
0 1
Property observers like willSet and didSet aren't triggered during initialization in Swift, but if we need to execute logic from property observers at this stage, we can use some workarounds.
on Dec 17
From nilcoalescing.com
Create an AsyncStream from withObservationTracking() function
0 0
Learn how to wrap withObservationTracking() into an AsyncStream to iterate over changes with an async for loop.
on Nov 25
From nilcoalescing.com
Using Observation framework outside of SwiftUI
0 0
Monitor changes to specific properties of an observable class using withObservationTracking() function from Observation framework in iOS 17.
on Nov 22
From nilcoalescing.com
Add placeholder text to SwiftUI TextEditor
0 0
Remove the default TextEditor background on iOS and add a placeholder that is not currently supported in TextEditor out of the box.
on Nov 18
From nilcoalescing.com
Hierarchical background styles in SwiftUI
0 0
Use the new instance properties of the ShapeStyle in iOS 17 to access hierarchical system background styles, such as secondary and tertiary background.
on Nov 5
From nilcoalescing.com
0 0
Take advantage of the new improvements in the debug console in Xcode and learn how to filter logs by type, category or message, show and hide similar items and view log metadata.
on Oct 23