Skip to content

Commit

Permalink
Added ifdef macro to use LARSTorch on simulator
Browse files Browse the repository at this point in the history
  • Loading branch information
larsacus committed Sep 11, 2013
1 parent 02b0ccf commit 9c3f282
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions LARSTorch.m
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,9 @@ - (BOOL)isInturrupted{
#endif
}

#if !TARGET_IPHONE_SIMULATOR

- (AVCaptureDevice *)torchDevice{
#if !TARGET_IPHONE_SIMULATOR
if (_torchDevice == nil) {
NSArray *videoDevices = [AVCaptureDevice devicesWithMediaType:AVMediaTypeVideo];
for (AVCaptureDevice *device in videoDevices) {
Expand All @@ -104,9 +105,10 @@ - (AVCaptureDevice *)torchDevice{
}

return _torchDevice;
}

#else
return nil;
#endif
}

- (void)setTorchState:(LARSTorchState)torchOn{
#if !TARGET_IPHONE_SIMULATOR
Expand Down

0 comments on commit 9c3f282

Please sign in to comment.