Roman Gorbatko
Roman Gorbatko

Reputation: 43

How to copy UIImageView?

I need to get a copy of UIImageView (essentially the same UIImageView only in a different variable and the lack of a link between them) I tried using the copy() method, but have crash

my code

 let copyImageView = imageView?.copy() as? UIImageView

My crash

    unrecognized selector sent to instance 0x12ef77520
2022-07-24 11:48:28.270344+0400 Pixchange[766:98265] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UIImageView copyWithZone:]: unrecognized selector sent to instance 0x12ef77520'
*** First throw call stack:
(0x1cfcf9288 0x1e89f3744 0x1cfdd6fc4 0x1d304df5c 0x1cfc8de98 0x1cfc8cf70 0x102ecf408 0x102ed065c 0x102ed0de0 0x102ed0e80 0x1d22b7c58 0x1d22812c8 0x1d224a7c8 0x1d2283610 0x1d223c1e4 0x1d226f594 0x1d227c854 0x1d242a288 0x1d2250150 0x1d2244ea8 0x1d224a428 0x1cfd1b414 0x1cfd2c1a0 0x1cfc65694 0x1cfc6b05c 0x1cfc7ebc8 0x1ebdb2374 0x1d25ee648 0x1d236fd90 0x102d08304 0x105e0dce4)

Upvotes: 0

Views: 96

Answers (0)

Related Questions