Coder Social home page Coder Social logo

simformsolutionspvtltd / sscustomtabbar Goto Github PK

View Code? Open in Web Editor NEW
560.0 16.0 65.0 1.98 MB

Simple Animated tabbar with native control

License: MIT License

Swift 94.85% Ruby 5.15%
customtabbar animatedtabbar tabbar fluidtabbar swiftui swiftui-animations

sscustomtabbar's Introduction

SSCustomTabbar

Simple Animated tabbar with native control.

Version License Platform Swift Version PRs Welcome

Example

Example

Requirements

  • iOS 11.0+
  • Xcode 10.0+

Installation

SSCustomTabbar doesn't contain any external dependencies.

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

pod 'SSCustomTabbar'

UIKit Usage example

Set UITabbarController to SSCustomTabBarViewController

alt text

Set UITabBar to SSCustomTabBar

alt text

Set UITabBar to SSCustomTabBar reverse curve

alt text

SwiftUI Usage example

struct TabItem: View {

  var text: String
  @State var isNextActive: Bool = false
  @Binding var isTabBarHidden: Bool

  var body: some View {
     NavigationView {
           ZStack {
              NavigationLink(destination: PushedView(isTabBarHidden: self.$isTabBarHidden, showPushedView: self.$isNextActive), isActive: self.$isNextActive) {
                   EmptyView()
              }
            
              VStack(spacing: 30) {
                
                   Button(action: {
                       self.isNextActive = true
                   }) {
                       Text("Tap to Push")
                   }
               }
           }.onAppear {
               self.isTabBarHidden = false
           }
       }
  }

}


struct ContentView: View {

   @State var isTabBarHidden: Bool = false

   var body: some View {
       tabView
        .onReceive(NotificationCenter.default.publisher(for: UIApplication.willEnterForegroundNotification)) { _ in
            SwiftUITabBarController.refreshViews()
       }
   }

   var tabView: some View {
       let vc1 = SwiftUITabView(content: UIHostingController(rootView: TabItem(text: "Home", isTabBarHidden: self.$isTabBarHidden)), title: "Home", selectedImage: "iconHomeSelected", unSelectedImage: "iconHome")
       let vc2 = SwiftUITabView(content: UIHostingController(rootView: TabItem(text: "Favorite", isTabBarHidden: self.$isTabBarHidden)), title: "Favorite", selectedImage: "iconFavoriteSelected", unSelectedImage: "iconFavorite")
       let vc3 = SwiftUITabView(content: UIHostingController(rootView: TabItem(text: "Video", isTabBarHidden: self.$isTabBarHidden)), title: "Video", selectedImage: "iconVideoSelected", unSelectedImage: "iconVideo")
       let vc4 = SwiftUITabView(content: UIHostingController(rootView: TabItem(text: "Profile", isTabBarHidden: self.$isTabBarHidden)), title: "Profile", selectedImage: "iconProfileSelected", unSelectedImage: "iconProfile")
       let vc5 = SwiftUITabView(content: UIHostingController(rootView: TabItem(text: "Chat", isTabBarHidden: self.$isTabBarHidden)), title: "Chat", selectedImage: "iconChatSelected", unSelectedImage: "iconChat")
    
       let tabBarView = SwiftUITabBarController(tabItems: [vc1, vc2, vc3, vc4, vc5], configuration: .constant(SSTabConfiguration()), isTabBarHidden: self.$isTabBarHidden)
       return tabBarView
  }

}

Customization

You can change:

  • BarHeight
  • UnSelected item tint color
  • Wave Height
  • Animation point(Position)
  • Layer background color

alt text

alt text

alt text

Adding Badge value

alt text

Add/Update badge value:

let tabBarController = self.tabBarController as? SSCustomTabBarViewController
tabBarController?.addOrUpdateBadgeValueAtIndex(index: 0, value: "Your Value Here")

Remove badge value:

let tabBarController = self.tabBarController as? SSCustomTabBarViewController
tabBarController?.removeBadgeValueAtIndex(index: 1)

Remove all badge values:

let tabBarController = self.tabBarController as? SSCustomTabBarViewController
tabBarController?.removeAllBadges()

Contribute

We would love you for the contribution to SSCustomTabMenu, check the LICENSE file for more info.

Android Library.

  • Check our Android Library also on Github

Check out our other Libraries

License

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

sscustomtabbar's People

Contributors

bhargavbajani-simformsolutions avatar ketan-simform avatar mobile-simformsolutions avatar ravilsimform avatar shah-vraj avatar simform-solutions avatar sumit-goswami avatar sumit-simform avatar twodollarsesq avatar vraj-s-shah avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

sscustomtabbar's Issues

Swift code usage

Can I ask how to use this by swift code ? (Not SwiftUI)
Thanks a lot.

RTL support ?

Hello,

I have been trying to fix tab bar to RTL language Can't fix the wave in the right position
I am using Swift

Thank you.

Unable to set shadow to Tab bar

Hello, Thank you for this awesome library but I am facing issue while setting shadow to Tab bar I have use following things to set Shadow to Tabbar

Screenshot 2019-06-11 at 4 15 01 PM

Please Help!

Unable to set the default chosen tab.

Hello,

I have been trying to set the default chosen tab view when the app starts but it's not working, Could you please tell me how can I do that?
I am using SwiftUI

Thank you.

How can i stop displaying Tabbar Item?

Hello, Thanks for this library! I have some feature like guest login and I want to Restrict some tab bar item as If your doesn't logged in then user should not able to open that particular item and instead of this I am going to show some alert for example Please login first

Can you please help me with this that how can i Restrict some Tabbar Item?

How to Use in iPAD

Thanks for this library! Can I use this tabbar in my iPad app?
here I get wave issues in ipad
I attached ScreenShot. please help As soon as possible

IMG_2638

unable to open file (in target "SSCustomTabbar_Tests" )

Hi I'm trying to run the example, but I encounter this error. Do you have any idea to solve this? thanks
Showing Recent Messages : /Users/SSCustomTabbar-1.2/Example/Pods/Pods/Target Support Files/Pods-SSCustomTabbar_Tests/Pods-SSCustomTabbar_Tests.debug.xcconfig: unable to open file (in target "SSCustomTabbar_Tests" in project "SSCustomTabbar") (in target 'SSCustomTabbar_Tests')

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.