Inherits from NSObject
Conforms to NSFastEnumeration
TKCoreLayout
Declared in TKCoreStackLayout.h

Overview

A class that is able to arrange subviews in a stack layout.

Properties

alignmentMode

The alignment mode that will be used when arranging the view.

@property TKCoreLayoutAlignmentMode alignmentMode

Declared In

TKCoreStackLayout.h

count

The items count.

@property (nonatomic, readonly) NSInteger count

Return Value

The items count.

Declared In

TKCoreStackLayout.h

itemOrder

The layout order. It can be normal or reversed.

@property (nonatomic, assign) TKCoreStackLayoutItemOrder itemOrder

Discussion

The stack layout item orders are defined as follows:

typedef enum {
    TKCoreStackLayoutItemOrderNormal,       // Items should be arranged in the same order they are added in the stack.
    TKCoreStackLayoutItemOrderReverse       // Items should be arranged in reverse order.
} TKCoreStackLayoutItemOrder;

Declared In

TKCoreStackLayout.h

itemSpacing

A value that defines the spacing between the subviews.

@property (nonatomic, assign) CGFloat itemSpacing

Declared In

TKCoreStackLayout.h

items

The stack items.

@property (nonatomic, strong, readonly) NSArray *items

Declared In

TKCoreStackLayout.h

orientation

The layout orientation. It can be horizontal or vertical.

@property (nonatomic, assign) TKCoreStackLayoutOrientation orientation

Discussion

The stack layout orientations are defined as follows:

typedef enum {
    TKCoreStackLayoutOrientationHorizontal,     // Items should be arranged horizontally.
    TKCoreStackLayoutOrientationVertical        // Items should be arranged vertically.
} TKCoreStackLayoutOrientation;

Declared In

TKCoreStackLayout.h

stretchMode

The streching mode that will be used when arranging the view.

@property TKCoreLayoutStretchMode stretchMode

Declared In

TKCoreStackLayout.h

Instance Methods

addItem:

Adds a new stack layout item to the stack. This method does not add a subview to a superview. The developer should do this explicitly.

- (BOOL)addItem:(id<TKCoreLayout>)item

Parameters

item

The item to be added.

Return Value

YES if successfull.

Declared In

TKCoreStackLayout.h

indexOfItem:

Gets the index of specific item.

- (NSInteger)indexOfItem:(id<TKCoreLayout>)layoutItem

Parameters

layoutItem

The item.

Return Value

The item index if successfull.

Declared In

TKCoreStackLayout.h

insertItem:atIndex:

Inserts a new item at a specified position in the stack. This method does not add a subview to a superview. The developer should do this explicitly.

- (BOOL)insertItem:(id<TKCoreLayout>)item atIndex:(NSUInteger)index

Parameters

item

The item to be inserted.

index

The index at which the item will be inserted.

Return Value

YES if successfull.

Declared In

TKCoreStackLayout.h

itemAtIndex:

Gets an item at a specific index.

- (id<TKCoreLayout>)itemAtIndex:(NSUInteger)index

Parameters

index

The index of the item.

Return Value

An instance of TKCoreStackLayoutItem if successfull.

Declared In

TKCoreStackLayout.h

lastItem

The last item in the layout

- (id<TKCoreLayout>)lastItem

Return Value

The last item in the layout

Declared In

TKCoreStackLayout.h

removeAllItems

Removes all items from the stack. This method does not remove subviews from their superview.

- (void)removeAllItems

Declared In

TKCoreStackLayout.h

removeItem:

Removes an item from the stack.

- (BOOL)removeItem:(id<TKCoreLayout>)item

Parameters

item

The item to be removed.

Return Value

YES if successfull.

Declared In

TKCoreStackLayout.h

removeItemAtIndex:

Removes an item from the stack.

- (BOOL)removeItemAtIndex:(NSUInteger)index

Parameters

index

The index of the item to be removed.

Return Value

YES if successfull.

Declared In

TKCoreStackLayout.h