Files
2025-10-04 08:46:46 +01:00

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))
}
}
}