     }
     
     init() {
-        super.init(frame: CGRect(x: 0, y: 0, width: 420, height: 216));
+        let width = UIScreen.mainScreen().bounds.width;
+        super.init(frame: CGRect(x: 0, y: 0, width: width, height: 216));
+        initialize();
     }
 
     required init(coder aDecoder: NSCoder) {
         super.init(coder: aDecoder)!;
-        self.frame = CGRect(x: 0, y: 0, width: 420, height: 216);
+        let width = UIScreen.mainScreen().bounds.width;
+        self.frame = CGRect(x: 0, y: 0, width: width, height: 216);
         initialize();
     }
     

        
        calendar.locale = self.locale;
        
        
        switch(mode) {
            case FxDatePickerMode.Date:
               component = DateComponent(calendar: calendar, order: ["month": 0, "day": 1, "year": 2]);

    }
    
    func pickerView(pickerView: UIPickerView, numberOfRowsInComponent component: Int) -> Int {
        print("Count: \(self.component.getPickerItems()[component].count)");
        return self.component.getPickerItems()[component].count;
    }
    
    func pickerView(pickerView: UIPickerView, attributedTitleForRow row: Int, forComponent component: Int) -> NSAttributedString? {
        
        //let selectedRow = pickerView.selectedRowInComponent(component);
        var attributes : [String : AnyObject] = [:];
        
        attributes = [
            NSFontAttributeName: font,
            NSForegroundColorAttributeName: textColor
        ];
