Skip to content

Commit

Permalink
[ios_platform_images] Add Swift Package Manager support (#6684)
Browse files Browse the repository at this point in the history
Adds Swift Package Manager support to `ios_platform_images`.

This does not migrate the example app's Xcode project; the example app's Xcode project is migrated whenever you run it using the Flutter tool with the Swift Package Manager feature enabled.

Fixes flutter/flutter#146909
  • Loading branch information
loic-sharma authored May 8, 2024
1 parent 8de142d commit 0167b51
Show file tree
Hide file tree
Showing 11 changed files with 36 additions and 5 deletions.
3 changes: 2 additions & 1 deletion packages/ios_platform_images/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
## NEXT
## 0.2.4

* Updates minimum iOS version to 12.0 and minimum Flutter version to 3.16.6.
* Adds Swift Package Manager compatibility.

## 0.2.3+2

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import Flutter
import UIKit

@UIApplicationMain
@main
@objc class AppDelegate: FlutterAppDelegate {
override func application(
_ application: UIApplication,
Expand Down
Empty file.
3 changes: 2 additions & 1 deletion packages/ios_platform_images/ios/ios_platform_images.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ Downloaded by pub (not CocoaPods).
s.source = { :http => 'https://github.com/flutter/packages/tree/main/packages/ios_platform_images' }
s.documentation_url = 'https://pub.dev/packages/ios_platform_images'
s.source_files = 'Classes/**/*.swift'
s.source_files = 'ios_platform_images/Sources/ios_platform_images/**/*.swift'
s.dependency 'Flutter'
s.platform = :ios, '12.0'

Expand All @@ -25,5 +26,5 @@ Downloaded by pub (not CocoaPods).
'LD_RUNPATH_SEARCH_PATHS' => '/usr/lib/swift',
}
s.swift_version = '5.0'
s.resource_bundles = {'ios_platform_images_privacy' => ['Resources/PrivacyInfo.xcprivacy']}
s.resource_bundles = {'ios_platform_images_privacy' => ['ios_platform_images/Sources/ios_platform_images/Resources/PrivacyInfo.xcprivacy']}
end
28 changes: 28 additions & 0 deletions packages/ios_platform_images/ios/ios_platform_images/Package.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
// swift-tools-version: 5.9
// The swift-tools-version declares the minimum version of Swift required to build this package.

// Copyright 2013 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

import PackageDescription

let package = Package(
name: "ios_platform_images",
platforms: [
.iOS("12.0")
],
products: [
.library(name: "ios-platform-images", targets: ["ios_platform_images"])
],
dependencies: [],
targets: [
.target(
name: "ios_platform_images",
dependencies: [],
resources: [
.process("Resources")
]
)
]
)
3 changes: 2 additions & 1 deletion packages/ios_platform_images/pigeons/messages.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ import 'package:pigeon/pigeon.dart';

@ConfigurePigeon(PigeonOptions(
dartOut: 'lib/src/messages.g.dart',
swiftOut: 'ios/Classes/messages.g.swift',
swiftOut:
'ios/ios_platform_images/Sources/ios_platform_messages/messages.g.swift',
copyrightHeader: 'pigeons/copyright.txt',
))

Expand Down
2 changes: 1 addition & 1 deletion packages/ios_platform_images/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: ios_platform_images
description: A plugin to share images between Flutter and iOS in add-to-app setups.
repository: https://github.com/flutter/packages/tree/main/packages/ios_platform_images
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+ios_platform_images%22
version: 0.2.3+2
version: 0.2.4

environment:
sdk: ^3.2.3
Expand Down

0 comments on commit 0167b51

Please sign in to comment.