소스 검색

Managed to make rows visible

Iñigo Valentin 9 년 전
부모
커밋
0273ccb55c

+ 24 - 17
Section.xib

@@ -12,7 +12,7 @@
         <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="Section">
             <connections>
                 <outlet property="container" destination="iN0-l3-epB" id="Wlw-JP-OOQ"/>
-                <outlet property="content" destination="PeG-j2-Npa" id="iLe-Gu-TMy"/>
+                <outlet property="content" destination="hhU-TV-XGc" id="xAE-Nj-VrU"/>
                 <outlet property="title" destination="mYX-eR-Wot" id="a6d-ku-3LY"/>
             </connections>
         </placeholder>
@@ -21,29 +21,36 @@
             <rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
             <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
             <subviews>
-                <view contentMode="scaleToFill" misplaced="YES" translatesAutoresizingMaskIntoConstraints="NO" id="e7S-aL-6Ed" userLabel="Section">
-                    <rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
+                <view contentMode="scaleToFill" 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" contentMode="scaleToFill" fixedFrame="YES" text="Titulo" textAlignment="natural" translatesAutoresizingMaskIntoConstraints="NO" id="mYX-eR-Wot">
-                            <rect key="frame" x="0.0" y="0.0" width="375" height="34"/>
-                            <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
+                        <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"/>
                             <color key="backgroundColor" red="0.23731978796769859" green="0.48982898252051899" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                             <color key="textColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
                             <fontDescription key="fontDescription" type="boldSystem" pointSize="14"/>
                             <textInputTraits key="textInputTraits" autocapitalizationType="sentences"/>
                         </textView>
-                        <view contentMode="scaleToFill" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="PeG-j2-Npa" userLabel="Content">
-                            <rect key="frame" x="0.0" y="33" width="375" height="634"/>
-                            <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
-                            <color key="backgroundColor" red="0.59607843137254901" green="0.78431372549019607" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
-                        </view>
+                        <stackView opaque="NO" contentMode="scaleToFill" axis="vertical" translatesAutoresizingMaskIntoConstraints="NO" id="hhU-TV-XGc" userLabel="Content">
+                            <rect key="frame" x="0.0" y="27" width="355" height="620"/>
+                        </stackView>
                     </subviews>
+                    <constraints>
+                        <constraint firstItem="mYX-eR-Wot" firstAttribute="bottom" secondItem="hhU-TV-XGc" secondAttribute="top" id="0JC-9a-fRi"/>
+                        <constraint firstItem="mYX-eR-Wot" firstAttribute="trailing" secondItem="hhU-TV-XGc" secondAttribute="trailing" id="4VF-IP-46O"/>
+                        <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"/>
+                        <constraint firstAttribute="trailing" secondItem="hhU-TV-XGc" secondAttribute="trailing" id="IEf-ra-MWR"/>
+                        <constraint firstAttribute="bottom" secondItem="hhU-TV-XGc" secondAttribute="bottom" id="LWh-iK-25D"/>
+                        <constraint firstItem="mYX-eR-Wot" firstAttribute="leading" secondItem="e7S-aL-6Ed" secondAttribute="leading" id="PeJ-Ts-OCF"/>
+                        <constraint firstItem="mYX-eR-Wot" firstAttribute="top" secondItem="e7S-aL-6Ed" secondAttribute="top" id="f9V-iV-6wB"/>
+                    </constraints>
                     <userDefinedRuntimeAttributes>
                         <userDefinedRuntimeAttribute type="color" keyPath="borderColor">
                             <color key="value" red="0.0" green="0.0" blue="0.066666666666666666" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                         </userDefinedRuntimeAttribute>
                         <userDefinedRuntimeAttribute type="number" keyPath="borderWidth">
-                            <real key="value" value="3"/>
+                            <real key="value" value="1"/>
                         </userDefinedRuntimeAttribute>
                         <userDefinedRuntimeAttribute type="number" keyPath="cornerRadius">
                             <real key="value" value="8"/>
@@ -53,17 +60,17 @@
             </subviews>
             <color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
             <constraints>
