Skip to content

Commit

Permalink
chore: Bump ios-core
Browse files Browse the repository at this point in the history
  • Loading branch information
adrien-coye committed Jan 15, 2024
1 parent 3ba6969 commit 24fc76d
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 22 deletions.
30 changes: 15 additions & 15 deletions .package.resolved
Original file line number Diff line number Diff line change
Expand Up @@ -86,35 +86,35 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/Infomaniak/ios-core",
"state" : {
"revision" : "02f54f97557ea8340df63649081e39faddd8af26",
"version" : "4.1.29"
"revision" : "504932a51c978b6aa0bbc086054875a36241674e",
"version" : "5.0.1"
}
},
{
"identity" : "ios-core-ui",
"kind" : "remoteSourceControl",
"location" : "https://github.com/Infomaniak/ios-core-ui",
"state" : {
"revision" : "0a6b23bc6c37d9c75033428ca07d0a2a6cf4e97b",
"version" : "2.5.5"
"revision" : "2ade7b9cfc5942d1126570b40a6680e4ffcff105",
"version" : "3.0.0"
}
},
{
"identity" : "ios-dependency-injection",
"kind" : "remoteSourceControl",
"location" : "https://github.com/Infomaniak/ios-dependency-injection",
"state" : {
"revision" : "b4d872b5baf5d6f19b98fdfd765205c57870d02e",
"version" : "1.1.11"
"revision" : "8dc9e67e6d3d9f4f5bd02d693a7ce1f93b125bcd",
"version" : "2.0.1"
}
},
{
"identity" : "ios-login",
"kind" : "remoteSourceControl",
"location" : "https://github.com/Infomaniak/ios-login",
"state" : {
"revision" : "b9f5d87da453b52eec72fb1e0443f28209c6ac67",
"version" : "4.1.0"
"revision" : "ba2e72bc84a673d4e1626f898419da82b54baefb",
"version" : "5.0.0"
}
},
{
Expand Down Expand Up @@ -194,32 +194,32 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/realm/realm-core.git",
"state" : {
"revision" : "c569bec4d04da84030d94f376437bc4efda3686b",
"version" : "13.23.1"
"revision" : "7227d6a447821c28895daa099b6c7cd4c99d461b",
"version" : "13.25.1"
}
},
{
"identity" : "realm-swift",
"kind" : "remoteSourceControl",
"location" : "https://github.com/realm/realm-swift",
"state" : {
"revision" : "fd199ce07edb4db69e862f74151b95602aad3b43",
"version" : "10.44.0"
"revision" : "836cc4b8619886f979f8961c3f592a82b0741591",
"version" : "10.45.3"
}
},
{
"identity" : "sentry-cocoa",
"kind" : "remoteSourceControl",
"location" : "https://github.com/getsentry/sentry-cocoa",
"state" : {
"revision" : "74cf23b2946c92550fb1185612077151497e648e",
"version" : "8.17.1"
"revision" : "3b9a8e69ca296bd8cd0e317ad7a448e5daf4a342",
"version" : "8.18.0"
}
},
{
"identity" : "snackbar.swift",
"kind" : "remoteSourceControl",
"location" : "https://github.com/PhilippeWeidmann/SnackBar.swift",
"location" : "https://github.com/Infomaniak/SnackBar.swift",
"state" : {
"revision" : "9a3c0c71796625ec3804df993483aa80266fa1ff",
"version" : "1.1.0"
Expand Down
8 changes: 4 additions & 4 deletions Project.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ let project = Project(name: "kDrive",
packages: [
.package(url: "https://github.com/apple/swift-algorithms", .upToNextMajor(from: "1.2.0")),
.package(url: "https://github.com/Alamofire/Alamofire", .upToNextMajor(from: "5.2.2")),
.package(url: "https://github.com/Infomaniak/ios-core", .upToNextMajor(from: "4.1.29")),
.package(url: "https://github.com/Infomaniak/ios-core-ui", .upToNextMajor(from: "2.5.5")),
.package(url: "https://github.com/Infomaniak/ios-login", .upToNextMajor(from: "4.0.0")),
.package(url: "https://github.com/Infomaniak/ios-dependency-injection", .upToNextMajor(from: "1.1.11")),
.package(url: "https://github.com/Infomaniak/ios-core", .upToNextMajor(from: "5.0.1")),
.package(url: "https://github.com/Infomaniak/ios-core-ui", .upToNextMajor(from: "3.0.0")),
.package(url: "https://github.com/Infomaniak/ios-login", .upToNextMajor(from: "5.0.0")),
.package(url: "https://github.com/Infomaniak/ios-dependency-injection", .upToNextMajor(from: "2.0.0")),
.package(url: "https://github.com/Infomaniak/swift-concurrency", .upToNextMajor(from: "0.0.4")),
.package(url: "https://github.com/realm/realm-swift", .upToNextMajor(from: "10.43.0")),
.package(url: "https://github.com/SCENEE/FloatingPanel", .upToNextMajor(from: "2.0.0")),
Expand Down
48 changes: 45 additions & 3 deletions kDriveCore/Utils/Files/FileImportHelper.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,48 @@ import kDriveResources
import Photos
import RealmSwift

extension ItemProviderURLRepresentation {
var URLResult: Result<URL, Error> {
get async {
let result = await result
switch result {
case .success((let url, _)):
return .success(url)
case .failure(let error):
return .failure(error)
}
}
}
}

extension ItemProviderFileRepresentation {
var URLResult: Result<URL, Error> {
get async {
let result = await result
switch result {
case .success((let url, _)):
return .success(url)
case .failure(let error):
return .failure(error)
}
}
}
}

extension ItemProviderZipRepresentation {
var URLResult: Result<URL, Error> {
get async {
let result = await result
switch result {
case .success((let url, _)):
return .success(url)
case .failure(let error):
return .failure(error)
}
}
}
}

public enum ImportError: LocalizedError {
case accessDenied
case emptyImageData
Expand Down Expand Up @@ -145,7 +187,7 @@ public final class FileImportHelper {
case .isURL:
let getPlist = try ItemProviderURLRepresentation(from: itemProvider)
progress.addChild(getPlist.progress, withPendingUnitCount: perItemUnitCount)
return await getPlist.result
return await getPlist.URLResult

case .isText:
let getText = try ItemProviderTextRepresentation(from: itemProvider)
Expand All @@ -166,12 +208,12 @@ public final class FileImportHelper {
)
progress.addChild(getFile.progress, withPendingUnitCount: perItemUnitCount)

return await getFile.result
return await getFile.URLResult

case .isDirectory:
let getFile = try ItemProviderZipRepresentation(from: itemProvider)
progress.addChild(getFile.progress, withPendingUnitCount: perItemUnitCount)
return await getFile.result
return await getFile.URLResult

case .none:
return .failure(ErrorDomain.UTINotFound)
Expand Down

0 comments on commit 24fc76d

Please sign in to comment.