Optional framework

I linked a framework as optional/weak and it's working fine in the latest Xcode but in the older Xcode version compilation is failing due to "framework not found". Is there a way to fix the compilation error in the older Xcode version?