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

Upgrade minimal support version to iOS 13.0 #190

Merged
merged 4 commits into from
Jul 26, 2023
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
33 changes: 23 additions & 10 deletions LineSDK/LineSDK.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
archiveVersion = 1;
classes = {
};
objectVersion = 50;
objectVersion = 53;
objects = {

/* Begin PBXBuildFile section */
Expand Down Expand Up @@ -136,7 +136,6 @@
4B90588721006E5D004D717F /* LineSDKTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B90588621006E5D004D717F /* LineSDKTests.swift */; };
4B9058D421007394004D717F /* LoginConfiguration.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B9058D321007394004D717F /* LoginConfiguration.swift */; };
4B9058D6210073E6004D717F /* LoginManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B9058D5210073E6004D717F /* LoginManager.swift */; };
4B9058D8210078FB004D717F /* Result.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B9058D7210078FB004D717F /* Result.swift */; };
4B9058DC21007C8C004D717F /* LoginResult.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B9058DB21007C8C004D717F /* LoginResult.swift */; };
4B93F2D223CD5307003B955D /* OpenChatCreatingControllerDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B93F2D123CD5307003B955D /* OpenChatCreatingControllerDelegate.swift */; };
4B94D06721533D4D0049DE68 /* ECDSATests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B94D06621533D4D0049DE68 /* ECDSATests.swift */; };
Expand Down Expand Up @@ -375,7 +374,6 @@
4BCD257F23FFAABA00D4B6BD /* RSA.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B25A814213687A400C74B87 /* RSA.swift */; };
4BCD258023FFAABA00D4B6BD /* ECDSA.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B3CCB9B21523B1300F51D76 /* ECDSA.swift */; };
4BCD258123FFAABA00D4B6BD /* ResultUtils.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4BF3044E221D3620005ADADD /* ResultUtils.swift */; };
4BCD258223FFAABA00D4B6BD /* Result.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B9058D7210078FB004D717F /* Result.swift */; };
4BCD258323FFAABA00D4B6BD /* Helpers.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B45256C2101829F00A39D4F /* Helpers.swift */; };
4BCD258423FFAABA00D4B6BD /* Delegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B8FF4852105656500890AEF /* Delegate.swift */; };
4BCD258523FFAABA00D4B6BD /* CallbackQueue.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B8FF48A21056B3800890AEF /* CallbackQueue.swift */; };
Expand Down Expand Up @@ -709,7 +707,6 @@
4B90588821006E5D004D717F /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
4B9058D321007394004D717F /* LoginConfiguration.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LoginConfiguration.swift; sourceTree = "<group>"; };
4B9058D5210073E6004D717F /* LoginManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LoginManager.swift; sourceTree = "<group>"; };
4B9058D7210078FB004D717F /* Result.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Result.swift; sourceTree = "<group>"; };
4B9058DB21007C8C004D717F /* LoginResult.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LoginResult.swift; sourceTree = "<group>"; };
4B93F2D123CD5307003B955D /* OpenChatCreatingControllerDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OpenChatCreatingControllerDelegate.swift; sourceTree = "<group>"; };
4B94D06621533D4D0049DE68 /* ECDSATests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ECDSATests.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -1305,7 +1302,6 @@
isa = PBXGroup;
children = (
4BF3044E221D3620005ADADD /* ResultUtils.swift */,
4B9058D7210078FB004D717F /* Result.swift */,
4B45256C2101829F00A39D4F /* Helpers.swift */,
4B8FF4852105656500890AEF /* Delegate.swift */,
4B8FF48A21056B3800890AEF /* CallbackQueue.swift */,
Expand Down Expand Up @@ -2083,8 +2079,9 @@
4B90586F21006E5C004D717F /* Project object */ = {
isa = PBXProject;
attributes = {
BuildIndependentTargetsInParallel = YES;
LastSwiftUpdateCheck = 0940;
LastUpgradeCheck = 1400;
LastUpgradeCheck = 1430;
ORGANIZATIONNAME = "LINE Corp";
TargetAttributes = {
4B6A702D2109793500D71C66 = {
Expand Down Expand Up @@ -2300,7 +2297,6 @@
4B9A3047212139C000174C6F /* TemplateMessage.swift in Sources */,
4B1C44652137E0CA0094C1D4 /* JWT.swift in Sources */,
4BB002C82244788A00FB8BD8 /* ImageManager.swift in Sources */,
4B9058D8210078FB004D717F /* Result.swift in Sources */,
4B9A30352121182400174C6F /* VideoMessage.swift in Sources */,
4B9A304921213CE100174C6F /* TemplateButtonsPayload.swift in Sources */,
4B688E3E226F029B002575CC /* LoadingIndicator.swift in Sources */,
Expand Down Expand Up @@ -2581,7 +2577,6 @@
4BCD256623FFAABA00D4B6BD /* ImageManager.swift in Sources */,
4BCD24D023FFA74100D4B6BD /* LineSDKJWT.swift in Sources */,
4BCD253B23FFAABA00D4B6BD /* GetShareFriendsRequest.swift in Sources */,
4BCD258223FFAABA00D4B6BD /* Result.swift in Sources */,
4BCD253823FFAABA00D4B6BD /* GetGroupsRequest.swift in Sources */,
D1D22C972408A8FD0028A9E0 /* FormSection.swift in Sources */,
D1D22CAB2408AA480028A9E0 /* LineSDKOpenChatRoomMembershipState.swift in Sources */,
Expand Down Expand Up @@ -2886,7 +2881,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
Expand Down Expand Up @@ -2946,7 +2941,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = LineSDKXCProj;
Expand All @@ -2969,13 +2964,16 @@
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1174;
DYLIB_INSTALL_NAME_BASE = "@rpath";
ENABLE_MODULE_VERIFIER = YES;
INFOPLIST_FILE = LineSDK/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
MODULE_VERIFIER_SUPPORTED_LANGUAGES = "objective-c objective-c++";
MODULE_VERIFIER_SUPPORTED_LANGUAGE_STANDARDS = "gnu11 gnu++14";
PRODUCT_BUNDLE_IDENTIFIER = com.linecorp.LineSDK;
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
SKIP_INSTALL = YES;
Expand All @@ -2996,13 +2994,16 @@
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1174;
DYLIB_INSTALL_NAME_BASE = "@rpath";
ENABLE_MODULE_VERIFIER = YES;
INFOPLIST_FILE = LineSDK/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
MODULE_VERIFIER_SUPPORTED_LANGUAGES = "objective-c objective-c++";
MODULE_VERIFIER_SUPPORTED_LANGUAGE_STANDARDS = "gnu11 gnu++14";
PRODUCT_BUNDLE_IDENTIFIER = com.linecorp.LineSDK;
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
SKIP_INSTALL = YES;
Expand Down Expand Up @@ -3058,13 +3059,16 @@
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1174;
DYLIB_INSTALL_NAME_BASE = "@rpath";
ENABLE_MODULE_VERIFIER = YES;
INFOPLIST_FILE = LineSDKObjC/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
MODULE_VERIFIER_SUPPORTED_LANGUAGES = "objective-c objective-c++";
MODULE_VERIFIER_SUPPORTED_LANGUAGE_STANDARDS = "gnu11 gnu++14";
PRODUCT_BUNDLE_IDENTIFIER = com.linecorp.LineSDKObjC;
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
SKIP_INSTALL = YES;
Expand All @@ -3084,13 +3088,16 @@
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1174;
DYLIB_INSTALL_NAME_BASE = "@rpath";
ENABLE_MODULE_VERIFIER = YES;
INFOPLIST_FILE = LineSDKObjC/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
MODULE_VERIFIER_SUPPORTED_LANGUAGES = "objective-c objective-c++";
MODULE_VERIFIER_SUPPORTED_LANGUAGE_STANDARDS = "gnu11 gnu++14";
PRODUCT_BUNDLE_IDENTIFIER = com.linecorp.LineSDKObjC;
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
SKIP_INSTALL = YES;
Expand Down Expand Up @@ -3143,13 +3150,16 @@
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1174;
DYLIB_INSTALL_NAME_BASE = "@rpath";
ENABLE_MODULE_VERIFIER = YES;
INFOPLIST_FILE = LineSDKObjC/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
MODULE_VERIFIER_SUPPORTED_LANGUAGES = "objective-c objective-c++";
MODULE_VERIFIER_SUPPORTED_LANGUAGE_STANDARDS = "gnu11 gnu++14";
OTHER_SWIFT_FLAGS = "-DLineSDKBinary";
PRODUCT_BUNDLE_IDENTIFIER = com.linecorp.LineSDKObjC;
PRODUCT_NAME = LineSDKObjC;
Expand All @@ -3170,13 +3180,16 @@
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1174;
DYLIB_INSTALL_NAME_BASE = "@rpath";
ENABLE_MODULE_VERIFIER = YES;
INFOPLIST_FILE = LineSDKObjC/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
MODULE_VERIFIER_SUPPORTED_LANGUAGES = "objective-c objective-c++";
MODULE_VERIFIER_SUPPORTED_LANGUAGE_STANDARDS = "gnu11 gnu++14";
OTHER_SWIFT_FLAGS = "-DLineSDKBinary";
PRODUCT_BUNDLE_IDENTIFIER = com.linecorp.LineSDKObjC;
PRODUCT_NAME = LineSDKObjC;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1400"
LastUpgradeVersion = "1430"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1400"
LastUpgradeVersion = "1430"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1400"
LastUpgradeVersion = "1430"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
14 changes: 0 additions & 14 deletions LineSDK/LineSDK/Crypto/CryptoHelpers.swift
Original file line number Diff line number Diff line change
Expand Up @@ -169,21 +169,7 @@ extension SecKey {

// Get public key from certData
let copyKey: (SecCertificate) -> SecKey?

#if targetEnvironment(macCatalyst)
copyKey = SecCertificateCopyKey
#else
if #available(iOS 12.0, *) {
copyKey = SecCertificateCopyKey
} else if #available(iOS 10.3, *) {
copyKey = SecCertificateCopyPublicKey
} else {
throw CryptoError.generalError(
reason: .operationNotSupported(
reason: "Loading public key from certificate not supported below iOS 10.3.")
)
}
#endif

guard let key = copyKey(certData) else {
throw CryptoError.algorithmsFailed(
Expand Down
6 changes: 3 additions & 3 deletions LineSDK/LineSDK/LineSDKUI/OpenChatUI/Model/FormEntry.swift
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,10 @@ class Option<T: CustomStringConvertible & Equatable>: FormEntry {
private func render() -> UITableViewCell {
let cell = UITableViewCell(style: .value1, reuseIdentifier: nil)
cell.textLabel?.font = .systemFont(ofSize: 15.0)
cell.textLabel?.textColor = .LineSDKLabel
cell.textLabel?.textColor = .label
cell.textLabel?.text = title
cell.detailTextLabel?.font = .systemFont(ofSize: 15.0)
cell.detailTextLabel?.textColor = .LineSDKSecondaryLabel
cell.detailTextLabel?.textColor = .secondaryLabel
cell.detailTextLabel?.text = selectedOption.description
cell.accessoryType = .disclosureIndicator

Expand Down Expand Up @@ -146,7 +146,7 @@ class Toggle: FormEntry {
let cell = UITableViewCell(style: .default, reuseIdentifier: nil)
cell.selectionStyle = .none
cell.textLabel?.font = .systemFont(ofSize: 15.0)
cell.textLabel?.textColor = .LineSDKLabel
cell.textLabel?.textColor = .label
cell.textLabel?.text = title
cell.accessoryView = searchOptionSwitch
return cell
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class FormSectionRenderer {
private lazy var footerLabel: UILabel = {
let label = UILabel()
label.font = .systemFont(ofSize: 13)
label.textColor = .LineSDKSecondaryLabel
label.textColor = .secondaryLabel
label.numberOfLines = 0
label.text = self.section.footerText
return label
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,14 +138,7 @@ class CountLimitedTextView: UIView {
private func setup() {
setupSubviews()
setupLayouts()

if #available(iOS 13.0, *) {
} else {
// A workaround for `textView` not resizing correctly on iOS 12 and earlier for small
// screens (like iPhone SE).
// This layout issue does not happen on iOS 13.
DispatchQueue.main.async { self.clearText() }
}

}

private func setupSubviews() {
Expand Down Expand Up @@ -206,13 +199,6 @@ class CountLimitedTextView: UIView {
@objc private func clearText() {
text = ""
textView.sizeToFit()

if #available(iOS 13.0, *) {
} else {
// A workaround for `textView` not resizing correctly on iOS 12 and earlier.
// This layout issue does not happen on iOS 13.
DispatchQueue.main.async { self.setNeedsLayout() }
}
}

private func validateString(_ text: String) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ class OpenChatRoomDescriptionTableViewCell: UITableViewCell {

struct TextViewStyle: CountLimitedTextViewStyle {
let font: UIFont = .boldSystemFont(ofSize: 15)
let textColor: UIColor = .LineSDKLabel
let textColor: UIColor = .label
let placeholderFont: UIFont = .boldSystemFont(ofSize: 15)
let placeholderColor: UIColor = .LineSDKSecondaryLabel
let placeholderColor: UIColor = .secondaryLabel
let textCountLabelFont: UIFont = .systemFont(ofSize: 12)
let textCountLabelColor: UIColor = .LineSDKSecondaryLabel
let textCountLabelColor: UIColor = .secondaryLabel
}

lazy var textView: CountLimitedTextView = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ class OpenChatRoomNameTableViewCell: UITableViewCell {

struct TextViewStyle: CountLimitedTextViewStyle {
let font: UIFont = .boldSystemFont(ofSize: 18)
let textColor: UIColor = .LineSDKLabel
let textColor: UIColor = .label
let placeholderFont: UIFont = .boldSystemFont(ofSize: 18)
let placeholderColor: UIColor = .LineSDKSecondaryLabel
let placeholderColor: UIColor = .secondaryLabel
let textCountLabelFont: UIFont = .systemFont(ofSize: 12)
let textCountLabelColor: UIColor = .LineSDKSecondaryLabel
let textCountLabelColor: UIColor = .secondaryLabel
}

let textView = CountLimitedTextView(style: TextViewStyle())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import UIKit
class OpenChatRoomInfoViewController: UITableViewController {

enum Design {
static var backgroundColor: UIColor { return .LineSDKSystemGroupedBackground }
static var backgroundColor: UIColor { return .systemGroupedBackground }
}

let onClose = Delegate<OpenChatRoomInfoViewController, Void>()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,16 @@ import UIKit
class OpenChatUserProfileViewController: UIViewController {

enum Design {
static var backgroundColor: UIColor { return .LineSDKSystemGroupedBackground }
static var backgroundColor: UIColor { return .systemGroupedBackground }
}

struct TextViewStyle: CountLimitedTextViewStyle {
let font: UIFont = .systemFont(ofSize: 22, weight: .semibold)
let textColor: UIColor = .LineSDKLabel
let textColor: UIColor = .label
let placeholderFont: UIFont = .systemFont(ofSize: 22, weight: .semibold)
let placeholderColor = UIColor.LineSDKSecondaryLabel.withAlphaComponent(0.7)
let placeholderColor = UIColor.secondaryLabel.withAlphaComponent(0.7)
let textCountLabelFont: UIFont = .systemFont(ofSize: 12)
let textCountLabelColor: UIColor = .LineSDKSecondaryLabel
let textCountLabelColor: UIColor = .secondaryLabel
let showCountLimitLabel = false
let showUnderBorderLine = true
}
Expand Down Expand Up @@ -107,7 +107,7 @@ class OpenChatUserProfileViewController: UIViewController {
private lazy var nickNameTipLabel: UILabel = {
let label = UILabel()
label.font = .systemFont(ofSize: 13)
label.textColor = UIColor.LineSDKSecondaryLabel.withAlphaComponent(0.7)
label.textColor = UIColor.secondaryLabel.withAlphaComponent(0.7)
label.textAlignment = .center
label.numberOfLines = 0
label.text = String(format: Localization.string("openchat.create.profile.input.guide"), formItem.roomName)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class PageTabView: UIView {
class TabView: UIControl {
enum Design {
static var titleColor: UIColor { return .systemGray }
static var selectedTitleColor: UIColor { return .LineSDKLabel }
static var selectedTitleColor: UIColor { return .label }

static var titleFont: UIFont { return .systemFont(ofSize: 15) }
static var selectedTitleFont: UIFont { return .systemFont(ofSize: 15, weight: .semibold) }
Expand Down Expand Up @@ -82,7 +82,7 @@ class PageTabView: UIView {
enum Design {
static var height: CGFloat { return 3 }
static var widthMargin: CGFloat { return 4 }
static var color: UIColor { return .LineSDKLabel }
static var color: UIColor { return .label }
}

private let underline: UIView = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import UIKit
class PageViewController: UIViewController {

enum Design {
static var backgroundColor: UIColor { return .LineSDKSystemBackground }
static var backgroundColor: UIColor { return .systemBackground }
}

struct Page {
Expand Down
Loading
Loading