From 37ffdf4833873f49556704532a9296f80879d1a9 Mon Sep 17 00:00:00 2001 From: stan <3421902@qq.com> Date: Fri, 22 Sep 2017 14:56:50 +0800 Subject: [PATCH] fix public issue --- GrandMenu.podspec | 4 ++-- GrandMenu/GrandBaseTable.swift | 4 ++-- GrandMenu/GrandCellTableViewCell.swift | 8 ++++---- GrandMenu/GrandContentViewController.swift | 22 +++++++++++----------- GrandMenu/GrandPageContentView.swift | 16 ++++++++-------- 5 files changed, 27 insertions(+), 27 deletions(-) diff --git a/GrandMenu.podspec b/GrandMenu.podspec index f79bef3..9389bea 100644 --- a/GrandMenu.podspec +++ b/GrandMenu.podspec @@ -16,7 +16,7 @@ Pod::Spec.new do |s| # s.name = "GrandMenu" - s.version = "1.1.0" + s.version = "1.1.1" s.summary = "GrandMenu is a powerful and simple Menu" # This description is used to generate tags and improve search results. @@ -80,7 +80,7 @@ Pod::Spec.new do |s| # Supports git, hg, bzr, svn and HTTP. # - s.source = { :git => "https://github.com/DuckDeck/GrandMenu.git", :tag => "1.1.0" } + s.source = { :git => "https://github.com/DuckDeck/GrandMenu.git", :tag => "1.1.1" } # ――― Source Code ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # diff --git a/GrandMenu/GrandBaseTable.swift b/GrandMenu/GrandBaseTable.swift index d63e636..a67d96e 100644 --- a/GrandMenu/GrandBaseTable.swift +++ b/GrandMenu/GrandBaseTable.swift @@ -8,9 +8,9 @@ import UIKit -class GrandBaseTable: UITableView,UIGestureRecognizerDelegate { +open class GrandBaseTable: UITableView,UIGestureRecognizerDelegate { - func gestureRecognizer(_ gestureRecognizer: UIGestureRecognizer, shouldRecognizeSimultaneouslyWith otherGestureRecognizer: UIGestureRecognizer) -> Bool { + public func gestureRecognizer(_ gestureRecognizer: UIGestureRecognizer, shouldRecognizeSimultaneouslyWith otherGestureRecognizer: UIGestureRecognizer) -> Bool { return true } } diff --git a/GrandMenu/GrandCellTableViewCell.swift b/GrandMenu/GrandCellTableViewCell.swift index 6465581..5578f28 100644 --- a/GrandMenu/GrandCellTableViewCell.swift +++ b/GrandMenu/GrandCellTableViewCell.swift @@ -8,11 +8,11 @@ import UIKit -class GrandCellTableViewCell: UITableViewCell { +open class GrandCellTableViewCell: UITableViewCell { - var pageContentView:GrandPageContentView? - var vcs = [UIViewController]() - var cellCanScroll = false{ + open var pageContentView:GrandPageContentView? + open var vcs = [UIViewController]() + open var cellCanScroll = false{ didSet{ for vc in vcs{ if let v = vc as? GrandContentViewController{ diff --git a/GrandMenu/GrandContentViewController.swift b/GrandMenu/GrandContentViewController.swift index 5ee507b..d82b841 100644 --- a/GrandMenu/GrandContentViewController.swift +++ b/GrandMenu/GrandContentViewController.swift @@ -9,40 +9,40 @@ import UIKit -class GrandContentViewController: UIViewController,UITableViewDataSource,UITableViewDelegate { - var canScroll = false; - var tableView = UITableView() - var fingerIsTouch = false +open class GrandContentViewController: UIViewController,UITableViewDataSource,UITableViewDelegate { + open var canScroll = false; + open var tableView = UITableView() + open var fingerIsTouch = false - override func viewDidLoad() { + override open func viewDidLoad() { super.viewDidLoad() tableView = UITableView() tableView.dataSource = self tableView.delegate = self view.addSubview(tableView) } - override func viewWillLayoutSubviews() { + override open func viewWillLayoutSubviews() { tableView.frame = self.view.bounds } - func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { + public func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { return 0 } - func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { + public func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { return UITableViewCell() } - func scrollViewWillBeginDragging(_ scrollView: UIScrollView) { + public func scrollViewWillBeginDragging(_ scrollView: UIScrollView) { fingerIsTouch = true } - func scrollViewWillEndDragging(_ scrollView: UIScrollView, withVelocity velocity: CGPoint, targetContentOffset: UnsafeMutablePointer) { + public func scrollViewWillEndDragging(_ scrollView: UIScrollView, withVelocity velocity: CGPoint, targetContentOffset: UnsafeMutablePointer) { fingerIsTouch = false } - func scrollViewDidScroll(_ scrollView: UIScrollView) { + public func scrollViewDidScroll(_ scrollView: UIScrollView) { if !canScroll{ scrollView.contentOffset = CGPoint() } diff --git a/GrandMenu/GrandPageContentView.swift b/GrandMenu/GrandPageContentView.swift index 132b4c8..8cabe9b 100644 --- a/GrandMenu/GrandPageContentView.swift +++ b/GrandMenu/GrandPageContentView.swift @@ -8,13 +8,13 @@ import UIKit -@objc protocol GrandPageContentViewDelagate { +@objc public protocol GrandPageContentViewDelagate { @objc optional func contentViewWillBeginDragging(contentview:GrandPageContentView) @objc optional func contentViewDidScroll(contentview:GrandPageContentView,startIndex:CGFloat,endIndex:CGFloat,progress:CGFloat) @objc optional func contentViewDidEndDecelerating(contentview:GrandPageContentView,startIndex:CGFloat,endIndex:CGFloat) } -class GrandPageContentView: UIView { +open class GrandPageContentView: UIView { let cellId = "GrandCelId" weak open var delegate:GrandPageContentViewDelagate? @@ -67,18 +67,18 @@ class GrandPageContentView: UIView { } - required init?(coder aDecoder: NSCoder) { + required public init?(coder aDecoder: NSCoder) { fatalError("init(coder:) has not been implemented") } } extension GrandPageContentView:UICollectionViewDataSource,UICollectionViewDelegate{ - func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { + public func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { return self.childViewController?.count ?? 0 } - func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { + public func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { let cell = collectionView.dequeueReusableCell(withReuseIdentifier: cellId, for: indexPath) cell.contentView.subviews.forEach { (v) in v.removeFromSuperview() @@ -89,13 +89,13 @@ extension GrandPageContentView:UICollectionViewDataSource,UICollectionViewDelega return cell } - func scrollViewWillBeginDragging(_ scrollView: UIScrollView) { + public func scrollViewWillBeginDragging(_ scrollView: UIScrollView) { isSelectBtn = false startOffsetX = scrollView.contentOffset.x delegate?.contentViewWillBeginDragging?(contentview: self) } - func scrollViewDidScroll(_ scrollView: UIScrollView) { + public func scrollViewDidScroll(_ scrollView: UIScrollView) { if isSelectBtn { return } @@ -123,7 +123,7 @@ extension GrandPageContentView:UICollectionViewDataSource,UICollectionViewDelega delegate?.contentViewDidScroll?(contentview: self, startIndex: startIndex, endIndex: endIndex, progress: progress) } - func scrollViewDidEndDecelerating(_ scrollView: UIScrollView) { + public func scrollViewDidEndDecelerating(_ scrollView: UIScrollView) { let scrollViewWidth = scrollView.bounds.size.width let currentOffsetX = scrollView.contentOffset.x let startIndex = floor(startOffsetX / scrollViewWidth)