# How can I use iOS Libraries?

**URL:** <https://forums.unrealengine.com/t/how-can-i-use-ios-libraries/285786>\
**Category:** Mobile\
**Tags:** xcode, MAC-OS-X, libraries, unreal-engine, unrealbuildtool, question\
**Created:** [June 13, 2014, 12:11pm UTC](https://forums.unrealengine.com/t/how-can-i-use-ios-libraries/285786 "2014-06-13T12:11:58Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![mze](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@mze](https://forums.unrealengine.com/u/mze)\
**Post date:** [June 13, 2014, 12:11pm UTC](https://forums.unrealengine.com/t/how-can-i-use-ios-libraries/285786/1 "2014-06-13T12:11:58Z")

</div>

I’m using a mac to write a game for iOS, I’m trying to use UIKit from xCode however when I import the framework I receive the error that it can’t be found. "Shell Script Invocation Error ‘UIKit/UIAlertView.h’ file not found. Someone asked a similar question and was referred to the unreal source code build.cs, I took my build.cs from there but I can’t see what I’m missing.

In my .cpp class I have:

```
#include "MyProject2.h"
#include "BasicHUD.h"
#import <Foundation/Foundation.h>
#import <UIKit/UIAlertView.h> // Error here: "Shell Script Invocation Error 'UIKit/UIAlertView.h' file not found

ABasicHUD::ABasicHUD(const class FPostConstructInitializeProperties& PCIP)
: Super(PCIP)
{
}

void ABasicHUD::ShowAlert(){
    NSString *string = [[NSString alloc]init];
    UIAlertView *alert = [[UIAlertView alloc]init];
}

```

My build.cs looks like this:

```
using UnrealBuildTool;

public class MyProject2 : ModuleRules
{
    public MyProject2(TargetInfo Target)
    {

        PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore" });

        if (Target.Platform == UnrealTargetPlatform.IOS)
	    {
            PublicIncludePaths.AddRange(new string[] {"Runtime/Core/Public/Apple", "Runtime/Core/Public/IOS"});
		    AddThirdPartyPrivateStaticDependencies( Target, "zlib" );
		    PublicFrameworks.AddRange(new string[] { "UIKit", "AudioToolbox", "AVFoundation", "GameKit", "StoreKit", "CoreVideo", "CoreMedia", "CoreMotion"});

	    }
    }
}
```

---

<div class="post-metadata">

**Author:** ![mze](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@mze](https://forums.unrealengine.com/u/mze)\
**Post date:** [July 8, 2014, 7:57am UTC](https://forums.unrealengine.com/t/how-can-i-use-ios-libraries/285786/2 "2014-07-08T07:57:15Z")

</div>

Still wondering about this one.

---

<div class="post-metadata">

**Author:** ![mindblender](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/mindblender/32/598567_2.png) [@mindblender](https://forums.unrealengine.com/u/mindblender)\
**Post date:** [July 11, 2014, 4:31am UTC](https://forums.unrealengine.com/t/how-can-i-use-ios-libraries/285786/3 "2014-07-11T04:31:41Z")

</div>

I wonder if this is actually possible without making any bridge between Objective-C++ and C++. My guess is that #import is for Objective-C while code is being compiled as C++.

I don’t know a proper way to do this… Looks like standalone static library written in Objective-C++ (C++ simply interfacing Objective-C frameworks) would work… Not sure. never tried so far.

Do we have to dig into engine source to expose ios native features??

I found this QnA [https://answers.unrealengine.com/questions/36890/plugin-doesnt-start-on-ios-device.html](https://answers.unrealengine.com/questions/36890/plugin-doesnt-start-on-ios-device.html)

So… static library plugin, it is.

---

<div class="post-metadata">

**Author:** ![mze](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@mze](https://forums.unrealengine.com/u/mze)\
**Post date:** [July 14, 2014, 10:59am UTC](https://forums.unrealengine.com/t/how-can-i-use-ios-libraries/285786/4 "2014-07-14T10:59:43Z")

</div>

Thanks for the reply.  
Import and include are not so different, can use either. I was looking through the source code to try and find out how they have implemented their iOS features. I haven’t been able to figure out how they’ve done it though. In the source they have imported iOS frameworks no problem and have used objective-c in .cpp files which confuses me.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_23fb44af](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_23fb44af](https://forums.unrealengine.com/u/anonymous_user_23fb44af)\
**Post date:** [November 23, 2017, 1:42pm UTC](https://forums.unrealengine.com/t/how-can-i-use-ios-libraries/285786/5 "2017-11-23T13:42:25Z")

</div>

3 years later…  
Any news on this? Can we build native iOS UIKIT in UE?
