소스 검색

Changes made to repopulate after initial sync. Not working.

Iñigo Valentin 9 년 전
부모
커밋
b756b6a34e
5개의 변경된 파일56개의 추가작업 그리고 29개의 파일을 삭제
  1. 10 0
      app.xcodeproj/xcuserdata/seavenois.xcuserdatad/xcschemes/app.xcscheme
  2. 17 11
      app/HomeView.swift
  3. 5 5
      app/HomeView.xib
  4. 3 3
      app/Section.swift
  5. 21 10
      app/ViewController.swift

+ 10 - 0
app.xcodeproj/xcuserdata/seavenois.xcuserdatad/xcschemes/app.xcscheme

@@ -39,6 +39,11 @@
          </BuildableReference>
       </MacroExpansion>
       <AdditionalOptions>
+         <AdditionalOption
+            key = "NSZombieEnabled"
+            value = "YES"
+            isEnabled = "YES">
+         </AdditionalOption>
       </AdditionalOptions>
    </TestAction>
    <LaunchAction
@@ -62,6 +67,11 @@
          </BuildableReference>
       </BuildableProductRunnable>
       <AdditionalOptions>
+         <AdditionalOption
+            key = "NSZombieEnabled"
+            value = "YES"
+            isEnabled = "YES">
+         </AdditionalOption>
       </AdditionalOptions>
    </LaunchAction>
    <ProfileAction

+ 17 - 11
app/HomeView.swift

@@ -29,20 +29,22 @@ Class to handle the home view.
 class HomeView: UIView {
 	
 	// Outlets
-	@IBOutlet weak var scrollView: UIScrollView!
-	@IBOutlet weak var container: UIView!
-	@IBOutlet weak var locationSection: Section!
-	@IBOutlet weak var lablancaSection: Section!
-	@IBOutlet weak var futureActivitiesSection: Section!
-	@IBOutlet weak var blogSection: Section!
-	@IBOutlet weak var gallerySection: Section!
-	@IBOutlet weak var pastActivitiesSection: Section!
-	@IBOutlet weak var socialSection: Section!
+	@IBOutlet var scrollView: UIScrollView!
+	@IBOutlet var container: UIView!
+	@IBOutlet var locationSection: Section!
+	@IBOutlet var lablancaSection: Section!
+	@IBOutlet var futureActivitiesSection: Section!
+	@IBOutlet var blogSection: Section!
+	@IBOutlet var gallerySection: Section!
+	@IBOutlet var pastActivitiesSection: Section!
+	@IBOutlet var socialSection: Section!
 
 	var lang: String? = nil
 	var moc: NSManagedObjectContext? = nil
 	var appDelegate: AppDelegate? = nil
 	
+	let dbgTxt = "IVV"
+	
 	
 	/**
 	Run when the view is started.
@@ -64,7 +66,7 @@ class HomeView: UIView {
 		// Load the contents of the HomeView.xib file.
 		Bundle.main.loadNibNamed("HomeView", owner: self, options: nil)
 		self.addSubview(container)
-		container.frame = self.bounds
+		self.container.frame = self.bounds
 		
 
 		// Set titles for each section
@@ -98,10 +100,14 @@ class HomeView: UIView {
 	}
 
 	
+	func populate2(){
+		NSLog(":HOME:DEBUG: Dummy Populating home view.")
+	}
+	
 	/**
 	Triggers a reloading (or initial loading) of all sections.
 	*/
-	func populate(){
+	open func populate(){
 		
 		NSLog(":HOME:DEBUG: Populating home view.")
 		

+ 5 - 5
app/HomeView.xib

@@ -1,15 +1,15 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<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">
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="12120" systemVersion="16E195" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
     <device id="retina3_5" orientation="portrait">
         <adaptation id="fullscreen"/>
     </device>
     <dependencies>
         <deployment identifier="iOS"/>
-        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="11757"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="12088"/>
         <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
     </dependencies>
     <objects>
-        <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="HomeView" customModule="app" customModuleProvider="target">
+        <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner">
             <connections>
                 <outlet property="blogSection" destination="uHa-Mu-U68" id="RUp-Jg-AxI"/>
                 <outlet property="container" destination="iN0-l3-epB" id="cfT-rm-jA0"/>
@@ -23,14 +23,14 @@
             </connections>
         </placeholder>
         <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
-        <view contentMode="scaleToFill" id="iN0-l3-epB">
+        <view contentMode="scaleToFill" id="iN0-l3-epB" customClass="HomeView" customModule="app">
             <rect key="frame" x="0.0" y="0.0" width="320" height="480"/>
             <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
             <subviews>
                 <scrollView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" ambiguous="YES" alwaysBounceVertical="YES" showsHorizontalScrollIndicator="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Poy-ba-9jX">
                     <rect key="frame" x="0.0" y="0.0" width="320" height="480"/>
                     <subviews>
-                        <stackView opaque="NO" contentMode="scaleToFill" ambiguous="YES" misplaced="YES" axis="vertical" alignment="center" spacing="10" translatesAutoresizingMaskIntoConstraints="NO" id="gOz-rr-CeQ">
+                        <stackView opaque="NO" contentMode="scaleToFill" ambiguous="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 contentMode="scaleToFill" ambiguous="YES" translatesAutoresizingMaskIntoConstraints="NO" id="Ljm-NP-c4e" customClass="Section" customModule="app">

+ 3 - 3
app/Section.swift

@@ -27,13 +27,13 @@ import UIKit
 class Section: UIView {
 	
 	//The container.
-	@IBOutlet weak var container: UIView!
+	@IBOutlet var container: UIView!
 	
 	//The section title.
-	@IBOutlet weak var title: UITextView!
+	@IBOutlet var title: UITextView!
 	
 	//The content of the section.
-	@IBOutlet weak var content: UIStackView!
+	@IBOutlet var content: UIStackView!
 	
 	
 	

+ 21 - 10
app/ViewController.swift

@@ -48,6 +48,7 @@ class ViewController: UIViewController, UICollectionViewDataSource, UICollection
 	 Controller initializer.
 	*/
 	required init?(coder aDecoder: NSCoder) {
+		NSLog(":CONTROLLER:DEBUG: Init!")
 		super.init(coder: aDecoder)
 	}
 	
@@ -106,8 +107,8 @@ class ViewController: UIViewController, UICollectionViewDataSource, UICollection
 		}
 		else{
 			NSLog(":CONTROLLER:DEBUG: Re-populating views and hidding initial sync screen.")
-			NSLog(":CONTROLLER:DEBUG: Re-populating disabled: Throws error.")
-			//populate()
+			//NSLog(":CONTROLLER:DEBUG: Re-populating disabled: Throws error.")
+			self.populate()
 			syncSegue?.destination.dismiss(animated: true, completion: nil)
 		}
 	}
@@ -143,7 +144,7 @@ class ViewController: UIViewController, UICollectionViewDataSource, UICollection
 	 Run when the app loads.
 	*/
 	override func viewDidLoad() {
-				
+						
 		//Hide all sections, except for the first one
 		self.containerViewLocation.alpha = 0
 		self.containerViewLablanca.alpha = 0
@@ -154,22 +155,32 @@ class ViewController: UIViewController, UICollectionViewDataSource, UICollection
 		NSLog(":CONTROLLER:LOG: viewDidLoad()")
 		NSLog(":CONTROLLER:DEBUG: Skyp sync")
 		//Sync()
-		
-		super.viewDidLoad()
 
 		//self.containerViewBlog.setController(controller: self as ViewController)
 		
-		delegate = UIApplication.shared.delegate as! AppDelegate
-		delegate?.controller = self
+		self.delegate = UIApplication.shared.delegate as? AppDelegate
+		self.delegate?.controller = self
+		
+		NSLog(":CONTROLLER:DEBUG: Forcing a call to populate")
+		//self.populate()
+		
+		super.viewDidLoad()
 		
 	}
 
 	func populate(){
-		//self.containerViewHome.populate()
+		if (self.containerViewHome != nil){
+			//(self.containerViewHome as HomeView).populate2()
+			let ng = self.containerViewHome.dbgTxt
+			NSLog("AAAAA \(ng)")
+		}
+		else{
+			NSLog("CONTROLLER:ERROR: containerViewHome couldn't be populated: It is nil.")
+		}
 		//self.containerLocation.populate()
 		//self.containerLablanca.populate()
-		self.containerViewActivities.populate()
-		self.containerViewBlog.populate()
+		//self.containerViewActivities.populate()
+		//self.containerViewBlog.populate()
 		//self.containerGallery.populate()
 	}