This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
override func restoreUserActivityState(_ activity: NSUserActivity) { | |
if activity.activityType == CSSearchableItemActionType, let info = activity.userInfo, let selectedIdentifier = info[CSSearchableItemActivityIdentifier] as? String { | |
print("Selected Identifier: \(selectedIdentifier)") | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func application(_ application: UIApplication, continue userActivity: NSUserActivity, restorationHandler: @escaping ([Any]?) -> Void) -> Bool { | |
let vc = (window?.rootViewController as! UINavigationController).viewControllers[0] | |
vc.restoreUserActivityState(userActivity) | |
return true | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CSSearchableIndex.default().deleteSearchableItems(withDomainIdentifiers: ["news"]) { (error) in | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import CoreSpotlight | |
import MobileCoreServices | |
func indexSearchableItems(){ | |
//let matches ... | |
var searchableItems = [CSSearchableItem]() | |
for match in matches { | |
let searchItemAttributeSet = CSSearchableItemAttributeSet(itemContentType: kUTTypeText as String) | |
searchItemAttributeSet.title = match.title |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Privacy Policy | |
Dejan Atanasov built the 1BET app as a Freemium app. This SERVICE is provided by Dejan Atanasov at no cost and is intended for use as is. | |
This page is used to inform website visitors regarding my policies with the collection, use, and disclosure of Personal Information if anyone decided to use my Service. | |
If you choose to use my Service, then you agree to the collection and use of information in relation to this policy. The Personal Information that I collect is used for providing and improving the Service. I will not use or share your information with anyone except as described in this Privacy Policy. | |
The terms used in this Privacy Policy have the same meanings as in our Terms and Conditions, which is accessible at 1BET unless otherwise defined in this Privacy Policy. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func authenticate(){ | |
let context = LAContext() | |
let reason = "We need this to protect your payments." // add your own message explaining why you need this authentication method | |
var authError: NSError? | |
if context.canEvaluatePolicy(.deviceOwnerAuthenticationWithBiometrics, error: &authError) { | |
context.evaluatePolicy(.deviceOwnerAuthenticationWithBiometrics, localizedReason: reason) { success, error in | |
if success { | |
// User authenticated successfully | |
} else { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func scanImage(image: CIImage){ | |
// Load the ML model through its generated class | |
guard let model = try? VNCoreMLModel(for: GoogLeNetPlaces().model) else { | |
fatalError("can't load Places ML model") | |
} | |
// Create a Vision request with completion handler | |
let request = VNCoreMLRequest(model: model) { request, error in | |
guard let results = request.results as? [VNClassificationObservation] else { | |
fatalError("unexpected result type from VNCoreMLRequest") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func circle(){ | |
let circleCenter = CLLocationCoordinate2D(latitude: 37.35, longitude: -122.0) | |
let circ = GMSCircle(position: circleCenter, radius: 1000) | |
circ.map = mapView | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func polygon(){ | |
// Create a rectangular path | |
let rect = GMSMutablePath() | |
rect.add(CLLocationCoordinate2D(latitude: 37.36, longitude: -122.0)) | |
rect.add(CLLocationCoordinate2D(latitude: 37.45, longitude: -122.0)) | |
rect.add(CLLocationCoordinate2D(latitude: 37.45, longitude: -122.2)) | |
rect.add(CLLocationCoordinate2D(latitude: 37.36, longitude: -122.2)) | |
// Create the polygon, and assign it to the map. | |
let polygon = GMSPolygon(path: rect) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func drawRectange(){ | |
/* create the path */ | |
let path = GMSMutablePath() | |
path.add(CLLocationCoordinate2D(latitude: 37.36, longitude: -122.0)) | |
path.add(CLLocationCoordinate2D(latitude: 37.45, longitude: -122.0)) | |
path.add(CLLocationCoordinate2D(latitude: 37.45, longitude: -122.2)) | |
path.add(CLLocationCoordinate2D(latitude: 37.36, longitude: -122.2)) | |
path.add(CLLocationCoordinate2D(latitude: 37.36, longitude: -122.0)) | |
/* show what you have drawn */ |
NewerOlder