Search code examples
iosobjective-cuicollectionviewautolayout

Autolayout Warning : Will attempt to recover by breaking constraint <NSLayoutConstraint in CollectionView


I'm using UICollectionView & Flow Layout and Class for layout of collectionView Cell is as to achieve slide animation like feedly app Or insorts app

import UIKit
class UltravisualLayout: UICollectionViewLayout {
    fileprivate var contentWidth:CGFloat!
    fileprivate var contentHeight:CGFloat!
    fileprivate var yOffset:CGFloat = 0

    var maxAlpha:CGFloat = 1
    var minAlpha:CGFloat = 0

    var widthOffset:CGFloat = 0
    var heightOffset:CGFloat = 0

    fileprivate var cache = [UICollectionViewLayoutAttributes]()

    fileprivate var itemWidth:CGFloat{
        return (collectionView?.bounds.width)!
    }
    fileprivate var itemHeight:CGFloat{
        return (collectionView?.bounds.height)!
    }
    fileprivate var collectionViewHeight:CGFloat{
        return (collectionView?.bounds.height)!
    }


    fileprivate var numberOfItems:Int{
        return (collectionView?.numberOfItems(inSection: 0))!
    }


    fileprivate var dragOffset:CGFloat{
        return (collectionView?.bounds.height)!
    }
    fileprivate var currentItemIndex:Int{
        return max(0, Int(collectionView!.contentOffset.y / collectionViewHeight))
    }

    var nextItemBecomeCurrentPercentage:CGFloat{
        return (collectionView!.contentOffset.y / (collectionViewHeight)) - CGFloat(currentItemIndex)
    }

    override func prepare() {
        cache.removeAll(keepingCapacity: false)
        yOffset = 0

        for item in 0 ..< numberOfItems{

            let indexPath = IndexPath(item: item, section: 0)
            let attribute = UICollectionViewLayoutAttributes(forCellWith: indexPath)
            attribute.zIndex = -(indexPath as NSIndexPath).row


            if ((indexPath as NSIndexPath).item == currentItemIndex+1) && ((indexPath as NSIndexPath).item < numberOfItems){

                attribute.alpha = minAlpha + max((maxAlpha-minAlpha) * nextItemBecomeCurrentPercentage, 0)
                let width = itemWidth - widthOffset + (widthOffset * nextItemBecomeCurrentPercentage)
                let height = itemHeight - heightOffset + (heightOffset * nextItemBecomeCurrentPercentage)

                let deltaWidth =  width/itemWidth
                let deltaHeight = height/itemHeight

                attribute.frame = CGRect(x: 0, y: yOffset, width: itemWidth, height: itemHeight)
                attribute.transform = CGAffineTransform(scaleX: deltaWidth, y: deltaHeight)

                attribute.center.y = (collectionView?.center.y)! +  (collectionView?.contentOffset.y)!
                attribute.center.x = (collectionView?.center.x)! + (collectionView?.contentOffset.x)!
                yOffset += collectionViewHeight

            }else{
                attribute.frame = CGRect(x: 0, y: yOffset, width: itemWidth, height: itemHeight)
                attribute.center.y = (collectionView?.center.y)! + yOffset
                attribute.center.x = (collectionView?.center.x)!
                yOffset += collectionViewHeight
            }
            cache.append(attribute)
        }
    }

    //Return the size of ContentView
    override var collectionViewContentSize : CGSize {
        contentWidth = (collectionView?.bounds.width)!
        contentHeight = CGFloat(numberOfItems) * (collectionView?.bounds.height)!
        return CGSize(width: contentWidth, height: contentHeight)
    }

    //Return Attributes  whose frame lies in the Visible Rect
    override func layoutAttributesForElements(in rect: CGRect) -> [UICollectionViewLayoutAttributes]? {
        var layoutAttributes = [UICollectionViewLayoutAttributes]()
        for attribute in cache{
            if attribute.frame.intersects(rect){
                layoutAttributes.append(attribute)
            }
        }
        return layoutAttributes
    }


    override func shouldInvalidateLayout(forBoundsChange newBounds: CGRect) -> Bool {
        return true
    }

