The Composable Architecture(TCA)는 일관되고 이해할 수 있는 방식으로 어플리케이션을 만들기 위해 탄생한 라이브러리입니다. 합성(Composition), 테스팅(Testing) 그리고 인체 공학(Ergonomics)을 염두에 둔 TCA는 SwiftUI, UIKit을 지원하며 모든 애플 플랫폼(iOS, macOS, tvOS, watchOS)에서 사용 가능합니다.
This file contains 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
// | |
// AGAudioRecorder.swift | |
// BaseProject | |
// | |
// Created by AshvinGudaliya on 17/09/18. | |
// Copyright © 2018 AshvinGudaliya. All rights reserved. | |
// | |
import UIKit | |
import AVFoundation |
This file contains 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
# Usage: | |
# command | |
# `sh gifconverter.sh /Users/canapio/Desktop/turtle_DEMO_004_4.MP4` | |
# on mac | |
# some configuration | |
width="240" | |
fps="12" | |
# path setup |
This file contains 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
// https://stackoverflow.com/a/45777692/5536516 | |
import Foundation | |
struct MemoryAddress<T>: CustomStringConvertible { | |
let intValue: Int | |
var description: String { | |
let length = 2 + 2 * MemoryLayout<UnsafeRawPointer>.size |
This file contains 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 | |
/// Protocol for NSLocking objects that also provide try() | |
public protocol TryLockable: NSLocking { | |
func `try`() -> Bool | |
} | |
// These Cocoa classes have tryLock() | |
extension NSLock: TryLockable {} | |
extension NSRecursiveLock: TryLockable {} |
This file contains 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
/** A pthread-based recursive mutex lock. */ | |
public class Mutex { | |
private var mutex: pthread_mutex_t = pthread_mutex_t() | |
public init() { | |
var attr: pthread_mutexattr_t = pthread_mutexattr_t() | |
pthread_mutexattr_init(&attr) | |
pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE) | |
let err = pthread_mutex_init(&self.mutex, &attr) |
영어지만, 조금 더 상세하게 마크다운 사용법을 안내하고 있는
"Markdown Guide (https://www.markdownguide.org/)" 를 보시는 것을 추천합니다. ^^
아, 그리고 마크다운만으로 표현이 부족하다고 느끼신다면, HTML 태그를 활용하시는 것도 좋습니다.
This file contains 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 Mutex { | |
private let _mutex = UnsafeMutablePointer<pthread_mutex_t>.alloc(1) | |
init() { | |
pthread_mutex_init(_mutex, nil) | |
} | |
func lock() -> Int32 { | |
return pthread_mutex_lock(_mutex) | |
} |