File tree Expand file tree Collapse file tree 2 files changed +13
-3
lines changed
Example/Example.xcodeproj Expand file tree Collapse file tree 2 files changed +13
-3
lines changed Original file line number Diff line number Diff line change 457
457
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
458
458
PRODUCT_BUNDLE_IDENTIFIER = com.polydice.ICInputAccessoryExample;
459
459
PRODUCT_NAME = "$(TARGET_NAME)";
460
+ TARGETED_DEVICE_FAMILY = "1,2";
460
461
};
461
462
name = Debug;
462
463
};
470
471
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
471
472
PRODUCT_BUNDLE_IDENTIFIER = com.polydice.ICInputAccessoryExample;
472
473
PRODUCT_NAME = "$(TARGET_NAME)";
474
+ TARGETED_DEVICE_FAMILY = "1,2";
473
475
};
474
476
name = Release;
475
477
};
Original file line number Diff line number Diff line change @@ -38,23 +38,31 @@ public class ICKeyboardDismissTextField: UITextField {
38
38
39
39
override public init ( frame: CGRect ) {
40
40
super. init ( frame: frame)
41
- inputAccessoryView = accessoryView
41
+ setUpAccessoryView ( )
42
42
}
43
43
44
44
required public init ? ( coder aDecoder: NSCoder ) {
45
45
super. init ( coder: aDecoder)
46
- inputAccessoryView = accessoryView
46
+ setUpAccessoryView ( )
47
47
}
48
48
49
49
// MARK: - UIResponder
50
50
51
51
override public func becomeFirstResponder( ) -> Bool {
52
- accessoryView. alpha = 1
52
+ if UI_USER_INTERFACE_IDIOM ( ) == . Phone {
53
+ accessoryView. alpha = 1
54
+ }
53
55
return super. becomeFirstResponder ( )
54
56
}
55
57
56
58
// MARK: - Private Methods
57
59
60
+ private func setUpAccessoryView( ) {
61
+ if UI_USER_INTERFACE_IDIOM ( ) == . Phone {
62
+ inputAccessoryView = accessoryView
63
+ }
64
+ }
65
+
58
66
@IBAction private func dismiss( sender: UIButton ) {
59
67
resignFirstResponder ( )
60
68
UIView . animateWithDuration ( 0.3 ) {
You can’t perform that action at this time.
0 commit comments