Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Increase Deployment Target to iOS 13 #2459

Merged
merged 14 commits into from
Jan 3, 2025
Merged
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
- Don't show message-input when forwarding (#2435)
- Long-tap links for copying to clipboard (#2445)
- Hide address in titles: protect against over-the-shoulder-attacks, improve screenshot privacy, clear UX (#2447)
- minimum system version is iOS 13 now

## v1.50.3

Expand Down
6 changes: 2 additions & 4 deletions DcCore/DcCore.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES;
ONLY_ACTIVE_ARCH = YES;
Expand Down Expand Up @@ -442,7 +442,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
MTL_ENABLE_DEBUG_INFO = NO;
MTL_FAST_MATH = YES;
SDKROOT = iphoneos;
Expand Down Expand Up @@ -471,7 +471,6 @@
);
INFOPLIST_FILE = DcCore/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand Down Expand Up @@ -506,7 +505,6 @@
);
INFOPLIST_FILE = DcCore/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand Down
26 changes: 12 additions & 14 deletions DcCore/DcCore/Extensions/UIColor+Extensions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ public extension UIColor {
// see: https://stackoverflow.com/a/33397427
convenience init(hexString: String) {
let hex = hexString.trimmingCharacters(in: CharacterSet.alphanumerics.inverted)
var int = UInt32()
Scanner(string: hex).scanHexInt32(&int)
let a, r, g, b: UInt32
var int = UInt64()
Scanner(string: hex).scanHexInt64(&int)
let a, r, g, b: UInt64
switch hex.count {
case 3: // RGB (12-bit)
(a, r, g, b) = (255, (int >> 8) * 17, (int >> 4 & 0xF) * 17, (int & 0xF) * 17)
Expand All @@ -38,26 +38,24 @@ public extension UIColor {
self.init(red: CGFloat(r) / 255, green: CGFloat(g) / 255, blue: CGFloat(b) / 255, alpha: CGFloat(a) / 255)
}

static func themeColor(light: UIColor, dark: UIColor? = nil) -> UIColor {
if let dark = dark {
if #available(iOS 13, *) {
return UIColor.init { (trait) -> UIColor in
return trait.userInterfaceStyle == .dark ? dark : light
}
static func themeColor(light: UIColor, dark: UIColor? = nil) -> UIColor {
if let dark {
return UIColor.init { (trait) -> UIColor in
return trait.userInterfaceStyle == .dark ? dark : light
}
} else {
return light
}
return light
}

static func themeColor(lightHex: String, darkHex: String? = nil) -> UIColor {
if let darkHex = darkHex {
if #available(iOS 13, *) {
if let darkHex {
return UIColor.init { (trait) -> UIColor in
return trait.userInterfaceStyle == .dark ? UIColor(hexString: darkHex) : UIColor(hexString: lightHex)
}
}
} else {
return UIColor(hexString: lightHex)
}
return UIColor(hexString: lightHex)
}

static func rgb(red: CGFloat, green: CGFloat, blue: CGFloat) -> UIColor {
Expand Down
54 changes: 26 additions & 28 deletions DcCore/DcCore/Helper/DcUtils.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,35 +15,33 @@ public struct DcUtils {
}

public static func donateSendMessageIntent(context: DcContext, chatId: Int, chatAvatar: UIImage?) {
if #available(iOS 13.0, *) {
let chat = context.getChat(chatId: chatId)
let groupName = INSpeakableString(spokenPhrase: chat.name)

let sendMessageIntent = INSendMessageIntent(recipients: nil,
content: nil,
speakableGroupName: groupName,
conversationIdentifier: "\(context.id).\(chatId)",
serviceName: nil,
sender: nil)

// Add the user's avatar to the intent.
if let imageData = chat.profileImage?.pngData() {
let image = INImage(imageData: imageData)
sendMessageIntent.setImage(image, forParameterNamed: \.speakableGroupName)
} else if let imageData = chatAvatar?.pngData() {
let image = INImage(imageData: imageData)
sendMessageIntent.setImage(image, forParameterNamed: \.speakableGroupName)
}

// Donate the intent.
let interaction = INInteraction(intent: sendMessageIntent, response: nil)
interaction.groupIdentifier = "\(context.id)"
interaction.donate(completion: { error in
if error != nil {
logger.error(error.debugDescription)
}
})
let chat = context.getChat(chatId: chatId)
let groupName = INSpeakableString(spokenPhrase: chat.name)

let sendMessageIntent = INSendMessageIntent(recipients: nil,
content: nil,
speakableGroupName: groupName,
conversationIdentifier: "\(context.id).\(chatId)",
serviceName: nil,
sender: nil)

// Add the user's avatar to the intent.
if let imageData = chat.profileImage?.pngData() {
let image = INImage(imageData: imageData)
sendMessageIntent.setImage(image, forParameterNamed: \.speakableGroupName)
} else if let imageData = chatAvatar?.pngData() {
let image = INImage(imageData: imageData)
sendMessageIntent.setImage(image, forParameterNamed: \.speakableGroupName)
}

// Donate the intent.
let interaction = INInteraction(intent: sendMessageIntent, response: nil)
interaction.groupIdentifier = "\(context.id)"
interaction.donate(completion: { error in
if error != nil {
logger.error(error.debugDescription)
}
})
}

static func copyAndFreeArray(inputArray: OpaquePointer?) -> [Int] {
Expand Down
8 changes: 1 addition & 7 deletions DcShare/Controller/SendingController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,7 @@ class SendingController: UIViewController {
}()

private var activityIndicator: UIActivityIndicatorView = {
let view: UIActivityIndicatorView
if #available(iOS 13, *) {
view = UIActivityIndicatorView(style: .large)
} else {
view = UIActivityIndicatorView(style: .whiteLarge)
view.color = UIColor.gray
}
let view = UIActivityIndicatorView(style: .large)
view.startAnimating()
view.translatesAutoresizingMaskIntoConstraints = false
return view
Expand Down
8 changes: 3 additions & 5 deletions DcShare/Controller/ShareViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,9 @@ class ShareViewController: SLComposeServiceViewController {
super.viewDidLoad()
setupNavigationBar()
// workaround for iOS13 bug
if #available(iOS 13.0, *) {
_ = NotificationCenter.default.addObserver(forName: UIResponder.keyboardDidShowNotification, object: nil, queue: .main) { (_) in
if let layoutContainerView = self.view.subviews.last {
layoutContainerView.frame.size.height += 10
}
_ = NotificationCenter.default.addObserver(forName: UIResponder.keyboardDidShowNotification, object: nil, queue: .main) { (_) in
if let layoutContainerView = self.view.subviews.last {
layoutContainerView.frame.size.height += 10
}
}
placeholder = String.localized("chat_input_placeholder")
Expand Down
4 changes: 2 additions & 2 deletions Podfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
platform :ios, '12.0'
platform :ios, '13.0'
use_frameworks!

# ignore all warnings from all dependencies
Expand Down Expand Up @@ -26,7 +26,7 @@ end
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = "12.0"
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = "13.0"
config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64"
end
end
Expand Down
34 changes: 17 additions & 17 deletions Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PODS:
- CocoaLumberjack (3.8.2):
- CocoaLumberjack/Core (= 3.8.2)
- CocoaLumberjack/Core (3.8.2)
- CocoaLumberjack (3.8.5):
- CocoaLumberjack/Core (= 3.8.5)
- CocoaLumberjack/Core (3.8.5)
- libwebp (1.3.2):
- libwebp/demux (= 1.3.2)
- libwebp/mux (= 1.3.2)
Expand All @@ -15,21 +15,21 @@ PODS:
- libwebp/webp (1.3.2):
- libwebp/sharpyuv
- MCEmojiPicker (1.2.3)
- ReachabilitySwift (5.0.0)
- ReachabilitySwift (5.2.4)
- SCSiriWaveformView (1.1.2)
- SDWebImage (5.18.8):
- SDWebImage/Core (= 5.18.8)
- SDWebImage/Core (5.18.8)
- SDWebImage (5.20.0):
- SDWebImage/Core (= 5.20.0)
- SDWebImage/Core (5.20.0)
- SDWebImageSVGKitPlugin (1.4.0):
- SDWebImage/Core (~> 5.10)
- SVGKit (~> 3.0)
- SDWebImageWebPCoder (0.14.2):
- SDWebImageWebPCoder (0.14.6):
- libwebp (~> 1.0)
- SDWebImage/Core (~> 5.17)
- SVGKit (3.0.0):
- CocoaLumberjack (~> 3.0)
- SwiftFormat/CLI (0.52.11)
- SwiftLint (0.54.0)
- SwiftFormat/CLI (0.55.3)
- SwiftLint (0.57.1)

DEPENDENCIES:
- MCEmojiPicker (from `https://github.com/deltachat/MCEmojiPicker`, branch `main`)
Expand Down Expand Up @@ -66,18 +66,18 @@ CHECKOUT OPTIONS:
:git: https://github.com/deltachat/MCEmojiPicker

SPEC CHECKSUMS:
CocoaLumberjack: f8d89a516e7710fdb2e9b8f1560b16ec6040eef0
CocoaLumberjack: 6a459bc897d6d80bd1b8c78482ec7ad05dffc3f0
libwebp: 1786c9f4ff8a279e4dac1e8f385004d5fc253009
MCEmojiPicker: d24f72731881c05143870eefff52f586d493b982
ReachabilitySwift: 985039c6f7b23a1da463388634119492ff86c825
ReachabilitySwift: 32793e867593cfc1177f5d16491e3a197d2fccda
SCSiriWaveformView: 016392911fb442c17d6dbad68e666edb13193c02
SDWebImage: a81bbb3ba4ea5f810f4069c68727cb118467a04a
SDWebImage: 73c6079366fea25fa4bb9640d5fb58f0893facd8
SDWebImageSVGKitPlugin: 7542dd07c344ec3415ded0461a1161a6f087e0c9
SDWebImageWebPCoder: 633b813fca24f1de5e076bcd7f720c038b23892b
SDWebImageWebPCoder: e38c0a70396191361d60c092933e22c20d5b1380
SVGKit: 1ad7513f8c74d9652f94ed64ddecda1a23864dea
SwiftFormat: 2ca3d0b75754193f0f3ba532291f25ae08dd1e42
SwiftLint: c1de071d9d08c8aba837545f6254315bc900e211
SwiftFormat: 2f3558ca02842dcd3fd970360d2d4054bd21624a
SwiftLint: 92196976e597b9afec5dbe374810103e6c1d9d7c

PODFILE CHECKSUM: 68422360320087b0cc5cd7b1b9597388ed182745
PODFILE CHECKSUM: 2da95f11b974320ff49308be31714c4fd2efb4ac

COCOAPODS: 1.16.2
32 changes: 32 additions & 0 deletions Pods/CocoaLumberjack/CHANGELOG.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Pods/CocoaLumberjack/LICENSE

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Pods/CocoaLumberjack/Sources/CocoaLumberjack/CLI/CLIColor.m

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading