Skip to content

Instantly share code, notes, and snippets.

@FabiolaRamirez
Created June 4, 2019 18:27
Show Gist options
  • Select an option

  • Save FabiolaRamirez/9e7f0d87198270dce16742932df128cd to your computer and use it in GitHub Desktop.

Select an option

Save FabiolaRamirez/9e7f0d87198270dce16742932df128cd to your computer and use it in GitHub Desktop.
topView.backgroundColor = UIColor.creditSesameLightGrayBackgroundColor
topView.addTopSeparator()
bottomView.backgroundColor = UIColor.creditSesameLightGrayBackgroundColor
bottomView.addBottomSeparator()
segmentControl.delegate = self
segmentControl.datasource = self
topView.heightAnchor.constraint(equalToConstant: 16).isActive = true
segmentControl.heightAnchor.constraint(equalToConstant: 32).isActive = true
bottomView.heightAnchor.constraint(equalToConstant: 16).isActive = true
stackView.axis = .vertical
stackView.distribution = .equalSpacing
stackView.alignment = .center
stackView.spacing = 64;
stackView.addArrangedSubview(topView)
stackView.addArrangedSubview(segmentControl)
stackView.addArrangedSubview(bottomView)
stackView.translatesAutoresizingMaskIntoConstraints = false;
//stackView.centerXAnchor.constraint(equalTo: self.view.centerXAnchor).isActive = true
//stackView.centerYAnchor.constraint(equalTo: self.view.centerYAnchor).isActive = true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment