瀏覽代碼

Merge branch 'BaseProject'

Iñigo Valentin 9 年之前
父節點
當前提交
b6d4e5aca0
共有 2 個文件被更改,包括 209 次插入7 次删除
  1. 201 0
      app/Base.lproj/Main.storyboard
  2. 8 7
      app/PhotoViewController.swift

+ 201 - 0
app/Base.lproj/Main.storyboard

@@ -200,6 +200,7 @@
                         <segue destination="zJF-Mh-CNb" kind="show" identifier="SegueSchedule" id="A70-jo-yAP"/>
                         <segue destination="jfx-Q2-RtY" kind="show" identifier="SeguePastActivity" id="MmG-k2-wHn"/>
                         <segue destination="DDO-dI-c0J" kind="show" identifier="SegueFutureActivity" id="ec7-aO-4Ac"/>
+                        <segue destination="4tZ-ol-bgA" kind="show" identifier="SeguePhoto" id="bix-gF-Nro"/>
                     </connections>
                 </viewController>
                 <placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
@@ -696,6 +697,7 @@
                         <outlet property="albumView" destination="YEF-04-q7Y" id="7tR-Lr-9nh"/>
                         <outlet property="barButton" destination="Thj-0t-rxK" id="6bX-xo-abt"/>
                         <outlet property="barTitle" destination="LLe-aQ-Sbj" id="bFR-jT-Xmq"/>
+                        <segue destination="4tZ-ol-bgA" kind="show" identifier="SeguePhotoAlbum" id="I7s-Ej-GB6"/>
                     </connections>
                 </viewController>
                 <placeholder placeholderIdentifier="IBFirstResponder" id="GLj-OZ-Cqc" userLabel="First Responder" sceneMemberID="firstResponder"/>
@@ -1694,6 +1696,204 @@
             </objects>
             <point key="canvasLocation" x="-1570" y="277"/>
         </scene>
