All Projects → marty-suzuki → SplittableViewKit

marty-suzuki / SplittableViewKit

Licence: MIT license
A cell of IndexPath(row: 0, section: 0) in UITableView is automatically moved to left view when device rotated.

Programming Languages

swift
15916 projects
objective c
16641 projects - #2 most used programming language
ruby
36898 projects - #4 most used programming language

Projects that are alternatives of or similar to SplittableViewKit

OrientPy
Seismic station orientation tools
Stars: ✭ 29 (-25.64%)
Mutual labels:  orientation
bppgrid
QtQuick 2 Table component, modeled on TableView QML Type and some other Cool qml components
Stars: ✭ 54 (+38.46%)
Mutual labels:  tableview
TableViewExtension
This extension simplify registering any cell, reusing and other verbosity steps.
Stars: ✭ 13 (-66.67%)
Mutual labels:  tableview
allotment
A React component for resizable split views
Stars: ✭ 359 (+820.51%)
Mutual labels:  split
proxy-rotator
Simple proxy rotation service
Stars: ✭ 28 (-28.21%)
Mutual labels:  rotation
IZJHorizontalTableView
一个支持添加横向滑动切换ScrollView的tableView,并且保持原有垂直方向视图加载的View。可实现仿微博iOS,转转iOS等切换效果
Stars: ✭ 14 (-64.1%)
Mutual labels:  tableview
iOSProjects
It's project that contains different applications developed with Swift 5.7 👨‍💻👩🏼‍💻🧑🏿‍💻
Stars: ✭ 122 (+212.82%)
Mutual labels:  tableview
monorepo-split-github-action
Github Action for Monorepo Split
Stars: ✭ 56 (+43.59%)
Mutual labels:  split
device.js
🧬 Reactive library to observe essential browser and device properties.
Stars: ✭ 29 (-25.64%)
Mutual labels:  orientation
ReactiveDataDisplayManager
No description or website provided.
Stars: ✭ 35 (-10.26%)
Mutual labels:  tableview
virtualGizmo3D
Virtual GIZMO - 3D object manipulator / orientator, via mouse, with pan and dolly/zoom features
Stars: ✭ 36 (-7.69%)
Mutual labels:  rotation
rotatewriter
Writter for internal golang log library or for rs/zerolog which has normal smooth nonblocking rotate
Stars: ✭ 16 (-58.97%)
Mutual labels:  rotation
AEScript-Explode-Shape-Layer
Extract shapes from a shape layer to individual layers
Stars: ✭ 37 (-5.13%)
Mutual labels:  split
yolov5 obb
yolov5 + csl_label.(Oriented Object Detection)(Rotation Detection)(Rotated BBox)基于yolov5的旋转目标检测
Stars: ✭ 1,105 (+2733.33%)
Mutual labels:  rotation
flutter native device orientation
Native device orientation plugin for flutter.
Stars: ✭ 67 (+71.79%)
Mutual labels:  orientation
thinkeys
Split ortholinear custom replacement keyboard with TrackPoint for ThinkPad laptops.
Stars: ✭ 167 (+328.21%)
Mutual labels:  split
ZXTableView
快速、高效地构建TableView,节省80%以上重复代码,无需设置数据源和代理。
Stars: ✭ 18 (-53.85%)
Mutual labels:  tableview
Quadcopter SimCon
Quadcopter Simulation and Control. Dynamics generated with PyDy.
Stars: ✭ 84 (+115.38%)
Mutual labels:  rotation
react-client
React JS SDK client for Split Software
Stars: ✭ 23 (-41.03%)
Mutual labels:  split
ruby-client
Ruby SDK client for Split Software
Stars: ✭ 22 (-43.59%)
Mutual labels:  split

SplittableViewKit

Language Carthage compatible Version License Platform

A cell of IndexPath(row: 0, section: 0) in UITableView is automatically moved to left view when device rotated.

Usage

Please initialize SplittableTableView with initializer or Interface Builder. SplittableTableView.rightView is UITableView. Do not set delegate or dataSource directly to SplittableTableView.rightView. You must use SplittableTableView.delgate or SplittableTableView.dataSource.

let splittableTableView: SplittableTableView

splittableTableView.delegate = self
splittableTableView.dataSource = self
splittableTableView.rightView.register(UINib(nibName: "ThumbnailViewCell", bundle: nil),
                                       forCellReuseIdentifier: "ThumbnailViewCell")

SplittableViewKit is almost same as UITableView interface because SplittableTableViewDataSource adopted UITableViewDataSource and SplittableTableViewDelegate adopted UITableViewDelegate. func splittableContainerViewFor(topView: UIView, layoutType: LayoutType) -> UIView is only one difference. You should return a UIView that layouted top view. Layout patterns are LayoutType.left and LayoutType.fixedTop.

extension ViewController: SplittableTableViewDataSource {
    func splittableContainerViewFor(topView: UIView, layoutType: LayoutType) -> UIView {
        let view = UIView(frame: .zero)
        topView.translatesAutoresizingMaskIntoConstraints = false
        view.addSubview(topView)
        if layoutType == .left {
            NSLayoutConstraint.activate([
                view.leadingAnchor.constraint(equalTo: topView.leadingAnchor, constant: 0),
                view.trailingAnchor.constraint(equalTo: topView.trailingAnchor, constant: 0),
                view.centerYAnchor.constraint(equalTo: topView.centerYAnchor, constant: 0)
            ])
        } else {
            NSLayoutConstraint.activate([
                view.safeAreaLayoutGuide.topAnchor.constraint(equalTo: topView.topAnchor, constant: 0),
                view.leftAnchor.constraint(equalTo: topView.leftAnchor, constant: 0),
                view.rightAnchor.constraint(equalTo: topView.rightAnchor, constant: 0),
                view.bottomAnchor.constraint(equalTo: topView.bottomAnchor, constant: 0)
            ])
        }
        return view
    }
}

You can change fixed top or not with SplittableTableView.isFixedTop.

splittableTableView.isFixedTop = true
left fixedTop

You can change ratio of leftView and rightView with SplittableTableView.ratio.

splittableTableView.ratio = .init(left: 1, right: 2)
left: 1, right: 1 left: 2, right: 1

Example

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

Requirements

  • iOS 9 or greater
  • Swift 4 or greater

Installation

Carthage

If you’re using Carthage, simply add SplittableViewKit to your Cartfile:

github "marty-suzuki/SplittableViewKit"

CocoaPods

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

pod 'SplittableViewKit'

Author

marty-suzuki, [email protected]

License

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

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].