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

Update coding style. #59

Merged
merged 3 commits into from
Aug 4, 2018
Merged

Update coding style. #59

merged 3 commits into from
Aug 4, 2018

Conversation

pingchen114
Copy link
Contributor

This Pull Request contains the following coding style updates.

  1. Remove internal keyword since it is already the default attribute.
  2. Replace fileprivate with private regarding to Swift 4.
  3. Some spaces and newlines for readability
  4. Remove redundant ; symbol
  5. Simplify some logic for better readability.

Reference

https://google.github.io/swift/
https://github.com/raywenderlich/swift-style-guide

init(_ ARview:Any?, renderer:SCNRenderer, contentMode:ARFrameMode) {
struct RenderAR {
private var view: Any?
private var renderEngine: SCNRenderer!
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this will cause memory leaks. you may keep the private tag but make this variable global (outside the struct)

internal var ARcontentMode:ARFrameMode!
init(_ ARview:Any?, renderer:SCNRenderer, contentMode:ARFrameMode) {
struct RenderAR {
private var view: Any?
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this will cause memory leaks. you may keep the private tag but make this variable global (outside the struct)

@@ -8,33 +8,37 @@

import Foundation
import ARKit
fileprivate var view:Any?
fileprivate var renderEngine:SCNRenderer!

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove the following from struct RenderAR and put it here:

private var view: Any?
private var renderEngine: SCNRenderer!

Copy link
Contributor Author

@pingchen114 pingchen114 Jul 30, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated 62f90d0, Sorry, seems I forgot to push my commit here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah... the code is already committed.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pingchen114, will review it and get back to you soon

@pingchen114
Copy link
Contributor Author

Thanks for the quick review, I am fixing it now.

@AFathi AFathi merged commit 8e7eafb into AFathi:master Aug 4, 2018
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

Successfully merging this pull request may close these issues.

None yet

2 participants