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

Next views "origin point" is wrong on iOS 11 #295

Closed
Valpertui opened this issue Jul 4, 2017 · 9 comments
Closed

Next views "origin point" is wrong on iOS 11 #295

Valpertui opened this issue Jul 4, 2017 · 9 comments
Assignees
Projects

Comments

@Valpertui
Copy link

Next views "origin point" is wrong on iOS 11

When I build on iOS 11, the Koloda View origin point for next views is different than on iOS 10 and previous (see screenshots)
koloda_ios_11

How should it look like?

koloda_ios_10

Report a bug

What did you do?

Same build, same code, one running on iOS 11, the other on iOS 10

What did you expect to happen?

Origin point for next views for both OS to be the same (in the center behind the view like on iOS 10)

What happened instead?

Origin point for next views is off to the right. (each next view has the exact same frame size on iOS 10 and 11, tested through hierarchy inspector)

Your Environment

  • Version of the component: 4.0
  • Swift version: 3.0
  • iOS version: 10.3.2 and 11
  • Device: iPhone 6 size for the iOS 11 device. I don't have another size iOS 11 device, and didn't try to use the new Xcode yet.
  • Xcode version: 8.3.3
  • If you use Cocoapods:

Stack

   CocoaPods : 1.2.1
        Ruby : ruby 2.3.0p0 (2015-12-25 revision 53290) [x86_64-darwin15]
    RubyGems : 2.5.1
        Host : Mac OS X 10.12.5 (16F73)
       Xcode : 8.3.3 (8E3004b)
         Git : git version 2.13.1
Ruby lib dir : /Users/Valentin/.rvm/rubies/ruby-2.3.0/lib
Repositories : master - https://github.com/CocoaPods/Specs.git @ da787c5bf33b991d53ea8db6f5d47dab03dd0f0a

Installation Source

Executable Path: /Users/Valentin/.rvm/gems/ruby-2.3.0/bin/pod

Plugins

cocoapods-deintegrate : 1.0.1
cocoapods-plugins     : 1.0.0
cocoapods-search      : 1.0.0
cocoapods-stats       : 1.0.0
cocoapods-trunk       : 1.2.0
cocoapods-try         : 1.1.0

Podfile

platform :ios, '9.0'
use_frameworks!
inhibit_all_warnings!

def testing_pods
  pod 'Quick'
  pod 'Nimble'
end

def network_pods
  pod 'Alamofire'
  pod 'Moya'
  pod 'Moya/ReactiveCocoa'
end

def general_pods
  pod 'Argo'
  pod 'ReactiveCocoa'
  pod 'AFDateHelper'
  pod 'AsyncSwift'
  pod 'Curry'
end

def security_pods
  pod 'Locksmith'
end

def analytics_pods
  pod 'Analytics'
end

def ui_pods
  pod 'SVProgressHUD'
  pod 'JVFloatLabeledTextField'
  pod 'TPKeyboardAvoiding'
  pod 'Koloda', '4.0'
  pod 'MTCardLayout', :git => "https://github.com/Valpertui/MTCardLayout"
  pod 'Voltron', :git => "https://github.com/Valpertui/Voltron"
  pod 'Auk', :git => "https://github.com/Valpertui/VPAuk"
  pod 'Kingfisher'
  pod 'JSQWebViewController'
  pod 'Intercom'
  pod 'JSQMessagesViewController'
  pod 'JTAppleCalendar', '~> 7.0'
end

target 'Locum' do
  general_pods
  network_pods
  ui_pods
  analytics_pods
end

target 'LocumKit' do
  general_pods
  network_pods

  target 'LocumKitTests' do
    testing_pods
    general_pods
    network_pods
    inherit! :search_paths
  end
end

target 'LocumAppKit' do
  general_pods
  network_pods
  security_pods

  target 'LocumAppKitTests' do
    testing_pods
    general_pods
    network_pods
    inherit! :search_paths
  end  
end

target 'AppTests' do
    ui_pods
    testing_pods
    general_pods
    network_pods
    inherit! :search_paths
end

Project that demonstrates the bug

Sorry I don't have the time to build a project demonstrating the issue yet.

@chris-wickens
Copy link

Experiencing the same issue with our app. Please fix!

@konstantin-tcherkashin
Copy link

Same issue on iOS 11 DP4

@okcomp
Copy link

okcomp commented Aug 12, 2017

@Valpertui Any updates on this issue? Did you fix this in your app?

@Valpertui
Copy link
Author

Valpertui commented Aug 12, 2017 via email

@okcomp
Copy link

okcomp commented Aug 12, 2017

@Valpertui changing the line 202 in KolodaView.swift to return (initialFrame, scale) makes it work, but I don't quite understand why returning finalFrame works on iOS 10

@Valpertui
Copy link
Author

@okcomp You need to take into consideration that it will not work anymore on iOS 10- if you change the line 189 into return (initialFrame, scale)

@Valpertui
Copy link
Author

temporary hack :

        if #available(iOS 11, *) {
            return (initialFrame, scale)
        } else {
            return (finalFrame, scale)
        }

@satoshin21
Copy link
Contributor

@Valpertui
In iOS11, set view.layer.transform is not work If you set view.frame immediately.
I think it is just a bug, but We should not change view.layer.transform with view.frame at the same time.

   if #available(iOS 11, *) {
        return (initialFrame, scale)
   } else {
        return (finalFrame, scale)
   }

finalFrame.size is equal to top card's size, but transform will work in iOS10 (KolodaView.swift L169), so appearance is correct.
In iOS11, view.layer.transform will not work in this case, but initialFrame has correct size for card, so I think upper code is work correctly for now.

@rnkyr rnkyr added this to To Do in v 4.3 Sep 21, 2017
@rnkyr rnkyr moved this from To Do to In review in v 4.3 Sep 21, 2017
@rnkyr
Copy link
Contributor

rnkyr commented Sep 21, 2017

Hi, guys. Looks like suggested solution works fine. Since I don't have an alternative I've applied it and going to release a new version with this fix asap. Thanks everyone for the contribution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
v 4.3
Done
Development

No branches or pull requests

6 participants