@@ -530,42 +530,39 @@ class KeyboardViewController: UIInputViewController {
530
530
}
531
531
}
532
532
533
- @IBOutlet var conjugateKeyTL : UIButton !
534
- @IBOutlet var conjugateKeyTR : UIButton !
535
- @IBOutlet var conjugateKeyBL : UIButton !
536
- @IBOutlet var conjugateKeyBR : UIButton !
533
+ @IBOutlet var conjugateKeyTop : UIButton !
534
+ @IBOutlet var conjugateKeyMiddle : UIButton !
535
+ @IBOutlet var conjugateKeyBottom : UIButton !
537
536
538
- /// Returns all buttons for the 2x2 conjugation display
539
- func get2x2ConjButtons ( ) -> [ UIButton ] {
537
+ /// Returns all buttons for the 3x1 conjugation display
538
+ func get3x1ConjButtons ( ) -> [ UIButton ] {
540
539
let conjugationButtons : [ UIButton ] = [
541
- conjugateKeyTL , conjugateKeyTR , conjugateKeyBL , conjugateKeyBR
540
+ conjugateKeyTop , conjugateKeyMiddle , conjugateKeyBottom
542
541
]
543
542
544
543
return conjugationButtons
545
544
}
546
545
547
- @IBOutlet var conjugateLblTL : UIButton !
548
- @IBOutlet var conjugateLblTR : UIButton !
549
- @IBOutlet var conjugateLblBL : UIButton !
550
- @IBOutlet var conjugateLblBR : UIButton !
546
+ @IBOutlet var conjugateLblTop : UIButton !
547
+ @IBOutlet var conjugateLblMiddle : UIButton !
548
+ @IBOutlet var conjugateLblBottom : UIButton !
551
549
552
- /// Returns all labels for the 2x2 conjugation display.
553
- func get2x2ConjLabels ( ) -> [ UIButton ] {
550
+ /// Returns all labels for the 3x1 conjugation display.
551
+ func get3x1ConjLabels ( ) -> [ UIButton ] {
554
552
let conjugationLabels : [ UIButton ] = [
555
- conjugateLblTL , conjugateLblTR , conjugateLblBL , conjugateLblBR
553
+ conjugateLblTop , conjugateLblMiddle , conjugateLblBottom
556
554
]
557
555
558
556
return conjugationLabels
559
557
}
560
558
561
- /// Sets up all buttons and labels that are associated with the 2x2 conjugation display.
562
- func setConj2x2View( ) {
563
- setBtn ( btn: conjugateKeyTL, color: keyColor, name: " conjugateTopLeft " , canCap: false , isSpecial: false )
564
- setBtn ( btn: conjugateKeyTR, color: keyColor, name: " conjugateTopRight " , canCap: false , isSpecial: false )
565
- setBtn ( btn: conjugateKeyBL, color: keyColor, name: " conjugateBottomLeft " , canCap: false , isSpecial: false )
566
- setBtn ( btn: conjugateKeyBR, color: keyColor, name: " conjugateBottomRight " , canCap: false , isSpecial: false )
559
+ /// Sets up all buttons and labels that are associated with the 3x1 conjugation display.
560
+ func setConj3x1View( ) {
561
+ setBtn ( btn: conjugateKeyTop, color: keyColor, name: " conjugateTop " , canCap: false , isSpecial: false )
562
+ setBtn ( btn: conjugateKeyMiddle, color: keyColor, name: " conjugateMiddle " , canCap: false , isSpecial: false )
563
+ setBtn ( btn: conjugateKeyBottom, color: keyColor, name: " conjugateBottom " , canCap: false , isSpecial: false )
567
564
568
- for btn in get2x2ConjButtons ( ) {
565
+ for btn in get3x1ConjButtons ( ) {
569
566
activateBtn ( btn: btn)
570
567
}
571
568
@@ -574,45 +571,48 @@ class KeyboardViewController: UIInputViewController {
574
571
if isLandscapeView {
575
572
conjugationFontDivisor = 4
576
573
}
577
- for btn in get2x2ConjButtons ( ) {
574
+ for btn in get3x1ConjButtons ( ) {
578
575
btn. titleLabel? . font = . systemFont( ofSize: letterKeyWidth / conjugationFontDivisor)
579
576
}
580
577
}
581
578
}
582
579
583
- @IBOutlet var conjugateKeyTop : UIButton !
584
- @IBOutlet var conjugateKeyMiddle : UIButton !
585
- @IBOutlet var conjugateKeyBottom : UIButton !
580
+ @IBOutlet var conjugateKeyTL : UIButton !
581
+ @IBOutlet var conjugateKeyTR : UIButton !
582
+ @IBOutlet var conjugateKeyBL : UIButton !
583
+ @IBOutlet var conjugateKeyBR : UIButton !
586
584
587
- /// Returns all buttons for the 3x1 conjugation display
588
- func get3x1ConjButtons ( ) -> [ UIButton ] {
585
+ /// Returns all buttons for the 2x2 conjugation display
586
+ func get2x2ConjButtons ( ) -> [ UIButton ] {
589
587
let conjugationButtons : [ UIButton ] = [
590
- conjugateKeyTop , conjugateKeyMiddle , conjugateKeyBottom
588
+ conjugateKeyTL , conjugateKeyTR , conjugateKeyBL , conjugateKeyBR
591
589
]
592
590
593
591
return conjugationButtons
594
592
}
595
593
596
- @IBOutlet var conjugateLblTop : UIButton !
597
- @IBOutlet var conjugateLblMiddle : UIButton !
598
- @IBOutlet var conjugateLblBottom : UIButton !
594
+ @IBOutlet var conjugateLblTL : UIButton !
595
+ @IBOutlet var conjugateLblTR : UIButton !
596
+ @IBOutlet var conjugateLblBL : UIButton !
597
+ @IBOutlet var conjugateLblBR : UIButton !
599
598
600
- /// Returns all labels for the 3x1 conjugation display.
601
- func get3x1ConjLabels ( ) -> [ UIButton ] {
599
+ /// Returns all labels for the 2x2 conjugation display.
600
+ func get2x2ConjLabels ( ) -> [ UIButton ] {
602
601
let conjugationLabels : [ UIButton ] = [
603
- conjugateLblTop , conjugateLblMiddle , conjugateLblBottom
602
+ conjugateLblTL , conjugateLblTR , conjugateLblBL , conjugateLblBR
604
603
]
605
604
606
605
return conjugationLabels
607
606
}
608
607
609
- /// Sets up all buttons and labels that are associated with the 3x1 conjugation display.
610
- func setConj3x1View( ) {
611
- setBtn ( btn: conjugateKeyTop, color: keyColor, name: " conjugateTop " , canCap: false , isSpecial: false )
612
- setBtn ( btn: conjugateKeyMiddle, color: keyColor, name: " conjugateMiddle " , canCap: false , isSpecial: false )
613
- setBtn ( btn: conjugateKeyBottom, color: keyColor, name: " conjugateBottom " , canCap: false , isSpecial: false )
608
+ /// Sets up all buttons and labels that are associated with the 2x2 conjugation display.
609
+ func setConj2x2View( ) {
610
+ setBtn ( btn: conjugateKeyTL, color: keyColor, name: " conjugateTopLeft " , canCap: false , isSpecial: false )
611
+ setBtn ( btn: conjugateKeyTR, color: keyColor, name: " conjugateTopRight " , canCap: false , isSpecial: false )
612
+ setBtn ( btn: conjugateKeyBL, color: keyColor, name: " conjugateBottomLeft " , canCap: false , isSpecial: false )
613
+ setBtn ( btn: conjugateKeyBR, color: keyColor, name: " conjugateBottomRight " , canCap: false , isSpecial: false )
614
614
615
- for btn in get3x1ConjButtons ( ) {
615
+ for btn in get2x2ConjButtons ( ) {
616
616
activateBtn ( btn: btn)
617
617
}
618
618
@@ -621,7 +621,7 @@ class KeyboardViewController: UIInputViewController {
621
621
if isLandscapeView {
622
622
conjugationFontDivisor = 4
623
623
}
624
- for btn in get3x1ConjButtons ( ) {
624
+ for btn in get2x2ConjButtons ( ) {
625
625
btn. titleLabel? . font = . systemFont( ofSize: letterKeyWidth / conjugationFontDivisor)
626
626
}
627
627
}
@@ -716,20 +716,20 @@ class KeyboardViewController: UIInputViewController {
716
716
func setConjugationBtns( ) {
717
717
// Set the conjugation view to 2x2 for Swedish and Russian past tense.
718
718
if controllerLanguage == " Swedish " {
719
- conjugateAlternateView = true
719
+ conjugateDimensions = . view2x2
720
720
} else if controllerLanguage == " Russian " && ruConjugationState == . past {
721
- conjugateAlternateView = true
721
+ conjugateDimensions = . view2x2
722
722
} else if
723
723
commandState == . selectCaseConjugation
724
724
&& controllerLanguage == " German "
725
725
&& [ . accusative, . dative, . genitive] . contains ( deCaseConjugationState) {
726
- conjugateAlternateView = true
726
+ conjugateDimensions = . view2x2
727
727
} else {
728
- conjugateAlternateView = false
728
+ conjugateDimensions = . view3x2
729
729
}
730
730
731
731
// The base conjugation view is 3x2 for first, second, and third person in singular and plural.
732
- if conjugateAlternateView == false {
732
+ if conjugateDimensions == . view3x2 {
733
733
setConj3x2View ( )
734
734
} else {
735
735
setConj2x2View ( )
@@ -755,7 +755,12 @@ class KeyboardViewController: UIInputViewController {
755
755
activateBtn ( btn: conjugateShiftRight)
756
756
757
757
// Make all labels clear and set their font for if they will be used.
758
- let allConjLabels : [ UIButton ] = get3x2ConjLabels ( ) + get2x2ConjLabels( )
758
+ let allConjLabels : [ UIButton ] =
759
+ get3x2ConjLabels ( )
760
+ + get3x1ConjLabels( )
761
+ + get2x2ConjLabels( )
762
+ + get1x2ConjLabels( )
763
+ + get1x1ConjLabels( )
759
764
for lbl in allConjLabels {
760
765
lbl. backgroundColor = UIColor . clear
761
766
lbl. setTitleColor ( specialKeyColor, for: . normal)
@@ -771,7 +776,7 @@ class KeyboardViewController: UIInputViewController {
771
776
activateBtn ( btn: conjugateShiftLeft)
772
777
activateBtn ( btn: conjugateShiftRight)
773
778
774
- if conjugateAlternateView == false {
779
+ if conjugateDimensions == . view3x2 {
775
780
for btn in get3x2ConjButtons ( ) {
776
781
activateBtn ( btn: btn)
777
782
}
@@ -781,7 +786,7 @@ class KeyboardViewController: UIInputViewController {
781
786
}
782
787
}
783
788
784
- if conjugateAlternateView == true {
789
+ if conjugateDimensions == . view2x2 {
785
790
for btn in get3x2ConjButtons ( ) {
786
791
deactivateBtn ( btn: btn)
787
792
}
@@ -801,14 +806,14 @@ class KeyboardViewController: UIInputViewController {
801
806
802
807
let allConjButtons : [ UIButton ] =
803
808
get3x2ConjButtons ( )
804
- + get2x2ConjButtons( )
805
809
+ get3x1ConjButtons( )
810
+ + get2x2ConjButtons( )
806
811
+ get1x2ConjButtons( )
807
812
+ get1x1ConjButtons( )
808
813
let allConjLabels : [ UIButton ] =
809
814
get3x2ConjLabels ( )
810
- + get2x2ConjLabels( )
811
815
+ get3x1ConjLabels( )
816
+ + get2x2ConjLabels( )
812
817
+ get1x2ConjLabels( )
813
818
+ get1x1ConjLabels( )
814
819
let allConjElements : [ UIButton ] = allConjButtons + allConjLabels
@@ -838,7 +843,7 @@ class KeyboardViewController: UIInputViewController {
838
843
conjTPP = conjugationStateFxn ( ) + " TPP "
839
844
840
845
} else if controllerLanguage == " Russian " {
841
- if conjugateAlternateView == false {
846
+ if conjugateDimensions == . view3x2 {
842
847
conjFPS = ruGetConjugationState ( ) + " FPS "
843
848
conjSPS = ruGetConjugationState ( ) + " SPS "
844
849
conjTPS = ruGetConjugationState ( ) + " TPS "
@@ -899,7 +904,7 @@ class KeyboardViewController: UIInputViewController {
899
904
conjugateLblBL. setTitle ( " " + labelBottomLeft, for: . normal)
900
905
conjugateLblBR. setTitle ( " " + labelBottomRight, for: . normal)
901
906
902
- if conjugateAlternateView == false {
907
+ if conjugateDimensions == . view3x2 {
903
908
allConjugations = [ conjFPS, conjSPS, conjTPS, conjFPP, conjSPP, conjTPP]
904
909
allConjugationBtns = get3x2ConjButtons ( )
905
910
} else {
0 commit comments