# How make UIView visible in UX

**URL:** <https://forums.fusetools.com/t/how-make-uiview-visible-in-ux/6156>\
**Category:** How-to Discussions\
**Created:** [October 28, 2016, 2:50pm UTC](https://forums.fusetools.com/t/how-make-uiview-visible-in-ux/6156 "2016-10-28T14:50:06Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Donald](https://avatars.discourse-cdn.com/v4/letter/d/ac8455/32.png) [@Donald](https://forums.fusetools.com/u/Donald)\
**Post date:** [October 28, 2016, 2:50pm UTC](https://forums.fusetools.com/t/how-make-uiview-visible-in-ux/6156/1 "2016-10-28T14:50:06Z")

</div>

Hi,

i’m trying to implement QR/EAN barcode scanner and i will use for this existing module [https://github.com/bolav/fuse-barcodescanner](https://github.com/bolav/fuse-barcodescanner)  
I downloaded actual version of MTBBarcodeScanner library and i have it integrated in this module. Now is it builded correctly after few modifications.  
But what i don’t understand is, how can i make this UIView, in which will be camera, visible with UX ?

This is part of UNO implementation.

```auto
using Uno;
using Uno.Collections;
using Fuse;
using Fuse.Scripting;
using Fuse.Reactive;
using Uno.Compiler.ExportTargetInterop;

[Require("Source.Include", "MTBBarcodeScanner.h")]
[ForeignInclude(Language.ObjC, "MTBBasicExampleViewController.h")]
public class BarcodeScanner : NativeModule {

	public BarcodeScanner(){
		AddMember(new NativeFunction("scanner", 
			(NativeCallback)Scanner));
	}
	object Scanner(Context c, object[] args){
		Scanner();

		return null;
	}

	[Foreign(Language.ObjC)]

	static extern(iOS) void Scanner()
	@{
		UIView *previewView = [UIApplication sharedApplication].keyWindow;

		NSLog(@"This is it: %@", @"This is my string text!");
		MTBBarcodeScanner *scanner = [[MTBBarcodeScanner alloc] initWithPreviewView:previewView];
		[MTBBarcodeScanner requestCameraPermissionWithSuccess:^(BOOL success) {
			if (success) {
				NSError *error;
				[self.scanner startScanningWithResultBlock:^(NSArray *codes) {
					AVMetadataMachineReadableCodeObject *code = [codes firstObject];
					NSLog(@"Found code: %@", code.stringValue);
					[self.scanner stopScanning];
				} error:&error];
			} else {
				NSLog(@"The user denied access to the camera");
				// The user denied access to the camera
			}
		}];

	@}
	static extern(!iOS) void Scanner(){
		debug_log("Barcode Scanner is not supported on this platform");
	}

}

```

---

<div class="post-metadata">

**Author:** ![Anders\_Lassen](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/anders_lassen/32/522_2.png) [@Anders\_Lassen](https://forums.fusetools.com/u/Anders_Lassen)\
**Post date:** [October 31, 2016, 4:28pm UTC](https://forums.fusetools.com/t/how-make-uiview-visible-in-ux/6156/2 "2016-10-31T16:28:44Z")

</div>

Hi!

Have a look here: [https://github.com/nekronos/FuseNativeControls](https://github.com/nekronos/FuseNativeControls)

---

<div class="post-metadata">

**Author:** ![Donald](https://avatars.discourse-cdn.com/v4/letter/d/ac8455/32.png) [@Donald](https://forums.fusetools.com/u/Donald)\
**Post date:** [October 31, 2016, 4:46pm UTC](https://forums.fusetools.com/t/how-make-uiview-visible-in-ux/6156/3 "2016-10-31T16:46:51Z")

</div>

Hi Anders,

sry but i don’t think, that this my question has something to do with native controls

---

<div class="post-metadata">

**Author:** ![Anders\_Lassen](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/anders_lassen/32/522_2.png) [@Anders\_Lassen](https://forums.fusetools.com/u/Anders_Lassen)\
**Post date:** [November 4, 2016, 11:47am UTC](https://forums.fusetools.com/t/how-make-uiview-visible-in-ux/6156/4 "2016-11-04T11:47:09Z")

</div>

You are asking how to make an `UIView` (native iOS view) visible, so if that’s not a question about native controls then I’m not understanding the question correctly. Please be more clear/specific.

---

<div class="post-metadata">

**Author:** ![Donald](https://avatars.discourse-cdn.com/v4/letter/d/ac8455/32.png) [@Donald](https://forums.fusetools.com/u/Donald)\
**Post date:** [November 5, 2016, 6:00pm UTC](https://forums.fusetools.com/t/how-make-uiview-visible-in-ux/6156/5 "2016-11-05T18:00:39Z")

</div>

I have solved it with:

```auto
UIViewController *uivc = [UIApplication sharedApplication].keyWindow.rootViewController;

```

and then in UX i must this have:

```auto
<ClientPanel>
        <StackPanel>

```

then it works me.

---

<div class="post-metadata">

**Author:** ![Vegard\_Strand\_Lende](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/vegard_strand_lende/32/349_2.png) [@Vegard\_Strand\_Lende](https://forums.fusetools.com/u/Vegard_Strand_Lende)\
**Post date:** [November 10, 2016, 2:21pm UTC](https://forums.fusetools.com/t/how-make-uiview-visible-in-ux/6156/6 "2016-11-10T14:21:30Z")

</div>

Hi!

The github project [https://github.com/nekronos/FuseNativeControls](https://github.com/nekronos/FuseNativeControls) is a good place to look if you want to integrate native android and/or ios views. I guess the way you have solved it works, but that wont take part in fuse layout and hittesting.
