     }()
 
     private lazy var buttonSpacer: UIView = UIView()
+    private var heightConstraint: Constraint?
 
     private var copiedURL: NSURL? {
         if let string = UIPasteboard.generalPasteboard().string,

        } else {
            self.openCopiedLinkButton.hidden = true
        }

        self.view.setNeedsLayout()
    }

    func widgetMarginInsetsForProposedMarginInsets(defaultMarginInsets: UIEdgeInsets) -> UIEdgeInsets {
        TodayUX.defaultWidgetTextMargin = defaultMarginInsets.left
        return UIEdgeInsetsMake(0, 0, TodayUX.verticalWidgetMargin, 0)
    }

    func widgetPerformUpdateWithCompletionHandler(completionHandler: ((NCUpdateResult) -> Void)) {
        // Perform any setup necessary in order to update the view.
        dispatch_async(dispatch_get_main_queue()) {
            // updates need to be made on the main thread
            self.updateCopiedLink()
            // and we need to call the completion handler in every branch.
            completionHandler(NCUpdateResult.NewData)
        }
        completionHandler(NCUpdateResult.NewData)
    }

    // MARK: Button behaviour

            make.height.equalTo(TodayUX.copyLinkButtonHeight)
        }

        view.snp_remakeConstraints { heightConstraint = $0.height.equalTo(buttonSpacer.snp_height).priorityHigh().constraint }
    }
    
    override func viewWillAppear(animated: Bool) {
        super.viewWillAppear(animated)
        updateCopiedLink()
        var extraHeight = TodayUX.verticalWidgetMargin
        if hasCopiedURL {
            extraHeight += TodayUX.copyLinkButtonHeight + TodayUX.verticalWidgetMargin
        }
        heightConstraint?.updateOffset(extraHeight)
    }

    override func viewDidLayoutSubviews() {
