SizeToFit method minimum IOS requirement(Support) - ios

simple Question , im trying to understand which minimal ios support SizeToFit method.
I have tried it on a IOS 7 simulator and its seems to work properly.
But according to the docs :
sample code :
numberToolbar.sizeToFit()
It support IOS 8+, how is it possible? Is it safe to use on ios 7?

Have a look at Apple's documentation here for sizeToFit. It says :
Availability
Available in iOS 2.0 and later.
So, don't worry it will work on iOS7

Related

What's gonna happen if using Deprecated Button Properties in future iOS?

I was trying to use imageEdgeInests to make the edge inset bigger, but the document says it's available in ios 2.0 - 15.0. (deprecated)
Since my app needs to support ios14, I used imageEdgeInsets for now, but what's gonna happen if an iPhone with future ios (like ios 16?) runs the code? (and if I don't add #available and UIButton.Configuration code) Is it gonna crash the app?

Can UIStackView support iOS 8 or 7?

I know that UIStackview is a new feature in iOS 9. If I want my app to support iOS 8 or iOS 7, does that mean I shouldn't use stack views?
It looks like it's for iOS 9+.
UIStackView
Availability
Available in iOS 9.0 and later
UIStackView is only available in "iOS 9.0 and later".
If you need to support earlier versions of iOS, check out OAStackView, a drop-in replacement which "implements most of the features from UIStackView" and supports iOS 7+.
A few minor features haven't been finished yet. I tried it out using the UIStackView-Playground project and it works pretty well.
You could also check out MarkupKit (I'm the project's author):
https://github.com/gk-brown/MarkupKit
The LMColumnView and LMRowView classes are very similar to UIStackView but work with iOS 8. They also have a couple features that UIStackView doesn't have, such as the ability to set a background color and weight-based distribution.
See this article for more information:
https://gkbrown.wordpress.com/2015/09/29/using-uistackview-with-markupkit/
UIStackView is supported only in iOS 9+. For people looking for a backport to iOS7/8:
https://github.com/oarrabi/OAStackView

How to deal with: UIActionSheet deprecated (iOS8) X UIAlertController not supported (iOS7)

The UIActionSheet is deprecated on iOS 7 and the docs suggest to use UIAlertController however UIAlertController is not supported on iOS7 :P
My code will run if I do use the UIActionSheet in iOS8, there's a warning :P but it runs...
I wondering to know if is there another alternative instead of just leaving the deprecated code and make sure that it works for both iOS (7/8).
tkx
If you are writing shared code that can be used on both iOS 7 as well as an iOS 8 extension - where the UIAlertView/UIActionSheet APIs are restricted - have a look at JVAlertController.
It's an open-source back-port UIAlertController to iOS 7 that I created to work around this.
Like #rmaddy pointed out you should set your deployment target to iOS 7 and use UIActionSheet. That way you will not get any warnings and your code runs on both iOS 7/8!

Autolayout and minium ios version

I would like to know whether there is minimum IOS version for autolayout (like will it be ok on ios 4?). I am reading this https://developer.apple.com/Library/ios/documentation/UserExperience/Conceptual/AutolayoutPG/Introduction/Introduction.html and it say it is included in xCode 5. Is there minimum ios version to use autolayout?
iOS 6.0 is the minimum version. If you see, for example, the NSLayoutContraint documentation you'll see the version number information there.

Using iOS 6 theme for iOS 7 app

I am curious: is there a way to set an iOS 7 app to run with the old fashion iOS 6 visual appearance? I am aware of the UIAppearance protocol but setting the appearance for each individual element seems to be a bit of hassle.
Update: It is no longer possible to upload apps targeting the iOS6 SDK.
Short answer: Compile with SDK6, while it is still possible. Eventually, Apple will deny this, however.
If you are feeling adventurous, try:
[[NSUserDefaults standardUserDefaults] registerDefaults:#{ #"UIUseLegacyUI": #YES }];
(Don't submit your apps with this, however.)
I've tested an old app that I submitted to app store 2 years ago that compiled with iOS 6, before they introduced iOS7. I can confirm that the answer I picked was not entirely correct.
When running on iOS 7 device, the app I made for iOS 6 was a mix of both - 50% looking like iOS 6, 50% like iOS 7. It was compiled with xCode 4.3 or something, with base SDK being iOS 6.
For example, the toolbar and tab bar look like iOS 6, while the alert view looks like iOS 7.
The app that I made was called Social Comics in case you want to have a look yourselves. I made this app not long after I graduated and haven't update it for 2 years so don't laugh if it looked dated...
Compiling with SDK6 in XCode 5 won't help you much. You'll still get the iOS 7 look if you won't customize it your self to look like iOS6. Check my answer here: https://stackoverflow.com/a/18954491/1578927

Resources