Просмотр исходного кода

Merge branch 'Constraints' into BaseProject

Iñigo Valentin 9 лет назад
Родитель
Сommit
fbbb98aad2
6 измененных файлов с 36 добавлено и 58 удалено
  1. 5 4
      Section.xib
  2. 0 27
      app/BlogView.swift
  3. 17 14
      app/BlogView.xib
  4. 10 9
      app/GalleryView.xib
  5. 2 2
      app/HomeView.xib
  6. 2 2
      app/Info.plist

+ 5 - 4
Section.xib

@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="11762" systemVersion="16B2657" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="11762" systemVersion="16E195" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
     <device id="retina4_7" orientation="portrait">
         <adaptation id="fullscreen"/>
     </device>
@@ -21,11 +21,11 @@
             <rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
             <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
             <subviews>
-                <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="e7S-aL-6Ed" userLabel="Section">
+                <view contentMode="scaleAspectFill" translatesAutoresizingMaskIntoConstraints="NO" id="e7S-aL-6Ed" userLabel="Section">
                     <rect key="frame" x="10" y="10" width="355" height="647"/>
                     <subviews>
-                        <textView clipsSubviews="YES" multipleTouchEnabled="YES" userInteractionEnabled="NO" contentMode="scaleToFill" misplaced="YES" bounces="NO" scrollEnabled="NO" showsHorizontalScrollIndicator="NO" showsVerticalScrollIndicator="NO" editable="NO" text="Titulo" textAlignment="natural" translatesAutoresizingMaskIntoConstraints="NO" id="mYX-eR-Wot">
-                            <rect key="frame" x="0.0" y="0.0" width="375" height="30"/>
+                        <textView clipsSubviews="YES" multipleTouchEnabled="YES" userInteractionEnabled="NO" contentMode="scaleToFill" bounces="NO" scrollEnabled="NO" showsHorizontalScrollIndicator="NO" showsVerticalScrollIndicator="NO" editable="NO" text="Titulo" textAlignment="natural" translatesAutoresizingMaskIntoConstraints="NO" id="mYX-eR-Wot">
+                            <rect key="frame" x="0.0" y="0.0" width="355" height="27"/>
                             <color key="backgroundColor" red="0.0" green="0.47058823529999999" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                             <color key="textColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
                             <fontDescription key="fontDescription" type="boldSystem" pointSize="14"/>
@@ -39,6 +39,7 @@
                     <color key="backgroundColor" red="0.59607843140000005" green="0.7843137255" blue="1" alpha="1" colorSpace="calibratedRGB"/>
                     <constraints>
                         <constraint firstItem="mYX-eR-Wot" firstAttribute="bottom" secondItem="hhU-TV-XGc" secondAttribute="top" id="0JC-9a-fRi" userLabel="Section_Title.bottom=Content.top"/>
+                        <constraint firstItem="mYX-eR-Wot" firstAttribute="width" secondItem="e7S-aL-6Ed" secondAttribute="width" id="0xY-43-c4D"/>
                         <constraint firstItem="mYX-eR-Wot" firstAttribute="trailing" secondItem="hhU-TV-XGc" secondAttribute="trailing" id="4VF-IP-46O" userLabel="Section_Title.trailing=Content.trailing"/>
                         <constraint firstItem="mYX-eR-Wot" firstAttribute="leading" secondItem="hhU-TV-XGc" secondAttribute="leading" id="5pZ-0J-Mc4"/>
                         <constraint firstItem="hhU-TV-XGc" firstAttribute="top" secondItem="e7S-aL-6Ed" secondAttribute="top" constant="27" id="GaL-O1-uum"/>

+ 0 - 27
app/BlogView.swift

@@ -142,33 +142,6 @@ class BlogView: UIView {
 		} catch {
 			print("BLOG:ERROR: Error with request: \(error)")
 		}
