Instantiate to a specific position in Swift xCode - ios

I'm looking for some help.
I'm doing a homework for school on xCode and I have an issue.
I'm trying to ma multiple magazine cover that the user can scroll through them. I created a UIScrollview that I instantiate each .xib files (Magazine covers) in it but they stack on top of each other.
What I am actually trying to do is to instantiate the covers side by side (so the user can swipe through them like snapchat's filter). Is there a way to set a certain position?!?
SPECS OF THE PROJECT:
-I'm on the latest xCode beta.
-The target is an iPad Pro on iOS 10.3

I believe UICollectionView is what you're looking for.
Try with this tutorial. It doesn't show exactly what you need but once you see how collection views work you'll realize how to implement your task (or come again for more questions :))

Related

How to smoothly translate view in iMessage extension in iOS 10?

I have issue when I try to push view controller in willTransitionToPresentationStyle:. The view was blinking for a split second before it fully expanded. It might be a small glitch or bug since iOS 10 and Xcode 8 are still in beta. But when I manually requested to change presentation style to MSMessagesAppPresentationStyleExpanded by calling requestPresentationStyle: after I push view controller, it went to expand mode more smoothly. Does anyone have similar issue?
I have had similar problems with transitions in iMessage apps. I think this should improve considerably when iOS 10 and Xcode 8 come out of beta, but for now we have to deal with Xcode's bugs.
There's a few things I've done to make this look better. Inside my extension I have a method that checks the presentation style every time the view changes. This method manages two different UIs - one for MSMessagesAppPresentationStyleExpanded and one for MSMessagesAppPresentationStyleCompact. This method hides and shows specific views accordingly. In my compact UI I have a button that allows the user to expand the interface by clicking it (this is basically the same as clicking the up arrow at the bottom right of the screen).
I've noticed that if you let the user expand the messages app after the view has been loaded for a while the transitions are much smoother and less buggy. Not sure why this is the case, but you should give it a try. Also, I've found segues to be extremely buggy, so that's why I went with keeping everything on one view controller.

iOS left slide navigation mernu

I want to have in my app some nice slide navigationmanu just like in SWRevealViewController. My problem is that SWRevealViewController needs iOS 7.0 and ARC and in my project I have iOS 6.0 without ARC. Is there any way to use SWRevealViewController in my app or maybe there is any alternative to it?
You might want to take a look at ViewDeck https://github.com/Inferis/ViewDeck
It is compatible with iOS 6 and non-ARC.
I cannot tell about SWRevealViewController without ARC or iOS7 (thus I cannot directly answer your question), but I would put a lot of weight behind the following :
Over 80% of all iOS devices currently run iOS7 or greater. ARC has been available since iOS5, which is several years ago.
The mobile market is a quickly evolving one. Not upgrading will quickly lead you to a dark path where you'll end up fighting a losing battle. I understand that your project probably has limitations, but converting right now and keeping up with new technologies will save you a lot of trouble (for instance, trying to make a newer component work with your specific setup).
I would add, the same goes for AutoLayout. If you aren't using it already, you should start, NOW. Rumor has it the next iPhones will vary in size, and the legacy way of handling visuals cannot scale correctly (perhaps the whole reason AutoLayout was created is to prepare this change).
So in short, I wouldn't recommend adapting a new component to your old project, but rather updating your old project to make it modern. You'll end up saving a lot of time.

iOS 7 Transition - XCode 5 - Interface Builder - Three20

