{"id":3073,"url":"https://github.com/ruipfcosta/SwiftyWalkthrough","last_synced_at":"2025-08-06T16:32:20.425Z","repository":{"id":48287515,"uuid":"43432661","full_name":"ruipfcosta/SwiftyWalkthrough","owner":"ruipfcosta","description":"The easiest way to create a great walkthrough experience in your apps, powered by Swift.","archived":false,"fork":false,"pushed_at":"2021-08-03T08:50:24.000Z","size":3932,"stargazers_count":370,"open_issues_count":9,"forks_count":47,"subscribers_count":11,"default_branch":"master","last_synced_at":"2024-11-18T22:31:54.372Z","etag":null,"topics":[],"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/ruipfcosta.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":"2015-09-30T12:51:22.000Z","updated_at":"2024-11-05T23:58:20.000Z","dependencies_parsed_at":"2022-08-31T14:01:29.284Z","dependency_job_id":null,"html_url":"https://github.com/ruipfcosta/SwiftyWalkthrough","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ruipfcosta%2FSwiftyWalkthrough","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ruipfcosta%2FSwiftyWalkthrough/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ruipfcosta%2FSwiftyWalkthrough/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ruipfcosta%2FSwiftyWalkthrough/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ruipfcosta","download_url":"https://codeload.github.com/ruipfcosta/SwiftyWalkthrough/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228923756,"owners_count":17992574,"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":[],"created_at":"2024-01-05T20:16:30.620Z","updated_at":"2024-12-09T16:31:19.010Z","avatar_url":"https://github.com/ruipfcosta.png","language":"Swift","funding_links":[],"categories":["Walkthrough / Intro / Tutorial","Libs","Introduction","UI [🔝](#readme)"],"sub_categories":["Web View","UI","Other free courses"],"readme":"# SwiftyWalkthrough\n\n[![Platform](http://img.shields.io/badge/platform-ios-blue.svg?style=flat\n)](https://developer.apple.com/iphone/index.action)\n[![Language](http://img.shields.io/badge/language-swift-brightgreen.svg?style=flat\n)](https://developer.apple.com/swift)\n[![License](http://img.shields.io/badge/license-MIT-lightgrey.svg?style=flat\n)](http://mit-license.org)\n[![CocoaPods](https://img.shields.io/cocoapods/v/SwiftyWalkthrough.svg)]()\n[![Carthage Compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)\n\nSwiftyWalkthrough is a library for creating great walkthrough experiences in your apps, written in Swift. \nYou can use the library to allow users to navigate and explore your app, step by step, in a predefined way controlled by you. \n\n## Features\n\n- [x] Add walkthroughs to your app with little effort: you don't need to change anything in your view hierarchy.\n- [x] SwiftyWalkthrough is great for onboarding, walkthroughs, tutorials, etc.\n- [x] Control with precision which views are accessible to the user in a given time.\n- [x] Take users through a series of steps, even across multiple screens.\n- [x] Is simple!\n\n## Preview\n\nSwiftyWalkthrough provides you with a framework to build your walkthrough experience, giving you full control over what you want to achieve. The following examples were built using SwiftyWalkthrough:\n\n![SwiftyWalkthrough demo](https://raw.githubusercontent.com/ruipfcosta/SwiftyWalkthrough/master/extras/demo.gif)\n\n![MyChoicePad demo](https://raw.githubusercontent.com/ruipfcosta/SwiftyWalkthrough/master/extras/demo-mcp.gif)\n\n## Usage\n\nSwiftyWalkthrough works by adding an overlay on top of your screen, blocking the access to your views. You can then control which views should be made accessible and when.\n\n### Initialize a walkthrough or attach to an existing one\n\n```swift\nimport SwiftyWalkthrough\n\nif let _ = walkthroughView {\n\t// Attached to existing walkthrough\n} else {\n   let myCustomWalkthrough = CustomWalkthroughView()\n   startWalkthrough(myCustomWalkthrough)\n   // Walkthrough initialized\n}\n```\n\n### Check if there is an ongoing walkthrough\n\nSometimes it is useful to know if there is an ongoing walkthrough (i.e. to adjust the logic on the view controllers). In that situation you can make use of the property ```ongoingWalkthrough```.\n\n```swift\n@IBAction func switchValueChanged(sender: UISwitch) {\n    customWalkthroughView?.removeAllHoles()\n    customWalkthroughView?.helpLabel.hidden = true\n\t\n    NSUserDefaults.standardUserDefaults().setBool(true, forKey: \"settingsWalkthroughComplete\")\n\t\n    if ongoingWalkthrough {\n        navigationController?.popToRootViewControllerAnimated(true)\n    }\n}\n```\n\n### Cut holes on the overlay for the views you want to expose\n\n```swift\n@IBOutlet weak var nameField: UITextField!\n@IBOutlet weak var surnameField: UITextField!\n@IBOutlet weak var addressField: UITextField!\n\noverride func viewDidAppear(animated: Bool) {\n\tsuper.viewDidAppear(animated)\n\twalkthroughView?.cutHolesForViews([nameField]) // start by only allowing the interaction with nameField\n}\n```\n\n`cutHolesForViews` will only look into your views' frames to cut the holes in the overlay. If you want to add some extra padding or define a corner radius, use `cutHolesForViewDescriptors` like this:\n\n```swift\nlet descriptors = [\n\tViewDescriptor(view: showProfileButton, extraPaddingX: 20, extraPaddingY: 10, cornerRadius: 10)\n]\n\nwalkthroughView?.cutHolesForViewDescriptors(descriptors)\n```\n\n### Remove the holes\n\n```swift\nwalkthroughView?.removeAllHoles()\n```\n\n### Close the walkthrough when it is finished\n\n```swift\nfinishWalkthrough()\n```\n\n### Customization\n\nBy default, SwiftyWalkthrough only provides the mechanism to block the access to your views and cut holes to access them, it's up to you to customize it to suit your needs. You can do it by subclassing ```WalkthroughView``` and start the walkthrough with your custom walkthrough view. You can find more about this on the example provided with the library.\n\n```swift\nimport UIKit\nimport SwiftyWalkthrough\n\nclass CustomWalkthroughView: WalkthroughView {\n    // customize it\n}\n\nlet myCustomWalkthrough = CustomWalkthroughView()\nstartWalkthrough(myCustomWalkthrough)\n```\n\nTo specify the overlay's dim color at any time you just need to set the property `dimColor`:\n\n```swift\nwalkthroughView?.dimColor = UIColor.redColor().colorWithAlphaComponent(0.7).CGColor\n```\n\n### WalkthroughViewDelegate\n\nIf for some reason you need to be notified right before the interaction with an exposed view, you can provide an implementation for the `willInteractWithView` method:\n\n```swift\n// MARK: - WalkthroughViewDelegate\n    \nfunc willInteractWithView(view: UIView) {\n    print(\"Will interact with view \\(view)\")\n}\n```\n\n**Note:** Keep in mind that `willInteractWithView` may be invoked multiple times, depending on the view hierarchy, as it relies on UIView's `hitTest` method. From the [UIView Class Reference](https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIView_Class/index.html#//apple_ref/occ/instm/UIView/hitTest:withEvent:):\n\n\u003e This method traverses the view hierarchy by calling the pointInside:withEvent: method of each subview to determine which subview should receive a touch event. If pointInside:withEvent: returns true, then the subview’s hierarchy is similarly traversed until the frontmost view containing the specified point is found. If a view does not contain the point, its branch of the view hierarchy is ignored. You rarely need to call this method yourself, but you might override it to hide touch events from subviews.\n\n\u003e This method ignores view objects that are hidden, that have disabled user interactions, or have an alpha level less than 0.01. This method does not take the view’s content into account when determining a hit. Thus, a view can still be returned even if the specified point is in a transparent portion of that view’s content.\n\n\u003e Points that lie outside the receiver’s bounds are never reported as hits, even if they actually lie within one of the receiver’s subviews. This can occur if the current view’s clipsToBounds property is set to false and the affected subview extends beyond the view’s bounds.\n\n## Requirements\n\n* iOS 9.0+\n* Xcode 10.2.1 / Swift 5\n\n## Instalation\n\n### CocoaPods\n\n```ruby\nplatform :ios, '9.0'\nuse_frameworks!\n\npod 'SwiftyWalkthrough'\n```\n\n### Carthage\n\n```ogdl\ngithub \"ruipfcosta/SwiftyWalkthrough\"\n```\n\n## Credits\n\nOwned and maintained by Rui Costa ([@ruipfcosta](https://twitter.com/ruipfcosta)). \n\nThanks to Andrew Jackman ([@andrew_jackman](https://twitter.com/andrew_jackman)).\n\n## Contributing\n\nBug reports and pull requests are welcome.\n\n## License\n\nSwiftyWalkthrough is released under the MIT license. See LICENSE for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fruipfcosta%2FSwiftyWalkthrough","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fruipfcosta%2FSwiftyWalkthrough","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fruipfcosta%2FSwiftyWalkthrough/lists"}