This file contains hidden or 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 <AudioToolbox/AudioToolbox.h> | |
| void AudioServicesPlaySystemSoundWithVibration(SystemSoundID inSystemSoundID,id arg,NSDictionary* vibratePattern); |
This file contains hidden or 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
| let vibe: NSArray = [true, 1000, false, 250, true, 1200] | |
| let dict = [ | |
| "Intensity": 0.7, | |
| "VibePattern": vibe | |
| ] as [String : Any] | |
| AudioServicesPlaySystemSoundWithVibration(kSystemSoundID_Vibrate, nil, dict) |
This file contains hidden or 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 CoreHaptics | |
| func playHapticsFile() { | |
| guard let url = Bundle.main.url(forResource: "myfile", withExtension: "ahap") else { | |
| print("could not load file") | |
| return | |
| } | |
| do { |
This file contains hidden or 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 CoreHaptics | |
| import HaptrixSync | |
| func playHapticsFile() { | |
| guard let url = Bundle.main.url(forResource: "myfile", withExtension: "ahap") else { | |
| print("could not load file") | |
| return | |
| } | |
This file contains hidden or 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 Foundation | |
| import GameController | |
| import CoreHaptics | |
| /** | |
| Ensure the controller supports Haptics, then play | |
| */ | |
| class PlayStationHaptics { | |
| var engine: CHHapticEngine? |
This file contains hidden or 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
| struct Product: Decodable { | |
| let title: String | |
| } | |
| class MyCombine { | |
| func getWithCombine() -> AnyPublisher<Product, Error> { | |
| let url = URL(string: "https://dummyjson.com/products/1")! |
OlderNewer