Giter VIP home page Giter VIP logo

Comments (7)

ermalkaleci avatar ermalkaleci commented on July 21, 2024

Hi
Check delegate function. You are returning nil instead of a viewcontroller.
Btw I'm not Turkish.
On Sat, 3 Oct 2015 at 15:00, JannyKul [email protected] wrote:

Selamlar Ermal Abi, thank you so much for the library, the functionality
here is exactly what I was looking for. However, I am struggling to get it
working in swift using the bridging file route. I have started by trying to
create a very simple version of your example document to try and figure out
where the issue is however this hasn't helped. Everything compiles and
builds fine but the error is thrown during run time.

The code I am using is below and where the error is thrown is shown below.
From what I can tell the line throwing the error is:
tabSwipe.createWithRootViewController(self, tabNames: names, tintColor:
color, delegate: self)

Any help would be greatly appreciated. Thank you.

This is my code:
[image: screen shot 2015-10-03 at 13 51 50]
https://cloud.githubusercontent.com/assets/14953265/10262980/f64fc35c-69d5-11e5-9ad6-68545e9c4859.png

This is where the error is being thrown within the library:
[image: screen shot 2015-10-03 at 13 54 10]
https://cloud.githubusercontent.com/assets/14953265/10262999/53d77c5e-69d6-11e5-88f1-7bc36353f1a2.png
[image: screen shot 2015-10-03 at 13 54 37]
https://cloud.githubusercontent.com/assets/14953265/10263002/57f087e0-69d6-11e5-8931-2a65886e2494.png


Reply to this email directly or view it on GitHub
#41.

from carbonkit.

JannyKul avatar JannyKul commented on July 21, 2024

Thank you so much for your quick response! I'm terribly sorry but I don't think I quite understand, are you referring to the "delegate: self" part of the above code - I would have thought this is supposed to reference the HomeViewController? Apologies for my lack of understanding.

from carbonkit.

ermalkaleci avatar ermalkaleci commented on July 21, 2024

At delegate func tabSwipeNavigation
Make sure you are returning a viewController because you are trying to put
a nil instead of a viewController
On Sat, 3 Oct 2015 at 15:59, JannyKul [email protected] wrote:

Thank you so much for your quick response! I'm terribly sorry but I don't
think I quite understand, are you referring to the "delegate: self" part of
the above code - I would have thought this is supposed to reference the
HomeViewController? Apologies for my lack of understanding.


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

from carbonkit.

JannyKul avatar JannyKul commented on July 21, 2024

yes perfect that worked, thank you so much for the help!

from carbonkit.

JannyKul avatar JannyKul commented on July 21, 2024

Of course, remind me of the issue or let me know what problem you're having? It works for me now

Sent from my iPhone

On 11 Nov 2015, at 17:51, Alan Gonzalez [email protected] wrote:

@JannyKul can you show me the swift code? i try to use it but i can't get it to work.


Reply to this email directly or view it on GitHub.

from carbonkit.

alangonzalez93 avatar alangonzalez93 commented on July 21, 2024

@JannyKul @ermalkaleci Hi guys, I could make this work on SWIFT. My question now is how to add constrains on the CarbonTabSwipeNavigation to adapt this on the different screens size.

from carbonkit.

ermalkaleci avatar ermalkaleci commented on July 21, 2024

Hi @alangonzalez93
What is not working on Swift?

class ViewController: UIViewController, CarbonTabSwipeNavigationDelegate {

    // MARK: Override methods
    override func viewDidLoad() {
        super.viewDidLoad()
        let items = ["Features", "Products", "About"]
        let carbonTabSwipeNavigation = CarbonTabSwipeNavigation.init(items: items, delegate: self)
        carbonTabSwipeNavigation.insertIntoRootViewController(self)
    }

    func carbonTabSwipeNavigation(carbonTabSwipeNavigation: CarbonTabSwipeNavigation, viewControllerAtIndex index: UInt) -> UIViewController {
        // return viewController at index
    }
}

This method will insert into root view controller using top and bottomLayoutGuide anchors.

 carbonTabSwipeNavigation.insertIntoRootViewController(self)

or you don't call this method and insert carbonTabSwipeNavigation view manually

[self.view addSubView:carbonTabSwipeNavigation.view];

then add constraints i.e:

"V:|carbonTabSwipeNavigation.view|"
"H:|carbonTabSwipeNavigation.view|"

from carbonkit.

Related Issues (20)

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.