Tricky transition in custom view [closed] - ios

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
Good day everyone!
A customer asked me to implement a view. Here you can download and look at video how this view should work. (Left cells are days, right - hours)
It's kind of calendar view.
I've tried to do this task with collection view and custom layout. But do not hit much success. Because of the tricky transition of left cells. They become smaller (to speed up scroll), but right side is still the same.
Is there any possibilities to create such transition in collection view or picker view? Or should i use base view with overriding draw method?
Regards, Eugene.

It's a calendar, so it's essentially infinite, so I don't think a UICollectionView or UITableView is appropriate for this (e.g. what would you return as the number of cells?).
I'd be creating custom UIView subclasses for the left and right side, and overriding drawRect.

Related

Custom page controll with words instead of dots - Swift [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 4 years ago.
Improve this question
I am currently making a timetable in a collectionView.
I want the user to scroll through the weeks using paging in the collectionView.
I am struggling to change the dots into words like: Monday, Tuesday, Wednesday. IS this possible using page controll, or should I code from scratch? See image for example
You can try this pods, I think it will help you.
https://github.com/rechsteiner/Parchment
Parchment is a very flexible paging view controller. It let’s you page between view controllers while showing any type of generic indicator that scrolls along with the content. Here are some benefits of using Parchment:
https://github.com/xmartlabs/XLPagerTabStrip
XLPagerTabStrip is a Container View Controller that allows us to switch easily among a collection of view controllers. Pan gesture can be used to move on to next or previous view controller. It shows a interactive indicator of the current, previous, next child view controllers.
I think you can make it custom components. It's easy to implement.
Take UICollectionView to this paging options. And add UITableView below to UICollectionView.
Change your data after select any item in UICollectionView.

Animate navigation bar with a flexible height in xcode 11 using Swift [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 5 years ago.
Improve this question
Any ideas how to create like this animation on iOS using Swift ? Thanks
There are three ways to achieve this (probably more than three):
Create a custom header and listen to your table view Scroll, then update the header based on the offset.
Use a third party library like this one:
https://material.io/components/ios/catalog/flexible-headers/
Follow a tutorial (there are many of them): https://www.youtube.com/watch?v=lML5XMLrZEk
Sometimes it is better to do that by yourself, but in this case, I think a framework could help you.
I think it's not the UINavigationBar. You could change nav bar alpha then add custom view to table view or collection view and create animation that you need when scrolling.
Custom Collection view flow layout or ScrollView with UIScrollViewDelegate adjusting the header height when content offset is changing.

How to let a user duplicate a view [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 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.

UIView - allocate vs hide [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 have a custom view on my ViewController. I want to remove it when I tap on the screen. It contains image and text.
What is the best way to do this?
I know 2 ways:
use hidden on tap on the screen throughout touchesBegan: and allocate it once.
use removeFromSuperview and allocate it every time.
This depends on requirement :
If on an average, user will tap more times again and again, you should got for hidden approach
But if user has to tap a few times, better to go with second approach
Removing a view from it's superview doesn't necessarily mean that the view will be deallocated. If you keep a strong reference to the view you can add it and remove it as a superview without it being deallocated.

Ios - is there a pattern or architecture for a screen with lots of text and paragraphs? [closed]

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.)

Resources