This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import UIKit | |
class KConfettiView: UIView { | |
private var emitterLayer:CAEmitterLayer! | |
var coefficient:Float = 0.5 | |
var cellCount:Int = 5 | |
var image:UIImage? | |
var color:UIColor? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extension URLSession { | |
func syncDataTask(with request: URLRequest) -> (Data?, URLResponse?, Error?) { | |
var data: Data? | |
var response: URLResponse? | |
var error: Error? | |
let semaphore = DispatchSemaphore(value: .zero) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extension UIView { | |
@discardableResult | |
func constrain(constraints: (UIView) -> [NSLayoutConstraint]) -> [NSLayoutConstraint] { | |
let constraints = constraints(self) | |
self.translatesAutoresizingMaskIntoConstraints = false | |
NSLayoutConstraint.activate(constraints) | |
return constraints | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
security find-generic-password -ga "WIFI NAME" | grep "password:" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import UIKit | |
@IBDesignable | |
final class ClockFace: UIView { | |
var numberTextFont: UIFont = UIFont.boldSystemFont(ofSize: 11) | |
@IBInspectable var textColor: UIColor = .black | |
@IBInspectable var tickColor: UIColor = .black | |
@IBInspectable var fiveTickColor: UIColor = .black |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// PinterestLayout.swift | |
// Papr | |
// | |
// Created by Joan Disho on 26.05.18. | |
// Copyright © 2018 Joan Disho. All rights reserved. | |
// | |
import RxSwift | |
import RxCocoa |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private struct ActivityToken<E>: ObservableConvertibleType, Disposable { | |
private let _source: Observable<E> | |
private let _dispose: Cancelable | |
init(source: Observable<E>, disposeAction: @escaping () -> Void) { | |
_source = source | |
_dispose = Disposables.create(with: disposeAction) | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class PhotoCapture { | |
// here some stuff for capture image, such as capture session, configurations, photo output | |
// More detail : https://github.com/trilliwon/ArtCamera/blob/master/Camera/Controllers/PhotoCapture.swift | |
} | |
// MARK: - AVCapturePhotoCaptureDelegate | |
extension PhotoCapture: AVCapturePhotoCaptureDelegate { | |
func photoOutput(_ output: AVCapturePhotoOutput, willCapturePhotoFor resolvedSettings: AVCaptureResolvedPhotoSettings) { | |
AudioServicesDisposeSystemSoundID(1108) | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
import os.log | |
extension OSLog { | |
static var appDefault: OSLog { | |
return log(category: "app_default") | |
} | |
private static func log(category: String) -> OSLog { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import AVFoundation | |
import os.log | |
/// https://developer.apple.com/library/archive/documentation/AudioVideo/Conceptual/AVFoundationPG/Articles/05_Export.html | |
/** | |
Steps | |
- Use serialization queues to handle the asynchronous nature of reading and writing audiovisual data | |
- Initialize an asset reader and configure two asset reader outputs, one for audio and one for video | |
- Initialize an asset writer and configure two asset writer inputs, one for audio and one for video |