Skip to content

Instantly share code, notes, and snippets.

View sebjvidal's full-sized avatar

Seb Vidal sebjvidal

View GitHub Profile
@sebjvidal
sebjvidal / ViewController.swift
Created November 5, 2024 15:35
UIButton Control Size for Mac Catalyst
import UIKit
class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
let button = UIButton(type: .system)
button.role = .primary
button.controlSize = .large
@sebjvidal
sebjvidal / ViewController.swift
Created May 28, 2024 16:39
UICustomViewMenuElement Demo
//
// ViewController.swift
// UIMenu-Demo
//
// Created by Seb Vidal on 28/05/2024.
//
import UIKit
class ViewController: UIViewController {
@sebjvidal
sebjvidal / ViewController.swift
Created April 30, 2024 15:50
Apple Journal Calendar UI Demo
//
// ViewController.swift
// Journal-Calendar-Demo
//
// Created by Seb Vidal on 30/04/2024.
//
import UIKit
class ViewController: UIViewController {
@sebjvidal
sebjvidal / UIFont.TextStyle+Emphasized.swift
Last active June 3, 2024 09:46
Private UIFont.TextStyles
import UIKit
extension UIFont.TextStyle {
static var emphasizedLargeTitle: UIFont.TextStyle {
return UIFont.TextStyle(rawValue: "UICTFontTextStyleEmphasizedTitle0")
}
static var emphasizedTitle1: 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 {