         return false
     }
 
-    func allDependenciesLoaddedOf(view:UIView) -> Bool {
+    func hasSetDependenciesOf(view:UIView) -> Bool {
         for dep in dependencies {
             if dep.to == view && !dep.hasSet {
                 return false;

    private init() {}

    // TODO: Set vs Array (performance) ?
    /// 全部约束
    var dependencies = Set<Dependency>()


// MARK: Layout
private extension DependencyManager {

    // TODO: hasSetDependenciesOf 不是每次都要遍历的，可以提前生成一个渲染序列，这个渲染序列的副产品就是检查是否有依赖循环
    // TODO: 这个算法的复杂度事多少😂
    /// 核心布局方法
    func layout(views: [UIView]) {
        if hasUnsetDependenciesOf(views) {
            var layoutingViews = Set(views)
            repeat {
                _ = layoutingViews.map { view in
                    if hasSetDependenciesOf(view) {
                        view.layoutWithFangYuan()
                        setDependenciesOf(view)
                        layoutingViews.remove(view)
                    }
                }
            } while hasUnsetDependenciesOf(views)
        } else {
            _ = views.map { view in
                view.layoutWithFangYuan()
            }
        }
    }

    func hasUnsetDependenciesOf(views:[UIView]) -> Bool {

        let unsetInfo = unsetDependencyInfo

        guard unsetInfo.has else {
            return false
        }

        for view in views {
            for dep in unsetInfo.dependencies {
                if dep.to == view {
                    return true
                }
