Questions tagged [ios]

iOS is the mobile operating system running on the Apple iPhone, iPod touch, and iPad. Use this tag [ios] for questions related to programming on the iOS platform. Use the related tags [objective-c] and [swift] for issues specific to those programming languages.

It should not be confused with i5/OS, which is one of IBM's operating systems for the IBM Power Systems (originally AS/400), or with Cisco's IOS (Inter-network Operating System).

iOS Latest Stable Release: iOS 16.3.1 (20D67) released on February 13, 2023

Latest Preview: iOS 16.4 RC beta (20E246) released on March 21, 2023

Latest Release News: News and Updates

iOS is a derivative of Apple's OSX desktop operating system, with which it shares many (but not all) common frameworks and other components. These include Cocoa Touch (the counterpart of the OS X Cocoa UI Framework), the Mach/Darwin/XNU kernel and code from the Berkeley Software Distribution (BSD).

Applications for iOS are written for the Cocoa Touch framework (as opposed to OS X's Cocoa framework) using the same Xcode IDE for official use (i.e. for submitting applications to Apple's App Store) or using unofficial (mostly command-line only) toolchains for various operating systems (including Linux) for unofficial/jailbroken development. OS X is based on the Darwin-OS foundation, itself based on several Unix descendants. On June 2nd, 2014, Apple announced a new language, Swift, which could be used to develop apps for iOS. Swift was in beta until September 9th, 2014, and is, since September 17th, 2018, at version 4.2.0.

Each iOS application runs in its own secure sandbox to prevent (accidentally or intentionally) altering other applications, the operating system, or any other data. Since iOS 8, an iOS application can have extensions that extend custom functionality beyond the application. iOS is optimized for the power, graphics, processor, and memory constraints of mobile devices.

The user interface of iOS is based on the concept of direct manipulation through multi-touch gestures. Interface control elements consist of sliders, switches, and buttons, all included in Apple's UIKit Framework. Interaction with the OS includes gestures such as swipe, tap, pinch, and reverse pinch, all of which have specific definitions within the context of the iOS operating system and its multi-touch interface.

Internal accelerometers and gyroscopes can be used by applications to respond to the user shaking the device (one application is the undo command) or rotating it in three dimensions (one common result is switching from portrait to landscape mode or autorotation).

Apple initially adapted features from OS X to create iOS, but that cycle is now bidirectional. Many features on OS X 10.7 OSX Lion were implemented first in iOS, including application sandboxing, an OS X App Store (and the implied widespread third-party app code signing), the content-centric ("natural") scrolling direction, along with AV Foundation, Core Location, and a few other frameworks.

Swift Package Manager or SPM is a dependency manager tool from Apple for managing the distribution of the Swift code. Introduced with Swift 3.0, it is slowly becoming the dominant dependency tool in Swift and Objective-C projects. The basic concepts of the SPM are:

  • Modules - Swift code are organized in modules that specify the namespace and enforce access control of the code.
  • Packages - are reusable components of code used in the projects and at the moment these languages are supported: Swift, Objective-C, Objective-C++, C, or C++
  • Products - library or executable
  • Dependencies - modules on which code in the packages depends on

It comes as a part of the Xcode IDE Swift packages or as part of the Swift toolchains. The source code can be found here.

CocoaPods is a dependency manager for Swift and Objective-C Cocoa projects. It includes almost ten thousand libraries to help programmers scale projects. A popular alternative is Carthage, which is a decentralized dependency manager, meaning that it does not store a central list of available projects.

Use the tag for questions about Cisco's IOS operating system for Cisco network routers.

Please follow the article My App Crashed, Now What? by Ray Wenderlich, before posting any questions relating to app crashes. It explains how to properly debug an iOS app. It's pointless to ask questions relating to crashes when you don't have a proper backtrace and exception message.

Before you ask about custom controls: I want this type of control. Please visit cocoacontrols once. You will get lots of custom controls, animation, libraries, and much more which are available in Swift and Objective-C.

Before asking about a topic, just search for it in https://developer.apple.com/documentation/ also, which is the developer documentation provided by Apple that covers a lot of information regarding iOS development.


Resources


Chat Rooms

Chat about iOS with other Stack Overflow users


If you are moving from Objective-C to Swift, but you don't know anything about Swift, then you can convert your Objective-C code/project to Swift. Use the following third-party link.

Related Tags

Platforms:

Programming languages:

IDE:

Frameworks & extensions:

Distribution:

683185 questions
112
votes
23 answers

Firebase Crashlytics: Upload missing dSYMs to see crashes from 1 versions.(iOS)

