Git Product home page Git Product logo

Comments (5)

andreamazz avatar andreamazz commented on September 20, 2024

Hi @robmontesinos
Can I see your implementation of the visibleCells method?
My guess is that you are not properly passing an array of UIViews, so that method call is calling setTransform on an array instead.

from amwavetransition.

robmontesinos avatar robmontesinos commented on September 20, 2024

Oh oh. You pretty damn smart. Here you go:

lazy var visibleCells: [AnyObject] = self.waveCells()

func waveCells() -> [AnyObject] {
    var cells = [AnyObject]()
    cells.append(self.mainImageView)
    cells.append(self.mainTableView.visibleCells())
    return cells
}

I wanted lazy initialization but maybe that was not the way to go.

from amwavetransition.

andreamazz avatar andreamazz commented on September 20, 2024

Lazy instantiation is fine, but when you append self.mainTableView.visibleCells() you are appending an array. So your cells array looks like this: [UIImageView, NSArray]. In order for that to work you need to flatten the array. A fast way is to use the += operand instead of append:

var cells = [AnyObject]()
cells += self.mainImageView
cells += self.mainTableView.visibleCells()
return cells

from amwavetransition.

robmontesinos avatar robmontesinos commented on September 20, 2024

Andrea, you rock!
Implementing the above caused a complaint - something about self.mainImageView and AnyObject not being a CGFloat.

This below does work thanks to you.

func waveCells() -> [AnyObject] {
    var cells = [AnyObject]()
    cells.append(self.mainImageView)
    cells += self.mainTableView.visibleCells()
    return cells
}

Salud!!!!

from amwavetransition.

andreamazz avatar andreamazz commented on September 20, 2024

Happy to help 👍

from amwavetransition.

Related Issues (19)

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.