# Integrating Unity game view inside a Native iOS Application view

**URL:** https://discussions.unity.com/t/integrating-unity-game-view-inside-a-native-ios-application-view/745050
**Category:** Mobile
**Tags:** Feedback
**Created:** [May 28, 2019, 2:55pm UTC](https://discussions.unity.com/t/integrating-unity-game-view-inside-a-native-ios-application-view/745050 "2019-05-28T14:55:06Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![unity\_95ICPFwaui8-ZQ](https://avatars.discourse-cdn.com/v4/letter/u/57b2e6/32.png) [@unity\_95ICPFwaui8-ZQ](https://discussions.unity.com/u/unity_95ICPFwaui8-ZQ)
#### Post date: [May 28, 2019, 2:55pm UTC](https://discussions.unity.com/t/integrating-unity-game-view-inside-a-native-ios-application-view/745050/1 "2019-05-28T14:55:06Z")

</div>

I would like to know whether my approach to integrate unity game in native iOS application is good enough and will not face issues going further with the same.

1. Built the UnityFramework target in the iOS application exported from the Unity game.
2. Added the framework in the existing native iOS application
3. Added the required User-defined settings in the existing native iOS application’s build settings
4. In the existing application viewController’s button action method, called the below method to launch the unity window.

[[UnityFramework getInstance] runEmbeddedWithArgc:args.count argv:cargs appLaunchOpts:rage:{}];

1. Added a subclass for UnityAppController and in the preStartUnity method resized the window.  
Eg.  
-( **void** ) preStartUnity {

[**self**.window setFrame:CGRectMake(0, 0, 150, 150)];

}  
Any suggestions on dismissing the view. For now, I did  
[[UnityFramework getInstance] unloadApplicaion: **YES** ]; + UnityAppController.window hidden and then called showUnityWindow to display the game again.  
Also, incase if I need to access any app delegate functionalities I can call them from my existing AppDelegate to the UnityAppController subclass  
Please let me know, if there are any simple and better approaches for integration

---

<div class="post-metadata">

### Author: ![Aiursrage2k](https://dub1.discourse-cdn.com/unity/user_avatar/discussions.unity.com/aiursrage2k/32/275732_2.png) [@Aiursrage2k](https://discussions.unity.com/u/Aiursrage2k)
#### Post date: [May 28, 2019, 8:54pm UTC](https://discussions.unity.com/t/integrating-unity-game-view-inside-a-native-ios-application-view/745050/2 "2019-05-28T20:54:07Z")

</div>

Yeah this is a nightmare and the solution keeps changing

---

<div class="post-metadata">

### Author: ![samizzo](https://dub1.discourse-cdn.com/unity/user_avatar/discussions.unity.com/samizzo/32/312488_2.png) [@samizzo](https://discussions.unity.com/u/samizzo)
#### Post date: [May 29, 2019, 1:18am UTC](https://discussions.unity.com/t/integrating-unity-game-view-inside-a-native-ios-application-view/745050/3 "2019-05-29T01:18:21Z")

</div>

I haven’t tried the new UnityFramework feature but it sounds promising. A few years ago I did this in Unity 5.2.1. Here’s a prototype I built to demonstrate it: [GitHub - samizzo/UnityNativePrototype](https://github.com/samizzo/UnityNativePrototype) I don’t know if my prototype still works but the fundamentals should be good I think. Anyway probably it’s best to go with the UnityFramework stuff but I just thought I’d point out an alternative.

---

<div class="post-metadata">

### Author: ![unity\_95ICPFwaui8-ZQ](https://avatars.discourse-cdn.com/v4/letter/u/57b2e6/32.png) [@unity\_95ICPFwaui8-ZQ](https://discussions.unity.com/u/unity_95ICPFwaui8-ZQ)
#### Post date: [May 29, 2019, 6:24am UTC](https://discussions.unity.com/t/integrating-unity-game-view-inside-a-native-ios-application-view/745050/4 "2019-05-29T06:24:30Z")

</div>

> [@Aiursrage2k](#):
>
> Yeah this is a nightmare and the solution keeps changing

Yeah exactly. Thats why thought to post and get a suggestion

---

<div class="post-metadata">

### Author: ![unity\_95ICPFwaui8-ZQ](https://avatars.discourse-cdn.com/v4/letter/u/57b2e6/32.png) [@unity\_95ICPFwaui8-ZQ](https://discussions.unity.com/u/unity_95ICPFwaui8-ZQ)
#### Post date: [May 29, 2019, 6:38am UTC](https://discussions.unity.com/t/integrating-unity-game-view-inside-a-native-ios-application-view/745050/5 "2019-05-29T06:38:40Z")

</div>

> [@samizzo](#):
>
> I haven’t tried the new UnityFramework feature but it sounds promising. A few years ago I did this in Unity 5.2.1. Here’s a prototype I built to demonstrate it: [https://github.com/samizzo/UnityNativePrototype](https://github.com/samizzo/UnityNativePrototype) I don’t know if my prototype still works but the fundamentals should be good I think. Anyway probably it’s best to go with the UnityFramework stuff but I just thought I’d point out an alternative.

Thanks for the suggestion. Unity project that is built from the latest version looks different from the one which is posted in the GitHub link you provided.
