2

I'm making a snippet to make UILabels faster. In this snippet I really just want to set the variable name once and then use it later when setting the color and background color. How can I reuse what I set in <#labelName#> so I don't have to write it for every attribute I alter?

UILabel *<#labelName#> = [[UILabel alloc] initWithFrame:CGRectMake(<#x#>, <#y#>,<#width#>, <#height#>)];
<#labelName#>.textColor = <#UIColor#>
<#labelName#>.backgroundColor = [UIColor clearColor];
jscs
  • 63,694
  • 13
  • 151
  • 195
bogen
  • 9,954
  • 9
  • 50
  • 89
  • I think it's not possible. File a proposal to bugreport.apple.com – Shmidt Mar 27 '13 at 15:45
  • 2
    Used to be possible pre-Xcode 4 -- one placeholder was allowed to be "capturing" (denoted `<#!labelName!#>`); you could write the variable name, select it, then trigger the snippet (I forget what they were called then). It would replace all `<#!labelName!#>`s with the selected text. This would also be possible with scripting support. Like Shmidt says, file a bug. – jscs Mar 27 '13 at 15:49

0 Answers0