Last active
July 12, 2022 12:32
-
-
Save alkozin/2a775e77451878463e1e918564eaf9da to your computer and use it in GitHub Desktop.
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
//Working examples | |
//Async | |
//Anything from Nothing | |
|{ (anything: Anything) in | |
🧙🏼 | |
} | |
//Determinate user's location | |
|{ (location: CLLocation) in | |
} | |
//Receive pedometer data | |
|{ (data: CMPedometerData) in | |
} | |
//Find bluetooth peripheral near | |
|{ (peripheral: CBPeripheral) in | |
} | |
//Detect motion | |
|{ (motion: UIEvent.EventSubtype) in | |
if motion == .motionShake { | |
} | |
} | |
//Subscribe to notification | |
UIWindow.keyboardWillShowNotification | { (n: Notification) in | |
} | |
//Look for a contact | |
CNContact.predicateForContacts(matchingName: "John Appleseed") | .every { (contact: CNContact) in | |
} | |
//Read hardware NFC tag | |
|{ (tag: NFCNDEFTag) in | |
} | |
//Write NFC tag | |
let write: NFCNDEFMessage = URL(string: filtered)| | |
tag | write | { (error: Error?) in | |
} | |
//Recognize bodies in imageURL | |
URL(string: "http://example.com/image.jpg") | { (faces: [VNFaceObservation]) in | |
} | |
//Recognize bodies in data | |
data | .while { (bodies: [VNHumanBodyPoseObservation]) in | |
bodies < 2 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment