Skip to content

Add property to determine if device is compatible with Apple Pencil - #177

Closed
SomeRandomiOSDev wants to merge 2 commits into
devicekit:swift-4.2from
SomeRandomiOSDev:swift-4.2
Closed

Add property to determine if device is compatible with Apple Pencil#177
SomeRandomiOSDev wants to merge 2 commits into
devicekit:swift-4.2from
SomeRandomiOSDev:swift-4.2

Conversation

@SomeRandomiOSDev

Copy link
Copy Markdown
Contributor

Added a property to the Device enum to determine is the given device can use the Apple Pencil. Current list of supported devices taken off of the Apple Pencil support page: https://support.apple.com/en-us/HT205236

@devicekit-danger-bot

devicekit-danger-bot commented Apr 9, 2019

Copy link
Copy Markdown
4 Warnings
⚠️ Plist changed, don’t forget to localize your plist values
⚠️ Source/Device.generated.swift#L298 - Function body should span 40 lines or less excluding comments and whitespace: currently spans 65 lines
⚠️ Source/Device.generated.swift#L621 - TODOs should be resolved (Longterm we need a better solu…).
⚠️ Source/Device.generated.swift#L1136 - Prefer empty collection over optional collection.

SwiftLint found issues

Warnings

File Line Reason
Device.generated.swift 1136 Prefer empty collection over optional collection.
Device.generated.swift 621 TODOs should be resolved (Longterm we need a better solu...).
Device.generated.swift 298 Function body should span 40 lines or less excluding comments and whitespace: currently spans 65 lines
Device.generated.swift 1171 Let and var should be separated from other statements by a blank line.

Generated by 🚫 Danger

@Zandor300

Copy link
Copy Markdown
Member

Nice! Don't know how @denisenepraunig would want to merge this with #168.

Would also be cool to have a property that returns an enum with which Apple Pencil (1st/2nd gen) is supported on that device. Currently, the iPads only support one of the two, but this might change in the future. I think having it return an array of enums would future proof it so we won't have to introduce a breaking change in the future.

@SomeRandomiOSDev

Copy link
Copy Markdown
Contributor Author

@Zandor300 I really like this idea, much more than a simple boolean. I'll implement this and push an update to this PR

…describe which generation of the Apple Pencil is supported
@SomeRandomiOSDev SomeRandomiOSDev changed the title Add property to determine is device is compatible with Apple Pencil Add property to determine if device is compatible with Apple Pencil Apr 10, 2019
@Zandor300

Copy link
Copy Markdown
Member

I think it would be easier to merge this into master instead of swift-4.2 since we’ll be merging the 2.0 pr soon into master which uses Swift 5. I don’t actually know; is it possible to change this pr to merge to master instead?

public struct ApplePencilSupport: OptionSet {

public var rawValue: UInt
public init(rawValue: UInt) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Let and var should be separated from other statements by a blank line.

@SomeRandomiOSDev

Copy link
Copy Markdown
Contributor Author

Closed in lieu of PR against master: #178

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.

3 participants