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
114
votes
4 answers

What is Prefix.pch file in Xcode?

So many developers are adding various convenience macros to the Prefix.pch. But my question is what is that Prefix.pch file. If i remove that Prefix.pch file from my Xcode, then will my application run? Or will it show any error? Or will it crash…
Soumya Ranjan
  • 4,817
  • 2
  • 26
  • 51
114
votes
15 answers

When to use UICollectionView instead of UITableView?

I found that UICollectionView is like an upgraded version of UITableView introduced in iOS6, but when should I choose UICollectionView instead of UITableView? There are still Apps using UITableView, if UICollectionView can do anything UITableView…
wz366
  • 2,840
  • 6
  • 25
  • 34
114
votes
9 answers

iOS 7 parallax effect in my view controller

I'm developing an app for iOS 7 in Objective-C. I've got a screen in my app with a few buttons and a pretty background image. (It's a simple xib with UIButtons on top of a UIImageView.) I was thinking that it'd be cool if those buttons had the…
Dan Fabulich
  • 37,506
  • 41
  • 139
  • 175
114
votes
9 answers

Navigation bar appear over the views with new iOS7 SDK

CGRect cgRect1 = [[UIScreen mainScreen] applicationFrame]; UISearchBar *mySearchBar = [[UISearchBar alloc] initWithFrame:CGRectMake(0, 0, cgRect.size.width, 40)]; mySearchBar.autoresizingMask = …
user2110287
114
votes
5 answers

UITableView with fixed section headers

Greets, I'm reading that the default behaviour of UITableView is to pin section header rows to the top of the table as you scroll through the sections until the next section pushes the previos section row out of view. I have a UITableView inside a…
topwik
  • 3,487
  • 8
  • 41
  • 65
114
votes
29 answers

Is it possible to use AutoLayout with UITableView's tableHeaderView?

Since I discovered AutoLayout I use it everywhere, now I'm trying to use it with a tableHeaderView. I made a subclass of UIView added everything (labels etc...) I wanted with their constraints, then I added this CustomView to the…
ItsASecret
  • 2,589
  • 3
  • 19
  • 32
114
votes
13 answers

Changing UIImage color

I'm trying to change color of UIImage. My code: -(UIImage *)coloredImage:(UIImage *)firstImage withColor:(UIColor *)color { UIGraphicsBeginImageContext(firstImage.size); CGContextRef context = UIGraphicsGetCurrentContext(); [color…
RomanHouse
  • 2,552
  • 3
  • 23
  • 44
114
votes
11 answers

When is it better to use an NSSet over an NSArray?

I have used NSSets many times in my apps, but I have never created one myself. When is it better to use an NSSet as opposed to an NSArray and why?
geminiCoder
  • 2,918
  • 2
  • 29
  • 50
113
votes
7 answers

How to load a xib file in a UIView

I have been searching everywhere and nothing so far has worked for me. Basically I want to have a .xib file called rootView.xib and inside it I want to have a UIView (lets call it containerView) that takes up only half of the screen (so there would…
Matt
  • 2,920
  • 6
  • 23
  • 33
113
votes
6 answers

Status bar could not find cached time string image. Rendering in-process

I get the above runtime message after I upgraded to Swift4.1 and Xcode 9.3. Before the upgrade I did not have this message in my console window. Status bar could not find cached time string image. Rendering in-process. comes up every few minutes…
mac_eric
  • 1,230
  • 3
  • 12
  • 12
113
votes
2 answers

What is the difference between libsqlite3.dylib and libsqlite3.0.dylib?

I'm getting started with SQLite databases in an app I'm working on. I've not run into issues yet but one of the early steps from this tutorial is linking the SQLite3 framework. The tutorial calls for libsqlite3.0.dylib but I noticed another one…
earnshavian
  • 1,864
  • 2
  • 13
  • 17
113
votes
12 answers

Xcode 6.4 The Application You Have Selected Does Not Exist

I am trying to submit to iTunes Connect with Xcode 6.4. I am getting this error Unable to Validate Your Application The application you have selected does not exist. I am able to find the provisioning profile through my dev account on the…
mfossat
  • 1,229
  • 2
  • 9
  • 8
113
votes
2 answers

How to check what a String starts with (prefix) or ends with (suffix) in Swift

I'm trying to test if a Swift string starts or ends with a certain value. These methods do not exist: var str = "Hello, playground" str.startsWith("Hello") // error str.endsWith("ground") // error I would also like to get the prefix and suffix…
Suragch
  • 484,302
  • 314
  • 1,365
  • 1,393
113
votes
17 answers

How to compare two strings ignoring case in Swift language?

How can we compare two strings in swift ignoring case ? for eg : var a = "Cash" var b = "cash" Is there any method that will return true if we compare var a & var b
ak_tyagi
  • 1,552
  • 2
  • 12
  • 20
113
votes
7 answers

Swift GET request with parameters

I'm very new to swift, so I will probably have a lot of faults in my code but what I'm trying to achieve is send a GET request to a localhost server with paramters. More so I'm trying to achieve it given my function take two parameters…
MrSSS16
  • 1,133
  • 2
  • 8
  • 4