Giter Site home page Giter Site logo

trendingtechnology / slideviewcontroller Goto Github PK

View Code? Open in Web Editor NEW

This project forked from dohernandezm/slideviewcontroller

0.0 1.0 0.0 7.08 MB

SlideView Controller: A neat way to easily have 2-4 UIViewControllers share a view.

License: MIT License

Swift 100.00%

slideviewcontroller's Introduction

SlideViewController

drawing

drawing

drawing

Do you need to display multiple UIVIewControllers in a small space? Do their frames need to be user adjustable? That's what SlideViewController is for. Automatically displays up to four views depending on how many views it is sent. Can be configured with a horizontal or vertical orientation and to rotate clockwise or counter-clockwise. This swift UIViewController subclass requires iOS 13+ or macOS Catalyst 10.15+.

Slider Gestures:

  • PAN will move the slider around.
  • LONGPRESS will toggle edit mode on and off.
  • TAP during edit mode will rotate the views. Or you can set it to change the configuration(horizontal/vertical/top/bottom) by calling changeGridStyle.

As easy as creating the view then giving it some viewControllers

For example:

let subViewControllers = [zxyMapController, xyzFavesTableController, zxySettingController]
let slideController = SlideViewController(newViewControllers: subViewControllers) //Sets view position based in order (ie 0 = Primary, 1 = Secondary, etc.)

Funtionality options:

Many of these options are not meant to be called during runtime, but can be.

  • This struct passes configuration options to the SlideViewController.
struct SlideViewConfiguarationStruct {}
  • Color and Size options:
func setConfiguration(newConfiguration: SlideViewConfiguarationStruct?)

var backgroundColor:UIColor = .systemBackground
var crosshairColor:UIColor = .systemGray
var crosshairActiveColor:UIColor = .systemBlue
  • Inter-view border thickness. Unless you have another mechanism for moving the slider, anything less than 9 is hard to tap.
var slideViewBorderThickness = CGFloat(9)
  • Interface options:
var gridStyle:SlideViewPositions = .Primary
var rotateClockwise:Bool = true
var rotateViews:Bool = false
var stopEditAfterRotate:Bool = false//If a rotation event if fleeting, get out of it after one rotation.
var editModeActive:Bool = false//Edit mode can be set here, must update views after this is set.
var xyLock: (x:Bool,y:Bool) = (false,false)//Make it so the slider will only move in one direction.

Accessibility options:

  • SlideView calls out the slider location, but will not call out child view locations. Possible for future update.

To Fix:

  • Add accessibility Catalyst accessibility needs work/Slider's voiceover script needs to support internationalization, just english for now.
  • ~~When adding views, if you are in edit mode, new views do not get rounded corners.
  • Single view mode is currently stuck in the upper left hand corner.
  • Change "config" to primary view position and change SliderViewPosition to something else

slideviewcontroller's People

Contributors

dohernandezm avatar

Watchers

 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.