Search code examples
iosswift2ios9stackview

Any way to change order of photos in stack view?


Does anyone know how to change the order of photos in stack view(both horizontal and vertical) by user's desire?


Solution

  • The fiddly way is to use

    addArrangedSubview()
    insertArrangedSubview()
    removeArrangedSubview()
    

    If you have more time, I'd consider looking into UICollectionView which has a lot more flexibility that StackViews, especially for things like rearrangement.