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

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

221116 questions
49
votes
17 answers

Can you develop native iPhone apps in Ruby?

Hi I'm looking into iPhone development, and Objective-C is not be my preferred language. As far as I can see at this moment Ruby cannot be used to talk to Cocoa Touch at the moment on the iPhone. So my question is, am I wrong? Can I use Ruby on the…
BefittingTheorem
  • 9,859
  • 14
  • 63
  • 94
49
votes
3 answers

Inject system wide touch events on iOS7

Prior to iOS7 it was possible to inject touch events with the GSSendSystemEvent and GSSendEvent private API calls, eg: GSSendEvent - Inject Touch Event iOS Simulating System Wide Touch Events on iOS System-wide tap simulation on iOS Send a global…
Ben Dowling
  • 15,775
  • 8
  • 80
  • 100
49
votes
25 answers

iOS 7 status bar overlapping UI

I recently upgraded to xcode 5 and when I run my app in the iOS simulator the splash screen overlaps the status bar and when you are in the app the status bar overlaps onto elements on my app, like a back button I have on the top left hand corner of…
Automator21
  • 647
  • 2
  • 7
  • 11
49
votes
5 answers

Problem running iPhone application on iPhone from Xcode (and in Instruments)

I have a problem running one application on the iPhone from Xcode (or Instruments). When I try to run the app I get the error message Failed to upload XXX.app in the bottom left corner of Xcode. The strange thing is it actually uploaded the app to…
Ben
  • 1,622
  • 3
  • 19
  • 34
49
votes
12 answers

Removing a view controller from UIPageViewController

It's odd that there's no straightforward way to do this. Consider the following scenario: You have a page view controller with 1 page. Add another page (total 2) and scroll to it. What I want is, when the user scrolls back to the first page, the…
Snowman
  • 29,431
  • 43
  • 165
  • 290
49
votes
25 answers

UITextField for Phone Number

I was wondering how I can format the textField that I'm using for a phone number (ie like the "Add New Contact" page on the iPhone. When I enter in a new mobile phone, ex. 1236890987 it formats it as (123) 689-0987.) I already have the keyboard set…
None
49
votes
13 answers

AVAudioPlayer fade volume out

I have an AVAudioPlayer playing some audio (duh!) The audio is initiated when the user presses a button. When they release it I want the audio to fade out. I am using Interface builder...so I am trying to hook up a function on "touch up inside" that…
Jonathan
49
votes
5 answers

Access App Identifier Prefix programmatically

How can I access the Bundle Seed ID/Team ID/App Identifier Prefix string programmatically? (These are all the same thing as far as I can tell). I am using the UICKeychainStore keychain wrapper to persist data across several applications. Each of…
Jacob Jennings
  • 2,668
  • 1
  • 21
  • 26
48
votes
7 answers

How to add a view behind other view in iOS

I want to add a view under my tab bar analog in iOS and then show it with animation coming from behind it. But when I use my code, the view that must come from behind my tab bar overlaps my tab bar for a while. This is my code: -…
Denis Kutlubaev
  • 13,009
  • 6
  • 76
  • 67
48
votes
13 answers

How to decode the Google Directions API polylines field into lat long points in Objective-C for iPhone?

I want to draw routes on a map corresponding to directions JSON which I am getting through the Google Directions API: https://developers.google.com/maps/documentation/directions/start I have figured out how to extract the latitude and longitude…
Alan Moore
  • 6,347
  • 6
  • 50
  • 66
48
votes
6 answers

Deploy to iPhone without running

How do I deploy my app down to the iPhone (for testing purposes) from XCode without actually running the app?
Jason Marcell
  • 2,605
  • 5
  • 27
  • 39
48
votes
5 answers

Copy functionality in iOS by using UIPasteboard

NSString *copyStringverse = [[NSString alloc] initWithFormat:@"%@",[textview.text]]; UIPasteboard *pb = [UIPasteboard generalPasteboard]; [pb setString:copyStringverse]; I'm using above code for copying contents in textview, but I want to copy…
stackiphone
  • 1,245
  • 3
  • 19
  • 41
48
votes
5 answers

How do I scroll to a position programmatically in UIScrollView

I have a scroll view which scrolls horizontally. I just added images, labels and a webview in it and there are many objects in it. I want to directly scroll to the first object in the scroll view. How do I do this?
user1072740
  • 660
  • 1
  • 6
  • 10
48
votes
3 answers

iOS - Get CPU usage from application

Does anyone know how to obtain CPU usage for an application? It's definitely possible, because there are application in app store (Activity Monitor Touch) which can show it.
ivanzoid
  • 5,712
  • 2
  • 28
  • 43
48
votes
2 answers

RootViewController animation transition, initial orientation is wrong

So I followed this thread: RootViewController Switch Transition Animation to transit the window.rootViewController from A to B to C. Code looks like this: [UIView transitionWithView:self.window duration:0.5 …
Chris Chen
  • 4,948
  • 4
  • 41
  • 49
1 2 3
99
100