From 73db225196e4302c3a9b326194bbb24775a4a86d Mon Sep 17 00:00:00 2001 From: Christoph Pader Date: Mon, 30 Sep 2024 16:17:20 +0200 Subject: [PATCH 1/3] fix: VisionCamera session is not deinitialized when screen gets unmounted on `native-stack` --- ....0.0-beta.13+001+rn75-compatibility.patch} | 47 +++++---------- ...stack-unmount-recycle-camera-session.patch | 59 +++++++++++++++++++ 2 files changed, 73 insertions(+), 33 deletions(-) rename patches/{react-native-vision-camera+4.0.0-beta.13.patch => react-native-vision-camera+4.0.0-beta.13+001+rn75-compatibility.patch} (99%) create mode 100644 patches/react-native-vision-camera+4.0.0-beta.13+002+native-stack-unmount-recycle-camera-session.patch diff --git a/patches/react-native-vision-camera+4.0.0-beta.13.patch b/patches/react-native-vision-camera+4.0.0-beta.13+001+rn75-compatibility.patch similarity index 99% rename from patches/react-native-vision-camera+4.0.0-beta.13.patch rename to patches/react-native-vision-camera+4.0.0-beta.13+001+rn75-compatibility.patch index 4e0961ec536ac..b66b659dab577 100644 --- a/patches/react-native-vision-camera+4.0.0-beta.13.patch +++ b/patches/react-native-vision-camera+4.0.0-beta.13+001+rn75-compatibility.patch @@ -1335,7 +1335,7 @@ index 0000000..46c2c2c +#endif /* RCT_NEW_ARCH_ENABLED */ diff --git a/node_modules/react-native-vision-camera/ios/RNCameraView.mm b/node_modules/react-native-vision-camera/ios/RNCameraView.mm new file mode 100644 -index 0000000..019be20 +index 0000000..b90427e --- /dev/null +++ b/node_modules/react-native-vision-camera/ios/RNCameraView.mm @@ -0,0 +1,377 @@ @@ -1384,7 +1384,7 @@ index 0000000..019be20 + + //The remaining part of the initializer is standard Objective-C code to create views and layout them with AutoLayout. Here we can change whatever we want to. + _view = [[CameraView alloc] init]; -+ _view.delegate = self; ++ _view.delegate = self; + + self.contentView = _view; +} @@ -1397,9 +1397,9 @@ index 0000000..019be20 +{ + const auto &newViewProps = *std::static_pointer_cast(props); + const auto &oldViewProps = *std::static_pointer_cast(_props); -+ ++ + NSMutableArray* changedProps = [[NSMutableArray alloc] init]; -+ ++ + if(oldViewProps.isActive != newViewProps.isActive){ + _view.isActive = newViewProps.isActive; + [changedProps addObject:@"isActive"]; @@ -1496,12 +1496,12 @@ index 0000000..019be20 + _view.enableFpsGraph = newViewProps.enableFpsGraph; + [changedProps addObject:@"enableFpsGraph"]; + } -+ -+ ++ ++ + if(_view.format == nil){ + _view.format =[ [NSMutableDictionary alloc] init]; + } -+ ++ + + //Checking format props, TODO: find cleaner way to do it + if(oldViewProps.format.supportsDepthCapture != newViewProps.format.supportsDepthCapture){ @@ -1521,7 +1521,7 @@ index 0000000..019be20 + [_view.format setValue:newPixelFormats forKey:@"pixelFormats"]; + [changedProps addObject:@"format"]; + } -+ ++ + if(oldViewProps.format.videoStabilizationModes.size() != newViewProps.format.videoStabilizationModes.size()){ + NSMutableArray* newVideoStabilizationModes = [[NSMutableArray alloc] init]; + for(int i = 0; i < newViewProps.format.videoStabilizationModes.size(); i++){ @@ -1530,7 +1530,7 @@ index 0000000..019be20 + [_view.format setValue:newVideoStabilizationModes forKey:@"videoStabilizationModes"]; + [changedProps addObject:@"format"]; + } -+ ++ + if(oldViewProps.format.photoHeight != newViewProps.format.photoHeight){ + [_view.format setValue:[NSNumber numberWithDouble:newViewProps.format.photoHeight] forKey:@"photoHeight"]; + [changedProps addObject:@"format"]; @@ -1578,11 +1578,11 @@ index 0000000..019be20 + [_view.format setValue:supportsPhotoHDR forKey:@"supportsPhotoHDR"]; + [changedProps addObject:@"format"]; + } -+ ++ + if (_view.format.count == 0) { + _view.format = nil; + } -+ ++ + if(_view.codeScannerOptions == nil){ + _view.codeScannerOptions =[[NSMutableDictionary alloc] init]; + } @@ -1595,12 +1595,12 @@ index 0000000..019be20 + [_view.codeScannerOptions setValue:newCodeTypes forKey:@"codeTypes"]; + [changedProps addObject:@"codeScannerOptions"]; + } -+ ++ + if(oldViewProps.codeScannerOptions.interval != newViewProps.codeScannerOptions.interval){ + [_view.codeScannerOptions setValue:[NSNumber numberWithDouble:newViewProps.codeScannerOptions.interval] forKey:@"interval"]; + [changedProps addObject:@"codeScannerOptions"]; + } -+ ++ + if( + oldViewProps.codeScannerOptions.regionOfInterest.x != newViewProps.codeScannerOptions.regionOfInterest.x || + oldViewProps.codeScannerOptions.regionOfInterest.y != newViewProps.codeScannerOptions.regionOfInterest.y || @@ -1616,7 +1616,7 @@ index 0000000..019be20 + [_view.codeScannerOptions setValue:newRegionOfInterest forKey:@"regionOfInterest"]; + [changedProps addObject:@"codeScannerOptions"]; + } -+ ++ + if (_view.codeScannerOptions.count == 0) { + _view.codeScannerOptions = nil; + } @@ -2005,25 +2005,6 @@ index 0000000..e47e42f @@ -0,0 +1 @@ +{"version":3,"file":"CameraViewNativeComponent.d.ts","sourceRoot":"","sources":["../../../src/specs/CameraViewNativeComponent.ts"],"names":[],"mappings":";;AACA,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC7D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,2CAA2C,CAAC;AAGnG,MAAM,MAAM,yBAAyB,GAAG,aAAa,CAAC,WAAW,CAAC,CAAC;AAEnE,MAAM,WAAW,WAAY,SAAQ,SAAS;IAC5C,gBAAgB,EAAE,OAAO,CAAC;IAC1B,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,QAAQ,EAAE,MAAM,CAAC;IACjB,oBAAoB,EAAE,OAAO,CAAC;IAC9B,cAAc,EAAE,OAAO,CAAC;IACxB,uBAAuB,EAAE,OAAO,CAAC;IACjC,mBAAmB,EAAE,MAAM,CAAC;IAC5B,QAAQ,EAAE,OAAO,CAAC;IAClB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAA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C;YAAC,OAAO,EAAE,MAAM,CAAC;YAAC,OAAO,EAAE,MAAM,CAAA;SAAE,CAAC,CAAC;KACrF,CAAC,CACH,CAAC;IACF,WAAW,EAAE,kBAAkB,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAC;CAC/C;;AAED,wBAAiE"} \ No newline at end of file -diff --git a/node_modules/react-native-vision-camera/package.json b/node_modules/react-native-vision-camera/package.json -index 86352fa..7af9577 100644 ---- a/node_modules/react-native-vision-camera/package.json -+++ b/node_modules/react-native-vision-camera/package.json -@@ -166,5 +166,13 @@ - ] - ] - }, -- "packageManager": "yarn@1.22.19+sha1.4ba7fc5c6e704fce2066ecbfb0b0d8976fe62447" -+ "codegenConfig": { -+ "name": "RNVisioncameraSpec", -+ "type": "all", -+ "jsSrcsDir": "./src/specs", -+ "android": { -+ "javaPackageName": "com.mrousavy.camera" -+ } -+ }, -+ "packageManager": "yarn@1.22.19" - } diff --git a/node_modules/react-native-vision-camera/src/Camera.tsx b/node_modules/react-native-vision-camera/src/Camera.tsx index 18733ba..1668322 100644 --- a/node_modules/react-native-vision-camera/src/Camera.tsx diff --git a/patches/react-native-vision-camera+4.0.0-beta.13+002+native-stack-unmount-recycle-camera-session.patch b/patches/react-native-vision-camera+4.0.0-beta.13+002+native-stack-unmount-recycle-camera-session.patch new file mode 100644 index 0000000000000..b98b6d30540fa --- /dev/null +++ b/patches/react-native-vision-camera+4.0.0-beta.13+002+native-stack-unmount-recycle-camera-session.patch @@ -0,0 +1,59 @@ +diff --git a/node_modules/react-native-vision-camera/ios/RNCameraView.mm b/node_modules/react-native-vision-camera/ios/RNCameraView.mm +index b90427e..feccc33 100644 +--- a/node_modules/react-native-vision-camera/ios/RNCameraView.mm ++++ b/node_modules/react-native-vision-camera/ios/RNCameraView.mm +@@ -34,26 +34,46 @@ + (ComponentDescriptorProvider)componentDescriptorProvider + return concreteComponentDescriptorProvider(); + } + ++- (void) initCamera { ++ static const auto defaultProps = std::make_shared(); ++ _props = defaultProps; ++ ++ //The remaining part of the initializer is standard Objective-C code to create views and layout them with AutoLayout. Here we can change whatever we want to. ++ _view = [[CameraView alloc] init]; ++ _view.delegate = self; ++ ++ self.contentView = _view; ++} ++ + - (instancetype)initWithFrame:(CGRect)frame + { + self = [super initWithFrame:frame]; +-if (self) { +- static const auto defaultProps = std::make_shared(); +- _props = defaultProps; ++ if (self) { ++ [self initCamera]; ++ } ++ return self; ++} ++ + +- //The remaining part of the initializer is standard Objective-C code to create views and layout them with AutoLayout. Here we can change whatever we want to. +- _view = [[CameraView alloc] init]; +- _view.delegate = self; ++- (void) prepareForRecycle { ++ [super prepareForRecycle]; + +- self.contentView = _view; ++ _view.delegate = nil; ++ _view = nil; ++ self.contentView = nil; + } + +-return self; ++- (void) updateLayoutMetrics:(const facebook::react::LayoutMetrics &)layoutMetrics oldLayoutMetrics:(const facebook::react::LayoutMetrics &)oldLayoutMetrics { ++ [super updateLayoutMetrics:layoutMetrics oldLayoutMetrics:oldLayoutMetrics]; + } + + // why we need this func -> https://reactnative.dev/docs/next/the-new-architecture/pillars-fabric-components#write-the-native-ios-code + - (void)updateProps:(Props::Shared const &)props oldProps:(Props::Shared const &)oldProps + { ++ if (_view == nil) { ++ [self initCamera]; ++ } ++ + const auto &newViewProps = *std::static_pointer_cast(props); + const auto &oldViewProps = *std::static_pointer_cast(_props); + From a0aa19d350a259dedd335ee5c8059267e286648e Mon Sep 17 00:00:00 2001 From: Christoph Pader Date: Tue, 1 Oct 2024 18:51:32 +0200 Subject: [PATCH 2/3] update patch --- ...stack-unmount-recycle-camera-session.patch | 62 +++++++++---------- 1 file changed, 29 insertions(+), 33 deletions(-) diff --git a/patches/react-native-vision-camera+4.0.0-beta.13+002+native-stack-unmount-recycle-camera-session.patch b/patches/react-native-vision-camera+4.0.0-beta.13+002+native-stack-unmount-recycle-camera-session.patch index b98b6d30540fa..311e5c96e2f87 100644 --- a/patches/react-native-vision-camera+4.0.0-beta.13+002+native-stack-unmount-recycle-camera-session.patch +++ b/patches/react-native-vision-camera+4.0.0-beta.13+002+native-stack-unmount-recycle-camera-session.patch @@ -1,50 +1,46 @@ diff --git a/node_modules/react-native-vision-camera/ios/RNCameraView.mm b/node_modules/react-native-vision-camera/ios/RNCameraView.mm -index b90427e..feccc33 100644 +index b90427e..0be4171 100644 --- a/node_modules/react-native-vision-camera/ios/RNCameraView.mm +++ b/node_modules/react-native-vision-camera/ios/RNCameraView.mm -@@ -34,26 +34,46 @@ + (ComponentDescriptorProvider)componentDescriptorProvider +@@ -34,26 +34,43 @@ + (ComponentDescriptorProvider)componentDescriptorProvider return concreteComponentDescriptorProvider(); } -+- (void) initCamera { -+ static const auto defaultProps = std::make_shared(); -+ _props = defaultProps; -+ -+ //The remaining part of the initializer is standard Objective-C code to create views and layout them with AutoLayout. Here we can change whatever we want to. -+ _view = [[CameraView alloc] init]; -+ _view.delegate = self; -+ -+ self.contentView = _view; -+} -+ - - (instancetype)initWithFrame:(CGRect)frame - { - self = [super initWithFrame:frame]; +-- (instancetype)initWithFrame:(CGRect)frame +-{ +- self = [super initWithFrame:frame]; -if (self) { - static const auto defaultProps = std::make_shared(); -- _props = defaultProps; -+ if (self) { -+ [self initCamera]; -+ } -+ return self; -+} -+ ++- (void) initCamera { ++ static const auto defaultProps = std::make_shared(); + _props = defaultProps; - //The remaining part of the initializer is standard Objective-C code to create views and layout them with AutoLayout. Here we can change whatever we want to. -- _view = [[CameraView alloc] init]; -- _view.delegate = self; -+- (void) prepareForRecycle { -+ [super prepareForRecycle]; ++ // The remaining part of the initializer is standard bjective-C code to create views and layout them with utoLayout. Here we can change whatever we want to. + _view = [[CameraView alloc] init]; + _view.delegate = self; -- self.contentView = _view; -+ _view.delegate = nil; -+ _view = nil; -+ self.contentView = nil; + self.contentView = _view; } -return self; -+- (void) updateLayoutMetrics:(const facebook::react::LayoutMetrics &)layoutMetrics oldLayoutMetrics:(const facebook::react::LayoutMetrics &)oldLayoutMetrics { -+ [super updateLayoutMetrics:layoutMetrics oldLayoutMetrics:oldLayoutMetrics]; ++- (instancetype)initWithFrame:(CGRect)frame ++{ ++ self = [super initWithFrame:frame]; ++ if (self) { ++ [self initCamera]; ++ } ++ ++ return self; ++} ++ ++- (void) prepareForRecycle { ++ [super prepareForRecycle]; ++ ++ self.contentView = _view; ++ _view.delegate = nil; ++ _view = nil; ++ self.contentView = nil; } // why we need this func -> https://reactnative.dev/docs/next/the-new-architecture/pillars-fabric-components#write-the-native-ios-code From 00944c0ddbf6ba7171e0aad89490fdd57828e871 Mon Sep 17 00:00:00 2001 From: Christoph Pader Date: Wed, 2 Oct 2024 13:51:51 +0200 Subject: [PATCH 3/3] fix: patches --- ...4.0.0-beta.13+001+rn75-compatibility.patch | 47 +++++++++++++------ ...stack-unmount-recycle-camera-session.patch | 2 +- 2 files changed, 34 insertions(+), 15 deletions(-) diff --git a/patches/react-native-vision-camera+4.0.0-beta.13+001+rn75-compatibility.patch b/patches/react-native-vision-camera+4.0.0-beta.13+001+rn75-compatibility.patch index b66b659dab577..4e0961ec536ac 100644 --- a/patches/react-native-vision-camera+4.0.0-beta.13+001+rn75-compatibility.patch +++ b/patches/react-native-vision-camera+4.0.0-beta.13+001+rn75-compatibility.patch @@ -1335,7 +1335,7 @@ index 0000000..46c2c2c +#endif /* RCT_NEW_ARCH_ENABLED */ diff --git a/node_modules/react-native-vision-camera/ios/RNCameraView.mm b/node_modules/react-native-vision-camera/ios/RNCameraView.mm new file mode 100644 -index 0000000..b90427e +index 0000000..019be20 --- /dev/null +++ b/node_modules/react-native-vision-camera/ios/RNCameraView.mm @@ -0,0 +1,377 @@ @@ -1384,7 +1384,7 @@ index 0000000..b90427e + + //The remaining part of the initializer is standard Objective-C code to create views and layout them with AutoLayout. Here we can change whatever we want to. + _view = [[CameraView alloc] init]; -+ _view.delegate = self; ++ _view.delegate = self; + + self.contentView = _view; +} @@ -1397,9 +1397,9 @@ index 0000000..b90427e +{ + const auto &newViewProps = *std::static_pointer_cast(props); + const auto &oldViewProps = *std::static_pointer_cast(_props); -+ ++ + NSMutableArray* changedProps = [[NSMutableArray alloc] init]; -+ ++ + if(oldViewProps.isActive != newViewProps.isActive){ + _view.isActive = newViewProps.isActive; + [changedProps addObject:@"isActive"]; @@ -1496,12 +1496,12 @@ index 0000000..b90427e + _view.enableFpsGraph = newViewProps.enableFpsGraph; + [changedProps addObject:@"enableFpsGraph"]; + } -+ -+ ++ ++ + if(_view.format == nil){ + _view.format =[ [NSMutableDictionary alloc] init]; + } -+ ++ + + //Checking format props, TODO: find cleaner way to do it + if(oldViewProps.format.supportsDepthCapture != newViewProps.format.supportsDepthCapture){ @@ -1521,7 +1521,7 @@ index 0000000..b90427e + [_view.format setValue:newPixelFormats forKey:@"pixelFormats"]; + [changedProps addObject:@"format"]; + } -+ ++ + if(oldViewProps.format.videoStabilizationModes.size() != newViewProps.format.videoStabilizationModes.size()){ + NSMutableArray* newVideoStabilizationModes = [[NSMutableArray alloc] init]; + for(int i = 0; i < newViewProps.format.videoStabilizationModes.size(); i++){ @@ -1530,7 +1530,7 @@ index 0000000..b90427e + [_view.format setValue:newVideoStabilizationModes forKey:@"videoStabilizationModes"]; + [changedProps addObject:@"format"]; + } -+ ++ + if(oldViewProps.format.photoHeight != newViewProps.format.photoHeight){ + [_view.format setValue:[NSNumber numberWithDouble:newViewProps.format.photoHeight] forKey:@"photoHeight"]; + [changedProps addObject:@"format"]; @@ -1578,11 +1578,11 @@ index 0000000..b90427e + [_view.format setValue:supportsPhotoHDR forKey:@"supportsPhotoHDR"]; + [changedProps addObject:@"format"]; + } -+ ++ + if (_view.format.count == 0) { + _view.format = nil; + } -+ ++ + if(_view.codeScannerOptions == nil){ + _view.codeScannerOptions =[[NSMutableDictionary alloc] init]; + } @@ -1595,12 +1595,12 @@ index 0000000..b90427e + [_view.codeScannerOptions setValue:newCodeTypes forKey:@"codeTypes"]; + [changedProps addObject:@"codeScannerOptions"]; + } -+ ++ + if(oldViewProps.codeScannerOptions.interval != newViewProps.codeScannerOptions.interval){ + [_view.codeScannerOptions setValue:[NSNumber numberWithDouble:newViewProps.codeScannerOptions.interval] forKey:@"interval"]; + [changedProps addObject:@"codeScannerOptions"]; + } -+ ++ + if( + oldViewProps.codeScannerOptions.regionOfInterest.x != newViewProps.codeScannerOptions.regionOfInterest.x || + oldViewProps.codeScannerOptions.regionOfInterest.y != newViewProps.codeScannerOptions.regionOfInterest.y || @@ -1616,7 +1616,7 @@ index 0000000..b90427e + [_view.codeScannerOptions setValue:newRegionOfInterest forKey:@"regionOfInterest"]; + [changedProps addObject:@"codeScannerOptions"]; + } -+ ++ + if (_view.codeScannerOptions.count == 0) { + _view.codeScannerOptions = nil; + } @@ -2005,6 +2005,25 @@ index 0000000..e47e42f @@ -0,0 +1 @@ +{"version":3,"file":"CameraViewNativeComponent.d.ts","sourceRoot":"","sources":["../../../src/specs/CameraViewNativeComponent.ts"],"names":[],"mappings":";;AACA,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC7D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,2CAA2C,CAAC;AAGnG,MAAM,MAAM,yBAAyB,GAAG,aAAa,CAAC,WAAW,CAAC,CAAC;AAEnE,MAAM,WAAW,WAAY,SAAQ,SAAS;IAC5C,gBAAgB,EAAE,OAAO,CAAC;IAC1B,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,QAAQ,EAAE,MAAM,CAAC;IACjB,oBAAoB,EAAE,OAAO,CAAC;IAC9B,cAAc,EAAE,OAAO,CAAC;IACxB,uBAAuB,EAAE,OAAO,CAAC;IACjC,mBAAmB,EAAE,MAAM,CAAC;IAC5B,QAAQ,EAAE,OAAO,CAAC;IAClB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAA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C;YAAC,MAAM,EAAE,MAAM,CAAC;YAAC,OAAO,EAAE,MAAM,CAAC;YAAC,OAAO,EAAE,MAAM,CAAA;SAAE,CAAC,CAAC;KACrF,CAAC,CACH,CAAC;IACF,WAAW,EAAE,kBAAkB,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAC;CAC/C;;AAED,wBAAiE"} \ No newline at end of file +diff --git a/node_modules/react-native-vision-camera/package.json b/node_modules/react-native-vision-camera/package.json +index 86352fa..7af9577 100644 +--- a/node_modules/react-native-vision-camera/package.json ++++ b/node_modules/react-native-vision-camera/package.json +@@ -166,5 +166,13 @@ + ] + ] + }, +- "packageManager": "yarn@1.22.19+sha1.4ba7fc5c6e704fce2066ecbfb0b0d8976fe62447" ++ "codegenConfig": { ++ "name": "RNVisioncameraSpec", ++ "type": "all", ++ "jsSrcsDir": "./src/specs", ++ "android": { ++ "javaPackageName": "com.mrousavy.camera" ++ } ++ }, ++ "packageManager": "yarn@1.22.19" + } diff --git a/node_modules/react-native-vision-camera/src/Camera.tsx b/node_modules/react-native-vision-camera/src/Camera.tsx index 18733ba..1668322 100644 --- a/node_modules/react-native-vision-camera/src/Camera.tsx diff --git a/patches/react-native-vision-camera+4.0.0-beta.13+002+native-stack-unmount-recycle-camera-session.patch b/patches/react-native-vision-camera+4.0.0-beta.13+002+native-stack-unmount-recycle-camera-session.patch index 311e5c96e2f87..ac9bda68f9d9d 100644 --- a/patches/react-native-vision-camera+4.0.0-beta.13+002+native-stack-unmount-recycle-camera-session.patch +++ b/patches/react-native-vision-camera+4.0.0-beta.13+002+native-stack-unmount-recycle-camera-session.patch @@ -12,7 +12,7 @@ index b90427e..0be4171 100644 -if (self) { - static const auto defaultProps = std::make_shared(); +- (void) initCamera { -+ static const auto defaultProps = std::make_shared(); ++ static const auto defaultProps = std::make_shared(); _props = defaultProps; - //The remaining part of the initializer is standard Objective-C code to create views and layout them with AutoLayout. Here we can change whatever we want to.