Created
November 6, 2014 01:53
-
-
Save puls/203336da4ef59ee204f3 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?xml version="1.0" encoding="UTF-8" standalone="no"?> | |
| <document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="6250" systemVersion="14A389" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES"> | |
| <dependencies> | |
| <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="6244"/> | |
| </dependencies> | |
| <scenes> | |
| <!--View Controller--> | |
| <scene sceneID="ztc-eJ-ujb"> | |
| <objects> | |
| <viewController id="mhR-QO-pIv" sceneMemberID="viewController"> | |
| <layoutGuides> | |
| <viewControllerLayoutGuide type="top" id="miT-Je-PDN"/> | |
| <viewControllerLayoutGuide type="bottom" id="twd-Iu-phu"/> | |
| </layoutGuides> | |
| <view key="view" contentMode="scaleToFill" id="S5t-92-IaS"> | |
| <rect key="frame" x="0.0" y="0.0" width="600" height="600"/> | |
| <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> | |
| <subviews> | |
| <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Tiw-GD-Zb0"> | |
| <rect key="frame" x="279" y="290" width="42" height="20.5"/> | |
| <fontDescription key="fontDescription" type="system" pointSize="17"/> | |
| <color key="textColor" cocoaTouchSystemColor="darkTextColor"/> | |
| <nil key="highlightedColor"/> | |
| </label> | |
| <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="hG4-ug-beR"> | |
| <rect key="frame" x="279" y="227" width="42" height="20.5"/> | |
| <fontDescription key="fontDescription" type="system" pointSize="17"/> | |
| <color key="textColor" cocoaTouchSystemColor="darkTextColor"/> | |
| <nil key="highlightedColor"/> | |
| </label> | |
| </subviews> | |
| <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/> | |
| <constraints> | |
| <constraint firstAttribute="centerX" secondItem="Tiw-GD-Zb0" secondAttribute="centerX" id="22E-n9-cHn"/> | |
| <constraint firstAttribute="centerY" secondItem="Tiw-GD-Zb0" secondAttribute="centerY" id="e0l-lU-8iG"/> | |
| <constraint firstAttribute="centerX" secondItem="hG4-ug-beR" secondAttribute="centerX" id="hyd-U7-34x"/> | |
| <constraint firstItem="Tiw-GD-Zb0" firstAttribute="top" secondItem="hG4-ug-beR" secondAttribute="bottom" constant="42.5" id="iUf-7F-iNI"/> | |
| </constraints> | |
| </view> | |
| </viewController> | |
| <placeholder placeholderIdentifier="IBFirstResponder" id="qXy-ix-3p9" userLabel="First Responder" sceneMemberID="firstResponder"/> | |
| </objects> | |
| <point key="canvasLocation" x="228" y="284"/> | |
| </scene> | |
| </scenes> | |
| </document> |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Here's a very simple iOS storyboard with a single view controller, its view, and two labels that are horizontally centered. It should be fairly clear that this is safe to open in Xcode to play along.
Notice that line 37 specifies a spacing constraint with a constant of 42.5 pt. This should be okay, since coordinates on iOS are specified in floating point, and most iOS devices today can display half-point coordinates on full pixels.
Even if it's not okay—I'll even take "not a good idea"—there are a number of failure modes I'd accept, none of which are what actually happens.
Open this file on a 2x display (like a Retina MacBook Pro or, if you want to make me really jealous, a Retina 5K iMac) and you'll see everything is great. Open it on a 1x display and you'll see you have auto layout issues.
You can easily fix those auto layout issues by updating frames, but then if you move back to a 2x display, you'll have auto layout issues once again.
You can even see this in real time if you have one of each display and drag the Xcode window back and forth.
Steps to Reproduce:
Expected Results:
Any of the following:
Actual Results:
Endless streams of hilarity involving unfixable layout constraints.
Version:
Xcode 6.1(6A1052d)
OS X Yosemite 10.10 (14A389)
(Yes, I filed this as rdar://18889965)