 
     // MARK: with
 
+    /// Returns a copy with the origin value changed.
     public func with(# origin: CGPoint) -> CGRect {
         return CGRect(origin: origin, size: size)
     }
+    /// Returns a copy with the x and y values changed.
     public func with(# x: CGFloat, y: CGFloat) -> CGRect {
         return with(origin: CGPoint(x: x, y: y))
     }
+    /// Returns a copy with the x value changed.
     public func with(# x: CGFloat) -> CGRect {
         return with(x: x, y: y)
     }
+    /// Returns a copy with the y value changed.
     public func with(# y: CGFloat) -> CGRect {
         return with(x: x, y: y)
     }
 
+    /// Returns a copy with the size value changed.
     public func with(# size: CGSize) -> CGRect {
         return CGRect(origin: origin, size: size)
     }
+    /// Returns a copy with the width and height values changed.
     public func with(# width: CGFloat, height: CGFloat) -> CGRect {
         return with(size: CGSize(width: width, height: height))
     }
+    /// Returns a copy with the width value changed.
     public func with(# width: CGFloat) -> CGRect {
         return with(width: width, height: height)
     }
+    /// Returns a copy with the height value changed.
     public func with(# height: CGFloat) -> CGRect {
         return with(width: width, height: height)
     }
 
+    /// Returns a copy with the x and width values changed.
     public func with(# x: CGFloat, width: CGFloat) -> CGRect {
         return CGRect(origin: CGPoint(x: x, y: y), size: CGSize(width: width, height: height))
     }
+    /// Returns a copy with the y and height values changed.
     public func with(# y: CGFloat, height: CGFloat) -> CGRect {
         return CGRect(origin: CGPoint(x: x, y: y), size: CGSize(width: width, height: height))
     }
 
     // MARK: offset
 
+    /// Returns a copy with the x and y values offset.
     public func rectByOffsetting(dx: CGFloat, _ dy: CGFloat) -> CGRect {
         return with(x: x + dx, y: y + dy)
     }
+    /// Returns a copy with the x value values offset.
     public func rectByOffsetting(# dx: CGFloat) -> CGRect {
         return with(x: x + dx)
     }
+    /// Returns a copy with the y value values offset.
     public func rectByOffsetting(# dy: CGFloat) -> CGRect {
         return with(y: y + dy)
     }
+    /// Returns a copy with the x and y values offset.
     public func rectByOffsetting(by: CGSize) -> CGRect {
         return with(x: x + by.width, y: y + by.height)
     }
 
+    /// Modifies the x and y values by offsetting.
     public mutating func offset(dx: CGFloat, _ dy: CGFloat) {
         offset(dx: dx, dy: dy)
     }
+    /// Modifies the x value values by offsetting.
     public mutating func offset(dx: CGFloat = 0) {
         x += dx
     }
+    /// Modifies the y value values by offsetting.
     public mutating func offset(dy: CGFloat = 0) {
         y += dy
     }
+    /// Modifies the x and y values by offsetting.
     public mutating func offset(by: CGSize) {
         offset(dx: by.width, dy: by.height)
     }
 
     // MARK: inset
 
+    /// Returns a copy inset on all edges by the same value.
     public func rectByInsetting(by: CGFloat) -> CGRect {
         return rectByInsetting(dx: by, dy: by)
     }
 
+    /// Returns a copy inset on the left and right edges.
     public func rectByInsetting(# dx: CGFloat) -> CGRect {
         return with(x: x + dx, width: width - dx * 2)
     }
+    /// Returns a copy inset on the top and bottom edges.
     public func rectByInsetting(# dy: CGFloat) -> CGRect {
         return with(y: y + dy, height: height - dy * 2)
     }
 
+    /// Returns a copy inset on all edges by different values.
     public func rectByInsetting(minX: CGFloat = 0, minY: CGFloat = 0, maxX: CGFloat = 0, maxY: CGFloat = 0) -> CGRect {
         return CGRect(x: x + minX, y: y + minY, width: width - minX - maxX, height: height - minY - maxY)
     }
 
+    /// Returns a copy inset on all edges by different values.
     public func rectByInsetting(top: CGFloat = 0, left: CGFloat = 0, bottom: CGFloat = 0, right: CGFloat = 0) -> CGRect {
         #if os(iOS)
             return CGRect(x: x + left, y: y + top, width: width - right - left, height: height - top - bottom)

        }
    }

    public mutating func setSizeCentered(size: CGSize) {
        self = rectByCentering(size)
    }

    public mutating func setSizeCentered(size: CGSize, alignTo edge: CGRectEdge) {
        self = rectByCentering(size, alignTo: edge)
    }

    public mutating func setSizeAligned(size: CGSize, corner e1: CGRectEdge, _ e2: CGRectEdge) {
        self = rectByAligning(size, corner: e1, e2)
    }


    // MARK: points

    /// Accesses the point at the top left corner.
    public var topLeft: CGPoint {
        get {return CGPoint(x: left, y: top)}
        set {left = newValue.x; top = newValue.y}
    }
    /// Accesses the point at the middle of the top edge.
    public var topCenter: CGPoint {
        get {return CGPoint(x: centerX, y: top)}
        set {centerX = newValue.x; top = newValue.y}
    }
    /// Accesses the point at the top right corner.
    public var topRight: CGPoint {
        get {return CGPoint(x: right, y: top)}
        set {right = newValue.x; top = newValue.y}
    }

    /// Accesses the point at the middle of the left edge.
    public var centerLeft: CGPoint {
        get {return CGPoint(x: left, y: centerY)}
        set {left = newValue.x; centerY = newValue.y}
    }
    /// Accesses the point at the center.
    public var center: CGPoint {
        get {return CGPoint(x: centerX, y: centerY)}
        set {centerX = newValue.x; centerY = newValue.y}
    }
    /// Accesses the point at the middle of the right edge.
    public var centerRight: CGPoint {
        get {return CGPoint(x: right, y: centerY)}
        set {right = newValue.x; centerY = newValue.y}
    }

    /// Accesses the point at the bottom left corner.
    public var bottomLeft: CGPoint {
        get {return CGPoint(x: left, y: bottom)}
        set {left = newValue.x; bottom = newValue.y}
    }
    /// Accesses the point at the middle of the bottom edge.
    public var bottomCenter: CGPoint {
        get {return CGPoint(x: centerX, y: bottom)}
        set {centerX = newValue.x; bottom = newValue.y}
    }
    /// Accesses the point at the bottom right corner.
    public var bottomRight: CGPoint {
        get {return CGPoint(x: right, y: bottom)}
        set {right = newValue.x; bottom = newValue.y}
