Git Product home page Git Product logo

oxclassifytagdemo's Introduction

OXClassifyTagDemo

三级指标/三级分类内容展示demo

因为项目需要实现了一个分类查找的界面,多个类别/指标之间有多级依赖关系,效果如下:

整个demo使用MVC架构。

分三级,也就是分三类,用表头的view来展示,自定义实现一个表头的headerView类。

表头右边指标的箭头动画使用UIView动画实现,点击后会判断该类下是否有内容并且避免跳级展开显示,通过delegate回调刷新列表,但是为了完整显示箭头动画,这个回调操作使用GCD来延迟执行。收起时会收起所有小于等于该级别的分类列表

各个分类/指标使用一个自定义的Model来装载数据。每个Model有以下数据:

  • id
  • 标题
  • 是否是叶子节点(比如古文学就是个叶子节点,下面不会再有分类了,因此点击后没有效果了
  • 下属节点数组(比如文学下属数组包含**文学和外国文学,**文学下属数组包含古文学和小说文学,在点击一个节点后通过该数组获取其下属内容并显示)

采用这种结构是为了方便构建多级依赖关系的树状结构,同时用一个是否有叶子节点的属性,可以用于不一定都是满树的情况。

列表及一些逻辑放在Controller内,列表、delegate等,都比较常见。

有帮助的话请star鼓励~

更多内容可以查看我的博客

oxclassifytagdemo's People

Contributors

cloudox avatar

Watchers

 avatar  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.