Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot overload .generate() with all parameters #50

Closed
cdeck95 opened this issue Aug 29, 2018 · 2 comments
Closed

Cannot overload .generate() with all parameters #50

cdeck95 opened this issue Aug 29, 2018 · 2 comments

Comments

@cdeck95
Copy link

cdeck95 commented Aug 29, 2018

Xcode Version: 9.4.1
Swift Version: 4.1
Podfile depenency: pod "EFQRCode", '~> 4.2.2'

Problem: Unable to overload the code below with the following parameters:

  1. Magnification
  2. Mode
  3. InputCorrectionLevel
  4. Icon
  5. Transparency
  6. Binariazation
  7. Point Shape

Error given when trying to overload the generate method:

Incorrect argument label in call (have 'content:mode:foregroundColor:watermark:', expected 'content:size:foregroundColor:watermark:')

Code used:

if let tryImage = EFQRCode.generate(
            content: qrCodeString,
           // backgroundColor: Color.coral.value.cgColor,
            mode: EFQRCodeMode.binarization
            foregroundColor: Color.bondiBlue.value.cgColor,
            watermark: UIImage(named: "Logo-1.png")?.toCGImage()
            ) {
            print("Create QRCode image success: \(tryImage)")
            return UIImage(cgImage: tryImage)
        } else {
            print("Create QRCode image failed!")
            return nil
        }

Can you overload the generate method with more than just the base params? I also tried using the second option to initialize the code generator but got a different error. I do not want to throw multiple issues into one post but I felt that it was important to note why I am trying to overload the method rather than trying the other way.

@junweimah
Copy link

hi
have you solved this?

seems like the generator function doesn't have icon has param

@EyreFree
Copy link
Member

EyreFree commented Nov 14, 2018

@cdeck95 @junweimah

EFQRCode 4.4.2 may have corrected this problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants