Kansai.kt #4 〜呑んだくれLT大会〜の発表資料とさせてください。
- @ikesyo
- 株式会社はてな アプリケーションエンジニア@京都
- https://twitter.com/ikesyo
- https://github.com/ikesyo
| public enum ScreenState<Value, Error: Swift.Error> { | |
| case loading | |
| case failed(Error) | |
| case empty | |
| case loaded(Value) | |
| public var isLoading: Bool { | |
| if case .loading = self { return true } | |
| return false | |
| } |
| // https://twitter.com/Kyomesuke/status/1702700847183151125 | |
| import SwiftUI | |
| struct BiggerWidthPreferenceKey: PreferenceKey { | |
| static var defaultValue: CGFloat { .zero } | |
| static func reduce(value: inout CGFloat, nextValue: () -> CGFloat) { | |
| value = max(value, nextValue()) | |
| } |
| // swift-interface-format-version: 1.0 | |
| // swift-compiler-version: Apple Swift version 5.7.1 (swiftlang-5.7.1.135.3 clang-1400.0.29.51) | |
| // swift-module-flags: -target arm64-apple-macos11.0 -enable-objc-interop -enable-library-evolution -swift-version 5 -enforce-exclusivity=checked -O -package-description-version 999.0 -module-link-name XcodeProjectPlugin -module-name XcodeProjectPlugin | |
| // swift-module-flags-ignorable: -enable-bare-slash-regex -user-module-version 21508 | |
| import PackagePlugin | |
| import Swift | |
| public struct XcodeProject { | |
| public let id: XcodeProjectPlugin.XcodeProject.ID | |
| public typealias ID = Swift.String | |
| public let displayName: Swift.String |
Kansai.kt #4 〜呑んだくれLT大会〜の発表資料とさせてください。
$ xcodebuild -list
Resolve Package Graph
Resolved source packages:
MyLibrary: /Users/ikesyo/Desktop/MyLibrary
Information about workspace "MyLibrary":
Schemes:
MyLibrary
関西モバイルアプリ研究会 #24 の発表資料とさせてください。
| import Foundation | |
| class ABC {} | |
| let abc = ABC() | |
| // in-out expression can be used for CConstVoidPointer parameter. | |
| var key: Void? | |
| objc_setAssociatedObject(abc, &key, "value", UInt(OBJC_ASSOCIATION_RETAIN_NONATOMIC)) |
| #!/usr/bin/env bash | |
| # Automatically installs swiftenv and run's swiftenv install. | |
| # This script was designed for usage in CI systems. | |
| git clone -b support-installing-previews --depth 1 https://github.com/ikesyo/swiftenv.git ~/.swiftenv | |
| export SWIFTENV_ROOT="$HOME/.swiftenv" | |
| export PATH="$SWIFTENV_ROOT/bin:$SWIFTENV_ROOT/shims:$PATH" | |
| if [ -f ".swift-version" ] || [ -n "$SWIFT_VERSION" ]; then | |
| swiftenv install -s |
| // https://twitter.com/watura/status/708164552882425856 | |
| import Himotoki | |
| struct Foo: Decodable { | |
| let JSON: [String: AnyJSON] | |
| static func decode(e: Extractor) throws -> Foo { | |
| let dictFromJSONStringTransformer = Transformer<String, [String: AnyJSON]> { string in | |
| guard let data = string.dataUsingEncoding(NSUTF8StringEncoding) else { |
| diff --git a/Source/CarthageKit/Errors.swift b/Source/CarthageKit/Errors.swift | |
| index f15cc3b..07ac87f 100644 | |
| --- a/Source/CarthageKit/Errors.swift | |
| +++ b/Source/CarthageKit/Errors.swift | |
| @@ -28,6 +28,9 @@ public enum CarthageError: ErrorType, Equatable { | |
| /// a dependency. | |
| case RequiredVersionNotFound(ProjectIdentifier, VersionSpecifier) | |
| + /// A git submodule didn't exist which is listed in `.gitmodules` entries. | |
| + case SubmoduleNotFound(String) |