{"id":2176,"url":"https://github.com/nsomar/OAStackView","last_synced_at":"2025-08-02T23:32:03.852Z","repository":{"id":33802900,"uuid":"37496940","full_name":"nsomar/OAStackView","owner":"nsomar","description":"Porting UIStackView to iOS 7+","archived":false,"fork":false,"pushed_at":"2017-03-28T19:25:32.000Z","size":5262,"stargazers_count":2141,"open_issues_count":26,"forks_count":191,"subscribers_count":65,"default_branch":"master","last_synced_at":"2024-10-29T17:59:20.286Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Objective-C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nsomar.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-06-15T23:35:18.000Z","updated_at":"2024-10-12T12:21:01.000Z","dependencies_parsed_at":"2022-07-13T14:32:40.051Z","dependency_job_id":null,"html_url":"https://github.com/nsomar/OAStackView","commit_stats":null,"previous_names":["oarrabi/oastackview"],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nsomar%2FOAStackView","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nsomar%2FOAStackView/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nsomar%2FOAStackView/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nsomar%2FOAStackView/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nsomar","download_url":"https://codeload.github.com/nsomar/OAStackView/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228503137,"owners_count":17930518,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-01-05T20:16:06.675Z","updated_at":"2024-12-06T17:30:47.973Z","avatar_url":"https://github.com/nsomar.png","language":"Objective-C","funding_links":[],"categories":["Objective-C","UI"],"sub_categories":["Other free courses","Font","Other Testing"],"readme":"# OAStackView\n\n[![Build Status](https://travis-ci.org/oarrabi/OAStackView.svg)](https://travis-ci.org/oarrabi/OAStackView)\n[![Version](https://img.shields.io/cocoapods/v/OAStackView.svg?style=flat)](http://cocoapods.org/pods/OAStackView)\n[![License](https://img.shields.io/cocoapods/l/OAStackView.svg?style=flat)](http://cocoapods.org/pods/OAStackView)\n[![Platform](https://img.shields.io/cocoapods/p/OAStackView.svg?style=flat)](http://cocoapods.org/pods/OAStackView)\n\niOS 9 introduced the very cool [UIStackView](https://developer.apple.com/library/prerelease/ios/documentation/UIKit/Reference/UIStackView_Class_Reference/), UIStackView can be used to easily create simple and complex layouts.\n\nAs expected `UIStackView` can only be used for iOS 9 and up. This project tries to port back the stackview to iOS 7+.\n\n`OAStackView` aims at replicating all the features in `UIStackView`\n\n\u003cp align=\"center\"\u003e\u003cimg src =\"http://g.recordit.co/RPV2txRGLu.gif\" /\u003e\u003c/p\u003e\n\n## Usage\n\nTo run the example project, clone the repo, and run `pod install` from the Example directory first.\n\nSince `OAStackView` mimics the interface of `UIStackView`, the usage of `OAStackView` is similar to `UIStackView`.\n\n`OAStackView` Can be either used from the Interface builder, or from code.\n\n### Interface Builder\n\nDrag a a UIView into your view controller, and add some views to it.\n\n\n\u003cp align=\"center\"\u003e\u003cimg src=\"http://i1348.photobucket.com/albums/p740/o_abdelhafith/step1_zps2xxl75vw.png\" border=\"0\" alt=\" photo step1_zps2xxl75vw.png\" height=\"360px\" width=\"200px\"/\u003e\u003c/p\u003e\n\nChange the class to `OAStackView`\n\n\u003cp align=\"center\"\u003e\u003cimg src=\"http://i1348.photobucket.com/albums/p740/o_abdelhafith/step2_zpsfgwirklz.png\" border=\"0\" alt=\" photo step2_zpsfgwirklz.png\" height=\"220px\" width=\"200px\"/\u003e\u003c/p\u003e\n\n(Optional) Change the stack Axis (set Axis Value to 0 for Horizontal or 1 for Vertical), Spacing, Alignment or distribution.\n\n\u003cp align=\"center\"\u003e\u003cimg src=\"http://i1348.photobucket.com/albums/p740/o_abdelhafith/step3_zpsmk8xw3hz.png\" border=\"0\" alt=\" photo step3_zpsmk8xw3hz.png\" height=\"233 the viewpx\" width=\"200px\"/\u003e\u003c/p\u003e\n\nRun the project!\n\n\u003cp align=\"center\"\u003e\u003cimg src=\"http://i1348.photobucket.com/albums/p740/o_abdelhafith/step4_zpsgl92oeoc.png\" border=\"0\" alt=\" photo step4_zpsgl92oeoc.png\" height=\"200px\" width=\"200px\"/\u003e \u003c/p\u003e\n\n\n### From Code\n\nTo use `OAStackView` from code, Please refer to [UIStackView](https://developer.apple.com/library/prerelease/ios/documentation/UIKit/Reference/UIStackView_Class_Reference/) for proper documentation.\n\nAs a quick example on its usage do the following:\n\nCreate a couple of views to be stacked:\n\n```objc\n UILabel *l1 = [[UILabel alloc] init];\n l1.text = @\"Label 1\";\n UILabel *l2 = [[UILabel alloc] init];\n l2.text = @\"Label 2\";\n```\n\nCreate the stack view passing the array of views:\n\n```objc\nOAStackView *stackView = [[OAStackView alloc] initWithArrangedSubviews:@[l1, l2]];\nstackView.translatesAutoresizingMaskIntoConstraints = NO;\n```\n\nAdd the stack view to `self.view`\n\n```objc\n[self.view addSubview:stackView];\n\n[self.view addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@\"V:|-30-[stackView]\"\n                                                                  options:0\n                                                                  metrics:0\n                                                                    views:NSDictionaryOfVariableBindings(stackView)]];\n\n[self.view addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@\"H:|-10-[stackView]\"\n                                                                  options:0\n                                                                  metrics:0\n                                                                    views:NSDictionaryOfVariableBindings(stackView)]];\n```\n\n## Installation\n\nOAStackView is available through [CocoaPods](http://cocoapods.org). To install\nit, simply add the following line to your Podfile:\n\n```ruby\npod \"OAStackView\"\n```\n\n## Tests\n\nSince `OAStackView` has been built from reverse engineering `UIStackView`, and since I intend to keep updating and refactoring `OAStackView`, tests was one of the requirements going forward.\n\nThe following a [human readable](https://raw.githubusercontent.com/oarrabi/OAStackView/master/Example/Tests/tests.transcript.txt?token=ABZLPOoXoCREu-BpaaIEVcTY5i1icbkrks5ViJ_9wA%3D%3D) text subscript (generated with [specipy](https://github.com/oarrabi/specipy)).\n\n## Contribution\n\nAll contributions in any form are welcomed, if you find the project helpful, and you want to contribute then please do.\n\n## Known Issues, and future improvements\n\n### Missing functionality\n`OAStackView` implements most of the features from `UIStackView` except the following:\n\n- [ ] `baselineRelativeArrangement`   \n\n\t@property(nonatomic,getter=isBaselineRelativeArrangement) BOOL baselineRelativeArrangement;\n\n- [x] `layoutMarginsRelativeArrangement`     \n\n\n\t@property(nonatomic,getter=isLayoutMarginsRelativeArrangement) BOOL layoutMarginsRelativeArrangement;    \n\n`UIStackViewDistribution` is also partially implemented (2 elements out of 5 are still not implemented)    \n\n- [x] `UIStackViewDistributionFill`\n- [x] `UIStackViewDistributionFillEqually`    \n- [x] `UIStackViewDistributionFillProportionally`   \n- [ ] `UIStackViewDistributionEqualSpacing`    \n- [ ] `UIStackViewDistributionEqualCentering`\n\nPlease refer to [UIStackView](https://developer.apple.com/library/prerelease/ios/documentation/UIKit/Reference/UIStackView_Class_Reference/) for proper documentation.\n\n### Future improvements\nThe following would be nice to have for future versions\n\n- [ ] Covering the remaining functionality from `UIStackView`\n- [ ] Better Documentation\n- [ ] Better test coverage for some edge cases\n- [ ] Rewrite in swift, or more swift friendly\n\n## Author\n\nOmar Abdelhafith, o.arrabi@me.com\n\n## License\n\nOAStackView is available under the MIT license. See the LICENSE file for more info.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnsomar%2FOAStackView","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnsomar%2FOAStackView","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnsomar%2FOAStackView/lists"}