ios10

Swift 3 and NumberFormatter (.currency) == ¤?

老子叫甜甜 提交于 2019-12-04 03:24:30
Xcode 8.0 (8A218a) GM Target : iOS 10 (Swift 3) Consider the following code: let number = NSDecimalNumber(decimal: 22.4) let numberFormatter = NumberFormatter() numberFormatter.numberStyle = .currency numberFormatter.locale = Locale.current let result = numberFormatter.string(from: number) print(result!) The result is: ¤22.40 (I have no idea what ¤ means.) But if I initialize the locale such as: numberFormatter.locale = Locale(identifier: "en_US") The result will be: $22.40 ... which is what I'd expect in the first place. Notice that this works in a Playground tho: The problem seems to happen

Animate navigation bar barTintColor change in iOS10 not working

↘锁芯ラ 提交于 2019-12-04 03:09:51
I upgraded to XCode 8.0 / iOS 10 and now the color change animation of my navigation bar is not working anymore, it changes the color directly without any animation. UIView.animateWithDuration(0.2, animations: { self.navigationController?.navigationBar.barTintColor = currentSection.color! }) Anyone knows how to fix this? To animate navigationBar’s color change in iOS10 you need to call layoutIfNeeded after setting color inside animation block. Example code: UIView.animateWithDuration(0.5) { self.navigationController?.navigationBar.barTintColor = UIColor.redColor() self.navigationController?

UICollectionView Prefetch Data Source in iOS 10?

这一生的挚爱 提交于 2019-12-04 02:31:25
What is the purpose of prefetchDataSources introduced in iOS 10? I just ran a project in XCode 8 GM Seed and started getting errors: MessagesExtension[17902:1238603] *** Assertion failure in -[UICollectionView _createPreparedSupplementaryViewForElementOfKind:atIndexPath:withLayoutAttributes:applyAttributes:], /BuildRoot/Library/Caches/com.apple.xbs/Sources/UIKit_Sim/UIKit-3599.6/UICollectionView.m:2161 Milap Kundalia UICollectionView gains a new property this year called prefetchDataSource. Just like the existing delegate and dataSource properties, we can simply set it to some object that

How to intercept “Messages” sent from CallKit incoming call screen?

大兔子大兔子 提交于 2019-12-04 01:21:46
问题 I'm using iOS 10's CallKit to receive incoming calls. The calls in my app do not come from "phone numbers" or "email addresses", but from an internal identifier in my protocol. I thus report incoming calls with the CXHandleType of CXHandleTypeGeneric (and not CXHandleTypePhoneNumber or CXHandleTypeEmailAddress ), using a custom string as the "value" of the handle. When I report the incoming call, and the phone is not locked, the user sees an incoming call screen, with the buttons "Remind Me",

MPMediaItemArtwork init(image:) deprecated in iOS 10.0

十年热恋 提交于 2019-12-04 01:11:02
Apple has deprecated init(image:) method in MPMediaItemArtwork in iOS 10. What is the new alternative. the class shows interface shows method below to be available in the new OS version public init(boundsSize: CGSize, requestHandler: @escaping (CGSize) -> UIImage) Anyone know how to use it? Also question 2, part of the previous question: Does showing now playing metadata on the lock-screen and control-center using MPNowPlayingInfoCenter work in the simulator? Virasio You can use the following code: let image = UIImage(named: "logo")! let artwork = MPMediaItemArtwork.init(boundsSize: image.size

if we're in the real pre-commit handler we can't actually add any new fences due to CA restriction [duplicate]

前提是你 提交于 2019-12-04 00:54:15
问题 This question already has answers here : iOS 10: “[App] if we're in the real pre-commit handler we can't actually add any new fences due to CA restriction” (6 answers) Closed 2 years ago . I am using UIImagePickerController with Camera type. When I first opens the image picker controller it works fine, But after open the image picker vc, when i rotate the device, It shows the "[App] if we're in the real pre-commit handler we can't actually add any new fences due to CA restriction" & there is

iOS 10 Launch Screen Bug

最后都变了- 提交于 2019-12-03 23:49:29
问题 My Device and Simulator seem to be caching the launch screen for my app! I have deleted the original Launch Screen.storyboard and created my own XIB and swift files called "StartingPointView.xib" and "StartingPointView.Swift". The XIB file contains a view with Blue background color. It is also linked in the Xcode project settings under app icon and launch images. So far everything seems fine, but when I change the color of the StartingPointView's view to say Yellow, the app continues to

Swift 3D Touch iOS 10 Home screen quick actions share Item missing

心不动则不痛 提交于 2019-12-03 22:27:17
In my apps that use 3D touch home screen quick actions I do not have the new iOS 10 default sharing option that all apps got for free. I have seen some apps, for example Amazon, that have their 4 custom shortcut items (quick actions) and the 1 default sharing option. Is there a way I can get the default iOS 10 sharing option back? MwcsMac That feature or option is only available for apps that are live on the App Store, it will not show up when testing your app. It is done automatically so there is nothing you will have to do. 来源: https://stackoverflow.com/questions/39752216/swift-3d-touch-ios

How to add buttons above keyboard

為{幸葍}努か 提交于 2019-12-03 21:01:23
How to add button above the keyboard like this one in Stack Exchange app? And when you long press the text in UITextView How to add "Select" and "Select All"? The first question, you can set textField 's inputAccessoryView to your custom view, this can customize the keyboard's header. The result: You can do it like below; first, you should instance the view you want to add above the keyboard. class ViewController : UIViewController { @IBOutlet weak var textField: UITextField! override func viewDidLoad() { super.viewDidLoad() textField.inputAccessoryView = Bundle.main.loadNibNamed(

sceneDidLoad being called twice?

谁说我不能喝 提交于 2019-12-03 18:51:40
问题 Using Xcode 8, swift 3 and I create a iOS application using the game template with entities enabled. I notice I was seeing double node count for some initial sprites even though I only used addChild once. I added override func sceneDidLoad() { print(#function) ... } to the code and no idea why this is being called twice. log file... 2016-09-20 10:21:31.482 MMDecon1[3295:791435] SKUtil.m: MGGetBoolAnswer is not available in the simulator. sceneDidLoad() sceneDidLoad() I added override func