Latest 0.0.5
Homepage https://github.com/rimsan/Holarchy
License MIT
Platforms ios 8.0, requires ARC
Frameworks UIKit
Authors

CI Status
Version
License
Platform

Usage

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

Installation

Holarchy is available through CocoaPods. To install
it, simply add the following line to your Podfile:

pod "Holarchy"

Examples

Holarchy solves a problem of bulding long scrollable layouts (like forms) without Autolayout/UITableView/UICollectionView.
As for now only one class is available – ‘HOLVerticalFlowView’. With this class you can build vertical layouts, adding views one by one.

Few remarks about how it works

  • When you add a view to layout – it will be shrinked to the full width of FlowView (like UITableViewCell).
  • Your custom view should return appropriate intrinsicContentSize (FlowView needs height, width will be ignored).
  • Views are pinned to each other – so you can easily animate expanding/collapsing.
  • You can use nice chaining when work with FlowView

So what we have here?

Create FlowView and add it to your controller:

self.flowScrollView = [HOLVerticalFlowView new];

[self.flowScrollView.scrollView mas_makeConstraints:^(MASConstraintMaker *make) {
  make.edges.equalTo(self.view);
}];

Add an already created view:

self.flowScrollView.addView(self.titleLabel);

Add a UIView subclass (with predefined height inside):

self.flowScrollView.addView([MYSeparatorView class]);

Add just a number – transparent view of corresponding height will be created (you can use it for creating margins between your components):

self.flowScrollView.addView(@20);

Set margins for previously added view:

self.flowScrollView
            .addView(self.titleLabel)
            .withLeftMargin(10)
            .withRightMargin(10);

Set height for previously added view (existing height constraints will be removed):

self.flowScrollView
            .addView(self.titleLabel)
            .withHeight(10);

Customize or create a pointer to previously added view:

self.flowScrollView
            .addView(@50)
            .customize(^(UIView *view) {
                view.backgroundColor = [UIColor redColor];
                self.redDelimiterView = view;
            });

Set inner insets for the whole content view:

self.flowScrollView.contentViewInsets = UIEdgeInsetsMake(10,10,10,10);

Author

Roman Petryshen, https://twitter.com/RomanPetryshen

License

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

Latest podspec

{
    "name": "Holarchy",
    "version": "0.0.5",
    "summary": "A subclass of UIScrollView that provides painless building of forms etc.",
    "description": "Forget about table/collection views when you need to create custom scrollable layout with custom elements.",
    "homepage": "https://github.com/rimsan/Holarchy",
    "license": "MIT",
    "authors": {
        "Roman Petryshen": "[email protected]"
    },
    "source": {
        "git": "https://github.com/rimsan/Holarchy.git",
        "tag": "0.0.5"
    },
    "social_media_url": "https://twitter.com/RomanPetryshen",
    "platforms": {
        "ios": "8.0"
    },
    "requires_arc": true,
    "source_files": "Holarchy/*",
    "frameworks": "UIKit"
}

Pin It on Pinterest

Share This