apptekstudios / ASCollectionView

A SwiftUI collection view with support for custom layouts, preloading, and more.
MIT License
1.35k stars 161 forks source link

Instance method 'background(_:alignment:)' requires that 'UIColor' conform to 'View' #216

Closed valnenov closed 3 years ago

valnenov commented 3 years ago

Describe the bug I imported the Demo code in my Swift project. Was able to get everything to work except for some minor errors. For instance: In the TableViewDragAndDropScreen.swift file I get the error: Instance method 'background(_:alignment:)' requires that 'UIColor' conform to 'View' in code segment like this:

Text("some text") .padding().background(Color.red)

To Reproduce I have set the Target to iOS: 13.2 Using Swift 5

Expected behaviour I expected this code to compile the same error-free way as in the Demo project

Screenshots

Screen Shot 2021-07-07 at 9 36 50 AM

Xcode Version: Version 12.5 (12E262)

Simulator, Device, Both? Both

valnenov commented 3 years ago

Problem solved per answer 3 in https://stackoverflow.com/questions/65510419/why-am-i-getting-instance-method-background-alignment-requires-that-uico