Skip to content

Conversation

guykogus
Copy link
Contributor

@guykogus guykogus commented Jun 8, 2020

🚀

Loosen some protocol restrictions to make functions more generic.

Checklist

  • I checked the Contributing Guidelines before creating this request.
  • New extensions are written in Swift 5.0.
  • New extensions support iOS 10.0+ / tvOS 9.0+ / macOS 10.10+ / watchOS 2.0+, or use @available if not.
  • I have added tests for new extensions, and they passed.
  • All extensions have a clear comments explaining their functionality, all parameters and return type in English.
  • All extensions are declared as public.
  • I have added a changelog entry describing my changes.

@codecov
Copy link

codecov bot commented Jun 8, 2020

Codecov Report

Merging #863 into master will decrease coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #863      +/-   ##
==========================================
- Coverage   95.48%   95.47%   -0.01%     
==========================================
  Files         101      100       -1     
  Lines        3408     3401       -7     
==========================================
- Hits         3254     3247       -7     
  Misses        154      154              
Flag Coverage Δ
#ios 95.57% <100.00%> (-0.01%) ⬇️
#macos 97.07% <100.00%> (-0.01%) ⬇️
#tvos 93.55% <100.00%> (-0.02%) ⬇️
Impacted Files Coverage Δ
...wifterSwift/SwiftStdlib/CollectionExtensions.swift 100.00% <100.00%> (ø)

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 3739cd9...4c92efe. Read the comment docs.

@SwifterSwiftBot
Copy link

SwifterSwiftBot commented Jun 8, 2020

4 Messages
📖 Thank you for submitting a pull request to SwifterSwift. The team will review your submission as soon as possible.
📖 iOS: Executed 683 tests, with 0 failures (0 unexpected) in 17.812 (18.803) seconds
📖 tvOS: Executed 645 tests, with 0 failures (0 unexpected) in 3.346 (3.744) seconds
📖 macOS: Executed 511 tests, with 0 failures (0 unexpected) in 4.757 (4.971) seconds

Generated by 🚫 Danger

Copy link
Member

@LucianoPAlmeida LucianoPAlmeida left a comment

Choose a reason for hiding this comment

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

Nice @guykogus, these are great improvements 💯
Just one or two points worth considering, but overall looks great :)

@guykogus guykogus mentioned this pull request Jun 9, 2020
7 tasks
@LucianoPAlmeida
Copy link
Member

We have to fix these timeout tests at some point :)

LucianoPAlmeida
LucianoPAlmeida previously approved these changes Jun 9, 2020
@LucianoPAlmeida
Copy link
Member

@guykogus Could this failing time tests fix enter in your clean up branch? It is often failing so I think we should give a little increase on the limit there.

@guykogus
Copy link
Contributor Author

guykogus commented Jun 9, 2020

@guykogus Could this failing time tests fix enter in your clean up branch? It is often failing so I think we should give a little increase on the limit there.

Yep, fixed it: 0c2d3dc#diff-9029f943f4f9fe91d3038cdd34d323b8R63

@guykogus guykogus force-pushed the random-access-collection branch 3 times, most recently from 4bc99e2 to 1ff5620 Compare July 3, 2020 13:58
guykogus added 9 commits July 6, 2020 11:13
… `Collection`.

Generalise `Collection` functions  `indices(where:)` and `forEach(slice:body:)` to work with any `Index` type.
Generalise `Collection` function `average()` to work with any `BinaryInteger` elements.
@guykogus guykogus force-pushed the random-access-collection branch from 5c4fb94 to 48c3bf5 Compare July 6, 2020 09:14
@LucianoPAlmeida LucianoPAlmeida merged commit 2989954 into master Jul 6, 2020
@LucianoPAlmeida
Copy link
Member

Let's move on with this because it's really not ideal having to updating all the time since it's ready :)

@guykogus guykogus deleted the random-access-collection branch July 21, 2020 08:44
nasircsms pushed a commit to nasircsms/SwifterSwift that referenced this pull request Aug 26, 2020
* 'master' of https://github.com/SwifterSwift/SwifterSwift: (79 commits)
  Helper functions for scrolling to the edges or by page of a scroll view (SwifterSwift#888)
  Add XCTest extension for comparing Color objects (SwifterSwift#889)
  Fix swiftlint error (SwifterSwift#894)
  Bump kramdown from 2.1.0 to 2.3.0 (SwifterSwift#891)
  Added note for UIView.addShadow() (SwifterSwift#890)
  loadFromNib(withClass) (SwifterSwift#885)
  constraint finders (widthConstraint, heightConstraint, leadingConstraint, trailingConstraint, topConstraint, bottomConstraint) (SwifterSwift#886)
  added String.regexEscaped (SwifterSwift#883)
  Make √ generic for FloatingPoint values (SwifterSwift#880)
  Update UITextField extensions (SwifterSwift#878)
  Added `masksToBounds` (IBInspectable) extension (SwifterSwift#877)
  Reinstate debounce function (SwifterSwift#869)
  `RandomAccessCollection`/`Collection` generalisations (SwifterSwift#863)
  Added HKActivitySummary extensions (SwifterSwift#875)
  Added new method for easily instantiating a view controller from a storyboard (SwifterSwift#860)
  Clean up code (SwifterSwift#864)
  fixed "".truncated crashed (SwifterSwift#866)
  Deprecated map(by:), compactMap(by:), filter(by:) (SwifterSwift#862)
  Overloaded 'contains' operator for string regex matching (SwifterSwift#858)
  Added convenient wrapper to asyncAfter (SwifterSwift#859)
  ...

# Conflicts:
#	Sources/SwifterSwift/AppKit/NSColorExtensions.swift
#	Sources/SwifterSwift/AppKit/NSImageExtensions.swift
#	Sources/SwifterSwift/AppKit/NSViewExtensions.swift
#	Sources/SwifterSwift/CoreGraphics/CGColorExtensions.swift
#	Sources/SwifterSwift/CoreGraphics/CGFloatExtensions.swift
#	Sources/SwifterSwift/CoreGraphics/CGPointExtensions.swift
#	Sources/SwifterSwift/CoreGraphics/CGSizeExtensions.swift
#	Sources/SwifterSwift/Foundation/NSAttributedStringExtensions.swift
#	Sources/SwifterSwift/SwiftStdlib/StringExtensions.swift
#	SwifterSwift.xcodeproj/project.pbxproj
#	Tests/AppKitTests/NSColorExtensionsTests.swift
#	Tests/SwiftStdlibTests/StringExtensionsTests.swift
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