molecule changes
This commit is contained in:
parent
1009c38aff
commit
2dcf922dfd
@ -8,6 +8,10 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
public protocol RadioBoxSelectionDelegate: class {
|
||||
func selectedRadioBox(text: String)
|
||||
}
|
||||
|
||||
open class RadioBoxes: View {
|
||||
|
||||
public var collectionView: CollectionView!
|
||||
@ -19,7 +23,7 @@ open class RadioBoxes: View {
|
||||
private var radioBoxesModel: RadioBoxesModel? {
|
||||
return model as? RadioBoxesModel
|
||||
}
|
||||
|
||||
public var radioDelegate: RadioBoxSelectionDelegate?
|
||||
private var delegateObject: MVMCoreUIDelegateObject?
|
||||
|
||||
/// The models for the molecules.
|
||||
@ -161,6 +165,8 @@ extension RadioBoxes: UICollectionViewDelegate {
|
||||
cell.radioBox.selectBox()
|
||||
_ = FormValidator.validate(delegate: delegateObject?.formHolderDelegate)
|
||||
cell.updateAccessibility()
|
||||
guard let nu = boxes?[indexPath.row] else { return }
|
||||
radioDelegate?.selectedRadioBox(text: nu.text)
|
||||
}
|
||||
|
||||
open func collectionView(_ collectionView: UICollectionView, didDeselectItemAt indexPath: IndexPath) {
|
||||
|
||||
@ -13,7 +13,8 @@ import UIKit
|
||||
func didSelectItem(_ indexPath: IndexPath, tabs: Tabs)
|
||||
}
|
||||
|
||||
@objcMembers open class Tabs: View, MVMCoreUIViewConstrainingProtocol {
|
||||
@objcMembers open class Tabs: View, MVMCoreUIViewConstrainingProtocol, MFButtonProtocol {
|
||||
|
||||
|
||||
public var tabsModel: TabsModel? {
|
||||
get { return model as? TabsModel }
|
||||
@ -81,9 +82,11 @@ import UIKit
|
||||
let collectionView = UICollectionView(frame: .zero, collectionViewLayout: layout)
|
||||
collectionView.translatesAutoresizingMaskIntoConstraints = false
|
||||
collectionView.register(TabItemCell.self, forCellWithReuseIdentifier: TabCellId)
|
||||
collectionView.isUserInteractionEnabled = true
|
||||
collectionView.backgroundColor = .clear
|
||||
collectionView.showsVerticalScrollIndicator = false
|
||||
collectionView.showsHorizontalScrollIndicator = false
|
||||
collectionView.isScrollEnabled = true
|
||||
collectionView.dataSource = self
|
||||
collectionView.delegate = self
|
||||
addSubview(collectionView)
|
||||
@ -120,6 +123,8 @@ import UIKit
|
||||
//bottom line
|
||||
bottomLine.topAnchor.constraint(equalTo: bottomScrollView.bottomAnchor).isActive = true;
|
||||
NSLayoutConstraint.constraintPinSubview(bottomLine, pinTop: false, pinBottom: true, pinLeft: true, pinRight: true)
|
||||
|
||||
self.collectionView?.delegate = self
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
@ -289,6 +294,7 @@ extension Tabs {
|
||||
public override func setupView() {
|
||||
super.setupView()
|
||||
contentView.addSubview(label)
|
||||
contentView.isUserInteractionEnabled = true
|
||||
NSLayoutConstraint.constraintPinSubview(label, pinTop: false, topConstant: 0, pinBottom: true, bottomConstant: 6, pinLeft: true, leftConstant: 0, pinRight: true, rightConstant: 0)
|
||||
label.baselineAdjustment = .alignCenters
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user