Skip to content

Instantly share code, notes, and snippets.

View manasdevslopes's full-sized avatar
😍
Focusing

Manas Vijaywargiya manasdevslopes

😍
Focusing
  • Infosys
  • Mumbai
View GitHub Profile
//
// PhoneCallModifier.swift
// WebView
//
// Created by MANAS VIJAYWARGIYA on 03/03/25.
// ------------------------------------------------------------------------
// Copyright © 2025 Blacenova. All rights reserved.
// ------------------------------------------------------------------------
//
@manasdevslopes
manasdevslopes / HapticFeedback.swift
Last active March 19, 2025 06:54
How to add haptics in SwiftUI
//
// HapticFeedback.swift
// Feeback
//
// Created by MANAS VIJAYWARGIYA on 19/03/25.
// ------------------------------------------------------------------------
// Copyright © 2025 Blacenova. All rights reserved.
// ------------------------------------------------------------------------
//
@manasdevslopes
manasdevslopes / ShowUIKitFullScreenModal.swift
Last active February 26, 2025 08:14
Show UIKit Full-Screen Modal
//
// ShowUIKitFullScreenModal.swift
// CameraAVFoundation
//
// Created by MANAS VIJAYWARGIYA on 26/02/25.
// ------------------------------------------------------------------------
// Copyright © 2025 Blacenova. All rights reserved.
// ------------------------------------------------------------------------
//
@manasdevslopes
manasdevslopes / CardBackgroundModifier.swift
Created February 26, 2025 07:20
Card Background Modifier
//
// CardBackgroundModifier.swift
// CameraAVFoundation
//
// Created by MANAS VIJAYWARGIYA on 26/02/25.
// ------------------------------------------------------------------------
// Copyright © 2025 Blacenova. All rights reserved.
// ------------------------------------------------------------------------
//
@manasdevslopes
manasdevslopes / SafeAreaInsetModifier.swift
Created February 26, 2025 07:04
SafeAreaInsetModifier
//
// SafeAreaInsetModifier.swift
// CameraAVFoundation
//
// Created by MANAS VIJAYWARGIYA on 26/02/25.
// ------------------------------------------------------------------------
// Copyright © 2025 Blacenova. All rights reserved.
// ------------------------------------------------------------------------
//
@manasdevslopes
manasdevslopes / KeywordExtraction.swift
Created February 3, 2025 08:52
First Extract the JSON from Localisation file of Xcode, then use below function to extract keywords from JSON and use it as Strings for Translation.
import SwiftUI
var Words = """
"CORNER" : {
},
"Country Picker" : {
},
"Enter your mobile number" : {
@manasdevslopes
manasdevslopes / String+Extensions.swift
Last active December 30, 2024 11:48
to encode a String by removing space and add %20 to make it valid for url
extension String {
func encoded() -> String {
return self.addingPercentEncoding(withAllowedCharacters: .urlHostAllowed) ?? self
}
}
@manasdevslopes
manasdevslopes / JSONDecoder.swift
Created May 11, 2024 14:32
Decode a Dictionary of different types such as [String: String], [String: Int], [String: Bool] & so on...
import SwiftUI
// How to decode a Dictionary, if value is different, let's say [String: String], [String: Int], [String: Bool] & so on...
let json = """
{
"type": "featuredImage",
"rating": 4,
"isVisible": true
}
"""
@manasdevslopes
manasdevslopes / ShimmerEffectModifier.swift
Created April 13, 2023 13:30
Add Shimmer Effect to Text, View etc...
import SwiftUI
struct ShimmerConfig {
var tint: Color
var highlight: Color
var blur: CGFloat = 0
var highlightOpacity: CGFloat = 1
var speed: CGFloat = 2
}
@manasdevslopes
manasdevslopes / Color+Extensions.swift
Last active April 13, 2023 12:23
Create extension of Color to add hex in SwiftUI
import SwiftUI
extension Color {
init(hex: String) {
let hex = hex.trimmingCharacters(in: CharacterSet.alphanumerics.inverted)
var int: UInt64 = 0
Scanner(string: hex).scanHexInt64(&int)
let a, r, g, b: UInt64
switch hex.count {
case 3: // RGB (12-bit)