Skip to content

Commit

Permalink
update for swift 4.2 and xcode 10.0
Browse files Browse the repository at this point in the history
  • Loading branch information
rafiki270 committed Jun 6, 2018
1 parent d1d3eec commit 4e3ec32
Show file tree
Hide file tree
Showing 9 changed files with 31 additions and 23 deletions.
12 changes: 10 additions & 2 deletions Example/Pods/Pods.xcodeproj/project.pbxproj

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

8 changes: 4 additions & 4 deletions Example/Presentables.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};
};
Expand Down Expand Up @@ -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;
Expand All @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion Example/Presentables/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion Example/Presentables/TableViewCell.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
18 changes: 9 additions & 9 deletions Example/Presentables/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand All @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion Presentables.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ extension UICollectionView {

open func register<T>(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<T>(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)
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -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? {
Expand All @@ -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) {
Expand Down

0 comments on commit 4e3ec32

Please sign in to comment.