Swipable tab and menu View and ViewController.

Overview

SwipeMenuViewController

Platform Cocoapods Carthage compatible SPM compatible License

Overview

SwipeMenuViewController provides SwipeMenuView and SwipeMenuViewController. This is very useful to build swipe-based paging UI. The interface is as simple as UIKit's.

Demo

Here are some style of demos using SwipeMenuView.

Segmented Tab & Underline Flexible Tab & Underline Flexible Tab & Circle

Installation

CocoaPods

You can integrate via CocoaPods. Add the following line to your Podfile :

pod 'SwipeMenuViewController'

and run pod install

Carthage

You can integrate via Carthage, too. Add the following line to your Cartfile :

github "yysskk/SwipeMenuViewController"

and run carthage update

Swift Package Manager

You can integrate via Swift Package Manager, too. See the following site for instructions.

Documentation

  • See Usage documentation for all the various properties and options that can be set
  • See Versioning for versioning documentation

Author

Yusuke Morishita

Support via PayPal

License

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

Comments
  • jump to specific index of page failed

    jump to specific index of page failed

    I wrote following method in my code. However jump function does not work in this situation, it only jumps to the second page.

    func swipeMenuView(_ swipeMenuView: SwipeMenuView, viewDidSetupAt currentIndex: Int) {
            swipeMenuView.jump(to: selectedPage, animated: true)
        }
    
    opened by sharedcare 6
  • Swift 4.2 / Xcode 10.0 version Error

    Swift 4.2 / Xcode 10.0 version Error

    Describe the bug A clear and concise description of what the bug is.

    Build system information

    Showing Recent Messages :-1: Multiple commands produce '/Users/jasu/Library/Developer/Xcode/DerivedData/Folder-fvgwuawkkumkbnbwxdxvjausocav/Build/Products/Debug-iphonesimulator/SwipeMenuViewController/SwipeMenuViewController.framework/Info.plist': Target 'SwipeMenuViewController' (project 'Pods') has copy command from '/Users/jasu/Folder/Folder/Pods/SwipeMenuViewController/Sources/Supporting files/Info.plist' to '/Users/jasu/Library/Developer/Xcode/DerivedData/Folder-fvgwuawkkumkbnbwxdxvjausocav/Build/Products/Debug-iphonesimulator/SwipeMenuViewController/SwipeMenuViewController.framework/Info.plist' Target 'SwipeMenuViewController' (project 'Pods') has process command with output '/Users/jasu/Library/Developer/Xcode/DerivedData/Folder-fvgwuawkkumkbnbwxdxvjausocav/Build/Products/Debug-iphonesimulator/SwipeMenuViewController/SwipeMenuViewController.framework/Info.plist'

    I get an error when building in Swift 4.2 / Xcode 10.0. Can it be checked quickly? thanks

    opened by jasudev 5
  • Change the underline color and the selected text ?

    Change the underline color and the selected text ?

    Is your feature request related to a problem? Please describe. A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

    Describe the solution you'd like A clear and concise description of what you want to happen.

    Describe alternatives you've considered A clear and concise description of any alternative solutions or features you've considered.

    Additional context Add any other context or screenshots about the feature request here.

    opened by Terens777 5
  • Issue when clicking the view buttons too fast

    Issue when clicking the view buttons too fast

    Hi, when you tap two of the navigation items too fast, the view controller will not change but the addition (underline) will still move to the next last clicked one.

    Example:

    1. Starting at Bulbasaur, I tapped Caterpie then quickly tapped Bulbasaur again
    2. The underline moved from Caterpie then to Bulbasaur immediately, but the view controller stayed at Caterpie.

    Was reproduced on an iPhone 8 Plus (11.3) with the latest version, and the issue also happens in other iPhones as well.

    image

    bug 
    opened by mbasnillo 5
  • Child TableViewController doesn't work

    Child TableViewController doesn't work

    Hi,

    I'm using the SwipeMenuViewController on my app, but when i use an UITableViewController as child and click inside the tableview (or cells), the tableview automatically gets the content empty (as reset).

    My code:

    extension MainViewController: SwipeMenuViewDataSource {
        
        //MARK - SwipeMenuViewDataSource
        func numberOfPages(in swipeMenuView: SwipeMenuView) -> Int {
            return 3
        }
        
        func swipeMenuView(_ swipeMenuView: SwipeMenuView, titleForPageAt index: Int) -> String {
            switch index {
                case 0:
                    return "tab1"
                case 1:
                    return "+tab2"
                case 2:
                    return "tab3"
                default:
                    return ""
            }
        }
        
        func swipeMenuView(_ swipeMenuView: SwipeMenuView, viewControllerForPageAt index: Int) -> UIViewController {
            switch index {
                case 0:
                    return TableViewController1()
                case 1:
                    return TableViewController2()
                case 2:
                    return TableViewController3()
                default:
                    return TableViewController1()
            }
        }
    }
    
     @IBOutlet weak var swipeMenuView: SwipeMenuView! {
            didSet {
                swipeMenuView.delegate                          = self
                swipeMenuView.dataSource                        = self
                var options: SwipeMenuViewOptions               = .init()
                options.tabView.style                           = .segmented
                options.tabView.margin                          = 8.0
                options.tabView.underlineView.backgroundColor   = ColorUtils.hex2Color(hex: _color(str: "color_green"))
                options.tabView.backgroundColor                 = UIColor.white
                options.tabView.underlineView.height            = 3.0
                options.tabView.itemView.font                   = UIFont(name: "Montserrat-Regular", size: 12.0)!
                options.tabView.itemView.textColor              = UIColor.black
                options.tabView.itemView.selectedTextColor      = .black
                options.tabView.itemView.margin                 = 10.0
                options.contentScrollView.backgroundColor       = UIColor.black
                swipeMenuView.reloadData(options: options, default: nil, isOrientationChange: false)
            }
        }
    
        override func viewDidLoad() {
            super.viewDidLoad()
            swipeMenuView.reloadData()
        }
    

    And the result:

    It displaying the tabs, and show the tableview content img_4160

    But when i tapped inside tableview (or slide between tabs), the tableview gets the content empty. img_4161

    My structure IB:

    captura de tela 2018-01-16 as 13 55 50

    Anyone had this problem?

    Thank you!

    opened by mcinside13 5
  • while tabView.style is segmented,the tabView.underlineView.margin is wrong at beginning

    while tabView.style is segmented,the tabView.underlineView.margin is wrong at beginning

    options.tabView.style = .segmented options.tabView.backgroundColor = .white options.tabView.underlineView.backgroundColor = .red options.tabView.underlineView.height = 3 options.tabView.underlineView.margin = 20 options.tabView.itemView.textColor = .black options.tabView.itemView.selectedTextColor = .red options.tabView.height = 45 options.tabView.itemView.font = UIFont.systemFont(ofSize:15) swipeMenuView.reloadData(options: options)

    bug 
    opened by chaoshenglu 5
  • Addiction view padding left

    Addiction view padding left

    Hello! When I set this option: options.tabView.additionView.padding = .init(top: 0, left: 16, bottom: 0, right: 16) padding left on start did not apply. Can you help me to fix this?

    opened by YuraChudnick 3
  • Tab title is transparent until swap to change tab.

    Tab title is transparent until swap to change tab.

    I am using below code

    override func viewDidLoad() {
            super.viewDidLoad()
            options.tabView.style = .flexible
            options.tabView.margin                          = 8.0
            options.tabView.underlineView.backgroundColor   = UIColor.white
            options.tabView.backgroundColor                 = UIColor(red: 0.18, green: 0.18, blue: 0.18, alpha: 1.00)
            options.tabView.underlineView.height            = 3.0
            options.tabView.itemView.textColor              = UIColor(red: 0.60, green: 0.60, blue: 0.60, alpha: 1.00)
            options.tabView.itemView.selectedTextColor      = UIColor(red: 1.00, green: 1.00, blue: 1.00, alpha: 1.00)
            options.tabView.itemView.margin                 = 10.0
            options.contentScrollView.backgroundColor       = UIColor.lightGray
            options.tabView.isSafeAreaEnabled = true
            options.tabView.height = 60
            self.reload()
            // Do any additional setup after loading the view.
        }
    

    It was working fine when I used options.tabView.style = .segmented but after changing it to .flexible now at first launch tab title is not showing but when I try to swap tab it becomes visible as you can see in screeshot

    egxkbjga5g

    What's wrong I am doing here ?

    invalid 
    opened by varun-naharia 3
  • Text colour changing back to black on swipe.

    Text colour changing back to black on swipe.

    I set text colour to lightGray and it's working fine with tab changing through tap on tab name but it's changing colour to black when I change tab through swipe.

    image

    bug 
    opened by varun-naharia 3
  • important problem

    important problem

    when i use "swipeMenuView.jump(to: index)", the delegate's toIndex is not right

    default

    code: public func jump(to index: Int) {

        if let tabView = tabView, let contentScrollView = contentScrollView {
            tabView.jump(to: index)
            currentIndex = index-----------> add this
            contentScrollView.jump(to: index, animated: false)
        }
    }
    

    when i do this ,the index order is right

    opened by lizizi 3
  • itemViews index out of range in SwipeMenuViewController viewDidLoad callback

    itemViews index out of range in SwipeMenuViewController viewDidLoad callback

    I am using:

    • Version: 1.1.5
    • pod install
    • Xcode: 8.2.1
    • Swift: 3.0.2

    Following the example and usage in README, I subclass SwipeMenuViewController and implement necessary data source methods. But the exception is thrown when SwipeMenuViewController calling view.addSubview(swipeMenuView) inside viewDidLoad.

    In the bottom, TabView calls animateUnderlineView, when accessing self.currentItem, the getter method trying to return itemViews[currentIndex], which raises index out of range exception since itemViews is empty. Note that at this time, the data source methods have not been called, and swipeMenuView.dataSource is setup before view.addSubview(swipeMenuView).

    I can run the example project (tag 1.1.5 commit) successfully, and follow the same setup as it did in my project. But the problem still happens.

    If more information is needed, please tell me. Thanks!

    opened by DesmondDAI 3
  • SwipeMenuViewController embedded in NavigationController (Under Navigation Bar)

    SwipeMenuViewController embedded in NavigationController (Under Navigation Bar)

    I tried the example code and embedding ViewController inside a navigation controller. However, when the navigation bar exists, the tabs are hidden. When I start sliding ,then, the tabs appear.

    I want to use this repo for my project where the sliding tab will be under the navigation bar.

    opened by kwanhlee 0
  • set padding have  bug

    set padding have bug

    options.tabView.additionView.padding = UIEdgeInsets.init(top: 0, left: 30, bottom: 0, right: 30); Enter the front desk from the background bar deviation (chinese:设置padding之后,将app退到后台,然后再进入前台,会发现底部的滑块位置偏移了)

    opened by cuilizhong 0
  • Update TabView to accept NSAttributedString

    Update TabView to accept NSAttributedString

    Here I update the TabView to accept NSAttributedString in lieu of String.

    This enables quite a bit more flexibility with what you add as the title to the tab bar. For instance, one can now add images using the NSTextAttachment.

    Regarding implementation, I have the TabView prefer func tabView(_ tabView: TabView, titleForItemAt index: Int) -> String? over func tabView(_ tabView: TabView, attributedTitleForItemAt index: Int) -> NSAttributedString?, so if you implement both dataSource methods for a given index it will use the original.

    opened by richard-ash 0
  • Is there a way to change the underline text color?

    Is there a way to change the underline text color?

    Is your feature request related to a problem? Please describe. I see in the demo images that the tab underline can be changed to blue, green, etc. Looking at the options struct however, there isn't such an option. In addition, the underline color doesn't match the selectedTextColor.

    Describe the solution you'd like Either 1/ provide a color option in Underline or 2/ match the line's color to the selectedTextColor

    opened by gilbertl 2
