-
Notifications
You must be signed in to change notification settings - Fork 1
/
MoreTableViewController.swift
116 lines (70 loc) · 3.1 KB
/
MoreTableViewController.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
//
// MoreTableViewController.swift
// EasyTrip
//
// Created by Shaden Almuhaidib on 08/03/2022.
//
import UIKit
class MoreTableViewController: UITableViewController {
@IBOutlet weak var nameSymbol: UIImageView!
@IBOutlet weak var emailSymbol: UIImageView!
@IBOutlet weak var phoneSymbol: UIImageView!
@IBOutlet weak var aboutusSymbol: UIImageView!
@IBOutlet weak var languageSymbol: UIImageView!
@IBOutlet weak var modeSymbol: UIImageView!
@IBOutlet weak var personName: UITextField!
@IBOutlet weak var settingLable: UILabel!
@IBOutlet weak var languageLable: UILabel!
@IBOutlet weak var modeLable: UILabel!
@IBOutlet weak var generalLable: UILabel!
@IBOutlet weak var languageButton: UIButton!
@IBOutlet weak var editButton: UIButton!
override func viewDidLoad() {
super.viewDidLoad()
generalLable.text = NSLocalizedString("general", comment: "")
languageButton.setTitle(NSLocalizedString("EN|AR", comment: ""), for: .normal)
languageLable.text = NSLocalizedString("language", comment: "")
modeLable.text = NSLocalizedString("mode", comment: "")
settingLable.text = NSLocalizedString("settings", comment: "")
}
@IBAction func languageButton(_ sender: Any) {
let currentLang = Locale.current.languageCode
let newLanguage = currentLang == "en" ? " ar" : "en"
UserDefaults.standard.setValue(newLanguage, forKey: "AppleLanguages")
exit(0)
}
// func NSLocalizedString(_ key: String, tableName: String? = default, bundel: Bundle = default, value: String = default, comment: String)-> String {
//
// //let string = NSLocalizedString("general", comment: "")
//
// }
// let currentLang = Locale.current.languageCode
// let newLanguage = currentLang == "en" ? "ar" : "en"
// UserDefaults.standard.setValue([newLanguage], forKey: "AppleLanguages")
// UserDefaults.standard.setValue([newLanguage], forkey: "AppleLanguages")
// exit(0)
@IBAction func userName(_ sender: UITextField) {
}
@IBAction func userEmail(_ sender: UITextField) {
}
@IBAction func userPhone(_ sender: UITextField) {
}
@IBAction func editButton(_ sender: Any) {
}
// MARK: - Table view data source
override func numberOfSections(in tableView: UITableView) -> Int {
// #warning Incomplete implementation, return the number of sections
return 1
}
override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
// #warning Incomplete implementation, return the number of rows
return 6
}
override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
if indexPath.section == 0 {
if indexPath.row == 2 {
performSegue(withIdentifier: "goToDetals", sender: nil)
}
}
}
}