diff --git a/AppMessage/AppMessage.xcodeproj/project.pbxproj b/AppMessage/AppMessage.xcodeproj/project.pbxproj index c6b7b1a..92f58f1 100644 --- a/AppMessage/AppMessage.xcodeproj/project.pbxproj +++ b/AppMessage/AppMessage.xcodeproj/project.pbxproj @@ -285,13 +285,13 @@ isa = PBXProject; attributes = { LastSwiftUpdateCheck = 0710; - LastUpgradeCheck = 0900; + LastUpgradeCheck = 1020; ORGANIZATIONNAME = mirabeau; TargetAttributes = { 7F434A2219628D490081F35C = { CreatedOnToolsVersion = 6.0; DevelopmentTeam = X356V8CMHF; - LastSwiftMigration = 0900; + LastSwiftMigration = 1020; SystemCapabilities = { com.apple.BackgroundModes = { enabled = 1; @@ -440,6 +440,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; @@ -448,12 +449,14 @@ CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; @@ -494,6 +497,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; @@ -502,12 +506,14 @@ CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; @@ -556,8 +562,7 @@ PROVISIONING_PROFILE = ""; SWIFT_OBJC_BRIDGING_HEADER = "AppMessage/AppMessage-Bridging-Header.h"; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_SWIFT3_OBJC_INFERENCE = Default; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Debug; @@ -580,8 +585,7 @@ PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE = ""; SWIFT_OBJC_BRIDGING_HEADER = "AppMessage/AppMessage-Bridging-Header.h"; - SWIFT_SWIFT3_OBJC_INFERENCE = Default; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Release; diff --git a/AppMessage/AppMessage.xcodeproj/xcshareddata/xcschemes/AppMessage.xcscheme b/AppMessage/AppMessage.xcodeproj/xcshareddata/xcschemes/AppMessage.xcscheme index c9178f8..4866bf2 100755 --- a/AppMessage/AppMessage.xcodeproj/xcshareddata/xcschemes/AppMessage.xcscheme +++ b/AppMessage/AppMessage.xcodeproj/xcshareddata/xcschemes/AppMessage.xcscheme @@ -1,6 +1,6 @@ @@ -46,7 +45,6 @@ buildConfiguration = "Debug" selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" - language = "" launchStyle = "0" useCustomWorkingDirectory = "NO" ignoresPersistentStateOnLaunch = "NO" diff --git a/AppMessage/AppMessage/AppDelegate.swift b/AppMessage/AppMessage/AppDelegate.swift index b665c28..71f983d 100755 --- a/AppMessage/AppMessage/AppDelegate.swift +++ b/AppMessage/AppMessage/AppDelegate.swift @@ -15,7 +15,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 { // Only call this line once. It will make sure the recordType are there in iCloud. // After this, go to the iCloud dashboard and make all metadata for each recordType queryable and sortable! diff --git a/AppMessage/AppMessage/Async.swift b/AppMessage/AppMessage/Async.swift index 3f0a8c0..6a36c8e 100644 --- a/AppMessage/AppMessage/Async.swift +++ b/AppMessage/AppMessage/Async.swift @@ -762,6 +762,8 @@ public extension DispatchQoS.QoSClass { case .utility: return "Utility" case .background: return "Background" case .unspecified: return "Unspecified" + @unknown default: + return "Unspecified" } } } diff --git a/AppMessage/AppMessage/Controlers/ChatViewController.swift b/AppMessage/AppMessage/Controlers/ChatViewController.swift index 3c2821d..58235b0 100755 --- a/AppMessage/AppMessage/Controlers/ChatViewController.swift +++ b/AppMessage/AppMessage/Controlers/ChatViewController.swift @@ -169,7 +169,7 @@ class ChatViewController: JSQMessagesViewController, UIActionSheetDelegate, Uzys let filePath = (docDirPaths[0] as NSString).appendingPathComponent("\(id).png") if let asset = item as? Asset { if let image = asset.File?.image() { - if let myData = UIImagePNGRepresentation(image) { + if let myData = image.pngData() { try? myData.write(to: URL(fileURLWithPath: filePath), options: [.atomic]) } } @@ -335,7 +335,7 @@ class ChatViewController: JSQMessagesViewController, UIActionSheetDelegate, Uzys let docDirPath = NSSearchPathForDirectoriesInDomains(.cachesDirectory, .userDomainMask, true)[0] as NSString let filePath = docDirPath.appendingPathComponent("Image_\(i).png") let image = getUIImageFromCTAsset(asset as! ALAsset) - if let myData = UIImagePNGRepresentation(image) { + if let myData = image.pngData() { try? myData.write(to: URL(fileURLWithPath: filePath), options: [.atomic]) } @@ -399,7 +399,7 @@ class ChatViewController: JSQMessagesViewController, UIActionSheetDelegate, Uzys let representation: ALAssetRepresentation = (asset as ALAsset).defaultRepresentation() let img: CGImage = representation.fullResolutionImage().takeUnretainedValue() let scale: CGFloat = CGFloat(representation.scale()) - let orientation: UIImageOrientation = UIImageOrientation(rawValue: representation.orientation().rawValue)! + let orientation: UIImage.Orientation = UIImage.Orientation(rawValue: representation.orientation().rawValue)! let image: UIImage = UIImage(cgImage: img, scale: scale, orientation: orientation) return image.resizedImageToFit(in: CGSize(width: 640, height: 640), scaleIfSmaller: true) @@ -498,15 +498,15 @@ class ChatViewController: JSQMessagesViewController, UIActionSheetDelegate, Uzys firstName = (EVCloudData.publicDB.dao.activeUser as? CKUserIdentity)?.nameComponents?.givenName ?? "" lastName = (EVCloudData.publicDB.dao.activeUser as? CKUserIdentity)?.nameComponents?.familyName ?? "" } else { - firstName = (EVCloudData.publicDB.dao.activeUser as? CKDiscoveredUserInfo)?.firstName ?? "" - lastName = (EVCloudData.publicDB.dao.activeUser as? CKDiscoveredUserInfo)?.lastName ?? "" + firstName = (EVCloudData.publicDB.dao.activeUser as? CKDiscoveredUserInfo)?.displayContact?.givenName ?? "" + lastName = (EVCloudData.publicDB.dao.activeUser as? CKDiscoveredUserInfo)?.displayContact?.familyName ?? "" } - initials = "\(String(describing: firstName.characters.first)) \(String(describing: lastName.characters.first))" + initials = "\(String(describing: firstName.first)) \(String(describing: lastName.first))" //initials = "\(Array(arrayLiteral: firstName)[0]) \(Array(arrayLiteral: lastName)[0])" } else { //initials = "\(Array(arrayLiteral: chatWithFirstName)[0]) \(Array(arrayLiteral: chatWithLastName)[0])" - initials = "\(String(describing: chatWithFirstName.characters.first)) \(String(describing: chatWithLastName.characters.first))" + initials = "\(String(describing: chatWithFirstName.first)) \(String(describing: chatWithLastName.first))" } let size: CGFloat = 14 @@ -548,7 +548,7 @@ class ChatViewController: JSQMessagesViewController, UIActionSheetDelegate, Uzys if data.MessageType == MessageTypeEnum.Picture.rawValue { viewController.title = "Photo" let photoView = VIPhotoView(frame:self.navigationController!.view.bounds, andImage:(message.media as? JSQPhotoMediaItem)?.image) - photoView?.autoresizingMask = UIViewAutoresizing(rawValue:1 << 6 - 1) + photoView?.autoresizingMask = UIView.AutoresizingMask(rawValue:1 << 6 - 1) viewController.view.addSubview(photoView!) self.navigationController!.pushViewController(viewController, animated: true) } else if data.MessageType == MessageTypeEnum.Location.rawValue { @@ -568,8 +568,9 @@ class ChatViewController: JSQMessagesViewController, UIActionSheetDelegate, Uzys } } - func mapView(_ mapView: MKMapView, annotationView view: MKAnnotationView, didChange newState: MKAnnotationViewDragState, fromOldState oldState: MKAnnotationViewDragState) { - mapView.setRegion(MKCoordinateRegionMakeWithDistance(view.annotation!.coordinate, 1000, 1000), animated: true) + func mapView(_ mapView: MKMapView, annotationView view: MKAnnotationView, didChange newState: MKAnnotationView.DragState, fromOldState oldState: MKAnnotationView.DragState) { + let region = MKCoordinateRegion(center: view.annotation!.coordinate, latitudinalMeters: 1000, longitudinalMeters: 1000) + mapView.setRegion(region, animated: true) } override func collectionView(_ collectionView: JSQMessagesCollectionView!, didTapCellAt indexPath: IndexPath!, touchLocation: CGPoint) { @@ -590,7 +591,7 @@ class ChatViewController: JSQMessagesViewController, UIActionSheetDelegate, Uzys self.localData = [JSQMessage?](repeating: nil, count: count) } if id < count { - data = EVCloudData.publicDB.data[self.dataID]![count - id - 1] as! Message + data = EVCloudData.publicDB.data[self.dataID]![count - id - 1] as? Message } else { data = Message() } diff --git a/AppMessage/AppMessage/Controlers/LeftMenuViewController.swift b/AppMessage/AppMessage/Controlers/LeftMenuViewController.swift index 182ac62..92f446f 100755 --- a/AppMessage/AppMessage/Controlers/LeftMenuViewController.swift +++ b/AppMessage/AppMessage/Controlers/LeftMenuViewController.swift @@ -121,8 +121,8 @@ class LeftMenuViewController: UIViewController, UITableViewDataSource, UITableVi let lastName: String = (user as! CKUserIdentity).nameComponents?.familyName ?? "" startChat((user as! CKUserIdentity).userRecordID!.recordName, firstName: firstName, lastName: lastName) } else { - let firstName: String = (user as! CKDiscoveredUserInfo).firstName ?? "" - let lastName: String = (user as! CKDiscoveredUserInfo).lastName ?? "" + let firstName: String = (user as! CKDiscoveredUserInfo).displayContact?.givenName ?? "" + let lastName: String = (user as! CKDiscoveredUserInfo).displayContact?.familyName ?? "" startChat((user as! CKDiscoveredUserInfo).userRecordID!.recordName, firstName: firstName, lastName: lastName) } } diff --git a/AppMessage/AppMessage/Controlers/NewsViewController.swift b/AppMessage/AppMessage/Controlers/NewsViewController.swift index bc48d38..85b1069 100755 --- a/AppMessage/AppMessage/Controlers/NewsViewController.swift +++ b/AppMessage/AppMessage/Controlers/NewsViewController.swift @@ -82,7 +82,7 @@ class NewsViewController: UIViewController, UITableViewDataSource, UITableViewDe if let news: News = EVCloudData.publicDB.data["News_All"]![(indexPath as NSIndexPath).row] as? News { if let url: URL = URL(string: news.ActionUrl) { if #available(iOS 10.0, *) { - UIApplication.shared.open(url, options: [:], completionHandler: nil) + UIApplication.shared.open(url, options: convertToUIApplicationOpenExternalURLOptionsKeyDictionary([:]), completionHandler: nil) } else { UIApplication.shared.openURL(url) } @@ -91,3 +91,8 @@ class NewsViewController: UIViewController, UITableViewDataSource, UITableViewDe } } + +// Helper function inserted by Swift 4.2 migrator. +fileprivate func convertToUIApplicationOpenExternalURLOptionsKeyDictionary(_ input: [String: Any]) -> [UIApplication.OpenExternalURLOptionsKey: Any] { + return Dictionary(uniqueKeysWithValues: input.map { key, value in (UIApplication.OpenExternalURLOptionsKey(rawValue: key), value)}) +} diff --git a/AppMessage/AppMessage/Controlers/RootViewController.swift b/AppMessage/AppMessage/Controlers/RootViewController.swift index 4484d00..cbc5b77 100755 --- a/AppMessage/AppMessage/Controlers/RootViewController.swift +++ b/AppMessage/AppMessage/Controlers/RootViewController.swift @@ -28,7 +28,7 @@ class RootViewController: UIViewController { NotificationCenter.default.addObserver(forName: NSNotification.Name.NSUbiquityIdentityDidChange, object: nil, queue: nil) { _ in EVLog("The user’s iCloud login changed: should refresh all user data.") Async.main { - self.viewController?.removeFromParentViewController() + self.viewController?.removeFromParent() } return } diff --git a/AppMessage/AppMessage/Controlers/TestsViewController.swift b/AppMessage/AppMessage/Controlers/TestsViewController.swift index 1e9641d..13fcce7 100755 --- a/AppMessage/AppMessage/Controlers/TestsViewController.swift +++ b/AppMessage/AppMessage/Controlers/TestsViewController.swift @@ -50,11 +50,11 @@ class TestsViewController: UIViewController { func conflictTest() { let message = Message() - message.recordID = CKRecordID(recordName: "We use this twice") + message.recordID = CKRecord.ID(recordName: "We use this twice") message.Text = "This is the message text" let message2 = Message() - message2.recordID = CKRecordID(recordName: "We use this twice") + message2.recordID = CKRecord.ID(recordName: "We use this twice") message2.Text = "This is an other message text" self.dao.saveItem(message, completionHandler: {record in @@ -199,7 +199,7 @@ class TestsViewController: UIViewController { }) // Get all records of a recordType that are created by me using a predicate - let predicate = NSPredicate(format: "creatorUserRecordID == %@", CKRecordID(recordName: userId)) + let predicate = NSPredicate(format: "creatorUserRecordID == %@", CKRecord.ID(recordName: userId)) dao.query(Message(), predicate:predicate, completionHandler: { results, isFinished in EVLog("query recordType created by: result count = \(results.count)") return false diff --git a/AppMessage/AppMessage/DataObjects/CKAsset+UIImage.swift b/AppMessage/AppMessage/DataObjects/CKAsset+UIImage.swift index 46a35c9..fc2c671 100755 --- a/AppMessage/AppMessage/DataObjects/CKAsset+UIImage.swift +++ b/AppMessage/AppMessage/DataObjects/CKAsset+UIImage.swift @@ -10,8 +10,8 @@ import CloudKit import UIKit public extension CKAsset { - public func image() -> UIImage? { - if let data = try? Data(contentsOf: self.fileURL) { + func image() -> UIImage? { + if let data = try? Data(contentsOf: self.fileURL!) { return UIImage(data: data) } return nil diff --git a/AppMessage/AppMessage/DataObjects/Message.swift b/AppMessage/AppMessage/DataObjects/Message.swift index d3f6bde..76014f7 100755 --- a/AppMessage/AppMessage/DataObjects/Message.swift +++ b/AppMessage/AppMessage/DataObjects/Message.swift @@ -17,21 +17,21 @@ enum MessageTypeEnum: String { class Message: CKDataObject { // From which Channel is this message - var From: CKReference? // = CKReference(recordID: CKRecordID(recordName: "N/A"), action: CKReferenceAction.None) + var From: CKRecord.Reference? // = CKReference(recordID: CKRecordID(recordName: "N/A"), action: CKReferenceAction.None) var From_ID: String = "" func setFromFields(_ id: String) { self.From_ID = id - self.From = CKReference(recordID: CKRecordID(recordName: id), action: CKReferenceAction.deleteSelf) + self.From = CKRecord.Reference(recordID: CKRecord.ID(recordName: id), action: CKRecord.Reference.Action.deleteSelf) } var FromFirstName: String = "" var FromLastName: String = "" // To what Channel or Group is this message - var To: CKReference? // = CKReference(recordID: CKRecordID(recordName: "N/A"), action: CKReferenceAction.None) + var To: CKRecord.Reference? // = CKReference(recordID: CKRecordID(recordName: "N/A"), action: CKReferenceAction.None) var To_ID: String = "" func setToFields(_ id: String) { self.To_ID = id - self.To = CKReference(recordID: CKRecordID(recordName: id), action: CKReferenceAction.deleteSelf) + self.To = CKRecord.Reference(recordID: CKRecord.ID(recordName: id), action: CKRecord.Reference.Action.deleteSelf) } var ToFirstName: String = "" var ToLastName: String = "" @@ -43,11 +43,11 @@ class Message: CKDataObject { var MessageType: String = MessageTypeEnum.Text.rawValue // From which Channel is this message - var Asset: CKReference? // = CKReference(recordID: CKRecordID(recordName: "N/A"), action: CKReferenceAction.None) + var Asset: CKRecord.Reference? // = CKReference(recordID: CKRecordID(recordName: "N/A"), action: CKReferenceAction.None) var Asset_ID: String = "" func setAssetFields(_ id: String) { self.Asset_ID = id - self.Asset = CKReference(recordID: CKRecordID(recordName: id), action: CKReferenceAction.none) + self.Asset = CKRecord.Reference(recordID: CKRecord.ID(recordName: id), action: CKRecord.Reference.Action.none) } var Latitude: Double = 52.8350711 diff --git a/AppMessage/AppMessage/Helper.swift b/AppMessage/AppMessage/Helper.swift index 064e541..eae2d5c 100755 --- a/AppMessage/AppMessage/Helper.swift +++ b/AppMessage/AppMessage/Helper.swift @@ -26,7 +26,7 @@ class Helper { kCRToastAnimationOutDirectionKey : NSNumber(value: CRToastAnimationDirection.bottom.rawValue), ] Async.main { - CRToastManager.showNotification(options: options as! [AnyHashable: Any], completionBlock: { }) + CRToastManager.showNotification(options: options as? [AnyHashable: Any], completionBlock: { }) } } diff --git a/AppMessage/AppMessage/SSASideMenu.swift b/AppMessage/AppMessage/SSASideMenu.swift index 44d4dbd..57cb218 100755 --- a/AppMessage/AppMessage/SSASideMenu.swift +++ b/AppMessage/AppMessage/SSASideMenu.swift @@ -285,7 +285,7 @@ class SSASideMenu: UIViewController, UIGestureRecognizerDelegate { hideViewController(controller) } setupMenuViewControllerMotionEffects() - view.bringSubview(toFront: contentViewContainer) + view.bringSubviewToFront(contentViewContainer) } } @@ -298,7 +298,7 @@ class SSASideMenu: UIViewController, UIGestureRecognizerDelegate { hideViewController(controller) } setupMenuViewControllerMotionEffects() - view.bringSubview(toFront: contentViewContainer) + view.bringSubviewToFront(contentViewContainer) } } @@ -432,7 +432,7 @@ class SSASideMenu: UIViewController, UIGestureRecognizerDelegate { let centerXLandscape = CGFloat(contentViewInLandscapeOffsetCenterX) + (iOS8 ? CGFloat(view.frame.width) : CGFloat(view.frame.height)) let centerXPortrait = CGFloat(contentViewInPortraitOffsetCenterX) + CGFloat(view.frame.width) - let centerX = UIInterfaceOrientationIsLandscape(UIApplication.shared.statusBarOrientation) ? centerXLandscape : centerXPortrait + let centerX = UIApplication.shared.statusBarOrientation.isLandscape ? centerXLandscape : centerXPortrait contentViewContainer.center = CGPoint(x: centerX, y: contentViewContainer.center.y) // contentViewContainer.frame.origin.x = self.view.frame.width * 0.75 @@ -442,7 +442,7 @@ class SSASideMenu: UIViewController, UIGestureRecognizerDelegate { let centerXLandscape = -CGFloat(self.contentViewInLandscapeOffsetCenterX) let centerXPortrait = CGFloat(-self.contentViewInPortraitOffsetCenterX) - let centerX = UIInterfaceOrientationIsLandscape(UIApplication.shared.statusBarOrientation) ? centerXLandscape : centerXPortrait + let centerX = UIApplication.shared.statusBarOrientation.isLandscape ? centerXLandscape : centerXPortrait contentViewContainer.center = CGPoint.init(x: centerX, y: contentViewContainer.center.y) } @@ -653,18 +653,18 @@ class SSASideMenu: UIViewController, UIGestureRecognizerDelegate { fileprivate func setupViewController(_ targetView: UIView, targetViewController: UIViewController?) { if let viewController = targetViewController { - addChildViewController(viewController) + addChild(viewController) viewController.view.frame = view.bounds viewController.view.autoresizingMask = [.flexibleWidth, .flexibleHeight] targetView.addSubview(viewController.view) - viewController.didMove(toParentViewController: self) + viewController.didMove(toParent: self) } } fileprivate func hideViewController(_ targetViewController: UIViewController) { - targetViewController.willMove(toParentViewController: nil) + targetViewController.willMove(toParent: nil) targetViewController.view.removeFromSuperview() - targetViewController.removeFromParentViewController() + targetViewController.removeFromParent() } // MARK : Layout @@ -675,7 +675,7 @@ class SSASideMenu: UIViewController, UIGestureRecognizerDelegate { return } else { contentButton.addTarget(self, action: #selector(SSASideMenu.hideMenuViewController as (SSASideMenu) -> () -> ()), for:.touchUpInside) - contentButton.autoresizingMask = UIViewAutoresizing() + contentButton.autoresizingMask = UIView.AutoresizingMask() contentButton.frame = contentViewContainer.bounds contentButton.autoresizingMask = [.flexibleWidth, .flexibleHeight] contentButton.tag = 101 @@ -817,7 +817,7 @@ class SSASideMenu: UIViewController, UIGestureRecognizerDelegate { let centerXLandscape = CGFloat(contentViewInLandscapeOffsetCenterX) + (iOS8 ? CGFloat(view.frame.width) : CGFloat(view.frame.height)) let centerXPortrait = CGFloat(contentViewInPortraitOffsetCenterX) + CGFloat(view.frame.width) - let centerX = UIInterfaceOrientationIsLandscape(UIApplication.shared.statusBarOrientation) ? centerXLandscape : centerXPortrait + let centerX = UIApplication.shared.statusBarOrientation.isLandscape ? centerXLandscape : centerXPortrait center = CGPoint.init(x: centerX, y: contentViewContainer.center.y) @@ -826,7 +826,7 @@ class SSASideMenu: UIViewController, UIGestureRecognizerDelegate { let centerXLandscape = -CGFloat(self.contentViewInLandscapeOffsetCenterX) let centerXPortrait = CGFloat(-self.contentViewInPortraitOffsetCenterX) - let centerX = UIInterfaceOrientationIsLandscape(UIApplication.shared.statusBarOrientation) ? centerXLandscape : centerXPortrait + let centerX = UIApplication.shared.statusBarOrientation.isLandscape ? centerXLandscape : centerXPortrait center = CGPoint.init(x: centerX, y: contentViewContainer.center.y) } @@ -971,7 +971,7 @@ class SSASideMenu: UIViewController, UIGestureRecognizerDelegate { delta = point.x / view.frame.size.width } - delta = min(fabs(delta), 1.6) + delta = min(abs(delta), 1.6) var contentViewScale: CGFloat = type == .scale ? 1 - ((1 - CGFloat(contentViewScaleValue)) * delta) : 1 diff --git a/EVCloudKitDao.podspec b/EVCloudKitDao.podspec index 6312c92..68c6554 100755 --- a/EVCloudKitDao.podspec +++ b/EVCloudKitDao.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = "EVCloudKitDao" - s.version = "3.5.2" + s.version = "3.6.0" s.summary = "iOS: Simplified access to Apple’s CloudKit" s.description = "Simplified access to Apple’s CloudKit using reflection and generics" diff --git a/UnitTests/UnitTests.xcodeproj/project.pbxproj b/UnitTests/UnitTests.xcodeproj/project.pbxproj index ea02152..a21626b 100644 --- a/UnitTests/UnitTests.xcodeproj/project.pbxproj +++ b/UnitTests/UnitTests.xcodeproj/project.pbxproj @@ -146,7 +146,7 @@ isa = PBXProject; attributes = { LastSwiftUpdateCheck = 0710; - LastUpgradeCheck = 0900; + LastUpgradeCheck = 1020; ORGANIZATIONNAME = mirabeau; TargetAttributes = { 7F29764D1BB93D6A0074C85A = { @@ -164,6 +164,7 @@ developmentRegion = English; hasScannedForEncodings = 0; knownRegions = ( + English, en, Base, ); @@ -341,6 +342,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; @@ -349,12 +351,14 @@ CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; @@ -395,6 +399,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; @@ -403,12 +408,14 @@ CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; diff --git a/UnitTests/UnitTests.xcodeproj/xcshareddata/xcschemes/OSXTest.xcscheme b/UnitTests/UnitTests.xcodeproj/xcshareddata/xcschemes/OSXTest.xcscheme index ca533ea..d4645f0 100755 --- a/UnitTests/UnitTests.xcodeproj/xcshareddata/xcschemes/OSXTest.xcscheme +++ b/UnitTests/UnitTests.xcodeproj/xcshareddata/xcschemes/OSXTest.xcscheme @@ -1,6 +1,6 @@