Skip to content

Commit

Permalink
Making iOS 7 Compatible
Browse files Browse the repository at this point in the history
Fixing the resignFirstResponder method to work with the new hierarchy
of UITableView.
  • Loading branch information
drumnkyle committed Nov 7, 2013
1 parent 6724047 commit 4a5c65a
Show file tree
Hide file tree
Showing 5 changed files with 184 additions and 2 deletions.
@@ -0,0 +1,41 @@
<?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>IDESourceControlProjectFavoriteDictionaryKey</key>
<false/>
<key>IDESourceControlProjectIdentifier</key>
<string>738C18F0-CD0C-44B8-B996-51926293FC53</string>
<key>IDESourceControlProjectName</key>
<string>PickerCellDemo</string>
<key>IDESourceControlProjectOriginsDictionary</key>
<dict>
<key>BDD35BD1-32F9-441D-B104-6F8F7F5ED22C</key>
<string>https://github.com/wannabegeek/PickerTableViewCell.git</string>
</dict>
<key>IDESourceControlProjectPath</key>
<string>PickerCellDemo.xcodeproj/project.xcworkspace</string>
<key>IDESourceControlProjectRelativeInstallPathDictionary</key>
<dict>
<key>BDD35BD1-32F9-441D-B104-6F8F7F5ED22C</key>
<string>../..</string>
</dict>
<key>IDESourceControlProjectURL</key>
<string>https://github.com/wannabegeek/PickerTableViewCell.git</string>
<key>IDESourceControlProjectVersion</key>
<integer>110</integer>
<key>IDESourceControlProjectWCCIdentifier</key>
<string>BDD35BD1-32F9-441D-B104-6F8F7F5ED22C</string>
<key>IDESourceControlProjectWCConfigurations</key>
<array>
<dict>
<key>IDESourceControlRepositoryExtensionIdentifierKey</key>
<string>public.vcs.git</string>
<key>IDESourceControlWCCIdentifierKey</key>
<string>BDD35BD1-32F9-441D-B104-6F8F7F5ED22C</string>
<key>IDESourceControlWCCName</key>
<string>PickerTableViewCell</string>
</dict>
</array>
</dict>
</plist>
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<Bucket
type = "1"
version = "2.0">
<Breakpoints>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.ExceptionBreakpoint">
<BreakpointContent
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
scope = "0"
stopOnStyle = "0">
</BreakpointContent>
</BreakpointProxy>
</Breakpoints>
</Bucket>
@@ -0,0 +1,86 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0500"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "E2CA1A5C146B09E00070B8B9"
BuildableName = "PickerCellDemo.app"
BlueprintName = "PickerCellDemo"
ReferencedContainer = "container:PickerCellDemo.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 = "E2CA1A5C146B09E00070B8B9"
BuildableName = "PickerCellDemo.app"
BlueprintName = "PickerCellDemo"
ReferencedContainer = "container:PickerCellDemo.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 = "E2CA1A5C146B09E00070B8B9"
BuildableName = "PickerCellDemo.app"
BlueprintName = "PickerCellDemo"
ReferencedContainer = "container:PickerCellDemo.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
buildConfiguration = "Release"
debugDocumentVersioning = "YES">
<BuildableProductRunnable>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "E2CA1A5C146B09E00070B8B9"
BuildableName = "PickerCellDemo.app"
BlueprintName = "PickerCellDemo"
ReferencedContainer = "container:PickerCellDemo.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
@@ -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>PickerCellDemo.xcscheme</key>
<dict>
<key>orderHint</key>
<integer>0</integer>
</dict>
</dict>
<key>SuppressBuildableAutocreation</key>
<dict>
<key>E2CA1A5C146B09E00070B8B9</key>
<dict>
<key>primary</key>
<true/>
</dict>
</dict>
</dict>
</plist>
20 changes: 18 additions & 2 deletions PickerCellDemo/DateInputTableViewCell.m
Expand Up @@ -129,7 +129,15 @@ - (BOOL)resignFirstResponder {
} else {
// Nothing to do
}
UITableView *tableView = (UITableView *)self.superview;
UITableView *tableView;
if ([self.superview class] != [UITableView class])
{
tableView = (UITableView *)self.superview.superview;
}
else
{
tableView = (UITableView *)self.superview;
}
[tableView deselectRowAtIndexPath:[tableView indexPathForCell:self] animated:YES];
return [super resignFirstResponder];
}
Expand Down Expand Up @@ -255,7 +263,15 @@ - (BOOL)canBecomeFirstResponder {

- (void)popoverControllerDidDismissPopover:(UIPopoverController *)popoverController {
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
UITableView *tableView = (UITableView *)self.superview;
UITableView *tableView;
if ([self.superview class] != [UITableView class])
{
tableView = (UITableView *)self.superview.superview;
}
else
{
tableView = (UITableView *)self.superview;
}
[tableView deselectRowAtIndexPath:[tableView indexPathForCell:self] animated:YES];
[self resignFirstResponder];
}
Expand Down

0 comments on commit 4a5c65a

Please sign in to comment.