ios10

CTCallCenter is deprecated. What is the alternative?

自作多情 提交于 2019-11-29 10:19:10
I am using CTCallCenter in my project. Now it's deprecated, I would like to know what are alternatives? How to get the event for the voice call? This is poorly documented, but I've found this mention in CTCallCenter public header files: "Replaced by <CallKit/CXCallObserver.h> " So, from iOS 10 you should use CXCallObserver class of new CallKit framework to retrieve info about active calls: CXCallObserver *callObserver = [[CXCallObserver alloc] init]; Provide object, conforming to CXCallObserverDelegate protocol and queue, on which you want to perform delegate callbacks: // If queue is nil,

iOS 10 custom navigation bar height

天大地大妈咪最大 提交于 2019-11-29 10:11:33
I implemented custom navigation bar height, by subclassing it with following code class TMNavigationBar: UINavigationBar { ///The height you want your navigation bar to be of static let navigationBarHeight: CGFloat = 44.0 ///The difference between new height and default height static let heightIncrease:CGFloat = navigationBarHeight - 44 override init(frame: CGRect) { super.init(frame: frame) initialize() } required init?(coder aDecoder: NSCoder) { super.init(coder: aDecoder) initialize() } private func initialize() { let shift = TMNavigationBar.heightIncrease/2 ///Transform all view to shift

get phone call states in iOS 10

二次信任 提交于 2019-11-29 09:57:03
问题 I want to get phone call states in my app. After some search I found CoreTelephony framework. But that is deprecated in iOS 10. SO is there any other alternative available? I also found CallKit . A new framework in iOS 10. But didn't getting call states from same as I searched. 回答1: import CallKit into your AppDelegate and add the following code: // AppDelegate var callObserver: CXCallObserver! // add property // in applicationDidFinishLaunching... callObserver = CXCallObserver() callObserver

Xcode 8 Beta (null) was unable to service the request

∥☆過路亽.° 提交于 2019-11-29 09:12:55
I have an app that worked fine in the released version of Xcode. I downloaded the beta and after I fixed all the little changes I ran it and it worked. I just came back and ran it again and I get an error saying The request to open "com.matthewhsingleton.Smoke" failed . (null) was unable to service the request. I have quit Xcode and reopened it, I have restarted my computer, tried different iPhone simulators and all produce the same resulte Felipe Andrade My error was similar, instead of "(null)", the message was: "SpringBoard was unable to service the request" Restarting the simulator worked

Cropping CIImage

陌路散爱 提交于 2019-11-29 07:57:30
I have a class that takes an UIImage , initializes a CIImage with it like so: workingImage = CIImage.init(image: baseImage!) Then the image is used to cut out 9 neighbouring squares in a 3x3 pattern out of it - in a loop: for x in 0..<3 { for y in 0..<3 { croppingRect = CGRect(x: CGFloat(Double(x) * sideLength + startPointX), y: CGFloat(Double(y) * sideLength + startPointY), width: CGFloat(sideLength), height: CGFloat(sideLength)) let tmpImg = (workingImage?.cropping(to: croppingRect))! } } Those tmpImgs are inserted into a table and later used, but thats besides the point. This code works on

iOS Get list of all WiFi networks

早过忘川 提交于 2019-11-29 07:33:26
问题 This is not a duplicate of the dozens of similar questions (too many to list) because I have evidence that it is possible to publish an app that displays a list of wifi networks. So, it has been widely accepted and understood that you cannot get a list of all wifi networks without using a private api. The use of a private api will cause an app to be rejected from app store review. However, Google did it recently in their Google Home app that was released on 10/26/2016, so it must be possible

How to use predicates with fetchRequest in Core Data

一世执手 提交于 2019-11-29 07:03:21
I pass a contact Identifier from Contacts tableview controller to another Location tableview controller. So I define a delegate ContactSelectionDelegate and implement method userSelectedContact in Location tableview controller and get contactIdentifierString I am searching the database to find a match for contactIdentifierString and find value for another attribute provider name. This involves searching the whole database. Is there a faster way by assigning a predicate to the context fetchRequest. I thought that would be faster and fewer lines of code. Can someone suggest how to use predicates

iOS10 SFSafariViewController not working when alpha is set to 0

时光毁灭记忆、已成空白 提交于 2019-11-29 06:59:28
I'm using SFSafariViewController to grab user's cookie in my app. Here's is my code: SFSafariViewController *safari = [[SFSafariViewController alloc]initWithURL:[NSURL URLWithString:referrerUrl] entersReaderIfAvailable:NO]; safari.delegate = self; safari.modalPresentationStyle = UIModalPresentationOverCurrentContext; safari.view.alpha = 0.0; safari.view.hidden = true; [self dismissViewControllerAnimated:false completion:nil]; NSLog(@"[referrerService - StoreViewController] presenting safari VC"); [self presentViewController:safari animated:false completion:nil]; This works well on iOS 9. but

How to programmatically open the WIFI settings in Objective-C on iOS 10

旧街凉风 提交于 2019-11-29 06:54:05
The following code works fine on iOS 9, see this post. But it doesn't work on iOS 10. How to open WIFI settings programmatically on iOS 10 [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"prefs:root=WIFI"]]; Ahmad F The same exact code should work, but for iOS 10 you need to do some additional work by adding "prefs" to the URL Types: After selecting your target: Navigate to "Info" tab. After scrolling to bottom, you should see "URL Types" section. Add a new one (by clicking on the plus button) and fill the "URL Schemes" with "prefs". It should be similar to this: Now, your

How can I remove previously delivered notifications when a new notification arrives with UNUserNotificationCenterDelegate in iOS 10?

时光怂恿深爱的人放手 提交于 2019-11-29 06:22:09
This question is about the new UserNotifications framework in iOS 10. I have an app that schedules a local notification every half hour after the user did a certain action in the app, starting at 1 hour. To avoid cluttering a user's lock screen or notification center, I only want one notification to show up at a time, so there is only one notification with the most recent, relevant information. My plan to achieve this is to clear all delivered notifications any time a new notification is presented. It seems this should be possible with the new willPresent method of