    override func targetContentOffset(forProposedContentOffset proposedContentOffset: CGPoint, withScrollingVelocity velocity: CGPoint) -> CGPoint {
        let itemIndex = round(proposedContentOffset.y / (dragOffset))
        let yOffset = itemIndex * (collectionView?.bounds.height)!
        return CGPoint(x: 0, y: yOffset)
    }
    override func layoutAttributesForItem(at indexPath: IndexPath) -> UICollectionViewLayoutAttributes? {

        // Logic that calculates the UICollectionViewLayoutAttributes of the item
        // and returns the UICollectionViewLayoutAttributes
        return UICollectionViewLayoutAttributes(forCellWith: indexPath)
    }

}

I Created custom view with Xib as

Class SmallStory

#import <UIKit/UIKit.h>
@interface SmallStory : UIView
@property (weak, nonatomic) IBOutlet UIImageView *image;
@property (weak, nonatomic) IBOutlet UILabel *title;
@property (weak, nonatomic) IBOutlet UILabel *pubDate;
@end

SmallStory.m

#import "SmallStory.h"
@interface SmallStory()
@property (nonatomic, strong) UIView *containerView;
@property (nonatomic, strong) NSMutableArray *customConstraints;

@end
@implementation SmallStory

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/
- (instancetype)initWithCoder:(NSCoder *)aDecoder
{
    self = [super initWithCoder:aDecoder];
    if (self) {
        [self customInit];
    }
    return self;
}

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self customInit];
    }
    return self;
}

- (void)customInit
{
    _customConstraints = [[NSMutableArray alloc] init];

    UIView *view = nil;
    NSArray *objects = [[NSBundle mainBundle] loadNibNamed:@"SmallStory"
                                                     owner:self
                                                   options:nil];
    for (id object in objects) {
        if ([object isKindOfClass:[UIView class]]) {
            view = object;
            break;
        }
    }

    if (view != nil) {
        _containerView = view;
        view.translatesAutoresizingMaskIntoConstraints = NO;
        [self addSubview:view];
        [self setNeedsUpdateConstraints];
    }
}
- (void)updateConstraints
{
    [self removeConstraints:self.customConstraints];
    [self.customConstraints removeAllObjects];

    if (self.containerView != nil) {
        UIView *view = self.containerView;
        NSDictionary *views = NSDictionaryOfVariableBindings(view);
        [self.customConstraints addObjectsFromArray:
         [NSLayoutConstraint constraintsWithVisualFormat:
          @"H:|[view]|" options:0 metrics:nil views:views]];
        [self.customConstraints addObjectsFromArray:
         [NSLayoutConstraint constraintsWithVisualFormat:
          @"V:|[view]|" options:0 metrics:nil views:views]];
        [self addConstraints:self.customConstraints];
    }

    [super updateConstraints];
}



- (UIViewController*)getSuperViewController
{
    for (UIView* next = [self superview]; next; next = next.superview)
    {
        UIResponder* nextResponder = [next nextResponder];

        if ([nextResponder isKindOfClass:[UIViewController class]])
        {
            return (UIViewController*)nextResponder;
        }
    }

    return nil;
}
@end

Xib Design Looks like

Now Collection View Cell Is devided into 5 parts

and each small view is assigned as SmallStory Class

and Story Board Looks Like

enter image description here

When I run App There is Autolayout warnings as below

