Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

Large diffs are not rendered by default.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<Bucket
uuid = "94D0F5A2-9839-4130-AF7F-DAF525AFAA1A"
type = "1"
version = "2.0">
<Breakpoints>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
uuid = "6A0E0413-E840-410C-BCE6-A3EBF5DAE0B9"
shouldBeEnabled = "No"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "TravelGuide/WelcomScreenView.swift"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "13"
endingLineNumber = "13"
landmarkName = "body"
landmarkType = "24">
</BreakpointContent>
</BreakpointProxy>
</Breakpoints>
</Bucket>
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>SchemeUserState</key>
<dict>
<key>TravelGuide.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>0</integer>
</dict>
</dict>
</dict>
</plist>
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"colors" : [
{
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"images" : [
{
"idiom" : "universal",
"platform" : "ios",
"size" : "1024x1024"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"images" : [
{
"filename" : "Alcatraz_Island_photo_Don_Ramey_Logan.jpg",
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"images" : [
{
"filename" : "0940924B-A1E4-4A46-99ED-288BC89CEA59_1_105_c.jpeg",
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"images" : [
{
"filename" : "63CDFB69-0EB8-410C-A4DC-9236CE2266E9_1_102_o.jpeg",
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"images" : [
{
"filename" : "FB3F6E1A-69EE-414D-9BE8-A5FDA346C207_1_102_o.jpeg",
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 16 additions & 0 deletions StringCatalogEnumSample/TravelGuide/TravelGuide/Destination.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
//
// Destination.swift
// TravelGuide
//
// Created by Ankit Mane on 3/20/24.
//

import Foundation

struct Destination {
let name: String
let imageName: String
let description: String
let attractionsCount: Int
let attractions: [String]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
//
// DestinationDetailView.swift
// TravelGuide
//
// Created by Ankit Mane on 3/20/24.
//

import Foundation
import SwiftUI

struct DestinationDetailView: View {
var destination: Destination

var body: some View {
ZStack {
LinearGradient(gradient: Gradient(colors: [.blue, .white]),
startPoint: .topLeading,
endPoint: .bottomTrailing)
.edgesIgnoringSafeArea(.all)

ScrollView {
VStack {
Image(destination.imageName) // Ensure you have this image in your assets
.resizable()
.frame(width: 250, height: 250)
.scaledToFit()
.cornerRadius(10)
.shadow(radius: 5)
.padding()

Text(destination.name)
.font(.largeTitle)
.fontWeight(.bold)
.padding([.top, .bottom], 5)

Text(destination.description)
.font(.body)
.padding()

VStack(alignment: .leading) {
Text(String.localizedStringWithFormat(NSLocalizedString(XCS.lldAttractions.rawValue, comment: ""), Int64(destination.attractionsCount)))
.font(.headline)
.padding([.top, .bottom, .leading])

ForEach(destination.attractions, id: \.self) { attraction in
Text("• \(attraction)")
.padding([.bottom, .leading])
}
}
.frame(maxWidth: .infinity, alignment: .leading)
.background(Color.black.opacity(0.2))
.cornerRadius(10)
.shadow(radius: 5)
}
.padding()
}
.navigationTitle(destination.name)
.navigationBarTitleDisplayMode(.inline)
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
//
// DestinationListViewModel.swift
// TravelGuide
//
// Created by Ankit Mane on 3/20/24.
//

import Foundation
class DestinationListViewModel: ObservableObject {
@Published var destinations: [Destination] = []

// Initializer or function to load destinations
func loadDestinations() {

destinations = [
Destination(
name: XCS.bigSur.string,
imageName: "big_sur_image_name",
description: XCS.bigSureDesc.string,
attractionsCount: 3,
attractions: [
XCS.bigSurAttraction1.string,
XCS.bigSurAttraction2.string,
XCS.bigSurAttraction3.string
]
),
Destination(
name: XCS.goldenGateBridge.string,
imageName: "golden_gate_bridge_image_name",
description: XCS.goldenGateBridgeDesc.string,
attractionsCount: 1,
attractions: [
XCS.goldenGateBridgeAttraction.string
]
),
Destination(
name: XCS.alcatraz.string,
imageName: "alcatraz_image_name",
description: XCS.alcatrazDesc.string,
attractionsCount: 2,
attractions: [
XCS.alcatrazAttraction1.string,
XCS.alcatrazAttraction2.string
]
),
Destination(
name: XCS.twinPeaks.string,
imageName: "twin_peaks_image_name",
description: XCS.twinPeaksDesc.string,
attractionsCount: 1,
attractions: [
XCS.twinPeaksAttraction.string
]
)
]

}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
//
// DestinationViewModel.swift
// TravelGuide
//
// Created by Ankit Mane on 3/20/24.
//

import Foundation
class DestinationViewModel: ObservableObject {
@Published var destination: Destination

init(destination: Destination) {
self.destination = destination
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
//
// DestinationsView.swift
// TravelGuide
//
// Created by Ankit Mane on 3/20/24.
//

import Foundation
import SwiftUI

struct DestinationsView: View {
@ObservedObject var viewModel = DestinationListViewModel()

var body: some View {
ZStack {
LinearGradient(gradient: Gradient(colors: [.blue, .white]),
startPoint: .topLeading,
endPoint: .bottomTrailing)
.edgesIgnoringSafeArea(.all)

ScrollView {
LazyVStack(spacing: 0) {
ForEach(viewModel.destinations, id: \.name) { destination in
NavigationLink(destination: DestinationDetailView(destination: destination)) {
HStack {
Image(destination.imageName) // Ensure you have these images in your assets
.resizable()
.frame(width: 50, height: 50)
.cornerRadius(10)
Text(destination.name)
Spacer()
Image(systemName: "chevron.right")
}
.padding()
.frame(maxWidth: .infinity, alignment: .leading)
.background(Color.white.opacity(0.5))
.cornerRadius(10)
.shadow(radius: 1)
.padding(.horizontal)
.padding(.vertical, 4)
}
.buttonStyle(PlainButtonStyle()) // Remove the button highlight effect on tap
}
}
}
.navigationTitle(XCS.travelDestinations.string)
}
.onAppear {
viewModel.loadDestinations() // Load destinations when the view appears
}
}
}

8 changes: 8 additions & 0 deletions StringCatalogEnumSample/TravelGuide/TravelGuide/File.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
//
// File.swift
// TravelGuide
//
// Created by Ankit Mane on 3/20/24.
//

import Foundation
Loading