一、实现原理
实质上就是创建UITableView。包含对section的和cell的自定义,对section添加TapGesture监听点击操作(实时修改标记值),(通过标记值)实时改变numberOfRowsInSection的值,然后调用UITableView的reloadData方法实现展开/收缩section的效果。
二、实现流程
1 初始化tableView,并对对section进行注册registerNib:forCellReuseIdentifier:。
2 实现UITableView的相关回调函数:
numberOfSectionsInTableView
heightForRowAtIndexPath