YPImagePicker icon indicating copy to clipboard operation
YPImagePicker copied to clipboard

Cannot infer contextual base in reference to member 'ypSystemBackground'

Open gnovakovski opened this issue 3 years ago • 4 comments

Describe the bug A clear and concise description of what the bug is. I just imported the YPImagePicker with Pods, and i receiving the compiling error: Cannot infer contextual base in reference to member 'ypSystemBackground'. This happens inside the lib To Reproduce Steps to reproduce the behavior: 1 - added YPImagePicker to pods 2 - pod deintegrate 3 - pod install 4 - add framework YPImagePicker on target 4 - Try to build 5 - Error in build Note: i tried via package dependencies and the same error happen

Expected behavior No error should happen

Screenshots If applicable, add screenshots to help explain your problem. Screen Shot 2021-11-09 at 11 14 13

Environment (please complete the following information): 1 - Xcode 12.4 2 - IOS 14.4

  • Device: Iphone 12[Simulator]

  • OS: 11.6

  • Xcode Version: 12.4

  • Swift Version: 5

  • Cocoapods

  • Package Dependencies

gnovakovski avatar Nov 09 '21 14:11 gnovakovski

https://github.com/apple/swift-evolution/blob/main/proposals/0287-implicit-member-chains.md This might help

Never9002 avatar Jan 27 '22 07:01 Never9002

Hello, I was wondering if you could solve the issue?

AhmedAbouelkher avatar Feb 07 '22 23:02 AhmedAbouelkher

As described in the linked page, this syntax requires Swift 5.4 or later, available in XCode 12.5 or later.

If you cannot upgrade XCode, you can alternatively change the line to:

    public var cropOverlayColor: UIColor = UIColor.ypSystemBackground.withAlphaComponent(0.4)

skopf avatar Mar 03 '22 08:03 skopf

As described in the linked page, this syntax requires Swift 5.4 or later, available in XCode 12.5 or later.

If you cannot upgrade XCode, you can alternatively change the line to:

    public var cropOverlayColor: UIColor = UIColor.ypSystemBackground.withAlphaComponent(0.4)

For others to see: I can confirm that this was the issue; was running an outdated version of Xcode (12.4). Instead waiting to install a new version of XCode, I just "unlocked" the class and updated the lib to your suggestion. Built and ran perfectly.

epitosoft avatar Mar 15 '22 07:03 epitosoft