Skip to content

Instantly share code, notes, and snippets.

View filimo's full-sized avatar

VictorK filimo

View GitHub Profile
import SwiftUI
enum NavTestRoute: Hashable {
case child(Int)
}
struct NavTestChildView: View {
let num: Int
init(num: Int) {
@filimo
filimo / ByteWriteChannel.kt
Created September 19, 2022 15:39 — forked from Skeptick/ByteWriteChannel.kt
iOS ByteWriteChannel
import io.ktor.client.utils.*
import io.ktor.utils.io.*
import io.ktor.utils.io.bits.*
import kotlinx.cinterop.*
import kotlinx.coroutines.*
import platform.CoreFoundation.*
import platform.Foundation.*
import platform.UIKit.*
import platform.posix.memcpy
import platform.posix.uint8_tVar
@filimo
filimo / WWDC.json
Created April 16, 2021 05:22 — forked from harishgonnabattula/WWDC.json
WWDC 2015-2018 Video urls and summary
[
{"url": "https://devstreaming-cdn.apple.com/videos/wwdc/2018/236mwbxbxjfsvns4jan/236/236_hd_avspeechsynthesizer_making_ios_talk.mp4?dl=1", "title": "AVSpeechSynthesizer: Making iOS Talk", "summary": "Speech can enhance the audio experience of your app, whether you are generating spoken feedback for accessibility, or providing critical information beyond simple alerts or notifications. AVSpeechSynthesizer produces synthesized speech from text and allows you to control and monitor the progress of ongoing speech. Learn the ins and outs of AVSpeechSynthesizer and how to add computer-generated speech output to your app."},
{"url": "https://devstreaming-cdn.apple.com/videos/wwdc/2018/405bjty1j94taqv8ii/405/405_hd_measuring_performance_using_logging.mp4?dl=1", "title": "Measuring Performance Using Logging", "summary": "Learn how to use signposts and logging to measure performance. Understand how the Points of Interest instrument can be used to examine logged data. Get an introduction into creating and using custo
//
// CancelBag.swift
// CountriesSwiftUI
//
// Created by Alexey Naumov on 04.04.2020.
// Copyright © 2020 Alexey Naumov. All rights reserved.
//
import Combine
import SwiftUI
extension Color {
static let offWhite = Color(red: 225 / 255, green: 225 / 255, blue: 235 / 255)
}
struct SimpleButtonStyle: ButtonStyle {
func makeBody(configuration: Self.Configuration) -> some View {
configuration.label
.padding(30)
.background(
RoundedRectangle(cornerRadius: 20)
protocol ProtocolB1 {
init()
func methodB1()
}
extension ProtocolB1 where Self: ClassB1 {
func methodB1() {
print("ProtocolB1 where Self: ClassB1", #function, #line, Self.self)
}
protocol AssotiatedTypeProtocol {
func bar()
}
class BaseClass: AssotiatedTypeProtocol {
func bar() {
print("BaseClass")
}
}
@filimo
filimo / NavigationView2Demo.swift
Last active February 15, 2020 18:50
Hide/show parent navigation bar
import SwiftUI
struct NavigationView2Demo: View {
@State var hide = false
var body: some View {
NavigationView {
NavigationView2Demo_A
.navigationBarHidden(hide)
.onAppear { self.hide = true }
import SwiftUI
struct ScaleButtonStyle: ButtonStyle {
public func makeBody(configuration: Configuration) -> some View {
print(configuration.isPressed)
return configuration.label
.frame(width: 200, height: 200)
.scaleEffect(configuration.isPressed ? 0.9 : 1)
.animation(.easeInOut)
@filimo
filimo / AdvanceTabView.swift
Created January 17, 2020 21:46
Custom TabView in SwiftUI
class AdvanceTabViewStore: ObservableObject {
private init() {}
static let shared = AdvanceTabViewStore()
@Published var activeTab = 1
}
struct AdvanceTabView: View {
@ObservedObject var store = AdvanceTabViewStore.shared