{"id":3084,"url":"https://github.com/juanpablofernandez/SwiftyOnboard","last_synced_at":"2025-08-06T16:32:04.219Z","repository":{"id":37381981,"uuid":"86270902","full_name":"juanpablofernandez/SwiftyOnboard","owner":"juanpablofernandez","description":"A swifty iOS framework that allows developers to create beautiful onboarding experiences.","archived":false,"fork":false,"pushed_at":"2022-03-25T03:45:39.000Z","size":2390,"stargazers_count":1248,"open_issues_count":34,"forks_count":106,"subscribers_count":24,"default_branch":"master","last_synced_at":"2024-09-17T20:04:16.083Z","etag":null,"topics":["cocoapods","custom-layout","framework","ios","onboard","onboarding","swift","swifty","swiftyonboard"],"latest_commit_sha":null,"homepage":"","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/juanpablofernandez.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-03-26T23:02:36.000Z","updated_at":"2024-08-21T06:34:10.000Z","dependencies_parsed_at":"2022-08-08T20:15:14.144Z","dependency_job_id":null,"html_url":"https://github.com/juanpablofernandez/SwiftyOnboard","commit_stats":null,"previous_names":[],"tags_count":17,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/juanpablofernandez%2FSwiftyOnboard","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/juanpablofernandez%2FSwiftyOnboard/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/juanpablofernandez%2FSwiftyOnboard/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/juanpablofernandez%2FSwiftyOnboard/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/juanpablofernandez","download_url":"https://codeload.github.com/juanpablofernandez/SwiftyOnboard/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228923736,"owners_count":17992570,"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":["cocoapods","custom-layout","framework","ios","onboard","onboarding","swift","swifty","swiftyonboard"],"created_at":"2024-01-05T20:16:30.937Z","updated_at":"2024-12-09T16:31:14.875Z","avatar_url":"https://github.com/juanpablofernandez.png","language":"Swift","funding_links":[],"categories":["Walkthrough / Intro / Tutorial","Libs","Swift","UI [🔝](#readme)","UI"],"sub_categories":["Web View","UI","Other free courses"],"readme":"# SwiftyOnboard\n\u003e A simple iOS framework that allows developers to create onboarding experiences.\n\n[![Swift Version][swift-image]][swift-url]\n[![Build Status][travis-image]][travis-url]\n[![License][license-image]][license-url]\n[![CocoaPods](https://img.shields.io/cocoapods/v/SwiftyOnboard.svg)](https://cocoapods.org/pods/SwiftyOnboard)\n[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)\n[![Platform](https://img.shields.io/cocoapods/p/LFAlertController.svg?style=flat)](http://cocoapods.org/pods/LFAlertController)\n\nSwiftyOnboard makes it easy to add onboarding to any iOS application. SwiftyOnboard handles all of the logic behind the pagination of views, which allows you to quickly add a highly customizable onboarding to your app, all in a lightweight framework.\n\n![](screenshots/onboard1.gif)\n![](screenshots/onboard2.gif)\n\n## Contents\n\n* [Requirements](#requirements)\n* [Installation](#installation)\n    * [CocoaPods](#cocoapods)\n    * [Manually](#manually)\n* [Usage](#usage)\n    * [Properties](#properties)\n    * [Methods](#methods)\n    * [Protocols](#protocols)\n        * [DataSource](#swiftyonboarddatasource)\n        * [Delegate](#swiftyonboarddelegate)\n* [Notes](#notes)\n* [Contribute](#contribute)\n* [License](#license)\n\n## Requirements\n\n- iOS 12.0+\n- Xcode 10.3+\n\n## Installation\n\n#### CocoaPods\nYou can use [CocoaPods](http://cocoapods.org/) to install `SwiftyOnboard` by adding this to your `Podfile`:\n\n```ruby\nuse_frameworks!\npod 'SwiftyOnboard'\n```\nIf you get the ``Unable to find a specification for `SwiftyOnboard`.``  error after running `pod install`.\n\nRun the following commands on your project directory:\n```\npod repo update\n```\n```\npod install\n```\n#### Carthage\nTo install via Carthage add this to your Cartfile:\n```ruby\ngithub \"juanpablofernandez/SwiftyOnboard\"\n```\n#### Manually\n1. Drag and drop ```SwiftyOnboard.swift``` ```SwiftyOnboardOverlay.swift``` ```SwiftyOnboardPage.swift``` in your project.  \n2. That's it!\n\n## Usage\n1. Import `SwiftyOnboard` module to your `ViewController` class\n```swift\nimport SwiftyOnboard\n```\n2. Add `SwiftyOnboard` to `ViewController`, then set dataSource and delegate for it\n```swift\nclass ViewController: UIViewController {\n    override func viewDidLoad() {\n            super.viewDidLoad()\n\n            let swiftyOnboard = SwiftyOnboard(frame: view.frame)\n            view.addSubview(swiftyOnboard)\n            swiftyOnboard.dataSource = self\n        }\n}\n```\n3. Conform your `ViewController` to `SwiftyOnboardDataSource` protocol and implement all the methods, e.g.\n```swift\nextension ViewController: SwiftyOnboardDataSource {\n\n        func swiftyOnboardNumberOfPages(swiftyOnboard: SwiftyOnboard) -\u003e Int {\n            return 3\n        }\n\n        func swiftyOnboardPageForIndex(swiftyOnboard: SwiftyOnboard, index: Int) -\u003e SwiftyOnboardPage? {\n            let page = SwiftyOnboardPage()\n            return page\n        }\n}\n```\n4. `SwiftyOnboard` works with default implementation. Override it to customize its behavior\n\n\u003c!-- [Example project with CocoaPods](https://github.com/juanpablofernandez). --\u003e\n\n### Properties\n\nSwiftyOnboard has the following properties:\n```swift\npublic var dataSource: SwiftyOnboardDataSource?\n```\nAn object that supports the SwiftyOnboardDataSource protocol and can provide views to populate the SwiftyOnboard.\n```swift\npublic var delegate: SwiftyOnboardDelegate?\n```\nAn object that supports the SwiftyOnboardDelegate protocol and can respond to SwiftyOnboard events.\n```swift\npublic var shouldSwipe: Bool\n```\nWhether or not swiping is enabled [default = true].\n```swift\npublic var fadePages: Bool\n```\nWhether or not pages will fade upon transition [default = true].\n\n### Methods\n\nSwiftyOnboard class has the following methods:\n```swift\nfunc goToPage(index: Int, animated: Bool)\n```\nThis method allows you to move to a certain page in the onboarding.\n\n### Protocols\n\nThe SwiftyOnboard follows the Apple convention for data-driven views by providing two protocol interfaces, SwiftyOnboardDataSource and SwiftyOnboardDelegate.\n#### SwiftyOnboardDataSource\nSwiftyOnboardDataSource protocol has the following methods:\n```swift\nfunc swiftyOnboardNumberOfPages(swiftyOnboard: SwiftyOnboard) -\u003e Int\n```\nReturn the number of items (pages) in the onboarding.\n```swift\nfunc swiftyOnboardViewForBackground(swiftyOnboard: SwiftyOnboard) -\u003e UIView?\n```\nReturn a view to be displayed as the background of the onboarding.\n```swift\nfunc swiftyOnboardPageForIndex(swiftyOnboard: SwiftyOnboard, index: Int) -\u003e SwiftyOnboardPage?\n```\nReturn a view (page) to be displayed at the specified index in the onboarding.\n```swift\nfunc swiftyOnboardViewForOverlay(swiftyOnboard: SwiftyOnboard) -\u003e SwiftyOnboardOverlay?\n```\nReturn an overlay (view) to be displayed on top of the onboarding pages. e.g. [The continue and skip buttons which don't move with the pages, also included is the page control]\n```swift\nfunc swiftyOnboardOverlayForPosition(swiftyOnboard: SwiftyOnboard, overlay: SwiftyOnboardOverlay, for position: Double)\n```\nEdit the overlay (view) for the desired position. e.g. [Change the \"continue button\" text to \"Done\", when the last page is reached]\n```swift\nfunc swiftyOnboardBackgroundColorFor(_ swiftyOnboard: SwiftyOnboard, atIndex index: Int) -\u003e UIColor?\n```\nSet the background color for the page at the given index. (Very useful when you have pages with different background colors)\n\n#### SwiftyOnboardDelegate\nSwiftyOnboardDelegate protocol has the following methods:\n```swift\nfunc swiftyOnboard(swiftyOnboard: SwiftyOnboard, currentPage index: Int)\n```\nThis method is called whenever a page is shown, it holds the index to that page. It is called regardless of whether the page was swiped programmatically or through user interaction.\n```swift\nfunc swiftyOnboard(swiftyOnboard: SwiftyOnboard, leftEdge position: Double)\n```\nThis method is called whenever the pages are scrolling, it holds the current distance between the left side of the screen and the left side of the first page.\n```swift\nfunc swiftyOnboard(swiftyOnboard: SwiftyOnboard, tapped index: Int)\n```\nThis method is called whenever a page is tapped by the user, it holds the index of the tapped page.\n\n## Notes\n* Landscape mode is not supported\n\n## Contribute\nContributions are welcomed! There are however certain guidelines you must follow when you contribute:\n* Have descriptive commit messages.\n* Make a pull request for every feature (Don't make a pull request that adds 3 new features. Make an individual pull request for each of those features, with a descriptive message).\n* Don't update the example project, or any other irrelevant files.\n\nI want to see your amazing onboarding. Take screenshots and/or record a gif and send it my way!\n\n## License\n\nDistributed under the MIT license. See ``LICENSE`` for more information.\n\n[swift-image]:https://img.shields.io/badge/swift-5.0-orange.svg\n[swift-url]: https://swift.org/\n[license-image]: https://img.shields.io/badge/License-MIT-blue.svg\n[license-url]: LICENSE\n[travis-image]: https://img.shields.io/travis/dbader/node-datadog-metrics/master.svg?style=flat-square\n[travis-url]: https://travis-ci.org/dbader/node-datadog-metrics\n[codebeat-image]: https://codebeat.co/badges/c19b47ea-2f9d-45df-8458-b2d952fe9dad\n[codebeat-url]: https://codebeat.co/projects/github-com-vsouza-awesomeios-com\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjuanpablofernandez%2FSwiftyOnboard","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjuanpablofernandez%2FSwiftyOnboard","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjuanpablofernandez%2FSwiftyOnboard/lists"}