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

[Breaking Changes] New v6 API for Swift and ObjC #109

Merged
merged 25 commits into from Dec 20, 2020
Merged

[Breaking Changes] New v6 API for Swift and ObjC #109

merged 25 commits into from Dec 20, 2020

Conversation

ApolloZhu
Copy link
Member

@ApolloZhu ApolloZhu commented Nov 25, 2020

See V6 API Announcement for details

  • Enable chaining methods for builder pattern
    • Mostly automatically migrate-able:
      • Use control + option + command + F to apply all fix-its in scope
      • Need to manually update EFQRCodeMode.none to EFQRCodeMode?.none, i.e. nil
      • Need to manually update recognition code to handle empty array instead of handling optional and/or empty array
    • Variables are now public for old, non-chaining behavior
      • Use EFQRCodeGenerator.with<T>(_: ReferenceWritableKeyPath<Self, T>, _: T) -> Self to set property directly and chain invocations
    • Old APIs (EFQRCode+Migration-v6.swift) are deprecated, and should be marked as obsoleted/unavailable with v7 release, and the file completely deleted with v8 release.
  • Objective-C Support (closes 能否出一个OC版本 #92)
    • EFQRCodeGenerator, EFQRCodeRecognizer are now equally available in Swift/ObjC, and EFQRCode will be Swift only
    • Added unit tests to ensure API availability
  • EFUIntPixel appears to be not an active part of the existing public API, so it will no longer be
    • Note: this will most likely resurface in v7?
  • Officially drop pathToSave from GIF generation API

- Enable chainning and make variables public
- Should deprecate old API at 7.0.0 version
@ApolloZhu ApolloZhu marked this pull request as draft November 25, 2020 13:26
@ApolloZhu ApolloZhu added this to the v6.0.0 milestone Nov 25, 2020
@ApolloZhu ApolloZhu self-assigned this Nov 25, 2020
@ApolloZhu ApolloZhu changed the title [Breaking Changes] New v6 API [Breaking Changes] New v6 API for Swift and ObjC Nov 25, 2020
@codecov-io
Copy link

codecov-io commented Nov 25, 2020

Codecov Report

Merging #109 (8453bc7) into main (eaaf55e) will increase coverage by 2.70%.
The diff coverage is 59.78%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #109      +/-   ##
==========================================
+ Coverage   58.80%   61.50%   +2.70%     
==========================================
  Files          14       15       +1     
  Lines         869      982     +113     
==========================================
+ Hits          511      604      +93     
- Misses        358      378      +20     
Impacted Files Coverage Δ
Source/CIColor+.swift 100.00% <ø> (ø)
Source/NSColor+.swift 25.00% <0.00%> (+2.77%) ⬆️
Source/NSImage+.swift 50.00% <ø> (ø)
Source/EFIntSize.swift 62.50% <25.00%> (ø)
Source/EFQRCode+Migration-v6.swift 45.58% <45.58%> (ø)
Source/EFQRCode+GIF.swift 28.57% <50.00%> (+28.57%) ⬆️
Source/EFQRCode.swift 53.57% <51.85%> (ø)
Source/EFQRCodeGenerator.swift 77.89% <66.66%> (+1.19%) ⬆️
Source/EFQRCode+ObjC.swift 71.42% <71.42%> (ø)
Source/EFQRCodeRecognizer.swift 82.35% <87.50%> (+24.45%) ⬆️
... and 4 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update eaaf55e...8453bc7. Read the comment docs.

@ApolloZhu

This comment has been minimized.

@ApolloZhu ApolloZhu marked this pull request as ready for review December 19, 2020 04:13
@ApolloZhu
Copy link
Member Author

ApolloZhu commented Dec 19, 2020

Examples of the new API:

@ApolloZhu ApolloZhu mentioned this pull request Dec 19, 2020
8 tasks
@ApolloZhu ApolloZhu mentioned this pull request Dec 20, 2020
10 tasks
@EyreFree EyreFree merged commit b3de061 into main Dec 20, 2020
@EyreFree EyreFree deleted the objc branch December 20, 2020 08:40
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.

能否出一个OC版本
3 participants