mirror of
https://github.com/nicklockwood/SwiftFormat.git
synced 2026-05-17 10:30:35 +00:00
15 lines
458 B
Swift
Executable File
15 lines
458 B
Swift
Executable File
// Copyright © 2017 Schibsted. All rights reserved.
|
|
|
|
import UIKit
|
|
|
|
final class PagesViewController: UIViewController, UIScrollViewDelegate {
|
|
@IBOutlet var scrollView: UIScrollView?
|
|
@IBOutlet var pageControl: UIPageControl?
|
|
|
|
func scrollViewDidScroll(_ scrollView: UIScrollView) {
|
|
if scrollView === self.scrollView {
|
|
pageControl?.currentPage = Int(round(scrollView.contentOffset.x / scrollView.frame.width))
|
|
}
|
|
}
|
|
}
|