All Projects → touyou → NeumorphismTab

touyou / NeumorphismTab

Licence: MIT License
Custom TabBarController with Neumorphism.

Programming Languages

swift
15916 projects
ruby
36898 projects - #4 most used programming language
objective c
16641 projects - #2 most used programming language

Projects that are alternatives of or similar to NeumorphismTab

NeumorphismKit
Neumorphism framework for UIKit.
Stars: ✭ 39 (-50%)
Mutual labels:  carthage, storyboard, neumorphism
Swiftysound
SwiftySound is a simple library that lets you play sounds with a single line of code.
Stars: ✭ 995 (+1175.64%)
Mutual labels:  carthage, spm
Validatedpropertykit
Easily validate your Properties with Property Wrappers 👮
Stars: ✭ 701 (+798.72%)
Mutual labels:  carthage, spm
Switch
💊 An iOS switch control implemented in Swift with full Interface Builder support
Stars: ✭ 132 (+69.23%)
Mutual labels:  carthage, storyboard
Bow
🏹 Bow is a cross-platform library for Typed Functional Programming in Swift
Stars: ✭ 538 (+589.74%)
Mutual labels:  carthage, spm
Sidemenu
Simple side/slide menu control for iOS, no code necessary! Lots of customization. Add it to your project in 5 minutes or less.
Stars: ✭ 5,267 (+6652.56%)
Mutual labels:  carthage, storyboard
Sheeeeeeeeet
Sheeeeeeeeet is a Swift library for creating menus, custom action sheets, context menus etc.
Stars: ✭ 1,177 (+1408.97%)
Mutual labels:  carthage, spm
Gzipswift
Swift framework that enables gzip/gunzip Data using zlib
Stars: ✭ 356 (+356.41%)
Mutual labels:  carthage, spm
Shsearchbar
The search bar that doesn't suck.
Stars: ✭ 206 (+164.1%)
Mutual labels:  carthage, spm
Aksidemenu
Beautiful iOS side menu library with parallax effect. Written in Swift
Stars: ✭ 216 (+176.92%)
Mutual labels:  carthage, spm
Localize
Localize is a framework writed in swift to localize your projects easier improves i18n, including storyboards and strings.
Stars: ✭ 253 (+224.36%)
Mutual labels:  carthage, storyboard
Sidemenu
An interactive iOS side menu with rich features.
Stars: ✭ 442 (+466.67%)
Mutual labels:  carthage, storyboard
Uitextfield Navigation
🏄‍♂️ UITextField-Navigation makes it easier to navigate between UITextFields and UITextViews
Stars: ✭ 436 (+458.97%)
Mutual labels:  carthage, storyboard
Kydrawercontroller
Side Drawer Navigation Controller similar to Android
Stars: ✭ 632 (+710.26%)
Mutual labels:  carthage, storyboard
Simpleimageviewer
A snappy image viewer with zoom and interactive dismissal transition.
Stars: ✭ 408 (+423.08%)
Mutual labels:  carthage, spm
Sketchkit
A lightweight auto-layout DSL library for iOS & tvOS.
Stars: ✭ 40 (-48.72%)
Mutual labels:  carthage, spm
swift-currency
Type-safety and algorithms for working with money in Swift.
Stars: ✭ 88 (+12.82%)
Mutual labels:  carthage, spm
Stevia
🍃 Concise Autolayout code
Stars: ✭ 3,182 (+3979.49%)
Mutual labels:  carthage, storyboard
Color
Color utilities for macOS, iOS, tvOS, and watchOS
Stars: ✭ 145 (+85.9%)
Mutual labels:  carthage, spm
Columbus
A feature-rich country picker for iOS, tvOS and watchOS.
Stars: ✭ 23 (-70.51%)
Mutual labels:  carthage, spm

NeumorphismTab

Platform Language Carthage
Swift Package Manager Version License

NeumorphismTab is custom TabBarController with Neumorphism design.

Features

  • Implement custom tab with neumorphism.
  • UIView extension which add neumorphism shadow to any views.

Requirements

  • Xcode 11.0 or greater
  • iOS 11 or greater
  • Swift 5.1

Installation

Carthage

If you're using Carthage, simply add NeumorphismTab to your Cartfile:

github "touyou/NeumorphismTab"

CocoaPods

NeumorphismTab is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod 'NeumorphismTab'

Swift Package Manager

NeumorphismTab is available through SwiftPM, create Package.swift and add dependencies value

dependencies: [
    .package(url: "https://github.com/touyou/NeumorphismTab.git", from: "0.9.6")
]

See also: GitHub - j-channings/swift-package-manager-ios: Example of how to use SPM v4 to manage iOS dependencies

or you can use GUI based SPM with Xcode 11.

Usage

Basic Neumorphism Tab

Like this.

NeumorphismTab

Code is this.

import UIKit
import NeumorphismTab

class DemoTabBarController: NeumorphismTabBarController {

    override func setupView() {
        
        let color = UIColor(hex: "C1D2EB")
        let home = NeumorphismTabBarItem(icon: UIImage(systemName: "house.fill")!, title: "Home")
        let favorite = NeumorphismTabBarItem(icon: UIImage(systemName: "heart.fill")!, title: "")

        view.backgroundColor = color

        let homeViewController: ViewController = {
            let viewController = ViewController.instantiate()
            viewController.view.backgroundColor = color
            return viewController
        }()

        let favoriteViewController: UIViewController = {
            let viewController = UIViewController()
            viewController.view.backgroundColor = color
            return viewController
        }()

        setTabBar(items: [home, favorite])
        viewControllers = [homeViewController, favoriteViewController]
    }
}

NeumorphismTabBarController needs same background color throughout all view and ViewControllers. In particular, a luminance of the color should be within 0.18 to 0.88.

Add Neumorphism to any view

addNeumorphismShadow(with:) can add neumorphism to any view. with is parent of the view.

let color = UIColor(hex: "C1D2EB")
view.backgroundColor = color
childView.backgroundColor = color
childView.layer.cornerRadius = childView.bounds.width / 2
childView.layer.maskedCorners = [.layerMaxXMaxYCorner, .layerMaxXMinYCorner, .layerMinXMaxYCorner]
childView.addNeumorphismShadow(with: view)

Overridable method and properties

var tabHorizontalMargin: CGFloat

Override it if you want to adjust tab margin of horizontal.

var tabVerticalMargin: CGFloat

Override it if you want to adjust tab margin of bottom.

func setupView()

You must override it and setup ViewControllers and tab by calling setTabBar method here.

func switchedTab(to toIndex: Int)

Override it if you want to implement some feature when switching tab.

Other convenience properties, method and extensions

backgroundColor (in NeumorphismTabBarController)

If you set some color here, it can reset neumorphism shadow color with set color.

StoryboardInstantiable protocol and instantiate() method

When you use NeumorphismTabBarController, you should instantiate ViewControllers by code because you can setup it only in setupView method. StoryboardInstantiate protocol enable you to use Storyboard and instantiate by code easily.

You should write like this:

extension ViewController: StoryboardInstantiable {}

Then you should create new storyboard named ViewController's name (e.g. ViewController.storyboard), and make layout and set is initial view controller true. Now you can instantiate ViewController like this:

let viewController = ViewController.instantiate()

Hex color initializer

You can use UIColor initializer by hex string. You must not include # if you use it.

License

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

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].