All Projects → partho-maple → Pbtreeview

partho-maple / Pbtreeview

An UITreeView implementation from UITableView that Apple missed in its UIKit framework. And it is in pure Swift.

Programming Languages

swift
15916 projects

Projects that are alternatives of or similar to Pbtreeview

Basecomponents
BaseComponents aims to provide easily reusable and understandable components to increase productivity with UIKit and Foundation APIs
Stars: ✭ 92 (-28.12%)
Mutual labels:  uikit, ui-components, uitableview
Swiftreorder
Easy UITableView drag-and-drop cell reordering
Stars: ✭ 340 (+165.63%)
Mutual labels:  uikit, ui-components, uitableview
Components
MobileUI was created thinking of making your hybrid application faster and smaller since you only install what you are really going to use for UI.
Stars: ✭ 125 (-2.34%)
Mutual labels:  uikit, ui-components
Tail Kit
Tail-kit is a free and open source components and templates kit fully coded with Tailwind css 2.0.
Stars: ✭ 997 (+678.91%)
Mutual labels:  uikit, ui-components
Ibanimatable
Design and prototype customized UI, interaction, navigation, transition and animation for App Store ready Apps in Interface Builder with IBAnimatable.
Stars: ✭ 8,585 (+6607.03%)
Mutual labels:  uikit, ui-components
Quick Free Bootstrap Theme
Free Bootstrap 4 Theme perfect for building responsive, mobile-first projects on the web suitable for businesses, startups, and agencies.
Stars: ✭ 31 (-75.78%)
Mutual labels:  uikit, ui-components
Spalert
Native alert from Apple Music & Feedback. Contains Done, Heart & Message and other presets.
Stars: ✭ 1,014 (+692.19%)
Mutual labels:  uikit, ui-components
Vyplayindicator
PlayIndicator inspired by Apple's Music Player.
Stars: ✭ 47 (-63.28%)
Mutual labels:  uikit, ui-components
Graphview
Android GraphView is used to display data in graph structures.
Stars: ✭ 918 (+617.19%)
Mutual labels:  tree-structure, treeview
Taiga Ui
Angular UI Kit and components library for awesome people
Stars: ✭ 1,353 (+957.03%)
Mutual labels:  uikit, ui-components
Datingapp
Dating UI kit is used for online meet up with girls and boys . The screen contains more than 30 icons and most of all required elements required to design an application like this. The XML and JAVA files contains comments at each and every point for easy understanding. Everything was made with a detail oriented style and followed by today's web trends. Clean coded & Layers are well-organized, carefully named, and grouped.
Stars: ✭ 97 (-24.22%)
Mutual labels:  uikit, ui-components
Ct Material Kit Pro
Premium Bootstrap 4 UI Kit based on Google's Material Design
Stars: ✭ 123 (-3.91%)
Mutual labels:  uikit, ui-components
Qmuidemo ios
Sample Code for QMUI iOS
Stars: ✭ 912 (+612.5%)
Mutual labels:  uikit, ui-components
Swifthuecolorpicker
iOS HUE color picker
Stars: ✭ 44 (-65.62%)
Mutual labels:  uikit, ui-components
Zircleui
🚀 zircle-ui is a frontend library to develop zoomable user interfaces.
Stars: ✭ 870 (+579.69%)
Mutual labels:  uikit, ui-components
Pagingkit
PagingKit provides customizable menu UI. It has more flexible layout and design than the other libraries.
Stars: ✭ 1,030 (+704.69%)
Mutual labels:  uikit, uitableview
React Virgin
The react-native UI Kit you've been looking for.
Stars: ✭ 1,523 (+1089.84%)
Mutual labels:  uikit, ui-components
Qmui ios
QMUI iOS——致力于提高项目 UI 开发效率的解决方案
Stars: ✭ 6,433 (+4925.78%)
Mutual labels:  uikit, ui-components
Viewanimator
ViewAnimator brings your UI to life with just one line
Stars: ✭ 6,592 (+5050%)
Mutual labels:  uikit, uitableview
Swiftassetspickercontroller
A simple assets picker controller based on iOS 8 Photos framework. Supports iCloud photos and videos. It's written in Swift.
Stars: ✭ 81 (-36.72%)
Mutual labels:  uikit, ui-components

PBTreeView

Swift 5.0 iOS License Apache PerfectlySoft Twitter


An UITreeView implementation from UITableView that Apple missed in its UIKit framework. And it is in pure Swift.

★★ Star our github repository to help us! ★★

Created by Partho Biswas (@ParthoBiswas007)

What's in it

  • [x] An UITreeView implementation from UITableView.
  • [x] An iOS application showing it's implementation and usage.

Preview

preview

Requirements

iOS 8.0+ / Swift 5.0+

Setup and Usage

This PBTreeView has been drawn over UITableView. Every row/node of the TreeView represents a UITableViewCell with a custom object.

Step 1:

  • First you need to arrange some datasource that seems like a tree. Check this JSON datasource as example.
  • This JSON data contains RelationshipDetails object as primary unit. This object will contain the information for each node of the tree. This object need to have an unique identifire. In this case, it's social_security_number.

Step 2:

  • Create a TreeViewDataHandler object and call it's following function passing the parsed data array
public func configureTreeViewDatasource(_ relationDetails: [RelationshipDetails]) -> [TreeViewNodeItem]?

And use the return value of the above function as TreeView's data source. Lile following.

var dataHandler: TreeViewDataHandler? = TreeViewDataHandler()
    
let relations: [RelationshipDetails]? = readJson(JSON_File_Name)
var treeViewDataSource = [TreeViewNodeItem]()
treeViewDataSource = (dataHandler?.configureTreeViewDatasource(relations!))!

Step 3:

  • Listen for RelodeTreeView notification to relode the TreeView.
NotificationCenter.default.addObserver(self, selector: #selector(relodeTreeView(_:)), name: NSNotification.Name(rawValue: "RelodeTreeView"), object: nil)

func relodeTreeView(_ notification: Notification) {
  self.treeViewDataSource = (dataHandler?.refreshNodes())!
  DispatchQueue.main.async {
    self.famityTreeTableView.reloadData()
    }
}

Customisation

Setting up UITableViewCell and UITableView

  • Create your own UITableViewCell custom subclass for the TreeView node.

Setting up custom data model

  • Just replace Relations and RelationshipDetails object with your own with proper changes and requirments.

Up Next

  • Dynamic addition and deletion of tree node.
  • Dyanmic Data Container
  • Dynamic View Holder

Contributing

Contributions are welcome. Please just open an Issue on GitHub to discuss a point or request a feature or send a Pull Request with your suggestion. If there's a related discussion on the Swift Evolution mailing list, please also post the thread name with a link.

Please also try to follow the same syntax and semantic in your commit messages (see rationale here).

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].