This file contains hidden or 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 | |
| import Foundation | |
| struct Repositories: Decodable { | |
| let repos: [Repository] | |
| enum CodingKeys : String, CodingKey { | |
| case repos = "items" | |
| } | |
| } |
This file contains hidden or 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 | |
| import Foundation | |
| struct Repository: Decodable { | |
| let name: String | |
| let htmlURL: String | |
| enum CodingKeys : String, CodingKey { | |
| case name | |
| case htmlURL = "html_url" |
This file contains hidden or 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
| # where we do the main work of creating a credit card... | |
| class CreditCard | |
| VALID_TYPES = [ | |
| CreditCardType.new("AMEX", /^3(4|7)\d{13}$/), | |
| CreditCardType.new("DCCB", /^30[0-5]\d{11}$/), | |
| CreditCardType.new("DISC", /^6(011|5\d\d)\d{12}$/), | |
| CreditCardType.new("MC", /^5[1-5]\d{14}$/), | |
| CreditCardType.new("VISA", /^4\d{12}(\d{3})?$/) | |
| ] |
This file contains hidden or 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 React, { useState, useRef } from 'react'; | |
| import { View, Text, TouchableOpacity, StyleSheet } from 'react-native'; | |
| export default function App() { | |
| // Set up useState and useRef here... | |
| // Constants for formatting time here... | |
This file contains hidden or 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
| # ======================== | |
| # .gitignore for Xcode 16 | |
| # ======================== | |
| # Tags: Xcode, gitignore, Swift, iOS, macOS, Development | |
| # A comprehensive .gitignore file tailored for Xcode 16 projects. | |
| # Excludes auto-generated, system-specific, and unnecessary files. | |
| # Suitable for Swift, Objective-C, CocoaPods, Carthage, and more. | |
| # --- macOS Files --- | |
| # Ignore system-generated files specific to macOS. |
This file contains hidden or 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 Combine | |
| import Foundation | |
| // MARK: - Movie Database | |
| let movies = [ | |
| "The Matrix", | |
| "The Godfather", | |
| "The Dark Knight", | |
| "Monty Python and the Holy Grail", | |
| "Forrest Gump", |
This file contains hidden or 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
| // TODO: TASK 1 - Handle user touches to detect balloon pops | |
| /* Handle touch-down events during active gameplay | |
| **Note**: This demonstrates several key concepts: | |
| 1. Converting touch coordinates between different coordinate systems | |
| 2. Hit-testing to find which nodes were touched | |
| 3. Filtering nodes by their 'name' property | |
| 4. Early exit patterns with guard statements | |
| - Parameters: |
OlderNewer