Skip to content

Instantly share code, notes, and snippets.

@Kharauzov
Last active February 14, 2020 10:35
Show Gist options
  • Select an option

  • Save Kharauzov/04ad79ed62d9bdc83298c945013ff90d to your computer and use it in GitHub Desktop.

Select an option

Save Kharauzov/04ad79ed62d9bdc83298c945013ff90d to your computer and use it in GitHub Desktop.
import UIKit
class ProfileView: UIView {
// Some properties
var titleLabel: UILabel
var profileImageView: UIImageVew
var profileImageViewTopConstraint: NSLayoutConstraint
var titleLabelLeadingConstraint: NSLayoutConstraint
///
/// some other code here for ProfileView implementation
///
func configure() {
profileImageView.contentMode = SBValue<UIView.ContentMode>(iPhoneSE: .center, otherDevices: .scaleAspectFit).definedValue
titleLabel.font = SBValue<CGFloat>(iPhone8: 12, smallerDevice: 10, biggerDevice: 15).definedValue
profileImageViewTopConstraint.constant = SBValue<CGFloat>(iPhone8: 15, smallerDevice: 10, biggerDevice: 22.5).definedValue
titleLabelLeadingConstraint.constant = SBValue<CGFloat>(iPhone8: 20, smallerDevice: 15, biggerDevice: 30).definedValue
}
///
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment