Skip to content
This repository has been archived by the owner on Sep 21, 2020. It is now read-only.

Include with other controls in UIViewController #40

Closed
khunshan opened this issue Sep 27, 2015 · 7 comments
Closed

Include with other controls in UIViewController #40

khunshan opened this issue Sep 27, 2015 · 7 comments

Comments

@khunshan
Copy link

It looks not possible to use CarbonTabSwipeNavigation in an already UIViewController incase if we want to have a banner, header or simply any other UIView above Tabs. Its because CarbonTabSwipeNavigation inherits UIViewController which I believe restricts itself to be used as a part of some UIViewController beside other controls of UI instead it is a full fledge UIViewController.

Is there a way to use CarbonTabSwipeNavigation inside as a control in UIViewController? Like this:
05-1dashboard-accounts

@ermalkaleci
Copy link
Owner

Hello @khunshan,
Yes it is a way. In next version this will be much easy.
Anyway if you create a new ViewController (A) for below view (CarbonTabSwipeNavigation) and use this (A) as rootViewController for CarbonTabSwipe and then addSubview A.view to rootView.

@interface HomeViewController () <CarbonTabSwipeDelegate>
{
    UIViewController *A;
}
@end 

@implementation HomeViewController

- (void)viewDidLoad {
    [super viewDidLoad];

    A = [[UIViewController alloc] init];
    A.view.frame = CGRectMake(0, 200, 320, 300); // just creating a frame
    [self.view addSubview:A.view];

    NSArray *names = @[@"ONE", @"TWO", @"THREE", @"FOUR", @"FIVE", @"SIX", @"SEVEN", @"EIGHT", @"NINE", @"TEN"];
    UIColor *color = [UIColor white];
    tabSwipe = [[CarbonTabSwipeNavigation alloc] createWithRootViewController:A tabNames:names tintColor:color delegate:self];
}
@end

I hope this will help you ;)

@ancheng1114
Copy link

Thanks , it's working nice.

@khunshan
Copy link
Author

I missed it. However. I am glad it does work now.

On Mon, Oct 26, 2015 at 12:55 PM, ancheng notifications@github.com wrote:

Thanks , it's working nice.


Reply to this email directly or view it on GitHub
#40 (comment)
.

Khunshan S. Ahmad

@JigneshParekh7165
Copy link

My Header Height is 64 how can i set CarbonTabSwipeNavigation start from 64....Plz Help Me...

class MessgeVC: UIViewController,CarbonTabSwipeNavigationDelegate
{

var items = NSArray()
var carbonTabSwipeNavigation: CarbonTabSwipeNavigation = CarbonTabSwipeNavigation()

override func viewDidLoad() 

{
super.viewDidLoad()

    self.title = "Message"
    items = ["Agent", "Comment"]

    carbonTabSwipeNavigation = CarbonTabSwipeNavigation(items: items as [AnyObject], delegate: self)
    carbonTabSwipeNavigation.insertIntoRootViewController(self)
    carbonTabSwipeNavigation.setNormalColor(UIColor(white: 1, alpha: 0.8))
    carbonTabSwipeNavigation.setSelectedColor(UIColor.whiteColor())
    self.style()

}

it started from (0,0,320,30) how can i solve this issue???

chat_1024

@ermalkaleci
Copy link
Owner

use [carbonTabSwipeNavigation insertIntoRootViewController:self andTargetView:yourView];

@JigneshParekh7165
Copy link

class MessgeVC: UIViewController,CarbonTabSwipeNavigationDelegate

{

var items = NSArray()

var carbonTabSwipeNavigation: CarbonTabSwipeNavigation =

CarbonTabSwipeNavigation()

var a: UIViewController!


override func viewDidLoad() {

    super.viewDidLoad()



    a.view.frame = CGRectMake(0, 64, 320, 30)

    self.view.addSubview(a.view)


    self.title = "Message"

    items = ["Agent", "Comment"]



    carbonTabSwipeNavigation = CarbonTabSwipeNavigation(items: items as

[AnyObject], delegate: self)

    carbonTabSwipeNavigation.insertIntoRootViewController(self,

andTargetView: a.view)

I had place this code but its not working what can i do for
carbonTabSwipeNavigation Started from 0,64,320,30....Help Me Bro....

On Wed, May 18, 2016 at 1:39 AM, Ermal Kaleci notifications@github.com
wrote:

use [carbonTabSwipeNavigation insertIntoRootViewController:self
andTargetView:yourView];


You are receiving this because you commented.
Reply to this email directly or view it on GitHub
#40 (comment)

@ermalkaleci
Copy link
Owner

create a UIView not UIViewController. you can do it from storyboard and create an IBOutlet

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants