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
{"list":[{"IDECodeSnippetCompletionPrefix":"fnv","IDECodeSnippetCompletionScopes":["ClassImplementation"],"IDECodeSnippetContents":"- (void)<#method name#> {\n <#code#>\n}","IDECodeSnippetIdentifier":"6B47EC5A-B22B-4155-8C3F-632CCDFC4502","IDECodeSnippetLanguage":"Xcode.SourceCodeLanguage.Objective-C","IDECodeSnippetPlatformFamily":"all","IDECodeSnippetTitle":"创建一个返回值为空的方法","IDECodeSnippetUserSnippet":true},{"IDECodeSnippetCompletionPrefix":"swiftmark","IDECodeSnippetCompletionScopes":["ClassImplementation"],"IDECodeSnippetContents":"\/\/ MARK: - <#section#>","IDECodeSnippetIdentifier":"A54D18ED-62B6-4468-9F9F-880DEF598DAF","IDECodeSnippetLanguage":"Xcode.SourceCodeLanguage.Swift","IDECodeSnippetPlatformFamily":"all","IDECodeSnippetTitle":"swiftmark","IDECodeSnippetUserSnippet":true},{"IDECodeSnippetCompletionPrefix":"backItem","IDECodeSnippetCompletionScopes":["All"],"IDECodeSnippetContents":"[UIBarButtonItem qmui_backItemWithTarget:self action:@selector(<#selector name#>)];","IDECodeSnippetIdentifier":"4 |
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
struct ContentView: View { | |
var body: some View { | |
VStack { | |
HStack { | |
Text("What is the magic color for this leaf node?") | |
} | |
.environment(\.magicColor, .blue) | |
} | |
.environment(\.magicColor, .red) | |
} |
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
struct DumpingEnvironment<Content>: View where Content: View { | |
@Environment(\.self) var environmentValues | |
var optimizePrint = true | |
let content: Content | |
init(optimized: Bool = true, content: Content) { | |
self.optimizePrint = optimized | |
self.content = content | |
} |
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 ContentView: View { | |
var body: some View { | |
AdaptiveCardView(cardJson: "{ \"type\": \"AdaptiveCard\", \"version\": \"1.0\", \"body\": [ { \"type\": \"Image\", \"url\": \"http://adaptivecards.io/content/adaptive-card-50.png\", \"horizontalAlignment\":\"center\" }, { \"type\": \"TextBlock\", \"horizontalAlignment\":\"center\", \"text\": \"Hello **Adaptive Cards!**\" } ], \"actions\": [ { \"type\": \"Action.OpenUrl\", \"title\": \"Learn more\", \"url\": \"http://adaptivecards.io\" }, { \"type\": \"Action.OpenUrl\", \"title\": \"GitHub\", \"url\": \"http://github.com/Microsoft/AdaptiveCards\" } | |
} | |
} |
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 UIKit | |
import SafariServices | |
class AdaptiveCardViewController: UIViewController, ACRActionDelegate{ | |
internal var cardJson: String = "serialized Adaptive Card JSON to be set" | |
override func viewDidLoad() { | |
super.viewDidLoad() |
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 SwiftUI | |
struct AdaptiveCardView: UIViewControllerRepresentable { | |
var cardJson: String | |
func makeUIViewController(context: Context) -> AdaptiveCardViewController { | |
let vc = AdaptiveCardViewController() | |
vc.cardJson = cardJson |
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
#ifndef BridgingHeader_h | |
#define BridgingHeader_h | |
#import "AdaptiveCards/ACFramework.h" | |
#endif /* BridgingHeader_h */ |
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
platform :ios, '14.0' | |
target 'MSAdaptiveCardExample' do | |
use_frameworks! | |
pod 'AdaptiveCards' | |
end |
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
class MySchemeHandler: NSObject, WKURLSchemeHandler { | |
func webView(_ webView: WKWebView, start urlSchemeTask: WKURLSchemeTask) { | |
print("started for \(urlSchemeTask.request.url?.absoluteString)") | |
guard let url = urlSchemeTask.request.url else { return } | |
var components = URLComponents(url: url, resolvingAgainstBaseURL: true) | |
components?.scheme = "https" | |
guard let finalUrl = components?.url else { return } | |
print("proxy to \(finalUrl.absoluteString)") | |
let task = URLSession.shared.dataTask(with: URLRequest(url: finalUrl)) { receivedData, urlresponse, error in | |
guard let response = urlresponse, let data = receivedData else { urlSchemeTask.didFinish(); return } |
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
// ... | |
#if DEBUG | |
struct ObjectMessageView_Previews: PreviewProvider { | |
static var singleButtonPreview: some View { | |
ObjectMessageView(model: UIModelDataContent(text: "text1", list: nil, form: nil, picture: nil, video: nil, | |
header: UIModelDataHeader(title: UIModelDataValue(value: "A very long title which is maybe even too long but who knows :) who can really tell? I don't know. That is a real interesting question. What do you think?", dataType: UIModelData.ValueType.text.rawValue, rawValue: nil, | |
label: nil, | |
valueState: nil), | |
subtitle: UIModelDataValue(value: "A very long subtitle which is maybe even too long but who knows :) who can really tell |