Giter Site home page Giter Site logo

ole / olecontainerscrollview Goto Github PK

View Code? Open in Web Editor NEW
588.0 21.0 67.0 87 KB

A UIScrollView subclass that intelligently handles multiple child scroll views and does not interfere with UIKitʼs cell reuse functionality.

Home Page: http://oleb.net/blog/2014/05/scrollviews-inside-scrollviews/

License: MIT License

Objective-C 99.63% C++ 0.37%

olecontainerscrollview's Introduction

OLEContainerScrollView

A UIScrollView subclass that intelligently handles multiple child scroll views and does not interfere with UIKitʼs cell reuse functionality.

Written by Ole Begemann, May 2014.

⚠️ No maintenance ⚠️

This project is not being maintained. I’m not using it myself and I don’t want to spend time on it adding more features. I still think the code contains some good ideas. Feel free to read the code and take ideas from it and/or maintain your own fork.

Blog Post

Please read my blog post about OLEContainerScrollView for details about the implementation.

Demo App

To check out the demo app:

  1. Clone this repository.
  2. Open OLEContainerScrollViewDemo.xcodeproj in Xcode.

The demo app uses a class I have written named OLESimulatedTableView to illustrate how a UITableView reuses its cells.

Usage

  1. Manually clone this repository to your machine or add it as a Git submodule to your project.
  2. Drag the folder OLEContainerScrollView into your Xcode project to add all the files in it to your project.
  3. #import "OLEContainerScrollView.h"
  4. Create an OLEContainerScrollView instead of a regular UIScrollView.
  5. Add subviews (like table views, collection views, regular scroll views, or just other regular views) to the scroll view’s contentView. Check out the comments in OLEContainerScrollView.h.

License

Published under the MIT License. See the LICENSE file for details.

olecontainerscrollview's People

Contributors

jimroepcke avatar joe-trellick avatar kirillyakimovich avatar mmorey avatar ole avatar robb avatar tomaskraina avatar z3bi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

olecontainerscrollview's Issues

How to implement UITableview datasource and delegate ?

Thanks for the great component.
Upon checking, I noticed that there aren't any code pieces for displaying any data on the cell (OLESimulatedTableView)
How can I use this tableview as a subview of container.
Thanks in advance.

setContentOffset:animated: does not work as expected on child scroll views

I have a bit more complex setup in my app where I set the content offset directly on a table view in code. This table view and it's UITableViewController have no knowledge of OLEContainerScrollView.

Setting the content inset breaks the layout. Any idea how to make this setup work correctly?

I guess OLEContainerScrollView could observe the contentOffset and if it changed outside of its layoutSubviews implementation, it could adjust the layout accordingly.

EDIT:

What I actually need is to call scrollToRow(at:at:animated:) on the tableView, not setting the content offset.

Implicit Declaration Function NSCParameterAssert

Hi! @ole

Thank you for your open source libraries.

I have an issue in OLESwizzling.
Could you give me a tutorial to import your libraries ?
May i have to set my project in order to use your libraries?

I have been drag your libraries and drop in to my project, however i got an error in OLESwizzling ("Implicit Declaration of Function NSCParameterAssert").
As additional clue, I can not initialize object like NSString, NSArrat, etc.
screen shot 2015-07-29 at 4 11 21 pm

Sorry for My Bad English

Aji

Why use contentView to addSubViews?

Hi, i had read you source codes, and i found that all subviews are added to a contentview, and this contentview is added to the ScrollView, then set contentview's frame and bounds to control subviews position.
i just want to know why just add subviews to scrollview directly?

Spacing

Could you suggest what it would take to introduce spacing between views and also between views and the container scrollview?

Dropping Touches

Ole,

First of all, love the scroll view and the thought behind it. I'm using a modified version of it in our app, and I've noticed that when scrolling fast we can miss UI touch events. I've put logging into UIApplication sendEvent: and we are completely missing touches. I've narrowed down the issue to be when setting the frame/contentOffset for an internal scrollview (UICollectionView) inside of OLEContainerScrollView. My theory is that under fast scrolling, the scroll view is doing lots of computation and lots of repositioning (frame and content offset) of views, which causes the user input to be blocked. I can't find a lot of resources online about this. It's unclear to me whether blocking the main thread can actually cause touches to be lost rather than just delaying them. I'd be okay with slightly delayed touches, but the fact that they don't appear at all is concerning.

Have you had any experience in production with OLEContainerScrollView containing complex scrollviews/collectionviews dropping touches?

Private api usage

Hey cool project, but is this suitable in a commercial application? i noticed private api usage in 2db7ddb

If i remove this code what defects/issues can i expect?

Maybe we could create a app store safe branch?

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.