UILabel position in custom tableView cell
<p>I'm trying to make an app without using storyboards and I have a problem.
I've set up custom cell and everything looks ok on iPhone 5s:
<a href="https://i.stack.imgur.com/h1no6.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/h1no6.png" alt="enter image description here"></a></p>

<p>But my right label looks wrong on, for example, iPhone 6s+:
<a href="https://i.stack.imgur.com/mKuUY.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/mKuUY.png" alt="enter image description here"></a></p>

<p>Here is my code:</p>

<pre><code>class CustomTableViewCell: UITableViewCell {


var leftLabel = UILabel()
var currencyValueLabel = UILabel()



required init?(coder aDecoder: NSCoder) {
    super.init(coder: aDecoder)
}


override init(style: UITableViewCellStyle, reuseIdentifier: String?) {
    super.init(style: style, reuseIdentifier: reuseIdentifier)

    leftLabel = UILabel(frame: CGRect(
            x: 16,
            y: 8,
            width: 100,
            height: self.bounds.size.height-16
        ))
        leftLabel.textAlignment = .Left
        addSubview(leftLabel)

    currencyValueLabel = UILabel(frame: CGRect(
            x: self.bounds.size.width-116,
            y: 8,
            width: 100,
            height: self.bounds.size.height-16
        ))
        rightLabel.textAlignment = .Right
        addSubview(rightLabel)

}


}
</code></pre>

<p><strong>Update:</strong>
I've tried autolayout:</p>

<pre><code>leftLabel.leadingAnchor.constraintEqualToAnchor(self.layoutMarginsGuide.leadingAnchor, constant: 20).active = true
    leftLabel.centerYAnchor.constraintEqualToAnchor(self.layoutMarginsGuide.centerYAnchor).active = true
</code></pre>

<p>and this is result</p>

<pre><code>    2016-05-05 18:49:09.849 RubApp[57636:2228350] Unable to simultaneously satisfy constraints.
    Probably at least one of the constraints in the following list is one you don't want. 
    Try this: 
        (1) look at each constraint and try to figure out which you don't expect; 
        (2) find the code that added the unwanted constraint or constraints and fix it. 
    (Note: If you're seeing NSAutoresizingMaskLayoutConstraints that you don't understand, refer to the documentation for the UIView property translatesAutoresizingMaskIntoConstraints) 
(
    "&lt;NSAutoresizingMaskLayoutConstraint:0x7fc503d21c50 h=--&amp; v=--&amp; UILabel:0x7fc503cea100'EUR'.midX == + 66&gt;",
    "&lt;NSAutoresizingMaskLayoutConstraint:0x7fc503d1ea40 h=--&amp; v=--&amp; H:[UILabel:0x7fc503cea100'EUR'(100)]&gt;",
    "&lt;NSLayoutConstraint:0x7fc503ce7c00 UILabel:0x7fc503cea100'EUR'.leading == UILayoutGuide:0x7fc503ce8c20'UIViewLayoutMarginsGuide'.leading + 20&gt;",
    "&lt;NSAutoresizingMaskLayoutConstraint:0x7fc503ce98e0 h=-&amp;- v=--&amp; 'UIView-Encapsulated-Layout-Left' H:|-(0)-[RubApp.MainViewCell:0x7fc505868000'idTableCellMainView']   (Names: '|':UITableViewWrapperView:0x7fc505869600 )&gt;",
    "&lt;NSLayoutConstraint:0x7fc503ce7df0 'UIView-leftMargin-guide-constraint' H:|-(15)-[UILayoutGuide:0x7fc503ce8c20'UIViewLayoutMarginsGuide'](LTR)   (Names: '|':RubApp.MainViewCell:0x7fc505868000'idTableCellMainView' )&gt;"
)

Will attempt to recover by breaking constraint 
&lt;NSLayoutConstraint:0x7fc503ce7c00 UILabel:0x7fc503cea100'EUR'.leading == UILayoutGuide:0x7fc503ce8c20'UIViewLayoutMarginsGuide'.leading + 20&gt;

Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger.
The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in &lt;UIKit/UIView.h&gt; may also be helpful.
2016-05-05 18:49:09.857 RubApp[57636:2228350] Unable to simultaneously satisfy constraints.
    Probably at least one of the constraints in the following list is one you don't want. 
    Try this: 
        (1) look at each constraint and try to figure out which you don't expect; 
        (2) find the code that added the unwanted constraint or constraints and fix it. 
    (Note: If you're seeing NSAutoresizingMaskLayoutConstraints that you don't understand, refer to the documentation for the UIView property translatesAutoresizingMaskIntoConstraints) 
(
    "&lt;NSAutoresizingMaskLayoutConstraint:0x7fc503e5a720 h=--&amp; v=--&amp; UILabel:0x7fc503e49b50'USD'.midX == + 66&gt;",
    "&lt;NSAutoresizingMaskLayoutConstraint:0x7fc503e5a940 h=--&amp; v=--&amp; H:[UILabel:0x7fc503e49b50'USD'(100)]&gt;",
    "&lt;NSLayoutConstraint:0x7fc503e56f50 UILabel:0x7fc503e49b50'USD'.leading == UILayoutGuide:0x7fc503e4a3a0'UIViewLayoutMarginsGuide'.leading + 20&gt;",
    "&lt;NSAutoresizingMaskLayoutConstraint:0x7fc503e5ab70 h=-&amp;- v=--&amp; 'UIView-Encapsulated-Layout-Left' H:|-(0)-[RubApp.MainViewCell:0x7fc504030a00'idTableCellMainView']   (Names: '|':UITableViewWrapperView:0x7fc505869600 )&gt;",
    "&lt;NSLayoutConstraint:0x7fc503e4a780 'UIView-leftMargin-guide-constraint' H:|-(15)-[UILayoutGuide:0x7fc503e4a3a0'UIViewLayoutMarginsGuide'](LTR)   (Names: '|':RubApp.MainViewCell:0x7fc504030a00'idTableCellMainView' )&gt;"
)

Will attempt to recover by breaking constraint 
&lt;NSLayoutConstraint:0x7fc503e56f50 UILabel:0x7fc503e49b50'USD'.leading == UILayoutGuide:0x7fc503e4a3a0'UIViewLayoutMarginsGuide'.leading + 20&gt;

Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger.
The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in &lt;UIKit/UIView.h&gt; may also be helpful.
</code></pre>

<p>I know that something wrong with constant setting, but don't know what. Sorry if this question is stupid but this is my first app without storyboards.</p>