mac support
mac/ios parity
This commit is contained in:
Micah Gomez 2021-08-17 23:33:38 -06:00
parent f524b51bf5
commit 91f4c26678
8 changed files with 184 additions and 25 deletions

View file

@ -92,7 +92,7 @@
BD7A5E38251034D7003E992C /* StoreKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = StoreKit.framework; path = System/Library/Frameworks/StoreKit.framework; sourceTree = SDKROOT; };
BD7D35D52510042D00A61B6B /* night.gif */ = {isa = PBXFileReference; lastKnownFileType = image.gif; path = night.gif; sourceTree = "<group>"; };
BD8D804625188B2200389258 /* hssceneExtension.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = hssceneExtension.entitlements; sourceTree = "<group>"; };
BDA060F62447F3E6009C72CE /* Nook Music.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Nook Music.app"; sourceTree = BUILT_PRODUCTS_DIR; };
BDA060F62447F3E6009C72CE /* AC Tape Deck.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "AC Tape Deck.app"; sourceTree = BUILT_PRODUCTS_DIR; };
BDA060F92447F3E6009C72CE /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
BDA060FB2447F3E6009C72CE /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = "<group>"; };
BDA060FD2447F3E6009C72CE /* FirstViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FirstViewController.swift; sourceTree = "<group>"; };
@ -204,7 +204,7 @@
BDA060F72447F3E6009C72CE /* Products */ = {
isa = PBXGroup;
children = (
BDA060F62447F3E6009C72CE /* Nook Music.app */,
BDA060F62447F3E6009C72CE /* AC Tape Deck.app */,
BDA0610E2447F3F3009C72CE /* grandfatherrockTests.xctest */,
BDA061192447F3F3009C72CE /* grandfatherrockUITests.xctest */,
BDE56CB825186B0500A47239 /* hssceneExtension.appex */,
@ -293,7 +293,7 @@
BDF748A32616C11500877F21 /* Zip */,
);
productName = grandfatherrock;
productReference = BDA060F62447F3E6009C72CE /* Nook Music.app */;
productReference = BDA060F62447F3E6009C72CE /* AC Tape Deck.app */;
productType = "com.apple.product-type.application";
};
BDA0610D2447F3F3009C72CE /* grandfatherrockTests */ = {
@ -649,7 +649,7 @@
CODE_SIGN_ENTITLEMENTS = grandfatherrock/grandfatherrock.entitlements;
CODE_SIGN_IDENTITY = "iPhone Developer";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 2;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = PRBH2T6668;
INFOPLIST_FILE = grandfatherrock/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
@ -657,10 +657,10 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.3;
MARKETING_VERSION = 1.3.1;
PRODUCT_BUNDLE_IDENTIFIER = dev.mpg13.grandfatherrock;
PRODUCT_NAME = "Nook Music";
SUPPORTS_MACCATALYST = NO;
PRODUCT_NAME = "AC Tape Deck";
SUPPORTS_MACCATALYST = YES;
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
@ -675,7 +675,7 @@
CODE_SIGN_ENTITLEMENTS = grandfatherrock/grandfatherrock.entitlements;
CODE_SIGN_IDENTITY = "iPhone Developer";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 2;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = PRBH2T6668;
INFOPLIST_FILE = grandfatherrock/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
@ -683,10 +683,10 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.3;
MARKETING_VERSION = 1.3.1;
PRODUCT_BUNDLE_IDENTIFIER = dev.mpg13.grandfatherrock;
PRODUCT_NAME = "Nook Music";
SUPPORTS_MACCATALYST = NO;
PRODUCT_NAME = "AC Tape Deck";
SUPPORTS_MACCATALYST = YES;
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
@ -785,7 +785,7 @@
CODE_SIGN_ENTITLEMENTS = hssceneExtension.entitlements;
CODE_SIGN_IDENTITY = "iPhone Developer";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 2;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = PRBH2T6668;
INFOPLIST_FILE = hsscene/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
@ -794,11 +794,11 @@
"@executable_path/Frameworks",
"@executable_path/../../Frameworks",
);
MARKETING_VERSION = 1.3;
MARKETING_VERSION = 1.3.1;
PRODUCT_BUNDLE_IDENTIFIER = dev.mpg13.grandfatherrock.hsscene;
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
SUPPORTS_MACCATALYST = NO;
SUPPORTS_MACCATALYST = YES;
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
@ -813,7 +813,7 @@
CODE_SIGN_ENTITLEMENTS = hssceneExtension.entitlements;
CODE_SIGN_IDENTITY = "iPhone Developer";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 2;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = PRBH2T6668;
INFOPLIST_FILE = hsscene/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
@ -822,11 +822,11 @@
"@executable_path/Frameworks",
"@executable_path/../../Frameworks",
);
MARKETING_VERSION = 1.3;
MARKETING_VERSION = 1.3.1;
PRODUCT_BUNDLE_IDENTIFIER = dev.mpg13.grandfatherrock.hsscene;
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
SUPPORTS_MACCATALYST = NO;
SUPPORTS_MACCATALYST = YES;
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";

View file

@ -49,12 +49,12 @@
<key>grandfatherrock.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>0</integer>
<integer>1</integer>
</dict>
<key>hssceneExtension.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>1</integer>
<integer>0</integer>
</dict>
<key>hswidgetExtension.xcscheme_^#shared#^_</key>
<dict>

View file

@ -22,8 +22,8 @@
<rect key="frame" x="0.0" y="0.0" width="320" height="568"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<view contentMode="scaleToFill" misplaced="YES" translatesAutoresizingMaskIntoConstraints="NO" id="1nc-vR-sG8">
<rect key="frame" x="-1" y="0.0" width="320" height="519"/>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="1nc-vR-sG8">
<rect key="frame" x="0.0" y="0.0" width="320" height="519"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</view>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="ACBackgroundDay" translatesAutoresizingMaskIntoConstraints="NO" id="Ujw-y3-bt3">
@ -84,6 +84,7 @@
<constraint firstItem="1nc-vR-sG8" firstAttribute="leading" secondItem="tsR-hK-woN" secondAttribute="leading" id="B9F-vB-YN1"/>
<constraint firstItem="PQr-Ze-W5v" firstAttribute="trailing" secondItem="ERT-d4-fi5" secondAttribute="trailing" constant="8" id="BuE-zP-hu9"/>
<constraint firstAttribute="bottom" secondItem="1nc-vR-sG8" secondAttribute="bottom" id="D6C-6f-D6F"/>
<constraint firstItem="1nc-vR-sG8" firstAttribute="centerX" secondItem="tsR-hK-woN" secondAttribute="centerX" id="Ffd-nd-etd"/>
<constraint firstItem="ERT-d4-fi5" firstAttribute="leading" secondItem="PQr-Ze-W5v" secondAttribute="leading" constant="8" id="IuE-ro-63E"/>
<constraint firstItem="Ujw-y3-bt3" firstAttribute="bottom" secondItem="PQr-Ze-W5v" secondAttribute="bottom" id="M3J-pn-Sam"/>
<constraint firstItem="Ujw-y3-bt3" firstAttribute="leading" secondItem="PQr-Ze-W5v" secondAttribute="leading" constant="-2" id="M4e-yJ-sli"/>
@ -382,7 +383,7 @@
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Icon by Isabella Gomez" textAlignment="center" lineBreakMode="wordWrap" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="slx-7G-t3k">
<rect key="frame" x="20" y="525.5" width="280" height="14.5"/>
<rect key="frame" x="20" y="8" width="280" height="14.5"/>
<fontDescription key="fontDescription" type="system" pointSize="12"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
@ -404,19 +405,38 @@
<action selector="websiteButton:" destination="8LK-WS-C3a" eventType="touchUpInside" id="y2E-1G-XVT"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="ygq-ZZ-lJS">
<rect key="frame" x="16" y="478" width="288" height="50"/>
<color key="backgroundColor" white="0.66666666669999997" alpha="0.40000000000000002" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstAttribute="height" constant="50" id="WDC-re-i5U"/>
</constraints>
<color key="tintColor" systemColor="labelColor"/>
<state key="normal" title="Dismiss"/>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="number" keyPath="layer.cornerRadius">
<integer key="value" value="16"/>
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
<connections>
<action selector="dismiss:" destination="8LK-WS-C3a" eventType="touchUpInside" id="4bD-mt-lSq"/>
</connections>
</button>
</subviews>
<viewLayoutGuide key="safeArea" id="Qng-vH-mPk"/>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
<constraints>
<constraint firstItem="Qng-vH-mPk" firstAttribute="trailing" secondItem="slx-7G-t3k" secondAttribute="trailing" constant="20" id="0Lz-gI-bvP"/>
<constraint firstItem="gD8-gD-kvG" firstAttribute="top" secondItem="SvO-8B-YAs" secondAttribute="bottom" constant="8" symbolic="YES" id="6Kl-jm-0xO"/>
<constraint firstItem="Qng-vH-mPk" firstAttribute="bottom" secondItem="slx-7G-t3k" secondAttribute="bottom" constant="8" id="6p5-Fv-Rm0"/>
<constraint firstAttribute="top" secondItem="slx-7G-t3k" secondAttribute="top" constant="-8" id="6p5-Fv-Rm0"/>
<constraint firstItem="Qng-vH-mPk" firstAttribute="bottom" secondItem="ygq-ZZ-lJS" secondAttribute="bottom" constant="20" id="7X5-dg-B4O"/>
<constraint firstItem="Qng-vH-mPk" firstAttribute="trailing" secondItem="SvO-8B-YAs" secondAttribute="trailing" constant="16" id="FNp-wP-MqG"/>
<constraint firstItem="slx-7G-t3k" firstAttribute="leading" secondItem="Qng-vH-mPk" secondAttribute="leading" constant="20" id="Hf3-fu-YFw"/>
<constraint firstItem="Bo4-PM-Ch5" firstAttribute="leading" secondItem="Qng-vH-mPk" secondAttribute="leading" constant="16" id="J81-9H-TDg"/>
<constraint firstItem="8BV-wp-YO2" firstAttribute="top" secondItem="GLx-A2-QUQ" secondAttribute="bottom" constant="8" symbolic="YES" id="JIW-Fd-Rao"/>
<constraint firstItem="Qng-vH-mPk" firstAttribute="trailing" secondItem="7aC-B4-rXp" secondAttribute="trailing" constant="16" id="MWS-Gk-aGc"/>
<constraint firstItem="Qng-vH-mPk" firstAttribute="trailing" secondItem="gD8-gD-kvG" secondAttribute="trailing" constant="16" id="MZO-QU-Llr"/>
<constraint firstItem="Qng-vH-mPk" firstAttribute="trailing" secondItem="ygq-ZZ-lJS" secondAttribute="trailing" constant="16" id="RUR-zh-TjO"/>
<constraint firstItem="ygq-ZZ-lJS" firstAttribute="leading" secondItem="Qng-vH-mPk" secondAttribute="leading" constant="16" id="T2q-Mf-eTF"/>
<constraint firstItem="11I-Jn-Iz5" firstAttribute="leading" secondItem="Qng-vH-mPk" secondAttribute="leading" constant="16" id="T9p-4Y-zLx"/>
<constraint firstItem="8BV-wp-YO2" firstAttribute="leading" secondItem="Qng-vH-mPk" secondAttribute="leading" constant="20" id="VP9-am-I43"/>
<constraint firstItem="Qng-vH-mPk" firstAttribute="trailing" secondItem="Bo4-PM-Ch5" secondAttribute="trailing" constant="16" id="Ypj-jc-Fv4"/>

View file

@ -49,6 +49,20 @@ extension UserDefaults: ObjectSavable {
}
}
extension UIView {
func fitLayers() {
layer.fit(rect: bounds)
}
}
extension CALayer {
func fit(rect: CGRect) {
frame = rect
sublayers?.forEach { $0.fit(rect: rect) }
}
}
extension UIViewController {
func addSnowflakes() {
@ -534,6 +548,12 @@ class FirstViewController: UIViewController{
}
override func viewWillLayoutSubviews() {
super.viewWillLayoutSubviews()
view.fitLayers()
}
@IBOutlet var sceneryImageView: UIImageView!
@IBOutlet var gradientView: UIView!
@ -1225,7 +1245,9 @@ class FirstViewController: UIViewController{
gradient.locations = [0.00, 1.00]
gradientView.layer.sublayers?.forEach { $0.removeFromSuperlayer() }
gradientView.translatesAutoresizingMaskIntoConstraints = false
gradientView.layer.addSublayer(gradient)
}

View file

@ -205,6 +205,7 @@ class FourthViewController: UIViewController, UITableViewDelegate, UITableViewDa
musicHandler.updateMusic()
}
/*
// create the gradient layer
let gradient = CAGradientLayer()
gradient.frame = self.view.bounds
@ -270,7 +271,8 @@ class FourthViewController: UIViewController, UITableViewDelegate, UITableViewDa
default:
//print(GlobalVars.musicSelectionID0)
print(GlobalVars.musicSelection0)
}*/
}*/*/
updateGradientAndView()
}
override func viewDidDisappear(_ animated: Bool) {
@ -366,6 +368,12 @@ class FourthViewController: UIViewController, UITableViewDelegate, UITableViewDa
}
override func viewWillLayoutSubviews() {
super.viewWillLayoutSubviews()
view.fitLayers()
}
@IBAction func close(_ sender: Any) {
dismiss(animated: true)
}
@ -447,5 +455,95 @@ class FourthViewController: UIViewController, UITableViewDelegate, UITableViewDa
task.resume()
}
func updateGradientAndView(){
let gradient = CAGradientLayer()
gradient.frame = self.view.bounds
//print("time: ", GlobalVars.hour)
if((GlobalVars.hour >= 8) && (GlobalVars.hour <= 19)){ //Daytime
do{
var gif = try UIImage(gifName: "day.gif")
var gradColors:[CGColor] = [UIColor(red: 0.39, green: 0.69, blue: 1.00, alpha: 1).cgColor, UIColor(red: 0.07, green: 0.45, blue: 0.87, alpha: 1).cgColor]
//63b0ff
//1273de
if GlobalVars.weatherList == 2 {
gif = try UIImage(gifName: "day snow.gif")
gradColors = [UIColor(red: 0.91, green: 0.98, blue: 1.00, alpha: 1.00).cgColor,UIColor(red: 0.36, green: 0.60, blue: 0.87, alpha: 1.00).cgColor]
//e8faff
//5b99de
} else if GlobalVars.weatherList == 1 {
//7da3ca
//416594
gradColors = [UIColor(red: 0.49, green: 0.64, blue: 0.79, alpha: 1.00).cgColor, UIColor(red: 0.25, green: 0.40, blue: 0.58, alpha: 1.00).cgColor]
}
//sceneryImageView.setGifImage(gif, loopCount: -1)
gradient.colors = gradColors
}catch{print(error)}
} else if((GlobalVars.hour >= 20) && (GlobalVars.hour <= 21)){//Sunset
do{
var gif = try UIImage(gifName: "day.gif")
var gradColors:[CGColor] = [UIColor(red: 0.00, green: 0.31, blue: 0.59, alpha: 1).cgColor, UIColor(red: 1.00, green: 0.78, blue: 0.88, alpha: 1).cgColor]
//004f96
//ffc7e0
if GlobalVars.weatherList == 2 {
gif = try UIImage(gifName: "day snow.gif")
gradColors = [UIColor(red: 0.46, green: 0.61, blue: 0.71, alpha: 1.00).cgColor,UIColor(red: 1.00, green: 0.89, blue: 0.94, alpha: 1.00).cgColor]
//769cb6
//ffe4f0
} else if GlobalVars.weatherList == 1 {
gradColors = [UIColor(red: 0.27, green: 0.44, blue: 0.59, alpha: 1.00).cgColor,UIColor(red: 0.64, green: 0.48, blue: 0.55, alpha: 1.00).cgColor]
//446f96
//a27b8c
}
//sceneryImageView.setGifImage(gif, loopCount: -1)
gradient.colors = gradColors
}catch{print(error)}
} else if((GlobalVars.hour >= 22) || (GlobalVars.hour <= 5)){//Night
do{
var gif = try UIImage(gifName: "night.gif")
var gradColors:[CGColor] = [UIColor(red: 0.08, green: 0.27, blue: 0.59, alpha: 1).cgColor, UIColor(red: 0.00, green: 0.20, blue: 0.29, alpha: 1).cgColor]
//144596
//00334a
if GlobalVars.weatherList == 2 {
gif = try UIImage(gifName: "night snow.gif")
gradColors = [UIColor(red: 0.55, green: 0.59, blue: 0.60, alpha: 1.00).cgColor,UIColor(red: 0.18, green: 0.30, blue: 0.44, alpha: 1.00).cgColor]
//8B9699
//2E4D70
} else if GlobalVars.weatherList == 1 {
gradColors = [UIColor(red: 0.00, green: 0.12, blue: 0.17, alpha: 1.00).cgColor,UIColor(red: 0.05, green: 0.18, blue: 0.39, alpha: 1.00).cgColor]
//0D2E63
//001E2B
}
//sceneryImageView.setGifImage(gif, loopCount: -1)
gradient.colors = gradColors
}catch{print(error)}
} else if((GlobalVars.hour >= 6) && (GlobalVars.hour <= 7)){//Sunrise
do{
var gif = try UIImage(gifName: "day.gif")
var gradColors:[CGColor] = [UIColor(red: 0.02, green: 0.26, blue: 0.49, alpha: 1).cgColor, UIColor(red: 0.89, green: 0.68, blue: 0.60, alpha: 1).cgColor]
//05427D
//e3ad99
if GlobalVars.weatherList == 2 {
gif = try UIImage(gifName: "day snow.gif")
gradColors = [UIColor(red: 0.50, green: 0.61, blue: 0.72, alpha: 1.00).cgColor,UIColor(red: 0.94, green: 0.87, blue: 0.84, alpha: 1.00).cgColor]
//809CB7
//EFDDD7
} else if GlobalVars.weatherList == 1 {
gradColors = [UIColor(red: 0.14, green: 0.25, blue: 0.36, alpha: 1.00).cgColor,UIColor(red: 0.54, green: 0.41, blue: 0.36, alpha: 1.00).cgColor]
//23405C
//8A685C
}
//sceneryImageView.setGifImage(gif, loopCount: -1)
gradient.colors = gradColors
}catch{print(error)}
}
gradient.locations = [0.00, 1.00]
gradientView.layer.sublayers?.forEach { $0.removeFromSuperlayer() }
gradientView.translatesAutoresizingMaskIntoConstraints = false
gradientView.layer.addSublayer(gradient)
}
}

View file

@ -212,10 +212,18 @@ class SecondViewController: UIViewController, UITableViewDelegate, UITableViewDa
//shareMenu.popoverPresentationController.sourceView = self.view
//shareMenu.popoverPresentationController.sourceRect = CGRectMake(self.view.bounds.size.width / 2.0, self.view.bounds.size.height / 2.0, 1.0, 1.0)
#if targetEnvironment(macCatalyst)
#else
alert.addAction(UIAlertAction(title: "From Music App", style: .default, handler: {_ in
self.tableHour = indexPath.row
self.present(self.mediaPicker, animated: true, completion: nil)
}))
#endif
alert.addAction(UIAlertAction(title: "From File", style: .default, handler: {_ in
let NotificationVC = self.storyboard?.instantiateViewController(withIdentifier: "FourthViewController") as! UIViewController
GlobalVars.selectedCell = indexPath.row
@ -558,7 +566,14 @@ class SecondViewController: UIViewController, UITableViewDelegate, UITableViewDa
gradient.locations = [0.00, 1.00]
gradientView.layer.sublayers?.forEach { $0.removeFromSuperlayer() }
gradientView.translatesAutoresizingMaskIntoConstraints = false
gradientView.layer.addSublayer(gradient)
}
override func viewWillLayoutSubviews() {
super.viewWillLayoutSubviews()
view.fitLayers()
}
}

View file

@ -41,6 +41,10 @@ class ThirdViewController: UIViewController {
IAPHandler.shared.purchaseMyProduct(index: 0)
}
@IBAction func dismiss(_ sender: Any) {
dismiss(animated: true)
}
let defaults = UserDefaults.standard
override func viewDidLoad() {