![]() ![]() Let objDetailVC = objDetailStoryboard. Let objDetailStoryboard = UIStoryboard.init(name: "CountryDetailSB", bundle: nil) ansform = CGAffineTransform(scaleX: -1, y: 1)įunc tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) If (forKey: "Language") as! String = "he" Let imgSelect = cell.viewWithTag(102) as! UIImageView Let lblCountryName = cell.viewWithTag(101) as! UILabel Let cell = queueReusableCell(withIdentifier: "Cell", for: indexPath) Design title and tableview as below.Įxtension CountryListViewController: UITableViewDelegate, UITableViewDataSourceįunc tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Intįunc tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell You can see that if the English language is selected then push animation will look from left to right and if Hebrew is selected then push animation will look from right to left. Then push view to the CountryListViewController. With the previous navigation, it is not possible to get the effect of new semantic so we created new navigation and set it into the application’s rootViewContoller. If the selected language is Hebrew, then set it into UserDefaults and set app’s navigation right to left. We have to set new rootViewController for getting the effect of newly set semantic. If it is English then set it into UserDefaults and set app’s navigation left to right. So simply push into the Country List view. If the currently selected language is the same as the previously selected language, then no need to change the application’s language. In the above method, first, we have checked whether the selected language is equal to the previously selected language or not. Self.navigationController!.pushViewController(objListVC, animated: true) RootNav.pushViewController(objListVC, animated: true) Let objListVC = objListStoryboard.instantiateViewController(withIdentifier: "CountryListViewController") as! CountryListViewController Let objListStoryboard = UIStoryboard.init(name: "CountryListSB", bundle: nil) Let rootNav = objStoryboard.instantiateViewController(withIdentifier: "rootNav") as! UINavigationController ![]() Let objStoryboard = UIStoryboard.init(name: "Main", bundle: nil) ![]() UIView.appearance().semanticContentAttribute =.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |