iOS: Implement a simple drag and drop to reorder [closed] - ios

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 9 years ago.
Improve this question
I have x number of views in a row:
[view1] [view2] [view3]
I need to be able to drag and reorder anyone of them (just in the horizontal direction), and also need to insert new views.
How would you implement this?
I guess something like this:
- (void)didDragView:(UIView *)currentView
{
for (UIView *v in self.viewsArray)
{
if (currentView.center.x < v.center.x)
// Move view to index: [self.viewsArray indexOfObject:v];
}
}

I think this might help
http://undefinedvalue.com/2010/02/05/iphone-sample-code-tiles
However, you need some code change in order to support horizontal direction only

you should use a collection view and this category:
DraggableCollectionView

Related

Change the structure automatically? (iOS/Storyboard) [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 4 years ago.
Improve this question
To know better what I mean, check this screenshot here. Let's say the UIView with the number 3 are removed. Is it possible to tell the storyboard or ViewController it should after the remove put the UIView number 4 and 5 higher (the y-position), so that it looks like this screenshot?
Sorry for the very basic question, but I have no idea how I could start or if this have a special name, to google it.
This job is best fit for a vertical UIStackView , as setting
self.view3.isHidden = true
will automatically collapse the view , but if the items count will be many than fit in a single device height , then you have to embed the stackView inside a UIScrollView , or use a UITableView instead

swift multiple buttons inside table view cell [closed]

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 5 years ago.
Improve this question
How to create view like in image to stretch to all width programmatically
https://cocoapods.org/pods/FlexLayout
I would recommend using something like FlexLayout. It handles laying views out however you determine that you want to lay them out, can handle changing widths, stacking in columns or in rows. Think if it similar to stack views the way you can lay them out. You don't need to use any constraints with this library. (I do not have any connection to the library at all).

UI design - simple struct - how to implement [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 6 years ago.
Improve this question
How can I create the next (and simple) structure?
Is it just a tableView? or is it require assets ?
(I'm asking about the squares only, not about the text and icon at each row)
For this kind of design you should take one UIView with border and rounded corner.
Then add three textfield to it without border and add two another uiview of height 1 or 2 pixel(So it's looks like line) as a separator.
So by this you have ready this empty box with three textfield.

trying to arrange items in tableview cell- and they keep jumping [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 9 years ago.
Improve this question
I am trying to create a custom tableview cell
however, all my content inside keeps jumping around
This is how i put the objects in my view
and this is how the view renders during runtime
Why are my labels keep jumping ?
Using auto layout tend to move the objects.
Disable it if you don't really use it and it won't jump.

Any way can implement the function as picture shows [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 9 years ago.
Improve this question
As you see, a image cycle show area. is it in the first cell of table or some other ways implement?
Does it scroll with the content or is it static?
If it scrolls with the content:
Using tableHeaderView is the easiest solution.
If it is static:
Just layout as a separate view above the UITableView in Interface Builder or code.
You can create a small pagecontrol with scrollView and add that to tableHeaderView and then you can achieve the functionality shown in picture.

Resources