Latest 0.2.0
Homepage https://github.com/itsKaynine/SwiftRaisedTab
License MIT
Platforms ios 8.0, requires ARC
Authors

Based on this blog post:
http://idevrecipes.com/2010/12/16/raised-center-tab-bar-button

SwiftRaisedTab

Installation

Install CocoaPods using the following command.

$ gem install cocoapods

Add the following to your Podfile.

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
use_frameworks!

pod 'SwiftRaisedTab', '~> 0.2.0'

Usage

Subclass RaisedTabBarController and implement the following in viewWillAppear and onRaisedButton.

To link to storyboard, drag a new TabBarController into the storyboard and change Custom Class to your RaisedTabBarController subclass.

import UIKit
import SwiftRaisedTab

class ViewController: RaisedTabBarController {

    override func viewDidLoad() {
        super.viewDidLoad()
        // Do any additional setup after loading the view, typically from a nib.
    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }

    override func viewWillAppear(animated: Bool) {
        super.viewWillAppear(animated)

        // Insert empty tab item at center index. In this case we have 5 tabs.
        self.insertEmptyTabItem("", atIndex: 2)

        // Raise the center button with image
        let img = UIImage(named: "icon_camera")
        self.addRaisedButton(img, highlightImage: nil)
    }

    // Handler for raised button
    override func onRaisedButton(sender: UIButton!) {
        super.onRaisedButton(sender)

        println("Raised button tapped")
    }

}

Latest podspec

{
    "name": "SwiftRaisedTab",
    "version": "0.2.0",
    "summary": "SwiftRaisedTab recreates raised center tab item seen in many social networking apps.",
    "description": "SwiftRaisedTab is a simple library written in Swift that recreates raised center tab item seen in many social networking apps.",
    "homepage": "https://github.com/itsKaynine/SwiftRaisedTab",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Punnawut Khowkittipaiboon": "[email protected]"
    },
    "source": {
        "git": "https://github.com/itsKaynine/SwiftRaisedTab.git",
        "tag": "0.2.0"
    },
    "social_media_url": "https://twitter.com/itsKaynine",
    "platforms": {
        "ios": "8.0"
    },
    "source_files": "SwiftRaisedTab/*.{m,h,swift}",
    "requires_arc": true
}

Pin It on Pinterest

Share This