pylapp

iOS

What's new SwiftUI?

πŸ‡ΊπŸ‡Έ – Monday, May 12th 2025

Keywords: #Swift, #SwiftUI, #iOS, #iOSDev, #Apple

Here are some summaries of main news about SwiftUI, just to keep them in mind and list (more detailed) sources. A lof of this content is written thanks to the awesome work of Hacking with Swift. If you consider supporting this publication, prefer supporting them instead.

iOS 18 / Xcode 16.0 (2025)

View on main actor, thus not needed anymore to add @MainActor on views protocols properties.

PresentationSizing protocol helps to create our own sizes for views.

onGeometryChange() modifier lets us track when a view's frame, size or safe area insets change, and also onScrollGeometryChange() for ScrollView.

TabView has now dedicated Tab children, but it could bring failures for old code on iPadOS.

Accessiblity label and hint have modifiers to define them as views.

Tab bar can be floating

Sources

iOS 17 (2023) / Xcode 15.0

Scroll view has been improved.

Drawing and animations have been improved, and SF Symbols can be animated easily.

In-app purchases can be displayed easily and in simple fashion with SwiftUI thanks to dedicated views ready to be used.

sensoryFeedback() is available for haptics.

ContentUnavailableView is here to tell the user that no content is available.

Sources

iOS 16 / Xcode 14.0 (2022)

Bottom sheet presentation has been improved with presentationDetents() view modifier.

Tap location on view is easier to get.

ShareLink view makes it easy to share any kind of data from the app as long as it conforms to the Transferable protocol.

requestReview (StoreKit) allows users to rate the app.

PasteButton can be used to let the user paste data into the app if Transferable.

Sources

iOS 15 / Xcode 13.0 (2021)

refreshable() brings pull-to-refresh behaviour for lists!

searchable() brings search bar to filter data!

swipeActions() for list row are a reality!

AsyncImage view can load remote image from a URL!

Toolbar can be added to the keyboard.

task() let run asynchronous task when a view is shown.

Sources

And about iOS 14 and iOS 13

Don't.

β€” Last update: Monday, May, 12th 2025 β€”

Did you enjoy reading this blog? Give me a beer 🍺 or use something else ❀️‍πŸ”₯ Licensed under CC-BY-SA 4.0. Opinions are my own. To contact me, feel free to choose the most suitable medium for you, or for example Mastodon.

What's new Swift?

πŸ‡ΊπŸ‡Έ – Monday, May 12th 2025

Keywords: #Swift, #Swiftlang, #iOS, #iOSDev, #Apple

Here are some summaries of main news about Swift, just to keep them in mind and list (more detailed) sources. A lof of this content is written thanks to the awesome work of Hacking with Swift. If you consider supporting this publication, prefer supporting them instead.

Swift 6.1 (2025)

Concurrency has been updated. Now the nonisolated keyword, used to indicate that an API is safe to call from any concurrent context, can be used for types and extensions ; it prevents for example to add the keyword for every properties or methods in extensions.

Trailing comas can be added at the end of tuples, argument lists and string interpolations for example ; not only in collection literals.

Package traits can now be defined inside Package.swift definitions so as to define configurations for specific environments like WASM.

Swift Testing has been improved with custom traits to perform logic before or after tests (e.g. for set-up and tear-down actions). Test scopes can be customized, for example for mocks usages. #expect(throws:) and #require(throws:) have been improved also.

Swift-DocC provides better management of references of methods with same signatures.

Sources

Swift 6 (2024)

Concurrency comes! Now, if enabled, we can use the power of concurrency and its new API to ensure the source code is thread-safe with improved memory safety and no more data races.

Typed throws are now available. Methods in their signatures can define which types of errors are thrown, and it brings better clarity and consistancy.

Ownership provided with Swift 5.9 has a bit been improved and can be applied to generics.

C++ interoperability has been improved with support of move-only types, virtual methods, default arguments and also more standard library type.

Embedded Swift is included as preview with Swift 6 ; this toolchain supports ARM and RISC-V.

128-bit integers are now managed in their signed and unsigned variants.

@DebugDescription is now available for custom LLDB summaries ; this new macro let specify LLDB type summaries for our own types in the code to ease debugging.

Foundation has been refactored with some API converted to Swift like JSONDecoder, URL, Calendar, FileManager, ProcessInfo, FormatStyle, ParseStrategy, Predicate, JSON5.

Swift Testing exists! Expressive API, more simple to use compared to XCTest, scales large codebases with features like parameterization.

Sources

Swift 5.9 (2023)

Macros can be used to reduce repetitive boilerplate and work just like built-in language features. They are based on SwiftSyntax.

Parameter packs with generics syntax allow to define one method signature with an undefined list of parameters, without upper limits, even for returned values.

Ownership is featured. The new consume operator tells Swift to deinitialize a variable and transfer its contents without copying it. The borrow operator comes too, and structs and enums can be defined as noncopyable. The discard keyword is also here for consuming methods of elements having a deinit to bypass.

Syntax has been improved with the if and switch more modernized in their available syntaxes.

Sources

Swift 5.8 (2023)

It prepares for the Swift 6 big changes and its upcoming features. Developer experience has been improved.

@backDeployed is available and makes possible to allow new API to be used in older versions of frameworks by writing code for a function into app's binary then performing a runtime check.

implicit self for weak self captures is a reality and makes for example guard let else syntax smoother.

It is also possible to have functions with generic parameter which can be optional on the parameter definition.

Collection downcasts in cast patterns are supported and can be useful for example with switch case let as pattern.

Resources

Swift 5.7 (2022)

if let for unwrapping optionals is now shorter.

Regex has been enriched a lot with DSL for example.

Opaque parameter declarations and result types can be managed with the use of some keyword in parameter declarations.

Sources

Swift 5.6 (2022)

any keyword is available to mark existential types, which is different than opaque types with some keyword. The any keyword is here to bring optimization when objects are used through their abstract types making the runtime use the dynamic dispatch process for optimization. Thus this process won't be used.

Type placeholder with _ symbol can be called to let the compiler define types of variables (in, for example, declarations).

Concurrency has been enriched to prepare Swift 6 with the @preconcurrency macro and other improvements with @Sendable and @MainActor.

Sources

Swift 5.5 (2021)

async/await and async/throws are now real! Here come asynchronous functions, allowing to run complex asynchronous code without for example needing to use in some cases Combine. Task is also shipped.

AsyncSequence come with async/await also.

Actors are also embedded, i.e. kind of classes that are safe to use in concurrent environments with their content accessible by a single thread at any given time.

Sendable are here to define if data can safely be transferred to another thread.

lazy has been improved to be used in local contexts and write stored properties only calculated when first used.

Sources

β€” Last update: Monday, May, 12th 2025 β€”

Did you enjoy reading this blog? Give me a beer 🍺 or use something else ❀️‍πŸ”₯ Licensed under CC-BY-SA 4.0. Opinions are my own. To contact me, feel free to choose the most suitable medium for you, or for example Mastodon.