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 Network | |
| final class NetworkListener { | |
| static let shared = NetworkListener() | |
| public var publicIp: String = "UNKNOWN_IP" | |
| private let monitor = NWPathMonitor() |
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 SwiftUIExampleView: View { | |
| @State private var profileFrame: CGRect = .zero | |
| var body: some View { | |
| VStack { | |
| Image(systemName: "person.circle") | |
| .overlay( | |
| GeometryReader { geo in | |
| Color.clear.onAppear { | |
| // Capture global frame |
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
| // Start with the default theme | |
| var oceanTheme = BEOnboardingPopupTheme.default | |
| // 1. Layout Customization | |
| oceanTheme.popupWidth = 320 | |
| oceanTheme.containerCornerRadius = 16 | |
| // 2. Colors | |
| oceanTheme.containerBackgroundColor = UIColor(red: 0.95, green: 0.98, blue: 1.0, alpha: 1.0) // Very light blue | |
| oceanTheme.overlayColor = UIColor.black.withAlphaComponent(0.75) // Darker overlay |
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
| class HomeViewController: UIViewController { | |
| @IBOutlet weak var profileButton: UIButton! | |
| @IBOutlet weak var settingsButton: UIButton! | |
| override func viewDidAppear(_ animated: Bool) { | |
| super.viewDidAppear(animated) | |
| // Map the Enum cases to the UIViews | |
| let steps: [(MyOnboardingStep, UIView)] = [ |
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 UIKit | |
| import BEOnboardingPopup | |
| enum MyOnboardingStep: BEOnboardingStepable { | |
| case profile | |
| case settings | |
| var text: String { | |
| switch self { | |
| case .profile: |
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
| // | |
| // SpeechDemoViewController.swift | |
| // VoiceToTextSample | |
| // | |
| // Created by Burak Ekmen | |
| // | |
| import UIKit | |
| class SpeechDemoViewController: UIViewController { |
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
| // | |
| // VoiceToTextManager.swift | |
| // VoiceToTextSample | |
| // | |
| // Created by Burak Ekmen | |
| // | |
| import Foundation | |
| import Speech | |
| import UIKit |
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
| func requestPermissions(completion: @escaping (Bool) -> Void) { | |
| // 1. Request Speech Authorization | |
| SFSpeechRecognizer.requestAuthorization { [weak self] authStatus in | |
| guard authStatus == .authorized else { | |
| completion(false) | |
| return | |
| } | |
| // 2. Request Microphone Authorization | |
| AVAudioSession.sharedInstance().requestRecordPermission { granted in |
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
| enum ListeningStatus { | |
| case idle | |
| case listening | |
| case stopped | |
| } |
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
| extension DraggableCollectionViewController : DraggableCollectionViewCellDataSourceOutputDelegate { | |
| func itemDropped() { | |
| print("Items List\n") | |
| let items = dataSource.snapshot().itemIdentifiers(inSection: .main) | |
| if !items.isEmpty { | |
| for item in items { | |
| print("UUID: \(item.uuid), Color: \(item.color.accessibilityName)") | |
| } | |
| } |
NewerOlder