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
109
votes
14 answers

How to compress of reduce the size of an image before uploading to Parse as PFFile? (Swift)

I was trying to upload an image file to Parse after taking photo directly on phone. But it throws an exception: Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'PFFile cannot be larger than 10485760 bytes' Here is…
elvislkm
  • 1,165
  • 2
  • 8
  • 9
109
votes
12 answers

Determine if the access to photo library is set or not - PHPhotoLibrary

With the new functionality in iOS 8, if you are using a camera in the app, it will ask for permission to access the camera and then when you try to retake the pic, it asks for permission to access photo library. Next time when I launch the app, I…
tech_human
  • 6,592
  • 16
  • 65
  • 107
109
votes
17 answers

Simple and clean way to convert JSON string to Object in Swift

I have been searching for days to convert a fairly simple JSON string to an object type in Swift but with no avail. Here is the code for web service call: func GetAllBusiness() { Alamofire.request(.GET,…
Hasan Nizamani
  • 1,093
  • 2
  • 7
  • 6
109
votes
11 answers

Check for internet connection availability in Swift

Is there a way to check if the internet connection is available using Swift? I know there are many third party libraries to do this but they are all written in Objective-C. I'm looking for a Swift alternative.
Isuru
  • 30,617
  • 60
  • 187
  • 303
109
votes
7 answers

How to set the width of a cell in a UITableView in grouped style

I have been working on this for about 2 days, so i thought i share my learnings with you. The question is: Is it possible to make the width of a cell in a grouped UITableView smaller? The answer is: No. But there are two ways you can get around this…
Tomen
  • 4,854
  • 5
  • 28
  • 39
109
votes
23 answers

Sqlite File Location Core Data

Typically, the sqlite store file for core data apps is located in Library>Application Support>iPhone Simulator>7.1(or whichever version you are using)>Applications>(Whichever folder contains your app)>Documents folder, but I can't find it in IOS…
enlyte
  • 2,757
  • 3
  • 13
  • 13
109
votes
6 answers

Remove iOS input shadow

On iOS (Safari 5) I have to following for input element (top inner shadow): I want to remove top shadow, bug -webkit-appearance doesn't save. Current style is: input { border-radius: 15px; border: 1px dashed #BBB; padding: 10px; …
WHITECOLOR
  • 24,996
  • 37
  • 121
  • 181
109
votes
14 answers

iOS 7 - Status bar overlaps the view

I have a ViewController which is inside a UINavigationcontroller, but the navigationBar is hidden. When I run the app on iOS 7, the status bar shows on top of my view. Is there a way to avoid this? I don't want to write any OS specific code. I…
aryaxt
  • 76,198
  • 92
  • 293
  • 442
109
votes
4 answers

What does get-task-allow do in Xcode?

When I set up my entitlements in my iPhone app project, I create a new Entitlements.plist, and set the value of get-task-allow to false. But why? What does this key represent? Note this is related to Application could not be verified error when…
Codebeef
  • 43,508
  • 23
  • 86
  • 119
108
votes
7 answers

UITextField - capture return button event

How can I detect when a user pressed "return" keyboard button while editing UITextField? I need to do this in order to dismiss keyboard when user pressed the "return" button. Thanks.
Ilya Suzdalnitski
  • 52,598
  • 51
  • 134
  • 168
108
votes
6 answers

AVAudioPlayer throws breakpoint in debug mode

Every time I load the app it stops as if I had set a breakpoint on this line: self.audioPlayer = [[[AVAudioPlayer alloc] initWithData:[dataPersister loadData:self.fileName] error:&outError] autorelease]; There's…
ThomasCle
  • 6,792
  • 7
  • 41
  • 81
108
votes
10 answers

How do you add an action to a button programmatically in xcode

I know how to add an IBAction to a button by dragging from the interface builder, but I want to add the action programmatically to save time and to avoid switching back and forth constantly. The solution is probably really simple, but I just can't…
aggiesfan64
  • 1,133
  • 2
  • 7
  • 8
108
votes
16 answers

The selected run destination is not valid for this action

I have opened a project that has always been iphone/ipad. I can't build it now because for some reason my only "Scheme" option is "MyApp My Mac 64-bit". How can I get this set back to iphone/ipad simulator and devices? My "Targeted Device Family"…
sol
  • 6,402
  • 13
  • 47
  • 57
108
votes
1 answer

Xcode 10b5 - duplicate symbol linker error, can't compile with Crashlytics

I'm trying to compile my project, which has both Firebase, Crashlytics/Fabric, and a bunch of other stuff, with Xcode 10 beta 5. It fails during linking with these errors: Ld…
xaphod
  • 6,392
  • 2
  • 37
  • 45
108
votes
8 answers

change text of button and disable button in iOS

How do you change the text of the button and disable a button in iOS?
Namratha
  • 16,630
  • 27
  • 90
  • 125
1 2 3
99
100