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 last month.
Improve this question
I am working on a project that creates a form dynamically based on an xml file. Everything works fine, except that if a form has too many textViews, it loads very slowly. Analyzing the app performance through xcode Time profiler, I came to know that whenever a textView is initailized it consumes a lot of cpu. Below are the screen shots of the profiler, that shows how a textview initialization takes 25.7% of the total time. According to the profiler, just textview initialization takes about 2.10 seconds.
I found a similar issue Slow load time for custom UIView with UITextView property in Swift that suggests a solution to use storyboard. However, I have a dynamic view constructed based on a xml file. So, I cannot create a view with storyboard or xib.
Profiler shows average time taken while each initialization of a UItextView:
Profiler shows 100% time is consumed just while calling the initializer of UItextView:
Related
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
I'm trying to build a chat app like the native Messages app/Whatsapp.
The design is a little bit different than the native chat bubbles (rectangle messages view instead of bubbles) but I guess the basics are the same. Of course the messages should start from the bottom of the screen like any chat app, and in the bottom there should be a "new message" textField.
Should I use UITableView or UICollectionView for this purpose?
Thank you!
I just finished shipping a chat app and went through this exact question when building the architecture. This isn't a hot take.
I made the mistake at first to go with UITableView only to realize halfway that UICollectionView is way more powerful. (UICollectionView even has a tableLayout if you want to use it this way).
I realized this after studying the other chat libraries available like JSQMessagesViewController, MMTextureChat, MessageKit etc.
UITableView is good but soon enough you'll run into performance and customization issues like I did.
As for showing the messages from the bottom, the trick is to flip the view. That way when you call insert(atIndexPath:) the item shows up at the bottom.
Hope it helps.
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 am developing a universal iOS app. I am looking to achieve the below grid layout using 8 images (inclusive of the text).
My skills of autolayout are poor, especially for universal apps. I would like the layout to remain for iPad and smaller screen devices, and scale the images accordingly.
I am unsure how to achieve this. Could you suggest a method and perhaps point me in the right direction by providing suggestions on methods to achieve this, such as UICollectionView or grid layout using autolayout.
Collection view! It's a great way to arrange things in a view like this that automatically adapts to screen size.
Apple docs - https://developer.apple.com/library/ios/documentation/UIKit/Reference/UICollectionView_class/
Simple example you can follow - How to make a simple collection view with Swift
UICollectionView is a powerful tool, can be tricky to nail down at first but follow along on the tutorial and you should be able to make your design in no time!
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
So I'm following a set of tutorials and have come to a point where I have the app working (A simple calculator), but the UI could still be improved.
The current UI works great on phones, but when going up to an iPad, parts of the UI expand as needed, but the buttons stay at quite a small size. I have no constraints keeping the buttons small and the stack that the buttons are in do expand to fill the space.
My project files can be found here:
https://github.com/maza256/retrocalc
An image to explain is found here:
iPhone and iPad Preview image
Any help would be great.
After looking at your project I found one change that you can make. Go to storyboard and select the buttons then click on attribues inspector. Then under control change the alingment options on the far right, which will cause your image to expand to fit the space.
Ipad
Inspector Setting
Sorry that i didn't catch this in my post. But you will need to click on the stack view for the top row of numbers and make sure to make the stack view settings like this.
Buttons are the right size. They are not small and behave as you expect. Try to change background color:
iPad screenshot
The problem is that you have very small images. You have to provide .#2x and .#3x images, so you won't lost quality on iPad.
Image assets
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 planing to use dynamic typing in my application. Is there any technical limitations that i should care about? I could not found it Apple official doc. If possible, please provide some sample code.
See blog post here
OS: It only works in iOS7+.
UITextField: The placeholder font is not exposed in the public API and doesn't use the value of the font property, therefore you can't adjust its size as the content size changes. This leads to a weird effect where the text adjusts normally but if the field is cleared it jumps back to the original font size when displaying the placeholder. You can most likely fix this by subclassing UITextField and implementing placeholderRectForBounds: and drawPlaceholderInRect: with adaptive fonts yourself, however this is left as an exercise for the reader.
MKAnnotationView: The text in the system-provided callout does not adjust as the content size changes. Unfortunately, fixing this requires you to implement the entire callout yourself.
See here sample application
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 9 years ago.
Improve this question
Apple introduced storyboard which saves lots of coding time. It seems that it doesn't support iOS4 and below. So is it mature enough to use storyboard for development now? How are other application doing?
Storyboards are only supported in ios5. Mainly because they support segues
I can recommend you using storyboards just because it brings your project screens to something logically bound, so if random developer sees it he can quickly figure out everything.
Coding layouts is time thrown to trash. Your time and time you'll support the project, and time you'll spend trying to find bugs in this code, and time of other people that would be very much demotivated when they see the code for layouts.
In storyboards you are also forced to use MVC, so u'd never create a separate view for anything but tableview cells. (like you can do in XIB)
You should be sure that you have more than 2GB of RAM to use storyboards, because they usually contain more than 5 screens and DO lag on slow computers. The monitor size is also better be big or you'd be forced to scrolling over things all the time.
Yes story board is okay to use. Just set your deployment target above 4.0. If you do that you should be fine.