I made a Swift extension to use frames like I would on iOS but Can't compile while using it -


I created this extension in NSV so that it is easy to work with the scenes.

  import Cocoa public extension NSView {var Inverted Frame: NSRect (get {return NSRect (x: frame.origin.x, y: superview.bounds.height - frame.origin.y, width: Bounds.isize.width, height: bounds.size) .height)} set {self.frame = NSRect (x: newValue.origin.x, y: superview.bounds.height - newValue.origin.y - newValue.height, Width: newValue.width, height: newValue.height)}}}   

But whenever I try to use it, I get an error compiling time ...

  commands / applications / Xcode6- beta4.app/   

However if I computed in a class implementation Cut and paste the A variable so it works fine. P>

I'm not sure why this is something wrong with my code? Can anyone do this work?

Your property setter newValue as a method parameter, Rather than saying that, the compiler is clearly crashed. Remember that a bare set is only found in an protocol property declaration.

Comments

Popular posts from this blog

ios - Adding an SKSpriteNode to SKScene from a child SKSpriteNode -

Matlab transpose a table vector -

c# - Textbox not clickable but editable -