Skip to content

A coachmark used in list views in iOS applications [under development!]

License

Notifications You must be signed in to change notification settings

AamirAnwar/OSListCoachmark

Repository files navigation

Alt Text

OSCoachmarkView [Under Development]

Maintainability Test Coverage Build Status Carthage compatible GitHub license

A lightweight framework for displaying coachmarks in iOS apps. Built in pure Swift 👨‍💻

Alt Text

Showcase

Standard List Coachmark

A compact coachmark which is generally used in list views. Here's a demo of what this looks like,

Alt Text

Appstore coachmark

A coachmark similar to the one used on the appstore product page.

Alt Text

Installation

Cocoapods

For CocoaPods, add this to your podfile

  pod 'OSCoachmarkView', '~> 0.1'

Carthage

For Carthage, add the following to your Cartfile

github "AamirAnwar/OSListCoachmark" ~> 0.1

Usage

You can use any of the preset coachmarks using OSListCoachmarkGenerator or create any custom view in the same fashion. Here is how you would embed your custom view inside the coachmark.

let view = CustomCoachmarkView()
let coachmarkView = OSCoachmarkView()
coachmarkView.attachedView = view

Sizing of the above custom coachmark will be based on autolayout subject to min/max constraints. To position the coachmark relative to the view, you can write your own logic to show/hide the coachmark or you can use OSCoachmarkPresenter to do this. Here's an example of what this might look like -

let coachmarkPresenter = OSCoachmarkPresenter()
coachmarkPresenter.view = coachmarkView
coachmarkPresenter.attachToView(self.view, anchor: .bottom)

OSCoachmarkPresenter objects can attach a coachmark to a given view with two modes - top and bottom. All animation and presentation logic is taken care of with you only having to call show() and hide() based on any logic you choose.

// Show
self.coachmarkPresenter.show()

//Hide
self.coachmarkPresenter.hide()

Checkout the example Xcode Project in the Example folder which has a demo with all three classes in action 🚀

Additional Features

  • Added Blur support in OSListCoachmarkView
  • Optional loader in OSListCoachmarkView

Documentation

You can find the reference docs under OSCoachmarkView/docs/index.html

Requirements

  • iOS 11.0+
  • Xcode 9
  • Swift 4

Contributing

All help is welcome. Open an issue or even better submit a pull request 😀

Author

Aamir Anwar @aamiranwarr Feel free to reach out to me on twitter!

License

OSListCoachmark is released under the MIT license. See LICENSE for more details.

Todo

  • Abstract out presenter logic
  • Add animation options to both top and bottom modes
  • Add blur support
  • Create example coachmarks using the Factory Pattern
  • Add Cocoapod/Carthage support
  • Polish README
  • Add Travis Support
  • Generate documentation

About

A coachmark used in list views in iOS applications [under development!]

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published