Skip to content

Conversation

@pookjw
Copy link

@pookjw pookjw commented Jan 4, 2022

Old Style

import UIKit

class MyCollectionViewLayout: UICollectionViewCompositionalLayout {
    required init?(coder: NSCoder) {
        super.init { (section, layoutEnvironment) -> NSCollectionLayoutSection? in
            /* code */
        }

        let nib: UINib = .init(nibName: String(describing: MyCollectionReusableView.self), bundle: .main)
        register(nib, forDecorationViewOfKind: String(describing: MyCollectionReusableView.self))
    }
}

New Style

import UIKit
import Reusable

class MyCollectionViewLayout: UICollectionViewCompositionalLayout {
    required init?(coder: NSCoder) {
        super.init { (section, layoutEnvironment) -> NSCollectionLayoutSection? in
            /* code */
        }

        register(decorationViewType: MyCollectionReusableView.self)
    }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants