         view.autoRemoveConstraint(flashButtonEdgeConstraint)
         
         let constraintRight = statusBarOrientation == .portrait || statusBarOrientation == .landscapeRight
-        let attribute : NSLayoutAttribute = constraintRight ? .top : .bottom
+        let attribute : NSLayoutAttribute = constraintRight ? .topMargin : .bottomMargin
         
         flashButtonEdgeConstraint = NSLayoutConstraint(
             item: flashButton,

            attributeTwo = .left
            break
        default:
            attributeOne = .bottom
            attributeTwo = .top
            break
        }
        


        switch statusBarOrientation {
        case .portrait:
            attributeOne = .topMargin
            attributeTwo = .bottomMargin
            break
        case .landscapeRight:
            attributeOne = .left
