Skip to content

Commit c515c6f

Browse files
committed
Replace ivars with properties
1 parent de9ab37 commit c515c6f

File tree

4 files changed

+36
-38
lines changed

4 files changed

+36
-38
lines changed

packages/camera/camera_avfoundation/example/ios/Runner.xcodeproj/project.pbxproj

+2-2
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@
5252
E11D6A8F2D81B81D0031E6C5 /* MockCaptureVideoDataOutput.swift in Sources */ = {isa = PBXBuildFile; fileRef = E11D6A8E2D81B81D0031E6C5 /* MockCaptureVideoDataOutput.swift */; };
5353
E12C4FF62D68C69000515E70 /* CameraPluginDelegatingMethodTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = E12C4FF52D68C69000515E70 /* CameraPluginDelegatingMethodTests.swift */; };
5454
E12C4FF82D68E85500515E70 /* MockFLTCameraPermissionManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = E12C4FF72D68E85500515E70 /* MockFLTCameraPermissionManager.swift */; };
55-
E1A5F4E32D80259C0005BA64 /* FLTCamSetFlashModeTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = E1A5F4E22D80259C0005BA64 /* FLTCamSetFlashModeTests.swift */; };
5655
E15139182D80980900FEE47B /* FLTCamSetDeviceOrientationTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = E15139172D80980900FEE47B /* FLTCamSetDeviceOrientationTests.swift */; };
56+
E1A5F4E32D80259C0005BA64 /* FLTCamSetFlashModeTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = E1A5F4E22D80259C0005BA64 /* FLTCamSetFlashModeTests.swift */; };
5757
E1FFEAAD2D6C8DD700B14107 /* MockFLTCam.swift in Sources */ = {isa = PBXBuildFile; fileRef = E1FFEAAC2D6C8DD700B14107 /* MockFLTCam.swift */; };
5858
E1FFEAAF2D6CDA8C00B14107 /* CameraPluginCreateCameraTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = E1FFEAAE2D6CDA8C00B14107 /* CameraPluginCreateCameraTests.swift */; };
5959
E1FFEAB12D6CDE5B00B14107 /* CameraPluginInitializeCameraTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = E1FFEAB02D6CDE5B00B14107 /* CameraPluginInitializeCameraTests.swift */; };
@@ -152,8 +152,8 @@
152152
E11D6A8E2D81B81D0031E6C5 /* MockCaptureVideoDataOutput.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MockCaptureVideoDataOutput.swift; sourceTree = "<group>"; };
153153
E12C4FF52D68C69000515E70 /* CameraPluginDelegatingMethodTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CameraPluginDelegatingMethodTests.swift; sourceTree = "<group>"; };
154154
E12C4FF72D68E85500515E70 /* MockFLTCameraPermissionManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MockFLTCameraPermissionManager.swift; sourceTree = "<group>"; };
155-
E1A5F4E22D80259C0005BA64 /* FLTCamSetFlashModeTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FLTCamSetFlashModeTests.swift; sourceTree = "<group>"; };
156155
E15139172D80980900FEE47B /* FLTCamSetDeviceOrientationTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FLTCamSetDeviceOrientationTests.swift; sourceTree = "<group>"; };
156+
E1A5F4E22D80259C0005BA64 /* FLTCamSetFlashModeTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FLTCamSetFlashModeTests.swift; sourceTree = "<group>"; };
157157
E1FFEAAC2D6C8DD700B14107 /* MockFLTCam.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MockFLTCam.swift; sourceTree = "<group>"; };
158158
E1FFEAAE2D6CDA8C00B14107 /* CameraPluginCreateCameraTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CameraPluginCreateCameraTests.swift; sourceTree = "<group>"; };
159159
E1FFEAB02D6CDE5B00B14107 /* CameraPluginInitializeCameraTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CameraPluginInitializeCameraTests.swift; sourceTree = "<group>"; };

packages/camera/camera_avfoundation/ios/camera_avfoundation/Sources/camera_avfoundation/FLTCaptureConnection.m

+12-10
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,11 @@
44

55
#import "./include/camera_avfoundation/FLTCaptureConnection.h"
66

7-
@implementation FLTDefaultCaptureConnection {
8-
AVCaptureConnection *_connection;
9-
}
7+
@interface FLTDefaultCaptureConnection ()
8+
@property(nonatomic, strong) AVCaptureConnection *connection;
9+
@end
10+
11+
@implementation FLTDefaultCaptureConnection
1012

1113
- (instancetype)initWithConnection:(AVCaptureConnection *)connection {
1214
self = [super init];
@@ -17,31 +19,31 @@ - (instancetype)initWithConnection:(AVCaptureConnection *)connection {
1719
}
1820

1921
- (BOOL)isVideoMirroringSupported {
20-
return _connection.isVideoMirroringSupported;
22+
return self.connection.isVideoMirroringSupported;
2123
}
2224

2325
- (BOOL)isVideoOrientationSupported {
24-
return _connection.isVideoOrientationSupported;
26+
return self.connection.isVideoOrientationSupported;
2527
}
2628

2729
- (void)setVideoMirrored:(BOOL)videoMirrored {
28-
_connection.videoMirrored = videoMirrored;
30+
self.connection.videoMirrored = videoMirrored;
2931
}
3032

3133
- (BOOL)isVideoMirrored {
32-
return _connection.isVideoMirrored;
34+
return self.connection.isVideoMirrored;
3335
}
3436

3537
- (void)setVideoOrientation:(AVCaptureVideoOrientation)videoOrientation {
36-
_connection.videoOrientation = videoOrientation;
38+
self.connection.videoOrientation = videoOrientation;
3739
}
3840

3941
- (AVCaptureVideoOrientation)videoOrientation {
40-
return _connection.videoOrientation;
42+
return self.connection.videoOrientation;
4143
}
4244

4345
- (NSArray<AVCaptureInputPort *> *)inputPorts {
44-
return _connection.inputPorts;
46+
return self.connection.inputPorts;
4547
}
4648

4749
@end

packages/camera/camera_avfoundation/ios/camera_avfoundation/Sources/camera_avfoundation/FLTCapturePhotoOutput.m

+11-13
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,11 @@
44

55
#import "./include/camera_avfoundation/FLTCapturePhotoOutput.h"
66

7-
@implementation FLTDefaultCapturePhotoOutput {
8-
AVCapturePhotoOutput *_avOutput;
9-
}
7+
@interface FLTDefaultCapturePhotoOutput ()
8+
@property(nonatomic, strong) AVCapturePhotoOutput *avOutput;
9+
@end
10+
11+
@implementation FLTDefaultCapturePhotoOutput
1012

1113
- (instancetype)initWithPhotoOutput:(AVCapturePhotoOutput *)photoOutput {
1214
self = [super init];
@@ -16,35 +18,31 @@ - (instancetype)initWithPhotoOutput:(AVCapturePhotoOutput *)photoOutput {
1618
return self;
1719
}
1820

19-
- (AVCapturePhotoOutput *)avOutput {
20-
return _avOutput;
21-
}
22-
2321
- (NSArray<AVVideoCodecType> *)availablePhotoCodecTypes {
24-
return _avOutput.availablePhotoCodecTypes;
22+
return self.avOutput.availablePhotoCodecTypes;
2523
}
2624

2725
- (BOOL)highResolutionCaptureEnabled {
28-
return _avOutput.isHighResolutionCaptureEnabled;
26+
return self.avOutput.isHighResolutionCaptureEnabled;
2927
}
3028

3129
- (void)setHighResolutionCaptureEnabled:(BOOL)enabled {
32-
[_avOutput setHighResolutionCaptureEnabled:enabled];
30+
[self.avOutput setHighResolutionCaptureEnabled:enabled];
3331
}
3432

3533
- (void)capturePhotoWithSettings:(AVCapturePhotoSettings *)settings
3634
delegate:(NSObject<AVCapturePhotoCaptureDelegate> *)delegate {
37-
[_avOutput capturePhotoWithSettings:settings delegate:delegate];
35+
[self.avOutput capturePhotoWithSettings:settings delegate:delegate];
3836
}
3937

4038
- (nullable NSObject<FLTCaptureConnection> *)connectionWithMediaType:
4139
(nonnull AVMediaType)mediaType {
4240
return [[FLTDefaultCaptureConnection alloc]
43-
initWithConnection:[_avOutput connectionWithMediaType:mediaType]];
41+
initWithConnection:[self.avOutput connectionWithMediaType:mediaType]];
4442
}
4543

4644
- (NSArray<NSNumber *> *)supportedFlashModes {
47-
return _avOutput.supportedFlashModes;
45+
return self.avOutput.supportedFlashModes;
4846
}
4947

5048
@end

packages/camera/camera_avfoundation/ios/camera_avfoundation/Sources/camera_avfoundation/FLTCaptureVideoDataOutput.m

+11-13
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,11 @@
44

55
#import "./include/camera_avfoundation/FLTCaptureVideoDataOutput.h"
66

7-
@implementation FLTDefaultCaptureVideoDataOutput {
8-
AVCaptureVideoDataOutput *_avOutput;
9-
}
7+
@interface FLTDefaultCaptureVideoDataOutput ()
8+
@property(nonatomic, strong) AVCaptureVideoDataOutput *avOutput;
9+
@end
10+
11+
@implementation FLTDefaultCaptureVideoDataOutput
1012

1113
- (instancetype)initWithCaptureVideoOutput:(AVCaptureVideoDataOutput *)videoOutput {
1214
self = [super init];
@@ -16,36 +18,32 @@ - (instancetype)initWithCaptureVideoOutput:(AVCaptureVideoDataOutput *)videoOutp
1618
return self;
1719
}
1820

19-
- (AVCaptureVideoDataOutput *)avOutput {
20-
return _avOutput;
21-
}
22-
2321
- (BOOL)alwaysDiscardsLateVideoFrames {
24-
return _avOutput.alwaysDiscardsLateVideoFrames;
22+
return self.avOutput.alwaysDiscardsLateVideoFrames;
2523
}
2624

2725
- (void)setAlwaysDiscardsLateVideoFrames:(BOOL)alwaysDiscardsLateVideoFrames {
28-
_avOutput.alwaysDiscardsLateVideoFrames = alwaysDiscardsLateVideoFrames;
26+
self.avOutput.alwaysDiscardsLateVideoFrames = alwaysDiscardsLateVideoFrames;
2927
}
3028

3129
- (NSDictionary<NSString *, id> *)videoSettings {
32-
return _avOutput.videoSettings;
30+
return self.avOutput.videoSettings;
3331
}
3432

3533
- (void)setVideoSettings:(NSDictionary<NSString *, id> *)videoSettings {
36-
_avOutput.videoSettings = videoSettings;
34+
self.avOutput.videoSettings = videoSettings;
3735
}
3836

3937
- (nullable NSObject<FLTCaptureConnection> *)connectionWithMediaType:
4038
(nonnull AVMediaType)mediaType {
4139
return [[FLTDefaultCaptureConnection alloc]
42-
initWithConnection:[_avOutput connectionWithMediaType:mediaType]];
40+
initWithConnection:[self.avOutput connectionWithMediaType:mediaType]];
4341
}
4442

4543
- (void)setSampleBufferDelegate:
4644
(nullable id<AVCaptureVideoDataOutputSampleBufferDelegate>)sampleBufferDelegate
4745
queue:(nullable dispatch_queue_t)sampleBufferCallbackQueue {
48-
[_avOutput setSampleBufferDelegate:sampleBufferDelegate queue:sampleBufferCallbackQueue];
46+
[self.avOutput setSampleBufferDelegate:sampleBufferDelegate queue:sampleBufferCallbackQueue];
4947
}
5048

5149
@end

0 commit comments

Comments
 (0)