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
// Excerpt from `SwiftUI.framework/Modules/SwiftUI.swiftmodule/arm64-apple-ios.swiftinterface` | |
// in Xcode 14.0b1 | |
// | |
// This is how any `Layout`-conforming type becomes a container view | |
// when it's used with a `@ViewBuilder` closure. | |
@available(iOS 16.0, macOS 13.0, tvOS 16.0, watchOS 9.0, *) | |
extension SwiftUI.Layout { | |
@_alwaysEmitIntoClient public func callAsFunction<V>(@SwiftUI.ViewBuilder _ content: () -> V) -> some SwiftUI.View where V : SwiftUI.View { | |
return _VariadicView.Tree( | |
root: _LayoutRoot(self), content: content()) |
This file has been truncated, but you can view the full file.
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
// swift-interface-format-version: 1.0 | |
// swift-compiler-version: Apple Swift version 5.7 (swiftlang-5.7.0.113.10 clang-1400.0.16.2) | |
// swift-module-flags: -target arm64-apple-ios16.0 -enable-objc-interop -enable-library-evolution -swift-version 5 -enforce-exclusivity=checked -Osize -library-level api -library-level api -module-name SwiftUI | |
// swift-module-flags-ignorable: -user-module-version 4.0.66.3.102 | |
import Accessibility | |
import Combine | |
import CoreData | |
import CoreFoundation | |
@_exported import CoreGraphics | |
@_exported import CoreTransferable |
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
// | |
// KeyCommand.swift | |
// Adds Keyboard Shortcuts to SwiftUI on iOS 13 | |
// See https://steipete.com/posts/fixing-keyboardshortcut-in-swiftui/ | |
// License: MIT | |
// | |
// Usage: (wrap view in `KeyboardEnabledHostingController`) | |
// Button(action: { | |
// print("Button Tapped!!") | |
// }) { |
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
// | |
// main.swift | |
// RoutingApproaches | |
// | |
// Created by Chris Eidhof on 01.08.18. | |
// Copyright © 2018 objc.io. 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
#!/bin/bash | |
# Invoke like this: | |
# ./watch.sh my command here | |
# And it will run 'my command here' once, and then when it detects changes. | |
# TODO: Don't just search in the last second. Search for updates since the last | |
# completed build. Otherwise for big directories, midway through your search | |
# you've already taken 1s and you will miss updates. |
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
#!/bin/bash | |
set -e | |
CONTENTS=$(tesseract -c language_model_penalty_non_dict_word=0.8 --tessdata-dir /usr/local/share/tessdata/ "$1" stdout -l eng | xml esc) | |
hex=$((cat <<EOF | |
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> |
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
// | |
// MXSEventTrackingWindow.h | |
// | |
// Created by Max Seelemann on 01.09.16. | |
// Copyright © 2016 The Soulmen. All rights reserved. | |
// | |
/*! | |
@abstract Special window class used for advanced event processing. | |
*/ |
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 NSObject { | |
// Call this when the class being debugged is initialized | |
func debug_ensureOnlyOneInstanceSetup() { | |
let type = self.dynamicType | |
let currentCreatedCount = createdCount(type) | |
assert(currentCreatedCount == 0, "More that 1 \(self) created, potential memory leak") | |
setCreateCount(currentCreatedCount + 1, classType: type) | |
} | |
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
// | |
// CollectionViewDataSource.swift | |
// Khan Academy | |
// | |
// Created by Andy Matuschak on 10/14/14. | |
// Copyright (c) 2014 Khan Academy. All rights reserved. | |
// | |
import UIKit |
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
static Boolean PSPDFCaseInsensitiveEqualCallback(const void *a, const void *b) { | |
id objA = (__bridge id)a, objB = (__bridge id)b; | |
Boolean ret = FALSE; | |
if ([objA isKindOfClass:NSString.class] && [objB isKindOfClass:NSString.class]) { | |
ret = ([objA compare:objB options:NSCaseInsensitiveSearch|NSLiteralSearch] == NSOrderedSame); | |
}else { | |
ret = [objA isEqual:objB]; | |
} | |
return ret; | |
} |
NewerOlder