Questions tagged [ios8]
iOS 8 is the eighth version of Apple's iOS mobile operating system. It was announced at the company's Apple Worldwide Developers Conference (WWDC) on June 2, 2014 and was released to the public on September 17, 2014. The ios8 tag should be used for questions specific to Apple's iOS 8 operating system. General iOS questions should use the ios tag.
ios8
9,285
questions
686
votes
43
answers
188k
views
iOS 8 UITableView separator inset 0 not working
I have an app where the UITableView's separator inset is set to custom values - Right 0, Left 0. This works perfectly in iOS 7.x, however in iOS 8.0 I see that the separator inset is set to the ...
623
votes
26
answers
286k
views
Location Services not working in iOS 8
My app that worked fine on iOS 7 doesn't work with the iOS 8 SDK.
CLLocationManager doesn't return a location, and I don't see my app under Settings -> Location Services either. I did a ...
503
votes
25
answers
320k
views
Capture iOS Simulator video for App Preview
Okay, so we can now submit video previews of our apps on the App Store. According to Apple we should do so with an iOS8 device and OSX 10.10. The problem is you have to have all the different devices (...
334
votes
4
answers
119k
views
What's the difference between all the Selection Segues?
Show
Show Detail
Present Modally
Popover presentation
Custom
What is the difference between them? I couldn't find any documentation on it. There used to be some which I found in a Google search, but ...
322
votes
10
answers
101k
views
Automatic Preferred Max Layout Width is not available on iOS versions prior to 8.0
I opened an existing iOS project with Xcode6 beta6, and Xcode lists the following warning for both Storyboard and Xib files:
Automatic Preferred Max Layout Width is not available on iOS versions
...
312
votes
35
answers
374k
views
Reading in a JSON File Using Swift
I'm really struggling with trying to read a JSON file into Swift so I can play around with it. I've spent the best part of 2 days re-searching and trying different methods but no luck as of yet so I ...
295
votes
16
answers
145k
views
NSRange to Range<String.Index>
How can I convert NSRange to Range<String.Index> in Swift?
I want to use the following UITextFieldDelegate method:
func textField(textField: UITextField!,
...
293
votes
29
answers
208k
views
Error Domain=NSURLErrorDomain Code=-1005 "The network connection was lost."
I have an application which works fine on Xcode6-Beta1 and Xcode6-Beta2 with both iOS7 and iOS8. But with Xcode6-Beta3, Beta4, Beta5 I'm facing network issues with iOS8 but everything works fine on ...
247
votes
15
answers
347k
views
How to create a String with format?
I need to create a String with format which can convert Int, Int64, Double, etc types into String. Using Objective-C, I can do it by:
NSString *str = [NSString stringWithFormat:@"%d , %f, %ld, %@&...
234
votes
37
answers
311k
views
Changing the Status Bar Color for specific ViewControllers using Swift in iOS8
override func preferredStatusBarStyle() -> UIStatusBarStyle {
return UIStatusBarStyle.LightContent;
}
Using the above code in any ViewController to set the statusBar color to White for a specific ...
233
votes
24
answers
417k
views
How to call gesture tap on UIView programmatically in swift
I have a UIView and and I have added tap gesture to it:
let tap = UITapGestureRecognizer(target: self, action: Selector("handleTap:"))
tap.delegate = self
myView.addGesture(tap)
I am trying to call ...
230
votes
20
answers
115k
views
iOS 8 Snapshotting a view that has not been rendered results in an empty snapshot
In iOS 8 I am having problem capturing images from camera till now I am using this code for
UIImagePickerController *controller=[[UIImagePickerController alloc] init];
controller.videoQuality=...
210
votes
15
answers
104k
views
registerForRemoteNotificationTypes: is not supported in iOS 8.0 and later
When trying to register for push notifications under iOS 8.x:
application.registerForRemoteNotificationTypes(UIRemoteNotificationType.Alert | UIRemoteNotificationType.Badge | UIRemoteNotificationType....
194
votes
8
answers
103k
views
How to enable native resolution for apps on iPhone 6 and 6 Plus?
Xcode 6 GM now includes simulators for iPhone 6 and 6 Plus, and by default they run apps in a scaled mode.
To enable the new screen size I tried adding [email protected] which seems to do a part of ...
192
votes
18
answers
258k
views
NavigationBar bar, tint, and title text color in iOS 8
The background text in the status bar is still black. How do I change the color to white?
// io8, swift, Xcode 6.0.1
override func viewDidLoad() {
super.viewDidLoad()
self....
187
votes
3
answers
132k
views
Base64 Decoding in iOS 7+
I have Encoded text(NSString) using NSData Class new API which is Added in iOS7.
using this
- (NSData *)dataUsingEncoding:(NSStringEncoding)encoding;
here is my code
NSString *...
187
votes
15
answers
65k
views
UISplitViewController in portrait on iPhone shows detail VC instead of master
I am using a Universal Storyboard in Xcode 6, targeting iOS 7 and above. I've implemented a UISplitViewController which is now natively supported on iPhone running iOS 8, and Xcode will automatically ...
186
votes
18
answers
90k
views
Is [UIScreen mainScreen].bounds.size becoming orientation-dependent in iOS8?
I ran the following code in both iOS 7 and iOS 8:
UIInterfaceOrientation orientation = [[UIApplication sharedApplication] statusBarOrientation];
BOOL landscape = (orientation == ...
172
votes
25
answers
217k
views
Can I set the cookies to be used by a WKWebView?
I'm trying to switch an existing app from UIWebView to WKWebView. The current app manages the users login / session outside of the webview and sets the cookies required for authentication into the the ...
164
votes
12
answers
231k
views
Custom UITableViewCell from nib in Swift
I'm trying to create a custom table view cell from a nib. I'm referring to this article here. I'm facing two issues.
I created a .xib file with a UITableViewCell object dragged on to it. I created a ...
161
votes
5
answers
88k
views
What is an "unwrapped value" in Swift?
I'm learning Swift for iOS 8 / OSX 10.10 by following this tutorial, and the term "unwrapped value" is used several times, as in this paragraph (under Objects and Class):
When working with ...
160
votes
12
answers
56k
views
Autoresizing issue of UICollectionViewCell contentView's frame in Storyboard prototype cell (Xcode 6, iOS 8 SDK) happens when running on iOS 7 only
I'm using Xcode 6 Beta 3, iOS 8 SDK. Build Target iOS 7.0 using Swift. Please refer to my problem step by step with screenshots below.
I have a UICollectionView in Storyboard. 1 Prototype ...
156
votes
8
answers
42k
views
Why is UICollectionViewCell's outlet nil?
I have created a custom UICollectionViewCell in Interface Builder, binded views on it to the class, and then when I want to use and set a string to the label on the string, tha label has a nil value.
...
155
votes
25
answers
158k
views
How to force view controller orientation in iOS 8?
Before iOS 8, we used below code in conjunction with supportedInterfaceOrientations and shouldAutoRotate delegate methods to force app orientation to any particular orientation. I used below code ...
149
votes
28
answers
129k
views
Launch Image does not show up in my iOS App
I want to get a simple launch screen to show in my app, built using Xcode 6.0.1.
I have added a launch screen in two ways: As an XIB (with the default name, LaunchScreen.xib) and as a launchimage set ...
147
votes
3
answers
86k
views
Obtain bundle identifier programmatically in Swift?
How can I get the bundle ID in Swift?
Objective-C version:
NSString *bundleIdentifier = [[NSBundle mainBundle] bundleIdentifier];
144
votes
18
answers
97k
views
Xcode 6 - How to pick signing certificate/provisioning profile for Ad-Hoc distribution?
To distribute the app to our testers we use Xcode, which we do using the following process:
Archive application
Distribute for Ad-Hoc
Choose provisioning profile
Save the .ipa to a folder
But with ...
142
votes
7
answers
64k
views
Rotation methods deprecated, equivalent of 'didRotateFromInterfaceOrientation'?
I'm trying to implement the new viewWillTransitionToSize method which has been introduced in iOS 8 (all other rotation methods have been deprecated). I'd like to know what the equivalent of ...
137
votes
16
answers
119k
views
Xcode 6 iPhone Simulator Application Support location
In Xcode 6, I have an app I'm using Core Data in, but there is no folder in Application Support for the iOS 8 iPhone Simulator. Where are my files and Core Data sqlite database being stored?
137
votes
16
answers
152k
views
Can't find keyplane that supports type 4 for keyboard iPhone-Portrait-NumberPad; using 3876877096_Portrait_iPhone-Simple-Pad_Default
I've downloaded iOS 8 Gold Master for the iPhone and the SDK.
I tested the app and it works fine, except for one thing.
I have a text field where a number pad will appear if the user wants to type ...
135
votes
11
answers
116k
views
Xcode iOS 8 Keyboard types not supported
I have a UITextField Ctrl-dragged as an @Outlet in my .swift class.
Now in viewDidLoad i'm using this code
self.myTextField.keyboardType = UIKeyboardType.DecimalPad
When i launch my app on simulator ...
132
votes
30
answers
75k
views
UITableView dynamic cell heights only correct after some scrolling
I have a UITableView with a custom UITableViewCell defined in a storyboard using auto layout. The cell has several multiline UILabels.
The UITableView appears to properly calculate cell heights, but ...
131
votes
10
answers
98k
views
Is it possible to obtain a dynamic table view section header height using Auto Layout?
New in iOS 8, you can obtain 100% dynamic table view cells by simply setting the estimated row height, then layout your elements in the cell using Auto Layout. If the content increases in height, the ...
129
votes
14
answers
87k
views
WKWebView not loading local files under iOS 8
For previous iOS 8 betas, load a local web app (in Bundle) and it works fine for both UIWebView and WKWebView, and I even ported a web game using the new WKWebView API.
var url = NSURL(...
128
votes
24
answers
208k
views
UIAlertController custom font, size, color
I am using new UIAlertController for showing alerts. I have this code:
// nil titles break alert interface on iOS 8.0, so we'll be using empty strings
UIAlertController *alert = [UIAlertController ...
128
votes
6
answers
58k
views
What is the entry point of swift code execution?
There is no main() method in swift. The program must start the execution from somewhere. So what is the entry point of swift code execution and how is it decided?
120
votes
13
answers
198k
views
How to present popover properly in iOS 8
I'm trying to add a UIPopoverView to my Swift iOS 8 app, but I am unable to access the PopoverContentSize property, as the popover does not show in the correct shape. my code:
var popover: ...
120
votes
7
answers
76k
views
Adaptive segue in storyboard Xcode 6. Is push deprecated?
Xcode 6 interface builder by default has new checkbox "use size classes". It makes views adaptive.
When I try to make segue between 2 views in my storyboard I have new options:
instead old:...
115
votes
5
answers
65k
views
Ask for User Permission to Receive UILocalNotifications in iOS 8
I have set up local notifications in the App Delegate Using this:
- (void)applicationDidEnterBackground:(UIApplication *)application
{
UILocalNotification *notification = [[UILocalNotification ...
113
votes
11
answers
145k
views
Disable a Button
I want to disable a button (UIButton) on iOS after it is clicked. I am new to developing for iOS but I think the equivalent code on objective - C is this:
button.enabled = NO;
But I couldn't do that ...
111
votes
4
answers
77k
views
Why can't I call the default super.init() on UIViewController in Swift?
I am not using a UIViewController from a storyboard and I want to have a custom init function where I pass in an NSManagedObjectID of some object. I just want to call super.init() like I have in ...
111
votes
13
answers
51k
views
Enterprise App Update Distribution on iOS 8
I have an enterprise app that I'm distributing via an itms URL:
itms-services://?action=download-manifest&url=itms-services://?action=download-manifest&url=https://$MY_PLIST_URL.plist
On iOS ...
110
votes
12
answers
120k
views
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 ...
107
votes
5
answers
74k
views
What is the "right" way to handle orientation changes in iOS 8?
Can someone please tell me the "right" or "best" approach to working with portrait and landscape interface orientations in iOS 8? It seems that all the functions I want to use for that purpose are ...
106
votes
16
answers
56k
views
Attributed string with custom fonts in storyboard does not load correctly
We are using custom fonts in our project. It works well in Xcode 5. In Xcode 6, it works in plain text, attributed string in code. But those attributed strings set in storyboard all revert to ...
104
votes
14
answers
17k
views
Custom Font Sizing in Xcode 6 Size Classes not working properly with Custom Fonts
Xcode 6 has a new feature where fonts and font sizes in UILabel, UITextField, and UIButton can be set automatically based on the size class of the current device configuration, right in the storyboard....
103
votes
26
answers
125k
views
How to check validity of URL in Swift?
Trying to make an app launch the default browser to a URL, but only if the URL entered is valid, otherwise it displays a message saying the URL is invalid.
How would I go about checking the validity ...
100
votes
18
answers
48k
views
iOS8 - constraints ambiguously suggest a height of zero
Has anyone got any idea how to debug this?
Warning once only: Detected a case where constraints ambiguously suggest a height of zero for a tableview cell's content view. We're considering the ...
100
votes
21
answers
59k
views
Unable to boot device in current state: Booted
Any guess on "Unable to boot device in current state: Booted" error in Xcode6 beta while running (build+run) project in Simulator. I am just running my existing project in Xcode 6 I found above ...
100
votes
7
answers
26k
views
Sizing class for iPad portrait and Landscape Modes
I basically want to have my subviews positioned differently depending upon the orientation of the iPad (Portrait or Landscape) using Sizing Classes introduced in xcode 6. I have found numerous ...