From 09c40f710ee5c66a52a1f212eb0accea9e6ecef8 Mon Sep 17 00:00:00 2001 From: mrustaa Date: Tue, 9 Jun 2020 23:01:58 +0300 Subject: [PATCH] update 1.0.2 --- ContainerControllerSwift.podspec | 2 +- .../1.0.0/ContainerControllerSwift.podspec | 45 ---- ContainerControllerSwift/Assets/.gitkeep | 0 ContainerControllerSwift/Classes/.gitkeep | 0 .../CollectionAdapterTypes.swift | 14 -- .../ContainerTable/TableAdapterTypes.swift | 16 -- .../CollectionAdapterCell.swift | 8 +- .../CollectionAdapterCellData.swift | 2 +- .../CollectionAdapterItem.swift | 2 +- .../CollectionAdapterTypes.swift | 14 ++ .../CollectionAdapterView.swift | 10 +- .../{Classes => }/ContainerController.swift | 26 +-- .../ContainerControllerDelegate.swift | 4 +- .../{Classes => }/ContainerDevice.swift | 6 +- .../{Classes => }/ContainerLayout.swift | 6 +- .../ContainerTable/TableAdapterCell.swift | 6 +- .../ContainerTable/TableAdapterCellData.swift | 2 +- .../ContainerTable/TableAdapterItem.swift | 2 +- .../ContainerTable/TableAdapterTypes.swift | 16 ++ .../ContainerTable/TableAdapterView.swift | 10 +- .../{Classes => }/ContainerTypes.swift | 2 +- .../{Classes => }/ContainerView.swift | 4 +- .../project.pbxproj | 11 +- .../ContainerControllerSwift-Example.xcscheme | 26 +-- Example/Pods/Pods.xcodeproj/project.pbxproj | 197 +++++++++--------- 25 files changed, 192 insertions(+), 239 deletions(-) delete mode 100644 ContainerControllerSwift/1.0.0/ContainerControllerSwift.podspec delete mode 100644 ContainerControllerSwift/Assets/.gitkeep delete mode 100644 ContainerControllerSwift/Classes/.gitkeep delete mode 100644 ContainerControllerSwift/Classes/ContainerCollection/CollectionAdapterTypes.swift delete mode 100644 ContainerControllerSwift/Classes/ContainerTable/TableAdapterTypes.swift rename ContainerControllerSwift/{Classes => }/ContainerCollection/CollectionAdapterCell.swift (94%) rename ContainerControllerSwift/{Classes => }/ContainerCollection/CollectionAdapterCellData.swift (86%) rename ContainerControllerSwift/{Classes => }/ContainerCollection/CollectionAdapterItem.swift (93%) create mode 100644 ContainerControllerSwift/ContainerCollection/CollectionAdapterTypes.swift rename ContainerControllerSwift/{Classes => }/ContainerCollection/CollectionAdapterView.swift (87%) rename ContainerControllerSwift/{Classes => }/ContainerController.swift (97%) rename ContainerControllerSwift/{Classes => }/ContainerControllerDelegate.swift (91%) rename ContainerControllerSwift/{Classes => }/ContainerDevice.swift (98%) rename ContainerControllerSwift/{Classes => }/ContainerLayout.swift (96%) rename ContainerControllerSwift/{Classes => }/ContainerTable/TableAdapterCell.swift (92%) rename ContainerControllerSwift/{Classes => }/ContainerTable/TableAdapterCellData.swift (92%) rename ContainerControllerSwift/{Classes => }/ContainerTable/TableAdapterItem.swift (94%) create mode 100644 ContainerControllerSwift/ContainerTable/TableAdapterTypes.swift rename ContainerControllerSwift/{Classes => }/ContainerTable/TableAdapterView.swift (92%) rename ContainerControllerSwift/{Classes => }/ContainerTypes.swift (92%) rename ContainerControllerSwift/{Classes => }/ContainerView.swift (97%) diff --git a/ContainerControllerSwift.podspec b/ContainerControllerSwift.podspec index 404af84..aa60310 100644 --- a/ContainerControllerSwift.podspec +++ b/ContainerControllerSwift.podspec @@ -8,7 +8,7 @@ Pod::Spec.new do |s| s.name = 'ContainerControllerSwift' - s.version = '1.0.0' + s.version = '1.0.1' s.summary = 'This is a swipe-panel from application: https://www.apple.com/ios/maps/' # This description is used to generate tags and improve search results. diff --git a/ContainerControllerSwift/1.0.0/ContainerControllerSwift.podspec b/ContainerControllerSwift/1.0.0/ContainerControllerSwift.podspec deleted file mode 100644 index 404af84..0000000 --- a/ContainerControllerSwift/1.0.0/ContainerControllerSwift.podspec +++ /dev/null @@ -1,45 +0,0 @@ -# -# Be sure to run `pod lib lint ContainerControllerSwift.podspec' to ensure this is a -# valid spec before submitting. -# -# Any lines starting with a # are optional, but their use is encouraged -# To learn more about a Podspec see https://guides.cocoapods.org/syntax/podspec.html -# - -Pod::Spec.new do |s| - s.name = 'ContainerControllerSwift' - s.version = '1.0.0' - s.summary = 'This is a swipe-panel from application: https://www.apple.com/ios/maps/' - -# This description is used to generate tags and improve search results. -# * Think: What does it do? Why did you write it? What is the focus? -# * Try to keep it short, snappy and to the point. -# * Write the description between the DESC delimiters below. -# * Finally, don't worry about the indent, CocoaPods strips it! - - s.description = <<-DESC -TODO: Add long description of the pod here. -'This is a swipe-panel from application: https://www.apple.com/ios/maps/' - DESC - - s.homepage = 'https://github.com/mrustaa/ContainerController' - # s.screenshots = 'www.example.com/screenshots_1', 'www.example.com/screenshots_2' - s.license = { :type => 'MIT', :file => 'LICENSE' } - s.author = { 'rustamburger@gmail.com' => 'rustamburger@gmail.com' } - s.source = { :git => 'https://github.com/mrustaa/ContainerController.git', :tag => s.version.to_s } - # s.social_media_url = 'https://twitter.com/' - - s.swift_version = '5.2.4' - s.ios.deployment_target = '13.0' - - s.source_files = 'ContainerControllerSwift/*.{swift}' - s.source_files = 'ContainerControllerSwift/**/*.{swift}' - - # s.resource_bundles = { - # 'ContainerControllerSwift' => ['ContainerControllerSwift/Assets/*.png'] - # } - - # s.public_header_files = 'Pod/Classes/**/*.h' - # s.frameworks = 'UIKit', 'MapKit' - # s.dependency 'AFNetworking', '~> 2.3' -end diff --git a/ContainerControllerSwift/Assets/.gitkeep b/ContainerControllerSwift/Assets/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/ContainerControllerSwift/Classes/.gitkeep b/ContainerControllerSwift/Classes/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/ContainerControllerSwift/Classes/ContainerCollection/CollectionAdapterTypes.swift b/ContainerControllerSwift/Classes/ContainerCollection/CollectionAdapterTypes.swift deleted file mode 100644 index d8fcfc9..0000000 --- a/ContainerControllerSwift/Classes/ContainerCollection/CollectionAdapterTypes.swift +++ /dev/null @@ -1,14 +0,0 @@ -// -// CollectionAdapterTypes.swift -// PatternsSwift -// -// Created by Рустам Мотыгуллин on 01/05/2020. -// Copyright © 2020 mrusta. All rights reserved. -// - -import UIKit - -typealias CollectionAdapterCountCallback = () -> Int -typealias CollectionAdapterCellIndexCallback = (_ index: Int) -> UICollectionViewCell -typealias CollectionAdapterSizeIndexCallback = (_ index: Int) -> CGSize -typealias CollectionAdapterSelectIndexCallback = (_ index: Int) -> () diff --git a/ContainerControllerSwift/Classes/ContainerTable/TableAdapterTypes.swift b/ContainerControllerSwift/Classes/ContainerTable/TableAdapterTypes.swift deleted file mode 100644 index 92c489a..0000000 --- a/ContainerControllerSwift/Classes/ContainerTable/TableAdapterTypes.swift +++ /dev/null @@ -1,16 +0,0 @@ -// -// ContainerTypes.swift -// PatternsSwift -// -// Created by Рустам Мотыгуллин on 21/04/2020. -// Copyright © 2020 mrusta. All rights reserved. -// - -import UIKit - -typealias TableAdapterCountCallback = () -> Int -typealias TableAdapterCellIndexCallback = (_ index: Int) -> UITableViewCell -typealias TableAdapterHeightIndexCallback = (_ index: Int) -> CGFloat -typealias TableAdapterSelectIndexCallback = (_ index: Int) -> () -typealias TableAdapterDidScrollCallback = () -> () -typealias TableAdapterDeleteIndexCallback = (_ index: Int) -> () diff --git a/ContainerControllerSwift/Classes/ContainerCollection/CollectionAdapterCell.swift b/ContainerControllerSwift/ContainerCollection/CollectionAdapterCell.swift similarity index 94% rename from ContainerControllerSwift/Classes/ContainerCollection/CollectionAdapterCell.swift rename to ContainerControllerSwift/ContainerCollection/CollectionAdapterCell.swift index 30fa727..0819093 100644 --- a/ContainerControllerSwift/Classes/ContainerCollection/CollectionAdapterCell.swift +++ b/ContainerControllerSwift/ContainerCollection/CollectionAdapterCell.swift @@ -8,7 +8,7 @@ import UIKit -class CollectionAdapterCell: UICollectionViewCell { +open class CollectionAdapterCell: UICollectionViewCell { @IBInspectable var hideAnimation: Bool = false var selectedView: UIView? @@ -24,7 +24,7 @@ class CollectionAdapterCell: UICollectionViewCell { setupCommonProperties() } - required init?(coder: NSCoder) { + required public init?(coder: NSCoder) { super.init(coder: coder) setupCommonProperties() } @@ -49,7 +49,7 @@ class CollectionAdapterCell: UICollectionViewCell { let selAlpha: CGFloat = 0.2 // 0.15 - override var isSelected: Bool { + open override var isSelected: Bool { set { super.isSelected = newValue @@ -85,7 +85,7 @@ class CollectionAdapterCell: UICollectionViewCell { } } - override var isHighlighted: Bool { + open override var isHighlighted: Bool { set { super.isHighlighted = newValue diff --git a/ContainerControllerSwift/Classes/ContainerCollection/CollectionAdapterCellData.swift b/ContainerControllerSwift/ContainerCollection/CollectionAdapterCellData.swift similarity index 86% rename from ContainerControllerSwift/Classes/ContainerCollection/CollectionAdapterCellData.swift rename to ContainerControllerSwift/ContainerCollection/CollectionAdapterCellData.swift index 34ff829..34e83d8 100644 --- a/ContainerControllerSwift/Classes/ContainerCollection/CollectionAdapterCellData.swift +++ b/ContainerControllerSwift/ContainerCollection/CollectionAdapterCellData.swift @@ -8,7 +8,7 @@ import UIKit -class CollectionAdapterCellData: NSObject { +open class CollectionAdapterCellData: NSObject { public var selectCallback: (() -> Void)? diff --git a/ContainerControllerSwift/Classes/ContainerCollection/CollectionAdapterItem.swift b/ContainerControllerSwift/ContainerCollection/CollectionAdapterItem.swift similarity index 93% rename from ContainerControllerSwift/Classes/ContainerCollection/CollectionAdapterItem.swift rename to ContainerControllerSwift/ContainerCollection/CollectionAdapterItem.swift index 192d6b7..c192fbd 100644 --- a/ContainerControllerSwift/Classes/ContainerCollection/CollectionAdapterItem.swift +++ b/ContainerControllerSwift/ContainerCollection/CollectionAdapterItem.swift @@ -8,7 +8,7 @@ import UIKit -class CollectionAdapterItem: NSObject { +open class CollectionAdapterItem: NSObject { public let cellClass: AnyClass public let cellData: CollectionAdapterCellData? diff --git a/ContainerControllerSwift/ContainerCollection/CollectionAdapterTypes.swift b/ContainerControllerSwift/ContainerCollection/CollectionAdapterTypes.swift new file mode 100644 index 0000000..f168a0a --- /dev/null +++ b/ContainerControllerSwift/ContainerCollection/CollectionAdapterTypes.swift @@ -0,0 +1,14 @@ +// +// CollectionAdapterTypes.swift +// PatternsSwift +// +// Created by Рустам Мотыгуллин on 01/05/2020. +// Copyright © 2020 mrusta. All rights reserved. +// + +import UIKit + +public typealias CollectionAdapterCountCallback = () -> Int +public typealias CollectionAdapterCellIndexCallback = (_ index: Int) -> UICollectionViewCell +public typealias CollectionAdapterSizeIndexCallback = (_ index: Int) -> CGSize +public typealias CollectionAdapterSelectIndexCallback = (_ index: Int) -> () diff --git a/ContainerControllerSwift/Classes/ContainerCollection/CollectionAdapterView.swift b/ContainerControllerSwift/ContainerCollection/CollectionAdapterView.swift similarity index 87% rename from ContainerControllerSwift/Classes/ContainerCollection/CollectionAdapterView.swift rename to ContainerControllerSwift/ContainerCollection/CollectionAdapterView.swift index 53b790d..9bde290 100644 --- a/ContainerControllerSwift/Classes/ContainerCollection/CollectionAdapterView.swift +++ b/ContainerControllerSwift/ContainerCollection/CollectionAdapterView.swift @@ -8,7 +8,7 @@ import UIKit -class CollectionAdapterView: UICollectionView { +open class CollectionAdapterView: UICollectionView { var countCallback: CollectionAdapterCountCallback? var cellIndexCallback: CollectionAdapterCellIndexCallback? @@ -17,7 +17,7 @@ class CollectionAdapterView: UICollectionView { var items: [CollectionAdapterItem] = [] - required init?(coder: NSCoder) { + required public init?(coder: NSCoder) { super.init(coder: coder) update() } @@ -64,7 +64,7 @@ class CollectionAdapterView: UICollectionView { extension CollectionAdapterView: UICollectionViewDelegate { - func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) { + public func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) { if !items.isEmpty { let item = items[indexPath.row] item.cellData?.selectCallback?() @@ -78,7 +78,7 @@ extension CollectionAdapterView: UICollectionViewDelegate { extension CollectionAdapterView: UICollectionViewDataSource { - func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { + public func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { if !items.isEmpty { return items.count } @@ -88,7 +88,7 @@ extension CollectionAdapterView: UICollectionViewDataSource { return 0 } - func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { + public func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { if !items.isEmpty { let item = items[indexPath.row] let cell = cellAt(indexPath) diff --git a/ContainerControllerSwift/Classes/ContainerController.swift b/ContainerControllerSwift/ContainerController.swift similarity index 97% rename from ContainerControllerSwift/Classes/ContainerController.swift rename to ContainerControllerSwift/ContainerController.swift index 9a006b1..f7d6d35 100644 --- a/ContainerControllerSwift/Classes/ContainerController.swift +++ b/ContainerControllerSwift/ContainerController.swift @@ -8,7 +8,7 @@ import UIKit -class ContainerController: NSObject { +open class ContainerController: NSObject { // MARK: Views @@ -1094,7 +1094,7 @@ class ContainerController: NSObject { extension ContainerController: UIGestureRecognizerDelegate { - func gestureRecognizer(_ gestureRecognizer: UIGestureRecognizer, shouldRecognizeSimultaneouslyWith otherGestureRecognizer: UIGestureRecognizer) -> Bool { + public func gestureRecognizer(_ gestureRecognizer: UIGestureRecognizer, shouldRecognizeSimultaneouslyWith otherGestureRecognizer: UIGestureRecognizer) -> Bool { return false } @@ -1104,14 +1104,14 @@ extension ContainerController: UIGestureRecognizerDelegate { extension ContainerController: UITableViewDelegate { - func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat { + public func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat { if let tableAdapterView = scrollView as? TableAdapterView { return tableAdapterView.tableView(tableView, heightForRowAt: indexPath) } return 0 } - func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { + public func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { if let tableAdapterView = scrollView as? TableAdapterView { return tableAdapterView.tableView(tableView, didSelectRowAt: indexPath) } @@ -1123,14 +1123,14 @@ extension ContainerController: UITableViewDelegate { extension ContainerController: UITableViewDataSource { - func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { + public func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { if let tableAdapterView = scrollView as? TableAdapterView { return tableAdapterView.tableView(tableView, numberOfRowsInSection: section) } return 0 } - func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { + public func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { if let tableAdapterView = scrollView as? TableAdapterView { return tableAdapterView.tableView(tableView, cellForRowAt: indexPath) } @@ -1143,7 +1143,7 @@ extension ContainerController: UITableViewDataSource { extension ContainerController: UICollectionViewDelegate { - func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) { + public func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) { if let collectionAdapterView = scrollView as? CollectionAdapterView { collectionAdapterView.collectionView(collectionView, didSelectItemAt: indexPath) } @@ -1155,14 +1155,14 @@ extension ContainerController: UICollectionViewDelegate { extension ContainerController: UICollectionViewDataSource { - func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { + public func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { if let collectionAdapterView = scrollView as? CollectionAdapterView { return collectionAdapterView.collectionView(collectionView, numberOfItemsInSection: section) } return 0 } - func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { + public func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { if let collectionAdapterView = scrollView as? CollectionAdapterView { return collectionAdapterView.collectionView(collectionView, cellForItemAt: indexPath) } @@ -1186,7 +1186,7 @@ extension ContainerController: UICollectionViewDelegateFlowLayout { extension ContainerController: UIScrollViewDelegate { - func scrollViewDidScroll(_ scrollView: UIScrollView) { + public func scrollViewDidScroll(_ scrollView: UIScrollView) { if let tableAdapterView = scrollView as? TableAdapterView { tableAdapterView.scrollViewDidScroll(tableAdapterView) @@ -1296,7 +1296,7 @@ extension ContainerController: UIScrollViewDelegate { // MARK: - Scroll Begin/End Dragging - func scrollViewWillBeginDragging(_ scrollView: UIScrollView) { + public func scrollViewWillBeginDragging(_ scrollView: UIScrollView) { isScrolling = true @@ -1309,11 +1309,11 @@ extension ContainerController: UIScrollViewDelegate { } } - func scrollViewDidEndDecelerating(_ scrollView: UIScrollView) { + public func scrollViewDidEndDecelerating(_ scrollView: UIScrollView) { isScrolling = false } - func scrollViewDidEndDragging(_ scrollView: UIScrollView, willDecelerate decelerate: Bool) { + public func scrollViewDidEndDragging(_ scrollView: UIScrollView, willDecelerate decelerate: Bool) { if !decelerate { isScrolling = false diff --git a/ContainerControllerSwift/Classes/ContainerControllerDelegate.swift b/ContainerControllerSwift/ContainerControllerDelegate.swift similarity index 91% rename from ContainerControllerSwift/Classes/ContainerControllerDelegate.swift rename to ContainerControllerSwift/ContainerControllerDelegate.swift index 999e85b..b694ac5 100644 --- a/ContainerControllerSwift/Classes/ContainerControllerDelegate.swift +++ b/ContainerControllerSwift/ContainerControllerDelegate.swift @@ -8,7 +8,7 @@ import UIKit -protocol ContainerControllerDelegate { +public protocol ContainerControllerDelegate { /// Reports rotation and orientation changes func containerControllerRotation(_ containerController: ContainerController) @@ -21,7 +21,7 @@ protocol ContainerControllerDelegate { } -extension ContainerControllerDelegate { +public extension ContainerControllerDelegate { func containerControllerRotation(_ containerController: ContainerController) { } diff --git a/ContainerControllerSwift/Classes/ContainerDevice.swift b/ContainerControllerSwift/ContainerDevice.swift similarity index 98% rename from ContainerControllerSwift/Classes/ContainerDevice.swift rename to ContainerControllerSwift/ContainerDevice.swift index ad03264..3c92203 100644 --- a/ContainerControllerSwift/Classes/ContainerDevice.swift +++ b/ContainerControllerSwift/ContainerDevice.swift @@ -2,11 +2,9 @@ import UIKit - - -extension ContainerDevice { +public extension ContainerDevice { - public enum Orientation { + enum Orientation { case portrait case landscapeLeft case landscapeRight diff --git a/ContainerControllerSwift/Classes/ContainerLayout.swift b/ContainerControllerSwift/ContainerLayout.swift similarity index 96% rename from ContainerControllerSwift/Classes/ContainerLayout.swift rename to ContainerControllerSwift/ContainerLayout.swift index 14e1d4c..5b493c8 100644 --- a/ContainerControllerSwift/Classes/ContainerLayout.swift +++ b/ContainerControllerSwift/ContainerLayout.swift @@ -10,7 +10,7 @@ import UIKit // MARK: - Position -class ContainerPosition { +open class ContainerPosition { var top: CGFloat @@ -30,7 +30,7 @@ class ContainerPosition { // MARK: - Insets -struct ContainerInsets { +public struct ContainerInsets { var right: CGFloat @@ -46,7 +46,7 @@ struct ContainerInsets { // MARK: - Layout -class ContainerLayout { +open class ContainerLayout { /** Initialization start position. diff --git a/ContainerControllerSwift/Classes/ContainerTable/TableAdapterCell.swift b/ContainerControllerSwift/ContainerTable/TableAdapterCell.swift similarity index 92% rename from ContainerControllerSwift/Classes/ContainerTable/TableAdapterCell.swift rename to ContainerControllerSwift/ContainerTable/TableAdapterCell.swift index 695c208..2f8e678 100644 --- a/ContainerControllerSwift/Classes/ContainerTable/TableAdapterCell.swift +++ b/ContainerControllerSwift/ContainerTable/TableAdapterCell.swift @@ -8,7 +8,7 @@ import UIKit -class TableAdapterCell: UITableViewCell { +open class TableAdapterCell: UITableViewCell { @IBInspectable var hideAnimation: Bool = false var selectedView: UIView? @@ -35,7 +35,7 @@ class TableAdapterCell: UITableViewCell { let selAlpha: CGFloat = 0.2 // 0.15 - override func setSelected(_ selected: Bool, animated: Bool) { + open override func setSelected(_ selected: Bool, animated: Bool) { if hideAnimation { @@ -65,7 +65,7 @@ class TableAdapterCell: UITableViewCell { } - override func setHighlighted(_ highlighted: Bool, animated: Bool) { + open override func setHighlighted(_ highlighted: Bool, animated: Bool) { if hideAnimation { if highlighted { diff --git a/ContainerControllerSwift/Classes/ContainerTable/TableAdapterCellData.swift b/ContainerControllerSwift/ContainerTable/TableAdapterCellData.swift similarity index 92% rename from ContainerControllerSwift/Classes/ContainerTable/TableAdapterCellData.swift rename to ContainerControllerSwift/ContainerTable/TableAdapterCellData.swift index 010e900..9d6549e 100644 --- a/ContainerControllerSwift/Classes/ContainerTable/TableAdapterCellData.swift +++ b/ContainerControllerSwift/ContainerTable/TableAdapterCellData.swift @@ -8,7 +8,7 @@ import UIKit -class TableAdapterCellData: NSObject { +open class TableAdapterCellData: NSObject { // public let cellIdentifier: String // diff --git a/ContainerControllerSwift/Classes/ContainerTable/TableAdapterItem.swift b/ContainerControllerSwift/ContainerTable/TableAdapterItem.swift similarity index 94% rename from ContainerControllerSwift/Classes/ContainerTable/TableAdapterItem.swift rename to ContainerControllerSwift/ContainerTable/TableAdapterItem.swift index fc8a8e0..83cd194 100644 --- a/ContainerControllerSwift/Classes/ContainerTable/TableAdapterItem.swift +++ b/ContainerControllerSwift/ContainerTable/TableAdapterItem.swift @@ -8,7 +8,7 @@ import UIKit -class TableAdapterItem: NSObject { +open class TableAdapterItem: NSObject { public let cellClass: AnyClass diff --git a/ContainerControllerSwift/ContainerTable/TableAdapterTypes.swift b/ContainerControllerSwift/ContainerTable/TableAdapterTypes.swift new file mode 100644 index 0000000..784291e --- /dev/null +++ b/ContainerControllerSwift/ContainerTable/TableAdapterTypes.swift @@ -0,0 +1,16 @@ +// +// ContainerTypes.swift +// PatternsSwift +// +// Created by Рустам Мотыгуллин on 21/04/2020. +// Copyright © 2020 mrusta. All rights reserved. +// + +import UIKit + +public typealias TableAdapterCountCallback = () -> Int +public typealias TableAdapterCellIndexCallback = (_ index: Int) -> UITableViewCell +public typealias TableAdapterHeightIndexCallback = (_ index: Int) -> CGFloat +public typealias TableAdapterSelectIndexCallback = (_ index: Int) -> () +public typealias TableAdapterDidScrollCallback = () -> () +public typealias TableAdapterDeleteIndexCallback = (_ index: Int) -> () diff --git a/ContainerControllerSwift/Classes/ContainerTable/TableAdapterView.swift b/ContainerControllerSwift/ContainerTable/TableAdapterView.swift similarity index 92% rename from ContainerControllerSwift/Classes/ContainerTable/TableAdapterView.swift rename to ContainerControllerSwift/ContainerTable/TableAdapterView.swift index 1a98fb9..f3c3294 100644 --- a/ContainerControllerSwift/Classes/ContainerTable/TableAdapterView.swift +++ b/ContainerControllerSwift/ContainerTable/TableAdapterView.swift @@ -8,7 +8,7 @@ import UIKit -class TableAdapterView: UITableView { +open class TableAdapterView: UITableView { @IBInspectable var separatorClr: UIColor? @@ -22,7 +22,7 @@ class TableAdapterView: UITableView { var items: [TableAdapterItem] = [] - required init?(coder: NSCoder) { + required public init?(coder: NSCoder) { super.init(coder: coder) update() } @@ -32,7 +32,7 @@ class TableAdapterView: UITableView { update() } - override func draw(_ rect: CGRect) { + open override func draw(_ rect: CGRect) { if let color = separatorClr { separatorColor = color } @@ -122,7 +122,7 @@ extension TableAdapterView: UITableViewDataSource { } - func tableView(_ tableView: UITableView, canEditRowAt indexPath: IndexPath) -> Bool { + public func tableView(_ tableView: UITableView, canEditRowAt indexPath: IndexPath) -> Bool { if !items.isEmpty { let item = items[indexPath.row] return item.canEditing() @@ -130,7 +130,7 @@ extension TableAdapterView: UITableViewDataSource { return false } - func tableView(_ tableView: UITableView, commit editingStyle: UITableViewCell.EditingStyle, forRowAt indexPath: IndexPath) { + public func tableView(_ tableView: UITableView, commit editingStyle: UITableViewCell.EditingStyle, forRowAt indexPath: IndexPath) { if editingStyle == .delete { items.remove(at: indexPath.row) diff --git a/ContainerControllerSwift/Classes/ContainerTypes.swift b/ContainerControllerSwift/ContainerTypes.swift similarity index 92% rename from ContainerControllerSwift/Classes/ContainerTypes.swift rename to ContainerControllerSwift/ContainerTypes.swift index 0a387a3..b692bf2 100644 --- a/ContainerControllerSwift/Classes/ContainerTypes.swift +++ b/ContainerControllerSwift/ContainerTypes.swift @@ -16,7 +16,7 @@ public enum ContainerMoveType { case custom } -enum ContainerFromType { +public enum ContainerFromType { case pan case scroll case scrollBorder diff --git a/ContainerControllerSwift/Classes/ContainerView.swift b/ContainerControllerSwift/ContainerView.swift similarity index 97% rename from ContainerControllerSwift/Classes/ContainerView.swift rename to ContainerControllerSwift/ContainerView.swift index 8cc0973..4bacd1a 100644 --- a/ContainerControllerSwift/Classes/ContainerView.swift +++ b/ContainerControllerSwift/ContainerView.swift @@ -8,7 +8,7 @@ import UIKit -class ContainerView: UIView { +open class ContainerView: UIView { var contentView: UIView? @@ -44,7 +44,7 @@ class ContainerView: UIView { self.contentView = contentView } - required init?(coder: NSCoder) { + required public init?(coder: NSCoder) { super.init(coder: coder) } diff --git a/Example/ContainerControllerSwift.xcodeproj/project.pbxproj b/Example/ContainerControllerSwift.xcodeproj/project.pbxproj index 0c89be9..4dcd74e 100644 --- a/Example/ContainerControllerSwift.xcodeproj/project.pbxproj +++ b/Example/ContainerControllerSwift.xcodeproj/project.pbxproj @@ -207,7 +207,7 @@ isa = PBXProject; attributes = { LastSwiftUpdateCheck = 0830; - LastUpgradeCheck = 0830; + LastUpgradeCheck = 1150; ORGANIZATIONNAME = CocoaPods; TargetAttributes = { 607FACCF1AFB9204008FA782 = { @@ -223,10 +223,9 @@ }; buildConfigurationList = 607FACCB1AFB9204008FA782 /* Build configuration list for PBXProject "ContainerControllerSwift" */; compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; + developmentRegion = en; hasScannedForEncodings = 0; knownRegions = ( - English, en, Base, ); @@ -378,6 +377,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; @@ -386,12 +386,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; @@ -432,6 +434,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; @@ -440,12 +443,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/Example/ContainerControllerSwift.xcodeproj/xcshareddata/xcschemes/ContainerControllerSwift-Example.xcscheme b/Example/ContainerControllerSwift.xcodeproj/xcshareddata/xcschemes/ContainerControllerSwift-Example.xcscheme index c8cfb85..bb091b1 100644 --- a/Example/ContainerControllerSwift.xcodeproj/xcshareddata/xcschemes/ContainerControllerSwift-Example.xcscheme +++ b/Example/ContainerControllerSwift.xcodeproj/xcshareddata/xcschemes/ContainerControllerSwift-Example.xcscheme @@ -1,6 +1,6 @@ + + + + @@ -54,23 +62,11 @@ - - - - - - - -