Skip to content
This repository was archived by the owner on Aug 5, 2025. It is now read-only.

Repository files navigation

DPLocalized

Change languages inside the app, no need to wait the screen to reboot any more.

CocoapodsPod LicenseSwift-5.3Carthage Compatible

alt text

Usage

First of all, the app needs to support multi-language, or another professional word "Localizations" in Xcode project.

Add notifications, to reload data of current page, or previous pages in the memory

func addNotifications(){NotificationCenter.default
.addObserver(self, selector: #selector(languageDidChange(_:)),
name:DPNotification.languageDidChange, object:nil)}deinit{NotificationCenter.default
.removeObserver(self, name:DPNotification.languageDidChange, object:nil)}@objcfunc languageDidChange(_ notification:Notification){
tableView.reloadData()}

Then add this line to the entry, it will open the language setting menu

DPLanguageManager.shared.popup(self)

And for the strings need to be localized, there is a syntax sugar in extension

"puppy".localized

And that's all. Thanks

About

Change languages inside the app, no need to wait the screen to reboot any more

Resources

Stars

11 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages