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 { | |
VStack { | |
Color.yellow | |
.frame(maxWidth: .infinity, maxHeight: .infinity) | |
VStack { | |
HStack { |
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 UIKit | |
var str = "Hell12o, p3laygrou4.5nd" | |
var ans = "" | |
str.forEach { s in | |
if (s.description.range(of: "[0-9-.]", | |
options: .regularExpression, | |
range: nil, | |
locale: nil) != nil) { |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="17156" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="BYZ-38-t0r"> | |
<device id="retina6_0" orientation="portrait" appearance="light"/> | |
<dependencies> | |
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="17126"/> | |
<capability name="Safe area layout guides" minToolsVersion="9.0"/> | |
<capability name="System colors in document resources" minToolsVersion="11.0"/> | |
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/> | |
</dependencies> | |
<scenes> |
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
func FirebaseAppCrashlytics() { | |
FirebaseApp.configure() | |
Crashlytics.crashlytics() | |
Crashlytics.crashlytics().setCrashlyticsCollectionEnabled(true) | |
let userInfo = [ | |
NSLocalizedDescriptionKey: NSLocalizedString("The request failed.", comment: ""), | |
NSLocalizedFailureReasonErrorKey: NSLocalizedString("The response returned a 404.", comment: ""), | |
NSLocalizedRecoverySuggestionErrorKey: NSLocalizedString("Does this page exist?", comment: ""), |
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 | |
final class TextModel: ObservableObject { | |
@Published var roomIndex = Array<String>() | |
} | |
struct ContentView: View { | |
@State private var tag : Int? | |
@State private var view: AnyView? |
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 | |
final class ViewModel: ObservableObject { | |
@Published var spIndex = [""] | |
} | |
struct ContentView: View { | |
@ObservedObject var viewModel = ViewModel() | |
init() { |
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 | |
import Combine | |
struct LanguageResponse: Decodable { | |
var statusCode: Int | |
var body: String | |
} | |
struct ContentView: View { |
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 | |
import AVFoundation | |
struct ContentView: View { | |
var body: some View { | |
RepresentableViewController() | |
} | |
} | |
struct ContentView_Previews: PreviewProvider { |
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 { | |
RepresentableViewController(view: HelloWorldColorView()) | |
} | |
} | |
struct ContentView_Previews: PreviewProvider { | |
static var previews: some View { |
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
let array = [1, 2, 3, 4, 5] | |
let total = array.map { $0 }.reduce(.zero, +) | |
let average = array.map { $0 }.reduce(.zero, +)/array.count | |
print(total) | |
print(average) |