Commit de2bb069 authored by emrcftci's avatar emrcftci Committed by Amritpal Sandhu
Browse files

refactor(*): Upgrade to Swift 5

parent db1452aa
......@@ -327,7 +327,7 @@
TargetAttributes = {
8A22EDFF1F9A9F40003A7F21 = {
CreatedOnToolsVersion = 9.0;
LastSwiftMigration = 0910;
LastSwiftMigration = 1120;
ProvisioningStyle = Automatic;
SystemCapabilities = {
com.apple.ApplicationGroups.iOS = {
......@@ -580,7 +580,7 @@
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "WAStickersThirdParty/WAStickersThirdParty-Bridging-Header.h";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = 1;
};
name = Debug;
......@@ -603,7 +603,7 @@
PRODUCT_BUNDLE_IDENTIFIER = WA.WAStickersThirdParty;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "WAStickersThirdParty/WAStickersThirdParty-Bridging-Header.h";
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = 1;
};
name = Release;
......
......@@ -13,7 +13,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.
return true
}
......
......@@ -37,7 +37,7 @@ struct Interoperability {
}
if #available(iOS 10.0, *) {
pasteboard.setItems([[PasteboardStickerPackDataType: dataToSend]], options: [UIPasteboardOption.localOnly: true, UIPasteboardOption.expirationDate: NSDate(timeIntervalSinceNow: PasteboardExpirationSeconds)])
pasteboard.setItems([[PasteboardStickerPackDataType: dataToSend]], options: [UIPasteboard.OptionsKey.localOnly: true, UIPasteboard.OptionsKey.expirationDate: NSDate(timeIntervalSinceNow: PasteboardExpirationSeconds)])
} else {
pasteboard.setData(dataToSend, forPasteboardType: PasteboardStickerPackDataType)
}
......
......@@ -184,7 +184,7 @@ class StickerPack {
json["identifier"] = self.identifier
json["name"] = self.name
json["publisher"] = self.publisher
json["tray_image"] = UIImagePNGRepresentation(self.trayImage.image!)?.base64EncodedString()
json["tray_image"] = self.trayImage.image!.pngData()?.base64EncodedString()
var stickersArray: [[String: Any]] = []
for sticker in self.stickers {
......
......@@ -27,7 +27,7 @@ class StickerPackInfoViewController: UITableViewController {
insets = tableView.safeAreaInsets
}
footerView.label.preferredMaxLayoutWidth = footerView.preferredLabelLayoutWidth(viewWidth: tableView.bounds.size.width - FooterView.MARGIN * 2 - insets.left - insets.right)
return ceil(footerView.systemLayoutSizeFitting(UILayoutFittingCompressedSize).height)
return ceil(footerView.systemLayoutSizeFitting(UIView.layoutFittingCompressedSize).height)
}
var stickerPack: StickerPack!
......
......@@ -94,6 +94,8 @@ class StickerPackViewController: UIViewController, UICollectionViewDataSource, U
let buttonLandscapeSize: CGSize = CGSize(width: 250.0, height: 50.0)
let buttonBottomMargin: CGFloat = 20.0
guard let view = view else { return }
// Share button constraints
view.addConstraint(NSLayoutConstraint(item: view, attribute: .bottomMargin, relatedBy: .equal, toItem: shareButton, attribute: .bottom, multiplier: 1.0, constant: buttonBottomMargin))
let centerPortraitShareConstraint = NSLayoutConstraint(item: view, attribute: .centerXWithinMargins, relatedBy: .equal, toItem: shareButton, attribute: .centerXWithinMargins, multiplier: 1.0, constant: 0.0)
......
......@@ -10,7 +10,7 @@ import UIKit
extension UIAlertController {
func addSpinner() {
let activity: UIActivityIndicatorView = UIActivityIndicatorView(activityIndicatorStyle: .gray)
let activity: UIActivityIndicatorView = UIActivityIndicatorView(style: .gray)
view.addSubview(activity)
activity.translatesAutoresizingMaskIntoConstraints = false
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment