Skip to content

Instantly share code, notes, and snippets.

Reda Lemeden kaishin

Block or report user

Report or block kaishin

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@CodeSlicing
CodeSlicing / AnimatedTrainWheelDemo.swift
Created Feb 19, 2020
Demonstrates referring to points from one animated layout guide to another animated layout guide
View AnimatedTrainWheelDemo.swift
//
// AnimatedTrainWheelDemo.swift
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
// of the Software, and to permit persons to whom the Software is furnished to do so,
// subject to the following conditions:
//
@MihaelIsaev
MihaelIsaev / Postgres+Transaction.swift
Last active Jan 16, 2020
Postgres transaction extension for Vapor4 and Fluent4
View Postgres+Transaction.swift
//
// Postgres+Transaction.swift
//
// Created by Mihael Isaev on 14.01.2020.
//
import Vapor
import FluentKit
import PostgresKit
@Amzd
Amzd / 0_UIKitTabView.swift
Last active Feb 19, 2020
SwiftUI tab bar view that respects navigation stacks when tabs are switched (unlike the TabView implementation)
View 0_UIKitTabView.swift
import SwiftUI
/// An iOS style TabView that doesn't reset it's childrens navigation stacks when tabs are switched.
struct UIKitTabView: View {
var viewControllers: [UIHostingController<AnyView>]
@State var selectedIndex: Int = 0
init(_ views: [Tab]) {
self.viewControllers = views.map {
let host = UIHostingController(rootView: $0.view)
@fitomad
fitomad / SwiftUI_async_image_loading.swift
Last active Aug 1, 2019
A SwiftUI example about async image loading.
View SwiftUI_async_image_loading.swift
//
// ImageLoader.swift
// DubDubKit
//
// Created by Adolfo Vera Blasco on 27/06/2019.
// Copyright © 2019 Adolfo Vera Blasco. All rights reserved.
//
#if os(macOS)
import AppKit
@ohayon
ohayon / DraggableView.swift
Last active Jul 31, 2019
Example of making a reusable `draggable()` modifier for SwiftUI Views
View DraggableView.swift
struct DraggablePita: View {
var body: some View {
Image(uiImage: UIImage(named: "pita.png")!)
.draggable() // Add the new, custom modifier to make this draggable
}
}
// Handle dragging
struct DraggableView: ViewModifier {
@State var offset = CGPoint(x: 0, y: 0)
@maxidorius
maxidorius / notes.md
Last active Feb 6, 2020
Notes on privacy and data collection of Matrix.org
View notes.md

Notes on privacy and data collection of Matrix.org


This version of the document is no longer canonical. You can find the canonical version hosted at Gitlab and Github.

PART 2 IS OUT, INCLUDING THE DISCLOSURE OF A GLOBAL FEDERATION DATA LEAK, AND THE ANATOMY OF A GDPR DATA REQUEST HANDLED BY MATRIX.ORG. SEE THE REPOS ABOVE.

This work is licensed under CC BY-NC-SA 4.0. See Editorial Notes for Attribution details.

View NumbersCollectionView.swift
import SwiftUI
struct NumbersCollectionView : UIViewRepresentable {
@Binding var numbers: [Int]
func makeUIView(context: Context) -> UICollectionView {
let layout = UICollectionViewFlowLayout()
let collectionView = UICollectionView(frame: .zero, collectionViewLayout: layout)
collectionView.backgroundColor = .white
@simonliotier
simonliotier / SwiftUI+CustomFonts+DynamicType.swift
Last active Dec 11, 2019
Example of how to get Dynamic Type with custom fonts in SwiftUI
View SwiftUI+CustomFonts+DynamicType.swift
import SwiftUI
/// Example of how to get Dynamic Type with custom fonts in SwiftUI.
struct ContentView: View {
var body: some View {
VStack(spacing: 20) {
Text("A large title").customFont(.largeTitle) // "Optima-ExtraBlack", 28
Text("A body").customFont(.body) // "Kailasa", 16
Text("A caption").customFont(.caption2) // "IowanOldStyle-Italic", 11
}
@brimelow
brimelow / ContentView.swift
Created Jun 13, 2019
Random 100 Circles Animation in SwiftUI
View ContentView.swift
//
// ContentView.swift
// DrawingGroup
//
// Created by Lee Brimelow on 6/12/19.
// Copyright © 2019 Lee Brimelow. All rights reserved.
//
import SwiftUI
@alexito4
alexito4 / RemoteImage.swift
Last active Dec 31, 2019
Rough sketch of SwiftUI RemoteImage using AlamofireImage
View RemoteImage.swift
import SwiftUI
import Combine
import AlamofireImage
let imageDownloader = ImageDownloader(
configuration: ImageDownloader.defaultURLSessionConfiguration(),
downloadPrioritization: .fifo,
maximumActiveDownloads: 4,
imageCache: AutoPurgingImageCache()
)
You can’t perform that action at this time.