Coder Social home page Coder Social logo

cthelp's Introduction

CTHelp

CI Status Version License Platform

About CTHelp

CTHelp is a Help system for iOS/Swift 4.2+

SampleScreen

Installation

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

pod 'CTHelp'

Quick Start

Add a button to your view and link the action to a function that sets up and presents the CTHelp view controller.

Here is a sample function that will create 3 help cards + 2 defaults (link to web and support email)

Note: No images appear until you upload images to your project and replace 'SomeFullSizedImage', 'SomeSmallImage' and 'CompanyLogo' with the corresponding names to your images.

Also, the links to the emailAddress and webSite will be broken until replaced with valid entries.

SampleCards

func showCTHelp() {
   let ctHelp = CTHelp()

   // Optional values to set colors
   // ctHelp.ctBgViewColor = .white
   // ctHelp.ctTitleColor = .darkText
   // ctHelp.ctHelpTextColor = .darkGray
   // ctHelp.ctActionButtonBGColor = UIColor(red: 28/255, green: 136/255, blue: 197.255, alpha: 1)
   // ctHelp.ctActionButtonTextColor = .white

   ctHelp.new(CTHelpItem(title:"No Text-Image Only",
                         helpText: "",
                         imageName:"SomeFullSizedImage"))
   ctHelp.new(CTHelpItem(title:"Text and Image",
                         helpText: "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.",
                         imageName:"SomeSmallImage"))
   ctHelp.new(CTHelpItem(title:"No Image-Text Only",
                         helpText: "Eu tempor suscipit dis sed. Tortor velit orci bibendum mattis non metus ornare consequat. Condimentum habitasse dictumst eros nibh rhoncus non pulvinar fermentum. Maecenas convallis gravida facilisis. Interdum, conubia lacinia magnis duis nec quisque.Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.",
                         imageName:""))

 // Optional addition of two default cards
 // Use only if you wish to change the strings presented in the two default cards
   // ctHelp.ctWebButtonTitle = ""
   // ctHelp.ctWebHelpText = ""
   // ctHelp.ctContactTitle = ""
   // ctHelp.ctContactHelpText = ""
   // ctHelp.ctIncludeDataText = ""
   // ctHelp.ctContactButtonTitle = ""

   // Email data
   // ctHelp.ctEmailSubject = ""
   // ctHelp.ctEmailAttachNote = ""
   // ctHelp.ctEmailBody = ""

   // Email alert
   // ctHelp.ctDataAlertTitle = ""
   // ctHelp.ctDataAlertMessage = ""
   // ctHelp.ctDataAlertActionNo = ""
   // ctHelp.ctDataAlertActionYes = ""

   ctHelp.appendDefaults(companyName: "Your Company Name", emailAddress: "[email protected]", data: nil, webSite: "https://www.yourWebsite.com", companyImageName: "CompanyLogo")

   ctHelp.presentHelp(from: self)
}

The optional color values let you change each of the 4 different components of the CTHelpView

image-20190124165825249

So uncommenting and changing some or all of the values can change the appearance of your help card.

image-20190124170300316

Optional String Values

You may choose to override the strings that are used on the two default cards (web and email contact). For your reference, here is how they match up. If you do not change the strings, the text will appear as shown with the exception of your company and app name which are passed through with the function call.

webStrings

contactStrings

alertStrings

emailStrings

More Documentation:

Read the Medium Blog for full documentation and tips for setting up CTHelp. Includes link to YouTube Video

https://medium.com/@stewartlynch/adding-help-to-your-ios-app-7d53053fb563

Author

StewartLynch, [email protected]

License

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

cthelp's People

Contributors

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