I'm trying to convert some code that works in Objective-C to Swift.  The problem I'm running into is that needsDisplayForKey/actionForKey aren't getting called the same way. As far as I can tell, the custom key values aren't getting passed in correctly.   Here is what I get when I debug it:

default value:

(String!) event = {
  core = {
    _baseAddress = Builtin.RawPointer = 0x00feee51 "onOrderIn"
    _countAndFlags = 1073741833
    _owner = Some {
      Some = (instance_type = Builtin.RawPointer = 0x01026348 @"onOrderIn")
    }
  }
}


custom value (empty string passed in):

(String!) event = {
  core = {
    _baseAddress = Builtin.RawPointer = 0x0b418f79
    _countAndFlags = 1073741833
    _owner = Some {
      Some = (instance_type = Builtin.RawPointer = 0x0b418f70 -&gt; 0x006e38f0 (void *)0x006e38c8: __NSCFString)
    }
  }
}


I'm not sure what the relevant code might be. I'll just ask - has anyone else was able to define a custom implicit animation in Swift? Is there anything I need to keep in mind when moving over from Objective C?

override class func needsDisplayForKey(key: String!) -&gt; Bool{
    if key == "angleFrom" || key == "angleTo" {
        return true;
    }
    return super.needsDisplayForKey(key)
}

override func actionForKey(event: String!) -&gt; CAAction!{
    if event == "angleFrom" || event == "angleTo" {
        return self.makeAnimationForKey(event)
    }
    return super.actionForKey(event)
}



Question: What does the Result property of a windows message mean and when and how to use it?
Answer: I depends on the message. According to the API reference it is bound to the specific message.

http://msdn.microsoft.com/en-us/library/windows/desktop/ms644950%28v=vs.85%29.aspx

E.g.:


  Return value
  
  An application returns zero if it processes this message.


http://msdn.microsoft.com/en-us/library/windows/desktop/dd145213%28v=vs.85%29.aspx 

It can be used as a flag, indicating that the message doesn't need further attendance.  

If your application handles, i.e. processes the message, a result of 0 will do.