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.

iOS is a mobile operating system created and developed by Apple Inc. exclusively for its hardware. It is the operating system that presently powers many of the company's mobile devices, including the iPhone, iPad, and iPod Touch.

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 14.3 (18C66) released on December 14, 2020

Latest Preview: iOS 14.4 beta 1 (18D5030e) released on December 16, 2020

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.

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 is available in Swift and Objective-C.

Before asking about a topic, just search it in https://developer.apple.com/documentation/ also, which is the developer documentation provided by the apple which 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:

656272 questions
579
votes
32 answers

iPhone UITextField - Change placeholder text color

I'd like to change the color of the placeholder text I set in my UITextField controls, to make it black. I'd prefer to do this without using normal text as the placeholder and having to override all the methods to imitate the behaviour of a…
adam
  • 21,709
  • 20
  • 83
  • 117
571
votes
18 answers

UITableViewCell, show delete button on swipe

How do I get the delete button to show when swiping on a UITableViewCell? The event is never raised and the delete button never appears.
TheLearner
  • 18,967
  • 35
  • 92
  • 162
571
votes
7 answers

Convert UTF-8 encoded NSData to NSString

I have UTF-8 encoded NSData from windows server and I want to convert it to NSString for iPhone. Since data contains characters (like a degree symbol) which have different values on both platforms, how do I convert data to string?
Ashwini Shahapurkar
  • 6,516
  • 6
  • 25
  • 35
566
votes
26 answers

Presenting modal in iOS 13 fullscreen

In iOS 13 there is a new behaviour for modal view controller when being presented. Now it's not fullscreen by default and when I try to slide down, the app just dismiss the View Controller automatically. How can I prevent this behaviour and get back…
pascalbros
  • 14,501
  • 5
  • 21
  • 34
566
votes
6 answers

In Objective-C, how do I test the object type?

I need to test whether the object is of type NSString or UIImageView. How can I accomplish this? Is there some type of "isoftype" method?
James Skidmore
  • 44,302
  • 30
  • 104
  • 135
559
votes
11 answers

Should IBOutlets be strong or weak under ARC?

I am developing exclusively for iOS 5 using ARC. Should IBOutlets to UIViews (and subclasses) be strong or weak? The following: @property (nonatomic, weak) IBOutlet UIButton *button; Would get rid of all of this: - (void)viewDidUnload { // ... …
558
votes
34 answers

UIScrollView Scrollable Content Size Ambiguity

Fellow devs, I am having trouble with AutoLayout in Interface Builder (Xcode 5 / iOS 7). It's very basic and important so I think everyone should know how this properly works. If this is a bug in Xcode, it is a critical one! So, whenever I have a…
Wirsing
  • 6,104
  • 3
  • 13
  • 13
557
votes
48 answers

How can I create a UIColor from a hex string?

How can I create a UIColor from a hexadecimal string format, such as #00FF00?
Rupesh
  • 7,566
  • 11
  • 38
  • 55
544
votes
21 answers

The resource could not be loaded because the App Transport Security policy requires the use of a secure connection

I am facing the Problem when I have updated my Xcode to 7.0 or iOS 9.0. Somehow it started giving me the Titled error "The resource could not be loaded because the App Transport Security policy requires the use of a secure connection" Webservice…
Manab Kumar Mal
  • 19,410
  • 5
  • 29
  • 43
539
votes
41 answers

How do I size a UITextView to its content?

Is there a good way to adjust the size of a UITextView to conform to its content? Say for instance I have a UITextView that contains one line of text: "Hello world" I then add another line of text: "Goodbye world" Is there a good way in Cocoa…
drewh
  • 9,795
  • 7
  • 30
  • 41
539
votes
17 answers

Starting iPhone app development in Linux?

I've heard that you need to get a Mac if you want to develop iPhone apps. Is this true? Is it possible to develop iPhone apps using Linux? If yes, what do I need and where do I download the necessary tools?
javac
  • 5,531
  • 4
  • 16
  • 6
534
votes
18 answers

How to programmatically send SMS on the iPhone?

Does anybody know if it's possible, and how, to programmatically send a SMS from the iPhone, with the official SDK / Cocoa Touch?
Marco
527
votes
16 answers

How to get the screen width and height in iOS?

How can one get the dimensions of the screen in iOS? Currently, I use: lCurrentWidth = self.view.frame.size.width; lCurrentHeight = self.view.frame.size.height; in viewWillAppear: and willAnimateRotationToInterfaceOrientation:duration: The first…
griotspeak
  • 12,532
  • 12
  • 38
  • 54
521
votes
22 answers

How to lose margin/padding in UITextView?

I have a UITextView in my iOS Application, which displays a large amount of text. I am then paging this text by using the offset margin parameter of the UITextView. My problem is that the padding of the UITextView is confusing my calculations as it…
sniurkst
  • 6,752
  • 5
  • 28
  • 30
511
votes
35 answers

How would I create a UIAlertView in Swift?

I have been working to create a UIAlertView in Swift, but for some reason I can't get the statement right because I'm getting this error: Could not find an overload for 'init' that accepts the supplied arguments Here is how I have it…
BlueBear
  • 7,039
  • 6
  • 29
  • 43