Skip to content

Commit

Permalink
Adding support for Swift Package Manager.
Browse files Browse the repository at this point in the history
  • Loading branch information
rnine committed Oct 13, 2020
1 parent b09131d commit 8412ee3
Show file tree
Hide file tree
Showing 223 changed files with 859 additions and 1,242 deletions.
10 changes: 6 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ DerivedData
*.perspectivev3
!default.perspectivev3
xcuserdata
.swiftpm/xcode

## Other
*.xccheckout
Expand All @@ -32,8 +33,8 @@ compile_commands.json
# Swift Package Manager
#
# Add this line if you want to avoid checking in source code from Swift Package Manager dependencies.
Packages/
.build/
/.build
/Packages

# CocoaPods
#
Expand Down Expand Up @@ -61,7 +62,8 @@ Carthage/
fastlane/report.xml
fastlane/screenshots

*.DS_Store
.DS_Store

# Jazzy Docs
docs/
docs/

2 changes: 1 addition & 1 deletion .jazzy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ readme: README.md
skip_undocumented: false
hide_documentation_coverage: false

xcodebuild_arguments: [-project, Filestack.xcodeproj, -target, Filestack]
swift_build_tool: spm
2 changes: 1 addition & 1 deletion .swiftformat
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
# rules

--enable isEmpty
--enable specifiers
--enable modifierOrder
--enable spaceInsideComments
--enable linebreakAtEndOfFile
--enable typeSugar
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
Change Log
==========

Version 2.4.0 (TBD)
----------------------------

- Added support for Unsplash cloud source.
- Added support for Swift Package Manager.

Version 2.3.2 (2020-07-30)
----------------------------

Expand Down
3 changes: 0 additions & 3 deletions Cartfile

This file was deleted.

3 changes: 0 additions & 3 deletions Cartfile.resolved

This file was deleted.

404 changes: 15 additions & 389 deletions Demo/FilestackDemo.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1020"
LastUpgradeVersion = "1200"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
4 changes: 2 additions & 2 deletions Filestack.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ Pod::Spec.new do |spec|
spec.resources = ["Filestack/UI/Storyboards/*.storyboard", "Filestack/Resources/*.xcassets"]

spec.dependency 'Alamofire', '~> 4.9'
spec.dependency 'FilestackSDK', '~> 2.3'
spec.dependency 'SSZipArchive', '2.2.3'
spec.dependency 'FilestackSDK', '~> 2.4'
spec.dependency 'Zip', '2.1'
end
1,426 changes: 662 additions & 764 deletions Filestack.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

12 changes: 1 addition & 11 deletions Filestack.xcodeproj/xcshareddata/xcschemes/Filestack.xcscheme
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1020"
LastUpgradeVersion = "1200"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down Expand Up @@ -37,16 +37,6 @@
</BuildableReference>
</MacroExpansion>
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "457085071F975C6C00991340"
BuildableName = "FilestackTests.xctest"
BlueprintName = "FilestackTests"
ReferencedContainer = "container:Filestack.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
</TestAction>
<LaunchAction
Expand Down
43 changes: 43 additions & 0 deletions Filestack.xcworkspace/xcshareddata/swiftpm/Package.resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{
"object": {
"pins": [
{
"package": "Alamofire",
"repositoryURL": "https://github.com/Alamofire/Alamofire.git",
"state": {
"branch": null,
"revision": "747c8db8d57b68d5e35275f10c92d55f982adbd4",
"version": "4.9.1"
}
},
{
"package": "FilestackSDK",
"repositoryURL": "https://github.com/filestack/filestack-swift.git",
"state": {
"branch": null,
"revision": "5652c2dbbc957e068346ac503893140ae41b19d8",
"version": "2.4.1"
}
},
{
"package": "OHHTTPStubs",
"repositoryURL": "https://github.com/AliSoftware/OHHTTPStubs.git",
"state": {
"branch": null,
"revision": "e92b5a5746ef16add2a1424f1fc19529d9a75cde",
"version": "9.0.0"
}
},
{
"package": "Zip",
"repositoryURL": "https://github.com/marmelroy/Zip.git",
"state": {
"branch": null,
"revision": "bd19d974e8a38cc8d3a88c90c8a107386c3b8ccf",
"version": "2.1.1"
}
}
]
},
"version": 1
}
22 changes: 0 additions & 22 deletions FilestackTests/Info.plist

This file was deleted.

34 changes: 34 additions & 0 deletions Package.resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"object": {
"pins": [
{
"package": "Alamofire",
"repositoryURL": "https://github.com/Alamofire/Alamofire",
"state": {
"branch": null,
"revision": "747c8db8d57b68d5e35275f10c92d55f982adbd4",
"version": "4.9.1"
}
},
{
"package": "FilestackSDK",
"repositoryURL": "https://github.com/filestack/filestack-swift",
"state": {
"branch": null,
"revision": "5652c2dbbc957e068346ac503893140ae41b19d8",
"version": "2.4.1"
}
},
{
"package": "Zip",
"repositoryURL": "https://github.com/marmelroy/Zip",
"state": {
"branch": null,
"revision": "bd19d974e8a38cc8d3a88c90c8a107386c3b8ccf",
"version": "2.1.1"
}
}
]
},
"version": 1
}
29 changes: 29 additions & 0 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
// swift-tools-version:5.3
// The swift-tools-version declares the minimum version of Swift required to build this package.

import PackageDescription

