GithubHelp home page GithubHelp logo

Comments (4)

yannickl avatar yannickl commented on July 21, 2024

Ok I'll llook at the best way to customize the overlay view in the next few day. Or if you have time, you're welcome. :)

from qrcodereader.swift.

fraserscottmorrison avatar fraserscottmorrison commented on July 21, 2024

Ive figured out how to use a custom overlay while hiding the default one

firstly, the codeReader needs to be made public

then

    self.addChildViewController(self.reader)
    self.view.addSubview(self.reader.view)
    self.reader.view.hidden = true

    // use SnapKit to add constraints to subview
    self.reader.view.snp_makeConstraints { (make) -> Void in
        make.edges.equalTo(self.view).inset(UIEdgeInsetsMake(0, 0, 0, 0))
    }

    self.reader.codeReader.previewLayer.removeFromSuperlayer()
    self.view.layer.insertSublayer(self.reader.codeReader.previewLayer, atIndex: 0)

Note, Im not showing this modally. The code is in a custom View Controller

from qrcodereader.swift.

yannickl avatar yannickl commented on July 21, 2024

If you are not using it modally I think the best solution is to create your own view. Here this is almost the same thing.

You can create the QRCodeReader object and insert the previewLayer directly.

from qrcodereader.swift.

yannickl avatar yannickl commented on July 21, 2024

With the last version the qrcodeReader property is now public. 👍

from qrcodereader.swift.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.