ios8

Setting Custom HTTP Headers in Alamofire in iOS 7 not working

删除回忆录丶 提交于 2019-12-21 03:43:24
问题 I've tried to set the Alamofire.Manager.sharedInstance.session.configuration.HTTPAdditionalHeaders with my custom HTTP Headers in iOS 7 but I have had no luck. This works fine in iOS 8. Does anyone have any suggestions? 回答1: I got it working. This has no effect on iOS7: Alamofire.Manager.sharedInstance.session.configuration.HTTPAdditionalHeaders = ["CustomHeader": customValue] This however will work on both iOS7 & 8: var headers = Alamofire.Manager.sharedInstance.session.configuration

What is the SKPaymentTransactionStateDeferred flow of alert messages by Apple?

自古美人都是妖i 提交于 2019-12-21 03:41:55
问题 With iOS8, Apple introduced the new SKPaymentTransactionStateDeferred state for IAP transactions. (e.g., see https://developer.apple.com/library/ios/technotes/tn2259/_index.html). Amongst various issues with this (like, how do you test this!?), I don't know what the flow of Apple alerts looks like with this state. For example, when your app gets the SKPaymentTransactionStatePurchased state, Apple has just given a message "Thank You. Your purchase was successful." What about with the deferred

Cannot assign to a parameter

拈花ヽ惹草 提交于 2019-12-21 03:13:37
问题 I have declared a function func someFunction(parameterName: Int) { parameterName = 2 //Cannot assign to let value parameter Name var a = parameterName } and trying to assign it a value during runtime, but it gives me error "Cannot assign to let value parameter Name". Is the parameter name constant by default? Can I change it to a variable? 回答1: [In Swift >= 3.0] Function parameters are defined as if by let and thus are constants. You'll need a local variable if you intend to modify the

Can I detect if screen is regular or compact from code on iOS 8?

本小妞迷上赌 提交于 2019-12-21 03:12:05
问题 iOS 8 introduce new screen types that are usable in Storyboards and in Xibs, can I detect these types in code? If yes, how? Here you can find more about it https://developer.apple.com/library/content/releasenotes/General/WhatsNewIniOS/Articles/iOS8.html 回答1: Yes you can, UIViewControllers now have a traitCollection property which has information from the device idiom, to the current size classes and more ... Furthermore you can implement the method func traitCollectionDidChange

warning: all apps should include an armv7 architecture (current archs = “arm64”)

两盒软妹~` 提交于 2019-12-21 02:52:25
问题 warning: all apps should include an armv7 architecture (current archs = "arm64"). I have read other posts with earlier versions of XCode and none of those examples helped fix this. Its seems no matter what I put in the settings, as you see below, helps. I still get the same error. The project and the target settings look the same. I have tried adding armv7s and that doesnt help. I dont know why the error says current archs - arm64. Doesnt it see everything else? 回答1: I found that the order in

Can't use keyboard extension in Spotlight after 8.3

女生的网名这么多〃 提交于 2019-12-21 02:45:21
问题 Since I updated my keyboard extension project to Swift 1.2 and my devices to iOS 8.3, I am no longer able to use my extension in Spotlight search. My extension is not in the list if I press and hold the "globe" key, and if it's the active keyboard when entering Spotlight the system keyboard is used instead. Other 3'rd party keyboards seems to work in Spotlight - and my own keyboard works in any other app I've tried it in (Notes, Mailbox, Safari etc). It used to work in Spotlight in all iOS 8

Present a UIAlertController from within a Popover in iOS8

做~自己de王妃 提交于 2019-12-21 01:59:22
问题 I set a UITableViewController to be displayed in a popover on iPad : When I click on a row, I display an alert to warn the user of a potential destructive action. I used the new UIAlertController, and here is what happens: The popover becomes very small (the size of the alertController view in fact). If I press Cancel, I can see the result : Here is my code: override func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) { var previouslySelectedCell:

ReadRSSI doesn't call the delegate method

南笙酒味 提交于 2019-12-21 01:21:12
问题 I got a problem since the iOS 8 update, right now my app is connected to a BLE device and periodically reads the RSSI thanks to a timer and the ReadRSSI method. The readRSSI method is called (checked with a breakpoint) so until this point everything is fine. According to the documentation calling the readRSSI should trigger the callback - (void)peripheral:(CBPeripheral *)peripheral didReadRSSI:(NSNumber *)RSSI error:(NSError *)error However, this delegate method is not called every time. But

Segue not getting selected row number

不羁的心 提交于 2019-12-20 23:32:26
问题 I am passing data from a table view controller to a detail view. I tried using indexPath.row directly in my prepareForSegue method, however it displays an error of use of unresolved identifier 'indexPath' So, after searching the web, I set up the variable indexOfSelectedPerson which is assigned the value of indexPath.row . The problem when I run the app in the simulator is that prepareForSegue is getting the initial value of indexOfSelectedPerson (0), then getting the value of the selected

Continuous vertical scrolling between UICollectionView nested in UIScrollView

丶灬走出姿态 提交于 2019-12-20 18:45:09
问题 While I know nested scrollViews aren't ideal, our designers provided me with this setup, so I'm doing my best to make it work. Let's begin! View Hierarchy UIView UIScrollView (Vertical Scrolling Only) UIImageView UICollectionView #1 (Horizontal Scrolling Only) UIImageView (different from previous UIImageView) UICollectionView #2 (Vertical Scrolling Only) Important Note All my views are defined using programmatic Auto Layout. Each successive view in the UIScrollView's subview hierarchy has a y