+ /* Index Collation {{{ */
+ if (Class $UILocalizedIndexedCollation = objc_getClass("UILocalizedIndexedCollation")) {
+ NSBundle *bundle([NSBundle bundleForClass:$UILocalizedIndexedCollation]);
+ NSString *path([bundle pathForResource:@"UITableViewLocalizedSectionIndex" ofType:@"plist"]);
+ //path = @"/System/Library/Frameworks/UIKit.framework/.lproj/UITableViewLocalizedSectionIndex.plist";
+ NSDictionary *dictionary([NSDictionary dictionaryWithContentsOfFile:path]);
+ _H<UILocalizedIndexedCollation> collation([[[UILocalizedIndexedCollation alloc] initWithDictionary:dictionary] autorelease]);
+
+ CollationLocale_ = MSHookIvar<NSLocale *>(collation, "_locale");
+
+ CollationThumbs_ = [collation sectionIndexTitles];
+ for (size_t index(0), end([CollationThumbs_ count]); index != end; ++index)
+ CollationOffset_.push_back([collation sectionForSectionIndexTitleAtIndex:index]);
+
+ CollationTitles_ = [collation sectionTitles];
+ CollationStarts_ = MSHookIvar<NSArray *>(collation, "_sectionStartStrings");
+
+ NSString *&transform(MSHookIvar<NSString *>(collation, "_transform"));
+ if (&transform != NULL && transform != nil) {
+ /*if ([collation respondsToSelector:@selector(transformedCollationStringForString:)])
+ CollationModify_ = [=](NSString *value) { return [collation transformedCollationStringForString:value]; };*/
+ const UChar *uid(reinterpret_cast<const UChar *>([transform cStringUsingEncoding:NSUnicodeStringEncoding]));
+ UErrorCode code(U_ZERO_ERROR);
+ CollationTransl_ = utrans_openU(uid, -1, UTRANS_FORWARD, NULL, 0, NULL, &code);
+ if (!U_SUCCESS(code))
+ NSLog(@"%s", u_errorName(code));
+ }
+ } else {
+ CollationLocale_ = [[[NSLocale alloc] initWithLocaleIdentifier:@"en@collation=dictionary"] autorelease];
+
+ CollationThumbs_ = [NSArray arrayWithObjects:@"A",@"B",@"C",@"D",@"E",@"F",@"G",@"H",@"I",@"J",@"K",@"L",@"M",@"N",@"O",@"P",@"Q",@"R",@"S",@"T",@"U",@"V",@"W",@"X",@"Y",@"Z",@"#",nil];
+ for (NSInteger offset(0); offset != 28; ++offset)
+ CollationOffset_.push_back(offset);
+
+ CollationTitles_ = [NSArray arrayWithObjects:@"A",@"B",@"C",@"D",@"E",@"F",@"G",@"H",@"I",@"J",@"K",@"L",@"M",@"N",@"O",@"P",@"Q",@"R",@"S",@"T",@"U",@"V",@"W",@"X",@"Y",@"Z",@"#",nil];
+ CollationStarts_ = [NSArray arrayWithObjects:@"a",@"b",@"c",@"d",@"e",@"f",@"g",@"h",@"i",@"j",@"k",@"l",@"m",@"n",@"o",@"p",@"q",@"r",@"s",@"t",@"u",@"v",@"w",@"x",@"y",@"z",@"ʒ",nil];
+ }
+ /* }}} */