Skip to content

CLASS

Section

public class Section: SKNode

A section contains a series of targets and can manipulate or access the targets within.

Properties

index

public var index: Int = 0

numberOfTargets

public var numberOfTargets: Int = 0

pursuitType

public var pursuitType: TargetPursuitType = .elliptical(center: CGPoint.zero, diameter: 1, .normal)

bounds

public var bounds: CGRect = CGRect(x: 0, y: 0, width: 0, height: 0)

animated

public var animated: Bool

Methods

setup()

public func setup()

Creates the cells and animates the targets if defined.

animate()

public func animate()

Animates all targets in the section to the configured pursuit type.

moveTo(_:completion:)

public func moveTo(_ point: TargetPoint, completion: @escaping () -> (Void) = {})

Moves all targets in the section to a given relative point.

  • Returns: Completion of the moving animation.

place(at:)

public func place(at point: TargetPoint)

react(with:completion:)

public func react(with reaction: TargetReaction, completion: @escaping () -> (Void) = {})

Makes all nodes in the section react with a given reaction.

  • Returns: Completion of the reaction animation.

changeSpeed(by:)

public func changeSpeed(by k: CGFloat)

reload()

public func reload()

Reloads all cells in the section.

update()

public func update()

Calls the configure(section) method in the view controller, asking for a new configration.