Comments (9)
I am ios developer..
i want to use folding tabbar in only one view controller so its possible for use it..?
from foldingtabbar.ios.
I was stuck on this for a bit but this is how I got it to work:
First, in your main storyboard, make a new UITabBarController. Next, add a new Cocoa Touch Class file to your project and make sure it is a subclass of YALFoldingTabBarController. Whatever you end up naming it, go back to the main storyboard and set the class name of the UITabBarController you made earlier to the name you gave to the Cocoa Touch Class file you created.
Next, in the new class file you made in the viewDidLoad function, you would set up all the same things you see in the AppDelegate file in the example provided by Yalantis minus this statement:
YALFoldingTabBarController *tabBarController = (YALFoldingTabBarController *) self.window.rootViewController;
Then, everytime you see tabBarController used, you would simple use "super" instead. This worked for me using swift so the SampleFoldingTabBarController.swift file (which is the custom Cocoa Touch Class I made) looks something like this:
import UIKit
import FoldingTabBar
class SampleFoldingTabBarController: YALFoldingTabBarController {
let tabItem1: YALTabBarItem = YALTabBarItem(itemImage: UIImage(named:"something", leftItemImage: UIImage(named:"somethingElse")
override func viewDidLoad() {
super.viewDidLoad()
super.leftBarItems = [tabItem1]
super.centerButtonImage = UIImage(named: "centerImage")
//so on and so forth
}
from foldingtabbar.ios.
@MarceloPrado Have you tried the solution above? Do you need some help?
from foldingtabbar.ios.
It works!!! Thanks
from foldingtabbar.ios.
It works! But I also want to handle touches on extra tabBarItems in the items page. So far, no successes after 2 days...
`import Foundation
import UIKit
import ARSLineProgress
import FoldingTabBar
class ViewControllerHome: UIViewController,UITextFieldDelegate,YALTabBarInteracting,YALTabBarViewDelegate {
var delegate: YALTabBarViewDelegate?
override func viewDidLoad() {
super.viewDidLoad()
print("Home VC called")
// Do any additional setup after loading the view.
// tabBarController = (YALFoldingTabBarController *) self.window.rootViewController
}
// MARK: YALTabBarInteracting protocol
@objc func extraLeftItemDidPressInTabBarView(tabBar: YALFoldingTabBar) {
print("extraLeftItemDidPressed")
}
@objc func extraRightItemDidPressed(sender: AnyObject) {
print("extraRightItemDidPressed")
}
}`
from foldingtabbar.ios.
Ok, i got it.
from foldingtabbar.ios.
@LiveRock Can you give some guidance how you did this?
from foldingtabbar.ios.
First, you need to conform to the protocol YALTabBarInteracting
Then you need to implement extraLeftItemDidPress and extraRightItemDidPress like this:
// MARK: YALTabBarInteracting protocol
@objc func extraLeftItemDidPress() {
print("extraLeftItemDidPress")
}
I couldn't get it to work initially because I did not implement it properly like:
@objc func extraLeftItemDidPress(sender : AnyObject!) {
print("extraLeftItemDidPress")
}
from foldingtabbar.ios.
i want implement for swift, some people can help me?
from foldingtabbar.ios.
Related Issues (20)
- unable to add the badge to tabbar item.
- Multiple commands produce
- Memory Issue HOT 1
- The FoldingTabBar is not displayed when using performSegue, The bar is shown but in black HOT 6
- TabBar without controller HOT 2
- Performing a segue from a ViewController HOT 2
- rightItemImage
- Is there any way to show badges on the tabBar items ?
- How to collapse tabbar programatically on swift?
- Making background transparent
- Setting title in view controller make title on tabbar appear
- How to hide the tabbar
- Chat cells animation
- Issue with iPhone X HOT 2
- How to prevent collapse on selecting an item
- Get center and each item views for attaching showcase
- 如果要用纯代码,怎么样集成 HOT 1
- Does not Provide Permission to Change the Colour of View . HOT 1
- So , it is just "wast of time" Library used in iOS HOT 1
- How to add the transparent color to tabBarView HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from foldingtabbar.ios.