This file contains hidden or 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
Network.shared.apollo.fetch(query: ListPersonQuery) { result in | |
switch result { | |
case .success(let graphQLResult): | |
if let items = graphQLResult.data?.listPerson?.items { | |
for conf in items { | |
if let curPerson = conf { | |
//Do whatever here with your Graphql Result | |
print(curPerson) | |
} | |
} |
This file contains hidden or 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 Apollo | |
class Network { | |
static let shared = Network() | |
let apollo: ApolloClient = { | |
let configuration = URLSessionConfiguration.default | |
configuration.httpAdditionalHeaders = [ | |
"x-api-key": "<YOUR-API-KEY>" | |
] |
This file contains hidden or 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 Shimmer: View { | |
@State var loading = true | |
var body: some View { | |
Group { | |
if self.loading { | |
ScrollView(.vertical, showsIndicators: false) { | |
VStack{ | |
HStack { |
This file contains hidden or 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 CardShimmer : View { | |
@State var show = false | |
var center = (UIScreen.main.bounds.width / 2) + 110 //removing padding with this hack | |
var body : some View{ | |
ZStack{ | |
Color.black.opacity(0.08) | |
.frame(height: 250) | |
.cornerRadius(20) | |
Color.white | |
.frame(height: 250) |
This file contains hidden or 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 TextShimmer : View { | |
@State var show = false | |
var body : some View{ | |
ZStack{ | |
Text("Shimmer").fontWeight(.heavy).font(.largeTitle).foregroundColor(Color(UIColor.systemOrange)).redacted(reason: .placeholder) | |
Text("Shimmer").fontWeight(.heavy).font(.largeTitle).foregroundColor(.white) | |
.mask( | |
Capsule() | |
.fill(LinearGradient(gradient: .init(colors: [.clear,.white,.clear]), startPoint: .top, endPoint: .bottom)) | |
.rotationEffect(.init(degrees: 60)) //just to tilt the shimmer a little to prettify it |
This file contains hidden or 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
ScrollView(.vertical, showsIndicators: false) { | |
VStack { | |
HStack { | |
VStack (alignment: .leading) { | |
Text("Shimmer").fontWeight(.heavy).font(.largeTitle).foregroundColor(Color(UIColor.systemOrange)) | |
} | |
Spacer() | |
} | |
ForEach(0..<4){_ in | |
ZStack { |
This file contains hidden or 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
// | |
// Clubhouse.swift | |
// Playground | |
// | |
// Created by Nav Singh on 2/11/21. | |
// | |
import SwiftUI | |
struct Clubhouse: View { |
This file contains hidden or 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 PaymentRing: View { | |
@State var frameSize = UIScreen.main.bounds.width - 120 | |
@State var current: CGFloat = 0 | |
@State var value: Double = 0 | |
var body: some View { | |
VStack { | |
ZStack { | |
Circle().stroke(Color.secondary, style: StrokeStyle(lineWidth: 40, lineCap: .butt, lineJoin: .round)).frame(width: frameSize, height: frameSize) |
This file contains hidden or 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 AppleMusicAnimation: View { | |
@State var show = false | |
@Namespace var namespace | |
var body: some View { | |
VStack { | |
Spacer() | |
VStack (spacing: 15) { |