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

Added Swift version for EC528 #314

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]

### Added
- [#313](https://github.com/green-code-initiative/ecoCode/issues/313) [EC528] Swift port


- [C# #66](https://github.com/green-code-initiative/ecoCode-csharp/pull/66) [EC93] [C#] Return Task directly

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
Shaking or vibrating an iOS device is possible using `UIFeedbackGenerator`.
Behind this effect stands a specific hardware component, the Haptic Engine, which consumes power. As a consequence, its usage should be carefully considered, especially if its added value is not clear.

== Noncompliant Code Example
Copy link
Member

Choose a reason for hiding this comment

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

ok for "non compliant example" ... but no "compliant example" ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

no there is no compliant example because the compliant example is not to use it at all :)

Copy link
Member

Choose a reason for hiding this comment

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

maybe write it explicitly in the description at the top, no ?


[source,swift]
----
import UIKit

func triggerVibration() {
let generator = UIImpactFeedbackGenerator(style: .heavy)
generator.impactOccurred()
}
----
Loading