Using MGSplitViewController inside UITabBar - uitabbarcontroller

Is anyone using MGSplitViewController inside a UITabBar?
My objective is basically to use UISplitViewController inside a UITabBar. UISplitViewController doesn't work well inside a UITabBar. Specifically, UISplitViewController splits apart when device orientation changes.
Since UISplitViewController didn't work for me, i turned to MGSplitViewController. And now it seems that it's not a workable solution to be used with UITabBar either. Im running into all sorts of problems. Mainly the following:
I have a tab-bar with 3-4 tabs. Each one contains a MGSplitViewController. In general, the MGSplitViewController contains a Master (UINavigationController) and a Detail (UIViewController). When i rotate the device, the content (UITableViewCell) inside the UITableView is misaligned/disturbed. Scrolling the UITableView to show new cells fixes the misalignment. The Master has a Navigation bar and a search bar, and orientation change doesn't affect them. Any solution?
MGSplitViewController is great! But it's not being maintained.

I ended up using IntelligentSplitViewController (github.com/grgcombs/IntelligentSplitViewController). Worked for me!

Related

SwiftUI NavigationBar sliver sliding down creates unexpected behavior

When using the NavigationView in SwiftUI, it creates lots of unexpected behavior when sliding down on the navigation bar to when it would collapse. I am using a search bar as well(searchable directly on the List). I am unsure what is causing this but it may have to do with having sections on my List.
Here is some source code that works for me. I am running this on a real iPhone and it creates this behavior.
https://utilities.awesomeplayer.tech/send/f.php?h=1I-fJPHl&p=1
UPDATE! I found the answer to this and that this is caused by adding .animation() to the SwiftUI List itself. While this does give a nice animation and controls the animation while updating, deleting, etc., it controls the animations of the whole navigation bar itself as well. I found this by tweaking the duration part of `.animation(.default(duration: 1)) to four and noticing a noticeable difference in how it slides down: it slides down slower.
There is a warning I was ignoring from Xcode complaining about a deprecation. After some research, I replaced it with .animation(.default, value: UUID()) and that seemed to work perfectly.

Instagram or Twitter profile page in SwiftUI

I have been trying to recreate the functionality of an Instagram or Twitter profile page, and I have run into a problem that I don't know how to solve.
The main idea that I use to reproduce this functionality is to use the contentOffset of ScrollView with cells, and change the vertical offset of the ProfileView so that when scrolling the list it disappears, and the view of the list switcher is fixed on top.
The problem is that when scrolling one list, and switching to another, I have an indent in top of the list, which I do not know how to make adaptive to the scroll of any of the lists and to the cells count in each list.
Maybe it would be worth adding another ScrollView in which to place the ProfileView and the view list switcher, but how to make them work similarly to what is in Instagram?
I have searched a lot on the internet for a solution, but I have not found anything to help me solve this exact problem, I will be very grateful for your help.
I created a small project demonstrating the problem, here is the GitHub link, you can download and run it: https://github.com/swiloper/StickyHeader
And also an example of the problem and desired functionality with Instagram:
enter image description here enter image description here

iOS Custom Tab Bar

I am looking to implement a custom Tab Bar in iOS where selected item is bigger size than the rest of the tabs and peeks out over the content similar to this screenshot.
Could someone point to a tutorial of how to accomplish this preferably in Swift?
I faced with this task several times. I found a lot of tutorials but I've never found one that gives the ability to create a center button that part of it is out of the tab bar.
At the end, I created an approach to have it done correctly. I implemented a simple example project with instructions how to do that. Please check my Custom Tabbar Center Button repo as an example.
One more benefit of it it's center button hides correctly with the tab bar when you use Hide Button Bar on Push property.
A UITabBar contains an array of UITabBarItems, which inherit from
UIBarItem. But unlike UIBarButtonItem that also inherits from
UIBarItem, there is no API to create a UITabBarItem with a customView.
So instead of trying to create a custom UITabBarItem, we’ll just
create a regular one and then put the custom UIButton on top of the
UITabBar
Not swift, but should be easily translated.
https://github.com/boctor/idev-recipes/tree/master/RaisedCenterTabBar
This one is Swift:
https://github.com/itsKaynine/SwiftRaisedTab
Source code for a similar question, using Swift 3:
https://stackoverflow.com/a/36016377/300897

How to add NSTableView to a CCLayer in cocos2D

I'm developing an App. It is compatible with iOS and MacOS. Obviously I'm using preprocessing definitions to establish some code conditions. I'm using Cocos2D. (v.2.1)
My question is related to NSTableView. While in the iOS version I was able to create a UITableView from scratch without using any XIB, and added to the scene using [[[Director sharedInstance] view] addSubview: myTableView] and it worked, the MacOS version didn't.
I created the NSTableView, even an NSHeaderView, also I stablished the delegate protocols for NStableView and DataSource, and it is working, because in my logs, I can see how my app returns the rows, and enters into the method to populate the Table data. But there is not a pixel on the screen. I've got added one column. I'm aware that many people missed to add a column, and the populate methods are not called.
Does anyone know if is it mandatory to use a XIB to create an NSTableView and loaded as a subView with cocos2D? Nothing that I've tested worked to show the table on the screen.
Thank you very much.

a Cufon problem on a nested menu

I'm building a nested navigation bar, here is the jsFiddle:
http://jsfiddle.net/3Y8vB/1/
the nested menus are on the third item, "Collezioni": so far so good. But adding Cufon triggers a strange problem: "hovering" the nested menus and going away from them all the way down, the "Collezioni" link disappears!
http://jsfiddle.net/3Y8vB/2/
Well, it doesn't really disappear: it retains the #fff color (:hover) instead of going back to #111 (normal state), and since the background is white too, it "disappears". Going all the way UP (without "hovering" the nested menus) has no problem.
I'm sure it's a Cufon related problem since the first version (without Cufon) is working nice.
Please, can you help to solve this? Thanks in advance
Ok, found the solution here:
https://github.com/sorccu/cufon/wiki/FAQ#wiki-faq-10
And here's the new jsFiddle:
http://jsfiddle.net/3Y8vB/3/