ToastTipIos.mm
//
// ToastTipIos.m
// pinyin iOS
//
// Created by zhoushaohua on 2018/6/4.
//
#import <Foundation/Foundation.h>
#import "ToastView.h"
#import "ToastTipIos.h"
#import "RootViewController.h"
@interface ToastTipViewController : UINavigationController
-(void)show:(std::string)msg;
@end
@interface ToastTipViewController()<ToastTipViewDelegate>
@property ToastView *toastView;
@end
@implementation ToastTipViewController
- (void) show:(std::string)msg
{
//[[[ToastView alloc] init] popUpToastWithMessage:@"提示內容"];
}
@end
ToastTipIos *ToastTipIos::toastTipIos = nullptr;
ToastTipIos *ToastTipIos::getInstance()
{
if (toastTipIos == nullptr) {
toastTipIos = new ToastTipIos();
}
return toastTipIos;
}
//void ToastTipIos::setViewController(void* viewController)
//{
// this->viewController = viewController;
//
// toastTipIosViewController = [[ToastTipViewController alloc] initWithNibName:nil bundle:nil];
// [((ToastTipViewController*)toastTipIosViewController) initSelf];
// [((RootViewController*)viewController).view addSubview:((ToastTipViewController*)toastTipIosViewController).view];
//}
void ToastTipIos::show(std::string msg)
{
NSString *converString = [NSString stringWithCString:msg.c_str()encoding:NSUTF8StringEncoding];
[[[ToastView alloc] init] popUpToastWithMessage:converString];
}