Layer by layer control of wettability in nanocomposite films