I crack my way through Swift. I like it, but I think that some things may be too simple, and I doubt it is right.
I am converting a project from Objective-C. In the project, I have a string property that is used in the method. In Objective-C, I did the following to initialize and highlight an object. After initializing and highlighting, I set it to an empty string.
NSMutableString *tempString = [[NSMutableString alloc] init]; self.currentParsedCharacterData = tempString; [currentParsedCharacterData setString: @""];
In Swift, I typed the following. Is it really that simple or am I missing something?
self.currentParsedCharacterData = ""
I think I want to do the following, but I'm not sure if this is necessary.
var tempString : String = "" self.currentParsedCharacterData = tempString
Take care
John
source share