Skip to content

Instantly share code, notes, and snippets.

//
// OptionalExtension.swift
//
// Created by Darktt on 19/6/11.
// Copyright © 2019 Darktt. All rights reserved.
//
import Foundation
public extension Optional
@Darktt
Darktt / A.swift
Last active March 2, 2023 08:04
AA BB
open class A
{
public let b: B = .init()
public init() {}
}
public extension A
{
class B
@Darktt
Darktt / FluentInterface.swift
Created September 27, 2022 01:26
FluentInterface
//
// FluentInterface.swift
// DTTest
//
// Created by Darktt on 21/9/3.
// Copyright © 2021 Darktt. All rights reserved.
//
import UIKit
@Darktt
Darktt / DTTimerHelper.swift
Created September 13, 2022 03:10
DTTimerHelper
//
// DTTimerHelper.swift
//
// Created by Darktt on 22/5/18.
// Copyright © 2022 Darktt. All rights reserved.
//
import Foundation
public final class DTTimerHelper
@Darktt
Darktt / ObjectDecodable.swift
Last active July 20, 2022 09:16
ObjectDecodable
//
// ObjectDecodable.swift
//
// Created by Darktt on 22/6/9.
// Copyright © 2022 Darktt. All rights reserved.
//
import Foundation
/**
@Darktt
Darktt / DTFontRegister.swift
Created April 30, 2022 00:08
DTFontRegister
//
// DTFontRegister.swift
//
// Created by Darktt on 17/1/18.
// Copyright © 2017 Darktt. All rights reserved.
//
import Foundation
import CoreText
@Darktt
Darktt / AnchorOperator.md
Last active March 13, 2024 07:40
AnchorOperator

How to use

func viewDidload()
{
    let collectionView = UICollectionView()
        
    self.view.addSubview(collectionView)
        
    collectionView.topAnchor =*= self.view.safeAreaLayoutGuide.topAnchor
 collectionView.leftAnchor =*= self.view.safeAreaLayoutGuide.leftAnchor
@Darktt
Darktt / MutipleLineStringBuilder.swift
Created March 4, 2022 04:46
Mutiple Line String Builder
//
// MutipleLineStringBuilder.swift
//
// Created by Darktt on 20/5/20.
// Copyright © 2020 Darktt. All rights reserved.
//
import Foundation
/**
@Darktt
Darktt / Trio-75-Rin.kbd.json
Last active January 5, 2022 04:56
Trio-75 Rin
[
{
"backcolor": "#761523",
"name": "Trio-75 Rin",
"radii": "20px",
"switchMount": "cherry",
"pcb": false
},
[
{
@Darktt
Darktt / Trio-75-FC.kbd.json
Last active December 28, 2021 21:23
Trio-75 FC
[
{
"backcolor": "#761523",
"name": "Trio-75 FC",
"radii": "20px",
"switchMount": "cherry",
"pcb": false
},
[
{