SegmentedController

public protocol SegmentedController

Represents a type which provides data and handling for actions for a SegmentedViewController.

  • Returns the number of segments.

    Declaration

    Swift

    func numberOfSegments() -> Int

    Return Value

    The number of segments.

  • Returns the view controller for the given segment index.

    Declaration

    Swift

    func viewControllerForSegment(atIndex index: Int) -> UIViewController?

    Parameters

    index

    An index of a segment.

    Return Value

    The view controller for the given segment index.

  • Returns the title for the given segment index.

    Declaration

    Swift

    func titleForSegment(atIndex index: Int) -> String?

    Parameters

    index

    An index of a segment.

    Return Value

    The title for the given segment index.

  • Tells the segmented controller that the segment at the specified index was selected.

    Declaration

    Swift

    func didSelectSegment(atIndex index: Int, of segmentedViewController: SegmentedViewController)

    Parameters

    index

    The index of the selected segment.

    segmentedViewController

    The segmented view controller object that is notifying you of the selection change.