Apple shares gain ahead of earnings