Swiftpack.co - Package - StewartLynch/CTHelpSPM


License Platform

About CTHelp

CTHelp is a Help system for iOS/Swift 5.1+ and iOS13+

Beta2 Release for iOS13

CTHelp is fully light/Dark mode compatible.



This version of CTHelp is installed via Swift Package Manager within XCode.

  1. From within Xcode 11 or later, choose File > Swift Package > Add Package Dependency

  2. At the next screen, enter https://github.com/StewartLynch/CTHelpSPM.git when asked to choose a Package Repository.


  3. Choose the latest version available (number may vary from this documentation)


  4. Add the package to your target.


You now have the dependency installed and are ready to import and use CTHelp

Quick Start

In your ViewController where you are going to present CTHelp,

import CTHelp

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.


func showCTHelp() {
   let ctHelp = CTHelp()

   // Optional values to set colors - The defaults are as shown
   // **Note**: if you are going to replace colors with custom colors, make sure you use colors
   // that have both a light and dark appearance.  **Use the Asset Catalog**
   // ctHelp.ctBgViewColor = .systemBackground
   // ctHelp.ctTitleColor = .label
   // ctHelp.ctHelpTextColor = .secondaryLabel
   // ctHelp.ctActionButtonBGColor = .systemBlue
   // ctHelp.ctActionButtonTextColor = .white
   // ctHelp.ctCloseButtonBGColor = .systemGray
   // ctHelp.ctCloseButtonTextColor = .white
   // ctHelp.ctPageControlColor = .label

   // Changes Color of buttons in navBar and on alertButtons when the mail form is presented
   // ctHelp.ctMailtintColor =  default tint color unless changed

   ctHelp.new(CTHelpItem(title:"No Text-Image Only",
                         helpText: "",
   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.",
   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.",

 // 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: "yourContactEmail@somewhere.com", data: nil, webSite: "https://www.yourWebsite.com", companyImageName: "CompanyLogo")

   ctHelp.presentHelp(from: self)

Changing Colors

The optional color values let you change each of the 5 different components of the CTHelp Card.

By default, CTHelp supports light and dark mode by default and with the default color settings shown below. If you decide to override these colors with your own, it is recommended that you use the Asset Catalog and make sure that you create colors for both the Any and Dark modes.


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


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.





Feedback Requested:

Please provide me with feedback for improvement.


StewartLynch, slynch@createchsol.com


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


Stars: 0
Help us keep the lights on


Used By

Total: 0