Permalink
Browse files

Localize SYPageControl and update example

  • Loading branch information...
soffes committed Mar 20, 2012
1 parent 88d2916 commit fc028de33b17528d1bf2313018e185cbe0c66886
@@ -23,20 +23,19 @@ - (void)viewDidLoad {
#pragma mark - SYPaginatorViewDataSource
-- (NSUInteger)numberOfPagesForPaginatorView:(SYPaginatorView *)paginator {
+- (NSUInteger)numberOfPagesForPaginatorView:(SYPaginatorView *)paginatorView {
return 99999;
}
-
-- (UIView *)paginatorView:(SYPaginatorView *)paginator viewForPage:(NSUInteger)page {
+- (SYPageView *)paginatorView:(SYPaginatorView *)paginatorView viewForPageAtIndex:(NSUInteger)pageIndex {
static NSString *identifier = @"identifier";
- PEPageView *view = [paginator dequeueReusableViewWithIdentifier:identifier];
+ PEPageView *view = (PEPageView *)[paginatorView dequeueReusablePageWithIdentifier:identifier];
if (!view) {
view = [[PEPageView alloc] initWithReuseIdentifier:identifier];
}
- view.textLabel.text = [NSString stringWithFormat:@"Page %i of %i", page + 1, paginator.numberOfPages];
+ view.textLabel.text = [NSString stringWithFormat:@"Page %i of %i", pageIndex + 1, paginatorView.numberOfPages];
return view;
}
@@ -15,6 +15,7 @@
B2C4DF96150962AD00ABF21F /* PEAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = B2C4DF90150962AD00ABF21F /* PEAppDelegate.m */; };
B2C4DF97150962AD00ABF21F /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = B2C4DF92150962AD00ABF21F /* main.m */; };
B2C4DFA4150962C100ABF21F /* libSYPaginator.a in Frameworks */ = {isa = PBXBuildFile; fileRef = B2C4DFA1150962B000ABF21F /* libSYPaginator.a */; };
+ B2D1962C15192AF0006BB5AD /* SYPaginatorResources.bundle in Resources */ = {isa = PBXBuildFile; fileRef = B2D1962815192ADE006BB5AD /* SYPaginatorResources.bundle */; };
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
@@ -32,6 +33,20 @@
remoteGlobalIDString = B2C4DF521509621B00ABF21F;
remoteInfo = SYPaginator;
};
+ B2D1962715192ADE006BB5AD /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = B2C4DF99150962AF00ABF21F /* SYPaginator.xcodeproj */;
+ proxyType = 2;
+ remoteGlobalIDString = B2D19608151928EB006BB5AD;
+ remoteInfo = SYPaginatorResources;
+ };
+ B2D1962A15192AE7006BB5AD /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = B2C4DF99150962AF00ABF21F /* SYPaginator.xcodeproj */;
+ proxyType = 1;
+ remoteGlobalIDString = B2D19607151928EB006BB5AD;
+ remoteInfo = SYPaginatorResources;
+ };
/* End PBXContainerItemProxy section */
/* Begin PBXFileReference section */
@@ -130,6 +145,7 @@
isa = PBXGroup;
children = (
B2C4DFA1150962B000ABF21F /* libSYPaginator.a */,
+ B2D1962815192ADE006BB5AD /* SYPaginatorResources.bundle */,
);
name = Products;
sourceTree = "<group>";
@@ -148,6 +164,7 @@
buildRules = (
);
dependencies = (
+ B2D1962B15192AE7006BB5AD /* PBXTargetDependency */,
B2C4DFA3150962BD00ABF21F /* PBXTargetDependency */,
);
name = "Paginator Example";
@@ -196,13 +213,21 @@
remoteRef = B2C4DFA0150962B000ABF21F /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
+ B2D1962815192ADE006BB5AD /* SYPaginatorResources.bundle */ = {
+ isa = PBXReferenceProxy;
+ fileType = wrapper.cfbundle;
+ path = SYPaginatorResources.bundle;
+ remoteRef = B2D1962715192ADE006BB5AD /* PBXContainerItemProxy */;
+ sourceTree = BUILT_PRODUCTS_DIR;
+ };
/* End PBXReferenceProxy section */
/* Begin PBXResourcesBuildPhase section */
B2C4DF6C1509622800ABF21F /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
+ B2D1962C15192AF0006BB5AD /* SYPaginatorResources.bundle in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -228,6 +253,11 @@
name = SYPaginator;
targetProxy = B2C4DFA2150962BD00ABF21F /* PBXContainerItemProxy */;
};
+ B2D1962B15192AE7006BB5AD /* PBXTargetDependency */ = {
+ isa = PBXTargetDependency;
+ name = SYPaginatorResources;
+ targetProxy = B2D1962A15192AE7006BB5AD /* PBXContainerItemProxy */;
+ };
/* End PBXTargetDependency section */
/* Begin XCBuildConfiguration section */
@@ -0,0 +1,46 @@
+<?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>CFBundleDevelopmentRegion</key>
+ <string>English</string>
+ <key>CFBundleExecutable</key>
+ <string>${EXECUTABLE_NAME}</string>
+ <key>CFBundleIconFile</key>
+ <string></string>
+ <key>CFBundleIdentifier</key>
+ <string>syntheticcorp.${PRODUCT_NAME:rfc1034identifier}</string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundleName</key>
+ <string>${PRODUCT_NAME}</string>
+ <key>CFBundlePackageType</key>
+ <string>BNDL</string>
+ <key>CFBundleShortVersionString</key>
+ <string>1.0</string>
+ <key>CFBundleSignature</key>
+ <string>????</string>
+ <key>CFBundleVersion</key>
+ <string>1</string>
+ <key>CFPlugInDynamicRegisterFunction</key>
+ <string></string>
+ <key>CFPlugInDynamicRegistration</key>
+ <string>NO</string>
+ <key>CFPlugInFactories</key>
+ <dict>
+ <key>00000000-0000-0000-0000-000000000000</key>
+ <string>MyFactoryFunction</string>
+ </dict>
+ <key>CFPlugInTypes</key>
+ <dict>
+ <key>00000000-0000-0000-0000-000000000000</key>
+ <array>
+ <string>00000000-0000-0000-0000-000000000000</string>
+ </array>
+ </dict>
+ <key>CFPlugInUnloadFunction</key>
+ <string></string>
+ <key>NSHumanReadableCopyright</key>
+ <string>Copyright © 2012 Synthetic. All rights reserved.</string>
+</dict>
+</plist>
@@ -0,0 +1,9 @@
+//
+// SYPaginator.strings
+// SYPaginator
+//
+// Created by Sam Soffes on 3/20/12.
+// Copyright (c) 2011 Synthetic. All rights reserved.
+//
+
+"PAGE_OF_TOTAL" = "%1$@ of %2$@"; // Example: "3 of 7" indicating page 3 is being displayed out of 7 pages
@@ -18,6 +18,10 @@
B2C4DFB11509631500ABF21F /* SYPaginatorViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = B2C4DFAC1509631500ABF21F /* SYPaginatorViewController.m */; };
B2D195FA1518FA41006BB5AD /* SYPageControl.h in Headers */ = {isa = PBXBuildFile; fileRef = B2D195F81518FA41006BB5AD /* SYPageControl.h */; };
B2D195FB1518FA41006BB5AD /* SYPageControl.m in Sources */ = {isa = PBXBuildFile; fileRef = B2D195F91518FA41006BB5AD /* SYPageControl.m */; };
+ B2D1960215192830006BB5AD /* NSBundle+SYPaginator.h in Headers */ = {isa = PBXBuildFile; fileRef = B2D1960015192830006BB5AD /* NSBundle+SYPaginator.h */; };
+ B2D1960315192830006BB5AD /* NSBundle+SYPaginator.m in Sources */ = {isa = PBXBuildFile; fileRef = B2D1960115192830006BB5AD /* NSBundle+SYPaginator.m */; };
+ B2D1960A151928EB006BB5AD /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B2D19609151928EB006BB5AD /* CoreFoundation.framework */; };
+ B2D196151519292F006BB5AD /* SYPaginator.strings in Resources */ = {isa = PBXBuildFile; fileRef = B2D195FE1519269D006BB5AD /* SYPaginator.strings */; };
/* End PBXBuildFile section */
/* Begin PBXFileReference section */
@@ -34,6 +38,12 @@
B2C4DFAC1509631500ABF21F /* SYPaginatorViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SYPaginatorViewController.m; sourceTree = "<group>"; };
B2D195F81518FA41006BB5AD /* SYPageControl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SYPageControl.h; sourceTree = "<group>"; };
B2D195F91518FA41006BB5AD /* SYPageControl.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SYPageControl.m; sourceTree = "<group>"; };
+ B2D195FF1519269D006BB5AD /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = Resources/en.lproj/SYPaginator.strings; sourceTree = SOURCE_ROOT; };
+ B2D1960015192830006BB5AD /* NSBundle+SYPaginator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSBundle+SYPaginator.h"; sourceTree = "<group>"; };
+ B2D1960115192830006BB5AD /* NSBundle+SYPaginator.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSBundle+SYPaginator.m"; sourceTree = "<group>"; };
+ B2D19608151928EB006BB5AD /* SYPaginatorResources.bundle */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = SYPaginatorResources.bundle; sourceTree = BUILT_PRODUCTS_DIR; };
+ B2D19609151928EB006BB5AD /* CoreFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreFoundation.framework; path = System/Library/Frameworks/CoreFoundation.framework; sourceTree = SDKROOT; };
+ B2D1961C15192988006BB5AD /* SYPaginatorResources-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "SYPaginatorResources-Info.plist"; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
@@ -45,13 +55,22 @@
);
runOnlyForDeploymentPostprocessing = 0;
};
+ B2D19605151928EB006BB5AD /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ B2D1960A151928EB006BB5AD /* CoreFoundation.framework in Frameworks */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
B2C4DF481509621B00ABF21F = {
isa = PBXGroup;
children = (
B2C4DFA81509631500ABF21F /* SYPaginator */,
+ B2D195FD1519267D006BB5AD /* Resources */,
B2C4DF551509621B00ABF21F /* Frameworks */,
B2C4DF541509621B00ABF21F /* Products */,
);
@@ -61,6 +80,7 @@
isa = PBXGroup;
children = (
B2C4DF531509621B00ABF21F /* libSYPaginator.a */,
+ B2D19608151928EB006BB5AD /* SYPaginatorResources.bundle */,
);
name = Products;
sourceTree = "<group>";
@@ -69,6 +89,7 @@
isa = PBXGroup;
children = (
B2C4DF561509621B00ABF21F /* Foundation.framework */,
+ B2D19609151928EB006BB5AD /* CoreFoundation.framework */,
);
name = Frameworks;
sourceTree = "<group>";
@@ -87,7 +108,19 @@
B275DFF21509788C00D6E7C1 /* SYPaginatorScrollView.m */,
B2D195F81518FA41006BB5AD /* SYPageControl.h */,
B2D195F91518FA41006BB5AD /* SYPageControl.m */,
+ B2D1960015192830006BB5AD /* NSBundle+SYPaginator.h */,
+ B2D1960115192830006BB5AD /* NSBundle+SYPaginator.m */,
+ );
+ path = SYPaginator;
+ sourceTree = "<group>";
+ };
+ B2D195FD1519267D006BB5AD /* Resources */ = {
+ isa = PBXGroup;
+ children = (
+ B2D1961C15192988006BB5AD /* SYPaginatorResources-Info.plist */,
+ B2D195FE1519269D006BB5AD /* SYPaginator.strings */,
);
+ name = Resources;
path = SYPaginator;
sourceTree = "<group>";
};
@@ -103,6 +136,7 @@
B275DFEF1509783500D6E7C1 /* SYPageView.h in Headers */,
B275DFF31509788C00D6E7C1 /* SYPaginatorScrollView.h in Headers */,
B2D195FA1518FA41006BB5AD /* SYPageControl.h in Headers */,
+ B2D1960215192830006BB5AD /* NSBundle+SYPaginator.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -126,6 +160,23 @@
productReference = B2C4DF531509621B00ABF21F /* libSYPaginator.a */;
productType = "com.apple.product-type.library.static";
};
+ B2D19607151928EB006BB5AD /* SYPaginatorResources */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = B2D19612151928EB006BB5AD /* Build configuration list for PBXNativeTarget "SYPaginatorResources" */;
+ buildPhases = (
+ B2D19604151928EB006BB5AD /* Sources */,
+ B2D19605151928EB006BB5AD /* Frameworks */,
+ B2D19606151928EB006BB5AD /* Resources */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ );
+ name = SYPaginatorResources;
+ productName = SYPaginatorResources;
+ productReference = B2D19608151928EB006BB5AD /* SYPaginatorResources.bundle */;
+ productType = "com.apple.product-type.bundle";
+ };
/* End PBXNativeTarget section */
/* Begin PBXProject section */
@@ -148,10 +199,22 @@
projectRoot = "";
targets = (
B2C4DF521509621B00ABF21F /* SYPaginator */,
+ B2D19607151928EB006BB5AD /* SYPaginatorResources */,
);
};
/* End PBXProject section */
+/* Begin PBXResourcesBuildPhase section */
+ B2D19606151928EB006BB5AD /* Resources */ = {
+ isa = PBXResourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ B2D196151519292F006BB5AD /* SYPaginator.strings in Resources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXResourcesBuildPhase section */
+
/* Begin PBXSourcesBuildPhase section */
B2C4DF4F1509621B00ABF21F /* Sources */ = {
isa = PBXSourcesBuildPhase;
@@ -162,11 +225,30 @@
B275DFF01509783500D6E7C1 /* SYPageView.m in Sources */,
B275DFF41509788C00D6E7C1 /* SYPaginatorScrollView.m in Sources */,
B2D195FB1518FA41006BB5AD /* SYPageControl.m in Sources */,
+ B2D1960315192830006BB5AD /* NSBundle+SYPaginator.m in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ B2D19604151928EB006BB5AD /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
+/* Begin PBXVariantGroup section */
+ B2D195FE1519269D006BB5AD /* SYPaginator.strings */ = {
+ isa = PBXVariantGroup;
+ children = (
+ B2D195FF1519269D006BB5AD /* en */,
+ );
+ name = SYPaginator.strings;
+ sourceTree = "<group>";
+ };
+/* End PBXVariantGroup section */
+
/* Begin XCBuildConfiguration section */
B2C4DF5E1509621B00ABF21F /* Debug */ = {
isa = XCBuildConfiguration;
@@ -242,6 +324,38 @@
};
name = Release;
};
+ B2D19613151928EB006BB5AD /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ARCHS = "$(ARCHS_STANDARD_64_BIT)";
+ GCC_ENABLE_OBJC_EXCEPTIONS = YES;
+ GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+ INFOPLIST_FILE = "Resources/SYPaginatorResources-Info.plist";
+ INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Bundles";
+ MACOSX_DEPLOYMENT_TARGET = 10.7;
+ ONLY_ACTIVE_ARCH = YES;
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ SDKROOT = iphoneos;
+ WRAPPER_EXTENSION = bundle;
+ };
+ name = Debug;
+ };
+ B2D19614151928EB006BB5AD /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ARCHS = "$(ARCHS_STANDARD_64_BIT)";
+ DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
+ GCC_ENABLE_OBJC_EXCEPTIONS = YES;
+ GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+ INFOPLIST_FILE = "Resources/SYPaginatorResources-Info.plist";
+ INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Bundles";
+ MACOSX_DEPLOYMENT_TARGET = 10.7;
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ SDKROOT = iphoneos;
+ WRAPPER_EXTENSION = bundle;
+ };
+ name = Release;
+ };
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
@@ -263,6 +377,14 @@
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
+ B2D19612151928EB006BB5AD /* Build configuration list for PBXNativeTarget "SYPaginatorResources" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ B2D19613151928EB006BB5AD /* Debug */,
+ B2D19614151928EB006BB5AD /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ };
/* End XCConfigurationList section */
};
rootObject = B2C4DF4A1509621B00ABF21F /* Project object */;
Oops, something went wrong.

0 comments on commit fc028de

Please sign in to comment.