Skip to content

Instantly share code, notes, and snippets.

View sebjvidal's full-sized avatar

Seb Vidal sebjvidal

View GitHub Profile
@sebjvidal
sebjvidal / UIFont.TextStyle+Emphasized.swift
Created March 4, 2024 12:17
Private UIFont.TextStyles
import UIKit
extension UIFont.TextStyle {
static var emphasizedLargeTitle: UIFont.TextStyle {
return UIFont.TextStyle(rawValue: "UICTFontTextStyleEmphasizedTitle0")
}
static var emphasizedLargeTitle1: UIFont.TextStyle {
return UIFont.TextStyle(rawValue: "UICTFontTextStyleEmphasizedTitle1")
}
import UIKit
import MetalKit
class ViewController: UIViewController {
override func viewDidAppear(_ animated: Bool) {
super.viewDidAppear(animated)
let imageView = UIImageView(image: UIImage(named: "landscape"))
imageView.frame = CGRect(x: 0, y: 200, width: 350, height: 197)
view.addSubview(imageView)
@sebjvidal
sebjvidal / Slider.swift
Created February 12, 2024 21:46
Slider
import SwiftUI
struct ContentView: View {
@State var isExpanded: Bool = false
@State var width: CGFloat = 100
var body: some View {
ZStack(alignment: .leading) {
Capsule()
@sebjvidal
sebjvidal / SceneDelegate.swift
Created June 27, 2023 18:14
Custom UINavigationBar Height
// MARK: - SceneDelegate
class SceneDelegate: UIResponder, UIWindowSceneDelegate {
var window: UIWindow?
func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {
let navigationController = UINavigationController(navigationBarClass: NavigationBar.self, toolbarClass: nil)
(navigationController.navigationBar as! NavigationBar).preferredHeight = 88
navigationController.setViewControllers([ViewController()], animated: false)
//
// ViewController.swift
// task-test
//
// Created by Seb Vidal on 18/08/2022.
//
import UIKit
class FirstViewController: UIViewController {
@sebjvidal
sebjvidal / SceneDelegate.swift
Created January 30, 2022 21:00
SceneDelegate: NSToolbarItem.Identifier.supplementarySidebarTrackingSeparatorItemIdentifier
//
// SceneDelegate.swift
// Snippet
//
// Created by Seb Vidal on 30/01/2022.
//
import UIKit
class SceneDelegate: UIResponder, UIWindowSceneDelegate, NSToolbarDelegate {