You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

49 lines
1.3 KiB

//
// PageCollectionViewCell.swift
// GME Remit
//
// Created by Armaan Shrestha on 21/08/2022.
// Copyright © 2022 Gobal Money Express Co. Ltd. All rights reserved.
//
import UIKit
class PageCollectionViewCell: UICollectionViewCell {
// MARK: - Initialization
override init(frame: CGRect) {
super.init(frame: frame)
self.setupUI()
}
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
// MARK: - UI Properties
public var view: UIView? {
didSet {
self.setupUI()
}
}
// MARK: - UI Setup
private func setupUI() {
guard let view = view else { return }
self.contentView.addSubview(view)
view.translatesAutoresizingMaskIntoConstraints = false
NSLayoutConstraint.activate([
view.leftAnchor
.constraint(equalTo: self.contentView.leftAnchor),
view.topAnchor
.constraint(equalTo: self.contentView.topAnchor),
view.rightAnchor
.constraint(equalTo: self.contentView.rightAnchor),
view.bottomAnchor
.constraint(equalTo: self.contentView.bottomAnchor)
])
}
}