Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Sources/Filestack/Internal/Requests/LogoutRequest.swift
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ final class LogoutRequest {
let task = URLSession.filestackDefault.dataTask(with: request) { (data, response, error) in
let response = LogoutResponse(error: error)

completionBlock(response)
DispatchQueue.main.async { completionBlock(response) }
}

task.resume()
Expand Down
4 changes: 3 additions & 1 deletion Sources/Filestack/Public/Models/Client.swift
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,9 @@ private extension Client {
}

// Set the presentation context provider
session.presentationContextProvider = self
if #available(iOS 13.0, *) {
session.presentationContextProvider = self
}

// Keep a strong reference to the auth session.
self.safariAuthSession = session
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,22 @@ class DocumentPickerUploadController: URLPickerUploadController {
viewController: UIViewController,
config: Config,
completionBlock: (([URL]) -> Void)? = nil) {
let allowedContentTypes = config.documentPickerAllowedUTIs.compactMap { UTIString in
if let contentType = UTType(UTIString) {
return contentType
} else {
return nil
}
if #available(iOS 14.0, *) {
let allowedContentTypes: [UTType] = config.documentPickerAllowedUTIs
.compactMap { UTType($0) }
self.picker = UIDocumentPickerViewController(
forOpeningContentTypes: allowedContentTypes.isEmpty ? [UTType.item] : allowedContentTypes,
asCopy: true
)
} else {
let docTypes: [String] = config.documentPickerAllowedUTIs.isEmpty
? ["public.item"]
: config.documentPickerAllowedUTIs
self.picker = UIDocumentPickerViewController(
documentTypes: docTypes,
in: .import
)
}
self.picker = UIDocumentPickerViewController(forOpeningContentTypes: allowedContentTypes.isEmpty ? [.item] : allowedContentTypes, asCopy: true)
super.init(uploader: uploader,
viewController: viewController,
presentedViewController: picker,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,13 @@ private extension AlbumListViewController {
private extension AlbumListViewController {
func createAndStartLaodingView() {
DispatchQueue.main.async {
let indicator = UIActivityIndicatorView(style: .medium)
let style: UIActivityIndicatorView.Style
if #available(iOS 13.0, *) {
style = .medium
} else {
style = .gray
}
let indicator = UIActivityIndicatorView(style: style)
indicator.center = self.view.center
indicator.startAnimating()
self.view.addSubview(indicator)
Expand Down