-		
-		//Always at the end: update scrollview
-		var h: Int = 0
-		for view in scrollView.subviews {
-			//contentRect = contentRect.union(view.frame);
-			h = h + Int(view.frame.height) + 30 //Why 30?
-			print("BLOG:DEBUG: curh: \(h)")
-		}
-		// TODO: Calculate at the end
-		self.scrollView.contentSize.height = 2500//CGFloat(h);
-		
-		// The view controller
-		//var viewController: ViewController  = self.window?.rootViewController as! ViewController
-		
-		
-		//let viewController = UIApplication.topViewController() as! ViewController
-		
-		//viewController.showPost(id: 4)
-		
-		//print("BLOG:DEBUG: Show post on load.")
-		//self.delegate?.controller?.showPost(id: 4)
-		
-		//controller.showPost(id: 4)
-		
-		
-		
-		
 		print("BLOG:DEBUG: Finished loading BlogView")
 	}
 	

+ 17 - 14
app/BlogView.xib

@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="11762" systemVersion="16D32" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
-    <device id="retina3_5" orientation="portrait">
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="11762" systemVersion="16E195" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
+    <device id="retina5_5" orientation="portrait">
         <adaptation id="fullscreen"/>
     </device>
     <dependencies>
@@ -18,33 +18,33 @@
         </placeholder>
         <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
         <view contentMode="scaleToFill" id="iN0-l3-epB" userLabel="Container">
-            <rect key="frame" x="0.0" y="0.0" width="320" height="480"/>
+            <rect key="frame" x="0.0" y="0.0" width="414" height="736"/>
             <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
             <subviews>
-                <scrollView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" showsHorizontalScrollIndicator="NO" translatesAutoresizingMaskIntoConstraints="NO" id="V2d-fd-cjO">
-                    <rect key="frame" x="0.0" y="0.0" width="320" height="480"/>
+                <scrollView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" ambiguous="YES" alwaysBounceVertical="YES" showsHorizontalScrollIndicator="NO" translatesAutoresizingMaskIntoConstraints="NO" id="V2d-fd-cjO">
+                    <rect key="frame" x="0.0" y="0.0" width="414" height="736"/>
                     <subviews>
-                        <stackView contentMode="scaleToFill" axis="vertical" alignment="center" translatesAutoresizingMaskIntoConstraints="NO" id="Iqa-PQ-TOo">
-                            <rect key="frame" x="0.0" y="0.0" width="320" height="2200"/>
+                        <stackView contentMode="scaleToFill" ambiguous="YES" misplaced="YES" axis="vertical" alignment="center" translatesAutoresizingMaskIntoConstraints="NO" id="Iqa-PQ-TOo">
+                            <rect key="frame" x="0.0" y="0.0" width="414" height="2200"/>
                             <subviews>
-                                <view autoresizesSubviews="NO" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="xlt-p5-m6w" customClass="Section" customModule="app">
-                                    <rect key="frame" x="0.0" y="0.0" width="320" height="2200"/>
-                                    <constraints>
-                                        <constraint firstAttribute="height" constant="2200" id="dig-UC-mt1" userLabel="height = 2200"/>
-                                    </constraints>
+                                <view contentMode="scaleToFill" ambiguous="YES" translatesAutoresizingMaskIntoConstraints="NO" id="xlt-p5-m6w" customClass="Section" customModule="app">
+                                    <rect key="frame" x="0.0" y="0.0" width="414" height="2200"/>
                                     <edgeInsets key="layoutMargins" top="8" left="8" bottom="8" right="8"/>
                                 </view>
                             </subviews>
                             <constraints>
                                 <constraint firstItem="xlt-p5-m6w" firstAttribute="top" secondItem="Iqa-PQ-TOo" secondAttribute="top" id="ARG-5x-hIU"/>
                                 <constraint firstAttribute="bottom" secondItem="xlt-p5-m6w" secondAttribute="bottom" id="EIU-Wo-4hn"/>
