How to implement tree-level catalog folding and unwinding
1 Introduction
Recently has been writing projects with Swift, has now completed the half, probably in mid-November can be completed, the time will be a series of video, the source is stacked out. I am the iOS 0 Foundation learning Swift, which has not had any OBJC experience in the past few weeks and has been spent in the cycle of pit crawls. At present, not only the swift Chinese information is scarce, the English material is very few, many problems to finally still want to see OBJC code, cause I now see OBJC even with guess also can understand a 7788. In addition, several of the swift learning groups of Daniel are also very enthusiastic, many problems can be pointed to the pain point. The so-called drink from, while the project was idle last week, to help a netizen to do a demo, the main function is "How to achieve tree-level directory folding and expansion."
The topic at first glance seems quite bluffing, in fact we usually use, Windows Explorer directory tree, click the minus sign to collapse the current directory and subdirectories, click the plus sign to expand. The demo has a similar function to complete, but the catalog is replaced with a uitableviewcell, and the minus sign becomes the click Sectionheader. is a feature demo (the uploaded GIF picture does not show, please click Http://i1.hoopchina.com.cn/blogfile/201409/30/bbsimg141204328756017_360*240.gif)
2 Source Download
This is the station link: http://download.csdn.net/detail/adoaiwen1314/7991993 Note: When running the demo, please open the agent, the Netizen's website was wall:Http://redian.today/mobi.php?mod=comment&id=218560&type=json
3 FAQs
The function of parsing JSON in demo is a bit complicated, but it is only for the specific data structure, it can be ignored, it is mainly how to realize the hiding and unfolding process with sectionheader. The specific code is not analyzed, in doubt can leave a comment in the comments.
ios-swift-How to Implement tree-level catalog folding and expansion