1.2 & 1.2.1

launch screen update
more responsive buttons
added external file support
etc
This commit is contained in:
Micah Gomez 2021-07-31 13:39:30 -06:00
parent ffe4b62677
commit 5b5f914513
16 changed files with 1175 additions and 958 deletions

BIN
.DS_Store vendored

Binary file not shown.

View file

@ -29,6 +29,8 @@
BDE56CC325186B0C00A47239 /* hssceneExtension.appex in Embed App Extensions */ = {isa = PBXBuildFile; fileRef = BDE56CB825186B0500A47239 /* hssceneExtension.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; }; BDE56CC325186B0C00A47239 /* hssceneExtension.appex in Embed App Extensions */ = {isa = PBXBuildFile; fileRef = BDE56CB825186B0500A47239 /* hssceneExtension.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; };
BDE56CCB25186C4100A47239 /* FinkHeavy.ttf in Resources */ = {isa = PBXBuildFile; fileRef = BDB53FCC250765A1004E9788 /* FinkHeavy.ttf */; }; BDE56CCB25186C4100A47239 /* FinkHeavy.ttf in Resources */ = {isa = PBXBuildFile; fileRef = BDB53FCC250765A1004E9788 /* FinkHeavy.ttf */; };
BDE8138F2507422100371570 /* ThirdViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = BDE8138E2507422100371570 /* ThirdViewController.swift */; }; BDE8138F2507422100371570 /* ThirdViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = BDE8138E2507422100371570 /* ThirdViewController.swift */; };
BDF7489D2616C0D900877F21 /* SwiftyJSON in Frameworks */ = {isa = PBXBuildFile; productRef = BDF7489C2616C0D900877F21 /* SwiftyJSON */; };
BDF748A42616C11500877F21 /* Zip in Frameworks */ = {isa = PBXBuildFile; productRef = BDF748A32616C11500877F21 /* Zip */; };
/* End PBXBuildFile section */ /* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */ /* Begin PBXContainerItemProxy section */
@ -106,7 +108,9 @@
isa = PBXFrameworksBuildPhase; isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( files = (
BDF7489D2616C0D900877F21 /* SwiftyJSON in Frameworks */,
BD7D35DB2510111700A61B6B /* SwiftyGif in Frameworks */, BD7D35DB2510111700A61B6B /* SwiftyGif in Frameworks */,
BDF748A42616C11500877F21 /* Zip in Frameworks */,
BD7A5E39251034D7003E992C /* StoreKit.framework in Frameworks */, BD7A5E39251034D7003E992C /* StoreKit.framework in Frameworks */,
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
@ -256,6 +260,8 @@
name = grandfatherrock; name = grandfatherrock;
packageProductDependencies = ( packageProductDependencies = (
BD7D35DA2510111700A61B6B /* SwiftyGif */, BD7D35DA2510111700A61B6B /* SwiftyGif */,
BDF7489C2616C0D900877F21 /* SwiftyJSON */,
BDF748A32616C11500877F21 /* Zip */,
); );
productName = grandfatherrock; productName = grandfatherrock;
productReference = BDA060F62447F3E6009C72CE /* Nook Music.app */; productReference = BDA060F62447F3E6009C72CE /* Nook Music.app */;
@ -351,6 +357,8 @@
mainGroup = BDA060ED2447F3E5009C72CE; mainGroup = BDA060ED2447F3E5009C72CE;
packageReferences = ( packageReferences = (
BD7D35D92510111700A61B6B /* XCRemoteSwiftPackageReference "SwiftyGif" */, BD7D35D92510111700A61B6B /* XCRemoteSwiftPackageReference "SwiftyGif" */,
BDF7489B2616C0D900877F21 /* XCRemoteSwiftPackageReference "SwiftyJSON" */,
BDF748A22616C11500877F21 /* XCRemoteSwiftPackageReference "Zip" */,
); );
productRefGroup = BDA060F72447F3E6009C72CE /* Products */; productRefGroup = BDA060F72447F3E6009C72CE /* Products */;
projectDirPath = ""; projectDirPath = "";
@ -605,7 +613,7 @@
CODE_SIGN_ENTITLEMENTS = grandfatherrock/grandfatherrock.entitlements; CODE_SIGN_ENTITLEMENTS = grandfatherrock/grandfatherrock.entitlements;
CODE_SIGN_IDENTITY = "iPhone Developer"; CODE_SIGN_IDENTITY = "iPhone Developer";
CODE_SIGN_STYLE = Automatic; CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 3; CURRENT_PROJECT_VERSION = 2;
DEVELOPMENT_TEAM = PRBH2T6668; DEVELOPMENT_TEAM = PRBH2T6668;
INFOPLIST_FILE = grandfatherrock/Info.plist; INFOPLIST_FILE = grandfatherrock/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 13.0; IPHONEOS_DEPLOYMENT_TARGET = 13.0;
@ -613,7 +621,7 @@
"$(inherited)", "$(inherited)",
"@executable_path/Frameworks", "@executable_path/Frameworks",
); );
MARKETING_VERSION = 1.1; MARKETING_VERSION = 1.2.1;
PRODUCT_BUNDLE_IDENTIFIER = dev.mpg13.grandfatherrock; PRODUCT_BUNDLE_IDENTIFIER = dev.mpg13.grandfatherrock;
PRODUCT_NAME = "Nook Music"; PRODUCT_NAME = "Nook Music";
SUPPORTS_MACCATALYST = NO; SUPPORTS_MACCATALYST = NO;
@ -631,7 +639,7 @@
CODE_SIGN_ENTITLEMENTS = grandfatherrock/grandfatherrock.entitlements; CODE_SIGN_ENTITLEMENTS = grandfatherrock/grandfatherrock.entitlements;
CODE_SIGN_IDENTITY = "iPhone Developer"; CODE_SIGN_IDENTITY = "iPhone Developer";
CODE_SIGN_STYLE = Automatic; CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 3; CURRENT_PROJECT_VERSION = 2;
DEVELOPMENT_TEAM = PRBH2T6668; DEVELOPMENT_TEAM = PRBH2T6668;
INFOPLIST_FILE = grandfatherrock/Info.plist; INFOPLIST_FILE = grandfatherrock/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 13.0; IPHONEOS_DEPLOYMENT_TARGET = 13.0;
@ -639,7 +647,7 @@
"$(inherited)", "$(inherited)",
"@executable_path/Frameworks", "@executable_path/Frameworks",
); );
MARKETING_VERSION = 1.1; MARKETING_VERSION = 1.2.1;
PRODUCT_BUNDLE_IDENTIFIER = dev.mpg13.grandfatherrock; PRODUCT_BUNDLE_IDENTIFIER = dev.mpg13.grandfatherrock;
PRODUCT_NAME = "Nook Music"; PRODUCT_NAME = "Nook Music";
SUPPORTS_MACCATALYST = NO; SUPPORTS_MACCATALYST = NO;
@ -741,7 +749,7 @@
CODE_SIGN_ENTITLEMENTS = hssceneExtension.entitlements; CODE_SIGN_ENTITLEMENTS = hssceneExtension.entitlements;
CODE_SIGN_IDENTITY = "iPhone Developer"; CODE_SIGN_IDENTITY = "iPhone Developer";
CODE_SIGN_STYLE = Automatic; CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 3; CURRENT_PROJECT_VERSION = 2;
DEVELOPMENT_TEAM = PRBH2T6668; DEVELOPMENT_TEAM = PRBH2T6668;
INFOPLIST_FILE = hsscene/Info.plist; INFOPLIST_FILE = hsscene/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 14.0; IPHONEOS_DEPLOYMENT_TARGET = 14.0;
@ -750,7 +758,7 @@
"@executable_path/Frameworks", "@executable_path/Frameworks",
"@executable_path/../../Frameworks", "@executable_path/../../Frameworks",
); );
MARKETING_VERSION = 1.1; MARKETING_VERSION = 1.2.1;
PRODUCT_BUNDLE_IDENTIFIER = dev.mpg13.grandfatherrock.hsscene; PRODUCT_BUNDLE_IDENTIFIER = dev.mpg13.grandfatherrock.hsscene;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES; SKIP_INSTALL = YES;
@ -769,7 +777,7 @@
CODE_SIGN_ENTITLEMENTS = hssceneExtension.entitlements; CODE_SIGN_ENTITLEMENTS = hssceneExtension.entitlements;
CODE_SIGN_IDENTITY = "iPhone Developer"; CODE_SIGN_IDENTITY = "iPhone Developer";
CODE_SIGN_STYLE = Automatic; CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 3; CURRENT_PROJECT_VERSION = 2;
DEVELOPMENT_TEAM = PRBH2T6668; DEVELOPMENT_TEAM = PRBH2T6668;
INFOPLIST_FILE = hsscene/Info.plist; INFOPLIST_FILE = hsscene/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 14.0; IPHONEOS_DEPLOYMENT_TARGET = 14.0;
@ -778,7 +786,7 @@
"@executable_path/Frameworks", "@executable_path/Frameworks",
"@executable_path/../../Frameworks", "@executable_path/../../Frameworks",
); );
MARKETING_VERSION = 1.1; MARKETING_VERSION = 1.2.1;
PRODUCT_BUNDLE_IDENTIFIER = dev.mpg13.grandfatherrock.hsscene; PRODUCT_BUNDLE_IDENTIFIER = dev.mpg13.grandfatherrock.hsscene;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES; SKIP_INSTALL = YES;
@ -848,6 +856,22 @@
minimumVersion = 5.3.0; minimumVersion = 5.3.0;
}; };
}; };
BDF7489B2616C0D900877F21 /* XCRemoteSwiftPackageReference "SwiftyJSON" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/SwiftyJSON/SwiftyJSON.git";
requirement = {
kind = upToNextMajorVersion;
minimumVersion = 5.0.1;
};
};
BDF748A22616C11500877F21 /* XCRemoteSwiftPackageReference "Zip" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/marmelroy/Zip.git";
requirement = {
kind = upToNextMajorVersion;
minimumVersion = 2.1.1;
};
};
/* End XCRemoteSwiftPackageReference section */ /* End XCRemoteSwiftPackageReference section */
/* Begin XCSwiftPackageProductDependency section */ /* Begin XCSwiftPackageProductDependency section */
@ -856,6 +880,16 @@
package = BD7D35D92510111700A61B6B /* XCRemoteSwiftPackageReference "SwiftyGif" */; package = BD7D35D92510111700A61B6B /* XCRemoteSwiftPackageReference "SwiftyGif" */;
productName = SwiftyGif; productName = SwiftyGif;
}; };
BDF7489C2616C0D900877F21 /* SwiftyJSON */ = {
isa = XCSwiftPackageProductDependency;
package = BDF7489B2616C0D900877F21 /* XCRemoteSwiftPackageReference "SwiftyJSON" */;
productName = SwiftyJSON;
};
BDF748A32616C11500877F21 /* Zip */ = {
isa = XCSwiftPackageProductDependency;
package = BDF748A22616C11500877F21 /* XCRemoteSwiftPackageReference "Zip" */;
productName = Zip;
};
/* End XCSwiftPackageProductDependency section */ /* End XCSwiftPackageProductDependency section */
}; };
rootObject = BDA060EE2447F3E5009C72CE /* Project object */; rootObject = BDA060EE2447F3E5009C72CE /* Project object */;

View file

@ -9,6 +9,24 @@
"revision": "0cd770feed5807d9fd4fa8df5ad74b56b814b0c8", "revision": "0cd770feed5807d9fd4fa8df5ad74b56b814b0c8",
"version": "5.4.0" "version": "5.4.0"
} }
},
{
"package": "SwiftyJSON",
"repositoryURL": "https://github.com/SwiftyJSON/SwiftyJSON.git",
"state": {
"branch": null,
"revision": "b3dcd7dbd0d488e1a7077cb33b00f2083e382f07",
"version": "5.0.1"
}
},
{
"package": "Zip",
"repositoryURL": "https://github.com/marmelroy/Zip.git",
"state": {
"branch": null,
"revision": "bd19d974e8a38cc8d3a88c90c8a107386c3b8ccf",
"version": "2.1.1"
}
} }
] ]
}, },

View file

@ -4,15 +4,36 @@
<dict> <dict>
<key>SchemeUserState</key> <key>SchemeUserState</key>
<dict> <dict>
<key>Playground (Playground) 1.xcscheme</key>
<dict>
<key>isShown</key>
<false/>
<key>orderHint</key>
<integer>3</integer>
</dict>
<key>Playground (Playground) 2.xcscheme</key>
<dict>
<key>isShown</key>
<false/>
<key>orderHint</key>
<integer>4</integer>
</dict>
<key>Playground (Playground).xcscheme</key>
<dict>
<key>isShown</key>
<false/>
<key>orderHint</key>
<integer>2</integer>
</dict>
<key>grandfatherrock.xcscheme_^#shared#^_</key> <key>grandfatherrock.xcscheme_^#shared#^_</key>
<dict> <dict>
<key>orderHint</key> <key>orderHint</key>
<integer>1</integer> <integer>0</integer>
</dict> </dict>
<key>hssceneExtension.xcscheme_^#shared#^_</key> <key>hssceneExtension.xcscheme_^#shared#^_</key>
<dict> <dict>
<key>orderHint</key> <key>orderHint</key>
<integer>0</integer> <integer>1</integer>
</dict> </dict>
<key>hswidgetExtension.xcscheme_^#shared#^_</key> <key>hswidgetExtension.xcscheme_^#shared#^_</key>
<dict> <dict>

Binary file not shown.

View file

@ -0,0 +1,23 @@
{
"images" : [
{
"filename" : "coollogo_com-13092940.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "coollogo_com-13092941.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "coollogo_com-13092942.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 129 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 129 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 129 KiB

View file

@ -1,9 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="17154" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="01J-lp-oVM"> <document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="19142.2" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
<device id="retina4_7" orientation="portrait" appearance="light"/> <device id="retina6_1" orientation="portrait" appearance="light"/>
<dependencies> <dependencies>
<deployment identifier="iOS"/> <deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="17124"/> <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="19129"/>
<capability name="Image references" minToolsVersion="12.0"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/> <capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="System colors in document resources" minToolsVersion="11.0"/> <capability name="System colors in document resources" minToolsVersion="11.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/> <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
@ -14,32 +15,43 @@
<objects> <objects>
<viewController id="01J-lp-oVM" sceneMemberID="viewController"> <viewController id="01J-lp-oVM" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3"> <view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/> <rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews> <subviews>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="LaunchImage" translatesAutoresizingMaskIntoConstraints="NO" id="erM-YB-Vzk"> <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="tzs-7w-lyi">
<rect key="frame" x="123.5" y="269.5" width="128" height="128"/> <rect key="frame" x="100" y="384" width="214" height="128"/>
<constraints> <constraints>
<constraint firstAttribute="width" secondItem="erM-YB-Vzk" secondAttribute="height" multiplier="1:1" id="0TT-ZM-7es"/> <constraint firstAttribute="width" secondItem="tzs-7w-lyi" secondAttribute="height" multiplier="77:46" id="axO-24-MFU"/>
<constraint firstAttribute="width" constant="128" id="xCb-tz-RTW"/>
</constraints> </constraints>
<imageReference key="image" image="Micah Gomez"/>
</imageView> </imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="From" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Zuj-Ek-bSV">
<rect key="frame" x="100" y="347" width="214" height="29"/>
<fontDescription key="fontDescription" type="system" weight="heavy" pointSize="24"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
</subviews> </subviews>
<viewLayoutGuide key="safeArea" id="6Tk-OE-BBY"/> <viewLayoutGuide key="safeArea" id="6Tk-OE-BBY"/>
<color key="backgroundColor" systemColor="systemBackgroundColor"/> <color key="backgroundColor" systemColor="systemBackgroundColor"/>
<constraints> <constraints>
<constraint firstItem="erM-YB-Vzk" firstAttribute="centerX" secondItem="Ze5-6b-2t3" secondAttribute="centerX" id="9Sw-2e-l2R"/> <constraint firstItem="tzs-7w-lyi" firstAttribute="leading" secondItem="Zuj-Ek-bSV" secondAttribute="leading" id="L95-JJ-ciP"/>
<constraint firstItem="erM-YB-Vzk" firstAttribute="centerY" secondItem="Ze5-6b-2t3" secondAttribute="centerY" id="Mtq-Xq-8oK"/> <constraint firstItem="tzs-7w-lyi" firstAttribute="top" secondItem="Zuj-Ek-bSV" secondAttribute="bottom" constant="8" symbolic="YES" id="Let-P6-Mj6"/>
<constraint firstItem="tzs-7w-lyi" firstAttribute="centerY" secondItem="Ze5-6b-2t3" secondAttribute="centerY" id="Nd0-O8-MaK"/>
<constraint firstItem="tzs-7w-lyi" firstAttribute="trailing" secondItem="Zuj-Ek-bSV" secondAttribute="trailing" id="PnO-Jq-5bD"/>
<constraint firstItem="6Tk-OE-BBY" firstAttribute="trailing" secondItem="tzs-7w-lyi" secondAttribute="trailing" constant="100" id="T4A-hC-jCR"/>
<constraint firstItem="tzs-7w-lyi" firstAttribute="centerX" secondItem="Ze5-6b-2t3" secondAttribute="centerX" id="mO4-py-5Sy"/>
<constraint firstItem="tzs-7w-lyi" firstAttribute="leading" secondItem="6Tk-OE-BBY" secondAttribute="leading" constant="100" id="sS2-OU-O7z"/>
</constraints> </constraints>
</view> </view>
</viewController> </viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/> <placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects> </objects>
<point key="canvasLocation" x="52" y="374.66266866566718"/> <point key="canvasLocation" x="53" y="375"/>
</scene> </scene>
</scenes> </scenes>
<resources> <resources>
<image name="LaunchImage" width="768" height="768"/> <image name="Micah Gomez" width="385.5" height="230.5"/>
<systemColor name="systemBackgroundColor"> <systemColor name="systemBackgroundColor">
<color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> <color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</systemColor> </systemColor>

View file

@ -1,9 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="17506" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="49e-Tb-3d3"> <document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="18122" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="49e-Tb-3d3">
<device id="retina4_0" orientation="portrait" appearance="light"/> <device id="retina4_0" orientation="portrait" appearance="light"/>
<dependencies> <dependencies>
<deployment identifier="iOS"/> <deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="17505"/> <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="18093"/>
<capability name="Image references" minToolsVersion="12.0"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/> <capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="System colors in document resources" minToolsVersion="11.0"/> <capability name="System colors in document resources" minToolsVersion="11.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/> <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
@ -117,7 +118,7 @@
<color key="backgroundColor" systemColor="systemFillColor"/> <color key="backgroundColor" systemColor="systemFillColor"/>
<prototypes> <prototypes>
<tableViewCell clipsSubviews="YES" contentMode="scaleAspectFit" insetsLayoutMarginsFromSafeArea="NO" selectionStyle="blue" hidesAccessoryWhenEditing="NO" indentationLevel="1" indentationWidth="0.0" reuseIdentifier="hourcell" rowHeight="80" id="4WK-Bk-wob" customClass="hourDataCell" customModule="Nook_Music" customModuleProvider="target"> <tableViewCell clipsSubviews="YES" contentMode="scaleAspectFit" insetsLayoutMarginsFromSafeArea="NO" selectionStyle="blue" hidesAccessoryWhenEditing="NO" indentationLevel="1" indentationWidth="0.0" reuseIdentifier="hourcell" rowHeight="80" id="4WK-Bk-wob" customClass="hourDataCell" customModule="Nook_Music" customModuleProvider="target">
<rect key="frame" x="0.0" y="28" width="288" height="80"/> <rect key="frame" x="0.0" y="24.5" width="288" height="80"/>
<autoresizingMask key="autoresizingMask"/> <autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="4WK-Bk-wob" id="zgb-be-Y4R"> <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="4WK-Bk-wob" id="zgb-be-Y4R">
<rect key="frame" x="0.0" y="0.0" width="288" height="80"/> <rect key="frame" x="0.0" y="0.0" width="288" height="80"/>
@ -220,6 +221,7 @@
<outlet property="hoursTable" destination="EyG-9P-mxm" id="nKa-0x-NrF"/> <outlet property="hoursTable" destination="EyG-9P-mxm" id="nKa-0x-NrF"/>
<outlet property="selectListControl" destination="tNe-0A-XZP" id="Y9A-1K-Qj9"/> <outlet property="selectListControl" destination="tNe-0A-XZP" id="Y9A-1K-Qj9"/>
<segue destination="8LK-WS-C3a" kind="presentation" modalPresentationStyle="automatic" id="4kl-sn-3de"/> <segue destination="8LK-WS-C3a" kind="presentation" modalPresentationStyle="automatic" id="4kl-sn-3de"/>
<segue destination="XMN-Ld-irO" kind="presentation" id="vuf-aN-ACY"/>
</connections> </connections>
</viewController> </viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="4Nw-L8-lE0" sceneMemberID="firstResponder"/> <placeholder placeholderIdentifier="IBFirstResponder" id="4Nw-L8-lE0" sceneMemberID="firstResponder"/>
@ -230,12 +232,13 @@
<scene sceneID="yl2-sM-qoP"> <scene sceneID="yl2-sM-qoP">
<objects> <objects>
<tabBarController id="49e-Tb-3d3" sceneMemberID="viewController"> <tabBarController id="49e-Tb-3d3" sceneMemberID="viewController">
<tabBar key="tabBar" contentMode="scaleToFill" barStyle="black" translucent="NO" backgroundImage="grass" itemPositioning="fill" id="W28-zg-YXA"> <tabBar key="tabBar" contentMode="scaleToFill" barStyle="black" translucent="NO" itemPositioning="fill" id="W28-zg-YXA">
<rect key="frame" x="0.0" y="975" width="768" height="49"/> <rect key="frame" x="0.0" y="975" width="768" height="49"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<color key="tintColor" red="0.86256664989999998" green="0.69524472950000005" blue="0.2422021627" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> <color key="tintColor" red="0.86256664989999998" green="0.69524472950000005" blue="0.2422021627" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<color key="selectedImageTintColor" red="0.86256664989999998" green="0.69524472950000005" blue="0.2422021627" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> <color key="selectedImageTintColor" red="0.86256664989999998" green="0.69524472950000005" blue="0.2422021627" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<imageReference key="backgroundImage" image="grass"/>
</tabBar> </tabBar>
<connections> <connections>
<segue destination="9pv-A4-QxB" kind="relationship" relationship="viewControllers" id="u7Y-xg-7CH"/> <segue destination="9pv-A4-QxB" kind="relationship" relationship="viewControllers" id="u7Y-xg-7CH"/>
@ -405,38 +408,141 @@
</objects> </objects>
<point key="canvasLocation" x="1507.5" y="358.0985915492958"/> <point key="canvasLocation" x="1507.5" y="358.0985915492958"/>
</scene> </scene>
<!--Tune Writer--> <!--Select Files-->
<scene sceneID="4HD-tT-eIY"> <scene sceneID="Bvz-2B-EZq">
<objects> <objects>
<viewController title="Tune Writer" id="zOe-Zh-aR8" customClass="FourthViewController" customModule="Nook_Music" customModuleProvider="target" sceneMemberID="viewController"> <viewController storyboardIdentifier="FourthViewController" title="Select Files" id="XMN-Ld-irO" customClass="FourthViewController" customModule="Nook_Music" customModuleProvider="target" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="hB0-dI-9mZ"> <view key="view" contentMode="scaleToFill" id="SQY-U2-iSU">
<rect key="frame" x="0.0" y="0.0" width="320" height="568"/> <rect key="frame" x="0.0" y="0.0" width="320" height="568"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews> <subviews>
<view contentMode="scaleToFill" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="hMG-YO-jSe" userLabel="Gradient View"> <view contentMode="scaleToFill" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="Nhx-Td-rM8" userLabel="Gradient View">
<rect key="frame" x="0.0" y="0.0" width="320" height="519"/> <rect key="frame" x="0.0" y="0.0" width="320" height="519"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/> <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</view> </view>
<tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="28" sectionFooterHeight="28" translatesAutoresizingMaskIntoConstraints="NO" id="hZH-eV-Pyy">
<rect key="frame" x="16" y="20" width="288" height="412"/>
<color key="backgroundColor" systemColor="systemFillColor"/>
<prototypes>
<tableViewCell clipsSubviews="YES" contentMode="scaleAspectFit" insetsLayoutMarginsFromSafeArea="NO" selectionStyle="blue" hidesAccessoryWhenEditing="NO" indentationLevel="1" indentationWidth="0.0" reuseIdentifier="filecell" rowHeight="36" id="sfi-qk-UU3" customClass="fileDataCell" customModule="Nook_Music" customModuleProvider="target">
<rect key="frame" x="0.0" y="24.5" width="288" height="36"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="sfi-qk-UU3" id="EA1-9A-ReP">
<rect key="frame" x="0.0" y="0.0" width="288" height="36"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" multipleTouchEnabled="YES" contentMode="left" ambiguous="YES" insetsLayoutMarginsFromSafeArea="NO" text="Title" lineBreakMode="wordWrap" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="gjm-p2-dVN" userLabel="Filename Label">
<rect key="frame" x="16" y="0.0" width="256" height="19.5"/>
<accessibility key="accessibilityConfiguration" hint="Press to select a file for this track"/>
<fontDescription key="fontDescription" name="FinkHeavy" family="FinkHeavy" pointSize="20"/>
<color key="textColor" red="0.86256664989999998" green="0.69524472950000005" blue="0.2422021627" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" multipleTouchEnabled="YES" contentMode="left" ambiguous="YES" insetsLayoutMarginsFromSafeArea="NO" text="Subtitle" textAlignment="natural" lineBreakMode="wordWrap" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="QhO-n4-nRS" userLabel="Filetype Label">
<rect key="frame" x="16" y="24" width="256" height="12"/>
<fontDescription key="fontDescription" name="FinkHeavy" family="FinkHeavy" pointSize="12"/>
<color key="textColor" red="0.86256664989999998" green="0.69524472950000005" blue="0.2422021627" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<constraints>
<constraint firstItem="gjm-p2-dVN" firstAttribute="leading" secondItem="EA1-9A-ReP" secondAttribute="leading" constant="16" id="2ge-CM-fMk"/>
<constraint firstAttribute="trailing" secondItem="QhO-n4-nRS" secondAttribute="trailing" constant="16" id="DYg-fy-B3r"/>
<constraint firstItem="gjm-p2-dVN" firstAttribute="top" secondItem="EA1-9A-ReP" secondAttribute="top" id="T3Z-LS-fjT"/>
<constraint firstItem="QhO-n4-nRS" firstAttribute="leading" secondItem="EA1-9A-ReP" secondAttribute="leading" constant="16" id="bLK-f5-yja"/>
<constraint firstAttribute="trailing" secondItem="gjm-p2-dVN" secondAttribute="trailing" constant="16" id="cFU-Hf-pHz"/>
<constraint firstAttribute="bottom" secondItem="QhO-n4-nRS" secondAttribute="bottom" id="fMB-wW-w9w"/>
<constraint firstItem="QhO-n4-nRS" firstAttribute="top" secondItem="gjm-p2-dVN" secondAttribute="bottom" constant="4.5" id="uJD-cJ-Hud"/>
</constraints>
</tableViewCellContentView>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<inset key="separatorInset" minX="15" minY="0.0" maxX="15" maxY="0.0"/>
<connections>
<outlet property="filenameLabel" destination="gjm-p2-dVN" id="IMB-SE-NdB"/>
<outlet property="filetypeLabel" destination="QhO-n4-nRS" id="mdk-DM-i65"/>
</connections>
</tableViewCell>
</prototypes>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="number" keyPath="layer.cornerRadius">
<integer key="value" value="16"/>
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
</tableView>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Gtw-5T-lhf">
<rect key="frame" x="16" y="440" width="288" height="40"/>
<accessibility key="accessibilityConfiguration" label="Developer Information"/>
<fontDescription key="fontDescription" name="FinkHeavy" family="FinkHeavy" pointSize="24"/>
<color key="tintColor" red="0.86256664989999998" green="0.69524472950000005" blue="0.2422021627" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<state key="normal" title="Import Music">
<color key="titleShadowColor" systemColor="labelColor"/>
</state>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="size" keyPath="layer.shadowOffset">
<size key="value" width="0.0" height="0.0"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="number" keyPath="layer.shadowOpacity">
<integer key="value" value="1"/>
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
<connections>
<action selector="importPopup:" destination="XMN-Ld-irO" eventType="touchUpInside" id="xy7-2v-rUl"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="TNt-ut-C5N">
<rect key="frame" x="16" y="488" width="288" height="40"/>
<accessibility key="accessibilityConfiguration" label="Developer Information"/>
<fontDescription key="fontDescription" name="FinkHeavy" family="FinkHeavy" pointSize="24"/>
<color key="tintColor" red="0.86256664989999998" green="0.69524472950000005" blue="0.2422021627" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<state key="normal" title="Close">
<color key="titleShadowColor" systemColor="labelColor"/>
</state>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="size" keyPath="layer.shadowOffset">
<size key="value" width="0.0" height="0.0"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="number" keyPath="layer.shadowOpacity">
<integer key="value" value="1"/>
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
<connections>
<action selector="close:" destination="XMN-Ld-irO" eventType="touchUpInside" id="I1q-Rv-DWI"/>
</connections>
</button>
</subviews> </subviews>
<viewLayoutGuide key="safeArea" id="VvP-4h-AlD"/> <viewLayoutGuide key="safeArea" id="by8-sR-TEB"/>
<color key="backgroundColor" systemColor="systemBackgroundColor"/> <color key="backgroundColor" systemColor="systemBackgroundColor"/>
<constraints>
<constraint firstItem="TNt-ut-C5N" firstAttribute="centerX" secondItem="SQY-U2-iSU" secondAttribute="centerX" id="1QM-GT-SPe"/>
<constraint firstItem="hZH-eV-Pyy" firstAttribute="leading" secondItem="by8-sR-TEB" secondAttribute="leading" constant="16" id="69X-d8-MCZ"/>
<constraint firstItem="hZH-eV-Pyy" firstAttribute="top" secondItem="by8-sR-TEB" secondAttribute="top" constant="20" id="CcZ-rs-U8r"/>
<constraint firstItem="Gtw-5T-lhf" firstAttribute="trailing" secondItem="hZH-eV-Pyy" secondAttribute="trailing" id="F5a-mn-jG0"/>
<constraint firstItem="by8-sR-TEB" firstAttribute="bottom" secondItem="TNt-ut-C5N" secondAttribute="bottom" constant="20" id="HCd-rV-EmG"/>
<constraint firstItem="Gtw-5T-lhf" firstAttribute="leading" secondItem="hZH-eV-Pyy" secondAttribute="leading" id="QKu-RY-5lI"/>
<constraint firstItem="TNt-ut-C5N" firstAttribute="trailing" secondItem="hZH-eV-Pyy" secondAttribute="trailing" id="R7g-vQ-331"/>
<constraint firstItem="TNt-ut-C5N" firstAttribute="leading" secondItem="hZH-eV-Pyy" secondAttribute="leading" id="Vec-wc-zzi"/>
<constraint firstItem="TNt-ut-C5N" firstAttribute="top" secondItem="Gtw-5T-lhf" secondAttribute="bottom" constant="8" symbolic="YES" id="Xh1-Mk-OGS"/>
<constraint firstItem="hZH-eV-Pyy" firstAttribute="centerX" secondItem="SQY-U2-iSU" secondAttribute="centerX" id="eaS-Hg-VWE"/>
<constraint firstItem="Gtw-5T-lhf" firstAttribute="top" secondItem="hZH-eV-Pyy" secondAttribute="bottom" constant="8" symbolic="YES" id="gwL-qL-OEN"/>
<constraint firstItem="by8-sR-TEB" firstAttribute="trailing" secondItem="hZH-eV-Pyy" secondAttribute="trailing" constant="16" id="lpP-1W-Oxz"/>
</constraints>
</view> </view>
<tabBarItem key="tabBarItem" title="Select Music" image="music.quarternote.3" catalog="system" id="AdX-qc-4Zh"/> <tabBarItem key="tabBarItem" title="Select Music" image="music.note.list" catalog="system" id="43d-kW-N64"/>
<connections> <connections>
<outlet property="gradientView" destination="hMG-YO-jSe" id="W5k-Ys-Jdm"/> <outlet property="filesTable" destination="hZH-eV-Pyy" id="U0F-Ea-jLo"/>
<outlet property="gradientView" destination="Nhx-Td-rM8" id="2GE-Fv-Hv1"/>
</connections> </connections>
</viewController> </viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="IJj-FB-yVG" sceneMemberID="firstResponder"/> <placeholder placeholderIdentifier="IBFirstResponder" id="xg2-Wz-H2K" sceneMemberID="firstResponder"/>
</objects> </objects>
<point key="canvasLocation" x="0.0" y="763"/> <point key="canvasLocation" x="744.375" y="1150.3521126760563"/>
</scene> </scene>
</scenes> </scenes>
<resources> <resources>
<image name="ACBackgroundDay" width="750" height="200"/> <image name="ACBackgroundDay" width="750" height="200"/>
<image name="grass" width="530" height="93"/> <image name="grass" width="530" height="93"/>
<image name="music.note.list" catalog="system" width="128" height="115"/> <image name="music.note.list" catalog="system" width="128" height="115"/>
<image name="music.quarternote.3" catalog="system" width="128" height="103"/>
<image name="play.circle" catalog="system" width="128" height="121"/> <image name="play.circle" catalog="system" width="128" height="121"/>
<image name="play.fill" catalog="system" width="116" height="128"/> <image name="play.fill" catalog="system" width="116" height="128"/>
<systemColor name="labelColor"> <systemColor name="labelColor">

File diff suppressed because it is too large Load diff

View file

@ -7,39 +7,194 @@
// //
import UIKit import UIKit
import AudioToolbox import Zip
import SwiftyJSON
import MediaPlayer
class fileDataCell : UITableViewCell {
@IBOutlet weak var filetypeLabel: UILabel!
@IBOutlet weak var filenameLabel : UILabel!
}
class FourthViewController: UIViewController, UIPickerViewDelegate{ extension FileManager {
func urls(for directory: FileManager.SearchPathDirectory, skipsHiddenFiles: Bool = true ) -> [URL]? {
let documentsURL = urls(for: directory, in: .userDomainMask)[0]
let fileURLs = try? contentsOfDirectory(at: documentsURL, includingPropertiesForKeys: nil, options: skipsHiddenFiles ? .skipsHiddenFiles : [] )
return fileURLs
}
}
class FourthViewController: UIViewController, UITableViewDelegate, UITableViewDataSource, MPMediaPickerControllerDelegate {
var refreshControl = UIRefreshControl()
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
var resourcesContent = FileManager.default.urls(for: .documentDirectory) ?? []
resourcesContent.sort {
$0.lastPathComponent < $1.lastPathComponent
}
print(FileManager.default.urls(for: .documentDirectory) ?? "none")
return resourcesContent.count
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: "filecell", for: indexPath) as! fileDataCell
var resourcesContent = FileManager.default.urls(for: .documentDirectory) ?? []
resourcesContent.sort {
$0.lastPathComponent < $1.lastPathComponent
}
cell.filenameLabel?.text = resourcesContent[indexPath.row].lastPathComponent
cell.filetypeLabel?.text = resourcesContent[indexPath.row].pathExtension
cell.selectionStyle = .none
return cell
}
func tableView(_ tableView: UITableView, canEditRowAt indexPath: IndexPath) -> Bool
{
return true
}
func tableView(_ tableView: UITableView, commit editingStyle: UITableViewCell.EditingStyle, forRowAt indexPath: IndexPath){
var resourcesContent = FileManager.default.urls(for: .documentDirectory) ?? []
resourcesContent.sort {
$0.lastPathComponent < $1.lastPathComponent
}
let dirs : [String] = NSSearchPathForDirectoriesInDomains(FileManager.SearchPathDirectory.documentDirectory, FileManager.SearchPathDomainMask.allDomainsMask, true)
let filePathToDelete = dirs[0].appendingFormat("/" + resourcesContent[indexPath.row].lastPathComponent)
let fileManager = FileManager.default
if editingStyle == .delete
{
do {
//Check if file exists
if fileManager.fileExists(atPath: filePathToDelete) {
//Delete file
try fileManager.removeItem(atPath: filePathToDelete)
} else {
print("File does not exist: \(resourcesContent[indexPath.row].absoluteString)")
}
}
catch let error as NSError {
print("An error took place: \(error)")
}
filesTable.reloadData()
}
}
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath){
var resourcesContent = FileManager.default.urls(for: .documentDirectory) ?? []
resourcesContent.sort {
$0.lastPathComponent < $1.lastPathComponent
}
print(resourcesContent[indexPath.row].lastPathComponent)
print(resourcesContent[indexPath.row])
GlobalVars.musicSelection[GlobalVars.selectedMusicList][GlobalVars.selectedCell!] = resourcesContent[indexPath.row].lastPathComponent
GlobalVars.musicSelectionID[GlobalVars.selectedMusicList][GlobalVars.selectedCell!] = 0
GlobalVars.musicFileURL[GlobalVars.selectedMusicList][GlobalVars.selectedCell!] = resourcesContent[indexPath.row].lastPathComponent
//print("PATH FROM IS \(resourcesContent[indexPath.row].absoluteString)")
print("PATH SAVED IS \(GlobalVars.musicFileURL[GlobalVars.selectedMusicList][GlobalVars.selectedCell!])")
GlobalVars.musicFormatType[GlobalVars.selectedMusicList][GlobalVars.selectedCell!] = false
GlobalVars.selectedCell = nil
self.dismiss(animated: true, completion: nil)
}
let defaults = UserDefaults.standard
@IBOutlet var filesTable: UITableView!
@IBOutlet var gradientView: UIView! @IBOutlet var gradientView: UIView!
let defaults = UserDefaults.standard @IBOutlet var selectListControl: UISegmentedControl!
@IBAction func selectListControlChanged(_ sender: Any) {
MPMusicPlayerController.applicationMusicPlayer.stop()
GlobalVars.selectedMusicList = selectListControl.selectedSegmentIndex
//print(GlobalVars.selectedMusicList)
filesTable.reloadData()
/*var noSongs = false
switch GlobalVars.selectedMusicList {
case 0:
for i in GlobalVars.musicSelectionID0 {
if (i == 0){
noSongs = true
}
}
case 1:
for i in GlobalVars.musicSelectionID1 {
if (i == 0){
noSongs = true
}
}
case 2:
for i in GlobalVars.musicSelectionID2 {
if (i == 0){
noSongs = true
}
}
case 3:
for i in GlobalVars.musicSelectionID3 {
if (i == 0){
noSongs = true
}
}
case 4:
for i in GlobalVars.musicSelectionID4 {
if (i == 0){
noSongs = true
}
}
default:
for i in GlobalVars.musicSelectionID0 {
if (i == 0){
noSongs = true
}
}
}
if noSongs {
MPMusicPlayerController.applicationMusicPlayer.pause()
//print("pausing")
}*/
musicHandler.updateMusic()
//print("updating")
}
override func viewDidLoad() { override func viewDidLoad() {
super.viewDidLoad() super.viewDidLoad()
// Do any additional setup after loading the view. // Do any additional setup after loading the view.
/*let message = "\n\n\n\n\n\n" filesTable.delegate = self
let alert = UIAlertController(title: "Please Select Note", message: message, preferredStyle: UIAlertController.Style.actionSheet) filesTable.dataSource = self
alert.isModalInPopover = true
filesTable.alwaysBounceVertical = true
let pickerFrame = UIPickerView(frame: CGRect(x: 5, y: 20, width: 400 - 20, height: 140)) // CGRectMake(left, top, width, height) - left and top are like margins let refresher = UIRefreshControl()
pickerFrame.tag = 555 refresher.addTarget(self, action: #selector(refreshStream), for: .valueChanged)
//set the pickers datasource and delegate
pickerFrame.delegate = self refreshControl = refresher
filesTable.addSubview(refreshControl)
//Add the picker to the alert controller }
alert.view.addSubview(pickerFrame)
let okAction = UIAlertAction(title: "OK", style: .default, handler: { @objc func refreshStream() {
(alert: UIAlertAction!) -> Void in
//Perform Action print("refresh")
}) filesTable?.reloadData()
alert.addAction(okAction)
let cancelAction = UIAlertAction(title: "Cancel", style: .destructive, handler: nil) refreshControl.endRefreshing()
alert.addAction(cancelAction)
self.parent!.present(alert, animated: true, completion: { })
*/
} }
override func viewWillAppear(_ animated: Bool) { override func viewWillAppear(_ animated: Bool) {
@ -69,45 +224,228 @@ class FourthViewController: UIViewController, UIPickerViewDelegate{
} }
gradient.locations = [0.00, 1.00] gradient.locations = [0.00, 1.00]
/*let gradientChangeAnimation = CABasicAnimation(keyPath: "colors")
gradientChangeAnimation.duration = 5.0
if((GlobalVars.hour >= 8) && (GlobalVars.hour <= 19)){ //Daytime
//print("day")
gradientChangeAnimation.toValue = [UIColor(red: 0.00, green: 0.31, blue: 0.59, alpha: 1).cgColor, UIColor(red: 0.07, green: 0.45, blue: 0.87, alpha: 1).cgColor]
} else if((GlobalVars.hour >= 20) && (GlobalVars.hour <= 21)){//Sunset
//print("sunset")
gradientChangeAnimation.toValue = [UIColor(red: 0.00, green: 0.31, blue: 0.59, alpha: 1).cgColor, UIColor(red: 1.00, green: 0.61, blue: 0.43, alpha: 1).cgColor]
} else if((GlobalVars.hour >= 22) || (GlobalVars.hour <= 5)){//Night
//print("night")
gradientChangeAnimation.toValue = [
UIColor(red: 0.68, green: 0.67, blue: 1.0, alpha: 1).cgColor,
UIColor(red: 1.00, green: 0.00, blue: 0.09, alpha: 1).cgColor
]
} else if((GlobalVars.hour >= 6) && (GlobalVars.hour <= 7)){//Sunrise
//print("sunrise")
gradientChangeAnimation.toValue = [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]
}
gradientChangeAnimation.autoreverses = true
gradientChangeAnimation.fillMode = CAMediaTimingFillMode.forwards
gradientChangeAnimation.isRemovedOnCompletion = false
gradient.add(gradientChangeAnimation, forKey: "colorChange")
*/
// add the gradient to the view
gradientView.layer.addSublayer(gradient) gradientView.layer.addSublayer(gradient)
/// Create a sequence /*switch GlobalVars.selectedMusicList {
var sequence : MusicSequence? = nil case 0:
var musicSequenceStatus = NewMusicSequence(&sequence) //print(GlobalVars.musicSelectionID0)
var track : MusicTrack? = nil print(GlobalVars.musicSelection0)
/// Create a music track containg a sequence and a music track case 1:
var musicTrack = MusicSequenceNewTrack(sequence!, &track) //print(GlobalVars.musicSelectionID1)
var time = MusicTimeStamp(1.0) print(GlobalVars.musicSelection1)
case 2:
//print(GlobalVars.musicSelectionID2)
// The notes of the song print(GlobalVars.musicSelection2)
var notes: [UInt8] = [50,47,48,50/*,128*/,40,48,/*128,*/47,43,45,47/*,128*/,38,45] case 3:
//print(GlobalVars.musicSelectionID3)
for index:Int in 0...11 { print(GlobalVars.musicSelection3)
var note = MIDINoteMessage(channel: 0, case 4:
note: notes[index], //print(GlobalVars.musicSelectionID4)
velocity: 64, print(GlobalVars.musicSelection4)
releaseVelocity: 0, default:
duration: 1.0) //print(GlobalVars.musicSelectionID0)
guard let track = track else {fatalError()} print(GlobalVars.musicSelection0)
musicTrack = MusicTrackNewMIDINoteEvent(track, time, &note) }*/
time += 1
}
// Creating a player
var musicNotePlayer : MusicPlayer? = nil
var player = NewMusicPlayer(&musicNotePlayer)
player = MusicPlayerSetSequence(musicNotePlayer!, sequence)
player = MusicPlayerStart(musicNotePlayer!)
} }
override func viewDidDisappear(_ animated: Bool) { override func viewDidDisappear(_ animated: Bool) {
gradientView.layer.sublayers?.forEach { $0.removeFromSuperlayer() } gradientView.layer.sublayers?.forEach { $0.removeFromSuperlayer() }
} }
@IBAction func importPopup(_ sender: Any) {
//1. Create the alert controller.
let alert = UIAlertController(title: "Download Music", message: "Enter a link to an MP3, ZIP, or properly formatted JSON file \n If your files aren't visible after entering the link, try pulling down to refresh", preferredStyle: .alert)
//2. Add the text field. You can configure it however you need.
alert.addTextField { (textField) in
textField.text = "https://downloads.khinsider.com"
}
// 3. Grab the value from the text field, and print it when the user clicks OK.
alert.addAction(UIAlertAction(title: "OK", style: .default, handler: {_ in
let textField = alert.textFields![0] // Force unwrapping because we know it exists.
print("Text field: \(textField.text)")
if (!textField.text!.isEmpty) {
let fileURL = URL(string: textField.text!)
let sessionConfig = URLSessionConfiguration.default
let session = URLSession(configuration: sessionConfig)
let request = URLRequest(url:fileURL!)
if ((fileURL?.pathExtension == "mp3") || (fileURL?.pathExtension == "zip")) {
let documentsUrl:URL = (FileManager.default.urls(for: .documentDirectory, in: .userDomainMask).first!) as URL
let destinationFileUrl = documentsUrl.appendingPathComponent(fileURL?.lastPathComponent ?? "fileerr")
self.downloadSong(request: request, destination: destinationFileUrl, runFrom: "Default")
} else if (fileURL?.pathExtension == "json") {
print("file is json")
let documentsUrl:URL = (FileManager.default.urls(for: .documentDirectory, in: .userDomainMask).first!) as URL
let task = session.dataTask(with: request) { (data, response, error) in
if error == nil {
do{
let jsonData = try JSON(data: data!)
print(jsonData)
//print(jsonURL)
for (index,subJson):(String, JSON) in jsonData {
let hour:Int = subJson["hour"].intValue
print(hour)
let url:URL = subJson["url"].url!
//let url:URL = URL(fileURLWithPath: urlAsString)
let urlRequest = URLRequest(url:url)
print(url)
var DLHourPadding:String = ""
if(hour < 10){
DLHourPadding = "0"
}
let destinationFileUrl = documentsUrl.appendingPathComponent((fileURL!.deletingPathExtension().lastPathComponent) + " - " + DLHourPadding + String(hour) + " - " + url.lastPathComponent)
print(destinationFileUrl)
self.downloadSong(request: urlRequest, destination: destinationFileUrl, runFrom: "JSON")
GlobalVars.musicFormatType[GlobalVars.selectedMusicList][hour] = false
GlobalVars.musicSelectionID[GlobalVars.selectedMusicList][hour] = 0
GlobalVars.musicSelection[GlobalVars.selectedMusicList][hour] = destinationFileUrl.lastPathComponent
GlobalVars.musicFileURL[GlobalVars.selectedMusicList][hour] = destinationFileUrl.lastPathComponent
}
}
catch {
print(error)
}
}
}
task.resume()
} else {
let unsupportedAlert = UIAlertController(title: "", message: "Please make sure your url links to an mp3, zip, or json file", preferredStyle: UIAlertController.Style.alert)
unsupportedAlert.addAction(UIAlertAction(title: "Okay", style: UIAlertAction.Style.default, handler: nil))
self.present(unsupportedAlert, animated: true, completion: nil)
}
}
}))
// 4. Present the alert.
self.present(alert, animated: true, completion: nil)
}
@IBAction func close(_ sender: Any) {
dismiss(animated: true)
}
func downloadSong(request:URLRequest,destination:URL,runFrom:String) -> Void {
let sessionConfig = URLSessionConfiguration.default
let session = URLSession(configuration: sessionConfig)
let task = session.downloadTask(with: request) { (tempLocalUrl, response, error) in
if let tempLocalUrl = tempLocalUrl, error == nil {
do {
try FileManager.default.copyItem(at: tempLocalUrl, to: destination)
} catch (let writeError) {
print("Error creating a file \(destination) : \(writeError)")
DispatchQueue.main.async {
let writeErrAlert = UIAlertController(title: "Error Saving File '\(destination.lastPathComponent)'", message: "Check to make sure another file with the same name doesn't already exist", preferredStyle: UIAlertController.Style.alert)
writeErrAlert.addAction(UIAlertAction(title: "Okay", style: UIAlertAction.Style.default, handler: nil))
self.present(writeErrAlert, animated: true, completion: nil)
self.filesTable.reloadData()
}
}
// Success
if (runFrom == "Default") {
if let statusCode = (response as? HTTPURLResponse)?.statusCode {
print("Successfully downloaded. Status code: \(statusCode)")
DispatchQueue.main.async {
let dlAlert = UIAlertController(title: "Successfully Downloaded", message: "\(destination.lastPathComponent)", preferredStyle: UIAlertController.Style.alert)
dlAlert.addAction(UIAlertAction(title: "Okay", style: UIAlertAction.Style.default, handler: nil))
self.present(dlAlert, animated: true, completion: nil)
self.filesTable.reloadData()
}
}
}
} else {
print("Error took place while downloading a file. Error description: %@", error?.localizedDescription as Any);
DispatchQueue.main.async {
let networkErrAlert = UIAlertController(title: "Error Downloading File '\(destination.lastPathComponent)'", message: "Check to make sure your internet connection is stable and that the URL is correct", preferredStyle: UIAlertController.Style.alert)
networkErrAlert.addAction(UIAlertAction(title: "Okay", style: UIAlertAction.Style.default, handler: nil))
self.present(networkErrAlert, animated: true, completion: nil)
self.filesTable.reloadData()
}
}
if destination.pathExtension == "zip" {
print("it's a zip!")
if runFrom == "Default" {
let dirs : [String] = NSSearchPathForDirectoriesInDomains(FileManager.SearchPathDirectory.documentDirectory, FileManager.SearchPathDomainMask.allDomainsMask, true)
let filePathToDelete = dirs[0].appendingFormat("/" + destination.lastPathComponent)
do {
//let unzipDirectory = try Zip.quickUnzipFile(destination) // Unzip
let unzipDirectory = try Zip.unzipFile(destination, destination: URL(fileURLWithPath: dirs[0]), overwrite: false, password: nil)
}
catch {
print("Something went wrong: \(error)")
}
do {
let fileManager = FileManager.default
// Check if file exists
if fileManager.fileExists(atPath: filePathToDelete) {
// Delete file
try fileManager.removeItem(atPath: filePathToDelete)
} else {
print("File does not exist")
}
}
catch let error as NSError {
print("An error took place: \(error)")
}
} else if runFrom == "JSON" {
print("Cannot download zip in json!")
}
}
}
task.resume()
}
} }

