Latest 0.2.1
Homepage https://github.com/zliw/MWButtonGroup
License MIT
Platforms ios 7.0, requires ARC
Authors

A UIView containing a group of buttons horizontally positioned in a rounded rectangle.

  • Support for single-select mode and multi-select mode is available.
  • Colouring and limited styling of the buttons is possible
  • Notifications are handled by a delegate pattern

screenshot

Requirements

MWButtonGroup was written for ARC and requires iOS 7.0+ (but it should also work on earlier versions). No other dependencies are currently needed.

Installation

MWButtonGroup is best installed using CococaPods (see http://cocoapods.org).

Add the following line to your Podfile:

pod 'MWButtonGroup', '~> 0.2'

Usage

An example of the usage can be seen in the MWButtonGroup-Example-Folder.

The Basics

The view can be initialized like any other UIView subclass (or can be created in interface builder). Unfortunately styling of the view has to be implented in code.

  MWButtonGroup *group = [[MWButtonGroup alloc] initWithFrame:CGRectMake(0, 0, 320, 40)];

Buttons can be added by specifying their labels as strings:

  [group createButtonsForTitles:@[@"Yes", @"No", @"Maybe"]]

Multiselection is turned off by default. You can enable it by setting a property.

    group.coloredButtonGroup.multiSelectAllowed = YES;

The default is to use black and white as colour scheme. You can set the following colour
properties.

    group.textColor = [UIColor yellowColor];
    group.buttonBackgroundColor = [UIColor colorWithRed:0 green:0.25 blue:0 alpha:1];

The font can be set for all buttons contained in the button group:

    group.font = [UIFont fontWithName:@"HelveticaNeue" size:16];

License

The component is available under a MIT license. For more details see the license file.

Latest podspec

{
    "name": "MWButtonGroup",
    "version": "0.2.1",
    "summary": "a UIView subclass managing a group of buttons",
    "description": "                       MWButtonGroup manages a group of UIButtonsnn                       * can be configured for multipe or single select moden                       * button colors and some styling (fonts, lines) can be adjusted n",
    "homepage": "https://github.com/zliw/MWButtonGroup",
    "screenshots": "https://raw.githubusercontent.com/zliw/MWButtonGroup/master/screenshot.png",
    "license": "MIT",
    "authors": {
        "Martin Wilz": "[email protected]"
    },
    "source": {
        "git": "https://github.com/zliw/MWButtonGroup.git",
        "tag": "0.2.1"
    },
    "platforms": {
        "ios": "7.0"
    },
    "requires_arc": true,
    "source_files": "Classes",
    "public_header_files": "Classes/*.h"
}

Pin It on Pinterest

Share This