Skip to content

Commit

Permalink
Fixed issue where shouldSelectItemAtIndex delegate method wasn't fire…
Browse files Browse the repository at this point in the history
…d for items other than the currently selected one. Updated project settings for Xcode 4.2.
  • Loading branch information
Nick Lockwood committed Oct 20, 2011
1 parent 0157518 commit ebe8498
Show file tree
Hide file tree
Showing 17 changed files with 3,079 additions and 6 deletions.
3 changes: 3 additions & 0 deletions iCarousel Mac Demo/iCarouselMac.xcodeproj/project.pbxproj
Expand Up @@ -165,6 +165,9 @@
/* Begin PBXProject section */
018BBC5B13A37041005CA505 /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0420;
};
buildConfigurationList = 018BBC5E13A37041005CA505 /* Build configuration list for PBXProject "iCarouselMac" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
Expand Down
Binary file not shown.
13 changes: 13 additions & 0 deletions iCarousel No Nib Demo/iCarouselExample.xcodeproj/project.pbxproj
Expand Up @@ -152,6 +152,9 @@
/* Begin PBXProject section */
01308D8513491C3500453707 /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0420;
};
buildConfigurationList = 01308D8813491C3500453707 /* Build configuration list for PBXProject "iCarouselExample" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
Expand Down Expand Up @@ -243,10 +246,15 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
ARCHS = (
armv6,
armv7,
);
COPY_PHASE_STRIP = NO;
GCC_DYNAMIC_NO_PIC = NO;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "iCarouselExample-Prefix.pch";
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
INFOPLIST_FILE = "iCarouselExample-Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 3.2;
PRODUCT_NAME = "$(TARGET_NAME)";
Expand All @@ -259,9 +267,14 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
ARCHS = (
armv6,
armv7,
);
COPY_PHASE_STRIP = YES;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "iCarouselExample-Prefix.pch";
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
INFOPLIST_FILE = "iCarouselExample-Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 3.2;
PRODUCT_NAME = "$(TARGET_NAME)";
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.
@@ -0,0 +1,10 @@
<?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>IDEWorkspaceUserSettings_HasAskedToTakeAutomaticSnapshotBeforeSignificantChanges</key>
<true/>
<key>IDEWorkspaceUserSettings_SnapshotAutomaticallyBeforeSignificantChanges</key>
<false/>
</dict>
</plist>
@@ -0,0 +1,72 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "01308D8D13491C3500453707"
BuildableName = "iCarouselExample.app"
BlueprintName = "iCarouselExample"
ReferencedContainer = "container:iCarouselExample.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.GDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.GDB"
shouldUseLaunchSchemeArgsEnv = "YES"
buildConfiguration = "Debug">
<Testables>
</Testables>
</TestAction>
<LaunchAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.GDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.GDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
buildConfiguration = "Debug">
<BuildableProductRunnable>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "01308D8D13491C3500453707"
BuildableName = "iCarouselExample.app"
BlueprintName = "iCarouselExample"
ReferencedContainer = "container:iCarouselExample.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
buildConfiguration = "Release">
<BuildableProductRunnable>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "01308D8D13491C3500453707"
BuildableName = "iCarouselExample.app"
BlueprintName = "iCarouselExample"
ReferencedContainer = "container:iCarouselExample.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>iCarouselExample.xcscheme</key>
<dict>
<key>orderHint</key>
<integer>0</integer>
</dict>
</dict>
<key>SuppressBuildableAutocreation</key>
<dict>
<key>01308D8D13491C3500453707</key>
<dict>
<key>primary</key>
<true/>
</dict>
</dict>
</dict>
</plist>
17 changes: 15 additions & 2 deletions iCarousel No Nib Demo/iCarouselExampleViewController.m
Expand Up @@ -281,17 +281,30 @@ - (void)carouselDidEndScrollingAnimation:(iCarousel *)carousel
NSLog(@"Carousel did end scrolling");
}

- (BOOL)carousel:(iCarousel *)_carousel shouldSelectItemAtIndex:(NSInteger)index
{
if (index == carousel.currentItemIndex)
{
NSLog(@"Should select current item");
}
else
{
NSLog(@"Should select item number %i", index);
}
return YES;
}

- (void)carousel:(iCarousel *)_carousel didSelectItemAtIndex:(NSInteger)index
{
if (index == carousel.currentItemIndex)
{
//note, this will only ever happen if USE_BUTTONS == NO
//otherwise the button intercepts the tap event
NSLog(@"Selected current item");
NSLog(@"Did select current item");
}
else
{
NSLog(@"Selected item number %i", index);
NSLog(@"Did select item number %i", index);
}
}

Expand Down
13 changes: 13 additions & 0 deletions iCarousel iOS Demo/iCarouselExample.xcodeproj/project.pbxproj
Expand Up @@ -158,6 +158,9 @@
/* Begin PBXProject section */
01308D8513491C3500453707 /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0420;
};
buildConfigurationList = 01308D8813491C3500453707 /* Build configuration list for PBXProject "iCarouselExample" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
Expand Down Expand Up @@ -267,10 +270,15 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
ARCHS = (
armv6,
armv7,
);
COPY_PHASE_STRIP = NO;
GCC_DYNAMIC_NO_PIC = NO;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "iCarouselExample-Prefix.pch";
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
INFOPLIST_FILE = "iCarouselExample-Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 3.2;
PRODUCT_NAME = "$(TARGET_NAME)";
Expand All @@ -283,9 +291,14 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
ARCHS = (
armv6,
armv7,
);
COPY_PHASE_STRIP = YES;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "iCarouselExample-Prefix.pch";
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
INFOPLIST_FILE = "iCarouselExample-Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 3.2;
PRODUCT_NAME = "$(TARGET_NAME)";
Expand Down

0 comments on commit ebe8498

Please sign in to comment.