Controlling the switching field in nanomagnets by means of domain-engineered antiferromagnets