Recall that $A \to B$ is equivalent to $\lnot A \lor B$ and to $\lnot (A \land \lnot B)$, and that $A \leftrightarrow B$ is equivalent to $(A \to B) \land (B \to A)$, which is then equivalent to $(\lnot A \lor B) \land (\lnot B \lor A)$.
So, if you are able to express $\lnot A$ and $A \lor B$ and $A \land B$ in terms of the NAND operator $\mid$ (also known as Sheffer stroke), you should be able to express $A \to B$ and $A \leftrightarrow B$ in terms of $\mid$ (just compose the translations).
For instance, since $\lnot A \equiv A \mid A$ and $A \lor B \equiv (A \mid A) \mid (B \mid B)$, then you have \begin{align} A \to B \equiv \lnot A \lor B \equiv (\lnot A \mid \lnot A) \mid (B \mid B) \equiv \dots \end{align}
There is a (equivalent) shorter translation of $A \to B$. Indeed, since $A \mid B \equiv \lnot (A \land B)$, one has \begin{align} A \to B \equiv \lnot (A \land \lnot B) \equiv A \mid \lnot B \equiv \dots \end{align}