-                                <constraint firstAttribute="height" constant="2200" id="FSh-mk-71J"/>
+                                <constraint firstItem="xlt-p5-m6w" firstAttribute="centerX" secondItem="Iqa-PQ-TOo" secondAttribute="centerX" id="cHf-jr-BYh"/>
+                                <constraint firstItem="xlt-p5-m6w" firstAttribute="width" secondItem="Iqa-PQ-TOo" secondAttribute="width" id="i9f-Kl-gsH"/>
                             </constraints>
                         </stackView>
                     </subviews>
                     <constraints>
                         <constraint firstItem="Iqa-PQ-TOo" firstAttribute="top" secondItem="V2d-fd-cjO" secondAttribute="top" id="JUm-Fl-IMw"/>
-                        <constraint firstAttribute="trailing" secondItem="Iqa-PQ-TOo" secondAttribute="trailing" id="NAr-lB-8Ty"/>
+                        <constraint firstItem="Iqa-PQ-TOo" firstAttribute="trailing" secondItem="V2d-fd-cjO" secondAttribute="trailing" id="NAr-lB-8Ty"/>
+                        <constraint firstItem="xlt-p5-m6w" firstAttribute="width" secondItem="V2d-fd-cjO" secondAttribute="width" id="beG-GV-zBi"/>
+                        <constraint firstItem="xlt-p5-m6w" firstAttribute="centerX" secondItem="V2d-fd-cjO" secondAttribute="centerX" id="tjw-ff-7cu"/>
                         <constraint firstItem="Iqa-PQ-TOo" firstAttribute="leading" secondItem="V2d-fd-cjO" secondAttribute="leading" id="wWa-rA-U3w"/>
                         <constraint firstAttribute="bottom" secondItem="Iqa-PQ-TOo" secondAttribute="bottom" id="x0w-9j-39f"/>
                     </constraints>
@@ -54,8 +54,11 @@
                 <constraint firstItem="V2d-fd-cjO" firstAttribute="width" secondItem="iN0-l3-epB" secondAttribute="width" id="JsC-UU-8eB"/>
                 <constraint firstItem="V2d-fd-cjO" firstAttribute="height" secondItem="iN0-l3-epB" secondAttribute="height" id="bBb-zb-kBf"/>
                 <constraint firstItem="V2d-fd-cjO" firstAttribute="top" secondItem="iN0-l3-epB" secondAttribute="top" id="ddT-DW-Knz"/>
+                <constraint firstItem="Iqa-PQ-TOo" firstAttribute="width" secondItem="iN0-l3-epB" secondAttribute="width" id="iYG-LX-UH4"/>
                 <constraint firstItem="V2d-fd-cjO" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" id="kdV-ei-kvf"/>
+                <constraint firstItem="Iqa-PQ-TOo" firstAttribute="centerX" secondItem="iN0-l3-epB" secondAttribute="centerX" id="uJX-4Y-e2l"/>
             </constraints>
+            <point key="canvasLocation" x="35.5" y="53.5"/>
         </view>
     </objects>
 </document>

+ 10 - 9
app/GalleryView.xib

@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="11762" systemVersion="16D32" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="11762" systemVersion="16E195" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
     <device id="retina4_7" orientation="portrait">
         <adaptation id="fullscreen"/>
     </device>
@@ -21,17 +21,14 @@
             <rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
             <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
             <subviews>
-                <scrollView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" showsHorizontalScrollIndicator="NO" translatesAutoresizingMaskIntoConstraints="NO" id="aoy-Mh-gpR">
+                <scrollView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" ambiguous="YES" alwaysBounceVertical="YES" showsHorizontalScrollIndicator="NO" translatesAutoresizingMaskIntoConstraints="NO" id="aoy-Mh-gpR">
                     <rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
                     <subviews>
-                        <stackView opaque="NO" contentMode="scaleToFill" axis="vertical" alignment="center" spacing="10" translatesAutoresizingMaskIntoConstraints="NO" id="ULw-PH-L95">
-                            <rect key="frame" x="0.0" y="0.0" width="320" height="3000"/>
+                        <stackView opaque="NO" contentMode="scaleToFill" ambiguous="YES" misplaced="YES" axis="vertical" alignment="center" spacing="10" translatesAutoresizingMaskIntoConstraints="NO" id="ULw-PH-L95">
+                            <rect key="frame" x="0.0" y="0.0" width="375" height="3000"/>
                             <subviews>
-                                <view autoresizesSubviews="NO" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="3TY-0K-6q1" customClass="Section" customModule="app">
-                                    <rect key="frame" x="0.0" y="0.0" width="320" height="3000"/>
-                                    <constraints>
-                                        <constraint firstAttribute="height" constant="3000" id="vPf-aG-EZ9"/>
-                                    </constraints>
+                                <view contentMode="scaleToFill" ambiguous="YES" translatesAutoresizingMaskIntoConstraints="NO" id="3TY-0K-6q1" customClass="Section" customModule="app">
+                                    <rect key="frame" x="0.0" y="0.0" width="375" height="3000"/>
                                     <edgeInsets key="layoutMargins" top="8" left="8" bottom="8" right="8"/>
                                 </view>
                             </subviews>
@@ -55,7 +52,11 @@
                 <constraint firstItem="aoy-Mh-gpR" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" id="53f-dW-QfI"/>
                 <constraint firstItem="aoy-Mh-gpR" firstAttribute="height" secondItem="iN0-l3-epB" secondAttribute="height" id="JAc-a5-eSB"/>
                 <constraint firstItem="aoy-Mh-gpR" firstAttribute="top" secondItem="iN0-l3-epB" secondAttribute="top" id="KbH-35-FjR"/>
+                <constraint firstItem="ULw-PH-L95" firstAttribute="centerX" secondItem="iN0-l3-epB" secondAttribute="centerX" id="Pmm-8v-Nel"/>
+                <constraint firstItem="3TY-0K-6q1" firstAttribute="centerX" secondItem="iN0-l3-epB" secondAttribute="centerX" id="SuI-4Q-EhS"/>
                 <constraint firstItem="aoy-Mh-gpR" firstAttribute="width" secondItem="iN0-l3-epB" secondAttribute="width" id="ftc-db-cKU"/>
+                <constraint firstItem="3TY-0K-6q1" firstAttribute="width" secondItem="iN0-l3-epB" secondAttribute="width" id="uuX-zc-aKY"/>
+                <constraint firstItem="ULw-PH-L95" firstAttribute="width" secondItem="iN0-l3-epB" secondAttribute="width" id="xne-RG-cs4"/>
             </constraints>
         </view>
     </objects>

+ 2 - 2
app/HomeView.xib

@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="11762" systemVersion="16D32" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="11762" systemVersion="16E195" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
     <device id="retina3_5" orientation="portrait">
         <adaptation id="fullscreen"/>
     </device>
@@ -33,7 +33,7 @@
                         <stackView opaque="NO" contentMode="scaleToFill" ambiguous="YES" misplaced="YES" axis="vertical" alignment="center" spacing="10" translatesAutoresizingMaskIntoConstraints="NO" id="gOz-rr-CeQ">
                             <rect key="frame" x="0.0" y="0.0" width="320" height="780"/>
                             <subviews>
-                                <view autoresizesSubviews="NO" contentMode="scaleToFill" ambiguous="YES" translatesAutoresizingMaskIntoConstraints="NO" id="Ljm-NP-c4e" customClass="Section" customModule="app">
+                                <view contentMode="scaleToFill" ambiguous="YES" translatesAutoresizingMaskIntoConstraints="NO" id="Ljm-NP-c4e" customClass="Section" customModule="app">
                                     <rect key="frame" x="0.0" y="0.0" width="320" height="50"/>
                                 </view>
                                 <view contentMode="scaleToFill" ambiguous="YES" translatesAutoresizingMaskIntoConstraints="NO" id="9nu-j1-wGI" customClass="Section" customModule="app">

+ 2 - 2
app/Info.plist

@@ -17,9 +17,9 @@
 	<key>CFBundlePackageType</key>
 	<string>APPL</string>
 	<key>CFBundleShortVersionString</key>
-	<string>1.0</string>
+	<string>0.0.1</string>
 	<key>CFBundleVersion</key>
-	<string>1</string>
+	<string>2</string>
 	<key>LSRequiresIPhoneOS</key>
 	<true/>
 	<key>UILaunchStoryboardName</key>