 
 
Swift에서 Objective C 호출
설정 : Build Settings -> Swift Compiler - General -> Objective-C Bridging Header 에서 헤더 설정 (보통 mm 파일 생성 시 자동 생성 됨)
// MyProject-Bridging-Header.h
#include "MyObjectiveC.h"
// MyObjectiveC.h
@interface MyObjectiveC : NSObject
-(void)Hello
@end
// MyObjectiveC.mm
@import "MyObjectiveC.h"
@implementation MyObjectiveC
-(void)Hello
{
	// do something
}
// MySwift.swift
class Test
{
	func hello()
	{
		MyObjectiveC().Hello()
	}
}
 
Objective C에서 Swift 호출
설정 : Build Settings -> Packaging -> Defines Module : Yes ( -Swift.h가 자동 생성됨)
// MyObjectiveC.mm
#import "MyProject-Swift.h"
void Test()
{
	[[MySwift shared] Hello];
}
// MySwift.swift
#import Foundation
@objc class MySwift : NSObject {
	@objc static let shared = MySwift()
    @objc func Hello()
    {
    	print("hello world");
    }
}
 
Objective C에서 C++ 호출
// Test.hpp
#pragma once
class Test
{
public:
    Test();
    void Hello();
}
void CStyle();
// Test.cpp
Test::Test()
{
}
void Test::Hello()
{
	printf("hello");
}
void CStyle()
{
	printf("C");
}
// MyObjectiveC.mm
#import "Test.hpp"
@implementation MyObjectiveC
-(void)start
{
	CStyle();
	Test test;
	test.Hello();
}
 
C++에서 Objective C호출
// MyCpp.cpp
#include "MyObjectiveC.h"
void func()
{
	Hello();
}
// MyObjectiveC.h
#pragma once
void Hello();
// MyObjectiveC.mm
void Hello()
{
	// do something..
}