What's the UITableView index magnifying glass character?

前端 未结 11 1813
醉话见心
醉话见心 2020-12-12 10:09

In Apple\'s iPhone apps (like Contacts), they have a nice magnifying glass icon at the top of the table view index. Since the table view index API is character-based, I assu

11条回答
  •  隐瞒了意图╮
    2020-12-12 10:54

    There already is an existing UTF codepoint for the magnifying glass. It is U+1F50D. However it's slightly tricky getting Xcode to recognize this number. According to Apple's String Programming Guide the UTF bits should be split into two UTF-16 surrogate pairs (0xD83D, 0xDD0D). Check with this surrogate pair calculator for reference.

    An NSString instance with the contents of the surrogate pair can be obtained with:

    [NSString stringWithFormat:@"%C%C", 0xD83D, 0xDD0D];
    

提交回复
热议问题