In your command-line run the following commands:
brew doctorbrew update
| // | |
| // VoronoiFlowGradient and the related sources | |
| // Copyright (c) 2024 Astemir Eleev | |
| // | |
| // Permission is hereby granted, free of charge, to any person obtaining a copy | |
| // of this software and associated documentation files (the "Software"), to deal | |
| // in the Software without restriction, including without limitation the rights | |
| // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
| // copies of the Software, and to permit persons to whom the Software is | |
| // furnished to do so, subject to the following conditions: |
| func checkStreak(of dateArray: [Date]) -> Int{ | |
| let dates = dateArray.sorted() | |
| // Check if the array contains more than 0 dates, otherwise return 0 | |
| guard dates.count > 0 else { return 0 } | |
| // Get full day value of first date in array | |
| let referenceDate = Calendar.current.startOfDay(for: dates.first!) | |
| // Get an array of (non-decreasing) integers | |
| let dayDiffs = dates.map { (date) -> Int in | |
| Calendar.current.dateComponents([.day], from: referenceDate, to: date).day! | |
| } |
| import SwiftUI | |
| extension Calendar { | |
| func generateDates( | |
| inside interval: DateInterval, | |
| matching components: DateComponents | |
| ) -> [Date] { | |
| var dates: [Date] = [] | |
| dates.append(interval.start) |
| let styles: [UIFont.TextStyle] = [ | |
| // iOS 17 | |
| .extraLargeTitle, .extraLargeTitle2, | |
| // iOS 11 | |
| .largeTitle, | |
| // iOS 9 | |
| .title1, .title2, .title3, .callout, | |
| // iOS 7 | |
| .headline, .subheadline, .body, .footnote, .caption1, .caption2, | |
| ] |
| // | |
| // ContentView.swift | |
| // Airdrop Demo | |
| // | |
| // Created by Daniel Kuntz on 7/30/23. | |
| // | |
| import SwiftUI | |
| struct ContentView: View { |
| import notify | |
| import Combine | |
| enum Notify {} | |
| extension Notify { | |
| struct Status: Error { | |
| let rawValue: UInt32 | |
| init(_ rawValue: UInt32) { | |
| self.rawValue = rawValue |
In your command-line run the following commands:
brew doctorbrew update| #!/bin/bash | |
| killall Xcode | |
| xcrun -k | |
| xcodebuild -alltargets clean | |
| rm -rf "$(getconf DARWIN_USER_CACHE_DIR)/org.llvm.clang/ModuleCache" | |
| rm -rf "$(getconf DARWIN_USER_CACHE_DIR)/org.llvm.clang.$(whoami)/ModuleCache" | |
| rm -rf ~/Library/Developer/Xcode/DerivedData/* | |
| rm -rf ~/Library/Caches/com.apple.dt.Xcode/* | |
| open /Applications/Xcode.app |
| a: AM/PM | |
| A: 0~86399999 (Millisecond of Day) | |
| c/cc: 1~7 (Day of Week) | |
| ccc: Sun/Mon/Tue/Wed/Thu/Fri/Sat | |
| cccc: Sunday/Monday/Tuesday/Wednesday/Thursday/Friday/Saturday | |
| d: 1~31 (0 padded Day of Month) | |
| D: 1~366 (0 padded Day of Year) | |
| //MARK:- Events | |
| override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?) { | |
| super.touchesBegan(touches, with: event) | |
| animate(isHighlighted: true) | |
| } | |
| override func touchesEnded(_ touches: Set<UITouch>, with event: UIEvent?) { | |
| super.touchesEnded(touches, with: event) | |
| animate(isHighlighted: false) | |
| } |