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
// | |
// ScrollHeaderToolbar.swift | |
// Author: Mark Battistella | |
// Website: https://markbattistella.com | |
// | |
// | |
// Purpose: | |
// This SwiftUI implementation provides a dynamic navigation interface where a large navigation | |
// title, along with additional UI elements like buttons, transitions into a smaller inline | |
// navigation title as the user scrolls. This mimics the behaviour found in Apple’s first-party |
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
// | |
// Author: Mark Battistella | |
// Website: https://markbattistella.com | |
// | |
#if os(iOS) | |
import UIKit | |
#else | |
import Foundation | |
#endif |
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
#!/bin/sh | |
# | |
# auto-increment.sh | |
# Author: Mark Battistella | |
# Website: https://markbattistella.com | |
# | |
# get the path for the config file | |
CONFIG_FILE="${PROJECT_DIR}/Shared/Data/Config.xcconfig" |
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
javascript:(function(){ | |
if(window.location.host === 'www.youtube.com' && window.location.pathname === '/watch'){ | |
var videoId = window.location.search.split('v=')[1]; | |
var ampersandPosition = videoId.indexOf('&'); | |
if(ampersandPosition != -1) { | |
videoId = videoId.substring(0, ampersandPosition); | |
} | |
var embedUrl = 'https://www.youtube.com/embed/' + videoId; | |
window.open(embedUrl, 'youtube', 'width=1920,height=1080'); | |
} |
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
<?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>FILEHEADER</key> | |
<string> | |
// Project: ___PROJECTNAME___ | |
// Author: ___FULLUSERNAME___ | |
// Website: ___WEBSITE___ | |
// |
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
final class CoreDataManager { | |
// -- singleton initalisation | |
static let shared = CoreDataManager() | |
var container: NSPersistentContainer | |
// -- managed object context | |
var managedObjectContext: NSManagedObjectContext { | |
container.viewContext |
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 ContentView_Previews: PreviewProvider { | |
static var previews: some View { | |
ContentView() | |
} | |
} | |
struct ContentView: View { | |
@State var hStackSize: CGSize = .zero | |
var body: some View { |
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 MaskingViewModifier: ViewModifier { | |
@Environment(\.scenePhase) | |
private var scenePhase | |
@State private var selectedPhase: ScenePhase? | |
func body(content: Content) -> some View { | |
ZStack { | |
content |