iPhone 5 crashes sometimes while charging

Before time my iphone 5 camera crashed once or twice and it just crushed again. I click on the icon, the camera starts, then those purple lines comes up and the screen goes black with purple lines then it comes back to normal.
Also just before that for a first time my iphone restarted for no reason. I just unlocked it and it went the white screen with the black apple logo.It never happened before...
I've noticed its doing those crushes sometimes when I am charging it. It's not happening everytime, but sometimes it happens. Is it just my iphone or its ios7 bug?
I cant take it to the genius bar, cause we don't have apple stores in Bulgaria and I have babied this phone so much since the day I bought it that I prefer not to send it in a box to apple, cause I am not sure how it will look when I get it back.
Sounds like it's software I recommend you backup and reinstall


Sent from my iPhone 5s Gold 64GB
Sounds like it's software I recommend you backup and reinstall

Oh I feel kinda relieved. If it's software I may try to fix it and may not cause its not happening often and with the new updates it will go off right? I am worried, that it might be hardware cause its happening only when its charging and I think I might be puling the cable too much so the jack is causing problems to the hardware or even have defective charging port and if its so I will have to deal with myself and send it to apple,cause I have like 6 months warranty left.
Sounds like it's software I recommend you backup and reinstall


Sent from my iPhone 5s Gold 64GB

I did that and today it happened again - same purple lines, but it didn't refresh the camera this time. Should I worry?

IMG_03071.jpg
20130329-195108.jpg

Original thread: https://forums.imore.com/threads/iphone-5-crashes-sometimes-while-charging.275586/