+        <!--Photo View Controller-->
+        <scene sceneID="fMl-8B-HVN">
+            <objects>
+                <viewController id="4tZ-ol-bgA" customClass="PhotoViewController" customModule="app" customModuleProvider="target" sceneMemberID="viewController">
+                    <layoutGuides>
+                        <viewControllerLayoutGuide type="top" id="Opn-kq-Afe"/>
+                        <viewControllerLayoutGuide type="bottom" id="6rI-ja-Srl"/>
+                    </layoutGuides>
+                    <view key="view" contentMode="scaleToFill" id="bzM-xk-bPL">
+                        <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="BaQ-A0-HNH" userLabel="Toolbar">
+                                <rect key="frame" x="0.0" y="20" width="375" height="30"/>
+                                <subviews>
+                                    <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="eUA-DI-pYf">
+                                        <rect key="frame" x="0.0" y="0.0" width="56.5" height="30"/>
+                                        <fontDescription key="fontDescription" type="boldSystem" pointSize="15"/>
+                                        <state key="normal" title="&lt;">
+                                            <color key="titleColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
+                                        </state>
+                                    </button>
+                                    <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Gasteizko Margolariak" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="die-Pc-rjK">
+                                        <rect key="frame" x="56.5" y="0.0" width="262.5" height="30"/>
+                                        <fontDescription key="fontDescription" type="boldSystem" pointSize="17"/>
+                                        <color key="textColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
+                                        <nil key="highlightedColor"/>
+                                    </label>
+                                </subviews>
+                                <color key="backgroundColor" red="0.0" green="0.47843137250000001" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                                <constraints>
+                                    <constraint firstItem="eUA-DI-pYf" firstAttribute="leading" secondItem="BaQ-A0-HNH" secondAttribute="leading" id="2iL-Mb-hfb"/>
+                                    <constraint firstItem="die-Pc-rjK" firstAttribute="width" secondItem="BaQ-A0-HNH" secondAttribute="width" multiplier="0.7" id="AkW-gH-v4x"/>
+                                    <constraint firstAttribute="height" constant="30" id="ExU-ba-SQB"/>
+                                    <constraint firstItem="die-Pc-rjK" firstAttribute="centerX" secondItem="BaQ-A0-HNH" secondAttribute="centerX" id="IV5-eB-hxH"/>
+                                    <constraint firstItem="eUA-DI-pYf" firstAttribute="centerY" secondItem="BaQ-A0-HNH" secondAttribute="centerY" id="QSe-Rk-KtW"/>
+                                    <constraint firstItem="die-Pc-rjK" firstAttribute="height" secondItem="BaQ-A0-HNH" secondAttribute="height" id="WQc-JG-RZs"/>
+                                    <constraint firstItem="eUA-DI-pYf" firstAttribute="height" secondItem="BaQ-A0-HNH" secondAttribute="height" id="thH-Nk-jcG"/>
+                                    <constraint firstItem="eUA-DI-pYf" firstAttribute="width" secondItem="BaQ-A0-HNH" secondAttribute="width" multiplier="0.15" id="wPx-Mr-FbG"/>
+                                    <constraint firstItem="die-Pc-rjK" firstAttribute="centerY" secondItem="BaQ-A0-HNH" secondAttribute="centerY" id="x4r-z4-bdk"/>
+                                </constraints>
+                            </view>
+                            <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="9Lg-UQ-FTH">
+                                <rect key="frame" x="0.0" y="50" width="375" height="617"/>
+                                <subviews>
+                                    <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="u6U-Bp-i7s" userLabel="Section">
+                                        <rect key="frame" x="10" y="10" width="355" height="597"/>
+                                        <subviews>
+                                            <label opaque="NO" userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" restorationIdentifier="Title" text="Title" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="EYj-yY-c90" userLabel="Title">
+                                                <rect key="frame" x="0.0" y="0.0" width="355" height="30"/>
+                                                <color key="backgroundColor" red="0.0" green="0.47058823529999999" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                                                <constraints>
+                                                    <constraint firstAttribute="height" constant="30" id="zmH-3Y-Iqr"/>
+                                                </constraints>
+                                                <fontDescription key="fontDescription" type="boldSystem" pointSize="14"/>
+                                                <color key="textColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
+                                                <nil key="highlightedColor"/>
+                                            </label>
+                                            <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="gxZ-ON-adS" userLabel="Entry">
+                                                <rect key="frame" x="10" y="40" width="335" height="547"/>
+                                                <subviews>
+                                                    <imageView userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="PhotoPlaceholder" translatesAutoresizingMaskIntoConstraints="NO" id="mFf-yO-29m">
+                                                        <rect key="frame" x="9.5" y="10" width="315" height="472"/>
+                                                    </imageView>
+                                                    <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Cqf-Ae-wxE">
+                                                        <rect key="frame" x="10" y="492" width="147.5" height="45"/>
+                                                        <color key="backgroundColor" red="0.070588235289999995" green="0.27058823529999998" blue="0.4039215686" alpha="1" colorSpace="calibratedRGB"/>
+                                                        <constraints>
+                                                            <constraint firstAttribute="height" constant="45" id="nvE-Vu-qnt"/>
+                                                        </constraints>
+                                                        <fontDescription key="fontDescription" type="boldSystem" pointSize="21"/>
+                                                        <state key="normal" title="&lt;">
+                                                            <color key="titleColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
+                                                        </state>
+                                                        <userDefinedRuntimeAttributes>
+                                                            <userDefinedRuntimeAttribute type="color" keyPath="borderColor">
+                                                                <color key="value" red="0.0" green="0.47058823529999999" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                                                            </userDefinedRuntimeAttribute>
+                                                            <userDefinedRuntimeAttribute type="number" keyPath="borderWidth">
+                                                                <real key="value" value="2"/>
+                                                            </userDefinedRuntimeAttribute>
+                                                            <userDefinedRuntimeAttribute type="number" keyPath="cornerRadius">
+                                                                <real key="value" value="4"/>
+                                                            </userDefinedRuntimeAttribute>
+                                                        </userDefinedRuntimeAttributes>
+                                                    </button>
+                                                    <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="MQZ-1L-ljd">
+                                                        <rect key="frame" x="177.5" y="492" width="147.5" height="45"/>
+                                                        <color key="backgroundColor" red="0.070588235289999995" green="0.27058823529999998" blue="0.4039215686" alpha="1" colorSpace="calibratedRGB"/>
+                                                        <constraints>
+                                                            <constraint firstAttribute="height" constant="45" id="sEQ-1N-CWo"/>
+                                                        </constraints>
+                                                        <fontDescription key="fontDescription" type="boldSystem" pointSize="21"/>
+                                                        <state key="normal" title="&gt;">
+                                                            <color key="titleColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
+                                                        </state>
+                                                        <userDefinedRuntimeAttributes>
+                                                            <userDefinedRuntimeAttribute type="color" keyPath="borderColor">
+                                                                <color key="value" red="0.0" green="0.47058823529999999" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                                                            </userDefinedRuntimeAttribute>
+                                                            <userDefinedRuntimeAttribute type="number" keyPath="borderWidth">
+                                                                <real key="value" value="2"/>
+                                                            </userDefinedRuntimeAttribute>
+                                                            <userDefinedRuntimeAttribute type="number" keyPath="cornerRadius">
+                                                                <real key="value" value="4"/>
+                                                            </userDefinedRuntimeAttribute>
+                                                        </userDefinedRuntimeAttributes>
+                                                    </button>
+                                                </subviews>
+                                                <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
+                                                <constraints>
+                                                    <constraint firstItem="mFf-yO-29m" firstAttribute="top" secondItem="gxZ-ON-adS" secondAttribute="top" constant="10" id="0uU-eB-coG"/>
+                                                    <constraint firstItem="mFf-yO-29m" firstAttribute="bottom" secondItem="Cqf-Ae-wxE" secondAttribute="top" constant="-10" id="MnH-et-D3H"/>
+                                                    <constraint firstAttribute="trailing" secondItem="MQZ-1L-ljd" secondAttribute="trailing" constant="10" id="S4h-cI-HfM"/>
+                                                    <constraint firstItem="mFf-yO-29m" firstAttribute="centerX" secondItem="gxZ-ON-adS" secondAttribute="centerX" id="To2-t2-uof"/>
+                                                    <constraint firstItem="Cqf-Ae-wxE" firstAttribute="width" secondItem="gxZ-ON-adS" secondAttribute="width" multiplier="0.5" constant="-20" id="YMY-6W-p3h"/>
+                                                    <constraint firstItem="Cqf-Ae-wxE" firstAttribute="leading" secondItem="gxZ-ON-adS" secondAttribute="leading" constant="10" id="bhl-Iy-4zb"/>
+                                                    <constraint firstAttribute="bottom" secondItem="Cqf-Ae-wxE" secondAttribute="bottom" constant="10" id="l2C-WB-HVK"/>
+                                                    <constraint firstItem="mFf-yO-29m" firstAttribute="width" secondItem="gxZ-ON-adS" secondAttribute="width" constant="-20" id="tFW-oS-t1f"/>
+                                                    <constraint firstAttribute="bottom" secondItem="MQZ-1L-ljd" secondAttribute="bottom" constant="10" id="tn4-RY-4BE"/>
+                                                    <constraint firstItem="MQZ-1L-ljd" firstAttribute="width" secondItem="gxZ-ON-adS" secondAttribute="width" multiplier="0.5" constant="-20" id="yRi-AD-sjm"/>
+                                                </constraints>
+                                                <edgeInsets key="layoutMargins" top="8" left="8" bottom="8" right="8"/>
+                                                <userDefinedRuntimeAttributes>
+                                                    <userDefinedRuntimeAttribute type="color" keyPath="borderColor">
+                                                        <color key="value" red="0.42745098040000001" green="0.41176470590000003" blue="0.56470588239999997" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                                                    </userDefinedRuntimeAttribute>
+                                                    <userDefinedRuntimeAttribute type="number" keyPath="borderWidth">
+                                                        <real key="value" value="1"/>
+                                                    </userDefinedRuntimeAttribute>
+                                                    <userDefinedRuntimeAttribute type="number" keyPath="cornerRadius">
+                                                        <real key="value" value="3"/>
+                                                    </userDefinedRuntimeAttribute>
+                                                </userDefinedRuntimeAttributes>
+                                            </view>
+                                        </subviews>
+                                        <color key="backgroundColor" red="0.59607843140000005" green="0.7843137255" blue="1" alpha="1" colorSpace="calibratedRGB"/>
+                                        <constraints>
+                                            <constraint firstItem="gxZ-ON-adS" firstAttribute="top" secondItem="EYj-yY-c90" secondAttribute="bottom" constant="10" id="5hs-Qv-K5M"/>
+                                            <constraint firstItem="gxZ-ON-adS" firstAttribute="width" secondItem="u6U-Bp-i7s" secondAttribute="width" constant="-20" id="9Q1-Cl-Qkk"/>
+                                            <constraint firstAttribute="bottom" secondItem="gxZ-ON-adS" secondAttribute="bottom" constant="10" id="AuW-rT-BGI"/>
+                                            <constraint firstItem="EYj-yY-c90" firstAttribute="centerX" secondItem="u6U-Bp-i7s" secondAttribute="centerX" id="Mjg-u1-OII"/>
+                                            <constraint firstItem="gxZ-ON-adS" firstAttribute="centerX" secondItem="u6U-Bp-i7s" secondAttribute="centerX" id="eaK-ly-nwU"/>
+                                            <constraint firstItem="EYj-yY-c90" firstAttribute="width" secondItem="u6U-Bp-i7s" secondAttribute="width" id="hk3-D2-VEG"/>
+                                            <constraint firstItem="EYj-yY-c90" firstAttribute="top" secondItem="u6U-Bp-i7s" secondAttribute="top" id="qX7-rw-fgS"/>
+                                        </constraints>
+                                        <edgeInsets key="layoutMargins" top="10" left="10" bottom="10" right="10"/>
+                                        <userDefinedRuntimeAttributes>
+                                            <userDefinedRuntimeAttribute type="color" keyPath="borderColor">
+                                                <color key="value" red="0.0" green="0.0" blue="0.066666666669999999" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                                            </userDefinedRuntimeAttribute>
+                                            <userDefinedRuntimeAttribute type="number" keyPath="borderWidth">
+                                                <real key="value" value="1"/>
+                                            </userDefinedRuntimeAttribute>
+                                            <userDefinedRuntimeAttribute type="number" keyPath="cornerRadius">
+                                                <real key="value" value="8"/>
+                                            </userDefinedRuntimeAttribute>
+                                        </userDefinedRuntimeAttributes>
+                                    </view>
+                                </subviews>
+                                <color key="backgroundColor" red="0.70980392160000005" green="0.82745098039999998" blue="0.8980392157" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                                <constraints>
+                                    <constraint firstItem="u6U-Bp-i7s" firstAttribute="height" secondItem="9Lg-UQ-FTH" secondAttribute="height" constant="-20" id="9F9-pF-CuK"/>
+                                    <constraint firstItem="u6U-Bp-i7s" firstAttribute="centerY" secondItem="9Lg-UQ-FTH" secondAttribute="centerY" id="H6J-WU-Q92"/>
+                                    <constraint firstItem="u6U-Bp-i7s" firstAttribute="width" secondItem="9Lg-UQ-FTH" secondAttribute="width" constant="-20" id="p1U-mr-Iy6"/>
+                                    <constraint firstItem="u6U-Bp-i7s" firstAttribute="centerX" secondItem="9Lg-UQ-FTH" secondAttribute="centerX" id="yhK-RB-pdM"/>
+                                </constraints>
+                                <userDefinedRuntimeAttributes>
+                                    <userDefinedRuntimeAttribute type="color" keyPath="borderColor">
+                                        <color key="value" red="0.70980392160000005" green="0.82745098039999998" blue="0.8980392157" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                                    </userDefinedRuntimeAttribute>
+                                </userDefinedRuntimeAttributes>
+                            </view>
+                        </subviews>
+                        <color key="backgroundColor" red="0.0" green="0.47058823529999999" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                        <constraints>
+                            <constraint firstItem="9Lg-UQ-FTH" firstAttribute="width" secondItem="bzM-xk-bPL" secondAttribute="width" id="GAe-bd-Ipt"/>
+                            <constraint firstItem="6rI-ja-Srl" firstAttribute="top" secondItem="9Lg-UQ-FTH" secondAttribute="bottom" id="GUf-jY-PCf"/>
+                            <constraint firstItem="9Lg-UQ-FTH" firstAttribute="centerX" secondItem="bzM-xk-bPL" secondAttribute="centerX" id="Hx8-Vg-nqJ"/>
+                            <constraint firstItem="BaQ-A0-HNH" firstAttribute="centerX" secondItem="bzM-xk-bPL" secondAttribute="centerX" id="Kk9-tt-lnC"/>
+                            <constraint firstItem="BaQ-A0-HNH" firstAttribute="width" secondItem="bzM-xk-bPL" secondAttribute="width" id="V1F-8K-cU1"/>
+                            <constraint firstItem="9Lg-UQ-FTH" firstAttribute="top" secondItem="BaQ-A0-HNH" secondAttribute="bottom" id="Xl9-XD-oeM"/>
+                            <constraint firstItem="BaQ-A0-HNH" firstAttribute="top" secondItem="Opn-kq-Afe" secondAttribute="bottom" id="xhM-RE-c7d"/>
+                        </constraints>
+                    </view>
+                    <connections>
+                        <outlet property="barButton" destination="eUA-DI-pYf" id="8JX-b7-gxu"/>
+                        <outlet property="barTitle" destination="die-Pc-rjK" id="kWD-lr-E3l"/>
+                        <outlet property="btNext" destination="MQZ-1L-ljd" id="DYd-iu-ICx"/>
+                        <outlet property="btPrev" destination="Cqf-Ae-wxE" id="bLd-5h-vIg"/>
+                        <outlet property="photoImage" destination="mFf-yO-29m" id="0Bt-aX-U5H"/>
+                        <outlet property="photoTitle" destination="EYj-yY-c90" id="JFS-XL-dda"/>
+                    </connections>
+                </viewController>
+                <placeholder placeholderIdentifier="IBFirstResponder" id="OaV-ZO-db2" userLabel="First Responder" sceneMemberID="firstResponder"/>
+            </objects>
+            <point key="canvasLocation" x="-2788" y="690"/>
+        </scene>
     </scenes>
     <resources>
         <image name="GM" width="120" height="120"/>
