Due to hardware constraints and safety requirements, many engineering systems have to satisfy input and output constraints. This paper proposes a new feedback-based iterative learning control (ILC) that can ensure the satisfaction of input and output constraints for linear-time-varying (LTV) systems. The proposed control structure consists of an output feedback loop, a feed-forward ILC and a hard constraint for input. A barrier function is used to assist the design of the output feedback in order to satisfy the output constraints. An appropriate saturation function is used in the design of ILC loop to address the input constraints. By using a suitable composite energy function, the main result of this paper shows that the desired trajectory can be learned using the proposed control structure without violating the input and output constraints. Simulation results are presented to demonstrate the effectiveness of the proposed control structure.