Valeriy Bezuglyy

12pods
UIKit+VBProgrammaticCreation is a set of categories for UIKit classes (UIView, UIButton, UIBarButtonItem, ...) which help to create readable code if you instantiate ui elements programmatically.
License: MIT
There are developers (like me) who prefer to create UI programmatically due to numerous reasons. I use storyboards for segues and user scene-path. But UIViewControllers are left empty. And I do not use xibs.
When you create adaptive UI programmatically the view (or viewcontroller) code becomes unreadable because of big autolayout creation calls.
VBAutolayout is a library which makes programmatic autolayout creation comfortable, readable and code-minimized.
Format
Views layout is described in a dictionary with special VBAutolayout format. Constraints are created only for VBAutolayoutAttribute-s contained in layout dictionary. Attribute is ignored if no VBAutolayoutConstant value was given.
Layout dictionary format:
@{VBAutolayoutAttribute: <1>,
VBAutolayoutAttribute: <2>,
VBAutolayoutAttribute: <3>
}
<1> = <const>
<2> = @{VBAutolayoutItem: <item>,
VBAutolayoutConstant: <const>}
<3> = @[<1>, <2>, ...]
is a view2 in constraint. If no specified, then superview is used and constraint is interpreted as a constraint to view container.
is a string with the same format as could be used for Visual Format Constraints Creation
<const> = <relation><constant>@<priority>, ex. 10, ==10, >=10, <=10, 10@999, >=10@999, etc.
<relation> = 1) <, <= for <=
2) >, >= for >=
3) =, == for ==
Several constraints can be combined for one attribute using variant .
Examples,
VBAutolayoutConstant: @">=10@999"}
License: MIT
VBCollectionViewController extends UICollectionViewController by adding pagination, pull-to-refresh and other useful features.
VBCollectionViewCell is a base class for cells. Each cell contains only apporpriate VBCollectionViewCellView as a subview. The idea is to setup UI of VBCollectionViewCellView by setting its item property (which calls updateUI).
VBCollectionViewHeader uses the same idea as VBCollectionViewCell.
License: MIT
Useful objective-c defines.
For example, VBLog is a NSLog redefine. It adds some additional info (caller class, line) to log message. Stops logging in non-DEBUG builds.
License: MIT
VBError is a base class for your own errors. It makes error creation and handling more effective.
When handling error you can check class instead of making domain+code check.
You can also create same errors(domain+code) in different parts of code by creating an instance of the same VBError subclass.
Use case 1.
Use case 2
License: MIT
VBException is a base class for your own exceptions. It makes exception creation and handling more effective.
Use case
By default, exception name is its classname. It can be changed by implementing +name method.
License: MIT
VBRandom is a pseudo-random numbers generator. Using of VBRandom simplifies random numbers creation code.
It uses arc4random() function.
VBRandom is available under the MIT license. See the LICENSE file for more info.
License: MIT
VBTableViewController extends UITableViewController by adding pagination, pull-to-refresh and other useful features.
VBTableViewCell is a base class for cells. Each cell contains only apporpriate VBTableViewCellView as a subview. The idea is to setup UI of VBTableViewCellView by setting its item property (which calls updateUI).
VBTableViewHeader uses the same idea as VBTableViewCell.
License: MIT
VBVerticalScrollView limits scrolling to only vertical direction by resizing its contentView.
According to Apple docs when working with UIScrollView you should put all views into one contentView which will be added to scrollView itself.
License: MIT