Code Monkey home page Code Monkey logo

tabview's Introduction

Tab View

TiltedTabViewTabViewInputAssistantGit


A replacement for UITabViewController, which mimics Safari tabs on iOS

Build Status Version Package Managers Contact

Requirements

  • Xcode 9 or later
  • iOS 11.0 or later

Usage

There are two primary view controllers in this library: TabViewController and TabViewContainerViewController. A TabViewController contains an array of tabs, a visible tab, and some methods to add and remove tabs. A TabViewContainerViewController contains TabViewControllers.

It's not necessary to use a TabViewContainerViewController, but it's suggested, as it allows for split screen on iPad.

To get started, take a look at the public API for both classes, and look at the sample app for an example of how to use both. At a minimum, you must subclass or instantiate a TabViewController, and add and remove tabs from it using its activateTab(_:) and closeTab(_:) methods.

Installation

Carthage

To install TabView using Carthage, add the following line to your Cartfile:

github "IMcD23/TabView" "master"

Submodule

To install TabView as a submodule into your git repository, run the following command:

git submodule add -b master https://github.com/IMcD23/TabView.git Path/To/TabView
git submodule update --init --recursive

Then, add the .xcodeproj in the root of the repository into your Xcode project, and add it as a build dependency.

ibuild

A Swift static library of this project is also available for the ibuild build system. Learn more about ibuild here

Author

Created by Ian McDowell

License

All code in this project is available under the license specified in the LICENSE file. However, since this project also bundles code from other projects, you are subject to those projects' licenses as well.

tabview's People

Contributors

ian-mcdowell avatar

Stargazers

Param Siddharth avatar Yetmens avatar  avatar Jwin avatar  avatar amadman avatar mrfakename avatar Gebacken Sonnig avatar  avatar 侠客老王 avatar devler avatar  avatar ent avatar Cem Olcay avatar Tim Kersey avatar Miguel de Icaza avatar  avatar  avatar LCN avatar  avatar vancaem avatar  avatar  avatar Adam Wienconek avatar Ern3st1989 avatar Stefan Popa avatar StephenFang avatar  avatar vincent avatar lihaojie avatar Mark Villacampa avatar __status302 avatar Vivek Padaya avatar Michael Gillund avatar Bram Pitoyo avatar  avatar Genrih Grigoryan avatar yohei sugigami avatar Zach avatar Tim Oliver avatar Nikhil Nigade avatar TOOGOO avatar mxmind avatar  avatar Apoorv Jain avatar iSangbill avatar  avatar iOS.Jett avatar  avatar Marc Steele avatar Tony Li avatar  avatar  avatar zhifenx avatar Rolls avatar luohaoyuan avatar Amandu  avatar Matt Shu avatar Diego The Great avatar  avatar sagar kothari avatar Hanis avatar  avatar Ahmed  avatar karadvdsn avatar Acampbell avatar  avatar SPT avatar Mark Meyer avatar  avatar Blaze (Balázs Galambosi) avatar Jinya avatar Eric Soto avatar Kyle Hankinson avatar Roberto Estrada avatar  avatar Yang avatar Semyon A. Chertkov avatar Bogon avatar John wick avatar Thiago Holanda avatar Toni Jovanoski avatar  avatar iMusic avatar Arthur Guiot avatar Omar Allaham avatar Vladislav Prusakov avatar Yubo Qin avatar  avatar Professor Coal avatar Mark Alldritt avatar Paulo Andrade avatar Maxime L. avatar Jason avatar Prof Syd Xu avatar Kyle Sherman avatar Emma Cold avatar Kai Shoya avatar Leonardo Kaminski Ferreira avatar Bruno Bilescky avatar

Watchers

 avatar James Cloos avatar  avatar Carabineiro avatar  avatar Hans Schülein avatar  avatar  avatar Rolls avatar  avatar  avatar

tabview's Issues

Make Storyboard friendly

Currently it is really badly integrated with storyboard. Everything has to happen programmatically.

SwiftUI

Not sure if this project is still active, but...

What would be the recommended way of incorporating this into SwiftUI? So each tab is represented by a SwiftUI View?

Make multiple windows compatible

As Apple added Multiple Windows in iPadOS, it would be great to be able to drag and drop a tab to make a new window. Or at least provide an API to connect with the SceneDelegate and create new windows.

Adding a tab via `activateTab` when `viewControllers` is empty causes crash.

If the view controllers array is empty and activateTab is called to add a tab an assertion failure will cause the program to crash

2018-04-02 15:18:46.925062-0700 TabView Sample[331:36129] 
*** Assertion failure in -[TabView.TabViewTabCollectionView _endItemAnimationsWithInvalidationContext:tentativelyForReordering:animator:],
 /BuildRoot/Library/Caches/com.apple.xbs/Sources/UIKit/UIKit-3698.52.10/UICollectionView.m:6031
2018-04-02 15:18:46.926864-0700 TabView Sample[331:36129] 
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', 
reason: 'Invalid update: invalid number of items in section 0.  
The number of items contained in an existing section after the update (1) must be equal to 
the number of items contained in that section before the update (1), plus or minus the number 
of items inserted or deleted from that section (1 inserted, 0 deleted) and plus or minus the 
number of items moved into or out of that section (0 moved in, 0 moved out).'

This behavior can be seen in the Sample project by making the following edit to ViewController.swift

        // Set the tabs in this tab view
//        self.viewControllers = [
//            Tab(title: "White", color: .white),
//            Tab(title: "Black", color: .black),
//            Tab(title: "Red", color: .red),
//            Tab(title: "Green", color: .green),
//            Tab(title: "Blue", color: .blue),
//            Tab(title: "A really long title", color: .blue)
//        ]
		
		self.activateTab(Tab(title: "Red", color: .red))

I haven't been able to quite figure out what is going on. If I do a PR will be forthcoming.

Logo Design Proposal

Greetings @IMcD23 , I am a graphics designer and an open source enthusiast and i want to collaborate & contribute to your project by designing a logo for it to be more visually represented. I will be doing it as a gift to the project if you will allow me. Thank you and my best regards!

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.