Our SDK provides you with the tools for an easy and transparent integration of STOMT in your apps. This repository provides you with a target for all the Apple devices we are currently supporting.
- Swift 4
- iOS 10+
Carthage is "A simple, decentralized dependency manager for Cocoa"
- Create a 'Cartfile' in your project root directory
- Copy the following in the Cartfile:
github "stomt/stomt-swift-sdk" ~> 0.1
- Run
carthage update
from the project root directory to fetch and build the SDK
At this point Carthage will have built the SDK and produced the .framework file to include in your project. Due to the App Store submission bug, you should follow the installation instructions available in the Carthage repository.
You can install Cocoapods with the command:
gem install cocoapods
To integrate the SDK using Cocoapods you have to create a Podfile
with the following content:
platform :ios, '10.0'
target '<Your Target Name>' do
pod 'StomtSDK', '~> 0.1'
end
Finally, run
pod install
If you prefer not to use dependency managers you can install the framework manually.
- If you are not using github for your project, execute
git init
, otherwise skip this step. - Add the SDK using git submodules
git submodule add https://github.com/stomt/stomt-swift-sdk
. A folder containing the SDK will be added to your project root folder. - Open the downloaded SDK folder and drag
StomtSDK.xcodeproj
inside and below your project icon in the Xcode navigator. - Click your project tab in the Xcode navigator and in
General
, scroll down and press+
inEmbedded Binaries
to addStomt.framework
for the required platform. - Build the framework from the target drop-down.
- Import following the instructions in the Usage section.
A Widget consists of an instance of SFSafariViewController that gets presented by one of your ViewControllers. Widgets are the easiest way to incorporate stomt creation and feed retrieval functionalities in your app.
To use the widgets you must acquire an applicationID from the "APPS" section of your project page (stomt.com) and set it in the AppDelegate.swift file as follows:
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
Stomt.setAppID(appID: "APPLICATIONID")
return true
}
The STOMT creation Widget can be invoked like this:
Stomt.creationWidget(fromViewController: self)
The feed retrieval Widget can be invoked like this:
Stomt.feedWidget(fromViewController: self)
Definitely! You can find it in the "Examples" folder in the repo.