attribute:atIndex:effectiveRange: is a getter method — it doesn't set/attach/add attributes, it reports to you what the attribute value is at a particular index in the string. As such, the effectiveRange parameter is an "out-pointer": you pass in a pointer to an NSRange, and the method fills in data at that pointer when it returns. In Swift (and within an NSAttributedString extension) you can call it like this:
var range = NSRange() let value = self.attribute(self.string, atIndex: 0, effectiveRange: &range)
However, that's not what you want. You seem to be wanting to set an attribute on the string, not get the value of an existing attribute. For that, use NSMutableAttributedString and the addAttribute:value:range: method, or (especially if you're applying attributes to an entire string) NSAttributedString's init(string:attributes:) constructor.