Skip to content

Move off foregroundColor / cornerRadius / overlay(_:alignment:), which are deprecated in a future SDK #28

Open

Description

@romchornyi

Summary

With the iOS 18 / macOS 15 floor from #15, the library still uses SwiftUI APIs that Apple marks "deprecated in a future version". They don't produce warnings yet, but they will in a future SDK:

API Count in Sources/ Replacement
.foregroundColor(_:) ~90 .foregroundStyle(_:)
.cornerRadius(_:) 7 .clipShape(.rect(cornerRadius:)) (with style: .continuous wherever the design calls for it)
.overlay(_:alignment:) ~12 (DashButton, AddressFieldView, ConverterCard, ConverterArrowBadge, SimpleSelect, NavigationBarCircleIcon, the FrameReader preview, …) .overlay(alignment:content:)

#15 migrated only the code it rewrote, and the rest is deliberately left for a separate PR. It is a mechanical change, but it touches almost every component, so it needs its own visual check.

Notes

  • foregroundStyle on Text inside Text concatenation needs care: check the places that concatenate Text.
  • .cornerRadius draws a non-continuous corner. Keep that look, or switch deliberately to .continuous where the design uses it.
  • After the migration, swift build should have no deprecation warnings on the latest SDK.

Activity

  1. changed the title [-]Move off foregroundColor / cornerRadius, which are deprecated in a future SDK[/-] [+]Move off foregroundColor / cornerRadius / overlay(_:alignment:), which are deprecated in a future SDK[/+] on Oct 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions