Skip to content

Commit 0a559a3

Browse files
authored
Merge pull request #128 from fulldecent/copilot/fix-74bf683b-a07f-43a0-adb2-f54d8a81f5d5
Remove CocoaPods and Carthage support, modernize to Swift Package Manager only
2 parents 53a6e19 + dc6f88f commit 0a559a3

File tree

14 files changed

+57
-216
lines changed

14 files changed

+57
-216
lines changed

.github/workflows/ci.yml

Lines changed: 15 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -12,24 +12,24 @@ env:
1212

1313
jobs:
1414
test:
15-
name: Test on iOS
15+
name: Test on iOS
1616
runs-on: macos-latest
17-
17+
1818
strategy:
1919
matrix:
2020
destination:
21-
- "OS=18.0,name=iPhone 15"
22-
- "OS=17.4,name=iPhone 14"
23-
- "OS=16.4,name=iPhone 12"
24-
21+
- "OS=18.5,name=iPhone 16 Pro"
22+
- "OS=18.5,name=iPhone 16"
23+
- "OS=18.5,name=iPhone SE (3rd generation)"
24+
2525
steps:
2626
- name: Checkout
2727
uses: actions/checkout@v4
2828

2929
- name: Setup Xcode
3030
uses: maxim-lobanov/setup-xcode@v1
3131
with:
32-
xcode-version: '16.4'
32+
xcode-version: '16.0'
3333

3434
- name: Install xcpretty
3535
run: gem install xcpretty
@@ -40,57 +40,18 @@ jobs:
4040
- name: Show available simulators
4141
run: xcrun simctl list devices available
4242

43-
- name: Build and Test Framework (Debug)
43+
- name: Build Swift Package for iOS
4444
run: |
4545
set -o pipefail
46-
xcodebuild -workspace "iOS Example/iOS Example.xcworkspace" \
47-
-scheme "FDTake" \
48-
-destination "${{ matrix.destination }}" \
49-
-configuration Debug \
50-
ONLY_ACTIVE_ARCH=NO \
51-
ENABLE_TESTABILITY=YES \
52-
test | xcpretty
53-
54-
- name: Build and Test Framework (Release)
55-
run: |
56-
set -o pipefail
57-
xcodebuild -workspace "iOS Example/iOS Example.xcworkspace" \
58-
-scheme "FDTake" \
59-
-destination "${{ matrix.destination }}" \
60-
-configuration Release \
61-
ONLY_ACTIVE_ARCH=NO \
62-
ENABLE_TESTABILITY=YES \
63-
test | xcpretty
46+
xcodebuild build \
47+
-scheme FDTake \
48+
-destination "${{ matrix.destination }}" | xcpretty
6449
65-
- name: Build Example App
50+
- name: Test iOS Example App
6651
run: |
6752
set -o pipefail
68-
xcodebuild -workspace "iOS Example/iOS Example.xcworkspace" \
53+
xcodebuild build \
54+
-project "iOS Example/iOS Example.xcodeproj" \
6955
-scheme "iOS Example" \
70-
-destination "${{ matrix.destination }}" \
71-
-configuration Debug \
72-
ONLY_ACTIVE_ARCH=NO \
73-
build | xcpretty
56+
-destination "${{ matrix.destination }}" | xcpretty
7457
75-
cocoapods:
76-
name: CocoaPods Validation
77-
runs-on: macos-latest
78-
79-
steps:
80-
- name: Checkout
81-
uses: actions/checkout@v4
82-
83-
- name: Setup Ruby
84-
uses: ruby/setup-ruby@v1
85-
with:
86-
ruby-version: '3.0'
87-
bundler-cache: true
88-
89-
- name: Install CocoaPods
90-
run: gem install cocoapods
91-
92-
- name: Lint Podspec
93-
run: pod lib lint --allow-warnings
94-
95-
- name: Check CocoaPods Quality
96-
run: ruby Tests/CheckCocoaPodsQualityIndexes.rb FDTake

.gitignore

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -41,21 +41,6 @@ playground.xcworkspace
4141
.build/
4242
.swiftpm
4343

44-
# CocoaPods
45-
#
46-
# We recommend against adding the Pods directory to your .gitignore. However
47-
# you should judge for yourself, the pros and cons are mentioned at:
48-
# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
49-
#
50-
# Pods/
51-
52-
# Carthage
53-
#
54-
# Add this line if you want to avoid checking in source code from Carthage dependencies.
55-
# Carthage/Checkouts
56-
57-
Carthage/Build
58-
5944
# fastlane
6045
#
6146
# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ All notable changes to this project will be documented in this file.
1313
- Updated build environment from Xcode 11.2 to Xcode 15.4
1414
- Updated iOS testing targets from iOS 13.2.2 to iOS 17.5, 16.4, and 14.5
1515
- Updated Swift Package Manager tools version from 5.1 to 5.7
16+
- **BREAKING:** Removed CocoaPods and Carthage support - use Swift Package Manager instead
17+
- **BREAKING:** Removed Xcode workspace - use the project file directly
18+
- Fixed MobileCoreServices import issue by migrating to UniformTypeIdentifiers framework
19+
- Updated CI to use Xcode project instead of workspace
1620

1721
#### KNOWN ISSUES
1822

CONTRIBUTING.md

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,11 @@ When you commit a change, please add a note to [CHANGELOG.md](CHANGELOG.md).
99
## Release Process
1010

1111
1. Confirm the build is [passing in GitHub Actions](https://github.com/fulldecent/FDTake/actions)
12-
1. This automatically checks that the Podfile is building
1312
2. Push a release commit
1413
1. Create a new Master section at the top
1514
2. Rename the old Master section like:
1615
## [1.0.5](https://github.com/fulldecent/FDTake/releases/tag/1.0.5)
1716
Released on 2016-02-14.
18-
3. Update the Podspec version number
1917
3. Create a GitHub release
2018
1. Tag the release (like `1.0.5`)
2119
2. Paste notes from [CHANGELOG.md](CHANGELOG.md)
22-
3. Push the Podspec to CocoaPods
23-
1. `pod trunk push`
24-
4. Create Carthage binaries
25-
1. `carthage build --no-skip-current`
26-
2. `carthage archive FDTake`
27-
3. Add to the GitHub release

FDTake.podspec

Lines changed: 0 additions & 23 deletions
This file was deleted.

Package.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import PackageDescription
44

55
let package = Package(
66
name: "FDTake",
7-
platforms: [.iOS(.v12)],
7+
platforms: [.iOS(.v15)],
88
products: [
99
.library(
1010
name: "FDTake",

README.md

Lines changed: 3 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
# FDTake
22

33
[![CI Status](https://github.com/fulldecent/FDTake/workflows/CI/badge.svg)](https://github.com/fulldecent/FDTake/actions)
4-
[![Version](https://img.shields.io/cocoapods/v/FDTake.svg?style=flat)](http://cocoapods.org/pods/FDTake)
5-
[![License](https://img.shields.io/cocoapods/l/FDTake.svg?style=flat)](http://cocoapods.org/pods/FDTake)
6-
[![Platform](https://img.shields.io/cocoapods/p/FDTake.svg?style=flat)](http://cocoapods.org/pods/FDTake)
74
[![Readme Score](http://readme-score-api.herokuapp.com/score.svg?url=fulldecent/FDTake)](http://clayallsopp.github.io/readme-score?url=fulldecent/FDTake)
85

96
Easily take a photo or video or choose from library
@@ -12,7 +9,7 @@ Easily take a photo or video or choose from library
129

1310
## Usage
1411

15-
To run the example project, clone the repo, and run `pod install` from the Example directory first.
12+
To run the example project, clone the repo and open `iOS Example/iOS Example.xcodeproj`.
1613

1714
To use it in your project, add an `FDTakeController` to your view controller and implement:
1815

@@ -112,9 +109,6 @@ open func present()
112109
open func dismiss()
113110
```
114111

115-
Other available options are documented at <a href="http://cocoadocs.org/docsets/FDTake/">CocoaDocs for FDTake</a>.
116-
117-
118112
## How it works
119113

120114
1. See if device has camera
@@ -159,22 +153,7 @@ Other available options are documented at <a href="http://cocoadocs.org/docsets/
159153

160154
## Installation
161155

162-
Add this to your project using Swift Package Manager. In Xcode that is simply: File > Swift Packages > Add Package Dependency... and you're done. Alternative installation options are shown below for legacy projects.
163-
164-
### CocoaPods
165-
166-
If you are already using [CocoaPods](http://cocoapods.org), just add 'FDTake' to your `Podfile` then run `pod install`.
167-
168-
### Carthage
169-
170-
If you are already using [Carthage](https://github.com/Carthage/Carthage), just add to your `Cartfile`:
171-
172-
```ogdl
173-
github "fulldecent/FDTake"
174-
```
175-
176-
Then run `carthage update` to build the framework and drag the built `FDTake`.framework into your Xcode project.
177-
156+
Add this to your project using Swift Package Manager. In Xcode that is simply: File > Swift Packages > Add Package Dependency... and you're done.
178157

179158
## Author
180159

@@ -184,7 +163,7 @@ William Entriken, github.com@phor.net
184163

185164
This is a mature project and we do not expect to add new features unless something has already become state-of-the-art in other applications. Please be prepared to cite screenshots of other apps before making a feature request.
186165

187-
We support targets for the latest released versions of Xcode, Carthage, CocoaPods and Swift Package Manager. If there are incompatabilities, for example CocoaPods not supporting the latest version of Xcode, then we will only support the latest released versions/combinations that are supported. If you would like to support pre-release versions of these packages, please open a pull request, not an issue.
166+
We support targets for the latest released versions of Xcode and Swift Package Manager. If there are incompatibilities, we will only support the latest released versions/combinations that are supported. If you would like to support pre-release versions of these packages, please open a pull request, not an issue.
188167

189168
## License
190169

Sources/FDTake/FDTakeController.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
//
77

88
import Foundation
9-
import MobileCoreServices
109
import UIKit
1110
import Photos
11+
import UniformTypeIdentifiers
1212

1313
/// A class for selecting and taking photos
1414
open class FDTakeController: NSObject {
@@ -237,10 +237,10 @@ open class FDTakeController: NSObject {
237237
self.imagePicker.allowsEditing = self.allowsEditing
238238
var mediaTypes = [String]()
239239
if self.allowsPhoto {
240-
mediaTypes.append(String(kUTTypeImage))
240+
mediaTypes.append(UTType.image.identifier)
241241
}
242242
if self.allowsVideo {
243-
mediaTypes.append(String(kUTTypeMovie))
243+
mediaTypes.append(UTType.movie.identifier)
244244
}
245245
self.imagePicker.mediaTypes = mediaTypes
246246

@@ -300,8 +300,8 @@ extension FDTakeController : UIImagePickerControllerDelegate, UINavigationContro
300300
didFinishPickingMediaWithInfo info: [UIImagePickerController.InfoKey : Any]
301301
) {
302302
UIApplication.shared.isStatusBarHidden = true
303-
switch info[.mediaType] as! CFString {
304-
case kUTTypeImage:
303+
switch info[.mediaType] as! String {
304+
case UTType.image.identifier:
305305
let imageToSave: UIImage
306306
if let editedImage = info[.editedImage] as? UIImage {
307307
imageToSave = editedImage
@@ -315,7 +315,7 @@ extension FDTakeController : UIImagePickerControllerDelegate, UINavigationContro
315315
if UI_USER_INTERFACE_IDIOM() == .pad {
316316
self.imagePicker.dismiss(animated: true)
317317
}
318-
case kUTTypeMovie:
318+
case UTType.movie.identifier:
319319
self.didGetVideo?(info[.mediaURL] as! URL, info)
320320
default:
321321
break

Tests/CheckCocoaPodsQualityIndexes.rb

Lines changed: 0 additions & 61 deletions
This file was deleted.

0 commit comments

Comments
 (0)