ios10

Save dictionary in userdefaults in swift 3 with xcode 8

隐身守侯 提交于 2019-11-27 12:16:44
I am using the following code to save an object to UserDefaults (previously NSUserDefaults) using xcode 8: let defaults = UserDefaults.standard() defaults.set(someObject, forKey: "someObject") print(defaults.object(forKey: "someObject")) someObject is a dictionary and I am running on the simulator. For some reason this is not saving the value and 'nil' is printed. Wondering if it's a simulator problem. Jan For Swift 3 UserDefaults.standard.setValue(token, forKey: "user_auth_token") print("\(UserDefaults.standard.value(forKey: "user_auth_token")!)") Working perfectly here with this..! let dict:

Is there a writeToFile equivalent for Swift 3's 'Data' type?

£可爱£侵袭症+ 提交于 2019-11-27 11:29:25
问题 I've some code which returns the new iOS 10 / Swift 3 NSData replacement(?) type: Data if let jpegData = UIImageJPEGRepresentation(newImage, 0.8) { ... } I want to write this image to disk, however NSData's writeToFile: method is not present for this class. It does have a writeToURL: method, but that doesn't seem to work with a file path (and appending component). Can anyone clarify how I would now do this, as used to be the case in Swift 2: jpegData.writeToFile(imagePath, atomically: true)

WARNING: Output of vertex shader 'v_gradient' not read by fragment shader

随声附和 提交于 2019-11-27 11:12:45
When i run my app in ios 10 using xcode 8 i am getting following message in debug console, and by UI getting freezed can any one know why this is happening ERROR /BuildRoot/Library/Caches/com.apple.xbs/Sources/VectorKit/VectorKit-1228.30.7.17.9/GeoGL/GeoGL/GLCoreContext.cpp 1763: InfoLog SolidRibbonShader: ERROR /BuildRoot/Library/Caches/com.apple.xbs/Sources/VectorKit/VectorKit-1228.30.7.17.9/GeoGL/GeoGL/GLCoreContext.cpp 1764: WARNING: Output of vertex shader 'v_gradient' not read by fragment shader Answer One of the situations where you might get this warning in Xcode is when using an app

UITableViewCell animate height issue in iOS 10

Deadly 提交于 2019-11-27 11:12:33
问题 My UITableViewCell will animate it's height when recognizing a tap. In iOS 9 and below this animation is smooth and works without issues. In iOS 10 beta there's a jarring jump during the animation. Is there a way to fix this? Here is a basic example of the code. - (void)cellTapped { [self.tableView beginUpdates]; [self.tableView endUpdates]; } - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath { return self.shouldExpandCell ? 200.0f : 100.0f; } EDIT

Error: Protocol not available, dumping backtrace [duplicate]

守給你的承諾、 提交于 2019-11-27 10:42:56
This question already has an answer here: Hide strange unwanted Xcode logs 12 answers 2016-09-17 15:16:04.386085 appDemo[2371:94976] [] __nwlog_err_simulate_crash simulate crash already simulated **"nw_socket_set_common_sockopts setsockopt SO_NOAPNFALLBK failed: [42] Protocol not available"** 2016-09-17 15:16:04.386676 appDemo[2371:94976] [] nw_socket_set_common_sockopts setsockopt SO_NOAPNFALLBK failed: [42] Protocol not available, dumping backtrace: [x86_64] libnetcore-856.1.8 0 libsystem_network.dylib 0x0000000112dc780e __nw_create_backtrace_string + 123 1 libnetwork.dylib

iOS 10 bug: UICollectionView received layout attributes for a cell with an index path that does not exist

假如想象 提交于 2019-11-27 10:36:22
Running my app in a device with iOS 10 I get this error: UICollectionView received layout attributes for a cell with an index path that does not exist In iOS 8 and 9 works fine. I have been researching and I have found that is something related to invalidate the collection view layout. I tried to implement that solution with no success, so I would like to ask for direct help. This is my hierarchy view: ->Table view ->Each cell of table is a custom collection view [GitHub Repo][1] ->Each item of collection view has another collection view What I have tried is to insert [self.collectionView

UNUserNotificationCenter did receive response with completion handler is never called iOS10, swift 2.3

你离开我真会死。 提交于 2019-11-27 10:18:24
问题 I am scheduling new notifications in iOS10, like this: func scheduleNotification (event : Meeting, todaysBadgeCounter: Int) { if #available(iOS 10.0, *) { let minutesBefore = 10 //interval in seconds from current point in time to notification let interval : NSTimeInterval = NSTimeInterval(secondsFromNowTo(event.startTime.dateByAddingTimeInterval(-minutesBefore * 60))) //only schedule in the future if(interval > 0){ let category = NotificationsController.notificationCategory let center =

how to get the incoming call number by using callkit

混江龙づ霸主 提交于 2019-11-27 09:30:15
How to get the incoming call phone number programmatically by using call kit framework. i tried with cxcallobserver class but no use. Any suggestions most helpful... When using CallKit's Call Blocking & Identification feature (new in iOS 10), phone numbers to be blocked or identified are loaded by your app's Call Directory extension prior to an incoming call and the phone numbers are stored by the system. Then, when an incoming call arrives, this stored data is consulted by the system and an incoming call may either be blocked or identified in the incoming call UI with the label provided. For

How to use call directory extension to identify a incoming call in my application?

眉间皱痕 提交于 2019-11-27 09:22:47
I am working on callKit framework, I found that by the use of call directory extension, we can Identify the incoming phone number. My question how to implement a call directory extension in iOS app to identify incoming call detail. I am working in Objective C. Let a number "+919876xxxxx" add in call directory extension using this method: - (BOOL)addIdentificationPhoneNumbersToContext:(CXCallDirectoryExtensionContext *)context { // Numbers must be provided in numerically ascending order. CXCallDirectoryPhoneNumber phoneNumbers[] = {+919876xxxxx}; NSArray<NSString *> *labels = @[ @"Telemarketer"

iOS11 swift silent push (background fetch, didReceiveRemoteNotification) is not working anymore

让人想犯罪 __ 提交于 2019-11-27 08:29:32
I was hoping that the iOS11 release will fix the silent push issue, which was in the latest betas and GM version of iOS. Currently I'm struggling to understand, why I don't receive any silent push messages, which should actually wake up my app to perform some needed tasks in the background. In iOS 10 I just use the background fetch capability and implemented the 'wake-up-code' in my AppDelegate like the code below. In iOS 11 the registering code is still working fine and my backend is also delivering the push notification to Apples DEV servers (sandbox) and also to the PROD servers (production