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
// | |
// ComposeView.swift | |
import UIKit | |
class ComposeView: UIView { | |
// ........ | |
// Other layout code and methods | |
// ........ | |
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 UIKit | |
/// Work around problem described here: https://stackoverflow.com/questions/47223680/safe-area-changes-in-parent-vc-when-presenting-modally-vc-in-landscape | |
/// When presenting screen with another orientation safe area changes on first screen | |
/// that affects constraints and all layout that depends on safe area. | |
/// To avoid this bug one should use UCFixedSafeAreaLayoutConstraint that can be updated with safe | |
/// area inset using `updateAllFixedSafeAreaConstraints(newSafeAreaInsets:)` in UIViewController | |
/// | |
/// | |
/// |
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
// | |
// NetworkEndpoint.swift | |
// Medinternet | |
// | |
// Created by VAndrJ on 6/10/18. | |
// Copyright © 2018 VAndrJ. All rights reserved. | |
// | |
import Foundation |
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
struct TypedIdentifier<T>: Equatable, Codable, ExpressibleByIntegerLiteral, CustomStringConvertible, RawRepresentable { | |
let rawValue: Int | |
var description: String { | |
return "\(rawValue)" | |
} | |
init?(rawValue: Int) { | |
self.rawValue = rawValue | |
} |
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
// | |
// ArcView.m | |
// UIBezierPathExampleForLI | |
// | |
// Created by Volodymyr Andriienko on 2/23/19. | |
// Copyright © 2019 VAndrJ. All rights reserved. | |
// | |
#import "ArcView.h" |
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
// mmcneely: From http://stackoverflow.com/questions/969130/nslog-tips-and-tricks | |
// - DLog prints output to the console, but only if the DEBUG symbol is defined | |
// - ALog prints output to the console no matter what | |
// - ULog pops up window on the device (or simulator) | |
#ifdef DEBUG | |
# define DLog(fmt, ...) NSLog((@"%s [Line %d] " fmt), __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__); | |
#else | |
# define DLog(...) | |
#endif |
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
#if DEBUG | |
#if canImport(SwiftUI) | |
import UIKit | |
import SwiftUI | |
@available (iOS 13.0, *) | |
struct UIViewControllerSwiftUIRepresentable: UIViewControllerRepresentable { | |
let controller: UIViewController | |
func makeUIViewController(context: Context) -> UIViewController { |
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
protocol Applyable {} | |
func with<T, R>(_ lhs: T, _ rhs: (T) throws -> R) rethrows -> R { | |
return try rhs(lhs) | |
} | |
extension Applyable where Self: AnyObject { | |
@discardableResult | |
func apply(_ block: (Self) throws -> Void) rethrows -> Self { |
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 | |
func checkAsync() async -> [String] { | |
(0...10).map({ "\($0)" }) | |
} | |
func checkAsyncAwait() async -> [String] { | |
await checkAsync() | |
} |
OlderNewer