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
// | |
// Global.swift | |
// MVVM-SwiftUI | |
// | |
// Created by Ben Myers on 9/14/22. | |
// | |
import SwiftUI | |
class Global: ObservableObject { |
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
// | |
// FoodView.swift | |
// MVVM-SwiftUI | |
// | |
// Created by Ben Myers on 9/13/22. | |
// | |
import SwiftUI | |
struct FoodView: View { |
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
// | |
// FoodViewModel.swift | |
// MVVM-SwiftUI | |
// | |
// Created by Ben Myers on 9/13/22. | |
// | |
import SwiftUI | |
import Foundation |
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 | |
/** | |
A protocol for MVVM-architecture. | |
View models manage most (but not all) of a view's logic. When handling large amounts of logic related to a particular view or views, it's useful to have a view model to manage the logic. | |
View models act as the bridge between models and views in MVVM architecture. | |
# Example |
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
// | |
// Food.swift | |
// MVVM-SwiftUI | |
// | |
// Created by Ben Myers on 9/13/22. | |
// | |
import Foundation | |
/** |
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
#!/bin/bash | |
git=$(sh /etc/profile; which git) | |
number_of_commits=$("$git" rev-list HEAD --count) | |
git_release_version=$("$git" describe --tags --always --abbrev=0) | |
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion $number_of_commits" "$INFOPLIST_FILE" | |
/usr/libexec/PlistBuddy -c "Set :CFBundleShortVersionString ${git_release_version#*v}" "$INFOPLIST_FILE" |
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
// | |
// main.cpp | |
// SubsetPermutations | |
// | |
// Created by Ben Myers on 7/11/21. | |
// | |
#include <iostream> | |
#include <cstring> | |
#include <vector> |
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 | |
extension View { | |
static func + <T> (lhs: Self, rhs: T) -> some View where T: View { | |
HStack { | |
lhs | |
rhs | |
} | |
} |
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 themidibus.*; | |
import javax.sound.midi.MidiMessage; | |
MidiBus myBus; | |
PKColor padColor; | |
PKManager pm; | |
// PadKit, PKManager and all subclasses in this project are owned by Ben Myers. | |
// Project initated 11/19/2018 | |
// Latest update 11/21/2018 | |
// Current version 1.2 |