Giter VIP home page Giter VIP logo

cgcellcontentviewmanager's Introduction

CGCellContentViewManager

Doc

English Doc · 中文文档 · 相关博客


Overview

Overview.gif

Introduction

An elegant way to solve the problem while we're clicking a UITableViewCell, the subview's backgroundColor in the cell's contentView's changed unexpected.

A Common Solution

Disable the native cell's selection style:


cell.selectionStyle = UITableViewCellSelectionStyleNone;

And then add a button to cover the cell's contentView, to imitate the native selection style.

But it seems to be a little complex.

Try CGCellContentViewManager! It can keep you away from these unnecessary troubles

Usage

Just add the files in CGCellContentViewManager to your project, and needn't for any setups,CGCellContentViewManager will work automatically.

All the subviews in the cell's contentView will never change backgroundColor while we're clicking the cell.

To disable the CGCellContentViewManager's auto-work for a cell:


cell.cg_cellContentViewManagerDisabled = YES;

To disable the CGCellContentViewManager's auto-work for a subview in cell's contentView:


customSubview.cg_cellContentViewManagerDisabled = YES;

Compatibility

Both supports Objective - C and Swift

In a Swift project, the Objective - C Bridging Header may not be required.

CocoaPods

Use with CocoaPods


pod 'CGCellContentViewManager', '1.0'

License

MIT

cgcellcontentviewmanager's People

Contributors

web2-wenjie-dev avatar

Watchers

 avatar

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.