Ending strings with ellipsis on ios



I have found a very useful routine that allows to end long strings with ellipsis by just specifying font size and available space.
It is called getStringWithEllipsisJni(const char* text, float width, float fontSize) and declared in Java_org_cocos2dx_lib_Cocos2dxBitmap.h

Are there any iOS equivalent exist?
Or any alternatives that can calculate how much space string will occupy on screen when using default system font aka:
auto text = cocos2d::ui::Text::create("sample text", "", 16);

Thank you in advance.