Releases(2.1.0)
Owner
Yusuke Morishita
Software Engineer
Yusuke Morishita
A Slide Menu, written in Swift, inspired by Slide Menu Material Design

Swift-Slide-Menu (Material Design Inspired) A Slide Menu, written in Swift 2, inspired by Navigation Drawer on Material Design (inspired by Google Mat

Boisney Philippe 90 Oct 17, 2020
Slide-Menu - A Simple Slide Menu With Swift

Slide Menu!! Весь интерфейс создан через код

Kirill 0 Jan 8, 2022
EasyMenu - SwiftUI Menu but not only button (similar to the native Menu)

EasyMenu SwiftUI Menu but not only button (similar to the native Menu) You can c

null 10 Oct 7, 2022
Swift-sidebar-menu-example - Create amazing sidebar menu with animation using swift

 SWIFT SIDEBAR MENU EXAMPLE In this project I create a awesome side bar menu fo

Paolo Prodossimo Lopes 4 Jul 25, 2022
Hamburger Menu Button - A hamburger menu button with full customization

Hamburger Menu Button A hamburger menu button with full customization. Inspired by VinhLe's idea on the Dribble How to use it You can config the looks

Toan Nguyen 114 Jun 12, 2022
A fun, easy-to-use tab bar navigation controller for iOS.

CircleBar Don’t you, sometimes, miss fun user interfaces? Truth is, we do. Sure, you can't use them in enterprise apps for obvious reasons, but if you

softhaus 786 Dec 25, 2022
A paging menu controller built from other view controllers placed inside a scroll view (like Spotify, Windows Phone, Instagram)

Unfortunately, life gets in the way sometimes and I won't be able to maintain this library any longer and upgrade this library to where it needs to be

null 5.2k Dec 31, 2022
A paging view controller with a highly customizable menu ✨

Getting Started | Customization | Installation Features Parchment lets you page between view controllers while showing any type of generic indicator t

Martin Rechsteiner 3k Jan 8, 2023
iOS Slide Menu View based on Google+, iQON, Feedly, Ameba iOS app. It is written in pure swift.

SlideMenuControllerSwift iOS Slide View based on iQON, Feedly, Google+, Ameba iPhone app. Installation CocoaPods pod 'SlideMenuControllerSwift' Carth

Yuji Hato 3.3k Dec 29, 2022
Mac menu bar tool to view the architecture of the running application

Silicon Info About Silicon Info is a tiny menu bar application allows the user to quickly view the architecture of the currently running application.

William Castelli (Billy) 260 Dec 29, 2022
Weather Dock is a MacOS headless application that shows popover view under the menu bar with weather info.

Weather Dock Weather forecast in MacOS menu bar Weather Dock is a MacOS headless application that shows popover view under the menu bar with weather i

Alexander Stepanischev 8 Dec 15, 2022
⭕️ CircleMenu is a simple, elegant UI menu with a circular layout and material design animations. Swift UI library made by @Ramotion

CIRCLE MENU Simple, elegant UI menu with a circular layout and material design animations We specialize in the designing and coding of custom UI for M

Ramotion 3.4k Dec 29, 2022
PagingKit provides customizable menu UI. It has more flexible layout and design than the other libraries.

PagingKit provides customizable menu & content UI. It has more flexible layout and design than the other libraries. What's this? There are many librar

Kazuhiro Hayashi 1.3k Jan 9, 2023
Grid and Circular Menu for iOS.

IGCMenu IGCMenu library gives easy way to create Grid and Circular menu in app. This is light weight and highly customisable menu.Support iOS 7 and ab

Sunil Sharma 138 Nov 14, 2022
An iOS drop down menu with pretty animation and easy to customize.

IGLDropDownMenu An iOS drop down menu with pretty animation. Screenshot How To Use Use CocoaPods: pod 'IGLDropDownMenu' Manual Install: Just drap the

Galvin Li 1.2k Dec 27, 2022
Hamburger Menu using Swift and iOS 8 API's

FrostedSidebar Hamburger Menu using Swift and iOS 8 API's Heavily influenced by @_ryannystrom's RNFrostedSidebar This implementation uses iOS 8's new

Evan Dekhayser 429 Oct 21, 2022
UIKit drop down menu, simple yet flexible and written in Swift

DropDownMenuKit DropDownMenuKit is a custom UIKit control to show a menu attached to the navigation bar or toolbar. The menu appears with a sliding an

Quentin Mathé 258 Dec 27, 2022
Menu controller with expandable item groups, custom position and appearance animation written with Swift. Similar to ActionSheet style of UIAlertController.

Easy to implement controller with expanding menu items. Design is very similar to iOS native ActionSheet presentation style of a UIAlertController. As

Anatoliy Voropay 22 Dec 27, 2022
Simple and Elegant Drop down menu for iOS 🔥💥

SwiftyMenu is simple yet powerfull drop down menu component for iOS. It allow you to have drop down menu that doesn't appear over your views, which gi

Karim Ebrahem 502 Nov 29, 2022