View file

@ -24,6 +24,8 @@
<string>public.app-category.music</string> <string>public.app-category.music</string>
<key>LSRequiresIPhoneOS</key> <key>LSRequiresIPhoneOS</key>
<true/> <true/>
<key>LSSupportsOpeningDocumentsInPlace</key>
<true/>
<key>NSAppleMusicUsageDescription</key> <key>NSAppleMusicUsageDescription</key>
<string>To select songs for each hour</string> <string>To select songs for each hour</string>
<key>UIAppFonts</key> <key>UIAppFonts</key>
@ -53,6 +55,8 @@
<array> <array>
<string>audio</string> <string>audio</string>
</array> </array>
<key>UIFileSharingEnabled</key>
<true/>
<key>UILaunchStoryboardName</key> <key>UILaunchStoryboardName</key>
<string>LaunchScreen</string> <string>LaunchScreen</string>
<key>UIMainStoryboardFile</key> <key>UIMainStoryboardFile</key>

View file

@ -81,7 +81,16 @@ class SecondViewController: UIViewController, UITableViewDelegate, UITableViewDa
cell.accessibilityLabel = cell.hourLabel.text cell.accessibilityLabel = cell.hourLabel.text
cell.accessibilityLabel?.append(". ") cell.accessibilityLabel?.append(". ")
switch GlobalVars.selectedMusicList { cell.songLabel?.text = GlobalVars.musicSelection[GlobalVars.selectedMusicList][indexPath.row]
if ((GlobalVars.musicSelectionID[GlobalVars.selectedMusicList][indexPath.row] == 0) && (GlobalVars.musicFileURL[GlobalVars.selectedMusicList][indexPath.row] == "")){
cell.accessoryType = .detailButton
cell.accessibilityLabel?.append("No song set")
} else {
cell.accessoryType = .none
cell.accessibilityLabel?.append(cell.songLabel.text!)
}
/*switch GlobalVars.selectedMusicList {
case 0: case 0:
cell.songLabel?.text = GlobalVars.musicSelection0[indexPath.row] cell.songLabel?.text = GlobalVars.musicSelection0[indexPath.row]
if (GlobalVars.musicSelectionID0[indexPath.row] == 0){ if (GlobalVars.musicSelectionID0[indexPath.row] == 0){
@ -131,7 +140,7 @@ class SecondViewController: UIViewController, UITableViewDelegate, UITableViewDa
cell.songLabel?.text = "uh oh!" cell.songLabel?.text = "uh oh!"
cell.accessoryType = .detailButton cell.accessoryType = .detailButton
cell.accessibilityLabel?.append("No song set") cell.accessibilityLabel?.append("No song set")
} }*/
cell.accessibilityHint?.append("Press to set a song for this hour") cell.accessibilityHint?.append("Press to set a song for this hour")
@ -146,7 +155,13 @@ class SecondViewController: UIViewController, UITableViewDelegate, UITableViewDa
func tableView(_ tableView: UITableView, commit editingStyle: UITableViewCell.EditingStyle, forRowAt indexPath: IndexPath){ func tableView(_ tableView: UITableView, commit editingStyle: UITableViewCell.EditingStyle, forRowAt indexPath: IndexPath){
if editingStyle == .delete if editingStyle == .delete
{ {
switch GlobalVars.selectedMusicList {
GlobalVars.musicSelection[GlobalVars.selectedMusicList][indexPath.row] = ""
GlobalVars.musicSelectionID[GlobalVars.selectedMusicList][indexPath.row] = 0
GlobalVars.musicFileURL[GlobalVars.selectedMusicList][indexPath.row] = ""
GlobalVars.musicFormatType[GlobalVars.selectedMusicList][indexPath.row] = true
/*switch GlobalVars.selectedMusicList {
case 0: case 0:
GlobalVars.musicSelection0[indexPath.row] = "" GlobalVars.musicSelection0[indexPath.row] = ""
GlobalVars.musicSelectionID0[indexPath.row] = 0 GlobalVars.musicSelectionID0[indexPath.row] = 0
@ -165,7 +180,7 @@ class SecondViewController: UIViewController, UITableViewDelegate, UITableViewDa
default: default:
GlobalVars.musicSelection0[indexPath.row] = "" GlobalVars.musicSelection0[indexPath.row] = ""
GlobalVars.musicSelectionID0[indexPath.row] = 0 GlobalVars.musicSelectionID0[indexPath.row] = 0
} }*/
hoursTable.reloadData() hoursTable.reloadData()
@ -177,15 +192,31 @@ class SecondViewController: UIViewController, UITableViewDelegate, UITableViewDa
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath){ func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath){
//let mediaPicker = MPMediaPickerController(mediaTypes: MPMediaType.music) let alert = UIAlertController(title: "Where do you want to select music from?", message: "", preferredStyle: .actionSheet)
tableHour = indexPath.row alert.popoverPresentationController?.sourceView = self.view
//print(tableHour) alert.popoverPresentationController?.sourceRect = CGRect(x: self.view.bounds.size.width / 2.0, y: self.view.bounds.size.height / 2.0, width: 1.0, height: 1.0)
present(mediaPicker, animated: true, completion: nil) if (UIDevice.current.userInterfaceIdiom == .pad){
/*if (selectedSong != "") { alert.popoverPresentationController!.permittedArrowDirections = []
GlobalVars.musicSelection[indexPath.row] = selectedSong
selectedSong = ""
} }
self.hoursTable.reloadData()*/ //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)
alert.addAction(UIAlertAction(title: "From Music App", style: .default, handler: {_ in
self.tableHour = indexPath.row
self.present(self.mediaPicker, animated: true, completion: nil)
}))
alert.addAction(UIAlertAction(title: "From File", style: .default, handler: {_ in
let NotificationVC = self.storyboard?.instantiateViewController(withIdentifier: "FourthViewController") as! UIViewController
GlobalVars.selectedCell = indexPath.row
NotificationVC.modalPresentationStyle = .fullScreen
self.present(NotificationVC, animated: true, completion: nil)
}))
alert.addAction(UIAlertAction(title: "Cancel", style: .cancel, handler: {_ in
}))
self.present(alert, animated: true)
} }
@ -223,9 +254,18 @@ class SecondViewController: UIViewController, UITableViewDelegate, UITableViewDa
//print("selected song") //print("selected song")
selectedSong = String(mediaItemCollection.items[0].title ?? "NOTHING") selectedSong = String(mediaItemCollection.items[0].title ?? "NOTHING")
//print(selectedSong) //print(selectedSong)
/*
GlobalVars.musicSelectionID[GlobalVars.selectedMusicList][tableHour] = mediaItemCollection.items[0].persistentID
GlobalVars.musicSelection[GlobalVars.selectedMusicList][tableHour] = selectedSong
*/
GlobalVars.musicSelection[GlobalVars.selectedMusicList][tableHour] = selectedSong
GlobalVars.musicSelectionID[GlobalVars.selectedMusicList][tableHour] = mediaItemCollection.items[0].persistentID
GlobalVars.musicFileURL[GlobalVars.selectedMusicList][tableHour] = ""
GlobalVars.musicFormatType[GlobalVars.selectedMusicList][tableHour] = true
//print(GlobalVars.selectedMusicList) //print(GlobalVars.selectedMusicList)
switch GlobalVars.selectedMusicList { /*switch GlobalVars.selectedMusicList {
case 0: case 0:
GlobalVars.musicSelectionID0[tableHour] = mediaItemCollection.items[0].persistentID GlobalVars.musicSelectionID0[tableHour] = mediaItemCollection.items[0].persistentID
GlobalVars.musicSelection0[tableHour] = selectedSong GlobalVars.musicSelection0[tableHour] = selectedSong
@ -244,7 +284,7 @@ class SecondViewController: UIViewController, UITableViewDelegate, UITableViewDa
default: default:
GlobalVars.musicSelectionID0[tableHour] = mediaItemCollection.items[0].persistentID GlobalVars.musicSelectionID0[tableHour] = mediaItemCollection.items[0].persistentID
GlobalVars.musicSelection0[tableHour] = selectedSong GlobalVars.musicSelection0[tableHour] = selectedSong
} }*/
//GlobalVars.musicSelectionID1[tableHour] = mediaItemCollection.items[0].persistentID //GlobalVars.musicSelectionID1[tableHour] = mediaItemCollection.items[0].persistentID
//GlobalVars.musicSelection1[tableHour] = selectedSong //GlobalVars.musicSelection1[tableHour] = selectedSong
@ -271,8 +311,10 @@ class SecondViewController: UIViewController, UITableViewDelegate, UITableViewDa
@IBAction func selectListControlChanged(_ sender: Any) { @IBAction func selectListControlChanged(_ sender: Any) {
MPMusicPlayerController.applicationMusicPlayer.stop() MPMusicPlayerController.applicationMusicPlayer.stop()
audioPlayer.stop()
GlobalVars.selectedMusicList = selectListControl.selectedSegmentIndex GlobalVars.selectedMusicList = selectListControl.selectedSegmentIndex
defaults.set(selectListControl.selectedSegmentIndex, forKey: "savedSelectedMusicList")
//print(GlobalVars.selectedMusicList) //print(GlobalVars.selectedMusicList)
hoursTable.reloadData() hoursTable.reloadData()
/*var noSongs = false /*var noSongs = false
@ -345,11 +387,12 @@ class SecondViewController: UIViewController, UITableViewDelegate, UITableViewDa
hoursTable.dataSource = self hoursTable.dataSource = self
selectListControl.selectedSegmentIndex = GlobalVars.selectedMusicList selectListControl.selectedSegmentIndex = GlobalVars.selectedMusicList
} }
override func viewWillAppear(_ animated: Bool) { override func viewWillAppear(_ animated: Bool) {
hoursTable.reloadData()
let prevHour = GlobalVars.hour let prevHour = GlobalVars.hour
GlobalVars.hour = Calendar.current.component(.hour, from: Date()) GlobalVars.hour = Calendar.current.component(.hour, from: Date())
if GlobalVars.hour != prevHour { if GlobalVars.hour != prevHour {
@ -402,85 +445,13 @@ class SecondViewController: UIViewController, UITableViewDelegate, UITableViewDa
// add the gradient to the view // add the gradient to the view
gradientView.layer.addSublayer(gradient) gradientView.layer.addSublayer(gradient)
switch GlobalVars.selectedMusicList {
case 0:
//print(GlobalVars.musicSelectionID0)
print(GlobalVars.musicSelection0)
case 1:
//print(GlobalVars.musicSelectionID1)
print(GlobalVars.musicSelection1)
case 2:
//print(GlobalVars.musicSelectionID2)
print(GlobalVars.musicSelection2)
case 3:
//print(GlobalVars.musicSelectionID3)
print(GlobalVars.musicSelection3)
case 4:
//print(GlobalVars.musicSelectionID4)
print(GlobalVars.musicSelection4)
default:
//print(GlobalVars.musicSelectionID0)
print(GlobalVars.musicSelection0)
}
} }
override func viewWillDisappear(_ animated: Bool) { override func viewWillDisappear(_ animated: Bool) {
do { do {try defaults.setObject(GlobalVars.musicSelection, forKey: "savedMusicSelection")} catch {/*print(error.localizedDescription)*/}
try defaults.setObject(GlobalVars.musicSelection0, forKey: "savedMusicSelection0") do {try defaults.setObject(GlobalVars.musicSelectionID, forKey: "savedMusicSelectionID")} catch {/*print(error.localizedDescription)*/}
} catch { do {try defaults.setObject(GlobalVars.musicFileURL, forKey: "savedMusicFileURL")} catch {/*print(error.localizedDescription)*/}
//print(error.localizedDescription) do {try defaults.setObject(GlobalVars.musicFormatType, forKey: "savedMusicFileType")} catch {/*print(error.localizedDescription)*/}
}
do {
try defaults.setObject(GlobalVars.musicSelectionID0, forKey: "savedMusicSelectionID0")
} catch {
//print(error.localizedDescription)
}
do {
try defaults.setObject(GlobalVars.musicSelection1, forKey: "savedMusicSelection1")
} catch {
//print(error.localizedDescription)
}
do {
try defaults.setObject(GlobalVars.musicSelectionID1, forKey: "savedMusicSelectionID1")
} catch {
//print(error.localizedDescription)
}
do {
try defaults.setObject(GlobalVars.musicSelection2, forKey: "savedMusicSelection2")
} catch {
//print(error.localizedDescription)
}
do {
try defaults.setObject(GlobalVars.musicSelectionID2, forKey: "savedMusicSelectionID2")
} catch {
//print(error.localizedDescription)
}
do {
try defaults.setObject(GlobalVars.musicSelection3, forKey: "savedMusicSelection3")
} catch {
//print(error.localizedDescription)
}
do {
try defaults.setObject(GlobalVars.musicSelectionID3, forKey: "savedMusicSelectionID3")
} catch {
//print(error.localizedDescription)
}
do {
try defaults.setObject(GlobalVars.musicSelection4, forKey: "savedMusicSelection4")
} catch {
//print(error.localizedDescription)
}
do {
try defaults.setObject(GlobalVars.musicSelectionID4, forKey: "savedMusicSelectionID4")
} catch {
//print(error.localizedDescription)
}
do {
try defaults.setObject(GlobalVars.selectedMusicList, forKey: "savedSelectedMusicList")
} catch {
//print(error.localizedDescription)
}
} }
override func viewDidDisappear(_ animated: Bool) { override func viewDidDisappear(_ animated: Bool) {