provideplatform / provide-ios

Native iOS example application leveraging the provide-swift API client
0 stars 0 forks source link

Add the UIViews in ConfirmWorkOrderViewController.swift to an outlet collection #29

Open jawwad opened 7 years ago

jawwad commented 7 years ago
@IBOutlet private var allViews: [UIView]!

Then connect all of the views that should be hidden or displayed to the property.

Then update

    private func setViews(hidden: Bool) {
        let views: [UIView] = [
            confirmButton,
            creditCardIcon,
            creditCardLastFour,
            userIconImageView,
            capacity,
            distanceEstimate,
            fareEstimate,
        ]
        views.forEach { $0.isHidden = hidden }
    }

To:

    private func setViews(hidden: Bool) {
        allViews.forEach { $0.isHidden = hidden }
    }