Skip to content

CLASS

SPViewController

open class SPViewController: SessionStatusViewController, SPSceneDelegate

The view containing the sceneKit scene

Properties

spType

open var spType: SPType

Methods

isStartPosition()

public func isStartPosition() -> Bool

init(nibName:bundle:)

override public init(nibName nibNameOrNil: String?, bundle nibBundleOrNil: Bundle?)

init(coder:)

required public init?(coder: NSCoder)

viewDidLoad()

open override func viewDidLoad()

viewDidAppear(_:)

open override func viewDidAppear(_ animated: Bool)

Parameters

Name Description
animated

viewWillTransition(to:with:)

open override func viewWillTransition(to size: CGSize,
                                      with coordinator: UIViewControllerTransitionCoordinator)

Method relating to the change of UI orientation.

  • Parameters:
  • size: The new size of the view
  • coordinator: sender

Parameters

Name Description
size The new size of the view
coordinator sender

viewWillDisappear(_:)

open override func viewWillDisappear(_ animated: Bool)

reload()

public func reload()

Removed the current scene and reloads it, calling all delegate methods againg.

reloadData()

public func reloadData()

Reloads the view to accomodate new or removed targets

update(icon:forTarget:inSection:)

public func update(icon: String, forTarget targetIndex: Int, inSection sectionIndex: Int = 0)

Update the icon of a target. This is relevant when UI changes impacts the presented icon.

  • Parameters:
  • icon: The new icon, a string the defines the location and name of an image file.
  • index: The index of the target to update the icon for.

Parameters

Name Description
icon The new icon, a string the defines the location and name of an image file.
index The index of the target to update the icon for.

getSection(_:)

public func getSection(_ index: Int) -> Section?

updateWinSize(to:)

public func updateWinSize(to winSize: Int)

numberOfSections()

open func numberOfSections() -> Int

spType(inSection:)

open func spType(inSection sectionIndex: Int) -> SPType

numberOfTargets(inSection:)

open func numberOfTargets(inSection index: Int) -> Int

Set up the number of targets in the scene. Override this method for your own implementation. - Parameters: - index: The section index - Returns: The number of targets in the scene.

Parameters

Name Description
index The section index

configure(section:)

open func configure(section: Section) -> Section

configure(target:inSection:atIndex:)

open func configure(target: TargetNode, inSection section: Int, atIndex index: Int) -> TargetNode

Configure each cell with a single target, and return it to display the cell and animate the target. Override this method for custom settings.

  • Parameters:
  • cell: The cell to be configured
  • atIndex: The index of the cell
  • Returns: The configured cell

Parameters

Name Description
cell The cell to be configured
atIndex The index of the cell

didActivate(target:inSection:atIndex:)

open func didActivate(target: TargetNode, inSection sectionIndex: Int, atIndex targetIndex: Int)

Notifies when a given target has been detected as activated. Override this method to react to activations in the controller.

  • Parameters:
  • cell: The cell that has been activated (contains a target node)
  • index: The index of the target that was activated.

Parameters

Name Description
cell The cell that has been activated (contains a target node)
index The index of the target that was activated.