Coder Social home page Coder Social logo

mcpoet / crfaqtableviewcontroller Goto Github PK

View Code? Open in Web Editor NEW

This project forked from camroth/crfaqtableviewcontroller

0.0 2.0 0.0 3.16 MB

CRFAQTableViewController allows you to quickly and easily display a clickable interface to navigate question and answer style content.

License: MIT License

crfaqtableviewcontroller's Introduction

CRFAQTableViewController

CRFAQTableViewController allows you to quickly and easily display a clickable interface to navigate question and answer style content. All lines automatically account for the required height to display a question or answer, and an indexed table of contents appears at the top for quick navigation.

CRFAQTableViewController demo

Usage

CRFAQTableViewController *faqViewController = [[CRFAQTableViewController alloc] init];
[faqViewController addQuestion:@"How Many Questions Can I Add?" withAnswer:@"As many as you want!"];

Optionally, an initializer exists to create an FAQ with existing data:

- (instancetype)initWithQuestions:(NSArray *)questions;

Where questions take the form of an array of 2-item arrays:

@[	@[ @"Question", @"Answer" ]	]

Once you have your CRFAQTableViewController created, you can always add more questions:

- (void)addQuestion:(NSString *)question withAnswer:(NSString *)answer;

While sane defaults have been chosen, you might want your FAQ to look and feel differently. For your convenience and customization, you can use these:

- (void)setHighlightedQuestionDelay:(float)highlightedQuestionDelay;
- (void)setHighlightedQuestionDuration:(float)highlightedQuestionDuration;
- (void)setHighlightedQuestionColor:(UIColor *)highlightedQuestionColor;
- (void)setIndexTitle:(NSString *)indexTitle;
- (void)setFontForQuestions:(UIFont *)fontForQuestions;
- (void)setFontForAnswers:(UIFont *)fontForAnswers;
- (void)setSectionHeadersToUppercase:(BOOL)isUppercase;

Installation

CRFAQTableViewController is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod "CRFAQTableViewController"

If you're not using CocoaPods, you'll want to place both the h/m/xib somewhere in your project.

License

CRFAQTableViewController is available under the MIT license. See the LICENSE file for more info.

Screenshots

Table of contents Item selected example

crfaqtableviewcontroller's People

Contributors

camroth avatar

Watchers

 avatar  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.