Code Monkey home page Code Monkey logo

scrollablestackview's Introduction

ScrollableStackView

Scrollable UIStackView. Scroll your stack view with a smile up on your face. Written in Swift 3. Used Apple's pure auto layout. If you need to use UIStackView scrollable (like UIScrollView) this is the right library for you. Objective-C and Swift compatible.

Version License Platform

Installation with CocoaPods

CocoaPods is a dependency manager for both Swift and Objective-C. ScrollableStackView is available through CocoaPods. You can install it with the following command:

$ gem install cocoapods

Podfile

To install it, simply add the following line to your Podfile:

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '10.0'

target 'TargetName' do
    pod "ScrollableStackView"
end

Then, run the following command:

$ pod install

Test Drive | Try Now ๐Ÿš€

You can try library before you add it to your project ๐ŸŽฏ Give it a try:

$ pod try ScrollableStackView

Pod try is a wonderful subcommand which allows you to quickly launch the demo project of a Pod. It can be used to assess the quality of a library โ€“ very useful for user interface elements โ€“ or to quickly get up to speed on how to use it.

Usage

Sample Code (Swift)

import ScrollableStackView

var scrollable = ScrollableStackView(frame: view.frame)
view.addSubview(scrollable)

// add your views with
let rectangle = UIView(frame: CGRect(x: 0, y: 0, width: 100, height: 55))
rectangle.backgroundColor = UIColor.blue
scrollable.stackView.addArrangedSubview(rectangle)
// ...

// you can set margins directly on the stackview
scrollable.stackView.layoutMargins = UIEdgeInsets(top: 8, left: 8, bottom: 8, right: 8)
scrollable.stackView.isLayoutMarginsRelativeArrangement = true

Sample Code (Objective-C)

@import ScrollableStackView

ScrollableStackView *scrollable = [[ScrollableStackView alloc] initWithFrame:self.view.frame];
scrollable.stackView.distribution = UIStackViewDistributionFillProportionally;
scrollable.stackView.alignment = UIStackViewAlignmentCenter;
scrollable.stackView.axis = UILayoutConstraintAxisVertical;
[self.view addSubview:scrollable];

UIView *rectangle = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 100, 55)];
[rectangle setBackgroundColor:[UIColor blueColor]];

// add your views with
[scrollable.stackView addArrangedSubview:rectangle];
// ...

Example Project

Cocoapods To run the example project, clone the repo, and run

$ pod install

from the Example directory first.

Communication

If you see a way to improve the project :

  • If you need help, use Stack Overflow. (Tag scrollablestackview)
  • If you'd like to ask a general question, use Stack Overflow.
  • 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. It's better to begin with an issue rather than a pull request, though, because we might disagree whether the proposed change is an actual improvement. ๐Ÿ˜‰

Recommend following GitHub Swift Style Guide

Thanks! โœŒ๏ธ

TODO

  • Add Storyboard in example project
  • Add toolbar for example project (or UITableView)
  • Add Carthage support
  • Add Swift Package Manager support

Author

Muhammed Gurhan Yerlikaya, [email protected]

License

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

scrollablestackview's People

Contributors

neoneye avatar gurhub avatar lutzifer avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.