Skip to content

Instantly share code, notes, and snippets.

View florianldt's full-sized avatar

Florian Ludot florianldt

View GitHub Profile
@florianldt
florianldt / CustomView.swift
Last active October 28, 2019 18:26
self sizing modal with airbnb/AloeStackView - issue #41
//
// CustomView.swift
// AloeStackDemo
//
// Created by Florian LUDOT on 2/28/19.
// Copyright © 2019 Florian LUDOT. All rights reserved.
//
import UIKit
@florianldt
florianldt / CustomView.swift
Created March 26, 2019 16:11
Possible solution for - Setting the stack view in a tableHeaderView #44
//
// CustomView.swift
// AloeStackDemo
//
// Created by Florian LUDOT on 1/3/19.
// Copyright © 2019 Florian LUDOT. All rights reserved.
//
import UIKit
@florianldt
florianldt / SideMenuViewController.swift
Created November 9, 2019 17:31
Simple implementation of a side menu using a UIView.
// Simple implementation of a side menu using a UIView.
// I would rather use a new controller to build that menu and add it as a child to this one using the addChild(_ childController: UIViewController) method, but out of scope here.
import UIKit
import PlaygroundSupport
class SideMenuViewController: UIViewController {
private var menuBarButtonItem: UIBarButtonItem!
@florianldt
florianldt / PlayerViewController.swift
Last active January 7, 2020 11:03
Gist trying to answer a Swift Korea (Facebook Group) question.
import UIKit
import PlaygroundSupport
import AVFoundation
class PlayerViewController: UIViewController {
enum Settings {
static let screenW: CGFloat = 375 // For playground use only
static let playerHeight: CGFloat = Settings.screenW * (9/16)
static let videoUrl = URL(string: "https://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4")!
@florianldt
florianldt / QueuingVideoViewController.swift
Created February 2, 2020 03:07
Queuing several video in AVQueuePlayer (for Playground)
import UIKit
import AVFoundation
import PlaygroundSupport
struct AVPlayerQueueBuilder {
static func from(_ urls: [URL]) -> [AVPlayerItem] {
return urls.map { return AVPlayerItem(url: $0) }
}
}
@florianldt
florianldt / HomeViewController.swift
Created February 3, 2020 03:16
How to build a URL based on information passed on pushViewController
import UIKit
import PlaygroundSupport
enum Styles {
enum Colors {
static let buttonBackgroundColor = UIColor(red: 72/255,
green: 199/255,
blue: 116/255,
alpha: 1)