Disregarding floating devices altogether (because they can easily be abandoned if needed), where and when you decide to swim in tidal waters should entirely depend on expertise of those waters. Currents are local phenomenon which do not necessarily replicate themselves from one place to another because the number of variables that lead to a predictable current are manifold.
However there are some precautions that one can take while learning the local waters. If you find yourself in a current that is pulling you out to sea, you should not try to fight the current. You want to get out of the current by swimming perpendicular to the current until you find yourself in water that is no longer pulling you away from shore.
Some tidal currents are created by a supply of inland water such as a river or bay, and you will not have the strength nor stamina to fight this current as it is likely to last for up to 6 hours without any hint of letting up.
Don't worry whether it's the shore you started with, your goal in this case is to get to ANY shore. You are much safer walking a few miles than you are trying to swim a few miles. Swim along the shoreline until you are no longer moving away from the shore, then turn shoreward and get yourself to dry land.