Latest 3.2.1
License MIT
Platforms ios 6.0, requires ARC

A very simple Objective-C UIView category for specifying single-sided borders.



Using CocoaPods

CocoaPods is a dependency manager for Objective-C, which automates and simplifies the process of using 3rd-party libraries like PREBorderView in your projects.


pod 'PREBorderView', "~> 3.2"


Otherwise just include UIView+PREBorderView.{h,m} in your project.


Add a border to a view

[view addBorderWithColor:[UIColor blackColor] andWidth:2 atPosition:PREBorderPositionRight];

Remove a border

[view removeBorderAtPosition:PREBorderPositionRight];


For convenience of usage you are able to specify a defaultBorderColor.

  • addRetinaPixelBorderWithColor:atPosition:
  • addRetinaPixelBorderAtPosition:

adds the border using defaultBorderColor

Respond to size changes

To easily update all borders to size changes of views

  • Use layoutBorders to update borders of a view.
  • Use layoutSubviewBorders to update borders of a view, as well as all borders of subviews.

To update a controller’s view to auto layout changes call layoutSubviewBorders in viewDidLayoutSubviews.

Full Documentation


  • If you found a bug, and can provide steps to reliably reproduce it, open an issue.
  • If you have a feature request, open an issue.
  • If you want to contribute, submit a pull request.


PREBorderView is released under the MIT license. See LICENSE for details.

Latest podspec

    "name": "PREBorderView",
    "version": "3.2.1",
    "summary": "A very simple Objective-C UIView category for specifying single-sided borders.",
    "homepage": "",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    "authors": {
        "Paul Steinhilber": "[email protected]"
    "source": {
        "git": "",
        "tag": "3.2.1"
    "source_files": "UIView+PREBorderView.{h,m}",
    "platforms": {
        "ios": "6.0"
    "requires_arc": true

Pin It on Pinterest

Share This