Questions tagged [iphone]

DO NOT use this tag unless you are addressing Apple's iPhone and/or iPod touch specifically. For questions not dependent on hardware, use the tag [ios]. More tags to consider are [xcode] (but only if the question is about the IDE itself), [swift], [objective-c] or [cocoa-touch] (but not [cocoa]). Please refrain from questions regarding the iTunes App Store or about iTunes Connect. If using C#, tag with [mono].

The iPhone is a smartphone made by Apple Inc. It was first launched on June 29, 2007, and has since been through several major hardware and software revisions. The iPhone, iPad, and iPod touch each run iOS (previously iPhone OS). Native iOS applications are written in Objective-C or in Swift since the release of iOS8, using the Cocoa Touch frameworks. These frameworks are distinct from Cocoa which is used exclusively for macOS development, though the two frameworks share many classes and features.

Most questions related to iPhone are also applicable to iPod touch devices since they support similar resolutions, input methods and features.

In all cases, questions that are specific to the features of a particular device should use the appropriate tag. Please refrain from questions regarding the App Store.

The iPhone has several hardware features and sensors which are accessible to native applications (and in some cases, to web apps via special APIs), including:

  • 3-axis accelerometer
  • 3-axis gyroscope
  • Magnetometer
  • GPS and A-GPS
  • Proximity sensor
  • Microphone, speaker, and headphone port
  • Front (since iPhone 4) and rear cameras, and LED flash
  • Lightning Dock Connector (iPhone 5 and above and iPod Touch 5th generation and above) and 30-pin dock connector (all others)
  • Fingerprint recognition system (Touch ID introduced with iPhone 5s)
  • Barometer (Introduced along with iPhone 6)
  • Multi-Touch touchscreen display (3D Touch introduced with iPhone 6s)
  • Dual Camera (iPhone 7 Plus, iPhone 8 Plus, iPhone X)
  • Face recognition system (Face ID introduced with iPhone X)

While native iPhone and iPod touch applications use the Cocoa Touch frameworks and are developed using the Xcode IDE, and questions about classes that exist in both Cocoa and Cocoa Touch can accurately wear both tags, most questions should use only one or the other.


Models

  • iPhone (1st generation)
  • iPhone 3G
  • iPhone 3GS
  • iPhone 4
  • iPhone 4S
  • iPhone 5
  • iPhone 5C
  • iPhone 5S
  • iPhone SE
  • iPhone 6
  • iPhone 6 Plus
  • iPhone 6S
  • iPhone 6S Plus
  • iPhone 7
  • iPhone 7 Plus
  • iPhone 8
  • iPhone 8 Plus
  • iPhone X
  • iPhone XS
  • iPhone XS Max
  • iPhone XR
  • iPhone 11
  • iPhone 11 Pro
  • iPhone 11 Pro Max
  • iPhone 12
  • iPhone 12 mini
  • iPhone 12 Pro
  • iPhone 12 Pro Max
  • iPhone 13
  • iPhone 13 mini
  • iPhone 13 Pro
  • iPhone 13 Pro Max

Resources

Apple Official Documentations

Books

  • Apress - Beginning iOS 6 development
  • Apress - Learn Objective-C on the Mac
  • Oreilly - iPhone App Development The Missing Manual
  • Objective-C Programming: The Big Nerd Ranch Guide
  • iOS 7 by Tutorials
  • Beginning iPhone SDK Programming with Objective-C

Blogs with Good Tutorials Collection

FAQ


Related Tags

221329 questions
342
votes
17 answers

iPhone App Icons - Exact Radius?

I'm trying to create the icon for my iPhone app, but don't know how to get the exact radius that the iPhone's icons use. I've searched and searched for a tutorial or a template but can't find one. I'm sure that I'm just a moron, but how do you get…
Frank Barson
  • 3,449
  • 3
  • 16
  • 4
339
votes
22 answers

Color Tint UIButton Image

I noticed that when I place a white or black UIImage into a UISegmentedControl it automatically color masks it to match the tint of the segmented control. I thought this was really cool, and was wondering if I could do this elsewhere as well. For…
Logan Shire
  • 5,013
  • 4
  • 29
  • 37
