Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
Hi there. Im new to ios, and i've been giving this assignment. I need to make a expandable/collapsable menu that can hold controls.
I have no idea on how to achieve this, and searching the internet has not proven fruitful - except for some navigation dropdown menus like this:
https://github.com/nmattisson/DropdownMenu
which is very nice, but ment for navigation, as i see it..
Any ideas? Thanks in advance
EDITED: Apparently the question was to broad.. I'll try to elaborate.
I need a menu i can place in certain viewcontrollers - each different viewcontroller can have different options, and often many different options. Therefore i need to add a menu that can be collapsed/expanded by a touch on the arrowbutton - as illustrated on pictures, and the collapsable menu must be able to contain different controls, depending on the context of where it is used.
After more research, i'm thinking a the usage of a container might be a part of the solution, and some animation to handle the expand/collapse.
So basicly - the menu could be something like the equivilant of an Android fragment, that can be inserted in the activities needed.
I hope this makes more sense.
You will try to play with Autolayout constraints ,
Ex : The height constraint of the container view is 60 in expanded mode ,if you want to collapse it change it to 0.
Related
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I've a countdown app, it counts the time towards and since a date that the user chooses, and would like to know how to allow a user to pick more than one countdowns.
I'm thinking if there is a way to let the user duplicate the view, but I could be far from right, I'm new to this.
Any help would be much appreciated.
Thanks.
Given the requirements that you mention on your question and the follow up comments, I think perhaps the best is to use a horizontally scrolling collection view, with each cell taking up the whole screen.
(before the advent of autolayout, I would have recommended a UISCrollView with the content size varying at runtime as you add pages, but setting up UISCrollView correctly with autolayout is a steep learning curve. UICollectionView and UITableView take care of this for you behind the scenes).
The setup would be like this:
In the storyboard, embed your view controller in a navigation controller, so you can (perhaps) have your "Add Countdown" button as the navigation bar's right bar button item.
Next (still in the storyboard), add a collection view to your view controller and wire any outlets/delegates/etc.
Implement your data source so that it reflects how many countdown objects you currently have, and set up the "add" button so that when tapped, it creates a new counter and refreshes the collection view.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I'm currently developing an iOS app for my company and I'm really new to app development. I have a styling guideline from our companys' art agency.
Here is an example of what I'm trying to accomplish.
As you can see on the pictures' bottom there a some "stacked" / "overlapped" panels (where the arrow is pointing at) The first one should have a title and content - the other two just an title. There should be no functionality (just by touching on them as a whole, to navigate to the detail view) - but I have no clue for realizing this.
I had a look at UIStackView but im not sure if this is the right control for doing this.
Is there a control for doing this, or do i have to place those views manually?
If you truly don't need any other functionality other than tapping on them you're going to have to layout three UIViews yourself like you see in the picture.
It looks like the top one is a UIView with room for a title Label, a time label (maybe?), and a detail Label. So start with a UIView, create your labels, and add them in one by one to the top view, taking care to set AutoLayout up correctly so the views are aligned like you see.
I would reccommend creating the back UIView first, then adding it, create the middle one, add it, then create the last one and add it. This way they will automatically be setup in the correct order "depth" wise
Edit: As you said your new, let met me add one more tip on how to implement this - I would put the layout of the three UIViews and text into a separate UIView subclass. Then, you can simply instantiate an instance of that UIView subclass and place it where you need in your layout like you would any other type of view or control.
Basically, by making your own subclasss, you create your own control that you were looking for originally.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
I would like to know the efficient way to create an app in Swift. Will the number of files (ViewController files) in my Xcode project affect the performance of my app?
For example, for a simple arithmetic calculator app, in the first view I'll display 4 buttons for addition, subtraction, multiplication and division. If I click on a button, then it will open a new view to enter the data and process it.
So, now my question is, should I create 4 different viewControllers or should I use only one viewController to perform all the 4 operations?
Which one would be the efficient way?
First, your question isn't about Swift, it is about UIKit.
Second, you are looking at the problem the wrong way. Different view controllers will control different views. Switching from one view to another is a user action. Do you want the user to switch from one view to another, or do you want them to use one view all the time without switching?
If there is one view displaying different things, it's one view controller. If it's several views displaying different things, it's several view controllers. And I can assure you that the number of view controllers is not what makes your app fast or slow.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
Hi I'm new to Xcode and don't quite understand the difference between all the view controllers. Eg what is the difference between a uiviewcontroller with a collection view on it and a uicollectionview controller it self? Confused as to why I wouldn't use a view controller then add views onto it depending on my requirements eh table, collection etc. Can anyone help to shed some light?
It's based on your requirements. You may change some properties with your View controllers. But when you use as part of its' controllers, you can't change it.
For example you CanĀ“t change UICollectionView Size of UICollectionViewController(see this).
In these case, you must use UICollectionView in viewcontroller. As like this, if you want to customize some property but functionality are same in all.
Here I mention some ref for you: Ref
You can take UICollectionViewController as a template which will have every thing for you. And view controller is simple scracth pad, you have to add things on it. There are some pros and cons in view controller you have to do every thing yourself, but collectioViewController you got controller with collectionView. But you can not change things as easily in it.
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this question
I have a screen that is supposed to have a few large sections of text, a few buttons on different places, and headings for every section which have different styles.
I can just cut and paste the text on the screen and make it a scroll view and be done with it, but I am wondering whether there is a pattern or a good practice way of creating such a screen that is perhaps more elegant than just dumping a bunch of text right on the page.
I am working with storyboards.
Thanks in advance for your advice.
I think using a storyboard and laying out the content is reasonable if there isn't too much there. (You can use a separate UIView and make it whatever height you want for layout purposes, then programmatically insert it into the scroll view.)
One alternative we often use for a "rich text"-like view is a UIWebView. (Though buttons in such a view are more of a pain.)