Skip to content

Instantly share code, notes, and snippets.

import SwiftUI
struct ContentView: View {
static var test:String = ""
static var testBinding = Binding<String>(get: { test }, set: { test = $0 } )
var body: some View {
NavigationView {
VStack(alignment: .leading) {
Text("Enter Review Comments:")
MultilineTextField("Type here", text: ContentView.testBinding, onCommit: {
//
// ChatBubble.swift
// ios14-demo
//
// Created by Prafulla Singh on 25/7/20.
//
import SwiftUI
struct ChatBubble<Content>: View where Content: View {
let direction: ChatBubbleShape.Direction
import SwiftUI
struct CardContent: View {
public var body: some View {
ZStack {
Color.gray
Text("Main View")
SlideOverView {
VStack {
//
// PieChart.swift
// NokiaGame
//
// Created by Prafulla Singh on 13/9/20.
// Copyright © 2020 Prafulla Singh. All rights reserved.
//
import SwiftUI
import SwiftUI
public struct CirclerPercentageProgressViewStyle : ProgressViewStyle {
public func makeBody(configuration: LinearProgressViewStyle.Configuration) -> some View {
VStack(spacing: 10) {
configuration.label
.foregroundColor(Color.secondary)
ZStack {
Circle()
.stroke(lineWidth: 15.0)
.opacity(0.3)
//
// ContentView.swift
// ios14-demo
//
// Created by Prafulla Singh on 23/6/20.
//
import SwiftUI
struct ChipsDataModel: Identifiable {
let id = UUID()
import SwiftUI
struct TabBarDemo: View {
@StateObject var tabItems = TabItems()
var body: some View {
ZStack {
///View1
NavigationView {
ZStack {
@vantruong1094
vantruong1094 / PhotoView.swift
Created July 11, 2022 10:28 — forked from ricardo0100/PhotoView.swift
Photo View with zoom and edges control in SwiftUI
import SwiftUI
struct PhotoView: View {
@State var scale: CGFloat = 1
@State var scaleAnchor: UnitPoint = .center
@State var lastScale: CGFloat = 1
@State var offset: CGSize = .zero
@State var lastOffset: CGSize = .zero
@State var debug = ""
var mediaJSON = { "categories" : [ { "name" : "Movies",
"videos" : [
{ "description" : "Big Buck Bunny tells the story of a giant rabbit with a heart bigger than himself. When one sunny day three rodents rudely harass him, something snaps... and the rabbit ain't no bunny anymore! In the typical cartoon tradition he prepares the nasty rodents a comical revenge.\n\nLicensed under the Creative Commons Attribution license\nhttp://www.bigbuckbunny.org",
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4" ],
"subtitle" : "By Blender Foundation",
"thumb" : "images/BigBuckBunny.jpg",
"title" : "Big Buck Bunny"
},
{ "description" : "The first Blender Open Movie from 2006",
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ElephantsDream.mp4" ],
import Bond
import ReactiveKit
class UserProfileViewModel {
let refreshing = Observable<Bool>(false)
let username = Observable<String>("")
let photos = Observable<[Photos]>([])
private let userViewModel: UserViewModel
private let photosViewModel: PhotosViewModel