Name: ios-app-example-pod
Owner: Particle
Description: Barebones example Swift iOS app demonstrating how to use the ParticleSetup / SDK cocoapod libraries
Created: 2015-04-13 22:36:53.0
Updated: 2018-04-24 02:11:11.0
Pushed: 2018-03-10 01:06:46.0
Size: 13554
Language: Swift
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
Barebones Swift iOS app showcasing basic ParticleSetup / Particle-SDK cocoapods usage / getting started.
Versioning: macOS 10.13.3, XCode 9.2 (Swift 4), Cocoapods 1.4, Particle-SDK pod 0.7, ParticleSetup pod 0.8
pod install
(make sure your have latest Cocoapods installed), pods will be installed and new XCode workspace file will be created.<your project name>.xcworkspace
Particle-Bridging-Header.h
for reference../<your project name folder>/Particle-Bridging-Header.h
(or wherever file is located).ViewController.swift
and Main.storyboard
for reference)ViewController invoking Particle setup must adhere to the ParticleSetupMainControllerDelegate
protocol and implement (at least) the funcion func particleSetupViewController(_ controller: ParticleSetupMainController!, didFinishWith result: ParticleSetupMainControllerResult, device: ParticleDevice!)
.
To invoke setup:
et setupController = ParticleSetupMainController()
setupController.delegate = self //as! UIViewController & ParticleSetupMainControllerDelegate
self.present(setupController, animated: true, completion: nil)
To reference the Particle cloud use: ParticleCloud.sharedInstance()
,
to reference a device use: var device : ParticleDevice
or use a returned device instance from a cloud function like:
evice != nil
device.getVariable("test", completion: { (value, err) -> Void in
print(value)
})
For questions - refer to Particle mobile knowledgebase/community here: https://community.particle.io/c/mobile
Good luck!