From 54f52dac801e17b861d48614c5e7924a9ba1c13c Mon Sep 17 00:00:00 2001 From: Mazyad Alabduljaleel Date: Fri, 17 Jul 2015 17:37:15 +0300 Subject: [PATCH] reduce header exposure this is important, so we know that this class is only used in one place --- cocos/ui/UIEditBox/UIEditBoxImpl-ios.h | 19 +------------------ cocos/ui/UIEditBox/UIEditBoxImpl-ios.mm | 18 ++++++++++++++++-- 2 files changed, 17 insertions(+), 20 deletions(-) diff --git a/cocos/ui/UIEditBox/UIEditBoxImpl-ios.h b/cocos/ui/UIEditBox/UIEditBoxImpl-ios.h index b7d6d8d9e93b..2ab3adbde9cf 100644 --- a/cocos/ui/UIEditBox/UIEditBoxImpl-ios.h +++ b/cocos/ui/UIEditBox/UIEditBoxImpl-ios.h @@ -33,24 +33,7 @@ #include "extensions/ExtensionMacros.h" #include "UIEditBoxImpl.h" -#import -#import - - -@interface UIEditBoxImplIOS_objc : NSObject - -@property (nonatomic, readonly, getter = isEditState) BOOL editState; - -- (instancetype)initWithFrame:(CGRect)frameRect editBox:(void *)editBox; -- (void)doAnimationWhenKeyboardMoveWithDuration:(float)duration distance:(float)distance; - -- (void)setPosition:(CGPoint)pos; -- (void)setContentSize:(CGSize)size; - -- (void)openKeyboard; -- (void)closeKeyboard; - -@end +@class UIEditBoxImplIOS_objc; NS_CC_BEGIN diff --git a/cocos/ui/UIEditBox/UIEditBoxImpl-ios.mm b/cocos/ui/UIEditBox/UIEditBoxImpl-ios.mm index d38236ff242d..a0e0c113bbc2 100644 --- a/cocos/ui/UIEditBox/UIEditBoxImpl-ios.mm +++ b/cocos/ui/UIEditBox/UIEditBoxImpl-ios.mm @@ -33,6 +33,9 @@ of this software and associated documentation files (the "Software"), to deal #include "2d/CCLabel.h" #import "platform/ios/CCEAGLView-ios.h" +#import +#import + #define getEditBoxImplIOS() ((cocos2d::ui::EditBoxImplIOS *)_editBox) static const int CC_EDIT_BOX_PADDING = 5; @@ -62,12 +65,23 @@ - (CGRect)editingRectForBounds:(CGRect)bounds @end -#pragma mark - UIEditBox private declerations +#pragma mark - UIEditBox ios implementation + -@interface UIEditBoxImplIOS_objc () +@interface UIEditBoxImplIOS_objc : NSObject @property (nonatomic, retain) UITextField *textField; @property (nonatomic, assign) void *editBox; +@property (nonatomic, readonly, getter = isEditState) BOOL editState; + +- (instancetype)initWithFrame:(CGRect)frameRect editBox:(void *)editBox; +- (void)doAnimationWhenKeyboardMoveWithDuration:(float)duration distance:(float)distance; + +- (void)setPosition:(CGPoint)pos; +- (void)setContentSize:(CGSize)size; + +- (void)openKeyboard; +- (void)closeKeyboard; @end