-                <constraint firstAttribute="trailing" secondItem="e7S-aL-6Ed" secondAttribute="trailing" constant="10" id="Awe-dm-9Bj"/>
-                <constraint firstItem="e7S-aL-6Ed" firstAttribute="top" secondItem="iN0-l3-epB" secondAttribute="top" constant="10" id="fWW-UC-yU1"/>
-                <constraint firstAttribute="bottom" secondItem="e7S-aL-6Ed" secondAttribute="bottom" constant="10" id="oLA-Ar-sdL"/>
-                <constraint firstItem="e7S-aL-6Ed" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" constant="10" id="pNB-w5-2Zm"/>
+                <constraint firstItem="e7S-aL-6Ed" firstAttribute="top" secondItem="iN0-l3-epB" secondAttribute="top" constant="10" id="0Kw-6t-Izr"/>
+                <constraint firstItem="e7S-aL-6Ed" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" constant="10" id="WVI-h0-OgP"/>
+                <constraint firstAttribute="bottom" secondItem="e7S-aL-6Ed" secondAttribute="bottom" constant="10" id="Zde-I3-ww6"/>
+                <constraint firstAttribute="trailing" secondItem="e7S-aL-6Ed" secondAttribute="trailing" constant="10" id="p8h-b4-Zxb"/>
             </constraints>
             <userDefinedRuntimeAttributes>
                 <userDefinedRuntimeAttribute type="number" keyPath="cornerRadius">
                     <real key="value" value="4"/>
                 </userDefinedRuntimeAttribute>
             </userDefinedRuntimeAttributes>
-            <point key="canvasLocation" x="-410" y="72"/>
+            <point key="canvasLocation" x="-409.5" y="74.5"/>
         </view>
     </objects>
 </document>

BIN
app.xcodeproj/project.xcworkspace/xcuserdata/seavenois.xcuserdatad/UserInterfaceState.xcuserstate


+ 22 - 14
app/HomeView.swift

