How to put a UIImage in an AnyObject array?

In Xcode 6 beta 7, I cannot put UIImage in AnyObject Array:

var objects = [pizzaImage.image, title, ingredients.text] 

error: Cannot convert the expression type 'Array' to type 'ArrayLiteralConvertible

no problem in beta 6

EDIT is the complete code, tried everything but no luck:

 var objects = [pizzaImage.image!, title, ingredients.text!]] var act = UIActivityViewController(activityItems: objects, applicationActivities: nil) self.presentViewController(act, animated: true, completion: nil) 
+1
source share
1 answer

It is decided:

 var objects = [pizzaImage.image!, title!, ingredients.text]] var act = UIActivityViewController(activityItems: objects, applicationActivities: nil) self.presentViewController(act, animated: true, completion: nil) 

but if you enter only the title and text field, then complier has nothing to complain about:

 var objects = [title, ingredients.text] 

why?? it's really unclear ...

+1
source

Source: https://habr.com/ru/post/976187/


All Articles