This file contains 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
// | |
// CustomModifier.swift | |
// | |
// Created by Rudrank Riyam on 03/11/19. | |
// Copyright © 2019 Rudrank Riyam. All rights reserved. | |
// | |
import SwiftUI | |
struct BackgroundModifier: ViewModifier { |
This file contains 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 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) |
This file contains 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 InformationDetailView: View { | |
var title: String = "title" | |
var subTitle: String = "subTitle" | |
var imageName: String = "car" | |
var body: some View { | |
HStack(alignment: .center) { | |
Image(systemName: imageName) |
This file contains 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 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") |
This file contains 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 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) |
This file contains 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 TitleView: View { | |
var body: some View { | |
VStack { | |
Image("gradientsIcon") | |
.resizable() | |
.aspectRatio(contentMode: .fit) | |
.frame(width: 180, alignment: .center) | |
.accessibility(hidden: true) |
This file contains 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 IntroductionView: View { | |
var body: some View { | |
ScrollView { | |
VStack(alignment: .center) { | |
Spacer() | |
TitleView() |
This file contains 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 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)) |
This file contains 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
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 |
OlderNewer