This repository has been archived by the owner on Dec 11, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #28 from WeTransfer/feature/transfer-board-split
SDK V2
- Loading branch information
Showing
44 changed files
with
1,127 additions
and
454 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule WeTransfer-iOS-CI
updated
5 files
+1 −1 | Danger/Dangerfile | |
+1 −0 | Fastlane/Fastfile | |
+1 −1 | README.md | |
+1 −1 | Scripts/travis.sh | |
+2 −3 | SwiftLint/.swiftlint-source.yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
Pod::Spec.new do |s| | ||
s.name = "WeTransfer-Swift-SDK" | ||
s.version = "1.0" | ||
s.version = "2.0" | ||
s.summary = "A Swift SDK for WeTransfer’s public API" | ||
s.homepage = "https://github.com/WeTransfer/WeTransfer-Swift-SDK" | ||
s.license = "MIT" | ||
s.author = { "Pim Coumans" => "[email protected]" } | ||
s.source = { :git => "https://github.com/WeTransfer/WeTransfer-Swift-SDK.git", :tag => "v#{s.version}" } | ||
|
||
s.swift_version = "4.1" | ||
s.swift_version = "4.2" | ||
s.ios.deployment_target = "9.0" | ||
s.osx.deployment_target = "10.10" | ||
|
||
|
Large diffs are not rendered by default.
Oops, something went wrong.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
// | ||
// Transfer.swift | ||
// WeTransfer Swift SDK | ||
// | ||
// Created by Pim Coumans on 01/10/2018. | ||
// Copyright © 2018 WeTransfer. All rights reserved. | ||
// | ||
|
||
import Foundation | ||
|
||
/// Describes a single board to be created, adding files to and uploading files from. Used as an identifier between each request to be made and a local representation of the server-side board. | ||
/// Files should be added through the appropriate addFiles method | ||
public final class Board: Transferable { | ||
public private(set) var identifier: String? | ||
|
||
/// The name of the board. This name will be shown when viewing the transfer on wetransfer.com | ||
public let name: String | ||
/// Optional description of the board. This will be shown when viewing the transfer on wetransfer.com | ||
public let description: String? | ||
|
||
/// References to all the files added to the board. Files can be added with the public method on the WeTransfer struct | ||
public private(set) var files: [File] = [] | ||
|
||
/// Available when the board is created on the server | ||
public private(set) var shortURL: URL? | ||
|
||
/// Internal initializer with required properties | ||
init(name: String, description: String?) { | ||
self.name = name | ||
self.description = description | ||
} | ||
} | ||
|
||
// MARK: - Private updating methods | ||
extension Board { | ||
|
||
/// Updates the board with server-side information | ||
/// | ||
/// - Parameters: | ||
/// - identifier: Identifier to point to global board | ||
/// - shortURL: URL of where the board can be found online | ||
func update(with identifier: String, shortURL: URL) { | ||
self.identifier = identifier | ||
self.shortURL = shortURL | ||
} | ||
|
||
/// Adds provided files to the board locally | ||
/// | ||
/// - Parameter files: Files to be added to the board | ||
func add(_ files: [File]) { | ||
for file in files where !self.files.contains(file) { | ||
self.files.append(file) | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// | ||
// Transferable.swift | ||
// WeTransfer | ||
// | ||
// Created by Pim Coumans on 04/10/2018. | ||
// Copyright © 2018 WeTransfer. All rights reserved. | ||
// | ||
|
||
import Foundation | ||
|
||
/// Shared properties for both transfers and boards | ||
public protocol Transferable { | ||
var identifier: String? { get } | ||
var files: [File] { get } | ||
var shortURL: URL? { get } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.