Tableview found nil in iOS7 and works perfectly fine in iOS8 - ios

I am facing a strange issue. I am using revealController to open side menu for that as left view controller, I have placed a tableView.
I have placed UITableView in nib file of iphone and ipad and given IBOutlet to access it. In the viewController file I have given row height by simple line IBtblSideMenu!.rowHeight = IS_IPHONE ? 43 : 114.
Here at this point IBtblSideMenu appears to be found nil.
I have connected tableview's delegate and even placed controller's name in class field everything is done and it is perfectly working fine in iOS 8.
Issue comes in iOS7 only.
Please help me to resolve. I am not able to find any solution. Thanks in advance

Related

Swift blur cell is not displaying correctly

I want to create a blur table view cell with a top view like in the first image here:
On iPhone 8, everything works correctly but on iPhone X after viewDidLoad it's not displaying correctly:
After changing the ViewController and switching back it's working fine:
My hierarchy is as follows:
It's created in Swift 4.
Does anyone have experience with that problem? Thanks in advance!
I had the same problem in my app. What actually happens is the Xcode picks up the default storyboard of your Main.storyboard for the build. This error occurs on all the devices which have the width greater than 375. Try testing your build with iPhone X as storyboard default or call layoutSubViews() at the end of viewDidLoad.

TableView pushed down after view change

I'm kind of new with ios development with swift 4, so I'm testing some functionalities.
I have a tableview inside a normal UIViewController:
The space left blank is intentionally, as I have some custom tabs.
When I show a detail from a table cell element, and then press back button, the table view gets pushed down (and up). Please see this where I show the problem.
The iphone is a SE with ios10. In simulations with iOS11, this does not happen. Developing in MacOS Sierra 10.12.6 with xCode 9.2.
Any clue on how to fix this?
EDIT:
Using the view debugger, I got this:
The selected area is a UITableWrapperView element. Behind it, is the UITableView, which preserve its constrains.
set
self.tableView.bounces = false
Or put this in viewDidAppear
let offset = CGPoint.init(x: 0, y:0)
self.tableView.setContentOffset(offset, animated: false)
It can happen because of SafeArea... Check you constraint which connects tableView top with navigation bar.
You can also try placing blank UIView between Navigation bar and tableView. Your custom tabs should be in this view. So tableView will be connected with the nearest view (which you have just added) and should not bounce.
Thats a really weird behavior. I recommend you to use the Xcode view debugger. You would be able to examine dimensions and constraints values by using size inspector.
The code where you set up your tableview, try implementing it in the method viewDidLayoutSubviews(in case you are doing it in viewDidLoad).
override func viewDidLayoutSubviews() {
//mention your tableview setup code here
}
A similar thing happened to me, and this method came quite handy. Hope this helps.
Try this for iOS 11.0
tableView.contentInsetAdjustmentBehavior = .never

iOS presentViewController freezed when storyboard has a TextView with one word only

I am having this weird problem in my iOS 9 device, the app just freezed when I try to presentViewController to a ViewController designed in storyboard. And the ViewController happens to have a UITextView with single word as the content: Name
How I fixed it:
After I changed the Name to Name : (notice the space there), it runs fine now.
This is not really a question, rather than a reminder to those having this weird problem.
I got this problem and I removed text from Interface file and put it in programmatically in viewDidLoad method.Sometimes space also don't work so better put text programmatically and you can add without space as well.

Setting Modal Presentation Style causing views to disappear (Xcode 6)

I have set up my view in interface builder. I am using auto layout which has been set up also.
If I present my view with the following code:
GlossaryViewController *glossaryViewController = [[GlossaryViewController alloc] initWithNibName:#"GlossaryViewController" bundle:nil];
glossaryViewController.delegate = self;
glossaryViewController.modalPresentationStyle = UIModalPresentationFullScreen;
[self presentViewController:glossaryViewController animated:YES completion:nil];
Then everything works fine. However if I change modalPresentationStyle to a smaller style such as UIModalPresentationFormSheet then none of my views are visible when the view appears.
I have even tried testing it with just a UIImageView that is set to hug the four edges. Even this disappears.
Before I upgrade to Xcode 6 I had created similar views that still work fine. This has only occurred when creating a new xib.
Has anyone else had similar issues?
After deleting the app, deleting the troublesome nib, doing a clean, restarting xcode and then recreating the xib I still have not be able to get this to work. This was after attempts at changing the size of the view, orientation and playing around with auto layout.
The behaviour is rather odd. Sometimes a single view might show but adding any others by it does nothing.
I have hopefully found a work around for now. If you do as follows:
Click on files owner and then go to the 'Show file inspector' tab.
Next look for 'Interface builder document'. Under this heading is 'Opens in'. Change this from 6 to 5.1.
The following popup appears. (WARNING: if seems once you have clicked 'Disable size classes' there is no going back. So make sure it's what you want to do):
Select the option you want to keep. So if the xib is just for iPhone then select iPhone. This will then give you back the way it was in xcode 5. Basically it's converting it back to a xib that handles either iPhone or iPad and not both.
Look forward to hopefully someone being able to explain what I am doing wrong or if there is some sort of issue with interface builder at this moment in time. Be good use the new interface builder instead of switching back to xcode 5.1 xib interface.

Shift elements in the iOS simulator

Maybe this is silly question but I can't fix it. In StoryBoard it looks OK
But in simulator it looks:
And no matter how I shifted the TableView up it still looks the same. And it's not just this one time when I put like PickerView in the simulator it looked shifted.
May have some setting in the inspector who is responsible for this, or what is the problem?
Try setting automaticallyAdjustsScrollViewInsets = NO in your UIViewController

Resources