Git Product home page Git Product logo

circularscroller's Introduction

CircularScroller

Efficient and Lightweight endless UIScrollView implementation in Swift

Version Platform License danielemargutti.com Twitter Follow

Introduction

CircularScroller is a very lightweight (less than 400LoC) and memory efficient implementation of an endless/circular UIScrollView for iOS.
It's written in pure Swift with Auto-Layout in mind.

Features Highlights
๐Ÿ—œ Lightweight implementation: single source code, no dependencies, all in less than 400 lines of code.
๐Ÿš€ It's efficient; it only allocates three holder pages at time and allows you to limit avoid unecessary allocations (see the doc).
๐ŸŒˆ Auto-Layout since the beginning.
๐Ÿงฌ It uses standard UIKit components at its core. No magic, just a UIScrollView on sterioids.
๐Ÿฆ Fully made in Swift 5 from Swift โฅ lovers

circularscroller's People

Contributors

malcommac avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

circularscroller's Issues

Great component with a few issues...

  1. On line 318 it should be 'break' instead of 'return'

  2. There is a flickering when scrolling from left to right because images are first removed with removeFromSuperView() and then added again with addSubview(). I solved this by inserting the subviews at index 0 and after recenterScrollOffset(), remove the subviews with an index > 0

  3. the first time the CircularScroller shows a scrollable image it's in the wrong size on small devices -> on line 375 [let centerOffsetX = CGFloat(centerPageIndex - 1) * bounds.size.width] the bounds are incorrect. For now I fixed this by replacing self.layoutIfNeeded() with self.layoutSubviews() ...

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.