UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
IOSView.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
5#ifndef SWIFT_IMPORT
6#include "CoreTypes.h"
9#endif
10
11#import <UIKit/UIKit.h>
12
13#import <Metal/Metal.h>
14#import <QuartzCore/CAMetalLayer.h>
15
16#if WITH_ACCESSIBILITY
18#endif
19
20#ifndef SWIFT_IMPORT
34
35namespace MTL
36{
37 class Device;
38}
39#endif
40
41#ifndef SWIFT_IMPORT
43#endif
44@interface FIOSView : UIView <UIKeyInput, UITextInput>
45{
46@public
47 // are we initialized?
48 bool bIsInitialized;
50//@private
51 // keeps track of the number of active touches
52 // used to bring up the three finger touch debug console after 3 active touches are registered
55 // track the touches by pointer (which will stay the same for a given finger down) - note we don't deref the pointers in this array
57 float PreviousForces[10];
58 bool HasMoved[10];
60 // global metal device
61#ifndef SWIFT_IMPORT
62 MTL::Device* MetalDevice;
63#endif
65 // Might be null if caching is disabled.
69
70 // whether or not to use the new style virtual keyboard that sends events to the engine instead of using an alert
74 // caches for the TextInput
82 volatile int KeyboardShowCount;
84#if !PLATFORM_TVOS
86 // the orientation for the current frame we are displaying, or 0 if none is available
88#endif
89}
90
91#if WITH_ACCESSIBILITY
94#endif
95
97@property (nonatomic) uint SwapCount;
98@property (assign, nonatomic) CGSize ViewSize;
100-(bool)CreateFramebuffer;
101-(void)DestroyFramebuffer;
102-(void)UpdateRenderWidth:(unsigned int)Width andHeight:(unsigned int)Height;
103-(void)CalculateContentScaleFactor:(int)ScreenWidth ScreenHeight:(int)ScreenHeight;
104-(void)forceLayoutSubviews;
105
106- (void)SwapBuffers;
107
109// Return a drawable object (ie a back buffer texture) for the RHI to render to
110- (id<CAMetalDrawable>)MakeDrawable;
111
112#ifndef SWIFT_IMPORT
114-(void)InitKeyboard;
115-(void)ActivateKeyboard:(bool)bInSendEscapeOnClose;
116-(void)ActivateKeyboard:(bool)bInSendEscapeOnClose keyboardConfig:(FKeyboardConfig)KeyboardConfig;
117-(void)DeactivateKeyboard;
118-(bool)ShouldUseIntegratedKeyboard;
119
120// callable from outside to fake locations
121-(void)HandleTouchAtLoc:(CGPoint)Loc PrevLoc:(CGPoint)PrevLoc TouchIndex:(int)TouchIndex Force:(float)Force Type:(TouchType)Type TouchesArray:(TArray<TouchInput>&)TouchesArray;
122#endif
123
124#if BUILD_EMBEDDED_APP
125// startup UE before we have a view - so that we don't need block on Metal device creation, which can take .5-1.5 seconds!
127#endif
128
129@end
130
131
135#if PLATFORM_TVOS
136#import <GameController/GameController.h>
137// if TVOS doesn't use the GCEventViewController, it will background the app when the user presses Menu/Pause
139#else
140@interface IOSViewController : UIViewController
141#endif
142{
143}
144
145#if !PLATFORM_TVOS && !PLATFORM_VISIONOS
147
150#endif
151
152@end
OODEFFUNC typedef void(OODLE_CALLBACK t_fp_OodleCore_Plugin_Free)(void *ptr)
TouchType
Definition AndroidInputInterface.h:85
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
const bool
Definition NetworkReplayStreaming.h:178
Definition IOSView.cpp:91
bool HasMoved[10]
Definition IOSView.h:59
float PreviousForces[10]
Definition IOSView.h:58
UIInterfaceOrientationMask LastFrameInterfaceOrientationMask
Definition IOSView.h:88
NSString * CachedMarkedText
Definition IOSView.h:76
UITouch * AllTouches[10]
Definition IOSView.h:57
bool bSendEscapeOnClose
Definition IOSView.h:73
bool bIsInitialized
Definition IOSView.h:49
UIInterfaceOrientationMask SupportedInterfaceOrientations
Definition IOSView.h:86
id< CAMetalDrawable > PanicDrawable
Definition IOSView.h:65
volatile int KeyboardShowCount
Definition IOSView.h:83
int NumActiveTouches
Definition IOSView.h:54
CAMetalLayer * CachedMetalLayer
Definition IOSView.h:67
bool bIsUsingIntegratedKeyboard
Definition IOSView.h:72
UITextAutocapitalizationType AutocapitalizationType
Definition IOSView.h:80
BOOL bSecureTextEntry
Definition IOSView.h:81
UIKeyboardType KeyboardType
Definition IOSView.h:78
UITextAutocorrectionType AutocorrectionType
Definition IOSView.h:79
MTL::Device * MetalDevice
Definition IOSView.h:63
Definition IOSView.cpp:1091
UIInterfaceOrientationMask supportedInterfaceOrientations_Internal()
Definition IOSView.cpp:1136
UIInterfaceOrientationMask supportedInterfaceOrientations()
Definition IOSView.cpp:1154
Definition Array.h:670
Definition IOSView.cpp:31
Definition IOSView.h:22
FKeyboardConfig()
Definition IOSView.h:28
UIKeyboardType KeyboardType
Definition IOSView.h:23
UITextAutocapitalizationType AutocapitalizationType
Definition IOSView.h:25
UITextAutocorrectionType AutocorrectionType
Definition IOSView.h:24
BOOL bSecureTextEntry
Definition IOSView.h:26
Definition AndroidInputInterface.h:145