hotfix/view-life-cycle-functions-called-multiple-times

Provide public constructor for segment.
Provide public getter for current index.
This commit is contained in:
David Livadaru 2017-08-02 14:50:27 +03:00
parent add0442f40
commit d902fafadf
2 changed files with 9 additions and 0 deletions

View File

@ -105,6 +105,10 @@ public class HorizontalMenuViewController: UIViewController, MenuDataSource, Pag
layoutController?.delegate = layoutDelegate
}
}
public var currentIndex: Int {
return paginationController.currentIndex
}
/// If true, when users seleects an iten from menu,
/// all view controllers from current index to selected index will be loaded.

View File

@ -14,4 +14,9 @@ public struct Segment<SegmentPoint: BasicArithmetic>: ProgressPoint {
public let first: SegmentPoint
public let second: SegmentPoint
public init(first: SegmentPoint, second: SegmentPoint) {
self.first = first
self.second = second
}
}