diff --git a/Example/Pods/Pods.xcodeproj/project.pbxproj b/Example/Pods/Pods.xcodeproj/project.pbxproj index 586dde9..65eee40 100644 --- a/Example/Pods/Pods.xcodeproj/project.pbxproj +++ b/Example/Pods/Pods.xcodeproj/project.pbxproj @@ -576,6 +576,14 @@ attributes = { LastSwiftUpdateCheck = 0930; LastUpgradeCheck = 0920; + TargetAttributes = { + 42496662329BEC99D782A6A4A2E9768F = { + LastSwiftMigration = 1000; + }; + 4AA478CE19FF7815EB2981781A3E4C07 = { + LastSwiftMigration = 1000; + }; + }; }; buildConfigurationList = 2D8E8EC45A3A1A1D94AE762CB5028504 /* Build configuration list for PBXProject "Pods" */; compatibilityVersion = "Xcode 3.2"; @@ -787,7 +795,7 @@ SKIP_INSTALL = YES; SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) "; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 4.2; TARGETED_DEVICE_FAMILY = "1,2"; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; @@ -913,7 +921,7 @@ SKIP_INSTALL = YES; SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) "; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 4.2; TARGETED_DEVICE_FAMILY = "1,2"; VALIDATE_PRODUCT = YES; VERSIONING_SYSTEM = "apple-generic"; diff --git a/Example/Presentables.xcodeproj/project.pbxproj b/Example/Presentables.xcodeproj/project.pbxproj index e05622a..3dd8417 100644 --- a/Example/Presentables.xcodeproj/project.pbxproj +++ b/Example/Presentables.xcodeproj/project.pbxproj @@ -259,11 +259,11 @@ TargetAttributes = { 607FACCF1AFB9204008FA782 = { CreatedOnToolsVersion = 6.3.1; - LastSwiftMigration = 0900; + LastSwiftMigration = 1000; }; 607FACE41AFB9204008FA782 = { CreatedOnToolsVersion = 6.3.1; - LastSwiftMigration = 0900; + LastSwiftMigration = 1000; TestTargetID = 607FACCF1AFB9204008FA782; }; }; @@ -571,7 +571,7 @@ MODULE_NAME = ExampleApp; PRODUCT_BUNDLE_IDENTIFIER = "org.mangowebuk.Presentables-Example"; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 4.2; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Debug; @@ -586,7 +586,7 @@ MODULE_NAME = ExampleApp; PRODUCT_BUNDLE_IDENTIFIER = "org.mangowebuk.Presentables-Example"; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 4.2; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Release; diff --git a/Example/Presentables/AppDelegate.swift b/Example/Presentables/AppDelegate.swift index 769e5db..1c1d4be 100644 --- a/Example/Presentables/AppDelegate.swift +++ b/Example/Presentables/AppDelegate.swift @@ -14,7 +14,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 { window = UIWindow(frame: UIScreen.main.bounds) let homeViewController = ViewController() diff --git a/Example/Presentables/TableViewCell.swift b/Example/Presentables/TableViewCell.swift index d9f6eda..2f8c243 100644 --- a/Example/Presentables/TableViewCell.swift +++ b/Example/Presentables/TableViewCell.swift @@ -17,7 +17,7 @@ class TableViewCell: UITableViewCell { } - override init(style: UITableViewCellStyle, reuseIdentifier: String?) { + override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) { super.init(style: .subtitle, reuseIdentifier: reuseIdentifier) configure() diff --git a/Example/Presentables/ViewController.swift b/Example/Presentables/ViewController.swift index 32232c3..04be9f0 100644 --- a/Example/Presentables/ViewController.swift +++ b/Example/Presentables/ViewController.swift @@ -26,10 +26,10 @@ class ViewController: UIViewController { let tableButton = UIButton() tableButton.backgroundColor = tableButton.tintColor tableButton.layer.cornerRadius = 6 - tableButton.setTitle("Table view example", for: .normal) - tableButton.setTitleColor(.white, for: .normal) + tableButton.setTitle("Table view example", for: UIControl.State.normal) + tableButton.setTitleColor(.white, for: UIControl.State.normal) view.addSubview(tableButton) - tableButton.addTarget(self, action: #selector(didTapTableButton), for: .touchUpInside) + tableButton.addTarget(self, action: #selector(didTapTableButton), for: UIControl.Event.touchUpInside) tableButton.snp.makeConstraints { (make) in make.top.equalTo(120) make.left.equalTo(20) @@ -40,10 +40,10 @@ class ViewController: UIViewController { let tableButton2 = UIButton() tableButton2.backgroundColor = tableButton2.tintColor tableButton2.layer.cornerRadius = 6 - tableButton2.setTitle("Table view example 2", for: .normal) - tableButton2.setTitleColor(.white, for: .normal) + tableButton2.setTitle("Table view example 2", for: UIControl.State.normal) + tableButton2.setTitleColor(.white, for: UIControl.State.normal) view.addSubview(tableButton2) - tableButton2.addTarget(self, action: #selector(didTapTable2Button), for: .touchUpInside) + tableButton2.addTarget(self, action: #selector(didTapTable2Button), for: UIControl.Event.touchUpInside) tableButton2.snp.makeConstraints { (make) in make.top.equalTo(tableButton.snp.bottom).offset(20) make.left.right.height.equalTo(tableButton) @@ -52,10 +52,10 @@ class ViewController: UIViewController { let collectionButton = UIButton() collectionButton.backgroundColor = collectionButton.tintColor collectionButton.layer.cornerRadius = 6 - collectionButton.setTitle("Collection view example", for: .normal) - collectionButton.setTitleColor(.white, for: .normal) + collectionButton.setTitle("Collection view example", for: UIControl.State.normal) + collectionButton.setTitleColor(.white, for: UIControl.State.normal) view.addSubview(collectionButton) - collectionButton.addTarget(self, action: #selector(didTapCollectionButton), for: .touchUpInside) + collectionButton.addTarget(self, action: #selector(didTapCollectionButton), for: UIControl.Event.touchUpInside) collectionButton.snp.makeConstraints { (make) in make.top.equalTo(tableButton2.snp.bottom).offset(20) make.left.right.height.equalTo(tableButton2) diff --git a/Presentables.podspec b/Presentables.podspec index 5e85c9f..9c547b5 100644 --- a/Presentables.podspec +++ b/Presentables.podspec @@ -8,7 +8,7 @@ Pod::Spec.new do |s| s.name = 'Presentables' - s.version = '0.6.7' + s.version = '0.7.0' s.summary = 'Simple reactive library for managing table views & collection views, written in Swift' # This description is used to generate tags and improve search results. diff --git a/Presentables/Classes/Collection views/PresentableCollectionViewDataManager.swift b/Presentables/Classes/Collection views/PresentableCollectionViewDataManager.swift index a423dfc..84efba3 100644 --- a/Presentables/Classes/Collection views/PresentableCollectionViewDataManager.swift +++ b/Presentables/Classes/Collection views/PresentableCollectionViewDataManager.swift @@ -65,7 +65,7 @@ open class PresentableCollectionViewDataManager: NSObject, PresentableManager, U } open func collectionView(_ collectionView: UICollectionView, viewForSupplementaryElementOfKind kind: String, at indexPath: IndexPath) -> UICollectionReusableView { - if kind == UICollectionElementKindSectionHeader { + if kind == UICollectionView.elementKindSectionHeader { guard let presentable: AnyPresentable = data.header(forSection: indexPath.section) else { fatalError() } diff --git a/Presentables/Classes/Collection views/UICollectionView+Presentables.swift b/Presentables/Classes/Collection views/UICollectionView+Presentables.swift index 01e4fe8..f45fe55 100644 --- a/Presentables/Classes/Collection views/UICollectionView+Presentables.swift +++ b/Presentables/Classes/Collection views/UICollectionView+Presentables.swift @@ -18,12 +18,12 @@ extension UICollectionView { open func register(header viewClass: T.Type) where T: UICollectionReusableView { let identifier = String(describing: T.self) - register(viewClass, forSupplementaryViewOfKind: UICollectionElementKindSectionHeader, withReuseIdentifier: identifier) + register(viewClass, forSupplementaryViewOfKind: UICollectionView.elementKindSectionHeader, withReuseIdentifier: identifier) } open func register(footer viewClass: T.Type) where T: UICollectionReusableView { let identifier = String(describing: T.self) - register(viewClass, forSupplementaryViewOfKind: UICollectionElementKindSectionFooter, withReuseIdentifier: identifier) + register(viewClass, forSupplementaryViewOfKind: UICollectionView.elementKindSectionFooter, withReuseIdentifier: identifier) } } diff --git a/Presentables/Classes/Table views/PresentableTableViewDataManager.swift b/Presentables/Classes/Table views/PresentableTableViewDataManager.swift index 46b0860..552b123 100644 --- a/Presentables/Classes/Table views/PresentableTableViewDataManager.swift +++ b/Presentables/Classes/Table views/PresentableTableViewDataManager.swift @@ -94,7 +94,7 @@ open class PresentableTableViewDataManager: NSObject, PresentableManager, UITabl } open func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat { - return data[section].header == nil ? 0 : UITableViewAutomaticDimension + return data[section].header == nil ? 0 : UITableView.automaticDimension } open func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? { @@ -105,7 +105,7 @@ open class PresentableTableViewDataManager: NSObject, PresentableManager, UITabl } open func tableView(_ tableView: UITableView, heightForFooterInSection section: Int) -> CGFloat { - return data[section].footer == nil ? 0 : UITableViewAutomaticDimension + return data[section].footer == nil ? 0 : UITableView.automaticDimension } open func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {