Giter VIP home page Giter VIP logo

splitview's Introduction

SplitView

Resizable Split View, inspired by Apple's Split View for iPadOS and SplitKit

Vertical Horizontal

Requirements

Swift Package Manager (SPM)

.Package(url: "https://github.com/twodayslate/SplitView.git", majorVersion: 1)

For the latest updates use:

.Package(url: "https://github.com/twodayslate/SplitView.git", branch: "master")

CocoaPods

pod 'SplitView'

For the latest updates use:

pod 'SplitView', :git => 'https://github.com/twodayslate/SplitView.git'

Usage

Using SplitView is easy! Simply create a SplitView and add your views to it - just like a UIStackView.

import SplitView
//
let mySplitView = SplitView()
mySplitView.addSplitSubview(myFirstView)
mySplitView.addSplitSubview(mySecondView)

There are certain customizations available including minimum sizing and snapping. Custom handles are also supported.

Be sure to checkout the example App.

splitview's People

Contributors

subdan avatar twodayslate avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

splitview's Issues

Support fixed width

Support fixed width - A splitview will remain at 25% or 250px and will not be able to be moved.

Not sure how useful this would be and I can already see a bunch of edge cases

I need to show navigation bar in child views, possible?

Thanks for awesome library,
I've two views/viewcontrollers side by side. Now I've requirement to add navigation bars in both the controllers same as like native splitviewController.

I've workaround and reviewed in the library. But could not find any provision for the navigation bar.
So is it possible to add or any way to achieve?

Hopping for the best.

Fix Constraint Issue

This happens when you change the axis. I am not sure exactly how to fix this issue. The good thing is that this this doesn't break functionality.

2019-08-23 13:43:23.551077-0400 app[73592:7943791] [LayoutConstraints] Unable to simultaneously satisfy constraints.
	Probably at least one of the constraints in the following list is one you don't want. 
	Try this: 
		(1) look at each constraint and try to figure out which you don't expect; 
		(2) find the code that added the unwanted constraint or constraints and fix it. 
(
    "<NSLayoutConstraint:0x600000b108c0 SplitView.SplitViewHandle:0x7fb1fe511de0.width == 18   (active)>",
    "<NSLayoutConstraint:0x600000b31310 H:|-(0)-[UIStackView:0x7fb1fe505f30]   (active, names: '|':SplitView.SplitView:0x7fb1fe50e370 )>",
    "<NSLayoutConstraint:0x600000b31680 H:[UIStackView:0x7fb1fe505f30]-(0)-|   (active, names: '|':SplitView.SplitView:0x7fb1fe50e370 )>",
    "<NSLayoutConstraint:0x600000b3b9d0 H:|-(0)-[UIStackView:0x7fb1fe7059d0]   (active, names: '|':UIView:0x7fb1fe705400 )>",
    "<NSLayoutConstraint:0x600000b3ba20 H:[UIStackView:0x7fb1fe7059d0]-(0)-|   (active, names: '|':UIView:0x7fb1fe705400 )>",
    "<NSLayoutConstraint:0x600000b37f20 'UISV-alignment' WKWebView:0x7fb21e823c00'zac.gorak.us'.leading == SplitView.SplitViewHandle:0x7fb1fe511de0.leading   (active)>",
    "<NSLayoutConstraint:0x600000b3a990 'UISV-alignment' WKWebView:0x7fb21e823c00'zac.gorak.us'.trailing == SplitView.SplitViewHandle:0x7fb1fe511de0.trailing   (active)>",
    "<NSLayoutConstraint:0x600000b39590 'UISV-alignment' Toolbar.leading == SplitView.SplitView:0x7fb1fe50e370.leading   (active, names: Toolbar:0x7fb1fe70c380 )>",
    "<NSLayoutConstraint:0x600000b395e0 'UISV-alignment' Toolbar.trailing == SplitView.SplitView:0x7fb1fe50e370.trailing   (active, names: Toolbar:0x7fb1fe70c380 )>",
    "<NSLayoutConstraint:0x600000b37e30 'UISV-canvas-connection' UIStackView:0x7fb1fe505f30.leading == WKWebView:0x7fb21e823c00'zac.gorak.us'.leading   (active)>",
    "<NSLayoutConstraint:0x600000b37ed0 'UISV-canvas-connection' H:[WKWebView:0x7fb21e823c00'zac.gorak.us']-(0)-|   (active, names: '|':UIStackView:0x7fb1fe505f30 )>",
    "<NSLayoutConstraint:0x600000b394a0 'UISV-canvas-connection' UIStackView:0x7fb1fe7059d0.leading == Toolbar.leading   (active, names: Toolbar:0x7fb1fe70c380 )>",
    "<NSLayoutConstraint:0x600000b394f0 'UISV-canvas-connection' H:[Toolbar]-(0)-|   (active, names: Toolbar:0x7fb1fe70c380, '|':UIStackView:0x7fb1fe7059d0 )>",
    "<NSLayoutConstraint:0x600000b39680 'UIView-Encapsulated-Layout-Width' UIView:0x7fb1fe705400.width == 1024   (active)>"
)

Will attempt to recover by breaking constraint 
<NSLayoutConstraint:0x600000b108c0 SplitView.SplitViewHandle:0x7fb1fe511de0.width == 18   (active)>

Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger.
The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in <UIKitCore/UIView.h> may also be helpful.

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.