337
votes
9 answers

Programmatically get own phone number in iOS

Is there any way to get own phone number by standard APIs from iPhone SDK?
Vadim
  • 9,383
  • 7
  • 36
  • 58
327
votes
15 answers

How to hide 'Back' button on navigation bar on iPhone?

I added a navigation control to switch between views in my app. But some of the views shouldn't have 'Back' (the previous title) button. Any ideas about how to hide the back button?
Chilly Zhong
  • 16,763
  • 23
  • 77
  • 103
319
votes
18 answers

Detect current device with UI_USER_INTERFACE_IDIOM() in Swift

What is the equivalent of UI_USER_INTERFACE_IDIOM() in Swift to detect between iPhone and iPad? I get an Use of unresolved identifier error when compiling in Swift.
Berry Blue
  • 15,330
  • 18
  • 62
  • 113
318
votes
7 answers

Why does viewWillAppear not get called when an app comes back from the background?

I'm writing an app and I need to change the view if the user is looking at the app while talking on the phone. I've implemented the following method: - (void)viewWillAppear:(BOOL)animated { [super viewWillAppear:animated]; …
Philip Walton
  • 29,693
  • 16
  • 60
  • 84
317
votes
23 answers

UITableview: How to Disable Selection for Some Rows but Not Others

I am displaying in a group tableview contents parsed from XML. I want to disable the click event on it (I should not be able to click it at all) The table contains two groups. I want to disable selection for the first group only but not the second…
Warrior
  • 39,156
  • 44
  • 139
  • 214
312
votes
35 answers

Adding images or videos to iPhone Simulator

I am trying to use UIImagePickerController with UIImagePickerControllerSourceTypePhotoLibrary, but it says, "No photos". Where does the simulator get the images from? Where should I copy the images so that they are displayed in the simulator?
Vijayeta
  • 5,585
  • 5
  • 21
  • 11
310
votes
14 answers

Comparison between Corona, Phonegap, Titanium

I am a web developer and I want to move my web products to iPhone. One of the products is like Google Maps: show map on the phone screen, you can drag or resize the map and view some information that we add to the map. I know there are some…
Mickey Shine
  • 12,187
  • 25
  • 96
  • 148
304
votes
8 answers

How to Sync iPhone Core Data with web server, and then push to other devices?

I have been working on a method to sync core data stored in an iPhone application between multiple devices, such as an iPad or a Mac. There are not many (if any at all) sync frameworks for use with Core Data on iOS. However, I have been thinking…
Jason
  • 14,517
  • 25
  • 92
  • 153
302
votes
15 answers

Capturing mobile phone traffic on Wireshark

How can I capture mobile phone traffic on Wireshark?
Xara
  • 8,748
  • 16
  • 52
  • 82
302
votes
24 answers

How to detect iPhone 5 (widescreen devices)?

I've just upgraded to Xcode 4.5 GM and found out that you can now apply the '4" Retina' size to your view controller in the storyboard. Now if I want to create an application that runs on both iPhone 4 and 5, of course I have to build every window…
Finn Gaida
  • 4,000
  • 4
  • 20
  • 30
297
votes
10 answers

How can we programmatically detect which iOS version is device running on?

I want to check if the user is running the app on iOS less than 5.0 and display a label in the app. How do I detect which iOS is running on user's device programmatically? Thanks!
meetpd
  • 9,150
  • 21
  • 71
  • 119
293
votes
24 answers

Creating a left-arrow button (like UINavigationBar's "back" style) on a UIToolbar

I'd love to create a "back" left-arrow-bezel button in a UIToolbar. As far as I can tell, the only way to get one of these is to leave UINavigationController at default settings and it uses one for the left bar item. But there's no way I can find to…
Marco
  • 14,977
  • 7
  • 36
  • 33
291
votes
24 answers

Proper way to exit iPhone application?

I am programming an iPhone app, and I need to force it to exit due to certain user actions. After cleaning up memory the app allocated, what's the appropriate method to call to terminate the application?
user21293
  • 6,439
  • 11
  • 44
  • 57