TangramKit - TangramKit is a powerful iOS UI framework implemented by Swift

  •        18

TGLayoutPos is represent to the position of a view. UIView provides six extension variables:tg_left, tg_top, tg_bottom, tg_right, tg_centerX, tg_centerY to set view's margin or space distance between self and others. TGLayoutSize is represent to the size of a view. UIView provides two extension variables:tg_width,tg_height to set view's width and height dimension. there are three special TGLayoutSize const object: .wrap, .fill, .average mean: wrap all subviews size, fill in to superview's residual size, average the superview's size.

https://github.com/youngsoft/TangramKit

Tags
Implementation
License
Platform

   




Related Projects

MyLinearLayout - MyLayout is a powerful iOS UI framework implemented by Objective-C

  •    Objective-C

Is equivalent to: UIStackView of iOS and LinearLayout of Android. Linear layout is a single line layout view that the subviews are arranged in sequence according to the added order(from top to bottom or from left to right). So the subviews' origin&size constraints are established by the added order. Subviews arranged in top-to-bottom order is called vertical linear layout view, and the subviews arranged in left-to-right order is called horizontal linear layout.

RRAutoLayout - iOS6 AutoLayout backport to iOS5

  •    Objective-C

I assume you are advanced iOS developer, know most of its internals and understand that this code/article is more proof of concept than working port (even if it kind of works). Nice, project starts without errors, but we see nothing on the screen. First we need to populate our class with data from XIB unarchiver. This is quit easy, just [aDecoder decodeIntegerForKey:@"..."] and set it where it belongs. Now we have our NSLayoutConstraint with all data from Interface Builder, but it gets dealloc'ed as soon as it created - we need to hold onto it. From Apple docs we see that UIView holds all its constraints, but views on iOS5 don't have all those ivars and methods to hold them... Adding methods is quite easy, everyone who reads this is already familiar with categories and if not..., well you shouldn't be reading this :) So as I wrote - we need clever way to store constraints in UIView on iOS5 and leverage all of its memory management. Lets start with -[UIView constraints] and -[UIView addConstraint:]. We don't want just drop those into category of UIView because they would conflict on iOS6 default implementation, so we need magic of <objc/runtime.h> again. First lets check if we not running in iOS6 if( ![[UIView class] respondsToSelector:@selector(requiresConstraintBasedLayout)] ) if not - insert our custom implementation of methods with default names of iOS6 - class_addMethod. Ok, so far so good, we have nonconflicting implementation in iOS5 witch does nothing in iOS6, now... were to store those constraints... (as you know categories don't have ivars). For this we will use quite new <objc/runtime.h> magic (this works from 10.6 as I remember) objc_setAssociatedObject.

ViewAnimator - ViewAnimator brings your UI to life with just one line

  •    Swift

ViewAnimator is a library for building complex iOS UIView animations in an easy way. It provides one line animations for any view included the ones which contain other views like UITableView and UICollectionView with its cells or UIStackView with its arrangedSubviews. UI created by Messaki, make sure to check out his profile.

FlexLib - FlexLib is a framework for creating native iOS applications using xml file, similar to Android and

  •    Objective-C

FlexLib is an Objective-C layout framework for iOS. It's based on flexbox model which is standard for web layout. So the layout capability is powerful and easy to use. With FlexLib, you can write iOS UI much faster than before, and there are better adaptability.

VegaScroll - ↕️ VegaScroll is a lightweight animation flowlayout for UICollectionView completely written in Swift 4, compatible with iOS 11 and Xcode 9

  •    Swift

VegaScroll is a lightweight animation flowlayout for UICollectionView completely written in Swift 4, compatible with iOS 11 and Xcode 9. Add the following line in your Podfile.


GSKStretchyHeaderView - A generic stretchy header for UITableView and UICollectionView

  •    Objective-C

For the time being, we haven't found a better way to deal with the contentInset adjustment, so the support for the iPhone X and the safeAreaInsets is not there yet. This may require a major refactor of the header view and a major release. For more information, see this issue and this PR (#68).

UIView-Autolayout - Category on UIView to simplify the creation of common layout constraints

  •    Objective-C

If you're making a new app targeting iOS9 or higher, I'd recommend using the new layout anchor functionality and stack views to achieve the layout you require. The layout anchor gives you concise creation of constraints in code, and stack views probably give you 90% of the layouts you were making yourself using constraints anyway. Category on UIView to simplify the creation of common layout constraints. The code is described and introduced in this blog post.

GLTableCollectionView - Netflix and App Store like UITableView with UICollectionView, written in pure Swift 4

  •    Swift

GLTableCollectionView is a ready to use UITableViewController with a UICollectionView for each UITableViewCell, something like Netflix, Airbnb or the Apple's App Store are doing in their iOS apps. GLTableCollectionView is completely customizable in both his UITableView and UICollectionView parts since it has been made on the same Data Source and Delegate methods with no complicated additions. Set paginationEnabled variable true in GLTableCollectionViewController class, false to disable. Default value is true.

SkeletonView - An elegant way to show users that something is happening and also prepare them to which contents he is waiting

  •    Swift

Today almost all apps have async processes, such as Api requests, long running processes, etc. And while the processes are working, usually developers place a loading view to show users that something is going on. SkeletonView has been conceived to address this need, an elegant way to show users that something is happening and also prepare them to which contents he is waiting.

Flix - iOS reusable form library in Swift.

  •    Swift

Flix is a flexible iOS framework for creating dynamic forms with UITableView or UICollectionView. Flix focus on combining cells of UICollectionView or UITableView, it don't care about the view layout, business logic. So you can easily build custom form using Flix.

GravitySlider - 🔄 GravitySlider is a beautiful alternative to the standard UICollectionView flow layout

  •    Swift

GravitySlider is a lightweight animation flowlayot for UICollectionView completely written in Swift 4, compatible with iOS 11 and xCode 9.

Carbon - 🚴 A declarative library for building component-based user interfaces in UITableView and UICollectionView

  •    Swift

Carbon is a library for building component-based user interfaces in UITableView and UICollectionView inspired by SwiftUI and React. This make it painless to build and maintain the complex UIs. Uses DifferenceKit which is highly optimized based on Paul Heckel's paper for diffing. Declarative design and diffing algorithm make your code more predictable, debugging easier and providing beautiful animations to users.

MEVFloatingButton - An iOS drop-in UITableView, UICollectionView and UIScrollView superclass category for showing a customizable floating button on top of it

  •    Objective-C

An iOS drop-in UITableView, UICollectionView, UIScrollView superclass category for showing a customizable floating button on top of it. To run the example project, clone the repo, and run pod install from the Example directory first.

Preheat - Automates prefetching of content in UITableView and UICollectionView

  •    Swift

Automates preheating (prefetching) of content in UITableView and UICollectionView. Deprecated on iOS 10. This library is similar to UITableViewDataSourcePrefetching and UICollectionViewDataSourcePrefetching added in iOS 10 which I would recommend to use instead.

Persei - Animated top menu for UITableView / UICollectionView / UIScrollView written in Swift

  •    Swift

Made in Yalantis. For application targets that do not support embedded frameworks, such as iOS 7, Persei can be integrated by including source files from the Persei folder directly, optionally wrapping the top-level types into struct Persei to simulate a namespace. Yes, this sucks.

CollectionViewShelfLayout - A UICollectionViewLayout subclass displays its items as rows of items similar to the App Store Feature tab without a nested UITableView/UICollectionView hack

  •    Swift

A UICollectionViewLayout subclass displays its items as rows of items similar to the App Store Feature tab without a nested UITableView/UICollectionView hack. You can use a single data source for all of your contents. Each section displays its items in a row. CollectionViewShelfLayout supports collection view's header view and footer view similar to table view's tableHeaderView and tableFooterView also sections' header and footer views too. This requirement is due to usage of some Auto Layout APIs available in iOS 8 and 9 or later. If you want to use CollectionViewShelfLayout in iOS 8, you can replace NSLayoutAnchor usage with other APIs.

Closures - Swifty closures for UIKit and Foundation

  •    Swift

Closures is an iOS Framework that adds closure handlers to many of the popular UIKit and Foundation classes. Although this framework is a substitute for some Cocoa Touch design patterns, such as Delegation & Data Sources and Target-Action, the authors make no claim regarding which is a better way to accomplish the same type of task. Most of the time it is a matter of style, preference, or convenience that will determine if any of these closure extensions are beneficial. Whether you're a functional purist, dislike a particular API, or simply just want to organize your code a little bit, you might enjoy using this library.

FlexLayout - FlexLayout adds a nice Swift interface to the highly optimized facebook/yoga flexbox implementation

  •    Swift

FlexLayout adds a nice Swift interface to the highly optimized Yoga flexbox implementation. Concise, intuitive & chainable syntax. Flexbox is an incredible improvement over UIStackView. It is simpler to use, much more versatile and amazingly performant.

PureLayout - The ultimate API for iOS & OS X Auto Layout — impressively simple, immensely powerful

  •    Objective-C

The ultimate API for iOS & OS X Auto Layout — impressively simple, immensely powerful. PureLayout extends UIView/NSView, NSArray, and NSLayoutConstraint with a comprehensive Auto Layout API that is modeled after Apple's own frameworks. PureLayout is a cross-platform Objective-C library that works (and looks!) great in Swift. It is fully backwards-compatible with all versions of iOS and OS X that support Auto Layout. Writing Auto Layout code from scratch isn't easy. PureLayout provides a fully capable and developer-friendly interface for Auto Layout. It is designed for clarity and simplicity, and takes inspiration from the AutoLayout UI options available in Interface Builder while delivering far more flexibility. The API is also highly efficient, as it adds only a thin layer of third party code and is engineered for maximum performance.

react-native-tableview-simple - Flexible and lightweight React Native component for UITableView made with pure CSS

  •    Javascript

This cross-platform component is inspired by the iOS-TableView. Made with pure CSS, the intention is to provide a flexible and lightweight alternative to a bridged component. react-native-tableview-simple provides you with some predefined CSS-styles, inspired by the native TableView. You can always mix the Cell-instances inside a Section, with other (React-Native)-Views. Therefore the Cell-Component itself can't be manipulated heavily.