Skip to content

Instantly share code, notes, and snippets.

View rudrankriyam's full-sized avatar
🎵
Living.

Rudrank Riyam rudrankriyam

🎵
Living.
View GitHub Profile
@rudrankriyam
rudrankriyam / Work_Product_Submission_GSoC_2019.md
Last active August 19, 2019 15:06
Rocket.Chat iOS VoiceOver Google Summer of Code Project 2019 Submission
@rudrankriyam
rudrankriyam / CustomModifier.swift
Created November 3, 2019 04:49
A custom modifier for creating a beautiful rounded background for your Views in SwiftUI.
//
// CustomModifier.swift
//
// Created by Rudrank Riyam on 03/11/19.
// Copyright © 2019 Rudrank Riyam. All rights reserved.
//
import SwiftUI
struct BackgroundModifier: ViewModifier {
@rudrankriyam
rudrankriyam / Extensions+Modifiers.swift
Last active November 21, 2019 14:11
Creating an Apple like Splash Screen in SwiftUI
import SwiftUI
struct ButtonModifier: ViewModifier {
func body(content: Content) -> some View {
content
.foregroundColor(.white)
.font(.system(.headline, design: .rounded))
.padding()
.frame(minWidth: 0, maxWidth: .infinity, alignment: .center)
.background(RoundedRectangle(cornerRadius: 15, style: .continuous)
@rudrankriyam
rudrankriyam / InformationDetailView.swift
Last active November 24, 2019 05:06
Creating an Apple like Splash Screen in SwiftUI Information Detail View
import SwiftUI
struct InformationDetailView: View {
var title: String = "title"
var subTitle: String = "subTitle"
var imageName: String = "car"
var body: some View {
HStack(alignment: .center) {
Image(systemName: imageName)
@rudrankriyam
rudrankriyam / InformationContainerView.swift
Created November 21, 2019 13:46
Creating an Apple like Splash Screen in SwiftUI Information Container View
import SwiftUI
struct InformationContainerView: View {
var body: some View {
VStack(alignment: .leading) {
InformationDetailView(title: "Match", subTitle: "Match the gradients by moving the Red, Green and Blue sliders for the left and right colors.", imageName: "slider.horizontal.below.rectangle")
InformationDetailView(title: "Precise", subTitle: "More precision with the steppers to get that 100 score.", imageName: "minus.slash.plus")
InformationDetailView(title: "Score", subTitle: "A detailed score and comparsion of your gradient and the target gradient.", imageName: "checkmark.square")
@rudrankriyam
rudrankriyam / Extensions+Modifiers.swift
Last active May 12, 2020 21:15
Creating an Apple like Splash Screen in SwiftUI Extensions + Modifiers
import SwiftUI
struct ButtonModifier: ViewModifier {
func body(content: Content) -> some View {
content
.foregroundColor(.white)
.font(.headline)
.padding()
.frame(minWidth: 0, maxWidth: .infinity, alignment: .center)
.background(RoundedRectangle(cornerRadius: 15, style: .continuous)
@rudrankriyam
rudrankriyam / TitleView.swift
Last active November 24, 2019 05:04
Creating an Apple like Splash Screen in SwiftUI Title View
import SwiftUI
struct TitleView: View {
var body: some View {
VStack {
Image("gradientsIcon")
.resizable()
.aspectRatio(contentMode: .fit)
.frame(width: 180, alignment: .center)
.accessibility(hidden: true)
@rudrankriyam
rudrankriyam / IntroductionView.swift
Last active November 24, 2019 05:06
Creating an Apple like Splash Screen in SwiftUI Introduction View
import SwiftUI
struct IntroductionView: View {
var body: some View {
ScrollView {
VStack(alignment: .center) {
Spacer()
TitleView()
@rudrankriyam
rudrankriyam / CustomStepper.swift
Created November 25, 2019 01:50
Custom Stepper with Haptic Feedback in SwiftUI
struct CustomStepper : View {
@Binding var value: Double
var textColor: Color
var colorName: String
var step = 1.0/255
var body: some View {
HStack {
Text(colorName + " \(Int(value * 255.0))").font(.system(.caption, design: .rounded))
@rudrankriyam
rudrankriyam / FindNumbersWithEvenNumberOfDigits.swift
Created January 20, 2020 05:06
Example for using remainder operator
func findNumbers(_ nums: [Int]) -> Int {
var count = 0
for value in nums {
var number = String(value)
if number.count % 2 == 0 {
count += 1
}
}
return count