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

Animate UIButton state change

I'm using a UIButton with images for normal and highlighted states. They work as expected but I want to have some fading/merging transition and not just a sudden swap. How can I do that?
Johnny Everson
  • 8,343
  • 7
  • 39
  • 75
51
votes
1 answer

How to convert NSMutableData to NSString on iPhone?

I received an NSMutableData from a server and now I want to convert it to an NSString. Any ideas about how to do this?
Chilly Zhong
  • 16,763
  • 23
  • 77
  • 103
51
votes
4 answers

self.window.rootViewController vs window addSubview

I've noticed a lot of examples for iPhone apps in the Application Delegate - (void)applicationDidFinishLaunching:(UIApplication *)application have [window addSubview: someController.view]; (1) as opposed to self.window.rootViewController =…
Gazzer
  • 4,524
  • 10
  • 39
  • 49
51
votes
4 answers

How to target iPhone 3GS AND iPhone 4 in one media query?

I am trying to implement alternate layouts for both the iPad/iPhone and older iPhones as well. I have established that the best method is to use @media from the CSS3 spec. As such these are my media queries at the minute: @media screen and…
Myles Gray
  • 8,711
  • 7
  • 48
  • 70
51
votes
5 answers

Accessing Local file using NSURL

I am trying to access an XML file store in the resources directory. I am using NSURL to access this file using NSURLConnection( this file is going to be swapped out for a remote service in the future). NSURLRequest *request = [NSURLRequest…
botptr
  • 987
  • 3
  • 11
  • 18
51
votes
2 answers

Number of downloads of my app

Is there a way to find the number of downloads for my app in the iTunes App Store?
Madhumitha
  • 3,794
  • 8
  • 30
  • 45
51
votes
12 answers

How programmatically move a UIScrollView to focus in a control above keyboard?

I have 6 UITextFields on my UIScrollView. Now, I can scroll by user request. But when the keyboard appear, some textfields are hidden. That is not user-friendly. How scroll programmatically the view so I get sure the keyboard not hide the…
mamcx
  • 15,916
  • 26
  • 101
  • 189
51
votes
7 answers

Deleting all the files in the iPhone sandbox (documents folder)?

Is there an easy way to delete all the files(images) I saved in the documents folder of the app?
Jinah Adam
  • 1,125
  • 2
  • 14
  • 27
51
votes
6 answers

Find/Replace in Xcode using Regular Expression

I have the following function calls at several places in my class. [myClass doOperationOne]; [myClass doOperationTwo]; [myClass doOperationThree]; In those lines, I want to search for the following, [myClass doOperationOne [myClass…
EmptyStack
  • 51,274
  • 23
  • 147
  • 178
51
votes
8 answers

iPhone: How do I get the file path of an image saved with UIImageWriteToSavedPhotosAlbum()?

I'm saving a merged image to the iPhone photo library using: UIImageWriteToSavedPhotosAlbum(viewImage, self, @selector(savedPhotoImage:didFinishSavingWithError:contextInfo:), nil); And getting the callback using: - (void)…
Ben
  • 1,565
  • 1
  • 10
  • 11
51
votes
12 answers

How to draw a "speech bubble" on an iPhone?

I'm trying to get a "speech bubble" effect similar to the one in Mac OS X when you right click on something in the dock. Here's what I have now: I need to get the "triangle" part of the lower portion. Is there any way I can draw something like…
sudo rm -rf
  • 29,408
  • 19
  • 102
  • 161
51
votes
7 answers

Force iphone app to restart programmatically?

I am trying to get my iPhone app to restart programmatically when the Logout button is pressed. Has anyone got a code sample to share? I've read that it is possible by modifying the main.m file but I couldn't find any code related to this. Any help…
manospro
  • 799
  • 1
  • 6
  • 16
51
votes
9 answers

How to get Duration from AVPlayer (Not AVAudioPlayer)?

I would like to make a UISlider(scrubber) for my AVPlayer. But since this is not an AVAudioPlayer, it doesn't have a built in duration. Any suggestion on how to create the Slider for fast forward, rewind and progress of the playback? I read the doc…
slowman21
  • 2,505
  • 3
  • 20
  • 20
51
votes
2 answers

Selector syntax for swift 3.0

I am trying to add target into button this way: btnAll.addTarget(self, action: #selector(buttonTapped(_:)), for: .touchUpInside) But it is giving me an error: Use of unresolved identifier 'buttonTapped' But I declared function like: func…
Ram Mani
  • 1,009
  • 1
  • 10
  • 15
51
votes
9 answers

Date Picker for iPhone Web Application

What is best way to show Date Picker for iPhone based Web Application. Can we show something like iPhone native date picker like shown below in web application:
Ramesh Soni
  • 15,867
  • 28
  • 93
  • 113