*2017-06-06 22:18:04.044717+0530 Jansatta[1096:258239] [LayoutConstraints] 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) 
(
    "<NSAutoresizingMaskLayoutConstraint:0x17028ca30 h=--& v=--& UIView:0x113d2c230.height == 0   (active)>",
    "<NSLayoutConstraint:0x1702875d0 UIImageView:0x113e32700.bottom == UIView:0x113e32e10.bottomMargin   (active)>",
    "<NSLayoutConstraint:0x170287260 UIImageView:0x113e32700.top == UIView:0x113e32e10.topMargin   (active)>",
    "<NSLayoutConstraint:0x17028af00 SmallStory:0x113e324f0.height == SmallStory:0x113d2c5e0.height   (active)>",
    "<NSLayoutConstraint:0x17028aff0 SmallStory:0x113d2c5e0.height == SmallStory:0x113d2c3d0.height   (active)>",
    "<NSLayoutConstraint:0x17028b270 SmallStory:0x113d2c3d0.height == 0.2*UIView:0x113d2c230.height   (active)>",
    "<NSLayoutConstraint:0x17028bea0 V:|-(0)-[UIView:0x113e32e10]   (active, names: '|':SmallStory:0x113e324f0 )>",
    "<NSLayoutConstraint:0x17028bef0 V:[UIView:0x113e32e10]-(0)-|   (active, names: '|':SmallStory:0x113e324f0 )>"
)
Will attempt to recover by breaking constraint 
<NSLayoutConstraint:0x1702875d0 UIImageView:0x113e32700.bottom == UIView:0x113e32e10.bottomMargin   (active)>
Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger.
The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in <UIKit/UIView.h> may also be helpful.
2017-06-06 22:18:04.047763+0530 Jansatta[1096:258239] [LayoutConstraints] 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) 
(
    "<NSAutoresizingMaskLayoutConstraint:0x17028cad0 h=--& v=--& UIView:0x113d2c230.width == 0   (active)>",
    "<NSLayoutConstraint:0x174285f00 H:|-(10)-[UIImageView:0x113d2c980]   (active, names: '|':UIView:0x113d2d090 )>",
    "<NSLayoutConstraint:0x174285f50 H:[UILabel:0x113d2ce00]-(10)-|   (active, names: '|':UIView:0x113d2d090 )>",
    "<NSLayoutConstraint:0x174285ff0 H:[UIImageView:0x113d2c980]-(10)-[UILabel:0x113d2ce00]   (active)>",
    "<NSLayoutConstraint:0x17028b130 SmallStory:0x113d2c3d0.width == UIView:0x113d2c230.width   (active)>",
    "<NSLayoutConstraint:0x17028b950 H:|-(0)-[UIView:0x113d2d090]   (active, names: '|':SmallStory:0x113d2c3d0 )>",
    "<NSLayoutConstraint:0x17028b9a0 H:[UIView:0x113d2d090]-(0)-|   (active, names: '|':SmallStory:0x113d2c3d0 )>"
)
Will attempt to recover by breaking constraint 
<NSLayoutConstraint:0x174285ff0 H:[UIImageView:0x113d2c980]-(10)-[UILabel:0x113d2ce00]   (active)>
Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger.
The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in <UIKit/UIView.h> may also be helpful.
2017-06-06 22:18:04.050793+0530 Jansatta[1096:258239] [LayoutConstraints] 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) 
(
    "<NSAutoresizingMaskLayoutConstraint:0x17028ca30 h=--& v=--& UIView:0x113d2c230.height == 0   (active)>",
    "<NSLayoutConstraint:0x170288840 UIImageView:0x113e331c0.bottom == UIView:0x113e33e00.bottomMargin   (active)>",
    "<NSLayoutConstraint:0x1702887a0 UIImageView:0x113e331c0.top == UIView:0x113e33e00.topMargin   (active)>",
    "<NSLayoutConstraint:0x1702892e0 SmallStory:0x113e32fb0.height == SmallStory:0x113e324f0.height   (active)>",
    "<NSLayoutConstraint:0x17028af00 SmallStory:0x113e324f0.height == SmallStory:0x113d2c5e0.height   (active)>",
    "<NSLayoutConstraint:0x17028aff0 SmallStory:0x113d2c5e0.height == SmallStory:0x113d2c3d0.height   (active)>",
    "<NSLayoutConstraint:0x17028b270 SmallStory:0x113d2c3d0.height == 0.2*UIView:0x113d2c230.height   (active)>",
    "<NSLayoutConstraint:0x17028c0d0 V:|-(0)-[UIView:0x113e33e00]   (active, names: '|':SmallStory:0x113e32fb0 )>",
    "<NSLayoutConstraint:0x17028c120 V:[UIView:0x113e33e00]-(0)-|   (active, names: '|':SmallStory:0x113e32fb0 )>"
)
Will attempt to recover by breaking constraint 
<NSLayoutConstraint:0x170288840 UIImageView:0x113e331c0.bottom == UIView:0x113e33e00.bottomMargin   (active)>
Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger.
The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in <UIKit/UIView.h> may also be helpful.
2017-06-06 22:18:04.054839+0530 Jansatta[1096:258239] [LayoutConstraints] 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) 
(
    "<NSAutoresizingMaskLayoutConstraint:0x17028ca30 h=--& v=--& UIView:0x113d2c230.height == 0   (active)>",
    "<NSLayoutConstraint:0x170287fd0 UIImageView:0x113e341b0.bottom == UIView:0x113e348c0.bottomMargin   (active)>",
    "<NSLayoutConstraint:0x170287f30 UIImageView:0x113e341b0.top == UIView:0x113e348c0.topMargin   (active)>",
    "<NSLayoutConstraint:0x1702892e0 SmallStory:0x113e32fb0.height == SmallStory:0x113e324f0.height   (active)>",
    "<NSLayoutConstraint:0x1702881b0 SmallStory:0x113e32fb0.height == SmallStory:0x113e33fa0.height   (active)>",
    "<NSLayoutConstraint:0x17028af00 SmallStory:0x113e324f0.height == SmallStory:0x113d2c5e0.height   (active)>",
    "<NSLayoutConstraint:0x17028aff0 SmallStory:0x113d2c5e0.height == SmallStory:0x113d2c3d0.height   (active)>",
    "<NSLayoutConstraint:0x17028b270 SmallStory:0x113d2c3d0.height == 0.2*UIView:0x113d2c230.height   (active)>",
    "<NSLayoutConstraint:0x17028c300 V:|-(0)-[UIView:0x113e348c0]   (active, names: '|':SmallStory:0x113e33fa0 )>",
    "<NSLayoutConstraint:0x17028c350 V:[UIView:0x113e348c0]-(0)-|   (active, names: '|':SmallStory:0x113e33fa0 )>"
)
Will attempt to recover by breaking constraint 
<NSLayoutConstraint:0x170287fd0 UIImageView:0x113e341b0.bottom == UIView:0x113e348c0.bottomMargin   (active)>
Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger.
The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in <UIKit/UIView.h> may also be helpful.
2017-06-06 22:18:04.058339+0530 Jansatta[1096:258239] [LayoutConstraints] 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) 
(
    "<NSAutoresizingMaskLayoutConstraint:0x17028cad0 h=--& v=--& UIView:0x113d2c230.width == 0   (active)>",
    "<NSLayoutConstraint:0x170287620 H:|-(10)-[UIImageView:0x113e32700]   (active, names: '|':UIView:0x113e32e10 )>",
    "<NSLayoutConstraint:0x170287670 H:[UILabel:0x113e32b80]-(10)-|   (active, names: '|':UIView:0x113e32e10 )>",
    "<NSLayoutConstraint:0x1702876c0 H:[UIImageView:0x113e32700]-(10)-[UILabel:0x113e32b80]   (active)>",
    "<NSLayoutConstraint:0x17028aeb0 SmallStory:0x113e324f0.width == SmallStory:0x113d2c5e0.width   (active)>",
    "<NSLayoutConstraint:0x17028b040 SmallStory:0x113d2c5e0.width == SmallStory:0x113d2c3d0.width   (active)>",
    "<NSLayoutConstraint:0x17028b130 SmallStory:0x113d2c3d0.width == UIView:0x113d2c230.width   (active)>",
    "<NSLayoutConstraint:0x17028be00 H:|-(0)-[UIView:0x113e32e10]   (active, names: '|':SmallStory:0x113e324f0 )>",
    "<NSLayoutConstraint:0x17028be50 H:[UIView:0x113e32e10]-(0)-|   (active, names: '|':SmallStory:0x113e324f0 )>"
)
Will attempt to recover by breaking constraint 
<NSLayoutConstraint:0x1702876c0 H:[UIImageView:0x113e32700]-(10)-[UILabel:0x113e32b80]   (active)>
Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger.
The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in <UIKit/UIView.h> may also be helpful.
2017-06-06 22:18:04.061159+0530 Jansatta[1096:258239] [LayoutConstraints] 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) 
(
    "<NSAutoresizingMaskLayoutConstraint:0x17028cad0 h=--& v=--& UIView:0x113d2c230.width == 0   (active)>",
    "<NSLayoutConstraint:0x17028a820 UIImageView:0x113e04f90.width == 180   (active)>",
    "<NSLayoutConstraint:0x17028aaf0 H:|-(10)-[UIImageView:0x113e04f90]   (active, names: '|':UIView:0x113e195a0 )>",
    "<NSLayoutConstraint:0x17028abe0 H:[UILabel:0x113e31dc0]-(10)-|   (active, names: '|':UIView:0x113e195a0 )>",
    "<NSLayoutConstraint:0x17028ac80 H:[UIImageView:0x113e04f90]-(10)-[UILabel:0x113e31dc0]   (active)>",
    "<NSLayoutConstraint:0x17028b040 SmallStory:0x113d2c5e0.width == SmallStory:0x113d2c3d0.width   (active)>",
    "<NSLayoutConstraint:0x17028b130 SmallStory:0x113d2c3d0.width == UIView:0x113d2c230.width   (active)>",
    "<NSLayoutConstraint:0x17028bbd0 H:|-(0)-[UIView:0x113e195a0]   (active, names: '|':SmallStory:0x113d2c5e0 )>",
    "<NSLayoutConstraint:0x17028bc20 H:[UIView:0x113e195a0]-(0)-|   (active, names: '|':SmallStory:0x113d2c5e0 )>"
)
Will attempt to recover by breaking constraint 
<NSLayoutConstraint:0x17028a820 UIImageView:0x113e04f90.width == 180   (active)>
Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger.
The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in <UIKit/UIView.h> may also be helpful.
2017-06-06 22:18:04.064548+0530 Jansatta[1096:258239] [LayoutConstraints] 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) 
(
    "<NSAutoresizingMaskLayoutConstraint:0x17028cad0 h=--& v=--& UIView:0x113d2c230.width == 0   (active)>",
    "<NSLayoutConstraint:0x17028aaf0 H:|-(10)-[UIImageView:0x113e04f90]   (active, names: '|':UIView:0x113e195a0 )>",
    "<NSLayoutConstraint:0x17028abe0 H:[UILabel:0x113e31dc0]-(10)-|   (active, names: '|':UIView:0x113e195a0 )>",
    "<NSLayoutConstraint:0x17028ac80 H:[UIImageView:0x113e04f90]-(10)-[UILabel:0x113e31dc0]   (active)>",
    "<NSLayoutConstraint:0x17028b040 SmallStory:0x113d2c5e0.width == SmallStory:0x113d2c3d0.width   (active)>",
    "<NSLayoutConstraint:0x17028b130 SmallStory:0x113d2c3d0.width == UIView:0x113d2c230.width   (active)>",
    "<NSLayoutConstraint:0x17028bbd0 H:|-(0)-[UIView:0x113e195a0]   (active, names: '|':SmallStory:0x113d2c5e0 )>",
    "<NSLayoutConstraint:0x17028bc20 H:[UIView:0x113e195a0]-(0)-|   (active, names: '|':SmallStory:0x113d2c5e0 )>"
)
Will attempt to recover by breaking constraint 
<NSLayoutConstraint:0x17028ac80 H:[UIImageView:0x113e04f90]-(10)-[UILabel:0x113e31dc0]   (active)>
Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger.
The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in <UIKit/UIView.h> may also be helpful.
2017-06-06 22:18:04.066582+0530 Jansatta[1096:258239] [LayoutConstraints] 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) 
(
    "<NSAutoresizingMaskLayoutConstraint:0x17028ca30 h=--& v=--& UIView:0x113d2c230.height == 0   (active)>",
    "<NSLayoutConstraint:0x17028aaa0 UIImageView:0x113e04f90.bottom == UIView:0x113e195a0.bottomMargin   (active)>",
    "<NSLayoutConstraint:0x17028ab40 UIImageView:0x113e04f90.top == UIView:0x113e195a0.topMargin   (active)>",
    "<NSLayoutConstraint:0x17028aff0 SmallStory:0x113d2c5e0.height == SmallStory:0x113d2c3d0.height   (active)>",
    "<NSLayoutConstraint:0x17028b270 SmallStory:0x113d2c3d0.height == 0.2*UIView:0x113d2c230.height   (active)>",
    "<NSLayoutConstraint:0x17028bc70 V:|-(0)-[UIView:0x113e195a0]   (active, names: '|':SmallStory:0x113d2c5e0 )>",
    "<NSLayoutConstraint:0x17028bcc0 V:[UIView:0x113e195a0]-(0)-|   (active, names: '|':SmallStory:0x113d2c5e0 )>"
)
Will attempt to recover by breaking constraint 
<NSLayoutConstraint:0x17028aaa0 UIImageView:0x113e04f90.bottom == UIView:0x113e195a0.bottomMargin   (active)>
Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger.
The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in <UIKit/UIView.h> may also be helpful.
2017-06-06 22:18:04.068461+0530 Jansatta[1096:258239] [LayoutConstraints] 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) 
(
    "<NSAutoresizingMaskLayoutConstraint:0x17028ca30 h=--& v=--& UIView:0x113d2c230.height == 0   (active)>",
    "<NSLayoutConstraint:0x174285e60 UIImageView:0x113d2c980.bottom == UIView:0x113d2d090.bottomMargin   (active)>",
    "<NSLayoutConstraint:0x174285eb0 UIImageView:0x113d2c980.top == UIView:0x113d2d090.topMargin   (active)>",
    "<NSLayoutConstraint:0x17028b270 SmallStory:0x113d2c3d0.height == 0.2*UIView:0x113d2c230.height   (active)>",
    "<NSLayoutConstraint:0x17028b9f0 V:|-(0)-[UIView:0x113d2d090]   (active, names: '|':SmallStory:0x113d2c3d0 )>",
    "<NSLayoutConstraint:0x17028ba40 V:[UIView:0x113d2d090]-(0)-|   (active, names: '|':SmallStory:0x113d2c3d0 )>"
)
Will attempt to recover by breaking constraint 
<NSLayoutConstraint:0x174285e60 UIImageView:0x113d2c980.bottom == UIView:0x113d2d090.bottomMargin   (active)>
Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger.
The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in <UIKit/UIView.h> may also be helpful.
2017-06-06 22:18:04.070615+0530 Jansatta[1096:258239] [LayoutConstraints] 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) 
(
    "<NSAutoresizingMaskLayoutConstraint:0x17028cad0 h=--& v=--& UIView:0x113d2c230.width == 0   (active)>",
    "<NSLayoutConstraint:0x1702873f0 UIImageView:0x113e331c0.width == 180   (active)>",
    "<NSLayoutConstraint:0x170287760 H:|-(10)-[UIImageView:0x113e331c0]   (active, names: '|':UIView:0x113e33e00 )>",
    "<NSLayoutConstraint:0x1702886b0 H:[UILabel:0x113e338d0]-(10)-|   (active, names: '|':UIView:0x113e33e00 )>",
    "<NSLayoutConstraint:0x170288570 H:[UIImageView:0x113e331c0]-(10)-[UILabel:0x113e338d0]   (active)>",
    "<NSLayoutConstraint:0x1702884d0 UILabel:0x113e338d0.leading == UILabel:0x113e333b0.leading   (active)>",
    "<NSLayoutConstraint:0x170288390 UILabel:0x113e333b0.trailing == UILabel:0x113e338d0.trailing   (active)>",
    "<NSLayoutConstraint:0x17028ae60 SmallStory:0x113e32fb0.width == SmallStory:0x113e324f0.width   (active)>",
    "<NSLayoutConstraint:0x17028aeb0 SmallStory:0x113e324f0.width == SmallStory:0x113d2c5e0.width   (active)>",
    "<NSLayoutConstraint:0x17028b040 SmallStory:0x113d2c5e0.width == SmallStory:0x113d2c3d0.width   (active)>",
    "<NSLayoutConstraint:0x17028b130 SmallStory:0x113d2c3d0.width == UIView:0x113d2c230.width   (active)>",
    "<NSLayoutConstraint:0x17028c030 H:|-(0)-[UIView:0x113e33e00]   (active, names: '|':SmallStory:0x113e32fb0 )>",
    "<NSLayoutConstraint:0x17028c080 H:[UIView:0x113e33e00]-(0)-|   (active, names: '|':SmallStory:0x113e32fb0 )>"
)*

HOW TO SOLVE THIS PLEASE HELP


Solution

  • HI I solved My Problem,

    Xib constraints put from required to high priority Warning goes away.