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
| { | |
| "tools": [ | |
| { | |
| "description": "Retrieves current compiler diagnostics (errors, warnings, notes) for a file in the Xcode project. Returns formatted diagnostic information including severity levels and messages.", | |
| "inputSchema": { | |
| "properties": { | |
| "filePath": { | |
| "description": "The path to the file within the Xcode project organization (e.g., 'ProjectName/Sources/MyFile.swift')", | |
| "type": "string" | |
| }, |
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
| SDK_PATH="$(xcrun --sdk iphonesimulator --show-sdk-path)" && \ | |
| xed "$SDK_PATH/System/Library/Frameworks/SwiftUICore.framework/Modules/SwiftUICore.swiftmodule/arm64-apple-ios-simulator.swiftinterface" && \ | |
| xed "$SDK_PATH/System/Library/Frameworks/SwiftUI.framework/Modules/SwiftUI.swiftmodule/arm64-apple-ios-simulator.swiftinterface" |
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
| // | |
| // VirtualKeyboard.swift | |
| // MacBook Air M1 Zhuyin Keyboard | |
| // Written with SwiftUI ~=300 LOC, < 4hrs | |
| // Created by Ethan Huang on 2021/1/13. | |
| // Twitter: @ethanhuang13 | |
| import SwiftUI | |
| struct VirtualKeyboard: View { |
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
| // | |
| // FacebookAuth.swift | |
| // GitHub: ethanhuang13 | |
| // Twitter: @ethanhuang13 | |
| import AuthenticationServices | |
| import SafariServices | |
| /* | |
| Updated: |
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
| // iOS 17's JSONEncoder is rarely producing a different key sorting order(< 5%), which is ok for JSON itself, but will cause flaky tests. | |
| // It wasn't happened pre-iOS 17. | |
| // https://mastodon.social/@ethanhuang13/110904915670262949 | |
| import XCTest | |
| final class JSONEncoderTests: XCTestCase { | |
| func testEncode() { | |
| struct Model: Codable { | |
| var a: String = "" |
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
| @ViewBuilder | |
| private func build<#name#>(_ viewStore: ViewStoreType) -> some View { | |
| } |
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
| sudo ln -s /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/13.2/ /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport | |
| sudo ln -s /Applications/Xcode-beta.app/Contents/Developer/Platforms/WatchOS.platform/DeviceSupport/6.1/ /Applications/Xcode.app/Contents/Developer/Platforms/WatchOS.platform/DeviceSupport | |
| sudo ln -s /Applications/Xcode-beta.app/Contents/Developer/Platforms/AppleTVOS.platform/DeviceSupport/13.2/ /Applications/Xcode.app/Contents/Developer/Platforms/AppleTVOS.platform/DeviceSupport |
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 { | |
| func isPossiblyVisible() -> Bool { | |
| guard isHidden == false, | |
| alpha > 0, | |
| bounds != .zero, | |
| let window = window, // In a window's view hierarchy | |
| window.isKeyWindow, // Does not consider cases covered by another transparent window | |
| window.hitTest(convert(center, to: nil), with: nil) != self | |
| else { return false } |
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
| // | |
| // ContentView.swift | |
| // ErrorAlert | |
| // | |
| // Created by Ethan Huang on 2022/6/4. | |
| // | |
| import SwiftUI | |
| enum AError: Error { |
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
| //: Playground - noun: a place where people can play | |
| // | |
| // The result is not guaranteed to be accurate. Typically, the function requires 200-400 characters to reliably guess the language of a string. | |
| // Reference: [CFStringTokenizerCopyBestStringLanguage(_:_:)](https://developer.apple.com/reference/corefoundation/1542136-cfstringtokenizercopybeststringl) | |
| // | |
| import Foundation | |
| extension String { | |
| func guessLanguage() -> String { |
NewerOlder