@@ -41,6 +41,10 @@ class HomeView: UIView {
 	@IBOutlet weak var pastActivitiesSection: Section!
 	@IBOutlet weak var socialSection: Section!
 	
+	override init(frame: CGRect){
+		super.init(frame: frame)
+	}
+	
 	/**
 	 Run when the view is started.
 	*/
@@ -70,7 +74,7 @@ class HomeView: UIView {
 		let lang : String = getLanguage()
 		
 		//Populate sections
-		setUpPastActivities(context: moc, delegate: appDelegate, lang: lang, parent: pastActivitiesSection.getContentView())
+		setUpPastActivities(context: moc, delegate: appDelegate, lang: lang, parent: pastActivitiesSection.getContentStack())
 		
 		//Always at the end: update scrollview
 		var h: Int = 0
@@ -93,7 +97,7 @@ class HomeView: UIView {
 		}
 	}
 	
-	func setUpPastActivities(context : NSManagedObjectContext, delegate: AppDelegate, lang: String, parent : UIView){
+	func setUpPastActivities(context : NSManagedObjectContext, delegate: AppDelegate, lang: String, parent : UIStackView){
 		
 		context.persistentStoreCoordinator = delegate.persistentStoreCoordinator
 		let fetchRequest: NSFetchRequest<Activity> = Activity.fetchRequest()
@@ -102,7 +106,7 @@ class HomeView: UIView {
 		fetchRequest.sortDescriptors = sortDescriptors
 		//TODO Compare dates
 		//fetchRequest.predicate = NSPredicate(format: "date < %@", sysdate)
-		fetchRequest.fetchLimit = 2
+		fetchRequest.fetchLimit = 1//2
 		
 		do {
 			//go get the results
@@ -123,25 +127,29 @@ class HomeView: UIView {
 				
 				
 				//Create a new row
-				row = RowHomePastActivities(s: "rowHomePastActivities", i: count) //frame: CGRect(top: 0, left: 0, width: 200, height: 50)
+				row = RowHomePastActivities.init(s: "rowHomePastActivities", i: count) //frame: CGRect(top: 0, left: 0, width: 200, height: 50)
+				//row = RowHomePastActivities(frame: parent.bounds)
+				//row = RowHomePastActivities.instanceFromNib() as! RowHomePastActivities
 				//row.frame = CGRect(x: 15, y: 15, width: 100, height: 100)
-				//row = RowHomePastActivities(frame: CGRect(x: 13, y: 13, width: 100, height: 100))
+				//row = RowHomePastActivities(frame: CGRect(x: 13, y: 0, width: 100, height: 100))
 				title = r.value(forKey: "permalink")! as! String
 				print(title)
 				row.setTitle(text: title)
-				row.backgroundColor = UIColor.red
+				//row.backgroundColor = UIColor.red
 				//row.setBounds(rect: parent.bounds)
-				parent.addSubview(row)
+				
+				parent.addArrangedSubview(row)
+				//parent.addSubview(row)
 				let lbl = UILabel()
 				lbl.text = "ABBA"
 				//view.addEntry(view: row)
-				//parent.addSubview(lbl)
-				var testView: UIView = UIView(frame: CGRect(x: 13, y: 13, width: 100, height: 100))
-    testView.backgroundColor = UIColor.blue
-    testView.alpha = 0.5
-    testView.tag = 100
-    testView.isUserInteractionEnabled = true
-    parent.addSubview(testView)
+				parent.addArrangedSubview(lbl)
+				//var testView: UIView = UIView(frame: CGRect(x: 13, y: 13, width: 100, height: 100))
+    //testView.backgroundColor = UIColor.blue
+    //testView.alpha = 0.5
+    //testView.tag = 100
+    //testView.isUserInteractionEnabled = true
+    //parent.addSubview(testView)
 				
 				//parent.addConstraint(NSLayoutConstraint(item: row, attribute: NSLayoutAttribute.right, relatedBy: NSLayoutRelation.equal, toItem: parent, attribute: NSLayoutAttribute.right, multiplier: 1, constant: -10))
 				//Íparent.addConstraint(NSLayoutConstraint(item: row, attribute: NSLayoutAttribute.bottom, relatedBy: NSLayoutRelation.equal, toItem: parent, attribute: NSLayoutAttribute.bottom, multiplier: 1, constant: -10))

+ 7 - 7
app/HomeView.xib

@@ -30,48 +30,48 @@
                 <scrollView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" showsHorizontalScrollIndicator="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Poy-ba-9jX">
                     <rect key="frame" x="0.0" y="0.0" width="320" height="480"/>
                     <subviews>
-                        <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Ljm-NP-c4e" customClass="Section" customModule="app" customModuleProvider="target">
+                        <view alpha="0.20000000000000001" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Ljm-NP-c4e" customClass="Section" customModule="app" customModuleProvider="target">
                             <rect key="frame" x="0.0" y="0.0" width="320" height="120"/>
                             <constraints>
                                 <constraint firstAttribute="height" constant="120" identifier="HomeView.Location.height" id="4XI-rg-Du1"/>
                             </constraints>
                         </view>
-                        <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="9nu-j1-wGI" customClass="Section" customModule="app" customModuleProvider="target">
+                        <view alpha="0.29999999999999999" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="9nu-j1-wGI" customClass="Section" customModule="app" customModuleProvider="target">
                             <rect key="frame" x="0.0" y="120" width="320" height="120"/>
                             <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
                             <constraints>
                                 <constraint firstAttribute="height" constant="120" identifier="HomeView.Lablanca.height" id="B0a-14-gfY"/>
                             </constraints>
                         </view>
-                        <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="FQo-nm-4Mo" customClass="Section" customModule="app" customModuleProvider="target">
+                        <view alpha="0.40000000000000002" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="FQo-nm-4Mo" customClass="Section" customModule="app" customModuleProvider="target">
                             <rect key="frame" x="0.0" y="240" width="320" height="120"/>
                             <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
                             <constraints>
                                 <constraint firstAttribute="height" constant="120" identifier="HomeView.FActivity.height" id="AJi-J2-weg"/>
                             </constraints>
                         </view>
-                        <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="uHa-Mu-U68" customClass="Section" customModule="app" customModuleProvider="target">
+                        <view alpha="0.5" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="uHa-Mu-U68" customClass="Section" customModule="app" customModuleProvider="target">
                             <rect key="frame" x="0.0" y="360" width="320" height="120"/>
                             <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
                             <constraints>
                                 <constraint firstAttribute="height" constant="120" identifier="HomeView.Blog.Height" id="bV3-sl-7SD"/>
                             </constraints>
                         </view>
-                        <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="v6A-Ya-esA" customClass="Section" customModule="app" customModuleProvider="target">
+                        <view alpha="0.59999999999999998" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="v6A-Ya-esA" customClass="Section" customModule="app" customModuleProvider="target">
                             <rect key="frame" x="28" y="480" width="320" height="120"/>
                             <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
                             <constraints>
                                 <constraint firstAttribute="height" constant="120" identifier="HomeView.Gallery.Height" id="vSS-A6-4QV"/>
                             </constraints>
                         </view>
-                        <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="fZk-r1-Tca" customClass="Section" customModule="app" customModuleProvider="target">
+                        <view alpha="0.69999999999999996" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="fZk-r1-Tca" customClass="Section" customModule="app" customModuleProvider="target">
                             <rect key="frame" x="160" y="600" width="0.0" height="0.0"/>
                             <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
                             <constraints>
                                 <constraint firstAttribute="height" constant="120" identifier="HomeView.PActivity.height" id="6SU-vG-oBN"/>
                             </constraints>
                         </view>
-                        <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="dgk-s8-xje" customClass="Section" customModule="app" customModuleProvider="target">
+                        <view alpha="0.59999999999999998" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="dgk-s8-xje" customClass="Section" customModule="app" customModuleProvider="target">
                             <rect key="frame" x="83" y="600" width="320" height="15"/>
                             <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
                             <constraints>

+ 52 - 10
app/RowHomePastActivities.swift

@@ -26,19 +26,25 @@ Extension of UIView to be formatted as sections.
 */
 @IBDesignable class RowHomePastActivities: UIView {
 	
+	//This view
+	var v: UIView!
+	
 	//The container.
+	@IBOutlet weak var container: UIView!
+	@IBOutlet weak var entry: UIView!
 	
 	
 	//The activity title.
 	@IBOutlet weak var title: UILabel!
+	@IBOutlet weak var descrip: UILabel!
+	
 	
 	
 	
 	//The acvtivity text.
-	@IBOutlet weak var descrip: UILabel!
 	
 	
-	@IBOutlet weak var container: UIView!
+	
 	
 	/**
 	Run when the section is loaded.
@@ -47,23 +53,59 @@ Extension of UIView to be formatted as sections.
 		super.init(coder: aDecoder)
 	}
 	
+	private func loadViewFromNib() -> UIView {
+		let bundle = Bundle(for: type(of: self))
+		let nib = UINib(nibName: String(describing: type(of: self)), bundle: bundle)
+		let nibView = nib.instantiate(withOwner: self, options: nil).first as! UIView
+		
+		return nibView
+	}
+	
 	init(s: String, i: Int) {
 		//self.s = s
 		//self.i = i
-		super.init(frame: CGRect(x: 00, y: 0, width: 200, height: 150))
-		Bundle.main.loadNibNamed("RowHomePastActivities", owner: self, options: nil)
-		self.addSubview(container)
+		super.init(frame: CGRect(x: 20, y: 100, width: 200, height: 450))
+		print("Constructor: Custom")
+		//self.bounds = CGRect(x: 00, y: 0, width: 200, height: 150)
+		//v = loadViewFromNib()
+		loadViewFromNib()
+		v = self
+		v.frame = bounds
+		v.autoresizingMask = [.flexibleWidth, .flexibleHeight]
+		v.translatesAutoresizingMaskIntoConstraints = true
+		v.backgroundColor = UIColor.green
+			//Bundle.main.loadNibNamed("RowHomePastActivities", owner: self, options: nil)
+		//self.addSubview(container)
 		//container.frame = CGRect(x: 20, y: 100, width: 100, height: 150)
 		//container.frame = CGRect(x: 20, y: 0, width: 100, height: 150)
 		container.backgroundColor = UIColor.green
+		container.autoresizingMask = [.flexibleWidth, .flexibleHeight]
+		container.translatesAutoresizingMaskIntoConstraints = true
+		self.backgroundColor = UIColor.red
+		self.borderColor = UIColor.blue
+		self.borderWidth = 3
 		//container.bounds = self.bounds//CGRect(x: 20, y: 100, width: 10, height: 10)
 		//title.frame = self.bounds
-		container.addSubview(title)
+		
 		print("bounds")
 		//title.frame = container.bounds//CGRect(x: 30, y: 150, width: 80, height: 100)
-		title.frame = CGRect(x: 0, y: 0, width: 50, height: 15)
-		title.bounds = CGRect(x: 0, y: 0, width: 50, height: 15)
+		//title.frame = CGRect(x: 0, y: 0, width: 50, height: 15)
+		//title.bounds = CGRect(x: 0, y: 0, width: 50, height: 15)
 		//title.bounds = CGRec
+		container.frame = v.frame
+		//container.frame = CGRect(x: self.bounds.origin.x, y: self.bounds.origin.y, width: self.bounds.width, height: self.bounds.height)
+		v.addSubview(container)
+		title.frame = self.bounds
+		container.addSubview(title)
+		//container.autoresizingMask = [UIViewAutoresizing.flexibleWidth, UIViewAutoresizing.flexibleHeight]
+		
+		let lbl = UILabel()
+		lbl.text = "ABBA2"
+		lbl.frame = v.bounds
+		//view.addEntry(view: row)
+		v.addSubview(lbl)
+		
+		
 	}
 	
 	override init(frame: CGRect){
@@ -80,8 +122,8 @@ Extension of UIView to be formatted as sections.
 	*/
 	func setTitle(text: String){
 		print("Setting title: \(text)")
-		title.text = text
-		descrip.text = text
+		//title.text = text
+		//descrip.text = text
 	}
 	
 	/**

+ 16 - 20
app/RowHomePastActivities.xib

@@ -10,20 +10,21 @@
         <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
     </dependencies>
     <objects>
-        <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="RowHomePastActivities" customModule="app" customModuleProvider="target">
+        <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="RowHomePastActivities" customModule="app">
             <connections>
-                <outlet property="container" destination="2hI-rc-KPm" id="0ga-QO-cvj"/>
-                <outlet property="descrip" destination="f4E-5p-Bid" id="ihi-Bg-Jib"/>
-                <outlet property="title" destination="Bkz-DV-HVr" id="2ey-2J-PCM"/>
+                <outlet property="container" destination="2hI-rc-KPm" id="rWX-Vl-kOp"/>
+                <outlet property="descrip" destination="f4E-5p-Bid" id="IF5-ck-qUL"/>
+                <outlet property="entry" destination="wLM-VU-VYk" id="Gkq-yE-fdN"/>
+                <outlet property="title" destination="Bkz-DV-HVr" id="L4e-zP-foa"/>
             </connections>
         </placeholder>
         <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
-        <view contentMode="scaleToFill" id="iN0-l3-epB" userLabel="RowHomePastActivities" customClass="RowHomePastActivities" customModule="app" customModuleProvider="target">
+        <view contentMode="scaleToFill" id="iN0-l3-epB" userLabel="RowHomePastActivities" customClass="RowHomePastActivities" customModule="app">
             <rect key="frame" x="0.0" y="0.0" width="320" height="568"/>
             <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
             <subviews>
-                <view alpha="0.55000000000000004" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="2hI-rc-KPm" userLabel="Container">
-                    <rect key="frame" x="0.0" y="0.0" width="320" height="568"/>
+                <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="2hI-rc-KPm" userLabel="Container">
+                    <rect key="frame" x="0.0" y="0.0" width="320" height="320"/>
                     <subviews>
                         <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="wLM-VU-VYk" userLabel="Entry">
                             <rect key="frame" x="0.0" y="0.0" width="320" height="144"/>
@@ -80,9 +81,9 @@
                     </subviews>
                     <color key="backgroundColor" red="1" green="0.0" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                     <constraints>
-                        <constraint firstItem="wLM-VU-VYk" firstAttribute="leading" secondItem="2hI-rc-KPm" secondAttribute="leading" id="COo-WD-1w9"/>
-                        <constraint firstItem="wLM-VU-VYk" firstAttribute="top" secondItem="2hI-rc-KPm" secondAttribute="top" id="XVB-II-0rK"/>
-                        <constraint firstItem="wLM-VU-VYk" firstAttribute="width" secondItem="2hI-rc-KPm" secondAttribute="width" id="jxF-AQ-Vkm"/>
+                        <constraint firstItem="wLM-VU-VYk" firstAttribute="leading" secondItem="2hI-rc-KPm" secondAttribute="leading" id="4wm-Kd-QZe"/>
+                        <constraint firstItem="wLM-VU-VYk" firstAttribute="top" secondItem="2hI-rc-KPm" secondAttribute="top" id="fmF-H5-bZ9"/>
+                        <constraint firstAttribute="trailing" secondItem="wLM-VU-VYk" secondAttribute="trailing" id="rOM-9n-P02"/>
                     </constraints>
                     <userDefinedRuntimeAttributes>
                         <userDefinedRuntimeAttribute type="color" keyPath="borderColor">
@@ -96,25 +97,20 @@
             </subviews>
             <color key="backgroundColor" red="0.0" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
             <constraints>
-                <constraint firstItem="2hI-rc-KPm" firstAttribute="width" secondItem="iN0-l3-epB" secondAttribute="width" id="VKl-d5-fJd"/>
-                <constraint firstAttribute="bottom" secondItem="2hI-rc-KPm" secondAttribute="bottom" id="cU8-H8-q3m"/>
-                <constraint firstItem="2hI-rc-KPm" firstAttribute="top" secondItem="iN0-l3-epB" secondAttribute="top" id="dVg-F6-N4H"/>
-                <constraint firstItem="2hI-rc-KPm" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" id="uDg-Fu-bJw"/>
+                <constraint firstItem="2hI-rc-KPm" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" id="PMg-Yl-oAA"/>
+                <constraint firstAttribute="trailing" secondItem="2hI-rc-KPm" secondAttribute="trailing" id="WIN-BI-cuJ"/>
+                <constraint firstItem="2hI-rc-KPm" firstAttribute="top" secondItem="iN0-l3-epB" secondAttribute="top" id="a5e-qs-gY9"/>
+                <constraint firstAttribute="bottom" secondItem="2hI-rc-KPm" secondAttribute="bottom" constant="248" id="whR-Gz-dvd"/>
             </constraints>
             <nil key="simulatedStatusBarMetrics"/>
-            <splitViewDetailSimulatedSizeMetrics key="simulatedDestinationMetrics"/>
             <userDefinedRuntimeAttributes>
                 <userDefinedRuntimeAttribute type="color" keyPath="borderColor">
                     <color key="value" red="0.0" green="0.0" blue="0.3381076388888889" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                 </userDefinedRuntimeAttribute>
                 <userDefinedRuntimeAttribute type="number" keyPath="borderWidth">
-                    <real key="value" value="10"/>
+                    <real key="value" value="3"/>
                 </userDefinedRuntimeAttribute>
             </userDefinedRuntimeAttributes>
-            <connections>
-                <outlet property="descrip" destination="f4E-5p-Bid" id="Xda-6E-LNC"/>
-                <outlet property="title" destination="Bkz-DV-HVr" id="Eiz-p3-B1a"/>
-            </connections>
             <point key="canvasLocation" x="46" y="-43"/>
         </view>
     </objects>

+ 3 - 2
app/Section.swift

@@ -33,7 +33,8 @@ class Section: UIView {
 	@IBOutlet weak var title: UITextView!
 	
 	//The content of the section.
-	@IBOutlet weak var content: UIView!
+	@IBOutlet weak var content: UIStackView!
+	
 	
 	
 	/**
@@ -48,7 +49,7 @@ class Section: UIView {
 		container.frame = self.bounds
 	}
 	
-	func getContentView() -> UIView {
+	func getContentStack() -> UIStackView {
 		return content
 	}