EZSwiftExtensions icon indicating copy to clipboard operation
EZSwiftExtensions copied to clipboard

Added two new functions in Transform Extensions, translate UIView and…

Open vilapuigvila opened this issue 9 years ago • 17 comments

Checklist

  • [x] New Extension
  • [ ] New Test
  • [ ] Changed more than one extension, but all changes are related
  • [ ] Trivial change (doesn't require changelog)

… trasnformIdentity with completion block.

vilapuigvila avatar Nov 05 '16 23:11 vilapuigvila

2 Errors
:no_entry_sign: Please, modify only one extension per pull request.
:no_entry_sign: Please, modify only one extension per pull request.
2 Messages
:book: Executed 170 tests, with 0 failures (0 unexpected) in 4.654 (4.864) seconds
:book: Executed 156 tests, with 0 failures (0 unexpected) in 4.347 (4.694) seconds

Generated by :no_entry_sign: danger

EZSwiftExtensionsBot avatar Nov 05 '16 23:11 EZSwiftExtensionsBot

Current coverage is 36.68% (diff: 87.50%)

Merging #300 into master will increase coverage by 1.71%

@@             master       #300   diff @@
==========================================
  Files            46         46          
  Lines          2042       2080    +38   
  Methods           0          0          
  Messages          0          0          
  Branches          0          0          
==========================================
+ Hits            714        763    +49   
+ Misses         1328       1317    -11   
  Partials          0          0          

Powered by Codecov. Last update 704a823...8cc3bb3

codecov-io avatar Nov 05 '16 23:11 codecov-io

Can we add tests for these extensions?

Khalian avatar Nov 06 '16 01:11 Khalian

I don't have too experience to adding tests, it you may help me a little, I'll be glad. Thanks.

vilapuigvila avatar Nov 07 '16 22:11 vilapuigvila

Hey @vilapuigvila, if you want more detailed help, please hit me on Gitter. Tests are really easy to learn and I Iearned how to write tests through EZSwiftExtensions.

This method, for example,

    public func setTranslation(_ duration:TimeInterval? = UIViewDefaultTransitionDuration, _ x: CGFloat? = 0.0, y: CGFloat? = 0.0, completion: ((Bool) -> Void)? = nil) {
         self.animate(duration: duration ?? UIViewDefaultTransitionDuration, animations: {
             self.transform = .init(translationX: x!, y: y!)
         }, completion: completion)
     }

You would test the UIView.frame before the animation and then test the UIView.frame after the animation so you see if the translation was successful

lfarah avatar Nov 08 '16 07:11 lfarah

Also check this out

lfarah avatar Nov 08 '16 08:11 lfarah

Ok perfect @lfarah I'll take a look about that.

vilapuigvila avatar Nov 08 '16 14:11 vilapuigvila

Hey @vilapuigvila, this PR is approved. I just need you to fix the conflicts before I can merge

lfarah avatar Nov 18 '16 10:11 lfarah

Do we have to include rotation, scaling too?

piv199 avatar Nov 20 '16 23:11 piv199

hi @lfarah I can't see conflicts, I merged master into this branch in my machine and works well, please can you help me?

vilapuigvila avatar Nov 26 '16 15:11 vilapuigvila

@vilapuigvila rebase on master

piv199 avatar Nov 26 '16 17:11 piv199

I did, but I have no conflicts. I don't understand :-(

vilapuigvila avatar Nov 27 '16 09:11 vilapuigvila

@vilapuigvila you haven't pushed to your remote

piv199 avatar Nov 27 '16 09:11 piv199

@piv199 which branch? mater or uiviewTranslations?

vilapuigvila avatar Nov 27 '16 09:11 vilapuigvila

vilapuigvila:uiviewTranslations

piv199 avatar Nov 27 '16 09:11 piv199

@piv199 uiviewTranslations hasn't anything to push. I'm sorry but I'm a little confused..

vilapuigvila avatar Nov 27 '16 10:11 vilapuigvila

Ok now would you mind pulling the mainline in trunk and rebasing and squashing your changes on top of it ? Also with our new CHANGELOG template you have to add an entry for the same.

Khalian avatar Jan 05 '17 18:01 Khalian