I am trying to transfer from a samsung to a new iphone 6.

as soon as i enter the code the samsung keeps asking for a new code and i am stuck at this point
Here's what Apple recommends you do....

https://support.apple.com/en-us/HT201196

Here's an iMore blog on the same topic..

How to move your photos, contacts, and more from Android to iPad and iPhone | iMore


As a side note, try restarting both devices. 🙂
You can let Move to iOS app to help you transfer data from Samsung to iPhone: https://support.apple.com/en-us/HT201196

Original thread: https://forums.imore.com/threads/i-am-trying-to-transfer-from-a-samsung-to-a-new-iphone-6.370852/