CocoaPods trunk is moving to be read-only. Read more on the blog, there are 15 months to go.
TestsTested | ✗ |
LangLanguage | Obj-CObjective C |
License | Commercial |
ReleasedLast Release | Jun 2019 |
Maintained by Thomas Kaufmann, Chris Connors, Marc Slavec.
This repository contains binary distribution of AnswerDash iOS SDK released by AnswerDash.
If you have any questions, comments, or issues related to any products distributed via this repository then please contact the team by emailing [email protected].
AnswerDashSDK is a dynamic framework that is compatible with Objective-C and Swift projects that target iOS 8 and higher.
AnswerDashSDK can be installed directly into your application by importing the framework or via CocoaPods. Quick installation instructions are provided below for reference.
The recommended path for installation is CocoaPods. CocoaPods provides a simple, versioned dependency management system that automates the tedious and error prone aspects of manually configuring libraries and frameworks. You can add AnswerDashSDK to your project via CocoaPods by doing the following:
$ sudo gem install cocoapods
$ pod setup
Now run the following in the root of your project directory:
$ pod init
This creates a Podfile
, to integrate the AnswerDashSDK add pod AnswerDashSDK
to the file. It should now look similar to this:
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
use_frameworks!
target '<Your Target Name>' do
pod 'AnswerDashSDK'
end
Complete the installation by executing:
$ pod install
These instructions will setup your local CocoaPods environment and import AnswerDashSDK into your project.
If you wish to install AnswerDashSDK directly into your application via the binary framework, download the latest AnswerDashSDK.tgz
, extract AnswerDashSDK.framework
and add it to your application with the following steps:
AnswerDashSDK.framework
is added to both 'Linked Frameworks and Libraries' and 'Embedded Binaries'.Apple will not allow uploading apps with unwanted architectures. You will see an error similar to this:
- ERROR ITMS-90087: "Unsupported Architectures. The executable for YourCompany.app/Frameworks/AnswerDashSDK.framework contains unsupported architectures '[x86_64, i386]'."
To fix this, add Run Script Phase to Build Phases:
bash "${BUILT_PRODUCTS_DIR}/${FRAMEWORKS_FOLDER_PATH}/AnswerDashSDK.framework/strip-frameworks.sh"
For more info, check this article.
Swift:
@import AnswerDashSDK
Objective-C:
#import <AnswerDashSDK/AnswerDashSDK.h>
AnswerDashSDK should be initialized at the application startup with a valid site ID. Add the following line to your application:didFinishLaunchingWithOptions:
delegate method.
Swift:
AnswerDash.initializeWithSiteID("YOUR-SITE-ID")
Objective-C:
[AnswerDash initializeWithSiteID:@"YOUR-SITE-ID"];
Whenever your application state changes, call the following method to inform the AnswerDashSDK. Calling this method will automatically preload the new questions and answers.
Swift:
AnswerDash.appState = "NEW-APP-STATE"
Objective-C:
[AnswerDash setAppState:@"NEW-APP-STATE"];
Programatically,
Swift:
let myAnswerDashButton = AnswerDashButton()
view.addSubview(myAnswerDashButton)
//Add layout constraints as required to position the button.
Objective C:
AnswerDashButton *myAnswerDashButton = [AnswerDashButton new];
[self.view addSubview:myAnswerDashButton];
//Add layout constraints as required to position the button.
Using Interface Builder,
Add a UIView
to your interface XIB/Storyboard. Change the custom class to AnswerDashButton
and add required layout constraints to position the button. DO NOT add width and height constraints.
If you need a default floating help button for your UITableView
, UICollectionView
or any other UIScrollView
based control, use this convenient method. AnswerDashSDK will properly position the button on the bottom right corner of the view and make it sticky when scrolling.
Swift:
tableView.addAnswerDashButton()
Objective-C:
[self.tableView addAnswerDashButton];
You can call removeAnswerDashButton
method to remove the button if required. For example:
Swift:
deinit {
tableView.removeAnswerDashButton()
}
Objective-C:
- (void)dealloc {
[self.tableView removeAnswerDashButton];
}
You can customize the appearance of the default AnswerDash button using following properties.
myAnswerDashButton.borderColor
myAnswerDashButton.fillColor
myAnswerDashButton.iconColor
If you want to trigger the AnswerDash popup using your own button or other interaction, call methods below directly to show and hide the popup.
Swift:
AnswerDashSDK.show() //Opens the AnswerDash popup
AnswerDashSDK.hide() //Close the AnswerDash popup
Objective-C:
[AnswerDashSDK show]; //Opens the AnswerDash popup
[AnswerDashSDK hide]; //Close the AnswerDash popup
You can reach the AnswerDash team at any time by emailing [email protected].
AnswerDashSDK is licensed under the AnswerDash SDK License.