Cancelled courses now struck through, switched the colour picker method from using an if tree to a simplified switch statement

This commit is contained in:
Deniz Duezgoeren
2019-08-21 11:33:45 +02:00
parent c05f7f1bbf
commit 769ba6cf45
3 changed files with 39 additions and 52 deletions
+11
View File
@@ -8,6 +8,7 @@
import UIKit
import MagazineLayout
import Crashlytics
class PlanViewController : UIViewController, UICollectionViewDataSource, UICollectionViewDelegateMagazineLayout {
@@ -58,6 +59,10 @@ class PlanViewController : UIViewController, UICollectionViewDataSource, UIColle
self.collectionView.reloadData()
}
override func viewDidLoad() {
super.viewDidLoad()
}
func getViewType() -> String {
return "plan"
}
@@ -134,6 +139,12 @@ class PlanViewController : UIViewController, UICollectionViewDataSource, UIColle
}
}
let add = self.substs[indexPath.item].additional.lowercased()
if add.contains("eigenverantwortliches arbeiten") || add.contains("entfall") || add.contains("fällt aus"){
mutableStrings[2].addAttribute(NSAttributedString.Key.strikethroughStyle, value: 2, range: NSMakeRange(0, mutableStrings[2].length))
mutableStrings[3].addAttribute(NSAttributedString.Key.strikethroughStyle, value: 2, range: NSMakeRange(0, mutableStrings[3].length))
}
cell.group.attributedText = mutableStrings[0]
cell.additional.text = self.substs[indexPath.item].additional
cell.time.attributedText = mutableStrings[1]