Skip to content

Commit

Permalink
Drop support for iOS 13.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Hengyu committed Dec 5, 2023
1 parent 8effeaf commit 98b366a
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 22 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

## Requirements

- iOS 13.0+, macCatalyst 13.0+
- iOS 14.0+, macCatalyst 14.0+

## Installation

Expand Down
12 changes: 5 additions & 7 deletions Sources/FeedbackSwift/FeedbackItemsDataSource.swift
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,12 @@ public class FeedbackItemsDataSource {
sections.append(
FeedbackItemsSection(items: [TopicItem(topics), BodyItem()])
)
if #available(iOS 13.0, macCatalyst 14.0, *) {
sections.append(
FeedbackItemsSection(
title: localized("feedback.AdditionalInfo"),
items: [AttachmentItem(isHidden: hidesAttachmentCell)]
)
sections.append(
FeedbackItemsSection(
title: localized("feedback.AdditionalInfo"),
items: [AttachmentItem(isHidden: hidesAttachmentCell)]
)
}
)
sections.append(
FeedbackItemsSection(
title: localized("feedback.DeviceInfo"),
Expand Down
16 changes: 5 additions & 11 deletions Sources/FeedbackSwift/FeedbackViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,7 @@ open class FeedbackViewController: UITableViewController {
public init(configuration: FeedbackConfiguration) {
self.configuration = configuration

if #available(iOS 13, *) {
super.init(style: .insetGrouped)
} else {
super.init(style: .grouped)
}
super.init(style: .insetGrouped)

wireframe = FeedbackWireframe(
viewController: self,
Expand Down Expand Up @@ -139,18 +135,16 @@ extension FeedbackViewController {
wireframe.showAttachmentActionSheet(
cellRect: cell.superview!.convert(cell.frame, to: view),
authorizePhotoLibrary: { completion in
PHPhotoLibrary.requestAuthorization { status in
PHPhotoLibrary.requestAuthorization(for: .readWrite) { status in
DispatchQueue.main.async {
completion(status == .authorized)
}
}
},
authorizeCamera: { completion in
if #available(iOS 13.0, macCatalyst 14.0, *) {
AVCaptureDevice.requestAccess(for: .video) { result in
DispatchQueue.main.async {
completion(result)
}
AVCaptureDevice.requestAccess(for: .video) { result in
DispatchQueue.main.async {
completion(result)
}
}
},
Expand Down
3 changes: 2 additions & 1 deletion Sources/FeedbackSwift/FeedbackWireframe.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import UIKit
import MobileCoreServices
import MessageUI
import UniformTypeIdentifiers

protocol FeedbackWireframeProtocol {
func showTopicsView(with service: FeedbackEditingServiceProtocol)
Expand Down Expand Up @@ -188,7 +189,7 @@ private extension FeedbackWireframe {
func showImagePicker(sourceType: UIImagePickerController.SourceType) {
let imagePicker = UIImagePickerController()
imagePicker.sourceType = sourceType
imagePicker.mediaTypes = [kUTTypeImage as String, kUTTypeMovie as String]
imagePicker.mediaTypes = [UTType.image.identifier, UTType.movie.identifier]
imagePicker.allowsEditing = false
imagePicker.delegate = imagePickerDelegate
imagePicker.modalPresentationStyle = .formSheet
Expand Down
5 changes: 3 additions & 2 deletions Sources/FeedbackSwift/Functions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@
// Copyright (c) 2017 CAPH TECH. All rights reserved.
//

import UIKit
import MobileCoreServices
import AVFoundation
import MobileCoreServices
import UIKit
import UniformTypeIdentifiers

func localized(_ key: String) -> String {
#if SWIFT_PACKAGE && swift(>=5.3)
Expand Down

0 comments on commit 98b366a

Please sign in to comment.