Skip to content

3.0.0

Latest

Choose a tag to compare

@Rillieux Rillieux released this 12 Jun 19:10
321a66e

What's new

PhotoSelectAndCrop 3.0 replaces the deprecated UIImagePickerController (and the unused PHPickerViewController wrapper) with the system SwiftUI PhotosPicker, raises the minimum platform to iOS 17, and modernizes the codebase: @Observable models, UIGraphicsImageRenderer-based cropping, working bundled localization (English and French), force-unwrap crashes removed, an accessibility-friendly picker button, and a CI build on every push.

Requirements

  • iOS 17.0+
  • Swift 5.9+ / Xcode 15+ (Xcode 16 recommended)

Migrating from 2.x (or 1.x) to 3.0

  1. SystemUIImagePicker and SystemPHPicker are removed. The package now presents the system PhotosPicker internally; there is nothing to configure. If your app imported these wrapper types directly, adopt PhotosPicker from PhotosUI yourself.

  2. ImageAttributes is now @Observable (and @MainActor) instead of ObservableObject.

    • Replace @StateObject var attributes = ImageAttributes(...) with @State private var attributes = ImageAttributes(...).
    • Replace @ObservedObject var attributes: ImageAttributes with a plain var attributes: ImageAttributes.
    • objectWillChange and $attributes projected values no longer exist.
    • Construct ImageAttributes in a main-actor context (any SwiftUI View or App qualifies). If you build it inside a nonisolated model or CoreData mapping layer, hop to the main actor first.
  3. ImagePane now has a single initializer with defaulted renderingMode, colors, and linearGradient parameters. All of the previous call shapes still compile unchanged.

  4. The Color shims (Color.systemRed, Color.label, etc.) are deprecated. Use Color(uiColor: .systemRed) and friends instead; the shims will be removed in a future release.

  5. Localization now actually works. The package's bundled translations (English and French) resolve from the package's own resource bundle (Bundle.module). If your app previously worked around this by adding the package's string keys (such as "Use photo" or "Move and Scale") to its own Localizable.strings, those app-level entries are no longer consulted. Note that iOS only displays languages the host app declares: for the package's French strings to appear, your app must either include French in its own localizations (project ▸ Info ▸ Localizations) or set CFBundleAllowMixedLocalizations to YES in its Info.plist.