Iñigo Valentin пре 9 година
родитељ
комит
d8456dd102

+ 1 - 0
Section.xib

@@ -12,6 +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="title" destination="mYX-eR-Wot" id="a6d-ku-3LY"/>
             </connections>
         </placeholder>

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


+ 3 - 3
app/HomeView.swift

@@ -70,7 +70,7 @@ class HomeView: UIView {
 		let lang : String = getLanguage()
 		
 		//Populate sections
-		setUpPastActivities(context: moc, delegate: appDelegate, lang: lang, parent: pastActivitiesSection)
+		setUpPastActivities(context: moc, delegate: appDelegate, lang: lang, parent: pastActivitiesSection.getContentView())
 		
 		//Always at the end: update scrollview
 		var h: Int = 0
@@ -93,7 +93,7 @@ class HomeView: UIView {
 		}
 	}
 	
-	func setUpPastActivities(context : NSManagedObjectContext, delegate: AppDelegate, lang: String, parent : Section){
+	func setUpPastActivities(context : NSManagedObjectContext, delegate: AppDelegate, lang: String, parent : UIView){
 		
 		context.persistentStoreCoordinator = delegate.persistentStoreCoordinator
 		let fetchRequest: NSFetchRequest<Activity> = Activity.fetchRequest()
@@ -130,7 +130,7 @@ class HomeView: UIView {
 				print(title)
 				row.setTitle(text: title)
 				row.backgroundColor = UIColor.red
-				row.setBounds(rect: parent.bounds)
+				//row.setBounds(rect: parent.bounds)
 				parent.addSubview(row)
 				let lbl = UILabel()
 				lbl.text = "ABBA"

+ 9 - 3
app/RowHomePastActivities.swift

@@ -50,14 +50,20 @@ Extension of UIView to be formatted as sections.
 	init(s: String, i: Int) {
 		//self.s = s
 		//self.i = i
-		super.init(frame: CGRect(x: 00, y: 0, width: 100, height: 150))
+		super.init(frame: CGRect(x: 00, y: 0, width: 200, height: 150))
 		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: 100, width: 100, height: 150)
+		//container.frame = CGRect(x: 20, y: 0, width: 100, height: 150)
+		container.backgroundColor = UIColor.green
 		//container.bounds = self.bounds//CGRect(x: 20, y: 100, width: 10, height: 10)
 		//title.frame = self.bounds
 		container.addSubview(title)
-		title.frame = CGRect(x: 30, y: 150, width: 80, height: 100)
+		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.bounds = CGRec
 	}
 	
 	override init(frame: CGRect){

+ 5 - 0
app/Section.swift

@@ -35,6 +35,7 @@ class Section: UIView {
 	//The content of the section.
 	@IBOutlet weak var content: UIView!
 	
+	
 	/**
 	 Run when the section is loaded.
 	*/
@@ -47,6 +48,10 @@ class Section: UIView {
 		container.frame = self.bounds
 	}
 	
+	func getContentView() -> UIView {
+		return content
+	}
+	
 	/**
 	 Chancges the title of the section.
 	 :param: title The new title.