Friday, September 8, 2017

Realm/RLMArray.h file not found and Could not build Objective-C module 'Realm'

Run Clean Build Folder...(Hold down option while clicking Product in the Xcode menu shows the Clean Build Folder...option) it fixes the issue for me

Courtesy : https://github.com/realm/realm-cocoa/issues/3551

Monday, September 4, 2017

iOS UIScrollViews have extra space on top


From iOS 7 onwards, a ViewController's view starts at absolute position (0,0), which means it's underneath the Nav Bar. 

So if we have a tableView or any other type of Scroll view in the View, the there is a chance that the top content might get hidden by the top bars. So ViewControllers automatically adjust the content inset of subviews which are of type UIScrollView to consider the space taken by the bars. 

If the ViewController is inside a NavigationController, the space typically is 64 (20 for the status bar + 44 for the Navigation Bar). Otherwise it's just 20, for the Status Bar

We can disable this automatic adjustment by setting: 

self.automaticallyAdjustsScrollViewInsets = NO;



This just got deprectated in iOS 11. The new method to fix this is : 

scrollView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever