I guess it should be
platform :ios, '11.0'
target 'MyProject' do
	use_frameworks!
	pod 'Firebase/Auth'
	pod 'GoogleSignIn'
end
according to this stack overflow topic. - https://stackoverflow.com/questions/57316862/what-does-platform-in-pod-file-refer-to
Post
Replies
Boosts
Views
Activity
Your way of closing the sheet looks a little awkward to me, so tried something like this and works in my environment. Yes, thank you. Again, have nice holidays.
Excellent! Thanks a lot, OOPer. Once I close this sheet window, I cannot open it again by clicking on the 'Show me a sheet' button. Do you happen to know what I need to do? Merry Christmas to you if I don't see you again before it...
Oops... My mistake... I've resolved the problem.
Oops, my apology... It was just a coding error that has caused this compiler error. I guess that's what OOPer said under a similar topic. Silly me...
Looks like there is quite a bit of repetitive code, I'd extract it to subviews / shared components and in general try keeping views more lightweight. ilionic, thank you.
If I run code with just one horizontal stack like
var body: some View {
	 VStack(spacing: 0.0) {
			HStack(spacing: 0.0) {
				 ForEach((0...6), id: \.self) {
						index in
						Button(buttonTitles[index] ?? "") {
							 eventPresented = true
							 selectedEventIndex = index + 1 - self.weekIndex
						}
						.foregroundColor(titleColors[index])
						.overlay(Text(eventNumbers[index] ?? "").font(.footnote).foregroundColor(.blue).offset(x: -16, y: -16))
						.buttonStyle(BorderlessButtonStyle())
						.frame(width: 48, height: 48, alignment: .center)
						.background(RoundedRectangle(cornerRadius: 2)
						.fill(fillColors[index])
						.shadow(color: shadowColors[index], radius: 2, x: 0, y: 0)
						)
						.sheet(isPresented: $eventPresented) {
							 EventView(eventVisible: self.$eventPresented, dayFromParent: self.$selectedEventIndex, monthFromParent: 11)
						}
				 }
			}
			.frame(width: 336.0, height: 48.0, alignment: .leading)
	 }
}
, the compiler won't do it. Could you suggest to me how I could improve it? Thank you.
That unable to type-check may occur when there is some primitive errors in such declarations. OOPer, thank you. With all due respect, the code will run without the third parameter.
The variables are set up as follows.
weekIndex = 2
for _ in 0..<2 {
	 buttonTitles.append("")
	 fillColors.append(Color.clear)
	 shadowColors.append(Color.clear)
	 titleColors.append(Color.clear)
}
for i in 0..<38 - 2 {
	 if i < numberOfDays {
			buttonTitles.append(String(i + 1))
			if let day = myDay {
				 if i + 1 == day {
						fillColors.append(Color.green)
						titleColors.append(Color.white)
						} else {
						fillColors.append(Color.white)
						titleColors.append(Color.black)
				 }
				 } else {
				 fillColors.append(Color.white)
				 titleColors.append(Color.black)
			}
			shadowColors.append(Color.black.opacity(0.4))
			} else {
			buttonTitles.append("")
			fillColors.append(Color.clear)
			shadowColors.append(Color.clear)
			titleColors.append(Color.clear)
	 }
}
If I run code with just one horizontal stack
var body: some View {
	 VStack(spacing: 0.0) {
			HStack(spacing: 0.0) {
				 ForEach((0...6), id: \.self) {
						index in
						Button(buttonTitles[index] ?? "") {
							 eventPresented = true
							 selectedEventIndex = index + 1 - self.weekIndex
						}
						.foregroundColor(titleColors[index])
						.overlay(Text(eventNumbers[index] ?? "").font(.footnote).foregroundColor(.blue).offset(x: -16, y: -16))
						.buttonStyle(BorderlessButtonStyle())
						.frame(width: 48, height: 48, alignment: .center)
						.background(RoundedRectangle(cornerRadius: 2)
						.fill(fillColors[index])
						.shadow(color: shadowColors[index], radius: 2, x: 0, y: 0)
						)
						.sheet(isPresented: $eventPresented) {
							 EventView(eventVisible: self.$eventPresented, dayFromParent: self.$selectedEventIndex, monthFromParent: 11)
						}
				 }
			}
			.frame(width: 336.0, height: 48.0, alignment: .leading)
	 }
}
, the compiler won't do it.
Seems to be the same issue as in this thread. Yes. I thought so. I tried using it inside the button, which failed. I guess I need to go back to reading a book. I have one, but... Thanks a lot.
Thank you, workingdogintokyo and OOPer. This time, I choose my own answer as a solution.
What is important is that do you want to invoke makeButtons at each time when the ZStack appears? In fact, the answer is Yes, OOPer. Thanks for asking the question.
Do I have to call it with onAppear like the following?
import SwiftUI
struct ContentView: View {
		@State private var eventPresented = false
		@State var fillColors: [Color] = Array(repeating: Color.white, count: 38)
		@State var buttonTitles: [String?] = Array(repeating: nil, count: 38)
		
		var body: some View {
				VStack {
						ZStack() {
								
						}.onAppear { makeButtons() }
						
						/* cal buttons */
						VStack(spacing: 0.0) {
								HStack(spacing: 0.0) {
										ForEach((0...6), id: \.self) {
												Button(buttonTitles[$0] ?? "") {
														eventPresented = true
												}
												.buttonStyle(BorderlessButtonStyle())
												.frame(width: 48, height: 48, alignment: .center)
												.background(RoundedRectangle(cornerRadius: 2)
																				.fill(fillColors[$0])
																				.shadow(color: Color.black.opacity(0.4), radius: 2, x: 0, y: 0)
												)
										}
								}
								...
								...
								...
								HStack(alignment: .top, spacing: 0.0) {
										ForEach((35...36), id: \.self) {
												Button(buttonTitles[$0] ?? "") {
														
												}
												.buttonStyle(BorderlessButtonStyle())
												.frame(width: 48, height: 48, alignment: .center)
												.background(RoundedRectangle(cornerRadius: 2)
																				.fill(fillColors[$0])
																				.shadow(color: Color.black.opacity(0.4), radius: 2, x: 0, y: 0)
												)
										}
								}
								.frame(width: 336.0, height: 48.0, alignment: .leading)
						}
				}.frame(minWidth: 370, idealWidth: 370, maxWidth: 370, minHeight: 420, idealHeight: 420, maxHeight: 420, alignment: .top)
		}
		
		func makeButtons() {
				buttonTitles.removeAll()
				for i in 0..<38 {
						buttonTitles.append(String(i + 1))
				}
				fillColors.removeAll()
				for _ in 0..<2 {
						fillColors.append(Color.clear)
				}
				for _ in 0..<36 {
						fillColors.append(Color.white)
				}
		}
}
Interestingly, there is a function called overlay.
Button("1") {
		
}
.overlay(Text("4").font(.footnote).foregroundColor(.blue).offset(x: -16, y: -16))
.buttonStyle(BorderlessButtonStyle())
.frame(width: 48, height: 48, alignment: .center)
.background(
		RoundedRectangle(cornerRadius: 2)
				.fill(Color.white)
				.shadow(color: Color.black.opacity(0.4), radius: 2, x: 0, y: 0)
)
Thank you, OOPer. The concern that I had with Text is that the string won't be necessarily placed inside the corresponding button. If I use your code, a small number will appear to the left of the corresponding button, not inside the corresponding button. I'm sorry if I failed to explain my needs initially.
Thank you, again, OOPer. That's an odd closure expression, which I have never seen in Swift.
That's interesting. Thanks, OOper. I have to take a close look at what you have done.