CosmicMind / Material

A UI/UX framework for creating beautiful applications.
http://cosmicmind.com
MIT License
11.98k stars 1.26k forks source link

Any plan to support Xcode 11? #1250

Closed himaratsu closed 5 years ago

himaratsu commented 5 years ago

Hi!

in Xcode 11, we can't build app using Material. Error message is here:

*** Assertion failure in -[_UINavigationBarContentView setLayoutMargins:], /BuildRoot/Library/Caches/com.apple.xbs/Sources/UIKitCore_Sim/UIKit-3899.8.4/_UINavigationBarContentView.m:703
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Client error attempting to change layout margins of a private view'

Do you have any plan to support this? Thanks.

daniel-jonathan commented 5 years ago

@himaratsu Yes, there are always plans to support the latest from Apple. Because it is beta, we usually wait until it is closer to release, or released. That said, we will most likely make a branch for it and help users to start exploring iOS 11 with Material. I will leave this issue up, and tackle that for you later this week. Thank you for sharing your question.

nguyenbao95 commented 5 years ago

I've spent much time on the same issue and have come up with a workaround that works for me and I think it will help you as well.

On iOS 13, changing layout margins of a private view is not allowed. So, expanding the frame to eliminate the layout margins can be an alternative solution.

if (@available(iOS 13.0, *)) {
    UIEdgeInsets margins = view.layoutMargins;
    CGRect frame = view.frame;
    frame.origin.x = -margins.left;
    frame.origin.y = -margins.top;
    frame.size.width += (margins.left + margins.right);
    frame.size.height += (margins.top + margins.bottom);
    view.frame = frame;
}
else {
    view.layoutMargins = UIEdgeInsetsZero;
}
adamdahan commented 5 years ago

@nguyenbao95 @himaratsu Thank you for the support!

We are getting ready to roll out updates for iOS 13 and supper Xcode 11 in the next few weeks.

mrtsamma commented 5 years ago

@adamdahan saw that you moved it to done. I'm curious what was the fix for iOS 13. Facing the same issue.

adamdahan commented 5 years ago

@mrtsamma You are correct. :) I realize now this ticket was visibility for others on the iOS 13 topic. Reopening issue until we release the IOS 13 patch.

mrtsamma commented 5 years ago

Ok, @nguyenbao95 answare suits for me with a small change(thanks):

for view in subviews {
    if #available(iOS 13.0, *) {
        let margins = view.layoutMargins
        var frame = view.frame
        frame.origin.x = -margins.left
        frame.size.width += (margins.left + margins.right)
        view.frame = frame
    } else {
        view.layoutMargins = .zero
    }
}

I don't need and can't to change height nor y pos.

phlippieb commented 5 years ago

https://github.com/CosmicMind/Material/pull/1269

22Round commented 5 years ago

please merge this fix, I can't build my project anymore @danieldahan

daniel-jonathan commented 5 years ago

@22Round Try Material 3.1.8. Thank you!

Hamza123Imran commented 4 years ago

@mrtsamma where have you placed this your code? I have upgraded to xcode 11.3 i'm getting same crash. how i can i recover from it.

Hamza123Imran commented 4 years ago

@adamdahan have your lib updated for 11.3 and iOS 13 version, if so please let me know the link or pods i'm facing an issue