Latest 1.1.2
Homepage https://github.com/hcbarry/MiddleAlignedButton
License MIT
Platforms ios 6.0, requires ARC
Authors

MiddleAlignedButton

![CI Status](http://img.shields.io/travis/Barry Lee/MiddleAlignedButton.svg?style=flat)
Version
License
Platform

MiddleAlignedButton Demo

Usage

To run the example project, clone the repo, and run pod install from the Example directory first.

Objective-C Example

  UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
  UIImage  *image = [UIImage imageNamed:@"YOUR_IMAGE_NAME"];
  NSString *title = @"YOUR_TITLE";
  CGFloat  spacing = 2.0f;

  ;
  ;
  ;

Swift Example

  let button = UIButton(type:.Custom)
  let image = UIImage(named: "YOUR_IMAGE_NAME")
  let title = "YOUR_TITLE"
  let spacing : CGFloat = 2.0

  button.setImage(image, forState: .Normal)
  button.setTitle(title, forState: .Normal)
  button.middleAlignButtonWithSpacing(spacing)

Requirements

  • Xcode Minimum Supported Version: Xcode 5.0
  • iOS Minimum Deployment Target: iOS 6.0
  • Language Support: Swift (any version), Objective-C

Installation

Using CocoaPods

  1. Add the pod UIButton+MiddleAligning to your Podfile.

    pod "UIButton+MiddleAligning"
  2. Run pod install from Terminal, then open your app’s .xcworkspace file to launch Xcode.
  3. Import the UIButton+MiddleAligning header.
    • Swift project: import UIButton+MiddleAligning
    • Objective-C project: import "UIButton+MiddleAligning.h"

Manually from GitHub

  1. Download the source files in the Pod/Classes/UIButton+MiddleAligning subdirectory.
  2. Add the source files to your Xcode project.
  3. Import the UIButton+MiddleAligning header.
    • Swift project: import UIButton+MiddleAligning
    • Objective-C project: import "UIButton+MiddleAligning.h"

Author

Barry Lee, [email protected]

License

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

Latest podspec

{
    "name": "UIButton+MiddleAligning",
    "version": "1.1.2",
    "summary": "An UIButton category for middle aligning imageView and titleLabel",
    "homepage": "https://github.com/hcbarry/MiddleAlignedButton",
    "screenshots": "https://raw.githubusercontent.com/hcbarry/MiddleAlignedButton/master/Demo.gif",
    "license": "MIT",
    "authors": {
        "Barry Lee": "[email protected]"
    },
    "source": {
        "git": "https://github.com/hcbarry/MiddleAlignedButton.git",
        "tag": "1.1.2"
    },
    "platforms": {
        "ios": "6.0"
    },
    "requires_arc": true,
    "source_files": "Pod/Classes/**/*",
    "public_header_files": "Pod/Classes/**/*.h"
}

Pin It on Pinterest

Share This