Error Message: Upload missing dSYMs to see crashes from 1 versions. Versions affected: 1.0 (1) I am trying to implement Firebase Crashlytics in my iOS project. I did all the setups according to Firebase Crashlytics Doucmentation. The crash is…
jazzbpn
  • 6,441
  • 16
  • 63
  • 99
112
votes
32 answers

dyld`__abort_with_payload: Without an error message

When I start my app with Xcode, I have a crash, but without an error. The app is just stopping on this thread: What can I do to have more information about the issue?
Kevin ABRIOUX
  • 16,507
  • 12
  • 93
  • 99
112
votes
8 answers

How to use Apple's new .p8 certificate for APNs in firebase console

With the recent up gradation of the Apple developer accounts, I am facing a difficulty that while trying to create the push notification certificates, it is providing me with (.p8) certificate instead of APNs ones which can be exported to…
Subso
  • 1,413
  • 2
  • 10
  • 16
112
votes
23 answers

how to make UITextView height dynamic according to text length?

As you can see in this image the UITextView changes it's height according to the text length, I want to make it adjust it's height according to the text length. *I saw other questions, but solutions there didn't work for me
DeyaEldeen
  • 10,847
  • 10
  • 42
  • 75
112
votes
11 answers

How to stop Firebase from logging status updates when app is launched

Whenever I launch the FireBase app, it logs the status of various Firebase features. Right now this is what is being logged: Configuring the default app. Firebase Analytics v.3200000 started To enable debug…
JCode
  • 1,788
  • 3
  • 12
  • 29
112
votes
1 answer

Android equivalent of NSUserDefaults in iOS

I'd like to save some simple data. On the iPhone, I can do it with NSUserDefaults in Objective-C. What is the similar command here in Android? I'm just saving a few variables, to be reused as long as the application is installed. I don't want to use…
christian Muller
  • 5,016
  • 6
  • 34
  • 44
112
votes
21 answers

UIButton won't go to Aspect Fit in iPhone

I have a couple UIButtons, and in IB they're set to Aspect Fit, but for some reason they're always stretching. Is there something else you have to set? I tried all the different view modes and none of them work, they all stretch.
marty
  • 1,137
  • 2
  • 7
  • 7
112
votes
1 answer

what's the purpose of double question mark in swift

I have seen such function: public func highlightValues(highs: [ChartHighlight]?) { // set the indices to highlight _indicesToHightlight = highs ?? [ChartHighlight](); // redraw the chart setNeedsDisplay(); } What's the purpose of…
Wingzero
  • 9,644
  • 10
  • 39
  • 80
112
votes
12 answers

Attributed Text Center Alignment

I have tried everything but cannot seem to center this text. Can someone please tell me where the error is. NSMutableParagraphStyle *paragraphStyle = NSMutableParagraphStyle.new; paragraphStyle.alignment = NSTextAlignmentCenter; label.attributedText…
user3255746
  • 1,377
  • 3
  • 12
  • 13
112
votes
17 answers

Use multiple font colors in a single label

Is there a way to use two, or even three font colors in a single label in iOS? If the text "hello, how are you" were used as an example, the "hello," would be blue, and the "how are you" would be green? Is this possible, it seems easier than…
Justin Rose
  • 1,165
  • 2
  • 10
  • 6
112
votes
6 answers

Interface Builder: What are the UIView's Layout iOS 6/7 Deltas for?

I just noticed the iOS 6/7 Delta property found under the UIView's structs layout. What is this for and why is this missing from AutoLayout?
Frederick C. Lee
  • 9,019
  • 17
  • 64
  • 105
111
votes
3 answers

UIPopovercontroller dealloc reached while popover is still visible

I assure you that I did look for an answer in SO for my question but none of them were helpful. Here I got a simple code that should present a UIImagePickerController within a…
111
votes
6 answers

What are the differences between a UIView and a CALayer?

Both have most of the same attributes, both support different kind of animations, both represent different data. What are the differences between a UIView and a CALayer?
Oleg Danu
  • 4,149
  • 4
  • 29
  • 47
111
votes
11 answers

Where to store global constants in an iOS application?

Most of the models in my iOS app query a web server. I would like to have a configuration file storing the base URL of the server. It will look something like this: // production // static NSString* const baseUrl = "http://website.example/" //…
JoJo
  • 19,587
  • 34
  • 106
  • 162
111
votes
21 answers

Xcode 11.4 compile error 'Missing package product '

When I integrate a local package in my Xcode project everything is fine initially but when i switch branches and want to run the app Xcode gives me the compile error Missing package product . When I quit Xcode and re-open it everything…
blackjacx
  • 9,011
  • 7
  • 45
  • 56