Giter VIP home page Giter VIP logo

faqview's Introduction

FAQView

An easy to use FAQ view for iOS written in Swift.

  • This view is a subclass of UIView.


FAQView FAQView

Setup with CocoaPods

If you are using CocoaPods add this text to your Podfile and run pod install.

use_frameworks!
target 'Your target name'
pod 'FAQView', '~> 0.5.0'

Or Add source

Simply add FAQView.swift file to you project.

Usage

Creating a view from the code

let items = [FAQItem(question: "What is reddit?", answer: "reddit is a source for what's new and popular on the web."),
            FAQItem(question: "How is a submission's score determined?", answer: "A submission's score is simply the number of upvotes minus the number of downvotes.")]

let faqView = FAQView(frame: view.frame, items: items)
view.addSubview(faqView)

Attributed text answers

You may use attributed text instead of plain text. Set the attributedAnswer property of items to an NSAttributedString.

Customization

// Change title
faqView.titleLabelText = "Top Queries"

// Question text color  
faqView.questionTextColor = UIColor.blue

// Answer text color
faqView.answerTextColor = UIColor.blue

// Question text font
faqView.questionTextFont = UIFont(name: "HelveticaNeue-Light", size: 15)

// View background color
faqView.viewBackgroundColor = UIColor.white

// Set up data detectors for automatic detection of links, phone numbers, etc., contained within the answer text.
faqView.dataDetectorTypes = [.phoneNumber, .calendarEvent, .link]

// Set color for links and detected data
faqView.tintColor = UIColor.red

Requirements

  • Swift 4.0
  • Xcode 9.0+
  • FAQView 0.4.x is compatible with Swift 3
  • iOS 9.0+

Author

Mukesh Thawani

Contributing

Feature requests, bug reports, and pull requests are all welcome.

License

Copyright (c) 2016-present Mukesh Thawani. Release under the MIT License.

faqview's People

Contributors

davidlari avatar irshadpc avatar mukeshthawani avatar widcket avatar

Watchers

 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.