Skip to content

Commit

Permalink
Issue chaione#2 fixed.
Browse files Browse the repository at this point in the history
  • Loading branch information
georgepiva committed Sep 6, 2012
1 parent 4fedfd0 commit 0f43eb2
Show file tree
Hide file tree
Showing 5 changed files with 126 additions and 8 deletions.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0440"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "CA3A7B8C13708CDE00CF5E6B"
BuildableName = "UIInputToolbarSample.app"
BlueprintName = "UIInputToolbarSample"
ReferencedContainer = "container:UIInputToolbarSample.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
buildConfiguration = "Debug">
<Testables>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "CA3A7B8C13708CDE00CF5E6B"
BuildableName = "UIInputToolbarSample.app"
BlueprintName = "UIInputToolbarSample"
ReferencedContainer = "container:UIInputToolbarSample.xcodeproj">
</BuildableReference>
</MacroExpansion>
</TestAction>
<LaunchAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
buildConfiguration = "Debug"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
allowLocationSimulation = "YES">
<BuildableProductRunnable>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "CA3A7B8C13708CDE00CF5E6B"
BuildableName = "UIInputToolbarSample.app"
BlueprintName = "UIInputToolbarSample"
ReferencedContainer = "container:UIInputToolbarSample.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
buildConfiguration = "Release"
debugDocumentVersioning = "YES">
<BuildableProductRunnable>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "CA3A7B8C13708CDE00CF5E6B"
BuildableName = "UIInputToolbarSample.app"
BlueprintName = "UIInputToolbarSample"
ReferencedContainer = "container:UIInputToolbarSample.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>SchemeUserState</key>
<dict>
<key>UIInputToolbarSample.xcscheme</key>
<dict>
<key>orderHint</key>
<integer>0</integer>
</dict>
</dict>
<key>SuppressBuildableAutocreation</key>
<dict>
<key>CA3A7B8C13708CDE00CF5E6B</key>
<dict>
<key>primary</key>
<true/>
</dict>
</dict>
</dict>
</plist>
Original file line number Diff line number Diff line change
Expand Up @@ -138,9 +138,9 @@ -(void)setFrame:(CGRect)aframe
CGRect backgroundFrame = aframe;
backgroundFrame.origin.y = 0;
backgroundFrame.origin.x = 0;
backgroundFrame.size.height -= 8;
CGRect textViewFrame = CGRectInset(backgroundFrame, kTextInsetX, 0);
internalTextView.frame = textViewFrame;
backgroundFrame.size.height -= 8;
textViewBackgroundImage.frame = backgroundFrame;
forceSizeUpdate = YES;
[super setFrame:aframe];
Expand Down Expand Up @@ -238,8 +238,8 @@ - (void)textViewDidChange:(UITextView *)textView
self.frame = r;
r.origin.y = 0;
r.origin.x = 0;
internalTextView.frame = CGRectInset(r, kTextInsetX, 0);
r.size.height -= 8;
internalTextView.frame = CGRectInset(r, kTextInsetX, 0);
textViewBackgroundImage.frame = r;

if(animateHeightChange)
Expand Down
22 changes: 16 additions & 6 deletions UIInputToolbarSample/Classes/UIInputToolbar/UIInputToolbar.m
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,11 @@

NSString * const CHExpandingTextViewWillChangeHeightNotification = @"CHExpandingTextViewWillChangeHeight";

@interface UIInputToolbar () {
UIColor *characterCountIsValidTextColor;
UIColor *characterCountIsValidShadowColor;
UIColor *characterCountIsNotValidTextColor;
UIColor *characterCountIsNotValidShadowColor;
}
@interface UIInputToolbar ()
@property (nonatomic, retain) UIColor *characterCountIsValidTextColor;
@property (nonatomic, retain) UIColor *characterCountIsValidShadowColor;
@property (nonatomic, retain) UIColor *characterCountIsNotValidTextColor;
@property (nonatomic, retain) UIColor *characterCountIsNotValidShadowColor;

@property (nonatomic, retain) UIButton *innerBarButton;

Expand All @@ -50,6 +49,11 @@ @implementation UIInputToolbar
@synthesize inputButtonImage=_inputButtonImage;
@synthesize innerBarButton;

@synthesize characterCountIsValidTextColor;
@synthesize characterCountIsValidShadowColor;
@synthesize characterCountIsNotValidTextColor;
@synthesize characterCountIsNotValidShadowColor;

-(void)inputButtonPressed
{
if ([delegate respondsToSelector:@selector(inputButtonPressed:)])
Expand Down Expand Up @@ -150,6 +154,12 @@ - (void)drawRect:(CGRect)rect

- (void)dealloc
{
[characterCountIsValidTextColor release];
[characterCountIsValidShadowColor release];
[characterCountIsNotValidTextColor release];
[characterCountIsNotValidShadowColor release];

[characterCountLabel release];
[textView release];
[inputButton release];
[super dealloc];
Expand Down

0 comments on commit 0f43eb2

Please sign in to comment.