Skip to content

Instantly share code, notes, and snippets.

View navsing's full-sized avatar
🏠
Working from home

Navdeep Singh navsing

🏠
Working from home
View GitHub Profile
@navsing
navsing / sharesheet.swift
Created August 27, 2020 21:57
Recreate iOS share sheet to any app in a minute
import SwiftUI
struct ShareSheet: View {
@State var show = false
@State var items: [Any] = []
var body: some View {
VStack {
Button(action: {
//Add Logic to add items here
self.show.toggle()
@navsing
navsing / iosSplash.swift
Created August 20, 2020 23:30
Recreate iOS style Welcome Screen to any app in 3 minutes
//
// Welcome.swift
// Playground
//
// Created by Nav Singh on 8/20/20.
//
import SwiftUI
struct Welcome: View {
@navsing
navsing / threads.swift
Created August 11, 2020 23:15
Recreating the Threads app by Instagram using SwiftUI and Swift Playgrounds on iPad
import SwiftUI
import PlaygroundSupport
struct Screen: View {
var body: some View {
VStack (spacing: 24) {
HStack {
Image(systemName: "line.horizontal.3").padding().background(Color.secondary.opacity(0.2)).clipShape(Circle())
Spacer()
@navsing
navsing / iPhone12ProWebsite.swift
Created July 15, 2020 19:05
iPhone 12 Pro Buying Experience
//
// Apple.swift
// Playground
//
// Created by Navdeep Singh on 7/14/20.
//
import SwiftUI
struct Apple: View {
@navsing
navsing / MessagesPart-III.swift
Last active March 6, 2025 14:32
Recreating the Messages App Part III (Chat Bubble Shape) using SwiftUI and Swift Playgrounds on iPad
import SwiftUI
import PlaygroundSupport
struct Screen: View {
var body: some View {
VStack {
HStack {
Spacer()
Text("Here’s to the crazy ones, the misfits, the rebels, the troublemakers, the round pegs in the square holes… the ones who see things differently — they’re not fond of rules…").padding().background(Color(UIColor.systemBlue)).clipShape(BubbleShape(myMessage: true)).foregroundColor(.white)
@navsing
navsing / MessagesPart-II.swift
Last active February 24, 2025 20:45
Recreating the Messages App Part II (Conversation View) using SwiftUI and Swift Playgrounds on iPad
import SwiftUI
import PlaygroundSupport
struct Screen: View {
var body: some View {
VStack {
ChatTopView()
ConversationView()
ChatBottomBar().padding(.bottom, 10)
}
@navsing
navsing / MessagesPart-I.swift
Last active August 26, 2024 02:14
Recreating the Messages App Part I using SwiftUI and Swift Playgrounds on iPad
import SwiftUI
import PlaygroundSupport
struct Screen: View {
var body: some View {
NavigationView {
VStack {
ScrollView (.vertical, showsIndicators: false) {
SearchBar()
Pins()
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)
}
}
Network.shared.apollo.perform(mutation: CreatePersonMutation(input: personInput)) { result in
switch result {
case .success(let graphQLResult):
print(graphQLResult)
case .failure(let error):
print("Failure! Error: \(error)")
}
}
//
// LandingPage.swift
// Swiftlycode
//
// Created by Navdeep Singh on 5/19/20.
// Copyright © 2020 Navdeep Singh. All rights reserved.
//
import SwiftUI