iOS 6 compatibility

improve iOS 6 compatibility caused by `sizeWithAttributes:` which only
available on iOS 7.