Code Monkey home page Code Monkey logo

Comments (6)

bubudrc avatar bubudrc commented on May 24, 2024 1

that works perfectly... tanks a lot 😄

from cardslayout.

filletofish avatar filletofish commented on May 24, 2024

Hi! Thanks!

Yes, this is possible. One can use extension I have described in #4:

extension UICollectionView {
  func scrollToItemInCardsLayout(item: Int, animated: Bool) {
    let contentOffset = CGPoint(x: self.bounds.width * CGFloat(item), y: 0)
    self.setContentOffset(contentOffset, animated: animated)
  }
} 

To block user to swipe the cards just set collectionView.isUserInteractionEnabled

Maybe you will also interested in implementing CollectionView with infinite scrolling for stepper.

from cardslayout.

bubudrc avatar bubudrc commented on May 24, 2024

Great,

Thanks a lot for your help. One thing its that if I set collectionView.isUserInteractionEnabled = false, I can touch any button inside the cell. There are another way to stop to the user to not move the card manually?

Thanks

from cardslayout.

filletofish avatar filletofish commented on May 24, 2024

@bubudrc try disable the buttons or even the cells manual by changing isUserInteractionEnabled.

from cardslayout.

bubudrc avatar bubudrc commented on May 24, 2024

hmmm... what I want its to have some buttons on cells (cards) enable, and do the card animation programatically. The user should not be able to swipe the card. it's that possible?

from cardslayout.

filletofish avatar filletofish commented on May 24, 2024

Try to use isScrollEnabled
https://discussions.apple.com/thread/2037566

from cardslayout.

Related Issues (18)

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.