Skip to content

refactor: iOS best-practice audit — unified logging, iOS 15 baseline, API cleanup - #6

Merged
Dicky019 merged 1 commit into
mainfrom
refactor/ios-best-practice-audit
Jun 10, 2026
Merged

Dicky019 merged 1 commit into
mainfrom
refactor/ios-best-practice-audit

Conversation

@Dicky019

Copy link
Copy Markdown
Owner

Summary

Full iOS best-practice audit ahead of publishing. Behavior-preserving where possible; pre-1.0 breaking changes where they improve the API.

Logging

  • Replace all print() with unified logging (os.Logger) behind a call-style façade: Log(.category, message, level:).
  • LogCategory (core/debug/benchmark) → dedicated Console.app categories; LogLevel (debug/info/notice/warning/error/fault); .public privacy applied centrally.

Platform

  • Raise deployment baseline to iOS 15 / macOS 12 / tvOS 15 / watchOS 8; drop redundant @available(iOS 13…) in SwiftUI.
  • ScreenDimensions.current now derives from the active UIWindowScene instead of the soft-deprecated UIScreen.main.

API cleanup (breaking)

  • Remove dead splitScreenMode (config + ScreenUtilConfigurable).
  • Gate measurePerformance / benchmarkScalingOperations behind #if DEBUG.
  • Unify ScaledValue's nested ScaleType into the top-level ScaleType (.font → .text, .auto removed, default .width).

Correctness & ergonomics

  • Mark ScreenScalable / ScreenUtilConfigurable / ScreenDimensionProvider as Sendable.
  • Conform ScalingLimits, ScreenMetrics, ScreenDimensions, SafeAreaInsets, ScreenUtilConfiguration, ScaleType, DeviceType to Equatable/Hashable.

Docs

  • Add /// comments across the public API; update README deployment versions and CHANGELOG.

Verification

  • swift build / -c release clean
  • iOS 15 simulator cross-compile clean
  • swift test: 119 passing (+6 new EquatableConformanceTests)
  • ThreadSanitizer: 0 data races
  • Line coverage: 92.81% (CI gate ≥85%)

Out of scope

Examples/ (deferred to a later full refactor), watchOS WKInterfaceDevice metrics, SwiftLint, LICENSE reconciliation.

… API cleanup

- Replace all print() with os.Logger via an internal Log façade
  (subsystem com.screenutil; core/debug/benchmark categories)
- Raise deployment baseline to iOS 15 / macOS 12 / tvOS 15 / watchOS 8
  and drop now-redundant @available annotations in SwiftUI
- Remove dead splitScreenMode from the config and ScreenUtilConfigurable
- Gate measurePerformance / benchmarkScalingOperations behind #if DEBUG
- Mark ScreenScalable / ScreenUtilConfigurable / ScreenDimensionProvider Sendable
- Derive ScreenDimensions.current from the active UIWindowScene instead of
  the soft-deprecated UIScreen.main
- Conform ScalingLimits, ScreenMetrics, ScreenDimensions, SafeAreaInsets,
  ScreenUtilConfiguration, ScaleType, and DeviceType to Equatable/Hashable
- Unify ScaledValue's nested ScaleType into the top-level ScaleType
  (.font → .text, .auto removed, default .width)
- Add doc comments across the public API; update README and CHANGELOG
@Dicky019
Dicky019 merged commit e7d6fa2 into main Jun 10, 2026
4 checks passed
@Dicky019
Dicky019 deleted the refactor/ios-best-practice-audit branch June 10, 2026 02:28
Dicky019 added a commit that referenced this pull request Jun 21, 2026
refactor: iOS best-practice audit — unified logging, iOS 15 baseline, API cleanup
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant