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 SwiftUI | |
struct PageView<Page: View>: UIViewControllerRepresentable { | |
var pages: [Page] | |
@Binding var currentPage: Int | |
func makeUIViewController(context: Context) -> UIPageViewController { | |
let pageViewController = UIPageViewController(transitionStyle: .scroll, navigationOrientation: .horizontal) | |
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 SwiftUI | |
struct _DisclosureIndicator: View { | |
var body: some View { | |
Image(systemName: "chevron.forward") | |
.imageScale(.small) | |
.font(.body.weight(.semibold)) | |
.foregroundColor(.primary.opacity(0.25)) | |
} | |
} |
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 | |
import KeychainAccess | |
@propertyWrapper | |
struct KeychainStorage<Value: Codable> { | |
let key: String | |
let service: String | |
let initialValue: Value | |
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 KingFisher | |
struct KFLinkPresentationIconProvider: ImageDataProvider { | |
let url: URL | |
let cacheKey: String | |
init(url: URL, cacheKey: String? = nil) { | |
self.url = url | |
self.cacheKey = cacheKey ?? url.absoluteString |
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 SwiftUI | |
func extractViewsFromContent<Content: View> (@ViewBuilder content: () -> Content) -> [Any] { | |
let tupleView = content() | |
let tupleViewMirror = Mirror(reflecting: tupleView) | |
let tuple = tupleViewMirror.children.first!.value | |
let tupleMirror = Mirror(reflecting: tuple) | |
let views = tupleMirror.children.map { $0.value } | |
return views | |
} |
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 MessageUI | |
import SwiftUI | |
struct MailComposer { | |
struct MessageBody { | |
var body: String | |
var isHTML: Bool | |
} | |
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/sh | |
PRODUCT_BUNDLE_VERSION=$(date "+%Y%m%d%H%M") | |
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion ${PRODUCT_BUNDLE_VERSION}" "${BUILT_PRODUCTS_DIR}/${INFOPLIST_PATH}" | |
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion ${PRODUCT_BUNDLE_VERSION}" "${PROJECT_DIR}/${INFOPLIST_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
import Swift | |
extension Result { | |
func casting<NewSuccess, NewFailure>() -> Result<NewSuccess, NewFailure>? { | |
switch self { | |
case .success(let success as NewSuccess) where Failure.self is NewFailure.Type: return .success(success) | |
case .failure(let failure as NewFailure) where Success.self is NewSuccess.Type: return .failure(failure) | |
default: return nil | |
} | |
} |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
NewerOlder