Skip to content

Instantly share code, notes, and snippets.

View burakekmen's full-sized avatar
💭
Always coding with love

Burak EKMEN burakekmen

💭
Always coding with love
  • Appcent
  • Istanbul, Turkey
View GitHub Profile
import Foundation
import Network
final class NetworkListener {
static let shared = NetworkListener()
public var publicIp: String = "UNKNOWN_IP"
private let monitor = NWPathMonitor()
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
// 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
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)] = [
import UIKit
import BEOnboardingPopup
enum MyOnboardingStep: BEOnboardingStepable {
case profile
case settings
var text: String {
switch self {
case .profile:
//
// SpeechDemoViewController.swift
// VoiceToTextSample
//
// Created by Burak Ekmen
//
import UIKit
class SpeechDemoViewController: UIViewController {
//
// VoiceToTextManager.swift
// VoiceToTextSample
//
// Created by Burak Ekmen
//
import Foundation
import Speech
import UIKit
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
enum ListeningStatus {
case idle
case listening
case stopped
}
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)")
}
}