Login

Xcode Script to Insert Pragma Line

Type in the title of your pragma mark, select it and run this script from the scripts menu or give it a keycode.

I use this script to help me with consistency in my code.

Alter the script to make the pramga look the way you like!

Script

#!/usr/bin/ruby

var = STDIN.read.upcase
if var.size > 60
 puts "Name too large"
 exit
end

print "
//----------------------------------------
//  #{var}
//----------------------------------------
#pragma mark -
#pragma mark #{var}\n\n"

Add comment


Security code
Refresh

 

Product Categories