[TIMOB-15680] iOS: Need to expose the NSTextEffectLetterpressStyle constant for AttributedString
| GitHub Issue | n/a |
|---|---|
| Type | Bug |
| Priority | High |
| Status | Closed |
| Resolution | Fixed |
| Resolution Date | 2013-11-08T19:07:53.000+0000 |
| Affected Version/s | Release 3.2.0 |
| Fix Version/s | 2013 Sprint 23, 2013 Sprint 23 API, Release 3.2.0 |
| Components | iOS |
| Labels | triage |
| Reporter | Benjamin Hatfield |
| Assignee | Pedro Enrique |
| Created | 2013-11-06T23:09:41.000+0000 |
| Updated | 2013-11-11T18:42:26.000+0000 |
Description
When specifying an attribute string using the Ti.UI.iOS.ATTRIBUTE_TEXT_EFFECT type, currently we cannot use the only supported effect which is the letterpress effect that is specified with the NSTextEffectLetterpressStyle constant. This constant does not appear to be exposed in the TiSDK.
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk/System/Library/Frameworks/UIKit.framework/Headers/NSAttributedString.h
https://developer.apple.com/library/ios/documentation/uikit/reference/NSAttributedString_UIKit_Additions/Reference/Reference.html#//apple_ref/c/data/NSTextEffectLetterpressStyle
PR: https://github.com/appcelerator/titanium_mobile/pull/4923
Code to test:
var win = Ti.UI.createWindow({ backgroundColor: '#ddd', }); win.open(); var text = 'Bacon ipsum dolor sit amet fatback leberkas salami sausage tongue strip steak. Andouille drumstick meatball boudin shank flank sausage, ribeye ham venison doner bacon ham hock. Appcelerator Titanium sucks rocks! Filet mignon ham pancetta, tail salami pork chop short ribs leberkas kielbasa t-bone tri-tip bresaola. Kevin beef ribs tail hamburger andouille filet mignon bresaola ham ham hock flank meatball pork chop corned beef'; var attr = Ti.UI.iOS.createAttributedString({ text: text, attributes: [ { type: Ti.UI.iOS.ATTRIBUTE_TEXT_EFFECT, value: Ti.UI.iOS.ATTRIBUTE_LETTERPRESS_STYLE, range: [0, text.length] } ] }); var label = Ti.UI.createLabel({ left: 20, right: 20, height: Ti.UI.SIZE, backgroundColor: 'red', color: '#ccc', attributedString: attr }); win.add(label);Closing as bug as fixed. Verified ATTRIBUTE_LETTERPRESS_STYLE using the above test code. Tested on: Titanium Studio, build: 3.2.0.201311100540 SDK build: 3.2.0.v20131110134044 Xcode: 5.0.1 Device: iphone 5s (7.0.2)