     }
 
     public subscript(key: LayoutKey) -> Layout {
-        if let subLayout = sublayouts[key.layoutKey] {
+        if let subLayout = sublayouts[key] {
             return subLayout
         } else {
             let sublayout = Layout()
-            sublayouts[key.layoutKey] = sublayout
+            sublayouts[key] = sublayout
             return sublayout
         }
     }

import UIKit

public protocol LayoutKey {

    var layoutKey: String { get }
}

extension String: LayoutKey {

    public var layoutKey: String { return self }
}

public class Layout {


    }

    private func sublayouts(_ keys: [LayoutKey]) -> [Layout] {
        return sublayouts.filter { keys.contains($0.key) } .map { $0.value }
    }
}
