parse-community / Parse-Swift

The Swift SDK for Parse Platform (iOS, macOS, watchOS, tvOS, Linux, Android, Windows)
https://parseplatform.org
MIT License
306 stars 69 forks source link

feat: add ParseFileTransferable protocol for direct file uploads #410

Closed cbaker6 closed 2 years ago

cbaker6 commented 2 years ago

New Pull Request Checklist

Issue Description

All ParseFile uploads currently default to having to go to a Parse Server which then forwards to a 3rd party file storage if necessary. There's no way to directly upload files to file storage from the Swift SDK.

Related issue: #n/a

Approach

Add the ParseFileTransferable protocol which allows developers to conform to the protocol and designate how/where ParseFile's are uploaded. Any object that conforms to ParseFileTransferable can be passed during initialization of the SDK to override the default behavior.

TODOs before merging

parse-github-assistant[bot] commented 2 years ago

Thanks for opening this pull request!

codecov[bot] commented 2 years ago

Codecov Report

Merging #410 (962185f) into main (378b81a) will decrease coverage by 0.00%. The diff coverage is 93.33%.

@@            Coverage Diff             @@
##             main     #410      +/-   ##
==========================================
- Coverage   89.95%   89.95%   -0.01%     
==========================================
  Files         158      159       +1     
  Lines       15269    15275       +6     
==========================================
+ Hits        13735    13740       +5     
- Misses       1534     1535       +1     
Impacted Files Coverage Δ
Sources/ParseSwift/Objects/ParseObject.swift 89.45% <ø> (ø)
Sources/ParseSwift/Types/ParseCLP.swift 99.47% <ø> (ø)
Sources/ParseSwift/Types/ParseOperation.swift 100.00% <ø> (ø)
Sources/ParseSwift/Types/ParseConfiguration.swift 53.06% <50.00%> (-0.14%) :arrow_down:
Sources/ParseSwift/Extensions/URLSession.swift 80.91% <95.00%> (+0.13%) :arrow_up:
Sources/ParseSwift/Parse.swift 99.02% <100.00%> (+<0.01%) :arrow_up:
...s/ParseSwift/Protocols/ParseFileTransferable.swift 100.00% <100.00%> (ø)
...ources/ParseSwift/Types/ParseAnalytics+async.swift 96.77% <0.00%> (+1.53%) :arrow_up:

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.