] let firstFiveBricks = bricks.prefix(5) let pdfData = createBrickPDF(firstFiveBricks) Cannot convert value of type ‘ArraySlice<Brick>’ to expected argument type ‘[Brick]’ !
] let firstFiveBricks = bricks.prefix(5) let pdfData = createBrickPDF(firstFiveBricks) Cannot convert value of type ‘ArraySlice<Brick>’ to expected argument type ‘[Brick]’ !
] let firstFiveBricks = bricks.prefix(5) let pdfData = createBrickPDF(firstFiveBricks) Cannot convert value of type ‘ArraySlice<Brick>’ to expected argument type ‘[Brick]’ !
createBrickPDF<S: Sequence>(_ bricks: S) -> Data where S.Iterator.Element == Brick { let result = NSMutableData() // prepare PDF context let renderer = BrickPDFRenderer(count: bricks.count) for brick in bricks { // generate PDF data } return result as Data }
Brick { let result = NSMutableData() // prepare PDF context let renderer = BrickPDFRenderer(count: bricks.count) for brick in bricks { // generate PDF data } return result as Data }