Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-15680] iOS: Need to expose the NSTextEffectLetterpressStyle constant for AttributedString

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2013-11-08T19:07:53.000+0000
Affected Version/sRelease 3.2.0
Fix Version/s2013 Sprint 23, 2013 Sprint 23 API, Release 3.2.0
ComponentsiOS
Labelstriage
ReporterBenjamin Hatfield
AssigneePedro Enrique
Created2013-11-06T23:09:41.000+0000
Updated2013-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

Comments

  1. Pedro Enrique 2013-11-06

    PR: https://github.com/appcelerator/titanium_mobile/pull/4923
  2. Pedro Enrique 2013-11-06

    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);
       
  3. Wilson Luu 2013-11-11

    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)

JSON Source