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 | |
class HoleView: UIView { | |
override func awakeFromNib() { | |
super.awakeFromNib() | |
} | |
override func draw(_ rect: CGRect) { | |
super.draw(rect) |
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
extension UIImage { | |
public func cropped(to rect: CGRect) -> UIImage? { | |
UIGraphicsBeginImageContextWithOptions(rect.size, true, scale) | |
draw(at: rect.origin.applying(CGAffineTransform(scaleX: -1, y: -1))) | |
let image = UIGraphicsGetImageFromCurrentImageContext() | |
UIGraphicsEndImageContext() | |
return image | |
} | |
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 APIKit | |
import Result | |
extension APIKit.Session { | |
class func sendSynchronous<Request>(_ request: Request) -> Result<Request.Response, APIKit.SessionTaskError> where Request: APIKit.Request { | |
return shared.sendSynchronous(request) | |
} | |
/// Execute `send(_:callbackQueue:handler:)` synchronously. |
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 | |
struct StructError: Error { | |
var localizedDescription: String { "StructError.localizedDescription" } | |
} | |
class ClassError: Error { | |
var localizedDescription: String { "ClassError.localizedDescription" } | |
} |
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 | |
let statuses: [(OSStatus, String)] = [ | |
(errSecSuccess,"errSecSuccess"), | |
(errSecUnimplemented,"errSecUnimplemented"), | |
(errSecDiskFull,"errSecDiskFull"), | |
// (errSecDskFull,"errSecDskFull"), // Deprecated | |
(errSecIO,"errSecIO"), | |
(errSecOpWr,"errSecOpWr"), | |
(errSecParam,"errSecParam"), |
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 | |
let allCodes: [(Int, String)] = [ | |
(NSFileNoSuchFileError,"NSFileNoSuchFileError"), | |
(NSFileLockingError,"NSFileLockingError"), | |
(NSFileReadUnknownError,"NSFileReadUnknownError"), | |
(NSFileReadNoPermissionError,"NSFileReadNoPermissionError"), | |
(NSFileReadInvalidFileNameError,"NSFileReadInvalidFileNameError"), | |
(NSFileReadCorruptFileError,"NSFileReadCorruptFileError"), | |
(NSFileReadNoSuchFileError,"NSFileReadNoSuchFileError"), |
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 | |
let allCodes: [(POSIXErrorCode, String)] = [ | |
(.E2BIG,"E2BIG"), | |
(.EACCES,"EACCES"), | |
(.EADDRINUSE,"EADDRINUSE"), | |
(.EADDRNOTAVAIL,"EADDRNOTAVAIL"), | |
(.EAFNOSUPPORT,"EAFNOSUPPORT"), | |
(.EAGAIN,"EAGAIN"), | |
(.EALREADY,"EALREADY"), |
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 'package:flutter/material.dart'; | |
void main() => runApp(MyApp()); | |
class MyApp extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
final theme = Theme.of(context); | |
return MaterialApp( | |
title: 'Test', |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.