 public struct VisualFormatLanguage : ExpressibleByStringInterpolation {
     
     let format: String
-    var metrics = NSHashTable<NSNumber>(options: NSPointerFunctions.Options.weakMemory)
+    var metrics = NSHashTable<NSNumber>(options: NSPointerFunctions.Options.copyIn)
     var views = NSHashTable<UIView>(options: NSPointerFunctions.Options.weakMemory)
+    var viewCount: Int = 0  // used to check if this VFL is still valid; since views won't persist the view pointers, if the view is deallocated, there will be an exception when constraints are created later
     
     public init(stringInterpolation strings: VisualFormatLanguage...) {
         var format = ""

            }
            for view in vfl.views.allObjects {
                views.add(view)
            }
        }
        self.format = format
    }
    
    public init<T>(stringInterpolationSegment expr: T) {
        format = String(describing: expr)
    }
    
    public init(stringInterpolationSegment view: UIView) {
        format = vflKey(view)
        views.add(view)
    }
    
    public init(stringInterpolationSegment number: NSNumber) {
        format = vflKey(number)
        metrics.add(number)
    }
    
    func vflDictionary<T>(_ table: NSHashTable<T>) -> [String : AnyObject] {

    
    /// Returns layout constraints with options.
    public func constraints(_ options: NSLayoutFormatOptions) -> [NSLayoutConstraint] {
        /// fail it if views are changed in case of the weak pointers' targets being deallocated
        guard views.count == viewCount else { return [] }
        return NSLayoutConstraint.constraints(withVisualFormat: format, options: options, metrics: vflDictionary(metrics), views: vflDictionary(views))
    }
    
