peter-iakovlev / Telegram

Telegram Messenger for iOS
3.22k stars 858 forks source link

Compiling codes with XCode 9 and ios 11 break the application #172

Open hsklia opened 6 years ago

hsklia commented 6 years ago

When compile the source with XCode 9 and IOS 11 , Chat list items will be invisible and application views does not work properly! For example navigation back button will be invisible in all controllers, All controllers top margins corrupted, and some other issues ...

lestadNew commented 6 years ago

@alihasanzaade i have the same problem, and when pick country see empty table cell

lestadNew commented 6 years ago

@alihasanzaade Hello,you found the problem?Can you help me?

denisdbv commented 6 years ago

@lestadNew Hey Andrew. Did you fixed this issues? For top margins corrupted I found one solution, it is: _tableView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;

lestadNew commented 6 years ago

@DenisDbv Hey Denis, i put this method all controllers top margins it is ok, but empty Row;

Goto-Code commented 6 years ago

@lestadNew Hey, did you solve your problem? I ran into the same problem, contact people and chat

Goto-Code commented 6 years ago

@lestadNew hey,I studied one morning and the solution was

import "TGListsTableView.h"

replace

lestadNew commented 6 years ago

@Goto-Code You are just super))))

lestadNew commented 6 years ago

@Goto-Code And you can not tell yet what is the reason that when you go to other view controller hiding the button back and title ? simulator screen shot - iphone 8 - 2017-11-24 at 12 04 56

Goto-Code commented 6 years ago

@lestadNew The problem is much simpler and needs to be changed

import "TGNavigationBar.m"

replace

lestadNew commented 6 years ago

@Goto-Code hello, i trie your code but in all navigationbar is empty

Goto-Code commented 6 years ago

@lestadNew Did you modify or customize tar

lestadNew commented 6 years ago

@Goto-Code No, only your code

lestadNew commented 6 years ago

@Goto-Code maybe #import "TGListsTableView.h" when insertview change all code? Your code:(@lestadNew hey,I studied one morning and the solution was

import "TGListsTableView.h"

replace)

Goto-Code commented 6 years ago

@lestadNew 其实这完全是因为ios11更新导致的问题!更改了nav的图层结构,你需要去了解这个,才能解决问题

casevictor commented 6 years ago

@lestadNew did you fix the empty navigation bar?

santosleonardo2 commented 6 years ago

To fix this navigation bar problem go to "TGNavigationBar.m". Look for the method "initWithFrame" and comment the if-statement on it. The final code should be something like this:

- (id)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
//    if (self)
//    {
//        [self commonInit:[self isKindOfClass:[TGBlackNavigationBar class]] ? UIBarStyleBlackTranslucent : UIBarStyleDefault];
//    }
    return self;
}

EDITED: I noticed that the code above will work only on iOS11. If you try to run the code in a early version than iOS11, the navigation bar will be transparent. So, I made a small change in the code. It should look like this:

- (id)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (@available(iOS 11, *)) {
        //iOS 11 or newer: Do nothing
    } else if (self) {
        [self commonInit:[self isKindOfClass:[TGBlackNavigationBar class]] ? UIBarStyleBlackTranslucent : UIBarStyleDefault];
    }
    return self;
}
Goto-Code commented 6 years ago

@santosleonardo2 @casevictor hey,How do you do? I failed when I changed my name, and I will sync it up to the previous name. What's going on?

lestadNew commented 6 years ago

@casevictor try @santosleonardo2 code, this code fix the empty navigation bar. @Goto-Code I did not understand your problem

Goto-Code commented 6 years ago

@lestadNew Hello, do you know how to solve the problem I just asked

casevictor commented 6 years ago

Thanks @santosleonardo2! Now it works :)