|
@@ -303,6 +303,29 @@ public class APIS: NSObject {
|
|
|
UIApplication.shared.visibleViewController?.present(navigationController, animated: true, completion: nil)
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ public static func openProfile() {
|
|
|
+ let isChangeProfile = Utils.getSetProfile()
|
|
|
+ if !isChangeProfile {
|
|
|
+ APIS.showChangeProfile()
|
|
|
+ return
|
|
|
+ }
|
|
|
+ let controller = AppStoryBoard.Palio.instance.instantiateViewController(withIdentifier: "profileView") as! ProfileViewController
|
|
|
+ controller.data = UserDefaults.standard.string(forKey: "me")!
|
|
|
+ controller.flag = .me
|
|
|
+ controller.dismissImage = { image, imageName in
|
|
|
+ var dataImage: [AnyHashable : Any] = [:]
|
|
|
+ dataImage["name"] = imageName
|
|
|
+ NotificationCenter.default.post(name: NSNotification.Name(rawValue: "imageFBUpdate"), object: nil, userInfo: dataImage)
|
|
|
+ }
|
|
|
+ let navigationController = UINavigationController(rootViewController: controller)
|
|
|
+ navigationController.defaultStyle()
|
|
|
+ if UIApplication.shared.visibleViewController?.navigationController != nil {
|
|
|
+ UIApplication.shared.visibleViewController?.navigationController?.present(navigationController, animated: true, completion: nil)
|
|
|
+ } else {
|
|
|
+ UIApplication.shared.visibleViewController?.present(navigationController, animated: true, completion: nil)
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
extension UINavigationController {
|