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

+ 0 - 12
app/AppDelegate.swift

@@ -62,20 +62,8 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
 		
 		let when = DispatchTime.now() + 120 // 2 minutes to perform the sync.
 		DispatchQueue.main.asyncAfter(deadline: when) {
-			NSLog(":BACKGROUND:LOG: Calling completion handler.")
 			completionHandler(UIBackgroundFetchResult.newData)
 		}
-		
-		/*if let tabBarController = window?.rootViewController as? UITabBarController, let viewControllers = tabBarController.viewControllers {
-			for viewController in viewControllers {
-				if let fetchViewController = viewController as? FetchViewController {
-					fetchViewController.fetch {
-						fetchViewController.updateUI()
-						completionHandler(.newData)
-					}
-				}
-			}
-		}*/
 	}
 
 

+ 0 - 1
app/FetchLocation.swift

@@ -46,7 +46,6 @@ class FetchLocation{
 			}
 			let status = (response as! HTTPURLResponse).statusCode
 			
-			NSLog(":LOCATION:LOG: Response code \(status)")
 			if status == 200{
 			
 				guard let data = data else {

+ 0 - 1
app/FutureActivityViewController.swift

@@ -142,7 +142,6 @@ class FutureActivityViewController: UIViewController, UIGestureRecognizerDelegat
 				do {
 					let itiSearchResults = try context.fetch(itiFetchRequest)
 					if itiSearchResults.count == 0{
-						NSLog(":FUTUREACTIVITY:DEBUG: No itinerary for activity \(id)")
 						self.itineraryContainer.isHidden = true
 					}
 					else{

+ 0 - 3
app/GalleryView.swift

@@ -53,8 +53,6 @@ class GalleryView: UIView {
 		
 		super.init(coder: aDecoder)
 		
-		NSLog(":GALLERY:LOG: Init gallery section.")
-		
 		//Load the contents of the HomeView.xib file.
 		Bundle.main.loadNibNamed("GalleryView", owner: self, options: nil)
 		self.addSubview(container)
@@ -155,7 +153,6 @@ class GalleryView: UIView {
 		self.scrollView.contentSize.height = 2500 //CGFloat(h);
 		
 		self.setUpRowsTapRecognizers()
-		NSLog(":GALLERY:LOG: Finished loading gallery section.")
 	}
 	
 	

+ 0 - 2
app/LablancaView.swift

@@ -57,8 +57,6 @@ class LablancaView: UIView {
 		
 		super.init(coder: aDecoder)
 		
-		NSLog(":LABLANCA:LOG: Init lablanca section.")
-
 		Bundle.main.loadNibNamed("LablancaView", owner: self, options: nil)
 		self.addSubview(container)
 		self.container.frame = self.bounds

+ 0 - 1
app/LocationView.swift

@@ -92,7 +92,6 @@ class LocationView: UIView {
 	Get new location
 	*/
 	func getNewLocation(){
-		NSLog(":LOCATION:LOG: Recalculating location.")
 		let defaults = UserDefaults.standard
 		if (defaults.value(forKey: "GMLocLat") != nil && defaults.value(forKey: "GMLocLon") != nil){
 			let lat = defaults.value(forKey: "GMLocLat") as! Double

+ 1 - 1
app/Notifications.swift

@@ -71,8 +71,8 @@ class Notifications{
 			}
 			
 			let strData: String = String(data:data, encoding: String.Encoding.utf8)!
-			NSLog(":NOTIFICATION:LOG: Data received: \(strData)")
 			if strData.length > 0{
+				NSLog(":NOTIFICATION:LOG: Notifications received.")
 				let dataNotification: [String] = self.getData(data: strData)
 				self.saveNotifications(entries: dataNotification)
 			}

+ 0 - 42
app/Sync.swift

@@ -221,7 +221,6 @@ class Sync{
 	func getTable(data: String, table: String) -> [String]{
 		//Does the table exists?
 		if data.indexOf(target: "\"\(table)\":[") == nil{
-			NSLog(":SYNC:LOG: Empty table: \(table).")
 			return [String]()
 		}
 		let iS : Int? = data.indexOf(target: "\"\(table)\":[")
@@ -237,8 +236,6 @@ class Sync{
 		entries[0] = entries[0].subStr(start: 1, end: entries[0].length - 1)
 		entries[entries.count - 1] = entries[entries.count - 1].subStr(start: 0, end: entries[entries.count - 1].length - 2)
 		
-		NSLog(":SYNC:LOG: Table \(table) has \(entries.count) rows.")
-		
 		//Return the array
 		return entries
 	}
@@ -250,8 +247,6 @@ class Sync{
 	*/
 	func saveTablePlace(entries : [String]){
 		
-		NSLog(":SYNC:LOG: Saving table Place.")
-		
 		//Set up context
 		let appDelegate = UIApplication.shared.delegate as! AppDelegate
 		let context = NSManagedObjectContext(concurrencyType: .privateQueueConcurrencyType)
@@ -344,8 +339,6 @@ class Sync{
 	*/
 	func saveTablePeople(entries : [String]){
 		
-		NSLog(":SYNC:LOG: Saving table People.")
-		
 		//Set up context
 		let appDelegate = UIApplication.shared.delegate as! AppDelegate
 		let context = NSManagedObjectContext(concurrencyType: .privateQueueConcurrencyType)
@@ -414,8 +407,6 @@ class Sync{
 	*/
 	func saveTablePost(entries : [String]){
 		
-		NSLog(":SYNC:LOG: Saving table Post.")
-		
 		let dateFormatter = DateFormatter()
 		dateFormatter.timeZone = TimeZone.ReferenceType.local
 		
@@ -519,8 +510,6 @@ class Sync{
 	*/
 	func saveTablePostComment(entries : [String]){
 		
-		NSLog(":SYNC:LOG: Saving table Post_comment.")
-		
 		let dateFormatter = DateFormatter()
 		dateFormatter.timeZone = TimeZone.ReferenceType.local
 		
@@ -598,8 +587,6 @@ class Sync{
 	*/
 	func saveTablePostImage(entries : [String]){
 		
-		NSLog(":SYNC:LOG: Saving table Post_image.")
-		
 		//Set up context
 		let appDelegate = UIApplication.shared.delegate as! AppDelegate
 		let context = NSManagedObjectContext(concurrencyType: .privateQueueConcurrencyType)
@@ -662,8 +649,6 @@ class Sync{
 	*/
 	func saveTablePostTag(entries : [String]){
 		
-		NSLog(":SYNC:LOG: Saving table Post_tag.")
-		
 		//Set up context
 		let appDelegate = UIApplication.shared.delegate as! AppDelegate
 		let context = NSManagedObjectContext(concurrencyType: .privateQueueConcurrencyType)
@@ -716,8 +701,6 @@ class Sync{
 	*/
 	func saveTableActivity(entries : [String]){
 		
-		NSLog(":SYNC:LOG: Saving table Activity.")
-		
 		let dateFormatter = DateFormatter()
 		dateFormatter.timeZone = TimeZone.ReferenceType.local
 		
@@ -874,8 +857,6 @@ class Sync{
 	*/
 	func saveTableActivityComment(entries : [String]){
 		
-		NSLog(":SYNC:LOG: Saving table Activity_comment.")
-		
 		let dateFormatter = DateFormatter()
 		dateFormatter.timeZone = TimeZone.ReferenceType.local
 		
@@ -953,8 +934,6 @@ class Sync{
 	*/
 	func saveTableActivityImage(entries : [String]){
 		
-		NSLog(":SYNC:LOG: Saving table Activity_image.")
-		
 		//Set up context
 		let appDelegate = UIApplication.shared.delegate as! AppDelegate
 		let context = NSManagedObjectContext(concurrencyType: .privateQueueConcurrencyType)
@@ -1017,8 +996,6 @@ class Sync{
 	*/
 	func saveTableActivityTag(entries : [String]){
 		
-		NSLog(":SYNC:LOG: Saving table Activity_tag.")
-		
 		//Set up context
 		let appDelegate = UIApplication.shared.delegate as! AppDelegate
 		let context = NSManagedObjectContext(concurrencyType: .privateQueueConcurrencyType)
@@ -1072,8 +1049,6 @@ class Sync{
 	//CHECK: New (and probably better format than the others.)
 	func saveTableActivityItinerary(entries : [String]){
 		
-		NSLog(":SYNC:LOG: Saving table Activity_itinerary.")
-		
 		let dateFormatter = DateFormatter()
 		dateFormatter.timeZone = TimeZone.ReferenceType.local
 		
@@ -1184,8 +1159,6 @@ class Sync{
 	*/
 	func saveTableAlbum(entries : [String]){
 		
-		NSLog(":SYNC:LOG: Saving table Album.")
-		
 		//Set up context
 		let appDelegate = UIApplication.shared.delegate as! AppDelegate
 		let context = NSManagedObjectContext(concurrencyType: .privateQueueConcurrencyType)
@@ -1280,8 +1253,6 @@ class Sync{
 	*/
 	func saveTablePhoto(entries : [String]){
 		
-		NSLog(":SYNC:LOG: Saving table Photo.")
-		
 		let dateFormatter = DateFormatter()
 		dateFormatter.timeZone = TimeZone.ReferenceType.local
 		
@@ -1397,8 +1368,6 @@ class Sync{
 	*/
 	func saveTablePhotoAlbum(entries : [String]){
 		
-		NSLog(":SYNC:LOG: Saving table Photo_album.")
-		
 		let dateFormatter = DateFormatter()
 		dateFormatter.timeZone = TimeZone.ReferenceType.local
 		
@@ -1455,8 +1424,6 @@ class Sync{
 	*/
 	func saveTableFestival(entries : [String]){
 		
-		NSLog(":SYNC:LOG: Saving table Festival.")
-		
 		//Set up context
 		let appDelegate = UIApplication.shared.delegate as! AppDelegate
 		let context = NSManagedObjectContext(concurrencyType: .privateQueueConcurrencyType)
@@ -1545,8 +1512,6 @@ class Sync{
 	*/
 	func saveTableFestivalDay(entries : [String]){
 		
-		NSLog(":SYNC:LOG: Saving table FestivalDay.")
-		
 		let dateFormatter = DateFormatter()
 		dateFormatter.timeZone = TimeZone.ReferenceType.local
 		
@@ -1624,8 +1589,6 @@ class Sync{
 	*/
 	func saveTableFestivalOffer(entries : [String]){
 		
-		NSLog(":SYNC:LOG: Saving table FestivalOffer.")
-		
 		//Set up context
 		let appDelegate = UIApplication.shared.delegate as! AppDelegate
 		let context = NSManagedObjectContext(concurrencyType: .privateQueueConcurrencyType)
@@ -1725,8 +1688,6 @@ class Sync{
 	*/
 	func saveTableFestivalEvent(entries : [String]){
 		
-		NSLog(":SYNC:LOG: Saving table FestivalEvent.")
-		
 		let dateFormatter = DateFormatter()
 		dateFormatter.timeZone = TimeZone.ReferenceType.local
 		
@@ -1866,8 +1827,6 @@ class Sync{
 	*/
 	func saveTableSponsor(entries : [String]){
 		
-		NSLog(":SYNC:LOG: Saving table Sponsor.")
-		
 		//Set up context
 		let appDelegate = UIApplication.shared.delegate as! AppDelegate
 		let context = NSManagedObjectContext(concurrencyType: .privateQueueConcurrencyType)
@@ -1997,7 +1956,6 @@ class Sync{
 	*/
 	func saveSettings(entries : [String]){
 		
-		NSLog(":SYNC:LOG: Saving settings.")
 		let defaults = UserDefaults.standard
 		
 		// Loop new entries

+ 1 - 26
app/ViewController.swift

@@ -154,13 +154,9 @@ class ViewController: UIViewController, UICollectionViewDataSource, UICollection
 	*/
 	func initialSync(showScreen: Bool){
 		if showScreen == true{
-			//performSegue(withIdentifier: "SegueSync", sender: nil)
 			Sync(synchronous: true)
 		}
 		else{
-			// TODO CHECK this
-			NSLog(":CONTROLLER:DEBUG: Re-populating disabled: Throws error.")
-			//self.populate()
 			syncSegue?.destination.dismiss(animated: true, completion: nil)
 		}
 	}
@@ -202,7 +198,6 @@ class ViewController: UIViewController, UICollectionViewDataSource, UICollection
 	}
 	
 	override func viewWillAppear(_ animated: Bool) {
-		self.populate()
 		super.viewWillAppear(animated)
 	}
 	
@@ -244,27 +239,7 @@ class ViewController: UIViewController, UICollectionViewDataSource, UICollection
 	func fetchLocation(){
 		FetchLocation()
 	}
-
-	/**
-	Actually populates all sections.
-	As of now, not working.
-	*/
-	func populate(){
-		// TODO Set this up.
-		if (self.containerViewHome != nil){
-			//(self.containerViewHome as HomeView).populate()
-			//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.containerGallery.populate()
-	}
+	
 	
 	/**
 	Executed when the view is actually shown.