let package = Package(
name: "Filestack",
platforms: [.iOS(.v11)],
products: [
// Products define the executables and libraries a package produces, and make them visible to other packages.
.library(
name: "Filestack",
targets: ["Filestack"]),
],
dependencies: [
// Dependencies declare other packages that this package depends on.
.package(url: "https://github.com/Alamofire/Alamofire", from: "4.9.1"),
.package(name: "FilestackSDK", url: "https://github.com/filestack/filestack-swift", from: "2.4.1"),
.package(url: "https://github.com/marmelroy/Zip", from: "2.1.1")
],
targets: [
// Targets are the basic building blocks of a package. A target can define a module or a test suite.
// Targets can depend on other targets in this package, and on products in packages this package depends on.
.target(
name: "Filestack",
dependencies: ["Alamofire", "FilestackSDK", "Zip"],
exclude: ["Filestack.h", "Info.plist"])
]
)
28 changes: 20 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ This is the official Swift iOS for Filestack — API and content management syst

## Requirements

* Xcode 11 or later
* Swift 4.2 up to 5.2 / Objective-C
* iOS 11 or later
* Xcode 11+ (*Xcode 12+ required for SPM support*)
* Swift 4.2+ / Objective-C
* iOS 11.0+

## Installing

Expand All @@ -31,7 +31,7 @@ platform :ios, '11.0'
use_frameworks!
target '<Your Target Name>' do
pod 'Filestack', '~> 2.3.2'
pod 'Filestack', '~> 2.4.0'
end
```

Expand All @@ -52,9 +52,21 @@ $ brew install carthage

To integrate Filestack into your Xcode project using Carthage, specify it in your `Cartfile`:

`github "filestack/filestack-ios" ~> 2.3.2`
`github "filestack/filestack-ios" ~> 2.4.0`

Run `carthage update` to build the framework and drag the built `Filestack.framework` into your Xcode project. Additionally, add `Filestack.framework`, `FilestackSDK.framework`, `Alamofire.framework`, and `ZipArchive.framework` to the embedded frameworks build phase of your app's target.
Run `carthage update` to build the framework and drag the built `Filestack.framework` into your Xcode project. Additionally, add `Filestack.framework`, `FilestackSDK.framework`, `Alamofire.framework`, and `Zip.framework` to the embedded frameworks build phase of your app's target.

### Swift Package Manager

Add `https://github.com/filestack/filestack-ios.git` as a [Swift Package Manager](https://swift.org/package-manager/) dependency to your Xcode project.

Alternatively, if you are adding `Filestack` to your own Swift Package, declare the dependency in your `Package.swift`:

```swift
dependencies: [
.package(name: "Filestack", url: "https://github.com/filestack/filestack-ios.git", .upToNextMajor(from: "2.4.0"))
]
```

### Manually

Expand All @@ -70,7 +82,7 @@ Add Filestack and its dependencies as git submodules by running the following co
$ git submodule add https://github.com/filestack/filestack-ios.git
$ git submodule add https://github.com/filestack/filestack-swift.git
$ git submodule add https://github.com/Alamofire/Alamofire.git
$ git submodule add https://github.com/ZipArchive/ZipArchive.git
$ git submodule add https://github.com/marmelroy/Zip.git
```

Open the new `filestack-ios` folder, and drag the `Filestack.xcodeproj` into the Project Navigator of your application's Xcode project.
Expand All @@ -84,7 +96,7 @@ In the tab bar at the top of that window, open the "General" panel.

Click on the + button under the "Embedded Binaries" section and choose the `Filestack.framework` for iOS.

Repeat the same process for adding `Alamofire`, `FilestackSDK`, and `ZipArchive` dependent frameworks.
Repeat the same process for adding `Alamofire`, `FilestackSDK`, and `Zip` dependent frameworks.

## Usage

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
// Copyright © 2018 Filestack. All rights reserved.
//

import Foundation
import UIKit

extension UIImage {
func with(written text: String, atPoint point: CGPoint) -> UIImage {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
// Copyright © 2018 Filestack. All rights reserved.
//

import Foundation
import Photos
import UIKit

class URLExtractor {
// MARK: - Private Properties
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
// Copyright © 2020 Filestack. All rights reserved.
//

import Foundation
import FilestackSDK
import Photos
import UIKit

class AssetURLExtractorOperation: BaseOperation<[URL]>, ProgressReporting {
// MARK: - Internal Properties
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
//

import FilestackSDK
import Foundation
import UIKit

extension Client {
// MARK: - Deprecated
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="16097" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="17156" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<device id="retina4_7" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="16087"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="17125"/>
<capability name="System colors in document resources" minToolsVersion="11.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
Expand Down Expand Up @@ -31,7 +32,7 @@
</constraints>
</imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Album Name" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="vGb-l0-BAJ">
<rect key="frame" x="106" y="29.5" width="99" height="21"/>
<rect key="frame" x="106" y="29.5" width="98" height="21"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
Expand Down Expand Up @@ -67,7 +68,7 @@
<collectionView key="view" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" dataMode="prototypes" id="mLr-pI-FRJ">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
<collectionViewFlowLayout key="collectionViewLayout" minimumLineSpacing="2" minimumInteritemSpacing="2" id="B37-mB-0BL">
<size key="itemSize" width="50" height="50"/>
<size key="headerReferenceSize" width="0.0" height="0.0"/>
Expand Down Expand Up @@ -141,5 +142,8 @@
</scenes>
<resources>
<image name="icon-selected" width="23.5" height="24.5"/>
<systemColor name="systemBackgroundColor">
<color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</systemColor>
</resources>
</document>
File renamed without changes.
Loading

0 comments on commit 8412ee3

Please sign in to comment.