iOS version of L0Smoothing