//
//  LayerView.swift
//  BFWControls
//
//  Created by Tom Brodhurst-Hill on 9/01/2016.
//  Copyright © 2016 BareFeetWare.
//  Free to use at your own risk, with acknowledgement to BareFeetWare.
//

import UIKit

extension UIView {
    
    var rotationDegrees: CGFloat {
        get {
            let angleInRadians = atan2(transform.b, transform.a)
            return angleInRadians * 180.0 / CGFloat(M_PI)
        }
        set {
            transform = CGAffineTransform(rotationAngle: .pi / 180.0 * newValue)
        }
    }
    
}

//
//  LayerView.swift
//  BFWControls
//
//  Created by Tom Brodhurst-Hill on 9/01/2016.
//  Copyright © 2016 BareFeetWare.
//  Free to use at your own risk, with acknowledgement to BareFeetWare.
//

import UIKit

extension UIView {
    
    var rotationDegrees: CGFloat {
        get {
            // TODO: Reverse engineer angle from transform.
            return 0.0
        }
        set {
            transform = CGAffineTransform(rotationAngle: .pi / 180.0 * newValue)
        }
    }
    
}

--- 
+++ 
@@ -13,8 +13,8 @@
     
     var rotationDegrees: CGFloat {
         get {
-            // TODO: Reverse engineer angle from transform.
-            return 0.0
+            let angleInRadians = atan2(transform.b, transform.a)
+            return angleInRadians * 180.0 / CGFloat(M_PI)
         }
         set {
             transform = CGAffineTransform(rotationAngle: .pi / 180.0 * newValue)
Fix UIView Rotation Degrees TODO

Completed UIView rotation degrees TODO.
