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
111
votes
7 answers

SwiftUI HStack fill whole width with equal spacing

I have an HStack: struct BottomList: View { var body: some View { HStack() { ForEach(navData) { item in NavItem(image: item.icon, title: item.title) } } } } How do I perfectly center…
Tom
  • 3,672
  • 6
  • 20
  • 52
111
votes
8 answers

How do I set a weight to SF Symbols for iOS 13?

I have this Image(systemName: "arrow.right") But how do I make it bold, semibold etc? I am using the new SwiftUI.
Just a coder
  • 15,480
  • 16
  • 85
  • 138
111
votes
25 answers

CocoaPods could not find compatible versions for pod "Firebase/Core” | cloud_firestore, Flutter

I am having some issues in the pod, see below Launching lib/main.dart on iPhone X in debug mode... Running pod install... CocoaPods' output: ↳ Preparing Analyzing dependencies Inspecting targets to integrate Using `ARCHS` setting to build…
Jashan PJ
  • 4,177
  • 4
  • 27
  • 41
111
votes
4 answers

How can I get the font size and font name of a UILabel?

I have a UILabel which I set a font size and a font name with Interface Builder. Now I have to read the values of both in my ViewController. How can I do this?
Tim
  • 13,228
  • 36
  • 108
  • 159
111
votes
6 answers

UIStackView Hide View Animation

In iOS 11 the behaviour of the hide animation within a UIStackView has changed, but I have been unable to find this documented anywhere. iOS 10 iOS 11 The code in both is this: UIView.animate(withDuration: DiscoverHeaderView.animationDuration, …
Infinity James
  • 4,667
  • 5
  • 23
  • 36
111
votes
9 answers

Adding a simple UIAlertView

What is some starter code I could use to make a simple UIAlertView with one "OK" button on it?
Linuxmint
  • 4,716
  • 11
  • 44
  • 64
111
votes
5 answers

How to remove the Xcode warning Apple Mach-O Linker Warning 'Pointer not aligned at address

I have a slight issue when build my Xcode project, get tones of warning after update pod. It looks like this Already search the whole site here but still no luck. it doesn't affect the project but it is quite annoying. Anyone could help?
Alexander Huang
  • 1,345
  • 2
  • 11
  • 16
111
votes
13 answers

Enterprise App Update Distribution on iOS 8

I have an enterprise app that I'm distributing via an itms URL: itms-services://?action=download-manifest&url=itms-services://?action=download-manifest&url=https://$MY_PLIST_URL.plist On iOS 7, both downloads and updates work fine. On iOS 8,…
Patrick Perini
  • 22,555
  • 12
  • 59
  • 88
111
votes
5 answers

iOS 7 TextKit - How to insert images inline with text?

I am trying to get the following effect using a UITextView: Basically I want to insert an image between text. The image can simply just take up 1 row of space so there is no wrapping necessary. I tried just adding a UIView to the subview: UIView…
Andy Hin
  • 30,345
  • 42
  • 99
  • 142
111
votes
13 answers

UITapGestureRecognizer tap on self.view but ignore subviews

I need to implement a feature that will invoke some code when I double tap on the self.view (view of UIViewController). But the problem that I have other UI object on this view and I don't want to attach any recognizer object to all of them. I found…
Matrosov Oleksandr
  • 25,505
  • 44
  • 151
  • 277
111
votes
12 answers

Change bundle identifier in Xcode when submitting my first app in IOS

I'm trying to submit my first app in iOS. I have entered iOS Provisioning Portal and I am about to create an app ID. Lets say that I name my bundle identifier: com.mycompany.appdemo Then going to Xcode and in the summary section I want to change…
ghostrider
  • 5,131
  • 14
  • 72
  • 120
111
votes
13 answers

No identities were available - administrator request

I had problems while "archiving" my app. I think there are invalid profiles because of iPhone Update to 5.1 and XCode update to 4.2.2. I've taken now more than 4 hours to get rid of certification issues while using this thread step by step 3 times…
Nasenbaer
  • 4,810
  • 11
  • 53
  • 86
110
votes
11 answers

iOS Detect 3G or WiFi

I am not sure if this is possible, but I have this scenario. I have a website displayed in my UIWebView which has the link set in a UISegmentedController. They website can detect if you are on wifi or on the 3g network. Now the segmented controller…
jwknz
  • 6,598
  • 16
  • 72
  • 115
110
votes
5 answers

iOS - How to set a UISwitch programmatically

I want to set my UISwitch to on or off programmatically. How would I do that? I am an iOS newbie.
Suchi
  • 9,989
  • 23
  • 68
  • 112
110
votes
15 answers

How to tell SwiftUI views to bind to nested ObservableObjects

I have a SwiftUI view that takes in an EnvironmentObject called appModel. It then reads the value appModel.submodel.count in its body method. I expect this to bind my view to the property count on submodel so that it re-renders when the property…
rjkaplan
  • 3,138
  • 5
  • 27
  • 33