This paper presents an alternating iteration hybrid precoding algorithm for the switch network-based dynamic fully-connected (SFC) structure, namely HP-SFC algorithm. Firstly, based on the sparsity of switch network, the optimization problem of the analog switch precoding matrix is transformed into a binary dictionary updating problem, which avoids to deal with the binary constraint straightly. Then, the optimization problem of the analog phase shifter (PS) precoding matrix is modeled as a quadratic unimodular programming problem by the vectorization of the analog PS precoding matrix. So that the analog PS precoding matrix can be readily optimized. Finally, the analog switch precoding matrix, the analog PS precoding matrix and the digital precoding matrix are alternately optimized via the block coordinate descent, the generalized power method and the least square, respectively. Theoretical analysis and simulation results show that the proposed algorithm can provide brilliantly hybrid precoding performence campared with the previous works, for example: 1) it reduces the hybrid precoding matrix residual, so that its spectral efficiency is close to the full digital optimal precoding; 2) it provids at least 15% energy efficiency improvement comparing with related algorithms.