     //闪光灯
     var btnFlash:UIButton = UIButton()
     
+    //返回
+    var buttonBcak: UIButton = UIButton()
+    
+    //相册
+    var buttonPhone: UIButton = UIButton()
+    
     //识别码的类型
     var arrayCodeType: [String]?
     
     //是否需要识别后的当前图像
     var isNeedCodeImage = false
     
-    var delegate: YLScanViewControllerDelegate?
+    weak var delegate: YLScanViewControllerDelegate?
     
     deinit {
         print("YLScanViewController deinit")

        btnFlash.setImage(YLScanViewSetting.imageFromBundleWithName(name:  "qrcode_scan_btn_flash_nor@2x"), for:UIControlState.normal)
        btnFlash.setImage(YLScanViewSetting.imageFromBundleWithName(name:  "qrcode_scan_btn_flash_down@2x"), for:UIControlState.selected)
        btnFlash.addTarget(self, action: #selector(openOrCloseFlash(sender:)), for: UIControlEvents.touchUpInside)
        self.view.addSubview(btnFlash)
    }
    //开关闪光灯
    func openOrCloseFlash(sender:UIButton){
        scanObj?.changeTorch()
        sender.isSelected = !sender.isSelected
        
    }
    
    open func openPhotoAlbum() {

        super.viewDidLoad()
        self.view.backgroundColor = UIColor.black
        self.edgesForExtendedLayout = UIRectEdge(rawValue: 0)
        self.navigationController?.navigationBar.isHidden = true;

        // Do any additional setup after loading the view.
    }
