 
 //MARK: - Checkin functions
 extension MapViewController {
-    private func checkinCount(with calculate: (Int, Int) -> Int) {
+    private func checkinCount(with calculate: (Int, Int) -> Int, log: String) {
         defer { DataManager.saveToDatabase(with: batteryStationAnnotations) }
-        
+        Answers.log(event: .MapButtons, customAttributes: log)
         guard let batteryAnnotation = selectedAnnotationView?.annotation as? BatteryStationPointAnnotation else { return }
         let counterOfcheckin = calculate(batteryAnnotation.checkinCounter ?? 0, 1)
         batteryAnnotation.checkinDay = counterOfcheckin > 0 ? Date.today : ""

        (selectedAnnotationView?.detailCalloutAccessoryView as? DetailAnnotationView)?.setup(with: counterOfcheckin)
    }
    
    @objc func checkin() {
        Answers.log(event: .MapButtons, customAttributes: "Check in")
        checkinCount(with: +)
    }
    
    @objc func unCheckin() {
        Answers.log(event: .MapButtons, customAttributes: "Remove check in")
        checkinCount(with: -)
    }
}

//MARK: - Lists of function annotations

    }
    
    private func setupSegmentControllerContainer() {
        view.addSubview(segmentControllerContainer)
        var topPadding: CGFloat = 64
        if #available(iOS 11, *) { topPadding += 16 }
        
        segmentControllerContainer.anchor(top: view.topAnchor, left: view.leftAnchor, bottom: nil, right: view.rightAnchor, topPadding: topPadding, leftPadding: 0, bottomPadding: 0, rightPadding: 0, width: 0, height: 44)
