Coder Social home page Coder Social logo

autodesk / adnetpromoterscoresurvey-ios Goto Github PK

View Code? Open in Web Editor NEW
15.0 15.0 9.0 454 KB

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

License: MIT License

Ruby 1.93% Swift 98.07%

adnetpromoterscoresurvey-ios's People

Contributors

adibendahan avatar applitom avatar qiuradsk avatar shaltom avatar simonbengtsson avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

adnetpromoterscoresurvey-ios's Issues

Setting base color

Currently you have to set each and every color to change to your app's base color. Would you accept a PR adding this method to reduce the boilerplate needed for simpler customizations?

In NPSAppearance:

func setBaseColor(_ color: UIColor) {
    let scoreLook = scoreQuestionViewAppearance
    scoreLook.sliderThumbColor = adjustBrightness(for: color, by: -10)
    scoreLook.sliderMinimumTrackTicksColor = UIColor.black.withAlphaComponent(0.2)
    scoreLook.highRankTitleMarkedColor = color
    scoreLook.lowRankTitleMarkedColor = color
    scoreLook.sliderMinimumTrackBackgroundColor = color
    scoreLook.selectedScoreTextColor = color
    scoreLook.sendButtonBackgroundColor = color
    
    let feedbackLook = feedbackQuestionViewAppearance
    feedbackLook.sendButtonBackgroundColor = color
    feedbackLook.editScoreButtonTextColor = color
    
    thankYouViewAppearance.bottomBannerColor = color
}

private func adjustBrightness(for color: UIColor, by percentage: CGFloat) -> UIColor? {
    var r: CGFloat = 0, g: CGFloat = 0, b: CGFloat = 0, a: CGFloat = 0
    color.getRed(&r, green: &g, blue: &b, alpha: &a)
    return UIColor(red: min(r + percentage / 100, 1.0),
                   green: min(g + percentage / 100, 1.0),
                   blue: min(b + percentage / 100, 1.0),
                   alpha: a)
}

Swift 5

Would you merge a PR converting code to swift 5?

Survey overlaps UI components on iPhone SE

Hey - I really like this library and everything is working great with it - except one thing - on iPhone SE, when entering text in the form field, the survey overlaps with UI components at the top of the app. See below for an example:

IMG_2014 (1)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.