Giter Site home page Giter Site logo

papercloud / esfeedbackviewcontroller Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ezescaruli/esfeedbackviewcontroller

0.0 3.0 1.0 1.8 MB

iOS library to show a feedback screen within an application.

License: MIT License

Ruby 1.46% Objective-C 88.24% Shell 10.30%

esfeedbackviewcontroller's Introduction

ESFeedbackViewController

Build Status Pod Platform

ESFeedbackViewController is an iOS library to show a feedback screen within an application. It shows a set of prompts, one after the other. Depending on what the user chooses in each step, the final input can end up being:

  • A written suggestion.
  • A review in the App Store.

Drawing

Installation

Simply add ESFeedbackViewController to your Podfile:

pod 'ESFeedbackViewController'

Usage

In your AppDelegate, once the application finished launching, add:

#import <ESFeedbackViewController/ESFeedbackViewController.h>

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
  ...

  // The required number of application launches to show the feedback screen.
  [ESFeedbackViewController setNumberOfLaunchesToShow:NUMBER_OF_LAUNCHES];
  
  // The app ID, required to show redirect the user to the App Store.
  [ESFeedbackViewController setAppID:APP_ID];
  
  // Register that the application was launched.
  [ESFeedbackViewController registerAppLaunch];

  ...
}

Displaying

Once [ESFeedbackViewController registerAppLaunch] was called, the feedback screen can be shown in any point of the app using the showIfNecessary method. For example:

@implementation MyViewController

- (void)viewDidAppear:(BOOL)animated {
  [super viewDidAppear:animated];
  [ESFeedbackViewController showIfNecessary];
}  

@end

Input tracking

To track the input that the user performs step by step, a callback is provided. It is called each time the user dismisses a prompt. It receives a view controller that represents the dismissed prompt, and a boolean indicating if the user chose to continue or to cancel. Can be useful to hit an analytics/backend server to store the input:

[ESFeedbackViewController setOnPromptWasDismissed:^(ESFeedbackPromptViewController *promptVC, BOOL ok) {
  NSLog(ok ? @"Pressed OK" : @"Pressed Cancel");

  if (promptVC.inputText.length > 0) {
    // If the prompt view controller has any way to input text, it can be accessed through the inputText property.
    NSLog(@"Input text: %@", promptVC.inputText);
  }
}];

Customization

As an UI addon, the text and buttons font can be customized:

[ESFeedbackViewController setTextFont:TEXT_FONT];
[ESFeedbackViewController setButtonsFont:BUTTONS_FONT];

License

This library is available under the MIT license.

esfeedbackviewcontroller's People

Contributors

markst avatar ezescaruli avatar

Watchers

Tom Spacek avatar  avatar James Cloos avatar

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.