{"id":17148902,"url":"https://github.com/ivanvorobei/sppagecontroller","last_synced_at":"2025-06-28T20:08:14.189Z","repository":{"id":41040019,"uuid":"417154914","full_name":"ivanvorobei/SPPageController","owner":"ivanvorobei","description":"Mimicrate to UIPageViewController. Has native system and scroll view paging. Support scroll to page and layout margins from container.","archived":false,"fork":false,"pushed_at":"2022-03-27T17:21:02.000Z","size":1756,"stargazers_count":58,"open_issues_count":0,"forks_count":5,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-06-22T12:17:30.262Z","etag":null,"topics":["controller","onboarding","page","pages","swift","tutorial","uikit","uipageviewcontroller","xcode"],"latest_commit_sha":null,"homepage":"https://opensource.ivanvorobei.io","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ivanvorobei.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-10-14T14:07:20.000Z","updated_at":"2025-06-02T12:27:19.000Z","dependencies_parsed_at":"2022-08-31T03:30:31.144Z","dependency_job_id":null,"html_url":"https://github.com/ivanvorobei/SPPageController","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/ivanvorobei/SPPageController","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ivanvorobei%2FSPPageController","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ivanvorobei%2FSPPageController/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ivanvorobei%2FSPPageController/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ivanvorobei%2FSPPageController/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ivanvorobei","download_url":"https://codeload.github.com/ivanvorobei/SPPageController/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ivanvorobei%2FSPPageController/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262490399,"owners_count":23319283,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["controller","onboarding","page","pages","swift","tutorial","uikit","uipageviewcontroller","xcode"],"created_at":"2024-10-14T21:30:16.996Z","updated_at":"2025-06-28T20:08:14.169Z","avatar_url":"https://github.com/ivanvorobei.png","language":"Swift","readme":"# SPPageController\n\n\u003cp aligment=\"left\"\u003e\n    \u003cimg src=\"https://cdn.ivanvorobei.io/github/sppagecontroller/v1.3/paging.png?version=8\" height=\"200\"/\u003e\n    \u003cimg src=\"https://cdn.ivanvorobei.io/github/sppagecontroller/v1.3/safe-scroll.png?version=8\" height=\"200\"/\u003e\n    \u003cimg src=\"https://cdn.ivanvorobei.io/github/sppagecontroller/v1.3/layout-margins.png?version=8\" height=\"200\"/\u003e\n\u003c/p\u003e\n\n\nMimicrate to native `UIPageViewController`. Each page is new controller, it can be even navigation controller. You can add any class of controllers like child. Support parent layout margins, paging and scroll by index. \n \nYou can scroll to any page programatically. If you need pages for onboarding, you can disable scroll by gester and disable swipe to dismiss.\n\n## Navigate\n\n- [Installation](#installation)\n    - [Swift Package Manager](#swift-package-manager)\n    - [CocoaPods](#cocoapods)\n    - [Manually](#manually)\n- [Usage](#usage)\n    - [Present](#usage)\n    - [Scroll](#scroll)\n    - [Dismiss](#dismiss)\n- [Russian Community](#russian-community)\n\n## Installation\n\nReady for use on iOS 12+.\n\n### Swift Package Manager\n\nThe [Swift Package Manager](https://swift.org/package-manager/) is a tool for automating the distribution of Swift code and is integrated into the `swift` compiler. It’s integrated with the Swift build system to automate the process of downloading, compiling, and linking dependencies.\n\nOnce you have your Swift package set up, adding as a dependency is as easy as adding it to the `dependencies` value of your `Package.swift`.\n\n```swift\ndependencies: [\n    .package(url: \"https://github.com/ivanvorobei/SPPageController\", .upToNextMajor(from: \"1.3.0\"))\n]\n```\n\n### CocoaPods:\n\n[CocoaPods](https://cocoapods.org) is a dependency manager. For usage and installation instructions, visit their website. To integrate using CocoaPods, specify it in your `Podfile`:\n\n```ruby\npod 'SPPageController'\n```\n\n### Manually\n\nIf you prefer not to use any of dependency managers, you can integrate manually. Put `Sources/SPPageController` folder in your Xcode project. Make sure to enable `Copy items if needed` and `Create groups`.\n\n## Usage\n\n`SPPageController` is container controller. Now available 2 system of paging - `.scroll` and `.page`. First using `UICollectionView` like basic view, its good work with content offset but not perfect when device rotated. Second using native `UIPageViewController`. You shoud choose which better for you. \n\nPass child controllers which using like pages and simple present page controller as you need:\n\n```swift\n// Here your controllers\nlet controllers: [UIViewController] = []\nlet pageController = SPPageController(childControllers: controllers, system: .page)\npresent(pageController, animated: true, completion: nil)\n```\n\nYou can manage layout margins of container. Apple still has bug with it, but my way support it correctly:\n\n```swift\npageController.view.layoutMargins = .init(horizontal: 50, vertical: 0)\n\n// Don't forget enable preserve layout margins for childs:\n// childController.view.preservesSuperviewLayoutMargins = true\n```\n\nNow for all childs left and right margins will be +50pt.\n\n### Scroll\n\nIf you want scroll only programatically, disable scroll between pages by gester:\n\n```swift\npageController.allowScroll = false\n```\n\nFor scroll by index call this function:\n\n```swift\npageController.safeScrollTo(index: 3, animated: true)\n```\n\n### Dismiss\n\nIf need disable dismiss by gester (related for modal controllers), set flag to `false`:\n\n```swift\npageController.allowDismissWithGester = false\n```\n\n## Russian Community\n\nЯ веду [телеграм-канал](https://sparrowcode.io/telegram), там публикую новости и туториалы.\u003cbr\u003e\nС проблемой помогут [в чате](https://sparrowcode.io/telegram/chat).\n\nВидео-туториалы выклыдываю на [YouTube](https://ivanvorobei.io/youtube):\n\n[![Tutorials on YouTube](https://cdn.ivanvorobei.io/github/readme/youtube-preview.jpg)](https://ivanvorobei.io/youtube)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fivanvorobei%2Fsppagecontroller","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fivanvorobei%2Fsppagecontroller","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fivanvorobei%2Fsppagecontroller/lists"}