I've currently an App (with a lot of View Controllers, ...) what uses the "discontinued" Facebook three20 Library and any storyboard, xib file.
Now I need to update this App, the Deployment Target will be iOS 7 and I have to build it with XCode 5.
So my questions:
Is using the Storyboard a good Idea? Would you suggest me to recreate all View Controllers in the Interface Builder?
--
Another question: when adding a Label Programmatically using iOS 7 feature
self.edgesForExtendedLayout = UIRectEdgeAll;
how do I set the Frame for this Element? Need I determine if I am in Landscape, Portrait and Add the 20+44 for example manually to the y-Axis to start under the NavBar or are there better ways to solve this problem?
Storyboards are good, and you should absolutely use them in any future app you make. Whether or not you should rebuild a current app to use storyboards is a question of how big the app currently is, how much bigger it might get, how much longer you'll support it, etc.
If the app is already pretty massive and it won't necessarily grow much at all from here, it's probably not worth the effort to convert over to storyboards.
If the app is only a handful of view controllers, but you have big future plans for it, I'd take the time to convert it over to storyboards so that all the future development will go faster/easier.
I don't deny storyboards but I respect the custom view approach. It means I am creating my each & every component programmatically via code, be it a UILabel or a UITableView. Aligning code with ios7 specific requirements can also be handelled & controlled at granular level using custom View approach.
To your questions about setting frames for the element or detecting device orientation can very well be detected & adopted by writing code.
You can search more help as the information is available all around on programming aspects of iOS.

Strange bug with resizing of UI elements in xCode 5? Video is attached

link to a video with bug
I simply created a project in xCode. Then I added any UI element to a view. Then I tried to resize this item to left and to right. No code, Interface Builder was used only.
I have checked with some types of projects for iOS and with UILabel and UIButton. The result is the same: when I try to resize the item from the left then it moves the parent view/viewcontroller instead.
Uncheck "Siblings and Ancestors" under Resizing Behavior in Xcode 5 Storyboard.
Voila! As such, resizing your UI elements will not cause your view controllers to move.
You need to uncheck the "Siblings and Ancestors" in your .xib/.storyboard file. See below screenshot of how to toggle this behavior on and off:
As has been said before, you must uncheck the "Siblings and Ancestors" option under Resizing Behavior in the Xcode 5 Storyboard.
The specific purpose of this feature is to be able to resize large groups of objects all at once. For instance, lets say that you have a Table View and you resize one of the cells. In this case, it would seem petty, since you would just have to resize the Table View Controller, but it becomes extremely handy once you have layered objects such as that.
Sorry for the somewhat duplicate answer, but you did ask for an explanation of why a feature like that would be added.
Additionally I have found out that another computer with the same version of xCode works with the same copy of project normally.
I didn't know how to solve this problem without uninstalling of xCode.
So I uninstalled it using AppCleaner and installed it again.

On an iPad, how to create a left side menu to let the contents displayed at the centre according to the item tapped on the menu

I am very new to iOS development. Currently, I am trying to develop an iPad app, which is used for taking orders in a restaurant. When I am trying to create the UI on an iPad, I want to create a left side menu to let the contents displayed at the centre according to the item tapped on the menu. Which is similar to this: http://www.dhtmlx.com/blog/wp-content/uploads/2011/02/ipad_menu_final.jpg
As I am very new to the iOS development, can anybody tell me where I can learn iOS development step by step. And are they any samples of this kind of app that I can refer to?
Thanks very much!
there are many tutorials for creating split view application as links provided by #PratyushaTerli and otherwise you can use direect way as recommended by #antonio MG and there is another two good links for creating them which are : https://github.com/mikefrederick/MFSideMenu (good demos in it using story board or using xib's ) and you can look on project on github named - mmdrawercontroller.
annother good project is this
As Antonio MG said, the easiest way to do this is with Master/Detail project in Xcode. It uses the UISplitViewController logic of one 'Master' controller which controls the appearance of detail content in the 'Slave' or 'Detail' controller aside.
The sample Xcode project should be enough to make you understand how UISplitViewController and its UISplitViewControllerDelegate work together. Or also checkout this tutorial: http://www.raywenderlich.com/1040/ipad-for-iphone-developers-101-uisplitview-tutorial
Just create a Master/Detail project and you will have the basic structure of that kind of behaviour. The rest is just customising the table and the cells.

Resources