Latest 2.0.0
Homepage https://github.com/Autodesk/ADNetPromoterScoreSurvey-iOS
License MIT
Platforms ios 9.0
Authors

ADNetPromoterScoreSurvey is an iOS component that presents Net Promoter Score (NPS) survey dialog to the user.

iPhone1iPhone2iPhone3

Features

  • Popup NPS survey dialog
  • Callbacks on user interaction
  • Final callback with user score, promoter type and feedback
  • Customize the dialog’s UI with your own style.

Support and requirements

  • iOS 9 and higher
  • Swift 4
  • Supports iPhone X

Installation

Cocoapods (Version 1.4.0 or later)

pod 'ADNetPromoterScoreSurvey'

Getting started

Create ADNetPromoterScoreSurvey member

var npsSurvery = ADNetPromoterScoreSurvey()

Show The survey

Just call showSurvey function view controller whenever you want to show the survey:

self.npsSurvery.showSurvey(onViewController: self)

Delegate Methods

Implement NetPromoterScoreSurveyDelegate to get survey results and user interaction callbacks

self.npsSurvery.delegate = self

Implementing NetPromoterScoreSurveyDelegate protocol:

All delegate methods are optional:

@objc optional func netPromoterScoreViewDidChange(_ npsSurvey: ADNetPromoterScoreSurvey,
                                                       toView: NetPromoterScoreViewType)

Implement this method to receive a callback when survey view changed.
toView will hold the active view type (scoreQuestionView, feedbackQuestionView, thankYouView)


@objc optional func netPromoterScoreDidPressSendScore(_ npsSurvey: ADNetPromoterScoreSurvey,
                                                    selectedScore: Int)

Implement this method to receive a callback when the user click on "Send" Button after selecting score in the Score Question View.


@objc optional func netPromoterScoreDidChangeScoreValue(_ npsSurvey: ADNetPromoterScoreSurvey,
                                                      newScoreValue: Int)

Implement this method to receive a callback when the user change the score in the Score slider.


@objc optional func netPromoterScoreDidPressEditScore(_ npsSurvey: ADNetPromoterScoreSurvey)

Implement this method to receive a callback when the user back to edit score from the "Feedback View"


@objc optional func netPromoterScoreSurveryCompleted(_ npsSurvey: ADNetPromoterScoreSurvey,
                                                    surveyResult: NPSResult)

Implement this method to receive a callback when the survey proccess completed and get the whole survey result.
surveyResult parameter provides summary of the survey result (score, feedback, promoterType).


@objc optional func netPromoterScoreDidPressClose(_ npsSurvey: ADNetPromoterScoreSurvey,
                                                     fromView: NetPromoterScoreViewType)

Implement this method to receive a callback when the user closes the survey. fromView will hold the view type that was active when the user closed the survey.

Custom Appearance

In order to use you custom texts and fonts you can change the appearnce of the survey.

Changing text:

self.npsSurvery.appearance.scoreQuestionViewAppearance.questionText = "My custom question text" 

Changing font:

self.npsSurvery.appearance.feedbackQuestionViewAppearance.textFieldFont = UIFont(name: "My Custom Font Name", size: 14)

Changing colors:

self.npsSurvery.appearance.scoreQuestionViewAppearance.highRankTitleColor = UIColor.red
self.npsSurvery.appearance.feedbackQuestionViewAppearance.titleFontColor = UIColor.red
self.npsSurvery.appearance.thankYouViewAppearance.backgroundColor  = UIColor.black

Example Project

  1. Clone the repository to your local environment
  2. Go to dir NetPromoterScoreSurveyExample
  3. Execute pod install
  4. Open Xcode workspace NetPromoterScoreSurveyExample.xcworkspace
  5. Run

Change Log

See Change Log page.

Contributing

See Contributing page.

Contact

Tomer Shalom

Latest podspec

{
    "name": "ADNetPromoterScoreSurvey",
    "version": "2.0.0",
    "summary": "An iOS Net Promoter Score Survey",
    "description": "Net Promoter or Net Promoter Score (NPS) is a management tool that can be used to gauge the loyalty of a firm's customer relationships. nIt serves as an alternative to traditional customer satisfaction research and claims to be correlated with revenue growth. nNPS has been widely adopted with more than two thirds of Fortune 1000 companies using the metric.",
    "homepage": "https://github.com/Autodesk/ADNetPromoterScoreSurvey-iOS",
    "screenshots": [
        "https://raw.githubusercontent.com/Autodesk/ADNetPromoterScoreSurvey-iOS/master/Assets/iphone1.png",
        "https://raw.githubusercontent.com/Autodesk/ADNetPromoterScoreSurvey-iOS/master/Assets/iphone2.png",
        "https://raw.githubusercontent.com/Autodesk/ADNetPromoterScoreSurvey-iOS/master/Assets/iphone3.png"
    ],
    "license": "MIT",
    "authors": {
        "Tomer Shalom": "[email protected]"
    },
    "social_media_url": "http://twitter.com/applitom",
    "platforms": {
        "ios": "9.0"
    },
    "source": {
        "git": "https://github.com/Autodesk/ADNetPromoterScoreSurvey-iOS.git",
        "tag": "2.0.0"
    },
    "source_files": "ADNetPromoterScoreSurvey/**/*.{h,m,swift}",
    "resources": "ADNetPromoterScoreSurvey/**/*.{xib,xcassets}",
    "swift_version": "4.0"
}

Pin It on Pinterest

Share This