File tree Expand file tree Collapse file tree
Example/Example.xcodeproj Expand file tree Collapse file tree Original file line number Diff line number Diff line change 457457 LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
458458 PRODUCT_BUNDLE_IDENTIFIER = com.polydice.ICInputAccessoryExample;
459459 PRODUCT_NAME = "$(TARGET_NAME)";
460+ TARGETED_DEVICE_FAMILY = "1,2";
460461 };
461462 name = Debug;
462463 };
470471 LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
471472 PRODUCT_BUNDLE_IDENTIFIER = com.polydice.ICInputAccessoryExample;
472473 PRODUCT_NAME = "$(TARGET_NAME)";
474+ TARGETED_DEVICE_FAMILY = "1,2";
473475 };
474476 name = Release;
475477 };
Original file line number Diff line number Diff line change @@ -38,23 +38,31 @@ public class ICKeyboardDismissTextField: UITextField {
3838
3939 override public init ( frame: CGRect ) {
4040 super. init ( frame: frame)
41- inputAccessoryView = accessoryView
41+ setUpAccessoryView ( )
4242 }
4343
4444 required public init ? ( coder aDecoder: NSCoder ) {
4545 super. init ( coder: aDecoder)
46- inputAccessoryView = accessoryView
46+ setUpAccessoryView ( )
4747 }
4848
4949 // MARK: - UIResponder
5050
5151 override public func becomeFirstResponder( ) -> Bool {
52- accessoryView. alpha = 1
52+ if UI_USER_INTERFACE_IDIOM ( ) == . Phone {
53+ accessoryView. alpha = 1
54+ }
5355 return super. becomeFirstResponder ( )
5456 }
5557
5658 // MARK: - Private Methods
5759
60+ private func setUpAccessoryView( ) {
61+ if UI_USER_INTERFACE_IDIOM ( ) == . Phone {
62+ inputAccessoryView = accessoryView
63+ }
64+ }
65+
5866 @IBAction private func dismiss( sender: UIButton ) {
5967 resignFirstResponder ( )
6068 UIView . animateWithDuration ( 0.3 ) {
You can’t perform that action at this time.
0 commit comments