Swift 3 embed button in page view controller - swift

i am trying to set up a pageviewcontroller that has embedded buttons ( those that dont move when the page view is swipped left or right but are constantly visable )
i have the standard viewcontroller, the pageviewcontroller, and another viewcontroller that has an imageview. the problem is that regardless where i place the buttons they move off screen whith the swipe an reappear with the new image.
is there a way of embeding them so they dont move off each swipe?
ive even tried placing an embedded navigation controller on the first viewcontroller but with no success.
thanks for the advice.

if you don't want them to move, you have to put them in the view controller that contains your UIPageViewController. So they will be only one instance of the button (not one for each pages).

Related

How i implemented an Tab into UITabBar without seeing this tab as item?

I have an UITabBarController which has 5 Tabs. So, my problem is, i want to make an welcome screen into the UITabBarController, but this screen should be just only one time visible, when the app started. After the screen appears and the user switch the Tabs, he can't go back to the welcome screen, otherwise he must quit the app and open it again.
I tried to make an UIViewController as an RootViewController, but he dont show me the UITabBarController instead.
Is there any way that i can solve this problem over the storyboard? Also with code it will be also okay.
If I did not misunderstand your question these ideas will help you;
Add an extra tab to your tabBarViewController , make it welcome view and make this view controller initial VC so user when landing to tabBarViewController this view will appear after few seconds change tab index selectedIndex as you desire from UITabBarViewController then hide welcome view button from tabBar.
Seond way : Inside UItabbarViewController create custom tabbarView (scrollable) you can use collectionView it's easy to implement and it cells selectable like buttons. Hide original tabbar make welcome view appears first, make its index sixth then change selectedIndex programmatically when you need and disable scrolling from collectionView with this way only your five buttons appears on screen and welcome view button automatically remain out of screen.
You can find example code in my Github repo UICWaveTabBar, UICSlideTabBar , UICExapandableTabBar
Fist link including .xib file, you can edit it from storyboard, second and third only code

Buttons of one particular view controller are not working

On tapping one button of first view controller, I am navigating to second view controller with performSegueWithIdentifier(identifier is given in storyboard and working fine).Second view controller will be shown in Landscape mode.
In second view controller there is a mapView(google). below the map, there is one button; on top of the map there is one more button, but both the button actions are not working.
userInteractionEnabled, enabled , accessibility all are correct.
Action methods are also dragged from storyboards properly and have been properly connected.(Removed and even connected again also)
Still action methods are not getting called. Buttons are also not clickable there.
Couldn't find the reason. thanks for help.

UIButtons don't align correctly upon first load of View Controller

I have a ViewController/View in a TabBar Controller that has 8 UIButtons in a 2x4 grid, sized 75x75, each with a 75x75 background image set on them. Currently, I've hard coded the XY positions in the Size Inspector in Interface Builder.
When I first load the View, by clicking on the tab bar icon, the bottom two buttons get squished against the row above them - as per this picture:
Each button triggers a segue that launches another ViewController with a WebView in it :
[self performSegueWithIdentifier:#"playVimeo" sender:sender];
In that WebView, there is a back button that triggers another segue to return to the thumbnails page :
[self performSegueWithIdentifier:#"returnToThumbnails" sender:sender];
When I press the back button and return to the thumbnail view for a second time, the buttons snap to the right place, unlike when they first load, as per this picture:
Here is a screenshot of my Storyboard:
Does anyone have an idea what is going on here ? I am lost...
Thanks in advance!
Jesse
This issue went away when I unselected "Use Autolayout" in the file inspector of the UIViewControllers.
Though as rdelmar pointed out in the comments, it is funny that it was working at all, as I was actually creating a new ViewController with every segue from my back button, and not popping back to the previous existing ViewController. It should have been working the same in both ways, as the View was always loading 'for the first time' ...

Load a view controller created inside a storyboard as a subview (into a part of the screen) of another view controller

I am currently developing as app for iPad. And I need to create a tabbar. The problem is that, for design purposes, I need the tabbar to be on the top half of the screen and not on the bottom as it is on the default tabbar controller.
Once the tabbar is on top I want that when a button is touched, the subview bellow the tab is changed. Furthermore, the subview that should be loaded was alson designed inside the storyboard. The following sketch shows what I want it to look like:
On my research I found a solution (here) for putting the tabbar on top. Now my problem is on loading a subview bellow it.
I tried it with [self.view addsubview:theNameOfTheViewCreatedINStoryboad.view] but the application simply hangs when I press the button.
I think that is because I am not specifying anywhere what should be the dimension of the new view or where on the scree should it be placed. The reason for that is because I do not know where it should be done.
Can anyone give me some lights on this matter? Is the referred approach the best one for putting a tabbar on top? How can I solve the subview problem?
Glad to see you are using a toolBar and not a tabBar. Even better would be to create a custom content view controller.
You should be looking into using containment:
UIViewController containment
How does View Controller Containment work in iOS 5?
positioning UIViewController containment children
check out the docs

iPad UIModalPresentationPageSheet with navigation controller

I have a navigationcontroller and on click of a row I want a sheet:
self.modalPresentationStyle=UIModalPresentationPageSheet;
that comes up and takes the middle space of the iPad (transparent).
This works fine I want this sheet which is itself a viewcontroller to have a table view within it.
When the user clicks on the table row of this sheet, it should navigate and another view should come in as a sliding animation effect, but I am not able to add another navigationcontroller to this view.
Is there any way to get this sliding animation effect without navigation?
Check out this tutorial http://www.nanaimostudio.com/blog/2010/6/30/modal-form-sheet-navigation-controller.html
The tutorial is not using a table view but in principle it works just the same.