Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

setOnError on Swift #82

Closed
kevinnguy opened this issue Feb 12, 2016 · 4 comments
Closed

setOnError on Swift #82

kevinnguy opened this issue Feb 12, 2016 · 4 comments

Comments

@kevinnguy
Copy link

Does anyone know how to set onError on Swift? I know in Objective-C, you can do:

[self.camera setOnError:^(LLSimpleCamera *camera, NSError *error) {
    // Something
}];

but on Swift, I don't have access to setOnError. I tried doing:

self.camera.onError = ({(camera : LLSimpleCamera!, error : NSError!) -> Void! in 
    // Something
})

but I would get an error. I just started working with Swift so this might be a syntax issue. Thanks for the great library and for the help!

@batuhansk
Copy link

Look at my repository for LLSimpleCamera on Swift.

On Friday, 12 February 2016, Kevin Nguy notifications@github.com wrote:

Does anyone know how to set onError on Swift? I know in Objective-C, you
can do:

[self.camera setOnError:^(LLSimpleCamera *camera, NSError *error) {
// Something
}];

but on Swift, I don't have access to setOnError. I tried doing:

self.camera.onError = ({(camera : LLSimpleCamera!, error : NSError!) -> Void! in
// Something
})

but I would get an error. I just started working with Swift so this might
be a syntax issue. Thanks for the great library and for the help!


Reply to this email directly or view it on GitHub
#82.

@kevinnguy
Copy link
Author

Thanks for the help @strawb3rryx7 ! Been learning Swift and so far, so good!

@kevinnguy
Copy link
Author

This is how it can be done on Swift:

self.camera.onError = {(camera, error) -> Void in
    // Something
}

@batuhansk
Copy link

Keep coding mate! 👍🏼

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants