Apple closes gap with Samsung with the help of iPhone 5 and iPad mini.