Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

iTofu/Tree

Open more actions menu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tree

CI Status Version License Platform Laguage CocoaPods LeoDev GitHub stars

🎏 Tree can help you manage views more clearly.

⚠️ If you using this lib after Swift 5.4, you could @_exported import Tree, otherwise you may have to import Tree everywhere. Swift Bugfix Link

Checking your current swift version:

swift --version

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

ScreenShot_01

Requirements

  • iOS 8.0+

Installation

Swift Package Manager

The Swift Package Manager is a tool for automating the distribution of Swift code and is integrated into the swift compiler.

Once you have your Swift package set up, adding Tree as a dependency is as easy as adding it to the dependencies value of your Package.swift or the Package list in Xcode.

dependencies: [
  .package(url: "https://github.com/iTofu/Tree.git", .upToNextMajor(from: "0.5.0"))
]

Normally you'll want to depend on the Tree target:

.product(name: "Tree", package: "Tree")

CocoaPods

CocoaPods is a dependency manager for Cocoa projects. For usage and installation instructions, visit their website. To integrate Tree into your Xcode project using CocoaPods, specify it in your Podfile:

pod 'Tree'

Usage

  • Add subviews (or stackView) or layers:

    // import
    import Tree
    // or global import
    @_exported import Tree
    
    // view
    view <- [
      aView,
      bView <- [
        cView,
      ],
      dLayer,
      eStackView <- [
        fButton,
        gButton,
        (hButton, 0), // insert hButton at index 0
      ],
      judge ? iView : nil,
    ]
    
    // layer
    layer <- [
      aLayer,
      bLayer,
      nil,
      // lalala...
    ]

Author

Leo, leodaxia@gmail.com

License

Tree is available under the MIT license. See the LICENSE file for more info.

About

🎏 Tree can help you manage views more clearly.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages

Morty Proxy This is a proxified and sanitized view of the page, visit original site.