Follow the below procedure to create ipa file.
Select your swiftDemo in your xcode(left-hand side as shown) Then select Product option, in which you could select Archive option.
Then a new window would open up as follow and in that window select the export option.
Then a pop up will come as below and select first option as you looking for apple store. So now follow as it say.
UPDATE -> Select the Save to ad-hoc deployment as below
if you have not sign with your apple developer id then below screen would pop-up
Now select add in this and provide your apple id and password in new window as shown.
Rest follow as guided by xcode and finally you will have your IPA file.
Go with your testflight.
Don’t forget to provide your provisioning profile and certificates in code-signing your build setting in xcode.