Skip to content

Commit 71d091f

Browse files
committed
make inits public
1 parent 2feb47a commit 71d091f

1 file changed

Lines changed: 10 additions & 10 deletions

File tree

SimplePagedViewFramework/Source/SimplePagedView.swift

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import UIKit
33
public class SimplePagedView: UIViewController {
44

55
// MARK: - Properties
6-
private static let defaultPageControlConstraints: (SimplePagedView) -> ([NSLayoutConstraint])
6+
public static let defaultPageControlConstraints: (SimplePagedView) -> ([NSLayoutConstraint])
77
= { (pagedViewController: SimplePagedView) in
88
return [
99
pagedViewController.pageControl.bottomAnchor.constraint(
@@ -22,7 +22,7 @@ public class SimplePagedView: UIViewController {
2222
]
2323
}
2424

25-
private enum Constants {
25+
fileprivate enum Constants {
2626
static let startingPage = 0
2727
static let pageControllerSpacing: CGFloat = -10
2828
}
@@ -70,7 +70,7 @@ public class SimplePagedView: UIViewController {
7070
}
7171
}
7272

73-
init(
73+
public init(
7474
indicatorColor: UIColor = .red,
7575
pageControlBackgroundColor: UIColor = .clear,
7676
initialPage: Int = 0,
@@ -88,7 +88,7 @@ public class SimplePagedView: UIViewController {
8888
self.pageControl.backgroundColor = pageControlBackgroundColor
8989
}
9090

91-
init(
91+
public init(
9292
indicatorColor: UIColor = .red,
9393
pageControlBackgroundColor: UIColor = .clear,
9494
initialPage: Int = 0,
@@ -177,8 +177,8 @@ public class SimplePagedView: UIViewController {
177177
/// Scrolls to the given page
178178
///
179179
/// - Parameters:
180-
/// - page: <#page description#>
181-
/// - animated: <#animated description#>
180+
/// - page: 0 indexed page number
181+
/// - animated: should the scrolling be animated
182182
public func scrollTo(page: Int, animated: Bool) {
183183
self.scrollView.setContentOffset(
184184
CGPoint(x: CGFloat(Int(scrollView.frame.size.width) * page), y: 0),
@@ -205,7 +205,7 @@ public class SimplePagedView: UIViewController {
205205
// MARK: - View Setup
206206
fileprivate extension SimplePagedView {
207207

208-
fileprivate func setupInnerPages(for views: [UIView]) -> [UIView] {
208+
func setupInnerPages(for views: [UIView]) -> [UIView] {
209209
if views.count == 0 {
210210
let view = UIView()
211211
view.translatesAutoresizingMaskIntoConstraints = false
@@ -216,7 +216,7 @@ fileprivate extension SimplePagedView {
216216
return views.map { $0.translatesAutoresizingMaskIntoConstraints = false; return $0 }
217217
}
218218

219-
fileprivate func setupGestures() {
219+
func setupGestures() {
220220
if pageIndicatorIsInteractive {
221221
let panGestureRecognizer = UIPanGestureRecognizer(target: self, action: #selector(self.panned(sender:)))
222222

@@ -227,7 +227,7 @@ fileprivate extension SimplePagedView {
227227
}
228228
}
229229

230-
fileprivate func setupSubviews() {
230+
func setupSubviews() {
231231
let customView = ExternallyInteractiveUIView(frame: self.view.frame)
232232
self.view = customView
233233

@@ -243,7 +243,7 @@ fileprivate extension SimplePagedView {
243243
}
244244

245245
// swiftlint:disable next function_body_length
246-
fileprivate func setupConstraints() {
246+
func setupConstraints() {
247247
let scrollViewConstraints = [
248248
scrollView.topAnchor.constraint(equalTo: view.topAnchor),
249249
scrollView.leadingAnchor.constraint(equalTo: view.leadingAnchor),

0 commit comments

Comments
 (0)