Also keep in mind that iPads, which I imagine are internally quite similar to iPhones in terms of circuitry and other components, are designed to work with SmartCovers that directly attach to them magnetically with enough strength that you can hold and shake them.
When people think about magnets harming electronics, they're mostly thinking about devices that depend on magnetic storage mediums like old floppy disks and computers with HDDs, not devices with solid state storage.