         
         let departureCityFieldWidth = contentWidth * self.cityFieldsSplitPercentage
         let arrivalCityFieldWidth = contentWidth * (1 - self.cityFieldsSplitPercentage)
-
+        
         self.departureCityField.frame = CGRectMake(marginLeft, offsetY, departureCityFieldWidth, cityFieldHeight)
         self.arrivalCityField.frame = CGRectMake(marginLeft + departureCityFieldWidth + spacingBetweenFields, offsetY, arrivalCityFieldWidth, cityFieldHeight)
     }
+    
+    // MARK: - Delegate
+    
+    func watermarkedTextFieldDidBeginEditing(watermarkedTextField: WatermarkedTextField) {
+        if(watermarkedTextField == self.departureCityField) {
+            self.cityFieldsSplitPercentage = 0.6;
+        }
+        else if(watermarkedTextField == self.arrivalCityField) {
+            self.cityFieldsSplitPercentage = 0.4;
+        }
+    }
 
 }


import UIKit

class ShowcaseExampleViewController: UIViewController {
    
    var departureCityField: WatermarkedTextField!
    var arrivalCityField: WatermarkedTextField!

        textField.textField.font = UIFont(name: "AppleSDGothicNeo-Regular", size: 18)
    }
    
    // MARK: - Animating the width change of the city fields
    
    func updateCityFieldsLayout() {
        UIView.animateWithDuration(0.2, animations: { () -> Void in
            self.layoutCityFields()
        })
    }
    
    func layoutCityFields() {
        let offsetY:CGFloat = 72
        let marginLeft:CGFloat = 12
        let marginRight:CGFloat = 12
