To run the example project, clone the repo, and run pod install
from the Example directory first.
- Describe more than one component with one dialog box.
- Set dialog box in bottom or top of your component.
- Adjusting component in circle shape.
- Self resizing to fit in the screen.
- Customizing dialog box in the way you want.
Xcode 8.0+ / Swift 3
iOS 8.0+
HPShowcase is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod 'HPShowcase'
You just need to drag ShowcaseController.swift , TASubtractionPath.swift , TAOverlayView.swift and TriangleView.swift into your project.
All thing you have to do is to complete below function:
ShowcaseController.instance.showHelp(helps: [TAOverlayView], targetVireController: UIViewController)
So you have to pass an array from TAOverlayView with your targetViewController. Lets create our first TAOverlayView:
TAOverlayView(subtractedPaths: [TASubtractionPath], hintLableTargetView: UIView, hintText: String, containerView: UIView, backgroundColor: UIColor, textColor: UIColor, boxPosition: DialogBoxPosition)
- subtractedPaths are the paths that you want to be shown in HPShowcase. If you want to show more than one component to user , create multiple subtractedPaths.
- hintLableTargetView is the view that you want to put dialog box under or top of it.
- hintText is your text that will be shown to user.
- containerView is a view that contains all of your hintLableTargetViews.
- backgroundColor parameter is backgroundColor of dialog box.
- textColor parameter is textColor of hint label.
- DialogBoxPosition is an enum to allow you put your dialog box on top or on bottom of hintLableTargetView.
So just one more thing , now we create TASubtractionPath:
TASubtractionPath(view: UIView, horizontalPadding: CGFloat = 0, verticalPadding: CGFloat = 0, cornerRadius: CGFloat = 0, shape: Shape = .rectangle)
- view will be shown to user in a shape.
- horizontalPadding is padding from left and right.
- verticalPadding is padding from top and bottom.
- cornerRadius can make corners of your shape(It is a square by default) to be curved.
- shape is an enum that allow you to make circle or square shapes.
You can access to HPShowcase delegate by:
ShowcaseController.instance.delegate
Do what you want after all things:
func helpShowFinished() {
// You can set a perfrence for that
}
- Arash Farahani
- Mehdi Gilanpour Also thanks to Nick Yap for the idea of overlay.
HPShowcase is available under the MIT license. See the LICENSE file for more info.