     // MARK: State
     
     func update(oldState: State) {
+        // If the number of punches required has changed, remove the old ones
+        // and add the new ones.
+        if oldState.punchesRequired != state.punchesRequired {
+            punchViews.forEach {
+                $0.removeFromSuperview()
+            }
+            
+            punchViews.removeAll()
+            
+            for _ in 0..<state.punchesRequired {
+                punchViews.append(PunchView(frame: CGRectZero))
+            }
+            
+            punchViews.forEach {
+                self.punchesContentView.addSubview($0)
+            }
+            
+        }
+        
+        // Update all the punchViews state's.
+        for (index, punchView) in punchViews.enumerate() {
+            var punchViewState = punchView.state
+            punchViewState.emptyPunchImage = state.emptyPunchImage
+            punchViewState.filledPunchImage = state.filledPunchImage
+            punchViewState.punchNumber = index + 1
+            punchViewState.isFilled = index < state.punchesReceived
+            punchViewState.punchNumberFont = state.punchNumberFont
+            punchViewState.punchNumberColor = state.punchNumberColor
+            
+            punchView.state = punchViewState
+        }
+        
         backgroundColor = state.backgroundColor
         punchesContentView.layer.borderColor = state.punchNumberColor.CGColor
+        
+        setNeedsUpdateConstraints()
     }
 }

     */
    private var punchesContentView = UIView()
    
    // MARK: Init
    
    init(state: State) {

        punchesContentView.backgroundColor = UIColor.clearColor()
        punchesContentView.layer.borderWidth = 1.0
        addSubview(punchesContentView)
        
        punchesContentView.snp_makeConstraints { make in
            make.edges.equalToSuperview().inset(10)
        }
        
        layoutIfNeeded()
    }
    
    // MARK: View
    
    override func updateConstraints() {
        guard let emptyPunchImage = state.emptyPunchImage else {
                super.updateConstraints()
                return
        }
        
        // Calculate if the PunchcardView has enough size to accommodate all punchViews.
        let punchNumberLabelHeight = NSString(string: "1").sizeWithAttributes([NSFontAttributeName: state.punchNumberFont]).height
        let punchViewSize = CGSize(width: emptyPunchImage.size.width,
                                   height: emptyPunchImage.size.height + punchNumberLabelHeight)
        guard punchViewSize.height < punchesContentView.bounds.size.height &&
            punchViewSize.width * CGFloat(state.punchesRequired) < punchesContentView.bounds.size.width     else {
                print("Punchcard: PunchcardView is either too short or too tall to support the punchViews given the punch image and number of punches.\nNot drawing any punch views.")
                super.updateConstraints()
                return
        }
        
        let buffer = (punchesContentView.bounds.size.width - (punchViewSize.width * CGFloat(state.punchesRequired)))/CGFloat(state.punchesRequired + 1)
        
        for (index, punchView) in punchViews.enumerate() {
            // If it's the first one, anchor it to the left side.
            if index == 0 {
                punchView.snp_remakeConstraints { make in
                    make.left.equalToSuperview().offset(buffer)
                    make.centerY.equalToSuperview()
                }
            }
            
            // If it's somewhere in the middle or the end, anchor the
            // left to the previous one.
            if index > 0 && index <= state.punchesRequired {
                punchView.snp_remakeConstraints { make in
                    make.left.equalTo(self.punchViews[index - 1].snp_right).offset(buffer)
                    make.centerY.equalToSuperview()
                }
            }
            
            // If it's the last one, add (snp_make, not snp_remake since we
            // don't want to blow away the ones we just created) an
            // anchor to the right side.
            if index == state.punchesRequired - 1 {
                punchView.snp_makeConstraints { make in
                    make.right.equalToSuperview().inset(buffer)
                }
            }
        }
        
        super.updateConstraints()
