Как использовать приложение написанное на Objective-C++ из swift приложения?

Всем привет! Подскажите кто знает.

Есть старое игра написание на Objective-C + C++. Все игра состоит из main.h main.mm и ресурса с изображениями. На текущий момент мне необходмо вставить код (написаный на swift) который необходимо вставить перед запуском игры. Как использовать приложение написанное на Objective-C++ из swift приложения?

main.h

//
#import <UIKit/UIKit.h>
#import <QuartzCore/QuartzCore.h>
#import <OpenGLES/EAGL.h>
#import <OpenGLES/EAGLDrawable.h>
#import <OpenGLES/ES1/gl.h>
#import <OpenGLES/ES1/glext.h>
#import <OpenGLES/ES2/gl.h>
#import <OpenGLES/ES2/glext.h>
#import <OpenAL/al.h>
#import <OpenAL/alc.h>
#import <AVFoundation/AVAudioPlayer.h>
#import <AudioToolbox/AudioToolbox.h>

#include <TargetConditionals.h>
#include <mach-o/dyld.h>

#include <cmath>
#include <cctype>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <vector>
#include <typeinfo>
#include <sys/stat.h>
#include <dirent.h>
#include <copyfile.h>
#include <signal.h>
#include <pthread.h>

class TBIOSGame;

@class TreasureBox;
@class TreasureBoxWindow;
@class TreasureBoxController;
@class TreasureBoxAppDelegate;

@interface TBTreasureBoxView : UIView {
@public
    EAGLContext *context;
    
    GLint backingWidth;
    GLint backingHeight;
    
    GLuint defaultFramebuffer;
    GLuint colorRenderbuffer;
    GLuint depthRenderbuffer;
}

+(Class)layerClass;
-(id)initWithCoder:(NSCoder*)coder;
-(void)drawView:(id)sender;
-(void)presentRenderbuffer;
-(BOOL)resizeFromLayer:(CAEAGLLayer *)layer;
-(void)layoutSubviews;
-(void)dealloc;

@end

@interface TBTreasureBoxWindow : UIWindow{
@public
}

-(void)touchesBegan:(NSSet*)touches withEvent:(UIEvent*)event;
-(void)touchesMoved:(NSSet*)touches withEvent:(UIEvent*)event;
-(void)touchesEnded:(NSSet*)touches withEvent:(UIEvent*)event;
-(void)touchesCancelled:(NSSet*)touches withEvent:(UIEvent*)event;

@end

@interface TBTreasureBoxViewController : UIViewController{
@public
}

-(void)viewDidAppear:(BOOL)animated;
-(void)viewDidDisappear:(BOOL)animated;
-(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation;
-(BOOL)shouldAutorotate;
-(NSUInteger)supportedInterfaceOrientations;

@end

@interface TBTreasureBoxAppDelegate : NSObject{
@public
    TBIOSGame *game;
    TreasureBoxWindow *_window;
    TreasureBox *view;
    TreasureBoxController *viewController;
    UITextField *textField;
    int textFieldState;
}

-(void)applicationWillResignActive:(UIApplication*)application;
-(void)applicationDidBecomeActive:(UIApplication*)application;
-(BOOL)textFieldShouldEndEditing:(UITextField*)textField;
-(BOOL)textField:(UITextField*)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString*)str;
-(void)updateTimerFired;
-(void)dealloc;
    
@property (nonatomic, retain) IBOutlet TreasureBoxWindow *_window;
@property (nonatomic, retain) IBOutlet TreasureBox *view;
@property (nonatomic, retain) IBOutlet TreasureBoxController *viewController;
@property (nonatomic, retain) IBOutlet UITextField *textField;

@end


//
@interface TreasureBox : TBTreasureBoxView{
}
@end

@interface TreasureBoxWindow : TBTreasureBoxWindow{
}
@end

@interface TreasureBoxController : TBTreasureBoxViewController{
}
@end

@interface TreasureBoxAppDelegate : TBTreasureBoxAppDelegate{
}
@end

Ответы (0 шт):