@@ -1702,6 +1902,7 @@
         <image name="Pinpoint" width="10" height="13"/>
     </resources>
     <inferredMetricsTieBreakers>
+        <segue reference="bix-gF-Nro"/>
         <segue reference="0Qp-db-Qb0"/>
     </inferredMetricsTieBreakers>
 </document>

+ 8 - 7
app/PhotoViewController.swift

@@ -31,7 +31,7 @@ class PhotoViewController: UIViewController, UIGestureRecognizerDelegate {
 	@IBOutlet weak var barTitle: UILabel!
 	@IBOutlet weak var photoTitle: UILabel!
 	@IBOutlet weak var photoImage: UIImageView!
-	@IBOutlet weak var photoDate: UILabel!
+	//@IBOutlet weak var photoDate: UILabel!
 	@IBOutlet weak var btPrev: UIButton!
 	@IBOutlet weak var btNext: UIButton!
 	
@@ -168,12 +168,13 @@ class PhotoViewController: UIViewController, UIGestureRecognizerDelegate {
 			var image: String
 			var date: NSDate
 			
-			for r in searchResults as [NSManagedObject] {
+			//for r in searchResults as [NSManagedObject] {
+			let r = searchResults[0]
 				
-				sTitle = r.value(forKey: "title_\(lang)")! as! String
-				if sTitle == "" || sTitle == "ul" {
+				//sTitle = r.value(forKey: "title_\(lang)")! as! String
+				//if sTitle == "" || sTitle == "ul" {
 					sTitle = self.albumTitle
-				}
+				//}
 				self.photoTitle.text = "  \(sTitle.decode().stripHtml())"
 				
 				// Enable or disable buttons
@@ -206,13 +207,13 @@ class PhotoViewController: UIViewController, UIGestureRecognizerDelegate {
 					let path = "img/galeria/preview/\(image)"
 					// TODO: Every time, set placeholder image
 					self.photoImage.setImage(localPath: path, remotePath: "https://margolariak.com/\(path)")
-					self.photoDate.text = formatDate(date: date, lang: lang)
+					//self.photoDate.text = formatDate(date: date, lang: lang)
 				}
 				catch {
 					NSLog(":PHOTO:ERROR: Error getting image for post \(id): \(error)")
 				}
 				
-			}
+			//}
 		} catch {
 			NSLog(":PHOTO:ERROR: Error setting up photo \(id): \(error)")
 		}