Skip to content

ReverseScale/AutoAlignButton

Repository files navigation

AutoAlignButton

CocoaPods  Build Status

EN | 中文

Routine development on the card layout needs a lot, and the the CollectionView heavy and heavy, wanted to package a lightweight card layout tools, based on the UIButton follow-up and make up UICollectionView and UILabel based on the realization of support for pictures, text , Adaptive layout and gestures, the use of safe and convenient.

Swift version: https://github.com/ReverseScale/AutoAlignButtonSwift

🎨 What does the test UI look like?

1 Multiple implementation list page 2 Based on the Button implementation 3 Based on the Label implementation 4 graphic mixed Button implementation 5 Edit graphic mixed Button implementation
Through the storyboard to build the basic UIButton + UIView implementation UILabel + UIView implementation Graphic and textual hybrid implementation based Edited graphic and textual hybrid implementation based

🚀 Advantage

    1. Lightweight architecture, fewer files, concise code
    1. Do not rely on any other third-party libraries
    1. Separate graphics and text button to achieve
    1. Support SDWebImage or YYWebImage extension
    1. Have a higher custom

🤖 Requirements

  • iOS 7+
  • Xcode 8+

🎯 Installation

1. Manual installation:

After downloading the Demo, drag the function folder into the project and start using the header file.

2.CocoaPods Installation:

Modify "Podfile" file

pod 'AutoAlignButtonTools',:git => 'https://github.com/ReverseScale/AutoAlignButtonToolsCocoapodsDemo.git'

Console Execute Pods Installation Command (Simplified Installation: pod install --no-repo-update)

pod install

If the pod search found is not the latest version, the terminal pod setup command to update the local spec image cache, search again OK

🛠 Usage

AutoAlignButtonView wrapper method

1. The basic method

/*
* Whether Jiugongge acquiescence: open
*/
@property (nonatomic, assign) BOOL isScratchableLatex;
/*
* Is: automatic layout
* countHorizonal Number of horizontal rows of nine squares
*/
@property (nonatomic, assign) NSInteger countHorizonal;
/*
Is: automatic layout
* countHorizonal Number of horizontal rows of a square grid a * No: Parameter layout
* buttonVerticalPadding Vertical spacing
* buttonHorizonalPadding horizontal spacing
*/
@property (nonatomic, assign) CGFloat buttonVerticalPadding;
@property (nonatomic, assign) CGFloat buttonHorizonalPadding;

2. ways to enhance

/*
* Whether to open the fillet default: Turn off the open according to the need to set the fillet parameters (off-screen rendering to be optimized)
*/
@property (nonatomic, assign) BOOL isCornerRadius;


// Data Source (Required Method)
@property (nonatomic, copy) NSArray *dataTitleArray;
@property (nonatomic, copy) NSArray *dataImagesArray;

// Click event delegate
@property (nonatomic, weak) id<AutoAlignButtonViewDelegate> delegate;

⚖ Protocol

MIT License

Copyright (c) 2017 ReverseScale

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

😬 Contact:

About

Lightweight automatic card layout package (attached: Swift version option package)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published