EFPrefix / EFQRCode

A better way to operate QR Code in Swift, support iOS, macOS, watchOS and tvOS.

Home Page:https://efprefix.github.io/EFQRCode

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cannot overload .generate() with all parameters

cdeck95 opened this issue · comments

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.

hi
have you solved this?

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

@cdeck95 @junweimah

EFQRCode 4.4.2 may have corrected this problem.