<commit_before>//
//  DestinationInfoSectionViewModel.swift
//  CascadingTableDelegate
//
//  Created by <NAME> on 11/2/16.
//  Copyright © 2016 <NAME>. All rights reserved.
//

import Foundation
import CoreLocation

struct DestinationInfo {
	let type: String
	let text: String
}

protocol DestinationInfoSectionViewModelObserver: class {
	
	/// Executed when any property info of the listened `DestinationInfoSectionViewModel` is updated.
	func infoSectionDataChanged()
}

protocol DestinationInfoSectionViewModel: class {
	
	/// Stores location coordinate.
	var locationCoordinate: CLLocationCoordinate2D? { get }
	
	/// Stores array of `DestinationInfo`.
	var locationInfo: [DestinationInfo] { get }
	
	/// `DestinationInfoSectionViewModelObserver`s of this instance.
	var infoSectionObservers: [DestinationInfoSectionViewModelObserver] { get set }
}

extension DestinationInfoSectionViewModel {
	
	func add(observer: DestinationInfoSectionViewModelObserver) {
		self.infoSectionObservers.append(observer)
	}
	
	func remove(observer: DestinationInfoSectionViewModelObserver) {
		
		let observerIndex = self.infoSectionObservers.index { (anotherObserver) -> Bool in
			
			var checkedObserver = observer
			var currentObserver = anotherObserver
			
			// TODO: Update this later
			return false
		}
		
		if let index = observerIndex {
			self.infoSectionObservers.remove(at: index)
		}
	}
	
	
	/// Notify all
	func notifyInfoSectionObservers() {
		self.infoSectionObservers.forEach { observer in
			observer.infoSectionDataChanged()
		}
	}
}
<commit_msg>Fix TODO in DestinationInfoSectionViewModel<commit_after>//
//  DestinationInfoSectionViewModel.swift
//  CascadingTableDelegate
//
//  Created by <NAME> on 11/2/16.
//  Copyright © 2016 <NAME>. All rights reserved.
//

import Foundation
import CoreLocation

struct DestinationInfo {
	let type: String
	let text: String
}

protocol DestinationInfoSectionViewModelObserver: class {
	
	/// Executed when any property info of the listened `DestinationInfoSectionViewModel` is updated.
	func infoSectionDataChanged()
}

protocol DestinationInfoSectionViewModel: class {
	
	/// Stores location coordinate.
	var locationCoordinate: CLLocationCoordinate2D? { get }
	
	/// Stores array of `DestinationInfo`.
	var locationInfo: [DestinationInfo] { get }
	
	/// `DestinationInfoSectionViewModelObserver`s of this instance.
	var infoSectionObservers: [DestinationInfoSectionViewModelObserver] { get set }
}

extension DestinationInfoSectionViewModel {
	
	func add(observer: DestinationInfoSectionViewModelObserver) {
		self.infoSectionObservers.append(observer)
	}
	
	func remove(observer: DestinationInfoSectionViewModelObserver) {
		
		let observerIndex = self.infoSectionObservers.index { (anotherObserver) -> Bool in
			
			return observer === anotherObserver
		}
		
		if let index = observerIndex {
			self.infoSectionObservers.remove(at: index)
		}
	}
	
	
	/// Notify all
	func notifyInfoSectionObservers() {
		self.infoSectionObservers.forEach { observer in
			observer.infoSectionDataChanged()
		}
	}
}

{'fraction_non_alphanumeric': 0.0831151832460733, 'fraction_numerical': 0.006544502617801047, 'mean_word_length': 4.420212765957447, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '142403', 'n_tokens_mistral': 945, 'n_tokens_neox': 834, 'n_words': 216}