CocoaPods trunk is moving to be read-only. Read more on the blog, there are 17 months to go.

MHSegmentedView 0.1.1

MHSegmentedView 0.1.1

TestsTested
LangLanguage Obj-CObjective C
License MIT
ReleasedLast Release Jan 2015

Maintained by Martin Hartl.



Usage

MHSegmentedView is drop-in tabbed Viewcontainer using an UISegmentedControl to switch the views.

  • init the MHSegmentedView using Storyboard or the UIView initializers
  • set the delegate of the MHSegmentedView object
  • MHSegmentedView is using AutoLayout to layout the contained UIViews

MHSegmentedViewDelegate

The class adopting the MHSegmentedViewDelegate must implement the following methods:

// returns the number of views which will be contained in the MHSegmentedView
- (NSInteger)numberOfSegmentsInSegmentedView:(MHSegmentedView *)segmentedView;
// returns the title of the view at the index. The title will be shown in the corresponding segment in the UISegmentedControl
- (NSString *)titleForSegmentAtIndex:(NSInteger)index inSegmentedView:(MHSegmentedView *)segmentedView;
// returns the view which will be presented for the index in the UISegmentedControl
- (UIView *)viewForSegmentIndex:(NSInteger)index inSegmentedView:(MHSegmentedView *)segmentedView;

Installation

Author

Martin Hartl, [email protected]

License

MHSegmentedView is available under the MIT license. See the LICENSE file for more info.