diff --git a/Examples/AnimatingViewsAndTransitions/Complete/.gitignore b/Examples/AnimatingViewsAndTransitions/Complete/.gitignore new file mode 100755 index 0000000..9e50718 --- /dev/null +++ b/Examples/AnimatingViewsAndTransitions/Complete/.gitignore @@ -0,0 +1,21 @@ +# See LICENSE folder for this sample’s licensing information. +# +# Apple sample code gitignore configuration. + +# Finder +.DS_Store + +# Xcode - User files +xcuserdata/ + +**/*.xcodeproj/project.xcworkspace/* +!**/*.xcodeproj/project.xcworkspace/xcshareddata + +**/*.xcodeproj/project.xcworkspace/xcshareddata/* +!**/*.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings + +**/*.playground/playground.xcworkspace/* +!**/*.playground/playground.xcworkspace/xcshareddata + +**/*.playground/playground.xcworkspace/xcshareddata/* +!**/*.playground/playground.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings diff --git a/Examples/AnimatingViewsAndTransitions/Complete/Configuration/SampleCode.xcconfig b/Examples/AnimatingViewsAndTransitions/Complete/Configuration/SampleCode.xcconfig new file mode 100755 index 0000000..db86c06 --- /dev/null +++ b/Examples/AnimatingViewsAndTransitions/Complete/Configuration/SampleCode.xcconfig @@ -0,0 +1,13 @@ +// +// See LICENSE folder for this sample’s licensing information. +// +// SampleCode.xcconfig +// + +// The `SAMPLE_CODE_DISAMBIGUATOR` configuration is to make it easier to build +// and run a sample code project. Once you set your project's development team, +// you'll have a unique bundle identifier. This is because the bundle identifier +// is derived based on the 'SAMPLE_CODE_DISAMBIGUATOR' value. Do not use this +// approach in your own projects—it's only useful for sample code projects because +// they are frequently downloaded and don't have a development team set. +SAMPLE_CODE_DISAMBIGUATOR=${DEVELOPMENT_TEAM} diff --git a/Examples/AnimatingViewsAndTransitions/Complete/LICENSE/LICENSE.txt b/Examples/AnimatingViewsAndTransitions/Complete/LICENSE/LICENSE.txt new file mode 100755 index 0000000..94e3d54 --- /dev/null +++ b/Examples/AnimatingViewsAndTransitions/Complete/LICENSE/LICENSE.txt @@ -0,0 +1,8 @@ +Copyright © 2019 Apple Inc. + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + diff --git a/Examples/AnimatingViewsAndTransitions/Complete/Landmarks/AnimatingViewsAndTransitions.xcodeproj/.xcodesamplecode.plist b/Examples/AnimatingViewsAndTransitions/Complete/Landmarks/AnimatingViewsAndTransitions.xcodeproj/.xcodesamplecode.plist new file mode 100755 index 0000000..5dd5da8 --- /dev/null +++ b/Examples/AnimatingViewsAndTransitions/Complete/Landmarks/AnimatingViewsAndTransitions.xcodeproj/.xcodesamplecode.plist @@ -0,0 +1,5 @@ + + + + + diff --git a/Examples/AnimatingViewsAndTransitions/Complete/Landmarks/AnimatingViewsAndTransitions.xcodeproj/project.pbxproj b/Examples/AnimatingViewsAndTransitions/Complete/Landmarks/AnimatingViewsAndTransitions.xcodeproj/project.pbxproj new file mode 100755 index 0000000..c1dabf0 --- /dev/null +++ b/Examples/AnimatingViewsAndTransitions/Complete/Landmarks/AnimatingViewsAndTransitions.xcodeproj/project.pbxproj @@ -0,0 +1,525 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 50; + objects = { + +/* Begin PBXBuildFile section */ + B7310DD1229F6839001079B9 /* HexagonParameters.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7310DD0229F6839001079B9 /* HexagonParameters.swift */; }; + B7310DD3229F6CA9001079B9 /* Badge.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7310DD2229F6CA9001079B9 /* Badge.swift */; }; + B7394866229F194000C47603 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7394865229F194000C47603 /* AppDelegate.swift */; }; + B7394868229F194000C47603 /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7394867229F194000C47603 /* SceneDelegate.swift */; }; + B739486A229F194000C47603 /* LandmarkDetail.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7394869229F194000C47603 /* LandmarkDetail.swift */; }; + B739486C229F194200C47603 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = B739486B229F194200C47603 /* Assets.xcassets */; }; + B739486F229F194200C47603 /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = B739486E229F194200C47603 /* Preview Assets.xcassets */; }; + B7394872229F194200C47603 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = B7394870229F194200C47603 /* LaunchScreen.storyboard */; }; + B739487A229F1B3F00C47603 /* CircleImage.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7394879229F1B3F00C47603 /* CircleImage.swift */; }; + B739487C229F1B6800C47603 /* MapView.swift in Sources */ = {isa = PBXBuildFile; fileRef = B739487B229F1B6800C47603 /* MapView.swift */; }; + B7394881229F28B900C47603 /* Landmark.swift in Sources */ = {isa = PBXBuildFile; fileRef = B739487F229F28B900C47603 /* Landmark.swift */; }; + B7394882229F28B900C47603 /* Data.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7394880229F28B900C47603 /* Data.swift */; }; + B7394891229F292F00C47603 /* rainbowlake.jpg in Resources */ = {isa = PBXBuildFile; fileRef = B7394884229F292D00C47603 /* rainbowlake.jpg */; }; + B7394893229F292F00C47603 /* icybay.jpg in Resources */ = {isa = PBXBuildFile; fileRef = B7394886229F292E00C47603 /* icybay.jpg */; }; + B7394894229F292F00C47603 /* lakemcdonald.jpg in Resources */ = {isa = PBXBuildFile; fileRef = B7394887229F292E00C47603 /* lakemcdonald.jpg */; }; + B7394895229F292F00C47603 /* turtlerock.jpg in Resources */ = {isa = PBXBuildFile; fileRef = B7394888229F292E00C47603 /* turtlerock.jpg */; }; + B7394896229F292F00C47603 /* umbagog.jpg in Resources */ = {isa = PBXBuildFile; fileRef = B7394889229F292E00C47603 /* umbagog.jpg */; }; + B7394897229F292F00C47603 /* hiddenlake.jpg in Resources */ = {isa = PBXBuildFile; fileRef = B739488A229F292E00C47603 /* hiddenlake.jpg */; }; + B7394898229F292F00C47603 /* stmarylake.jpg in Resources */ = {isa = PBXBuildFile; fileRef = B739488B229F292E00C47603 /* stmarylake.jpg */; }; + B7394899229F292F00C47603 /* twinlake.jpg in Resources */ = {isa = PBXBuildFile; fileRef = B739488C229F292E00C47603 /* twinlake.jpg */; }; + B739489A229F292F00C47603 /* silversalmoncreek.jpg in Resources */ = {isa = PBXBuildFile; fileRef = B739488D229F292E00C47603 /* silversalmoncreek.jpg */; }; + B739489B229F292F00C47603 /* landmarkData.json in Resources */ = {isa = PBXBuildFile; fileRef = B739488E229F292E00C47603 /* landmarkData.json */; }; + B739489C229F292F00C47603 /* chincoteague.jpg in Resources */ = {isa = PBXBuildFile; fileRef = B739488F229F292F00C47603 /* chincoteague.jpg */; }; + B739489D229F292F00C47603 /* chilkoottrail.jpg in Resources */ = {isa = PBXBuildFile; fileRef = B7394890229F292F00C47603 /* chilkoottrail.jpg */; }; + B739489F229F2D9700C47603 /* LandmarkRow.swift in Sources */ = {isa = PBXBuildFile; fileRef = B739489E229F2D9700C47603 /* LandmarkRow.swift */; }; + B73948A1229F2E1F00C47603 /* LandmarkList.swift in Sources */ = {isa = PBXBuildFile; fileRef = B73948A0229F2E1F00C47603 /* LandmarkList.swift */; }; + B73948A3229F3E2200C47603 /* charleyrivers.jpg in Resources */ = {isa = PBXBuildFile; fileRef = B73948A2229F3E2200C47603 /* charleyrivers.jpg */; }; + B7D2AAC5229F4D7C0061E5F5 /* UserData.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7D2AAC4229F4D7C0061E5F5 /* UserData.swift */; }; + B7D587AE229F7382006E8DCF /* BadgeBackground.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7D587AD229F7382006E8DCF /* BadgeBackground.swift */; }; + B7D587B0229F73C1006E8DCF /* BadgeSymbol.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7D587AF229F73C1006E8DCF /* BadgeSymbol.swift */; }; + B7D587B2229F7406006E8DCF /* RotatedBadgeSymbol.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7D587B1229F7406006E8DCF /* RotatedBadgeSymbol.swift */; }; + B7D587B6229F825D006E8DCF /* HikeView.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7D587B5229F825D006E8DCF /* HikeView.swift */; }; + B7D587B8229F826D006E8DCF /* GraphCapsule.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7D587B7229F826D006E8DCF /* GraphCapsule.swift */; }; + B7D587BA229F8288006E8DCF /* Hike.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7D587B9229F8288006E8DCF /* Hike.swift */; }; + B7D587BC229F82EB006E8DCF /* HikeDetail.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7D587BB229F82EB006E8DCF /* HikeDetail.swift */; }; + B7D587BE229F82FF006E8DCF /* HikeGraph.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7D587BD229F82FF006E8DCF /* HikeGraph.swift */; }; + B7D587C0229F830B006E8DCF /* hikeData.json in Resources */ = {isa = PBXBuildFile; fileRef = B7D587BF229F830B006E8DCF /* hikeData.json */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + 704D6530704D8B0000000001 /* SampleCode.xcconfig */ = {isa = PBXFileReference; name = SampleCode.xcconfig; path = ../Configuration/SampleCode.xcconfig; sourceTree = ""; }; + 7074FA407074F5C000000001 /* LICENSE.txt */ = {isa = PBXFileReference; includeInIndex = 1; path = LICENSE.txt; sourceTree = ""; }; + B7310DD0229F6839001079B9 /* HexagonParameters.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HexagonParameters.swift; sourceTree = ""; }; + B7310DD2229F6CA9001079B9 /* Badge.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Badge.swift; sourceTree = ""; }; + B7394862229F194000C47603 /* Landmarks.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Landmarks.app; sourceTree = BUILT_PRODUCTS_DIR; }; + B7394865229F194000C47603 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + B7394867229F194000C47603 /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = ""; }; + B7394869229F194000C47603 /* LandmarkDetail.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LandmarkDetail.swift; sourceTree = ""; }; + B739486B229F194200C47603 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + B739486E229F194200C47603 /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = ""; }; + B7394871229F194200C47603 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + B7394873229F194200C47603 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + B7394879229F1B3F00C47603 /* CircleImage.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CircleImage.swift; sourceTree = ""; }; + B739487B229F1B6800C47603 /* MapView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MapView.swift; sourceTree = ""; }; + B739487F229F28B900C47603 /* Landmark.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Landmark.swift; sourceTree = ""; }; + B7394880229F28B900C47603 /* Data.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Data.swift; sourceTree = ""; }; + B7394884229F292D00C47603 /* rainbowlake.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = rainbowlake.jpg; sourceTree = ""; }; + B7394886229F292E00C47603 /* icybay.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = icybay.jpg; sourceTree = ""; }; + B7394887229F292E00C47603 /* lakemcdonald.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = lakemcdonald.jpg; sourceTree = ""; }; + B7394888229F292E00C47603 /* turtlerock.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = turtlerock.jpg; sourceTree = ""; }; + B7394889229F292E00C47603 /* umbagog.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = umbagog.jpg; sourceTree = ""; }; + B739488A229F292E00C47603 /* hiddenlake.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = hiddenlake.jpg; sourceTree = ""; }; + B739488B229F292E00C47603 /* stmarylake.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = stmarylake.jpg; sourceTree = ""; }; + B739488C229F292E00C47603 /* twinlake.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = twinlake.jpg; sourceTree = ""; }; + B739488D229F292E00C47603 /* silversalmoncreek.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = silversalmoncreek.jpg; sourceTree = ""; }; + B739488E229F292E00C47603 /* landmarkData.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = landmarkData.json; sourceTree = ""; }; + B739488F229F292F00C47603 /* chincoteague.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = chincoteague.jpg; sourceTree = ""; }; + B7394890229F292F00C47603 /* chilkoottrail.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = chilkoottrail.jpg; sourceTree = ""; }; + B739489E229F2D9700C47603 /* LandmarkRow.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = LandmarkRow.swift; path = "Supporting Views/LandmarkRow.swift"; sourceTree = ""; }; + B73948A0229F2E1F00C47603 /* LandmarkList.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LandmarkList.swift; sourceTree = ""; }; + B73948A2229F3E2200C47603 /* charleyrivers.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = charleyrivers.jpg; sourceTree = ""; }; + B7D2AAC4229F4D7C0061E5F5 /* UserData.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UserData.swift; sourceTree = ""; }; + B7D587AD229F7382006E8DCF /* BadgeBackground.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BadgeBackground.swift; sourceTree = ""; }; + B7D587AF229F73C1006E8DCF /* BadgeSymbol.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BadgeSymbol.swift; sourceTree = ""; }; + B7D587B1229F7406006E8DCF /* RotatedBadgeSymbol.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RotatedBadgeSymbol.swift; sourceTree = ""; }; + B7D587B5229F825D006E8DCF /* HikeView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HikeView.swift; sourceTree = ""; }; + B7D587B7229F826D006E8DCF /* GraphCapsule.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GraphCapsule.swift; sourceTree = ""; }; + B7D587B9229F8288006E8DCF /* Hike.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Hike.swift; sourceTree = ""; }; + B7D587BB229F82EB006E8DCF /* HikeDetail.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HikeDetail.swift; sourceTree = ""; }; + B7D587BD229F82FF006E8DCF /* HikeGraph.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HikeGraph.swift; sourceTree = ""; }; + B7D587BF229F830B006E8DCF /* hikeData.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = hikeData.json; sourceTree = ""; }; + C4E4AAA0C4E4035000000001 /* README.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; name = README.md; path = ../README.md; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + B739485F229F194000C47603 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 704E08B0704E8FD000000001 /* Configuration */ = { + isa = PBXGroup; + children = ( + 704D6530704D8B0000000001 /* SampleCode.xcconfig */, + ); + name = Configuration; + sourceTree = ""; + }; + 7074E3507074EFD000000001 /* LICENSE */ = { + isa = PBXGroup; + children = ( + 7074FA407074F5C000000001 /* LICENSE.txt */, + ); + name = LICENSE; + path = ../LICENSE; + sourceTree = ""; + }; + B7394859229F194000C47603 = { + isa = PBXGroup; + children = ( + C4E4AAA0C4E4035000000001 /* README.md */, + B7394864229F194000C47603 /* Landmarks */, + B7394863229F194000C47603 /* Products */, + 704E08B0704E8FD000000001 /* Configuration */, + 7074E3507074EFD000000001 /* LICENSE */, + ); + sourceTree = ""; + }; + B7394863229F194000C47603 /* Products */ = { + isa = PBXGroup; + children = ( + B7394862229F194000C47603 /* Landmarks.app */, + ); + name = Products; + sourceTree = ""; + }; + B7394864229F194000C47603 /* Landmarks */ = { + isa = PBXGroup; + children = ( + B739487E229F282200C47603 /* Models */, + B7394865229F194000C47603 /* AppDelegate.swift */, + B7394867229F194000C47603 /* SceneDelegate.swift */, + B73948A0229F2E1F00C47603 /* LandmarkList.swift */, + B739489E229F2D9700C47603 /* LandmarkRow.swift */, + B7394869229F194000C47603 /* LandmarkDetail.swift */, + B7D587B5229F825D006E8DCF /* HikeView.swift */, + B7D587BB229F82EB006E8DCF /* HikeDetail.swift */, + B7310DD0229F6839001079B9 /* HexagonParameters.swift */, + B739487D229F1C0100C47603 /* Supporting Views */, + B7394883229F291A00C47603 /* Resources */, + B739486B229F194200C47603 /* Assets.xcassets */, + B7394870229F194200C47603 /* LaunchScreen.storyboard */, + B7394873229F194200C47603 /* Info.plist */, + B739486D229F194200C47603 /* Preview Content */, + ); + path = Landmarks; + sourceTree = ""; + }; + B739486D229F194200C47603 /* Preview Content */ = { + isa = PBXGroup; + children = ( + B739486E229F194200C47603 /* Preview Assets.xcassets */, + ); + path = "Preview Content"; + sourceTree = ""; + }; + B739487D229F1C0100C47603 /* Supporting Views */ = { + isa = PBXGroup; + children = ( + B7394879229F1B3F00C47603 /* CircleImage.swift */, + B739487B229F1B6800C47603 /* MapView.swift */, + B7310DD2229F6CA9001079B9 /* Badge.swift */, + B7D587AF229F73C1006E8DCF /* BadgeSymbol.swift */, + B7D587B1229F7406006E8DCF /* RotatedBadgeSymbol.swift */, + B7D587AD229F7382006E8DCF /* BadgeBackground.swift */, + B7D587BD229F82FF006E8DCF /* HikeGraph.swift */, + B7D587B7229F826D006E8DCF /* GraphCapsule.swift */, + ); + path = "Supporting Views"; + sourceTree = ""; + }; + B739487E229F282200C47603 /* Models */ = { + isa = PBXGroup; + children = ( + B7394880229F28B900C47603 /* Data.swift */, + B739487F229F28B900C47603 /* Landmark.swift */, + B7D587B9229F8288006E8DCF /* Hike.swift */, + B7D2AAC4229F4D7C0061E5F5 /* UserData.swift */, + ); + path = Models; + sourceTree = ""; + }; + B7394883229F291A00C47603 /* Resources */ = { + isa = PBXGroup; + children = ( + B739488E229F292E00C47603 /* landmarkData.json */, + B7D587BF229F830B006E8DCF /* hikeData.json */, + B7394890229F292F00C47603 /* chilkoottrail.jpg */, + B739488F229F292F00C47603 /* chincoteague.jpg */, + B739488A229F292E00C47603 /* hiddenlake.jpg */, + B7394886229F292E00C47603 /* icybay.jpg */, + B7394887229F292E00C47603 /* lakemcdonald.jpg */, + B7394884229F292D00C47603 /* rainbowlake.jpg */, + B739488D229F292E00C47603 /* silversalmoncreek.jpg */, + B739488B229F292E00C47603 /* stmarylake.jpg */, + B7394888229F292E00C47603 /* turtlerock.jpg */, + B739488C229F292E00C47603 /* twinlake.jpg */, + B7394889229F292E00C47603 /* umbagog.jpg */, + B73948A2229F3E2200C47603 /* charleyrivers.jpg */, + ); + path = Resources; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + B7394861229F194000C47603 /* Landmarks */ = { + isa = PBXNativeTarget; + buildConfigurationList = B7394876229F194200C47603 /* Build configuration list for PBXNativeTarget "Landmarks" */; + buildPhases = ( + B739485E229F194000C47603 /* Sources */, + B739485F229F194000C47603 /* Frameworks */, + B7394860229F194000C47603 /* Resources */, + C602AC70C605937000000001, + ); + buildRules = ( + ); + dependencies = ( + ); + name = Landmarks; + productName = Landmarks; + productReference = B7394862229F194000C47603 /* Landmarks.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + B739485A229F194000C47603 /* Project object */ = { + isa = PBXProject; + attributes = { + LastSwiftUpdateCheck = 1100; + LastUpgradeCheck = 1100; + ORGANIZATIONNAME = Apple; + TargetAttributes = { + B7394861229F194000C47603 = { + CreatedOnToolsVersion = 11.0; + }; + }; + }; + buildConfigurationList = B739485D229F194000C47603 /* Build configuration list for PBXProject "AnimatingViewsAndTransitions" */; + compatibilityVersion = "Xcode 9.3"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = B7394859229F194000C47603; + productRefGroup = B7394863229F194000C47603 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + B7394861229F194000C47603 /* Landmarks */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + B7394860229F194000C47603 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + B739489A229F292F00C47603 /* silversalmoncreek.jpg in Resources */, + B7394894229F292F00C47603 /* lakemcdonald.jpg in Resources */, + B7D587C0229F830B006E8DCF /* hikeData.json in Resources */, + B7394872229F194200C47603 /* LaunchScreen.storyboard in Resources */, + B73948A3229F3E2200C47603 /* charleyrivers.jpg in Resources */, + B7394891229F292F00C47603 /* rainbowlake.jpg in Resources */, + B739486F229F194200C47603 /* Preview Assets.xcassets in Resources */, + B7394895229F292F00C47603 /* turtlerock.jpg in Resources */, + B739486C229F194200C47603 /* Assets.xcassets in Resources */, + B7394899229F292F00C47603 /* twinlake.jpg in Resources */, + B7394896229F292F00C47603 /* umbagog.jpg in Resources */, + B739489D229F292F00C47603 /* chilkoottrail.jpg in Resources */, + B739489C229F292F00C47603 /* chincoteague.jpg in Resources */, + B739489B229F292F00C47603 /* landmarkData.json in Resources */, + B7394893229F292F00C47603 /* icybay.jpg in Resources */, + B7394897229F292F00C47603 /* hiddenlake.jpg in Resources */, + B7394898229F292F00C47603 /* stmarylake.jpg in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + B739485E229F194000C47603 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + B7394882229F28B900C47603 /* Data.swift in Sources */, + B7310DD3229F6CA9001079B9 /* Badge.swift in Sources */, + B7394866229F194000C47603 /* AppDelegate.swift in Sources */, + B7D587B8229F826D006E8DCF /* GraphCapsule.swift in Sources */, + B739487A229F1B3F00C47603 /* CircleImage.swift in Sources */, + B739487C229F1B6800C47603 /* MapView.swift in Sources */, + B7D587BA229F8288006E8DCF /* Hike.swift in Sources */, + B7D587BC229F82EB006E8DCF /* HikeDetail.swift in Sources */, + B7D587B6229F825D006E8DCF /* HikeView.swift in Sources */, + B7310DD1229F6839001079B9 /* HexagonParameters.swift in Sources */, + B73948A1229F2E1F00C47603 /* LandmarkList.swift in Sources */, + B7D587B0229F73C1006E8DCF /* BadgeSymbol.swift in Sources */, + B7D587B2229F7406006E8DCF /* RotatedBadgeSymbol.swift in Sources */, + B7D587BE229F82FF006E8DCF /* HikeGraph.swift in Sources */, + B7394868229F194000C47603 /* SceneDelegate.swift in Sources */, + B7D587AE229F7382006E8DCF /* BadgeBackground.swift in Sources */, + B739486A229F194000C47603 /* LandmarkDetail.swift in Sources */, + B739489F229F2D9700C47603 /* LandmarkRow.swift in Sources */, + B7D2AAC5229F4D7C0061E5F5 /* UserData.swift in Sources */, + B7394881229F28B900C47603 /* Landmark.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXVariantGroup section */ + B7394870229F194200C47603 /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + B7394871229F194200C47603 /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + B7394874229F194200C47603 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 704D6530704D8B0000000001 /* SampleCode.xcconfig */; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 13.0; + MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; + MTL_FAST_MATH = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + }; + name = Debug; + }; + B7394875229F194200C47603 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 704D6530704D8B0000000001 /* SampleCode.xcconfig */; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 13.0; + MTL_ENABLE_DEBUG_INFO = NO; + MTL_FAST_MATH = YES; + SDKROOT = iphoneos; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + B7394877229F194200C47603 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 704D6530704D8B0000000001 /* SampleCode.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_ASSET_PATHS = "Landmarks/Preview\\ Content"; + DEVELOPMENT_TEAM = ""; + ENABLE_PREVIEWS = YES; + INFOPLIST_FILE = Landmarks/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = "com.example.apple-samplecode.Landmarks${SAMPLE_CODE_DISAMBIGUATOR}"; + PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE_SPECIFIER = ""; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + B7394878229F194200C47603 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 704D6530704D8B0000000001 /* SampleCode.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_ASSET_PATHS = "Landmarks/Preview\\ Content"; + DEVELOPMENT_TEAM = ""; + ENABLE_PREVIEWS = YES; + INFOPLIST_FILE = Landmarks/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = "com.example.apple-samplecode.Landmarks${SAMPLE_CODE_DISAMBIGUATOR}"; + PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE_SPECIFIER = ""; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + B739485D229F194000C47603 /* Build configuration list for PBXProject "AnimatingViewsAndTransitions" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + B7394874229F194200C47603 /* Debug */, + B7394875229F194200C47603 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + B7394876229F194200C47603 /* Build configuration list for PBXNativeTarget "Landmarks" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + B7394877229F194200C47603 /* Debug */, + B7394878229F194200C47603 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = B739485A229F194000C47603 /* Project object */; +} diff --git a/Examples/AnimatingViewsAndTransitions/Complete/Landmarks/AnimatingViewsAndTransitions.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/Examples/AnimatingViewsAndTransitions/Complete/Landmarks/AnimatingViewsAndTransitions.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings new file mode 100755 index 0000000..3ddf867 --- /dev/null +++ b/Examples/AnimatingViewsAndTransitions/Complete/Landmarks/AnimatingViewsAndTransitions.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings @@ -0,0 +1,8 @@ + + + + + BuildSystemType + Latest + + diff --git a/Examples/AnimatingViewsAndTransitions/Complete/Landmarks/Landmarks/AppDelegate.swift b/Examples/AnimatingViewsAndTransitions/Complete/Landmarks/Landmarks/AppDelegate.swift new file mode 100755 index 0000000..e22943b --- /dev/null +++ b/Examples/AnimatingViewsAndTransitions/Complete/Landmarks/Landmarks/AppDelegate.swift @@ -0,0 +1,36 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +The application delegate. +*/ + +import UIKit + +@UIApplicationMain +class AppDelegate: UIResponder, UIApplicationDelegate { + + func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { + // Override point for customization after application launch. + return true + } + + func applicationWillTerminate(_ application: UIApplication) { + // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. + } + + // MARK: UISceneSession Lifecycle + func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration { + // Called when a new scene session is being created. + // Use this method to select a configuration to create the new scene with. + return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role) + } + + func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set) { + // Called when the user discards a scene session. + // If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions. + // Use this method to release any resources that were specific to the discarded scenes, as they will not return. + } + +} + diff --git a/Examples/AnimatingViewsAndTransitions/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/Contents.json b/Examples/AnimatingViewsAndTransitions/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100755 index 0000000..fa0d2db --- /dev/null +++ b/Examples/AnimatingViewsAndTransitions/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,113 @@ +{ + "images" : [ + { + "size" : "20x20", + "idiom" : "iphone", + "filename" : "landmark_app_icon_40x40.png", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "20x20", + "scale" : "3x" + }, + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "landmark_app_icon_58x58.png", + "scale" : "2x" + }, + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "landmark_app_icon_87x87.png", + "scale" : "3x" + }, + { + "size" : "40x40", + "idiom" : "iphone", + "filename" : "landmark_app_icon_80x80.png", + "scale" : "2x" + }, + { + "size" : "40x40", + "idiom" : "iphone", + "filename" : "landmark_app_icon_120x120.png", + "scale" : "3x" + }, + { + "size" : "60x60", + "idiom" : "iphone", + "filename" : "landmark_app_icon_120x120-1.png", + "scale" : "2x" + }, + { + "size" : "60x60", + "idiom" : "iphone", + "filename" : "landmark_app_icon_180x180.png", + "scale" : "3x" + }, + { + "idiom" : "ipad", + "size" : "20x20", + "scale" : "1x" + }, + { + "size" : "20x20", + "idiom" : "ipad", + "filename" : "landmark_app_icon_40x40-1.png", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "29x29", + "scale" : "1x" + }, + { + "size" : "29x29", + "idiom" : "ipad", + "filename" : "landmark_app_icon_58x58-1.png", + "scale" : "2x" + }, + { + "size" : "40x40", + "idiom" : "ipad", + "filename" : "landmark_app_icon_40x40-2.png", + "scale" : "1x" + }, + { + "size" : "40x40", + "idiom" : "ipad", + "filename" : "landmark_app_icon_80x80-1.png", + "scale" : "2x" + }, + { + "size" : "76x76", + "idiom" : "ipad", + "filename" : "landmark_app_icon_76x76.png", + "scale" : "1x" + }, + { + "size" : "76x76", + "idiom" : "ipad", + "filename" : "landmark_app_icon_152x152.png", + "scale" : "2x" + }, + { + "size" : "83.5x83.5", + "idiom" : "ipad", + "filename" : "landmark_app_icon_167x167.png", + "scale" : "2x" + }, + { + "size" : "1024x1024", + "idiom" : "ios-marketing", + "filename" : "landmark_app_icon_1024x1024.png", + "scale" : "1x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Examples/AnimatingViewsAndTransitions/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_1024x1024.png b/Examples/AnimatingViewsAndTransitions/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_1024x1024.png new file mode 100755 index 0000000..00d81c1 Binary files /dev/null and b/Examples/AnimatingViewsAndTransitions/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_1024x1024.png differ diff --git a/Examples/AnimatingViewsAndTransitions/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_120x120-1.png b/Examples/AnimatingViewsAndTransitions/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_120x120-1.png new file mode 100755 index 0000000..d382b8b Binary files /dev/null and b/Examples/AnimatingViewsAndTransitions/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_120x120-1.png differ diff --git a/Examples/AnimatingViewsAndTransitions/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_120x120.png b/Examples/AnimatingViewsAndTransitions/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_120x120.png new file mode 100755 index 0000000..d382b8b Binary files /dev/null and b/Examples/AnimatingViewsAndTransitions/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_120x120.png differ diff --git a/Examples/AnimatingViewsAndTransitions/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_152x152.png b/Examples/AnimatingViewsAndTransitions/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_152x152.png new file mode 100755 index 0000000..11057f8 Binary files /dev/null and b/Examples/AnimatingViewsAndTransitions/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_152x152.png differ diff --git a/Examples/AnimatingViewsAndTransitions/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_167x167.png b/Examples/AnimatingViewsAndTransitions/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_167x167.png new file mode 100755 index 0000000..f73bc26 Binary files /dev/null and b/Examples/AnimatingViewsAndTransitions/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_167x167.png differ diff --git a/Examples/AnimatingViewsAndTransitions/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_180x180.png b/Examples/AnimatingViewsAndTransitions/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_180x180.png new file mode 100755 index 0000000..b02738c Binary files /dev/null and b/Examples/AnimatingViewsAndTransitions/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_180x180.png differ diff --git a/Examples/AnimatingViewsAndTransitions/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_40x40-1.png b/Examples/AnimatingViewsAndTransitions/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_40x40-1.png new file mode 100755 index 0000000..abaff0e Binary files /dev/null and b/Examples/AnimatingViewsAndTransitions/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_40x40-1.png differ diff --git a/Examples/AnimatingViewsAndTransitions/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_40x40-2.png b/Examples/AnimatingViewsAndTransitions/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_40x40-2.png new file mode 100755 index 0000000..abaff0e Binary files /dev/null and b/Examples/AnimatingViewsAndTransitions/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_40x40-2.png differ diff --git a/Examples/AnimatingViewsAndTransitions/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_40x40.png b/Examples/AnimatingViewsAndTransitions/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_40x40.png new file mode 100755 index 0000000..abaff0e Binary files /dev/null and b/Examples/AnimatingViewsAndTransitions/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_40x40.png differ diff --git a/Examples/AnimatingViewsAndTransitions/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_58x58-1.png b/Examples/AnimatingViewsAndTransitions/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_58x58-1.png new file mode 100755 index 0000000..cf7c73d Binary files /dev/null and b/Examples/AnimatingViewsAndTransitions/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_58x58-1.png differ diff --git a/Examples/AnimatingViewsAndTransitions/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_58x58.png b/Examples/AnimatingViewsAndTransitions/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_58x58.png new file mode 100755 index 0000000..cf7c73d Binary files /dev/null and b/Examples/AnimatingViewsAndTransitions/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_58x58.png differ diff --git a/Examples/AnimatingViewsAndTransitions/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_76x76.png b/Examples/AnimatingViewsAndTransitions/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_76x76.png new file mode 100755 index 0000000..3eff85b Binary files /dev/null and b/Examples/AnimatingViewsAndTransitions/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_76x76.png differ diff --git a/Examples/AnimatingViewsAndTransitions/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_80x80-1.png b/Examples/AnimatingViewsAndTransitions/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_80x80-1.png new file mode 100755 index 0000000..6f33f66 Binary files /dev/null and b/Examples/AnimatingViewsAndTransitions/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_80x80-1.png differ diff --git a/Examples/AnimatingViewsAndTransitions/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_80x80.png b/Examples/AnimatingViewsAndTransitions/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_80x80.png new file mode 100755 index 0000000..6f33f66 Binary files /dev/null and b/Examples/AnimatingViewsAndTransitions/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_80x80.png differ diff --git a/Examples/AnimatingViewsAndTransitions/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_87x87.png b/Examples/AnimatingViewsAndTransitions/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_87x87.png new file mode 100755 index 0000000..9e1616c Binary files /dev/null and b/Examples/AnimatingViewsAndTransitions/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_87x87.png differ diff --git a/Examples/AnimatingViewsAndTransitions/Complete/Landmarks/Landmarks/Assets.xcassets/Contents.json b/Examples/AnimatingViewsAndTransitions/Complete/Landmarks/Landmarks/Assets.xcassets/Contents.json new file mode 100755 index 0000000..da4a164 --- /dev/null +++ b/Examples/AnimatingViewsAndTransitions/Complete/Landmarks/Landmarks/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Examples/AnimatingViewsAndTransitions/Complete/Landmarks/Landmarks/Assets.xcassets/turtlerock.imageset/Contents.json b/Examples/AnimatingViewsAndTransitions/Complete/Landmarks/Landmarks/Assets.xcassets/turtlerock.imageset/Contents.json new file mode 100755 index 0000000..5bfd7bf --- /dev/null +++ b/Examples/AnimatingViewsAndTransitions/Complete/Landmarks/Landmarks/Assets.xcassets/turtlerock.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "turtlerock.jpg", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Examples/AnimatingViewsAndTransitions/Complete/Landmarks/Landmarks/Assets.xcassets/turtlerock.imageset/turtlerock.jpg b/Examples/AnimatingViewsAndTransitions/Complete/Landmarks/Landmarks/Assets.xcassets/turtlerock.imageset/turtlerock.jpg new file mode 100755 index 0000000..68bcd3e Binary files /dev/null and b/Examples/AnimatingViewsAndTransitions/Complete/Landmarks/Landmarks/Assets.xcassets/turtlerock.imageset/turtlerock.jpg differ diff --git a/Examples/AnimatingViewsAndTransitions/Complete/Landmarks/Landmarks/Base.lproj/LaunchScreen.storyboard b/Examples/AnimatingViewsAndTransitions/Complete/Landmarks/Landmarks/Base.lproj/LaunchScreen.storyboard new file mode 100755 index 0000000..865e932 --- /dev/null +++ b/Examples/AnimatingViewsAndTransitions/Complete/Landmarks/Landmarks/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Examples/AnimatingViewsAndTransitions/Complete/Landmarks/Landmarks/HexagonParameters.swift b/Examples/AnimatingViewsAndTransitions/Complete/Landmarks/Landmarks/HexagonParameters.swift new file mode 100755 index 0000000..8decba4 --- /dev/null +++ b/Examples/AnimatingViewsAndTransitions/Complete/Landmarks/Landmarks/HexagonParameters.swift @@ -0,0 +1,57 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +Size, position, and other information used to draw a badge. +*/ + +import SwiftUI + +struct HexagonParameters { + struct Segment { + let useWidth: (CGFloat, CGFloat, CGFloat) + let xFactors: (CGFloat, CGFloat, CGFloat) + let useHeight: (CGFloat, CGFloat, CGFloat) + let yFactors: (CGFloat, CGFloat, CGFloat) + } + + static let adjustment: CGFloat = 0.085 + static let points = [ + Segment( + useWidth: (1.00, 1.00, 1.00), + xFactors: (0.60, 0.40, 0.50), + useHeight: (1.00, 1.00, 0.00), + yFactors: (0.05, 0.05, 0.00) + ), + Segment( + useWidth: (1.00, 1.00, 0.00), + xFactors: (0.05, 0.00, 0.00), + useHeight: (1.00, 1.00, 1.00), + yFactors: (0.20 + adjustment, 0.30 + adjustment, 0.25 + adjustment) + ), + Segment( + useWidth: (1.00, 1.00, 0.00), + xFactors: (0.00, 0.05, 0.00), + useHeight: (1.00, 1.00, 1.00), + yFactors: (0.70 - adjustment, 0.80 - adjustment, 0.75 - adjustment) + ), + Segment( + useWidth: (1.00, 1.00, 1.00), + xFactors: (0.40, 0.60, 0.50), + useHeight: (1.00, 1.00, 1.00), + yFactors: (0.95, 0.95, 1.00) + ), + Segment( + useWidth: (1.00, 1.00, 1.00), + xFactors: (0.95, 1.00, 1.00), + useHeight: (1.00, 1.00, 1.00), + yFactors: (0.80 - adjustment, 0.70 - adjustment, 0.75 - adjustment) + ), + Segment( + useWidth: (1.00, 1.00, 1.00), + xFactors: (1.00, 0.95, 1.00), + useHeight: (1.00, 1.00, 1.00), + yFactors: (0.30 + adjustment, 0.20 + adjustment, 0.25 + adjustment) + ) + ] +} diff --git a/Examples/AnimatingViewsAndTransitions/Complete/Landmarks/Landmarks/HikeDetail.swift b/Examples/AnimatingViewsAndTransitions/Complete/Landmarks/Landmarks/HikeDetail.swift new file mode 100755 index 0000000..3406a6d --- /dev/null +++ b/Examples/AnimatingViewsAndTransitions/Complete/Landmarks/Landmarks/HikeDetail.swift @@ -0,0 +1,49 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +A view showing the details for a hike. +*/ + +import SwiftUI + +struct HikeDetail: View { + let hike: Hike + @State var dataToShow = \Hike.Observation.elevation + + var buttons = [ + ("Elevation", \Hike.Observation.elevation), + ("Heart Rate", \Hike.Observation.heartRate), + ("Pace", \Hike.Observation.pace), + ] + + var body: some View { + return VStack { + HikeGraph(hike: hike, path: dataToShow) + .frame(height: 200, alignment: .center) + + HStack(spacing: 25) { + ForEach(buttons.identified(by: \.0)) { value in + Button(action: { + self.dataToShow = value.1 + }) { + Text(verbatim: value.0) + .font(.system(size: 15)) + .color(value.1 == self.dataToShow + ? Color.gray + : Color.accentColor) + .animation(nil) + } + } + } + } + } +} + +#if DEBUG +struct HikeDetail_Previews: PreviewProvider { + static var previews: some View { + HikeDetail(hike: hikeData[0]) + } +} +#endif diff --git a/Examples/AnimatingViewsAndTransitions/Complete/Landmarks/Landmarks/HikeView.swift b/Examples/AnimatingViewsAndTransitions/Complete/Landmarks/Landmarks/HikeView.swift new file mode 100755 index 0000000..f4c02cc --- /dev/null +++ b/Examples/AnimatingViewsAndTransitions/Complete/Landmarks/Landmarks/HikeView.swift @@ -0,0 +1,68 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +A view displaying inforamtion about a hike, including an elevation graph. +*/ + +import SwiftUI + +struct HikeView: View { + var hike: Hike + @State private var showDetail = false + + var transition: AnyTransition { + let insertion = AnyTransition.move(edge: .trailing) + .combined(with: .opacity) + let removal = AnyTransition.scale() + .combined(with: .opacity) + return .asymmetric(insertion: insertion, removal: removal) + } + + var body: some View { + VStack { + HStack { + HikeGraph(hike: hike, path: \.elevation) + .frame(width: 50, height: 30) + .animation(nil) + + VStack(alignment: .leading) { + Text(verbatim: hike.name) + .font(.headline) + Text(verbatim: hike.distanceText) + } + + Spacer() + + Button(action: { + withAnimation { + self.showDetail.toggle() + } + }) { + Image(systemName: "chevron.right.circle") + .imageScale(.large) + .rotationEffect(.degrees(showDetail ? 90 : 0)) + .scaleEffect(showDetail ? 1.5 : 1) + .padding() + } + } + + if showDetail { + HikeDetail(hike: hike) + .transition(transition) + } + } + } +} + +#if DEBUG +struct HikeView_Previews: PreviewProvider { + static var previews: some View { + VStack { + HikeView(hike: hikeData[0]) + .padding() + Spacer() + } + } +} +#endif diff --git a/Examples/AnimatingViewsAndTransitions/Complete/Landmarks/Landmarks/Info.plist b/Examples/AnimatingViewsAndTransitions/Complete/Landmarks/Landmarks/Info.plist new file mode 100755 index 0000000..e8bb4c6 --- /dev/null +++ b/Examples/AnimatingViewsAndTransitions/Complete/Landmarks/Landmarks/Info.plist @@ -0,0 +1,62 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + $(PRODUCT_BUNDLE_PACKAGE_TYPE) + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1 + LSRequiresIPhoneOS + + UIApplicationSceneManifest + + UIApplicationSupportsMultipleScenes + + UISceneConfigurations + + UIWindowSceneSessionRoleApplication + + + UILaunchStoryboardName + LaunchScreen + UISceneConfigurationName + Default Configuration + UISceneDelegateClassName + $(PRODUCT_MODULE_NAME).SceneDelegate + + + + + UILaunchStoryboardName + LaunchScreen + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/Examples/AnimatingViewsAndTransitions/Complete/Landmarks/Landmarks/LandmarkDetail.swift b/Examples/AnimatingViewsAndTransitions/Complete/Landmarks/Landmarks/LandmarkDetail.swift new file mode 100755 index 0000000..6c290a3 --- /dev/null +++ b/Examples/AnimatingViewsAndTransitions/Complete/Landmarks/Landmarks/LandmarkDetail.swift @@ -0,0 +1,71 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +A view showing the details for a landmark. +*/ + +import SwiftUI + +struct LandmarkDetail: View { + @EnvironmentObject var userData: UserData + var landmark: Landmark + + var landmarkIndex: Int { + userData.landmarks.firstIndex(where: { $0.id == landmark.id })! + } + + var body: some View { + VStack { + MapView(coordinate: landmark.locationCoordinate) + .edgesIgnoringSafeArea(.top) + .frame(height: 300) + + CircleImage(image: landmark.image(forSize: 250)) + .offset(x: 0, y: -130) + .padding(.bottom, -130) + + VStack(alignment: .leading) { + HStack { + Text(verbatim: landmark.name) + .font(.title) + + Button(action: { + self.userData.landmarks[self.landmarkIndex] + .isFavorite.toggle() + }) { + if self.userData.landmarks[self.landmarkIndex] + .isFavorite { + Image(systemName: "star.fill") + .foregroundColor(Color.yellow) + } else { + Image(systemName: "star") + .foregroundColor(Color.gray) + } + } + } + + HStack(alignment: .top) { + Text(verbatim: landmark.park) + .font(.subheadline) + Spacer() + Text(verbatim: landmark.state) + .font(.subheadline) + } + } + .padding() + + Spacer() + } + } +} + +#if DEBUG +struct LandmarkDetail_Preview: PreviewProvider { + static var previews: some View { + let userData = UserData() + return LandmarkDetail(landmark: userData.landmarks[0]) + .environmentObject(userData) + } +} +#endif diff --git a/Examples/AnimatingViewsAndTransitions/Complete/Landmarks/Landmarks/LandmarkList.swift b/Examples/AnimatingViewsAndTransitions/Complete/Landmarks/Landmarks/LandmarkList.swift new file mode 100755 index 0000000..c17b5f3 --- /dev/null +++ b/Examples/AnimatingViewsAndTransitions/Complete/Landmarks/Landmarks/LandmarkList.swift @@ -0,0 +1,45 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +A view showing a list of landmarks. +*/ + +import SwiftUI + +struct LandmarkList: View { + @EnvironmentObject private var userData: UserData + + var body: some View { + NavigationView { + List { + Toggle(isOn: $userData.showFavoritesOnly) { + Text("Show Favorites Only") + } + + ForEach(userData.landmarks) { landmark in + if !self.userData.showFavoritesOnly || landmark.isFavorite { + NavigationButton( + destination: LandmarkDetail(landmark: landmark)) { + LandmarkRow(landmark: landmark) + } + } + } + } + .navigationBarTitle(Text("Landmarks"), displayMode: .large) + } + } +} + +#if DEBUG +struct LandmarksList_Previews: PreviewProvider { + static var previews: some View { + ForEach(["iPhone SE", "iPhone XS Max"].identified(by: \.self)) { deviceName in + LandmarkList() + .previewDevice(PreviewDevice(rawValue: deviceName)) + .previewDisplayName(deviceName) + } + .environmentObject(UserData()) + } +} +#endif diff --git a/Examples/AnimatingViewsAndTransitions/Complete/Landmarks/Landmarks/Models/Data.swift b/Examples/AnimatingViewsAndTransitions/Complete/Landmarks/Landmarks/Models/Data.swift new file mode 100755 index 0000000..248d3b2 --- /dev/null +++ b/Examples/AnimatingViewsAndTransitions/Complete/Landmarks/Landmarks/Models/Data.swift @@ -0,0 +1,95 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +Helpers for loading images and data. +*/ + +import Foundation +import CoreLocation +import UIKit +import SwiftUI + +let landmarkData: [Landmark] = load("landmarkData.json") +let hikeData: [Hike] = load("hikeData.json") + +func load(_ filename: String, as type: T.Type = T.self) -> T { + let data: Data + + guard let file = Bundle.main.url(forResource: filename, withExtension: nil) + else { + fatalError("Couldn't find \(filename) in main bundle.") + } + + do { + data = try Data(contentsOf: file) + } catch { + fatalError("Couldn't load \(filename) from main bundle:\n\(error)") + } + + do { + let decoder = JSONDecoder() + return try decoder.decode(T.self, from: data) + } catch { + fatalError("Couldn't parse \(filename) as \(T.self):\n\(error)") + } +} + +final class ImageStore { + fileprivate typealias _ImageDictionary = [String: [Int: CGImage]] + fileprivate var images: _ImageDictionary = [:] + + fileprivate static var originalSize = 250 + fileprivate static var scale = 2 + + static var shared = ImageStore() + + func image(name: String, size: Int) -> Image { + let index = _guaranteeInitialImage(name: name) + + let sizedImage = images.values[index][size] + ?? _sizeImage(images.values[index][ImageStore.originalSize]!, to: size * ImageStore.scale) + images.values[index][size] = sizedImage + + return Image(sizedImage, scale: Length(ImageStore.scale), label: Text(verbatim: name)) + } + + fileprivate func _guaranteeInitialImage(name: String) -> _ImageDictionary.Index { + if let index = images.index(forKey: name) { return index } + + guard + let url = Bundle.main.url(forResource: name, withExtension: "jpg"), + let imageSource = CGImageSourceCreateWithURL(url as NSURL, nil), + let image = CGImageSourceCreateImageAtIndex(imageSource, 0, nil) + else { + fatalError("Couldn't load image \(name).jpg from main bundle.") + } + + images[name] = [ImageStore.originalSize: image] + return images.index(forKey: name)! + } + + fileprivate func _sizeImage(_ image: CGImage, to size: Int) -> CGImage { + guard + let colorSpace = image.colorSpace, + let context = CGContext( + data: nil, + width: size, height: size, + bitsPerComponent: image.bitsPerComponent, + bytesPerRow: image.bytesPerRow, + space: colorSpace, + bitmapInfo: image.bitmapInfo.rawValue) + else { + fatalError("Couldn't create graphics context.") + } + context.interpolationQuality = .high + context.draw(image, in: CGRect(x: 0, y: 0, width: size, height: size)) + + if let sizedImage = context.makeImage() { + return sizedImage + } else { + fatalError("Couldn't resize image.") + } + } +} + diff --git a/Examples/AnimatingViewsAndTransitions/Complete/Landmarks/Landmarks/Models/Hike.swift b/Examples/AnimatingViewsAndTransitions/Complete/Landmarks/Landmarks/Models/Hike.swift new file mode 100755 index 0000000..dfd2bb8 --- /dev/null +++ b/Examples/AnimatingViewsAndTransitions/Complete/Landmarks/Landmarks/Models/Hike.swift @@ -0,0 +1,31 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +The model for a hike. +*/ + +import SwiftUI + +struct Hike: Codable, Hashable, Identifiable { + var name: String + var id: Int + var distance: Double + var difficulty: Int + var observations: [Observation] + + static var formatter = LengthFormatter() + + var distanceText: String { + return Hike.formatter + .string(fromValue: distance, unit: .kilometer) + } + + struct Observation: Codable, Hashable { + var distanceFromStart: Double + + var elevation: Range + var pace: Range + var heartRate: Range + } +} diff --git a/Examples/AnimatingViewsAndTransitions/Complete/Landmarks/Landmarks/Models/Landmark.swift b/Examples/AnimatingViewsAndTransitions/Complete/Landmarks/Landmarks/Models/Landmark.swift new file mode 100755 index 0000000..79b9aa4 --- /dev/null +++ b/Examples/AnimatingViewsAndTransitions/Complete/Landmarks/Landmarks/Models/Landmark.swift @@ -0,0 +1,42 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +The model for an individual landmark. +*/ + +import SwiftUI +import CoreLocation + +struct Landmark: Hashable, Codable, Identifiable { + var id: Int + var name: String + fileprivate var imageName: String + fileprivate var coordinates: Coordinates + var state: String + var park: String + var category: Category + var isFavorite: Bool + + var locationCoordinate: CLLocationCoordinate2D { + CLLocationCoordinate2D( + latitude: coordinates.latitude, + longitude: coordinates.longitude) + } + + func image(forSize size: Int) -> Image { + ImageStore.shared.image(name: imageName, size: size) + } + + enum Category: String, CaseIterable, Codable, Hashable { + case featured = "Featured" + case lakes = "Lakes" + case rivers = "Rivers" + case mountains = "Mountains" + } +} + +struct Coordinates: Hashable, Codable { + var latitude: Double + var longitude: Double +} diff --git a/Examples/AnimatingViewsAndTransitions/Complete/Landmarks/Landmarks/Models/UserData.swift b/Examples/AnimatingViewsAndTransitions/Complete/Landmarks/Landmarks/Models/UserData.swift new file mode 100755 index 0000000..db31fb0 --- /dev/null +++ b/Examples/AnimatingViewsAndTransitions/Complete/Landmarks/Landmarks/Models/UserData.swift @@ -0,0 +1,25 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +A model object that stores app data. +*/ + +import Combine +import SwiftUI + +final class UserData: BindableObject { + let didChange = PassthroughSubject() + + var showFavoritesOnly = false { + didSet { + didChange.send(self) + } + } + + var landmarks = landmarkData { + didSet { + didChange.send(self) + } + } +} diff --git a/Examples/AnimatingViewsAndTransitions/Complete/Landmarks/Landmarks/Preview Content/Preview Assets.xcassets/Contents.json b/Examples/AnimatingViewsAndTransitions/Complete/Landmarks/Landmarks/Preview Content/Preview Assets.xcassets/Contents.json new file mode 100755 index 0000000..da4a164 --- /dev/null +++ b/Examples/AnimatingViewsAndTransitions/Complete/Landmarks/Landmarks/Preview Content/Preview Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Examples/AnimatingViewsAndTransitions/Complete/Landmarks/Landmarks/Resources/charleyrivers.jpg b/Examples/AnimatingViewsAndTransitions/Complete/Landmarks/Landmarks/Resources/charleyrivers.jpg new file mode 100755 index 0000000..17ff44b Binary files /dev/null and b/Examples/AnimatingViewsAndTransitions/Complete/Landmarks/Landmarks/Resources/charleyrivers.jpg differ diff --git a/Examples/AnimatingViewsAndTransitions/Complete/Landmarks/Landmarks/Resources/chilkoottrail.jpg b/Examples/AnimatingViewsAndTransitions/Complete/Landmarks/Landmarks/Resources/chilkoottrail.jpg new file mode 100755 index 0000000..e7f805e Binary files /dev/null and b/Examples/AnimatingViewsAndTransitions/Complete/Landmarks/Landmarks/Resources/chilkoottrail.jpg differ diff --git a/Examples/AnimatingViewsAndTransitions/Complete/Landmarks/Landmarks/Resources/chincoteague.jpg b/Examples/AnimatingViewsAndTransitions/Complete/Landmarks/Landmarks/Resources/chincoteague.jpg new file mode 100755 index 0000000..5f47986 Binary files /dev/null and b/Examples/AnimatingViewsAndTransitions/Complete/Landmarks/Landmarks/Resources/chincoteague.jpg differ diff --git a/Examples/AnimatingViewsAndTransitions/Complete/Landmarks/Landmarks/Resources/hiddenlake.jpg b/Examples/AnimatingViewsAndTransitions/Complete/Landmarks/Landmarks/Resources/hiddenlake.jpg new file mode 100755 index 0000000..d8e804c Binary files /dev/null and b/Examples/AnimatingViewsAndTransitions/Complete/Landmarks/Landmarks/Resources/hiddenlake.jpg differ diff --git a/Examples/AnimatingViewsAndTransitions/Complete/Landmarks/Landmarks/Resources/hikeData.json b/Examples/AnimatingViewsAndTransitions/Complete/Landmarks/Landmarks/Resources/hikeData.json new file mode 100755 index 0000000..3fb1e96 --- /dev/null +++ b/Examples/AnimatingViewsAndTransitions/Complete/Landmarks/Landmarks/Resources/hikeData.json @@ -0,0 +1,1882 @@ +[ + { + "name":"Lonesome Ridge Trail", + "id":1001, + "distance":4.5, + "difficulty":3, + "observations":[ + { + "elevation":[ + 291.65263635636268, + 309.26016677925196 + ], + "pace":[ + 396.08716481908732, + 403.68937873525232 + ], + "heartRate":[ + 117.16351898665887, + 121.95815455919609 + ], + "distanceFromStart":0 + }, + { + "elevation":[ + 299.24001936628116, + 317.44584350790012 + ], + "pace":[ + 380.19020240756623, + 395.3978319010256 + ], + "heartRate":[ + 117.6410892152911, + 124.82185220506081 + ], + "distanceFromStart":0.375 + }, + { + "elevation":[ + 303.62145464574394, + 336.05569457646544 + ], + "pace":[ + 380.55927782266116, + 397.60789726832775 + ], + "heartRate":[ + 121.52696452049059, + 127.31525441110122 + ], + "distanceFromStart":0.75 + }, + { + "elevation":[ + 319.90393365162629, + 346.26966025518789 + ], + "pace":[ + 357.94116421258531, + 398.0750288648062 + ], + "heartRate":[ + 123.75908585923588, + 132.77069404486801 + ], + "distanceFromStart":1.125 + }, + { + "elevation":[ + 354.17104439267905, + 403.57031216972939 + ], + "pace":[ + 335.07385149392701, + 397.82674381875808 + ], + "heartRate":[ + 130.8235194572915, + 140.55700591418218 + ], + "distanceFromStart":1.5 + }, + { + "elevation":[ + 357.42992871175124, + 385.92155620623635 + ], + "pace":[ + 395.16168913839374, + 404.60294066527558 + ], + "heartRate":[ + 131.5456052446734, + 134.65984504627627 + ], + "distanceFromStart":1.875 + }, + { + "elevation":[ + 345.47736721935661, + 363.18776661379422 + ], + "pace":[ + 340.82303041339082, + 404.71689228682374 + ], + "heartRate":[ + 125.1949698433959, + 131.31354363122026 + ], + "distanceFromStart":2.25 + }, + { + "elevation":[ + 346.23343025200535, + 497.23376445462401 + ], + "pace":[ + 261.27629148816021, + 331.68516208719467 + ], + "heartRate":[ + 131.67810544238606, + 154.26779645311458 + ], + "distanceFromStart":2.625 + }, + { + "elevation":[ + 491.57378483134391, + 547.49535224251053 + ], + "pace":[ + 296.05298644112088, + 401.14092967732398 + ], + "heartRate":[ + 151.36398089694217, + 166.20454793289232 + ], + "distanceFromStart":3 + }, + { + "elevation":[ + 472.06803233416338, + 531.92570520228401 + ], + "pace":[ + 395.50830663514012, + 401.67837917543591 + ], + "heartRate":[ + 134.41798110234078, + 151.90886697564241 + ], + "distanceFromStart":3.375 + }, + { + "elevation":[ + 339.81419476005283, + 461.03832527824829 + ], + "pace":[ + 395.31160487975183, + 404.49550455974907 + ], + "heartRate":[ + 129.97753472415462, + 138.13531094848992 + ], + "distanceFromStart":3.75 + }, + { + "elevation":[ + 303.1495508565697, + 342.3532820173541 + ], + "pace":[ + 395.02844559698116, + 402.65878340653796 + ], + "heartRate":[ + 127.72304232462609, + 133.26322270764186 + ], + "distanceFromStart":4.125 + } + ] + }, + { + "name":"Lonesome Ridge Trail", + "id":1002, + "distance":4.5, + "difficulty":3, + "observations":[ + { + "elevation":[ + 291.65263635636268, + 309.26016677925196 + ], + "pace":[ + 396.08716481908732, + 403.68937873525232 + ], + "heartRate":[ + 117.16351898665887, + 121.95815455919609 + ], + "distanceFromStart":0 + }, + { + "elevation":[ + 299.24001936628116, + 317.44584350790012 + ], + "pace":[ + 380.19020240756623, + 395.3978319010256 + ], + "heartRate":[ + 117.6410892152911, + 124.82185220506081 + ], + "distanceFromStart":0.375 + }, + { + "elevation":[ + 303.62145464574394, + 336.05569457646544 + ], + "pace":[ + 380.55927782266116, + 397.60789726832775 + ], + "heartRate":[ + 121.52696452049059, + 127.31525441110122 + ], + "distanceFromStart":0.75 + }, + { + "elevation":[ + 319.90393365162629, + 346.26966025518789 + ], + "pace":[ + 357.94116421258531, + 398.0750288648062 + ], + "heartRate":[ + 123.75908585923588, + 132.77069404486801 + ], + "distanceFromStart":1.125 + }, + { + "elevation":[ + 354.17104439267905, + 403.57031216972939 + ], + "pace":[ + 335.07385149392701, + 397.82674381875808 + ], + "heartRate":[ + 130.8235194572915, + 140.55700591418218 + ], + "distanceFromStart":1.5 + }, + { + "elevation":[ + 357.42992871175124, + 385.92155620623635 + ], + "pace":[ + 395.16168913839374, + 404.60294066527558 + ], + "heartRate":[ + 131.5456052446734, + 134.65984504627627 + ], + "distanceFromStart":1.875 + }, + { + "elevation":[ + 345.47736721935661, + 363.18776661379422 + ], + "pace":[ + 340.82303041339082, + 404.71689228682374 + ], + "heartRate":[ + 125.1949698433959, + 131.31354363122026 + ], + "distanceFromStart":2.25 + }, + { + "elevation":[ + 346.23343025200535, + 497.23376445462401 + ], + "pace":[ + 261.27629148816021, + 331.68516208719467 + ], + "heartRate":[ + 131.67810544238606, + 154.26779645311458 + ], + "distanceFromStart":2.625 + }, + { + "elevation":[ + 491.57378483134391, + 547.49535224251053 + ], + "pace":[ + 296.05298644112088, + 401.14092967732398 + ], + "heartRate":[ + 151.36398089694217, + 166.20454793289232 + ], + "distanceFromStart":3 + }, + { + "elevation":[ + 472.06803233416338, + 531.92570520228401 + ], + "pace":[ + 395.50830663514012, + 401.67837917543591 + ], + "heartRate":[ + 134.41798110234078, + 151.90886697564241 + ], + "distanceFromStart":3.375 + }, + { + "elevation":[ + 339.81419476005283, + 461.03832527824829 + ], + "pace":[ + 395.31160487975183, + 404.49550455974907 + ], + "heartRate":[ + 129.97753472415462, + 138.13531094848992 + ], + "distanceFromStart":3.75 + }, + { + "elevation":[ + 303.1495508565697, + 342.3532820173541 + ], + "pace":[ + 395.02844559698116, + 402.65878340653796 + ], + "heartRate":[ + 127.72304232462609, + 133.26322270764186 + ], + "distanceFromStart":4.125 + } + ] + }, + { + "name":"Lonesome Ridge Trail", + "id":1003, + "distance":4.5, + "difficulty":3, + "observations":[ + { + "elevation":[ + 291.65263635636268, + 309.26016677925196 + ], + "pace":[ + 396.08716481908732, + 403.68937873525232 + ], + "heartRate":[ + 117.16351898665887, + 121.95815455919609 + ], + "distanceFromStart":0 + }, + { + "elevation":[ + 299.24001936628116, + 317.44584350790012 + ], + "pace":[ + 380.19020240756623, + 395.3978319010256 + ], + "heartRate":[ + 117.6410892152911, + 124.82185220506081 + ], + "distanceFromStart":0.375 + }, + { + "elevation":[ + 303.62145464574394, + 336.05569457646544 + ], + "pace":[ + 380.55927782266116, + 397.60789726832775 + ], + "heartRate":[ + 121.52696452049059, + 127.31525441110122 + ], + "distanceFromStart":0.75 + }, + { + "elevation":[ + 319.90393365162629, + 346.26966025518789 + ], + "pace":[ + 357.94116421258531, + 398.0750288648062 + ], + "heartRate":[ + 123.75908585923588, + 132.77069404486801 + ], + "distanceFromStart":1.125 + }, + { + "elevation":[ + 354.17104439267905, + 403.57031216972939 + ], + "pace":[ + 335.07385149392701, + 397.82674381875808 + ], + "heartRate":[ + 130.8235194572915, + 140.55700591418218 + ], + "distanceFromStart":1.5 + }, + { + "elevation":[ + 357.42992871175124, + 385.92155620623635 + ], + "pace":[ + 395.16168913839374, + 404.60294066527558 + ], + "heartRate":[ + 131.5456052446734, + 134.65984504627627 + ], + "distanceFromStart":1.875 + }, + { + "elevation":[ + 345.47736721935661, + 363.18776661379422 + ], + "pace":[ + 340.82303041339082, + 404.71689228682374 + ], + "heartRate":[ + 125.1949698433959, + 131.31354363122026 + ], + "distanceFromStart":2.25 + }, + { + "elevation":[ + 346.23343025200535, + 497.23376445462401 + ], + "pace":[ + 261.27629148816021, + 331.68516208719467 + ], + "heartRate":[ + 131.67810544238606, + 154.26779645311458 + ], + "distanceFromStart":2.625 + }, + { + "elevation":[ + 491.57378483134391, + 547.49535224251053 + ], + "pace":[ + 296.05298644112088, + 401.14092967732398 + ], + "heartRate":[ + 151.36398089694217, + 166.20454793289232 + ], + "distanceFromStart":3 + }, + { + "elevation":[ + 472.06803233416338, + 531.92570520228401 + ], + "pace":[ + 395.50830663514012, + 401.67837917543591 + ], + "heartRate":[ + 134.41798110234078, + 151.90886697564241 + ], + "distanceFromStart":3.375 + }, + { + "elevation":[ + 339.81419476005283, + 461.03832527824829 + ], + "pace":[ + 395.31160487975183, + 404.49550455974907 + ], + "heartRate":[ + 129.97753472415462, + 138.13531094848992 + ], + "distanceFromStart":3.75 + }, + { + "elevation":[ + 303.1495508565697, + 342.3532820173541 + ], + "pace":[ + 395.02844559698116, + 402.65878340653796 + ], + "heartRate":[ + 127.72304232462609, + 133.26322270764186 + ], + "distanceFromStart":4.125 + } + ] + }, + { + "name":"Lonesome Ridge Trail", + "id":1004, + "distance":4.5, + "difficulty":3, + "observations":[ + { + "elevation":[ + 291.65263635636268, + 309.26016677925196 + ], + "pace":[ + 396.08716481908732, + 403.68937873525232 + ], + "heartRate":[ + 117.16351898665887, + 121.95815455919609 + ], + "distanceFromStart":0 + }, + { + "elevation":[ + 299.24001936628116, + 317.44584350790012 + ], + "pace":[ + 380.19020240756623, + 395.3978319010256 + ], + "heartRate":[ + 117.6410892152911, + 124.82185220506081 + ], + "distanceFromStart":0.375 + }, + { + "elevation":[ + 303.62145464574394, + 336.05569457646544 + ], + "pace":[ + 380.55927782266116, + 397.60789726832775 + ], + "heartRate":[ + 121.52696452049059, + 127.31525441110122 + ], + "distanceFromStart":0.75 + }, + { + "elevation":[ + 319.90393365162629, + 346.26966025518789 + ], + "pace":[ + 357.94116421258531, + 398.0750288648062 + ], + "heartRate":[ + 123.75908585923588, + 132.77069404486801 + ], + "distanceFromStart":1.125 + }, + { + "elevation":[ + 354.17104439267905, + 403.57031216972939 + ], + "pace":[ + 335.07385149392701, + 397.82674381875808 + ], + "heartRate":[ + 130.8235194572915, + 140.55700591418218 + ], + "distanceFromStart":1.5 + }, + { + "elevation":[ + 357.42992871175124, + 385.92155620623635 + ], + "pace":[ + 395.16168913839374, + 404.60294066527558 + ], + "heartRate":[ + 131.5456052446734, + 134.65984504627627 + ], + "distanceFromStart":1.875 + }, + { + "elevation":[ + 345.47736721935661, + 363.18776661379422 + ], + "pace":[ + 340.82303041339082, + 404.71689228682374 + ], + "heartRate":[ + 125.1949698433959, + 131.31354363122026 + ], + "distanceFromStart":2.25 + }, + { + "elevation":[ + 346.23343025200535, + 497.23376445462401 + ], + "pace":[ + 261.27629148816021, + 331.68516208719467 + ], + "heartRate":[ + 131.67810544238606, + 154.26779645311458 + ], + "distanceFromStart":2.625 + }, + { + "elevation":[ + 491.57378483134391, + 547.49535224251053 + ], + "pace":[ + 296.05298644112088, + 401.14092967732398 + ], + "heartRate":[ + 151.36398089694217, + 166.20454793289232 + ], + "distanceFromStart":3 + }, + { + "elevation":[ + 472.06803233416338, + 531.92570520228401 + ], + "pace":[ + 395.50830663514012, + 401.67837917543591 + ], + "heartRate":[ + 134.41798110234078, + 151.90886697564241 + ], + "distanceFromStart":3.375 + }, + { + "elevation":[ + 339.81419476005283, + 461.03832527824829 + ], + "pace":[ + 395.31160487975183, + 404.49550455974907 + ], + "heartRate":[ + 129.97753472415462, + 138.13531094848992 + ], + "distanceFromStart":3.75 + }, + { + "elevation":[ + 303.1495508565697, + 342.3532820173541 + ], + "pace":[ + 395.02844559698116, + 402.65878340653796 + ], + "heartRate":[ + 127.72304232462609, + 133.26322270764186 + ], + "distanceFromStart":4.125 + } + ] + }, + { + "name":"Lonesome Ridge Trail", + "id":1005, + "distance":4.5, + "difficulty":3, + "observations":[ + { + "elevation":[ + 291.65263635636268, + 309.26016677925196 + ], + "pace":[ + 396.08716481908732, + 403.68937873525232 + ], + "heartRate":[ + 117.16351898665887, + 121.95815455919609 + ], + "distanceFromStart":0 + }, + { + "elevation":[ + 299.24001936628116, + 317.44584350790012 + ], + "pace":[ + 380.19020240756623, + 395.3978319010256 + ], + "heartRate":[ + 117.6410892152911, + 124.82185220506081 + ], + "distanceFromStart":0.375 + }, + { + "elevation":[ + 303.62145464574394, + 336.05569457646544 + ], + "pace":[ + 380.55927782266116, + 397.60789726832775 + ], + "heartRate":[ + 121.52696452049059, + 127.31525441110122 + ], + "distanceFromStart":0.75 + }, + { + "elevation":[ + 319.90393365162629, + 346.26966025518789 + ], + "pace":[ + 357.94116421258531, + 398.0750288648062 + ], + "heartRate":[ + 123.75908585923588, + 132.77069404486801 + ], + "distanceFromStart":1.125 + }, + { + "elevation":[ + 354.17104439267905, + 403.57031216972939 + ], + "pace":[ + 335.07385149392701, + 397.82674381875808 + ], + "heartRate":[ + 130.8235194572915, + 140.55700591418218 + ], + "distanceFromStart":1.5 + }, + { + "elevation":[ + 357.42992871175124, + 385.92155620623635 + ], + "pace":[ + 395.16168913839374, + 404.60294066527558 + ], + "heartRate":[ + 131.5456052446734, + 134.65984504627627 + ], + "distanceFromStart":1.875 + }, + { + "elevation":[ + 345.47736721935661, + 363.18776661379422 + ], + "pace":[ + 340.82303041339082, + 404.71689228682374 + ], + "heartRate":[ + 125.1949698433959, + 131.31354363122026 + ], + "distanceFromStart":2.25 + }, + { + "elevation":[ + 346.23343025200535, + 497.23376445462401 + ], + "pace":[ + 261.27629148816021, + 331.68516208719467 + ], + "heartRate":[ + 131.67810544238606, + 154.26779645311458 + ], + "distanceFromStart":2.625 + }, + { + "elevation":[ + 491.57378483134391, + 547.49535224251053 + ], + "pace":[ + 296.05298644112088, + 401.14092967732398 + ], + "heartRate":[ + 151.36398089694217, + 166.20454793289232 + ], + "distanceFromStart":3 + }, + { + "elevation":[ + 472.06803233416338, + 531.92570520228401 + ], + "pace":[ + 395.50830663514012, + 401.67837917543591 + ], + "heartRate":[ + 134.41798110234078, + 151.90886697564241 + ], + "distanceFromStart":3.375 + }, + { + "elevation":[ + 339.81419476005283, + 461.03832527824829 + ], + "pace":[ + 395.31160487975183, + 404.49550455974907 + ], + "heartRate":[ + 129.97753472415462, + 138.13531094848992 + ], + "distanceFromStart":3.75 + }, + { + "elevation":[ + 303.1495508565697, + 342.3532820173541 + ], + "pace":[ + 395.02844559698116, + 402.65878340653796 + ], + "heartRate":[ + 127.72304232462609, + 133.26322270764186 + ], + "distanceFromStart":4.125 + } + ] + }, + { + "name":"Lonesome Ridge Trail", + "id":1006, + "distance":4.5, + "difficulty":3, + "observations":[ + { + "elevation":[ + 291.65263635636268, + 309.26016677925196 + ], + "pace":[ + 396.08716481908732, + 403.68937873525232 + ], + "heartRate":[ + 117.16351898665887, + 121.95815455919609 + ], + "distanceFromStart":0 + }, + { + "elevation":[ + 299.24001936628116, + 317.44584350790012 + ], + "pace":[ + 380.19020240756623, + 395.3978319010256 + ], + "heartRate":[ + 117.6410892152911, + 124.82185220506081 + ], + "distanceFromStart":0.375 + }, + { + "elevation":[ + 303.62145464574394, + 336.05569457646544 + ], + "pace":[ + 380.55927782266116, + 397.60789726832775 + ], + "heartRate":[ + 121.52696452049059, + 127.31525441110122 + ], + "distanceFromStart":0.75 + }, + { + "elevation":[ + 319.90393365162629, + 346.26966025518789 + ], + "pace":[ + 357.94116421258531, + 398.0750288648062 + ], + "heartRate":[ + 123.75908585923588, + 132.77069404486801 + ], + "distanceFromStart":1.125 + }, + { + "elevation":[ + 354.17104439267905, + 403.57031216972939 + ], + "pace":[ + 335.07385149392701, + 397.82674381875808 + ], + "heartRate":[ + 130.8235194572915, + 140.55700591418218 + ], + "distanceFromStart":1.5 + }, + { + "elevation":[ + 357.42992871175124, + 385.92155620623635 + ], + "pace":[ + 395.16168913839374, + 404.60294066527558 + ], + "heartRate":[ + 131.5456052446734, + 134.65984504627627 + ], + "distanceFromStart":1.875 + }, + { + "elevation":[ + 345.47736721935661, + 363.18776661379422 + ], + "pace":[ + 340.82303041339082, + 404.71689228682374 + ], + "heartRate":[ + 125.1949698433959, + 131.31354363122026 + ], + "distanceFromStart":2.25 + }, + { + "elevation":[ + 346.23343025200535, + 497.23376445462401 + ], + "pace":[ + 261.27629148816021, + 331.68516208719467 + ], + "heartRate":[ + 131.67810544238606, + 154.26779645311458 + ], + "distanceFromStart":2.625 + }, + { + "elevation":[ + 491.57378483134391, + 547.49535224251053 + ], + "pace":[ + 296.05298644112088, + 401.14092967732398 + ], + "heartRate":[ + 151.36398089694217, + 166.20454793289232 + ], + "distanceFromStart":3 + }, + { + "elevation":[ + 472.06803233416338, + 531.92570520228401 + ], + "pace":[ + 395.50830663514012, + 401.67837917543591 + ], + "heartRate":[ + 134.41798110234078, + 151.90886697564241 + ], + "distanceFromStart":3.375 + }, + { + "elevation":[ + 339.81419476005283, + 461.03832527824829 + ], + "pace":[ + 395.31160487975183, + 404.49550455974907 + ], + "heartRate":[ + 129.97753472415462, + 138.13531094848992 + ], + "distanceFromStart":3.75 + }, + { + "elevation":[ + 303.1495508565697, + 342.3532820173541 + ], + "pace":[ + 395.02844559698116, + 402.65878340653796 + ], + "heartRate":[ + 127.72304232462609, + 133.26322270764186 + ], + "distanceFromStart":4.125 + } + ] + }, + { + "name":"Lonesome Ridge Trail", + "id":1007, + "distance":4.5, + "difficulty":3, + "observations":[ + { + "elevation":[ + 291.65263635636268, + 309.26016677925196 + ], + "pace":[ + 396.08716481908732, + 403.68937873525232 + ], + "heartRate":[ + 117.16351898665887, + 121.95815455919609 + ], + "distanceFromStart":0 + }, + { + "elevation":[ + 299.24001936628116, + 317.44584350790012 + ], + "pace":[ + 380.19020240756623, + 395.3978319010256 + ], + "heartRate":[ + 117.6410892152911, + 124.82185220506081 + ], + "distanceFromStart":0.375 + }, + { + "elevation":[ + 303.62145464574394, + 336.05569457646544 + ], + "pace":[ + 380.55927782266116, + 397.60789726832775 + ], + "heartRate":[ + 121.52696452049059, + 127.31525441110122 + ], + "distanceFromStart":0.75 + }, + { + "elevation":[ + 319.90393365162629, + 346.26966025518789 + ], + "pace":[ + 357.94116421258531, + 398.0750288648062 + ], + "heartRate":[ + 123.75908585923588, + 132.77069404486801 + ], + "distanceFromStart":1.125 + }, + { + "elevation":[ + 354.17104439267905, + 403.57031216972939 + ], + "pace":[ + 335.07385149392701, + 397.82674381875808 + ], + "heartRate":[ + 130.8235194572915, + 140.55700591418218 + ], + "distanceFromStart":1.5 + }, + { + "elevation":[ + 357.42992871175124, + 385.92155620623635 + ], + "pace":[ + 395.16168913839374, + 404.60294066527558 + ], + "heartRate":[ + 131.5456052446734, + 134.65984504627627 + ], + "distanceFromStart":1.875 + }, + { + "elevation":[ + 345.47736721935661, + 363.18776661379422 + ], + "pace":[ + 340.82303041339082, + 404.71689228682374 + ], + "heartRate":[ + 125.1949698433959, + 131.31354363122026 + ], + "distanceFromStart":2.25 + }, + { + "elevation":[ + 346.23343025200535, + 497.23376445462401 + ], + "pace":[ + 261.27629148816021, + 331.68516208719467 + ], + "heartRate":[ + 131.67810544238606, + 154.26779645311458 + ], + "distanceFromStart":2.625 + }, + { + "elevation":[ + 491.57378483134391, + 547.49535224251053 + ], + "pace":[ + 296.05298644112088, + 401.14092967732398 + ], + "heartRate":[ + 151.36398089694217, + 166.20454793289232 + ], + "distanceFromStart":3 + }, + { + "elevation":[ + 472.06803233416338, + 531.92570520228401 + ], + "pace":[ + 395.50830663514012, + 401.67837917543591 + ], + "heartRate":[ + 134.41798110234078, + 151.90886697564241 + ], + "distanceFromStart":3.375 + }, + { + "elevation":[ + 339.81419476005283, + 461.03832527824829 + ], + "pace":[ + 395.31160487975183, + 404.49550455974907 + ], + "heartRate":[ + 129.97753472415462, + 138.13531094848992 + ], + "distanceFromStart":3.75 + }, + { + "elevation":[ + 303.1495508565697, + 342.3532820173541 + ], + "pace":[ + 395.02844559698116, + 402.65878340653796 + ], + "heartRate":[ + 127.72304232462609, + 133.26322270764186 + ], + "distanceFromStart":4.125 + } + ] + }, + { + "name":"Lonesome Ridge Trail", + "id":1008, + "distance":4.5, + "difficulty":3, + "observations":[ + { + "elevation":[ + 291.65263635636268, + 309.26016677925196 + ], + "pace":[ + 396.08716481908732, + 403.68937873525232 + ], + "heartRate":[ + 117.16351898665887, + 121.95815455919609 + ], + "distanceFromStart":0 + }, + { + "elevation":[ + 299.24001936628116, + 317.44584350790012 + ], + "pace":[ + 380.19020240756623, + 395.3978319010256 + ], + "heartRate":[ + 117.6410892152911, + 124.82185220506081 + ], + "distanceFromStart":0.375 + }, + { + "elevation":[ + 303.62145464574394, + 336.05569457646544 + ], + "pace":[ + 380.55927782266116, + 397.60789726832775 + ], + "heartRate":[ + 121.52696452049059, + 127.31525441110122 + ], + "distanceFromStart":0.75 + }, + { + "elevation":[ + 319.90393365162629, + 346.26966025518789 + ], + "pace":[ + 357.94116421258531, + 398.0750288648062 + ], + "heartRate":[ + 123.75908585923588, + 132.77069404486801 + ], + "distanceFromStart":1.125 + }, + { + "elevation":[ + 354.17104439267905, + 403.57031216972939 + ], + "pace":[ + 335.07385149392701, + 397.82674381875808 + ], + "heartRate":[ + 130.8235194572915, + 140.55700591418218 + ], + "distanceFromStart":1.5 + }, + { + "elevation":[ + 357.42992871175124, + 385.92155620623635 + ], + "pace":[ + 395.16168913839374, + 404.60294066527558 + ], + "heartRate":[ + 131.5456052446734, + 134.65984504627627 + ], + "distanceFromStart":1.875 + }, + { + "elevation":[ + 345.47736721935661, + 363.18776661379422 + ], + "pace":[ + 340.82303041339082, + 404.71689228682374 + ], + "heartRate":[ + 125.1949698433959, + 131.31354363122026 + ], + "distanceFromStart":2.25 + }, + { + "elevation":[ + 346.23343025200535, + 497.23376445462401 + ], + "pace":[ + 261.27629148816021, + 331.68516208719467 + ], + "heartRate":[ + 131.67810544238606, + 154.26779645311458 + ], + "distanceFromStart":2.625 + }, + { + "elevation":[ + 491.57378483134391, + 547.49535224251053 + ], + "pace":[ + 296.05298644112088, + 401.14092967732398 + ], + "heartRate":[ + 151.36398089694217, + 166.20454793289232 + ], + "distanceFromStart":3 + }, + { + "elevation":[ + 472.06803233416338, + 531.92570520228401 + ], + "pace":[ + 395.50830663514012, + 401.67837917543591 + ], + "heartRate":[ + 134.41798110234078, + 151.90886697564241 + ], + "distanceFromStart":3.375 + }, + { + "elevation":[ + 339.81419476005283, + 461.03832527824829 + ], + "pace":[ + 395.31160487975183, + 404.49550455974907 + ], + "heartRate":[ + 129.97753472415462, + 138.13531094848992 + ], + "distanceFromStart":3.75 + }, + { + "elevation":[ + 303.1495508565697, + 342.3532820173541 + ], + "pace":[ + 395.02844559698116, + 402.65878340653796 + ], + "heartRate":[ + 127.72304232462609, + 133.26322270764186 + ], + "distanceFromStart":4.125 + } + ] + }, + { + "name":"Lonesome Ridge Trail", + "id":1009, + "distance":4.5, + "difficulty":3, + "observations":[ + { + "elevation":[ + 291.65263635636268, + 309.26016677925196 + ], + "pace":[ + 396.08716481908732, + 403.68937873525232 + ], + "heartRate":[ + 117.16351898665887, + 121.95815455919609 + ], + "distanceFromStart":0 + }, + { + "elevation":[ + 299.24001936628116, + 317.44584350790012 + ], + "pace":[ + 380.19020240756623, + 395.3978319010256 + ], + "heartRate":[ + 117.6410892152911, + 124.82185220506081 + ], + "distanceFromStart":0.375 + }, + { + "elevation":[ + 303.62145464574394, + 336.05569457646544 + ], + "pace":[ + 380.55927782266116, + 397.60789726832775 + ], + "heartRate":[ + 121.52696452049059, + 127.31525441110122 + ], + "distanceFromStart":0.75 + }, + { + "elevation":[ + 319.90393365162629, + 346.26966025518789 + ], + "pace":[ + 357.94116421258531, + 398.0750288648062 + ], + "heartRate":[ + 123.75908585923588, + 132.77069404486801 + ], + "distanceFromStart":1.125 + }, + { + "elevation":[ + 354.17104439267905, + 403.57031216972939 + ], + "pace":[ + 335.07385149392701, + 397.82674381875808 + ], + "heartRate":[ + 130.8235194572915, + 140.55700591418218 + ], + "distanceFromStart":1.5 + }, + { + "elevation":[ + 357.42992871175124, + 385.92155620623635 + ], + "pace":[ + 395.16168913839374, + 404.60294066527558 + ], + "heartRate":[ + 131.5456052446734, + 134.65984504627627 + ], + "distanceFromStart":1.875 + }, + { + "elevation":[ + 345.47736721935661, + 363.18776661379422 + ], + "pace":[ + 340.82303041339082, + 404.71689228682374 + ], + "heartRate":[ + 125.1949698433959, + 131.31354363122026 + ], + "distanceFromStart":2.25 + }, + { + "elevation":[ + 346.23343025200535, + 497.23376445462401 + ], + "pace":[ + 261.27629148816021, + 331.68516208719467 + ], + "heartRate":[ + 131.67810544238606, + 154.26779645311458 + ], + "distanceFromStart":2.625 + }, + { + "elevation":[ + 491.57378483134391, + 547.49535224251053 + ], + "pace":[ + 296.05298644112088, + 401.14092967732398 + ], + "heartRate":[ + 151.36398089694217, + 166.20454793289232 + ], + "distanceFromStart":3 + }, + { + "elevation":[ + 472.06803233416338, + 531.92570520228401 + ], + "pace":[ + 395.50830663514012, + 401.67837917543591 + ], + "heartRate":[ + 134.41798110234078, + 151.90886697564241 + ], + "distanceFromStart":3.375 + }, + { + "elevation":[ + 339.81419476005283, + 461.03832527824829 + ], + "pace":[ + 395.31160487975183, + 404.49550455974907 + ], + "heartRate":[ + 129.97753472415462, + 138.13531094848992 + ], + "distanceFromStart":3.75 + }, + { + "elevation":[ + 303.1495508565697, + 342.3532820173541 + ], + "pace":[ + 395.02844559698116, + 402.65878340653796 + ], + "heartRate":[ + 127.72304232462609, + 133.26322270764186 + ], + "distanceFromStart":4.125 + } + ] + }, + { + "name":"Lonesome Ridge Trail", + "id":1010, + "distance":4.5, + "difficulty":3, + "observations":[ + { + "elevation":[ + 291.65263635636268, + 309.26016677925196 + ], + "pace":[ + 396.08716481908732, + 403.68937873525232 + ], + "heartRate":[ + 117.16351898665887, + 121.95815455919609 + ], + "distanceFromStart":0 + }, + { + "elevation":[ + 299.24001936628116, + 317.44584350790012 + ], + "pace":[ + 380.19020240756623, + 395.3978319010256 + ], + "heartRate":[ + 117.6410892152911, + 124.82185220506081 + ], + "distanceFromStart":0.375 + }, + { + "elevation":[ + 303.62145464574394, + 336.05569457646544 + ], + "pace":[ + 380.55927782266116, + 397.60789726832775 + ], + "heartRate":[ + 121.52696452049059, + 127.31525441110122 + ], + "distanceFromStart":0.75 + }, + { + "elevation":[ + 319.90393365162629, + 346.26966025518789 + ], + "pace":[ + 357.94116421258531, + 398.0750288648062 + ], + "heartRate":[ + 123.75908585923588, + 132.77069404486801 + ], + "distanceFromStart":1.125 + }, + { + "elevation":[ + 354.17104439267905, + 403.57031216972939 + ], + "pace":[ + 335.07385149392701, + 397.82674381875808 + ], + "heartRate":[ + 130.8235194572915, + 140.55700591418218 + ], + "distanceFromStart":1.5 + }, + { + "elevation":[ + 357.42992871175124, + 385.92155620623635 + ], + "pace":[ + 395.16168913839374, + 404.60294066527558 + ], + "heartRate":[ + 131.5456052446734, + 134.65984504627627 + ], + "distanceFromStart":1.875 + }, + { + "elevation":[ + 345.47736721935661, + 363.18776661379422 + ], + "pace":[ + 340.82303041339082, + 404.71689228682374 + ], + "heartRate":[ + 125.1949698433959, + 131.31354363122026 + ], + "distanceFromStart":2.25 + }, + { + "elevation":[ + 346.23343025200535, + 497.23376445462401 + ], + "pace":[ + 261.27629148816021, + 331.68516208719467 + ], + "heartRate":[ + 131.67810544238606, + 154.26779645311458 + ], + "distanceFromStart":2.625 + }, + { + "elevation":[ + 491.57378483134391, + 547.49535224251053 + ], + "pace":[ + 296.05298644112088, + 401.14092967732398 + ], + "heartRate":[ + 151.36398089694217, + 166.20454793289232 + ], + "distanceFromStart":3 + }, + { + "elevation":[ + 472.06803233416338, + 531.92570520228401 + ], + "pace":[ + 395.50830663514012, + 401.67837917543591 + ], + "heartRate":[ + 134.41798110234078, + 151.90886697564241 + ], + "distanceFromStart":3.375 + }, + { + "elevation":[ + 339.81419476005283, + 461.03832527824829 + ], + "pace":[ + 395.31160487975183, + 404.49550455974907 + ], + "heartRate":[ + 129.97753472415462, + 138.13531094848992 + ], + "distanceFromStart":3.75 + }, + { + "elevation":[ + 303.1495508565697, + 342.3532820173541 + ], + "pace":[ + 395.02844559698116, + 402.65878340653796 + ], + "heartRate":[ + 127.72304232462609, + 133.26322270764186 + ], + "distanceFromStart":4.125 + } + ] + } +] diff --git a/Examples/AnimatingViewsAndTransitions/Complete/Landmarks/Landmarks/Resources/icybay.jpg b/Examples/AnimatingViewsAndTransitions/Complete/Landmarks/Landmarks/Resources/icybay.jpg new file mode 100755 index 0000000..feb1764 Binary files /dev/null and b/Examples/AnimatingViewsAndTransitions/Complete/Landmarks/Landmarks/Resources/icybay.jpg differ diff --git a/Examples/AnimatingViewsAndTransitions/Complete/Landmarks/Landmarks/Resources/lakemcdonald.jpg b/Examples/AnimatingViewsAndTransitions/Complete/Landmarks/Landmarks/Resources/lakemcdonald.jpg new file mode 100755 index 0000000..bd9d6b9 Binary files /dev/null and b/Examples/AnimatingViewsAndTransitions/Complete/Landmarks/Landmarks/Resources/lakemcdonald.jpg differ diff --git a/Examples/AnimatingViewsAndTransitions/Complete/Landmarks/Landmarks/Resources/landmarkData.json b/Examples/AnimatingViewsAndTransitions/Complete/Landmarks/Landmarks/Resources/landmarkData.json new file mode 100755 index 0000000..e5b14fc --- /dev/null +++ b/Examples/AnimatingViewsAndTransitions/Complete/Landmarks/Landmarks/Resources/landmarkData.json @@ -0,0 +1,182 @@ +[ + { + "name": "Turtle Rock", + "category": "Rivers", + "city": "Twentynine Palms", + "state": "California", + "id": 1001, + "isFeatured": true, + "isFavorite": true, + "park": "Joshua Tree National Park", + "coordinates": { + "longitude": -116.166868, + "latitude": 34.011286 + }, + "imageName": "turtlerock" + }, + { + "name": "Silver Salmon Creek", + "category": "Lakes", + "city": "Port Alsworth", + "state": "Alaska", + "id": 1002, + "isFeatured": false, + "isFavorite": false, + "park": "Lake Clark National Park and Preserve", + "coordinates": { + "longitude": -152.665167, + "latitude": 59.980167 + }, + "imageName": "silversalmoncreek" + }, + { + "name": "Chilkoot Trail", + "category": "Mountains", + "city": "Skagway", + "state": "Alaska", + "id": 1003, + "isFeatured": false, + "isFavorite": true, + "park": "Klondike Gold Rush National Historical Park", + "coordinates": { + "longitude": -135.334571, + "latitude": 59.560551 + }, + "imageName": "chilkoottrail" + }, + { + "name": "St. Mary Lake", + "category": "Lakes", + "city": "Browning", + "state": "Montana", + "id": 1004, + "isFeatured": true, + "isFavorite": true, + "park": "Glacier National Park", + "coordinates": { + "longitude": -113.536248, + "latitude": 48.69423 + }, + "imageName": "stmarylake" + }, + { + "name": "Twin Lake", + "category": "Lakes", + "city": "Twin Lakes", + "state": "Alaska", + "id": 1005, + "isFeatured": false, + "isFavorite": false, + "park": "Lake Clark National Park and Preserve", + "coordinates": { + "longitude": -153.849883, + "latitude": 60.641684 + }, + "imageName": "twinlake" + }, + { + "name": "Lake McDonald", + "category": "Mountains", + "city": "West Glacier", + "state": "Montana", + "id": 1006, + "isFeatured": false, + "isFavorite": false, + "park": "Glacier National Park", + "coordinates": { + "longitude": -113.934831, + "latitude": 48.56002 + }, + "imageName": "lakemcdonald" + }, + { + "name": "Charley Rivers", + "category": "Rivers", + "city": "Eaking", + "state": "Alaska", + "id": 1007, + "isFeatured": true, + "isFavorite": false, + "park": "Charley Rivers National Preserve", + "coordinates": { + "longitude": -143.122586, + "latitude": 65.350021 + }, + "imageName": "charleyrivers", + }, + { + "name": "Icy Bay", + "category": "Mountains", + "city": "Icy Bay", + "state": "Alaska", + "id": 1008, + "isFeatured": false, + "isFavorite": false, + "park": "Wrangell-St. Elias National Park and Preserve", + "coordinates": { + "longitude": -141.518167, + "latitude": 60.089917 + }, + "imageName": "icybay" + }, + { + "name": "Rainbow Lake", + "category": "Lakes", + "city": "Willow", + "state": "Alaska", + "id": 1009, + "isFeatured": false, + "isFavorite": false, + "park": "State Recreation Area", + "coordinates": { + "longitude": -150.086103, + "latitude": 61.694334 + }, + "imageName": "rainbowlake" + }, + { + "name": "Hidden Lake", + "category": "Lakes", + "city": "Newhalem", + "state": "Washington", + "id": 1010, + "isFeatured": false, + "isFavorite": false, + "park": "North Cascades National Park", + "coordinates": { + "longitude": -121.17799, + "latitude": 48.495442 + }, + "imageName": "hiddenlake" + }, + { + "name": "Chincoteague", + "category": "Rivers", + "city": "Chincoteague", + "state": "Virginia", + "id": 1011, + "isFeatured": false, + "isFavorite": false, + "park": "Chincoteague National Wildlife Refuge", + "coordinates": { + "longitude": -75.383212, + "latitude": 37.91531 + }, + "imageName": "chincoteague" + }, + { + "name": "Lake Umbagog", + "category": "Lakes", + "city": "Errol", + "state": "New Hampshire", + "id": 1012, + "isFeatured": true, + "isFavorite": false, + "park": "Umbagog National Wildlife Refuge", + "coordinates": { + "longitude": -71.056816, + "latitude": 44.747408 + }, + "imageName": "umbagog" + } +] diff --git a/Examples/AnimatingViewsAndTransitions/Complete/Landmarks/Landmarks/Resources/rainbowlake.jpg b/Examples/AnimatingViewsAndTransitions/Complete/Landmarks/Landmarks/Resources/rainbowlake.jpg new file mode 100755 index 0000000..6da43dd Binary files /dev/null and b/Examples/AnimatingViewsAndTransitions/Complete/Landmarks/Landmarks/Resources/rainbowlake.jpg differ diff --git a/Examples/AnimatingViewsAndTransitions/Complete/Landmarks/Landmarks/Resources/silversalmoncreek.jpg b/Examples/AnimatingViewsAndTransitions/Complete/Landmarks/Landmarks/Resources/silversalmoncreek.jpg new file mode 100755 index 0000000..f657532 Binary files /dev/null and b/Examples/AnimatingViewsAndTransitions/Complete/Landmarks/Landmarks/Resources/silversalmoncreek.jpg differ diff --git a/Examples/AnimatingViewsAndTransitions/Complete/Landmarks/Landmarks/Resources/stmarylake.jpg b/Examples/AnimatingViewsAndTransitions/Complete/Landmarks/Landmarks/Resources/stmarylake.jpg new file mode 100755 index 0000000..1c71de4 Binary files /dev/null and b/Examples/AnimatingViewsAndTransitions/Complete/Landmarks/Landmarks/Resources/stmarylake.jpg differ diff --git a/Examples/AnimatingViewsAndTransitions/Complete/Landmarks/Landmarks/Resources/turtlerock.jpg b/Examples/AnimatingViewsAndTransitions/Complete/Landmarks/Landmarks/Resources/turtlerock.jpg new file mode 100755 index 0000000..f7a6e6d Binary files /dev/null and b/Examples/AnimatingViewsAndTransitions/Complete/Landmarks/Landmarks/Resources/turtlerock.jpg differ diff --git a/Examples/AnimatingViewsAndTransitions/Complete/Landmarks/Landmarks/Resources/twinlake.jpg b/Examples/AnimatingViewsAndTransitions/Complete/Landmarks/Landmarks/Resources/twinlake.jpg new file mode 100755 index 0000000..3e7a57c Binary files /dev/null and b/Examples/AnimatingViewsAndTransitions/Complete/Landmarks/Landmarks/Resources/twinlake.jpg differ diff --git a/Examples/AnimatingViewsAndTransitions/Complete/Landmarks/Landmarks/Resources/umbagog.jpg b/Examples/AnimatingViewsAndTransitions/Complete/Landmarks/Landmarks/Resources/umbagog.jpg new file mode 100755 index 0000000..56291c6 Binary files /dev/null and b/Examples/AnimatingViewsAndTransitions/Complete/Landmarks/Landmarks/Resources/umbagog.jpg differ diff --git a/Examples/AnimatingViewsAndTransitions/Complete/Landmarks/Landmarks/SceneDelegate.swift b/Examples/AnimatingViewsAndTransitions/Complete/Landmarks/Landmarks/SceneDelegate.swift new file mode 100755 index 0000000..96df0dc --- /dev/null +++ b/Examples/AnimatingViewsAndTransitions/Complete/Landmarks/Landmarks/SceneDelegate.swift @@ -0,0 +1,56 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +The scene delegate. +*/ + +import UIKit +import SwiftUI + +class SceneDelegate: UIResponder, UIWindowSceneDelegate { + + var window: UIWindow? + + func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) { + // Use this method to optionally configure and attach the UIWindow `window` to the provided UIWindowScene `scene`. + // If using a storyboard, the `window` property will automatically be initialized and attached to the scene. + // This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead). + + // Use a UIHostingController as window root view controller + let window = UIWindow(frame: UIScreen.main.bounds) + window.rootViewController = UIHostingController(rootView: LandmarkList().environmentObject(UserData())) + self.window = window + window.makeKeyAndVisible() + } + + func sceneDidDisconnect(_ scene: UIScene) { + // Called as the scene is being released by the system. + // This occurs shortly after the scene enters the background, or when its session is discarded. + // Release any resources associated with this scene that can be re-created the next time the scene connects. + // The scene may re-connect later, as its session was not neccessarily discarded (see `application:didDiscardSceneSessions` instead). + } + + func sceneDidBecomeActive(_ scene: UIScene) { + // Called when the scene has moved from an inactive state to an active state. + // Use this method to restart any tasks that were paused (or not yet started) when the scene was inactive. + } + + func sceneWillResignActive(_ scene: UIScene) { + // Called when the scene will move from an active state to an inactive state. + // This may occur due to temporary interruptions (ex. an incoming phone call). + } + + func sceneWillEnterForeground(_ scene: UIScene) { + // Called as the scene transitions from the background to the foreground. + // Use this method to undo the changes made on entering the background. + } + + func sceneDidEnterBackground(_ scene: UIScene) { + // Called as the scene transitions from the foreground to the background. + // Use this method to save data, release shared resources, and store enough scene-specific state information + // to restore the scene back to its current state. + } + +} + diff --git a/Examples/AnimatingViewsAndTransitions/Complete/Landmarks/Landmarks/Supporting Views/Badge.swift b/Examples/AnimatingViewsAndTransitions/Complete/Landmarks/Landmarks/Supporting Views/Badge.swift new file mode 100755 index 0000000..59f03b2 --- /dev/null +++ b/Examples/AnimatingViewsAndTransitions/Complete/Landmarks/Landmarks/Supporting Views/Badge.swift @@ -0,0 +1,41 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +A view that displays a badge. +*/ + +import SwiftUI + +struct Badge: View { + static let rotationCount = 8 + + var badgeSymbols: some View { + ForEach(0.. + var overallRange: Range + + var heightRatio: Length { + max(Length(magnitude(of: range) / magnitude(of: overallRange)), 0.15) + } + + var offsetRatio: Length { + Length((range.lowerBound - overallRange.lowerBound) / magnitude(of: overallRange)) + } + + var animation: Animation { + Animation.spring(initialVelocity: 5) + .speed(2) + .delay(0.03 * Double(index)) + } + + var body: some View { + Capsule() + .fill(Color.white) + .frame(height: height * heightRatio, alignment: .bottom) + .offset(x: 0, y: height * -offsetRatio) + .animation(animation) + } +} + +#if DEBUG +struct GraphCapsule_Previews: PreviewProvider { + static var previews: some View { + GraphCapsule(index: 0, height: 150, range: 10..<50, overallRange: 0..<100) + } +} +#endif diff --git a/Examples/AnimatingViewsAndTransitions/Complete/Landmarks/Landmarks/Supporting Views/HikeGraph.swift b/Examples/AnimatingViewsAndTransitions/Complete/Landmarks/Landmarks/Supporting Views/HikeGraph.swift new file mode 100755 index 0000000..7df5194 --- /dev/null +++ b/Examples/AnimatingViewsAndTransitions/Complete/Landmarks/Landmarks/Supporting Views/HikeGraph.swift @@ -0,0 +1,74 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +The elevation, heart rate, and pace of a hike plotted on a graph. +*/ + +import SwiftUI + +func rangeOfRanges(_ ranges: C) -> Range + where C.Element == Range { + guard !ranges.isEmpty else { return 0..<0 } + let low = ranges.lazy.map { $0.lowerBound }.min()! + let high = ranges.lazy.map { $0.upperBound }.max()! + return low..) -> Double { + return range.upperBound - range.lowerBound +} + +struct HikeGraph: View { + var hike: Hike + var path: KeyPath> + + var color: Color { + switch path { + case \.elevation: + return .gray + case \.heartRate: + return Color(hue: 0, saturation: 0.5, brightness: 0.7) + case \.pace: + return Color(hue: 0.7, saturation: 0.4, brightness: 0.7) + default: + return .black + } + } + + var body: some View { + let data = hike.observations + let overallRange = rangeOfRanges(data.lazy.map { $0[keyPath: self.path] }) + let maxMagnitude = data.map { magnitude(of: $0[keyPath: path]) }.max()! + let heightRatio = 1 - Length(maxMagnitude / magnitude(of: overallRange)) + + return GeometryReader { proxy in + HStack(alignment: .bottom, spacing: proxy.size.width / 120) { + ForEach(data.indices) { index in + GraphCapsule( + index: index, + height: proxy.size.height, + range: data[index][keyPath: self.path], + overallRange: overallRange) + .colorMultiply(self.color) + } + .offset(x: 0, y: proxy.size.height * heightRatio) + } + } + } +} + +#if DEBUG +struct HikeGraph_Previews: PreviewProvider { + static var previews: some View { + Group { + HikeGraph(hike: hikeData[0], path: \.elevation) + .frame(height: 200) + HikeGraph(hike: hikeData[0], path: \.heartRate) + .frame(height: 200) + HikeGraph(hike: hikeData[0], path: \.pace) + .frame(height: 200) + } + } +} +#endif diff --git a/Examples/AnimatingViewsAndTransitions/Complete/Landmarks/Landmarks/Supporting Views/LandmarkRow.swift b/Examples/AnimatingViewsAndTransitions/Complete/Landmarks/Landmarks/Supporting Views/LandmarkRow.swift new file mode 100755 index 0000000..2f8110c --- /dev/null +++ b/Examples/AnimatingViewsAndTransitions/Complete/Landmarks/Landmarks/Supporting Views/LandmarkRow.swift @@ -0,0 +1,38 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +A single row to be displayed in a list of landmarks. +*/ + +import SwiftUI + +struct LandmarkRow: View { + var landmark: Landmark + + var body: some View { + HStack { + landmark.image(forSize: 50) + Text(verbatim: landmark.name) + Spacer() + + if landmark.isFavorite { + Image(systemName: "star.fill") + .imageScale(.medium) + .foregroundColor(.yellow) + } + } + } +} + +#if DEBUG +struct LandmarkRow_Previews: PreviewProvider { + static var previews: some View { + Group { + LandmarkRow(landmark: landmarkData[0]) + LandmarkRow(landmark: landmarkData[1]) + } + .previewLayout(.fixed(width: 300, height: 70)) + } +} +#endif diff --git a/Examples/AnimatingViewsAndTransitions/Complete/Landmarks/Landmarks/Supporting Views/MapView.swift b/Examples/AnimatingViewsAndTransitions/Complete/Landmarks/Landmarks/Supporting Views/MapView.swift new file mode 100755 index 0000000..5a8c64b --- /dev/null +++ b/Examples/AnimatingViewsAndTransitions/Complete/Landmarks/Landmarks/Supporting Views/MapView.swift @@ -0,0 +1,31 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +A view that hosts an `MKMapView`. +*/ + +import SwiftUI +import MapKit + +struct MapView: UIViewRepresentable { + var coordinate: CLLocationCoordinate2D + + func makeUIView(context: Context) -> MKMapView { + MKMapView(frame: .zero) + } + + func updateUIView(_ view: MKMapView, context: Context) { + let span = MKCoordinateSpan(latitudeDelta: 0.02, longitudeDelta: 0.02) + let region = MKCoordinateRegion(center: coordinate, span: span) + view.setRegion(region, animated: true) + } +} + +#if DEBUG +struct MapView_Previews: PreviewProvider { + static var previews: some View { + MapView(coordinate: landmarkData[0].locationCoordinate) + } +} +#endif diff --git a/Examples/AnimatingViewsAndTransitions/Complete/Landmarks/Landmarks/Supporting Views/RotatedBadgeSymbol.swift b/Examples/AnimatingViewsAndTransitions/Complete/Landmarks/Landmarks/Supporting Views/RotatedBadgeSymbol.swift new file mode 100755 index 0000000..a7e4b53 --- /dev/null +++ b/Examples/AnimatingViewsAndTransitions/Complete/Landmarks/Landmarks/Supporting Views/RotatedBadgeSymbol.swift @@ -0,0 +1,26 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +A view that displays a rotated version of a badge symbol. +*/ + +import SwiftUI + +struct RotatedBadgeSymbol: View { + let angle: Angle + + var body: some View { + BadgeSymbol() + .padding(-60) + .rotationEffect(angle, anchor: .bottom) + } +} + +#if DEBUG +struct RotatedBadgeSymbol_Previews: PreviewProvider { + static var previews: some View { + RotatedBadgeSymbol(angle: .init(degrees: 5)) + } +} +#endif diff --git a/Examples/AnimatingViewsAndTransitions/Complete/README.md b/Examples/AnimatingViewsAndTransitions/Complete/README.md new file mode 100755 index 0000000..577767d --- /dev/null +++ b/Examples/AnimatingViewsAndTransitions/Complete/README.md @@ -0,0 +1,3 @@ +# Completed Project: Animating Views and Transitions + +Explore the completed project for the [Animating Views and Transitions](https://developer.apple.com/tutorials/swiftui/animating-views-and-transitions) tutorial. \ No newline at end of file diff --git a/Examples/AnimatingViewsAndTransitions/StartingPoint/.gitignore b/Examples/AnimatingViewsAndTransitions/StartingPoint/.gitignore new file mode 100755 index 0000000..9e50718 --- /dev/null +++ b/Examples/AnimatingViewsAndTransitions/StartingPoint/.gitignore @@ -0,0 +1,21 @@ +# See LICENSE folder for this sample’s licensing information. +# +# Apple sample code gitignore configuration. + +# Finder +.DS_Store + +# Xcode - User files +xcuserdata/ + +**/*.xcodeproj/project.xcworkspace/* +!**/*.xcodeproj/project.xcworkspace/xcshareddata + +**/*.xcodeproj/project.xcworkspace/xcshareddata/* +!**/*.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings + +**/*.playground/playground.xcworkspace/* +!**/*.playground/playground.xcworkspace/xcshareddata + +**/*.playground/playground.xcworkspace/xcshareddata/* +!**/*.playground/playground.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings diff --git a/Examples/AnimatingViewsAndTransitions/StartingPoint/Configuration/SampleCode.xcconfig b/Examples/AnimatingViewsAndTransitions/StartingPoint/Configuration/SampleCode.xcconfig new file mode 100755 index 0000000..db86c06 --- /dev/null +++ b/Examples/AnimatingViewsAndTransitions/StartingPoint/Configuration/SampleCode.xcconfig @@ -0,0 +1,13 @@ +// +// See LICENSE folder for this sample’s licensing information. +// +// SampleCode.xcconfig +// + +// The `SAMPLE_CODE_DISAMBIGUATOR` configuration is to make it easier to build +// and run a sample code project. Once you set your project's development team, +// you'll have a unique bundle identifier. This is because the bundle identifier +// is derived based on the 'SAMPLE_CODE_DISAMBIGUATOR' value. Do not use this +// approach in your own projects—it's only useful for sample code projects because +// they are frequently downloaded and don't have a development team set. +SAMPLE_CODE_DISAMBIGUATOR=${DEVELOPMENT_TEAM} diff --git a/Examples/AnimatingViewsAndTransitions/StartingPoint/LICENSE/LICENSE.txt b/Examples/AnimatingViewsAndTransitions/StartingPoint/LICENSE/LICENSE.txt new file mode 100755 index 0000000..94e3d54 --- /dev/null +++ b/Examples/AnimatingViewsAndTransitions/StartingPoint/LICENSE/LICENSE.txt @@ -0,0 +1,8 @@ +Copyright © 2019 Apple Inc. + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + diff --git a/Examples/AnimatingViewsAndTransitions/StartingPoint/Landmarks/AnimatingViewsAndTransitions.xcodeproj/.xcodesamplecode.plist b/Examples/AnimatingViewsAndTransitions/StartingPoint/Landmarks/AnimatingViewsAndTransitions.xcodeproj/.xcodesamplecode.plist new file mode 100755 index 0000000..5dd5da8 --- /dev/null +++ b/Examples/AnimatingViewsAndTransitions/StartingPoint/Landmarks/AnimatingViewsAndTransitions.xcodeproj/.xcodesamplecode.plist @@ -0,0 +1,5 @@ + + + + + diff --git a/Examples/AnimatingViewsAndTransitions/StartingPoint/Landmarks/AnimatingViewsAndTransitions.xcodeproj/project.pbxproj b/Examples/AnimatingViewsAndTransitions/StartingPoint/Landmarks/AnimatingViewsAndTransitions.xcodeproj/project.pbxproj new file mode 100755 index 0000000..94530de --- /dev/null +++ b/Examples/AnimatingViewsAndTransitions/StartingPoint/Landmarks/AnimatingViewsAndTransitions.xcodeproj/project.pbxproj @@ -0,0 +1,525 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 50; + objects = { + +/* Begin PBXBuildFile section */ + B7310DD1229F6839001079B9 /* HexagonParameters.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7310DD0229F6839001079B9 /* HexagonParameters.swift */; }; + B7310DD3229F6CA9001079B9 /* Badge.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7310DD2229F6CA9001079B9 /* Badge.swift */; }; + B7394866229F194000C47603 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7394865229F194000C47603 /* AppDelegate.swift */; }; + B7394868229F194000C47603 /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7394867229F194000C47603 /* SceneDelegate.swift */; }; + B739486A229F194000C47603 /* LandmarkDetail.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7394869229F194000C47603 /* LandmarkDetail.swift */; }; + B739486C229F194200C47603 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = B739486B229F194200C47603 /* Assets.xcassets */; }; + B739486F229F194200C47603 /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = B739486E229F194200C47603 /* Preview Assets.xcassets */; }; + B7394872229F194200C47603 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = B7394870229F194200C47603 /* LaunchScreen.storyboard */; }; + B739487A229F1B3F00C47603 /* CircleImage.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7394879229F1B3F00C47603 /* CircleImage.swift */; }; + B739487C229F1B6800C47603 /* MapView.swift in Sources */ = {isa = PBXBuildFile; fileRef = B739487B229F1B6800C47603 /* MapView.swift */; }; + B7394881229F28B900C47603 /* Landmark.swift in Sources */ = {isa = PBXBuildFile; fileRef = B739487F229F28B900C47603 /* Landmark.swift */; }; + B7394882229F28B900C47603 /* Data.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7394880229F28B900C47603 /* Data.swift */; }; + B7394891229F292F00C47603 /* rainbowlake.jpg in Resources */ = {isa = PBXBuildFile; fileRef = B7394884229F292D00C47603 /* rainbowlake.jpg */; }; + B7394893229F292F00C47603 /* icybay.jpg in Resources */ = {isa = PBXBuildFile; fileRef = B7394886229F292E00C47603 /* icybay.jpg */; }; + B7394894229F292F00C47603 /* lakemcdonald.jpg in Resources */ = {isa = PBXBuildFile; fileRef = B7394887229F292E00C47603 /* lakemcdonald.jpg */; }; + B7394895229F292F00C47603 /* turtlerock.jpg in Resources */ = {isa = PBXBuildFile; fileRef = B7394888229F292E00C47603 /* turtlerock.jpg */; }; + B7394896229F292F00C47603 /* umbagog.jpg in Resources */ = {isa = PBXBuildFile; fileRef = B7394889229F292E00C47603 /* umbagog.jpg */; }; + B7394897229F292F00C47603 /* hiddenlake.jpg in Resources */ = {isa = PBXBuildFile; fileRef = B739488A229F292E00C47603 /* hiddenlake.jpg */; }; + B7394898229F292F00C47603 /* stmarylake.jpg in Resources */ = {isa = PBXBuildFile; fileRef = B739488B229F292E00C47603 /* stmarylake.jpg */; }; + B7394899229F292F00C47603 /* twinlake.jpg in Resources */ = {isa = PBXBuildFile; fileRef = B739488C229F292E00C47603 /* twinlake.jpg */; }; + B739489A229F292F00C47603 /* silversalmoncreek.jpg in Resources */ = {isa = PBXBuildFile; fileRef = B739488D229F292E00C47603 /* silversalmoncreek.jpg */; }; + B739489B229F292F00C47603 /* landmarkData.json in Resources */ = {isa = PBXBuildFile; fileRef = B739488E229F292E00C47603 /* landmarkData.json */; }; + B739489C229F292F00C47603 /* chincoteague.jpg in Resources */ = {isa = PBXBuildFile; fileRef = B739488F229F292F00C47603 /* chincoteague.jpg */; }; + B739489D229F292F00C47603 /* chilkoottrail.jpg in Resources */ = {isa = PBXBuildFile; fileRef = B7394890229F292F00C47603 /* chilkoottrail.jpg */; }; + B739489F229F2D9700C47603 /* LandmarkRow.swift in Sources */ = {isa = PBXBuildFile; fileRef = B739489E229F2D9700C47603 /* LandmarkRow.swift */; }; + B73948A1229F2E1F00C47603 /* LandmarkList.swift in Sources */ = {isa = PBXBuildFile; fileRef = B73948A0229F2E1F00C47603 /* LandmarkList.swift */; }; + B73948A3229F3E2200C47603 /* charleyrivers.jpg in Resources */ = {isa = PBXBuildFile; fileRef = B73948A2229F3E2200C47603 /* charleyrivers.jpg */; }; + B7D2AAC5229F4D7C0061E5F5 /* UserData.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7D2AAC4229F4D7C0061E5F5 /* UserData.swift */; }; + B7D587AE229F7382006E8DCF /* BadgeBackground.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7D587AD229F7382006E8DCF /* BadgeBackground.swift */; }; + B7D587B0229F73C1006E8DCF /* BadgeSymbol.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7D587AF229F73C1006E8DCF /* BadgeSymbol.swift */; }; + B7D587B2229F7406006E8DCF /* RotatedBadgeSymbol.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7D587B1229F7406006E8DCF /* RotatedBadgeSymbol.swift */; }; + B7D587B6229F825D006E8DCF /* HikeView.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7D587B5229F825D006E8DCF /* HikeView.swift */; }; + B7D587B8229F826D006E8DCF /* GraphCapsule.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7D587B7229F826D006E8DCF /* GraphCapsule.swift */; }; + B7D587BA229F8288006E8DCF /* Hike.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7D587B9229F8288006E8DCF /* Hike.swift */; }; + B7D587BC229F82EB006E8DCF /* HikeDetail.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7D587BB229F82EB006E8DCF /* HikeDetail.swift */; }; + B7D587BE229F82FF006E8DCF /* HikeGraph.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7D587BD229F82FF006E8DCF /* HikeGraph.swift */; }; + B7D587C0229F830B006E8DCF /* hikeData.json in Resources */ = {isa = PBXBuildFile; fileRef = B7D587BF229F830B006E8DCF /* hikeData.json */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + B7310DD0229F6839001079B9 /* HexagonParameters.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HexagonParameters.swift; sourceTree = ""; }; + B7310DD2229F6CA9001079B9 /* Badge.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Badge.swift; sourceTree = ""; }; + B7394862229F194000C47603 /* Landmarks.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Landmarks.app; sourceTree = BUILT_PRODUCTS_DIR; }; + B7394865229F194000C47603 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + B7394867229F194000C47603 /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = ""; }; + B7394869229F194000C47603 /* LandmarkDetail.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LandmarkDetail.swift; sourceTree = ""; }; + B739486B229F194200C47603 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + B739486E229F194200C47603 /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = ""; }; + B7394871229F194200C47603 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + B7394873229F194200C47603 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + B7394879229F1B3F00C47603 /* CircleImage.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CircleImage.swift; sourceTree = ""; }; + B739487B229F1B6800C47603 /* MapView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MapView.swift; sourceTree = ""; }; + B739487F229F28B900C47603 /* Landmark.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Landmark.swift; sourceTree = ""; }; + B7394880229F28B900C47603 /* Data.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Data.swift; sourceTree = ""; }; + B7394884229F292D00C47603 /* rainbowlake.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = rainbowlake.jpg; sourceTree = ""; }; + B7394886229F292E00C47603 /* icybay.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = icybay.jpg; sourceTree = ""; }; + B7394887229F292E00C47603 /* lakemcdonald.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = lakemcdonald.jpg; sourceTree = ""; }; + B7394888229F292E00C47603 /* turtlerock.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = turtlerock.jpg; sourceTree = ""; }; + B7394889229F292E00C47603 /* umbagog.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = umbagog.jpg; sourceTree = ""; }; + B739488A229F292E00C47603 /* hiddenlake.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = hiddenlake.jpg; sourceTree = ""; }; + B739488B229F292E00C47603 /* stmarylake.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = stmarylake.jpg; sourceTree = ""; }; + B739488C229F292E00C47603 /* twinlake.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = twinlake.jpg; sourceTree = ""; }; + B739488D229F292E00C47603 /* silversalmoncreek.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = silversalmoncreek.jpg; sourceTree = ""; }; + B739488E229F292E00C47603 /* landmarkData.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = landmarkData.json; sourceTree = ""; }; + B739488F229F292F00C47603 /* chincoteague.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = chincoteague.jpg; sourceTree = ""; }; + B7394890229F292F00C47603 /* chilkoottrail.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = chilkoottrail.jpg; sourceTree = ""; }; + B739489E229F2D9700C47603 /* LandmarkRow.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = LandmarkRow.swift; path = "Supporting Views/LandmarkRow.swift"; sourceTree = ""; }; + B73948A0229F2E1F00C47603 /* LandmarkList.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LandmarkList.swift; sourceTree = ""; }; + B73948A2229F3E2200C47603 /* charleyrivers.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = charleyrivers.jpg; sourceTree = ""; }; + B7D2AAC4229F4D7C0061E5F5 /* UserData.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UserData.swift; sourceTree = ""; }; + B7D587AD229F7382006E8DCF /* BadgeBackground.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BadgeBackground.swift; sourceTree = ""; }; + B7D587AF229F73C1006E8DCF /* BadgeSymbol.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BadgeSymbol.swift; sourceTree = ""; }; + B7D587B1229F7406006E8DCF /* RotatedBadgeSymbol.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RotatedBadgeSymbol.swift; sourceTree = ""; }; + B7D587B5229F825D006E8DCF /* HikeView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HikeView.swift; sourceTree = ""; }; + B7D587B7229F826D006E8DCF /* GraphCapsule.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GraphCapsule.swift; sourceTree = ""; }; + B7D587B9229F8288006E8DCF /* Hike.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Hike.swift; sourceTree = ""; }; + B7D587BB229F82EB006E8DCF /* HikeDetail.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HikeDetail.swift; sourceTree = ""; }; + B7D587BD229F82FF006E8DCF /* HikeGraph.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HikeGraph.swift; sourceTree = ""; }; + B7D587BF229F830B006E8DCF /* hikeData.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = hikeData.json; sourceTree = ""; }; + C4E4AAA0C4E4035000000001 /* README.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; name = README.md; path = ../README.md; sourceTree = ""; }; + D4647A20D46497F000000001 /* SampleCode.xcconfig */ = {isa = PBXFileReference; name = SampleCode.xcconfig; path = ../Configuration/SampleCode.xcconfig; sourceTree = ""; }; + D4689770D468771000000001 /* LICENSE.txt */ = {isa = PBXFileReference; includeInIndex = 1; path = LICENSE.txt; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + B739485F229F194000C47603 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + B7394859229F194000C47603 = { + isa = PBXGroup; + children = ( + C4E4AAA0C4E4035000000001 /* README.md */, + B7394864229F194000C47603 /* Landmarks */, + B7394863229F194000C47603 /* Products */, + D46430F0D464341000000001 /* Configuration */, + D6574180D65753B000000001 /* LICENSE */, + ); + sourceTree = ""; + }; + B7394863229F194000C47603 /* Products */ = { + isa = PBXGroup; + children = ( + B7394862229F194000C47603 /* Landmarks.app */, + ); + name = Products; + sourceTree = ""; + }; + B7394864229F194000C47603 /* Landmarks */ = { + isa = PBXGroup; + children = ( + B739487E229F282200C47603 /* Models */, + B7394865229F194000C47603 /* AppDelegate.swift */, + B7394867229F194000C47603 /* SceneDelegate.swift */, + B73948A0229F2E1F00C47603 /* LandmarkList.swift */, + B739489E229F2D9700C47603 /* LandmarkRow.swift */, + B7394869229F194000C47603 /* LandmarkDetail.swift */, + B7D587B5229F825D006E8DCF /* HikeView.swift */, + B7D587BB229F82EB006E8DCF /* HikeDetail.swift */, + B7310DD0229F6839001079B9 /* HexagonParameters.swift */, + B739487D229F1C0100C47603 /* Supporting Views */, + B7394883229F291A00C47603 /* Resources */, + B739486B229F194200C47603 /* Assets.xcassets */, + B7394870229F194200C47603 /* LaunchScreen.storyboard */, + B7394873229F194200C47603 /* Info.plist */, + B739486D229F194200C47603 /* Preview Content */, + ); + path = Landmarks; + sourceTree = ""; + }; + B739486D229F194200C47603 /* Preview Content */ = { + isa = PBXGroup; + children = ( + B739486E229F194200C47603 /* Preview Assets.xcassets */, + ); + path = "Preview Content"; + sourceTree = ""; + }; + B739487D229F1C0100C47603 /* Supporting Views */ = { + isa = PBXGroup; + children = ( + B7394879229F1B3F00C47603 /* CircleImage.swift */, + B739487B229F1B6800C47603 /* MapView.swift */, + B7310DD2229F6CA9001079B9 /* Badge.swift */, + B7D587AF229F73C1006E8DCF /* BadgeSymbol.swift */, + B7D587B1229F7406006E8DCF /* RotatedBadgeSymbol.swift */, + B7D587AD229F7382006E8DCF /* BadgeBackground.swift */, + B7D587BD229F82FF006E8DCF /* HikeGraph.swift */, + B7D587B7229F826D006E8DCF /* GraphCapsule.swift */, + ); + path = "Supporting Views"; + sourceTree = ""; + }; + B739487E229F282200C47603 /* Models */ = { + isa = PBXGroup; + children = ( + B7394880229F28B900C47603 /* Data.swift */, + B739487F229F28B900C47603 /* Landmark.swift */, + B7D587B9229F8288006E8DCF /* Hike.swift */, + B7D2AAC4229F4D7C0061E5F5 /* UserData.swift */, + ); + path = Models; + sourceTree = ""; + }; + B7394883229F291A00C47603 /* Resources */ = { + isa = PBXGroup; + children = ( + B739488E229F292E00C47603 /* landmarkData.json */, + B7D587BF229F830B006E8DCF /* hikeData.json */, + B7394890229F292F00C47603 /* chilkoottrail.jpg */, + B739488F229F292F00C47603 /* chincoteague.jpg */, + B739488A229F292E00C47603 /* hiddenlake.jpg */, + B7394886229F292E00C47603 /* icybay.jpg */, + B7394887229F292E00C47603 /* lakemcdonald.jpg */, + B7394884229F292D00C47603 /* rainbowlake.jpg */, + B739488D229F292E00C47603 /* silversalmoncreek.jpg */, + B739488B229F292E00C47603 /* stmarylake.jpg */, + B7394888229F292E00C47603 /* turtlerock.jpg */, + B739488C229F292E00C47603 /* twinlake.jpg */, + B7394889229F292E00C47603 /* umbagog.jpg */, + B73948A2229F3E2200C47603 /* charleyrivers.jpg */, + ); + path = Resources; + sourceTree = ""; + }; + D46430F0D464341000000001 /* Configuration */ = { + isa = PBXGroup; + children = ( + D4647A20D46497F000000001 /* SampleCode.xcconfig */, + ); + name = Configuration; + sourceTree = ""; + }; + D6574180D65753B000000001 /* LICENSE */ = { + isa = PBXGroup; + children = ( + D4689770D468771000000001 /* LICENSE.txt */, + ); + name = LICENSE; + path = ../LICENSE; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + B7394861229F194000C47603 /* Landmarks */ = { + isa = PBXNativeTarget; + buildConfigurationList = B7394876229F194200C47603 /* Build configuration list for PBXNativeTarget "Landmarks" */; + buildPhases = ( + B739485E229F194000C47603 /* Sources */, + B739485F229F194000C47603 /* Frameworks */, + B7394860229F194000C47603 /* Resources */, + C602AC70C605937000000001, + ); + buildRules = ( + ); + dependencies = ( + ); + name = Landmarks; + productName = Landmarks; + productReference = B7394862229F194000C47603 /* Landmarks.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + B739485A229F194000C47603 /* Project object */ = { + isa = PBXProject; + attributes = { + LastSwiftUpdateCheck = 1100; + LastUpgradeCheck = 1100; + ORGANIZATIONNAME = Apple; + TargetAttributes = { + B7394861229F194000C47603 = { + CreatedOnToolsVersion = 11.0; + }; + }; + }; + buildConfigurationList = B739485D229F194000C47603 /* Build configuration list for PBXProject "AnimatingViewsAndTransitions" */; + compatibilityVersion = "Xcode 9.3"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = B7394859229F194000C47603; + productRefGroup = B7394863229F194000C47603 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + B7394861229F194000C47603 /* Landmarks */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + B7394860229F194000C47603 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + B739489A229F292F00C47603 /* silversalmoncreek.jpg in Resources */, + B7394894229F292F00C47603 /* lakemcdonald.jpg in Resources */, + B7D587C0229F830B006E8DCF /* hikeData.json in Resources */, + B7394872229F194200C47603 /* LaunchScreen.storyboard in Resources */, + B73948A3229F3E2200C47603 /* charleyrivers.jpg in Resources */, + B7394891229F292F00C47603 /* rainbowlake.jpg in Resources */, + B739486F229F194200C47603 /* Preview Assets.xcassets in Resources */, + B7394895229F292F00C47603 /* turtlerock.jpg in Resources */, + B739486C229F194200C47603 /* Assets.xcassets in Resources */, + B7394899229F292F00C47603 /* twinlake.jpg in Resources */, + B7394896229F292F00C47603 /* umbagog.jpg in Resources */, + B739489D229F292F00C47603 /* chilkoottrail.jpg in Resources */, + B739489C229F292F00C47603 /* chincoteague.jpg in Resources */, + B739489B229F292F00C47603 /* landmarkData.json in Resources */, + B7394893229F292F00C47603 /* icybay.jpg in Resources */, + B7394897229F292F00C47603 /* hiddenlake.jpg in Resources */, + B7394898229F292F00C47603 /* stmarylake.jpg in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + B739485E229F194000C47603 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + B7394882229F28B900C47603 /* Data.swift in Sources */, + B7310DD3229F6CA9001079B9 /* Badge.swift in Sources */, + B7394866229F194000C47603 /* AppDelegate.swift in Sources */, + B7D587B8229F826D006E8DCF /* GraphCapsule.swift in Sources */, + B739487A229F1B3F00C47603 /* CircleImage.swift in Sources */, + B739487C229F1B6800C47603 /* MapView.swift in Sources */, + B7D587BA229F8288006E8DCF /* Hike.swift in Sources */, + B7D587BC229F82EB006E8DCF /* HikeDetail.swift in Sources */, + B7D587B6229F825D006E8DCF /* HikeView.swift in Sources */, + B7310DD1229F6839001079B9 /* HexagonParameters.swift in Sources */, + B73948A1229F2E1F00C47603 /* LandmarkList.swift in Sources */, + B7D587B0229F73C1006E8DCF /* BadgeSymbol.swift in Sources */, + B7D587B2229F7406006E8DCF /* RotatedBadgeSymbol.swift in Sources */, + B7D587BE229F82FF006E8DCF /* HikeGraph.swift in Sources */, + B7394868229F194000C47603 /* SceneDelegate.swift in Sources */, + B7D587AE229F7382006E8DCF /* BadgeBackground.swift in Sources */, + B739486A229F194000C47603 /* LandmarkDetail.swift in Sources */, + B739489F229F2D9700C47603 /* LandmarkRow.swift in Sources */, + B7D2AAC5229F4D7C0061E5F5 /* UserData.swift in Sources */, + B7394881229F28B900C47603 /* Landmark.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXVariantGroup section */ + B7394870229F194200C47603 /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + B7394871229F194200C47603 /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + B7394874229F194200C47603 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = D4647A20D46497F000000001 /* SampleCode.xcconfig */; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 13.0; + MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; + MTL_FAST_MATH = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + }; + name = Debug; + }; + B7394875229F194200C47603 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = D4647A20D46497F000000001 /* SampleCode.xcconfig */; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 13.0; + MTL_ENABLE_DEBUG_INFO = NO; + MTL_FAST_MATH = YES; + SDKROOT = iphoneos; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + B7394877229F194200C47603 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = D4647A20D46497F000000001 /* SampleCode.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_ASSET_PATHS = "Landmarks/Preview\\ Content"; + DEVELOPMENT_TEAM = ""; + ENABLE_PREVIEWS = YES; + INFOPLIST_FILE = Landmarks/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = "com.example.apple-samplecode.Landmarks${SAMPLE_CODE_DISAMBIGUATOR}"; + PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE_SPECIFIER = ""; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + B7394878229F194200C47603 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = D4647A20D46497F000000001 /* SampleCode.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_ASSET_PATHS = "Landmarks/Preview\\ Content"; + DEVELOPMENT_TEAM = ""; + ENABLE_PREVIEWS = YES; + INFOPLIST_FILE = Landmarks/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = "com.example.apple-samplecode.Landmarks${SAMPLE_CODE_DISAMBIGUATOR}"; + PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE_SPECIFIER = ""; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + B739485D229F194000C47603 /* Build configuration list for PBXProject "AnimatingViewsAndTransitions" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + B7394874229F194200C47603 /* Debug */, + B7394875229F194200C47603 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + B7394876229F194200C47603 /* Build configuration list for PBXNativeTarget "Landmarks" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + B7394877229F194200C47603 /* Debug */, + B7394878229F194200C47603 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = B739485A229F194000C47603 /* Project object */; +} diff --git a/Examples/AnimatingViewsAndTransitions/StartingPoint/Landmarks/AnimatingViewsAndTransitions.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/Examples/AnimatingViewsAndTransitions/StartingPoint/Landmarks/AnimatingViewsAndTransitions.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings new file mode 100755 index 0000000..3ddf867 --- /dev/null +++ b/Examples/AnimatingViewsAndTransitions/StartingPoint/Landmarks/AnimatingViewsAndTransitions.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings @@ -0,0 +1,8 @@ + + + + + BuildSystemType + Latest + + diff --git a/Examples/AnimatingViewsAndTransitions/StartingPoint/Landmarks/Landmarks/AppDelegate.swift b/Examples/AnimatingViewsAndTransitions/StartingPoint/Landmarks/Landmarks/AppDelegate.swift new file mode 100755 index 0000000..e22943b --- /dev/null +++ b/Examples/AnimatingViewsAndTransitions/StartingPoint/Landmarks/Landmarks/AppDelegate.swift @@ -0,0 +1,36 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +The application delegate. +*/ + +import UIKit + +@UIApplicationMain +class AppDelegate: UIResponder, UIApplicationDelegate { + + func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { + // Override point for customization after application launch. + return true + } + + func applicationWillTerminate(_ application: UIApplication) { + // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. + } + + // MARK: UISceneSession Lifecycle + func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration { + // Called when a new scene session is being created. + // Use this method to select a configuration to create the new scene with. + return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role) + } + + func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set) { + // Called when the user discards a scene session. + // If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions. + // Use this method to release any resources that were specific to the discarded scenes, as they will not return. + } + +} + diff --git a/Examples/AnimatingViewsAndTransitions/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/Contents.json b/Examples/AnimatingViewsAndTransitions/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100755 index 0000000..deeb2c6 --- /dev/null +++ b/Examples/AnimatingViewsAndTransitions/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,113 @@ +{ + "images" : [ + { + "size" : "20x20", + "idiom" : "iphone", + "filename" : "landmark_app_icon_40x40.png", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "20x20", + "scale" : "3x" + }, + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "landmark_app_icon_58x58.png", + "scale" : "2x" + }, + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "landmark_app_icon_87x87.png", + "scale" : "3x" + }, + { + "size" : "40x40", + "idiom" : "iphone", + "filename" : "landmark_app_icon_80x80-1.png", + "scale" : "2x" + }, + { + "size" : "40x40", + "idiom" : "iphone", + "filename" : "landmark_app_icon_120x120-1.png", + "scale" : "3x" + }, + { + "size" : "60x60", + "idiom" : "iphone", + "filename" : "landmark_app_icon_120x120.png", + "scale" : "2x" + }, + { + "size" : "60x60", + "idiom" : "iphone", + "filename" : "landmark_app_icon_180x180.png", + "scale" : "3x" + }, + { + "idiom" : "ipad", + "size" : "20x20", + "scale" : "1x" + }, + { + "size" : "20x20", + "idiom" : "ipad", + "filename" : "landmark_app_icon_40x40-2.png", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "29x29", + "scale" : "1x" + }, + { + "size" : "29x29", + "idiom" : "ipad", + "filename" : "landmark_app_icon_58x58-1.png", + "scale" : "2x" + }, + { + "size" : "40x40", + "idiom" : "ipad", + "filename" : "landmark_app_icon_40x40-1.png", + "scale" : "1x" + }, + { + "size" : "40x40", + "idiom" : "ipad", + "filename" : "landmark_app_icon_80x80.png", + "scale" : "2x" + }, + { + "size" : "76x76", + "idiom" : "ipad", + "filename" : "landmark_app_icon_76x76.png", + "scale" : "1x" + }, + { + "size" : "76x76", + "idiom" : "ipad", + "filename" : "landmark_app_icon_152x152.png", + "scale" : "2x" + }, + { + "size" : "83.5x83.5", + "idiom" : "ipad", + "filename" : "landmark_app_icon_167x167.png", + "scale" : "2x" + }, + { + "size" : "1024x1024", + "idiom" : "ios-marketing", + "filename" : "landmark_app_icon_1024x1024.png", + "scale" : "1x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Examples/AnimatingViewsAndTransitions/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_1024x1024.png b/Examples/AnimatingViewsAndTransitions/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_1024x1024.png new file mode 100755 index 0000000..00d81c1 Binary files /dev/null and b/Examples/AnimatingViewsAndTransitions/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_1024x1024.png differ diff --git a/Examples/AnimatingViewsAndTransitions/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_120x120-1.png b/Examples/AnimatingViewsAndTransitions/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_120x120-1.png new file mode 100755 index 0000000..d382b8b Binary files /dev/null and b/Examples/AnimatingViewsAndTransitions/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_120x120-1.png differ diff --git a/Examples/AnimatingViewsAndTransitions/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_120x120.png b/Examples/AnimatingViewsAndTransitions/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_120x120.png new file mode 100755 index 0000000..d382b8b Binary files /dev/null and b/Examples/AnimatingViewsAndTransitions/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_120x120.png differ diff --git a/Examples/AnimatingViewsAndTransitions/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_152x152.png b/Examples/AnimatingViewsAndTransitions/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_152x152.png new file mode 100755 index 0000000..11057f8 Binary files /dev/null and b/Examples/AnimatingViewsAndTransitions/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_152x152.png differ diff --git a/Examples/AnimatingViewsAndTransitions/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_167x167.png b/Examples/AnimatingViewsAndTransitions/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_167x167.png new file mode 100755 index 0000000..f73bc26 Binary files /dev/null and b/Examples/AnimatingViewsAndTransitions/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_167x167.png differ diff --git a/Examples/AnimatingViewsAndTransitions/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_180x180.png b/Examples/AnimatingViewsAndTransitions/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_180x180.png new file mode 100755 index 0000000..b02738c Binary files /dev/null and b/Examples/AnimatingViewsAndTransitions/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_180x180.png differ diff --git a/Examples/AnimatingViewsAndTransitions/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_40x40-1.png b/Examples/AnimatingViewsAndTransitions/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_40x40-1.png new file mode 100755 index 0000000..abaff0e Binary files /dev/null and b/Examples/AnimatingViewsAndTransitions/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_40x40-1.png differ diff --git a/Examples/AnimatingViewsAndTransitions/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_40x40-2.png b/Examples/AnimatingViewsAndTransitions/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_40x40-2.png new file mode 100755 index 0000000..abaff0e Binary files /dev/null and b/Examples/AnimatingViewsAndTransitions/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_40x40-2.png differ diff --git a/Examples/AnimatingViewsAndTransitions/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_40x40.png b/Examples/AnimatingViewsAndTransitions/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_40x40.png new file mode 100755 index 0000000..abaff0e Binary files /dev/null and b/Examples/AnimatingViewsAndTransitions/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_40x40.png differ diff --git a/Examples/AnimatingViewsAndTransitions/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_58x58-1.png b/Examples/AnimatingViewsAndTransitions/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_58x58-1.png new file mode 100755 index 0000000..cf7c73d Binary files /dev/null and b/Examples/AnimatingViewsAndTransitions/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_58x58-1.png differ diff --git a/Examples/AnimatingViewsAndTransitions/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_58x58.png b/Examples/AnimatingViewsAndTransitions/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_58x58.png new file mode 100755 index 0000000..cf7c73d Binary files /dev/null and b/Examples/AnimatingViewsAndTransitions/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_58x58.png differ diff --git a/Examples/AnimatingViewsAndTransitions/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_76x76.png b/Examples/AnimatingViewsAndTransitions/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_76x76.png new file mode 100755 index 0000000..3eff85b Binary files /dev/null and b/Examples/AnimatingViewsAndTransitions/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_76x76.png differ diff --git a/Examples/AnimatingViewsAndTransitions/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_80x80-1.png b/Examples/AnimatingViewsAndTransitions/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_80x80-1.png new file mode 100755 index 0000000..6f33f66 Binary files /dev/null and b/Examples/AnimatingViewsAndTransitions/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_80x80-1.png differ diff --git a/Examples/AnimatingViewsAndTransitions/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_80x80.png b/Examples/AnimatingViewsAndTransitions/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_80x80.png new file mode 100755 index 0000000..6f33f66 Binary files /dev/null and b/Examples/AnimatingViewsAndTransitions/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_80x80.png differ diff --git a/Examples/AnimatingViewsAndTransitions/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_87x87.png b/Examples/AnimatingViewsAndTransitions/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_87x87.png new file mode 100755 index 0000000..9e1616c Binary files /dev/null and b/Examples/AnimatingViewsAndTransitions/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_87x87.png differ diff --git a/Examples/AnimatingViewsAndTransitions/StartingPoint/Landmarks/Landmarks/Assets.xcassets/Contents.json b/Examples/AnimatingViewsAndTransitions/StartingPoint/Landmarks/Landmarks/Assets.xcassets/Contents.json new file mode 100755 index 0000000..da4a164 --- /dev/null +++ b/Examples/AnimatingViewsAndTransitions/StartingPoint/Landmarks/Landmarks/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Examples/AnimatingViewsAndTransitions/StartingPoint/Landmarks/Landmarks/Assets.xcassets/turtlerock.imageset/Contents.json b/Examples/AnimatingViewsAndTransitions/StartingPoint/Landmarks/Landmarks/Assets.xcassets/turtlerock.imageset/Contents.json new file mode 100755 index 0000000..5bfd7bf --- /dev/null +++ b/Examples/AnimatingViewsAndTransitions/StartingPoint/Landmarks/Landmarks/Assets.xcassets/turtlerock.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "turtlerock.jpg", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Examples/AnimatingViewsAndTransitions/StartingPoint/Landmarks/Landmarks/Assets.xcassets/turtlerock.imageset/turtlerock.jpg b/Examples/AnimatingViewsAndTransitions/StartingPoint/Landmarks/Landmarks/Assets.xcassets/turtlerock.imageset/turtlerock.jpg new file mode 100755 index 0000000..68bcd3e Binary files /dev/null and b/Examples/AnimatingViewsAndTransitions/StartingPoint/Landmarks/Landmarks/Assets.xcassets/turtlerock.imageset/turtlerock.jpg differ diff --git a/Examples/AnimatingViewsAndTransitions/StartingPoint/Landmarks/Landmarks/Base.lproj/LaunchScreen.storyboard b/Examples/AnimatingViewsAndTransitions/StartingPoint/Landmarks/Landmarks/Base.lproj/LaunchScreen.storyboard new file mode 100755 index 0000000..865e932 --- /dev/null +++ b/Examples/AnimatingViewsAndTransitions/StartingPoint/Landmarks/Landmarks/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Examples/AnimatingViewsAndTransitions/StartingPoint/Landmarks/Landmarks/HexagonParameters.swift b/Examples/AnimatingViewsAndTransitions/StartingPoint/Landmarks/Landmarks/HexagonParameters.swift new file mode 100755 index 0000000..8decba4 --- /dev/null +++ b/Examples/AnimatingViewsAndTransitions/StartingPoint/Landmarks/Landmarks/HexagonParameters.swift @@ -0,0 +1,57 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +Size, position, and other information used to draw a badge. +*/ + +import SwiftUI + +struct HexagonParameters { + struct Segment { + let useWidth: (CGFloat, CGFloat, CGFloat) + let xFactors: (CGFloat, CGFloat, CGFloat) + let useHeight: (CGFloat, CGFloat, CGFloat) + let yFactors: (CGFloat, CGFloat, CGFloat) + } + + static let adjustment: CGFloat = 0.085 + static let points = [ + Segment( + useWidth: (1.00, 1.00, 1.00), + xFactors: (0.60, 0.40, 0.50), + useHeight: (1.00, 1.00, 0.00), + yFactors: (0.05, 0.05, 0.00) + ), + Segment( + useWidth: (1.00, 1.00, 0.00), + xFactors: (0.05, 0.00, 0.00), + useHeight: (1.00, 1.00, 1.00), + yFactors: (0.20 + adjustment, 0.30 + adjustment, 0.25 + adjustment) + ), + Segment( + useWidth: (1.00, 1.00, 0.00), + xFactors: (0.00, 0.05, 0.00), + useHeight: (1.00, 1.00, 1.00), + yFactors: (0.70 - adjustment, 0.80 - adjustment, 0.75 - adjustment) + ), + Segment( + useWidth: (1.00, 1.00, 1.00), + xFactors: (0.40, 0.60, 0.50), + useHeight: (1.00, 1.00, 1.00), + yFactors: (0.95, 0.95, 1.00) + ), + Segment( + useWidth: (1.00, 1.00, 1.00), + xFactors: (0.95, 1.00, 1.00), + useHeight: (1.00, 1.00, 1.00), + yFactors: (0.80 - adjustment, 0.70 - adjustment, 0.75 - adjustment) + ), + Segment( + useWidth: (1.00, 1.00, 1.00), + xFactors: (1.00, 0.95, 1.00), + useHeight: (1.00, 1.00, 1.00), + yFactors: (0.30 + adjustment, 0.20 + adjustment, 0.25 + adjustment) + ) + ] +} diff --git a/Examples/AnimatingViewsAndTransitions/StartingPoint/Landmarks/Landmarks/HikeDetail.swift b/Examples/AnimatingViewsAndTransitions/StartingPoint/Landmarks/Landmarks/HikeDetail.swift new file mode 100755 index 0000000..3406a6d --- /dev/null +++ b/Examples/AnimatingViewsAndTransitions/StartingPoint/Landmarks/Landmarks/HikeDetail.swift @@ -0,0 +1,49 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +A view showing the details for a hike. +*/ + +import SwiftUI + +struct HikeDetail: View { + let hike: Hike + @State var dataToShow = \Hike.Observation.elevation + + var buttons = [ + ("Elevation", \Hike.Observation.elevation), + ("Heart Rate", \Hike.Observation.heartRate), + ("Pace", \Hike.Observation.pace), + ] + + var body: some View { + return VStack { + HikeGraph(hike: hike, path: dataToShow) + .frame(height: 200, alignment: .center) + + HStack(spacing: 25) { + ForEach(buttons.identified(by: \.0)) { value in + Button(action: { + self.dataToShow = value.1 + }) { + Text(verbatim: value.0) + .font(.system(size: 15)) + .color(value.1 == self.dataToShow + ? Color.gray + : Color.accentColor) + .animation(nil) + } + } + } + } + } +} + +#if DEBUG +struct HikeDetail_Previews: PreviewProvider { + static var previews: some View { + HikeDetail(hike: hikeData[0]) + } +} +#endif diff --git a/Examples/AnimatingViewsAndTransitions/StartingPoint/Landmarks/Landmarks/HikeView.swift b/Examples/AnimatingViewsAndTransitions/StartingPoint/Landmarks/Landmarks/HikeView.swift new file mode 100755 index 0000000..ca1f218 --- /dev/null +++ b/Examples/AnimatingViewsAndTransitions/StartingPoint/Landmarks/Landmarks/HikeView.swift @@ -0,0 +1,56 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +A view displaying inforamtion about a hike, including an elevation graph. +*/ + +import SwiftUI + +struct HikeView: View { + var hike: Hike + @State private var showDetail = false + + var body: some View { + VStack { + HStack { + HikeGraph(hike: hike, path: \.elevation) + .frame(width: 50, height: 30) + .animation(nil) + + VStack(alignment: .leading) { + Text(verbatim: hike.name) + .font(.headline) + Text(verbatim: hike.distanceText) + } + + Spacer() + + Button(action: { + self.showDetail.toggle() + }) { + Image(systemName: "chevron.right.circle") + .imageScale(.large) + .rotationEffect(.degrees(showDetail ? 90 : 0)) + .padding() + } + } + + if showDetail { + HikeDetail(hike: hike) + } + } + } +} + +#if DEBUG +struct HikeView_Previews: PreviewProvider { + static var previews: some View { + VStack { + HikeView(hike: hikeData[0]) + .padding() + Spacer() + } + } +} +#endif diff --git a/Examples/AnimatingViewsAndTransitions/StartingPoint/Landmarks/Landmarks/Info.plist b/Examples/AnimatingViewsAndTransitions/StartingPoint/Landmarks/Landmarks/Info.plist new file mode 100755 index 0000000..e8bb4c6 --- /dev/null +++ b/Examples/AnimatingViewsAndTransitions/StartingPoint/Landmarks/Landmarks/Info.plist @@ -0,0 +1,62 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + $(PRODUCT_BUNDLE_PACKAGE_TYPE) + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1 + LSRequiresIPhoneOS + + UIApplicationSceneManifest + + UIApplicationSupportsMultipleScenes + + UISceneConfigurations + + UIWindowSceneSessionRoleApplication + + + UILaunchStoryboardName + LaunchScreen + UISceneConfigurationName + Default Configuration + UISceneDelegateClassName + $(PRODUCT_MODULE_NAME).SceneDelegate + + + + + UILaunchStoryboardName + LaunchScreen + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/Examples/AnimatingViewsAndTransitions/StartingPoint/Landmarks/Landmarks/LandmarkDetail.swift b/Examples/AnimatingViewsAndTransitions/StartingPoint/Landmarks/Landmarks/LandmarkDetail.swift new file mode 100755 index 0000000..6c290a3 --- /dev/null +++ b/Examples/AnimatingViewsAndTransitions/StartingPoint/Landmarks/Landmarks/LandmarkDetail.swift @@ -0,0 +1,71 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +A view showing the details for a landmark. +*/ + +import SwiftUI + +struct LandmarkDetail: View { + @EnvironmentObject var userData: UserData + var landmark: Landmark + + var landmarkIndex: Int { + userData.landmarks.firstIndex(where: { $0.id == landmark.id })! + } + + var body: some View { + VStack { + MapView(coordinate: landmark.locationCoordinate) + .edgesIgnoringSafeArea(.top) + .frame(height: 300) + + CircleImage(image: landmark.image(forSize: 250)) + .offset(x: 0, y: -130) + .padding(.bottom, -130) + + VStack(alignment: .leading) { + HStack { + Text(verbatim: landmark.name) + .font(.title) + + Button(action: { + self.userData.landmarks[self.landmarkIndex] + .isFavorite.toggle() + }) { + if self.userData.landmarks[self.landmarkIndex] + .isFavorite { + Image(systemName: "star.fill") + .foregroundColor(Color.yellow) + } else { + Image(systemName: "star") + .foregroundColor(Color.gray) + } + } + } + + HStack(alignment: .top) { + Text(verbatim: landmark.park) + .font(.subheadline) + Spacer() + Text(verbatim: landmark.state) + .font(.subheadline) + } + } + .padding() + + Spacer() + } + } +} + +#if DEBUG +struct LandmarkDetail_Preview: PreviewProvider { + static var previews: some View { + let userData = UserData() + return LandmarkDetail(landmark: userData.landmarks[0]) + .environmentObject(userData) + } +} +#endif diff --git a/Examples/AnimatingViewsAndTransitions/StartingPoint/Landmarks/Landmarks/LandmarkList.swift b/Examples/AnimatingViewsAndTransitions/StartingPoint/Landmarks/Landmarks/LandmarkList.swift new file mode 100755 index 0000000..c17b5f3 --- /dev/null +++ b/Examples/AnimatingViewsAndTransitions/StartingPoint/Landmarks/Landmarks/LandmarkList.swift @@ -0,0 +1,45 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +A view showing a list of landmarks. +*/ + +import SwiftUI + +struct LandmarkList: View { + @EnvironmentObject private var userData: UserData + + var body: some View { + NavigationView { + List { + Toggle(isOn: $userData.showFavoritesOnly) { + Text("Show Favorites Only") + } + + ForEach(userData.landmarks) { landmark in + if !self.userData.showFavoritesOnly || landmark.isFavorite { + NavigationButton( + destination: LandmarkDetail(landmark: landmark)) { + LandmarkRow(landmark: landmark) + } + } + } + } + .navigationBarTitle(Text("Landmarks"), displayMode: .large) + } + } +} + +#if DEBUG +struct LandmarksList_Previews: PreviewProvider { + static var previews: some View { + ForEach(["iPhone SE", "iPhone XS Max"].identified(by: \.self)) { deviceName in + LandmarkList() + .previewDevice(PreviewDevice(rawValue: deviceName)) + .previewDisplayName(deviceName) + } + .environmentObject(UserData()) + } +} +#endif diff --git a/Examples/AnimatingViewsAndTransitions/StartingPoint/Landmarks/Landmarks/Models/Data.swift b/Examples/AnimatingViewsAndTransitions/StartingPoint/Landmarks/Landmarks/Models/Data.swift new file mode 100755 index 0000000..248d3b2 --- /dev/null +++ b/Examples/AnimatingViewsAndTransitions/StartingPoint/Landmarks/Landmarks/Models/Data.swift @@ -0,0 +1,95 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +Helpers for loading images and data. +*/ + +import Foundation +import CoreLocation +import UIKit +import SwiftUI + +let landmarkData: [Landmark] = load("landmarkData.json") +let hikeData: [Hike] = load("hikeData.json") + +func load(_ filename: String, as type: T.Type = T.self) -> T { + let data: Data + + guard let file = Bundle.main.url(forResource: filename, withExtension: nil) + else { + fatalError("Couldn't find \(filename) in main bundle.") + } + + do { + data = try Data(contentsOf: file) + } catch { + fatalError("Couldn't load \(filename) from main bundle:\n\(error)") + } + + do { + let decoder = JSONDecoder() + return try decoder.decode(T.self, from: data) + } catch { + fatalError("Couldn't parse \(filename) as \(T.self):\n\(error)") + } +} + +final class ImageStore { + fileprivate typealias _ImageDictionary = [String: [Int: CGImage]] + fileprivate var images: _ImageDictionary = [:] + + fileprivate static var originalSize = 250 + fileprivate static var scale = 2 + + static var shared = ImageStore() + + func image(name: String, size: Int) -> Image { + let index = _guaranteeInitialImage(name: name) + + let sizedImage = images.values[index][size] + ?? _sizeImage(images.values[index][ImageStore.originalSize]!, to: size * ImageStore.scale) + images.values[index][size] = sizedImage + + return Image(sizedImage, scale: Length(ImageStore.scale), label: Text(verbatim: name)) + } + + fileprivate func _guaranteeInitialImage(name: String) -> _ImageDictionary.Index { + if let index = images.index(forKey: name) { return index } + + guard + let url = Bundle.main.url(forResource: name, withExtension: "jpg"), + let imageSource = CGImageSourceCreateWithURL(url as NSURL, nil), + let image = CGImageSourceCreateImageAtIndex(imageSource, 0, nil) + else { + fatalError("Couldn't load image \(name).jpg from main bundle.") + } + + images[name] = [ImageStore.originalSize: image] + return images.index(forKey: name)! + } + + fileprivate func _sizeImage(_ image: CGImage, to size: Int) -> CGImage { + guard + let colorSpace = image.colorSpace, + let context = CGContext( + data: nil, + width: size, height: size, + bitsPerComponent: image.bitsPerComponent, + bytesPerRow: image.bytesPerRow, + space: colorSpace, + bitmapInfo: image.bitmapInfo.rawValue) + else { + fatalError("Couldn't create graphics context.") + } + context.interpolationQuality = .high + context.draw(image, in: CGRect(x: 0, y: 0, width: size, height: size)) + + if let sizedImage = context.makeImage() { + return sizedImage + } else { + fatalError("Couldn't resize image.") + } + } +} + diff --git a/Examples/AnimatingViewsAndTransitions/StartingPoint/Landmarks/Landmarks/Models/Hike.swift b/Examples/AnimatingViewsAndTransitions/StartingPoint/Landmarks/Landmarks/Models/Hike.swift new file mode 100755 index 0000000..dfd2bb8 --- /dev/null +++ b/Examples/AnimatingViewsAndTransitions/StartingPoint/Landmarks/Landmarks/Models/Hike.swift @@ -0,0 +1,31 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +The model for a hike. +*/ + +import SwiftUI + +struct Hike: Codable, Hashable, Identifiable { + var name: String + var id: Int + var distance: Double + var difficulty: Int + var observations: [Observation] + + static var formatter = LengthFormatter() + + var distanceText: String { + return Hike.formatter + .string(fromValue: distance, unit: .kilometer) + } + + struct Observation: Codable, Hashable { + var distanceFromStart: Double + + var elevation: Range + var pace: Range + var heartRate: Range + } +} diff --git a/Examples/AnimatingViewsAndTransitions/StartingPoint/Landmarks/Landmarks/Models/Landmark.swift b/Examples/AnimatingViewsAndTransitions/StartingPoint/Landmarks/Landmarks/Models/Landmark.swift new file mode 100755 index 0000000..79b9aa4 --- /dev/null +++ b/Examples/AnimatingViewsAndTransitions/StartingPoint/Landmarks/Landmarks/Models/Landmark.swift @@ -0,0 +1,42 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +The model for an individual landmark. +*/ + +import SwiftUI +import CoreLocation + +struct Landmark: Hashable, Codable, Identifiable { + var id: Int + var name: String + fileprivate var imageName: String + fileprivate var coordinates: Coordinates + var state: String + var park: String + var category: Category + var isFavorite: Bool + + var locationCoordinate: CLLocationCoordinate2D { + CLLocationCoordinate2D( + latitude: coordinates.latitude, + longitude: coordinates.longitude) + } + + func image(forSize size: Int) -> Image { + ImageStore.shared.image(name: imageName, size: size) + } + + enum Category: String, CaseIterable, Codable, Hashable { + case featured = "Featured" + case lakes = "Lakes" + case rivers = "Rivers" + case mountains = "Mountains" + } +} + +struct Coordinates: Hashable, Codable { + var latitude: Double + var longitude: Double +} diff --git a/Examples/AnimatingViewsAndTransitions/StartingPoint/Landmarks/Landmarks/Models/UserData.swift b/Examples/AnimatingViewsAndTransitions/StartingPoint/Landmarks/Landmarks/Models/UserData.swift new file mode 100755 index 0000000..db31fb0 --- /dev/null +++ b/Examples/AnimatingViewsAndTransitions/StartingPoint/Landmarks/Landmarks/Models/UserData.swift @@ -0,0 +1,25 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +A model object that stores app data. +*/ + +import Combine +import SwiftUI + +final class UserData: BindableObject { + let didChange = PassthroughSubject() + + var showFavoritesOnly = false { + didSet { + didChange.send(self) + } + } + + var landmarks = landmarkData { + didSet { + didChange.send(self) + } + } +} diff --git a/Examples/AnimatingViewsAndTransitions/StartingPoint/Landmarks/Landmarks/Preview Content/Preview Assets.xcassets/Contents.json b/Examples/AnimatingViewsAndTransitions/StartingPoint/Landmarks/Landmarks/Preview Content/Preview Assets.xcassets/Contents.json new file mode 100755 index 0000000..da4a164 --- /dev/null +++ b/Examples/AnimatingViewsAndTransitions/StartingPoint/Landmarks/Landmarks/Preview Content/Preview Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Examples/AnimatingViewsAndTransitions/StartingPoint/Landmarks/Landmarks/Resources/charleyrivers.jpg b/Examples/AnimatingViewsAndTransitions/StartingPoint/Landmarks/Landmarks/Resources/charleyrivers.jpg new file mode 100755 index 0000000..17ff44b Binary files /dev/null and b/Examples/AnimatingViewsAndTransitions/StartingPoint/Landmarks/Landmarks/Resources/charleyrivers.jpg differ diff --git a/Examples/AnimatingViewsAndTransitions/StartingPoint/Landmarks/Landmarks/Resources/chilkoottrail.jpg b/Examples/AnimatingViewsAndTransitions/StartingPoint/Landmarks/Landmarks/Resources/chilkoottrail.jpg new file mode 100755 index 0000000..e7f805e Binary files /dev/null and b/Examples/AnimatingViewsAndTransitions/StartingPoint/Landmarks/Landmarks/Resources/chilkoottrail.jpg differ diff --git a/Examples/AnimatingViewsAndTransitions/StartingPoint/Landmarks/Landmarks/Resources/chincoteague.jpg b/Examples/AnimatingViewsAndTransitions/StartingPoint/Landmarks/Landmarks/Resources/chincoteague.jpg new file mode 100755 index 0000000..5f47986 Binary files /dev/null and b/Examples/AnimatingViewsAndTransitions/StartingPoint/Landmarks/Landmarks/Resources/chincoteague.jpg differ diff --git a/Examples/AnimatingViewsAndTransitions/StartingPoint/Landmarks/Landmarks/Resources/hiddenlake.jpg b/Examples/AnimatingViewsAndTransitions/StartingPoint/Landmarks/Landmarks/Resources/hiddenlake.jpg new file mode 100755 index 0000000..d8e804c Binary files /dev/null and b/Examples/AnimatingViewsAndTransitions/StartingPoint/Landmarks/Landmarks/Resources/hiddenlake.jpg differ diff --git a/Examples/AnimatingViewsAndTransitions/StartingPoint/Landmarks/Landmarks/Resources/hikeData.json b/Examples/AnimatingViewsAndTransitions/StartingPoint/Landmarks/Landmarks/Resources/hikeData.json new file mode 100755 index 0000000..3fb1e96 --- /dev/null +++ b/Examples/AnimatingViewsAndTransitions/StartingPoint/Landmarks/Landmarks/Resources/hikeData.json @@ -0,0 +1,1882 @@ +[ + { + "name":"Lonesome Ridge Trail", + "id":1001, + "distance":4.5, + "difficulty":3, + "observations":[ + { + "elevation":[ + 291.65263635636268, + 309.26016677925196 + ], + "pace":[ + 396.08716481908732, + 403.68937873525232 + ], + "heartRate":[ + 117.16351898665887, + 121.95815455919609 + ], + "distanceFromStart":0 + }, + { + "elevation":[ + 299.24001936628116, + 317.44584350790012 + ], + "pace":[ + 380.19020240756623, + 395.3978319010256 + ], + "heartRate":[ + 117.6410892152911, + 124.82185220506081 + ], + "distanceFromStart":0.375 + }, + { + "elevation":[ + 303.62145464574394, + 336.05569457646544 + ], + "pace":[ + 380.55927782266116, + 397.60789726832775 + ], + "heartRate":[ + 121.52696452049059, + 127.31525441110122 + ], + "distanceFromStart":0.75 + }, + { + "elevation":[ + 319.90393365162629, + 346.26966025518789 + ], + "pace":[ + 357.94116421258531, + 398.0750288648062 + ], + "heartRate":[ + 123.75908585923588, + 132.77069404486801 + ], + "distanceFromStart":1.125 + }, + { + "elevation":[ + 354.17104439267905, + 403.57031216972939 + ], + "pace":[ + 335.07385149392701, + 397.82674381875808 + ], + "heartRate":[ + 130.8235194572915, + 140.55700591418218 + ], + "distanceFromStart":1.5 + }, + { + "elevation":[ + 357.42992871175124, + 385.92155620623635 + ], + "pace":[ + 395.16168913839374, + 404.60294066527558 + ], + "heartRate":[ + 131.5456052446734, + 134.65984504627627 + ], + "distanceFromStart":1.875 + }, + { + "elevation":[ + 345.47736721935661, + 363.18776661379422 + ], + "pace":[ + 340.82303041339082, + 404.71689228682374 + ], + "heartRate":[ + 125.1949698433959, + 131.31354363122026 + ], + "distanceFromStart":2.25 + }, + { + "elevation":[ + 346.23343025200535, + 497.23376445462401 + ], + "pace":[ + 261.27629148816021, + 331.68516208719467 + ], + "heartRate":[ + 131.67810544238606, + 154.26779645311458 + ], + "distanceFromStart":2.625 + }, + { + "elevation":[ + 491.57378483134391, + 547.49535224251053 + ], + "pace":[ + 296.05298644112088, + 401.14092967732398 + ], + "heartRate":[ + 151.36398089694217, + 166.20454793289232 + ], + "distanceFromStart":3 + }, + { + "elevation":[ + 472.06803233416338, + 531.92570520228401 + ], + "pace":[ + 395.50830663514012, + 401.67837917543591 + ], + "heartRate":[ + 134.41798110234078, + 151.90886697564241 + ], + "distanceFromStart":3.375 + }, + { + "elevation":[ + 339.81419476005283, + 461.03832527824829 + ], + "pace":[ + 395.31160487975183, + 404.49550455974907 + ], + "heartRate":[ + 129.97753472415462, + 138.13531094848992 + ], + "distanceFromStart":3.75 + }, + { + "elevation":[ + 303.1495508565697, + 342.3532820173541 + ], + "pace":[ + 395.02844559698116, + 402.65878340653796 + ], + "heartRate":[ + 127.72304232462609, + 133.26322270764186 + ], + "distanceFromStart":4.125 + } + ] + }, + { + "name":"Lonesome Ridge Trail", + "id":1002, + "distance":4.5, + "difficulty":3, + "observations":[ + { + "elevation":[ + 291.65263635636268, + 309.26016677925196 + ], + "pace":[ + 396.08716481908732, + 403.68937873525232 + ], + "heartRate":[ + 117.16351898665887, + 121.95815455919609 + ], + "distanceFromStart":0 + }, + { + "elevation":[ + 299.24001936628116, + 317.44584350790012 + ], + "pace":[ + 380.19020240756623, + 395.3978319010256 + ], + "heartRate":[ + 117.6410892152911, + 124.82185220506081 + ], + "distanceFromStart":0.375 + }, + { + "elevation":[ + 303.62145464574394, + 336.05569457646544 + ], + "pace":[ + 380.55927782266116, + 397.60789726832775 + ], + "heartRate":[ + 121.52696452049059, + 127.31525441110122 + ], + "distanceFromStart":0.75 + }, + { + "elevation":[ + 319.90393365162629, + 346.26966025518789 + ], + "pace":[ + 357.94116421258531, + 398.0750288648062 + ], + "heartRate":[ + 123.75908585923588, + 132.77069404486801 + ], + "distanceFromStart":1.125 + }, + { + "elevation":[ + 354.17104439267905, + 403.57031216972939 + ], + "pace":[ + 335.07385149392701, + 397.82674381875808 + ], + "heartRate":[ + 130.8235194572915, + 140.55700591418218 + ], + "distanceFromStart":1.5 + }, + { + "elevation":[ + 357.42992871175124, + 385.92155620623635 + ], + "pace":[ + 395.16168913839374, + 404.60294066527558 + ], + "heartRate":[ + 131.5456052446734, + 134.65984504627627 + ], + "distanceFromStart":1.875 + }, + { + "elevation":[ + 345.47736721935661, + 363.18776661379422 + ], + "pace":[ + 340.82303041339082, + 404.71689228682374 + ], + "heartRate":[ + 125.1949698433959, + 131.31354363122026 + ], + "distanceFromStart":2.25 + }, + { + "elevation":[ + 346.23343025200535, + 497.23376445462401 + ], + "pace":[ + 261.27629148816021, + 331.68516208719467 + ], + "heartRate":[ + 131.67810544238606, + 154.26779645311458 + ], + "distanceFromStart":2.625 + }, + { + "elevation":[ + 491.57378483134391, + 547.49535224251053 + ], + "pace":[ + 296.05298644112088, + 401.14092967732398 + ], + "heartRate":[ + 151.36398089694217, + 166.20454793289232 + ], + "distanceFromStart":3 + }, + { + "elevation":[ + 472.06803233416338, + 531.92570520228401 + ], + "pace":[ + 395.50830663514012, + 401.67837917543591 + ], + "heartRate":[ + 134.41798110234078, + 151.90886697564241 + ], + "distanceFromStart":3.375 + }, + { + "elevation":[ + 339.81419476005283, + 461.03832527824829 + ], + "pace":[ + 395.31160487975183, + 404.49550455974907 + ], + "heartRate":[ + 129.97753472415462, + 138.13531094848992 + ], + "distanceFromStart":3.75 + }, + { + "elevation":[ + 303.1495508565697, + 342.3532820173541 + ], + "pace":[ + 395.02844559698116, + 402.65878340653796 + ], + "heartRate":[ + 127.72304232462609, + 133.26322270764186 + ], + "distanceFromStart":4.125 + } + ] + }, + { + "name":"Lonesome Ridge Trail", + "id":1003, + "distance":4.5, + "difficulty":3, + "observations":[ + { + "elevation":[ + 291.65263635636268, + 309.26016677925196 + ], + "pace":[ + 396.08716481908732, + 403.68937873525232 + ], + "heartRate":[ + 117.16351898665887, + 121.95815455919609 + ], + "distanceFromStart":0 + }, + { + "elevation":[ + 299.24001936628116, + 317.44584350790012 + ], + "pace":[ + 380.19020240756623, + 395.3978319010256 + ], + "heartRate":[ + 117.6410892152911, + 124.82185220506081 + ], + "distanceFromStart":0.375 + }, + { + "elevation":[ + 303.62145464574394, + 336.05569457646544 + ], + "pace":[ + 380.55927782266116, + 397.60789726832775 + ], + "heartRate":[ + 121.52696452049059, + 127.31525441110122 + ], + "distanceFromStart":0.75 + }, + { + "elevation":[ + 319.90393365162629, + 346.26966025518789 + ], + "pace":[ + 357.94116421258531, + 398.0750288648062 + ], + "heartRate":[ + 123.75908585923588, + 132.77069404486801 + ], + "distanceFromStart":1.125 + }, + { + "elevation":[ + 354.17104439267905, + 403.57031216972939 + ], + "pace":[ + 335.07385149392701, + 397.82674381875808 + ], + "heartRate":[ + 130.8235194572915, + 140.55700591418218 + ], + "distanceFromStart":1.5 + }, + { + "elevation":[ + 357.42992871175124, + 385.92155620623635 + ], + "pace":[ + 395.16168913839374, + 404.60294066527558 + ], + "heartRate":[ + 131.5456052446734, + 134.65984504627627 + ], + "distanceFromStart":1.875 + }, + { + "elevation":[ + 345.47736721935661, + 363.18776661379422 + ], + "pace":[ + 340.82303041339082, + 404.71689228682374 + ], + "heartRate":[ + 125.1949698433959, + 131.31354363122026 + ], + "distanceFromStart":2.25 + }, + { + "elevation":[ + 346.23343025200535, + 497.23376445462401 + ], + "pace":[ + 261.27629148816021, + 331.68516208719467 + ], + "heartRate":[ + 131.67810544238606, + 154.26779645311458 + ], + "distanceFromStart":2.625 + }, + { + "elevation":[ + 491.57378483134391, + 547.49535224251053 + ], + "pace":[ + 296.05298644112088, + 401.14092967732398 + ], + "heartRate":[ + 151.36398089694217, + 166.20454793289232 + ], + "distanceFromStart":3 + }, + { + "elevation":[ + 472.06803233416338, + 531.92570520228401 + ], + "pace":[ + 395.50830663514012, + 401.67837917543591 + ], + "heartRate":[ + 134.41798110234078, + 151.90886697564241 + ], + "distanceFromStart":3.375 + }, + { + "elevation":[ + 339.81419476005283, + 461.03832527824829 + ], + "pace":[ + 395.31160487975183, + 404.49550455974907 + ], + "heartRate":[ + 129.97753472415462, + 138.13531094848992 + ], + "distanceFromStart":3.75 + }, + { + "elevation":[ + 303.1495508565697, + 342.3532820173541 + ], + "pace":[ + 395.02844559698116, + 402.65878340653796 + ], + "heartRate":[ + 127.72304232462609, + 133.26322270764186 + ], + "distanceFromStart":4.125 + } + ] + }, + { + "name":"Lonesome Ridge Trail", + "id":1004, + "distance":4.5, + "difficulty":3, + "observations":[ + { + "elevation":[ + 291.65263635636268, + 309.26016677925196 + ], + "pace":[ + 396.08716481908732, + 403.68937873525232 + ], + "heartRate":[ + 117.16351898665887, + 121.95815455919609 + ], + "distanceFromStart":0 + }, + { + "elevation":[ + 299.24001936628116, + 317.44584350790012 + ], + "pace":[ + 380.19020240756623, + 395.3978319010256 + ], + "heartRate":[ + 117.6410892152911, + 124.82185220506081 + ], + "distanceFromStart":0.375 + }, + { + "elevation":[ + 303.62145464574394, + 336.05569457646544 + ], + "pace":[ + 380.55927782266116, + 397.60789726832775 + ], + "heartRate":[ + 121.52696452049059, + 127.31525441110122 + ], + "distanceFromStart":0.75 + }, + { + "elevation":[ + 319.90393365162629, + 346.26966025518789 + ], + "pace":[ + 357.94116421258531, + 398.0750288648062 + ], + "heartRate":[ + 123.75908585923588, + 132.77069404486801 + ], + "distanceFromStart":1.125 + }, + { + "elevation":[ + 354.17104439267905, + 403.57031216972939 + ], + "pace":[ + 335.07385149392701, + 397.82674381875808 + ], + "heartRate":[ + 130.8235194572915, + 140.55700591418218 + ], + "distanceFromStart":1.5 + }, + { + "elevation":[ + 357.42992871175124, + 385.92155620623635 + ], + "pace":[ + 395.16168913839374, + 404.60294066527558 + ], + "heartRate":[ + 131.5456052446734, + 134.65984504627627 + ], + "distanceFromStart":1.875 + }, + { + "elevation":[ + 345.47736721935661, + 363.18776661379422 + ], + "pace":[ + 340.82303041339082, + 404.71689228682374 + ], + "heartRate":[ + 125.1949698433959, + 131.31354363122026 + ], + "distanceFromStart":2.25 + }, + { + "elevation":[ + 346.23343025200535, + 497.23376445462401 + ], + "pace":[ + 261.27629148816021, + 331.68516208719467 + ], + "heartRate":[ + 131.67810544238606, + 154.26779645311458 + ], + "distanceFromStart":2.625 + }, + { + "elevation":[ + 491.57378483134391, + 547.49535224251053 + ], + "pace":[ + 296.05298644112088, + 401.14092967732398 + ], + "heartRate":[ + 151.36398089694217, + 166.20454793289232 + ], + "distanceFromStart":3 + }, + { + "elevation":[ + 472.06803233416338, + 531.92570520228401 + ], + "pace":[ + 395.50830663514012, + 401.67837917543591 + ], + "heartRate":[ + 134.41798110234078, + 151.90886697564241 + ], + "distanceFromStart":3.375 + }, + { + "elevation":[ + 339.81419476005283, + 461.03832527824829 + ], + "pace":[ + 395.31160487975183, + 404.49550455974907 + ], + "heartRate":[ + 129.97753472415462, + 138.13531094848992 + ], + "distanceFromStart":3.75 + }, + { + "elevation":[ + 303.1495508565697, + 342.3532820173541 + ], + "pace":[ + 395.02844559698116, + 402.65878340653796 + ], + "heartRate":[ + 127.72304232462609, + 133.26322270764186 + ], + "distanceFromStart":4.125 + } + ] + }, + { + "name":"Lonesome Ridge Trail", + "id":1005, + "distance":4.5, + "difficulty":3, + "observations":[ + { + "elevation":[ + 291.65263635636268, + 309.26016677925196 + ], + "pace":[ + 396.08716481908732, + 403.68937873525232 + ], + "heartRate":[ + 117.16351898665887, + 121.95815455919609 + ], + "distanceFromStart":0 + }, + { + "elevation":[ + 299.24001936628116, + 317.44584350790012 + ], + "pace":[ + 380.19020240756623, + 395.3978319010256 + ], + "heartRate":[ + 117.6410892152911, + 124.82185220506081 + ], + "distanceFromStart":0.375 + }, + { + "elevation":[ + 303.62145464574394, + 336.05569457646544 + ], + "pace":[ + 380.55927782266116, + 397.60789726832775 + ], + "heartRate":[ + 121.52696452049059, + 127.31525441110122 + ], + "distanceFromStart":0.75 + }, + { + "elevation":[ + 319.90393365162629, + 346.26966025518789 + ], + "pace":[ + 357.94116421258531, + 398.0750288648062 + ], + "heartRate":[ + 123.75908585923588, + 132.77069404486801 + ], + "distanceFromStart":1.125 + }, + { + "elevation":[ + 354.17104439267905, + 403.57031216972939 + ], + "pace":[ + 335.07385149392701, + 397.82674381875808 + ], + "heartRate":[ + 130.8235194572915, + 140.55700591418218 + ], + "distanceFromStart":1.5 + }, + { + "elevation":[ + 357.42992871175124, + 385.92155620623635 + ], + "pace":[ + 395.16168913839374, + 404.60294066527558 + ], + "heartRate":[ + 131.5456052446734, + 134.65984504627627 + ], + "distanceFromStart":1.875 + }, + { + "elevation":[ + 345.47736721935661, + 363.18776661379422 + ], + "pace":[ + 340.82303041339082, + 404.71689228682374 + ], + "heartRate":[ + 125.1949698433959, + 131.31354363122026 + ], + "distanceFromStart":2.25 + }, + { + "elevation":[ + 346.23343025200535, + 497.23376445462401 + ], + "pace":[ + 261.27629148816021, + 331.68516208719467 + ], + "heartRate":[ + 131.67810544238606, + 154.26779645311458 + ], + "distanceFromStart":2.625 + }, + { + "elevation":[ + 491.57378483134391, + 547.49535224251053 + ], + "pace":[ + 296.05298644112088, + 401.14092967732398 + ], + "heartRate":[ + 151.36398089694217, + 166.20454793289232 + ], + "distanceFromStart":3 + }, + { + "elevation":[ + 472.06803233416338, + 531.92570520228401 + ], + "pace":[ + 395.50830663514012, + 401.67837917543591 + ], + "heartRate":[ + 134.41798110234078, + 151.90886697564241 + ], + "distanceFromStart":3.375 + }, + { + "elevation":[ + 339.81419476005283, + 461.03832527824829 + ], + "pace":[ + 395.31160487975183, + 404.49550455974907 + ], + "heartRate":[ + 129.97753472415462, + 138.13531094848992 + ], + "distanceFromStart":3.75 + }, + { + "elevation":[ + 303.1495508565697, + 342.3532820173541 + ], + "pace":[ + 395.02844559698116, + 402.65878340653796 + ], + "heartRate":[ + 127.72304232462609, + 133.26322270764186 + ], + "distanceFromStart":4.125 + } + ] + }, + { + "name":"Lonesome Ridge Trail", + "id":1006, + "distance":4.5, + "difficulty":3, + "observations":[ + { + "elevation":[ + 291.65263635636268, + 309.26016677925196 + ], + "pace":[ + 396.08716481908732, + 403.68937873525232 + ], + "heartRate":[ + 117.16351898665887, + 121.95815455919609 + ], + "distanceFromStart":0 + }, + { + "elevation":[ + 299.24001936628116, + 317.44584350790012 + ], + "pace":[ + 380.19020240756623, + 395.3978319010256 + ], + "heartRate":[ + 117.6410892152911, + 124.82185220506081 + ], + "distanceFromStart":0.375 + }, + { + "elevation":[ + 303.62145464574394, + 336.05569457646544 + ], + "pace":[ + 380.55927782266116, + 397.60789726832775 + ], + "heartRate":[ + 121.52696452049059, + 127.31525441110122 + ], + "distanceFromStart":0.75 + }, + { + "elevation":[ + 319.90393365162629, + 346.26966025518789 + ], + "pace":[ + 357.94116421258531, + 398.0750288648062 + ], + "heartRate":[ + 123.75908585923588, + 132.77069404486801 + ], + "distanceFromStart":1.125 + }, + { + "elevation":[ + 354.17104439267905, + 403.57031216972939 + ], + "pace":[ + 335.07385149392701, + 397.82674381875808 + ], + "heartRate":[ + 130.8235194572915, + 140.55700591418218 + ], + "distanceFromStart":1.5 + }, + { + "elevation":[ + 357.42992871175124, + 385.92155620623635 + ], + "pace":[ + 395.16168913839374, + 404.60294066527558 + ], + "heartRate":[ + 131.5456052446734, + 134.65984504627627 + ], + "distanceFromStart":1.875 + }, + { + "elevation":[ + 345.47736721935661, + 363.18776661379422 + ], + "pace":[ + 340.82303041339082, + 404.71689228682374 + ], + "heartRate":[ + 125.1949698433959, + 131.31354363122026 + ], + "distanceFromStart":2.25 + }, + { + "elevation":[ + 346.23343025200535, + 497.23376445462401 + ], + "pace":[ + 261.27629148816021, + 331.68516208719467 + ], + "heartRate":[ + 131.67810544238606, + 154.26779645311458 + ], + "distanceFromStart":2.625 + }, + { + "elevation":[ + 491.57378483134391, + 547.49535224251053 + ], + "pace":[ + 296.05298644112088, + 401.14092967732398 + ], + "heartRate":[ + 151.36398089694217, + 166.20454793289232 + ], + "distanceFromStart":3 + }, + { + "elevation":[ + 472.06803233416338, + 531.92570520228401 + ], + "pace":[ + 395.50830663514012, + 401.67837917543591 + ], + "heartRate":[ + 134.41798110234078, + 151.90886697564241 + ], + "distanceFromStart":3.375 + }, + { + "elevation":[ + 339.81419476005283, + 461.03832527824829 + ], + "pace":[ + 395.31160487975183, + 404.49550455974907 + ], + "heartRate":[ + 129.97753472415462, + 138.13531094848992 + ], + "distanceFromStart":3.75 + }, + { + "elevation":[ + 303.1495508565697, + 342.3532820173541 + ], + "pace":[ + 395.02844559698116, + 402.65878340653796 + ], + "heartRate":[ + 127.72304232462609, + 133.26322270764186 + ], + "distanceFromStart":4.125 + } + ] + }, + { + "name":"Lonesome Ridge Trail", + "id":1007, + "distance":4.5, + "difficulty":3, + "observations":[ + { + "elevation":[ + 291.65263635636268, + 309.26016677925196 + ], + "pace":[ + 396.08716481908732, + 403.68937873525232 + ], + "heartRate":[ + 117.16351898665887, + 121.95815455919609 + ], + "distanceFromStart":0 + }, + { + "elevation":[ + 299.24001936628116, + 317.44584350790012 + ], + "pace":[ + 380.19020240756623, + 395.3978319010256 + ], + "heartRate":[ + 117.6410892152911, + 124.82185220506081 + ], + "distanceFromStart":0.375 + }, + { + "elevation":[ + 303.62145464574394, + 336.05569457646544 + ], + "pace":[ + 380.55927782266116, + 397.60789726832775 + ], + "heartRate":[ + 121.52696452049059, + 127.31525441110122 + ], + "distanceFromStart":0.75 + }, + { + "elevation":[ + 319.90393365162629, + 346.26966025518789 + ], + "pace":[ + 357.94116421258531, + 398.0750288648062 + ], + "heartRate":[ + 123.75908585923588, + 132.77069404486801 + ], + "distanceFromStart":1.125 + }, + { + "elevation":[ + 354.17104439267905, + 403.57031216972939 + ], + "pace":[ + 335.07385149392701, + 397.82674381875808 + ], + "heartRate":[ + 130.8235194572915, + 140.55700591418218 + ], + "distanceFromStart":1.5 + }, + { + "elevation":[ + 357.42992871175124, + 385.92155620623635 + ], + "pace":[ + 395.16168913839374, + 404.60294066527558 + ], + "heartRate":[ + 131.5456052446734, + 134.65984504627627 + ], + "distanceFromStart":1.875 + }, + { + "elevation":[ + 345.47736721935661, + 363.18776661379422 + ], + "pace":[ + 340.82303041339082, + 404.71689228682374 + ], + "heartRate":[ + 125.1949698433959, + 131.31354363122026 + ], + "distanceFromStart":2.25 + }, + { + "elevation":[ + 346.23343025200535, + 497.23376445462401 + ], + "pace":[ + 261.27629148816021, + 331.68516208719467 + ], + "heartRate":[ + 131.67810544238606, + 154.26779645311458 + ], + "distanceFromStart":2.625 + }, + { + "elevation":[ + 491.57378483134391, + 547.49535224251053 + ], + "pace":[ + 296.05298644112088, + 401.14092967732398 + ], + "heartRate":[ + 151.36398089694217, + 166.20454793289232 + ], + "distanceFromStart":3 + }, + { + "elevation":[ + 472.06803233416338, + 531.92570520228401 + ], + "pace":[ + 395.50830663514012, + 401.67837917543591 + ], + "heartRate":[ + 134.41798110234078, + 151.90886697564241 + ], + "distanceFromStart":3.375 + }, + { + "elevation":[ + 339.81419476005283, + 461.03832527824829 + ], + "pace":[ + 395.31160487975183, + 404.49550455974907 + ], + "heartRate":[ + 129.97753472415462, + 138.13531094848992 + ], + "distanceFromStart":3.75 + }, + { + "elevation":[ + 303.1495508565697, + 342.3532820173541 + ], + "pace":[ + 395.02844559698116, + 402.65878340653796 + ], + "heartRate":[ + 127.72304232462609, + 133.26322270764186 + ], + "distanceFromStart":4.125 + } + ] + }, + { + "name":"Lonesome Ridge Trail", + "id":1008, + "distance":4.5, + "difficulty":3, + "observations":[ + { + "elevation":[ + 291.65263635636268, + 309.26016677925196 + ], + "pace":[ + 396.08716481908732, + 403.68937873525232 + ], + "heartRate":[ + 117.16351898665887, + 121.95815455919609 + ], + "distanceFromStart":0 + }, + { + "elevation":[ + 299.24001936628116, + 317.44584350790012 + ], + "pace":[ + 380.19020240756623, + 395.3978319010256 + ], + "heartRate":[ + 117.6410892152911, + 124.82185220506081 + ], + "distanceFromStart":0.375 + }, + { + "elevation":[ + 303.62145464574394, + 336.05569457646544 + ], + "pace":[ + 380.55927782266116, + 397.60789726832775 + ], + "heartRate":[ + 121.52696452049059, + 127.31525441110122 + ], + "distanceFromStart":0.75 + }, + { + "elevation":[ + 319.90393365162629, + 346.26966025518789 + ], + "pace":[ + 357.94116421258531, + 398.0750288648062 + ], + "heartRate":[ + 123.75908585923588, + 132.77069404486801 + ], + "distanceFromStart":1.125 + }, + { + "elevation":[ + 354.17104439267905, + 403.57031216972939 + ], + "pace":[ + 335.07385149392701, + 397.82674381875808 + ], + "heartRate":[ + 130.8235194572915, + 140.55700591418218 + ], + "distanceFromStart":1.5 + }, + { + "elevation":[ + 357.42992871175124, + 385.92155620623635 + ], + "pace":[ + 395.16168913839374, + 404.60294066527558 + ], + "heartRate":[ + 131.5456052446734, + 134.65984504627627 + ], + "distanceFromStart":1.875 + }, + { + "elevation":[ + 345.47736721935661, + 363.18776661379422 + ], + "pace":[ + 340.82303041339082, + 404.71689228682374 + ], + "heartRate":[ + 125.1949698433959, + 131.31354363122026 + ], + "distanceFromStart":2.25 + }, + { + "elevation":[ + 346.23343025200535, + 497.23376445462401 + ], + "pace":[ + 261.27629148816021, + 331.68516208719467 + ], + "heartRate":[ + 131.67810544238606, + 154.26779645311458 + ], + "distanceFromStart":2.625 + }, + { + "elevation":[ + 491.57378483134391, + 547.49535224251053 + ], + "pace":[ + 296.05298644112088, + 401.14092967732398 + ], + "heartRate":[ + 151.36398089694217, + 166.20454793289232 + ], + "distanceFromStart":3 + }, + { + "elevation":[ + 472.06803233416338, + 531.92570520228401 + ], + "pace":[ + 395.50830663514012, + 401.67837917543591 + ], + "heartRate":[ + 134.41798110234078, + 151.90886697564241 + ], + "distanceFromStart":3.375 + }, + { + "elevation":[ + 339.81419476005283, + 461.03832527824829 + ], + "pace":[ + 395.31160487975183, + 404.49550455974907 + ], + "heartRate":[ + 129.97753472415462, + 138.13531094848992 + ], + "distanceFromStart":3.75 + }, + { + "elevation":[ + 303.1495508565697, + 342.3532820173541 + ], + "pace":[ + 395.02844559698116, + 402.65878340653796 + ], + "heartRate":[ + 127.72304232462609, + 133.26322270764186 + ], + "distanceFromStart":4.125 + } + ] + }, + { + "name":"Lonesome Ridge Trail", + "id":1009, + "distance":4.5, + "difficulty":3, + "observations":[ + { + "elevation":[ + 291.65263635636268, + 309.26016677925196 + ], + "pace":[ + 396.08716481908732, + 403.68937873525232 + ], + "heartRate":[ + 117.16351898665887, + 121.95815455919609 + ], + "distanceFromStart":0 + }, + { + "elevation":[ + 299.24001936628116, + 317.44584350790012 + ], + "pace":[ + 380.19020240756623, + 395.3978319010256 + ], + "heartRate":[ + 117.6410892152911, + 124.82185220506081 + ], + "distanceFromStart":0.375 + }, + { + "elevation":[ + 303.62145464574394, + 336.05569457646544 + ], + "pace":[ + 380.55927782266116, + 397.60789726832775 + ], + "heartRate":[ + 121.52696452049059, + 127.31525441110122 + ], + "distanceFromStart":0.75 + }, + { + "elevation":[ + 319.90393365162629, + 346.26966025518789 + ], + "pace":[ + 357.94116421258531, + 398.0750288648062 + ], + "heartRate":[ + 123.75908585923588, + 132.77069404486801 + ], + "distanceFromStart":1.125 + }, + { + "elevation":[ + 354.17104439267905, + 403.57031216972939 + ], + "pace":[ + 335.07385149392701, + 397.82674381875808 + ], + "heartRate":[ + 130.8235194572915, + 140.55700591418218 + ], + "distanceFromStart":1.5 + }, + { + "elevation":[ + 357.42992871175124, + 385.92155620623635 + ], + "pace":[ + 395.16168913839374, + 404.60294066527558 + ], + "heartRate":[ + 131.5456052446734, + 134.65984504627627 + ], + "distanceFromStart":1.875 + }, + { + "elevation":[ + 345.47736721935661, + 363.18776661379422 + ], + "pace":[ + 340.82303041339082, + 404.71689228682374 + ], + "heartRate":[ + 125.1949698433959, + 131.31354363122026 + ], + "distanceFromStart":2.25 + }, + { + "elevation":[ + 346.23343025200535, + 497.23376445462401 + ], + "pace":[ + 261.27629148816021, + 331.68516208719467 + ], + "heartRate":[ + 131.67810544238606, + 154.26779645311458 + ], + "distanceFromStart":2.625 + }, + { + "elevation":[ + 491.57378483134391, + 547.49535224251053 + ], + "pace":[ + 296.05298644112088, + 401.14092967732398 + ], + "heartRate":[ + 151.36398089694217, + 166.20454793289232 + ], + "distanceFromStart":3 + }, + { + "elevation":[ + 472.06803233416338, + 531.92570520228401 + ], + "pace":[ + 395.50830663514012, + 401.67837917543591 + ], + "heartRate":[ + 134.41798110234078, + 151.90886697564241 + ], + "distanceFromStart":3.375 + }, + { + "elevation":[ + 339.81419476005283, + 461.03832527824829 + ], + "pace":[ + 395.31160487975183, + 404.49550455974907 + ], + "heartRate":[ + 129.97753472415462, + 138.13531094848992 + ], + "distanceFromStart":3.75 + }, + { + "elevation":[ + 303.1495508565697, + 342.3532820173541 + ], + "pace":[ + 395.02844559698116, + 402.65878340653796 + ], + "heartRate":[ + 127.72304232462609, + 133.26322270764186 + ], + "distanceFromStart":4.125 + } + ] + }, + { + "name":"Lonesome Ridge Trail", + "id":1010, + "distance":4.5, + "difficulty":3, + "observations":[ + { + "elevation":[ + 291.65263635636268, + 309.26016677925196 + ], + "pace":[ + 396.08716481908732, + 403.68937873525232 + ], + "heartRate":[ + 117.16351898665887, + 121.95815455919609 + ], + "distanceFromStart":0 + }, + { + "elevation":[ + 299.24001936628116, + 317.44584350790012 + ], + "pace":[ + 380.19020240756623, + 395.3978319010256 + ], + "heartRate":[ + 117.6410892152911, + 124.82185220506081 + ], + "distanceFromStart":0.375 + }, + { + "elevation":[ + 303.62145464574394, + 336.05569457646544 + ], + "pace":[ + 380.55927782266116, + 397.60789726832775 + ], + "heartRate":[ + 121.52696452049059, + 127.31525441110122 + ], + "distanceFromStart":0.75 + }, + { + "elevation":[ + 319.90393365162629, + 346.26966025518789 + ], + "pace":[ + 357.94116421258531, + 398.0750288648062 + ], + "heartRate":[ + 123.75908585923588, + 132.77069404486801 + ], + "distanceFromStart":1.125 + }, + { + "elevation":[ + 354.17104439267905, + 403.57031216972939 + ], + "pace":[ + 335.07385149392701, + 397.82674381875808 + ], + "heartRate":[ + 130.8235194572915, + 140.55700591418218 + ], + "distanceFromStart":1.5 + }, + { + "elevation":[ + 357.42992871175124, + 385.92155620623635 + ], + "pace":[ + 395.16168913839374, + 404.60294066527558 + ], + "heartRate":[ + 131.5456052446734, + 134.65984504627627 + ], + "distanceFromStart":1.875 + }, + { + "elevation":[ + 345.47736721935661, + 363.18776661379422 + ], + "pace":[ + 340.82303041339082, + 404.71689228682374 + ], + "heartRate":[ + 125.1949698433959, + 131.31354363122026 + ], + "distanceFromStart":2.25 + }, + { + "elevation":[ + 346.23343025200535, + 497.23376445462401 + ], + "pace":[ + 261.27629148816021, + 331.68516208719467 + ], + "heartRate":[ + 131.67810544238606, + 154.26779645311458 + ], + "distanceFromStart":2.625 + }, + { + "elevation":[ + 491.57378483134391, + 547.49535224251053 + ], + "pace":[ + 296.05298644112088, + 401.14092967732398 + ], + "heartRate":[ + 151.36398089694217, + 166.20454793289232 + ], + "distanceFromStart":3 + }, + { + "elevation":[ + 472.06803233416338, + 531.92570520228401 + ], + "pace":[ + 395.50830663514012, + 401.67837917543591 + ], + "heartRate":[ + 134.41798110234078, + 151.90886697564241 + ], + "distanceFromStart":3.375 + }, + { + "elevation":[ + 339.81419476005283, + 461.03832527824829 + ], + "pace":[ + 395.31160487975183, + 404.49550455974907 + ], + "heartRate":[ + 129.97753472415462, + 138.13531094848992 + ], + "distanceFromStart":3.75 + }, + { + "elevation":[ + 303.1495508565697, + 342.3532820173541 + ], + "pace":[ + 395.02844559698116, + 402.65878340653796 + ], + "heartRate":[ + 127.72304232462609, + 133.26322270764186 + ], + "distanceFromStart":4.125 + } + ] + } +] diff --git a/Examples/AnimatingViewsAndTransitions/StartingPoint/Landmarks/Landmarks/Resources/icybay.jpg b/Examples/AnimatingViewsAndTransitions/StartingPoint/Landmarks/Landmarks/Resources/icybay.jpg new file mode 100755 index 0000000..feb1764 Binary files /dev/null and b/Examples/AnimatingViewsAndTransitions/StartingPoint/Landmarks/Landmarks/Resources/icybay.jpg differ diff --git a/Examples/AnimatingViewsAndTransitions/StartingPoint/Landmarks/Landmarks/Resources/lakemcdonald.jpg b/Examples/AnimatingViewsAndTransitions/StartingPoint/Landmarks/Landmarks/Resources/lakemcdonald.jpg new file mode 100755 index 0000000..bd9d6b9 Binary files /dev/null and b/Examples/AnimatingViewsAndTransitions/StartingPoint/Landmarks/Landmarks/Resources/lakemcdonald.jpg differ diff --git a/Examples/AnimatingViewsAndTransitions/StartingPoint/Landmarks/Landmarks/Resources/landmarkData.json b/Examples/AnimatingViewsAndTransitions/StartingPoint/Landmarks/Landmarks/Resources/landmarkData.json new file mode 100755 index 0000000..e5b14fc --- /dev/null +++ b/Examples/AnimatingViewsAndTransitions/StartingPoint/Landmarks/Landmarks/Resources/landmarkData.json @@ -0,0 +1,182 @@ +[ + { + "name": "Turtle Rock", + "category": "Rivers", + "city": "Twentynine Palms", + "state": "California", + "id": 1001, + "isFeatured": true, + "isFavorite": true, + "park": "Joshua Tree National Park", + "coordinates": { + "longitude": -116.166868, + "latitude": 34.011286 + }, + "imageName": "turtlerock" + }, + { + "name": "Silver Salmon Creek", + "category": "Lakes", + "city": "Port Alsworth", + "state": "Alaska", + "id": 1002, + "isFeatured": false, + "isFavorite": false, + "park": "Lake Clark National Park and Preserve", + "coordinates": { + "longitude": -152.665167, + "latitude": 59.980167 + }, + "imageName": "silversalmoncreek" + }, + { + "name": "Chilkoot Trail", + "category": "Mountains", + "city": "Skagway", + "state": "Alaska", + "id": 1003, + "isFeatured": false, + "isFavorite": true, + "park": "Klondike Gold Rush National Historical Park", + "coordinates": { + "longitude": -135.334571, + "latitude": 59.560551 + }, + "imageName": "chilkoottrail" + }, + { + "name": "St. Mary Lake", + "category": "Lakes", + "city": "Browning", + "state": "Montana", + "id": 1004, + "isFeatured": true, + "isFavorite": true, + "park": "Glacier National Park", + "coordinates": { + "longitude": -113.536248, + "latitude": 48.69423 + }, + "imageName": "stmarylake" + }, + { + "name": "Twin Lake", + "category": "Lakes", + "city": "Twin Lakes", + "state": "Alaska", + "id": 1005, + "isFeatured": false, + "isFavorite": false, + "park": "Lake Clark National Park and Preserve", + "coordinates": { + "longitude": -153.849883, + "latitude": 60.641684 + }, + "imageName": "twinlake" + }, + { + "name": "Lake McDonald", + "category": "Mountains", + "city": "West Glacier", + "state": "Montana", + "id": 1006, + "isFeatured": false, + "isFavorite": false, + "park": "Glacier National Park", + "coordinates": { + "longitude": -113.934831, + "latitude": 48.56002 + }, + "imageName": "lakemcdonald" + }, + { + "name": "Charley Rivers", + "category": "Rivers", + "city": "Eaking", + "state": "Alaska", + "id": 1007, + "isFeatured": true, + "isFavorite": false, + "park": "Charley Rivers National Preserve", + "coordinates": { + "longitude": -143.122586, + "latitude": 65.350021 + }, + "imageName": "charleyrivers", + }, + { + "name": "Icy Bay", + "category": "Mountains", + "city": "Icy Bay", + "state": "Alaska", + "id": 1008, + "isFeatured": false, + "isFavorite": false, + "park": "Wrangell-St. Elias National Park and Preserve", + "coordinates": { + "longitude": -141.518167, + "latitude": 60.089917 + }, + "imageName": "icybay" + }, + { + "name": "Rainbow Lake", + "category": "Lakes", + "city": "Willow", + "state": "Alaska", + "id": 1009, + "isFeatured": false, + "isFavorite": false, + "park": "State Recreation Area", + "coordinates": { + "longitude": -150.086103, + "latitude": 61.694334 + }, + "imageName": "rainbowlake" + }, + { + "name": "Hidden Lake", + "category": "Lakes", + "city": "Newhalem", + "state": "Washington", + "id": 1010, + "isFeatured": false, + "isFavorite": false, + "park": "North Cascades National Park", + "coordinates": { + "longitude": -121.17799, + "latitude": 48.495442 + }, + "imageName": "hiddenlake" + }, + { + "name": "Chincoteague", + "category": "Rivers", + "city": "Chincoteague", + "state": "Virginia", + "id": 1011, + "isFeatured": false, + "isFavorite": false, + "park": "Chincoteague National Wildlife Refuge", + "coordinates": { + "longitude": -75.383212, + "latitude": 37.91531 + }, + "imageName": "chincoteague" + }, + { + "name": "Lake Umbagog", + "category": "Lakes", + "city": "Errol", + "state": "New Hampshire", + "id": 1012, + "isFeatured": true, + "isFavorite": false, + "park": "Umbagog National Wildlife Refuge", + "coordinates": { + "longitude": -71.056816, + "latitude": 44.747408 + }, + "imageName": "umbagog" + } +] diff --git a/Examples/AnimatingViewsAndTransitions/StartingPoint/Landmarks/Landmarks/Resources/rainbowlake.jpg b/Examples/AnimatingViewsAndTransitions/StartingPoint/Landmarks/Landmarks/Resources/rainbowlake.jpg new file mode 100755 index 0000000..6da43dd Binary files /dev/null and b/Examples/AnimatingViewsAndTransitions/StartingPoint/Landmarks/Landmarks/Resources/rainbowlake.jpg differ diff --git a/Examples/AnimatingViewsAndTransitions/StartingPoint/Landmarks/Landmarks/Resources/silversalmoncreek.jpg b/Examples/AnimatingViewsAndTransitions/StartingPoint/Landmarks/Landmarks/Resources/silversalmoncreek.jpg new file mode 100755 index 0000000..f657532 Binary files /dev/null and b/Examples/AnimatingViewsAndTransitions/StartingPoint/Landmarks/Landmarks/Resources/silversalmoncreek.jpg differ diff --git a/Examples/AnimatingViewsAndTransitions/StartingPoint/Landmarks/Landmarks/Resources/stmarylake.jpg b/Examples/AnimatingViewsAndTransitions/StartingPoint/Landmarks/Landmarks/Resources/stmarylake.jpg new file mode 100755 index 0000000..1c71de4 Binary files /dev/null and b/Examples/AnimatingViewsAndTransitions/StartingPoint/Landmarks/Landmarks/Resources/stmarylake.jpg differ diff --git a/Examples/AnimatingViewsAndTransitions/StartingPoint/Landmarks/Landmarks/Resources/turtlerock.jpg b/Examples/AnimatingViewsAndTransitions/StartingPoint/Landmarks/Landmarks/Resources/turtlerock.jpg new file mode 100755 index 0000000..f7a6e6d Binary files /dev/null and b/Examples/AnimatingViewsAndTransitions/StartingPoint/Landmarks/Landmarks/Resources/turtlerock.jpg differ diff --git a/Examples/AnimatingViewsAndTransitions/StartingPoint/Landmarks/Landmarks/Resources/twinlake.jpg b/Examples/AnimatingViewsAndTransitions/StartingPoint/Landmarks/Landmarks/Resources/twinlake.jpg new file mode 100755 index 0000000..3e7a57c Binary files /dev/null and b/Examples/AnimatingViewsAndTransitions/StartingPoint/Landmarks/Landmarks/Resources/twinlake.jpg differ diff --git a/Examples/AnimatingViewsAndTransitions/StartingPoint/Landmarks/Landmarks/Resources/umbagog.jpg b/Examples/AnimatingViewsAndTransitions/StartingPoint/Landmarks/Landmarks/Resources/umbagog.jpg new file mode 100755 index 0000000..56291c6 Binary files /dev/null and b/Examples/AnimatingViewsAndTransitions/StartingPoint/Landmarks/Landmarks/Resources/umbagog.jpg differ diff --git a/Examples/AnimatingViewsAndTransitions/StartingPoint/Landmarks/Landmarks/SceneDelegate.swift b/Examples/AnimatingViewsAndTransitions/StartingPoint/Landmarks/Landmarks/SceneDelegate.swift new file mode 100755 index 0000000..96df0dc --- /dev/null +++ b/Examples/AnimatingViewsAndTransitions/StartingPoint/Landmarks/Landmarks/SceneDelegate.swift @@ -0,0 +1,56 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +The scene delegate. +*/ + +import UIKit +import SwiftUI + +class SceneDelegate: UIResponder, UIWindowSceneDelegate { + + var window: UIWindow? + + func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) { + // Use this method to optionally configure and attach the UIWindow `window` to the provided UIWindowScene `scene`. + // If using a storyboard, the `window` property will automatically be initialized and attached to the scene. + // This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead). + + // Use a UIHostingController as window root view controller + let window = UIWindow(frame: UIScreen.main.bounds) + window.rootViewController = UIHostingController(rootView: LandmarkList().environmentObject(UserData())) + self.window = window + window.makeKeyAndVisible() + } + + func sceneDidDisconnect(_ scene: UIScene) { + // Called as the scene is being released by the system. + // This occurs shortly after the scene enters the background, or when its session is discarded. + // Release any resources associated with this scene that can be re-created the next time the scene connects. + // The scene may re-connect later, as its session was not neccessarily discarded (see `application:didDiscardSceneSessions` instead). + } + + func sceneDidBecomeActive(_ scene: UIScene) { + // Called when the scene has moved from an inactive state to an active state. + // Use this method to restart any tasks that were paused (or not yet started) when the scene was inactive. + } + + func sceneWillResignActive(_ scene: UIScene) { + // Called when the scene will move from an active state to an inactive state. + // This may occur due to temporary interruptions (ex. an incoming phone call). + } + + func sceneWillEnterForeground(_ scene: UIScene) { + // Called as the scene transitions from the background to the foreground. + // Use this method to undo the changes made on entering the background. + } + + func sceneDidEnterBackground(_ scene: UIScene) { + // Called as the scene transitions from the foreground to the background. + // Use this method to save data, release shared resources, and store enough scene-specific state information + // to restore the scene back to its current state. + } + +} + diff --git a/Examples/AnimatingViewsAndTransitions/StartingPoint/Landmarks/Landmarks/Supporting Views/Badge.swift b/Examples/AnimatingViewsAndTransitions/StartingPoint/Landmarks/Landmarks/Supporting Views/Badge.swift new file mode 100755 index 0000000..59f03b2 --- /dev/null +++ b/Examples/AnimatingViewsAndTransitions/StartingPoint/Landmarks/Landmarks/Supporting Views/Badge.swift @@ -0,0 +1,41 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +A view that displays a badge. +*/ + +import SwiftUI + +struct Badge: View { + static let rotationCount = 8 + + var badgeSymbols: some View { + ForEach(0.. + var overallRange: Range + + var heightRatio: Length { + max(Length(magnitude(of: range) / magnitude(of: overallRange)), 0.15) + } + + var offsetRatio: Length { + Length((range.lowerBound - overallRange.lowerBound) / magnitude(of: overallRange)) + } + + var body: some View { + Capsule() + .fill(Color.white) + .frame(height: height * heightRatio, alignment: .bottom) + .offset(x: 0, y: height * -offsetRatio) + } +} + +#if DEBUG +struct GraphCapsule_Previews: PreviewProvider { + static var previews: some View { + GraphCapsule(index: 0, height: 150, range: 10..<50, overallRange: 0..<100) + } +} +#endif diff --git a/Examples/AnimatingViewsAndTransitions/StartingPoint/Landmarks/Landmarks/Supporting Views/HikeGraph.swift b/Examples/AnimatingViewsAndTransitions/StartingPoint/Landmarks/Landmarks/Supporting Views/HikeGraph.swift new file mode 100755 index 0000000..7df5194 --- /dev/null +++ b/Examples/AnimatingViewsAndTransitions/StartingPoint/Landmarks/Landmarks/Supporting Views/HikeGraph.swift @@ -0,0 +1,74 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +The elevation, heart rate, and pace of a hike plotted on a graph. +*/ + +import SwiftUI + +func rangeOfRanges(_ ranges: C) -> Range + where C.Element == Range { + guard !ranges.isEmpty else { return 0..<0 } + let low = ranges.lazy.map { $0.lowerBound }.min()! + let high = ranges.lazy.map { $0.upperBound }.max()! + return low..) -> Double { + return range.upperBound - range.lowerBound +} + +struct HikeGraph: View { + var hike: Hike + var path: KeyPath> + + var color: Color { + switch path { + case \.elevation: + return .gray + case \.heartRate: + return Color(hue: 0, saturation: 0.5, brightness: 0.7) + case \.pace: + return Color(hue: 0.7, saturation: 0.4, brightness: 0.7) + default: + return .black + } + } + + var body: some View { + let data = hike.observations + let overallRange = rangeOfRanges(data.lazy.map { $0[keyPath: self.path] }) + let maxMagnitude = data.map { magnitude(of: $0[keyPath: path]) }.max()! + let heightRatio = 1 - Length(maxMagnitude / magnitude(of: overallRange)) + + return GeometryReader { proxy in + HStack(alignment: .bottom, spacing: proxy.size.width / 120) { + ForEach(data.indices) { index in + GraphCapsule( + index: index, + height: proxy.size.height, + range: data[index][keyPath: self.path], + overallRange: overallRange) + .colorMultiply(self.color) + } + .offset(x: 0, y: proxy.size.height * heightRatio) + } + } + } +} + +#if DEBUG +struct HikeGraph_Previews: PreviewProvider { + static var previews: some View { + Group { + HikeGraph(hike: hikeData[0], path: \.elevation) + .frame(height: 200) + HikeGraph(hike: hikeData[0], path: \.heartRate) + .frame(height: 200) + HikeGraph(hike: hikeData[0], path: \.pace) + .frame(height: 200) + } + } +} +#endif diff --git a/Examples/AnimatingViewsAndTransitions/StartingPoint/Landmarks/Landmarks/Supporting Views/LandmarkRow.swift b/Examples/AnimatingViewsAndTransitions/StartingPoint/Landmarks/Landmarks/Supporting Views/LandmarkRow.swift new file mode 100755 index 0000000..2f8110c --- /dev/null +++ b/Examples/AnimatingViewsAndTransitions/StartingPoint/Landmarks/Landmarks/Supporting Views/LandmarkRow.swift @@ -0,0 +1,38 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +A single row to be displayed in a list of landmarks. +*/ + +import SwiftUI + +struct LandmarkRow: View { + var landmark: Landmark + + var body: some View { + HStack { + landmark.image(forSize: 50) + Text(verbatim: landmark.name) + Spacer() + + if landmark.isFavorite { + Image(systemName: "star.fill") + .imageScale(.medium) + .foregroundColor(.yellow) + } + } + } +} + +#if DEBUG +struct LandmarkRow_Previews: PreviewProvider { + static var previews: some View { + Group { + LandmarkRow(landmark: landmarkData[0]) + LandmarkRow(landmark: landmarkData[1]) + } + .previewLayout(.fixed(width: 300, height: 70)) + } +} +#endif diff --git a/Examples/AnimatingViewsAndTransitions/StartingPoint/Landmarks/Landmarks/Supporting Views/MapView.swift b/Examples/AnimatingViewsAndTransitions/StartingPoint/Landmarks/Landmarks/Supporting Views/MapView.swift new file mode 100755 index 0000000..5a8c64b --- /dev/null +++ b/Examples/AnimatingViewsAndTransitions/StartingPoint/Landmarks/Landmarks/Supporting Views/MapView.swift @@ -0,0 +1,31 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +A view that hosts an `MKMapView`. +*/ + +import SwiftUI +import MapKit + +struct MapView: UIViewRepresentable { + var coordinate: CLLocationCoordinate2D + + func makeUIView(context: Context) -> MKMapView { + MKMapView(frame: .zero) + } + + func updateUIView(_ view: MKMapView, context: Context) { + let span = MKCoordinateSpan(latitudeDelta: 0.02, longitudeDelta: 0.02) + let region = MKCoordinateRegion(center: coordinate, span: span) + view.setRegion(region, animated: true) + } +} + +#if DEBUG +struct MapView_Previews: PreviewProvider { + static var previews: some View { + MapView(coordinate: landmarkData[0].locationCoordinate) + } +} +#endif diff --git a/Examples/AnimatingViewsAndTransitions/StartingPoint/Landmarks/Landmarks/Supporting Views/RotatedBadgeSymbol.swift b/Examples/AnimatingViewsAndTransitions/StartingPoint/Landmarks/Landmarks/Supporting Views/RotatedBadgeSymbol.swift new file mode 100755 index 0000000..a7e4b53 --- /dev/null +++ b/Examples/AnimatingViewsAndTransitions/StartingPoint/Landmarks/Landmarks/Supporting Views/RotatedBadgeSymbol.swift @@ -0,0 +1,26 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +A view that displays a rotated version of a badge symbol. +*/ + +import SwiftUI + +struct RotatedBadgeSymbol: View { + let angle: Angle + + var body: some View { + BadgeSymbol() + .padding(-60) + .rotationEffect(angle, anchor: .bottom) + } +} + +#if DEBUG +struct RotatedBadgeSymbol_Previews: PreviewProvider { + static var previews: some View { + RotatedBadgeSymbol(angle: .init(degrees: 5)) + } +} +#endif diff --git a/Examples/AnimatingViewsAndTransitions/StartingPoint/README.md b/Examples/AnimatingViewsAndTransitions/StartingPoint/README.md new file mode 100755 index 0000000..635754f --- /dev/null +++ b/Examples/AnimatingViewsAndTransitions/StartingPoint/README.md @@ -0,0 +1,3 @@ +# Drawing Animating Views and Transitions + +Use this project to code along with the [Animating Views and Transitions](https://developer.apple.com/tutorials/swiftui/animating-views-and-transitions) tutorial. \ No newline at end of file diff --git a/Examples/BuildingListsAndNavigation/Complete/.gitignore b/Examples/BuildingListsAndNavigation/Complete/.gitignore new file mode 100755 index 0000000..9e50718 --- /dev/null +++ b/Examples/BuildingListsAndNavigation/Complete/.gitignore @@ -0,0 +1,21 @@ +# See LICENSE folder for this sample’s licensing information. +# +# Apple sample code gitignore configuration. + +# Finder +.DS_Store + +# Xcode - User files +xcuserdata/ + +**/*.xcodeproj/project.xcworkspace/* +!**/*.xcodeproj/project.xcworkspace/xcshareddata + +**/*.xcodeproj/project.xcworkspace/xcshareddata/* +!**/*.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings + +**/*.playground/playground.xcworkspace/* +!**/*.playground/playground.xcworkspace/xcshareddata + +**/*.playground/playground.xcworkspace/xcshareddata/* +!**/*.playground/playground.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings diff --git a/Examples/BuildingListsAndNavigation/Complete/Configuration/SampleCode.xcconfig b/Examples/BuildingListsAndNavigation/Complete/Configuration/SampleCode.xcconfig new file mode 100755 index 0000000..db86c06 --- /dev/null +++ b/Examples/BuildingListsAndNavigation/Complete/Configuration/SampleCode.xcconfig @@ -0,0 +1,13 @@ +// +// See LICENSE folder for this sample’s licensing information. +// +// SampleCode.xcconfig +// + +// The `SAMPLE_CODE_DISAMBIGUATOR` configuration is to make it easier to build +// and run a sample code project. Once you set your project's development team, +// you'll have a unique bundle identifier. This is because the bundle identifier +// is derived based on the 'SAMPLE_CODE_DISAMBIGUATOR' value. Do not use this +// approach in your own projects—it's only useful for sample code projects because +// they are frequently downloaded and don't have a development team set. +SAMPLE_CODE_DISAMBIGUATOR=${DEVELOPMENT_TEAM} diff --git a/Examples/BuildingListsAndNavigation/Complete/LICENSE/LICENSE.txt b/Examples/BuildingListsAndNavigation/Complete/LICENSE/LICENSE.txt new file mode 100755 index 0000000..94e3d54 --- /dev/null +++ b/Examples/BuildingListsAndNavigation/Complete/LICENSE/LICENSE.txt @@ -0,0 +1,8 @@ +Copyright © 2019 Apple Inc. + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + diff --git a/Examples/BuildingListsAndNavigation/Complete/Landmarks/BuildingListsAndNavigation.xcodeproj/.xcodesamplecode.plist b/Examples/BuildingListsAndNavigation/Complete/Landmarks/BuildingListsAndNavigation.xcodeproj/.xcodesamplecode.plist new file mode 100755 index 0000000..5dd5da8 --- /dev/null +++ b/Examples/BuildingListsAndNavigation/Complete/Landmarks/BuildingListsAndNavigation.xcodeproj/.xcodesamplecode.plist @@ -0,0 +1,5 @@ + + + + + diff --git a/Examples/BuildingListsAndNavigation/Complete/Landmarks/BuildingListsAndNavigation.xcodeproj/project.pbxproj b/Examples/BuildingListsAndNavigation/Complete/Landmarks/BuildingListsAndNavigation.xcodeproj/project.pbxproj new file mode 100755 index 0000000..0233bf4 --- /dev/null +++ b/Examples/BuildingListsAndNavigation/Complete/Landmarks/BuildingListsAndNavigation.xcodeproj/project.pbxproj @@ -0,0 +1,477 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 50; + objects = { + +/* Begin PBXBuildFile section */ + B7394866229F194000C47603 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7394865229F194000C47603 /* AppDelegate.swift */; }; + B7394868229F194000C47603 /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7394867229F194000C47603 /* SceneDelegate.swift */; }; + B739486A229F194000C47603 /* LandmarkDetail.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7394869229F194000C47603 /* LandmarkDetail.swift */; }; + B739486C229F194200C47603 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = B739486B229F194200C47603 /* Assets.xcassets */; }; + B739486F229F194200C47603 /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = B739486E229F194200C47603 /* Preview Assets.xcassets */; }; + B7394872229F194200C47603 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = B7394870229F194200C47603 /* LaunchScreen.storyboard */; }; + B739487A229F1B3F00C47603 /* CircleImage.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7394879229F1B3F00C47603 /* CircleImage.swift */; }; + B739487C229F1B6800C47603 /* MapView.swift in Sources */ = {isa = PBXBuildFile; fileRef = B739487B229F1B6800C47603 /* MapView.swift */; }; + B7394881229F28B900C47603 /* Landmark.swift in Sources */ = {isa = PBXBuildFile; fileRef = B739487F229F28B900C47603 /* Landmark.swift */; }; + B7394882229F28B900C47603 /* Data.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7394880229F28B900C47603 /* Data.swift */; }; + B7394891229F292F00C47603 /* rainbowlake.jpg in Resources */ = {isa = PBXBuildFile; fileRef = B7394884229F292D00C47603 /* rainbowlake.jpg */; }; + B7394892229F292F00C47603 /* yukon_charleyrivers.jpg in Resources */ = {isa = PBXBuildFile; fileRef = B7394885229F292D00C47603 /* yukon_charleyrivers.jpg */; }; + B7394893229F292F00C47603 /* icybay.jpg in Resources */ = {isa = PBXBuildFile; fileRef = B7394886229F292E00C47603 /* icybay.jpg */; }; + B7394894229F292F00C47603 /* lakemcdonald.jpg in Resources */ = {isa = PBXBuildFile; fileRef = B7394887229F292E00C47603 /* lakemcdonald.jpg */; }; + B7394895229F292F00C47603 /* turtlerock.jpg in Resources */ = {isa = PBXBuildFile; fileRef = B7394888229F292E00C47603 /* turtlerock.jpg */; }; + B7394896229F292F00C47603 /* umbagog.jpg in Resources */ = {isa = PBXBuildFile; fileRef = B7394889229F292E00C47603 /* umbagog.jpg */; }; + B7394897229F292F00C47603 /* hiddenlake.jpg in Resources */ = {isa = PBXBuildFile; fileRef = B739488A229F292E00C47603 /* hiddenlake.jpg */; }; + B7394898229F292F00C47603 /* stmarylake.jpg in Resources */ = {isa = PBXBuildFile; fileRef = B739488B229F292E00C47603 /* stmarylake.jpg */; }; + B7394899229F292F00C47603 /* twinlake.jpg in Resources */ = {isa = PBXBuildFile; fileRef = B739488C229F292E00C47603 /* twinlake.jpg */; }; + B739489A229F292F00C47603 /* silversalmoncreek.jpg in Resources */ = {isa = PBXBuildFile; fileRef = B739488D229F292E00C47603 /* silversalmoncreek.jpg */; }; + B739489B229F292F00C47603 /* landmarkData.json in Resources */ = {isa = PBXBuildFile; fileRef = B739488E229F292E00C47603 /* landmarkData.json */; }; + B739489C229F292F00C47603 /* chincoteague.jpg in Resources */ = {isa = PBXBuildFile; fileRef = B739488F229F292F00C47603 /* chincoteague.jpg */; }; + B739489D229F292F00C47603 /* chilkoottrail.jpg in Resources */ = {isa = PBXBuildFile; fileRef = B7394890229F292F00C47603 /* chilkoottrail.jpg */; }; + B739489F229F2D9700C47603 /* LandmarkRow.swift in Sources */ = {isa = PBXBuildFile; fileRef = B739489E229F2D9700C47603 /* LandmarkRow.swift */; }; + B73948A1229F2E1F00C47603 /* LandmarkList.swift in Sources */ = {isa = PBXBuildFile; fileRef = B73948A0229F2E1F00C47603 /* LandmarkList.swift */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + 875A65A0875A67A000000001 /* SampleCode.xcconfig */ = {isa = PBXFileReference; name = SampleCode.xcconfig; path = ../Configuration/SampleCode.xcconfig; sourceTree = ""; }; + 875CFFE0875D508000000001 /* LICENSE.txt */ = {isa = PBXFileReference; includeInIndex = 1; path = LICENSE.txt; sourceTree = ""; }; + B7394862229F194000C47603 /* Landmarks.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Landmarks.app; sourceTree = BUILT_PRODUCTS_DIR; }; + B7394865229F194000C47603 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + B7394867229F194000C47603 /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = ""; }; + B7394869229F194000C47603 /* LandmarkDetail.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LandmarkDetail.swift; sourceTree = ""; }; + B739486B229F194200C47603 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + B739486E229F194200C47603 /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = ""; }; + B7394871229F194200C47603 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + B7394873229F194200C47603 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + B7394879229F1B3F00C47603 /* CircleImage.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CircleImage.swift; sourceTree = ""; }; + B739487B229F1B6800C47603 /* MapView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MapView.swift; sourceTree = ""; }; + B739487F229F28B900C47603 /* Landmark.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Landmark.swift; sourceTree = ""; }; + B7394880229F28B900C47603 /* Data.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Data.swift; sourceTree = ""; }; + B7394884229F292D00C47603 /* rainbowlake.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = rainbowlake.jpg; sourceTree = ""; }; + B7394885229F292D00C47603 /* yukon_charleyrivers.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = yukon_charleyrivers.jpg; sourceTree = ""; }; + B7394886229F292E00C47603 /* icybay.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = icybay.jpg; sourceTree = ""; }; + B7394887229F292E00C47603 /* lakemcdonald.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = lakemcdonald.jpg; sourceTree = ""; }; + B7394888229F292E00C47603 /* turtlerock.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = turtlerock.jpg; sourceTree = ""; }; + B7394889229F292E00C47603 /* umbagog.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = umbagog.jpg; sourceTree = ""; }; + B739488A229F292E00C47603 /* hiddenlake.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = hiddenlake.jpg; sourceTree = ""; }; + B739488B229F292E00C47603 /* stmarylake.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = stmarylake.jpg; sourceTree = ""; }; + B739488C229F292E00C47603 /* twinlake.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = twinlake.jpg; sourceTree = ""; }; + B739488D229F292E00C47603 /* silversalmoncreek.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = silversalmoncreek.jpg; sourceTree = ""; }; + B739488E229F292E00C47603 /* landmarkData.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = landmarkData.json; sourceTree = ""; }; + B739488F229F292F00C47603 /* chincoteague.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = chincoteague.jpg; sourceTree = ""; }; + B7394890229F292F00C47603 /* chilkoottrail.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = chilkoottrail.jpg; sourceTree = ""; }; + B739489E229F2D9700C47603 /* LandmarkRow.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = LandmarkRow.swift; path = "Supporting Views/LandmarkRow.swift"; sourceTree = ""; }; + B73948A0229F2E1F00C47603 /* LandmarkList.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LandmarkList.swift; sourceTree = ""; }; + C4E4AAA0C4E4035000000001 /* README.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; name = README.md; path = ../README.md; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + B739485F229F194000C47603 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 875A5F80875A5F4000000001 /* Configuration */ = { + isa = PBXGroup; + children = ( + 875A65A0875A67A000000001 /* SampleCode.xcconfig */, + ); + name = Configuration; + sourceTree = ""; + }; + 875D4790875D403000000001 /* LICENSE */ = { + isa = PBXGroup; + children = ( + 875CFFE0875D508000000001 /* LICENSE.txt */, + ); + name = LICENSE; + path = ../LICENSE; + sourceTree = ""; + }; + B7394859229F194000C47603 = { + isa = PBXGroup; + children = ( + C4E4AAA0C4E4035000000001 /* README.md */, + B7394864229F194000C47603 /* Landmarks */, + B7394863229F194000C47603 /* Products */, + 875A5F80875A5F4000000001 /* Configuration */, + 875D4790875D403000000001 /* LICENSE */, + ); + sourceTree = ""; + }; + B7394863229F194000C47603 /* Products */ = { + isa = PBXGroup; + children = ( + B7394862229F194000C47603 /* Landmarks.app */, + ); + name = Products; + sourceTree = ""; + }; + B7394864229F194000C47603 /* Landmarks */ = { + isa = PBXGroup; + children = ( + B739487E229F282200C47603 /* Models */, + B7394865229F194000C47603 /* AppDelegate.swift */, + B7394867229F194000C47603 /* SceneDelegate.swift */, + B73948A0229F2E1F00C47603 /* LandmarkList.swift */, + B739489E229F2D9700C47603 /* LandmarkRow.swift */, + B7394869229F194000C47603 /* LandmarkDetail.swift */, + B739487D229F1C0100C47603 /* Supporting Views */, + B7394883229F291A00C47603 /* Resources */, + B739486B229F194200C47603 /* Assets.xcassets */, + B7394870229F194200C47603 /* LaunchScreen.storyboard */, + B7394873229F194200C47603 /* Info.plist */, + B739486D229F194200C47603 /* Preview Content */, + ); + path = Landmarks; + sourceTree = ""; + }; + B739486D229F194200C47603 /* Preview Content */ = { + isa = PBXGroup; + children = ( + B739486E229F194200C47603 /* Preview Assets.xcassets */, + ); + path = "Preview Content"; + sourceTree = ""; + }; + B739487D229F1C0100C47603 /* Supporting Views */ = { + isa = PBXGroup; + children = ( + B7394879229F1B3F00C47603 /* CircleImage.swift */, + B739487B229F1B6800C47603 /* MapView.swift */, + ); + path = "Supporting Views"; + sourceTree = ""; + }; + B739487E229F282200C47603 /* Models */ = { + isa = PBXGroup; + children = ( + B7394880229F28B900C47603 /* Data.swift */, + B739487F229F28B900C47603 /* Landmark.swift */, + ); + path = Models; + sourceTree = ""; + }; + B7394883229F291A00C47603 /* Resources */ = { + isa = PBXGroup; + children = ( + B739488E229F292E00C47603 /* landmarkData.json */, + B7394890229F292F00C47603 /* chilkoottrail.jpg */, + B739488F229F292F00C47603 /* chincoteague.jpg */, + B739488A229F292E00C47603 /* hiddenlake.jpg */, + B7394886229F292E00C47603 /* icybay.jpg */, + B7394887229F292E00C47603 /* lakemcdonald.jpg */, + B7394884229F292D00C47603 /* rainbowlake.jpg */, + B739488D229F292E00C47603 /* silversalmoncreek.jpg */, + B739488B229F292E00C47603 /* stmarylake.jpg */, + B7394888229F292E00C47603 /* turtlerock.jpg */, + B739488C229F292E00C47603 /* twinlake.jpg */, + B7394889229F292E00C47603 /* umbagog.jpg */, + B7394885229F292D00C47603 /* yukon_charleyrivers.jpg */, + ); + path = Resources; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + B7394861229F194000C47603 /* Landmarks */ = { + isa = PBXNativeTarget; + buildConfigurationList = B7394876229F194200C47603 /* Build configuration list for PBXNativeTarget "Landmarks" */; + buildPhases = ( + B739485E229F194000C47603 /* Sources */, + B739485F229F194000C47603 /* Frameworks */, + B7394860229F194000C47603 /* Resources */, + C602AC70C605937000000001, + ); + buildRules = ( + ); + dependencies = ( + ); + name = Landmarks; + productName = Landmarks; + productReference = B7394862229F194000C47603 /* Landmarks.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + B739485A229F194000C47603 /* Project object */ = { + isa = PBXProject; + attributes = { + LastSwiftUpdateCheck = 1100; + LastUpgradeCheck = 1100; + ORGANIZATIONNAME = Apple; + TargetAttributes = { + B7394861229F194000C47603 = { + CreatedOnToolsVersion = 11.0; + }; + }; + }; + buildConfigurationList = B739485D229F194000C47603 /* Build configuration list for PBXProject "BuildingListsAndNavigation" */; + compatibilityVersion = "Xcode 9.3"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = B7394859229F194000C47603; + productRefGroup = B7394863229F194000C47603 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + B7394861229F194000C47603 /* Landmarks */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + B7394860229F194000C47603 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + B739489A229F292F00C47603 /* silversalmoncreek.jpg in Resources */, + B7394894229F292F00C47603 /* lakemcdonald.jpg in Resources */, + B7394872229F194200C47603 /* LaunchScreen.storyboard in Resources */, + B7394891229F292F00C47603 /* rainbowlake.jpg in Resources */, + B739486F229F194200C47603 /* Preview Assets.xcassets in Resources */, + B7394895229F292F00C47603 /* turtlerock.jpg in Resources */, + B739486C229F194200C47603 /* Assets.xcassets in Resources */, + B7394899229F292F00C47603 /* twinlake.jpg in Resources */, + B7394896229F292F00C47603 /* umbagog.jpg in Resources */, + B739489D229F292F00C47603 /* chilkoottrail.jpg in Resources */, + B739489C229F292F00C47603 /* chincoteague.jpg in Resources */, + B739489B229F292F00C47603 /* landmarkData.json in Resources */, + B7394893229F292F00C47603 /* icybay.jpg in Resources */, + B7394897229F292F00C47603 /* hiddenlake.jpg in Resources */, + B7394898229F292F00C47603 /* stmarylake.jpg in Resources */, + B7394892229F292F00C47603 /* yukon_charleyrivers.jpg in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + B739485E229F194000C47603 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + B7394882229F28B900C47603 /* Data.swift in Sources */, + B7394866229F194000C47603 /* AppDelegate.swift in Sources */, + B739487A229F1B3F00C47603 /* CircleImage.swift in Sources */, + B739487C229F1B6800C47603 /* MapView.swift in Sources */, + B73948A1229F2E1F00C47603 /* LandmarkList.swift in Sources */, + B7394868229F194000C47603 /* SceneDelegate.swift in Sources */, + B739486A229F194000C47603 /* LandmarkDetail.swift in Sources */, + B739489F229F2D9700C47603 /* LandmarkRow.swift in Sources */, + B7394881229F28B900C47603 /* Landmark.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXVariantGroup section */ + B7394870229F194200C47603 /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + B7394871229F194200C47603 /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + B7394874229F194200C47603 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 875A65A0875A67A000000001 /* SampleCode.xcconfig */; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 13.0; + MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; + MTL_FAST_MATH = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + }; + name = Debug; + }; + B7394875229F194200C47603 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 875A65A0875A67A000000001 /* SampleCode.xcconfig */; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 13.0; + MTL_ENABLE_DEBUG_INFO = NO; + MTL_FAST_MATH = YES; + SDKROOT = iphoneos; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + B7394877229F194200C47603 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 875A65A0875A67A000000001 /* SampleCode.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_ASSET_PATHS = "Landmarks/Preview\\ Content"; + DEVELOPMENT_TEAM = ""; + ENABLE_PREVIEWS = YES; + INFOPLIST_FILE = Landmarks/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = "com.example.apple-samplecode.Landmarks${SAMPLE_CODE_DISAMBIGUATOR}"; + PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE_SPECIFIER = ""; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + B7394878229F194200C47603 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 875A65A0875A67A000000001 /* SampleCode.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_ASSET_PATHS = "Landmarks/Preview\\ Content"; + DEVELOPMENT_TEAM = ""; + ENABLE_PREVIEWS = YES; + INFOPLIST_FILE = Landmarks/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = "com.example.apple-samplecode.Landmarks${SAMPLE_CODE_DISAMBIGUATOR}"; + PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE_SPECIFIER = ""; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + B739485D229F194000C47603 /* Build configuration list for PBXProject "BuildingListsAndNavigation" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + B7394874229F194200C47603 /* Debug */, + B7394875229F194200C47603 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + B7394876229F194200C47603 /* Build configuration list for PBXNativeTarget "Landmarks" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + B7394877229F194200C47603 /* Debug */, + B7394878229F194200C47603 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = B739485A229F194000C47603 /* Project object */; +} diff --git a/Examples/BuildingListsAndNavigation/Complete/Landmarks/BuildingListsAndNavigation.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/Examples/BuildingListsAndNavigation/Complete/Landmarks/BuildingListsAndNavigation.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings new file mode 100755 index 0000000..3ddf867 --- /dev/null +++ b/Examples/BuildingListsAndNavigation/Complete/Landmarks/BuildingListsAndNavigation.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings @@ -0,0 +1,8 @@ + + + + + BuildSystemType + Latest + + diff --git a/Examples/BuildingListsAndNavigation/Complete/Landmarks/Landmarks/AppDelegate.swift b/Examples/BuildingListsAndNavigation/Complete/Landmarks/Landmarks/AppDelegate.swift new file mode 100755 index 0000000..e22943b --- /dev/null +++ b/Examples/BuildingListsAndNavigation/Complete/Landmarks/Landmarks/AppDelegate.swift @@ -0,0 +1,36 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +The application delegate. +*/ + +import UIKit + +@UIApplicationMain +class AppDelegate: UIResponder, UIApplicationDelegate { + + func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { + // Override point for customization after application launch. + return true + } + + func applicationWillTerminate(_ application: UIApplication) { + // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. + } + + // MARK: UISceneSession Lifecycle + func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration { + // Called when a new scene session is being created. + // Use this method to select a configuration to create the new scene with. + return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role) + } + + func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set) { + // Called when the user discards a scene session. + // If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions. + // Use this method to release any resources that were specific to the discarded scenes, as they will not return. + } + +} + diff --git a/Examples/BuildingListsAndNavigation/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/Contents.json b/Examples/BuildingListsAndNavigation/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100755 index 0000000..6ab6c31 --- /dev/null +++ b/Examples/BuildingListsAndNavigation/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,112 @@ +{ + "images" : [ + { + "size" : "20x20", + "idiom" : "iphone", + "filename" : "landmark_app_icon_40x40.png", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "20x20", + "scale" : "3x" + }, + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "landmark_app_icon_58x58.png", + "scale" : "2x" + }, + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "landmark_app_icon_87x87.png", + "scale" : "3x" + }, + { + "size" : "40x40", + "idiom" : "iphone", + "filename" : "landmark_app_icon_80x80.png", + "scale" : "2x" + }, + { + "size" : "40x40", + "idiom" : "iphone", + "filename" : "landmark_app_icon_120x120.png", + "scale" : "3x" + }, + { + "size" : "60x60", + "idiom" : "iphone", + "filename" : "landmark_app_icon_120x120-1.png", + "scale" : "2x" + }, + { + "size" : "60x60", + "idiom" : "iphone", + "filename" : "landmark_app_icon_180x180.png", + "scale" : "3x" + }, + { + "idiom" : "ipad", + "size" : "20x20", + "scale" : "1x" + }, + { + "size" : "20x20", + "idiom" : "ipad", + "filename" : "landmark_app_icon_40x40-1.png", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "29x29", + "scale" : "1x" + }, + { + "size" : "29x29", + "idiom" : "ipad", + "filename" : "landmark_app_icon_58x58-1.png", + "scale" : "2x" + }, + { + "size" : "40x40", + "idiom" : "ipad", + "filename" : "landmark_app_icon_40x40-2.png", + "scale" : "1x" + }, + { + "size" : "40x40", + "idiom" : "ipad", + "filename" : "landmark_app_icon_80x80-1.png", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "76x76", + "scale" : "1x" + }, + { + "size" : "76x76", + "idiom" : "ipad", + "filename" : "landmark_app_icon_152x152.png", + "scale" : "2x" + }, + { + "size" : "83.5x83.5", + "idiom" : "ipad", + "filename" : "landmark_app_icon_167x167.png", + "scale" : "2x" + }, + { + "size" : "1024x1024", + "idiom" : "ios-marketing", + "filename" : "landmark_app_icon_1024x1024.png", + "scale" : "1x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Examples/BuildingListsAndNavigation/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_1024x1024.png b/Examples/BuildingListsAndNavigation/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_1024x1024.png new file mode 100755 index 0000000..00d81c1 Binary files /dev/null and b/Examples/BuildingListsAndNavigation/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_1024x1024.png differ diff --git a/Examples/BuildingListsAndNavigation/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_120x120-1.png b/Examples/BuildingListsAndNavigation/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_120x120-1.png new file mode 100755 index 0000000..d382b8b Binary files /dev/null and b/Examples/BuildingListsAndNavigation/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_120x120-1.png differ diff --git a/Examples/BuildingListsAndNavigation/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_120x120.png b/Examples/BuildingListsAndNavigation/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_120x120.png new file mode 100755 index 0000000..d382b8b Binary files /dev/null and b/Examples/BuildingListsAndNavigation/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_120x120.png differ diff --git a/Examples/BuildingListsAndNavigation/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_152x152.png b/Examples/BuildingListsAndNavigation/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_152x152.png new file mode 100755 index 0000000..11057f8 Binary files /dev/null and b/Examples/BuildingListsAndNavigation/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_152x152.png differ diff --git a/Examples/BuildingListsAndNavigation/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_167x167.png b/Examples/BuildingListsAndNavigation/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_167x167.png new file mode 100755 index 0000000..f73bc26 Binary files /dev/null and b/Examples/BuildingListsAndNavigation/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_167x167.png differ diff --git a/Examples/BuildingListsAndNavigation/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_180x180.png b/Examples/BuildingListsAndNavigation/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_180x180.png new file mode 100755 index 0000000..b02738c Binary files /dev/null and b/Examples/BuildingListsAndNavigation/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_180x180.png differ diff --git a/Examples/BuildingListsAndNavigation/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_40x40-1.png b/Examples/BuildingListsAndNavigation/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_40x40-1.png new file mode 100755 index 0000000..abaff0e Binary files /dev/null and b/Examples/BuildingListsAndNavigation/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_40x40-1.png differ diff --git a/Examples/BuildingListsAndNavigation/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_40x40-2.png b/Examples/BuildingListsAndNavigation/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_40x40-2.png new file mode 100755 index 0000000..abaff0e Binary files /dev/null and b/Examples/BuildingListsAndNavigation/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_40x40-2.png differ diff --git a/Examples/BuildingListsAndNavigation/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_40x40.png b/Examples/BuildingListsAndNavigation/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_40x40.png new file mode 100755 index 0000000..abaff0e Binary files /dev/null and b/Examples/BuildingListsAndNavigation/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_40x40.png differ diff --git a/Examples/BuildingListsAndNavigation/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_58x58-1.png b/Examples/BuildingListsAndNavigation/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_58x58-1.png new file mode 100755 index 0000000..cf7c73d Binary files /dev/null and b/Examples/BuildingListsAndNavigation/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_58x58-1.png differ diff --git a/Examples/BuildingListsAndNavigation/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_58x58.png b/Examples/BuildingListsAndNavigation/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_58x58.png new file mode 100755 index 0000000..cf7c73d Binary files /dev/null and b/Examples/BuildingListsAndNavigation/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_58x58.png differ diff --git a/Examples/BuildingListsAndNavigation/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_80x80-1.png b/Examples/BuildingListsAndNavigation/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_80x80-1.png new file mode 100755 index 0000000..6f33f66 Binary files /dev/null and b/Examples/BuildingListsAndNavigation/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_80x80-1.png differ diff --git a/Examples/BuildingListsAndNavigation/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_80x80.png b/Examples/BuildingListsAndNavigation/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_80x80.png new file mode 100755 index 0000000..6f33f66 Binary files /dev/null and b/Examples/BuildingListsAndNavigation/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_80x80.png differ diff --git a/Examples/BuildingListsAndNavigation/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_87x87.png b/Examples/BuildingListsAndNavigation/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_87x87.png new file mode 100755 index 0000000..9e1616c Binary files /dev/null and b/Examples/BuildingListsAndNavigation/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_87x87.png differ diff --git a/Examples/BuildingListsAndNavigation/Complete/Landmarks/Landmarks/Assets.xcassets/Contents.json b/Examples/BuildingListsAndNavigation/Complete/Landmarks/Landmarks/Assets.xcassets/Contents.json new file mode 100755 index 0000000..da4a164 --- /dev/null +++ b/Examples/BuildingListsAndNavigation/Complete/Landmarks/Landmarks/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Examples/BuildingListsAndNavigation/Complete/Landmarks/Landmarks/Assets.xcassets/turtlerock.imageset/Contents.json b/Examples/BuildingListsAndNavigation/Complete/Landmarks/Landmarks/Assets.xcassets/turtlerock.imageset/Contents.json new file mode 100755 index 0000000..5bfd7bf --- /dev/null +++ b/Examples/BuildingListsAndNavigation/Complete/Landmarks/Landmarks/Assets.xcassets/turtlerock.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "turtlerock.jpg", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Examples/BuildingListsAndNavigation/Complete/Landmarks/Landmarks/Assets.xcassets/turtlerock.imageset/turtlerock.jpg b/Examples/BuildingListsAndNavigation/Complete/Landmarks/Landmarks/Assets.xcassets/turtlerock.imageset/turtlerock.jpg new file mode 100755 index 0000000..68bcd3e Binary files /dev/null and b/Examples/BuildingListsAndNavigation/Complete/Landmarks/Landmarks/Assets.xcassets/turtlerock.imageset/turtlerock.jpg differ diff --git a/Examples/BuildingListsAndNavigation/Complete/Landmarks/Landmarks/Base.lproj/LaunchScreen.storyboard b/Examples/BuildingListsAndNavigation/Complete/Landmarks/Landmarks/Base.lproj/LaunchScreen.storyboard new file mode 100755 index 0000000..865e932 --- /dev/null +++ b/Examples/BuildingListsAndNavigation/Complete/Landmarks/Landmarks/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Examples/BuildingListsAndNavigation/Complete/Landmarks/Landmarks/Info.plist b/Examples/BuildingListsAndNavigation/Complete/Landmarks/Landmarks/Info.plist new file mode 100755 index 0000000..e8bb4c6 --- /dev/null +++ b/Examples/BuildingListsAndNavigation/Complete/Landmarks/Landmarks/Info.plist @@ -0,0 +1,62 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + $(PRODUCT_BUNDLE_PACKAGE_TYPE) + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1 + LSRequiresIPhoneOS + + UIApplicationSceneManifest + + UIApplicationSupportsMultipleScenes + + UISceneConfigurations + + UIWindowSceneSessionRoleApplication + + + UILaunchStoryboardName + LaunchScreen + UISceneConfigurationName + Default Configuration + UISceneDelegateClassName + $(PRODUCT_MODULE_NAME).SceneDelegate + + + + + UILaunchStoryboardName + LaunchScreen + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/Examples/BuildingListsAndNavigation/Complete/Landmarks/Landmarks/LandmarkDetail.swift b/Examples/BuildingListsAndNavigation/Complete/Landmarks/Landmarks/LandmarkDetail.swift new file mode 100755 index 0000000..e957172 --- /dev/null +++ b/Examples/BuildingListsAndNavigation/Complete/Landmarks/Landmarks/LandmarkDetail.swift @@ -0,0 +1,48 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +A view showing the details for a landmark. +*/ + +import SwiftUI + +struct LandmarkDetail: View { + var landmark: Landmark + + var body: some View { + VStack { + MapView(coordinate: landmark.locationCoordinate) + .frame(height: 300) + + CircleImage(image: landmark.image(forSize: 250)) + .offset(x: 0, y: -130) + .padding(.bottom, -130) + + VStack(alignment: .leading) { + Text(landmark.name) + .font(.title) + + HStack(alignment: .top) { + Text(landmark.park) + .font(.subheadline) + Spacer() + Text(landmark.state) + .font(.subheadline) + } + } + .padding() + + Spacer() + } + .navigationBarTitle(Text(verbatim: landmark.name), displayMode: .inline) + } +} + +#if DEBUG +struct LandmarkDetail_Previews: PreviewProvider { + static var previews: some View { + LandmarkDetail(landmark: landmarkData[0]) + } +} +#endif diff --git a/Examples/BuildingListsAndNavigation/Complete/Landmarks/Landmarks/LandmarkList.swift b/Examples/BuildingListsAndNavigation/Complete/Landmarks/Landmarks/LandmarkList.swift new file mode 100755 index 0000000..1c5b7ee --- /dev/null +++ b/Examples/BuildingListsAndNavigation/Complete/Landmarks/Landmarks/LandmarkList.swift @@ -0,0 +1,33 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +A view showing a list of landmarks. +*/ + +import SwiftUI + +struct LandmarkList: View { + var body: some View { + NavigationView { + List(landmarkData) { landmark in + NavigationButton(destination: LandmarkDetail(landmark: landmark)) { + LandmarkRow(landmark: landmark) + } + } + .navigationBarTitle(Text("Landmarks"), displayMode: .large) + } + } +} + +#if DEBUG +struct LandmarkList_Previews: PreviewProvider { + static var previews: some View { + ForEach(["iPhone SE", "iPhone XS Max"].identified(by: \.self)) { deviceName in + LandmarkList() + .previewDevice(PreviewDevice(rawValue: deviceName)) + .previewDisplayName(deviceName) + } + } +} +#endif diff --git a/Examples/BuildingListsAndNavigation/Complete/Landmarks/Landmarks/Models/Data.swift b/Examples/BuildingListsAndNavigation/Complete/Landmarks/Landmarks/Models/Data.swift new file mode 100755 index 0000000..78837f6 --- /dev/null +++ b/Examples/BuildingListsAndNavigation/Complete/Landmarks/Landmarks/Models/Data.swift @@ -0,0 +1,93 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +Helpers for loading images and data. +*/ + +import UIKit +import SwiftUI +import CoreLocation + +let landmarkData: [Landmark] = load("landmarkData.json") + +func load(_ filename: String, as type: T.Type = T.self) -> T { + let data: Data + + guard let file = Bundle.main.url(forResource: filename, withExtension: nil) + else { + fatalError("Couldn't find \(filename) in main bundle.") + } + + do { + data = try Data(contentsOf: file) + } catch { + fatalError("Couldn't load \(filename) from main bundle:\n\(error)") + } + + do { + let decoder = JSONDecoder() + return try decoder.decode(T.self, from: data) + } catch { + fatalError("Couldn't parse \(filename) as \(T.self):\n\(error)") + } +} + +final class ImageStore { + fileprivate typealias _ImageDictionary = [String: [Int: CGImage]] + fileprivate var images: _ImageDictionary = [:] + + fileprivate static var originalSize = 250 + fileprivate static var scale = 2 + + static var shared = ImageStore() + + func image(name: String, size: Int) -> Image { + let index = _guaranteeInitialImage(name: name) + + let sizedImage = images.values[index][size] + ?? _sizeImage(images.values[index][ImageStore.originalSize]!, to: size * ImageStore.scale) + images.values[index][size] = sizedImage + + return Image(sizedImage, scale: Length(ImageStore.scale), label: Text(verbatim: name)) + } + + fileprivate func _guaranteeInitialImage(name: String) -> _ImageDictionary.Index { + if let index = images.index(forKey: name) { return index } + + guard + let url = Bundle.main.url(forResource: name, withExtension: "jpg"), + let imageSource = CGImageSourceCreateWithURL(url as NSURL, nil), + let image = CGImageSourceCreateImageAtIndex(imageSource, 0, nil) + else { + fatalError("Couldn't load image \(name).jpg from main bundle.") + } + + images[name] = [ImageStore.originalSize: image] + return images.index(forKey: name)! + } + + fileprivate func _sizeImage(_ image: CGImage, to size: Int) -> CGImage { + guard + let colorSpace = image.colorSpace, + let context = CGContext( + data: nil, + width: size, height: size, + bitsPerComponent: image.bitsPerComponent, + bytesPerRow: image.bytesPerRow, + space: colorSpace, + bitmapInfo: image.bitmapInfo.rawValue) + else { + fatalError("Couldn't create graphics context.") + } + context.interpolationQuality = .high + context.draw(image, in: CGRect(x: 0, y: 0, width: size, height: size)) + + if let sizedImage = context.makeImage() { + return sizedImage + } else { + fatalError("Couldn't resize image.") + } + } +} + diff --git a/Examples/BuildingListsAndNavigation/Complete/Landmarks/Landmarks/Models/Landmark.swift b/Examples/BuildingListsAndNavigation/Complete/Landmarks/Landmarks/Models/Landmark.swift new file mode 100755 index 0000000..f0be98d --- /dev/null +++ b/Examples/BuildingListsAndNavigation/Complete/Landmarks/Landmarks/Models/Landmark.swift @@ -0,0 +1,40 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +The model for an individual landmark. +*/ + +import SwiftUI +import CoreLocation + +struct Landmark: Hashable, Codable, Identifiable { + var id: Int + var name: String + fileprivate var imageName: String + fileprivate var coordinates: Coordinates + var state: String + var park: String + var category: Category + + var locationCoordinate: CLLocationCoordinate2D { + CLLocationCoordinate2D( + latitude: coordinates.latitude, + longitude: coordinates.longitude) + } + + func image(forSize size: Int) -> Image { + ImageStore.shared.image(name: imageName, size: size) + } + + enum Category: String, CaseIterable, Codable, Hashable { + case featured = "Featured" + case lakes = "Lakes" + case rivers = "Rivers" + } +} + +struct Coordinates: Hashable, Codable { + var latitude: Double + var longitude: Double +} diff --git a/Examples/BuildingListsAndNavigation/Complete/Landmarks/Landmarks/Preview Content/Preview Assets.xcassets/Contents.json b/Examples/BuildingListsAndNavigation/Complete/Landmarks/Landmarks/Preview Content/Preview Assets.xcassets/Contents.json new file mode 100755 index 0000000..da4a164 --- /dev/null +++ b/Examples/BuildingListsAndNavigation/Complete/Landmarks/Landmarks/Preview Content/Preview Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Examples/BuildingListsAndNavigation/Complete/Landmarks/Landmarks/Resources/chilkoottrail.jpg b/Examples/BuildingListsAndNavigation/Complete/Landmarks/Landmarks/Resources/chilkoottrail.jpg new file mode 100755 index 0000000..e7f805e Binary files /dev/null and b/Examples/BuildingListsAndNavigation/Complete/Landmarks/Landmarks/Resources/chilkoottrail.jpg differ diff --git a/Examples/BuildingListsAndNavigation/Complete/Landmarks/Landmarks/Resources/chincoteague.jpg b/Examples/BuildingListsAndNavigation/Complete/Landmarks/Landmarks/Resources/chincoteague.jpg new file mode 100755 index 0000000..5f47986 Binary files /dev/null and b/Examples/BuildingListsAndNavigation/Complete/Landmarks/Landmarks/Resources/chincoteague.jpg differ diff --git a/Examples/BuildingListsAndNavigation/Complete/Landmarks/Landmarks/Resources/hiddenlake.jpg b/Examples/BuildingListsAndNavigation/Complete/Landmarks/Landmarks/Resources/hiddenlake.jpg new file mode 100755 index 0000000..d8e804c Binary files /dev/null and b/Examples/BuildingListsAndNavigation/Complete/Landmarks/Landmarks/Resources/hiddenlake.jpg differ diff --git a/Examples/BuildingListsAndNavigation/Complete/Landmarks/Landmarks/Resources/icybay.jpg b/Examples/BuildingListsAndNavigation/Complete/Landmarks/Landmarks/Resources/icybay.jpg new file mode 100755 index 0000000..feb1764 Binary files /dev/null and b/Examples/BuildingListsAndNavigation/Complete/Landmarks/Landmarks/Resources/icybay.jpg differ diff --git a/Examples/BuildingListsAndNavigation/Complete/Landmarks/Landmarks/Resources/lakemcdonald.jpg b/Examples/BuildingListsAndNavigation/Complete/Landmarks/Landmarks/Resources/lakemcdonald.jpg new file mode 100755 index 0000000..bd9d6b9 Binary files /dev/null and b/Examples/BuildingListsAndNavigation/Complete/Landmarks/Landmarks/Resources/lakemcdonald.jpg differ diff --git a/Examples/BuildingListsAndNavigation/Complete/Landmarks/Landmarks/Resources/landmarkData.json b/Examples/BuildingListsAndNavigation/Complete/Landmarks/Landmarks/Resources/landmarkData.json new file mode 100755 index 0000000..01a9691 --- /dev/null +++ b/Examples/BuildingListsAndNavigation/Complete/Landmarks/Landmarks/Resources/landmarkData.json @@ -0,0 +1,158 @@ +[ + { + "name": "Turtle Rock", + "category": "Featured", + "city": "Twentynine Palms", + "state": "California", + "id": 1001, + "park": "Joshua Tree National Park", + "coordinates": { + "longitude": -116.166868, + "latitude": 34.011286 + }, + "imageName": "turtlerock" + }, + { + "name": "Silver Salmon Creek", + "category": "Lakes", + "city": "Port Alsworth", + "state": "Alaska", + "id": 4, + "park": "Lake Clark National Park and Preserve", + "coordinates": { + "longitude": -152.665167, + "latitude": 59.980167 + }, + "imageName": "silversalmoncreek" + }, + { + "name": "Chilkoot Trail", + "category": "Rivers", + "city": "Skagway", + "state": "Alaska", + "id": 5, + "park": "Klondike Gold Rush National Historical Park", + "coordinates": { + "longitude": -135.334571, + "latitude": 59.560551 + }, + "imageName": "chilkoottrail" + }, + { + "name": "St. Mary Lake", + "category": "Lakes", + "city": "Browning", + "state": "Montana", + "id": 8, + "park": "Glacier National Park", + "coordinates": { + "longitude": -113.536248, + "latitude": 48.69423 + }, + "imageName": "stmarylake" + }, + { + "name": "Twin Lake", + "category": "Lakes", + "city": "Twin Lakes", + "state": "Alaska", + "id": 11, + "park": "Lake Clark National Park and Preserve", + "coordinates": { + "longitude": -153.849883, + "latitude": 60.641684 + }, + "imageName": "twinlake" + }, + { + "name": "Lake McDonald", + "category": "Lakes", + "city": "West Glacier", + "state": "Montana", + "id": 6, + "park": "Glacier National Park", + "coordinates": { + "longitude": -113.934831, + "latitude": 48.56002 + }, + "imageName": "lakemcdonald" + }, + { + "name": "Charley Rivers", + "category": "Rivers", + "city": "Eaking", + "state": "Alaska", + "id": 1, + "park": "Charley Rivers National Preserve", + "coordinates": { + "longitude": -143.122586, + "latitude": 65.350021 + }, + "imageName": "yukon_charleyrivers" + }, + { + "name": "Icy Bay", + "category": "Lakes", + "city": "Icy Bay", + "state": "Alaska", + "id": 2, + "park": "Wrangell-St. Elias National Park and Preserve", + "coordinates": { + "longitude": -141.518167, + "latitude": 60.089917 + }, + "imageName": "icybay" + }, + { + "name": "Rainbow Lake", + "category": "Lakes", + "city": "Willow", + "state": "Alaska", + "id": 3, + "park": "State Recreation Area", + "coordinates": { + "longitude": -150.086103, + "latitude": 61.694334 + }, + "imageName": "rainbowlake" + }, + { + "name": "Hidden Lake", + "category": "Lakes", + "city": "Newhalem", + "state": "Washington", + "id": 7, + "park": "North Cascades National Park", + "coordinates": { + "longitude": -121.17799, + "latitude": 48.495442 + }, + "imageName": "hiddenlake" + }, + { + "name": "Chincoteague", + "category": "Rivers", + "city": "Chincoteague", + "state": "Virginia", + "id": 9, + "park": "Chincoteague National Wildlife Refuge", + "coordinates": { + "longitude": -75.383212, + "latitude": 37.91531 + }, + "imageName": "chincoteague" + }, + { + "name": "Lake Umbagog", + "category": "Lakes", + "city": "Errol", + "state": "New Hampshire", + "id": 10, + "park": "Umbagog National Wildlife Refuge", + "coordinates": { + "longitude": -71.056816, + "latitude": 44.747408 + }, + "imageName": "umbagog" + } +] diff --git a/Examples/BuildingListsAndNavigation/Complete/Landmarks/Landmarks/Resources/rainbowlake.jpg b/Examples/BuildingListsAndNavigation/Complete/Landmarks/Landmarks/Resources/rainbowlake.jpg new file mode 100755 index 0000000..6da43dd Binary files /dev/null and b/Examples/BuildingListsAndNavigation/Complete/Landmarks/Landmarks/Resources/rainbowlake.jpg differ diff --git a/Examples/BuildingListsAndNavigation/Complete/Landmarks/Landmarks/Resources/silversalmoncreek.jpg b/Examples/BuildingListsAndNavigation/Complete/Landmarks/Landmarks/Resources/silversalmoncreek.jpg new file mode 100755 index 0000000..f657532 Binary files /dev/null and b/Examples/BuildingListsAndNavigation/Complete/Landmarks/Landmarks/Resources/silversalmoncreek.jpg differ diff --git a/Examples/BuildingListsAndNavigation/Complete/Landmarks/Landmarks/Resources/stmarylake.jpg b/Examples/BuildingListsAndNavigation/Complete/Landmarks/Landmarks/Resources/stmarylake.jpg new file mode 100755 index 0000000..1c71de4 Binary files /dev/null and b/Examples/BuildingListsAndNavigation/Complete/Landmarks/Landmarks/Resources/stmarylake.jpg differ diff --git a/Examples/BuildingListsAndNavigation/Complete/Landmarks/Landmarks/Resources/turtlerock.jpg b/Examples/BuildingListsAndNavigation/Complete/Landmarks/Landmarks/Resources/turtlerock.jpg new file mode 100755 index 0000000..f7a6e6d Binary files /dev/null and b/Examples/BuildingListsAndNavigation/Complete/Landmarks/Landmarks/Resources/turtlerock.jpg differ diff --git a/Examples/BuildingListsAndNavigation/Complete/Landmarks/Landmarks/Resources/twinlake.jpg b/Examples/BuildingListsAndNavigation/Complete/Landmarks/Landmarks/Resources/twinlake.jpg new file mode 100755 index 0000000..3e7a57c Binary files /dev/null and b/Examples/BuildingListsAndNavigation/Complete/Landmarks/Landmarks/Resources/twinlake.jpg differ diff --git a/Examples/BuildingListsAndNavigation/Complete/Landmarks/Landmarks/Resources/umbagog.jpg b/Examples/BuildingListsAndNavigation/Complete/Landmarks/Landmarks/Resources/umbagog.jpg new file mode 100755 index 0000000..56291c6 Binary files /dev/null and b/Examples/BuildingListsAndNavigation/Complete/Landmarks/Landmarks/Resources/umbagog.jpg differ diff --git a/Examples/BuildingListsAndNavigation/Complete/Landmarks/Landmarks/Resources/yukon_charleyrivers.jpg b/Examples/BuildingListsAndNavigation/Complete/Landmarks/Landmarks/Resources/yukon_charleyrivers.jpg new file mode 100755 index 0000000..17ff44b Binary files /dev/null and b/Examples/BuildingListsAndNavigation/Complete/Landmarks/Landmarks/Resources/yukon_charleyrivers.jpg differ diff --git a/Examples/BuildingListsAndNavigation/Complete/Landmarks/Landmarks/SceneDelegate.swift b/Examples/BuildingListsAndNavigation/Complete/Landmarks/Landmarks/SceneDelegate.swift new file mode 100755 index 0000000..c4d69a9 --- /dev/null +++ b/Examples/BuildingListsAndNavigation/Complete/Landmarks/Landmarks/SceneDelegate.swift @@ -0,0 +1,56 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +The scene delegate. +*/ + +import UIKit +import SwiftUI + +class SceneDelegate: UIResponder, UIWindowSceneDelegate { + + var window: UIWindow? + + func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) { + // Use this method to optionally configure and attach the UIWindow `window` to the provided UIWindowScene `scene`. + // If using a storyboard, the `window` property will automatically be initialized and attached to the scene. + // This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead). + + // Use a UIHostingController as window root view controller + let window = UIWindow(frame: UIScreen.main.bounds) + window.rootViewController = UIHostingController(rootView: LandmarkList()) + self.window = window + window.makeKeyAndVisible() + } + + func sceneDidDisconnect(_ scene: UIScene) { + // Called as the scene is being released by the system. + // This occurs shortly after the scene enters the background, or when its session is discarded. + // Release any resources associated with this scene that can be re-created the next time the scene connects. + // The scene may re-connect later, as its session was not neccessarily discarded (see `application:didDiscardSceneSessions` instead). + } + + func sceneDidBecomeActive(_ scene: UIScene) { + // Called when the scene has moved from an inactive state to an active state. + // Use this method to restart any tasks that were paused (or not yet started) when the scene was inactive. + } + + func sceneWillResignActive(_ scene: UIScene) { + // Called when the scene will move from an active state to an inactive state. + // This may occur due to temporary interruptions (ex. an incoming phone call). + } + + func sceneWillEnterForeground(_ scene: UIScene) { + // Called as the scene transitions from the background to the foreground. + // Use this method to undo the changes made on entering the background. + } + + func sceneDidEnterBackground(_ scene: UIScene) { + // Called as the scene transitions from the foreground to the background. + // Use this method to save data, release shared resources, and store enough scene-specific state information + // to restore the scene back to its current state. + } + +} + diff --git a/Examples/BuildingListsAndNavigation/Complete/Landmarks/Landmarks/Supporting Views/CircleImage.swift b/Examples/BuildingListsAndNavigation/Complete/Landmarks/Landmarks/Supporting Views/CircleImage.swift new file mode 100755 index 0000000..ae44439 --- /dev/null +++ b/Examples/BuildingListsAndNavigation/Complete/Landmarks/Landmarks/Supporting Views/CircleImage.swift @@ -0,0 +1,27 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +A view that clips an image to a circle and adds a stroke and shadow. +*/ + +import SwiftUI + +struct CircleImage: View { + var image: Image + + var body: some View { + image + .clipShape(Circle()) + .overlay(Circle().stroke(Color.white, lineWidth: 4)) + .shadow(radius: 10) + } +} + +#if DEBUG +struct CircleImage_Previews: PreviewProvider { + static var previews: some View { + CircleImage(image: Image("turtlerock")) + } +} +#endif diff --git a/Examples/BuildingListsAndNavigation/Complete/Landmarks/Landmarks/Supporting Views/LandmarkRow.swift b/Examples/BuildingListsAndNavigation/Complete/Landmarks/Landmarks/Supporting Views/LandmarkRow.swift new file mode 100755 index 0000000..6a59563 --- /dev/null +++ b/Examples/BuildingListsAndNavigation/Complete/Landmarks/Landmarks/Supporting Views/LandmarkRow.swift @@ -0,0 +1,32 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +A single row to be displayed in a list of landmarks. +*/ + +import SwiftUI + +struct LandmarkRow: View { + var landmark: Landmark + + var body: some View { + HStack { + landmark.image(forSize: 50) + Text(verbatim: landmark.name) + Spacer() + } + } +} + +#if DEBUG +struct LandmarkRow_Previews: PreviewProvider { + static var previews: some View { + Group { + LandmarkRow(landmark: landmarkData[0]) + LandmarkRow(landmark: landmarkData[1]) + } + .previewLayout(.fixed(width: 300, height: 70)) + } +} +#endif diff --git a/Examples/BuildingListsAndNavigation/Complete/Landmarks/Landmarks/Supporting Views/MapView.swift b/Examples/BuildingListsAndNavigation/Complete/Landmarks/Landmarks/Supporting Views/MapView.swift new file mode 100755 index 0000000..5a8c64b --- /dev/null +++ b/Examples/BuildingListsAndNavigation/Complete/Landmarks/Landmarks/Supporting Views/MapView.swift @@ -0,0 +1,31 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +A view that hosts an `MKMapView`. +*/ + +import SwiftUI +import MapKit + +struct MapView: UIViewRepresentable { + var coordinate: CLLocationCoordinate2D + + func makeUIView(context: Context) -> MKMapView { + MKMapView(frame: .zero) + } + + func updateUIView(_ view: MKMapView, context: Context) { + let span = MKCoordinateSpan(latitudeDelta: 0.02, longitudeDelta: 0.02) + let region = MKCoordinateRegion(center: coordinate, span: span) + view.setRegion(region, animated: true) + } +} + +#if DEBUG +struct MapView_Previews: PreviewProvider { + static var previews: some View { + MapView(coordinate: landmarkData[0].locationCoordinate) + } +} +#endif diff --git a/Examples/BuildingListsAndNavigation/Complete/README.md b/Examples/BuildingListsAndNavigation/Complete/README.md new file mode 100755 index 0000000..929abe6 --- /dev/null +++ b/Examples/BuildingListsAndNavigation/Complete/README.md @@ -0,0 +1,3 @@ +# Completed Project: Building Lists and Navigation + +Explore the completed project for the [Building Lists and Navigation](https://developer.apple.com/tutorials/swiftui/building-lists-and-navigation) tutorial. diff --git a/Examples/BuildingListsAndNavigation/StartingPoint/.gitignore b/Examples/BuildingListsAndNavigation/StartingPoint/.gitignore new file mode 100755 index 0000000..9e50718 --- /dev/null +++ b/Examples/BuildingListsAndNavigation/StartingPoint/.gitignore @@ -0,0 +1,21 @@ +# See LICENSE folder for this sample’s licensing information. +# +# Apple sample code gitignore configuration. + +# Finder +.DS_Store + +# Xcode - User files +xcuserdata/ + +**/*.xcodeproj/project.xcworkspace/* +!**/*.xcodeproj/project.xcworkspace/xcshareddata + +**/*.xcodeproj/project.xcworkspace/xcshareddata/* +!**/*.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings + +**/*.playground/playground.xcworkspace/* +!**/*.playground/playground.xcworkspace/xcshareddata + +**/*.playground/playground.xcworkspace/xcshareddata/* +!**/*.playground/playground.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings diff --git a/Examples/BuildingListsAndNavigation/StartingPoint/Configuration/SampleCode.xcconfig b/Examples/BuildingListsAndNavigation/StartingPoint/Configuration/SampleCode.xcconfig new file mode 100755 index 0000000..db86c06 --- /dev/null +++ b/Examples/BuildingListsAndNavigation/StartingPoint/Configuration/SampleCode.xcconfig @@ -0,0 +1,13 @@ +// +// See LICENSE folder for this sample’s licensing information. +// +// SampleCode.xcconfig +// + +// The `SAMPLE_CODE_DISAMBIGUATOR` configuration is to make it easier to build +// and run a sample code project. Once you set your project's development team, +// you'll have a unique bundle identifier. This is because the bundle identifier +// is derived based on the 'SAMPLE_CODE_DISAMBIGUATOR' value. Do not use this +// approach in your own projects—it's only useful for sample code projects because +// they are frequently downloaded and don't have a development team set. +SAMPLE_CODE_DISAMBIGUATOR=${DEVELOPMENT_TEAM} diff --git a/Examples/BuildingListsAndNavigation/StartingPoint/LICENSE/LICENSE.txt b/Examples/BuildingListsAndNavigation/StartingPoint/LICENSE/LICENSE.txt new file mode 100755 index 0000000..94e3d54 --- /dev/null +++ b/Examples/BuildingListsAndNavigation/StartingPoint/LICENSE/LICENSE.txt @@ -0,0 +1,8 @@ +Copyright © 2019 Apple Inc. + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + diff --git a/Examples/BuildingListsAndNavigation/StartingPoint/Landmarks/BuildingListsAndNavigation.xcodeproj/.xcodesamplecode.plist b/Examples/BuildingListsAndNavigation/StartingPoint/Landmarks/BuildingListsAndNavigation.xcodeproj/.xcodesamplecode.plist new file mode 100755 index 0000000..5dd5da8 --- /dev/null +++ b/Examples/BuildingListsAndNavigation/StartingPoint/Landmarks/BuildingListsAndNavigation.xcodeproj/.xcodesamplecode.plist @@ -0,0 +1,5 @@ + + + + + diff --git a/Examples/BuildingListsAndNavigation/StartingPoint/Landmarks/BuildingListsAndNavigation.xcodeproj/project.pbxproj b/Examples/BuildingListsAndNavigation/StartingPoint/Landmarks/BuildingListsAndNavigation.xcodeproj/project.pbxproj new file mode 100755 index 0000000..4d4bd47 --- /dev/null +++ b/Examples/BuildingListsAndNavigation/StartingPoint/Landmarks/BuildingListsAndNavigation.xcodeproj/project.pbxproj @@ -0,0 +1,469 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 50; + objects = { + +/* Begin PBXBuildFile section */ + B7394866229F194000C47603 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7394865229F194000C47603 /* AppDelegate.swift */; }; + B7394868229F194000C47603 /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7394867229F194000C47603 /* SceneDelegate.swift */; }; + B739486A229F194000C47603 /* LandmarkDetail.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7394869229F194000C47603 /* LandmarkDetail.swift */; }; + B739486C229F194200C47603 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = B739486B229F194200C47603 /* Assets.xcassets */; }; + B739486F229F194200C47603 /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = B739486E229F194200C47603 /* Preview Assets.xcassets */; }; + B7394872229F194200C47603 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = B7394870229F194200C47603 /* LaunchScreen.storyboard */; }; + B739487A229F1B3F00C47603 /* CircleImage.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7394879229F1B3F00C47603 /* CircleImage.swift */; }; + B739487C229F1B6800C47603 /* MapView.swift in Sources */ = {isa = PBXBuildFile; fileRef = B739487B229F1B6800C47603 /* MapView.swift */; }; + B7394881229F28B900C47603 /* Landmark.swift in Sources */ = {isa = PBXBuildFile; fileRef = B739487F229F28B900C47603 /* Landmark.swift */; }; + B7394882229F28B900C47603 /* Data.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7394880229F28B900C47603 /* Data.swift */; }; + B7394891229F292F00C47603 /* rainbowlake.jpg in Resources */ = {isa = PBXBuildFile; fileRef = B7394884229F292D00C47603 /* rainbowlake.jpg */; }; + B7394892229F292F00C47603 /* yukon_charleyrivers.jpg in Resources */ = {isa = PBXBuildFile; fileRef = B7394885229F292D00C47603 /* yukon_charleyrivers.jpg */; }; + B7394893229F292F00C47603 /* icybay.jpg in Resources */ = {isa = PBXBuildFile; fileRef = B7394886229F292E00C47603 /* icybay.jpg */; }; + B7394894229F292F00C47603 /* lakemcdonald.jpg in Resources */ = {isa = PBXBuildFile; fileRef = B7394887229F292E00C47603 /* lakemcdonald.jpg */; }; + B7394895229F292F00C47603 /* turtlerock.jpg in Resources */ = {isa = PBXBuildFile; fileRef = B7394888229F292E00C47603 /* turtlerock.jpg */; }; + B7394896229F292F00C47603 /* umbagog.jpg in Resources */ = {isa = PBXBuildFile; fileRef = B7394889229F292E00C47603 /* umbagog.jpg */; }; + B7394897229F292F00C47603 /* hiddenlake.jpg in Resources */ = {isa = PBXBuildFile; fileRef = B739488A229F292E00C47603 /* hiddenlake.jpg */; }; + B7394898229F292F00C47603 /* stmarylake.jpg in Resources */ = {isa = PBXBuildFile; fileRef = B739488B229F292E00C47603 /* stmarylake.jpg */; }; + B7394899229F292F00C47603 /* twinlake.jpg in Resources */ = {isa = PBXBuildFile; fileRef = B739488C229F292E00C47603 /* twinlake.jpg */; }; + B739489A229F292F00C47603 /* silversalmoncreek.jpg in Resources */ = {isa = PBXBuildFile; fileRef = B739488D229F292E00C47603 /* silversalmoncreek.jpg */; }; + B739489B229F292F00C47603 /* landmarkData.json in Resources */ = {isa = PBXBuildFile; fileRef = B739488E229F292E00C47603 /* landmarkData.json */; }; + B739489C229F292F00C47603 /* chincoteague.jpg in Resources */ = {isa = PBXBuildFile; fileRef = B739488F229F292F00C47603 /* chincoteague.jpg */; }; + B739489D229F292F00C47603 /* chilkoottrail.jpg in Resources */ = {isa = PBXBuildFile; fileRef = B7394890229F292F00C47603 /* chilkoottrail.jpg */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + B7394862229F194000C47603 /* Landmarks.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Landmarks.app; sourceTree = BUILT_PRODUCTS_DIR; }; + B7394865229F194000C47603 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + B7394867229F194000C47603 /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = ""; }; + B7394869229F194000C47603 /* LandmarkDetail.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LandmarkDetail.swift; sourceTree = ""; }; + B739486B229F194200C47603 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + B739486E229F194200C47603 /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = ""; }; + B7394871229F194200C47603 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + B7394873229F194200C47603 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + B7394879229F1B3F00C47603 /* CircleImage.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CircleImage.swift; sourceTree = ""; }; + B739487B229F1B6800C47603 /* MapView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MapView.swift; sourceTree = ""; }; + B739487F229F28B900C47603 /* Landmark.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Landmark.swift; sourceTree = ""; }; + B7394880229F28B900C47603 /* Data.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Data.swift; sourceTree = ""; }; + B7394884229F292D00C47603 /* rainbowlake.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = rainbowlake.jpg; sourceTree = ""; }; + B7394885229F292D00C47603 /* yukon_charleyrivers.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = yukon_charleyrivers.jpg; sourceTree = ""; }; + B7394886229F292E00C47603 /* icybay.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = icybay.jpg; sourceTree = ""; }; + B7394887229F292E00C47603 /* lakemcdonald.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = lakemcdonald.jpg; sourceTree = ""; }; + B7394888229F292E00C47603 /* turtlerock.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = turtlerock.jpg; sourceTree = ""; }; + B7394889229F292E00C47603 /* umbagog.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = umbagog.jpg; sourceTree = ""; }; + B739488A229F292E00C47603 /* hiddenlake.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = hiddenlake.jpg; sourceTree = ""; }; + B739488B229F292E00C47603 /* stmarylake.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = stmarylake.jpg; sourceTree = ""; }; + B739488C229F292E00C47603 /* twinlake.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = twinlake.jpg; sourceTree = ""; }; + B739488D229F292E00C47603 /* silversalmoncreek.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = silversalmoncreek.jpg; sourceTree = ""; }; + B739488E229F292E00C47603 /* landmarkData.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = landmarkData.json; sourceTree = ""; }; + B739488F229F292F00C47603 /* chincoteague.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = chincoteague.jpg; sourceTree = ""; }; + B7394890229F292F00C47603 /* chilkoottrail.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = chilkoottrail.jpg; sourceTree = ""; }; + C4E4AAA0C4E4035000000001 /* README.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; name = README.md; path = ../README.md; sourceTree = ""; }; + F4750E80F475342000000001 /* SampleCode.xcconfig */ = {isa = PBXFileReference; name = SampleCode.xcconfig; path = ../Configuration/SampleCode.xcconfig; sourceTree = ""; }; + F479D5A0F479BCB000000001 /* LICENSE.txt */ = {isa = PBXFileReference; includeInIndex = 1; path = LICENSE.txt; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + B739485F229F194000C47603 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + B7394859229F194000C47603 = { + isa = PBXGroup; + children = ( + C4E4AAA0C4E4035000000001 /* README.md */, + B7394864229F194000C47603 /* Landmarks */, + B7394863229F194000C47603 /* Products */, + F475C870F475A24000000001 /* Configuration */, + F479F160F479F93000000001 /* LICENSE */, + ); + sourceTree = ""; + }; + B7394863229F194000C47603 /* Products */ = { + isa = PBXGroup; + children = ( + B7394862229F194000C47603 /* Landmarks.app */, + ); + name = Products; + sourceTree = ""; + }; + B7394864229F194000C47603 /* Landmarks */ = { + isa = PBXGroup; + children = ( + B739487E229F282200C47603 /* Models */, + B7394865229F194000C47603 /* AppDelegate.swift */, + B7394867229F194000C47603 /* SceneDelegate.swift */, + B7394869229F194000C47603 /* LandmarkDetail.swift */, + B739487D229F1C0100C47603 /* Supporting Views */, + B7394883229F291A00C47603 /* Resources */, + B739486B229F194200C47603 /* Assets.xcassets */, + B7394870229F194200C47603 /* LaunchScreen.storyboard */, + B7394873229F194200C47603 /* Info.plist */, + B739486D229F194200C47603 /* Preview Content */, + ); + path = Landmarks; + sourceTree = ""; + }; + B739486D229F194200C47603 /* Preview Content */ = { + isa = PBXGroup; + children = ( + B739486E229F194200C47603 /* Preview Assets.xcassets */, + ); + path = "Preview Content"; + sourceTree = ""; + }; + B739487D229F1C0100C47603 /* Supporting Views */ = { + isa = PBXGroup; + children = ( + B7394879229F1B3F00C47603 /* CircleImage.swift */, + B739487B229F1B6800C47603 /* MapView.swift */, + ); + path = "Supporting Views"; + sourceTree = ""; + }; + B739487E229F282200C47603 /* Models */ = { + isa = PBXGroup; + children = ( + B7394880229F28B900C47603 /* Data.swift */, + B739487F229F28B900C47603 /* Landmark.swift */, + ); + path = Models; + sourceTree = ""; + }; + B7394883229F291A00C47603 /* Resources */ = { + isa = PBXGroup; + children = ( + B739488E229F292E00C47603 /* landmarkData.json */, + B7394890229F292F00C47603 /* chilkoottrail.jpg */, + B739488F229F292F00C47603 /* chincoteague.jpg */, + B739488A229F292E00C47603 /* hiddenlake.jpg */, + B7394886229F292E00C47603 /* icybay.jpg */, + B7394887229F292E00C47603 /* lakemcdonald.jpg */, + B7394884229F292D00C47603 /* rainbowlake.jpg */, + B739488D229F292E00C47603 /* silversalmoncreek.jpg */, + B739488B229F292E00C47603 /* stmarylake.jpg */, + B7394888229F292E00C47603 /* turtlerock.jpg */, + B739488C229F292E00C47603 /* twinlake.jpg */, + B7394889229F292E00C47603 /* umbagog.jpg */, + B7394885229F292D00C47603 /* yukon_charleyrivers.jpg */, + ); + path = Resources; + sourceTree = ""; + }; + F475C870F475A24000000001 /* Configuration */ = { + isa = PBXGroup; + children = ( + F4750E80F475342000000001 /* SampleCode.xcconfig */, + ); + name = Configuration; + sourceTree = ""; + }; + F479F160F479F93000000001 /* LICENSE */ = { + isa = PBXGroup; + children = ( + F479D5A0F479BCB000000001 /* LICENSE.txt */, + ); + name = LICENSE; + path = ../LICENSE; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + B7394861229F194000C47603 /* Landmarks */ = { + isa = PBXNativeTarget; + buildConfigurationList = B7394876229F194200C47603 /* Build configuration list for PBXNativeTarget "Landmarks" */; + buildPhases = ( + B739485E229F194000C47603 /* Sources */, + B739485F229F194000C47603 /* Frameworks */, + B7394860229F194000C47603 /* Resources */, + C602AC70C605937000000001, + ); + buildRules = ( + ); + dependencies = ( + ); + name = Landmarks; + productName = Landmarks; + productReference = B7394862229F194000C47603 /* Landmarks.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + B739485A229F194000C47603 /* Project object */ = { + isa = PBXProject; + attributes = { + LastSwiftUpdateCheck = 1100; + LastUpgradeCheck = 1100; + ORGANIZATIONNAME = Apple; + TargetAttributes = { + B7394861229F194000C47603 = { + CreatedOnToolsVersion = 11.0; + }; + }; + }; + buildConfigurationList = B739485D229F194000C47603 /* Build configuration list for PBXProject "BuildingListsAndNavigation" */; + compatibilityVersion = "Xcode 9.3"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = B7394859229F194000C47603; + productRefGroup = B7394863229F194000C47603 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + B7394861229F194000C47603 /* Landmarks */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + B7394860229F194000C47603 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + B739489A229F292F00C47603 /* silversalmoncreek.jpg in Resources */, + B7394894229F292F00C47603 /* lakemcdonald.jpg in Resources */, + B7394872229F194200C47603 /* LaunchScreen.storyboard in Resources */, + B7394891229F292F00C47603 /* rainbowlake.jpg in Resources */, + B739486F229F194200C47603 /* Preview Assets.xcassets in Resources */, + B7394895229F292F00C47603 /* turtlerock.jpg in Resources */, + B739486C229F194200C47603 /* Assets.xcassets in Resources */, + B7394899229F292F00C47603 /* twinlake.jpg in Resources */, + B7394896229F292F00C47603 /* umbagog.jpg in Resources */, + B739489D229F292F00C47603 /* chilkoottrail.jpg in Resources */, + B739489C229F292F00C47603 /* chincoteague.jpg in Resources */, + B739489B229F292F00C47603 /* landmarkData.json in Resources */, + B7394893229F292F00C47603 /* icybay.jpg in Resources */, + B7394897229F292F00C47603 /* hiddenlake.jpg in Resources */, + B7394898229F292F00C47603 /* stmarylake.jpg in Resources */, + B7394892229F292F00C47603 /* yukon_charleyrivers.jpg in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + B739485E229F194000C47603 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + B7394882229F28B900C47603 /* Data.swift in Sources */, + B7394866229F194000C47603 /* AppDelegate.swift in Sources */, + B739487A229F1B3F00C47603 /* CircleImage.swift in Sources */, + B739487C229F1B6800C47603 /* MapView.swift in Sources */, + B7394868229F194000C47603 /* SceneDelegate.swift in Sources */, + B739486A229F194000C47603 /* LandmarkDetail.swift in Sources */, + B7394881229F28B900C47603 /* Landmark.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXVariantGroup section */ + B7394870229F194200C47603 /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + B7394871229F194200C47603 /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + B7394874229F194200C47603 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = F4750E80F475342000000001 /* SampleCode.xcconfig */; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 13.0; + MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; + MTL_FAST_MATH = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + }; + name = Debug; + }; + B7394875229F194200C47603 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = F4750E80F475342000000001 /* SampleCode.xcconfig */; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 13.0; + MTL_ENABLE_DEBUG_INFO = NO; + MTL_FAST_MATH = YES; + SDKROOT = iphoneos; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + B7394877229F194200C47603 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = F4750E80F475342000000001 /* SampleCode.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_ASSET_PATHS = "Landmarks/Preview\\ Content"; + DEVELOPMENT_TEAM = ""; + ENABLE_PREVIEWS = YES; + INFOPLIST_FILE = Landmarks/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = "com.example.apple-samplecode.Landmarks${SAMPLE_CODE_DISAMBIGUATOR}"; + PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE_SPECIFIER = ""; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + B7394878229F194200C47603 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = F4750E80F475342000000001 /* SampleCode.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_ASSET_PATHS = "Landmarks/Preview\\ Content"; + DEVELOPMENT_TEAM = ""; + ENABLE_PREVIEWS = YES; + INFOPLIST_FILE = Landmarks/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = "com.example.apple-samplecode.Landmarks${SAMPLE_CODE_DISAMBIGUATOR}"; + PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE_SPECIFIER = ""; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + B739485D229F194000C47603 /* Build configuration list for PBXProject "BuildingListsAndNavigation" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + B7394874229F194200C47603 /* Debug */, + B7394875229F194200C47603 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + B7394876229F194200C47603 /* Build configuration list for PBXNativeTarget "Landmarks" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + B7394877229F194200C47603 /* Debug */, + B7394878229F194200C47603 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = B739485A229F194000C47603 /* Project object */; +} diff --git a/Examples/BuildingListsAndNavigation/StartingPoint/Landmarks/BuildingListsAndNavigation.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/Examples/BuildingListsAndNavigation/StartingPoint/Landmarks/BuildingListsAndNavigation.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings new file mode 100755 index 0000000..3ddf867 --- /dev/null +++ b/Examples/BuildingListsAndNavigation/StartingPoint/Landmarks/BuildingListsAndNavigation.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings @@ -0,0 +1,8 @@ + + + + + BuildSystemType + Latest + + diff --git a/Examples/BuildingListsAndNavigation/StartingPoint/Landmarks/Landmarks/AppDelegate.swift b/Examples/BuildingListsAndNavigation/StartingPoint/Landmarks/Landmarks/AppDelegate.swift new file mode 100755 index 0000000..e22943b --- /dev/null +++ b/Examples/BuildingListsAndNavigation/StartingPoint/Landmarks/Landmarks/AppDelegate.swift @@ -0,0 +1,36 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +The application delegate. +*/ + +import UIKit + +@UIApplicationMain +class AppDelegate: UIResponder, UIApplicationDelegate { + + func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { + // Override point for customization after application launch. + return true + } + + func applicationWillTerminate(_ application: UIApplication) { + // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. + } + + // MARK: UISceneSession Lifecycle + func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration { + // Called when a new scene session is being created. + // Use this method to select a configuration to create the new scene with. + return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role) + } + + func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set) { + // Called when the user discards a scene session. + // If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions. + // Use this method to release any resources that were specific to the discarded scenes, as they will not return. + } + +} + diff --git a/Examples/BuildingListsAndNavigation/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/Contents.json b/Examples/BuildingListsAndNavigation/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100755 index 0000000..fa0d2db --- /dev/null +++ b/Examples/BuildingListsAndNavigation/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,113 @@ +{ + "images" : [ + { + "size" : "20x20", + "idiom" : "iphone", + "filename" : "landmark_app_icon_40x40.png", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "20x20", + "scale" : "3x" + }, + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "landmark_app_icon_58x58.png", + "scale" : "2x" + }, + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "landmark_app_icon_87x87.png", + "scale" : "3x" + }, + { + "size" : "40x40", + "idiom" : "iphone", + "filename" : "landmark_app_icon_80x80.png", + "scale" : "2x" + }, + { + "size" : "40x40", + "idiom" : "iphone", + "filename" : "landmark_app_icon_120x120.png", + "scale" : "3x" + }, + { + "size" : "60x60", + "idiom" : "iphone", + "filename" : "landmark_app_icon_120x120-1.png", + "scale" : "2x" + }, + { + "size" : "60x60", + "idiom" : "iphone", + "filename" : "landmark_app_icon_180x180.png", + "scale" : "3x" + }, + { + "idiom" : "ipad", + "size" : "20x20", + "scale" : "1x" + }, + { + "size" : "20x20", + "idiom" : "ipad", + "filename" : "landmark_app_icon_40x40-1.png", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "29x29", + "scale" : "1x" + }, + { + "size" : "29x29", + "idiom" : "ipad", + "filename" : "landmark_app_icon_58x58-1.png", + "scale" : "2x" + }, + { + "size" : "40x40", + "idiom" : "ipad", + "filename" : "landmark_app_icon_40x40-2.png", + "scale" : "1x" + }, + { + "size" : "40x40", + "idiom" : "ipad", + "filename" : "landmark_app_icon_80x80-1.png", + "scale" : "2x" + }, + { + "size" : "76x76", + "idiom" : "ipad", + "filename" : "landmark_app_icon_76x76.png", + "scale" : "1x" + }, + { + "size" : "76x76", + "idiom" : "ipad", + "filename" : "landmark_app_icon_152x152.png", + "scale" : "2x" + }, + { + "size" : "83.5x83.5", + "idiom" : "ipad", + "filename" : "landmark_app_icon_167x167.png", + "scale" : "2x" + }, + { + "size" : "1024x1024", + "idiom" : "ios-marketing", + "filename" : "landmark_app_icon_1024x1024.png", + "scale" : "1x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Examples/BuildingListsAndNavigation/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_1024x1024.png b/Examples/BuildingListsAndNavigation/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_1024x1024.png new file mode 100755 index 0000000..00d81c1 Binary files /dev/null and b/Examples/BuildingListsAndNavigation/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_1024x1024.png differ diff --git a/Examples/BuildingListsAndNavigation/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_120x120-1.png b/Examples/BuildingListsAndNavigation/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_120x120-1.png new file mode 100755 index 0000000..d382b8b Binary files /dev/null and b/Examples/BuildingListsAndNavigation/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_120x120-1.png differ diff --git a/Examples/BuildingListsAndNavigation/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_120x120.png b/Examples/BuildingListsAndNavigation/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_120x120.png new file mode 100755 index 0000000..d382b8b Binary files /dev/null and b/Examples/BuildingListsAndNavigation/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_120x120.png differ diff --git a/Examples/BuildingListsAndNavigation/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_152x152.png b/Examples/BuildingListsAndNavigation/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_152x152.png new file mode 100755 index 0000000..11057f8 Binary files /dev/null and b/Examples/BuildingListsAndNavigation/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_152x152.png differ diff --git a/Examples/BuildingListsAndNavigation/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_167x167.png b/Examples/BuildingListsAndNavigation/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_167x167.png new file mode 100755 index 0000000..f73bc26 Binary files /dev/null and b/Examples/BuildingListsAndNavigation/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_167x167.png differ diff --git a/Examples/BuildingListsAndNavigation/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_180x180.png b/Examples/BuildingListsAndNavigation/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_180x180.png new file mode 100755 index 0000000..b02738c Binary files /dev/null and b/Examples/BuildingListsAndNavigation/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_180x180.png differ diff --git a/Examples/BuildingListsAndNavigation/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_40x40-1.png b/Examples/BuildingListsAndNavigation/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_40x40-1.png new file mode 100755 index 0000000..abaff0e Binary files /dev/null and b/Examples/BuildingListsAndNavigation/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_40x40-1.png differ diff --git a/Examples/BuildingListsAndNavigation/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_40x40-2.png b/Examples/BuildingListsAndNavigation/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_40x40-2.png new file mode 100755 index 0000000..abaff0e Binary files /dev/null and b/Examples/BuildingListsAndNavigation/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_40x40-2.png differ diff --git a/Examples/BuildingListsAndNavigation/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_40x40.png b/Examples/BuildingListsAndNavigation/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_40x40.png new file mode 100755 index 0000000..abaff0e Binary files /dev/null and b/Examples/BuildingListsAndNavigation/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_40x40.png differ diff --git a/Examples/BuildingListsAndNavigation/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_58x58-1.png b/Examples/BuildingListsAndNavigation/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_58x58-1.png new file mode 100755 index 0000000..cf7c73d Binary files /dev/null and b/Examples/BuildingListsAndNavigation/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_58x58-1.png differ diff --git a/Examples/BuildingListsAndNavigation/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_58x58.png b/Examples/BuildingListsAndNavigation/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_58x58.png new file mode 100755 index 0000000..cf7c73d Binary files /dev/null and b/Examples/BuildingListsAndNavigation/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_58x58.png differ diff --git a/Examples/BuildingListsAndNavigation/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_76x76.png b/Examples/BuildingListsAndNavigation/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_76x76.png new file mode 100755 index 0000000..3eff85b Binary files /dev/null and b/Examples/BuildingListsAndNavigation/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_76x76.png differ diff --git a/Examples/BuildingListsAndNavigation/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_80x80-1.png b/Examples/BuildingListsAndNavigation/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_80x80-1.png new file mode 100755 index 0000000..6f33f66 Binary files /dev/null and b/Examples/BuildingListsAndNavigation/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_80x80-1.png differ diff --git a/Examples/BuildingListsAndNavigation/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_80x80.png b/Examples/BuildingListsAndNavigation/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_80x80.png new file mode 100755 index 0000000..6f33f66 Binary files /dev/null and b/Examples/BuildingListsAndNavigation/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_80x80.png differ diff --git a/Examples/BuildingListsAndNavigation/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_87x87.png b/Examples/BuildingListsAndNavigation/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_87x87.png new file mode 100755 index 0000000..9e1616c Binary files /dev/null and b/Examples/BuildingListsAndNavigation/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_87x87.png differ diff --git a/Examples/BuildingListsAndNavigation/StartingPoint/Landmarks/Landmarks/Assets.xcassets/Contents.json b/Examples/BuildingListsAndNavigation/StartingPoint/Landmarks/Landmarks/Assets.xcassets/Contents.json new file mode 100755 index 0000000..da4a164 --- /dev/null +++ b/Examples/BuildingListsAndNavigation/StartingPoint/Landmarks/Landmarks/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Examples/BuildingListsAndNavigation/StartingPoint/Landmarks/Landmarks/Assets.xcassets/turtlerock.imageset/Contents.json b/Examples/BuildingListsAndNavigation/StartingPoint/Landmarks/Landmarks/Assets.xcassets/turtlerock.imageset/Contents.json new file mode 100755 index 0000000..5bfd7bf --- /dev/null +++ b/Examples/BuildingListsAndNavigation/StartingPoint/Landmarks/Landmarks/Assets.xcassets/turtlerock.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "turtlerock.jpg", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Examples/BuildingListsAndNavigation/StartingPoint/Landmarks/Landmarks/Assets.xcassets/turtlerock.imageset/turtlerock.jpg b/Examples/BuildingListsAndNavigation/StartingPoint/Landmarks/Landmarks/Assets.xcassets/turtlerock.imageset/turtlerock.jpg new file mode 100755 index 0000000..68bcd3e Binary files /dev/null and b/Examples/BuildingListsAndNavigation/StartingPoint/Landmarks/Landmarks/Assets.xcassets/turtlerock.imageset/turtlerock.jpg differ diff --git a/Examples/BuildingListsAndNavigation/StartingPoint/Landmarks/Landmarks/Base.lproj/LaunchScreen.storyboard b/Examples/BuildingListsAndNavigation/StartingPoint/Landmarks/Landmarks/Base.lproj/LaunchScreen.storyboard new file mode 100755 index 0000000..865e932 --- /dev/null +++ b/Examples/BuildingListsAndNavigation/StartingPoint/Landmarks/Landmarks/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Examples/BuildingListsAndNavigation/StartingPoint/Landmarks/Landmarks/Info.plist b/Examples/BuildingListsAndNavigation/StartingPoint/Landmarks/Landmarks/Info.plist new file mode 100755 index 0000000..e8bb4c6 --- /dev/null +++ b/Examples/BuildingListsAndNavigation/StartingPoint/Landmarks/Landmarks/Info.plist @@ -0,0 +1,62 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + $(PRODUCT_BUNDLE_PACKAGE_TYPE) + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1 + LSRequiresIPhoneOS + + UIApplicationSceneManifest + + UIApplicationSupportsMultipleScenes + + UISceneConfigurations + + UIWindowSceneSessionRoleApplication + + + UILaunchStoryboardName + LaunchScreen + UISceneConfigurationName + Default Configuration + UISceneDelegateClassName + $(PRODUCT_MODULE_NAME).SceneDelegate + + + + + UILaunchStoryboardName + LaunchScreen + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/Examples/BuildingListsAndNavigation/StartingPoint/Landmarks/Landmarks/LandmarkDetail.swift b/Examples/BuildingListsAndNavigation/StartingPoint/Landmarks/Landmarks/LandmarkDetail.swift new file mode 100755 index 0000000..ee34bba --- /dev/null +++ b/Examples/BuildingListsAndNavigation/StartingPoint/Landmarks/Landmarks/LandmarkDetail.swift @@ -0,0 +1,45 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +A view showing the details for a landmark. +*/ + +import SwiftUI + +struct LandmarkDetail: View { + var body: some View { + VStack { + MapView() + .edgesIgnoringSafeArea(.top) + .frame(height: 300) + + CircleImage() + .offset(x: 0, y: -130) + .padding(.bottom, -130) + + VStack(alignment: .leading) { + Text("Turtle Rock") + .font(.title) + HStack(alignment: .top) { + Text("Joshua Tree National Park") + .font(.subheadline) + Spacer() + Text("California") + .font(.subheadline) + } + } + .padding() + + Spacer() + } + } +} + +#if DEBUG +struct LandmarkDetail_Previews: PreviewProvider { + static var previews: some View { + LandmarkDetail() + } +} +#endif diff --git a/Examples/BuildingListsAndNavigation/StartingPoint/Landmarks/Landmarks/Models/Data.swift b/Examples/BuildingListsAndNavigation/StartingPoint/Landmarks/Landmarks/Models/Data.swift new file mode 100755 index 0000000..78837f6 --- /dev/null +++ b/Examples/BuildingListsAndNavigation/StartingPoint/Landmarks/Landmarks/Models/Data.swift @@ -0,0 +1,93 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +Helpers for loading images and data. +*/ + +import UIKit +import SwiftUI +import CoreLocation + +let landmarkData: [Landmark] = load("landmarkData.json") + +func load(_ filename: String, as type: T.Type = T.self) -> T { + let data: Data + + guard let file = Bundle.main.url(forResource: filename, withExtension: nil) + else { + fatalError("Couldn't find \(filename) in main bundle.") + } + + do { + data = try Data(contentsOf: file) + } catch { + fatalError("Couldn't load \(filename) from main bundle:\n\(error)") + } + + do { + let decoder = JSONDecoder() + return try decoder.decode(T.self, from: data) + } catch { + fatalError("Couldn't parse \(filename) as \(T.self):\n\(error)") + } +} + +final class ImageStore { + fileprivate typealias _ImageDictionary = [String: [Int: CGImage]] + fileprivate var images: _ImageDictionary = [:] + + fileprivate static var originalSize = 250 + fileprivate static var scale = 2 + + static var shared = ImageStore() + + func image(name: String, size: Int) -> Image { + let index = _guaranteeInitialImage(name: name) + + let sizedImage = images.values[index][size] + ?? _sizeImage(images.values[index][ImageStore.originalSize]!, to: size * ImageStore.scale) + images.values[index][size] = sizedImage + + return Image(sizedImage, scale: Length(ImageStore.scale), label: Text(verbatim: name)) + } + + fileprivate func _guaranteeInitialImage(name: String) -> _ImageDictionary.Index { + if let index = images.index(forKey: name) { return index } + + guard + let url = Bundle.main.url(forResource: name, withExtension: "jpg"), + let imageSource = CGImageSourceCreateWithURL(url as NSURL, nil), + let image = CGImageSourceCreateImageAtIndex(imageSource, 0, nil) + else { + fatalError("Couldn't load image \(name).jpg from main bundle.") + } + + images[name] = [ImageStore.originalSize: image] + return images.index(forKey: name)! + } + + fileprivate func _sizeImage(_ image: CGImage, to size: Int) -> CGImage { + guard + let colorSpace = image.colorSpace, + let context = CGContext( + data: nil, + width: size, height: size, + bitsPerComponent: image.bitsPerComponent, + bytesPerRow: image.bytesPerRow, + space: colorSpace, + bitmapInfo: image.bitmapInfo.rawValue) + else { + fatalError("Couldn't create graphics context.") + } + context.interpolationQuality = .high + context.draw(image, in: CGRect(x: 0, y: 0, width: size, height: size)) + + if let sizedImage = context.makeImage() { + return sizedImage + } else { + fatalError("Couldn't resize image.") + } + } +} + diff --git a/Examples/BuildingListsAndNavigation/StartingPoint/Landmarks/Landmarks/Models/Landmark.swift b/Examples/BuildingListsAndNavigation/StartingPoint/Landmarks/Landmarks/Models/Landmark.swift new file mode 100755 index 0000000..31c85e1 --- /dev/null +++ b/Examples/BuildingListsAndNavigation/StartingPoint/Landmarks/Landmarks/Models/Landmark.swift @@ -0,0 +1,40 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +The model for an individual landmark. +*/ + +import SwiftUI +import CoreLocation + +struct Landmark: Hashable, Codable { + var id: Int + var name: String + fileprivate var imageName: String + fileprivate var coordinates: Coordinates + var state: String + var park: String + var category: Category + + var locationCoordinate: CLLocationCoordinate2D { + CLLocationCoordinate2D( + latitude: coordinates.latitude, + longitude: coordinates.longitude) + } + + func image(forSize size: Int) -> Image { + ImageStore.shared.image(name: imageName, size: size) + } + + enum Category: String, CaseIterable, Codable, Hashable { + case featured = "Featured" + case lakes = "Lakes" + case rivers = "Rivers" + } +} + +struct Coordinates: Hashable, Codable { + var latitude: Double + var longitude: Double +} diff --git a/Examples/BuildingListsAndNavigation/StartingPoint/Landmarks/Landmarks/Preview Content/Preview Assets.xcassets/Contents.json b/Examples/BuildingListsAndNavigation/StartingPoint/Landmarks/Landmarks/Preview Content/Preview Assets.xcassets/Contents.json new file mode 100755 index 0000000..da4a164 --- /dev/null +++ b/Examples/BuildingListsAndNavigation/StartingPoint/Landmarks/Landmarks/Preview Content/Preview Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Examples/BuildingListsAndNavigation/StartingPoint/Landmarks/Landmarks/Resources/chilkoottrail.jpg b/Examples/BuildingListsAndNavigation/StartingPoint/Landmarks/Landmarks/Resources/chilkoottrail.jpg new file mode 100755 index 0000000..e7f805e Binary files /dev/null and b/Examples/BuildingListsAndNavigation/StartingPoint/Landmarks/Landmarks/Resources/chilkoottrail.jpg differ diff --git a/Examples/BuildingListsAndNavigation/StartingPoint/Landmarks/Landmarks/Resources/chincoteague.jpg b/Examples/BuildingListsAndNavigation/StartingPoint/Landmarks/Landmarks/Resources/chincoteague.jpg new file mode 100755 index 0000000..5f47986 Binary files /dev/null and b/Examples/BuildingListsAndNavigation/StartingPoint/Landmarks/Landmarks/Resources/chincoteague.jpg differ diff --git a/Examples/BuildingListsAndNavigation/StartingPoint/Landmarks/Landmarks/Resources/hiddenlake.jpg b/Examples/BuildingListsAndNavigation/StartingPoint/Landmarks/Landmarks/Resources/hiddenlake.jpg new file mode 100755 index 0000000..d8e804c Binary files /dev/null and b/Examples/BuildingListsAndNavigation/StartingPoint/Landmarks/Landmarks/Resources/hiddenlake.jpg differ diff --git a/Examples/BuildingListsAndNavigation/StartingPoint/Landmarks/Landmarks/Resources/icybay.jpg b/Examples/BuildingListsAndNavigation/StartingPoint/Landmarks/Landmarks/Resources/icybay.jpg new file mode 100755 index 0000000..feb1764 Binary files /dev/null and b/Examples/BuildingListsAndNavigation/StartingPoint/Landmarks/Landmarks/Resources/icybay.jpg differ diff --git a/Examples/BuildingListsAndNavigation/StartingPoint/Landmarks/Landmarks/Resources/lakemcdonald.jpg b/Examples/BuildingListsAndNavigation/StartingPoint/Landmarks/Landmarks/Resources/lakemcdonald.jpg new file mode 100755 index 0000000..bd9d6b9 Binary files /dev/null and b/Examples/BuildingListsAndNavigation/StartingPoint/Landmarks/Landmarks/Resources/lakemcdonald.jpg differ diff --git a/Examples/BuildingListsAndNavigation/StartingPoint/Landmarks/Landmarks/Resources/landmarkData.json b/Examples/BuildingListsAndNavigation/StartingPoint/Landmarks/Landmarks/Resources/landmarkData.json new file mode 100755 index 0000000..01a9691 --- /dev/null +++ b/Examples/BuildingListsAndNavigation/StartingPoint/Landmarks/Landmarks/Resources/landmarkData.json @@ -0,0 +1,158 @@ +[ + { + "name": "Turtle Rock", + "category": "Featured", + "city": "Twentynine Palms", + "state": "California", + "id": 1001, + "park": "Joshua Tree National Park", + "coordinates": { + "longitude": -116.166868, + "latitude": 34.011286 + }, + "imageName": "turtlerock" + }, + { + "name": "Silver Salmon Creek", + "category": "Lakes", + "city": "Port Alsworth", + "state": "Alaska", + "id": 4, + "park": "Lake Clark National Park and Preserve", + "coordinates": { + "longitude": -152.665167, + "latitude": 59.980167 + }, + "imageName": "silversalmoncreek" + }, + { + "name": "Chilkoot Trail", + "category": "Rivers", + "city": "Skagway", + "state": "Alaska", + "id": 5, + "park": "Klondike Gold Rush National Historical Park", + "coordinates": { + "longitude": -135.334571, + "latitude": 59.560551 + }, + "imageName": "chilkoottrail" + }, + { + "name": "St. Mary Lake", + "category": "Lakes", + "city": "Browning", + "state": "Montana", + "id": 8, + "park": "Glacier National Park", + "coordinates": { + "longitude": -113.536248, + "latitude": 48.69423 + }, + "imageName": "stmarylake" + }, + { + "name": "Twin Lake", + "category": "Lakes", + "city": "Twin Lakes", + "state": "Alaska", + "id": 11, + "park": "Lake Clark National Park and Preserve", + "coordinates": { + "longitude": -153.849883, + "latitude": 60.641684 + }, + "imageName": "twinlake" + }, + { + "name": "Lake McDonald", + "category": "Lakes", + "city": "West Glacier", + "state": "Montana", + "id": 6, + "park": "Glacier National Park", + "coordinates": { + "longitude": -113.934831, + "latitude": 48.56002 + }, + "imageName": "lakemcdonald" + }, + { + "name": "Charley Rivers", + "category": "Rivers", + "city": "Eaking", + "state": "Alaska", + "id": 1, + "park": "Charley Rivers National Preserve", + "coordinates": { + "longitude": -143.122586, + "latitude": 65.350021 + }, + "imageName": "yukon_charleyrivers" + }, + { + "name": "Icy Bay", + "category": "Lakes", + "city": "Icy Bay", + "state": "Alaska", + "id": 2, + "park": "Wrangell-St. Elias National Park and Preserve", + "coordinates": { + "longitude": -141.518167, + "latitude": 60.089917 + }, + "imageName": "icybay" + }, + { + "name": "Rainbow Lake", + "category": "Lakes", + "city": "Willow", + "state": "Alaska", + "id": 3, + "park": "State Recreation Area", + "coordinates": { + "longitude": -150.086103, + "latitude": 61.694334 + }, + "imageName": "rainbowlake" + }, + { + "name": "Hidden Lake", + "category": "Lakes", + "city": "Newhalem", + "state": "Washington", + "id": 7, + "park": "North Cascades National Park", + "coordinates": { + "longitude": -121.17799, + "latitude": 48.495442 + }, + "imageName": "hiddenlake" + }, + { + "name": "Chincoteague", + "category": "Rivers", + "city": "Chincoteague", + "state": "Virginia", + "id": 9, + "park": "Chincoteague National Wildlife Refuge", + "coordinates": { + "longitude": -75.383212, + "latitude": 37.91531 + }, + "imageName": "chincoteague" + }, + { + "name": "Lake Umbagog", + "category": "Lakes", + "city": "Errol", + "state": "New Hampshire", + "id": 10, + "park": "Umbagog National Wildlife Refuge", + "coordinates": { + "longitude": -71.056816, + "latitude": 44.747408 + }, + "imageName": "umbagog" + } +] diff --git a/Examples/BuildingListsAndNavigation/StartingPoint/Landmarks/Landmarks/Resources/rainbowlake.jpg b/Examples/BuildingListsAndNavigation/StartingPoint/Landmarks/Landmarks/Resources/rainbowlake.jpg new file mode 100755 index 0000000..6da43dd Binary files /dev/null and b/Examples/BuildingListsAndNavigation/StartingPoint/Landmarks/Landmarks/Resources/rainbowlake.jpg differ diff --git a/Examples/BuildingListsAndNavigation/StartingPoint/Landmarks/Landmarks/Resources/silversalmoncreek.jpg b/Examples/BuildingListsAndNavigation/StartingPoint/Landmarks/Landmarks/Resources/silversalmoncreek.jpg new file mode 100755 index 0000000..f657532 Binary files /dev/null and b/Examples/BuildingListsAndNavigation/StartingPoint/Landmarks/Landmarks/Resources/silversalmoncreek.jpg differ diff --git a/Examples/BuildingListsAndNavigation/StartingPoint/Landmarks/Landmarks/Resources/stmarylake.jpg b/Examples/BuildingListsAndNavigation/StartingPoint/Landmarks/Landmarks/Resources/stmarylake.jpg new file mode 100755 index 0000000..1c71de4 Binary files /dev/null and b/Examples/BuildingListsAndNavigation/StartingPoint/Landmarks/Landmarks/Resources/stmarylake.jpg differ diff --git a/Examples/BuildingListsAndNavigation/StartingPoint/Landmarks/Landmarks/Resources/turtlerock.jpg b/Examples/BuildingListsAndNavigation/StartingPoint/Landmarks/Landmarks/Resources/turtlerock.jpg new file mode 100755 index 0000000..f7a6e6d Binary files /dev/null and b/Examples/BuildingListsAndNavigation/StartingPoint/Landmarks/Landmarks/Resources/turtlerock.jpg differ diff --git a/Examples/BuildingListsAndNavigation/StartingPoint/Landmarks/Landmarks/Resources/twinlake.jpg b/Examples/BuildingListsAndNavigation/StartingPoint/Landmarks/Landmarks/Resources/twinlake.jpg new file mode 100755 index 0000000..3e7a57c Binary files /dev/null and b/Examples/BuildingListsAndNavigation/StartingPoint/Landmarks/Landmarks/Resources/twinlake.jpg differ diff --git a/Examples/BuildingListsAndNavigation/StartingPoint/Landmarks/Landmarks/Resources/umbagog.jpg b/Examples/BuildingListsAndNavigation/StartingPoint/Landmarks/Landmarks/Resources/umbagog.jpg new file mode 100755 index 0000000..56291c6 Binary files /dev/null and b/Examples/BuildingListsAndNavigation/StartingPoint/Landmarks/Landmarks/Resources/umbagog.jpg differ diff --git a/Examples/BuildingListsAndNavigation/StartingPoint/Landmarks/Landmarks/Resources/yukon_charleyrivers.jpg b/Examples/BuildingListsAndNavigation/StartingPoint/Landmarks/Landmarks/Resources/yukon_charleyrivers.jpg new file mode 100755 index 0000000..17ff44b Binary files /dev/null and b/Examples/BuildingListsAndNavigation/StartingPoint/Landmarks/Landmarks/Resources/yukon_charleyrivers.jpg differ diff --git a/Examples/BuildingListsAndNavigation/StartingPoint/Landmarks/Landmarks/SceneDelegate.swift b/Examples/BuildingListsAndNavigation/StartingPoint/Landmarks/Landmarks/SceneDelegate.swift new file mode 100755 index 0000000..f7316e2 --- /dev/null +++ b/Examples/BuildingListsAndNavigation/StartingPoint/Landmarks/Landmarks/SceneDelegate.swift @@ -0,0 +1,56 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +The scene delegate. +*/ + +import UIKit +import SwiftUI + +class SceneDelegate: UIResponder, UIWindowSceneDelegate { + + var window: UIWindow? + + func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) { + // Use this method to optionally configure and attach the UIWindow `window` to the provided UIWindowScene `scene`. + // If using a storyboard, the `window` property will automatically be initialized and attached to the scene. + // This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead). + + // Use a UIHostingController as window root view controller + let window = UIWindow(frame: UIScreen.main.bounds) + window.rootViewController = UIHostingController(rootView: LandmarkDetail()) + self.window = window + window.makeKeyAndVisible() + } + + func sceneDidDisconnect(_ scene: UIScene) { + // Called as the scene is being released by the system. + // This occurs shortly after the scene enters the background, or when its session is discarded. + // Release any resources associated with this scene that can be re-created the next time the scene connects. + // The scene may re-connect later, as its session was not neccessarily discarded (see `application:didDiscardSceneSessions` instead). + } + + func sceneDidBecomeActive(_ scene: UIScene) { + // Called when the scene has moved from an inactive state to an active state. + // Use this method to restart any tasks that were paused (or not yet started) when the scene was inactive. + } + + func sceneWillResignActive(_ scene: UIScene) { + // Called when the scene will move from an active state to an inactive state. + // This may occur due to temporary interruptions (ex. an incoming phone call). + } + + func sceneWillEnterForeground(_ scene: UIScene) { + // Called as the scene transitions from the background to the foreground. + // Use this method to undo the changes made on entering the background. + } + + func sceneDidEnterBackground(_ scene: UIScene) { + // Called as the scene transitions from the foreground to the background. + // Use this method to save data, release shared resources, and store enough scene-specific state information + // to restore the scene back to its current state. + } + +} + diff --git a/Examples/BuildingListsAndNavigation/StartingPoint/Landmarks/Landmarks/Supporting Views/CircleImage.swift b/Examples/BuildingListsAndNavigation/StartingPoint/Landmarks/Landmarks/Supporting Views/CircleImage.swift new file mode 100755 index 0000000..f32a333 --- /dev/null +++ b/Examples/BuildingListsAndNavigation/StartingPoint/Landmarks/Landmarks/Supporting Views/CircleImage.swift @@ -0,0 +1,26 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +A view that clips an image to a circle and adds a stroke and shadow. +*/ + +import SwiftUI + +struct CircleImage: View { + var body: some View { + Image("turtlerock") + .clipShape(Circle()) + .overlay( + Circle().stroke(Color.white, lineWidth: 4)) + .shadow(radius: 10) + } +} + +#if DEBUG +struct CircleImage_Previews: PreviewProvider { + static var previews: some View { + CircleImage() + } +} +#endif diff --git a/Examples/BuildingListsAndNavigation/StartingPoint/Landmarks/Landmarks/Supporting Views/MapView.swift b/Examples/BuildingListsAndNavigation/StartingPoint/Landmarks/Landmarks/Supporting Views/MapView.swift new file mode 100755 index 0000000..ea5716e --- /dev/null +++ b/Examples/BuildingListsAndNavigation/StartingPoint/Landmarks/Landmarks/Supporting Views/MapView.swift @@ -0,0 +1,31 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +A view that hosts an `MKMapView`. +*/ + +import SwiftUI +import MapKit + +struct MapView: UIViewRepresentable { + func makeUIView(context: Context) -> MKMapView { + MKMapView(frame: .zero) + } + + func updateUIView(_ view: MKMapView, context: Context) { + let coordinate = CLLocationCoordinate2D( + latitude: 34.011_286, longitude: -116.166_868) + let span = MKCoordinateSpan(latitudeDelta: 2.0, longitudeDelta: 2.0) + let region = MKCoordinateRegion(center: coordinate, span: span) + view.setRegion(region, animated: true) + } +} + +#if DEBUG +struct MapView_Previews: PreviewProvider { + static var previews: some View { + MapView() + } +} +#endif diff --git a/Examples/BuildingListsAndNavigation/StartingPoint/README.md b/Examples/BuildingListsAndNavigation/StartingPoint/README.md new file mode 100755 index 0000000..f8596c8 --- /dev/null +++ b/Examples/BuildingListsAndNavigation/StartingPoint/README.md @@ -0,0 +1,3 @@ +# Building Lists and Navigation + +Use this project to code along with the [Building Lists and Navigation](https://developer.apple.com/tutorials/swiftui/building-lists-and-navigation) tutorial. diff --git a/Examples/Combine using GitHub API/.gitignore b/Examples/Combine using GitHub API/.gitignore new file mode 100755 index 0000000..704641d --- /dev/null +++ b/Examples/Combine using GitHub API/.gitignore @@ -0,0 +1,21 @@ +.DS_Store +*/build/* +*.pbxuser +!default.pbxuser +*.mode1v3 +!default.mode1v3 +*.mode2v3 +!default.mode2v3 +*.perspectivev3 +!default.perspectivev3 +xcuserdata +profile +*.moved-aside +DerivedData +.idea/ +*.hmap +*.xccheckout +*.xcuserstate +xcuserdata/ +*.moved-aside +*.xcuserstate diff --git a/Examples/Combine using GitHub API/LICENSE b/Examples/Combine using GitHub API/LICENSE new file mode 100755 index 0000000..6af96ad --- /dev/null +++ b/Examples/Combine using GitHub API/LICENSE @@ -0,0 +1,22 @@ +The MIT License (MIT) + +Copyright (c) 2019 ra1028 + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + diff --git a/Examples/Combine using GitHub API/README.md b/Examples/Combine using GitHub API/README.md new file mode 100755 index 0000000..5d2c3e3 --- /dev/null +++ b/Examples/Combine using GitHub API/README.md @@ -0,0 +1,19 @@ +# SwiftUI-Combine-Example +This is an example project of [SwiftUI](https://developer.apple.com/xcode/swiftui) and [Combine](https://developer.apple.com/documentation/combine) using GitHub `GET /search/users` API. + +

+ +

+ +## :clipboard: Requirements +- Swift5.1 Beta +- Xcode11.0 Beta +- iOS 13.0 Beta + +## :warning: GitHub API Rate Limiting +GitHub search API has a [rate limit rules](https://developer.github.com/v3/search/#rate-limit). +For unauthenticated requests, the rate limit allows you to make up to 10 requests per minute. + +## :books: Credit +- [Official SwiftUI Tutorial](https://developer.apple.com/tutorials/swiftui) +- [Combine Apple Developer Document](https://developer.apple.com/documentation/combine) diff --git a/Examples/Combine using GitHub API/SwiftUI-Combine-Example.xcodeproj/project.pbxproj b/Examples/Combine using GitHub API/SwiftUI-Combine-Example.xcodeproj/project.pbxproj new file mode 100755 index 0000000..9663e95 --- /dev/null +++ b/Examples/Combine using GitHub API/SwiftUI-Combine-Example.xcodeproj/project.pbxproj @@ -0,0 +1,373 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 50; + objects = { + +/* Begin PBXBuildFile section */ + 6B194EFF22A6BA07001B3151 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6B194EFE22A6BA07001B3151 /* AppDelegate.swift */; }; + 6B194F0122A6BA07001B3151 /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6B194F0022A6BA07001B3151 /* SceneDelegate.swift */; }; + 6B194F0322A6BA07001B3151 /* SearchUserView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6B194F0222A6BA07001B3151 /* SearchUserView.swift */; }; + 6B194F0522A6BA08001B3151 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 6B194F0422A6BA08001B3151 /* Assets.xcassets */; }; + 6B194F0822A6BA08001B3151 /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 6B194F0722A6BA08001B3151 /* Preview Assets.xcassets */; }; + 6B194F0B22A6BA08001B3151 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 6B194F0922A6BA08001B3151 /* LaunchScreen.storyboard */; }; + 6B194F1322A7108C001B3151 /* SearchUserRow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6B194F1222A7108C001B3151 /* SearchUserRow.swift */; }; + 6B194F1522A710AB001B3151 /* User.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6B194F1422A710AB001B3151 /* User.swift */; }; + 6B194F1722A710E6001B3151 /* SearchUserResponse.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6B194F1622A710E6001B3151 /* SearchUserResponse.swift */; }; + 6B194F1922A710FF001B3151 /* SearchUserViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6B194F1822A710FF001B3151 /* SearchUserViewModel.swift */; }; + 6B194F1B22A7112D001B3151 /* SearchUserBar.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6B194F1A22A7112D001B3151 /* SearchUserBar.swift */; }; + 6B194F1D22A71154001B3151 /* FoundationExtensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6B194F1C22A71154001B3151 /* FoundationExtensions.swift */; }; + 6B194F1F22A71B0F001B3151 /* AnySubscription.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6B194F1E22A71B0F001B3151 /* AnySubscription.swift */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + 6B194EFB22A6BA07001B3151 /* SwiftUI-Combine-Example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "SwiftUI-Combine-Example.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + 6B194EFE22A6BA07001B3151 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + 6B194F0022A6BA07001B3151 /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = ""; }; + 6B194F0222A6BA07001B3151 /* SearchUserView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SearchUserView.swift; sourceTree = ""; }; + 6B194F0422A6BA08001B3151 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 6B194F0722A6BA08001B3151 /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = ""; }; + 6B194F0A22A6BA08001B3151 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + 6B194F0C22A6BA08001B3151 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 6B194F1222A7108C001B3151 /* SearchUserRow.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SearchUserRow.swift; sourceTree = ""; }; + 6B194F1422A710AB001B3151 /* User.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = User.swift; sourceTree = ""; }; + 6B194F1622A710E6001B3151 /* SearchUserResponse.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SearchUserResponse.swift; sourceTree = ""; }; + 6B194F1822A710FF001B3151 /* SearchUserViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SearchUserViewModel.swift; sourceTree = ""; }; + 6B194F1A22A7112D001B3151 /* SearchUserBar.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SearchUserBar.swift; sourceTree = ""; }; + 6B194F1C22A71154001B3151 /* FoundationExtensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FoundationExtensions.swift; sourceTree = ""; }; + 6B194F1E22A71B0F001B3151 /* AnySubscription.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AnySubscription.swift; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 6B194EF822A6BA07001B3151 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 6B194EF222A6BA07001B3151 = { + isa = PBXGroup; + children = ( + 6B194EFD22A6BA07001B3151 /* SwiftUI-Combine-Example */, + 6B194EFC22A6BA07001B3151 /* Products */, + ); + sourceTree = ""; + }; + 6B194EFC22A6BA07001B3151 /* Products */ = { + isa = PBXGroup; + children = ( + 6B194EFB22A6BA07001B3151 /* SwiftUI-Combine-Example.app */, + ); + name = Products; + sourceTree = ""; + }; + 6B194EFD22A6BA07001B3151 /* SwiftUI-Combine-Example */ = { + isa = PBXGroup; + children = ( + 6B194F0222A6BA07001B3151 /* SearchUserView.swift */, + 6B194F1822A710FF001B3151 /* SearchUserViewModel.swift */, + 6B194F1A22A7112D001B3151 /* SearchUserBar.swift */, + 6B194F1222A7108C001B3151 /* SearchUserRow.swift */, + 6B194F1622A710E6001B3151 /* SearchUserResponse.swift */, + 6B194F1422A710AB001B3151 /* User.swift */, + 6B194F1E22A71B0F001B3151 /* AnySubscription.swift */, + 6B194F1C22A71154001B3151 /* FoundationExtensions.swift */, + 6B194F0022A6BA07001B3151 /* SceneDelegate.swift */, + 6B194EFE22A6BA07001B3151 /* AppDelegate.swift */, + 6B194F0422A6BA08001B3151 /* Assets.xcassets */, + 6B194F0922A6BA08001B3151 /* LaunchScreen.storyboard */, + 6B194F0C22A6BA08001B3151 /* Info.plist */, + 6B194F0622A6BA08001B3151 /* Preview Content */, + ); + path = "SwiftUI-Combine-Example"; + sourceTree = ""; + }; + 6B194F0622A6BA08001B3151 /* Preview Content */ = { + isa = PBXGroup; + children = ( + 6B194F0722A6BA08001B3151 /* Preview Assets.xcassets */, + ); + path = "Preview Content"; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 6B194EFA22A6BA07001B3151 /* SwiftUI-Combine-Example */ = { + isa = PBXNativeTarget; + buildConfigurationList = 6B194F0F22A6BA08001B3151 /* Build configuration list for PBXNativeTarget "SwiftUI-Combine-Example" */; + buildPhases = ( + 6B194EF722A6BA07001B3151 /* Sources */, + 6B194EF822A6BA07001B3151 /* Frameworks */, + 6B194EF922A6BA07001B3151 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "SwiftUI-Combine-Example"; + productName = "SwiftUI-Combine-Example"; + productReference = 6B194EFB22A6BA07001B3151 /* SwiftUI-Combine-Example.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 6B194EF322A6BA07001B3151 /* Project object */ = { + isa = PBXProject; + attributes = { + LastSwiftUpdateCheck = 1100; + LastUpgradeCheck = 1100; + ORGANIZATIONNAME = "Ryo Aoyama"; + TargetAttributes = { + 6B194EFA22A6BA07001B3151 = { + CreatedOnToolsVersion = 11.0; + }; + }; + }; + buildConfigurationList = 6B194EF622A6BA07001B3151 /* Build configuration list for PBXProject "SwiftUI-Combine-Example" */; + compatibilityVersion = "Xcode 9.3"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 6B194EF222A6BA07001B3151; + productRefGroup = 6B194EFC22A6BA07001B3151 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 6B194EFA22A6BA07001B3151 /* SwiftUI-Combine-Example */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 6B194EF922A6BA07001B3151 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 6B194F0B22A6BA08001B3151 /* LaunchScreen.storyboard in Resources */, + 6B194F0822A6BA08001B3151 /* Preview Assets.xcassets in Resources */, + 6B194F0522A6BA08001B3151 /* Assets.xcassets in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 6B194EF722A6BA07001B3151 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 6B194F1B22A7112D001B3151 /* SearchUserBar.swift in Sources */, + 6B194EFF22A6BA07001B3151 /* AppDelegate.swift in Sources */, + 6B194F0122A6BA07001B3151 /* SceneDelegate.swift in Sources */, + 6B194F1F22A71B0F001B3151 /* AnySubscription.swift in Sources */, + 6B194F0322A6BA07001B3151 /* SearchUserView.swift in Sources */, + 6B194F1922A710FF001B3151 /* SearchUserViewModel.swift in Sources */, + 6B194F1722A710E6001B3151 /* SearchUserResponse.swift in Sources */, + 6B194F1D22A71154001B3151 /* FoundationExtensions.swift in Sources */, + 6B194F1522A710AB001B3151 /* User.swift in Sources */, + 6B194F1322A7108C001B3151 /* SearchUserRow.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXVariantGroup section */ + 6B194F0922A6BA08001B3151 /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 6B194F0A22A6BA08001B3151 /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 6B194F0D22A6BA08001B3151 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 13.0; + MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; + MTL_FAST_MATH = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + }; + name = Debug; + }; + 6B194F0E22A6BA08001B3151 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 13.0; + MTL_ENABLE_DEBUG_INFO = NO; + MTL_FAST_MATH = YES; + SDKROOT = iphoneos; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 6B194F1022A6BA08001B3151 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_ASSET_PATHS = "SwiftUI-Combine-Example/Preview\\ Content"; + ENABLE_PREVIEWS = YES; + INFOPLIST_FILE = "SwiftUI-Combine-Example/Info.plist"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = "com.ryo.SwiftUI-Combine-Example"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = 1; + }; + name = Debug; + }; + 6B194F1122A6BA08001B3151 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_ASSET_PATHS = "SwiftUI-Combine-Example/Preview\\ Content"; + ENABLE_PREVIEWS = YES; + INFOPLIST_FILE = "SwiftUI-Combine-Example/Info.plist"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = "com.ryo.SwiftUI-Combine-Example"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = 1; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 6B194EF622A6BA07001B3151 /* Build configuration list for PBXProject "SwiftUI-Combine-Example" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 6B194F0D22A6BA08001B3151 /* Debug */, + 6B194F0E22A6BA08001B3151 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 6B194F0F22A6BA08001B3151 /* Build configuration list for PBXNativeTarget "SwiftUI-Combine-Example" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 6B194F1022A6BA08001B3151 /* Debug */, + 6B194F1122A6BA08001B3151 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 6B194EF322A6BA07001B3151 /* Project object */; +} diff --git a/Examples/Combine using GitHub API/SwiftUI-Combine-Example.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/Examples/Combine using GitHub API/SwiftUI-Combine-Example.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100755 index 0000000..d046e2b --- /dev/null +++ b/Examples/Combine using GitHub API/SwiftUI-Combine-Example.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/Examples/Combine using GitHub API/SwiftUI-Combine-Example.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/Examples/Combine using GitHub API/SwiftUI-Combine-Example.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100755 index 0000000..18d9810 --- /dev/null +++ b/Examples/Combine using GitHub API/SwiftUI-Combine-Example.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/Examples/Combine using GitHub API/SwiftUI-Combine-Example/AnySubscription.swift b/Examples/Combine using GitHub API/SwiftUI-Combine-Example/AnySubscription.swift new file mode 100755 index 0000000..b6b7768 --- /dev/null +++ b/Examples/Combine using GitHub API/SwiftUI-Combine-Example/AnySubscription.swift @@ -0,0 +1,15 @@ +import Combine + +final class AnySubscription: Subscription { + private let cancellable: Cancellable + + init(_ cancel: @escaping () -> Void) { + cancellable = AnyCancellable(cancel) + } + + func request(_ demand: Subscribers.Demand) {} + + func cancel() { + cancellable.cancel() + } +} diff --git a/Examples/Combine using GitHub API/SwiftUI-Combine-Example/AppDelegate.swift b/Examples/Combine using GitHub API/SwiftUI-Combine-Example/AppDelegate.swift new file mode 100755 index 0000000..b259097 --- /dev/null +++ b/Examples/Combine using GitHub API/SwiftUI-Combine-Example/AppDelegate.swift @@ -0,0 +1,4 @@ +import UIKit + +@UIApplicationMain +final class AppDelegate: UIResponder, UIApplicationDelegate {} diff --git a/Examples/Combine using GitHub API/SwiftUI-Combine-Example/Assets.xcassets/AppIcon.appiconset/Contents.json b/Examples/Combine using GitHub API/SwiftUI-Combine-Example/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100755 index 0000000..d8db8d6 --- /dev/null +++ b/Examples/Combine using GitHub API/SwiftUI-Combine-Example/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,98 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "size" : "20x20", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "20x20", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "3x" + }, + { + "idiom" : "ipad", + "size" : "20x20", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "20x20", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "29x29", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "40x40", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "76x76", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "76x76", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "83.5x83.5", + "scale" : "2x" + }, + { + "idiom" : "ios-marketing", + "size" : "1024x1024", + "scale" : "1x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Examples/Combine using GitHub API/SwiftUI-Combine-Example/Assets.xcassets/Contents.json b/Examples/Combine using GitHub API/SwiftUI-Combine-Example/Assets.xcassets/Contents.json new file mode 100755 index 0000000..da4a164 --- /dev/null +++ b/Examples/Combine using GitHub API/SwiftUI-Combine-Example/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Examples/Combine using GitHub API/SwiftUI-Combine-Example/Base.lproj/LaunchScreen.storyboard b/Examples/Combine using GitHub API/SwiftUI-Combine-Example/Base.lproj/LaunchScreen.storyboard new file mode 100755 index 0000000..865e932 --- /dev/null +++ b/Examples/Combine using GitHub API/SwiftUI-Combine-Example/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Examples/Combine using GitHub API/SwiftUI-Combine-Example/FoundationExtensions.swift b/Examples/Combine using GitHub API/SwiftUI-Combine-Example/FoundationExtensions.swift new file mode 100755 index 0000000..6fecb93 --- /dev/null +++ b/Examples/Combine using GitHub API/SwiftUI-Combine-Example/FoundationExtensions.swift @@ -0,0 +1,34 @@ +import SwiftUI +import Combine + +enum RequestError: Error { + case request(code: Int, error: Error?) + case unknown +} + +extension URLSession { + func send(request: URLRequest) -> AnyPublisher<(data: Data, response: HTTPURLResponse), RequestError> { + AnyPublisher<(data: Data, response: HTTPURLResponse), RequestError> { subscriber in + let task = self.dataTask(with: request) { data, response, error in + DispatchQueue.main.async { + let httpReponse = response as? HTTPURLResponse + if let data = data, let httpReponse = httpReponse, 200..<300 ~= httpReponse.statusCode { + _ = subscriber.receive((data, httpReponse)) + subscriber.receive(completion: .finished) + } + else if let httpReponse = httpReponse { + subscriber.receive(completion: .failure(.request(code: httpReponse.statusCode, error: error))) + } + else { + subscriber.receive(completion: .failure(.unknown)) + } + } + } + + subscriber.receive(subscription: AnySubscription(task.cancel)) + task.resume() + } + } +} + +extension JSONDecoder: TopLevelDecoder {} diff --git a/Examples/Combine using GitHub API/SwiftUI-Combine-Example/Info.plist b/Examples/Combine using GitHub API/SwiftUI-Combine-Example/Info.plist new file mode 100755 index 0000000..f602e95 --- /dev/null +++ b/Examples/Combine using GitHub API/SwiftUI-Combine-Example/Info.plist @@ -0,0 +1,60 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + $(PRODUCT_BUNDLE_PACKAGE_TYPE) + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1 + LSRequiresIPhoneOS + + UIApplicationSceneManifest + + UIApplicationSupportsMultipleScenes + + UISceneConfigurations + + UIWindowSceneSessionRoleApplication + + + UILaunchStoryboardName + LaunchScreen + UISceneConfigurationName + Default Configuration + UISceneDelegateClassName + $(PRODUCT_MODULE_NAME).SceneDelegate + + + + + UILaunchStoryboardName + LaunchScreen + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/Examples/Combine using GitHub API/SwiftUI-Combine-Example/Preview Content/Preview Assets.xcassets/Contents.json b/Examples/Combine using GitHub API/SwiftUI-Combine-Example/Preview Content/Preview Assets.xcassets/Contents.json new file mode 100755 index 0000000..da4a164 --- /dev/null +++ b/Examples/Combine using GitHub API/SwiftUI-Combine-Example/Preview Content/Preview Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Examples/Combine using GitHub API/SwiftUI-Combine-Example/SceneDelegate.swift b/Examples/Combine using GitHub API/SwiftUI-Combine-Example/SceneDelegate.swift new file mode 100755 index 0000000..f41d993 --- /dev/null +++ b/Examples/Combine using GitHub API/SwiftUI-Combine-Example/SceneDelegate.swift @@ -0,0 +1,15 @@ +import UIKit +import SwiftUI + +final class SceneDelegate: UIResponder, UIWindowSceneDelegate { + var window: UIWindow? + + func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) { + let window = UIWindow(frame: UIScreen.main.bounds) + window.rootViewController = UIHostingController( + rootView: SearchUserView().environmentObject(SearchUserViewModel()) + ) + self.window = window + window.makeKeyAndVisible() + } +} diff --git a/Examples/Combine using GitHub API/SwiftUI-Combine-Example/SearchUserBar.swift b/Examples/Combine using GitHub API/SwiftUI-Combine-Example/SearchUserBar.swift new file mode 100755 index 0000000..73f327b --- /dev/null +++ b/Examples/Combine using GitHub API/SwiftUI-Combine-Example/SearchUserBar.swift @@ -0,0 +1,31 @@ +import SwiftUI + +struct SearchUserBar: View { + @Binding var text: String + @State var action: () -> Void + + var body: some View { + ZStack { + HStack { + TextField( + $text, + placeholder: Text("Search User") + .color(Color.gray) + ) + .padding([.leading, .trailing], 8) + .frame(height: 32) + .background(Color.white.opacity(0.4)) + .cornerRadius(8) + + Button( + action: action, + label: { Text("Search") } + ) + .foregroundColor(Color.white) + } + .padding([.leading, .trailing], 16) + } + .frame(height: 64) + .background(Color.yellow) + } +} diff --git a/Examples/Combine using GitHub API/SwiftUI-Combine-Example/SearchUserResponse.swift b/Examples/Combine using GitHub API/SwiftUI-Combine-Example/SearchUserResponse.swift new file mode 100755 index 0000000..e950ce8 --- /dev/null +++ b/Examples/Combine using GitHub API/SwiftUI-Combine-Example/SearchUserResponse.swift @@ -0,0 +1,3 @@ +struct SearchUserResponse: Decodable { + var items: [User] +} diff --git a/Examples/Combine using GitHub API/SwiftUI-Combine-Example/SearchUserRow.swift b/Examples/Combine using GitHub API/SwiftUI-Combine-Example/SearchUserRow.swift new file mode 100755 index 0000000..08be368 --- /dev/null +++ b/Examples/Combine using GitHub API/SwiftUI-Combine-Example/SearchUserRow.swift @@ -0,0 +1,26 @@ +import SwiftUI + +struct SearchUserRow: View { + @EnvironmentObject var viewModel: SearchUserViewModel + @State var user: User + + var body: some View { + HStack { + self.viewModel.userImages[user].map { image in + Image(uiImage: image) + .frame(width: 44, height: 44) + .aspectRatio(contentMode: .fit) + .clipShape(Circle()) + .overlay(Circle().stroke(Color.gray, lineWidth: 1)) + } + + Text(user.login) + .font(Font.system(size: 18).bold()) + + Spacer() + } + .padding(EdgeInsets(top: 8, leading: 16, bottom: 8, trailing: 16)) + .frame(height: 60) + .onAppear { self.viewModel.getImage(for: self.user) } + } +} diff --git a/Examples/Combine using GitHub API/SwiftUI-Combine-Example/SearchUserView.swift b/Examples/Combine using GitHub API/SwiftUI-Combine-Example/SearchUserView.swift new file mode 100755 index 0000000..8ae5044 --- /dev/null +++ b/Examples/Combine using GitHub API/SwiftUI-Combine-Example/SearchUserView.swift @@ -0,0 +1,22 @@ +import SwiftUI + +struct SearchUserView: View { + @EnvironmentObject var viewModel: SearchUserViewModel + @State var text = "ra1028" + + var body: some View { + NavigationView { + VStack { + SearchUserBar(text: $text) { + self.viewModel.search(name: self.text) + } + + List(viewModel.users) { user in + SearchUserRow(user: user) + .tapAction { print(user) } + } + } + .navigationBarTitle(Text("Users")) + } + } +} diff --git a/Examples/Combine using GitHub API/SwiftUI-Combine-Example/SearchUserViewModel.swift b/Examples/Combine using GitHub API/SwiftUI-Combine-Example/SearchUserViewModel.swift new file mode 100755 index 0000000..b302b8a --- /dev/null +++ b/Examples/Combine using GitHub API/SwiftUI-Combine-Example/SearchUserViewModel.swift @@ -0,0 +1,60 @@ +import SwiftUI +import Combine + +final class SearchUserViewModel: BindableObject { + var didChange = PassthroughSubject() + + private(set) var users = [User]() { + didSet { + didChange.send(self) + } + } + + private(set) var userImages = [User: UIImage]() { + didSet { + didChange.send(self) + } + } + + private var cancellable: Cancellable? { + didSet { oldValue?.cancel() } + } + + func search(name: String) { + guard !name.isEmpty else { + return users = [] + } + + var urlComponents = URLComponents(string: "https://api.github.com/search/users")! + urlComponents.queryItems = [ + URLQueryItem(name: "q", value: name) + ] + var request = URLRequest(url: urlComponents.url!) + request.addValue("application/json", forHTTPHeaderField: "Content-Type") + + let assign = Subscribers.Assign(object: self, keyPath: \.users) + cancellable = assign + + URLSession.shared.send(request: request) + .map { $0.data } + .decode(type: SearchUserResponse.self, decoder: JSONDecoder()) + .map { $0.items } + .replaceError(with: []) + .receive(subscriber: assign) + } + + func getImage(for user: User) { + guard case .none = userImages[user] else { + return + } + + let request = URLRequest(url: user.avatar_url) + URLSession.shared.send(request: request) + .map { UIImage(data: $0.data) } + .replaceError(with: nil) + .eraseToAnyPublisher() + .receive(subscriber: Subscribers.Sink> { [weak self] image in + self?.userImages[user] = image + }) + } +} diff --git a/Examples/Combine using GitHub API/SwiftUI-Combine-Example/User.swift b/Examples/Combine using GitHub API/SwiftUI-Combine-Example/User.swift new file mode 100755 index 0000000..f66f698 --- /dev/null +++ b/Examples/Combine using GitHub API/SwiftUI-Combine-Example/User.swift @@ -0,0 +1,8 @@ +import Foundation +import SwiftUI + +struct User: Hashable, Identifiable, Decodable { + var id: Int64 + var login: String + var avatar_url: URL +} diff --git a/Examples/Combine using GitHub API/assets/sample.png b/Examples/Combine using GitHub API/assets/sample.png new file mode 100755 index 0000000..278656c Binary files /dev/null and b/Examples/Combine using GitHub API/assets/sample.png differ diff --git a/Examples/ComposingComplexInterfaces/Complete/.gitignore b/Examples/ComposingComplexInterfaces/Complete/.gitignore new file mode 100755 index 0000000..9e50718 --- /dev/null +++ b/Examples/ComposingComplexInterfaces/Complete/.gitignore @@ -0,0 +1,21 @@ +# See LICENSE folder for this sample’s licensing information. +# +# Apple sample code gitignore configuration. + +# Finder +.DS_Store + +# Xcode - User files +xcuserdata/ + +**/*.xcodeproj/project.xcworkspace/* +!**/*.xcodeproj/project.xcworkspace/xcshareddata + +**/*.xcodeproj/project.xcworkspace/xcshareddata/* +!**/*.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings + +**/*.playground/playground.xcworkspace/* +!**/*.playground/playground.xcworkspace/xcshareddata + +**/*.playground/playground.xcworkspace/xcshareddata/* +!**/*.playground/playground.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings diff --git a/Examples/ComposingComplexInterfaces/Complete/Configuration/SampleCode.xcconfig b/Examples/ComposingComplexInterfaces/Complete/Configuration/SampleCode.xcconfig new file mode 100755 index 0000000..db86c06 --- /dev/null +++ b/Examples/ComposingComplexInterfaces/Complete/Configuration/SampleCode.xcconfig @@ -0,0 +1,13 @@ +// +// See LICENSE folder for this sample’s licensing information. +// +// SampleCode.xcconfig +// + +// The `SAMPLE_CODE_DISAMBIGUATOR` configuration is to make it easier to build +// and run a sample code project. Once you set your project's development team, +// you'll have a unique bundle identifier. This is because the bundle identifier +// is derived based on the 'SAMPLE_CODE_DISAMBIGUATOR' value. Do not use this +// approach in your own projects—it's only useful for sample code projects because +// they are frequently downloaded and don't have a development team set. +SAMPLE_CODE_DISAMBIGUATOR=${DEVELOPMENT_TEAM} diff --git a/Examples/ComposingComplexInterfaces/Complete/LICENSE/LICENSE.txt b/Examples/ComposingComplexInterfaces/Complete/LICENSE/LICENSE.txt new file mode 100755 index 0000000..94e3d54 --- /dev/null +++ b/Examples/ComposingComplexInterfaces/Complete/LICENSE/LICENSE.txt @@ -0,0 +1,8 @@ +Copyright © 2019 Apple Inc. + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + diff --git a/Examples/ComposingComplexInterfaces/Complete/Landmarks/ComposingComplexInterfaces.xcodeproj/.xcodesamplecode.plist b/Examples/ComposingComplexInterfaces/Complete/Landmarks/ComposingComplexInterfaces.xcodeproj/.xcodesamplecode.plist new file mode 100755 index 0000000..5dd5da8 --- /dev/null +++ b/Examples/ComposingComplexInterfaces/Complete/Landmarks/ComposingComplexInterfaces.xcodeproj/.xcodesamplecode.plist @@ -0,0 +1,5 @@ + + + + + diff --git a/Examples/ComposingComplexInterfaces/Complete/Landmarks/ComposingComplexInterfaces.xcodeproj/project.pbxproj b/Examples/ComposingComplexInterfaces/Complete/Landmarks/ComposingComplexInterfaces.xcodeproj/project.pbxproj new file mode 100755 index 0000000..099efaa --- /dev/null +++ b/Examples/ComposingComplexInterfaces/Complete/Landmarks/ComposingComplexInterfaces.xcodeproj/project.pbxproj @@ -0,0 +1,533 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 50; + objects = { + +/* Begin PBXBuildFile section */ + B7310DD1229F6839001079B9 /* HexagonParameters.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7310DD0229F6839001079B9 /* HexagonParameters.swift */; }; + B7310DD3229F6CA9001079B9 /* Badge.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7310DD2229F6CA9001079B9 /* Badge.swift */; }; + B7394866229F194000C47603 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7394865229F194000C47603 /* AppDelegate.swift */; }; + B7394868229F194000C47603 /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7394867229F194000C47603 /* SceneDelegate.swift */; }; + B739486A229F194000C47603 /* LandmarkDetail.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7394869229F194000C47603 /* LandmarkDetail.swift */; }; + B739486C229F194200C47603 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = B739486B229F194200C47603 /* Assets.xcassets */; }; + B739486F229F194200C47603 /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = B739486E229F194200C47603 /* Preview Assets.xcassets */; }; + B7394872229F194200C47603 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = B7394870229F194200C47603 /* LaunchScreen.storyboard */; }; + B739487A229F1B3F00C47603 /* CircleImage.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7394879229F1B3F00C47603 /* CircleImage.swift */; }; + B739487C229F1B6800C47603 /* MapView.swift in Sources */ = {isa = PBXBuildFile; fileRef = B739487B229F1B6800C47603 /* MapView.swift */; }; + B7394881229F28B900C47603 /* Landmark.swift in Sources */ = {isa = PBXBuildFile; fileRef = B739487F229F28B900C47603 /* Landmark.swift */; }; + B7394882229F28B900C47603 /* Data.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7394880229F28B900C47603 /* Data.swift */; }; + B7394891229F292F00C47603 /* rainbowlake.jpg in Resources */ = {isa = PBXBuildFile; fileRef = B7394884229F292D00C47603 /* rainbowlake.jpg */; }; + B7394893229F292F00C47603 /* icybay.jpg in Resources */ = {isa = PBXBuildFile; fileRef = B7394886229F292E00C47603 /* icybay.jpg */; }; + B7394894229F292F00C47603 /* lakemcdonald.jpg in Resources */ = {isa = PBXBuildFile; fileRef = B7394887229F292E00C47603 /* lakemcdonald.jpg */; }; + B7394895229F292F00C47603 /* turtlerock.jpg in Resources */ = {isa = PBXBuildFile; fileRef = B7394888229F292E00C47603 /* turtlerock.jpg */; }; + B7394896229F292F00C47603 /* umbagog.jpg in Resources */ = {isa = PBXBuildFile; fileRef = B7394889229F292E00C47603 /* umbagog.jpg */; }; + B7394897229F292F00C47603 /* hiddenlake.jpg in Resources */ = {isa = PBXBuildFile; fileRef = B739488A229F292E00C47603 /* hiddenlake.jpg */; }; + B7394898229F292F00C47603 /* stmarylake.jpg in Resources */ = {isa = PBXBuildFile; fileRef = B739488B229F292E00C47603 /* stmarylake.jpg */; }; + B7394899229F292F00C47603 /* twinlake.jpg in Resources */ = {isa = PBXBuildFile; fileRef = B739488C229F292E00C47603 /* twinlake.jpg */; }; + B739489A229F292F00C47603 /* silversalmoncreek.jpg in Resources */ = {isa = PBXBuildFile; fileRef = B739488D229F292E00C47603 /* silversalmoncreek.jpg */; }; + B739489B229F292F00C47603 /* landmarkData.json in Resources */ = {isa = PBXBuildFile; fileRef = B739488E229F292E00C47603 /* landmarkData.json */; }; + B739489C229F292F00C47603 /* chincoteague.jpg in Resources */ = {isa = PBXBuildFile; fileRef = B739488F229F292F00C47603 /* chincoteague.jpg */; }; + B739489D229F292F00C47603 /* chilkoottrail.jpg in Resources */ = {isa = PBXBuildFile; fileRef = B7394890229F292F00C47603 /* chilkoottrail.jpg */; }; + B739489F229F2D9700C47603 /* LandmarkRow.swift in Sources */ = {isa = PBXBuildFile; fileRef = B739489E229F2D9700C47603 /* LandmarkRow.swift */; }; + B73948A1229F2E1F00C47603 /* LandmarkList.swift in Sources */ = {isa = PBXBuildFile; fileRef = B73948A0229F2E1F00C47603 /* LandmarkList.swift */; }; + B73948A3229F3E2200C47603 /* charleyrivers.jpg in Resources */ = {isa = PBXBuildFile; fileRef = B73948A2229F3E2200C47603 /* charleyrivers.jpg */; }; + B7D2AAC5229F4D7C0061E5F5 /* UserData.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7D2AAC4229F4D7C0061E5F5 /* UserData.swift */; }; + B7D587AE229F7382006E8DCF /* BadgeBackground.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7D587AD229F7382006E8DCF /* BadgeBackground.swift */; }; + B7D587B0229F73C1006E8DCF /* BadgeSymbol.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7D587AF229F73C1006E8DCF /* BadgeSymbol.swift */; }; + B7D587B2229F7406006E8DCF /* RotatedBadgeSymbol.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7D587B1229F7406006E8DCF /* RotatedBadgeSymbol.swift */; }; + B7D587B6229F825D006E8DCF /* HikeView.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7D587B5229F825D006E8DCF /* HikeView.swift */; }; + B7D587B8229F826D006E8DCF /* GraphCapsule.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7D587B7229F826D006E8DCF /* GraphCapsule.swift */; }; + B7D587BA229F8288006E8DCF /* Hike.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7D587B9229F8288006E8DCF /* Hike.swift */; }; + B7D587BC229F82EB006E8DCF /* HikeDetail.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7D587BB229F82EB006E8DCF /* HikeDetail.swift */; }; + B7D587BE229F82FF006E8DCF /* HikeGraph.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7D587BD229F82FF006E8DCF /* HikeGraph.swift */; }; + B7D587C0229F830B006E8DCF /* hikeData.json in Resources */ = {isa = PBXBuildFile; fileRef = B7D587BF229F830B006E8DCF /* hikeData.json */; }; + B7D587D222A0892C006E8DCF /* Home.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7D587D122A0892C006E8DCF /* Home.swift */; }; + B7D587D422A08965006E8DCF /* CategoryRow.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7D587D322A08965006E8DCF /* CategoryRow.swift */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + A27B87A0A27B580000000001 /* SampleCode.xcconfig */ = {isa = PBXFileReference; name = SampleCode.xcconfig; path = ../Configuration/SampleCode.xcconfig; sourceTree = ""; }; + A4D4D040A4D4CB5000000001 /* LICENSE.txt */ = {isa = PBXFileReference; includeInIndex = 1; path = LICENSE.txt; sourceTree = ""; }; + B7310DD0229F6839001079B9 /* HexagonParameters.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HexagonParameters.swift; sourceTree = ""; }; + B7310DD2229F6CA9001079B9 /* Badge.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Badge.swift; sourceTree = ""; }; + B7394862229F194000C47603 /* Landmarks.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Landmarks.app; sourceTree = BUILT_PRODUCTS_DIR; }; + B7394865229F194000C47603 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + B7394867229F194000C47603 /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = ""; }; + B7394869229F194000C47603 /* LandmarkDetail.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LandmarkDetail.swift; sourceTree = ""; }; + B739486B229F194200C47603 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + B739486E229F194200C47603 /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = ""; }; + B7394871229F194200C47603 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + B7394873229F194200C47603 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + B7394879229F1B3F00C47603 /* CircleImage.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CircleImage.swift; sourceTree = ""; }; + B739487B229F1B6800C47603 /* MapView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MapView.swift; sourceTree = ""; }; + B739487F229F28B900C47603 /* Landmark.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Landmark.swift; sourceTree = ""; }; + B7394880229F28B900C47603 /* Data.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Data.swift; sourceTree = ""; }; + B7394884229F292D00C47603 /* rainbowlake.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = rainbowlake.jpg; sourceTree = ""; }; + B7394886229F292E00C47603 /* icybay.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = icybay.jpg; sourceTree = ""; }; + B7394887229F292E00C47603 /* lakemcdonald.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = lakemcdonald.jpg; sourceTree = ""; }; + B7394888229F292E00C47603 /* turtlerock.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = turtlerock.jpg; sourceTree = ""; }; + B7394889229F292E00C47603 /* umbagog.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = umbagog.jpg; sourceTree = ""; }; + B739488A229F292E00C47603 /* hiddenlake.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = hiddenlake.jpg; sourceTree = ""; }; + B739488B229F292E00C47603 /* stmarylake.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = stmarylake.jpg; sourceTree = ""; }; + B739488C229F292E00C47603 /* twinlake.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = twinlake.jpg; sourceTree = ""; }; + B739488D229F292E00C47603 /* silversalmoncreek.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = silversalmoncreek.jpg; sourceTree = ""; }; + B739488E229F292E00C47603 /* landmarkData.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = landmarkData.json; sourceTree = ""; }; + B739488F229F292F00C47603 /* chincoteague.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = chincoteague.jpg; sourceTree = ""; }; + B7394890229F292F00C47603 /* chilkoottrail.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = chilkoottrail.jpg; sourceTree = ""; }; + B739489E229F2D9700C47603 /* LandmarkRow.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = LandmarkRow.swift; path = "Supporting Views/LandmarkRow.swift"; sourceTree = ""; }; + B73948A0229F2E1F00C47603 /* LandmarkList.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LandmarkList.swift; sourceTree = ""; }; + B73948A2229F3E2200C47603 /* charleyrivers.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = charleyrivers.jpg; sourceTree = ""; }; + B7D2AAC4229F4D7C0061E5F5 /* UserData.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UserData.swift; sourceTree = ""; }; + B7D587AD229F7382006E8DCF /* BadgeBackground.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BadgeBackground.swift; sourceTree = ""; }; + B7D587AF229F73C1006E8DCF /* BadgeSymbol.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BadgeSymbol.swift; sourceTree = ""; }; + B7D587B1229F7406006E8DCF /* RotatedBadgeSymbol.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RotatedBadgeSymbol.swift; sourceTree = ""; }; + B7D587B5229F825D006E8DCF /* HikeView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HikeView.swift; sourceTree = ""; }; + B7D587B7229F826D006E8DCF /* GraphCapsule.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GraphCapsule.swift; sourceTree = ""; }; + B7D587B9229F8288006E8DCF /* Hike.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Hike.swift; sourceTree = ""; }; + B7D587BB229F82EB006E8DCF /* HikeDetail.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HikeDetail.swift; sourceTree = ""; }; + B7D587BD229F82FF006E8DCF /* HikeGraph.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HikeGraph.swift; sourceTree = ""; }; + B7D587BF229F830B006E8DCF /* hikeData.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = hikeData.json; sourceTree = ""; }; + B7D587D122A0892C006E8DCF /* Home.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Home.swift; sourceTree = ""; }; + B7D587D322A08965006E8DCF /* CategoryRow.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CategoryRow.swift; sourceTree = ""; }; + C4E4AAA0C4E4035000000001 /* README.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; name = README.md; path = ../README.md; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + B739485F229F194000C47603 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + A279A190A27B3EC000000001 /* Configuration */ = { + isa = PBXGroup; + children = ( + A27B87A0A27B580000000001 /* SampleCode.xcconfig */, + ); + name = Configuration; + sourceTree = ""; + }; + A4D4C180A4D4BC9000000001 /* LICENSE */ = { + isa = PBXGroup; + children = ( + A4D4D040A4D4CB5000000001 /* LICENSE.txt */, + ); + name = LICENSE; + path = ../LICENSE; + sourceTree = ""; + }; + B7394859229F194000C47603 = { + isa = PBXGroup; + children = ( + C4E4AAA0C4E4035000000001 /* README.md */, + B7394864229F194000C47603 /* Landmarks */, + B7394863229F194000C47603 /* Products */, + A279A190A27B3EC000000001 /* Configuration */, + A4D4C180A4D4BC9000000001 /* LICENSE */, + ); + sourceTree = ""; + }; + B7394863229F194000C47603 /* Products */ = { + isa = PBXGroup; + children = ( + B7394862229F194000C47603 /* Landmarks.app */, + ); + name = Products; + sourceTree = ""; + }; + B7394864229F194000C47603 /* Landmarks */ = { + isa = PBXGroup; + children = ( + B739487E229F282200C47603 /* Models */, + B7394865229F194000C47603 /* AppDelegate.swift */, + B7394867229F194000C47603 /* SceneDelegate.swift */, + B7D587D122A0892C006E8DCF /* Home.swift */, + B7D587D322A08965006E8DCF /* CategoryRow.swift */, + B73948A0229F2E1F00C47603 /* LandmarkList.swift */, + B739489E229F2D9700C47603 /* LandmarkRow.swift */, + B7394869229F194000C47603 /* LandmarkDetail.swift */, + B7D587B5229F825D006E8DCF /* HikeView.swift */, + B7D587BB229F82EB006E8DCF /* HikeDetail.swift */, + B7310DD0229F6839001079B9 /* HexagonParameters.swift */, + B739487D229F1C0100C47603 /* Supporting Views */, + B7394883229F291A00C47603 /* Resources */, + B739486B229F194200C47603 /* Assets.xcassets */, + B7394870229F194200C47603 /* LaunchScreen.storyboard */, + B7394873229F194200C47603 /* Info.plist */, + B739486D229F194200C47603 /* Preview Content */, + ); + path = Landmarks; + sourceTree = ""; + }; + B739486D229F194200C47603 /* Preview Content */ = { + isa = PBXGroup; + children = ( + B739486E229F194200C47603 /* Preview Assets.xcassets */, + ); + path = "Preview Content"; + sourceTree = ""; + }; + B739487D229F1C0100C47603 /* Supporting Views */ = { + isa = PBXGroup; + children = ( + B7394879229F1B3F00C47603 /* CircleImage.swift */, + B739487B229F1B6800C47603 /* MapView.swift */, + B7310DD2229F6CA9001079B9 /* Badge.swift */, + B7D587AF229F73C1006E8DCF /* BadgeSymbol.swift */, + B7D587B1229F7406006E8DCF /* RotatedBadgeSymbol.swift */, + B7D587AD229F7382006E8DCF /* BadgeBackground.swift */, + B7D587BD229F82FF006E8DCF /* HikeGraph.swift */, + B7D587B7229F826D006E8DCF /* GraphCapsule.swift */, + ); + path = "Supporting Views"; + sourceTree = ""; + }; + B739487E229F282200C47603 /* Models */ = { + isa = PBXGroup; + children = ( + B7394880229F28B900C47603 /* Data.swift */, + B739487F229F28B900C47603 /* Landmark.swift */, + B7D587B9229F8288006E8DCF /* Hike.swift */, + B7D2AAC4229F4D7C0061E5F5 /* UserData.swift */, + ); + path = Models; + sourceTree = ""; + }; + B7394883229F291A00C47603 /* Resources */ = { + isa = PBXGroup; + children = ( + B739488E229F292E00C47603 /* landmarkData.json */, + B7D587BF229F830B006E8DCF /* hikeData.json */, + B7394890229F292F00C47603 /* chilkoottrail.jpg */, + B739488F229F292F00C47603 /* chincoteague.jpg */, + B739488A229F292E00C47603 /* hiddenlake.jpg */, + B7394886229F292E00C47603 /* icybay.jpg */, + B7394887229F292E00C47603 /* lakemcdonald.jpg */, + B7394884229F292D00C47603 /* rainbowlake.jpg */, + B739488D229F292E00C47603 /* silversalmoncreek.jpg */, + B739488B229F292E00C47603 /* stmarylake.jpg */, + B7394888229F292E00C47603 /* turtlerock.jpg */, + B739488C229F292E00C47603 /* twinlake.jpg */, + B7394889229F292E00C47603 /* umbagog.jpg */, + B73948A2229F3E2200C47603 /* charleyrivers.jpg */, + ); + path = Resources; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + B7394861229F194000C47603 /* Landmarks */ = { + isa = PBXNativeTarget; + buildConfigurationList = B7394876229F194200C47603 /* Build configuration list for PBXNativeTarget "Landmarks" */; + buildPhases = ( + B739485E229F194000C47603 /* Sources */, + B739485F229F194000C47603 /* Frameworks */, + B7394860229F194000C47603 /* Resources */, + C602AC70C605937000000001, + ); + buildRules = ( + ); + dependencies = ( + ); + name = Landmarks; + productName = Landmarks; + productReference = B7394862229F194000C47603 /* Landmarks.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + B739485A229F194000C47603 /* Project object */ = { + isa = PBXProject; + attributes = { + LastSwiftUpdateCheck = 1100; + LastUpgradeCheck = 1100; + ORGANIZATIONNAME = Apple; + TargetAttributes = { + B7394861229F194000C47603 = { + CreatedOnToolsVersion = 11.0; + }; + }; + }; + buildConfigurationList = B739485D229F194000C47603 /* Build configuration list for PBXProject "ComposingComplexInterfaces" */; + compatibilityVersion = "Xcode 9.3"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = B7394859229F194000C47603; + productRefGroup = B7394863229F194000C47603 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + B7394861229F194000C47603 /* Landmarks */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + B7394860229F194000C47603 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + B739489A229F292F00C47603 /* silversalmoncreek.jpg in Resources */, + B7394894229F292F00C47603 /* lakemcdonald.jpg in Resources */, + B7D587C0229F830B006E8DCF /* hikeData.json in Resources */, + B7394872229F194200C47603 /* LaunchScreen.storyboard in Resources */, + B73948A3229F3E2200C47603 /* charleyrivers.jpg in Resources */, + B7394891229F292F00C47603 /* rainbowlake.jpg in Resources */, + B739486F229F194200C47603 /* Preview Assets.xcassets in Resources */, + B7394895229F292F00C47603 /* turtlerock.jpg in Resources */, + B739486C229F194200C47603 /* Assets.xcassets in Resources */, + B7394899229F292F00C47603 /* twinlake.jpg in Resources */, + B7394896229F292F00C47603 /* umbagog.jpg in Resources */, + B739489D229F292F00C47603 /* chilkoottrail.jpg in Resources */, + B739489C229F292F00C47603 /* chincoteague.jpg in Resources */, + B739489B229F292F00C47603 /* landmarkData.json in Resources */, + B7394893229F292F00C47603 /* icybay.jpg in Resources */, + B7394897229F292F00C47603 /* hiddenlake.jpg in Resources */, + B7394898229F292F00C47603 /* stmarylake.jpg in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + B739485E229F194000C47603 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + B7394882229F28B900C47603 /* Data.swift in Sources */, + B7310DD3229F6CA9001079B9 /* Badge.swift in Sources */, + B7394866229F194000C47603 /* AppDelegate.swift in Sources */, + B7D587B8229F826D006E8DCF /* GraphCapsule.swift in Sources */, + B7D587D422A08965006E8DCF /* CategoryRow.swift in Sources */, + B739487A229F1B3F00C47603 /* CircleImage.swift in Sources */, + B739487C229F1B6800C47603 /* MapView.swift in Sources */, + B7D587BA229F8288006E8DCF /* Hike.swift in Sources */, + B7D587BC229F82EB006E8DCF /* HikeDetail.swift in Sources */, + B7D587B6229F825D006E8DCF /* HikeView.swift in Sources */, + B7310DD1229F6839001079B9 /* HexagonParameters.swift in Sources */, + B73948A1229F2E1F00C47603 /* LandmarkList.swift in Sources */, + B7D587B0229F73C1006E8DCF /* BadgeSymbol.swift in Sources */, + B7D587B2229F7406006E8DCF /* RotatedBadgeSymbol.swift in Sources */, + B7D587D222A0892C006E8DCF /* Home.swift in Sources */, + B7D587BE229F82FF006E8DCF /* HikeGraph.swift in Sources */, + B7394868229F194000C47603 /* SceneDelegate.swift in Sources */, + B7D587AE229F7382006E8DCF /* BadgeBackground.swift in Sources */, + B739486A229F194000C47603 /* LandmarkDetail.swift in Sources */, + B739489F229F2D9700C47603 /* LandmarkRow.swift in Sources */, + B7D2AAC5229F4D7C0061E5F5 /* UserData.swift in Sources */, + B7394881229F28B900C47603 /* Landmark.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXVariantGroup section */ + B7394870229F194200C47603 /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + B7394871229F194200C47603 /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + B7394874229F194200C47603 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = A27B87A0A27B580000000001 /* SampleCode.xcconfig */; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 13.0; + MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; + MTL_FAST_MATH = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + }; + name = Debug; + }; + B7394875229F194200C47603 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = A27B87A0A27B580000000001 /* SampleCode.xcconfig */; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 13.0; + MTL_ENABLE_DEBUG_INFO = NO; + MTL_FAST_MATH = YES; + SDKROOT = iphoneos; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + B7394877229F194200C47603 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = A27B87A0A27B580000000001 /* SampleCode.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_ASSET_PATHS = "Landmarks/Preview\\ Content"; + DEVELOPMENT_TEAM = ""; + ENABLE_PREVIEWS = YES; + INFOPLIST_FILE = Landmarks/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = "com.example.apple-samplecode.Landmarks${SAMPLE_CODE_DISAMBIGUATOR}"; + PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE_SPECIFIER = ""; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + B7394878229F194200C47603 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = A27B87A0A27B580000000001 /* SampleCode.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_ASSET_PATHS = "Landmarks/Preview\\ Content"; + DEVELOPMENT_TEAM = ""; + ENABLE_PREVIEWS = YES; + INFOPLIST_FILE = Landmarks/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = "com.example.apple-samplecode.Landmarks${SAMPLE_CODE_DISAMBIGUATOR}"; + PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE_SPECIFIER = ""; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + B739485D229F194000C47603 /* Build configuration list for PBXProject "ComposingComplexInterfaces" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + B7394874229F194200C47603 /* Debug */, + B7394875229F194200C47603 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + B7394876229F194200C47603 /* Build configuration list for PBXNativeTarget "Landmarks" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + B7394877229F194200C47603 /* Debug */, + B7394878229F194200C47603 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = B739485A229F194000C47603 /* Project object */; +} diff --git a/Examples/ComposingComplexInterfaces/Complete/Landmarks/ComposingComplexInterfaces.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/Examples/ComposingComplexInterfaces/Complete/Landmarks/ComposingComplexInterfaces.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings new file mode 100755 index 0000000..3ddf867 --- /dev/null +++ b/Examples/ComposingComplexInterfaces/Complete/Landmarks/ComposingComplexInterfaces.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings @@ -0,0 +1,8 @@ + + + + + BuildSystemType + Latest + + diff --git a/Examples/ComposingComplexInterfaces/Complete/Landmarks/Landmarks/AppDelegate.swift b/Examples/ComposingComplexInterfaces/Complete/Landmarks/Landmarks/AppDelegate.swift new file mode 100755 index 0000000..e22943b --- /dev/null +++ b/Examples/ComposingComplexInterfaces/Complete/Landmarks/Landmarks/AppDelegate.swift @@ -0,0 +1,36 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +The application delegate. +*/ + +import UIKit + +@UIApplicationMain +class AppDelegate: UIResponder, UIApplicationDelegate { + + func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { + // Override point for customization after application launch. + return true + } + + func applicationWillTerminate(_ application: UIApplication) { + // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. + } + + // MARK: UISceneSession Lifecycle + func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration { + // Called when a new scene session is being created. + // Use this method to select a configuration to create the new scene with. + return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role) + } + + func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set) { + // Called when the user discards a scene session. + // If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions. + // Use this method to release any resources that were specific to the discarded scenes, as they will not return. + } + +} + diff --git a/Examples/ComposingComplexInterfaces/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/Contents.json b/Examples/ComposingComplexInterfaces/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100755 index 0000000..fa0d2db --- /dev/null +++ b/Examples/ComposingComplexInterfaces/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,113 @@ +{ + "images" : [ + { + "size" : "20x20", + "idiom" : "iphone", + "filename" : "landmark_app_icon_40x40.png", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "20x20", + "scale" : "3x" + }, + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "landmark_app_icon_58x58.png", + "scale" : "2x" + }, + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "landmark_app_icon_87x87.png", + "scale" : "3x" + }, + { + "size" : "40x40", + "idiom" : "iphone", + "filename" : "landmark_app_icon_80x80.png", + "scale" : "2x" + }, + { + "size" : "40x40", + "idiom" : "iphone", + "filename" : "landmark_app_icon_120x120.png", + "scale" : "3x" + }, + { + "size" : "60x60", + "idiom" : "iphone", + "filename" : "landmark_app_icon_120x120-1.png", + "scale" : "2x" + }, + { + "size" : "60x60", + "idiom" : "iphone", + "filename" : "landmark_app_icon_180x180.png", + "scale" : "3x" + }, + { + "idiom" : "ipad", + "size" : "20x20", + "scale" : "1x" + }, + { + "size" : "20x20", + "idiom" : "ipad", + "filename" : "landmark_app_icon_40x40-1.png", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "29x29", + "scale" : "1x" + }, + { + "size" : "29x29", + "idiom" : "ipad", + "filename" : "landmark_app_icon_58x58-1.png", + "scale" : "2x" + }, + { + "size" : "40x40", + "idiom" : "ipad", + "filename" : "landmark_app_icon_40x40-2.png", + "scale" : "1x" + }, + { + "size" : "40x40", + "idiom" : "ipad", + "filename" : "landmark_app_icon_80x80-1.png", + "scale" : "2x" + }, + { + "size" : "76x76", + "idiom" : "ipad", + "filename" : "landmark_app_icon_76x76.png", + "scale" : "1x" + }, + { + "size" : "76x76", + "idiom" : "ipad", + "filename" : "landmark_app_icon_152x152.png", + "scale" : "2x" + }, + { + "size" : "83.5x83.5", + "idiom" : "ipad", + "filename" : "landmark_app_icon_167x167.png", + "scale" : "2x" + }, + { + "size" : "1024x1024", + "idiom" : "ios-marketing", + "filename" : "landmark_app_icon_1024x1024.png", + "scale" : "1x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Examples/ComposingComplexInterfaces/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_1024x1024.png b/Examples/ComposingComplexInterfaces/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_1024x1024.png new file mode 100755 index 0000000..00d81c1 Binary files /dev/null and b/Examples/ComposingComplexInterfaces/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_1024x1024.png differ diff --git a/Examples/ComposingComplexInterfaces/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_120x120-1.png b/Examples/ComposingComplexInterfaces/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_120x120-1.png new file mode 100755 index 0000000..d382b8b Binary files /dev/null and b/Examples/ComposingComplexInterfaces/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_120x120-1.png differ diff --git a/Examples/ComposingComplexInterfaces/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_120x120.png b/Examples/ComposingComplexInterfaces/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_120x120.png new file mode 100755 index 0000000..d382b8b Binary files /dev/null and b/Examples/ComposingComplexInterfaces/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_120x120.png differ diff --git a/Examples/ComposingComplexInterfaces/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_152x152.png b/Examples/ComposingComplexInterfaces/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_152x152.png new file mode 100755 index 0000000..11057f8 Binary files /dev/null and b/Examples/ComposingComplexInterfaces/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_152x152.png differ diff --git a/Examples/ComposingComplexInterfaces/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_167x167.png b/Examples/ComposingComplexInterfaces/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_167x167.png new file mode 100755 index 0000000..f73bc26 Binary files /dev/null and b/Examples/ComposingComplexInterfaces/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_167x167.png differ diff --git a/Examples/ComposingComplexInterfaces/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_180x180.png b/Examples/ComposingComplexInterfaces/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_180x180.png new file mode 100755 index 0000000..b02738c Binary files /dev/null and b/Examples/ComposingComplexInterfaces/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_180x180.png differ diff --git a/Examples/ComposingComplexInterfaces/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_40x40-1.png b/Examples/ComposingComplexInterfaces/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_40x40-1.png new file mode 100755 index 0000000..abaff0e Binary files /dev/null and b/Examples/ComposingComplexInterfaces/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_40x40-1.png differ diff --git a/Examples/ComposingComplexInterfaces/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_40x40-2.png b/Examples/ComposingComplexInterfaces/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_40x40-2.png new file mode 100755 index 0000000..abaff0e Binary files /dev/null and b/Examples/ComposingComplexInterfaces/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_40x40-2.png differ diff --git a/Examples/ComposingComplexInterfaces/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_40x40.png b/Examples/ComposingComplexInterfaces/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_40x40.png new file mode 100755 index 0000000..abaff0e Binary files /dev/null and b/Examples/ComposingComplexInterfaces/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_40x40.png differ diff --git a/Examples/ComposingComplexInterfaces/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_58x58-1.png b/Examples/ComposingComplexInterfaces/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_58x58-1.png new file mode 100755 index 0000000..cf7c73d Binary files /dev/null and b/Examples/ComposingComplexInterfaces/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_58x58-1.png differ diff --git a/Examples/ComposingComplexInterfaces/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_58x58.png b/Examples/ComposingComplexInterfaces/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_58x58.png new file mode 100755 index 0000000..cf7c73d Binary files /dev/null and b/Examples/ComposingComplexInterfaces/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_58x58.png differ diff --git a/Examples/ComposingComplexInterfaces/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_76x76.png b/Examples/ComposingComplexInterfaces/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_76x76.png new file mode 100755 index 0000000..3eff85b Binary files /dev/null and b/Examples/ComposingComplexInterfaces/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_76x76.png differ diff --git a/Examples/ComposingComplexInterfaces/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_80x80-1.png b/Examples/ComposingComplexInterfaces/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_80x80-1.png new file mode 100755 index 0000000..6f33f66 Binary files /dev/null and b/Examples/ComposingComplexInterfaces/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_80x80-1.png differ diff --git a/Examples/ComposingComplexInterfaces/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_80x80.png b/Examples/ComposingComplexInterfaces/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_80x80.png new file mode 100755 index 0000000..6f33f66 Binary files /dev/null and b/Examples/ComposingComplexInterfaces/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_80x80.png differ diff --git a/Examples/ComposingComplexInterfaces/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_87x87.png b/Examples/ComposingComplexInterfaces/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_87x87.png new file mode 100755 index 0000000..9e1616c Binary files /dev/null and b/Examples/ComposingComplexInterfaces/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_87x87.png differ diff --git a/Examples/ComposingComplexInterfaces/Complete/Landmarks/Landmarks/Assets.xcassets/Contents.json b/Examples/ComposingComplexInterfaces/Complete/Landmarks/Landmarks/Assets.xcassets/Contents.json new file mode 100755 index 0000000..da4a164 --- /dev/null +++ b/Examples/ComposingComplexInterfaces/Complete/Landmarks/Landmarks/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Examples/ComposingComplexInterfaces/Complete/Landmarks/Landmarks/Assets.xcassets/turtlerock.imageset/Contents.json b/Examples/ComposingComplexInterfaces/Complete/Landmarks/Landmarks/Assets.xcassets/turtlerock.imageset/Contents.json new file mode 100755 index 0000000..5bfd7bf --- /dev/null +++ b/Examples/ComposingComplexInterfaces/Complete/Landmarks/Landmarks/Assets.xcassets/turtlerock.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "turtlerock.jpg", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Examples/ComposingComplexInterfaces/Complete/Landmarks/Landmarks/Assets.xcassets/turtlerock.imageset/turtlerock.jpg b/Examples/ComposingComplexInterfaces/Complete/Landmarks/Landmarks/Assets.xcassets/turtlerock.imageset/turtlerock.jpg new file mode 100755 index 0000000..68bcd3e Binary files /dev/null and b/Examples/ComposingComplexInterfaces/Complete/Landmarks/Landmarks/Assets.xcassets/turtlerock.imageset/turtlerock.jpg differ diff --git a/Examples/ComposingComplexInterfaces/Complete/Landmarks/Landmarks/Base.lproj/LaunchScreen.storyboard b/Examples/ComposingComplexInterfaces/Complete/Landmarks/Landmarks/Base.lproj/LaunchScreen.storyboard new file mode 100755 index 0000000..865e932 --- /dev/null +++ b/Examples/ComposingComplexInterfaces/Complete/Landmarks/Landmarks/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Examples/ComposingComplexInterfaces/Complete/Landmarks/Landmarks/CategoryRow.swift b/Examples/ComposingComplexInterfaces/Complete/Landmarks/Landmarks/CategoryRow.swift new file mode 100755 index 0000000..1f4fbd8 --- /dev/null +++ b/Examples/ComposingComplexInterfaces/Complete/Landmarks/Landmarks/CategoryRow.swift @@ -0,0 +1,64 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +A view showing a scrollable list of landmarks. +*/ + +import SwiftUI + +struct CategoryRow: View { + var categoryName: String + var items: [Landmark] + + var body: some View { + VStack(alignment: .leading) { + Text(self.categoryName) + .font(.headline) + .padding(.leading, 15) + .padding(.top, 5) + + ScrollView(showsHorizontalIndicator: false) { + HStack(alignment: .top, spacing: 0) { + ForEach(self.items.identified(by: \.name)) { landmark in + NavigationButton( + destination: LandmarkDetail( + landmark: landmark + ) + ) { + CategoryItem(landmark: landmark) + } + } + } + } + .frame(height: 185) + } + } +} + +struct CategoryItem: View { + var landmark: Landmark + var body: some View { + VStack(alignment: .leading) { + landmark + .image(forSize: 155) + .renderingMode(.original) + .cornerRadius(5) + Text(landmark.name) + .color(.primary) + .font(.caption) + } + .padding(.leading, 15) + } +} + +#if DEBUG +struct CategoryRow_Previews: PreviewProvider { + static var previews: some View { + CategoryRow( + categoryName: landmarkData[0].category.rawValue, + items: Array(landmarkData.prefix(4)) + ) + } +} +#endif diff --git a/Examples/ComposingComplexInterfaces/Complete/Landmarks/Landmarks/HexagonParameters.swift b/Examples/ComposingComplexInterfaces/Complete/Landmarks/Landmarks/HexagonParameters.swift new file mode 100755 index 0000000..8decba4 --- /dev/null +++ b/Examples/ComposingComplexInterfaces/Complete/Landmarks/Landmarks/HexagonParameters.swift @@ -0,0 +1,57 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +Size, position, and other information used to draw a badge. +*/ + +import SwiftUI + +struct HexagonParameters { + struct Segment { + let useWidth: (CGFloat, CGFloat, CGFloat) + let xFactors: (CGFloat, CGFloat, CGFloat) + let useHeight: (CGFloat, CGFloat, CGFloat) + let yFactors: (CGFloat, CGFloat, CGFloat) + } + + static let adjustment: CGFloat = 0.085 + static let points = [ + Segment( + useWidth: (1.00, 1.00, 1.00), + xFactors: (0.60, 0.40, 0.50), + useHeight: (1.00, 1.00, 0.00), + yFactors: (0.05, 0.05, 0.00) + ), + Segment( + useWidth: (1.00, 1.00, 0.00), + xFactors: (0.05, 0.00, 0.00), + useHeight: (1.00, 1.00, 1.00), + yFactors: (0.20 + adjustment, 0.30 + adjustment, 0.25 + adjustment) + ), + Segment( + useWidth: (1.00, 1.00, 0.00), + xFactors: (0.00, 0.05, 0.00), + useHeight: (1.00, 1.00, 1.00), + yFactors: (0.70 - adjustment, 0.80 - adjustment, 0.75 - adjustment) + ), + Segment( + useWidth: (1.00, 1.00, 1.00), + xFactors: (0.40, 0.60, 0.50), + useHeight: (1.00, 1.00, 1.00), + yFactors: (0.95, 0.95, 1.00) + ), + Segment( + useWidth: (1.00, 1.00, 1.00), + xFactors: (0.95, 1.00, 1.00), + useHeight: (1.00, 1.00, 1.00), + yFactors: (0.80 - adjustment, 0.70 - adjustment, 0.75 - adjustment) + ), + Segment( + useWidth: (1.00, 1.00, 1.00), + xFactors: (1.00, 0.95, 1.00), + useHeight: (1.00, 1.00, 1.00), + yFactors: (0.30 + adjustment, 0.20 + adjustment, 0.25 + adjustment) + ) + ] +} diff --git a/Examples/ComposingComplexInterfaces/Complete/Landmarks/Landmarks/HikeDetail.swift b/Examples/ComposingComplexInterfaces/Complete/Landmarks/Landmarks/HikeDetail.swift new file mode 100755 index 0000000..3406a6d --- /dev/null +++ b/Examples/ComposingComplexInterfaces/Complete/Landmarks/Landmarks/HikeDetail.swift @@ -0,0 +1,49 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +A view showing the details for a hike. +*/ + +import SwiftUI + +struct HikeDetail: View { + let hike: Hike + @State var dataToShow = \Hike.Observation.elevation + + var buttons = [ + ("Elevation", \Hike.Observation.elevation), + ("Heart Rate", \Hike.Observation.heartRate), + ("Pace", \Hike.Observation.pace), + ] + + var body: some View { + return VStack { + HikeGraph(hike: hike, path: dataToShow) + .frame(height: 200, alignment: .center) + + HStack(spacing: 25) { + ForEach(buttons.identified(by: \.0)) { value in + Button(action: { + self.dataToShow = value.1 + }) { + Text(verbatim: value.0) + .font(.system(size: 15)) + .color(value.1 == self.dataToShow + ? Color.gray + : Color.accentColor) + .animation(nil) + } + } + } + } + } +} + +#if DEBUG +struct HikeDetail_Previews: PreviewProvider { + static var previews: some View { + HikeDetail(hike: hikeData[0]) + } +} +#endif diff --git a/Examples/ComposingComplexInterfaces/Complete/Landmarks/Landmarks/HikeView.swift b/Examples/ComposingComplexInterfaces/Complete/Landmarks/Landmarks/HikeView.swift new file mode 100755 index 0000000..f4c02cc --- /dev/null +++ b/Examples/ComposingComplexInterfaces/Complete/Landmarks/Landmarks/HikeView.swift @@ -0,0 +1,68 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +A view displaying inforamtion about a hike, including an elevation graph. +*/ + +import SwiftUI + +struct HikeView: View { + var hike: Hike + @State private var showDetail = false + + var transition: AnyTransition { + let insertion = AnyTransition.move(edge: .trailing) + .combined(with: .opacity) + let removal = AnyTransition.scale() + .combined(with: .opacity) + return .asymmetric(insertion: insertion, removal: removal) + } + + var body: some View { + VStack { + HStack { + HikeGraph(hike: hike, path: \.elevation) + .frame(width: 50, height: 30) + .animation(nil) + + VStack(alignment: .leading) { + Text(verbatim: hike.name) + .font(.headline) + Text(verbatim: hike.distanceText) + } + + Spacer() + + Button(action: { + withAnimation { + self.showDetail.toggle() + } + }) { + Image(systemName: "chevron.right.circle") + .imageScale(.large) + .rotationEffect(.degrees(showDetail ? 90 : 0)) + .scaleEffect(showDetail ? 1.5 : 1) + .padding() + } + } + + if showDetail { + HikeDetail(hike: hike) + .transition(transition) + } + } + } +} + +#if DEBUG +struct HikeView_Previews: PreviewProvider { + static var previews: some View { + VStack { + HikeView(hike: hikeData[0]) + .padding() + Spacer() + } + } +} +#endif diff --git a/Examples/ComposingComplexInterfaces/Complete/Landmarks/Landmarks/Home.swift b/Examples/ComposingComplexInterfaces/Complete/Landmarks/Landmarks/Home.swift new file mode 100755 index 0000000..9e5ac93 --- /dev/null +++ b/Examples/ComposingComplexInterfaces/Complete/Landmarks/Landmarks/Home.swift @@ -0,0 +1,67 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +A view showing featured landmarks above a list of all of the landmarks. +*/ + +import SwiftUI + +struct CategoryHome: View { + var categories: [String: [Landmark]] { + .init( + grouping: landmarkData, + by: { $0.category.rawValue } + ) + } + + var featured: [Landmark] { + landmarkData.filter { $0.isFeatured } + } + + var body: some View { + NavigationView { + List { + FeaturedLandmarks(landmarks: featured) + .scaledToFill() + .frame(height: 200) + .clipped() + .listRowInsets(EdgeInsets()) + + ForEach(categories.keys.sorted().identified(by: \.self)) { key in + CategoryRow(categoryName: key, items: self.categories[key]!) + } + .listRowInsets(EdgeInsets()) + + NavigationButton(destination: LandmarkList()) { + Text("See All") + } + } + .navigationBarTitle(Text("Featured")) + .navigationBarItems(trailing: + PresentationButton( + Image(systemName: "person.crop.circle") + .imageScale(.large) + .accessibility(label: Text("User Profile")) + .padding(), + destination: Text("User Profile") + ) + ) + } + } +} + +struct FeaturedLandmarks: View { + var landmarks: [Landmark] + var body: some View { + landmarks[0].image(forSize: 250).resizable() + } +} + +#if DEBUG +struct CategoryHome_Previews: PreviewProvider { + static var previews: some View { + CategoryHome() + } +} +#endif diff --git a/Examples/ComposingComplexInterfaces/Complete/Landmarks/Landmarks/Info.plist b/Examples/ComposingComplexInterfaces/Complete/Landmarks/Landmarks/Info.plist new file mode 100755 index 0000000..e8bb4c6 --- /dev/null +++ b/Examples/ComposingComplexInterfaces/Complete/Landmarks/Landmarks/Info.plist @@ -0,0 +1,62 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + $(PRODUCT_BUNDLE_PACKAGE_TYPE) + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1 + LSRequiresIPhoneOS + + UIApplicationSceneManifest + + UIApplicationSupportsMultipleScenes + + UISceneConfigurations + + UIWindowSceneSessionRoleApplication + + + UILaunchStoryboardName + LaunchScreen + UISceneConfigurationName + Default Configuration + UISceneDelegateClassName + $(PRODUCT_MODULE_NAME).SceneDelegate + + + + + UILaunchStoryboardName + LaunchScreen + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/Examples/ComposingComplexInterfaces/Complete/Landmarks/Landmarks/LandmarkDetail.swift b/Examples/ComposingComplexInterfaces/Complete/Landmarks/Landmarks/LandmarkDetail.swift new file mode 100755 index 0000000..6c290a3 --- /dev/null +++ b/Examples/ComposingComplexInterfaces/Complete/Landmarks/Landmarks/LandmarkDetail.swift @@ -0,0 +1,71 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +A view showing the details for a landmark. +*/ + +import SwiftUI + +struct LandmarkDetail: View { + @EnvironmentObject var userData: UserData + var landmark: Landmark + + var landmarkIndex: Int { + userData.landmarks.firstIndex(where: { $0.id == landmark.id })! + } + + var body: some View { + VStack { + MapView(coordinate: landmark.locationCoordinate) + .edgesIgnoringSafeArea(.top) + .frame(height: 300) + + CircleImage(image: landmark.image(forSize: 250)) + .offset(x: 0, y: -130) + .padding(.bottom, -130) + + VStack(alignment: .leading) { + HStack { + Text(verbatim: landmark.name) + .font(.title) + + Button(action: { + self.userData.landmarks[self.landmarkIndex] + .isFavorite.toggle() + }) { + if self.userData.landmarks[self.landmarkIndex] + .isFavorite { + Image(systemName: "star.fill") + .foregroundColor(Color.yellow) + } else { + Image(systemName: "star") + .foregroundColor(Color.gray) + } + } + } + + HStack(alignment: .top) { + Text(verbatim: landmark.park) + .font(.subheadline) + Spacer() + Text(verbatim: landmark.state) + .font(.subheadline) + } + } + .padding() + + Spacer() + } + } +} + +#if DEBUG +struct LandmarkDetail_Preview: PreviewProvider { + static var previews: some View { + let userData = UserData() + return LandmarkDetail(landmark: userData.landmarks[0]) + .environmentObject(userData) + } +} +#endif diff --git a/Examples/ComposingComplexInterfaces/Complete/Landmarks/Landmarks/LandmarkList.swift b/Examples/ComposingComplexInterfaces/Complete/Landmarks/Landmarks/LandmarkList.swift new file mode 100755 index 0000000..c17b5f3 --- /dev/null +++ b/Examples/ComposingComplexInterfaces/Complete/Landmarks/Landmarks/LandmarkList.swift @@ -0,0 +1,45 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +A view showing a list of landmarks. +*/ + +import SwiftUI + +struct LandmarkList: View { + @EnvironmentObject private var userData: UserData + + var body: some View { + NavigationView { + List { + Toggle(isOn: $userData.showFavoritesOnly) { + Text("Show Favorites Only") + } + + ForEach(userData.landmarks) { landmark in + if !self.userData.showFavoritesOnly || landmark.isFavorite { + NavigationButton( + destination: LandmarkDetail(landmark: landmark)) { + LandmarkRow(landmark: landmark) + } + } + } + } + .navigationBarTitle(Text("Landmarks"), displayMode: .large) + } + } +} + +#if DEBUG +struct LandmarksList_Previews: PreviewProvider { + static var previews: some View { + ForEach(["iPhone SE", "iPhone XS Max"].identified(by: \.self)) { deviceName in + LandmarkList() + .previewDevice(PreviewDevice(rawValue: deviceName)) + .previewDisplayName(deviceName) + } + .environmentObject(UserData()) + } +} +#endif diff --git a/Examples/ComposingComplexInterfaces/Complete/Landmarks/Landmarks/Models/Data.swift b/Examples/ComposingComplexInterfaces/Complete/Landmarks/Landmarks/Models/Data.swift new file mode 100755 index 0000000..248d3b2 --- /dev/null +++ b/Examples/ComposingComplexInterfaces/Complete/Landmarks/Landmarks/Models/Data.swift @@ -0,0 +1,95 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +Helpers for loading images and data. +*/ + +import Foundation +import CoreLocation +import UIKit +import SwiftUI + +let landmarkData: [Landmark] = load("landmarkData.json") +let hikeData: [Hike] = load("hikeData.json") + +func load(_ filename: String, as type: T.Type = T.self) -> T { + let data: Data + + guard let file = Bundle.main.url(forResource: filename, withExtension: nil) + else { + fatalError("Couldn't find \(filename) in main bundle.") + } + + do { + data = try Data(contentsOf: file) + } catch { + fatalError("Couldn't load \(filename) from main bundle:\n\(error)") + } + + do { + let decoder = JSONDecoder() + return try decoder.decode(T.self, from: data) + } catch { + fatalError("Couldn't parse \(filename) as \(T.self):\n\(error)") + } +} + +final class ImageStore { + fileprivate typealias _ImageDictionary = [String: [Int: CGImage]] + fileprivate var images: _ImageDictionary = [:] + + fileprivate static var originalSize = 250 + fileprivate static var scale = 2 + + static var shared = ImageStore() + + func image(name: String, size: Int) -> Image { + let index = _guaranteeInitialImage(name: name) + + let sizedImage = images.values[index][size] + ?? _sizeImage(images.values[index][ImageStore.originalSize]!, to: size * ImageStore.scale) + images.values[index][size] = sizedImage + + return Image(sizedImage, scale: Length(ImageStore.scale), label: Text(verbatim: name)) + } + + fileprivate func _guaranteeInitialImage(name: String) -> _ImageDictionary.Index { + if let index = images.index(forKey: name) { return index } + + guard + let url = Bundle.main.url(forResource: name, withExtension: "jpg"), + let imageSource = CGImageSourceCreateWithURL(url as NSURL, nil), + let image = CGImageSourceCreateImageAtIndex(imageSource, 0, nil) + else { + fatalError("Couldn't load image \(name).jpg from main bundle.") + } + + images[name] = [ImageStore.originalSize: image] + return images.index(forKey: name)! + } + + fileprivate func _sizeImage(_ image: CGImage, to size: Int) -> CGImage { + guard + let colorSpace = image.colorSpace, + let context = CGContext( + data: nil, + width: size, height: size, + bitsPerComponent: image.bitsPerComponent, + bytesPerRow: image.bytesPerRow, + space: colorSpace, + bitmapInfo: image.bitmapInfo.rawValue) + else { + fatalError("Couldn't create graphics context.") + } + context.interpolationQuality = .high + context.draw(image, in: CGRect(x: 0, y: 0, width: size, height: size)) + + if let sizedImage = context.makeImage() { + return sizedImage + } else { + fatalError("Couldn't resize image.") + } + } +} + diff --git a/Examples/ComposingComplexInterfaces/Complete/Landmarks/Landmarks/Models/Hike.swift b/Examples/ComposingComplexInterfaces/Complete/Landmarks/Landmarks/Models/Hike.swift new file mode 100755 index 0000000..dfd2bb8 --- /dev/null +++ b/Examples/ComposingComplexInterfaces/Complete/Landmarks/Landmarks/Models/Hike.swift @@ -0,0 +1,31 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +The model for a hike. +*/ + +import SwiftUI + +struct Hike: Codable, Hashable, Identifiable { + var name: String + var id: Int + var distance: Double + var difficulty: Int + var observations: [Observation] + + static var formatter = LengthFormatter() + + var distanceText: String { + return Hike.formatter + .string(fromValue: distance, unit: .kilometer) + } + + struct Observation: Codable, Hashable { + var distanceFromStart: Double + + var elevation: Range + var pace: Range + var heartRate: Range + } +} diff --git a/Examples/ComposingComplexInterfaces/Complete/Landmarks/Landmarks/Models/Landmark.swift b/Examples/ComposingComplexInterfaces/Complete/Landmarks/Landmarks/Models/Landmark.swift new file mode 100755 index 0000000..4a7586d --- /dev/null +++ b/Examples/ComposingComplexInterfaces/Complete/Landmarks/Landmarks/Models/Landmark.swift @@ -0,0 +1,43 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +The model for an individual landmark. +*/ + +import SwiftUI +import CoreLocation + +struct Landmark: Hashable, Codable, Identifiable { + var id: Int + var name: String + fileprivate var imageName: String + fileprivate var coordinates: Coordinates + var state: String + var park: String + var category: Category + var isFavorite: Bool + var isFeatured: Bool + + var locationCoordinate: CLLocationCoordinate2D { + CLLocationCoordinate2D( + latitude: coordinates.latitude, + longitude: coordinates.longitude) + } + + func image(forSize size: Int) -> Image { + ImageStore.shared.image(name: imageName, size: size) + } + + enum Category: String, CaseIterable, Codable, Hashable { + case featured = "Featured" + case lakes = "Lakes" + case rivers = "Rivers" + case mountains = "Mountains" + } +} + +struct Coordinates: Hashable, Codable { + var latitude: Double + var longitude: Double +} diff --git a/Examples/ComposingComplexInterfaces/Complete/Landmarks/Landmarks/Models/UserData.swift b/Examples/ComposingComplexInterfaces/Complete/Landmarks/Landmarks/Models/UserData.swift new file mode 100755 index 0000000..db31fb0 --- /dev/null +++ b/Examples/ComposingComplexInterfaces/Complete/Landmarks/Landmarks/Models/UserData.swift @@ -0,0 +1,25 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +A model object that stores app data. +*/ + +import Combine +import SwiftUI + +final class UserData: BindableObject { + let didChange = PassthroughSubject() + + var showFavoritesOnly = false { + didSet { + didChange.send(self) + } + } + + var landmarks = landmarkData { + didSet { + didChange.send(self) + } + } +} diff --git a/Examples/ComposingComplexInterfaces/Complete/Landmarks/Landmarks/Preview Content/Preview Assets.xcassets/Contents.json b/Examples/ComposingComplexInterfaces/Complete/Landmarks/Landmarks/Preview Content/Preview Assets.xcassets/Contents.json new file mode 100755 index 0000000..da4a164 --- /dev/null +++ b/Examples/ComposingComplexInterfaces/Complete/Landmarks/Landmarks/Preview Content/Preview Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Examples/ComposingComplexInterfaces/Complete/Landmarks/Landmarks/Resources/charleyrivers.jpg b/Examples/ComposingComplexInterfaces/Complete/Landmarks/Landmarks/Resources/charleyrivers.jpg new file mode 100755 index 0000000..17ff44b Binary files /dev/null and b/Examples/ComposingComplexInterfaces/Complete/Landmarks/Landmarks/Resources/charleyrivers.jpg differ diff --git a/Examples/ComposingComplexInterfaces/Complete/Landmarks/Landmarks/Resources/chilkoottrail.jpg b/Examples/ComposingComplexInterfaces/Complete/Landmarks/Landmarks/Resources/chilkoottrail.jpg new file mode 100755 index 0000000..e7f805e Binary files /dev/null and b/Examples/ComposingComplexInterfaces/Complete/Landmarks/Landmarks/Resources/chilkoottrail.jpg differ diff --git a/Examples/ComposingComplexInterfaces/Complete/Landmarks/Landmarks/Resources/chincoteague.jpg b/Examples/ComposingComplexInterfaces/Complete/Landmarks/Landmarks/Resources/chincoteague.jpg new file mode 100755 index 0000000..5f47986 Binary files /dev/null and b/Examples/ComposingComplexInterfaces/Complete/Landmarks/Landmarks/Resources/chincoteague.jpg differ diff --git a/Examples/ComposingComplexInterfaces/Complete/Landmarks/Landmarks/Resources/hiddenlake.jpg b/Examples/ComposingComplexInterfaces/Complete/Landmarks/Landmarks/Resources/hiddenlake.jpg new file mode 100755 index 0000000..d8e804c Binary files /dev/null and b/Examples/ComposingComplexInterfaces/Complete/Landmarks/Landmarks/Resources/hiddenlake.jpg differ diff --git a/Examples/ComposingComplexInterfaces/Complete/Landmarks/Landmarks/Resources/hikeData.json b/Examples/ComposingComplexInterfaces/Complete/Landmarks/Landmarks/Resources/hikeData.json new file mode 100755 index 0000000..3fb1e96 --- /dev/null +++ b/Examples/ComposingComplexInterfaces/Complete/Landmarks/Landmarks/Resources/hikeData.json @@ -0,0 +1,1882 @@ +[ + { + "name":"Lonesome Ridge Trail", + "id":1001, + "distance":4.5, + "difficulty":3, + "observations":[ + { + "elevation":[ + 291.65263635636268, + 309.26016677925196 + ], + "pace":[ + 396.08716481908732, + 403.68937873525232 + ], + "heartRate":[ + 117.16351898665887, + 121.95815455919609 + ], + "distanceFromStart":0 + }, + { + "elevation":[ + 299.24001936628116, + 317.44584350790012 + ], + "pace":[ + 380.19020240756623, + 395.3978319010256 + ], + "heartRate":[ + 117.6410892152911, + 124.82185220506081 + ], + "distanceFromStart":0.375 + }, + { + "elevation":[ + 303.62145464574394, + 336.05569457646544 + ], + "pace":[ + 380.55927782266116, + 397.60789726832775 + ], + "heartRate":[ + 121.52696452049059, + 127.31525441110122 + ], + "distanceFromStart":0.75 + }, + { + "elevation":[ + 319.90393365162629, + 346.26966025518789 + ], + "pace":[ + 357.94116421258531, + 398.0750288648062 + ], + "heartRate":[ + 123.75908585923588, + 132.77069404486801 + ], + "distanceFromStart":1.125 + }, + { + "elevation":[ + 354.17104439267905, + 403.57031216972939 + ], + "pace":[ + 335.07385149392701, + 397.82674381875808 + ], + "heartRate":[ + 130.8235194572915, + 140.55700591418218 + ], + "distanceFromStart":1.5 + }, + { + "elevation":[ + 357.42992871175124, + 385.92155620623635 + ], + "pace":[ + 395.16168913839374, + 404.60294066527558 + ], + "heartRate":[ + 131.5456052446734, + 134.65984504627627 + ], + "distanceFromStart":1.875 + }, + { + "elevation":[ + 345.47736721935661, + 363.18776661379422 + ], + "pace":[ + 340.82303041339082, + 404.71689228682374 + ], + "heartRate":[ + 125.1949698433959, + 131.31354363122026 + ], + "distanceFromStart":2.25 + }, + { + "elevation":[ + 346.23343025200535, + 497.23376445462401 + ], + "pace":[ + 261.27629148816021, + 331.68516208719467 + ], + "heartRate":[ + 131.67810544238606, + 154.26779645311458 + ], + "distanceFromStart":2.625 + }, + { + "elevation":[ + 491.57378483134391, + 547.49535224251053 + ], + "pace":[ + 296.05298644112088, + 401.14092967732398 + ], + "heartRate":[ + 151.36398089694217, + 166.20454793289232 + ], + "distanceFromStart":3 + }, + { + "elevation":[ + 472.06803233416338, + 531.92570520228401 + ], + "pace":[ + 395.50830663514012, + 401.67837917543591 + ], + "heartRate":[ + 134.41798110234078, + 151.90886697564241 + ], + "distanceFromStart":3.375 + }, + { + "elevation":[ + 339.81419476005283, + 461.03832527824829 + ], + "pace":[ + 395.31160487975183, + 404.49550455974907 + ], + "heartRate":[ + 129.97753472415462, + 138.13531094848992 + ], + "distanceFromStart":3.75 + }, + { + "elevation":[ + 303.1495508565697, + 342.3532820173541 + ], + "pace":[ + 395.02844559698116, + 402.65878340653796 + ], + "heartRate":[ + 127.72304232462609, + 133.26322270764186 + ], + "distanceFromStart":4.125 + } + ] + }, + { + "name":"Lonesome Ridge Trail", + "id":1002, + "distance":4.5, + "difficulty":3, + "observations":[ + { + "elevation":[ + 291.65263635636268, + 309.26016677925196 + ], + "pace":[ + 396.08716481908732, + 403.68937873525232 + ], + "heartRate":[ + 117.16351898665887, + 121.95815455919609 + ], + "distanceFromStart":0 + }, + { + "elevation":[ + 299.24001936628116, + 317.44584350790012 + ], + "pace":[ + 380.19020240756623, + 395.3978319010256 + ], + "heartRate":[ + 117.6410892152911, + 124.82185220506081 + ], + "distanceFromStart":0.375 + }, + { + "elevation":[ + 303.62145464574394, + 336.05569457646544 + ], + "pace":[ + 380.55927782266116, + 397.60789726832775 + ], + "heartRate":[ + 121.52696452049059, + 127.31525441110122 + ], + "distanceFromStart":0.75 + }, + { + "elevation":[ + 319.90393365162629, + 346.26966025518789 + ], + "pace":[ + 357.94116421258531, + 398.0750288648062 + ], + "heartRate":[ + 123.75908585923588, + 132.77069404486801 + ], + "distanceFromStart":1.125 + }, + { + "elevation":[ + 354.17104439267905, + 403.57031216972939 + ], + "pace":[ + 335.07385149392701, + 397.82674381875808 + ], + "heartRate":[ + 130.8235194572915, + 140.55700591418218 + ], + "distanceFromStart":1.5 + }, + { + "elevation":[ + 357.42992871175124, + 385.92155620623635 + ], + "pace":[ + 395.16168913839374, + 404.60294066527558 + ], + "heartRate":[ + 131.5456052446734, + 134.65984504627627 + ], + "distanceFromStart":1.875 + }, + { + "elevation":[ + 345.47736721935661, + 363.18776661379422 + ], + "pace":[ + 340.82303041339082, + 404.71689228682374 + ], + "heartRate":[ + 125.1949698433959, + 131.31354363122026 + ], + "distanceFromStart":2.25 + }, + { + "elevation":[ + 346.23343025200535, + 497.23376445462401 + ], + "pace":[ + 261.27629148816021, + 331.68516208719467 + ], + "heartRate":[ + 131.67810544238606, + 154.26779645311458 + ], + "distanceFromStart":2.625 + }, + { + "elevation":[ + 491.57378483134391, + 547.49535224251053 + ], + "pace":[ + 296.05298644112088, + 401.14092967732398 + ], + "heartRate":[ + 151.36398089694217, + 166.20454793289232 + ], + "distanceFromStart":3 + }, + { + "elevation":[ + 472.06803233416338, + 531.92570520228401 + ], + "pace":[ + 395.50830663514012, + 401.67837917543591 + ], + "heartRate":[ + 134.41798110234078, + 151.90886697564241 + ], + "distanceFromStart":3.375 + }, + { + "elevation":[ + 339.81419476005283, + 461.03832527824829 + ], + "pace":[ + 395.31160487975183, + 404.49550455974907 + ], + "heartRate":[ + 129.97753472415462, + 138.13531094848992 + ], + "distanceFromStart":3.75 + }, + { + "elevation":[ + 303.1495508565697, + 342.3532820173541 + ], + "pace":[ + 395.02844559698116, + 402.65878340653796 + ], + "heartRate":[ + 127.72304232462609, + 133.26322270764186 + ], + "distanceFromStart":4.125 + } + ] + }, + { + "name":"Lonesome Ridge Trail", + "id":1003, + "distance":4.5, + "difficulty":3, + "observations":[ + { + "elevation":[ + 291.65263635636268, + 309.26016677925196 + ], + "pace":[ + 396.08716481908732, + 403.68937873525232 + ], + "heartRate":[ + 117.16351898665887, + 121.95815455919609 + ], + "distanceFromStart":0 + }, + { + "elevation":[ + 299.24001936628116, + 317.44584350790012 + ], + "pace":[ + 380.19020240756623, + 395.3978319010256 + ], + "heartRate":[ + 117.6410892152911, + 124.82185220506081 + ], + "distanceFromStart":0.375 + }, + { + "elevation":[ + 303.62145464574394, + 336.05569457646544 + ], + "pace":[ + 380.55927782266116, + 397.60789726832775 + ], + "heartRate":[ + 121.52696452049059, + 127.31525441110122 + ], + "distanceFromStart":0.75 + }, + { + "elevation":[ + 319.90393365162629, + 346.26966025518789 + ], + "pace":[ + 357.94116421258531, + 398.0750288648062 + ], + "heartRate":[ + 123.75908585923588, + 132.77069404486801 + ], + "distanceFromStart":1.125 + }, + { + "elevation":[ + 354.17104439267905, + 403.57031216972939 + ], + "pace":[ + 335.07385149392701, + 397.82674381875808 + ], + "heartRate":[ + 130.8235194572915, + 140.55700591418218 + ], + "distanceFromStart":1.5 + }, + { + "elevation":[ + 357.42992871175124, + 385.92155620623635 + ], + "pace":[ + 395.16168913839374, + 404.60294066527558 + ], + "heartRate":[ + 131.5456052446734, + 134.65984504627627 + ], + "distanceFromStart":1.875 + }, + { + "elevation":[ + 345.47736721935661, + 363.18776661379422 + ], + "pace":[ + 340.82303041339082, + 404.71689228682374 + ], + "heartRate":[ + 125.1949698433959, + 131.31354363122026 + ], + "distanceFromStart":2.25 + }, + { + "elevation":[ + 346.23343025200535, + 497.23376445462401 + ], + "pace":[ + 261.27629148816021, + 331.68516208719467 + ], + "heartRate":[ + 131.67810544238606, + 154.26779645311458 + ], + "distanceFromStart":2.625 + }, + { + "elevation":[ + 491.57378483134391, + 547.49535224251053 + ], + "pace":[ + 296.05298644112088, + 401.14092967732398 + ], + "heartRate":[ + 151.36398089694217, + 166.20454793289232 + ], + "distanceFromStart":3 + }, + { + "elevation":[ + 472.06803233416338, + 531.92570520228401 + ], + "pace":[ + 395.50830663514012, + 401.67837917543591 + ], + "heartRate":[ + 134.41798110234078, + 151.90886697564241 + ], + "distanceFromStart":3.375 + }, + { + "elevation":[ + 339.81419476005283, + 461.03832527824829 + ], + "pace":[ + 395.31160487975183, + 404.49550455974907 + ], + "heartRate":[ + 129.97753472415462, + 138.13531094848992 + ], + "distanceFromStart":3.75 + }, + { + "elevation":[ + 303.1495508565697, + 342.3532820173541 + ], + "pace":[ + 395.02844559698116, + 402.65878340653796 + ], + "heartRate":[ + 127.72304232462609, + 133.26322270764186 + ], + "distanceFromStart":4.125 + } + ] + }, + { + "name":"Lonesome Ridge Trail", + "id":1004, + "distance":4.5, + "difficulty":3, + "observations":[ + { + "elevation":[ + 291.65263635636268, + 309.26016677925196 + ], + "pace":[ + 396.08716481908732, + 403.68937873525232 + ], + "heartRate":[ + 117.16351898665887, + 121.95815455919609 + ], + "distanceFromStart":0 + }, + { + "elevation":[ + 299.24001936628116, + 317.44584350790012 + ], + "pace":[ + 380.19020240756623, + 395.3978319010256 + ], + "heartRate":[ + 117.6410892152911, + 124.82185220506081 + ], + "distanceFromStart":0.375 + }, + { + "elevation":[ + 303.62145464574394, + 336.05569457646544 + ], + "pace":[ + 380.55927782266116, + 397.60789726832775 + ], + "heartRate":[ + 121.52696452049059, + 127.31525441110122 + ], + "distanceFromStart":0.75 + }, + { + "elevation":[ + 319.90393365162629, + 346.26966025518789 + ], + "pace":[ + 357.94116421258531, + 398.0750288648062 + ], + "heartRate":[ + 123.75908585923588, + 132.77069404486801 + ], + "distanceFromStart":1.125 + }, + { + "elevation":[ + 354.17104439267905, + 403.57031216972939 + ], + "pace":[ + 335.07385149392701, + 397.82674381875808 + ], + "heartRate":[ + 130.8235194572915, + 140.55700591418218 + ], + "distanceFromStart":1.5 + }, + { + "elevation":[ + 357.42992871175124, + 385.92155620623635 + ], + "pace":[ + 395.16168913839374, + 404.60294066527558 + ], + "heartRate":[ + 131.5456052446734, + 134.65984504627627 + ], + "distanceFromStart":1.875 + }, + { + "elevation":[ + 345.47736721935661, + 363.18776661379422 + ], + "pace":[ + 340.82303041339082, + 404.71689228682374 + ], + "heartRate":[ + 125.1949698433959, + 131.31354363122026 + ], + "distanceFromStart":2.25 + }, + { + "elevation":[ + 346.23343025200535, + 497.23376445462401 + ], + "pace":[ + 261.27629148816021, + 331.68516208719467 + ], + "heartRate":[ + 131.67810544238606, + 154.26779645311458 + ], + "distanceFromStart":2.625 + }, + { + "elevation":[ + 491.57378483134391, + 547.49535224251053 + ], + "pace":[ + 296.05298644112088, + 401.14092967732398 + ], + "heartRate":[ + 151.36398089694217, + 166.20454793289232 + ], + "distanceFromStart":3 + }, + { + "elevation":[ + 472.06803233416338, + 531.92570520228401 + ], + "pace":[ + 395.50830663514012, + 401.67837917543591 + ], + "heartRate":[ + 134.41798110234078, + 151.90886697564241 + ], + "distanceFromStart":3.375 + }, + { + "elevation":[ + 339.81419476005283, + 461.03832527824829 + ], + "pace":[ + 395.31160487975183, + 404.49550455974907 + ], + "heartRate":[ + 129.97753472415462, + 138.13531094848992 + ], + "distanceFromStart":3.75 + }, + { + "elevation":[ + 303.1495508565697, + 342.3532820173541 + ], + "pace":[ + 395.02844559698116, + 402.65878340653796 + ], + "heartRate":[ + 127.72304232462609, + 133.26322270764186 + ], + "distanceFromStart":4.125 + } + ] + }, + { + "name":"Lonesome Ridge Trail", + "id":1005, + "distance":4.5, + "difficulty":3, + "observations":[ + { + "elevation":[ + 291.65263635636268, + 309.26016677925196 + ], + "pace":[ + 396.08716481908732, + 403.68937873525232 + ], + "heartRate":[ + 117.16351898665887, + 121.95815455919609 + ], + "distanceFromStart":0 + }, + { + "elevation":[ + 299.24001936628116, + 317.44584350790012 + ], + "pace":[ + 380.19020240756623, + 395.3978319010256 + ], + "heartRate":[ + 117.6410892152911, + 124.82185220506081 + ], + "distanceFromStart":0.375 + }, + { + "elevation":[ + 303.62145464574394, + 336.05569457646544 + ], + "pace":[ + 380.55927782266116, + 397.60789726832775 + ], + "heartRate":[ + 121.52696452049059, + 127.31525441110122 + ], + "distanceFromStart":0.75 + }, + { + "elevation":[ + 319.90393365162629, + 346.26966025518789 + ], + "pace":[ + 357.94116421258531, + 398.0750288648062 + ], + "heartRate":[ + 123.75908585923588, + 132.77069404486801 + ], + "distanceFromStart":1.125 + }, + { + "elevation":[ + 354.17104439267905, + 403.57031216972939 + ], + "pace":[ + 335.07385149392701, + 397.82674381875808 + ], + "heartRate":[ + 130.8235194572915, + 140.55700591418218 + ], + "distanceFromStart":1.5 + }, + { + "elevation":[ + 357.42992871175124, + 385.92155620623635 + ], + "pace":[ + 395.16168913839374, + 404.60294066527558 + ], + "heartRate":[ + 131.5456052446734, + 134.65984504627627 + ], + "distanceFromStart":1.875 + }, + { + "elevation":[ + 345.47736721935661, + 363.18776661379422 + ], + "pace":[ + 340.82303041339082, + 404.71689228682374 + ], + "heartRate":[ + 125.1949698433959, + 131.31354363122026 + ], + "distanceFromStart":2.25 + }, + { + "elevation":[ + 346.23343025200535, + 497.23376445462401 + ], + "pace":[ + 261.27629148816021, + 331.68516208719467 + ], + "heartRate":[ + 131.67810544238606, + 154.26779645311458 + ], + "distanceFromStart":2.625 + }, + { + "elevation":[ + 491.57378483134391, + 547.49535224251053 + ], + "pace":[ + 296.05298644112088, + 401.14092967732398 + ], + "heartRate":[ + 151.36398089694217, + 166.20454793289232 + ], + "distanceFromStart":3 + }, + { + "elevation":[ + 472.06803233416338, + 531.92570520228401 + ], + "pace":[ + 395.50830663514012, + 401.67837917543591 + ], + "heartRate":[ + 134.41798110234078, + 151.90886697564241 + ], + "distanceFromStart":3.375 + }, + { + "elevation":[ + 339.81419476005283, + 461.03832527824829 + ], + "pace":[ + 395.31160487975183, + 404.49550455974907 + ], + "heartRate":[ + 129.97753472415462, + 138.13531094848992 + ], + "distanceFromStart":3.75 + }, + { + "elevation":[ + 303.1495508565697, + 342.3532820173541 + ], + "pace":[ + 395.02844559698116, + 402.65878340653796 + ], + "heartRate":[ + 127.72304232462609, + 133.26322270764186 + ], + "distanceFromStart":4.125 + } + ] + }, + { + "name":"Lonesome Ridge Trail", + "id":1006, + "distance":4.5, + "difficulty":3, + "observations":[ + { + "elevation":[ + 291.65263635636268, + 309.26016677925196 + ], + "pace":[ + 396.08716481908732, + 403.68937873525232 + ], + "heartRate":[ + 117.16351898665887, + 121.95815455919609 + ], + "distanceFromStart":0 + }, + { + "elevation":[ + 299.24001936628116, + 317.44584350790012 + ], + "pace":[ + 380.19020240756623, + 395.3978319010256 + ], + "heartRate":[ + 117.6410892152911, + 124.82185220506081 + ], + "distanceFromStart":0.375 + }, + { + "elevation":[ + 303.62145464574394, + 336.05569457646544 + ], + "pace":[ + 380.55927782266116, + 397.60789726832775 + ], + "heartRate":[ + 121.52696452049059, + 127.31525441110122 + ], + "distanceFromStart":0.75 + }, + { + "elevation":[ + 319.90393365162629, + 346.26966025518789 + ], + "pace":[ + 357.94116421258531, + 398.0750288648062 + ], + "heartRate":[ + 123.75908585923588, + 132.77069404486801 + ], + "distanceFromStart":1.125 + }, + { + "elevation":[ + 354.17104439267905, + 403.57031216972939 + ], + "pace":[ + 335.07385149392701, + 397.82674381875808 + ], + "heartRate":[ + 130.8235194572915, + 140.55700591418218 + ], + "distanceFromStart":1.5 + }, + { + "elevation":[ + 357.42992871175124, + 385.92155620623635 + ], + "pace":[ + 395.16168913839374, + 404.60294066527558 + ], + "heartRate":[ + 131.5456052446734, + 134.65984504627627 + ], + "distanceFromStart":1.875 + }, + { + "elevation":[ + 345.47736721935661, + 363.18776661379422 + ], + "pace":[ + 340.82303041339082, + 404.71689228682374 + ], + "heartRate":[ + 125.1949698433959, + 131.31354363122026 + ], + "distanceFromStart":2.25 + }, + { + "elevation":[ + 346.23343025200535, + 497.23376445462401 + ], + "pace":[ + 261.27629148816021, + 331.68516208719467 + ], + "heartRate":[ + 131.67810544238606, + 154.26779645311458 + ], + "distanceFromStart":2.625 + }, + { + "elevation":[ + 491.57378483134391, + 547.49535224251053 + ], + "pace":[ + 296.05298644112088, + 401.14092967732398 + ], + "heartRate":[ + 151.36398089694217, + 166.20454793289232 + ], + "distanceFromStart":3 + }, + { + "elevation":[ + 472.06803233416338, + 531.92570520228401 + ], + "pace":[ + 395.50830663514012, + 401.67837917543591 + ], + "heartRate":[ + 134.41798110234078, + 151.90886697564241 + ], + "distanceFromStart":3.375 + }, + { + "elevation":[ + 339.81419476005283, + 461.03832527824829 + ], + "pace":[ + 395.31160487975183, + 404.49550455974907 + ], + "heartRate":[ + 129.97753472415462, + 138.13531094848992 + ], + "distanceFromStart":3.75 + }, + { + "elevation":[ + 303.1495508565697, + 342.3532820173541 + ], + "pace":[ + 395.02844559698116, + 402.65878340653796 + ], + "heartRate":[ + 127.72304232462609, + 133.26322270764186 + ], + "distanceFromStart":4.125 + } + ] + }, + { + "name":"Lonesome Ridge Trail", + "id":1007, + "distance":4.5, + "difficulty":3, + "observations":[ + { + "elevation":[ + 291.65263635636268, + 309.26016677925196 + ], + "pace":[ + 396.08716481908732, + 403.68937873525232 + ], + "heartRate":[ + 117.16351898665887, + 121.95815455919609 + ], + "distanceFromStart":0 + }, + { + "elevation":[ + 299.24001936628116, + 317.44584350790012 + ], + "pace":[ + 380.19020240756623, + 395.3978319010256 + ], + "heartRate":[ + 117.6410892152911, + 124.82185220506081 + ], + "distanceFromStart":0.375 + }, + { + "elevation":[ + 303.62145464574394, + 336.05569457646544 + ], + "pace":[ + 380.55927782266116, + 397.60789726832775 + ], + "heartRate":[ + 121.52696452049059, + 127.31525441110122 + ], + "distanceFromStart":0.75 + }, + { + "elevation":[ + 319.90393365162629, + 346.26966025518789 + ], + "pace":[ + 357.94116421258531, + 398.0750288648062 + ], + "heartRate":[ + 123.75908585923588, + 132.77069404486801 + ], + "distanceFromStart":1.125 + }, + { + "elevation":[ + 354.17104439267905, + 403.57031216972939 + ], + "pace":[ + 335.07385149392701, + 397.82674381875808 + ], + "heartRate":[ + 130.8235194572915, + 140.55700591418218 + ], + "distanceFromStart":1.5 + }, + { + "elevation":[ + 357.42992871175124, + 385.92155620623635 + ], + "pace":[ + 395.16168913839374, + 404.60294066527558 + ], + "heartRate":[ + 131.5456052446734, + 134.65984504627627 + ], + "distanceFromStart":1.875 + }, + { + "elevation":[ + 345.47736721935661, + 363.18776661379422 + ], + "pace":[ + 340.82303041339082, + 404.71689228682374 + ], + "heartRate":[ + 125.1949698433959, + 131.31354363122026 + ], + "distanceFromStart":2.25 + }, + { + "elevation":[ + 346.23343025200535, + 497.23376445462401 + ], + "pace":[ + 261.27629148816021, + 331.68516208719467 + ], + "heartRate":[ + 131.67810544238606, + 154.26779645311458 + ], + "distanceFromStart":2.625 + }, + { + "elevation":[ + 491.57378483134391, + 547.49535224251053 + ], + "pace":[ + 296.05298644112088, + 401.14092967732398 + ], + "heartRate":[ + 151.36398089694217, + 166.20454793289232 + ], + "distanceFromStart":3 + }, + { + "elevation":[ + 472.06803233416338, + 531.92570520228401 + ], + "pace":[ + 395.50830663514012, + 401.67837917543591 + ], + "heartRate":[ + 134.41798110234078, + 151.90886697564241 + ], + "distanceFromStart":3.375 + }, + { + "elevation":[ + 339.81419476005283, + 461.03832527824829 + ], + "pace":[ + 395.31160487975183, + 404.49550455974907 + ], + "heartRate":[ + 129.97753472415462, + 138.13531094848992 + ], + "distanceFromStart":3.75 + }, + { + "elevation":[ + 303.1495508565697, + 342.3532820173541 + ], + "pace":[ + 395.02844559698116, + 402.65878340653796 + ], + "heartRate":[ + 127.72304232462609, + 133.26322270764186 + ], + "distanceFromStart":4.125 + } + ] + }, + { + "name":"Lonesome Ridge Trail", + "id":1008, + "distance":4.5, + "difficulty":3, + "observations":[ + { + "elevation":[ + 291.65263635636268, + 309.26016677925196 + ], + "pace":[ + 396.08716481908732, + 403.68937873525232 + ], + "heartRate":[ + 117.16351898665887, + 121.95815455919609 + ], + "distanceFromStart":0 + }, + { + "elevation":[ + 299.24001936628116, + 317.44584350790012 + ], + "pace":[ + 380.19020240756623, + 395.3978319010256 + ], + "heartRate":[ + 117.6410892152911, + 124.82185220506081 + ], + "distanceFromStart":0.375 + }, + { + "elevation":[ + 303.62145464574394, + 336.05569457646544 + ], + "pace":[ + 380.55927782266116, + 397.60789726832775 + ], + "heartRate":[ + 121.52696452049059, + 127.31525441110122 + ], + "distanceFromStart":0.75 + }, + { + "elevation":[ + 319.90393365162629, + 346.26966025518789 + ], + "pace":[ + 357.94116421258531, + 398.0750288648062 + ], + "heartRate":[ + 123.75908585923588, + 132.77069404486801 + ], + "distanceFromStart":1.125 + }, + { + "elevation":[ + 354.17104439267905, + 403.57031216972939 + ], + "pace":[ + 335.07385149392701, + 397.82674381875808 + ], + "heartRate":[ + 130.8235194572915, + 140.55700591418218 + ], + "distanceFromStart":1.5 + }, + { + "elevation":[ + 357.42992871175124, + 385.92155620623635 + ], + "pace":[ + 395.16168913839374, + 404.60294066527558 + ], + "heartRate":[ + 131.5456052446734, + 134.65984504627627 + ], + "distanceFromStart":1.875 + }, + { + "elevation":[ + 345.47736721935661, + 363.18776661379422 + ], + "pace":[ + 340.82303041339082, + 404.71689228682374 + ], + "heartRate":[ + 125.1949698433959, + 131.31354363122026 + ], + "distanceFromStart":2.25 + }, + { + "elevation":[ + 346.23343025200535, + 497.23376445462401 + ], + "pace":[ + 261.27629148816021, + 331.68516208719467 + ], + "heartRate":[ + 131.67810544238606, + 154.26779645311458 + ], + "distanceFromStart":2.625 + }, + { + "elevation":[ + 491.57378483134391, + 547.49535224251053 + ], + "pace":[ + 296.05298644112088, + 401.14092967732398 + ], + "heartRate":[ + 151.36398089694217, + 166.20454793289232 + ], + "distanceFromStart":3 + }, + { + "elevation":[ + 472.06803233416338, + 531.92570520228401 + ], + "pace":[ + 395.50830663514012, + 401.67837917543591 + ], + "heartRate":[ + 134.41798110234078, + 151.90886697564241 + ], + "distanceFromStart":3.375 + }, + { + "elevation":[ + 339.81419476005283, + 461.03832527824829 + ], + "pace":[ + 395.31160487975183, + 404.49550455974907 + ], + "heartRate":[ + 129.97753472415462, + 138.13531094848992 + ], + "distanceFromStart":3.75 + }, + { + "elevation":[ + 303.1495508565697, + 342.3532820173541 + ], + "pace":[ + 395.02844559698116, + 402.65878340653796 + ], + "heartRate":[ + 127.72304232462609, + 133.26322270764186 + ], + "distanceFromStart":4.125 + } + ] + }, + { + "name":"Lonesome Ridge Trail", + "id":1009, + "distance":4.5, + "difficulty":3, + "observations":[ + { + "elevation":[ + 291.65263635636268, + 309.26016677925196 + ], + "pace":[ + 396.08716481908732, + 403.68937873525232 + ], + "heartRate":[ + 117.16351898665887, + 121.95815455919609 + ], + "distanceFromStart":0 + }, + { + "elevation":[ + 299.24001936628116, + 317.44584350790012 + ], + "pace":[ + 380.19020240756623, + 395.3978319010256 + ], + "heartRate":[ + 117.6410892152911, + 124.82185220506081 + ], + "distanceFromStart":0.375 + }, + { + "elevation":[ + 303.62145464574394, + 336.05569457646544 + ], + "pace":[ + 380.55927782266116, + 397.60789726832775 + ], + "heartRate":[ + 121.52696452049059, + 127.31525441110122 + ], + "distanceFromStart":0.75 + }, + { + "elevation":[ + 319.90393365162629, + 346.26966025518789 + ], + "pace":[ + 357.94116421258531, + 398.0750288648062 + ], + "heartRate":[ + 123.75908585923588, + 132.77069404486801 + ], + "distanceFromStart":1.125 + }, + { + "elevation":[ + 354.17104439267905, + 403.57031216972939 + ], + "pace":[ + 335.07385149392701, + 397.82674381875808 + ], + "heartRate":[ + 130.8235194572915, + 140.55700591418218 + ], + "distanceFromStart":1.5 + }, + { + "elevation":[ + 357.42992871175124, + 385.92155620623635 + ], + "pace":[ + 395.16168913839374, + 404.60294066527558 + ], + "heartRate":[ + 131.5456052446734, + 134.65984504627627 + ], + "distanceFromStart":1.875 + }, + { + "elevation":[ + 345.47736721935661, + 363.18776661379422 + ], + "pace":[ + 340.82303041339082, + 404.71689228682374 + ], + "heartRate":[ + 125.1949698433959, + 131.31354363122026 + ], + "distanceFromStart":2.25 + }, + { + "elevation":[ + 346.23343025200535, + 497.23376445462401 + ], + "pace":[ + 261.27629148816021, + 331.68516208719467 + ], + "heartRate":[ + 131.67810544238606, + 154.26779645311458 + ], + "distanceFromStart":2.625 + }, + { + "elevation":[ + 491.57378483134391, + 547.49535224251053 + ], + "pace":[ + 296.05298644112088, + 401.14092967732398 + ], + "heartRate":[ + 151.36398089694217, + 166.20454793289232 + ], + "distanceFromStart":3 + }, + { + "elevation":[ + 472.06803233416338, + 531.92570520228401 + ], + "pace":[ + 395.50830663514012, + 401.67837917543591 + ], + "heartRate":[ + 134.41798110234078, + 151.90886697564241 + ], + "distanceFromStart":3.375 + }, + { + "elevation":[ + 339.81419476005283, + 461.03832527824829 + ], + "pace":[ + 395.31160487975183, + 404.49550455974907 + ], + "heartRate":[ + 129.97753472415462, + 138.13531094848992 + ], + "distanceFromStart":3.75 + }, + { + "elevation":[ + 303.1495508565697, + 342.3532820173541 + ], + "pace":[ + 395.02844559698116, + 402.65878340653796 + ], + "heartRate":[ + 127.72304232462609, + 133.26322270764186 + ], + "distanceFromStart":4.125 + } + ] + }, + { + "name":"Lonesome Ridge Trail", + "id":1010, + "distance":4.5, + "difficulty":3, + "observations":[ + { + "elevation":[ + 291.65263635636268, + 309.26016677925196 + ], + "pace":[ + 396.08716481908732, + 403.68937873525232 + ], + "heartRate":[ + 117.16351898665887, + 121.95815455919609 + ], + "distanceFromStart":0 + }, + { + "elevation":[ + 299.24001936628116, + 317.44584350790012 + ], + "pace":[ + 380.19020240756623, + 395.3978319010256 + ], + "heartRate":[ + 117.6410892152911, + 124.82185220506081 + ], + "distanceFromStart":0.375 + }, + { + "elevation":[ + 303.62145464574394, + 336.05569457646544 + ], + "pace":[ + 380.55927782266116, + 397.60789726832775 + ], + "heartRate":[ + 121.52696452049059, + 127.31525441110122 + ], + "distanceFromStart":0.75 + }, + { + "elevation":[ + 319.90393365162629, + 346.26966025518789 + ], + "pace":[ + 357.94116421258531, + 398.0750288648062 + ], + "heartRate":[ + 123.75908585923588, + 132.77069404486801 + ], + "distanceFromStart":1.125 + }, + { + "elevation":[ + 354.17104439267905, + 403.57031216972939 + ], + "pace":[ + 335.07385149392701, + 397.82674381875808 + ], + "heartRate":[ + 130.8235194572915, + 140.55700591418218 + ], + "distanceFromStart":1.5 + }, + { + "elevation":[ + 357.42992871175124, + 385.92155620623635 + ], + "pace":[ + 395.16168913839374, + 404.60294066527558 + ], + "heartRate":[ + 131.5456052446734, + 134.65984504627627 + ], + "distanceFromStart":1.875 + }, + { + "elevation":[ + 345.47736721935661, + 363.18776661379422 + ], + "pace":[ + 340.82303041339082, + 404.71689228682374 + ], + "heartRate":[ + 125.1949698433959, + 131.31354363122026 + ], + "distanceFromStart":2.25 + }, + { + "elevation":[ + 346.23343025200535, + 497.23376445462401 + ], + "pace":[ + 261.27629148816021, + 331.68516208719467 + ], + "heartRate":[ + 131.67810544238606, + 154.26779645311458 + ], + "distanceFromStart":2.625 + }, + { + "elevation":[ + 491.57378483134391, + 547.49535224251053 + ], + "pace":[ + 296.05298644112088, + 401.14092967732398 + ], + "heartRate":[ + 151.36398089694217, + 166.20454793289232 + ], + "distanceFromStart":3 + }, + { + "elevation":[ + 472.06803233416338, + 531.92570520228401 + ], + "pace":[ + 395.50830663514012, + 401.67837917543591 + ], + "heartRate":[ + 134.41798110234078, + 151.90886697564241 + ], + "distanceFromStart":3.375 + }, + { + "elevation":[ + 339.81419476005283, + 461.03832527824829 + ], + "pace":[ + 395.31160487975183, + 404.49550455974907 + ], + "heartRate":[ + 129.97753472415462, + 138.13531094848992 + ], + "distanceFromStart":3.75 + }, + { + "elevation":[ + 303.1495508565697, + 342.3532820173541 + ], + "pace":[ + 395.02844559698116, + 402.65878340653796 + ], + "heartRate":[ + 127.72304232462609, + 133.26322270764186 + ], + "distanceFromStart":4.125 + } + ] + } +] diff --git a/Examples/ComposingComplexInterfaces/Complete/Landmarks/Landmarks/Resources/icybay.jpg b/Examples/ComposingComplexInterfaces/Complete/Landmarks/Landmarks/Resources/icybay.jpg new file mode 100755 index 0000000..feb1764 Binary files /dev/null and b/Examples/ComposingComplexInterfaces/Complete/Landmarks/Landmarks/Resources/icybay.jpg differ diff --git a/Examples/ComposingComplexInterfaces/Complete/Landmarks/Landmarks/Resources/lakemcdonald.jpg b/Examples/ComposingComplexInterfaces/Complete/Landmarks/Landmarks/Resources/lakemcdonald.jpg new file mode 100755 index 0000000..bd9d6b9 Binary files /dev/null and b/Examples/ComposingComplexInterfaces/Complete/Landmarks/Landmarks/Resources/lakemcdonald.jpg differ diff --git a/Examples/ComposingComplexInterfaces/Complete/Landmarks/Landmarks/Resources/landmarkData.json b/Examples/ComposingComplexInterfaces/Complete/Landmarks/Landmarks/Resources/landmarkData.json new file mode 100755 index 0000000..e5b14fc --- /dev/null +++ b/Examples/ComposingComplexInterfaces/Complete/Landmarks/Landmarks/Resources/landmarkData.json @@ -0,0 +1,182 @@ +[ + { + "name": "Turtle Rock", + "category": "Rivers", + "city": "Twentynine Palms", + "state": "California", + "id": 1001, + "isFeatured": true, + "isFavorite": true, + "park": "Joshua Tree National Park", + "coordinates": { + "longitude": -116.166868, + "latitude": 34.011286 + }, + "imageName": "turtlerock" + }, + { + "name": "Silver Salmon Creek", + "category": "Lakes", + "city": "Port Alsworth", + "state": "Alaska", + "id": 1002, + "isFeatured": false, + "isFavorite": false, + "park": "Lake Clark National Park and Preserve", + "coordinates": { + "longitude": -152.665167, + "latitude": 59.980167 + }, + "imageName": "silversalmoncreek" + }, + { + "name": "Chilkoot Trail", + "category": "Mountains", + "city": "Skagway", + "state": "Alaska", + "id": 1003, + "isFeatured": false, + "isFavorite": true, + "park": "Klondike Gold Rush National Historical Park", + "coordinates": { + "longitude": -135.334571, + "latitude": 59.560551 + }, + "imageName": "chilkoottrail" + }, + { + "name": "St. Mary Lake", + "category": "Lakes", + "city": "Browning", + "state": "Montana", + "id": 1004, + "isFeatured": true, + "isFavorite": true, + "park": "Glacier National Park", + "coordinates": { + "longitude": -113.536248, + "latitude": 48.69423 + }, + "imageName": "stmarylake" + }, + { + "name": "Twin Lake", + "category": "Lakes", + "city": "Twin Lakes", + "state": "Alaska", + "id": 1005, + "isFeatured": false, + "isFavorite": false, + "park": "Lake Clark National Park and Preserve", + "coordinates": { + "longitude": -153.849883, + "latitude": 60.641684 + }, + "imageName": "twinlake" + }, + { + "name": "Lake McDonald", + "category": "Mountains", + "city": "West Glacier", + "state": "Montana", + "id": 1006, + "isFeatured": false, + "isFavorite": false, + "park": "Glacier National Park", + "coordinates": { + "longitude": -113.934831, + "latitude": 48.56002 + }, + "imageName": "lakemcdonald" + }, + { + "name": "Charley Rivers", + "category": "Rivers", + "city": "Eaking", + "state": "Alaska", + "id": 1007, + "isFeatured": true, + "isFavorite": false, + "park": "Charley Rivers National Preserve", + "coordinates": { + "longitude": -143.122586, + "latitude": 65.350021 + }, + "imageName": "charleyrivers", + }, + { + "name": "Icy Bay", + "category": "Mountains", + "city": "Icy Bay", + "state": "Alaska", + "id": 1008, + "isFeatured": false, + "isFavorite": false, + "park": "Wrangell-St. Elias National Park and Preserve", + "coordinates": { + "longitude": -141.518167, + "latitude": 60.089917 + }, + "imageName": "icybay" + }, + { + "name": "Rainbow Lake", + "category": "Lakes", + "city": "Willow", + "state": "Alaska", + "id": 1009, + "isFeatured": false, + "isFavorite": false, + "park": "State Recreation Area", + "coordinates": { + "longitude": -150.086103, + "latitude": 61.694334 + }, + "imageName": "rainbowlake" + }, + { + "name": "Hidden Lake", + "category": "Lakes", + "city": "Newhalem", + "state": "Washington", + "id": 1010, + "isFeatured": false, + "isFavorite": false, + "park": "North Cascades National Park", + "coordinates": { + "longitude": -121.17799, + "latitude": 48.495442 + }, + "imageName": "hiddenlake" + }, + { + "name": "Chincoteague", + "category": "Rivers", + "city": "Chincoteague", + "state": "Virginia", + "id": 1011, + "isFeatured": false, + "isFavorite": false, + "park": "Chincoteague National Wildlife Refuge", + "coordinates": { + "longitude": -75.383212, + "latitude": 37.91531 + }, + "imageName": "chincoteague" + }, + { + "name": "Lake Umbagog", + "category": "Lakes", + "city": "Errol", + "state": "New Hampshire", + "id": 1012, + "isFeatured": true, + "isFavorite": false, + "park": "Umbagog National Wildlife Refuge", + "coordinates": { + "longitude": -71.056816, + "latitude": 44.747408 + }, + "imageName": "umbagog" + } +] diff --git a/Examples/ComposingComplexInterfaces/Complete/Landmarks/Landmarks/Resources/rainbowlake.jpg b/Examples/ComposingComplexInterfaces/Complete/Landmarks/Landmarks/Resources/rainbowlake.jpg new file mode 100755 index 0000000..6da43dd Binary files /dev/null and b/Examples/ComposingComplexInterfaces/Complete/Landmarks/Landmarks/Resources/rainbowlake.jpg differ diff --git a/Examples/ComposingComplexInterfaces/Complete/Landmarks/Landmarks/Resources/silversalmoncreek.jpg b/Examples/ComposingComplexInterfaces/Complete/Landmarks/Landmarks/Resources/silversalmoncreek.jpg new file mode 100755 index 0000000..f657532 Binary files /dev/null and b/Examples/ComposingComplexInterfaces/Complete/Landmarks/Landmarks/Resources/silversalmoncreek.jpg differ diff --git a/Examples/ComposingComplexInterfaces/Complete/Landmarks/Landmarks/Resources/stmarylake.jpg b/Examples/ComposingComplexInterfaces/Complete/Landmarks/Landmarks/Resources/stmarylake.jpg new file mode 100755 index 0000000..1c71de4 Binary files /dev/null and b/Examples/ComposingComplexInterfaces/Complete/Landmarks/Landmarks/Resources/stmarylake.jpg differ diff --git a/Examples/ComposingComplexInterfaces/Complete/Landmarks/Landmarks/Resources/turtlerock.jpg b/Examples/ComposingComplexInterfaces/Complete/Landmarks/Landmarks/Resources/turtlerock.jpg new file mode 100755 index 0000000..f7a6e6d Binary files /dev/null and b/Examples/ComposingComplexInterfaces/Complete/Landmarks/Landmarks/Resources/turtlerock.jpg differ diff --git a/Examples/ComposingComplexInterfaces/Complete/Landmarks/Landmarks/Resources/twinlake.jpg b/Examples/ComposingComplexInterfaces/Complete/Landmarks/Landmarks/Resources/twinlake.jpg new file mode 100755 index 0000000..3e7a57c Binary files /dev/null and b/Examples/ComposingComplexInterfaces/Complete/Landmarks/Landmarks/Resources/twinlake.jpg differ diff --git a/Examples/ComposingComplexInterfaces/Complete/Landmarks/Landmarks/Resources/umbagog.jpg b/Examples/ComposingComplexInterfaces/Complete/Landmarks/Landmarks/Resources/umbagog.jpg new file mode 100755 index 0000000..56291c6 Binary files /dev/null and b/Examples/ComposingComplexInterfaces/Complete/Landmarks/Landmarks/Resources/umbagog.jpg differ diff --git a/Examples/ComposingComplexInterfaces/Complete/Landmarks/Landmarks/SceneDelegate.swift b/Examples/ComposingComplexInterfaces/Complete/Landmarks/Landmarks/SceneDelegate.swift new file mode 100755 index 0000000..0f5f17e --- /dev/null +++ b/Examples/ComposingComplexInterfaces/Complete/Landmarks/Landmarks/SceneDelegate.swift @@ -0,0 +1,56 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +The scene delegate. +*/ + +import UIKit +import SwiftUI + +class SceneDelegate: UIResponder, UIWindowSceneDelegate { + + var window: UIWindow? + + func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) { + // Use this method to optionally configure and attach the UIWindow `window` to the provided UIWindowScene `scene`. + // If using a storyboard, the `window` property will automatically be initialized and attached to the scene. + // This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead). + + // Use a UIHostingController as window root view controller + let window = UIWindow(frame: UIScreen.main.bounds) + window.rootViewController = UIHostingController(rootView: CategoryHome().environmentObject(UserData())) + self.window = window + window.makeKeyAndVisible() + } + + func sceneDidDisconnect(_ scene: UIScene) { + // Called as the scene is being released by the system. + // This occurs shortly after the scene enters the background, or when its session is discarded. + // Release any resources associated with this scene that can be re-created the next time the scene connects. + // The scene may re-connect later, as its session was not neccessarily discarded (see `application:didDiscardSceneSessions` instead). + } + + func sceneDidBecomeActive(_ scene: UIScene) { + // Called when the scene has moved from an inactive state to an active state. + // Use this method to restart any tasks that were paused (or not yet started) when the scene was inactive. + } + + func sceneWillResignActive(_ scene: UIScene) { + // Called when the scene will move from an active state to an inactive state. + // This may occur due to temporary interruptions (ex. an incoming phone call). + } + + func sceneWillEnterForeground(_ scene: UIScene) { + // Called as the scene transitions from the background to the foreground. + // Use this method to undo the changes made on entering the background. + } + + func sceneDidEnterBackground(_ scene: UIScene) { + // Called as the scene transitions from the foreground to the background. + // Use this method to save data, release shared resources, and store enough scene-specific state information + // to restore the scene back to its current state. + } + +} + diff --git a/Examples/ComposingComplexInterfaces/Complete/Landmarks/Landmarks/Supporting Views/Badge.swift b/Examples/ComposingComplexInterfaces/Complete/Landmarks/Landmarks/Supporting Views/Badge.swift new file mode 100755 index 0000000..59f03b2 --- /dev/null +++ b/Examples/ComposingComplexInterfaces/Complete/Landmarks/Landmarks/Supporting Views/Badge.swift @@ -0,0 +1,41 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +A view that displays a badge. +*/ + +import SwiftUI + +struct Badge: View { + static let rotationCount = 8 + + var badgeSymbols: some View { + ForEach(0.. + var overallRange: Range + + var heightRatio: Length { + max(Length(magnitude(of: range) / magnitude(of: overallRange)), 0.15) + } + + var offsetRatio: Length { + Length((range.lowerBound - overallRange.lowerBound) / magnitude(of: overallRange)) + } + + var animation: Animation { + Animation.spring(initialVelocity: 5) + .speed(2) + .delay(0.03 * Double(index)) + } + + var body: some View { + Capsule() + .fill(Color.white) + .frame(height: height * heightRatio, alignment: .bottom) + .offset(x: 0, y: height * -offsetRatio) + .animation(animation) + } +} + +#if DEBUG +struct GraphCapsule_Previews: PreviewProvider { + static var previews: some View { + GraphCapsule(index: 0, height: 150, range: 10..<50, overallRange: 0..<100) + } +} +#endif diff --git a/Examples/ComposingComplexInterfaces/Complete/Landmarks/Landmarks/Supporting Views/HikeGraph.swift b/Examples/ComposingComplexInterfaces/Complete/Landmarks/Landmarks/Supporting Views/HikeGraph.swift new file mode 100755 index 0000000..7df5194 --- /dev/null +++ b/Examples/ComposingComplexInterfaces/Complete/Landmarks/Landmarks/Supporting Views/HikeGraph.swift @@ -0,0 +1,74 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +The elevation, heart rate, and pace of a hike plotted on a graph. +*/ + +import SwiftUI + +func rangeOfRanges(_ ranges: C) -> Range + where C.Element == Range { + guard !ranges.isEmpty else { return 0..<0 } + let low = ranges.lazy.map { $0.lowerBound }.min()! + let high = ranges.lazy.map { $0.upperBound }.max()! + return low..) -> Double { + return range.upperBound - range.lowerBound +} + +struct HikeGraph: View { + var hike: Hike + var path: KeyPath> + + var color: Color { + switch path { + case \.elevation: + return .gray + case \.heartRate: + return Color(hue: 0, saturation: 0.5, brightness: 0.7) + case \.pace: + return Color(hue: 0.7, saturation: 0.4, brightness: 0.7) + default: + return .black + } + } + + var body: some View { + let data = hike.observations + let overallRange = rangeOfRanges(data.lazy.map { $0[keyPath: self.path] }) + let maxMagnitude = data.map { magnitude(of: $0[keyPath: path]) }.max()! + let heightRatio = 1 - Length(maxMagnitude / magnitude(of: overallRange)) + + return GeometryReader { proxy in + HStack(alignment: .bottom, spacing: proxy.size.width / 120) { + ForEach(data.indices) { index in + GraphCapsule( + index: index, + height: proxy.size.height, + range: data[index][keyPath: self.path], + overallRange: overallRange) + .colorMultiply(self.color) + } + .offset(x: 0, y: proxy.size.height * heightRatio) + } + } + } +} + +#if DEBUG +struct HikeGraph_Previews: PreviewProvider { + static var previews: some View { + Group { + HikeGraph(hike: hikeData[0], path: \.elevation) + .frame(height: 200) + HikeGraph(hike: hikeData[0], path: \.heartRate) + .frame(height: 200) + HikeGraph(hike: hikeData[0], path: \.pace) + .frame(height: 200) + } + } +} +#endif diff --git a/Examples/ComposingComplexInterfaces/Complete/Landmarks/Landmarks/Supporting Views/LandmarkRow.swift b/Examples/ComposingComplexInterfaces/Complete/Landmarks/Landmarks/Supporting Views/LandmarkRow.swift new file mode 100755 index 0000000..2f8110c --- /dev/null +++ b/Examples/ComposingComplexInterfaces/Complete/Landmarks/Landmarks/Supporting Views/LandmarkRow.swift @@ -0,0 +1,38 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +A single row to be displayed in a list of landmarks. +*/ + +import SwiftUI + +struct LandmarkRow: View { + var landmark: Landmark + + var body: some View { + HStack { + landmark.image(forSize: 50) + Text(verbatim: landmark.name) + Spacer() + + if landmark.isFavorite { + Image(systemName: "star.fill") + .imageScale(.medium) + .foregroundColor(.yellow) + } + } + } +} + +#if DEBUG +struct LandmarkRow_Previews: PreviewProvider { + static var previews: some View { + Group { + LandmarkRow(landmark: landmarkData[0]) + LandmarkRow(landmark: landmarkData[1]) + } + .previewLayout(.fixed(width: 300, height: 70)) + } +} +#endif diff --git a/Examples/ComposingComplexInterfaces/Complete/Landmarks/Landmarks/Supporting Views/MapView.swift b/Examples/ComposingComplexInterfaces/Complete/Landmarks/Landmarks/Supporting Views/MapView.swift new file mode 100755 index 0000000..5a8c64b --- /dev/null +++ b/Examples/ComposingComplexInterfaces/Complete/Landmarks/Landmarks/Supporting Views/MapView.swift @@ -0,0 +1,31 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +A view that hosts an `MKMapView`. +*/ + +import SwiftUI +import MapKit + +struct MapView: UIViewRepresentable { + var coordinate: CLLocationCoordinate2D + + func makeUIView(context: Context) -> MKMapView { + MKMapView(frame: .zero) + } + + func updateUIView(_ view: MKMapView, context: Context) { + let span = MKCoordinateSpan(latitudeDelta: 0.02, longitudeDelta: 0.02) + let region = MKCoordinateRegion(center: coordinate, span: span) + view.setRegion(region, animated: true) + } +} + +#if DEBUG +struct MapView_Previews: PreviewProvider { + static var previews: some View { + MapView(coordinate: landmarkData[0].locationCoordinate) + } +} +#endif diff --git a/Examples/ComposingComplexInterfaces/Complete/Landmarks/Landmarks/Supporting Views/RotatedBadgeSymbol.swift b/Examples/ComposingComplexInterfaces/Complete/Landmarks/Landmarks/Supporting Views/RotatedBadgeSymbol.swift new file mode 100755 index 0000000..a7e4b53 --- /dev/null +++ b/Examples/ComposingComplexInterfaces/Complete/Landmarks/Landmarks/Supporting Views/RotatedBadgeSymbol.swift @@ -0,0 +1,26 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +A view that displays a rotated version of a badge symbol. +*/ + +import SwiftUI + +struct RotatedBadgeSymbol: View { + let angle: Angle + + var body: some View { + BadgeSymbol() + .padding(-60) + .rotationEffect(angle, anchor: .bottom) + } +} + +#if DEBUG +struct RotatedBadgeSymbol_Previews: PreviewProvider { + static var previews: some View { + RotatedBadgeSymbol(angle: .init(degrees: 5)) + } +} +#endif diff --git a/Examples/ComposingComplexInterfaces/Complete/README.md b/Examples/ComposingComplexInterfaces/Complete/README.md new file mode 100755 index 0000000..43ccf8c --- /dev/null +++ b/Examples/ComposingComplexInterfaces/Complete/README.md @@ -0,0 +1,3 @@ +# Completed Project: Composing Complex Interfaces + +Explore the completed project for the [Composing Complex Interfaces](https://developer.apple.com/tutorials/swiftui/composing-complex-interfaces) tutorial. \ No newline at end of file diff --git a/Examples/ComposingComplexInterfaces/StartingPoint/.gitignore b/Examples/ComposingComplexInterfaces/StartingPoint/.gitignore new file mode 100755 index 0000000..9e50718 --- /dev/null +++ b/Examples/ComposingComplexInterfaces/StartingPoint/.gitignore @@ -0,0 +1,21 @@ +# See LICENSE folder for this sample’s licensing information. +# +# Apple sample code gitignore configuration. + +# Finder +.DS_Store + +# Xcode - User files +xcuserdata/ + +**/*.xcodeproj/project.xcworkspace/* +!**/*.xcodeproj/project.xcworkspace/xcshareddata + +**/*.xcodeproj/project.xcworkspace/xcshareddata/* +!**/*.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings + +**/*.playground/playground.xcworkspace/* +!**/*.playground/playground.xcworkspace/xcshareddata + +**/*.playground/playground.xcworkspace/xcshareddata/* +!**/*.playground/playground.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings diff --git a/Examples/ComposingComplexInterfaces/StartingPoint/Configuration/SampleCode.xcconfig b/Examples/ComposingComplexInterfaces/StartingPoint/Configuration/SampleCode.xcconfig new file mode 100755 index 0000000..db86c06 --- /dev/null +++ b/Examples/ComposingComplexInterfaces/StartingPoint/Configuration/SampleCode.xcconfig @@ -0,0 +1,13 @@ +// +// See LICENSE folder for this sample’s licensing information. +// +// SampleCode.xcconfig +// + +// The `SAMPLE_CODE_DISAMBIGUATOR` configuration is to make it easier to build +// and run a sample code project. Once you set your project's development team, +// you'll have a unique bundle identifier. This is because the bundle identifier +// is derived based on the 'SAMPLE_CODE_DISAMBIGUATOR' value. Do not use this +// approach in your own projects—it's only useful for sample code projects because +// they are frequently downloaded and don't have a development team set. +SAMPLE_CODE_DISAMBIGUATOR=${DEVELOPMENT_TEAM} diff --git a/Examples/ComposingComplexInterfaces/StartingPoint/LICENSE/LICENSE.txt b/Examples/ComposingComplexInterfaces/StartingPoint/LICENSE/LICENSE.txt new file mode 100755 index 0000000..94e3d54 --- /dev/null +++ b/Examples/ComposingComplexInterfaces/StartingPoint/LICENSE/LICENSE.txt @@ -0,0 +1,8 @@ +Copyright © 2019 Apple Inc. + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + diff --git a/Examples/ComposingComplexInterfaces/StartingPoint/Landmarks/ComposingComplexInterfaces.xcodeproj/.xcodesamplecode.plist b/Examples/ComposingComplexInterfaces/StartingPoint/Landmarks/ComposingComplexInterfaces.xcodeproj/.xcodesamplecode.plist new file mode 100755 index 0000000..5dd5da8 --- /dev/null +++ b/Examples/ComposingComplexInterfaces/StartingPoint/Landmarks/ComposingComplexInterfaces.xcodeproj/.xcodesamplecode.plist @@ -0,0 +1,5 @@ + + + + + diff --git a/Examples/ComposingComplexInterfaces/StartingPoint/Landmarks/ComposingComplexInterfaces.xcodeproj/project.pbxproj b/Examples/ComposingComplexInterfaces/StartingPoint/Landmarks/ComposingComplexInterfaces.xcodeproj/project.pbxproj new file mode 100755 index 0000000..9348a60 --- /dev/null +++ b/Examples/ComposingComplexInterfaces/StartingPoint/Landmarks/ComposingComplexInterfaces.xcodeproj/project.pbxproj @@ -0,0 +1,525 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 50; + objects = { + +/* Begin PBXBuildFile section */ + B7310DD1229F6839001079B9 /* HexagonParameters.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7310DD0229F6839001079B9 /* HexagonParameters.swift */; }; + B7310DD3229F6CA9001079B9 /* Badge.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7310DD2229F6CA9001079B9 /* Badge.swift */; }; + B7394866229F194000C47603 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7394865229F194000C47603 /* AppDelegate.swift */; }; + B7394868229F194000C47603 /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7394867229F194000C47603 /* SceneDelegate.swift */; }; + B739486A229F194000C47603 /* LandmarkDetail.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7394869229F194000C47603 /* LandmarkDetail.swift */; }; + B739486C229F194200C47603 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = B739486B229F194200C47603 /* Assets.xcassets */; }; + B739486F229F194200C47603 /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = B739486E229F194200C47603 /* Preview Assets.xcassets */; }; + B7394872229F194200C47603 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = B7394870229F194200C47603 /* LaunchScreen.storyboard */; }; + B739487A229F1B3F00C47603 /* CircleImage.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7394879229F1B3F00C47603 /* CircleImage.swift */; }; + B739487C229F1B6800C47603 /* MapView.swift in Sources */ = {isa = PBXBuildFile; fileRef = B739487B229F1B6800C47603 /* MapView.swift */; }; + B7394881229F28B900C47603 /* Landmark.swift in Sources */ = {isa = PBXBuildFile; fileRef = B739487F229F28B900C47603 /* Landmark.swift */; }; + B7394882229F28B900C47603 /* Data.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7394880229F28B900C47603 /* Data.swift */; }; + B7394891229F292F00C47603 /* rainbowlake.jpg in Resources */ = {isa = PBXBuildFile; fileRef = B7394884229F292D00C47603 /* rainbowlake.jpg */; }; + B7394893229F292F00C47603 /* icybay.jpg in Resources */ = {isa = PBXBuildFile; fileRef = B7394886229F292E00C47603 /* icybay.jpg */; }; + B7394894229F292F00C47603 /* lakemcdonald.jpg in Resources */ = {isa = PBXBuildFile; fileRef = B7394887229F292E00C47603 /* lakemcdonald.jpg */; }; + B7394895229F292F00C47603 /* turtlerock.jpg in Resources */ = {isa = PBXBuildFile; fileRef = B7394888229F292E00C47603 /* turtlerock.jpg */; }; + B7394896229F292F00C47603 /* umbagog.jpg in Resources */ = {isa = PBXBuildFile; fileRef = B7394889229F292E00C47603 /* umbagog.jpg */; }; + B7394897229F292F00C47603 /* hiddenlake.jpg in Resources */ = {isa = PBXBuildFile; fileRef = B739488A229F292E00C47603 /* hiddenlake.jpg */; }; + B7394898229F292F00C47603 /* stmarylake.jpg in Resources */ = {isa = PBXBuildFile; fileRef = B739488B229F292E00C47603 /* stmarylake.jpg */; }; + B7394899229F292F00C47603 /* twinlake.jpg in Resources */ = {isa = PBXBuildFile; fileRef = B739488C229F292E00C47603 /* twinlake.jpg */; }; + B739489A229F292F00C47603 /* silversalmoncreek.jpg in Resources */ = {isa = PBXBuildFile; fileRef = B739488D229F292E00C47603 /* silversalmoncreek.jpg */; }; + B739489B229F292F00C47603 /* landmarkData.json in Resources */ = {isa = PBXBuildFile; fileRef = B739488E229F292E00C47603 /* landmarkData.json */; }; + B739489C229F292F00C47603 /* chincoteague.jpg in Resources */ = {isa = PBXBuildFile; fileRef = B739488F229F292F00C47603 /* chincoteague.jpg */; }; + B739489D229F292F00C47603 /* chilkoottrail.jpg in Resources */ = {isa = PBXBuildFile; fileRef = B7394890229F292F00C47603 /* chilkoottrail.jpg */; }; + B739489F229F2D9700C47603 /* LandmarkRow.swift in Sources */ = {isa = PBXBuildFile; fileRef = B739489E229F2D9700C47603 /* LandmarkRow.swift */; }; + B73948A1229F2E1F00C47603 /* LandmarkList.swift in Sources */ = {isa = PBXBuildFile; fileRef = B73948A0229F2E1F00C47603 /* LandmarkList.swift */; }; + B73948A3229F3E2200C47603 /* charleyrivers.jpg in Resources */ = {isa = PBXBuildFile; fileRef = B73948A2229F3E2200C47603 /* charleyrivers.jpg */; }; + B7D2AAC5229F4D7C0061E5F5 /* UserData.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7D2AAC4229F4D7C0061E5F5 /* UserData.swift */; }; + B7D587AE229F7382006E8DCF /* BadgeBackground.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7D587AD229F7382006E8DCF /* BadgeBackground.swift */; }; + B7D587B0229F73C1006E8DCF /* BadgeSymbol.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7D587AF229F73C1006E8DCF /* BadgeSymbol.swift */; }; + B7D587B2229F7406006E8DCF /* RotatedBadgeSymbol.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7D587B1229F7406006E8DCF /* RotatedBadgeSymbol.swift */; }; + B7D587B6229F825D006E8DCF /* HikeView.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7D587B5229F825D006E8DCF /* HikeView.swift */; }; + B7D587B8229F826D006E8DCF /* GraphCapsule.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7D587B7229F826D006E8DCF /* GraphCapsule.swift */; }; + B7D587BA229F8288006E8DCF /* Hike.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7D587B9229F8288006E8DCF /* Hike.swift */; }; + B7D587BC229F82EB006E8DCF /* HikeDetail.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7D587BB229F82EB006E8DCF /* HikeDetail.swift */; }; + B7D587BE229F82FF006E8DCF /* HikeGraph.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7D587BD229F82FF006E8DCF /* HikeGraph.swift */; }; + B7D587C0229F830B006E8DCF /* hikeData.json in Resources */ = {isa = PBXBuildFile; fileRef = B7D587BF229F830B006E8DCF /* hikeData.json */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + 2858D4702858CD0000000001 /* SampleCode.xcconfig */ = {isa = PBXFileReference; name = SampleCode.xcconfig; path = ../Configuration/SampleCode.xcconfig; sourceTree = ""; }; + 285AE3C0285ADF0000000001 /* LICENSE.txt */ = {isa = PBXFileReference; includeInIndex = 1; path = LICENSE.txt; sourceTree = ""; }; + B7310DD0229F6839001079B9 /* HexagonParameters.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HexagonParameters.swift; sourceTree = ""; }; + B7310DD2229F6CA9001079B9 /* Badge.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Badge.swift; sourceTree = ""; }; + B7394862229F194000C47603 /* Landmarks.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Landmarks.app; sourceTree = BUILT_PRODUCTS_DIR; }; + B7394865229F194000C47603 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + B7394867229F194000C47603 /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = ""; }; + B7394869229F194000C47603 /* LandmarkDetail.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LandmarkDetail.swift; sourceTree = ""; }; + B739486B229F194200C47603 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + B739486E229F194200C47603 /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = ""; }; + B7394871229F194200C47603 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + B7394873229F194200C47603 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + B7394879229F1B3F00C47603 /* CircleImage.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CircleImage.swift; sourceTree = ""; }; + B739487B229F1B6800C47603 /* MapView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MapView.swift; sourceTree = ""; }; + B739487F229F28B900C47603 /* Landmark.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Landmark.swift; sourceTree = ""; }; + B7394880229F28B900C47603 /* Data.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Data.swift; sourceTree = ""; }; + B7394884229F292D00C47603 /* rainbowlake.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = rainbowlake.jpg; sourceTree = ""; }; + B7394886229F292E00C47603 /* icybay.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = icybay.jpg; sourceTree = ""; }; + B7394887229F292E00C47603 /* lakemcdonald.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = lakemcdonald.jpg; sourceTree = ""; }; + B7394888229F292E00C47603 /* turtlerock.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = turtlerock.jpg; sourceTree = ""; }; + B7394889229F292E00C47603 /* umbagog.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = umbagog.jpg; sourceTree = ""; }; + B739488A229F292E00C47603 /* hiddenlake.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = hiddenlake.jpg; sourceTree = ""; }; + B739488B229F292E00C47603 /* stmarylake.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = stmarylake.jpg; sourceTree = ""; }; + B739488C229F292E00C47603 /* twinlake.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = twinlake.jpg; sourceTree = ""; }; + B739488D229F292E00C47603 /* silversalmoncreek.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = silversalmoncreek.jpg; sourceTree = ""; }; + B739488E229F292E00C47603 /* landmarkData.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = landmarkData.json; sourceTree = ""; }; + B739488F229F292F00C47603 /* chincoteague.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = chincoteague.jpg; sourceTree = ""; }; + B7394890229F292F00C47603 /* chilkoottrail.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = chilkoottrail.jpg; sourceTree = ""; }; + B739489E229F2D9700C47603 /* LandmarkRow.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = LandmarkRow.swift; path = "Supporting Views/LandmarkRow.swift"; sourceTree = ""; }; + B73948A0229F2E1F00C47603 /* LandmarkList.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LandmarkList.swift; sourceTree = ""; }; + B73948A2229F3E2200C47603 /* charleyrivers.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = charleyrivers.jpg; sourceTree = ""; }; + B7D2AAC4229F4D7C0061E5F5 /* UserData.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UserData.swift; sourceTree = ""; }; + B7D587AD229F7382006E8DCF /* BadgeBackground.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BadgeBackground.swift; sourceTree = ""; }; + B7D587AF229F73C1006E8DCF /* BadgeSymbol.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BadgeSymbol.swift; sourceTree = ""; }; + B7D587B1229F7406006E8DCF /* RotatedBadgeSymbol.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RotatedBadgeSymbol.swift; sourceTree = ""; }; + B7D587B5229F825D006E8DCF /* HikeView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HikeView.swift; sourceTree = ""; }; + B7D587B7229F826D006E8DCF /* GraphCapsule.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GraphCapsule.swift; sourceTree = ""; }; + B7D587B9229F8288006E8DCF /* Hike.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Hike.swift; sourceTree = ""; }; + B7D587BB229F82EB006E8DCF /* HikeDetail.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HikeDetail.swift; sourceTree = ""; }; + B7D587BD229F82FF006E8DCF /* HikeGraph.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HikeGraph.swift; sourceTree = ""; }; + B7D587BF229F830B006E8DCF /* hikeData.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = hikeData.json; sourceTree = ""; }; + C4E4AAA0C4E4035000000001 /* README.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; name = README.md; path = ../README.md; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + B739485F229F194000C47603 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 2858CF802858CF4000000001 /* Configuration */ = { + isa = PBXGroup; + children = ( + 2858D4702858CD0000000001 /* SampleCode.xcconfig */, + ); + name = Configuration; + sourceTree = ""; + }; + 285ACD50285AD6E000000001 /* LICENSE */ = { + isa = PBXGroup; + children = ( + 285AE3C0285ADF0000000001 /* LICENSE.txt */, + ); + name = LICENSE; + path = ../LICENSE; + sourceTree = ""; + }; + B7394859229F194000C47603 = { + isa = PBXGroup; + children = ( + C4E4AAA0C4E4035000000001 /* README.md */, + B7394864229F194000C47603 /* Landmarks */, + B7394863229F194000C47603 /* Products */, + 2858CF802858CF4000000001 /* Configuration */, + 285ACD50285AD6E000000001 /* LICENSE */, + ); + sourceTree = ""; + }; + B7394863229F194000C47603 /* Products */ = { + isa = PBXGroup; + children = ( + B7394862229F194000C47603 /* Landmarks.app */, + ); + name = Products; + sourceTree = ""; + }; + B7394864229F194000C47603 /* Landmarks */ = { + isa = PBXGroup; + children = ( + B739487E229F282200C47603 /* Models */, + B7394865229F194000C47603 /* AppDelegate.swift */, + B7394867229F194000C47603 /* SceneDelegate.swift */, + B73948A0229F2E1F00C47603 /* LandmarkList.swift */, + B739489E229F2D9700C47603 /* LandmarkRow.swift */, + B7394869229F194000C47603 /* LandmarkDetail.swift */, + B7D587B5229F825D006E8DCF /* HikeView.swift */, + B7D587BB229F82EB006E8DCF /* HikeDetail.swift */, + B7310DD0229F6839001079B9 /* HexagonParameters.swift */, + B739487D229F1C0100C47603 /* Supporting Views */, + B7394883229F291A00C47603 /* Resources */, + B739486B229F194200C47603 /* Assets.xcassets */, + B7394870229F194200C47603 /* LaunchScreen.storyboard */, + B7394873229F194200C47603 /* Info.plist */, + B739486D229F194200C47603 /* Preview Content */, + ); + path = Landmarks; + sourceTree = ""; + }; + B739486D229F194200C47603 /* Preview Content */ = { + isa = PBXGroup; + children = ( + B739486E229F194200C47603 /* Preview Assets.xcassets */, + ); + path = "Preview Content"; + sourceTree = ""; + }; + B739487D229F1C0100C47603 /* Supporting Views */ = { + isa = PBXGroup; + children = ( + B7394879229F1B3F00C47603 /* CircleImage.swift */, + B739487B229F1B6800C47603 /* MapView.swift */, + B7310DD2229F6CA9001079B9 /* Badge.swift */, + B7D587AF229F73C1006E8DCF /* BadgeSymbol.swift */, + B7D587B1229F7406006E8DCF /* RotatedBadgeSymbol.swift */, + B7D587AD229F7382006E8DCF /* BadgeBackground.swift */, + B7D587BD229F82FF006E8DCF /* HikeGraph.swift */, + B7D587B7229F826D006E8DCF /* GraphCapsule.swift */, + ); + path = "Supporting Views"; + sourceTree = ""; + }; + B739487E229F282200C47603 /* Models */ = { + isa = PBXGroup; + children = ( + B7394880229F28B900C47603 /* Data.swift */, + B739487F229F28B900C47603 /* Landmark.swift */, + B7D587B9229F8288006E8DCF /* Hike.swift */, + B7D2AAC4229F4D7C0061E5F5 /* UserData.swift */, + ); + path = Models; + sourceTree = ""; + }; + B7394883229F291A00C47603 /* Resources */ = { + isa = PBXGroup; + children = ( + B739488E229F292E00C47603 /* landmarkData.json */, + B7D587BF229F830B006E8DCF /* hikeData.json */, + B7394890229F292F00C47603 /* chilkoottrail.jpg */, + B739488F229F292F00C47603 /* chincoteague.jpg */, + B739488A229F292E00C47603 /* hiddenlake.jpg */, + B7394886229F292E00C47603 /* icybay.jpg */, + B7394887229F292E00C47603 /* lakemcdonald.jpg */, + B7394884229F292D00C47603 /* rainbowlake.jpg */, + B739488D229F292E00C47603 /* silversalmoncreek.jpg */, + B739488B229F292E00C47603 /* stmarylake.jpg */, + B7394888229F292E00C47603 /* turtlerock.jpg */, + B739488C229F292E00C47603 /* twinlake.jpg */, + B7394889229F292E00C47603 /* umbagog.jpg */, + B73948A2229F3E2200C47603 /* charleyrivers.jpg */, + ); + path = Resources; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + B7394861229F194000C47603 /* Landmarks */ = { + isa = PBXNativeTarget; + buildConfigurationList = B7394876229F194200C47603 /* Build configuration list for PBXNativeTarget "Landmarks" */; + buildPhases = ( + B739485E229F194000C47603 /* Sources */, + B739485F229F194000C47603 /* Frameworks */, + B7394860229F194000C47603 /* Resources */, + C602AC70C605937000000001, + ); + buildRules = ( + ); + dependencies = ( + ); + name = Landmarks; + productName = Landmarks; + productReference = B7394862229F194000C47603 /* Landmarks.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + B739485A229F194000C47603 /* Project object */ = { + isa = PBXProject; + attributes = { + LastSwiftUpdateCheck = 1100; + LastUpgradeCheck = 1100; + ORGANIZATIONNAME = Apple; + TargetAttributes = { + B7394861229F194000C47603 = { + CreatedOnToolsVersion = 11.0; + }; + }; + }; + buildConfigurationList = B739485D229F194000C47603 /* Build configuration list for PBXProject "ComposingComplexInterfaces" */; + compatibilityVersion = "Xcode 9.3"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = B7394859229F194000C47603; + productRefGroup = B7394863229F194000C47603 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + B7394861229F194000C47603 /* Landmarks */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + B7394860229F194000C47603 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + B739489A229F292F00C47603 /* silversalmoncreek.jpg in Resources */, + B7394894229F292F00C47603 /* lakemcdonald.jpg in Resources */, + B7D587C0229F830B006E8DCF /* hikeData.json in Resources */, + B7394872229F194200C47603 /* LaunchScreen.storyboard in Resources */, + B73948A3229F3E2200C47603 /* charleyrivers.jpg in Resources */, + B7394891229F292F00C47603 /* rainbowlake.jpg in Resources */, + B739486F229F194200C47603 /* Preview Assets.xcassets in Resources */, + B7394895229F292F00C47603 /* turtlerock.jpg in Resources */, + B739486C229F194200C47603 /* Assets.xcassets in Resources */, + B7394899229F292F00C47603 /* twinlake.jpg in Resources */, + B7394896229F292F00C47603 /* umbagog.jpg in Resources */, + B739489D229F292F00C47603 /* chilkoottrail.jpg in Resources */, + B739489C229F292F00C47603 /* chincoteague.jpg in Resources */, + B739489B229F292F00C47603 /* landmarkData.json in Resources */, + B7394893229F292F00C47603 /* icybay.jpg in Resources */, + B7394897229F292F00C47603 /* hiddenlake.jpg in Resources */, + B7394898229F292F00C47603 /* stmarylake.jpg in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + B739485E229F194000C47603 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + B7394882229F28B900C47603 /* Data.swift in Sources */, + B7310DD3229F6CA9001079B9 /* Badge.swift in Sources */, + B7394866229F194000C47603 /* AppDelegate.swift in Sources */, + B7D587B8229F826D006E8DCF /* GraphCapsule.swift in Sources */, + B739487A229F1B3F00C47603 /* CircleImage.swift in Sources */, + B739487C229F1B6800C47603 /* MapView.swift in Sources */, + B7D587BA229F8288006E8DCF /* Hike.swift in Sources */, + B7D587BC229F82EB006E8DCF /* HikeDetail.swift in Sources */, + B7D587B6229F825D006E8DCF /* HikeView.swift in Sources */, + B7310DD1229F6839001079B9 /* HexagonParameters.swift in Sources */, + B73948A1229F2E1F00C47603 /* LandmarkList.swift in Sources */, + B7D587B0229F73C1006E8DCF /* BadgeSymbol.swift in Sources */, + B7D587B2229F7406006E8DCF /* RotatedBadgeSymbol.swift in Sources */, + B7D587BE229F82FF006E8DCF /* HikeGraph.swift in Sources */, + B7394868229F194000C47603 /* SceneDelegate.swift in Sources */, + B7D587AE229F7382006E8DCF /* BadgeBackground.swift in Sources */, + B739486A229F194000C47603 /* LandmarkDetail.swift in Sources */, + B739489F229F2D9700C47603 /* LandmarkRow.swift in Sources */, + B7D2AAC5229F4D7C0061E5F5 /* UserData.swift in Sources */, + B7394881229F28B900C47603 /* Landmark.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXVariantGroup section */ + B7394870229F194200C47603 /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + B7394871229F194200C47603 /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + B7394874229F194200C47603 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 2858D4702858CD0000000001 /* SampleCode.xcconfig */; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 13.0; + MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; + MTL_FAST_MATH = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + }; + name = Debug; + }; + B7394875229F194200C47603 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 2858D4702858CD0000000001 /* SampleCode.xcconfig */; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 13.0; + MTL_ENABLE_DEBUG_INFO = NO; + MTL_FAST_MATH = YES; + SDKROOT = iphoneos; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + B7394877229F194200C47603 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 2858D4702858CD0000000001 /* SampleCode.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_ASSET_PATHS = "Landmarks/Preview\\ Content"; + DEVELOPMENT_TEAM = ""; + ENABLE_PREVIEWS = YES; + INFOPLIST_FILE = Landmarks/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = "com.example.apple-samplecode.Landmarks${SAMPLE_CODE_DISAMBIGUATOR}"; + PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE_SPECIFIER = ""; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + B7394878229F194200C47603 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 2858D4702858CD0000000001 /* SampleCode.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_ASSET_PATHS = "Landmarks/Preview\\ Content"; + DEVELOPMENT_TEAM = ""; + ENABLE_PREVIEWS = YES; + INFOPLIST_FILE = Landmarks/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = "com.example.apple-samplecode.Landmarks${SAMPLE_CODE_DISAMBIGUATOR}"; + PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE_SPECIFIER = ""; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + B739485D229F194000C47603 /* Build configuration list for PBXProject "ComposingComplexInterfaces" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + B7394874229F194200C47603 /* Debug */, + B7394875229F194200C47603 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + B7394876229F194200C47603 /* Build configuration list for PBXNativeTarget "Landmarks" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + B7394877229F194200C47603 /* Debug */, + B7394878229F194200C47603 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = B739485A229F194000C47603 /* Project object */; +} diff --git a/Examples/ComposingComplexInterfaces/StartingPoint/Landmarks/ComposingComplexInterfaces.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/Examples/ComposingComplexInterfaces/StartingPoint/Landmarks/ComposingComplexInterfaces.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings new file mode 100755 index 0000000..3ddf867 --- /dev/null +++ b/Examples/ComposingComplexInterfaces/StartingPoint/Landmarks/ComposingComplexInterfaces.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings @@ -0,0 +1,8 @@ + + + + + BuildSystemType + Latest + + diff --git a/Examples/ComposingComplexInterfaces/StartingPoint/Landmarks/Landmarks/AppDelegate.swift b/Examples/ComposingComplexInterfaces/StartingPoint/Landmarks/Landmarks/AppDelegate.swift new file mode 100755 index 0000000..e22943b --- /dev/null +++ b/Examples/ComposingComplexInterfaces/StartingPoint/Landmarks/Landmarks/AppDelegate.swift @@ -0,0 +1,36 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +The application delegate. +*/ + +import UIKit + +@UIApplicationMain +class AppDelegate: UIResponder, UIApplicationDelegate { + + func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { + // Override point for customization after application launch. + return true + } + + func applicationWillTerminate(_ application: UIApplication) { + // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. + } + + // MARK: UISceneSession Lifecycle + func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration { + // Called when a new scene session is being created. + // Use this method to select a configuration to create the new scene with. + return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role) + } + + func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set) { + // Called when the user discards a scene session. + // If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions. + // Use this method to release any resources that were specific to the discarded scenes, as they will not return. + } + +} + diff --git a/Examples/ComposingComplexInterfaces/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/Contents.json b/Examples/ComposingComplexInterfaces/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100755 index 0000000..55bad5e --- /dev/null +++ b/Examples/ComposingComplexInterfaces/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,111 @@ +{ + "images" : [ + { + "size" : "20x20", + "idiom" : "iphone", + "filename" : "landmark_app_icon_40x40.png", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "20x20", + "scale" : "3x" + }, + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "landmark_app_icon_58x58.png", + "scale" : "2x" + }, + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "landmark_app_icon_87x87.png", + "scale" : "3x" + }, + { + "size" : "40x40", + "idiom" : "iphone", + "filename" : "landmark_app_icon_80x80.png", + "scale" : "2x" + }, + { + "size" : "40x40", + "idiom" : "iphone", + "filename" : "landmark_app_icon_120x120.png", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "3x" + }, + { + "idiom" : "ipad", + "size" : "20x20", + "scale" : "1x" + }, + { + "size" : "20x20", + "idiom" : "ipad", + "filename" : "landmark_app_icon_40x40-1.png", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "29x29", + "scale" : "1x" + }, + { + "size" : "29x29", + "idiom" : "ipad", + "filename" : "landmark_app_icon_58x58-1.png", + "scale" : "2x" + }, + { + "size" : "40x40", + "idiom" : "ipad", + "filename" : "landmark_app_icon_40x40-2.png", + "scale" : "1x" + }, + { + "size" : "40x40", + "idiom" : "ipad", + "filename" : "landmark_app_icon_80x80-1.png", + "scale" : "2x" + }, + { + "size" : "76x76", + "idiom" : "ipad", + "filename" : "landmark_app_icon_76x76.png", + "scale" : "1x" + }, + { + "size" : "76x76", + "idiom" : "ipad", + "filename" : "landmark_app_icon_152x152.png", + "scale" : "2x" + }, + { + "size" : "83.5x83.5", + "idiom" : "ipad", + "filename" : "landmark_app_icon_167x167.png", + "scale" : "2x" + }, + { + "size" : "1024x1024", + "idiom" : "ios-marketing", + "filename" : "landmark_app_icon_1024x1024.png", + "scale" : "1x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Examples/ComposingComplexInterfaces/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_1024x1024.png b/Examples/ComposingComplexInterfaces/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_1024x1024.png new file mode 100755 index 0000000..00d81c1 Binary files /dev/null and b/Examples/ComposingComplexInterfaces/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_1024x1024.png differ diff --git a/Examples/ComposingComplexInterfaces/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_120x120.png b/Examples/ComposingComplexInterfaces/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_120x120.png new file mode 100755 index 0000000..d382b8b Binary files /dev/null and b/Examples/ComposingComplexInterfaces/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_120x120.png differ diff --git a/Examples/ComposingComplexInterfaces/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_152x152.png b/Examples/ComposingComplexInterfaces/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_152x152.png new file mode 100755 index 0000000..11057f8 Binary files /dev/null and b/Examples/ComposingComplexInterfaces/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_152x152.png differ diff --git a/Examples/ComposingComplexInterfaces/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_167x167.png b/Examples/ComposingComplexInterfaces/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_167x167.png new file mode 100755 index 0000000..f73bc26 Binary files /dev/null and b/Examples/ComposingComplexInterfaces/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_167x167.png differ diff --git a/Examples/ComposingComplexInterfaces/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_40x40-1.png b/Examples/ComposingComplexInterfaces/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_40x40-1.png new file mode 100755 index 0000000..abaff0e Binary files /dev/null and b/Examples/ComposingComplexInterfaces/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_40x40-1.png differ diff --git a/Examples/ComposingComplexInterfaces/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_40x40-2.png b/Examples/ComposingComplexInterfaces/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_40x40-2.png new file mode 100755 index 0000000..abaff0e Binary files /dev/null and b/Examples/ComposingComplexInterfaces/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_40x40-2.png differ diff --git a/Examples/ComposingComplexInterfaces/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_40x40.png b/Examples/ComposingComplexInterfaces/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_40x40.png new file mode 100755 index 0000000..abaff0e Binary files /dev/null and b/Examples/ComposingComplexInterfaces/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_40x40.png differ diff --git a/Examples/ComposingComplexInterfaces/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_58x58-1.png b/Examples/ComposingComplexInterfaces/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_58x58-1.png new file mode 100755 index 0000000..cf7c73d Binary files /dev/null and b/Examples/ComposingComplexInterfaces/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_58x58-1.png differ diff --git a/Examples/ComposingComplexInterfaces/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_58x58.png b/Examples/ComposingComplexInterfaces/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_58x58.png new file mode 100755 index 0000000..cf7c73d Binary files /dev/null and b/Examples/ComposingComplexInterfaces/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_58x58.png differ diff --git a/Examples/ComposingComplexInterfaces/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_76x76.png b/Examples/ComposingComplexInterfaces/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_76x76.png new file mode 100755 index 0000000..3eff85b Binary files /dev/null and b/Examples/ComposingComplexInterfaces/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_76x76.png differ diff --git a/Examples/ComposingComplexInterfaces/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_80x80-1.png b/Examples/ComposingComplexInterfaces/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_80x80-1.png new file mode 100755 index 0000000..6f33f66 Binary files /dev/null and b/Examples/ComposingComplexInterfaces/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_80x80-1.png differ diff --git a/Examples/ComposingComplexInterfaces/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_80x80.png b/Examples/ComposingComplexInterfaces/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_80x80.png new file mode 100755 index 0000000..6f33f66 Binary files /dev/null and b/Examples/ComposingComplexInterfaces/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_80x80.png differ diff --git a/Examples/ComposingComplexInterfaces/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_87x87.png b/Examples/ComposingComplexInterfaces/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_87x87.png new file mode 100755 index 0000000..9e1616c Binary files /dev/null and b/Examples/ComposingComplexInterfaces/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_87x87.png differ diff --git a/Examples/ComposingComplexInterfaces/StartingPoint/Landmarks/Landmarks/Assets.xcassets/Contents.json b/Examples/ComposingComplexInterfaces/StartingPoint/Landmarks/Landmarks/Assets.xcassets/Contents.json new file mode 100755 index 0000000..da4a164 --- /dev/null +++ b/Examples/ComposingComplexInterfaces/StartingPoint/Landmarks/Landmarks/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Examples/ComposingComplexInterfaces/StartingPoint/Landmarks/Landmarks/Assets.xcassets/turtlerock.imageset/Contents.json b/Examples/ComposingComplexInterfaces/StartingPoint/Landmarks/Landmarks/Assets.xcassets/turtlerock.imageset/Contents.json new file mode 100755 index 0000000..5bfd7bf --- /dev/null +++ b/Examples/ComposingComplexInterfaces/StartingPoint/Landmarks/Landmarks/Assets.xcassets/turtlerock.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "turtlerock.jpg", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Examples/ComposingComplexInterfaces/StartingPoint/Landmarks/Landmarks/Assets.xcassets/turtlerock.imageset/turtlerock.jpg b/Examples/ComposingComplexInterfaces/StartingPoint/Landmarks/Landmarks/Assets.xcassets/turtlerock.imageset/turtlerock.jpg new file mode 100755 index 0000000..68bcd3e Binary files /dev/null and b/Examples/ComposingComplexInterfaces/StartingPoint/Landmarks/Landmarks/Assets.xcassets/turtlerock.imageset/turtlerock.jpg differ diff --git a/Examples/ComposingComplexInterfaces/StartingPoint/Landmarks/Landmarks/Base.lproj/LaunchScreen.storyboard b/Examples/ComposingComplexInterfaces/StartingPoint/Landmarks/Landmarks/Base.lproj/LaunchScreen.storyboard new file mode 100755 index 0000000..865e932 --- /dev/null +++ b/Examples/ComposingComplexInterfaces/StartingPoint/Landmarks/Landmarks/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Examples/ComposingComplexInterfaces/StartingPoint/Landmarks/Landmarks/HexagonParameters.swift b/Examples/ComposingComplexInterfaces/StartingPoint/Landmarks/Landmarks/HexagonParameters.swift new file mode 100755 index 0000000..8decba4 --- /dev/null +++ b/Examples/ComposingComplexInterfaces/StartingPoint/Landmarks/Landmarks/HexagonParameters.swift @@ -0,0 +1,57 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +Size, position, and other information used to draw a badge. +*/ + +import SwiftUI + +struct HexagonParameters { + struct Segment { + let useWidth: (CGFloat, CGFloat, CGFloat) + let xFactors: (CGFloat, CGFloat, CGFloat) + let useHeight: (CGFloat, CGFloat, CGFloat) + let yFactors: (CGFloat, CGFloat, CGFloat) + } + + static let adjustment: CGFloat = 0.085 + static let points = [ + Segment( + useWidth: (1.00, 1.00, 1.00), + xFactors: (0.60, 0.40, 0.50), + useHeight: (1.00, 1.00, 0.00), + yFactors: (0.05, 0.05, 0.00) + ), + Segment( + useWidth: (1.00, 1.00, 0.00), + xFactors: (0.05, 0.00, 0.00), + useHeight: (1.00, 1.00, 1.00), + yFactors: (0.20 + adjustment, 0.30 + adjustment, 0.25 + adjustment) + ), + Segment( + useWidth: (1.00, 1.00, 0.00), + xFactors: (0.00, 0.05, 0.00), + useHeight: (1.00, 1.00, 1.00), + yFactors: (0.70 - adjustment, 0.80 - adjustment, 0.75 - adjustment) + ), + Segment( + useWidth: (1.00, 1.00, 1.00), + xFactors: (0.40, 0.60, 0.50), + useHeight: (1.00, 1.00, 1.00), + yFactors: (0.95, 0.95, 1.00) + ), + Segment( + useWidth: (1.00, 1.00, 1.00), + xFactors: (0.95, 1.00, 1.00), + useHeight: (1.00, 1.00, 1.00), + yFactors: (0.80 - adjustment, 0.70 - adjustment, 0.75 - adjustment) + ), + Segment( + useWidth: (1.00, 1.00, 1.00), + xFactors: (1.00, 0.95, 1.00), + useHeight: (1.00, 1.00, 1.00), + yFactors: (0.30 + adjustment, 0.20 + adjustment, 0.25 + adjustment) + ) + ] +} diff --git a/Examples/ComposingComplexInterfaces/StartingPoint/Landmarks/Landmarks/HikeDetail.swift b/Examples/ComposingComplexInterfaces/StartingPoint/Landmarks/Landmarks/HikeDetail.swift new file mode 100755 index 0000000..3406a6d --- /dev/null +++ b/Examples/ComposingComplexInterfaces/StartingPoint/Landmarks/Landmarks/HikeDetail.swift @@ -0,0 +1,49 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +A view showing the details for a hike. +*/ + +import SwiftUI + +struct HikeDetail: View { + let hike: Hike + @State var dataToShow = \Hike.Observation.elevation + + var buttons = [ + ("Elevation", \Hike.Observation.elevation), + ("Heart Rate", \Hike.Observation.heartRate), + ("Pace", \Hike.Observation.pace), + ] + + var body: some View { + return VStack { + HikeGraph(hike: hike, path: dataToShow) + .frame(height: 200, alignment: .center) + + HStack(spacing: 25) { + ForEach(buttons.identified(by: \.0)) { value in + Button(action: { + self.dataToShow = value.1 + }) { + Text(verbatim: value.0) + .font(.system(size: 15)) + .color(value.1 == self.dataToShow + ? Color.gray + : Color.accentColor) + .animation(nil) + } + } + } + } + } +} + +#if DEBUG +struct HikeDetail_Previews: PreviewProvider { + static var previews: some View { + HikeDetail(hike: hikeData[0]) + } +} +#endif diff --git a/Examples/ComposingComplexInterfaces/StartingPoint/Landmarks/Landmarks/HikeView.swift b/Examples/ComposingComplexInterfaces/StartingPoint/Landmarks/Landmarks/HikeView.swift new file mode 100755 index 0000000..f4c02cc --- /dev/null +++ b/Examples/ComposingComplexInterfaces/StartingPoint/Landmarks/Landmarks/HikeView.swift @@ -0,0 +1,68 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +A view displaying inforamtion about a hike, including an elevation graph. +*/ + +import SwiftUI + +struct HikeView: View { + var hike: Hike + @State private var showDetail = false + + var transition: AnyTransition { + let insertion = AnyTransition.move(edge: .trailing) + .combined(with: .opacity) + let removal = AnyTransition.scale() + .combined(with: .opacity) + return .asymmetric(insertion: insertion, removal: removal) + } + + var body: some View { + VStack { + HStack { + HikeGraph(hike: hike, path: \.elevation) + .frame(width: 50, height: 30) + .animation(nil) + + VStack(alignment: .leading) { + Text(verbatim: hike.name) + .font(.headline) + Text(verbatim: hike.distanceText) + } + + Spacer() + + Button(action: { + withAnimation { + self.showDetail.toggle() + } + }) { + Image(systemName: "chevron.right.circle") + .imageScale(.large) + .rotationEffect(.degrees(showDetail ? 90 : 0)) + .scaleEffect(showDetail ? 1.5 : 1) + .padding() + } + } + + if showDetail { + HikeDetail(hike: hike) + .transition(transition) + } + } + } +} + +#if DEBUG +struct HikeView_Previews: PreviewProvider { + static var previews: some View { + VStack { + HikeView(hike: hikeData[0]) + .padding() + Spacer() + } + } +} +#endif diff --git a/Examples/ComposingComplexInterfaces/StartingPoint/Landmarks/Landmarks/Info.plist b/Examples/ComposingComplexInterfaces/StartingPoint/Landmarks/Landmarks/Info.plist new file mode 100755 index 0000000..e8bb4c6 --- /dev/null +++ b/Examples/ComposingComplexInterfaces/StartingPoint/Landmarks/Landmarks/Info.plist @@ -0,0 +1,62 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + $(PRODUCT_BUNDLE_PACKAGE_TYPE) + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1 + LSRequiresIPhoneOS + + UIApplicationSceneManifest + + UIApplicationSupportsMultipleScenes + + UISceneConfigurations + + UIWindowSceneSessionRoleApplication + + + UILaunchStoryboardName + LaunchScreen + UISceneConfigurationName + Default Configuration + UISceneDelegateClassName + $(PRODUCT_MODULE_NAME).SceneDelegate + + + + + UILaunchStoryboardName + LaunchScreen + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/Examples/ComposingComplexInterfaces/StartingPoint/Landmarks/Landmarks/LandmarkDetail.swift b/Examples/ComposingComplexInterfaces/StartingPoint/Landmarks/Landmarks/LandmarkDetail.swift new file mode 100755 index 0000000..6c290a3 --- /dev/null +++ b/Examples/ComposingComplexInterfaces/StartingPoint/Landmarks/Landmarks/LandmarkDetail.swift @@ -0,0 +1,71 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +A view showing the details for a landmark. +*/ + +import SwiftUI + +struct LandmarkDetail: View { + @EnvironmentObject var userData: UserData + var landmark: Landmark + + var landmarkIndex: Int { + userData.landmarks.firstIndex(where: { $0.id == landmark.id })! + } + + var body: some View { + VStack { + MapView(coordinate: landmark.locationCoordinate) + .edgesIgnoringSafeArea(.top) + .frame(height: 300) + + CircleImage(image: landmark.image(forSize: 250)) + .offset(x: 0, y: -130) + .padding(.bottom, -130) + + VStack(alignment: .leading) { + HStack { + Text(verbatim: landmark.name) + .font(.title) + + Button(action: { + self.userData.landmarks[self.landmarkIndex] + .isFavorite.toggle() + }) { + if self.userData.landmarks[self.landmarkIndex] + .isFavorite { + Image(systemName: "star.fill") + .foregroundColor(Color.yellow) + } else { + Image(systemName: "star") + .foregroundColor(Color.gray) + } + } + } + + HStack(alignment: .top) { + Text(verbatim: landmark.park) + .font(.subheadline) + Spacer() + Text(verbatim: landmark.state) + .font(.subheadline) + } + } + .padding() + + Spacer() + } + } +} + +#if DEBUG +struct LandmarkDetail_Preview: PreviewProvider { + static var previews: some View { + let userData = UserData() + return LandmarkDetail(landmark: userData.landmarks[0]) + .environmentObject(userData) + } +} +#endif diff --git a/Examples/ComposingComplexInterfaces/StartingPoint/Landmarks/Landmarks/LandmarkList.swift b/Examples/ComposingComplexInterfaces/StartingPoint/Landmarks/Landmarks/LandmarkList.swift new file mode 100755 index 0000000..c17b5f3 --- /dev/null +++ b/Examples/ComposingComplexInterfaces/StartingPoint/Landmarks/Landmarks/LandmarkList.swift @@ -0,0 +1,45 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +A view showing a list of landmarks. +*/ + +import SwiftUI + +struct LandmarkList: View { + @EnvironmentObject private var userData: UserData + + var body: some View { + NavigationView { + List { + Toggle(isOn: $userData.showFavoritesOnly) { + Text("Show Favorites Only") + } + + ForEach(userData.landmarks) { landmark in + if !self.userData.showFavoritesOnly || landmark.isFavorite { + NavigationButton( + destination: LandmarkDetail(landmark: landmark)) { + LandmarkRow(landmark: landmark) + } + } + } + } + .navigationBarTitle(Text("Landmarks"), displayMode: .large) + } + } +} + +#if DEBUG +struct LandmarksList_Previews: PreviewProvider { + static var previews: some View { + ForEach(["iPhone SE", "iPhone XS Max"].identified(by: \.self)) { deviceName in + LandmarkList() + .previewDevice(PreviewDevice(rawValue: deviceName)) + .previewDisplayName(deviceName) + } + .environmentObject(UserData()) + } +} +#endif diff --git a/Examples/ComposingComplexInterfaces/StartingPoint/Landmarks/Landmarks/Models/Data.swift b/Examples/ComposingComplexInterfaces/StartingPoint/Landmarks/Landmarks/Models/Data.swift new file mode 100755 index 0000000..248d3b2 --- /dev/null +++ b/Examples/ComposingComplexInterfaces/StartingPoint/Landmarks/Landmarks/Models/Data.swift @@ -0,0 +1,95 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +Helpers for loading images and data. +*/ + +import Foundation +import CoreLocation +import UIKit +import SwiftUI + +let landmarkData: [Landmark] = load("landmarkData.json") +let hikeData: [Hike] = load("hikeData.json") + +func load(_ filename: String, as type: T.Type = T.self) -> T { + let data: Data + + guard let file = Bundle.main.url(forResource: filename, withExtension: nil) + else { + fatalError("Couldn't find \(filename) in main bundle.") + } + + do { + data = try Data(contentsOf: file) + } catch { + fatalError("Couldn't load \(filename) from main bundle:\n\(error)") + } + + do { + let decoder = JSONDecoder() + return try decoder.decode(T.self, from: data) + } catch { + fatalError("Couldn't parse \(filename) as \(T.self):\n\(error)") + } +} + +final class ImageStore { + fileprivate typealias _ImageDictionary = [String: [Int: CGImage]] + fileprivate var images: _ImageDictionary = [:] + + fileprivate static var originalSize = 250 + fileprivate static var scale = 2 + + static var shared = ImageStore() + + func image(name: String, size: Int) -> Image { + let index = _guaranteeInitialImage(name: name) + + let sizedImage = images.values[index][size] + ?? _sizeImage(images.values[index][ImageStore.originalSize]!, to: size * ImageStore.scale) + images.values[index][size] = sizedImage + + return Image(sizedImage, scale: Length(ImageStore.scale), label: Text(verbatim: name)) + } + + fileprivate func _guaranteeInitialImage(name: String) -> _ImageDictionary.Index { + if let index = images.index(forKey: name) { return index } + + guard + let url = Bundle.main.url(forResource: name, withExtension: "jpg"), + let imageSource = CGImageSourceCreateWithURL(url as NSURL, nil), + let image = CGImageSourceCreateImageAtIndex(imageSource, 0, nil) + else { + fatalError("Couldn't load image \(name).jpg from main bundle.") + } + + images[name] = [ImageStore.originalSize: image] + return images.index(forKey: name)! + } + + fileprivate func _sizeImage(_ image: CGImage, to size: Int) -> CGImage { + guard + let colorSpace = image.colorSpace, + let context = CGContext( + data: nil, + width: size, height: size, + bitsPerComponent: image.bitsPerComponent, + bytesPerRow: image.bytesPerRow, + space: colorSpace, + bitmapInfo: image.bitmapInfo.rawValue) + else { + fatalError("Couldn't create graphics context.") + } + context.interpolationQuality = .high + context.draw(image, in: CGRect(x: 0, y: 0, width: size, height: size)) + + if let sizedImage = context.makeImage() { + return sizedImage + } else { + fatalError("Couldn't resize image.") + } + } +} + diff --git a/Examples/ComposingComplexInterfaces/StartingPoint/Landmarks/Landmarks/Models/Hike.swift b/Examples/ComposingComplexInterfaces/StartingPoint/Landmarks/Landmarks/Models/Hike.swift new file mode 100755 index 0000000..dfd2bb8 --- /dev/null +++ b/Examples/ComposingComplexInterfaces/StartingPoint/Landmarks/Landmarks/Models/Hike.swift @@ -0,0 +1,31 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +The model for a hike. +*/ + +import SwiftUI + +struct Hike: Codable, Hashable, Identifiable { + var name: String + var id: Int + var distance: Double + var difficulty: Int + var observations: [Observation] + + static var formatter = LengthFormatter() + + var distanceText: String { + return Hike.formatter + .string(fromValue: distance, unit: .kilometer) + } + + struct Observation: Codable, Hashable { + var distanceFromStart: Double + + var elevation: Range + var pace: Range + var heartRate: Range + } +} diff --git a/Examples/ComposingComplexInterfaces/StartingPoint/Landmarks/Landmarks/Models/Landmark.swift b/Examples/ComposingComplexInterfaces/StartingPoint/Landmarks/Landmarks/Models/Landmark.swift new file mode 100755 index 0000000..4a7586d --- /dev/null +++ b/Examples/ComposingComplexInterfaces/StartingPoint/Landmarks/Landmarks/Models/Landmark.swift @@ -0,0 +1,43 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +The model for an individual landmark. +*/ + +import SwiftUI +import CoreLocation + +struct Landmark: Hashable, Codable, Identifiable { + var id: Int + var name: String + fileprivate var imageName: String + fileprivate var coordinates: Coordinates + var state: String + var park: String + var category: Category + var isFavorite: Bool + var isFeatured: Bool + + var locationCoordinate: CLLocationCoordinate2D { + CLLocationCoordinate2D( + latitude: coordinates.latitude, + longitude: coordinates.longitude) + } + + func image(forSize size: Int) -> Image { + ImageStore.shared.image(name: imageName, size: size) + } + + enum Category: String, CaseIterable, Codable, Hashable { + case featured = "Featured" + case lakes = "Lakes" + case rivers = "Rivers" + case mountains = "Mountains" + } +} + +struct Coordinates: Hashable, Codable { + var latitude: Double + var longitude: Double +} diff --git a/Examples/ComposingComplexInterfaces/StartingPoint/Landmarks/Landmarks/Models/UserData.swift b/Examples/ComposingComplexInterfaces/StartingPoint/Landmarks/Landmarks/Models/UserData.swift new file mode 100755 index 0000000..db31fb0 --- /dev/null +++ b/Examples/ComposingComplexInterfaces/StartingPoint/Landmarks/Landmarks/Models/UserData.swift @@ -0,0 +1,25 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +A model object that stores app data. +*/ + +import Combine +import SwiftUI + +final class UserData: BindableObject { + let didChange = PassthroughSubject() + + var showFavoritesOnly = false { + didSet { + didChange.send(self) + } + } + + var landmarks = landmarkData { + didSet { + didChange.send(self) + } + } +} diff --git a/Examples/ComposingComplexInterfaces/StartingPoint/Landmarks/Landmarks/Preview Content/Preview Assets.xcassets/Contents.json b/Examples/ComposingComplexInterfaces/StartingPoint/Landmarks/Landmarks/Preview Content/Preview Assets.xcassets/Contents.json new file mode 100755 index 0000000..da4a164 --- /dev/null +++ b/Examples/ComposingComplexInterfaces/StartingPoint/Landmarks/Landmarks/Preview Content/Preview Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Examples/ComposingComplexInterfaces/StartingPoint/Landmarks/Landmarks/Resources/charleyrivers.jpg b/Examples/ComposingComplexInterfaces/StartingPoint/Landmarks/Landmarks/Resources/charleyrivers.jpg new file mode 100755 index 0000000..17ff44b Binary files /dev/null and b/Examples/ComposingComplexInterfaces/StartingPoint/Landmarks/Landmarks/Resources/charleyrivers.jpg differ diff --git a/Examples/ComposingComplexInterfaces/StartingPoint/Landmarks/Landmarks/Resources/chilkoottrail.jpg b/Examples/ComposingComplexInterfaces/StartingPoint/Landmarks/Landmarks/Resources/chilkoottrail.jpg new file mode 100755 index 0000000..e7f805e Binary files /dev/null and b/Examples/ComposingComplexInterfaces/StartingPoint/Landmarks/Landmarks/Resources/chilkoottrail.jpg differ diff --git a/Examples/ComposingComplexInterfaces/StartingPoint/Landmarks/Landmarks/Resources/chincoteague.jpg b/Examples/ComposingComplexInterfaces/StartingPoint/Landmarks/Landmarks/Resources/chincoteague.jpg new file mode 100755 index 0000000..5f47986 Binary files /dev/null and b/Examples/ComposingComplexInterfaces/StartingPoint/Landmarks/Landmarks/Resources/chincoteague.jpg differ diff --git a/Examples/ComposingComplexInterfaces/StartingPoint/Landmarks/Landmarks/Resources/hiddenlake.jpg b/Examples/ComposingComplexInterfaces/StartingPoint/Landmarks/Landmarks/Resources/hiddenlake.jpg new file mode 100755 index 0000000..d8e804c Binary files /dev/null and b/Examples/ComposingComplexInterfaces/StartingPoint/Landmarks/Landmarks/Resources/hiddenlake.jpg differ diff --git a/Examples/ComposingComplexInterfaces/StartingPoint/Landmarks/Landmarks/Resources/hikeData.json b/Examples/ComposingComplexInterfaces/StartingPoint/Landmarks/Landmarks/Resources/hikeData.json new file mode 100755 index 0000000..3fb1e96 --- /dev/null +++ b/Examples/ComposingComplexInterfaces/StartingPoint/Landmarks/Landmarks/Resources/hikeData.json @@ -0,0 +1,1882 @@ +[ + { + "name":"Lonesome Ridge Trail", + "id":1001, + "distance":4.5, + "difficulty":3, + "observations":[ + { + "elevation":[ + 291.65263635636268, + 309.26016677925196 + ], + "pace":[ + 396.08716481908732, + 403.68937873525232 + ], + "heartRate":[ + 117.16351898665887, + 121.95815455919609 + ], + "distanceFromStart":0 + }, + { + "elevation":[ + 299.24001936628116, + 317.44584350790012 + ], + "pace":[ + 380.19020240756623, + 395.3978319010256 + ], + "heartRate":[ + 117.6410892152911, + 124.82185220506081 + ], + "distanceFromStart":0.375 + }, + { + "elevation":[ + 303.62145464574394, + 336.05569457646544 + ], + "pace":[ + 380.55927782266116, + 397.60789726832775 + ], + "heartRate":[ + 121.52696452049059, + 127.31525441110122 + ], + "distanceFromStart":0.75 + }, + { + "elevation":[ + 319.90393365162629, + 346.26966025518789 + ], + "pace":[ + 357.94116421258531, + 398.0750288648062 + ], + "heartRate":[ + 123.75908585923588, + 132.77069404486801 + ], + "distanceFromStart":1.125 + }, + { + "elevation":[ + 354.17104439267905, + 403.57031216972939 + ], + "pace":[ + 335.07385149392701, + 397.82674381875808 + ], + "heartRate":[ + 130.8235194572915, + 140.55700591418218 + ], + "distanceFromStart":1.5 + }, + { + "elevation":[ + 357.42992871175124, + 385.92155620623635 + ], + "pace":[ + 395.16168913839374, + 404.60294066527558 + ], + "heartRate":[ + 131.5456052446734, + 134.65984504627627 + ], + "distanceFromStart":1.875 + }, + { + "elevation":[ + 345.47736721935661, + 363.18776661379422 + ], + "pace":[ + 340.82303041339082, + 404.71689228682374 + ], + "heartRate":[ + 125.1949698433959, + 131.31354363122026 + ], + "distanceFromStart":2.25 + }, + { + "elevation":[ + 346.23343025200535, + 497.23376445462401 + ], + "pace":[ + 261.27629148816021, + 331.68516208719467 + ], + "heartRate":[ + 131.67810544238606, + 154.26779645311458 + ], + "distanceFromStart":2.625 + }, + { + "elevation":[ + 491.57378483134391, + 547.49535224251053 + ], + "pace":[ + 296.05298644112088, + 401.14092967732398 + ], + "heartRate":[ + 151.36398089694217, + 166.20454793289232 + ], + "distanceFromStart":3 + }, + { + "elevation":[ + 472.06803233416338, + 531.92570520228401 + ], + "pace":[ + 395.50830663514012, + 401.67837917543591 + ], + "heartRate":[ + 134.41798110234078, + 151.90886697564241 + ], + "distanceFromStart":3.375 + }, + { + "elevation":[ + 339.81419476005283, + 461.03832527824829 + ], + "pace":[ + 395.31160487975183, + 404.49550455974907 + ], + "heartRate":[ + 129.97753472415462, + 138.13531094848992 + ], + "distanceFromStart":3.75 + }, + { + "elevation":[ + 303.1495508565697, + 342.3532820173541 + ], + "pace":[ + 395.02844559698116, + 402.65878340653796 + ], + "heartRate":[ + 127.72304232462609, + 133.26322270764186 + ], + "distanceFromStart":4.125 + } + ] + }, + { + "name":"Lonesome Ridge Trail", + "id":1002, + "distance":4.5, + "difficulty":3, + "observations":[ + { + "elevation":[ + 291.65263635636268, + 309.26016677925196 + ], + "pace":[ + 396.08716481908732, + 403.68937873525232 + ], + "heartRate":[ + 117.16351898665887, + 121.95815455919609 + ], + "distanceFromStart":0 + }, + { + "elevation":[ + 299.24001936628116, + 317.44584350790012 + ], + "pace":[ + 380.19020240756623, + 395.3978319010256 + ], + "heartRate":[ + 117.6410892152911, + 124.82185220506081 + ], + "distanceFromStart":0.375 + }, + { + "elevation":[ + 303.62145464574394, + 336.05569457646544 + ], + "pace":[ + 380.55927782266116, + 397.60789726832775 + ], + "heartRate":[ + 121.52696452049059, + 127.31525441110122 + ], + "distanceFromStart":0.75 + }, + { + "elevation":[ + 319.90393365162629, + 346.26966025518789 + ], + "pace":[ + 357.94116421258531, + 398.0750288648062 + ], + "heartRate":[ + 123.75908585923588, + 132.77069404486801 + ], + "distanceFromStart":1.125 + }, + { + "elevation":[ + 354.17104439267905, + 403.57031216972939 + ], + "pace":[ + 335.07385149392701, + 397.82674381875808 + ], + "heartRate":[ + 130.8235194572915, + 140.55700591418218 + ], + "distanceFromStart":1.5 + }, + { + "elevation":[ + 357.42992871175124, + 385.92155620623635 + ], + "pace":[ + 395.16168913839374, + 404.60294066527558 + ], + "heartRate":[ + 131.5456052446734, + 134.65984504627627 + ], + "distanceFromStart":1.875 + }, + { + "elevation":[ + 345.47736721935661, + 363.18776661379422 + ], + "pace":[ + 340.82303041339082, + 404.71689228682374 + ], + "heartRate":[ + 125.1949698433959, + 131.31354363122026 + ], + "distanceFromStart":2.25 + }, + { + "elevation":[ + 346.23343025200535, + 497.23376445462401 + ], + "pace":[ + 261.27629148816021, + 331.68516208719467 + ], + "heartRate":[ + 131.67810544238606, + 154.26779645311458 + ], + "distanceFromStart":2.625 + }, + { + "elevation":[ + 491.57378483134391, + 547.49535224251053 + ], + "pace":[ + 296.05298644112088, + 401.14092967732398 + ], + "heartRate":[ + 151.36398089694217, + 166.20454793289232 + ], + "distanceFromStart":3 + }, + { + "elevation":[ + 472.06803233416338, + 531.92570520228401 + ], + "pace":[ + 395.50830663514012, + 401.67837917543591 + ], + "heartRate":[ + 134.41798110234078, + 151.90886697564241 + ], + "distanceFromStart":3.375 + }, + { + "elevation":[ + 339.81419476005283, + 461.03832527824829 + ], + "pace":[ + 395.31160487975183, + 404.49550455974907 + ], + "heartRate":[ + 129.97753472415462, + 138.13531094848992 + ], + "distanceFromStart":3.75 + }, + { + "elevation":[ + 303.1495508565697, + 342.3532820173541 + ], + "pace":[ + 395.02844559698116, + 402.65878340653796 + ], + "heartRate":[ + 127.72304232462609, + 133.26322270764186 + ], + "distanceFromStart":4.125 + } + ] + }, + { + "name":"Lonesome Ridge Trail", + "id":1003, + "distance":4.5, + "difficulty":3, + "observations":[ + { + "elevation":[ + 291.65263635636268, + 309.26016677925196 + ], + "pace":[ + 396.08716481908732, + 403.68937873525232 + ], + "heartRate":[ + 117.16351898665887, + 121.95815455919609 + ], + "distanceFromStart":0 + }, + { + "elevation":[ + 299.24001936628116, + 317.44584350790012 + ], + "pace":[ + 380.19020240756623, + 395.3978319010256 + ], + "heartRate":[ + 117.6410892152911, + 124.82185220506081 + ], + "distanceFromStart":0.375 + }, + { + "elevation":[ + 303.62145464574394, + 336.05569457646544 + ], + "pace":[ + 380.55927782266116, + 397.60789726832775 + ], + "heartRate":[ + 121.52696452049059, + 127.31525441110122 + ], + "distanceFromStart":0.75 + }, + { + "elevation":[ + 319.90393365162629, + 346.26966025518789 + ], + "pace":[ + 357.94116421258531, + 398.0750288648062 + ], + "heartRate":[ + 123.75908585923588, + 132.77069404486801 + ], + "distanceFromStart":1.125 + }, + { + "elevation":[ + 354.17104439267905, + 403.57031216972939 + ], + "pace":[ + 335.07385149392701, + 397.82674381875808 + ], + "heartRate":[ + 130.8235194572915, + 140.55700591418218 + ], + "distanceFromStart":1.5 + }, + { + "elevation":[ + 357.42992871175124, + 385.92155620623635 + ], + "pace":[ + 395.16168913839374, + 404.60294066527558 + ], + "heartRate":[ + 131.5456052446734, + 134.65984504627627 + ], + "distanceFromStart":1.875 + }, + { + "elevation":[ + 345.47736721935661, + 363.18776661379422 + ], + "pace":[ + 340.82303041339082, + 404.71689228682374 + ], + "heartRate":[ + 125.1949698433959, + 131.31354363122026 + ], + "distanceFromStart":2.25 + }, + { + "elevation":[ + 346.23343025200535, + 497.23376445462401 + ], + "pace":[ + 261.27629148816021, + 331.68516208719467 + ], + "heartRate":[ + 131.67810544238606, + 154.26779645311458 + ], + "distanceFromStart":2.625 + }, + { + "elevation":[ + 491.57378483134391, + 547.49535224251053 + ], + "pace":[ + 296.05298644112088, + 401.14092967732398 + ], + "heartRate":[ + 151.36398089694217, + 166.20454793289232 + ], + "distanceFromStart":3 + }, + { + "elevation":[ + 472.06803233416338, + 531.92570520228401 + ], + "pace":[ + 395.50830663514012, + 401.67837917543591 + ], + "heartRate":[ + 134.41798110234078, + 151.90886697564241 + ], + "distanceFromStart":3.375 + }, + { + "elevation":[ + 339.81419476005283, + 461.03832527824829 + ], + "pace":[ + 395.31160487975183, + 404.49550455974907 + ], + "heartRate":[ + 129.97753472415462, + 138.13531094848992 + ], + "distanceFromStart":3.75 + }, + { + "elevation":[ + 303.1495508565697, + 342.3532820173541 + ], + "pace":[ + 395.02844559698116, + 402.65878340653796 + ], + "heartRate":[ + 127.72304232462609, + 133.26322270764186 + ], + "distanceFromStart":4.125 + } + ] + }, + { + "name":"Lonesome Ridge Trail", + "id":1004, + "distance":4.5, + "difficulty":3, + "observations":[ + { + "elevation":[ + 291.65263635636268, + 309.26016677925196 + ], + "pace":[ + 396.08716481908732, + 403.68937873525232 + ], + "heartRate":[ + 117.16351898665887, + 121.95815455919609 + ], + "distanceFromStart":0 + }, + { + "elevation":[ + 299.24001936628116, + 317.44584350790012 + ], + "pace":[ + 380.19020240756623, + 395.3978319010256 + ], + "heartRate":[ + 117.6410892152911, + 124.82185220506081 + ], + "distanceFromStart":0.375 + }, + { + "elevation":[ + 303.62145464574394, + 336.05569457646544 + ], + "pace":[ + 380.55927782266116, + 397.60789726832775 + ], + "heartRate":[ + 121.52696452049059, + 127.31525441110122 + ], + "distanceFromStart":0.75 + }, + { + "elevation":[ + 319.90393365162629, + 346.26966025518789 + ], + "pace":[ + 357.94116421258531, + 398.0750288648062 + ], + "heartRate":[ + 123.75908585923588, + 132.77069404486801 + ], + "distanceFromStart":1.125 + }, + { + "elevation":[ + 354.17104439267905, + 403.57031216972939 + ], + "pace":[ + 335.07385149392701, + 397.82674381875808 + ], + "heartRate":[ + 130.8235194572915, + 140.55700591418218 + ], + "distanceFromStart":1.5 + }, + { + "elevation":[ + 357.42992871175124, + 385.92155620623635 + ], + "pace":[ + 395.16168913839374, + 404.60294066527558 + ], + "heartRate":[ + 131.5456052446734, + 134.65984504627627 + ], + "distanceFromStart":1.875 + }, + { + "elevation":[ + 345.47736721935661, + 363.18776661379422 + ], + "pace":[ + 340.82303041339082, + 404.71689228682374 + ], + "heartRate":[ + 125.1949698433959, + 131.31354363122026 + ], + "distanceFromStart":2.25 + }, + { + "elevation":[ + 346.23343025200535, + 497.23376445462401 + ], + "pace":[ + 261.27629148816021, + 331.68516208719467 + ], + "heartRate":[ + 131.67810544238606, + 154.26779645311458 + ], + "distanceFromStart":2.625 + }, + { + "elevation":[ + 491.57378483134391, + 547.49535224251053 + ], + "pace":[ + 296.05298644112088, + 401.14092967732398 + ], + "heartRate":[ + 151.36398089694217, + 166.20454793289232 + ], + "distanceFromStart":3 + }, + { + "elevation":[ + 472.06803233416338, + 531.92570520228401 + ], + "pace":[ + 395.50830663514012, + 401.67837917543591 + ], + "heartRate":[ + 134.41798110234078, + 151.90886697564241 + ], + "distanceFromStart":3.375 + }, + { + "elevation":[ + 339.81419476005283, + 461.03832527824829 + ], + "pace":[ + 395.31160487975183, + 404.49550455974907 + ], + "heartRate":[ + 129.97753472415462, + 138.13531094848992 + ], + "distanceFromStart":3.75 + }, + { + "elevation":[ + 303.1495508565697, + 342.3532820173541 + ], + "pace":[ + 395.02844559698116, + 402.65878340653796 + ], + "heartRate":[ + 127.72304232462609, + 133.26322270764186 + ], + "distanceFromStart":4.125 + } + ] + }, + { + "name":"Lonesome Ridge Trail", + "id":1005, + "distance":4.5, + "difficulty":3, + "observations":[ + { + "elevation":[ + 291.65263635636268, + 309.26016677925196 + ], + "pace":[ + 396.08716481908732, + 403.68937873525232 + ], + "heartRate":[ + 117.16351898665887, + 121.95815455919609 + ], + "distanceFromStart":0 + }, + { + "elevation":[ + 299.24001936628116, + 317.44584350790012 + ], + "pace":[ + 380.19020240756623, + 395.3978319010256 + ], + "heartRate":[ + 117.6410892152911, + 124.82185220506081 + ], + "distanceFromStart":0.375 + }, + { + "elevation":[ + 303.62145464574394, + 336.05569457646544 + ], + "pace":[ + 380.55927782266116, + 397.60789726832775 + ], + "heartRate":[ + 121.52696452049059, + 127.31525441110122 + ], + "distanceFromStart":0.75 + }, + { + "elevation":[ + 319.90393365162629, + 346.26966025518789 + ], + "pace":[ + 357.94116421258531, + 398.0750288648062 + ], + "heartRate":[ + 123.75908585923588, + 132.77069404486801 + ], + "distanceFromStart":1.125 + }, + { + "elevation":[ + 354.17104439267905, + 403.57031216972939 + ], + "pace":[ + 335.07385149392701, + 397.82674381875808 + ], + "heartRate":[ + 130.8235194572915, + 140.55700591418218 + ], + "distanceFromStart":1.5 + }, + { + "elevation":[ + 357.42992871175124, + 385.92155620623635 + ], + "pace":[ + 395.16168913839374, + 404.60294066527558 + ], + "heartRate":[ + 131.5456052446734, + 134.65984504627627 + ], + "distanceFromStart":1.875 + }, + { + "elevation":[ + 345.47736721935661, + 363.18776661379422 + ], + "pace":[ + 340.82303041339082, + 404.71689228682374 + ], + "heartRate":[ + 125.1949698433959, + 131.31354363122026 + ], + "distanceFromStart":2.25 + }, + { + "elevation":[ + 346.23343025200535, + 497.23376445462401 + ], + "pace":[ + 261.27629148816021, + 331.68516208719467 + ], + "heartRate":[ + 131.67810544238606, + 154.26779645311458 + ], + "distanceFromStart":2.625 + }, + { + "elevation":[ + 491.57378483134391, + 547.49535224251053 + ], + "pace":[ + 296.05298644112088, + 401.14092967732398 + ], + "heartRate":[ + 151.36398089694217, + 166.20454793289232 + ], + "distanceFromStart":3 + }, + { + "elevation":[ + 472.06803233416338, + 531.92570520228401 + ], + "pace":[ + 395.50830663514012, + 401.67837917543591 + ], + "heartRate":[ + 134.41798110234078, + 151.90886697564241 + ], + "distanceFromStart":3.375 + }, + { + "elevation":[ + 339.81419476005283, + 461.03832527824829 + ], + "pace":[ + 395.31160487975183, + 404.49550455974907 + ], + "heartRate":[ + 129.97753472415462, + 138.13531094848992 + ], + "distanceFromStart":3.75 + }, + { + "elevation":[ + 303.1495508565697, + 342.3532820173541 + ], + "pace":[ + 395.02844559698116, + 402.65878340653796 + ], + "heartRate":[ + 127.72304232462609, + 133.26322270764186 + ], + "distanceFromStart":4.125 + } + ] + }, + { + "name":"Lonesome Ridge Trail", + "id":1006, + "distance":4.5, + "difficulty":3, + "observations":[ + { + "elevation":[ + 291.65263635636268, + 309.26016677925196 + ], + "pace":[ + 396.08716481908732, + 403.68937873525232 + ], + "heartRate":[ + 117.16351898665887, + 121.95815455919609 + ], + "distanceFromStart":0 + }, + { + "elevation":[ + 299.24001936628116, + 317.44584350790012 + ], + "pace":[ + 380.19020240756623, + 395.3978319010256 + ], + "heartRate":[ + 117.6410892152911, + 124.82185220506081 + ], + "distanceFromStart":0.375 + }, + { + "elevation":[ + 303.62145464574394, + 336.05569457646544 + ], + "pace":[ + 380.55927782266116, + 397.60789726832775 + ], + "heartRate":[ + 121.52696452049059, + 127.31525441110122 + ], + "distanceFromStart":0.75 + }, + { + "elevation":[ + 319.90393365162629, + 346.26966025518789 + ], + "pace":[ + 357.94116421258531, + 398.0750288648062 + ], + "heartRate":[ + 123.75908585923588, + 132.77069404486801 + ], + "distanceFromStart":1.125 + }, + { + "elevation":[ + 354.17104439267905, + 403.57031216972939 + ], + "pace":[ + 335.07385149392701, + 397.82674381875808 + ], + "heartRate":[ + 130.8235194572915, + 140.55700591418218 + ], + "distanceFromStart":1.5 + }, + { + "elevation":[ + 357.42992871175124, + 385.92155620623635 + ], + "pace":[ + 395.16168913839374, + 404.60294066527558 + ], + "heartRate":[ + 131.5456052446734, + 134.65984504627627 + ], + "distanceFromStart":1.875 + }, + { + "elevation":[ + 345.47736721935661, + 363.18776661379422 + ], + "pace":[ + 340.82303041339082, + 404.71689228682374 + ], + "heartRate":[ + 125.1949698433959, + 131.31354363122026 + ], + "distanceFromStart":2.25 + }, + { + "elevation":[ + 346.23343025200535, + 497.23376445462401 + ], + "pace":[ + 261.27629148816021, + 331.68516208719467 + ], + "heartRate":[ + 131.67810544238606, + 154.26779645311458 + ], + "distanceFromStart":2.625 + }, + { + "elevation":[ + 491.57378483134391, + 547.49535224251053 + ], + "pace":[ + 296.05298644112088, + 401.14092967732398 + ], + "heartRate":[ + 151.36398089694217, + 166.20454793289232 + ], + "distanceFromStart":3 + }, + { + "elevation":[ + 472.06803233416338, + 531.92570520228401 + ], + "pace":[ + 395.50830663514012, + 401.67837917543591 + ], + "heartRate":[ + 134.41798110234078, + 151.90886697564241 + ], + "distanceFromStart":3.375 + }, + { + "elevation":[ + 339.81419476005283, + 461.03832527824829 + ], + "pace":[ + 395.31160487975183, + 404.49550455974907 + ], + "heartRate":[ + 129.97753472415462, + 138.13531094848992 + ], + "distanceFromStart":3.75 + }, + { + "elevation":[ + 303.1495508565697, + 342.3532820173541 + ], + "pace":[ + 395.02844559698116, + 402.65878340653796 + ], + "heartRate":[ + 127.72304232462609, + 133.26322270764186 + ], + "distanceFromStart":4.125 + } + ] + }, + { + "name":"Lonesome Ridge Trail", + "id":1007, + "distance":4.5, + "difficulty":3, + "observations":[ + { + "elevation":[ + 291.65263635636268, + 309.26016677925196 + ], + "pace":[ + 396.08716481908732, + 403.68937873525232 + ], + "heartRate":[ + 117.16351898665887, + 121.95815455919609 + ], + "distanceFromStart":0 + }, + { + "elevation":[ + 299.24001936628116, + 317.44584350790012 + ], + "pace":[ + 380.19020240756623, + 395.3978319010256 + ], + "heartRate":[ + 117.6410892152911, + 124.82185220506081 + ], + "distanceFromStart":0.375 + }, + { + "elevation":[ + 303.62145464574394, + 336.05569457646544 + ], + "pace":[ + 380.55927782266116, + 397.60789726832775 + ], + "heartRate":[ + 121.52696452049059, + 127.31525441110122 + ], + "distanceFromStart":0.75 + }, + { + "elevation":[ + 319.90393365162629, + 346.26966025518789 + ], + "pace":[ + 357.94116421258531, + 398.0750288648062 + ], + "heartRate":[ + 123.75908585923588, + 132.77069404486801 + ], + "distanceFromStart":1.125 + }, + { + "elevation":[ + 354.17104439267905, + 403.57031216972939 + ], + "pace":[ + 335.07385149392701, + 397.82674381875808 + ], + "heartRate":[ + 130.8235194572915, + 140.55700591418218 + ], + "distanceFromStart":1.5 + }, + { + "elevation":[ + 357.42992871175124, + 385.92155620623635 + ], + "pace":[ + 395.16168913839374, + 404.60294066527558 + ], + "heartRate":[ + 131.5456052446734, + 134.65984504627627 + ], + "distanceFromStart":1.875 + }, + { + "elevation":[ + 345.47736721935661, + 363.18776661379422 + ], + "pace":[ + 340.82303041339082, + 404.71689228682374 + ], + "heartRate":[ + 125.1949698433959, + 131.31354363122026 + ], + "distanceFromStart":2.25 + }, + { + "elevation":[ + 346.23343025200535, + 497.23376445462401 + ], + "pace":[ + 261.27629148816021, + 331.68516208719467 + ], + "heartRate":[ + 131.67810544238606, + 154.26779645311458 + ], + "distanceFromStart":2.625 + }, + { + "elevation":[ + 491.57378483134391, + 547.49535224251053 + ], + "pace":[ + 296.05298644112088, + 401.14092967732398 + ], + "heartRate":[ + 151.36398089694217, + 166.20454793289232 + ], + "distanceFromStart":3 + }, + { + "elevation":[ + 472.06803233416338, + 531.92570520228401 + ], + "pace":[ + 395.50830663514012, + 401.67837917543591 + ], + "heartRate":[ + 134.41798110234078, + 151.90886697564241 + ], + "distanceFromStart":3.375 + }, + { + "elevation":[ + 339.81419476005283, + 461.03832527824829 + ], + "pace":[ + 395.31160487975183, + 404.49550455974907 + ], + "heartRate":[ + 129.97753472415462, + 138.13531094848992 + ], + "distanceFromStart":3.75 + }, + { + "elevation":[ + 303.1495508565697, + 342.3532820173541 + ], + "pace":[ + 395.02844559698116, + 402.65878340653796 + ], + "heartRate":[ + 127.72304232462609, + 133.26322270764186 + ], + "distanceFromStart":4.125 + } + ] + }, + { + "name":"Lonesome Ridge Trail", + "id":1008, + "distance":4.5, + "difficulty":3, + "observations":[ + { + "elevation":[ + 291.65263635636268, + 309.26016677925196 + ], + "pace":[ + 396.08716481908732, + 403.68937873525232 + ], + "heartRate":[ + 117.16351898665887, + 121.95815455919609 + ], + "distanceFromStart":0 + }, + { + "elevation":[ + 299.24001936628116, + 317.44584350790012 + ], + "pace":[ + 380.19020240756623, + 395.3978319010256 + ], + "heartRate":[ + 117.6410892152911, + 124.82185220506081 + ], + "distanceFromStart":0.375 + }, + { + "elevation":[ + 303.62145464574394, + 336.05569457646544 + ], + "pace":[ + 380.55927782266116, + 397.60789726832775 + ], + "heartRate":[ + 121.52696452049059, + 127.31525441110122 + ], + "distanceFromStart":0.75 + }, + { + "elevation":[ + 319.90393365162629, + 346.26966025518789 + ], + "pace":[ + 357.94116421258531, + 398.0750288648062 + ], + "heartRate":[ + 123.75908585923588, + 132.77069404486801 + ], + "distanceFromStart":1.125 + }, + { + "elevation":[ + 354.17104439267905, + 403.57031216972939 + ], + "pace":[ + 335.07385149392701, + 397.82674381875808 + ], + "heartRate":[ + 130.8235194572915, + 140.55700591418218 + ], + "distanceFromStart":1.5 + }, + { + "elevation":[ + 357.42992871175124, + 385.92155620623635 + ], + "pace":[ + 395.16168913839374, + 404.60294066527558 + ], + "heartRate":[ + 131.5456052446734, + 134.65984504627627 + ], + "distanceFromStart":1.875 + }, + { + "elevation":[ + 345.47736721935661, + 363.18776661379422 + ], + "pace":[ + 340.82303041339082, + 404.71689228682374 + ], + "heartRate":[ + 125.1949698433959, + 131.31354363122026 + ], + "distanceFromStart":2.25 + }, + { + "elevation":[ + 346.23343025200535, + 497.23376445462401 + ], + "pace":[ + 261.27629148816021, + 331.68516208719467 + ], + "heartRate":[ + 131.67810544238606, + 154.26779645311458 + ], + "distanceFromStart":2.625 + }, + { + "elevation":[ + 491.57378483134391, + 547.49535224251053 + ], + "pace":[ + 296.05298644112088, + 401.14092967732398 + ], + "heartRate":[ + 151.36398089694217, + 166.20454793289232 + ], + "distanceFromStart":3 + }, + { + "elevation":[ + 472.06803233416338, + 531.92570520228401 + ], + "pace":[ + 395.50830663514012, + 401.67837917543591 + ], + "heartRate":[ + 134.41798110234078, + 151.90886697564241 + ], + "distanceFromStart":3.375 + }, + { + "elevation":[ + 339.81419476005283, + 461.03832527824829 + ], + "pace":[ + 395.31160487975183, + 404.49550455974907 + ], + "heartRate":[ + 129.97753472415462, + 138.13531094848992 + ], + "distanceFromStart":3.75 + }, + { + "elevation":[ + 303.1495508565697, + 342.3532820173541 + ], + "pace":[ + 395.02844559698116, + 402.65878340653796 + ], + "heartRate":[ + 127.72304232462609, + 133.26322270764186 + ], + "distanceFromStart":4.125 + } + ] + }, + { + "name":"Lonesome Ridge Trail", + "id":1009, + "distance":4.5, + "difficulty":3, + "observations":[ + { + "elevation":[ + 291.65263635636268, + 309.26016677925196 + ], + "pace":[ + 396.08716481908732, + 403.68937873525232 + ], + "heartRate":[ + 117.16351898665887, + 121.95815455919609 + ], + "distanceFromStart":0 + }, + { + "elevation":[ + 299.24001936628116, + 317.44584350790012 + ], + "pace":[ + 380.19020240756623, + 395.3978319010256 + ], + "heartRate":[ + 117.6410892152911, + 124.82185220506081 + ], + "distanceFromStart":0.375 + }, + { + "elevation":[ + 303.62145464574394, + 336.05569457646544 + ], + "pace":[ + 380.55927782266116, + 397.60789726832775 + ], + "heartRate":[ + 121.52696452049059, + 127.31525441110122 + ], + "distanceFromStart":0.75 + }, + { + "elevation":[ + 319.90393365162629, + 346.26966025518789 + ], + "pace":[ + 357.94116421258531, + 398.0750288648062 + ], + "heartRate":[ + 123.75908585923588, + 132.77069404486801 + ], + "distanceFromStart":1.125 + }, + { + "elevation":[ + 354.17104439267905, + 403.57031216972939 + ], + "pace":[ + 335.07385149392701, + 397.82674381875808 + ], + "heartRate":[ + 130.8235194572915, + 140.55700591418218 + ], + "distanceFromStart":1.5 + }, + { + "elevation":[ + 357.42992871175124, + 385.92155620623635 + ], + "pace":[ + 395.16168913839374, + 404.60294066527558 + ], + "heartRate":[ + 131.5456052446734, + 134.65984504627627 + ], + "distanceFromStart":1.875 + }, + { + "elevation":[ + 345.47736721935661, + 363.18776661379422 + ], + "pace":[ + 340.82303041339082, + 404.71689228682374 + ], + "heartRate":[ + 125.1949698433959, + 131.31354363122026 + ], + "distanceFromStart":2.25 + }, + { + "elevation":[ + 346.23343025200535, + 497.23376445462401 + ], + "pace":[ + 261.27629148816021, + 331.68516208719467 + ], + "heartRate":[ + 131.67810544238606, + 154.26779645311458 + ], + "distanceFromStart":2.625 + }, + { + "elevation":[ + 491.57378483134391, + 547.49535224251053 + ], + "pace":[ + 296.05298644112088, + 401.14092967732398 + ], + "heartRate":[ + 151.36398089694217, + 166.20454793289232 + ], + "distanceFromStart":3 + }, + { + "elevation":[ + 472.06803233416338, + 531.92570520228401 + ], + "pace":[ + 395.50830663514012, + 401.67837917543591 + ], + "heartRate":[ + 134.41798110234078, + 151.90886697564241 + ], + "distanceFromStart":3.375 + }, + { + "elevation":[ + 339.81419476005283, + 461.03832527824829 + ], + "pace":[ + 395.31160487975183, + 404.49550455974907 + ], + "heartRate":[ + 129.97753472415462, + 138.13531094848992 + ], + "distanceFromStart":3.75 + }, + { + "elevation":[ + 303.1495508565697, + 342.3532820173541 + ], + "pace":[ + 395.02844559698116, + 402.65878340653796 + ], + "heartRate":[ + 127.72304232462609, + 133.26322270764186 + ], + "distanceFromStart":4.125 + } + ] + }, + { + "name":"Lonesome Ridge Trail", + "id":1010, + "distance":4.5, + "difficulty":3, + "observations":[ + { + "elevation":[ + 291.65263635636268, + 309.26016677925196 + ], + "pace":[ + 396.08716481908732, + 403.68937873525232 + ], + "heartRate":[ + 117.16351898665887, + 121.95815455919609 + ], + "distanceFromStart":0 + }, + { + "elevation":[ + 299.24001936628116, + 317.44584350790012 + ], + "pace":[ + 380.19020240756623, + 395.3978319010256 + ], + "heartRate":[ + 117.6410892152911, + 124.82185220506081 + ], + "distanceFromStart":0.375 + }, + { + "elevation":[ + 303.62145464574394, + 336.05569457646544 + ], + "pace":[ + 380.55927782266116, + 397.60789726832775 + ], + "heartRate":[ + 121.52696452049059, + 127.31525441110122 + ], + "distanceFromStart":0.75 + }, + { + "elevation":[ + 319.90393365162629, + 346.26966025518789 + ], + "pace":[ + 357.94116421258531, + 398.0750288648062 + ], + "heartRate":[ + 123.75908585923588, + 132.77069404486801 + ], + "distanceFromStart":1.125 + }, + { + "elevation":[ + 354.17104439267905, + 403.57031216972939 + ], + "pace":[ + 335.07385149392701, + 397.82674381875808 + ], + "heartRate":[ + 130.8235194572915, + 140.55700591418218 + ], + "distanceFromStart":1.5 + }, + { + "elevation":[ + 357.42992871175124, + 385.92155620623635 + ], + "pace":[ + 395.16168913839374, + 404.60294066527558 + ], + "heartRate":[ + 131.5456052446734, + 134.65984504627627 + ], + "distanceFromStart":1.875 + }, + { + "elevation":[ + 345.47736721935661, + 363.18776661379422 + ], + "pace":[ + 340.82303041339082, + 404.71689228682374 + ], + "heartRate":[ + 125.1949698433959, + 131.31354363122026 + ], + "distanceFromStart":2.25 + }, + { + "elevation":[ + 346.23343025200535, + 497.23376445462401 + ], + "pace":[ + 261.27629148816021, + 331.68516208719467 + ], + "heartRate":[ + 131.67810544238606, + 154.26779645311458 + ], + "distanceFromStart":2.625 + }, + { + "elevation":[ + 491.57378483134391, + 547.49535224251053 + ], + "pace":[ + 296.05298644112088, + 401.14092967732398 + ], + "heartRate":[ + 151.36398089694217, + 166.20454793289232 + ], + "distanceFromStart":3 + }, + { + "elevation":[ + 472.06803233416338, + 531.92570520228401 + ], + "pace":[ + 395.50830663514012, + 401.67837917543591 + ], + "heartRate":[ + 134.41798110234078, + 151.90886697564241 + ], + "distanceFromStart":3.375 + }, + { + "elevation":[ + 339.81419476005283, + 461.03832527824829 + ], + "pace":[ + 395.31160487975183, + 404.49550455974907 + ], + "heartRate":[ + 129.97753472415462, + 138.13531094848992 + ], + "distanceFromStart":3.75 + }, + { + "elevation":[ + 303.1495508565697, + 342.3532820173541 + ], + "pace":[ + 395.02844559698116, + 402.65878340653796 + ], + "heartRate":[ + 127.72304232462609, + 133.26322270764186 + ], + "distanceFromStart":4.125 + } + ] + } +] diff --git a/Examples/ComposingComplexInterfaces/StartingPoint/Landmarks/Landmarks/Resources/icybay.jpg b/Examples/ComposingComplexInterfaces/StartingPoint/Landmarks/Landmarks/Resources/icybay.jpg new file mode 100755 index 0000000..feb1764 Binary files /dev/null and b/Examples/ComposingComplexInterfaces/StartingPoint/Landmarks/Landmarks/Resources/icybay.jpg differ diff --git a/Examples/ComposingComplexInterfaces/StartingPoint/Landmarks/Landmarks/Resources/lakemcdonald.jpg b/Examples/ComposingComplexInterfaces/StartingPoint/Landmarks/Landmarks/Resources/lakemcdonald.jpg new file mode 100755 index 0000000..bd9d6b9 Binary files /dev/null and b/Examples/ComposingComplexInterfaces/StartingPoint/Landmarks/Landmarks/Resources/lakemcdonald.jpg differ diff --git a/Examples/ComposingComplexInterfaces/StartingPoint/Landmarks/Landmarks/Resources/landmarkData.json b/Examples/ComposingComplexInterfaces/StartingPoint/Landmarks/Landmarks/Resources/landmarkData.json new file mode 100755 index 0000000..e5b14fc --- /dev/null +++ b/Examples/ComposingComplexInterfaces/StartingPoint/Landmarks/Landmarks/Resources/landmarkData.json @@ -0,0 +1,182 @@ +[ + { + "name": "Turtle Rock", + "category": "Rivers", + "city": "Twentynine Palms", + "state": "California", + "id": 1001, + "isFeatured": true, + "isFavorite": true, + "park": "Joshua Tree National Park", + "coordinates": { + "longitude": -116.166868, + "latitude": 34.011286 + }, + "imageName": "turtlerock" + }, + { + "name": "Silver Salmon Creek", + "category": "Lakes", + "city": "Port Alsworth", + "state": "Alaska", + "id": 1002, + "isFeatured": false, + "isFavorite": false, + "park": "Lake Clark National Park and Preserve", + "coordinates": { + "longitude": -152.665167, + "latitude": 59.980167 + }, + "imageName": "silversalmoncreek" + }, + { + "name": "Chilkoot Trail", + "category": "Mountains", + "city": "Skagway", + "state": "Alaska", + "id": 1003, + "isFeatured": false, + "isFavorite": true, + "park": "Klondike Gold Rush National Historical Park", + "coordinates": { + "longitude": -135.334571, + "latitude": 59.560551 + }, + "imageName": "chilkoottrail" + }, + { + "name": "St. Mary Lake", + "category": "Lakes", + "city": "Browning", + "state": "Montana", + "id": 1004, + "isFeatured": true, + "isFavorite": true, + "park": "Glacier National Park", + "coordinates": { + "longitude": -113.536248, + "latitude": 48.69423 + }, + "imageName": "stmarylake" + }, + { + "name": "Twin Lake", + "category": "Lakes", + "city": "Twin Lakes", + "state": "Alaska", + "id": 1005, + "isFeatured": false, + "isFavorite": false, + "park": "Lake Clark National Park and Preserve", + "coordinates": { + "longitude": -153.849883, + "latitude": 60.641684 + }, + "imageName": "twinlake" + }, + { + "name": "Lake McDonald", + "category": "Mountains", + "city": "West Glacier", + "state": "Montana", + "id": 1006, + "isFeatured": false, + "isFavorite": false, + "park": "Glacier National Park", + "coordinates": { + "longitude": -113.934831, + "latitude": 48.56002 + }, + "imageName": "lakemcdonald" + }, + { + "name": "Charley Rivers", + "category": "Rivers", + "city": "Eaking", + "state": "Alaska", + "id": 1007, + "isFeatured": true, + "isFavorite": false, + "park": "Charley Rivers National Preserve", + "coordinates": { + "longitude": -143.122586, + "latitude": 65.350021 + }, + "imageName": "charleyrivers", + }, + { + "name": "Icy Bay", + "category": "Mountains", + "city": "Icy Bay", + "state": "Alaska", + "id": 1008, + "isFeatured": false, + "isFavorite": false, + "park": "Wrangell-St. Elias National Park and Preserve", + "coordinates": { + "longitude": -141.518167, + "latitude": 60.089917 + }, + "imageName": "icybay" + }, + { + "name": "Rainbow Lake", + "category": "Lakes", + "city": "Willow", + "state": "Alaska", + "id": 1009, + "isFeatured": false, + "isFavorite": false, + "park": "State Recreation Area", + "coordinates": { + "longitude": -150.086103, + "latitude": 61.694334 + }, + "imageName": "rainbowlake" + }, + { + "name": "Hidden Lake", + "category": "Lakes", + "city": "Newhalem", + "state": "Washington", + "id": 1010, + "isFeatured": false, + "isFavorite": false, + "park": "North Cascades National Park", + "coordinates": { + "longitude": -121.17799, + "latitude": 48.495442 + }, + "imageName": "hiddenlake" + }, + { + "name": "Chincoteague", + "category": "Rivers", + "city": "Chincoteague", + "state": "Virginia", + "id": 1011, + "isFeatured": false, + "isFavorite": false, + "park": "Chincoteague National Wildlife Refuge", + "coordinates": { + "longitude": -75.383212, + "latitude": 37.91531 + }, + "imageName": "chincoteague" + }, + { + "name": "Lake Umbagog", + "category": "Lakes", + "city": "Errol", + "state": "New Hampshire", + "id": 1012, + "isFeatured": true, + "isFavorite": false, + "park": "Umbagog National Wildlife Refuge", + "coordinates": { + "longitude": -71.056816, + "latitude": 44.747408 + }, + "imageName": "umbagog" + } +] diff --git a/Examples/ComposingComplexInterfaces/StartingPoint/Landmarks/Landmarks/Resources/rainbowlake.jpg b/Examples/ComposingComplexInterfaces/StartingPoint/Landmarks/Landmarks/Resources/rainbowlake.jpg new file mode 100755 index 0000000..6da43dd Binary files /dev/null and b/Examples/ComposingComplexInterfaces/StartingPoint/Landmarks/Landmarks/Resources/rainbowlake.jpg differ diff --git a/Examples/ComposingComplexInterfaces/StartingPoint/Landmarks/Landmarks/Resources/silversalmoncreek.jpg b/Examples/ComposingComplexInterfaces/StartingPoint/Landmarks/Landmarks/Resources/silversalmoncreek.jpg new file mode 100755 index 0000000..f657532 Binary files /dev/null and b/Examples/ComposingComplexInterfaces/StartingPoint/Landmarks/Landmarks/Resources/silversalmoncreek.jpg differ diff --git a/Examples/ComposingComplexInterfaces/StartingPoint/Landmarks/Landmarks/Resources/stmarylake.jpg b/Examples/ComposingComplexInterfaces/StartingPoint/Landmarks/Landmarks/Resources/stmarylake.jpg new file mode 100755 index 0000000..1c71de4 Binary files /dev/null and b/Examples/ComposingComplexInterfaces/StartingPoint/Landmarks/Landmarks/Resources/stmarylake.jpg differ diff --git a/Examples/ComposingComplexInterfaces/StartingPoint/Landmarks/Landmarks/Resources/turtlerock.jpg b/Examples/ComposingComplexInterfaces/StartingPoint/Landmarks/Landmarks/Resources/turtlerock.jpg new file mode 100755 index 0000000..f7a6e6d Binary files /dev/null and b/Examples/ComposingComplexInterfaces/StartingPoint/Landmarks/Landmarks/Resources/turtlerock.jpg differ diff --git a/Examples/ComposingComplexInterfaces/StartingPoint/Landmarks/Landmarks/Resources/twinlake.jpg b/Examples/ComposingComplexInterfaces/StartingPoint/Landmarks/Landmarks/Resources/twinlake.jpg new file mode 100755 index 0000000..3e7a57c Binary files /dev/null and b/Examples/ComposingComplexInterfaces/StartingPoint/Landmarks/Landmarks/Resources/twinlake.jpg differ diff --git a/Examples/ComposingComplexInterfaces/StartingPoint/Landmarks/Landmarks/Resources/umbagog.jpg b/Examples/ComposingComplexInterfaces/StartingPoint/Landmarks/Landmarks/Resources/umbagog.jpg new file mode 100755 index 0000000..56291c6 Binary files /dev/null and b/Examples/ComposingComplexInterfaces/StartingPoint/Landmarks/Landmarks/Resources/umbagog.jpg differ diff --git a/Examples/ComposingComplexInterfaces/StartingPoint/Landmarks/Landmarks/SceneDelegate.swift b/Examples/ComposingComplexInterfaces/StartingPoint/Landmarks/Landmarks/SceneDelegate.swift new file mode 100755 index 0000000..96df0dc --- /dev/null +++ b/Examples/ComposingComplexInterfaces/StartingPoint/Landmarks/Landmarks/SceneDelegate.swift @@ -0,0 +1,56 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +The scene delegate. +*/ + +import UIKit +import SwiftUI + +class SceneDelegate: UIResponder, UIWindowSceneDelegate { + + var window: UIWindow? + + func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) { + // Use this method to optionally configure and attach the UIWindow `window` to the provided UIWindowScene `scene`. + // If using a storyboard, the `window` property will automatically be initialized and attached to the scene. + // This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead). + + // Use a UIHostingController as window root view controller + let window = UIWindow(frame: UIScreen.main.bounds) + window.rootViewController = UIHostingController(rootView: LandmarkList().environmentObject(UserData())) + self.window = window + window.makeKeyAndVisible() + } + + func sceneDidDisconnect(_ scene: UIScene) { + // Called as the scene is being released by the system. + // This occurs shortly after the scene enters the background, or when its session is discarded. + // Release any resources associated with this scene that can be re-created the next time the scene connects. + // The scene may re-connect later, as its session was not neccessarily discarded (see `application:didDiscardSceneSessions` instead). + } + + func sceneDidBecomeActive(_ scene: UIScene) { + // Called when the scene has moved from an inactive state to an active state. + // Use this method to restart any tasks that were paused (or not yet started) when the scene was inactive. + } + + func sceneWillResignActive(_ scene: UIScene) { + // Called when the scene will move from an active state to an inactive state. + // This may occur due to temporary interruptions (ex. an incoming phone call). + } + + func sceneWillEnterForeground(_ scene: UIScene) { + // Called as the scene transitions from the background to the foreground. + // Use this method to undo the changes made on entering the background. + } + + func sceneDidEnterBackground(_ scene: UIScene) { + // Called as the scene transitions from the foreground to the background. + // Use this method to save data, release shared resources, and store enough scene-specific state information + // to restore the scene back to its current state. + } + +} + diff --git a/Examples/ComposingComplexInterfaces/StartingPoint/Landmarks/Landmarks/Supporting Views/Badge.swift b/Examples/ComposingComplexInterfaces/StartingPoint/Landmarks/Landmarks/Supporting Views/Badge.swift new file mode 100755 index 0000000..59f03b2 --- /dev/null +++ b/Examples/ComposingComplexInterfaces/StartingPoint/Landmarks/Landmarks/Supporting Views/Badge.swift @@ -0,0 +1,41 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +A view that displays a badge. +*/ + +import SwiftUI + +struct Badge: View { + static let rotationCount = 8 + + var badgeSymbols: some View { + ForEach(0.. + var overallRange: Range + + var heightRatio: Length { + max(Length(magnitude(of: range) / magnitude(of: overallRange)), 0.15) + } + + var offsetRatio: Length { + Length((range.lowerBound - overallRange.lowerBound) / magnitude(of: overallRange)) + } + + var animation: Animation { + Animation.spring(initialVelocity: 5) + .speed(2) + .delay(0.03 * Double(index)) + } + + var body: some View { + Capsule() + .fill(Color.white) + .frame(height: height * heightRatio, alignment: .bottom) + .offset(x: 0, y: height * -offsetRatio) + .animation(animation) + } +} + +#if DEBUG +struct GraphCapsule_Previews: PreviewProvider { + static var previews: some View { + GraphCapsule(index: 0, height: 150, range: 10..<50, overallRange: 0..<100) + } +} +#endif diff --git a/Examples/ComposingComplexInterfaces/StartingPoint/Landmarks/Landmarks/Supporting Views/HikeGraph.swift b/Examples/ComposingComplexInterfaces/StartingPoint/Landmarks/Landmarks/Supporting Views/HikeGraph.swift new file mode 100755 index 0000000..7df5194 --- /dev/null +++ b/Examples/ComposingComplexInterfaces/StartingPoint/Landmarks/Landmarks/Supporting Views/HikeGraph.swift @@ -0,0 +1,74 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +The elevation, heart rate, and pace of a hike plotted on a graph. +*/ + +import SwiftUI + +func rangeOfRanges(_ ranges: C) -> Range + where C.Element == Range { + guard !ranges.isEmpty else { return 0..<0 } + let low = ranges.lazy.map { $0.lowerBound }.min()! + let high = ranges.lazy.map { $0.upperBound }.max()! + return low..) -> Double { + return range.upperBound - range.lowerBound +} + +struct HikeGraph: View { + var hike: Hike + var path: KeyPath> + + var color: Color { + switch path { + case \.elevation: + return .gray + case \.heartRate: + return Color(hue: 0, saturation: 0.5, brightness: 0.7) + case \.pace: + return Color(hue: 0.7, saturation: 0.4, brightness: 0.7) + default: + return .black + } + } + + var body: some View { + let data = hike.observations + let overallRange = rangeOfRanges(data.lazy.map { $0[keyPath: self.path] }) + let maxMagnitude = data.map { magnitude(of: $0[keyPath: path]) }.max()! + let heightRatio = 1 - Length(maxMagnitude / magnitude(of: overallRange)) + + return GeometryReader { proxy in + HStack(alignment: .bottom, spacing: proxy.size.width / 120) { + ForEach(data.indices) { index in + GraphCapsule( + index: index, + height: proxy.size.height, + range: data[index][keyPath: self.path], + overallRange: overallRange) + .colorMultiply(self.color) + } + .offset(x: 0, y: proxy.size.height * heightRatio) + } + } + } +} + +#if DEBUG +struct HikeGraph_Previews: PreviewProvider { + static var previews: some View { + Group { + HikeGraph(hike: hikeData[0], path: \.elevation) + .frame(height: 200) + HikeGraph(hike: hikeData[0], path: \.heartRate) + .frame(height: 200) + HikeGraph(hike: hikeData[0], path: \.pace) + .frame(height: 200) + } + } +} +#endif diff --git a/Examples/ComposingComplexInterfaces/StartingPoint/Landmarks/Landmarks/Supporting Views/LandmarkRow.swift b/Examples/ComposingComplexInterfaces/StartingPoint/Landmarks/Landmarks/Supporting Views/LandmarkRow.swift new file mode 100755 index 0000000..2f8110c --- /dev/null +++ b/Examples/ComposingComplexInterfaces/StartingPoint/Landmarks/Landmarks/Supporting Views/LandmarkRow.swift @@ -0,0 +1,38 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +A single row to be displayed in a list of landmarks. +*/ + +import SwiftUI + +struct LandmarkRow: View { + var landmark: Landmark + + var body: some View { + HStack { + landmark.image(forSize: 50) + Text(verbatim: landmark.name) + Spacer() + + if landmark.isFavorite { + Image(systemName: "star.fill") + .imageScale(.medium) + .foregroundColor(.yellow) + } + } + } +} + +#if DEBUG +struct LandmarkRow_Previews: PreviewProvider { + static var previews: some View { + Group { + LandmarkRow(landmark: landmarkData[0]) + LandmarkRow(landmark: landmarkData[1]) + } + .previewLayout(.fixed(width: 300, height: 70)) + } +} +#endif diff --git a/Examples/ComposingComplexInterfaces/StartingPoint/Landmarks/Landmarks/Supporting Views/MapView.swift b/Examples/ComposingComplexInterfaces/StartingPoint/Landmarks/Landmarks/Supporting Views/MapView.swift new file mode 100755 index 0000000..5a8c64b --- /dev/null +++ b/Examples/ComposingComplexInterfaces/StartingPoint/Landmarks/Landmarks/Supporting Views/MapView.swift @@ -0,0 +1,31 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +A view that hosts an `MKMapView`. +*/ + +import SwiftUI +import MapKit + +struct MapView: UIViewRepresentable { + var coordinate: CLLocationCoordinate2D + + func makeUIView(context: Context) -> MKMapView { + MKMapView(frame: .zero) + } + + func updateUIView(_ view: MKMapView, context: Context) { + let span = MKCoordinateSpan(latitudeDelta: 0.02, longitudeDelta: 0.02) + let region = MKCoordinateRegion(center: coordinate, span: span) + view.setRegion(region, animated: true) + } +} + +#if DEBUG +struct MapView_Previews: PreviewProvider { + static var previews: some View { + MapView(coordinate: landmarkData[0].locationCoordinate) + } +} +#endif diff --git a/Examples/ComposingComplexInterfaces/StartingPoint/Landmarks/Landmarks/Supporting Views/RotatedBadgeSymbol.swift b/Examples/ComposingComplexInterfaces/StartingPoint/Landmarks/Landmarks/Supporting Views/RotatedBadgeSymbol.swift new file mode 100755 index 0000000..a7e4b53 --- /dev/null +++ b/Examples/ComposingComplexInterfaces/StartingPoint/Landmarks/Landmarks/Supporting Views/RotatedBadgeSymbol.swift @@ -0,0 +1,26 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +A view that displays a rotated version of a badge symbol. +*/ + +import SwiftUI + +struct RotatedBadgeSymbol: View { + let angle: Angle + + var body: some View { + BadgeSymbol() + .padding(-60) + .rotationEffect(angle, anchor: .bottom) + } +} + +#if DEBUG +struct RotatedBadgeSymbol_Previews: PreviewProvider { + static var previews: some View { + RotatedBadgeSymbol(angle: .init(degrees: 5)) + } +} +#endif diff --git a/Examples/ComposingComplexInterfaces/StartingPoint/README.md b/Examples/ComposingComplexInterfaces/StartingPoint/README.md new file mode 100755 index 0000000..04c6b3a --- /dev/null +++ b/Examples/ComposingComplexInterfaces/StartingPoint/README.md @@ -0,0 +1,3 @@ +# Composing Complex Interfaces + +Use this project to code along with the [Composing Complex Interfaces](https://developer.apple.com/tutorials/swiftui/composing-complex-interfaces) tutorial. \ No newline at end of file diff --git a/Examples/CreatingAndCombiningViews/Complete/.gitignore b/Examples/CreatingAndCombiningViews/Complete/.gitignore new file mode 100755 index 0000000..9e50718 --- /dev/null +++ b/Examples/CreatingAndCombiningViews/Complete/.gitignore @@ -0,0 +1,21 @@ +# See LICENSE folder for this sample’s licensing information. +# +# Apple sample code gitignore configuration. + +# Finder +.DS_Store + +# Xcode - User files +xcuserdata/ + +**/*.xcodeproj/project.xcworkspace/* +!**/*.xcodeproj/project.xcworkspace/xcshareddata + +**/*.xcodeproj/project.xcworkspace/xcshareddata/* +!**/*.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings + +**/*.playground/playground.xcworkspace/* +!**/*.playground/playground.xcworkspace/xcshareddata + +**/*.playground/playground.xcworkspace/xcshareddata/* +!**/*.playground/playground.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings diff --git a/Examples/CreatingAndCombiningViews/Complete/Configuration/SampleCode.xcconfig b/Examples/CreatingAndCombiningViews/Complete/Configuration/SampleCode.xcconfig new file mode 100755 index 0000000..db86c06 --- /dev/null +++ b/Examples/CreatingAndCombiningViews/Complete/Configuration/SampleCode.xcconfig @@ -0,0 +1,13 @@ +// +// See LICENSE folder for this sample’s licensing information. +// +// SampleCode.xcconfig +// + +// The `SAMPLE_CODE_DISAMBIGUATOR` configuration is to make it easier to build +// and run a sample code project. Once you set your project's development team, +// you'll have a unique bundle identifier. This is because the bundle identifier +// is derived based on the 'SAMPLE_CODE_DISAMBIGUATOR' value. Do not use this +// approach in your own projects—it's only useful for sample code projects because +// they are frequently downloaded and don't have a development team set. +SAMPLE_CODE_DISAMBIGUATOR=${DEVELOPMENT_TEAM} diff --git a/Examples/CreatingAndCombiningViews/Complete/LICENSE/LICENSE.txt b/Examples/CreatingAndCombiningViews/Complete/LICENSE/LICENSE.txt new file mode 100755 index 0000000..94e3d54 --- /dev/null +++ b/Examples/CreatingAndCombiningViews/Complete/LICENSE/LICENSE.txt @@ -0,0 +1,8 @@ +Copyright © 2019 Apple Inc. + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + diff --git a/Examples/CreatingAndCombiningViews/Complete/Landmarks/CreatingAndCombiningViews.xcodeproj/.xcodesamplecode.plist b/Examples/CreatingAndCombiningViews/Complete/Landmarks/CreatingAndCombiningViews.xcodeproj/.xcodesamplecode.plist new file mode 100755 index 0000000..5dd5da8 --- /dev/null +++ b/Examples/CreatingAndCombiningViews/Complete/Landmarks/CreatingAndCombiningViews.xcodeproj/.xcodesamplecode.plist @@ -0,0 +1,5 @@ + + + + + diff --git a/Examples/CreatingAndCombiningViews/Complete/Landmarks/CreatingAndCombiningViews.xcodeproj/project.pbxproj b/Examples/CreatingAndCombiningViews/Complete/Landmarks/CreatingAndCombiningViews.xcodeproj/project.pbxproj new file mode 100755 index 0000000..b440a3a --- /dev/null +++ b/Examples/CreatingAndCombiningViews/Complete/Landmarks/CreatingAndCombiningViews.xcodeproj/project.pbxproj @@ -0,0 +1,393 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 50; + objects = { + +/* Begin PBXBuildFile section */ + B7394866229F194000C47603 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7394865229F194000C47603 /* AppDelegate.swift */; }; + B7394868229F194000C47603 /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7394867229F194000C47603 /* SceneDelegate.swift */; }; + B739486A229F194000C47603 /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7394869229F194000C47603 /* ContentView.swift */; }; + B739486C229F194200C47603 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = B739486B229F194200C47603 /* Assets.xcassets */; }; + B739486F229F194200C47603 /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = B739486E229F194200C47603 /* Preview Assets.xcassets */; }; + B7394872229F194200C47603 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = B7394870229F194200C47603 /* LaunchScreen.storyboard */; }; + B739487A229F1B3F00C47603 /* CircleImage.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7394879229F1B3F00C47603 /* CircleImage.swift */; }; + B739487C229F1B6800C47603 /* MapView.swift in Sources */ = {isa = PBXBuildFile; fileRef = B739487B229F1B6800C47603 /* MapView.swift */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + 795AC830795A92E000000001 /* SampleCode.xcconfig */ = {isa = PBXFileReference; name = SampleCode.xcconfig; path = ../Configuration/SampleCode.xcconfig; sourceTree = ""; }; + 7B51AA007B507C1000000001 /* LICENSE.txt */ = {isa = PBXFileReference; includeInIndex = 1; path = LICENSE.txt; sourceTree = ""; }; + B7394862229F194000C47603 /* Landmarks.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Landmarks.app; sourceTree = BUILT_PRODUCTS_DIR; }; + B7394865229F194000C47603 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + B7394867229F194000C47603 /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = ""; }; + B7394869229F194000C47603 /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = ""; }; + B739486B229F194200C47603 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + B739486E229F194200C47603 /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = ""; }; + B7394871229F194200C47603 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + B7394873229F194200C47603 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + B7394879229F1B3F00C47603 /* CircleImage.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CircleImage.swift; sourceTree = ""; }; + B739487B229F1B6800C47603 /* MapView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MapView.swift; sourceTree = ""; }; + C4E4AAA0C4E4035000000001 /* README.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; name = README.md; path = ../README.md; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + B739485F229F194000C47603 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 795A9470795A943000000001 /* Configuration */ = { + isa = PBXGroup; + children = ( + 795AC830795A92E000000001 /* SampleCode.xcconfig */, + ); + name = Configuration; + sourceTree = ""; + }; + 7B5078C07B5070C000000001 /* LICENSE */ = { + isa = PBXGroup; + children = ( + 7B51AA007B507C1000000001 /* LICENSE.txt */, + ); + name = LICENSE; + path = ../LICENSE; + sourceTree = ""; + }; + B7394859229F194000C47603 = { + isa = PBXGroup; + children = ( + C4E4AAA0C4E4035000000001 /* README.md */, + B7394864229F194000C47603 /* Landmarks */, + B7394863229F194000C47603 /* Products */, + 795A9470795A943000000001 /* Configuration */, + 7B5078C07B5070C000000001 /* LICENSE */, + ); + sourceTree = ""; + }; + B7394863229F194000C47603 /* Products */ = { + isa = PBXGroup; + children = ( + B7394862229F194000C47603 /* Landmarks.app */, + ); + name = Products; + sourceTree = ""; + }; + B7394864229F194000C47603 /* Landmarks */ = { + isa = PBXGroup; + children = ( + B7394865229F194000C47603 /* AppDelegate.swift */, + B7394867229F194000C47603 /* SceneDelegate.swift */, + B7394869229F194000C47603 /* ContentView.swift */, + B739487D229F1C0100C47603 /* Supporting Views */, + B739486B229F194200C47603 /* Assets.xcassets */, + B7394870229F194200C47603 /* LaunchScreen.storyboard */, + B7394873229F194200C47603 /* Info.plist */, + B739486D229F194200C47603 /* Preview Content */, + ); + path = Landmarks; + sourceTree = ""; + }; + B739486D229F194200C47603 /* Preview Content */ = { + isa = PBXGroup; + children = ( + B739486E229F194200C47603 /* Preview Assets.xcassets */, + ); + path = "Preview Content"; + sourceTree = ""; + }; + B739487D229F1C0100C47603 /* Supporting Views */ = { + isa = PBXGroup; + children = ( + B7394879229F1B3F00C47603 /* CircleImage.swift */, + B739487B229F1B6800C47603 /* MapView.swift */, + ); + path = "Supporting Views"; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + B7394861229F194000C47603 /* Landmarks */ = { + isa = PBXNativeTarget; + buildConfigurationList = B7394876229F194200C47603 /* Build configuration list for PBXNativeTarget "Landmarks" */; + buildPhases = ( + B739485E229F194000C47603 /* Sources */, + B739485F229F194000C47603 /* Frameworks */, + B7394860229F194000C47603 /* Resources */, + C602AC70C605937000000001, + ); + buildRules = ( + ); + dependencies = ( + ); + name = Landmarks; + productName = Landmarks; + productReference = B7394862229F194000C47603 /* Landmarks.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + B739485A229F194000C47603 /* Project object */ = { + isa = PBXProject; + attributes = { + LastSwiftUpdateCheck = 1100; + LastUpgradeCheck = 1100; + ORGANIZATIONNAME = Apple; + TargetAttributes = { + B7394861229F194000C47603 = { + CreatedOnToolsVersion = 11.0; + }; + }; + }; + buildConfigurationList = B739485D229F194000C47603 /* Build configuration list for PBXProject "CreatingAndCombiningViews" */; + compatibilityVersion = "Xcode 9.3"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = B7394859229F194000C47603; + productRefGroup = B7394863229F194000C47603 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + B7394861229F194000C47603 /* Landmarks */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + B7394860229F194000C47603 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + B7394872229F194200C47603 /* LaunchScreen.storyboard in Resources */, + B739486F229F194200C47603 /* Preview Assets.xcassets in Resources */, + B739486C229F194200C47603 /* Assets.xcassets in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + B739485E229F194000C47603 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + B7394866229F194000C47603 /* AppDelegate.swift in Sources */, + B739487A229F1B3F00C47603 /* CircleImage.swift in Sources */, + B739487C229F1B6800C47603 /* MapView.swift in Sources */, + B7394868229F194000C47603 /* SceneDelegate.swift in Sources */, + B739486A229F194000C47603 /* ContentView.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXVariantGroup section */ + B7394870229F194200C47603 /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + B7394871229F194200C47603 /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + B7394874229F194200C47603 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 795AC830795A92E000000001 /* SampleCode.xcconfig */; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 13.0; + MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; + MTL_FAST_MATH = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + }; + name = Debug; + }; + B7394875229F194200C47603 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 795AC830795A92E000000001 /* SampleCode.xcconfig */; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 13.0; + MTL_ENABLE_DEBUG_INFO = NO; + MTL_FAST_MATH = YES; + SDKROOT = iphoneos; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + B7394877229F194200C47603 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 795AC830795A92E000000001 /* SampleCode.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_ASSET_PATHS = "Landmarks/Preview\\ Content"; + DEVELOPMENT_TEAM = ""; + ENABLE_PREVIEWS = YES; + INFOPLIST_FILE = Landmarks/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = "com.example.apple-samplecode.Landmarks${SAMPLE_CODE_DISAMBIGUATOR}"; + PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE_SPECIFIER = ""; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + B7394878229F194200C47603 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 795AC830795A92E000000001 /* SampleCode.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_ASSET_PATHS = "Landmarks/Preview\\ Content"; + DEVELOPMENT_TEAM = ""; + ENABLE_PREVIEWS = YES; + INFOPLIST_FILE = Landmarks/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = "com.example.apple-samplecode.Landmarks${SAMPLE_CODE_DISAMBIGUATOR}"; + PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE_SPECIFIER = ""; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + B739485D229F194000C47603 /* Build configuration list for PBXProject "CreatingAndCombiningViews" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + B7394874229F194200C47603 /* Debug */, + B7394875229F194200C47603 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + B7394876229F194200C47603 /* Build configuration list for PBXNativeTarget "Landmarks" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + B7394877229F194200C47603 /* Debug */, + B7394878229F194200C47603 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = B739485A229F194000C47603 /* Project object */; +} diff --git a/Examples/CreatingAndCombiningViews/Complete/Landmarks/CreatingAndCombiningViews.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/Examples/CreatingAndCombiningViews/Complete/Landmarks/CreatingAndCombiningViews.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings new file mode 100755 index 0000000..3ddf867 --- /dev/null +++ b/Examples/CreatingAndCombiningViews/Complete/Landmarks/CreatingAndCombiningViews.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings @@ -0,0 +1,8 @@ + + + + + BuildSystemType + Latest + + diff --git a/Examples/CreatingAndCombiningViews/Complete/Landmarks/Landmarks/AppDelegate.swift b/Examples/CreatingAndCombiningViews/Complete/Landmarks/Landmarks/AppDelegate.swift new file mode 100755 index 0000000..e22943b --- /dev/null +++ b/Examples/CreatingAndCombiningViews/Complete/Landmarks/Landmarks/AppDelegate.swift @@ -0,0 +1,36 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +The application delegate. +*/ + +import UIKit + +@UIApplicationMain +class AppDelegate: UIResponder, UIApplicationDelegate { + + func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { + // Override point for customization after application launch. + return true + } + + func applicationWillTerminate(_ application: UIApplication) { + // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. + } + + // MARK: UISceneSession Lifecycle + func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration { + // Called when a new scene session is being created. + // Use this method to select a configuration to create the new scene with. + return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role) + } + + func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set) { + // Called when the user discards a scene session. + // If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions. + // Use this method to release any resources that were specific to the discarded scenes, as they will not return. + } + +} + diff --git a/Examples/CreatingAndCombiningViews/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/Contents.json b/Examples/CreatingAndCombiningViews/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100755 index 0000000..fa0d2db --- /dev/null +++ b/Examples/CreatingAndCombiningViews/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,113 @@ +{ + "images" : [ + { + "size" : "20x20", + "idiom" : "iphone", + "filename" : "landmark_app_icon_40x40.png", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "20x20", + "scale" : "3x" + }, + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "landmark_app_icon_58x58.png", + "scale" : "2x" + }, + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "landmark_app_icon_87x87.png", + "scale" : "3x" + }, + { + "size" : "40x40", + "idiom" : "iphone", + "filename" : "landmark_app_icon_80x80.png", + "scale" : "2x" + }, + { + "size" : "40x40", + "idiom" : "iphone", + "filename" : "landmark_app_icon_120x120.png", + "scale" : "3x" + }, + { + "size" : "60x60", + "idiom" : "iphone", + "filename" : "landmark_app_icon_120x120-1.png", + "scale" : "2x" + }, + { + "size" : "60x60", + "idiom" : "iphone", + "filename" : "landmark_app_icon_180x180.png", + "scale" : "3x" + }, + { + "idiom" : "ipad", + "size" : "20x20", + "scale" : "1x" + }, + { + "size" : "20x20", + "idiom" : "ipad", + "filename" : "landmark_app_icon_40x40-1.png", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "29x29", + "scale" : "1x" + }, + { + "size" : "29x29", + "idiom" : "ipad", + "filename" : "landmark_app_icon_58x58-1.png", + "scale" : "2x" + }, + { + "size" : "40x40", + "idiom" : "ipad", + "filename" : "landmark_app_icon_40x40-2.png", + "scale" : "1x" + }, + { + "size" : "40x40", + "idiom" : "ipad", + "filename" : "landmark_app_icon_80x80-1.png", + "scale" : "2x" + }, + { + "size" : "76x76", + "idiom" : "ipad", + "filename" : "landmark_app_icon_76x76.png", + "scale" : "1x" + }, + { + "size" : "76x76", + "idiom" : "ipad", + "filename" : "landmark_app_icon_152x152.png", + "scale" : "2x" + }, + { + "size" : "83.5x83.5", + "idiom" : "ipad", + "filename" : "landmark_app_icon_167x167.png", + "scale" : "2x" + }, + { + "size" : "1024x1024", + "idiom" : "ios-marketing", + "filename" : "landmark_app_icon_1024x1024.png", + "scale" : "1x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Examples/CreatingAndCombiningViews/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_1024x1024.png b/Examples/CreatingAndCombiningViews/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_1024x1024.png new file mode 100755 index 0000000..00d81c1 Binary files /dev/null and b/Examples/CreatingAndCombiningViews/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_1024x1024.png differ diff --git a/Examples/CreatingAndCombiningViews/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_120x120-1.png b/Examples/CreatingAndCombiningViews/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_120x120-1.png new file mode 100755 index 0000000..d382b8b Binary files /dev/null and b/Examples/CreatingAndCombiningViews/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_120x120-1.png differ diff --git a/Examples/CreatingAndCombiningViews/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_120x120.png b/Examples/CreatingAndCombiningViews/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_120x120.png new file mode 100755 index 0000000..d382b8b Binary files /dev/null and b/Examples/CreatingAndCombiningViews/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_120x120.png differ diff --git a/Examples/CreatingAndCombiningViews/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_152x152.png b/Examples/CreatingAndCombiningViews/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_152x152.png new file mode 100755 index 0000000..11057f8 Binary files /dev/null and b/Examples/CreatingAndCombiningViews/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_152x152.png differ diff --git a/Examples/CreatingAndCombiningViews/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_167x167.png b/Examples/CreatingAndCombiningViews/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_167x167.png new file mode 100755 index 0000000..f73bc26 Binary files /dev/null and b/Examples/CreatingAndCombiningViews/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_167x167.png differ diff --git a/Examples/CreatingAndCombiningViews/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_180x180.png b/Examples/CreatingAndCombiningViews/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_180x180.png new file mode 100755 index 0000000..b02738c Binary files /dev/null and b/Examples/CreatingAndCombiningViews/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_180x180.png differ diff --git a/Examples/CreatingAndCombiningViews/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_40x40-1.png b/Examples/CreatingAndCombiningViews/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_40x40-1.png new file mode 100755 index 0000000..abaff0e Binary files /dev/null and b/Examples/CreatingAndCombiningViews/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_40x40-1.png differ diff --git a/Examples/CreatingAndCombiningViews/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_40x40-2.png b/Examples/CreatingAndCombiningViews/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_40x40-2.png new file mode 100755 index 0000000..abaff0e Binary files /dev/null and b/Examples/CreatingAndCombiningViews/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_40x40-2.png differ diff --git a/Examples/CreatingAndCombiningViews/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_40x40.png b/Examples/CreatingAndCombiningViews/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_40x40.png new file mode 100755 index 0000000..abaff0e Binary files /dev/null and b/Examples/CreatingAndCombiningViews/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_40x40.png differ diff --git a/Examples/CreatingAndCombiningViews/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_58x58-1.png b/Examples/CreatingAndCombiningViews/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_58x58-1.png new file mode 100755 index 0000000..cf7c73d Binary files /dev/null and b/Examples/CreatingAndCombiningViews/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_58x58-1.png differ diff --git a/Examples/CreatingAndCombiningViews/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_58x58.png b/Examples/CreatingAndCombiningViews/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_58x58.png new file mode 100755 index 0000000..cf7c73d Binary files /dev/null and b/Examples/CreatingAndCombiningViews/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_58x58.png differ diff --git a/Examples/CreatingAndCombiningViews/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_76x76.png b/Examples/CreatingAndCombiningViews/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_76x76.png new file mode 100755 index 0000000..3eff85b Binary files /dev/null and b/Examples/CreatingAndCombiningViews/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_76x76.png differ diff --git a/Examples/CreatingAndCombiningViews/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_80x80-1.png b/Examples/CreatingAndCombiningViews/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_80x80-1.png new file mode 100755 index 0000000..6f33f66 Binary files /dev/null and b/Examples/CreatingAndCombiningViews/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_80x80-1.png differ diff --git a/Examples/CreatingAndCombiningViews/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_80x80.png b/Examples/CreatingAndCombiningViews/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_80x80.png new file mode 100755 index 0000000..6f33f66 Binary files /dev/null and b/Examples/CreatingAndCombiningViews/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_80x80.png differ diff --git a/Examples/CreatingAndCombiningViews/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_87x87.png b/Examples/CreatingAndCombiningViews/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_87x87.png new file mode 100755 index 0000000..9e1616c Binary files /dev/null and b/Examples/CreatingAndCombiningViews/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_87x87.png differ diff --git a/Examples/CreatingAndCombiningViews/Complete/Landmarks/Landmarks/Assets.xcassets/Contents.json b/Examples/CreatingAndCombiningViews/Complete/Landmarks/Landmarks/Assets.xcassets/Contents.json new file mode 100755 index 0000000..da4a164 --- /dev/null +++ b/Examples/CreatingAndCombiningViews/Complete/Landmarks/Landmarks/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Examples/CreatingAndCombiningViews/Complete/Landmarks/Landmarks/Assets.xcassets/turtlerock.imageset/Contents.json b/Examples/CreatingAndCombiningViews/Complete/Landmarks/Landmarks/Assets.xcassets/turtlerock.imageset/Contents.json new file mode 100755 index 0000000..5bfd7bf --- /dev/null +++ b/Examples/CreatingAndCombiningViews/Complete/Landmarks/Landmarks/Assets.xcassets/turtlerock.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "turtlerock.jpg", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Examples/CreatingAndCombiningViews/Complete/Landmarks/Landmarks/Assets.xcassets/turtlerock.imageset/turtlerock.jpg b/Examples/CreatingAndCombiningViews/Complete/Landmarks/Landmarks/Assets.xcassets/turtlerock.imageset/turtlerock.jpg new file mode 100755 index 0000000..68bcd3e Binary files /dev/null and b/Examples/CreatingAndCombiningViews/Complete/Landmarks/Landmarks/Assets.xcassets/turtlerock.imageset/turtlerock.jpg differ diff --git a/Examples/CreatingAndCombiningViews/Complete/Landmarks/Landmarks/Base.lproj/LaunchScreen.storyboard b/Examples/CreatingAndCombiningViews/Complete/Landmarks/Landmarks/Base.lproj/LaunchScreen.storyboard new file mode 100755 index 0000000..865e932 --- /dev/null +++ b/Examples/CreatingAndCombiningViews/Complete/Landmarks/Landmarks/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Examples/CreatingAndCombiningViews/Complete/Landmarks/Landmarks/ContentView.swift b/Examples/CreatingAndCombiningViews/Complete/Landmarks/Landmarks/ContentView.swift new file mode 100755 index 0000000..6e4dea7 --- /dev/null +++ b/Examples/CreatingAndCombiningViews/Complete/Landmarks/Landmarks/ContentView.swift @@ -0,0 +1,45 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +A view showing the details for a landmark. +*/ + +import SwiftUI + +struct ContentView: View { + var body: some View { + VStack { + MapView() + .edgesIgnoringSafeArea(.top) + .frame(height: 300) + + CircleImage() + .offset(x: 0, y: -130) + .padding(.bottom, -130) + + VStack(alignment: .leading) { + Text("Turtle Rock") + .font(.title) + HStack(alignment: .top) { + Text("Joshua Tree National Park") + .font(.subheadline) + Spacer() + Text("California") + .font(.subheadline) + } + } + .padding() + + Spacer() + } + } +} + +#if DEBUG +struct ContentView_Previews: PreviewProvider { + static var previews: some View { + ContentView() + } +} +#endif diff --git a/Examples/CreatingAndCombiningViews/Complete/Landmarks/Landmarks/Info.plist b/Examples/CreatingAndCombiningViews/Complete/Landmarks/Landmarks/Info.plist new file mode 100755 index 0000000..e8bb4c6 --- /dev/null +++ b/Examples/CreatingAndCombiningViews/Complete/Landmarks/Landmarks/Info.plist @@ -0,0 +1,62 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + $(PRODUCT_BUNDLE_PACKAGE_TYPE) + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1 + LSRequiresIPhoneOS + + UIApplicationSceneManifest + + UIApplicationSupportsMultipleScenes + + UISceneConfigurations + + UIWindowSceneSessionRoleApplication + + + UILaunchStoryboardName + LaunchScreen + UISceneConfigurationName + Default Configuration + UISceneDelegateClassName + $(PRODUCT_MODULE_NAME).SceneDelegate + + + + + UILaunchStoryboardName + LaunchScreen + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/Examples/CreatingAndCombiningViews/Complete/Landmarks/Landmarks/Preview Content/Preview Assets.xcassets/Contents.json b/Examples/CreatingAndCombiningViews/Complete/Landmarks/Landmarks/Preview Content/Preview Assets.xcassets/Contents.json new file mode 100755 index 0000000..da4a164 --- /dev/null +++ b/Examples/CreatingAndCombiningViews/Complete/Landmarks/Landmarks/Preview Content/Preview Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Examples/CreatingAndCombiningViews/Complete/Landmarks/Landmarks/SceneDelegate.swift b/Examples/CreatingAndCombiningViews/Complete/Landmarks/Landmarks/SceneDelegate.swift new file mode 100755 index 0000000..8822243 --- /dev/null +++ b/Examples/CreatingAndCombiningViews/Complete/Landmarks/Landmarks/SceneDelegate.swift @@ -0,0 +1,56 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +The scene delegate. +*/ + +import UIKit +import SwiftUI + +class SceneDelegate: UIResponder, UIWindowSceneDelegate { + + var window: UIWindow? + + func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) { + // Use this method to optionally configure and attach the UIWindow `window` to the provided UIWindowScene `scene`. + // If using a storyboard, the `window` property will automatically be initialized and attached to the scene. + // This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead). + + // Use a UIHostingController as window root view controller + let window = UIWindow(frame: UIScreen.main.bounds) + window.rootViewController = UIHostingController(rootView: ContentView()) + self.window = window + window.makeKeyAndVisible() + } + + func sceneDidDisconnect(_ scene: UIScene) { + // Called as the scene is being released by the system. + // This occurs shortly after the scene enters the background, or when its session is discarded. + // Release any resources associated with this scene that can be re-created the next time the scene connects. + // The scene may re-connect later, as its session was not neccessarily discarded (see `application:didDiscardSceneSessions` instead). + } + + func sceneDidBecomeActive(_ scene: UIScene) { + // Called when the scene has moved from an inactive state to an active state. + // Use this method to restart any tasks that were paused (or not yet started) when the scene was inactive. + } + + func sceneWillResignActive(_ scene: UIScene) { + // Called when the scene will move from an active state to an inactive state. + // This may occur due to temporary interruptions (ex. an incoming phone call). + } + + func sceneWillEnterForeground(_ scene: UIScene) { + // Called as the scene transitions from the background to the foreground. + // Use this method to undo the changes made on entering the background. + } + + func sceneDidEnterBackground(_ scene: UIScene) { + // Called as the scene transitions from the foreground to the background. + // Use this method to save data, release shared resources, and store enough scene-specific state information + // to restore the scene back to its current state. + } + +} + diff --git a/Examples/CreatingAndCombiningViews/Complete/Landmarks/Landmarks/Supporting Views/CircleImage.swift b/Examples/CreatingAndCombiningViews/Complete/Landmarks/Landmarks/Supporting Views/CircleImage.swift new file mode 100755 index 0000000..f32a333 --- /dev/null +++ b/Examples/CreatingAndCombiningViews/Complete/Landmarks/Landmarks/Supporting Views/CircleImage.swift @@ -0,0 +1,26 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +A view that clips an image to a circle and adds a stroke and shadow. +*/ + +import SwiftUI + +struct CircleImage: View { + var body: some View { + Image("turtlerock") + .clipShape(Circle()) + .overlay( + Circle().stroke(Color.white, lineWidth: 4)) + .shadow(radius: 10) + } +} + +#if DEBUG +struct CircleImage_Previews: PreviewProvider { + static var previews: some View { + CircleImage() + } +} +#endif diff --git a/Examples/CreatingAndCombiningViews/Complete/Landmarks/Landmarks/Supporting Views/MapView.swift b/Examples/CreatingAndCombiningViews/Complete/Landmarks/Landmarks/Supporting Views/MapView.swift new file mode 100755 index 0000000..ea5716e --- /dev/null +++ b/Examples/CreatingAndCombiningViews/Complete/Landmarks/Landmarks/Supporting Views/MapView.swift @@ -0,0 +1,31 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +A view that hosts an `MKMapView`. +*/ + +import SwiftUI +import MapKit + +struct MapView: UIViewRepresentable { + func makeUIView(context: Context) -> MKMapView { + MKMapView(frame: .zero) + } + + func updateUIView(_ view: MKMapView, context: Context) { + let coordinate = CLLocationCoordinate2D( + latitude: 34.011_286, longitude: -116.166_868) + let span = MKCoordinateSpan(latitudeDelta: 2.0, longitudeDelta: 2.0) + let region = MKCoordinateRegion(center: coordinate, span: span) + view.setRegion(region, animated: true) + } +} + +#if DEBUG +struct MapView_Previews: PreviewProvider { + static var previews: some View { + MapView() + } +} +#endif diff --git a/Examples/CreatingAndCombiningViews/Complete/README.md b/Examples/CreatingAndCombiningViews/Complete/README.md new file mode 100755 index 0000000..0dfb812 --- /dev/null +++ b/Examples/CreatingAndCombiningViews/Complete/README.md @@ -0,0 +1,3 @@ +# Completed Project: Creating and Combining Views + +Explore the completed project for the [Creating and Combining Views](https://developer.apple.com/tutorials/swiftui/creating-and-combining-views) tutorial. diff --git a/Examples/CreatingAndCombiningViews/Resources/LICENSE/LICENSE.txt b/Examples/CreatingAndCombiningViews/Resources/LICENSE/LICENSE.txt new file mode 100755 index 0000000..94e3d54 --- /dev/null +++ b/Examples/CreatingAndCombiningViews/Resources/LICENSE/LICENSE.txt @@ -0,0 +1,8 @@ +Copyright © 2019 Apple Inc. + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + diff --git a/Examples/CreatingAndCombiningViews/Resources/turtlerock.jpg b/Examples/CreatingAndCombiningViews/Resources/turtlerock.jpg new file mode 100755 index 0000000..68bcd3e Binary files /dev/null and b/Examples/CreatingAndCombiningViews/Resources/turtlerock.jpg differ diff --git a/Examples/DrawingPathsAndShapes/Complete/.gitignore b/Examples/DrawingPathsAndShapes/Complete/.gitignore new file mode 100755 index 0000000..9e50718 --- /dev/null +++ b/Examples/DrawingPathsAndShapes/Complete/.gitignore @@ -0,0 +1,21 @@ +# See LICENSE folder for this sample’s licensing information. +# +# Apple sample code gitignore configuration. + +# Finder +.DS_Store + +# Xcode - User files +xcuserdata/ + +**/*.xcodeproj/project.xcworkspace/* +!**/*.xcodeproj/project.xcworkspace/xcshareddata + +**/*.xcodeproj/project.xcworkspace/xcshareddata/* +!**/*.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings + +**/*.playground/playground.xcworkspace/* +!**/*.playground/playground.xcworkspace/xcshareddata + +**/*.playground/playground.xcworkspace/xcshareddata/* +!**/*.playground/playground.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings diff --git a/Examples/DrawingPathsAndShapes/Complete/Configuration/SampleCode.xcconfig b/Examples/DrawingPathsAndShapes/Complete/Configuration/SampleCode.xcconfig new file mode 100755 index 0000000..db86c06 --- /dev/null +++ b/Examples/DrawingPathsAndShapes/Complete/Configuration/SampleCode.xcconfig @@ -0,0 +1,13 @@ +// +// See LICENSE folder for this sample’s licensing information. +// +// SampleCode.xcconfig +// + +// The `SAMPLE_CODE_DISAMBIGUATOR` configuration is to make it easier to build +// and run a sample code project. Once you set your project's development team, +// you'll have a unique bundle identifier. This is because the bundle identifier +// is derived based on the 'SAMPLE_CODE_DISAMBIGUATOR' value. Do not use this +// approach in your own projects—it's only useful for sample code projects because +// they are frequently downloaded and don't have a development team set. +SAMPLE_CODE_DISAMBIGUATOR=${DEVELOPMENT_TEAM} diff --git a/Examples/DrawingPathsAndShapes/Complete/LICENSE/LICENSE.txt b/Examples/DrawingPathsAndShapes/Complete/LICENSE/LICENSE.txt new file mode 100755 index 0000000..94e3d54 --- /dev/null +++ b/Examples/DrawingPathsAndShapes/Complete/LICENSE/LICENSE.txt @@ -0,0 +1,8 @@ +Copyright © 2019 Apple Inc. + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + diff --git a/Examples/DrawingPathsAndShapes/Complete/Landmarks/DrawingPathsAndShapes.xcodeproj/.xcodesamplecode.plist b/Examples/DrawingPathsAndShapes/Complete/Landmarks/DrawingPathsAndShapes.xcodeproj/.xcodesamplecode.plist new file mode 100755 index 0000000..5dd5da8 --- /dev/null +++ b/Examples/DrawingPathsAndShapes/Complete/Landmarks/DrawingPathsAndShapes.xcodeproj/.xcodesamplecode.plist @@ -0,0 +1,5 @@ + + + + + diff --git a/Examples/DrawingPathsAndShapes/Complete/Landmarks/DrawingPathsAndShapes.xcodeproj/project.pbxproj b/Examples/DrawingPathsAndShapes/Complete/Landmarks/DrawingPathsAndShapes.xcodeproj/project.pbxproj new file mode 100755 index 0000000..efba08b --- /dev/null +++ b/Examples/DrawingPathsAndShapes/Complete/Landmarks/DrawingPathsAndShapes.xcodeproj/project.pbxproj @@ -0,0 +1,501 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 50; + objects = { + +/* Begin PBXBuildFile section */ + B7310DD1229F6839001079B9 /* HexagonParameters.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7310DD0229F6839001079B9 /* HexagonParameters.swift */; }; + B7310DD3229F6CA9001079B9 /* Badge.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7310DD2229F6CA9001079B9 /* Badge.swift */; }; + B7394866229F194000C47603 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7394865229F194000C47603 /* AppDelegate.swift */; }; + B7394868229F194000C47603 /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7394867229F194000C47603 /* SceneDelegate.swift */; }; + B739486A229F194000C47603 /* LandmarkDetail.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7394869229F194000C47603 /* LandmarkDetail.swift */; }; + B739486C229F194200C47603 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = B739486B229F194200C47603 /* Assets.xcassets */; }; + B739486F229F194200C47603 /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = B739486E229F194200C47603 /* Preview Assets.xcassets */; }; + B7394872229F194200C47603 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = B7394870229F194200C47603 /* LaunchScreen.storyboard */; }; + B739487A229F1B3F00C47603 /* CircleImage.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7394879229F1B3F00C47603 /* CircleImage.swift */; }; + B739487C229F1B6800C47603 /* MapView.swift in Sources */ = {isa = PBXBuildFile; fileRef = B739487B229F1B6800C47603 /* MapView.swift */; }; + B7394881229F28B900C47603 /* Landmark.swift in Sources */ = {isa = PBXBuildFile; fileRef = B739487F229F28B900C47603 /* Landmark.swift */; }; + B7394882229F28B900C47603 /* Data.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7394880229F28B900C47603 /* Data.swift */; }; + B7394891229F292F00C47603 /* rainbowlake.jpg in Resources */ = {isa = PBXBuildFile; fileRef = B7394884229F292D00C47603 /* rainbowlake.jpg */; }; + B7394893229F292F00C47603 /* icybay.jpg in Resources */ = {isa = PBXBuildFile; fileRef = B7394886229F292E00C47603 /* icybay.jpg */; }; + B7394894229F292F00C47603 /* lakemcdonald.jpg in Resources */ = {isa = PBXBuildFile; fileRef = B7394887229F292E00C47603 /* lakemcdonald.jpg */; }; + B7394895229F292F00C47603 /* turtlerock.jpg in Resources */ = {isa = PBXBuildFile; fileRef = B7394888229F292E00C47603 /* turtlerock.jpg */; }; + B7394896229F292F00C47603 /* umbagog.jpg in Resources */ = {isa = PBXBuildFile; fileRef = B7394889229F292E00C47603 /* umbagog.jpg */; }; + B7394897229F292F00C47603 /* hiddenlake.jpg in Resources */ = {isa = PBXBuildFile; fileRef = B739488A229F292E00C47603 /* hiddenlake.jpg */; }; + B7394898229F292F00C47603 /* stmarylake.jpg in Resources */ = {isa = PBXBuildFile; fileRef = B739488B229F292E00C47603 /* stmarylake.jpg */; }; + B7394899229F292F00C47603 /* twinlake.jpg in Resources */ = {isa = PBXBuildFile; fileRef = B739488C229F292E00C47603 /* twinlake.jpg */; }; + B739489A229F292F00C47603 /* silversalmoncreek.jpg in Resources */ = {isa = PBXBuildFile; fileRef = B739488D229F292E00C47603 /* silversalmoncreek.jpg */; }; + B739489B229F292F00C47603 /* landmarkData.json in Resources */ = {isa = PBXBuildFile; fileRef = B739488E229F292E00C47603 /* landmarkData.json */; }; + B739489C229F292F00C47603 /* chincoteague.jpg in Resources */ = {isa = PBXBuildFile; fileRef = B739488F229F292F00C47603 /* chincoteague.jpg */; }; + B739489D229F292F00C47603 /* chilkoottrail.jpg in Resources */ = {isa = PBXBuildFile; fileRef = B7394890229F292F00C47603 /* chilkoottrail.jpg */; }; + B739489F229F2D9700C47603 /* LandmarkRow.swift in Sources */ = {isa = PBXBuildFile; fileRef = B739489E229F2D9700C47603 /* LandmarkRow.swift */; }; + B73948A1229F2E1F00C47603 /* LandmarkList.swift in Sources */ = {isa = PBXBuildFile; fileRef = B73948A0229F2E1F00C47603 /* LandmarkList.swift */; }; + B73948A3229F3E2200C47603 /* charleyrivers.jpg in Resources */ = {isa = PBXBuildFile; fileRef = B73948A2229F3E2200C47603 /* charleyrivers.jpg */; }; + B7D2AAC5229F4D7C0061E5F5 /* UserData.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7D2AAC4229F4D7C0061E5F5 /* UserData.swift */; }; + B7D587AE229F7382006E8DCF /* BadgeBackground.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7D587AD229F7382006E8DCF /* BadgeBackground.swift */; }; + B7D587B0229F73C1006E8DCF /* BadgeSymbol.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7D587AF229F73C1006E8DCF /* BadgeSymbol.swift */; }; + B7D587B2229F7406006E8DCF /* RotatedBadgeSymbol.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7D587B1229F7406006E8DCF /* RotatedBadgeSymbol.swift */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + 35D9E74035D9800000000001 /* LICENSE.txt */ = {isa = PBXFileReference; includeInIndex = 1; path = LICENSE.txt; sourceTree = ""; }; + 37184BE037184AA000000001 /* SampleCode.xcconfig */ = {isa = PBXFileReference; name = SampleCode.xcconfig; path = ../Configuration/SampleCode.xcconfig; sourceTree = ""; }; + B7310DD0229F6839001079B9 /* HexagonParameters.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HexagonParameters.swift; sourceTree = ""; }; + B7310DD2229F6CA9001079B9 /* Badge.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Badge.swift; sourceTree = ""; }; + B7394862229F194000C47603 /* Landmarks.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Landmarks.app; sourceTree = BUILT_PRODUCTS_DIR; }; + B7394865229F194000C47603 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + B7394867229F194000C47603 /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = ""; }; + B7394869229F194000C47603 /* LandmarkDetail.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LandmarkDetail.swift; sourceTree = ""; }; + B739486B229F194200C47603 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + B739486E229F194200C47603 /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = ""; }; + B7394871229F194200C47603 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + B7394873229F194200C47603 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + B7394879229F1B3F00C47603 /* CircleImage.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CircleImage.swift; sourceTree = ""; }; + B739487B229F1B6800C47603 /* MapView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MapView.swift; sourceTree = ""; }; + B739487F229F28B900C47603 /* Landmark.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Landmark.swift; sourceTree = ""; }; + B7394880229F28B900C47603 /* Data.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Data.swift; sourceTree = ""; }; + B7394884229F292D00C47603 /* rainbowlake.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = rainbowlake.jpg; sourceTree = ""; }; + B7394886229F292E00C47603 /* icybay.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = icybay.jpg; sourceTree = ""; }; + B7394887229F292E00C47603 /* lakemcdonald.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = lakemcdonald.jpg; sourceTree = ""; }; + B7394888229F292E00C47603 /* turtlerock.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = turtlerock.jpg; sourceTree = ""; }; + B7394889229F292E00C47603 /* umbagog.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = umbagog.jpg; sourceTree = ""; }; + B739488A229F292E00C47603 /* hiddenlake.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = hiddenlake.jpg; sourceTree = ""; }; + B739488B229F292E00C47603 /* stmarylake.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = stmarylake.jpg; sourceTree = ""; }; + B739488C229F292E00C47603 /* twinlake.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = twinlake.jpg; sourceTree = ""; }; + B739488D229F292E00C47603 /* silversalmoncreek.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = silversalmoncreek.jpg; sourceTree = ""; }; + B739488E229F292E00C47603 /* landmarkData.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = landmarkData.json; sourceTree = ""; }; + B739488F229F292F00C47603 /* chincoteague.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = chincoteague.jpg; sourceTree = ""; }; + B7394890229F292F00C47603 /* chilkoottrail.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = chilkoottrail.jpg; sourceTree = ""; }; + B739489E229F2D9700C47603 /* LandmarkRow.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = LandmarkRow.swift; path = "Supporting Views/LandmarkRow.swift"; sourceTree = ""; }; + B73948A0229F2E1F00C47603 /* LandmarkList.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LandmarkList.swift; sourceTree = ""; }; + B73948A2229F3E2200C47603 /* charleyrivers.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = charleyrivers.jpg; sourceTree = ""; }; + B7D2AAC4229F4D7C0061E5F5 /* UserData.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UserData.swift; sourceTree = ""; }; + B7D587AD229F7382006E8DCF /* BadgeBackground.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BadgeBackground.swift; sourceTree = ""; }; + B7D587AF229F73C1006E8DCF /* BadgeSymbol.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BadgeSymbol.swift; sourceTree = ""; }; + B7D587B1229F7406006E8DCF /* RotatedBadgeSymbol.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RotatedBadgeSymbol.swift; sourceTree = ""; }; + C4E4AAA0C4E4035000000001 /* README.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; name = README.md; path = ../README.md; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + B739485F229F194000C47603 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 35DA7F6035D9B10000000001 /* LICENSE */ = { + isa = PBXGroup; + children = ( + 35D9E74035D9800000000001 /* LICENSE.txt */, + ); + name = LICENSE; + path = ../LICENSE; + sourceTree = ""; + }; + 37184C6037184C2000000001 /* Configuration */ = { + isa = PBXGroup; + children = ( + 37184BE037184AA000000001 /* SampleCode.xcconfig */, + ); + name = Configuration; + sourceTree = ""; + }; + B7394859229F194000C47603 = { + isa = PBXGroup; + children = ( + C4E4AAA0C4E4035000000001 /* README.md */, + B7394864229F194000C47603 /* Landmarks */, + B7394863229F194000C47603 /* Products */, + 37184C6037184C2000000001 /* Configuration */, + 35DA7F6035D9B10000000001 /* LICENSE */, + ); + sourceTree = ""; + }; + B7394863229F194000C47603 /* Products */ = { + isa = PBXGroup; + children = ( + B7394862229F194000C47603 /* Landmarks.app */, + ); + name = Products; + sourceTree = ""; + }; + B7394864229F194000C47603 /* Landmarks */ = { + isa = PBXGroup; + children = ( + B739487E229F282200C47603 /* Models */, + B7394865229F194000C47603 /* AppDelegate.swift */, + B7394867229F194000C47603 /* SceneDelegate.swift */, + B73948A0229F2E1F00C47603 /* LandmarkList.swift */, + B739489E229F2D9700C47603 /* LandmarkRow.swift */, + B7394869229F194000C47603 /* LandmarkDetail.swift */, + B7310DD0229F6839001079B9 /* HexagonParameters.swift */, + B739487D229F1C0100C47603 /* Supporting Views */, + B7394883229F291A00C47603 /* Resources */, + B739486B229F194200C47603 /* Assets.xcassets */, + B7394870229F194200C47603 /* LaunchScreen.storyboard */, + B7394873229F194200C47603 /* Info.plist */, + B739486D229F194200C47603 /* Preview Content */, + ); + path = Landmarks; + sourceTree = ""; + }; + B739486D229F194200C47603 /* Preview Content */ = { + isa = PBXGroup; + children = ( + B739486E229F194200C47603 /* Preview Assets.xcassets */, + ); + path = "Preview Content"; + sourceTree = ""; + }; + B739487D229F1C0100C47603 /* Supporting Views */ = { + isa = PBXGroup; + children = ( + B7394879229F1B3F00C47603 /* CircleImage.swift */, + B739487B229F1B6800C47603 /* MapView.swift */, + B7310DD2229F6CA9001079B9 /* Badge.swift */, + B7D587AF229F73C1006E8DCF /* BadgeSymbol.swift */, + B7D587B1229F7406006E8DCF /* RotatedBadgeSymbol.swift */, + B7D587AD229F7382006E8DCF /* BadgeBackground.swift */, + ); + path = "Supporting Views"; + sourceTree = ""; + }; + B739487E229F282200C47603 /* Models */ = { + isa = PBXGroup; + children = ( + B7394880229F28B900C47603 /* Data.swift */, + B739487F229F28B900C47603 /* Landmark.swift */, + B7D2AAC4229F4D7C0061E5F5 /* UserData.swift */, + ); + path = Models; + sourceTree = ""; + }; + B7394883229F291A00C47603 /* Resources */ = { + isa = PBXGroup; + children = ( + B739488E229F292E00C47603 /* landmarkData.json */, + B7394890229F292F00C47603 /* chilkoottrail.jpg */, + B739488F229F292F00C47603 /* chincoteague.jpg */, + B739488A229F292E00C47603 /* hiddenlake.jpg */, + B7394886229F292E00C47603 /* icybay.jpg */, + B7394887229F292E00C47603 /* lakemcdonald.jpg */, + B7394884229F292D00C47603 /* rainbowlake.jpg */, + B739488D229F292E00C47603 /* silversalmoncreek.jpg */, + B739488B229F292E00C47603 /* stmarylake.jpg */, + B7394888229F292E00C47603 /* turtlerock.jpg */, + B739488C229F292E00C47603 /* twinlake.jpg */, + B7394889229F292E00C47603 /* umbagog.jpg */, + B73948A2229F3E2200C47603 /* charleyrivers.jpg */, + ); + path = Resources; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + B7394861229F194000C47603 /* Landmarks */ = { + isa = PBXNativeTarget; + buildConfigurationList = B7394876229F194200C47603 /* Build configuration list for PBXNativeTarget "Landmarks" */; + buildPhases = ( + B739485E229F194000C47603 /* Sources */, + B739485F229F194000C47603 /* Frameworks */, + B7394860229F194000C47603 /* Resources */, + C602AC70C605937000000001, + ); + buildRules = ( + ); + dependencies = ( + ); + name = Landmarks; + productName = Landmarks; + productReference = B7394862229F194000C47603 /* Landmarks.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + B739485A229F194000C47603 /* Project object */ = { + isa = PBXProject; + attributes = { + LastSwiftUpdateCheck = 1100; + LastUpgradeCheck = 1100; + ORGANIZATIONNAME = Apple; + TargetAttributes = { + B7394861229F194000C47603 = { + CreatedOnToolsVersion = 11.0; + }; + }; + }; + buildConfigurationList = B739485D229F194000C47603 /* Build configuration list for PBXProject "DrawingPathsAndShapes" */; + compatibilityVersion = "Xcode 9.3"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = B7394859229F194000C47603; + productRefGroup = B7394863229F194000C47603 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + B7394861229F194000C47603 /* Landmarks */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + B7394860229F194000C47603 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + B739489A229F292F00C47603 /* silversalmoncreek.jpg in Resources */, + B7394894229F292F00C47603 /* lakemcdonald.jpg in Resources */, + B7394872229F194200C47603 /* LaunchScreen.storyboard in Resources */, + B73948A3229F3E2200C47603 /* charleyrivers.jpg in Resources */, + B7394891229F292F00C47603 /* rainbowlake.jpg in Resources */, + B739486F229F194200C47603 /* Preview Assets.xcassets in Resources */, + B7394895229F292F00C47603 /* turtlerock.jpg in Resources */, + B739486C229F194200C47603 /* Assets.xcassets in Resources */, + B7394899229F292F00C47603 /* twinlake.jpg in Resources */, + B7394896229F292F00C47603 /* umbagog.jpg in Resources */, + B739489D229F292F00C47603 /* chilkoottrail.jpg in Resources */, + B739489C229F292F00C47603 /* chincoteague.jpg in Resources */, + B739489B229F292F00C47603 /* landmarkData.json in Resources */, + B7394893229F292F00C47603 /* icybay.jpg in Resources */, + B7394897229F292F00C47603 /* hiddenlake.jpg in Resources */, + B7394898229F292F00C47603 /* stmarylake.jpg in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + B739485E229F194000C47603 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + B7394882229F28B900C47603 /* Data.swift in Sources */, + B7310DD3229F6CA9001079B9 /* Badge.swift in Sources */, + B7394866229F194000C47603 /* AppDelegate.swift in Sources */, + B739487A229F1B3F00C47603 /* CircleImage.swift in Sources */, + B739487C229F1B6800C47603 /* MapView.swift in Sources */, + B7310DD1229F6839001079B9 /* HexagonParameters.swift in Sources */, + B73948A1229F2E1F00C47603 /* LandmarkList.swift in Sources */, + B7D587B0229F73C1006E8DCF /* BadgeSymbol.swift in Sources */, + B7D587B2229F7406006E8DCF /* RotatedBadgeSymbol.swift in Sources */, + B7394868229F194000C47603 /* SceneDelegate.swift in Sources */, + B7D587AE229F7382006E8DCF /* BadgeBackground.swift in Sources */, + B739486A229F194000C47603 /* LandmarkDetail.swift in Sources */, + B739489F229F2D9700C47603 /* LandmarkRow.swift in Sources */, + B7D2AAC5229F4D7C0061E5F5 /* UserData.swift in Sources */, + B7394881229F28B900C47603 /* Landmark.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXVariantGroup section */ + B7394870229F194200C47603 /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + B7394871229F194200C47603 /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + B7394874229F194200C47603 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 37184BE037184AA000000001 /* SampleCode.xcconfig */; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 13.0; + MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; + MTL_FAST_MATH = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + }; + name = Debug; + }; + B7394875229F194200C47603 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 37184BE037184AA000000001 /* SampleCode.xcconfig */; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 13.0; + MTL_ENABLE_DEBUG_INFO = NO; + MTL_FAST_MATH = YES; + SDKROOT = iphoneos; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + B7394877229F194200C47603 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 37184BE037184AA000000001 /* SampleCode.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_ASSET_PATHS = "Landmarks/Preview\\ Content"; + DEVELOPMENT_TEAM = ""; + ENABLE_PREVIEWS = YES; + INFOPLIST_FILE = Landmarks/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = "com.example.apple-samplecode.Landmarks${SAMPLE_CODE_DISAMBIGUATOR}"; + PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE_SPECIFIER = ""; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + B7394878229F194200C47603 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 37184BE037184AA000000001 /* SampleCode.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_ASSET_PATHS = "Landmarks/Preview\\ Content"; + DEVELOPMENT_TEAM = ""; + ENABLE_PREVIEWS = YES; + INFOPLIST_FILE = Landmarks/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = "com.example.apple-samplecode.Landmarks${SAMPLE_CODE_DISAMBIGUATOR}"; + PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE_SPECIFIER = ""; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + B739485D229F194000C47603 /* Build configuration list for PBXProject "DrawingPathsAndShapes" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + B7394874229F194200C47603 /* Debug */, + B7394875229F194200C47603 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + B7394876229F194200C47603 /* Build configuration list for PBXNativeTarget "Landmarks" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + B7394877229F194200C47603 /* Debug */, + B7394878229F194200C47603 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = B739485A229F194000C47603 /* Project object */; +} diff --git a/Examples/DrawingPathsAndShapes/Complete/Landmarks/DrawingPathsAndShapes.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/Examples/DrawingPathsAndShapes/Complete/Landmarks/DrawingPathsAndShapes.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings new file mode 100755 index 0000000..3ddf867 --- /dev/null +++ b/Examples/DrawingPathsAndShapes/Complete/Landmarks/DrawingPathsAndShapes.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings @@ -0,0 +1,8 @@ + + + + + BuildSystemType + Latest + + diff --git a/Examples/DrawingPathsAndShapes/Complete/Landmarks/Landmarks/AppDelegate.swift b/Examples/DrawingPathsAndShapes/Complete/Landmarks/Landmarks/AppDelegate.swift new file mode 100755 index 0000000..e22943b --- /dev/null +++ b/Examples/DrawingPathsAndShapes/Complete/Landmarks/Landmarks/AppDelegate.swift @@ -0,0 +1,36 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +The application delegate. +*/ + +import UIKit + +@UIApplicationMain +class AppDelegate: UIResponder, UIApplicationDelegate { + + func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { + // Override point for customization after application launch. + return true + } + + func applicationWillTerminate(_ application: UIApplication) { + // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. + } + + // MARK: UISceneSession Lifecycle + func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration { + // Called when a new scene session is being created. + // Use this method to select a configuration to create the new scene with. + return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role) + } + + func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set) { + // Called when the user discards a scene session. + // If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions. + // Use this method to release any resources that were specific to the discarded scenes, as they will not return. + } + +} + diff --git a/Examples/DrawingPathsAndShapes/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/Contents.json b/Examples/DrawingPathsAndShapes/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100755 index 0000000..fa0d2db --- /dev/null +++ b/Examples/DrawingPathsAndShapes/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,113 @@ +{ + "images" : [ + { + "size" : "20x20", + "idiom" : "iphone", + "filename" : "landmark_app_icon_40x40.png", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "20x20", + "scale" : "3x" + }, + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "landmark_app_icon_58x58.png", + "scale" : "2x" + }, + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "landmark_app_icon_87x87.png", + "scale" : "3x" + }, + { + "size" : "40x40", + "idiom" : "iphone", + "filename" : "landmark_app_icon_80x80.png", + "scale" : "2x" + }, + { + "size" : "40x40", + "idiom" : "iphone", + "filename" : "landmark_app_icon_120x120.png", + "scale" : "3x" + }, + { + "size" : "60x60", + "idiom" : "iphone", + "filename" : "landmark_app_icon_120x120-1.png", + "scale" : "2x" + }, + { + "size" : "60x60", + "idiom" : "iphone", + "filename" : "landmark_app_icon_180x180.png", + "scale" : "3x" + }, + { + "idiom" : "ipad", + "size" : "20x20", + "scale" : "1x" + }, + { + "size" : "20x20", + "idiom" : "ipad", + "filename" : "landmark_app_icon_40x40-1.png", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "29x29", + "scale" : "1x" + }, + { + "size" : "29x29", + "idiom" : "ipad", + "filename" : "landmark_app_icon_58x58-1.png", + "scale" : "2x" + }, + { + "size" : "40x40", + "idiom" : "ipad", + "filename" : "landmark_app_icon_40x40-2.png", + "scale" : "1x" + }, + { + "size" : "40x40", + "idiom" : "ipad", + "filename" : "landmark_app_icon_80x80-1.png", + "scale" : "2x" + }, + { + "size" : "76x76", + "idiom" : "ipad", + "filename" : "landmark_app_icon_76x76.png", + "scale" : "1x" + }, + { + "size" : "76x76", + "idiom" : "ipad", + "filename" : "landmark_app_icon_152x152.png", + "scale" : "2x" + }, + { + "size" : "83.5x83.5", + "idiom" : "ipad", + "filename" : "landmark_app_icon_167x167.png", + "scale" : "2x" + }, + { + "size" : "1024x1024", + "idiom" : "ios-marketing", + "filename" : "landmark_app_icon_1024x1024.png", + "scale" : "1x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Examples/DrawingPathsAndShapes/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_1024x1024.png b/Examples/DrawingPathsAndShapes/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_1024x1024.png new file mode 100755 index 0000000..00d81c1 Binary files /dev/null and b/Examples/DrawingPathsAndShapes/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_1024x1024.png differ diff --git a/Examples/DrawingPathsAndShapes/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_120x120-1.png b/Examples/DrawingPathsAndShapes/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_120x120-1.png new file mode 100755 index 0000000..d382b8b Binary files /dev/null and b/Examples/DrawingPathsAndShapes/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_120x120-1.png differ diff --git a/Examples/DrawingPathsAndShapes/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_120x120.png b/Examples/DrawingPathsAndShapes/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_120x120.png new file mode 100755 index 0000000..d382b8b Binary files /dev/null and b/Examples/DrawingPathsAndShapes/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_120x120.png differ diff --git a/Examples/DrawingPathsAndShapes/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_152x152.png b/Examples/DrawingPathsAndShapes/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_152x152.png new file mode 100755 index 0000000..11057f8 Binary files /dev/null and b/Examples/DrawingPathsAndShapes/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_152x152.png differ diff --git a/Examples/DrawingPathsAndShapes/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_167x167.png b/Examples/DrawingPathsAndShapes/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_167x167.png new file mode 100755 index 0000000..f73bc26 Binary files /dev/null and b/Examples/DrawingPathsAndShapes/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_167x167.png differ diff --git a/Examples/DrawingPathsAndShapes/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_180x180.png b/Examples/DrawingPathsAndShapes/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_180x180.png new file mode 100755 index 0000000..b02738c Binary files /dev/null and b/Examples/DrawingPathsAndShapes/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_180x180.png differ diff --git a/Examples/DrawingPathsAndShapes/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_40x40-1.png b/Examples/DrawingPathsAndShapes/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_40x40-1.png new file mode 100755 index 0000000..abaff0e Binary files /dev/null and b/Examples/DrawingPathsAndShapes/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_40x40-1.png differ diff --git a/Examples/DrawingPathsAndShapes/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_40x40-2.png b/Examples/DrawingPathsAndShapes/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_40x40-2.png new file mode 100755 index 0000000..abaff0e Binary files /dev/null and b/Examples/DrawingPathsAndShapes/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_40x40-2.png differ diff --git a/Examples/DrawingPathsAndShapes/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_40x40.png b/Examples/DrawingPathsAndShapes/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_40x40.png new file mode 100755 index 0000000..abaff0e Binary files /dev/null and b/Examples/DrawingPathsAndShapes/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_40x40.png differ diff --git a/Examples/DrawingPathsAndShapes/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_58x58-1.png b/Examples/DrawingPathsAndShapes/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_58x58-1.png new file mode 100755 index 0000000..cf7c73d Binary files /dev/null and b/Examples/DrawingPathsAndShapes/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_58x58-1.png differ diff --git a/Examples/DrawingPathsAndShapes/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_58x58.png b/Examples/DrawingPathsAndShapes/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_58x58.png new file mode 100755 index 0000000..cf7c73d Binary files /dev/null and b/Examples/DrawingPathsAndShapes/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_58x58.png differ diff --git a/Examples/DrawingPathsAndShapes/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_76x76.png b/Examples/DrawingPathsAndShapes/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_76x76.png new file mode 100755 index 0000000..3eff85b Binary files /dev/null and b/Examples/DrawingPathsAndShapes/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_76x76.png differ diff --git a/Examples/DrawingPathsAndShapes/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_80x80-1.png b/Examples/DrawingPathsAndShapes/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_80x80-1.png new file mode 100755 index 0000000..6f33f66 Binary files /dev/null and b/Examples/DrawingPathsAndShapes/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_80x80-1.png differ diff --git a/Examples/DrawingPathsAndShapes/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_80x80.png b/Examples/DrawingPathsAndShapes/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_80x80.png new file mode 100755 index 0000000..6f33f66 Binary files /dev/null and b/Examples/DrawingPathsAndShapes/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_80x80.png differ diff --git a/Examples/DrawingPathsAndShapes/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_87x87.png b/Examples/DrawingPathsAndShapes/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_87x87.png new file mode 100755 index 0000000..9e1616c Binary files /dev/null and b/Examples/DrawingPathsAndShapes/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_87x87.png differ diff --git a/Examples/DrawingPathsAndShapes/Complete/Landmarks/Landmarks/Assets.xcassets/Contents.json b/Examples/DrawingPathsAndShapes/Complete/Landmarks/Landmarks/Assets.xcassets/Contents.json new file mode 100755 index 0000000..da4a164 --- /dev/null +++ b/Examples/DrawingPathsAndShapes/Complete/Landmarks/Landmarks/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Examples/DrawingPathsAndShapes/Complete/Landmarks/Landmarks/Assets.xcassets/turtlerock.imageset/Contents.json b/Examples/DrawingPathsAndShapes/Complete/Landmarks/Landmarks/Assets.xcassets/turtlerock.imageset/Contents.json new file mode 100755 index 0000000..5bfd7bf --- /dev/null +++ b/Examples/DrawingPathsAndShapes/Complete/Landmarks/Landmarks/Assets.xcassets/turtlerock.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "turtlerock.jpg", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Examples/DrawingPathsAndShapes/Complete/Landmarks/Landmarks/Assets.xcassets/turtlerock.imageset/turtlerock.jpg b/Examples/DrawingPathsAndShapes/Complete/Landmarks/Landmarks/Assets.xcassets/turtlerock.imageset/turtlerock.jpg new file mode 100755 index 0000000..68bcd3e Binary files /dev/null and b/Examples/DrawingPathsAndShapes/Complete/Landmarks/Landmarks/Assets.xcassets/turtlerock.imageset/turtlerock.jpg differ diff --git a/Examples/DrawingPathsAndShapes/Complete/Landmarks/Landmarks/Base.lproj/LaunchScreen.storyboard b/Examples/DrawingPathsAndShapes/Complete/Landmarks/Landmarks/Base.lproj/LaunchScreen.storyboard new file mode 100755 index 0000000..865e932 --- /dev/null +++ b/Examples/DrawingPathsAndShapes/Complete/Landmarks/Landmarks/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Examples/DrawingPathsAndShapes/Complete/Landmarks/Landmarks/HexagonParameters.swift b/Examples/DrawingPathsAndShapes/Complete/Landmarks/Landmarks/HexagonParameters.swift new file mode 100755 index 0000000..8decba4 --- /dev/null +++ b/Examples/DrawingPathsAndShapes/Complete/Landmarks/Landmarks/HexagonParameters.swift @@ -0,0 +1,57 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +Size, position, and other information used to draw a badge. +*/ + +import SwiftUI + +struct HexagonParameters { + struct Segment { + let useWidth: (CGFloat, CGFloat, CGFloat) + let xFactors: (CGFloat, CGFloat, CGFloat) + let useHeight: (CGFloat, CGFloat, CGFloat) + let yFactors: (CGFloat, CGFloat, CGFloat) + } + + static let adjustment: CGFloat = 0.085 + static let points = [ + Segment( + useWidth: (1.00, 1.00, 1.00), + xFactors: (0.60, 0.40, 0.50), + useHeight: (1.00, 1.00, 0.00), + yFactors: (0.05, 0.05, 0.00) + ), + Segment( + useWidth: (1.00, 1.00, 0.00), + xFactors: (0.05, 0.00, 0.00), + useHeight: (1.00, 1.00, 1.00), + yFactors: (0.20 + adjustment, 0.30 + adjustment, 0.25 + adjustment) + ), + Segment( + useWidth: (1.00, 1.00, 0.00), + xFactors: (0.00, 0.05, 0.00), + useHeight: (1.00, 1.00, 1.00), + yFactors: (0.70 - adjustment, 0.80 - adjustment, 0.75 - adjustment) + ), + Segment( + useWidth: (1.00, 1.00, 1.00), + xFactors: (0.40, 0.60, 0.50), + useHeight: (1.00, 1.00, 1.00), + yFactors: (0.95, 0.95, 1.00) + ), + Segment( + useWidth: (1.00, 1.00, 1.00), + xFactors: (0.95, 1.00, 1.00), + useHeight: (1.00, 1.00, 1.00), + yFactors: (0.80 - adjustment, 0.70 - adjustment, 0.75 - adjustment) + ), + Segment( + useWidth: (1.00, 1.00, 1.00), + xFactors: (1.00, 0.95, 1.00), + useHeight: (1.00, 1.00, 1.00), + yFactors: (0.30 + adjustment, 0.20 + adjustment, 0.25 + adjustment) + ) + ] +} diff --git a/Examples/DrawingPathsAndShapes/Complete/Landmarks/Landmarks/Info.plist b/Examples/DrawingPathsAndShapes/Complete/Landmarks/Landmarks/Info.plist new file mode 100755 index 0000000..e8bb4c6 --- /dev/null +++ b/Examples/DrawingPathsAndShapes/Complete/Landmarks/Landmarks/Info.plist @@ -0,0 +1,62 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + $(PRODUCT_BUNDLE_PACKAGE_TYPE) + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1 + LSRequiresIPhoneOS + + UIApplicationSceneManifest + + UIApplicationSupportsMultipleScenes + + UISceneConfigurations + + UIWindowSceneSessionRoleApplication + + + UILaunchStoryboardName + LaunchScreen + UISceneConfigurationName + Default Configuration + UISceneDelegateClassName + $(PRODUCT_MODULE_NAME).SceneDelegate + + + + + UILaunchStoryboardName + LaunchScreen + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/Examples/DrawingPathsAndShapes/Complete/Landmarks/Landmarks/LandmarkDetail.swift b/Examples/DrawingPathsAndShapes/Complete/Landmarks/Landmarks/LandmarkDetail.swift new file mode 100755 index 0000000..6c290a3 --- /dev/null +++ b/Examples/DrawingPathsAndShapes/Complete/Landmarks/Landmarks/LandmarkDetail.swift @@ -0,0 +1,71 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +A view showing the details for a landmark. +*/ + +import SwiftUI + +struct LandmarkDetail: View { + @EnvironmentObject var userData: UserData + var landmark: Landmark + + var landmarkIndex: Int { + userData.landmarks.firstIndex(where: { $0.id == landmark.id })! + } + + var body: some View { + VStack { + MapView(coordinate: landmark.locationCoordinate) + .edgesIgnoringSafeArea(.top) + .frame(height: 300) + + CircleImage(image: landmark.image(forSize: 250)) + .offset(x: 0, y: -130) + .padding(.bottom, -130) + + VStack(alignment: .leading) { + HStack { + Text(verbatim: landmark.name) + .font(.title) + + Button(action: { + self.userData.landmarks[self.landmarkIndex] + .isFavorite.toggle() + }) { + if self.userData.landmarks[self.landmarkIndex] + .isFavorite { + Image(systemName: "star.fill") + .foregroundColor(Color.yellow) + } else { + Image(systemName: "star") + .foregroundColor(Color.gray) + } + } + } + + HStack(alignment: .top) { + Text(verbatim: landmark.park) + .font(.subheadline) + Spacer() + Text(verbatim: landmark.state) + .font(.subheadline) + } + } + .padding() + + Spacer() + } + } +} + +#if DEBUG +struct LandmarkDetail_Preview: PreviewProvider { + static var previews: some View { + let userData = UserData() + return LandmarkDetail(landmark: userData.landmarks[0]) + .environmentObject(userData) + } +} +#endif diff --git a/Examples/DrawingPathsAndShapes/Complete/Landmarks/Landmarks/LandmarkList.swift b/Examples/DrawingPathsAndShapes/Complete/Landmarks/Landmarks/LandmarkList.swift new file mode 100755 index 0000000..c17b5f3 --- /dev/null +++ b/Examples/DrawingPathsAndShapes/Complete/Landmarks/Landmarks/LandmarkList.swift @@ -0,0 +1,45 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +A view showing a list of landmarks. +*/ + +import SwiftUI + +struct LandmarkList: View { + @EnvironmentObject private var userData: UserData + + var body: some View { + NavigationView { + List { + Toggle(isOn: $userData.showFavoritesOnly) { + Text("Show Favorites Only") + } + + ForEach(userData.landmarks) { landmark in + if !self.userData.showFavoritesOnly || landmark.isFavorite { + NavigationButton( + destination: LandmarkDetail(landmark: landmark)) { + LandmarkRow(landmark: landmark) + } + } + } + } + .navigationBarTitle(Text("Landmarks"), displayMode: .large) + } + } +} + +#if DEBUG +struct LandmarksList_Previews: PreviewProvider { + static var previews: some View { + ForEach(["iPhone SE", "iPhone XS Max"].identified(by: \.self)) { deviceName in + LandmarkList() + .previewDevice(PreviewDevice(rawValue: deviceName)) + .previewDisplayName(deviceName) + } + .environmentObject(UserData()) + } +} +#endif diff --git a/Examples/DrawingPathsAndShapes/Complete/Landmarks/Landmarks/Models/Data.swift b/Examples/DrawingPathsAndShapes/Complete/Landmarks/Landmarks/Models/Data.swift new file mode 100755 index 0000000..78837f6 --- /dev/null +++ b/Examples/DrawingPathsAndShapes/Complete/Landmarks/Landmarks/Models/Data.swift @@ -0,0 +1,93 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +Helpers for loading images and data. +*/ + +import UIKit +import SwiftUI +import CoreLocation + +let landmarkData: [Landmark] = load("landmarkData.json") + +func load(_ filename: String, as type: T.Type = T.self) -> T { + let data: Data + + guard let file = Bundle.main.url(forResource: filename, withExtension: nil) + else { + fatalError("Couldn't find \(filename) in main bundle.") + } + + do { + data = try Data(contentsOf: file) + } catch { + fatalError("Couldn't load \(filename) from main bundle:\n\(error)") + } + + do { + let decoder = JSONDecoder() + return try decoder.decode(T.self, from: data) + } catch { + fatalError("Couldn't parse \(filename) as \(T.self):\n\(error)") + } +} + +final class ImageStore { + fileprivate typealias _ImageDictionary = [String: [Int: CGImage]] + fileprivate var images: _ImageDictionary = [:] + + fileprivate static var originalSize = 250 + fileprivate static var scale = 2 + + static var shared = ImageStore() + + func image(name: String, size: Int) -> Image { + let index = _guaranteeInitialImage(name: name) + + let sizedImage = images.values[index][size] + ?? _sizeImage(images.values[index][ImageStore.originalSize]!, to: size * ImageStore.scale) + images.values[index][size] = sizedImage + + return Image(sizedImage, scale: Length(ImageStore.scale), label: Text(verbatim: name)) + } + + fileprivate func _guaranteeInitialImage(name: String) -> _ImageDictionary.Index { + if let index = images.index(forKey: name) { return index } + + guard + let url = Bundle.main.url(forResource: name, withExtension: "jpg"), + let imageSource = CGImageSourceCreateWithURL(url as NSURL, nil), + let image = CGImageSourceCreateImageAtIndex(imageSource, 0, nil) + else { + fatalError("Couldn't load image \(name).jpg from main bundle.") + } + + images[name] = [ImageStore.originalSize: image] + return images.index(forKey: name)! + } + + fileprivate func _sizeImage(_ image: CGImage, to size: Int) -> CGImage { + guard + let colorSpace = image.colorSpace, + let context = CGContext( + data: nil, + width: size, height: size, + bitsPerComponent: image.bitsPerComponent, + bytesPerRow: image.bytesPerRow, + space: colorSpace, + bitmapInfo: image.bitmapInfo.rawValue) + else { + fatalError("Couldn't create graphics context.") + } + context.interpolationQuality = .high + context.draw(image, in: CGRect(x: 0, y: 0, width: size, height: size)) + + if let sizedImage = context.makeImage() { + return sizedImage + } else { + fatalError("Couldn't resize image.") + } + } +} + diff --git a/Examples/DrawingPathsAndShapes/Complete/Landmarks/Landmarks/Models/Landmark.swift b/Examples/DrawingPathsAndShapes/Complete/Landmarks/Landmarks/Models/Landmark.swift new file mode 100755 index 0000000..79b9aa4 --- /dev/null +++ b/Examples/DrawingPathsAndShapes/Complete/Landmarks/Landmarks/Models/Landmark.swift @@ -0,0 +1,42 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +The model for an individual landmark. +*/ + +import SwiftUI +import CoreLocation + +struct Landmark: Hashable, Codable, Identifiable { + var id: Int + var name: String + fileprivate var imageName: String + fileprivate var coordinates: Coordinates + var state: String + var park: String + var category: Category + var isFavorite: Bool + + var locationCoordinate: CLLocationCoordinate2D { + CLLocationCoordinate2D( + latitude: coordinates.latitude, + longitude: coordinates.longitude) + } + + func image(forSize size: Int) -> Image { + ImageStore.shared.image(name: imageName, size: size) + } + + enum Category: String, CaseIterable, Codable, Hashable { + case featured = "Featured" + case lakes = "Lakes" + case rivers = "Rivers" + case mountains = "Mountains" + } +} + +struct Coordinates: Hashable, Codable { + var latitude: Double + var longitude: Double +} diff --git a/Examples/DrawingPathsAndShapes/Complete/Landmarks/Landmarks/Models/UserData.swift b/Examples/DrawingPathsAndShapes/Complete/Landmarks/Landmarks/Models/UserData.swift new file mode 100755 index 0000000..db31fb0 --- /dev/null +++ b/Examples/DrawingPathsAndShapes/Complete/Landmarks/Landmarks/Models/UserData.swift @@ -0,0 +1,25 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +A model object that stores app data. +*/ + +import Combine +import SwiftUI + +final class UserData: BindableObject { + let didChange = PassthroughSubject() + + var showFavoritesOnly = false { + didSet { + didChange.send(self) + } + } + + var landmarks = landmarkData { + didSet { + didChange.send(self) + } + } +} diff --git a/Examples/DrawingPathsAndShapes/Complete/Landmarks/Landmarks/Preview Content/Preview Assets.xcassets/Contents.json b/Examples/DrawingPathsAndShapes/Complete/Landmarks/Landmarks/Preview Content/Preview Assets.xcassets/Contents.json new file mode 100755 index 0000000..da4a164 --- /dev/null +++ b/Examples/DrawingPathsAndShapes/Complete/Landmarks/Landmarks/Preview Content/Preview Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Examples/DrawingPathsAndShapes/Complete/Landmarks/Landmarks/Resources/charleyrivers.jpg b/Examples/DrawingPathsAndShapes/Complete/Landmarks/Landmarks/Resources/charleyrivers.jpg new file mode 100755 index 0000000..17ff44b Binary files /dev/null and b/Examples/DrawingPathsAndShapes/Complete/Landmarks/Landmarks/Resources/charleyrivers.jpg differ diff --git a/Examples/DrawingPathsAndShapes/Complete/Landmarks/Landmarks/Resources/chilkoottrail.jpg b/Examples/DrawingPathsAndShapes/Complete/Landmarks/Landmarks/Resources/chilkoottrail.jpg new file mode 100755 index 0000000..e7f805e Binary files /dev/null and b/Examples/DrawingPathsAndShapes/Complete/Landmarks/Landmarks/Resources/chilkoottrail.jpg differ diff --git a/Examples/DrawingPathsAndShapes/Complete/Landmarks/Landmarks/Resources/chincoteague.jpg b/Examples/DrawingPathsAndShapes/Complete/Landmarks/Landmarks/Resources/chincoteague.jpg new file mode 100755 index 0000000..5f47986 Binary files /dev/null and b/Examples/DrawingPathsAndShapes/Complete/Landmarks/Landmarks/Resources/chincoteague.jpg differ diff --git a/Examples/DrawingPathsAndShapes/Complete/Landmarks/Landmarks/Resources/hiddenlake.jpg b/Examples/DrawingPathsAndShapes/Complete/Landmarks/Landmarks/Resources/hiddenlake.jpg new file mode 100755 index 0000000..d8e804c Binary files /dev/null and b/Examples/DrawingPathsAndShapes/Complete/Landmarks/Landmarks/Resources/hiddenlake.jpg differ diff --git a/Examples/DrawingPathsAndShapes/Complete/Landmarks/Landmarks/Resources/icybay.jpg b/Examples/DrawingPathsAndShapes/Complete/Landmarks/Landmarks/Resources/icybay.jpg new file mode 100755 index 0000000..feb1764 Binary files /dev/null and b/Examples/DrawingPathsAndShapes/Complete/Landmarks/Landmarks/Resources/icybay.jpg differ diff --git a/Examples/DrawingPathsAndShapes/Complete/Landmarks/Landmarks/Resources/lakemcdonald.jpg b/Examples/DrawingPathsAndShapes/Complete/Landmarks/Landmarks/Resources/lakemcdonald.jpg new file mode 100755 index 0000000..bd9d6b9 Binary files /dev/null and b/Examples/DrawingPathsAndShapes/Complete/Landmarks/Landmarks/Resources/lakemcdonald.jpg differ diff --git a/Examples/DrawingPathsAndShapes/Complete/Landmarks/Landmarks/Resources/landmarkData.json b/Examples/DrawingPathsAndShapes/Complete/Landmarks/Landmarks/Resources/landmarkData.json new file mode 100755 index 0000000..e5b14fc --- /dev/null +++ b/Examples/DrawingPathsAndShapes/Complete/Landmarks/Landmarks/Resources/landmarkData.json @@ -0,0 +1,182 @@ +[ + { + "name": "Turtle Rock", + "category": "Rivers", + "city": "Twentynine Palms", + "state": "California", + "id": 1001, + "isFeatured": true, + "isFavorite": true, + "park": "Joshua Tree National Park", + "coordinates": { + "longitude": -116.166868, + "latitude": 34.011286 + }, + "imageName": "turtlerock" + }, + { + "name": "Silver Salmon Creek", + "category": "Lakes", + "city": "Port Alsworth", + "state": "Alaska", + "id": 1002, + "isFeatured": false, + "isFavorite": false, + "park": "Lake Clark National Park and Preserve", + "coordinates": { + "longitude": -152.665167, + "latitude": 59.980167 + }, + "imageName": "silversalmoncreek" + }, + { + "name": "Chilkoot Trail", + "category": "Mountains", + "city": "Skagway", + "state": "Alaska", + "id": 1003, + "isFeatured": false, + "isFavorite": true, + "park": "Klondike Gold Rush National Historical Park", + "coordinates": { + "longitude": -135.334571, + "latitude": 59.560551 + }, + "imageName": "chilkoottrail" + }, + { + "name": "St. Mary Lake", + "category": "Lakes", + "city": "Browning", + "state": "Montana", + "id": 1004, + "isFeatured": true, + "isFavorite": true, + "park": "Glacier National Park", + "coordinates": { + "longitude": -113.536248, + "latitude": 48.69423 + }, + "imageName": "stmarylake" + }, + { + "name": "Twin Lake", + "category": "Lakes", + "city": "Twin Lakes", + "state": "Alaska", + "id": 1005, + "isFeatured": false, + "isFavorite": false, + "park": "Lake Clark National Park and Preserve", + "coordinates": { + "longitude": -153.849883, + "latitude": 60.641684 + }, + "imageName": "twinlake" + }, + { + "name": "Lake McDonald", + "category": "Mountains", + "city": "West Glacier", + "state": "Montana", + "id": 1006, + "isFeatured": false, + "isFavorite": false, + "park": "Glacier National Park", + "coordinates": { + "longitude": -113.934831, + "latitude": 48.56002 + }, + "imageName": "lakemcdonald" + }, + { + "name": "Charley Rivers", + "category": "Rivers", + "city": "Eaking", + "state": "Alaska", + "id": 1007, + "isFeatured": true, + "isFavorite": false, + "park": "Charley Rivers National Preserve", + "coordinates": { + "longitude": -143.122586, + "latitude": 65.350021 + }, + "imageName": "charleyrivers", + }, + { + "name": "Icy Bay", + "category": "Mountains", + "city": "Icy Bay", + "state": "Alaska", + "id": 1008, + "isFeatured": false, + "isFavorite": false, + "park": "Wrangell-St. Elias National Park and Preserve", + "coordinates": { + "longitude": -141.518167, + "latitude": 60.089917 + }, + "imageName": "icybay" + }, + { + "name": "Rainbow Lake", + "category": "Lakes", + "city": "Willow", + "state": "Alaska", + "id": 1009, + "isFeatured": false, + "isFavorite": false, + "park": "State Recreation Area", + "coordinates": { + "longitude": -150.086103, + "latitude": 61.694334 + }, + "imageName": "rainbowlake" + }, + { + "name": "Hidden Lake", + "category": "Lakes", + "city": "Newhalem", + "state": "Washington", + "id": 1010, + "isFeatured": false, + "isFavorite": false, + "park": "North Cascades National Park", + "coordinates": { + "longitude": -121.17799, + "latitude": 48.495442 + }, + "imageName": "hiddenlake" + }, + { + "name": "Chincoteague", + "category": "Rivers", + "city": "Chincoteague", + "state": "Virginia", + "id": 1011, + "isFeatured": false, + "isFavorite": false, + "park": "Chincoteague National Wildlife Refuge", + "coordinates": { + "longitude": -75.383212, + "latitude": 37.91531 + }, + "imageName": "chincoteague" + }, + { + "name": "Lake Umbagog", + "category": "Lakes", + "city": "Errol", + "state": "New Hampshire", + "id": 1012, + "isFeatured": true, + "isFavorite": false, + "park": "Umbagog National Wildlife Refuge", + "coordinates": { + "longitude": -71.056816, + "latitude": 44.747408 + }, + "imageName": "umbagog" + } +] diff --git a/Examples/DrawingPathsAndShapes/Complete/Landmarks/Landmarks/Resources/rainbowlake.jpg b/Examples/DrawingPathsAndShapes/Complete/Landmarks/Landmarks/Resources/rainbowlake.jpg new file mode 100755 index 0000000..6da43dd Binary files /dev/null and b/Examples/DrawingPathsAndShapes/Complete/Landmarks/Landmarks/Resources/rainbowlake.jpg differ diff --git a/Examples/DrawingPathsAndShapes/Complete/Landmarks/Landmarks/Resources/silversalmoncreek.jpg b/Examples/DrawingPathsAndShapes/Complete/Landmarks/Landmarks/Resources/silversalmoncreek.jpg new file mode 100755 index 0000000..f657532 Binary files /dev/null and b/Examples/DrawingPathsAndShapes/Complete/Landmarks/Landmarks/Resources/silversalmoncreek.jpg differ diff --git a/Examples/DrawingPathsAndShapes/Complete/Landmarks/Landmarks/Resources/stmarylake.jpg b/Examples/DrawingPathsAndShapes/Complete/Landmarks/Landmarks/Resources/stmarylake.jpg new file mode 100755 index 0000000..1c71de4 Binary files /dev/null and b/Examples/DrawingPathsAndShapes/Complete/Landmarks/Landmarks/Resources/stmarylake.jpg differ diff --git a/Examples/DrawingPathsAndShapes/Complete/Landmarks/Landmarks/Resources/turtlerock.jpg b/Examples/DrawingPathsAndShapes/Complete/Landmarks/Landmarks/Resources/turtlerock.jpg new file mode 100755 index 0000000..f7a6e6d Binary files /dev/null and b/Examples/DrawingPathsAndShapes/Complete/Landmarks/Landmarks/Resources/turtlerock.jpg differ diff --git a/Examples/DrawingPathsAndShapes/Complete/Landmarks/Landmarks/Resources/twinlake.jpg b/Examples/DrawingPathsAndShapes/Complete/Landmarks/Landmarks/Resources/twinlake.jpg new file mode 100755 index 0000000..3e7a57c Binary files /dev/null and b/Examples/DrawingPathsAndShapes/Complete/Landmarks/Landmarks/Resources/twinlake.jpg differ diff --git a/Examples/DrawingPathsAndShapes/Complete/Landmarks/Landmarks/Resources/umbagog.jpg b/Examples/DrawingPathsAndShapes/Complete/Landmarks/Landmarks/Resources/umbagog.jpg new file mode 100755 index 0000000..56291c6 Binary files /dev/null and b/Examples/DrawingPathsAndShapes/Complete/Landmarks/Landmarks/Resources/umbagog.jpg differ diff --git a/Examples/DrawingPathsAndShapes/Complete/Landmarks/Landmarks/SceneDelegate.swift b/Examples/DrawingPathsAndShapes/Complete/Landmarks/Landmarks/SceneDelegate.swift new file mode 100755 index 0000000..96df0dc --- /dev/null +++ b/Examples/DrawingPathsAndShapes/Complete/Landmarks/Landmarks/SceneDelegate.swift @@ -0,0 +1,56 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +The scene delegate. +*/ + +import UIKit +import SwiftUI + +class SceneDelegate: UIResponder, UIWindowSceneDelegate { + + var window: UIWindow? + + func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) { + // Use this method to optionally configure and attach the UIWindow `window` to the provided UIWindowScene `scene`. + // If using a storyboard, the `window` property will automatically be initialized and attached to the scene. + // This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead). + + // Use a UIHostingController as window root view controller + let window = UIWindow(frame: UIScreen.main.bounds) + window.rootViewController = UIHostingController(rootView: LandmarkList().environmentObject(UserData())) + self.window = window + window.makeKeyAndVisible() + } + + func sceneDidDisconnect(_ scene: UIScene) { + // Called as the scene is being released by the system. + // This occurs shortly after the scene enters the background, or when its session is discarded. + // Release any resources associated with this scene that can be re-created the next time the scene connects. + // The scene may re-connect later, as its session was not neccessarily discarded (see `application:didDiscardSceneSessions` instead). + } + + func sceneDidBecomeActive(_ scene: UIScene) { + // Called when the scene has moved from an inactive state to an active state. + // Use this method to restart any tasks that were paused (or not yet started) when the scene was inactive. + } + + func sceneWillResignActive(_ scene: UIScene) { + // Called when the scene will move from an active state to an inactive state. + // This may occur due to temporary interruptions (ex. an incoming phone call). + } + + func sceneWillEnterForeground(_ scene: UIScene) { + // Called as the scene transitions from the background to the foreground. + // Use this method to undo the changes made on entering the background. + } + + func sceneDidEnterBackground(_ scene: UIScene) { + // Called as the scene transitions from the foreground to the background. + // Use this method to save data, release shared resources, and store enough scene-specific state information + // to restore the scene back to its current state. + } + +} + diff --git a/Examples/DrawingPathsAndShapes/Complete/Landmarks/Landmarks/Supporting Views/Badge.swift b/Examples/DrawingPathsAndShapes/Complete/Landmarks/Landmarks/Supporting Views/Badge.swift new file mode 100755 index 0000000..59f03b2 --- /dev/null +++ b/Examples/DrawingPathsAndShapes/Complete/Landmarks/Landmarks/Supporting Views/Badge.swift @@ -0,0 +1,41 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +A view that displays a badge. +*/ + +import SwiftUI + +struct Badge: View { + static let rotationCount = 8 + + var badgeSymbols: some View { + ForEach(0.. MKMapView { + MKMapView(frame: .zero) + } + + func updateUIView(_ view: MKMapView, context: Context) { + let span = MKCoordinateSpan(latitudeDelta: 0.02, longitudeDelta: 0.02) + let region = MKCoordinateRegion(center: coordinate, span: span) + view.setRegion(region, animated: true) + } +} + +#if DEBUG +struct MapView_Previews: PreviewProvider { + static var previews: some View { + MapView(coordinate: landmarkData[0].locationCoordinate) + } +} +#endif diff --git a/Examples/DrawingPathsAndShapes/Complete/Landmarks/Landmarks/Supporting Views/RotatedBadgeSymbol.swift b/Examples/DrawingPathsAndShapes/Complete/Landmarks/Landmarks/Supporting Views/RotatedBadgeSymbol.swift new file mode 100755 index 0000000..a7e4b53 --- /dev/null +++ b/Examples/DrawingPathsAndShapes/Complete/Landmarks/Landmarks/Supporting Views/RotatedBadgeSymbol.swift @@ -0,0 +1,26 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +A view that displays a rotated version of a badge symbol. +*/ + +import SwiftUI + +struct RotatedBadgeSymbol: View { + let angle: Angle + + var body: some View { + BadgeSymbol() + .padding(-60) + .rotationEffect(angle, anchor: .bottom) + } +} + +#if DEBUG +struct RotatedBadgeSymbol_Previews: PreviewProvider { + static var previews: some View { + RotatedBadgeSymbol(angle: .init(degrees: 5)) + } +} +#endif diff --git a/Examples/DrawingPathsAndShapes/Complete/README.md b/Examples/DrawingPathsAndShapes/Complete/README.md new file mode 100755 index 0000000..02bb0f0 --- /dev/null +++ b/Examples/DrawingPathsAndShapes/Complete/README.md @@ -0,0 +1,3 @@ +# Completed Project: Drawing Paths and Shapes + +Explore the completed project for the [Drawing Paths and Shapes](https://developer.apple.com/tutorials/swiftui/drawing-paths-and-shapes) tutorial. \ No newline at end of file diff --git a/Examples/DrawingPathsAndShapes/StartingPoint/.gitignore b/Examples/DrawingPathsAndShapes/StartingPoint/.gitignore new file mode 100755 index 0000000..9e50718 --- /dev/null +++ b/Examples/DrawingPathsAndShapes/StartingPoint/.gitignore @@ -0,0 +1,21 @@ +# See LICENSE folder for this sample’s licensing information. +# +# Apple sample code gitignore configuration. + +# Finder +.DS_Store + +# Xcode - User files +xcuserdata/ + +**/*.xcodeproj/project.xcworkspace/* +!**/*.xcodeproj/project.xcworkspace/xcshareddata + +**/*.xcodeproj/project.xcworkspace/xcshareddata/* +!**/*.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings + +**/*.playground/playground.xcworkspace/* +!**/*.playground/playground.xcworkspace/xcshareddata + +**/*.playground/playground.xcworkspace/xcshareddata/* +!**/*.playground/playground.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings diff --git a/Examples/DrawingPathsAndShapes/StartingPoint/Configuration/SampleCode.xcconfig b/Examples/DrawingPathsAndShapes/StartingPoint/Configuration/SampleCode.xcconfig new file mode 100755 index 0000000..db86c06 --- /dev/null +++ b/Examples/DrawingPathsAndShapes/StartingPoint/Configuration/SampleCode.xcconfig @@ -0,0 +1,13 @@ +// +// See LICENSE folder for this sample’s licensing information. +// +// SampleCode.xcconfig +// + +// The `SAMPLE_CODE_DISAMBIGUATOR` configuration is to make it easier to build +// and run a sample code project. Once you set your project's development team, +// you'll have a unique bundle identifier. This is because the bundle identifier +// is derived based on the 'SAMPLE_CODE_DISAMBIGUATOR' value. Do not use this +// approach in your own projects—it's only useful for sample code projects because +// they are frequently downloaded and don't have a development team set. +SAMPLE_CODE_DISAMBIGUATOR=${DEVELOPMENT_TEAM} diff --git a/Examples/DrawingPathsAndShapes/StartingPoint/LICENSE/LICENSE.txt b/Examples/DrawingPathsAndShapes/StartingPoint/LICENSE/LICENSE.txt new file mode 100755 index 0000000..94e3d54 --- /dev/null +++ b/Examples/DrawingPathsAndShapes/StartingPoint/LICENSE/LICENSE.txt @@ -0,0 +1,8 @@ +Copyright © 2019 Apple Inc. + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + diff --git a/Examples/DrawingPathsAndShapes/StartingPoint/Landmarks/DrawingPathsAndShapes.xcodeproj/.xcodesamplecode.plist b/Examples/DrawingPathsAndShapes/StartingPoint/Landmarks/DrawingPathsAndShapes.xcodeproj/.xcodesamplecode.plist new file mode 100755 index 0000000..5dd5da8 --- /dev/null +++ b/Examples/DrawingPathsAndShapes/StartingPoint/Landmarks/DrawingPathsAndShapes.xcodeproj/.xcodesamplecode.plist @@ -0,0 +1,5 @@ + + + + + diff --git a/Examples/DrawingPathsAndShapes/StartingPoint/Landmarks/DrawingPathsAndShapes.xcodeproj/project.pbxproj b/Examples/DrawingPathsAndShapes/StartingPoint/Landmarks/DrawingPathsAndShapes.xcodeproj/project.pbxproj new file mode 100755 index 0000000..c9b94dd --- /dev/null +++ b/Examples/DrawingPathsAndShapes/StartingPoint/Landmarks/DrawingPathsAndShapes.xcodeproj/project.pbxproj @@ -0,0 +1,485 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 50; + objects = { + +/* Begin PBXBuildFile section */ + B7310DD1229F6839001079B9 /* HexagonParameters.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7310DD0229F6839001079B9 /* HexagonParameters.swift */; }; + B7394866229F194000C47603 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7394865229F194000C47603 /* AppDelegate.swift */; }; + B7394868229F194000C47603 /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7394867229F194000C47603 /* SceneDelegate.swift */; }; + B739486A229F194000C47603 /* LandmarkDetail.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7394869229F194000C47603 /* LandmarkDetail.swift */; }; + B739486C229F194200C47603 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = B739486B229F194200C47603 /* Assets.xcassets */; }; + B739486F229F194200C47603 /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = B739486E229F194200C47603 /* Preview Assets.xcassets */; }; + B7394872229F194200C47603 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = B7394870229F194200C47603 /* LaunchScreen.storyboard */; }; + B739487A229F1B3F00C47603 /* CircleImage.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7394879229F1B3F00C47603 /* CircleImage.swift */; }; + B739487C229F1B6800C47603 /* MapView.swift in Sources */ = {isa = PBXBuildFile; fileRef = B739487B229F1B6800C47603 /* MapView.swift */; }; + B7394881229F28B900C47603 /* Landmark.swift in Sources */ = {isa = PBXBuildFile; fileRef = B739487F229F28B900C47603 /* Landmark.swift */; }; + B7394882229F28B900C47603 /* Data.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7394880229F28B900C47603 /* Data.swift */; }; + B7394891229F292F00C47603 /* rainbowlake.jpg in Resources */ = {isa = PBXBuildFile; fileRef = B7394884229F292D00C47603 /* rainbowlake.jpg */; }; + B7394893229F292F00C47603 /* icybay.jpg in Resources */ = {isa = PBXBuildFile; fileRef = B7394886229F292E00C47603 /* icybay.jpg */; }; + B7394894229F292F00C47603 /* lakemcdonald.jpg in Resources */ = {isa = PBXBuildFile; fileRef = B7394887229F292E00C47603 /* lakemcdonald.jpg */; }; + B7394895229F292F00C47603 /* turtlerock.jpg in Resources */ = {isa = PBXBuildFile; fileRef = B7394888229F292E00C47603 /* turtlerock.jpg */; }; + B7394896229F292F00C47603 /* umbagog.jpg in Resources */ = {isa = PBXBuildFile; fileRef = B7394889229F292E00C47603 /* umbagog.jpg */; }; + B7394897229F292F00C47603 /* hiddenlake.jpg in Resources */ = {isa = PBXBuildFile; fileRef = B739488A229F292E00C47603 /* hiddenlake.jpg */; }; + B7394898229F292F00C47603 /* stmarylake.jpg in Resources */ = {isa = PBXBuildFile; fileRef = B739488B229F292E00C47603 /* stmarylake.jpg */; }; + B7394899229F292F00C47603 /* twinlake.jpg in Resources */ = {isa = PBXBuildFile; fileRef = B739488C229F292E00C47603 /* twinlake.jpg */; }; + B739489A229F292F00C47603 /* silversalmoncreek.jpg in Resources */ = {isa = PBXBuildFile; fileRef = B739488D229F292E00C47603 /* silversalmoncreek.jpg */; }; + B739489B229F292F00C47603 /* landmarkData.json in Resources */ = {isa = PBXBuildFile; fileRef = B739488E229F292E00C47603 /* landmarkData.json */; }; + B739489C229F292F00C47603 /* chincoteague.jpg in Resources */ = {isa = PBXBuildFile; fileRef = B739488F229F292F00C47603 /* chincoteague.jpg */; }; + B739489D229F292F00C47603 /* chilkoottrail.jpg in Resources */ = {isa = PBXBuildFile; fileRef = B7394890229F292F00C47603 /* chilkoottrail.jpg */; }; + B739489F229F2D9700C47603 /* LandmarkRow.swift in Sources */ = {isa = PBXBuildFile; fileRef = B739489E229F2D9700C47603 /* LandmarkRow.swift */; }; + B73948A1229F2E1F00C47603 /* LandmarkList.swift in Sources */ = {isa = PBXBuildFile; fileRef = B73948A0229F2E1F00C47603 /* LandmarkList.swift */; }; + B73948A3229F3E2200C47603 /* charleyrivers.jpg in Resources */ = {isa = PBXBuildFile; fileRef = B73948A2229F3E2200C47603 /* charleyrivers.jpg */; }; + B7D2AAC5229F4D7C0061E5F5 /* UserData.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7D2AAC4229F4D7C0061E5F5 /* UserData.swift */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + 2DCE23D02DCC99A000000001 /* SampleCode.xcconfig */ = {isa = PBXFileReference; name = SampleCode.xcconfig; path = ../Configuration/SampleCode.xcconfig; sourceTree = ""; }; + 2FD259902DCF231000000001 /* LICENSE.txt */ = {isa = PBXFileReference; includeInIndex = 1; path = LICENSE.txt; sourceTree = ""; }; + B7310DD0229F6839001079B9 /* HexagonParameters.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HexagonParameters.swift; sourceTree = ""; }; + B7394862229F194000C47603 /* Landmarks.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Landmarks.app; sourceTree = BUILT_PRODUCTS_DIR; }; + B7394865229F194000C47603 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + B7394867229F194000C47603 /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = ""; }; + B7394869229F194000C47603 /* LandmarkDetail.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LandmarkDetail.swift; sourceTree = ""; }; + B739486B229F194200C47603 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + B739486E229F194200C47603 /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = ""; }; + B7394871229F194200C47603 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + B7394873229F194200C47603 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + B7394879229F1B3F00C47603 /* CircleImage.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CircleImage.swift; sourceTree = ""; }; + B739487B229F1B6800C47603 /* MapView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MapView.swift; sourceTree = ""; }; + B739487F229F28B900C47603 /* Landmark.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Landmark.swift; sourceTree = ""; }; + B7394880229F28B900C47603 /* Data.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Data.swift; sourceTree = ""; }; + B7394884229F292D00C47603 /* rainbowlake.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = rainbowlake.jpg; sourceTree = ""; }; + B7394886229F292E00C47603 /* icybay.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = icybay.jpg; sourceTree = ""; }; + B7394887229F292E00C47603 /* lakemcdonald.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = lakemcdonald.jpg; sourceTree = ""; }; + B7394888229F292E00C47603 /* turtlerock.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = turtlerock.jpg; sourceTree = ""; }; + B7394889229F292E00C47603 /* umbagog.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = umbagog.jpg; sourceTree = ""; }; + B739488A229F292E00C47603 /* hiddenlake.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = hiddenlake.jpg; sourceTree = ""; }; + B739488B229F292E00C47603 /* stmarylake.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = stmarylake.jpg; sourceTree = ""; }; + B739488C229F292E00C47603 /* twinlake.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = twinlake.jpg; sourceTree = ""; }; + B739488D229F292E00C47603 /* silversalmoncreek.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = silversalmoncreek.jpg; sourceTree = ""; }; + B739488E229F292E00C47603 /* landmarkData.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = landmarkData.json; sourceTree = ""; }; + B739488F229F292F00C47603 /* chincoteague.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = chincoteague.jpg; sourceTree = ""; }; + B7394890229F292F00C47603 /* chilkoottrail.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = chilkoottrail.jpg; sourceTree = ""; }; + B739489E229F2D9700C47603 /* LandmarkRow.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = LandmarkRow.swift; path = "Supporting Views/LandmarkRow.swift"; sourceTree = ""; }; + B73948A0229F2E1F00C47603 /* LandmarkList.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LandmarkList.swift; sourceTree = ""; }; + B73948A2229F3E2200C47603 /* charleyrivers.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = charleyrivers.jpg; sourceTree = ""; }; + B7D2AAC4229F4D7C0061E5F5 /* UserData.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UserData.swift; sourceTree = ""; }; + C4E4AAA0C4E4035000000001 /* README.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; name = README.md; path = ../README.md; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + B739485F229F194000C47603 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 2DCE23302DCE264000000001 /* Configuration */ = { + isa = PBXGroup; + children = ( + 2DCE23D02DCC99A000000001 /* SampleCode.xcconfig */, + ); + name = Configuration; + sourceTree = ""; + }; + 2DCF20602DCF74E000000001 /* LICENSE */ = { + isa = PBXGroup; + children = ( + 2FD259902DCF231000000001 /* LICENSE.txt */, + ); + name = LICENSE; + path = ../LICENSE; + sourceTree = ""; + }; + B7394859229F194000C47603 = { + isa = PBXGroup; + children = ( + C4E4AAA0C4E4035000000001 /* README.md */, + B7394864229F194000C47603 /* Landmarks */, + B7394863229F194000C47603 /* Products */, + 2DCE23302DCE264000000001 /* Configuration */, + 2DCF20602DCF74E000000001 /* LICENSE */, + ); + sourceTree = ""; + }; + B7394863229F194000C47603 /* Products */ = { + isa = PBXGroup; + children = ( + B7394862229F194000C47603 /* Landmarks.app */, + ); + name = Products; + sourceTree = ""; + }; + B7394864229F194000C47603 /* Landmarks */ = { + isa = PBXGroup; + children = ( + B739487E229F282200C47603 /* Models */, + B7394865229F194000C47603 /* AppDelegate.swift */, + B7394867229F194000C47603 /* SceneDelegate.swift */, + B73948A0229F2E1F00C47603 /* LandmarkList.swift */, + B739489E229F2D9700C47603 /* LandmarkRow.swift */, + B7394869229F194000C47603 /* LandmarkDetail.swift */, + B7310DD0229F6839001079B9 /* HexagonParameters.swift */, + B739487D229F1C0100C47603 /* Supporting Views */, + B7394883229F291A00C47603 /* Resources */, + B739486B229F194200C47603 /* Assets.xcassets */, + B7394870229F194200C47603 /* LaunchScreen.storyboard */, + B7394873229F194200C47603 /* Info.plist */, + B739486D229F194200C47603 /* Preview Content */, + ); + path = Landmarks; + sourceTree = ""; + }; + B739486D229F194200C47603 /* Preview Content */ = { + isa = PBXGroup; + children = ( + B739486E229F194200C47603 /* Preview Assets.xcassets */, + ); + path = "Preview Content"; + sourceTree = ""; + }; + B739487D229F1C0100C47603 /* Supporting Views */ = { + isa = PBXGroup; + children = ( + B7394879229F1B3F00C47603 /* CircleImage.swift */, + B739487B229F1B6800C47603 /* MapView.swift */, + ); + path = "Supporting Views"; + sourceTree = ""; + }; + B739487E229F282200C47603 /* Models */ = { + isa = PBXGroup; + children = ( + B7394880229F28B900C47603 /* Data.swift */, + B739487F229F28B900C47603 /* Landmark.swift */, + B7D2AAC4229F4D7C0061E5F5 /* UserData.swift */, + ); + path = Models; + sourceTree = ""; + }; + B7394883229F291A00C47603 /* Resources */ = { + isa = PBXGroup; + children = ( + B739488E229F292E00C47603 /* landmarkData.json */, + B7394890229F292F00C47603 /* chilkoottrail.jpg */, + B739488F229F292F00C47603 /* chincoteague.jpg */, + B739488A229F292E00C47603 /* hiddenlake.jpg */, + B7394886229F292E00C47603 /* icybay.jpg */, + B7394887229F292E00C47603 /* lakemcdonald.jpg */, + B7394884229F292D00C47603 /* rainbowlake.jpg */, + B739488D229F292E00C47603 /* silversalmoncreek.jpg */, + B739488B229F292E00C47603 /* stmarylake.jpg */, + B7394888229F292E00C47603 /* turtlerock.jpg */, + B739488C229F292E00C47603 /* twinlake.jpg */, + B7394889229F292E00C47603 /* umbagog.jpg */, + B73948A2229F3E2200C47603 /* charleyrivers.jpg */, + ); + path = Resources; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + B7394861229F194000C47603 /* Landmarks */ = { + isa = PBXNativeTarget; + buildConfigurationList = B7394876229F194200C47603 /* Build configuration list for PBXNativeTarget "Landmarks" */; + buildPhases = ( + B739485E229F194000C47603 /* Sources */, + B739485F229F194000C47603 /* Frameworks */, + B7394860229F194000C47603 /* Resources */, + C602AC70C605937000000001, + ); + buildRules = ( + ); + dependencies = ( + ); + name = Landmarks; + productName = Landmarks; + productReference = B7394862229F194000C47603 /* Landmarks.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + B739485A229F194000C47603 /* Project object */ = { + isa = PBXProject; + attributes = { + LastSwiftUpdateCheck = 1100; + LastUpgradeCheck = 1100; + ORGANIZATIONNAME = Apple; + TargetAttributes = { + B7394861229F194000C47603 = { + CreatedOnToolsVersion = 11.0; + }; + }; + }; + buildConfigurationList = B739485D229F194000C47603 /* Build configuration list for PBXProject "DrawingPathsAndShapes" */; + compatibilityVersion = "Xcode 9.3"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = B7394859229F194000C47603; + productRefGroup = B7394863229F194000C47603 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + B7394861229F194000C47603 /* Landmarks */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + B7394860229F194000C47603 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + B739489A229F292F00C47603 /* silversalmoncreek.jpg in Resources */, + B7394894229F292F00C47603 /* lakemcdonald.jpg in Resources */, + B7394872229F194200C47603 /* LaunchScreen.storyboard in Resources */, + B73948A3229F3E2200C47603 /* charleyrivers.jpg in Resources */, + B7394891229F292F00C47603 /* rainbowlake.jpg in Resources */, + B739486F229F194200C47603 /* Preview Assets.xcassets in Resources */, + B7394895229F292F00C47603 /* turtlerock.jpg in Resources */, + B739486C229F194200C47603 /* Assets.xcassets in Resources */, + B7394899229F292F00C47603 /* twinlake.jpg in Resources */, + B7394896229F292F00C47603 /* umbagog.jpg in Resources */, + B739489D229F292F00C47603 /* chilkoottrail.jpg in Resources */, + B739489C229F292F00C47603 /* chincoteague.jpg in Resources */, + B739489B229F292F00C47603 /* landmarkData.json in Resources */, + B7394893229F292F00C47603 /* icybay.jpg in Resources */, + B7394897229F292F00C47603 /* hiddenlake.jpg in Resources */, + B7394898229F292F00C47603 /* stmarylake.jpg in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + B739485E229F194000C47603 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + B7394882229F28B900C47603 /* Data.swift in Sources */, + B7394866229F194000C47603 /* AppDelegate.swift in Sources */, + B739487A229F1B3F00C47603 /* CircleImage.swift in Sources */, + B739487C229F1B6800C47603 /* MapView.swift in Sources */, + B7310DD1229F6839001079B9 /* HexagonParameters.swift in Sources */, + B73948A1229F2E1F00C47603 /* LandmarkList.swift in Sources */, + B7394868229F194000C47603 /* SceneDelegate.swift in Sources */, + B739486A229F194000C47603 /* LandmarkDetail.swift in Sources */, + B739489F229F2D9700C47603 /* LandmarkRow.swift in Sources */, + B7D2AAC5229F4D7C0061E5F5 /* UserData.swift in Sources */, + B7394881229F28B900C47603 /* Landmark.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXVariantGroup section */ + B7394870229F194200C47603 /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + B7394871229F194200C47603 /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + B7394874229F194200C47603 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 2DCE23D02DCC99A000000001 /* SampleCode.xcconfig */; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 13.0; + MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; + MTL_FAST_MATH = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + }; + name = Debug; + }; + B7394875229F194200C47603 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 2DCE23D02DCC99A000000001 /* SampleCode.xcconfig */; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 13.0; + MTL_ENABLE_DEBUG_INFO = NO; + MTL_FAST_MATH = YES; + SDKROOT = iphoneos; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + B7394877229F194200C47603 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 2DCE23D02DCC99A000000001 /* SampleCode.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_ASSET_PATHS = "Landmarks/Preview\\ Content"; + DEVELOPMENT_TEAM = ""; + ENABLE_PREVIEWS = YES; + INFOPLIST_FILE = Landmarks/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = "com.example.apple-samplecode.Landmarks${SAMPLE_CODE_DISAMBIGUATOR}"; + PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE_SPECIFIER = ""; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + B7394878229F194200C47603 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 2DCE23D02DCC99A000000001 /* SampleCode.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_ASSET_PATHS = "Landmarks/Preview\\ Content"; + DEVELOPMENT_TEAM = ""; + ENABLE_PREVIEWS = YES; + INFOPLIST_FILE = Landmarks/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = "com.example.apple-samplecode.Landmarks${SAMPLE_CODE_DISAMBIGUATOR}"; + PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE_SPECIFIER = ""; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + B739485D229F194000C47603 /* Build configuration list for PBXProject "DrawingPathsAndShapes" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + B7394874229F194200C47603 /* Debug */, + B7394875229F194200C47603 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + B7394876229F194200C47603 /* Build configuration list for PBXNativeTarget "Landmarks" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + B7394877229F194200C47603 /* Debug */, + B7394878229F194200C47603 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = B739485A229F194000C47603 /* Project object */; +} diff --git a/Examples/DrawingPathsAndShapes/StartingPoint/Landmarks/DrawingPathsAndShapes.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/Examples/DrawingPathsAndShapes/StartingPoint/Landmarks/DrawingPathsAndShapes.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings new file mode 100755 index 0000000..3ddf867 --- /dev/null +++ b/Examples/DrawingPathsAndShapes/StartingPoint/Landmarks/DrawingPathsAndShapes.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings @@ -0,0 +1,8 @@ + + + + + BuildSystemType + Latest + + diff --git a/Examples/DrawingPathsAndShapes/StartingPoint/Landmarks/Landmarks/AppDelegate.swift b/Examples/DrawingPathsAndShapes/StartingPoint/Landmarks/Landmarks/AppDelegate.swift new file mode 100755 index 0000000..e22943b --- /dev/null +++ b/Examples/DrawingPathsAndShapes/StartingPoint/Landmarks/Landmarks/AppDelegate.swift @@ -0,0 +1,36 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +The application delegate. +*/ + +import UIKit + +@UIApplicationMain +class AppDelegate: UIResponder, UIApplicationDelegate { + + func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { + // Override point for customization after application launch. + return true + } + + func applicationWillTerminate(_ application: UIApplication) { + // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. + } + + // MARK: UISceneSession Lifecycle + func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration { + // Called when a new scene session is being created. + // Use this method to select a configuration to create the new scene with. + return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role) + } + + func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set) { + // Called when the user discards a scene session. + // If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions. + // Use this method to release any resources that were specific to the discarded scenes, as they will not return. + } + +} + diff --git a/Examples/DrawingPathsAndShapes/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/Contents.json b/Examples/DrawingPathsAndShapes/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100755 index 0000000..6ab6c31 --- /dev/null +++ b/Examples/DrawingPathsAndShapes/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,112 @@ +{ + "images" : [ + { + "size" : "20x20", + "idiom" : "iphone", + "filename" : "landmark_app_icon_40x40.png", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "20x20", + "scale" : "3x" + }, + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "landmark_app_icon_58x58.png", + "scale" : "2x" + }, + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "landmark_app_icon_87x87.png", + "scale" : "3x" + }, + { + "size" : "40x40", + "idiom" : "iphone", + "filename" : "landmark_app_icon_80x80.png", + "scale" : "2x" + }, + { + "size" : "40x40", + "idiom" : "iphone", + "filename" : "landmark_app_icon_120x120.png", + "scale" : "3x" + }, + { + "size" : "60x60", + "idiom" : "iphone", + "filename" : "landmark_app_icon_120x120-1.png", + "scale" : "2x" + }, + { + "size" : "60x60", + "idiom" : "iphone", + "filename" : "landmark_app_icon_180x180.png", + "scale" : "3x" + }, + { + "idiom" : "ipad", + "size" : "20x20", + "scale" : "1x" + }, + { + "size" : "20x20", + "idiom" : "ipad", + "filename" : "landmark_app_icon_40x40-1.png", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "29x29", + "scale" : "1x" + }, + { + "size" : "29x29", + "idiom" : "ipad", + "filename" : "landmark_app_icon_58x58-1.png", + "scale" : "2x" + }, + { + "size" : "40x40", + "idiom" : "ipad", + "filename" : "landmark_app_icon_40x40-2.png", + "scale" : "1x" + }, + { + "size" : "40x40", + "idiom" : "ipad", + "filename" : "landmark_app_icon_80x80-1.png", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "76x76", + "scale" : "1x" + }, + { + "size" : "76x76", + "idiom" : "ipad", + "filename" : "landmark_app_icon_152x152.png", + "scale" : "2x" + }, + { + "size" : "83.5x83.5", + "idiom" : "ipad", + "filename" : "landmark_app_icon_167x167.png", + "scale" : "2x" + }, + { + "size" : "1024x1024", + "idiom" : "ios-marketing", + "filename" : "landmark_app_icon_1024x1024.png", + "scale" : "1x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Examples/DrawingPathsAndShapes/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_1024x1024.png b/Examples/DrawingPathsAndShapes/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_1024x1024.png new file mode 100755 index 0000000..00d81c1 Binary files /dev/null and b/Examples/DrawingPathsAndShapes/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_1024x1024.png differ diff --git a/Examples/DrawingPathsAndShapes/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_120x120-1.png b/Examples/DrawingPathsAndShapes/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_120x120-1.png new file mode 100755 index 0000000..d382b8b Binary files /dev/null and b/Examples/DrawingPathsAndShapes/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_120x120-1.png differ diff --git a/Examples/DrawingPathsAndShapes/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_120x120.png b/Examples/DrawingPathsAndShapes/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_120x120.png new file mode 100755 index 0000000..d382b8b Binary files /dev/null and b/Examples/DrawingPathsAndShapes/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_120x120.png differ diff --git a/Examples/DrawingPathsAndShapes/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_152x152.png b/Examples/DrawingPathsAndShapes/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_152x152.png new file mode 100755 index 0000000..11057f8 Binary files /dev/null and b/Examples/DrawingPathsAndShapes/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_152x152.png differ diff --git a/Examples/DrawingPathsAndShapes/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_167x167.png b/Examples/DrawingPathsAndShapes/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_167x167.png new file mode 100755 index 0000000..f73bc26 Binary files /dev/null and b/Examples/DrawingPathsAndShapes/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_167x167.png differ diff --git a/Examples/DrawingPathsAndShapes/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_180x180.png b/Examples/DrawingPathsAndShapes/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_180x180.png new file mode 100755 index 0000000..b02738c Binary files /dev/null and b/Examples/DrawingPathsAndShapes/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_180x180.png differ diff --git a/Examples/DrawingPathsAndShapes/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_40x40-1.png b/Examples/DrawingPathsAndShapes/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_40x40-1.png new file mode 100755 index 0000000..abaff0e Binary files /dev/null and b/Examples/DrawingPathsAndShapes/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_40x40-1.png differ diff --git a/Examples/DrawingPathsAndShapes/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_40x40-2.png b/Examples/DrawingPathsAndShapes/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_40x40-2.png new file mode 100755 index 0000000..abaff0e Binary files /dev/null and b/Examples/DrawingPathsAndShapes/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_40x40-2.png differ diff --git a/Examples/DrawingPathsAndShapes/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_40x40.png b/Examples/DrawingPathsAndShapes/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_40x40.png new file mode 100755 index 0000000..abaff0e Binary files /dev/null and b/Examples/DrawingPathsAndShapes/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_40x40.png differ diff --git a/Examples/DrawingPathsAndShapes/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_58x58-1.png b/Examples/DrawingPathsAndShapes/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_58x58-1.png new file mode 100755 index 0000000..cf7c73d Binary files /dev/null and b/Examples/DrawingPathsAndShapes/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_58x58-1.png differ diff --git a/Examples/DrawingPathsAndShapes/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_58x58.png b/Examples/DrawingPathsAndShapes/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_58x58.png new file mode 100755 index 0000000..cf7c73d Binary files /dev/null and b/Examples/DrawingPathsAndShapes/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_58x58.png differ diff --git a/Examples/DrawingPathsAndShapes/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_80x80-1.png b/Examples/DrawingPathsAndShapes/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_80x80-1.png new file mode 100755 index 0000000..6f33f66 Binary files /dev/null and b/Examples/DrawingPathsAndShapes/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_80x80-1.png differ diff --git a/Examples/DrawingPathsAndShapes/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_80x80.png b/Examples/DrawingPathsAndShapes/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_80x80.png new file mode 100755 index 0000000..6f33f66 Binary files /dev/null and b/Examples/DrawingPathsAndShapes/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_80x80.png differ diff --git a/Examples/DrawingPathsAndShapes/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_87x87.png b/Examples/DrawingPathsAndShapes/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_87x87.png new file mode 100755 index 0000000..9e1616c Binary files /dev/null and b/Examples/DrawingPathsAndShapes/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_87x87.png differ diff --git a/Examples/DrawingPathsAndShapes/StartingPoint/Landmarks/Landmarks/Assets.xcassets/Contents.json b/Examples/DrawingPathsAndShapes/StartingPoint/Landmarks/Landmarks/Assets.xcassets/Contents.json new file mode 100755 index 0000000..da4a164 --- /dev/null +++ b/Examples/DrawingPathsAndShapes/StartingPoint/Landmarks/Landmarks/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Examples/DrawingPathsAndShapes/StartingPoint/Landmarks/Landmarks/Assets.xcassets/turtlerock.imageset/Contents.json b/Examples/DrawingPathsAndShapes/StartingPoint/Landmarks/Landmarks/Assets.xcassets/turtlerock.imageset/Contents.json new file mode 100755 index 0000000..5bfd7bf --- /dev/null +++ b/Examples/DrawingPathsAndShapes/StartingPoint/Landmarks/Landmarks/Assets.xcassets/turtlerock.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "turtlerock.jpg", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Examples/DrawingPathsAndShapes/StartingPoint/Landmarks/Landmarks/Assets.xcassets/turtlerock.imageset/turtlerock.jpg b/Examples/DrawingPathsAndShapes/StartingPoint/Landmarks/Landmarks/Assets.xcassets/turtlerock.imageset/turtlerock.jpg new file mode 100755 index 0000000..68bcd3e Binary files /dev/null and b/Examples/DrawingPathsAndShapes/StartingPoint/Landmarks/Landmarks/Assets.xcassets/turtlerock.imageset/turtlerock.jpg differ diff --git a/Examples/DrawingPathsAndShapes/StartingPoint/Landmarks/Landmarks/Base.lproj/LaunchScreen.storyboard b/Examples/DrawingPathsAndShapes/StartingPoint/Landmarks/Landmarks/Base.lproj/LaunchScreen.storyboard new file mode 100755 index 0000000..865e932 --- /dev/null +++ b/Examples/DrawingPathsAndShapes/StartingPoint/Landmarks/Landmarks/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Examples/DrawingPathsAndShapes/StartingPoint/Landmarks/Landmarks/HexagonParameters.swift b/Examples/DrawingPathsAndShapes/StartingPoint/Landmarks/Landmarks/HexagonParameters.swift new file mode 100755 index 0000000..8decba4 --- /dev/null +++ b/Examples/DrawingPathsAndShapes/StartingPoint/Landmarks/Landmarks/HexagonParameters.swift @@ -0,0 +1,57 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +Size, position, and other information used to draw a badge. +*/ + +import SwiftUI + +struct HexagonParameters { + struct Segment { + let useWidth: (CGFloat, CGFloat, CGFloat) + let xFactors: (CGFloat, CGFloat, CGFloat) + let useHeight: (CGFloat, CGFloat, CGFloat) + let yFactors: (CGFloat, CGFloat, CGFloat) + } + + static let adjustment: CGFloat = 0.085 + static let points = [ + Segment( + useWidth: (1.00, 1.00, 1.00), + xFactors: (0.60, 0.40, 0.50), + useHeight: (1.00, 1.00, 0.00), + yFactors: (0.05, 0.05, 0.00) + ), + Segment( + useWidth: (1.00, 1.00, 0.00), + xFactors: (0.05, 0.00, 0.00), + useHeight: (1.00, 1.00, 1.00), + yFactors: (0.20 + adjustment, 0.30 + adjustment, 0.25 + adjustment) + ), + Segment( + useWidth: (1.00, 1.00, 0.00), + xFactors: (0.00, 0.05, 0.00), + useHeight: (1.00, 1.00, 1.00), + yFactors: (0.70 - adjustment, 0.80 - adjustment, 0.75 - adjustment) + ), + Segment( + useWidth: (1.00, 1.00, 1.00), + xFactors: (0.40, 0.60, 0.50), + useHeight: (1.00, 1.00, 1.00), + yFactors: (0.95, 0.95, 1.00) + ), + Segment( + useWidth: (1.00, 1.00, 1.00), + xFactors: (0.95, 1.00, 1.00), + useHeight: (1.00, 1.00, 1.00), + yFactors: (0.80 - adjustment, 0.70 - adjustment, 0.75 - adjustment) + ), + Segment( + useWidth: (1.00, 1.00, 1.00), + xFactors: (1.00, 0.95, 1.00), + useHeight: (1.00, 1.00, 1.00), + yFactors: (0.30 + adjustment, 0.20 + adjustment, 0.25 + adjustment) + ) + ] +} diff --git a/Examples/DrawingPathsAndShapes/StartingPoint/Landmarks/Landmarks/Info.plist b/Examples/DrawingPathsAndShapes/StartingPoint/Landmarks/Landmarks/Info.plist new file mode 100755 index 0000000..e8bb4c6 --- /dev/null +++ b/Examples/DrawingPathsAndShapes/StartingPoint/Landmarks/Landmarks/Info.plist @@ -0,0 +1,62 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + $(PRODUCT_BUNDLE_PACKAGE_TYPE) + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1 + LSRequiresIPhoneOS + + UIApplicationSceneManifest + + UIApplicationSupportsMultipleScenes + + UISceneConfigurations + + UIWindowSceneSessionRoleApplication + + + UILaunchStoryboardName + LaunchScreen + UISceneConfigurationName + Default Configuration + UISceneDelegateClassName + $(PRODUCT_MODULE_NAME).SceneDelegate + + + + + UILaunchStoryboardName + LaunchScreen + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/Examples/DrawingPathsAndShapes/StartingPoint/Landmarks/Landmarks/LandmarkDetail.swift b/Examples/DrawingPathsAndShapes/StartingPoint/Landmarks/Landmarks/LandmarkDetail.swift new file mode 100755 index 0000000..6c290a3 --- /dev/null +++ b/Examples/DrawingPathsAndShapes/StartingPoint/Landmarks/Landmarks/LandmarkDetail.swift @@ -0,0 +1,71 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +A view showing the details for a landmark. +*/ + +import SwiftUI + +struct LandmarkDetail: View { + @EnvironmentObject var userData: UserData + var landmark: Landmark + + var landmarkIndex: Int { + userData.landmarks.firstIndex(where: { $0.id == landmark.id })! + } + + var body: some View { + VStack { + MapView(coordinate: landmark.locationCoordinate) + .edgesIgnoringSafeArea(.top) + .frame(height: 300) + + CircleImage(image: landmark.image(forSize: 250)) + .offset(x: 0, y: -130) + .padding(.bottom, -130) + + VStack(alignment: .leading) { + HStack { + Text(verbatim: landmark.name) + .font(.title) + + Button(action: { + self.userData.landmarks[self.landmarkIndex] + .isFavorite.toggle() + }) { + if self.userData.landmarks[self.landmarkIndex] + .isFavorite { + Image(systemName: "star.fill") + .foregroundColor(Color.yellow) + } else { + Image(systemName: "star") + .foregroundColor(Color.gray) + } + } + } + + HStack(alignment: .top) { + Text(verbatim: landmark.park) + .font(.subheadline) + Spacer() + Text(verbatim: landmark.state) + .font(.subheadline) + } + } + .padding() + + Spacer() + } + } +} + +#if DEBUG +struct LandmarkDetail_Preview: PreviewProvider { + static var previews: some View { + let userData = UserData() + return LandmarkDetail(landmark: userData.landmarks[0]) + .environmentObject(userData) + } +} +#endif diff --git a/Examples/DrawingPathsAndShapes/StartingPoint/Landmarks/Landmarks/LandmarkList.swift b/Examples/DrawingPathsAndShapes/StartingPoint/Landmarks/Landmarks/LandmarkList.swift new file mode 100755 index 0000000..c17b5f3 --- /dev/null +++ b/Examples/DrawingPathsAndShapes/StartingPoint/Landmarks/Landmarks/LandmarkList.swift @@ -0,0 +1,45 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +A view showing a list of landmarks. +*/ + +import SwiftUI + +struct LandmarkList: View { + @EnvironmentObject private var userData: UserData + + var body: some View { + NavigationView { + List { + Toggle(isOn: $userData.showFavoritesOnly) { + Text("Show Favorites Only") + } + + ForEach(userData.landmarks) { landmark in + if !self.userData.showFavoritesOnly || landmark.isFavorite { + NavigationButton( + destination: LandmarkDetail(landmark: landmark)) { + LandmarkRow(landmark: landmark) + } + } + } + } + .navigationBarTitle(Text("Landmarks"), displayMode: .large) + } + } +} + +#if DEBUG +struct LandmarksList_Previews: PreviewProvider { + static var previews: some View { + ForEach(["iPhone SE", "iPhone XS Max"].identified(by: \.self)) { deviceName in + LandmarkList() + .previewDevice(PreviewDevice(rawValue: deviceName)) + .previewDisplayName(deviceName) + } + .environmentObject(UserData()) + } +} +#endif diff --git a/Examples/DrawingPathsAndShapes/StartingPoint/Landmarks/Landmarks/Models/Data.swift b/Examples/DrawingPathsAndShapes/StartingPoint/Landmarks/Landmarks/Models/Data.swift new file mode 100755 index 0000000..78837f6 --- /dev/null +++ b/Examples/DrawingPathsAndShapes/StartingPoint/Landmarks/Landmarks/Models/Data.swift @@ -0,0 +1,93 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +Helpers for loading images and data. +*/ + +import UIKit +import SwiftUI +import CoreLocation + +let landmarkData: [Landmark] = load("landmarkData.json") + +func load(_ filename: String, as type: T.Type = T.self) -> T { + let data: Data + + guard let file = Bundle.main.url(forResource: filename, withExtension: nil) + else { + fatalError("Couldn't find \(filename) in main bundle.") + } + + do { + data = try Data(contentsOf: file) + } catch { + fatalError("Couldn't load \(filename) from main bundle:\n\(error)") + } + + do { + let decoder = JSONDecoder() + return try decoder.decode(T.self, from: data) + } catch { + fatalError("Couldn't parse \(filename) as \(T.self):\n\(error)") + } +} + +final class ImageStore { + fileprivate typealias _ImageDictionary = [String: [Int: CGImage]] + fileprivate var images: _ImageDictionary = [:] + + fileprivate static var originalSize = 250 + fileprivate static var scale = 2 + + static var shared = ImageStore() + + func image(name: String, size: Int) -> Image { + let index = _guaranteeInitialImage(name: name) + + let sizedImage = images.values[index][size] + ?? _sizeImage(images.values[index][ImageStore.originalSize]!, to: size * ImageStore.scale) + images.values[index][size] = sizedImage + + return Image(sizedImage, scale: Length(ImageStore.scale), label: Text(verbatim: name)) + } + + fileprivate func _guaranteeInitialImage(name: String) -> _ImageDictionary.Index { + if let index = images.index(forKey: name) { return index } + + guard + let url = Bundle.main.url(forResource: name, withExtension: "jpg"), + let imageSource = CGImageSourceCreateWithURL(url as NSURL, nil), + let image = CGImageSourceCreateImageAtIndex(imageSource, 0, nil) + else { + fatalError("Couldn't load image \(name).jpg from main bundle.") + } + + images[name] = [ImageStore.originalSize: image] + return images.index(forKey: name)! + } + + fileprivate func _sizeImage(_ image: CGImage, to size: Int) -> CGImage { + guard + let colorSpace = image.colorSpace, + let context = CGContext( + data: nil, + width: size, height: size, + bitsPerComponent: image.bitsPerComponent, + bytesPerRow: image.bytesPerRow, + space: colorSpace, + bitmapInfo: image.bitmapInfo.rawValue) + else { + fatalError("Couldn't create graphics context.") + } + context.interpolationQuality = .high + context.draw(image, in: CGRect(x: 0, y: 0, width: size, height: size)) + + if let sizedImage = context.makeImage() { + return sizedImage + } else { + fatalError("Couldn't resize image.") + } + } +} + diff --git a/Examples/DrawingPathsAndShapes/StartingPoint/Landmarks/Landmarks/Models/Landmark.swift b/Examples/DrawingPathsAndShapes/StartingPoint/Landmarks/Landmarks/Models/Landmark.swift new file mode 100755 index 0000000..79b9aa4 --- /dev/null +++ b/Examples/DrawingPathsAndShapes/StartingPoint/Landmarks/Landmarks/Models/Landmark.swift @@ -0,0 +1,42 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +The model for an individual landmark. +*/ + +import SwiftUI +import CoreLocation + +struct Landmark: Hashable, Codable, Identifiable { + var id: Int + var name: String + fileprivate var imageName: String + fileprivate var coordinates: Coordinates + var state: String + var park: String + var category: Category + var isFavorite: Bool + + var locationCoordinate: CLLocationCoordinate2D { + CLLocationCoordinate2D( + latitude: coordinates.latitude, + longitude: coordinates.longitude) + } + + func image(forSize size: Int) -> Image { + ImageStore.shared.image(name: imageName, size: size) + } + + enum Category: String, CaseIterable, Codable, Hashable { + case featured = "Featured" + case lakes = "Lakes" + case rivers = "Rivers" + case mountains = "Mountains" + } +} + +struct Coordinates: Hashable, Codable { + var latitude: Double + var longitude: Double +} diff --git a/Examples/DrawingPathsAndShapes/StartingPoint/Landmarks/Landmarks/Models/UserData.swift b/Examples/DrawingPathsAndShapes/StartingPoint/Landmarks/Landmarks/Models/UserData.swift new file mode 100755 index 0000000..db31fb0 --- /dev/null +++ b/Examples/DrawingPathsAndShapes/StartingPoint/Landmarks/Landmarks/Models/UserData.swift @@ -0,0 +1,25 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +A model object that stores app data. +*/ + +import Combine +import SwiftUI + +final class UserData: BindableObject { + let didChange = PassthroughSubject() + + var showFavoritesOnly = false { + didSet { + didChange.send(self) + } + } + + var landmarks = landmarkData { + didSet { + didChange.send(self) + } + } +} diff --git a/Examples/DrawingPathsAndShapes/StartingPoint/Landmarks/Landmarks/Preview Content/Preview Assets.xcassets/Contents.json b/Examples/DrawingPathsAndShapes/StartingPoint/Landmarks/Landmarks/Preview Content/Preview Assets.xcassets/Contents.json new file mode 100755 index 0000000..da4a164 --- /dev/null +++ b/Examples/DrawingPathsAndShapes/StartingPoint/Landmarks/Landmarks/Preview Content/Preview Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Examples/DrawingPathsAndShapes/StartingPoint/Landmarks/Landmarks/Resources/charleyrivers.jpg b/Examples/DrawingPathsAndShapes/StartingPoint/Landmarks/Landmarks/Resources/charleyrivers.jpg new file mode 100755 index 0000000..17ff44b Binary files /dev/null and b/Examples/DrawingPathsAndShapes/StartingPoint/Landmarks/Landmarks/Resources/charleyrivers.jpg differ diff --git a/Examples/DrawingPathsAndShapes/StartingPoint/Landmarks/Landmarks/Resources/chilkoottrail.jpg b/Examples/DrawingPathsAndShapes/StartingPoint/Landmarks/Landmarks/Resources/chilkoottrail.jpg new file mode 100755 index 0000000..e7f805e Binary files /dev/null and b/Examples/DrawingPathsAndShapes/StartingPoint/Landmarks/Landmarks/Resources/chilkoottrail.jpg differ diff --git a/Examples/DrawingPathsAndShapes/StartingPoint/Landmarks/Landmarks/Resources/chincoteague.jpg b/Examples/DrawingPathsAndShapes/StartingPoint/Landmarks/Landmarks/Resources/chincoteague.jpg new file mode 100755 index 0000000..5f47986 Binary files /dev/null and b/Examples/DrawingPathsAndShapes/StartingPoint/Landmarks/Landmarks/Resources/chincoteague.jpg differ diff --git a/Examples/DrawingPathsAndShapes/StartingPoint/Landmarks/Landmarks/Resources/hiddenlake.jpg b/Examples/DrawingPathsAndShapes/StartingPoint/Landmarks/Landmarks/Resources/hiddenlake.jpg new file mode 100755 index 0000000..d8e804c Binary files /dev/null and b/Examples/DrawingPathsAndShapes/StartingPoint/Landmarks/Landmarks/Resources/hiddenlake.jpg differ diff --git a/Examples/DrawingPathsAndShapes/StartingPoint/Landmarks/Landmarks/Resources/icybay.jpg b/Examples/DrawingPathsAndShapes/StartingPoint/Landmarks/Landmarks/Resources/icybay.jpg new file mode 100755 index 0000000..feb1764 Binary files /dev/null and b/Examples/DrawingPathsAndShapes/StartingPoint/Landmarks/Landmarks/Resources/icybay.jpg differ diff --git a/Examples/DrawingPathsAndShapes/StartingPoint/Landmarks/Landmarks/Resources/lakemcdonald.jpg b/Examples/DrawingPathsAndShapes/StartingPoint/Landmarks/Landmarks/Resources/lakemcdonald.jpg new file mode 100755 index 0000000..bd9d6b9 Binary files /dev/null and b/Examples/DrawingPathsAndShapes/StartingPoint/Landmarks/Landmarks/Resources/lakemcdonald.jpg differ diff --git a/Examples/DrawingPathsAndShapes/StartingPoint/Landmarks/Landmarks/Resources/landmarkData.json b/Examples/DrawingPathsAndShapes/StartingPoint/Landmarks/Landmarks/Resources/landmarkData.json new file mode 100755 index 0000000..e5b14fc --- /dev/null +++ b/Examples/DrawingPathsAndShapes/StartingPoint/Landmarks/Landmarks/Resources/landmarkData.json @@ -0,0 +1,182 @@ +[ + { + "name": "Turtle Rock", + "category": "Rivers", + "city": "Twentynine Palms", + "state": "California", + "id": 1001, + "isFeatured": true, + "isFavorite": true, + "park": "Joshua Tree National Park", + "coordinates": { + "longitude": -116.166868, + "latitude": 34.011286 + }, + "imageName": "turtlerock" + }, + { + "name": "Silver Salmon Creek", + "category": "Lakes", + "city": "Port Alsworth", + "state": "Alaska", + "id": 1002, + "isFeatured": false, + "isFavorite": false, + "park": "Lake Clark National Park and Preserve", + "coordinates": { + "longitude": -152.665167, + "latitude": 59.980167 + }, + "imageName": "silversalmoncreek" + }, + { + "name": "Chilkoot Trail", + "category": "Mountains", + "city": "Skagway", + "state": "Alaska", + "id": 1003, + "isFeatured": false, + "isFavorite": true, + "park": "Klondike Gold Rush National Historical Park", + "coordinates": { + "longitude": -135.334571, + "latitude": 59.560551 + }, + "imageName": "chilkoottrail" + }, + { + "name": "St. Mary Lake", + "category": "Lakes", + "city": "Browning", + "state": "Montana", + "id": 1004, + "isFeatured": true, + "isFavorite": true, + "park": "Glacier National Park", + "coordinates": { + "longitude": -113.536248, + "latitude": 48.69423 + }, + "imageName": "stmarylake" + }, + { + "name": "Twin Lake", + "category": "Lakes", + "city": "Twin Lakes", + "state": "Alaska", + "id": 1005, + "isFeatured": false, + "isFavorite": false, + "park": "Lake Clark National Park and Preserve", + "coordinates": { + "longitude": -153.849883, + "latitude": 60.641684 + }, + "imageName": "twinlake" + }, + { + "name": "Lake McDonald", + "category": "Mountains", + "city": "West Glacier", + "state": "Montana", + "id": 1006, + "isFeatured": false, + "isFavorite": false, + "park": "Glacier National Park", + "coordinates": { + "longitude": -113.934831, + "latitude": 48.56002 + }, + "imageName": "lakemcdonald" + }, + { + "name": "Charley Rivers", + "category": "Rivers", + "city": "Eaking", + "state": "Alaska", + "id": 1007, + "isFeatured": true, + "isFavorite": false, + "park": "Charley Rivers National Preserve", + "coordinates": { + "longitude": -143.122586, + "latitude": 65.350021 + }, + "imageName": "charleyrivers", + }, + { + "name": "Icy Bay", + "category": "Mountains", + "city": "Icy Bay", + "state": "Alaska", + "id": 1008, + "isFeatured": false, + "isFavorite": false, + "park": "Wrangell-St. Elias National Park and Preserve", + "coordinates": { + "longitude": -141.518167, + "latitude": 60.089917 + }, + "imageName": "icybay" + }, + { + "name": "Rainbow Lake", + "category": "Lakes", + "city": "Willow", + "state": "Alaska", + "id": 1009, + "isFeatured": false, + "isFavorite": false, + "park": "State Recreation Area", + "coordinates": { + "longitude": -150.086103, + "latitude": 61.694334 + }, + "imageName": "rainbowlake" + }, + { + "name": "Hidden Lake", + "category": "Lakes", + "city": "Newhalem", + "state": "Washington", + "id": 1010, + "isFeatured": false, + "isFavorite": false, + "park": "North Cascades National Park", + "coordinates": { + "longitude": -121.17799, + "latitude": 48.495442 + }, + "imageName": "hiddenlake" + }, + { + "name": "Chincoteague", + "category": "Rivers", + "city": "Chincoteague", + "state": "Virginia", + "id": 1011, + "isFeatured": false, + "isFavorite": false, + "park": "Chincoteague National Wildlife Refuge", + "coordinates": { + "longitude": -75.383212, + "latitude": 37.91531 + }, + "imageName": "chincoteague" + }, + { + "name": "Lake Umbagog", + "category": "Lakes", + "city": "Errol", + "state": "New Hampshire", + "id": 1012, + "isFeatured": true, + "isFavorite": false, + "park": "Umbagog National Wildlife Refuge", + "coordinates": { + "longitude": -71.056816, + "latitude": 44.747408 + }, + "imageName": "umbagog" + } +] diff --git a/Examples/DrawingPathsAndShapes/StartingPoint/Landmarks/Landmarks/Resources/rainbowlake.jpg b/Examples/DrawingPathsAndShapes/StartingPoint/Landmarks/Landmarks/Resources/rainbowlake.jpg new file mode 100755 index 0000000..6da43dd Binary files /dev/null and b/Examples/DrawingPathsAndShapes/StartingPoint/Landmarks/Landmarks/Resources/rainbowlake.jpg differ diff --git a/Examples/DrawingPathsAndShapes/StartingPoint/Landmarks/Landmarks/Resources/silversalmoncreek.jpg b/Examples/DrawingPathsAndShapes/StartingPoint/Landmarks/Landmarks/Resources/silversalmoncreek.jpg new file mode 100755 index 0000000..f657532 Binary files /dev/null and b/Examples/DrawingPathsAndShapes/StartingPoint/Landmarks/Landmarks/Resources/silversalmoncreek.jpg differ diff --git a/Examples/DrawingPathsAndShapes/StartingPoint/Landmarks/Landmarks/Resources/stmarylake.jpg b/Examples/DrawingPathsAndShapes/StartingPoint/Landmarks/Landmarks/Resources/stmarylake.jpg new file mode 100755 index 0000000..1c71de4 Binary files /dev/null and b/Examples/DrawingPathsAndShapes/StartingPoint/Landmarks/Landmarks/Resources/stmarylake.jpg differ diff --git a/Examples/DrawingPathsAndShapes/StartingPoint/Landmarks/Landmarks/Resources/turtlerock.jpg b/Examples/DrawingPathsAndShapes/StartingPoint/Landmarks/Landmarks/Resources/turtlerock.jpg new file mode 100755 index 0000000..f7a6e6d Binary files /dev/null and b/Examples/DrawingPathsAndShapes/StartingPoint/Landmarks/Landmarks/Resources/turtlerock.jpg differ diff --git a/Examples/DrawingPathsAndShapes/StartingPoint/Landmarks/Landmarks/Resources/twinlake.jpg b/Examples/DrawingPathsAndShapes/StartingPoint/Landmarks/Landmarks/Resources/twinlake.jpg new file mode 100755 index 0000000..3e7a57c Binary files /dev/null and b/Examples/DrawingPathsAndShapes/StartingPoint/Landmarks/Landmarks/Resources/twinlake.jpg differ diff --git a/Examples/DrawingPathsAndShapes/StartingPoint/Landmarks/Landmarks/Resources/umbagog.jpg b/Examples/DrawingPathsAndShapes/StartingPoint/Landmarks/Landmarks/Resources/umbagog.jpg new file mode 100755 index 0000000..56291c6 Binary files /dev/null and b/Examples/DrawingPathsAndShapes/StartingPoint/Landmarks/Landmarks/Resources/umbagog.jpg differ diff --git a/Examples/DrawingPathsAndShapes/StartingPoint/Landmarks/Landmarks/SceneDelegate.swift b/Examples/DrawingPathsAndShapes/StartingPoint/Landmarks/Landmarks/SceneDelegate.swift new file mode 100755 index 0000000..96df0dc --- /dev/null +++ b/Examples/DrawingPathsAndShapes/StartingPoint/Landmarks/Landmarks/SceneDelegate.swift @@ -0,0 +1,56 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +The scene delegate. +*/ + +import UIKit +import SwiftUI + +class SceneDelegate: UIResponder, UIWindowSceneDelegate { + + var window: UIWindow? + + func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) { + // Use this method to optionally configure and attach the UIWindow `window` to the provided UIWindowScene `scene`. + // If using a storyboard, the `window` property will automatically be initialized and attached to the scene. + // This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead). + + // Use a UIHostingController as window root view controller + let window = UIWindow(frame: UIScreen.main.bounds) + window.rootViewController = UIHostingController(rootView: LandmarkList().environmentObject(UserData())) + self.window = window + window.makeKeyAndVisible() + } + + func sceneDidDisconnect(_ scene: UIScene) { + // Called as the scene is being released by the system. + // This occurs shortly after the scene enters the background, or when its session is discarded. + // Release any resources associated with this scene that can be re-created the next time the scene connects. + // The scene may re-connect later, as its session was not neccessarily discarded (see `application:didDiscardSceneSessions` instead). + } + + func sceneDidBecomeActive(_ scene: UIScene) { + // Called when the scene has moved from an inactive state to an active state. + // Use this method to restart any tasks that were paused (or not yet started) when the scene was inactive. + } + + func sceneWillResignActive(_ scene: UIScene) { + // Called when the scene will move from an active state to an inactive state. + // This may occur due to temporary interruptions (ex. an incoming phone call). + } + + func sceneWillEnterForeground(_ scene: UIScene) { + // Called as the scene transitions from the background to the foreground. + // Use this method to undo the changes made on entering the background. + } + + func sceneDidEnterBackground(_ scene: UIScene) { + // Called as the scene transitions from the foreground to the background. + // Use this method to save data, release shared resources, and store enough scene-specific state information + // to restore the scene back to its current state. + } + +} + diff --git a/Examples/DrawingPathsAndShapes/StartingPoint/Landmarks/Landmarks/Supporting Views/CircleImage.swift b/Examples/DrawingPathsAndShapes/StartingPoint/Landmarks/Landmarks/Supporting Views/CircleImage.swift new file mode 100755 index 0000000..ae44439 --- /dev/null +++ b/Examples/DrawingPathsAndShapes/StartingPoint/Landmarks/Landmarks/Supporting Views/CircleImage.swift @@ -0,0 +1,27 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +A view that clips an image to a circle and adds a stroke and shadow. +*/ + +import SwiftUI + +struct CircleImage: View { + var image: Image + + var body: some View { + image + .clipShape(Circle()) + .overlay(Circle().stroke(Color.white, lineWidth: 4)) + .shadow(radius: 10) + } +} + +#if DEBUG +struct CircleImage_Previews: PreviewProvider { + static var previews: some View { + CircleImage(image: Image("turtlerock")) + } +} +#endif diff --git a/Examples/DrawingPathsAndShapes/StartingPoint/Landmarks/Landmarks/Supporting Views/LandmarkRow.swift b/Examples/DrawingPathsAndShapes/StartingPoint/Landmarks/Landmarks/Supporting Views/LandmarkRow.swift new file mode 100755 index 0000000..2f8110c --- /dev/null +++ b/Examples/DrawingPathsAndShapes/StartingPoint/Landmarks/Landmarks/Supporting Views/LandmarkRow.swift @@ -0,0 +1,38 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +A single row to be displayed in a list of landmarks. +*/ + +import SwiftUI + +struct LandmarkRow: View { + var landmark: Landmark + + var body: some View { + HStack { + landmark.image(forSize: 50) + Text(verbatim: landmark.name) + Spacer() + + if landmark.isFavorite { + Image(systemName: "star.fill") + .imageScale(.medium) + .foregroundColor(.yellow) + } + } + } +} + +#if DEBUG +struct LandmarkRow_Previews: PreviewProvider { + static var previews: some View { + Group { + LandmarkRow(landmark: landmarkData[0]) + LandmarkRow(landmark: landmarkData[1]) + } + .previewLayout(.fixed(width: 300, height: 70)) + } +} +#endif diff --git a/Examples/DrawingPathsAndShapes/StartingPoint/Landmarks/Landmarks/Supporting Views/MapView.swift b/Examples/DrawingPathsAndShapes/StartingPoint/Landmarks/Landmarks/Supporting Views/MapView.swift new file mode 100755 index 0000000..5a8c64b --- /dev/null +++ b/Examples/DrawingPathsAndShapes/StartingPoint/Landmarks/Landmarks/Supporting Views/MapView.swift @@ -0,0 +1,31 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +A view that hosts an `MKMapView`. +*/ + +import SwiftUI +import MapKit + +struct MapView: UIViewRepresentable { + var coordinate: CLLocationCoordinate2D + + func makeUIView(context: Context) -> MKMapView { + MKMapView(frame: .zero) + } + + func updateUIView(_ view: MKMapView, context: Context) { + let span = MKCoordinateSpan(latitudeDelta: 0.02, longitudeDelta: 0.02) + let region = MKCoordinateRegion(center: coordinate, span: span) + view.setRegion(region, animated: true) + } +} + +#if DEBUG +struct MapView_Previews: PreviewProvider { + static var previews: some View { + MapView(coordinate: landmarkData[0].locationCoordinate) + } +} +#endif diff --git a/Examples/DrawingPathsAndShapes/StartingPoint/README.md b/Examples/DrawingPathsAndShapes/StartingPoint/README.md new file mode 100755 index 0000000..7e3b548 --- /dev/null +++ b/Examples/DrawingPathsAndShapes/StartingPoint/README.md @@ -0,0 +1,3 @@ +# Drawing Paths and Shapes + +Use this project to code along with the [Drawing Paths and Shapes](https://developer.apple.com/tutorials/swiftui/drawing-paths-and-shapes) tutorial. \ No newline at end of file diff --git a/Examples/Example To-Do App/.gitignore b/Examples/Example To-Do App/.gitignore new file mode 100755 index 0000000..5518329 --- /dev/null +++ b/Examples/Example To-Do App/.gitignore @@ -0,0 +1,14 @@ +.DS_Store +.bundle + +**/xcuserdata +*.pbxuser +*.mode1v3 + +Pods/ +Carthage/ +vendor/ + +fastlane/report.xml +*.ipa +*.dSYM.zip diff --git a/Examples/Example To-Do App/LICENSE b/Examples/Example To-Do App/LICENSE new file mode 100755 index 0000000..b907ae9 --- /dev/null +++ b/Examples/Example To-Do App/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2019 Suyeol Jeon (xoul.kr) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/Examples/Example To-Do App/README.md b/Examples/Example To-Do App/README.md new file mode 100755 index 0000000..2fb8bf1 --- /dev/null +++ b/Examples/Example To-Do App/README.md @@ -0,0 +1,14 @@ +# SwiftUITodo + +SwiftUITodo is an example to-do list application using [SwiftUI](https://developer.apple.com/xcode/swiftui/) which is first introduced in WWDC19 keynote. + +![screenshot](https://user-images.githubusercontent.com/931655/58843349-f6dbf400-8626-11e9-8227-fbd369c29515.png) + +## Requirements + +* Xcode 11 Beta +* Swift 5.1 + +## License + +SwiftUITodo is under MIT license. See the [LICENSE](LICENSE) file for more info. diff --git a/Examples/Example To-Do App/SwiftUITodo.xcodeproj/project.pbxproj b/Examples/Example To-Do App/SwiftUITodo.xcodeproj/project.pbxproj new file mode 100755 index 0000000..0682e06 --- /dev/null +++ b/Examples/Example To-Do App/SwiftUITodo.xcodeproj/project.pbxproj @@ -0,0 +1,367 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 50; + objects = { + +/* Begin PBXBuildFile section */ + 031596AE22A5BDBA001BBA1B /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 031596AD22A5BDBA001BBA1B /* AppDelegate.swift */; }; + 031596B022A5BDBA001BBA1B /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 031596AF22A5BDBA001BBA1B /* SceneDelegate.swift */; }; + 031596B222A5BDBA001BBA1B /* TaskListView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 031596B122A5BDBA001BBA1B /* TaskListView.swift */; }; + 031596B422A5BDBB001BBA1B /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 031596B322A5BDBB001BBA1B /* Assets.xcassets */; }; + 031596B722A5BDBB001BBA1B /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 031596B622A5BDBB001BBA1B /* Preview Assets.xcassets */; }; + 031596BA22A5BDBB001BBA1B /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 031596B822A5BDBB001BBA1B /* LaunchScreen.storyboard */; }; + 031596C222A5BDE8001BBA1B /* Task.swift in Sources */ = {isa = PBXBuildFile; fileRef = 031596C122A5BDE8001BBA1B /* Task.swift */; }; + 031596C822A5C661001BBA1B /* UserData.swift in Sources */ = {isa = PBXBuildFile; fileRef = 031596C722A5C661001BBA1B /* UserData.swift */; }; + 031596CA22A5DDE0001BBA1B /* TaskEditView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 031596C922A5DDE0001BBA1B /* TaskEditView.swift */; }; + 031596CC22A5F360001BBA1B /* TaskItemView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 031596CB22A5F360001BBA1B /* TaskItemView.swift */; }; + C8E0A25922A789D100E940E8 /* UserDefaultsValue.swift in Sources */ = {isa = PBXBuildFile; fileRef = C8E0A25822A789D100E940E8 /* UserDefaultsValue.swift */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + 031596AA22A5BDBA001BBA1B /* SwiftUITodo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SwiftUITodo.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 031596AD22A5BDBA001BBA1B /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + 031596AF22A5BDBA001BBA1B /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = ""; }; + 031596B122A5BDBA001BBA1B /* TaskListView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TaskListView.swift; sourceTree = ""; }; + 031596B322A5BDBB001BBA1B /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 031596B622A5BDBB001BBA1B /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = ""; }; + 031596B922A5BDBB001BBA1B /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + 031596BB22A5BDBB001BBA1B /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 031596C122A5BDE8001BBA1B /* Task.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Task.swift; sourceTree = ""; }; + 031596C722A5C661001BBA1B /* UserData.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UserData.swift; sourceTree = ""; }; + 031596C922A5DDE0001BBA1B /* TaskEditView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TaskEditView.swift; sourceTree = ""; }; + 031596CB22A5F360001BBA1B /* TaskItemView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TaskItemView.swift; sourceTree = ""; }; + C8E0A25822A789D100E940E8 /* UserDefaultsValue.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UserDefaultsValue.swift; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 031596A722A5BDBA001BBA1B /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 031596A122A5BDBA001BBA1B = { + isa = PBXGroup; + children = ( + 031596AC22A5BDBA001BBA1B /* SwiftUITodo */, + 031596AB22A5BDBA001BBA1B /* Products */, + ); + sourceTree = ""; + }; + 031596AB22A5BDBA001BBA1B /* Products */ = { + isa = PBXGroup; + children = ( + 031596AA22A5BDBA001BBA1B /* SwiftUITodo.app */, + ); + name = Products; + sourceTree = ""; + }; + 031596AC22A5BDBA001BBA1B /* SwiftUITodo */ = { + isa = PBXGroup; + children = ( + 031596AD22A5BDBA001BBA1B /* AppDelegate.swift */, + 031596AF22A5BDBA001BBA1B /* SceneDelegate.swift */, + 031596C722A5C661001BBA1B /* UserData.swift */, + 031596C122A5BDE8001BBA1B /* Task.swift */, + 031596B122A5BDBA001BBA1B /* TaskListView.swift */, + 031596CB22A5F360001BBA1B /* TaskItemView.swift */, + 031596C922A5DDE0001BBA1B /* TaskEditView.swift */, + C8E0A25822A789D100E940E8 /* UserDefaultsValue.swift */, + 031596B322A5BDBB001BBA1B /* Assets.xcassets */, + 031596B822A5BDBB001BBA1B /* LaunchScreen.storyboard */, + 031596BB22A5BDBB001BBA1B /* Info.plist */, + 031596B522A5BDBB001BBA1B /* Preview Content */, + ); + path = SwiftUITodo; + sourceTree = ""; + }; + 031596B522A5BDBB001BBA1B /* Preview Content */ = { + isa = PBXGroup; + children = ( + 031596B622A5BDBB001BBA1B /* Preview Assets.xcassets */, + ); + path = "Preview Content"; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 031596A922A5BDBA001BBA1B /* SwiftUITodo */ = { + isa = PBXNativeTarget; + buildConfigurationList = 031596BE22A5BDBB001BBA1B /* Build configuration list for PBXNativeTarget "SwiftUITodo" */; + buildPhases = ( + 031596A622A5BDBA001BBA1B /* Sources */, + 031596A722A5BDBA001BBA1B /* Frameworks */, + 031596A822A5BDBA001BBA1B /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = SwiftUITodo; + productName = SwiftUITodo; + productReference = 031596AA22A5BDBA001BBA1B /* SwiftUITodo.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 031596A222A5BDBA001BBA1B /* Project object */ = { + isa = PBXProject; + attributes = { + LastSwiftUpdateCheck = 1100; + LastUpgradeCheck = 1100; + ORGANIZATIONNAME = "Suyeol Jeon"; + TargetAttributes = { + 031596A922A5BDBA001BBA1B = { + CreatedOnToolsVersion = 11.0; + }; + }; + }; + buildConfigurationList = 031596A522A5BDBA001BBA1B /* Build configuration list for PBXProject "SwiftUITodo" */; + compatibilityVersion = "Xcode 9.3"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 031596A122A5BDBA001BBA1B; + productRefGroup = 031596AB22A5BDBA001BBA1B /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 031596A922A5BDBA001BBA1B /* SwiftUITodo */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 031596A822A5BDBA001BBA1B /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 031596BA22A5BDBB001BBA1B /* LaunchScreen.storyboard in Resources */, + 031596B722A5BDBB001BBA1B /* Preview Assets.xcassets in Resources */, + 031596B422A5BDBB001BBA1B /* Assets.xcassets in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 031596A622A5BDBA001BBA1B /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 031596C222A5BDE8001BBA1B /* Task.swift in Sources */, + 031596AE22A5BDBA001BBA1B /* AppDelegate.swift in Sources */, + 031596C822A5C661001BBA1B /* UserData.swift in Sources */, + 031596CC22A5F360001BBA1B /* TaskItemView.swift in Sources */, + 031596CA22A5DDE0001BBA1B /* TaskEditView.swift in Sources */, + 031596B022A5BDBA001BBA1B /* SceneDelegate.swift in Sources */, + C8E0A25922A789D100E940E8 /* UserDefaultsValue.swift in Sources */, + 031596B222A5BDBA001BBA1B /* TaskListView.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXVariantGroup section */ + 031596B822A5BDBB001BBA1B /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 031596B922A5BDBB001BBA1B /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 031596BC22A5BDBB001BBA1B /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 13.0; + MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; + MTL_FAST_MATH = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + }; + name = Debug; + }; + 031596BD22A5BDBB001BBA1B /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 13.0; + MTL_ENABLE_DEBUG_INFO = NO; + MTL_FAST_MATH = YES; + SDKROOT = iphoneos; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 031596BF22A5BDBB001BBA1B /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_ASSET_PATHS = "SwiftUITodo/Preview\\ Content"; + DEVELOPMENT_TEAM = N2C267LBVY; + ENABLE_PREVIEWS = YES; + INFOPLIST_FILE = SwiftUITodo/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = kr.xoul.SwiftUITodo; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + 031596C022A5BDBB001BBA1B /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_ASSET_PATHS = "SwiftUITodo/Preview\\ Content"; + DEVELOPMENT_TEAM = N2C267LBVY; + ENABLE_PREVIEWS = YES; + INFOPLIST_FILE = SwiftUITodo/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = kr.xoul.SwiftUITodo; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 031596A522A5BDBA001BBA1B /* Build configuration list for PBXProject "SwiftUITodo" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 031596BC22A5BDBB001BBA1B /* Debug */, + 031596BD22A5BDBB001BBA1B /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 031596BE22A5BDBB001BBA1B /* Build configuration list for PBXNativeTarget "SwiftUITodo" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 031596BF22A5BDBB001BBA1B /* Debug */, + 031596C022A5BDBB001BBA1B /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 031596A222A5BDBA001BBA1B /* Project object */; +} diff --git a/Examples/Example To-Do App/SwiftUITodo.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/Examples/Example To-Do App/SwiftUITodo.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100755 index 0000000..f60d885 --- /dev/null +++ b/Examples/Example To-Do App/SwiftUITodo.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/Examples/Example To-Do App/SwiftUITodo.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/Examples/Example To-Do App/SwiftUITodo.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100755 index 0000000..18d9810 --- /dev/null +++ b/Examples/Example To-Do App/SwiftUITodo.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/Examples/Example To-Do App/SwiftUITodo/AppDelegate.swift b/Examples/Example To-Do App/SwiftUITodo/AppDelegate.swift new file mode 100755 index 0000000..915ca17 --- /dev/null +++ b/Examples/Example To-Do App/SwiftUITodo/AppDelegate.swift @@ -0,0 +1,41 @@ +// +// AppDelegate.swift +// SwiftUITodo +// +// Created by Suyeol Jeon on 03/06/2019. +// Copyright © 2019 Suyeol Jeon. All rights reserved. +// + +import UIKit + +@UIApplicationMain +class AppDelegate: UIResponder, UIApplicationDelegate { + + + + func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { + // Override point for customization after application launch. + return true + } + + func applicationWillTerminate(_ application: UIApplication) { + // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. + } + + // MARK: UISceneSession Lifecycle + + func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration { + // Called when a new scene session is being created. + // Use this method to select a configuration to create the new scene with. + return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role) + } + + func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set) { + // Called when the user discards a scene session. + // If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions. + // Use this method to release any resources that were specific to the discarded scenes, as they will not return. + } + + +} + diff --git a/Examples/Example To-Do App/SwiftUITodo/Assets.xcassets/AppIcon.appiconset/Contents.json b/Examples/Example To-Do App/SwiftUITodo/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100755 index 0000000..d8db8d6 --- /dev/null +++ b/Examples/Example To-Do App/SwiftUITodo/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,98 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "size" : "20x20", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "20x20", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "3x" + }, + { + "idiom" : "ipad", + "size" : "20x20", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "20x20", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "29x29", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "40x40", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "76x76", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "76x76", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "83.5x83.5", + "scale" : "2x" + }, + { + "idiom" : "ios-marketing", + "size" : "1024x1024", + "scale" : "1x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Examples/Example To-Do App/SwiftUITodo/Assets.xcassets/Contents.json b/Examples/Example To-Do App/SwiftUITodo/Assets.xcassets/Contents.json new file mode 100755 index 0000000..da4a164 --- /dev/null +++ b/Examples/Example To-Do App/SwiftUITodo/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Examples/Example To-Do App/SwiftUITodo/Base.lproj/LaunchScreen.storyboard b/Examples/Example To-Do App/SwiftUITodo/Base.lproj/LaunchScreen.storyboard new file mode 100755 index 0000000..865e932 --- /dev/null +++ b/Examples/Example To-Do App/SwiftUITodo/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Examples/Example To-Do App/SwiftUITodo/Info.plist b/Examples/Example To-Do App/SwiftUITodo/Info.plist new file mode 100755 index 0000000..e8bb4c6 --- /dev/null +++ b/Examples/Example To-Do App/SwiftUITodo/Info.plist @@ -0,0 +1,62 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + $(PRODUCT_BUNDLE_PACKAGE_TYPE) + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1 + LSRequiresIPhoneOS + + UIApplicationSceneManifest + + UIApplicationSupportsMultipleScenes + + UISceneConfigurations + + UIWindowSceneSessionRoleApplication + + + UILaunchStoryboardName + LaunchScreen + UISceneConfigurationName + Default Configuration + UISceneDelegateClassName + $(PRODUCT_MODULE_NAME).SceneDelegate + + + + + UILaunchStoryboardName + LaunchScreen + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/Examples/Example To-Do App/SwiftUITodo/Preview Content/Preview Assets.xcassets/Contents.json b/Examples/Example To-Do App/SwiftUITodo/Preview Content/Preview Assets.xcassets/Contents.json new file mode 100755 index 0000000..da4a164 --- /dev/null +++ b/Examples/Example To-Do App/SwiftUITodo/Preview Content/Preview Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Examples/Example To-Do App/SwiftUITodo/SceneDelegate.swift b/Examples/Example To-Do App/SwiftUITodo/SceneDelegate.swift new file mode 100755 index 0000000..443dfb1 --- /dev/null +++ b/Examples/Example To-Do App/SwiftUITodo/SceneDelegate.swift @@ -0,0 +1,61 @@ +// +// SceneDelegate.swift +// SwiftUITodo +// +// Created by Suyeol Jeon on 03/06/2019. +// Copyright © 2019 Suyeol Jeon. All rights reserved. +// + +import UIKit +import SwiftUI + +class SceneDelegate: UIResponder, UIWindowSceneDelegate { + + var window: UIWindow? + + + func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) { + // Use this method to optionally configure and attach the UIWindow `window` to the provided UIWindowScene `scene`. + // If using a storyboard, the `window` property will automatically be initialized and attached to the scene. + // This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead). + + // Use a UIHostingController as window root view controller + let window = UIWindow(frame: UIScreen.main.bounds) + window.rootViewController = UIHostingController(rootView: NavigationView { + TaskListView().environmentObject(UserData()) + }) + self.window = window + window.makeKeyAndVisible() + } + + func sceneDidDisconnect(_ scene: UIScene) { + // Called as the scene is being released by the system. + // This occurs shortly after the scene enters the background, or when its session is discarded. + // Release any resources associated with this scene that can be re-created the next time the scene connects. + // The scene may re-connect later, as its session was not neccessarily discarded (see `application:didDiscardSceneSessions` instead). + } + + func sceneDidBecomeActive(_ scene: UIScene) { + // Called when the scene has moved from an inactive state to an active state. + // Use this method to restart any tasks that were paused (or not yet started) when the scene was inactive. + } + + func sceneWillResignActive(_ scene: UIScene) { + // Called when the scene will move from an active state to an inactive state. + // This may occur due to temporary interruptions (ex. an incoming phone call). + } + + func sceneWillEnterForeground(_ scene: UIScene) { + // Called as the scene transitions from the background to the foreground. + // Use this method to undo the changes made on entering the background. + } + + func sceneDidEnterBackground(_ scene: UIScene) { + // Called as the scene transitions from the foreground to the background. + // Use this method to save data, release shared resources, and store enough scene-specific state information + // to restore the scene back to its current state. + } + + +} + diff --git a/Examples/Example To-Do App/SwiftUITodo/Task.swift b/Examples/Example To-Do App/SwiftUITodo/Task.swift new file mode 100755 index 0000000..9f83bb0 --- /dev/null +++ b/Examples/Example To-Do App/SwiftUITodo/Task.swift @@ -0,0 +1,21 @@ +// +// Task.swift +// SwiftUITodo +// +// Created by Suyeol Jeon on 03/06/2019. +// Copyright © 2019 Suyeol Jeon. All rights reserved. +// + +import SwiftUI + +struct Task: Equatable, Hashable, Codable, Identifiable { + let id: UUID + var title: String + var isDone: Bool + + init(title: String, isDone: Bool) { + self.id = UUID() + self.title = title + self.isDone = isDone + } +} diff --git a/Examples/Example To-Do App/SwiftUITodo/TaskEditView.swift b/Examples/Example To-Do App/SwiftUITodo/TaskEditView.swift new file mode 100755 index 0000000..81d3da2 --- /dev/null +++ b/Examples/Example To-Do App/SwiftUITodo/TaskEditView.swift @@ -0,0 +1,52 @@ +// +// TaskEditView.swift +// SwiftUITodo +// +// Created by Suyeol Jeon on 03/06/2019. +// Copyright © 2019 Suyeol Jeon. All rights reserved. +// + +import SwiftUI + +struct TaskEditView: View { + @EnvironmentObject var userData: UserData + private let task: Task + private var draftTitle: State + + init(task: Task) { + self.task = task + self.draftTitle = .init(initialValue: task.title) + } + + var body: some View { + let inset = EdgeInsets(top: -8, leading: -10, bottom: -7, trailing: -10) + return VStack(alignment: .leading, spacing: 0) { + TextField( + self.draftTitle.binding, + placeholder: Text("Enter New Title..."), + onEditingChanged: { _ in self.updateTask() }, + onCommit: {} + ) + .background( + RoundedRectangle(cornerRadius: 5) + .fill(Color.clear) + .border(Color(red: 0.7, green: 0.7, blue: 0.7), width: 1 / UIScreen.main.scale, cornerRadius: 5) + .padding(inset) + ) + .padding(EdgeInsets( + top: 15 - inset.top, + leading: 20 - inset.leading, + bottom: 15 - inset.bottom, + trailing: 20 - inset.trailing + )) + + Spacer() + } + .navigationBarTitle(Text("Edit Task 📝")) + } + + private func updateTask() { + guard let index = self.userData.tasks.firstIndex(of: self.task) else { return } + self.userData.tasks[index].title = self.draftTitle.value + } +} diff --git a/Examples/Example To-Do App/SwiftUITodo/TaskItemView.swift b/Examples/Example To-Do App/SwiftUITodo/TaskItemView.swift new file mode 100755 index 0000000..e9f9fdd --- /dev/null +++ b/Examples/Example To-Do App/SwiftUITodo/TaskItemView.swift @@ -0,0 +1,52 @@ +// +// TaskItemView.swift +// SwiftUITodo +// +// Created by Suyeol Jeon on 03/06/2019. +// Copyright © 2019 Suyeol Jeon. All rights reserved. +// + +import SwiftUI + +struct TaskItemView: View { + @EnvironmentObject var userData: UserData + + let task: Task + @Binding var isEditing: Bool + + var body: some View { + return HStack { + if self.isEditing { + Image(systemName: "minus.circle") + .foregroundColor(.red) + .tapAction(count: 1) { + self.delete() + } + NavigationButton(destination: TaskEditView(task: task).environmentObject(self.userData)) { + Text(task.title) + } + } else { + Button(action: { self.toggleDone() }) { + Text(self.task.title) + } + Spacer() + if task.isDone { + Image(systemName: "checkmark").foregroundColor(.green) + } + } + } + } + + private func toggleDone() { + guard !self.isEditing else { return } + guard let index = self.userData.tasks.firstIndex(where: { $0.id == self.task.id }) else { return } + self.userData.tasks[index].isDone.toggle() + } + + private func delete() { + self.userData.tasks.removeAll(where: { $0.id == self.task.id }) + if self.userData.tasks.isEmpty { + self.isEditing = false + } + } +} diff --git a/Examples/Example To-Do App/SwiftUITodo/TaskListView.swift b/Examples/Example To-Do App/SwiftUITodo/TaskListView.swift new file mode 100755 index 0000000..2ddbcd8 --- /dev/null +++ b/Examples/Example To-Do App/SwiftUITodo/TaskListView.swift @@ -0,0 +1,38 @@ +// +// TaskListView.swift +// SwiftUITodo +// +// Created by Suyeol Jeon on 03/06/2019. +// Copyright © 2019 Suyeol Jeon. All rights reserved. +// + +import SwiftUI + +struct TaskListView: View { + @EnvironmentObject var userData: UserData + @State var draftTitle: String = "" + @State var isEditing: Bool = false + + var body: some View { + List { + TextField($draftTitle, placeholder: Text("Create a New Task..."), onCommit: self.createTask) + ForEach(self.userData.tasks) { task in + TaskItemView(task: task, isEditing: self.$isEditing) + } + } + .navigationBarItem(title: Text("Tasks 👀")) + .navigationBarItems(trailing: Button(action: { self.isEditing.toggle() }) { + if !self.isEditing { + Text("Edit") + } else { + Text("Done").bold() + } + }) + } + + private func createTask() { + let newTask = Task(title: self.draftTitle, isDone: false) + self.userData.tasks.insert(newTask, at: 0) + self.draftTitle = "" + } +} diff --git a/Examples/Example To-Do App/SwiftUITodo/UserData.swift b/Examples/Example To-Do App/SwiftUITodo/UserData.swift new file mode 100755 index 0000000..368e996 --- /dev/null +++ b/Examples/Example To-Do App/SwiftUITodo/UserData.swift @@ -0,0 +1,26 @@ +// +// UserData.swift +// SwiftUITodo +// +// Created by Suyeol Jeon on 03/06/2019. +// Copyright © 2019 Suyeol Jeon. All rights reserved. +// + +import Combine +import SwiftUI + +private let defaultTasks: [Task] = [ + Task(title: "Read SwiftUI Documentation 📚", isDone: false), + Task(title: "Watch WWDC19 Keynote 🎉", isDone: true), +] + +final class UserData: BindableObject { + let didChange = PassthroughSubject() + + @UserDefaultValue(key: "Tasks", defaultValue: defaultTasks) + var tasks: [Task] { + didSet { + didChange.send(self) + } + } +} diff --git a/Examples/Example To-Do App/SwiftUITodo/UserDefaultsValue.swift b/Examples/Example To-Do App/SwiftUITodo/UserDefaultsValue.swift new file mode 100755 index 0000000..73be39c --- /dev/null +++ b/Examples/Example To-Do App/SwiftUITodo/UserDefaultsValue.swift @@ -0,0 +1,28 @@ +// +// UserDefaultsValue.swift +// SwiftUITodo +// +// Created by kemchenj on 2019/6/5. +// Copyright © 2019 Suyeol Jeon. All rights reserved. +// + +import Foundation + +@propertyDelegate +struct UserDefaultValue { + + let key: String + let defaultValue: Value + + var value: Value { + get { + let data = UserDefaults.standard.data(forKey: key) + let value = data.flatMap { try? JSONDecoder().decode(Value.self, from: $0) } + return value ?? defaultValue + } + set { + let data = try? JSONEncoder().encode(newValue) + UserDefaults.standard.set(data, forKey: key) + } + } +} diff --git a/Examples/GitHub Search/.gitignore b/Examples/GitHub Search/.gitignore new file mode 100755 index 0000000..8b7a3dd --- /dev/null +++ b/Examples/GitHub Search/.gitignore @@ -0,0 +1,70 @@ +# Xcode +# +# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore + +.DS_Store + +## Build generated +build/ +DerivedData/ + +## Various settings +*.pbxuser +!default.pbxuser +*.mode1v3 +!default.mode1v3 +*.mode2v3 +!default.mode2v3 +*.perspectivev3 +!default.perspectivev3 +xcuserdata/ + +## Other +*.moved-aside +*.xccheckout +*.xcscmblueprint + +## Obj-C/Swift specific +*.hmap +*.ipa +*.dSYM.zip +*.dSYM + +## Playgrounds +timeline.xctimeline +playground.xcworkspace + +# Swift Package Manager +# +# Add this line if you want to avoid checking in source code from Swift Package Manager dependencies. +# Packages/ +# Package.pins +# Package.resolved +.build/ + +# CocoaPods +# +# We recommend against adding the Pods directory to your .gitignore. However +# you should judge for yourself, the pros and cons are mentioned at: +# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control +# +# Pods/ + +# Carthage +# +# Add this line if you want to avoid checking in source code from Carthage dependencies. +# Carthage/Checkouts + +Carthage/Build + +# fastlane +# +# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the +# screenshots whenever they are needed. +# For more information about the recommended setup visit: +# https://docs.fastlane.tools/best-practices/source-control/#source-control + +fastlane/report.xml +fastlane/Preview.html +fastlane/screenshots/**/*.png +fastlane/test_output diff --git a/Examples/GitHub Search/GitHubSearchWithSwiftUI.xcodeproj/project.pbxproj b/Examples/GitHub Search/GitHubSearchWithSwiftUI.xcodeproj/project.pbxproj new file mode 100755 index 0000000..f3f2403 --- /dev/null +++ b/Examples/GitHub Search/GitHubSearchWithSwiftUI.xcodeproj/project.pbxproj @@ -0,0 +1,401 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 50; + objects = { + +/* Begin PBXBuildFile section */ + ED73146222A6F228004F8DA0 /* RepositoryListView.swift in Sources */ = {isa = PBXBuildFile; fileRef = ED73146122A6F228004F8DA0 /* RepositoryListView.swift */; }; + EDDADAB122A808D500FEDC01 /* Combine.swift in Sources */ = {isa = PBXBuildFile; fileRef = EDDADAB022A808D500FEDC01 /* Combine.swift */; }; + EDDADAB322A809E600FEDC01 /* URLSession.Combine.swift in Sources */ = {isa = PBXBuildFile; fileRef = EDDADAB222A809E600FEDC01 /* URLSession.Combine.swift */; }; + EDDADAB522A821CD00FEDC01 /* ItemResponse.swift in Sources */ = {isa = PBXBuildFile; fileRef = EDDADAB422A821CD00FEDC01 /* ItemResponse.swift */; }; + EDDADAB722A829A300FEDC01 /* RepositoryAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = EDDADAB622A829A300FEDC01 /* RepositoryAPI.swift */; }; + EDDADAB922A82C0400FEDC01 /* RepositoryListViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = EDDADAB822A82C0400FEDC01 /* RepositoryListViewModel.swift */; }; + EDDADABB22A82C2500FEDC01 /* JSONDecoder.Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = EDDADABA22A82C2500FEDC01 /* JSONDecoder.Extension.swift */; }; + EDDF06A222A6C61C00B23D44 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = EDDF06A122A6C61C00B23D44 /* AppDelegate.swift */; }; + EDDF06A422A6C61C00B23D44 /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = EDDF06A322A6C61C00B23D44 /* SceneDelegate.swift */; }; + EDDF06A822A6C61D00B23D44 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = EDDF06A722A6C61D00B23D44 /* Assets.xcassets */; }; + EDDF06AB22A6C61D00B23D44 /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = EDDF06AA22A6C61D00B23D44 /* Preview Assets.xcassets */; }; + EDDF06AE22A6C61D00B23D44 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = EDDF06AC22A6C61D00B23D44 /* LaunchScreen.storyboard */; }; + EDDF06B722A6CD8300B23D44 /* RepositoryView.swift in Sources */ = {isa = PBXBuildFile; fileRef = EDDF06B622A6CD8300B23D44 /* RepositoryView.swift */; }; + EDDF06BA22A6D78200B23D44 /* Repository.swift in Sources */ = {isa = PBXBuildFile; fileRef = EDDF06B922A6D78200B23D44 /* Repository.swift */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + ED73146122A6F228004F8DA0 /* RepositoryListView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RepositoryListView.swift; sourceTree = ""; }; + EDDADAB022A808D500FEDC01 /* Combine.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Combine.swift; sourceTree = ""; }; + EDDADAB222A809E600FEDC01 /* URLSession.Combine.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = URLSession.Combine.swift; sourceTree = ""; }; + EDDADAB422A821CD00FEDC01 /* ItemResponse.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ItemResponse.swift; sourceTree = ""; }; + EDDADAB622A829A300FEDC01 /* RepositoryAPI.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RepositoryAPI.swift; sourceTree = ""; }; + EDDADAB822A82C0400FEDC01 /* RepositoryListViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RepositoryListViewModel.swift; sourceTree = ""; }; + EDDADABA22A82C2500FEDC01 /* JSONDecoder.Extension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = JSONDecoder.Extension.swift; sourceTree = ""; }; + EDDF069E22A6C61C00B23D44 /* GitHubSearchWithSwiftUI.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = GitHubSearchWithSwiftUI.app; sourceTree = BUILT_PRODUCTS_DIR; }; + EDDF06A122A6C61C00B23D44 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + EDDF06A322A6C61C00B23D44 /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = ""; }; + EDDF06A722A6C61D00B23D44 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + EDDF06AA22A6C61D00B23D44 /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = ""; }; + EDDF06AD22A6C61D00B23D44 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + EDDF06AF22A6C61D00B23D44 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + EDDF06B622A6CD8300B23D44 /* RepositoryView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RepositoryView.swift; sourceTree = ""; }; + EDDF06B922A6D78200B23D44 /* Repository.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Repository.swift; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + EDDF069B22A6C61C00B23D44 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + EDDADAAF22A808C300FEDC01 /* Extension */ = { + isa = PBXGroup; + children = ( + EDDADAB022A808D500FEDC01 /* Combine.swift */, + EDDADAB222A809E600FEDC01 /* URLSession.Combine.swift */, + EDDADABA22A82C2500FEDC01 /* JSONDecoder.Extension.swift */, + ); + path = Extension; + sourceTree = ""; + }; + EDDF069522A6C61C00B23D44 = { + isa = PBXGroup; + children = ( + EDDF06A022A6C61C00B23D44 /* GitHubSearchWithSwiftUI */, + EDDF069F22A6C61C00B23D44 /* Products */, + ); + sourceTree = ""; + }; + EDDF069F22A6C61C00B23D44 /* Products */ = { + isa = PBXGroup; + children = ( + EDDF069E22A6C61C00B23D44 /* GitHubSearchWithSwiftUI.app */, + ); + name = Products; + sourceTree = ""; + }; + EDDF06A022A6C61C00B23D44 /* GitHubSearchWithSwiftUI */ = { + isa = PBXGroup; + children = ( + EDDF06A122A6C61C00B23D44 /* AppDelegate.swift */, + EDDF06A322A6C61C00B23D44 /* SceneDelegate.swift */, + EDDADAAF22A808C300FEDC01 /* Extension */, + EDDF06B822A6D77000B23D44 /* Model */, + EDDF06B522A6CD6400B23D44 /* View */, + EDDF06A722A6C61D00B23D44 /* Assets.xcassets */, + EDDF06AC22A6C61D00B23D44 /* LaunchScreen.storyboard */, + EDDF06AF22A6C61D00B23D44 /* Info.plist */, + EDDF06A922A6C61D00B23D44 /* Preview Content */, + ); + path = GitHubSearchWithSwiftUI; + sourceTree = ""; + }; + EDDF06A922A6C61D00B23D44 /* Preview Content */ = { + isa = PBXGroup; + children = ( + EDDF06AA22A6C61D00B23D44 /* Preview Assets.xcassets */, + ); + path = "Preview Content"; + sourceTree = ""; + }; + EDDF06B522A6CD6400B23D44 /* View */ = { + isa = PBXGroup; + children = ( + ED73146122A6F228004F8DA0 /* RepositoryListView.swift */, + EDDF06B622A6CD8300B23D44 /* RepositoryView.swift */, + EDDADAB822A82C0400FEDC01 /* RepositoryListViewModel.swift */, + ); + path = View; + sourceTree = ""; + }; + EDDF06B822A6D77000B23D44 /* Model */ = { + isa = PBXGroup; + children = ( + EDDF06B922A6D78200B23D44 /* Repository.swift */, + EDDADAB422A821CD00FEDC01 /* ItemResponse.swift */, + EDDADAB622A829A300FEDC01 /* RepositoryAPI.swift */, + ); + path = Model; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + EDDF069D22A6C61C00B23D44 /* GitHubSearchWithSwiftUI */ = { + isa = PBXNativeTarget; + buildConfigurationList = EDDF06B222A6C61D00B23D44 /* Build configuration list for PBXNativeTarget "GitHubSearchWithSwiftUI" */; + buildPhases = ( + EDDF069A22A6C61C00B23D44 /* Sources */, + EDDF069B22A6C61C00B23D44 /* Frameworks */, + EDDF069C22A6C61C00B23D44 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = GitHubSearchWithSwiftUI; + productName = GitHubSearchWithSwiftUI; + productReference = EDDF069E22A6C61C00B23D44 /* GitHubSearchWithSwiftUI.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + EDDF069622A6C61C00B23D44 /* Project object */ = { + isa = PBXProject; + attributes = { + LastSwiftUpdateCheck = 1100; + LastUpgradeCheck = 1100; + ORGANIZATIONNAME = "jp.marty-suzuki"; + TargetAttributes = { + EDDF069D22A6C61C00B23D44 = { + CreatedOnToolsVersion = 11.0; + }; + }; + }; + buildConfigurationList = EDDF069922A6C61C00B23D44 /* Build configuration list for PBXProject "GitHubSearchWithSwiftUI" */; + compatibilityVersion = "Xcode 9.3"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = EDDF069522A6C61C00B23D44; + productRefGroup = EDDF069F22A6C61C00B23D44 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + EDDF069D22A6C61C00B23D44 /* GitHubSearchWithSwiftUI */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + EDDF069C22A6C61C00B23D44 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + EDDF06AE22A6C61D00B23D44 /* LaunchScreen.storyboard in Resources */, + EDDF06AB22A6C61D00B23D44 /* Preview Assets.xcassets in Resources */, + EDDF06A822A6C61D00B23D44 /* Assets.xcassets in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + EDDF069A22A6C61C00B23D44 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ED73146222A6F228004F8DA0 /* RepositoryListView.swift in Sources */, + EDDADAB722A829A300FEDC01 /* RepositoryAPI.swift in Sources */, + EDDF06A222A6C61C00B23D44 /* AppDelegate.swift in Sources */, + EDDADAB522A821CD00FEDC01 /* ItemResponse.swift in Sources */, + EDDF06A422A6C61C00B23D44 /* SceneDelegate.swift in Sources */, + EDDADAB922A82C0400FEDC01 /* RepositoryListViewModel.swift in Sources */, + EDDF06BA22A6D78200B23D44 /* Repository.swift in Sources */, + EDDF06B722A6CD8300B23D44 /* RepositoryView.swift in Sources */, + EDDADAB322A809E600FEDC01 /* URLSession.Combine.swift in Sources */, + EDDADABB22A82C2500FEDC01 /* JSONDecoder.Extension.swift in Sources */, + EDDADAB122A808D500FEDC01 /* Combine.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXVariantGroup section */ + EDDF06AC22A6C61D00B23D44 /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + EDDF06AD22A6C61D00B23D44 /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + EDDF06B022A6C61D00B23D44 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 13.0; + MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; + MTL_FAST_MATH = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + }; + name = Debug; + }; + EDDF06B122A6C61D00B23D44 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 13.0; + MTL_ENABLE_DEBUG_INFO = NO; + MTL_FAST_MATH = YES; + SDKROOT = iphoneos; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + EDDF06B322A6C61D00B23D44 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_ASSET_PATHS = "GitHubSearchWithSwiftUI/Preview\\ Content"; + ENABLE_PREVIEWS = YES; + INFOPLIST_FILE = GitHubSearchWithSwiftUI/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = "jp.marty-suzuki.GitHubSearchWithSwiftUI"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + EDDF06B422A6C61D00B23D44 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_ASSET_PATHS = "GitHubSearchWithSwiftUI/Preview\\ Content"; + ENABLE_PREVIEWS = YES; + INFOPLIST_FILE = GitHubSearchWithSwiftUI/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = "jp.marty-suzuki.GitHubSearchWithSwiftUI"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + EDDF069922A6C61C00B23D44 /* Build configuration list for PBXProject "GitHubSearchWithSwiftUI" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + EDDF06B022A6C61D00B23D44 /* Debug */, + EDDF06B122A6C61D00B23D44 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + EDDF06B222A6C61D00B23D44 /* Build configuration list for PBXNativeTarget "GitHubSearchWithSwiftUI" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + EDDF06B322A6C61D00B23D44 /* Debug */, + EDDF06B422A6C61D00B23D44 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = EDDF069622A6C61C00B23D44 /* Project object */; +} diff --git a/Examples/GitHub Search/GitHubSearchWithSwiftUI.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/Examples/GitHub Search/GitHubSearchWithSwiftUI.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100755 index 0000000..ea1588f --- /dev/null +++ b/Examples/GitHub Search/GitHubSearchWithSwiftUI.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/Examples/GitHub Search/GitHubSearchWithSwiftUI.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/Examples/GitHub Search/GitHubSearchWithSwiftUI.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100755 index 0000000..18d9810 --- /dev/null +++ b/Examples/GitHub Search/GitHubSearchWithSwiftUI.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/Examples/GitHub Search/GitHubSearchWithSwiftUI/AppDelegate.swift b/Examples/GitHub Search/GitHubSearchWithSwiftUI/AppDelegate.swift new file mode 100755 index 0000000..f0cbb83 --- /dev/null +++ b/Examples/GitHub Search/GitHubSearchWithSwiftUI/AppDelegate.swift @@ -0,0 +1,41 @@ +// +// AppDelegate.swift +// GitHubSearchWithSwiftUI +// +// Created by marty-suzuki on 2019/06/05. +// Copyright © 2019 jp.marty-suzuki. All rights reserved. +// + +import UIKit + +@UIApplicationMain +class AppDelegate: UIResponder, UIApplicationDelegate { + + + + func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { + // Override point for customization after application launch. + return true + } + + func applicationWillTerminate(_ application: UIApplication) { + // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. + } + + // MARK: UISceneSession Lifecycle + + func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration { + // Called when a new scene session is being created. + // Use this method to select a configuration to create the new scene with. + return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role) + } + + func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set) { + // Called when the user discards a scene session. + // If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions. + // Use this method to release any resources that were specific to the discarded scenes, as they will not return. + } + + +} + diff --git a/Examples/GitHub Search/GitHubSearchWithSwiftUI/Assets.xcassets/AppIcon.appiconset/Contents.json b/Examples/GitHub Search/GitHubSearchWithSwiftUI/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100755 index 0000000..d8db8d6 --- /dev/null +++ b/Examples/GitHub Search/GitHubSearchWithSwiftUI/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,98 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "size" : "20x20", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "20x20", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "3x" + }, + { + "idiom" : "ipad", + "size" : "20x20", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "20x20", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "29x29", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "40x40", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "76x76", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "76x76", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "83.5x83.5", + "scale" : "2x" + }, + { + "idiom" : "ios-marketing", + "size" : "1024x1024", + "scale" : "1x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Examples/GitHub Search/GitHubSearchWithSwiftUI/Assets.xcassets/Contents.json b/Examples/GitHub Search/GitHubSearchWithSwiftUI/Assets.xcassets/Contents.json new file mode 100755 index 0000000..da4a164 --- /dev/null +++ b/Examples/GitHub Search/GitHubSearchWithSwiftUI/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Examples/GitHub Search/GitHubSearchWithSwiftUI/Base.lproj/LaunchScreen.storyboard b/Examples/GitHub Search/GitHubSearchWithSwiftUI/Base.lproj/LaunchScreen.storyboard new file mode 100755 index 0000000..865e932 --- /dev/null +++ b/Examples/GitHub Search/GitHubSearchWithSwiftUI/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Examples/GitHub Search/GitHubSearchWithSwiftUI/Extension/Combine.swift b/Examples/GitHub Search/GitHubSearchWithSwiftUI/Extension/Combine.swift new file mode 100755 index 0000000..45decef --- /dev/null +++ b/Examples/GitHub Search/GitHubSearchWithSwiftUI/Extension/Combine.swift @@ -0,0 +1,41 @@ +// +// Combine.swift +// GitHubSearchWithSwiftUI +// +// Created by marty-suzuki on 2019/06/05. +// Copyright © 2019 jp.marty-suzuki. All rights reserved. +// + +import Foundation + +struct CombineExtension { + let base: Base + + init(_ base: Base) { + self.base = base + } +} + +protocol CombineCompatible { + associatedtype CombineExtensionBase + + static var combine: CombineExtension.Type { get set } + var combine: CombineExtension { get set } +} + +extension CombineCompatible { + + static var combine: CombineExtension.Type { + get { + return CombineExtension.self + } + set {} + } + + var combine: CombineExtension { + get { + return CombineExtension(self) + } + set {} + } +} diff --git a/Examples/GitHub Search/GitHubSearchWithSwiftUI/Extension/JSONDecoder.Extension.swift b/Examples/GitHub Search/GitHubSearchWithSwiftUI/Extension/JSONDecoder.Extension.swift new file mode 100755 index 0000000..98200e5 --- /dev/null +++ b/Examples/GitHub Search/GitHubSearchWithSwiftUI/Extension/JSONDecoder.Extension.swift @@ -0,0 +1,12 @@ +// +// JSONDecoder.Extension.swift +// GitHubSearchWithSwiftUI +// +// Created by marty-suzuki on 2019/06/06. +// Copyright © 2019 jp.marty-suzuki. All rights reserved. +// + +import Combine +import Foundation + +extension JSONDecoder: TopLevelDecoder {} diff --git a/Examples/GitHub Search/GitHubSearchWithSwiftUI/Extension/URLSession.Combine.swift b/Examples/GitHub Search/GitHubSearchWithSwiftUI/Extension/URLSession.Combine.swift new file mode 100755 index 0000000..bd6a46f --- /dev/null +++ b/Examples/GitHub Search/GitHubSearchWithSwiftUI/Extension/URLSession.Combine.swift @@ -0,0 +1,58 @@ +// +// URLSession.Combine.swift +// GitHubSearchWithSwiftUI +// +// Created by marty-suzuki on 2019/06/05. +// Copyright © 2019 jp.marty-suzuki. All rights reserved. +// + +import Combine +import Foundation + +extension URLSession: CombineCompatible {} + +extension CombineExtension where Base == URLSession { + + func send(request: URLRequest) -> AnyPublisher { + + AnyPublisher { [base] subscriber in + + let task = base.dataTask(with: request) { data, response, error in + + guard let response = response as? HTTPURLResponse else { + subscriber.receive(completion: .failure(.invalidResponse)) + return + } + + guard 200..<300 ~= response.statusCode else { + let e = URLSessionError.serverError(statusCode: response.statusCode, + error: error) + subscriber.receive(completion: .failure(e)) + return + } + + guard let data = data else { + subscriber.receive(completion: .failure(.noData)) + return + } + + if let error = error { + subscriber.receive(completion: .failure(.unknown(error))) + } else { + _ = subscriber.receive(data) + subscriber.receive(completion: .finished) + } + } + + // TODO: cancel task when subscriber cancelled + task.resume() + } + } +} + +enum URLSessionError: Error { + case invalidResponse + case noData + case serverError(statusCode: Int, error: Error?) + case unknown(Error) +} diff --git a/Examples/GitHub Search/GitHubSearchWithSwiftUI/Info.plist b/Examples/GitHub Search/GitHubSearchWithSwiftUI/Info.plist new file mode 100755 index 0000000..e8bb4c6 --- /dev/null +++ b/Examples/GitHub Search/GitHubSearchWithSwiftUI/Info.plist @@ -0,0 +1,62 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + $(PRODUCT_BUNDLE_PACKAGE_TYPE) + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1 + LSRequiresIPhoneOS + + UIApplicationSceneManifest + + UIApplicationSupportsMultipleScenes + + UISceneConfigurations + + UIWindowSceneSessionRoleApplication + + + UILaunchStoryboardName + LaunchScreen + UISceneConfigurationName + Default Configuration + UISceneDelegateClassName + $(PRODUCT_MODULE_NAME).SceneDelegate + + + + + UILaunchStoryboardName + LaunchScreen + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/Examples/GitHub Search/GitHubSearchWithSwiftUI/Model/ItemResponse.swift b/Examples/GitHub Search/GitHubSearchWithSwiftUI/Model/ItemResponse.swift new file mode 100755 index 0000000..fcf3e69 --- /dev/null +++ b/Examples/GitHub Search/GitHubSearchWithSwiftUI/Model/ItemResponse.swift @@ -0,0 +1,13 @@ +// +// ItemResponse.swift +// GitHubSearchWithSwiftUI +// +// Created by marty-suzuki on 2019/06/06. +// Copyright © 2019 jp.marty-suzuki. All rights reserved. +// + +import Foundation + +struct ItemResponse: Decodable { + let items: [T] +} diff --git a/Examples/GitHub Search/GitHubSearchWithSwiftUI/Model/Repository.swift b/Examples/GitHub Search/GitHubSearchWithSwiftUI/Model/Repository.swift new file mode 100755 index 0000000..95f0a40 --- /dev/null +++ b/Examples/GitHub Search/GitHubSearchWithSwiftUI/Model/Repository.swift @@ -0,0 +1,17 @@ +// +// Repository.swift +// GitHubSearchWithSwiftUI +// +// Created by marty-suzuki on 2019/06/05. +// Copyright © 2019 jp.marty-suzuki. All rights reserved. +// + +import Foundation + +struct Repository: Decodable { + let id: Int + let fullName: String + let description: String? + let stargazersCount: Int + let htmlUrl: URL +} diff --git a/Examples/GitHub Search/GitHubSearchWithSwiftUI/Model/RepositoryAPI.swift b/Examples/GitHub Search/GitHubSearchWithSwiftUI/Model/RepositoryAPI.swift new file mode 100755 index 0000000..f0fb5ae --- /dev/null +++ b/Examples/GitHub Search/GitHubSearchWithSwiftUI/Model/RepositoryAPI.swift @@ -0,0 +1,36 @@ +// +// RepositoryModel.swift +// GitHubSearchWithSwiftUI +// +// Created by marty-suzuki on 2019/06/06. +// Copyright © 2019 jp.marty-suzuki. All rights reserved. +// + +import Combine +import Foundation + +enum RepositoryAPI { + + static func search(query: String) -> AnyPublisher<[Repository], Error> { + + guard var components = URLComponents(string: "https://api.github.com/search/repositories") else { + return Publishers.Empty<[Repository], Error>().eraseToAnyPublisher() + } + components.queryItems = [URLQueryItem(name: "q", value: query)] + + guard let url = components.url else { + return Publishers.Empty<[Repository], Error>().eraseToAnyPublisher() + } + + var request = URLRequest(url: url) + request.addValue("application/json", forHTTPHeaderField: "Content-Type") + let decoder = JSONDecoder() + decoder.keyDecodingStrategy = .convertFromSnakeCase + return URLSession.shared.combine.send(request: request) + .decode(type: ItemResponse.self, decoder: decoder) + .map { $0.items } + .handleEvents(receiveOutput: { print($0) }, + receiveCompletion: { print($0)}) + .eraseToAnyPublisher() + } +} diff --git a/Examples/GitHub Search/GitHubSearchWithSwiftUI/Preview Content/Preview Assets.xcassets/Contents.json b/Examples/GitHub Search/GitHubSearchWithSwiftUI/Preview Content/Preview Assets.xcassets/Contents.json new file mode 100755 index 0000000..da4a164 --- /dev/null +++ b/Examples/GitHub Search/GitHubSearchWithSwiftUI/Preview Content/Preview Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Examples/GitHub Search/GitHubSearchWithSwiftUI/SceneDelegate.swift b/Examples/GitHub Search/GitHubSearchWithSwiftUI/SceneDelegate.swift new file mode 100755 index 0000000..3a4a981 --- /dev/null +++ b/Examples/GitHub Search/GitHubSearchWithSwiftUI/SceneDelegate.swift @@ -0,0 +1,61 @@ +// +// SceneDelegate.swift +// GitHubSearchWithSwiftUI +// +// Created by marty-suzuki on 2019/06/05. +// Copyright © 2019 jp.marty-suzuki. All rights reserved. +// + +import UIKit +import SwiftUI + +class SceneDelegate: UIResponder, UIWindowSceneDelegate { + + var window: UIWindow? + + + func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) { + // Use this method to optionally configure and attach the UIWindow `window` to the provided UIWindowScene `scene`. + // If using a storyboard, the `window` property will automatically be initialized and attached to the scene. + // This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead). + + // Use a UIHostingController as window root view controller + let window = UIWindow(frame: UIScreen.main.bounds) + window.rootViewController = UIHostingController(rootView: + RepositoryListView().environmentObject(RepositoryListViewModel()) + ) + self.window = window + window.makeKeyAndVisible() + } + + func sceneDidDisconnect(_ scene: UIScene) { + // Called as the scene is being released by the system. + // This occurs shortly after the scene enters the background, or when its session is discarded. + // Release any resources associated with this scene that can be re-created the next time the scene connects. + // The scene may re-connect later, as its session was not neccessarily discarded (see `application:didDiscardSceneSessions` instead). + } + + func sceneDidBecomeActive(_ scene: UIScene) { + // Called when the scene has moved from an inactive state to an active state. + // Use this method to restart any tasks that were paused (or not yet started) when the scene was inactive. + } + + func sceneWillResignActive(_ scene: UIScene) { + // Called when the scene will move from an active state to an inactive state. + // This may occur due to temporary interruptions (ex. an incoming phone call). + } + + func sceneWillEnterForeground(_ scene: UIScene) { + // Called as the scene transitions from the background to the foreground. + // Use this method to undo the changes made on entering the background. + } + + func sceneDidEnterBackground(_ scene: UIScene) { + // Called as the scene transitions from the foreground to the background. + // Use this method to save data, release shared resources, and store enough scene-specific state information + // to restore the scene back to its current state. + } + + +} + diff --git a/Examples/GitHub Search/GitHubSearchWithSwiftUI/View/RepositoryListView.swift b/Examples/GitHub Search/GitHubSearchWithSwiftUI/View/RepositoryListView.swift new file mode 100755 index 0000000..d47a5f3 --- /dev/null +++ b/Examples/GitHub Search/GitHubSearchWithSwiftUI/View/RepositoryListView.swift @@ -0,0 +1,37 @@ +// +// RepositoryListView.swift +// GitHubSearchWithSwiftUI +// +// Created by marty-suzuki on 2019/06/05. +// Copyright © 2019 jp.marty-suzuki. All rights reserved. +// + +import SwiftUI + +struct RepositoryListView : View { + + @EnvironmentObject private var viewModel: RepositoryListViewModel + @State private var text: String = "" + + var body: some View { + + NavigationView { + + TextField($text, + placeholder: Text("Search reposipories..."), + onCommit: { self.viewModel.search(query: self.text) }) + .frame(height: 40) + .padding(EdgeInsets(top: 0, leading: 8, bottom: 0, trailing: 8)) + .border(Color.gray, cornerRadius: 8) + .padding(EdgeInsets(top: 0, leading: 16, bottom: 0, trailing: 16)) + + List { + + ForEach(viewModel.repositories.identified(by: \.id)) { repository in + RepositoryView(repository: repository) + } + } + .navigationBarTitle(Text("Search🔍")) + } + } +} diff --git a/Examples/GitHub Search/GitHubSearchWithSwiftUI/View/RepositoryListViewModel.swift b/Examples/GitHub Search/GitHubSearchWithSwiftUI/View/RepositoryListViewModel.swift new file mode 100755 index 0000000..f5e7360 --- /dev/null +++ b/Examples/GitHub Search/GitHubSearchWithSwiftUI/View/RepositoryListViewModel.swift @@ -0,0 +1,49 @@ +// +// RepositoryListViewModel.swift +// GitHubSearchWithSwiftUI +// +// Created by marty-suzuki on 2019/06/06. +// Copyright © 2019 jp.marty-suzuki. All rights reserved. +// + +import Combine +import Foundation +import SwiftUI + +final class RepositoryListViewModel: BindableObject { + + let didChange: AnyPublisher + private let _didChange = PassthroughSubject() + + private let _searchWithQuery = PassthroughSubject() + private lazy var repositoriesAssign = Subscribers.Assign(object: self, keyPath: \.repositories) + + private(set) var repositories: [Repository] = [] { + didSet { + // TODO: Do not want to use DispatchQueue.main here + DispatchQueue.main.async { + self._didChange.send(self) + } + } + } + + deinit { + repositoriesAssign.cancel() + } + + init() { + self.didChange = _didChange.eraseToAnyPublisher() + + _searchWithQuery + .flatMap { query -> AnyPublisher<[Repository], Never> in + RepositoryAPI.search(query: query) + .replaceError(with: []) + .eraseToAnyPublisher() + } + .receive(subscriber: repositoriesAssign) + } + + func search(query: String) { + _searchWithQuery.send(query) + } +} diff --git a/Examples/GitHub Search/GitHubSearchWithSwiftUI/View/RepositoryView.swift b/Examples/GitHub Search/GitHubSearchWithSwiftUI/View/RepositoryView.swift new file mode 100755 index 0000000..d72af46 --- /dev/null +++ b/Examples/GitHub Search/GitHubSearchWithSwiftUI/View/RepositoryView.swift @@ -0,0 +1,36 @@ +// +// RepositoryView.swift +// GitHubSearchWithSwiftUI +// +// Created by marty-suzuki on 2019/06/05. +// Copyright © 2019 jp.marty-suzuki. All rights reserved. +// + +import SwiftUI + +struct RepositoryView : View { + + let repository: Repository + + var body: some View { + + VStack(alignment: .leading) { + + HStack { + Image(systemName: "doc.text") + Text(repository.fullName) + .bold() + } + + // Show text if description exists + repository.description + .map(Text.init)? + .lineLimit(nil) + + HStack { + Image(systemName: "star") + Text("\(repository.stargazersCount)") + } + } + } +} diff --git a/Examples/GitHub Search/LICENSE b/Examples/GitHub Search/LICENSE new file mode 100755 index 0000000..4f28152 --- /dev/null +++ b/Examples/GitHub Search/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2019 Taiki Suzuki + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/Examples/GitHub Search/README.md b/Examples/GitHub Search/README.md new file mode 100755 index 0000000..5e86d09 --- /dev/null +++ b/Examples/GitHub Search/README.md @@ -0,0 +1,30 @@ +# GitHubSearchWithSwiftUI + +GitHubSearchWithSwiftUI is an example that using [SwiftUI ](https://developer.apple.com/xcode/swiftui/) + + + +## TODO + +- [x] Search with TextField's text +- [x] Reflect API responses to List +- [X] Separate API access from BindableObject +- [X] Use Combine with API access +- [ ] Reflect responses in MainThread via Combine + +## Requirements + +- Xcode 11 Beta +- Swift 5.1 +- iOS 13 Beta + +## References + +- https://developer.apple.com/tutorials/swiftui/tutorials +- https://developer.apple.com/documentation/swiftui +- https://developer.apple.com/documentation/combine +- https://developer.apple.com/design/human-interface-guidelines/sf-symbols/overview/ + +## License + +GitHubSearchWithSwiftUI is under MIT license. See the [LICENSE](./LICENSE) file for more info. diff --git a/Examples/HandlingUserInput/Complete/.gitignore b/Examples/HandlingUserInput/Complete/.gitignore new file mode 100755 index 0000000..9e50718 --- /dev/null +++ b/Examples/HandlingUserInput/Complete/.gitignore @@ -0,0 +1,21 @@ +# See LICENSE folder for this sample’s licensing information. +# +# Apple sample code gitignore configuration. + +# Finder +.DS_Store + +# Xcode - User files +xcuserdata/ + +**/*.xcodeproj/project.xcworkspace/* +!**/*.xcodeproj/project.xcworkspace/xcshareddata + +**/*.xcodeproj/project.xcworkspace/xcshareddata/* +!**/*.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings + +**/*.playground/playground.xcworkspace/* +!**/*.playground/playground.xcworkspace/xcshareddata + +**/*.playground/playground.xcworkspace/xcshareddata/* +!**/*.playground/playground.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings diff --git a/Examples/HandlingUserInput/Complete/Configuration/SampleCode.xcconfig b/Examples/HandlingUserInput/Complete/Configuration/SampleCode.xcconfig new file mode 100755 index 0000000..db86c06 --- /dev/null +++ b/Examples/HandlingUserInput/Complete/Configuration/SampleCode.xcconfig @@ -0,0 +1,13 @@ +// +// See LICENSE folder for this sample’s licensing information. +// +// SampleCode.xcconfig +// + +// The `SAMPLE_CODE_DISAMBIGUATOR` configuration is to make it easier to build +// and run a sample code project. Once you set your project's development team, +// you'll have a unique bundle identifier. This is because the bundle identifier +// is derived based on the 'SAMPLE_CODE_DISAMBIGUATOR' value. Do not use this +// approach in your own projects—it's only useful for sample code projects because +// they are frequently downloaded and don't have a development team set. +SAMPLE_CODE_DISAMBIGUATOR=${DEVELOPMENT_TEAM} diff --git a/Examples/HandlingUserInput/Complete/LICENSE/LICENSE.txt b/Examples/HandlingUserInput/Complete/LICENSE/LICENSE.txt new file mode 100755 index 0000000..94e3d54 --- /dev/null +++ b/Examples/HandlingUserInput/Complete/LICENSE/LICENSE.txt @@ -0,0 +1,8 @@ +Copyright © 2019 Apple Inc. + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + diff --git a/Examples/HandlingUserInput/Complete/Landmarks/HandlingUserInput.xcodeproj/.xcodesamplecode.plist b/Examples/HandlingUserInput/Complete/Landmarks/HandlingUserInput.xcodeproj/.xcodesamplecode.plist new file mode 100755 index 0000000..5dd5da8 --- /dev/null +++ b/Examples/HandlingUserInput/Complete/Landmarks/HandlingUserInput.xcodeproj/.xcodesamplecode.plist @@ -0,0 +1,5 @@ + + + + + diff --git a/Examples/HandlingUserInput/Complete/Landmarks/HandlingUserInput.xcodeproj/project.pbxproj b/Examples/HandlingUserInput/Complete/Landmarks/HandlingUserInput.xcodeproj/project.pbxproj new file mode 100755 index 0000000..dba058a --- /dev/null +++ b/Examples/HandlingUserInput/Complete/Landmarks/HandlingUserInput.xcodeproj/project.pbxproj @@ -0,0 +1,481 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 50; + objects = { + +/* Begin PBXBuildFile section */ + B7394866229F194000C47603 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7394865229F194000C47603 /* AppDelegate.swift */; }; + B7394868229F194000C47603 /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7394867229F194000C47603 /* SceneDelegate.swift */; }; + B739486A229F194000C47603 /* LandmarkDetail.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7394869229F194000C47603 /* LandmarkDetail.swift */; }; + B739486C229F194200C47603 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = B739486B229F194200C47603 /* Assets.xcassets */; }; + B739486F229F194200C47603 /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = B739486E229F194200C47603 /* Preview Assets.xcassets */; }; + B7394872229F194200C47603 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = B7394870229F194200C47603 /* LaunchScreen.storyboard */; }; + B739487A229F1B3F00C47603 /* CircleImage.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7394879229F1B3F00C47603 /* CircleImage.swift */; }; + B739487C229F1B6800C47603 /* MapView.swift in Sources */ = {isa = PBXBuildFile; fileRef = B739487B229F1B6800C47603 /* MapView.swift */; }; + B7394881229F28B900C47603 /* Landmark.swift in Sources */ = {isa = PBXBuildFile; fileRef = B739487F229F28B900C47603 /* Landmark.swift */; }; + B7394882229F28B900C47603 /* Data.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7394880229F28B900C47603 /* Data.swift */; }; + B7394891229F292F00C47603 /* rainbowlake.jpg in Resources */ = {isa = PBXBuildFile; fileRef = B7394884229F292D00C47603 /* rainbowlake.jpg */; }; + B7394893229F292F00C47603 /* icybay.jpg in Resources */ = {isa = PBXBuildFile; fileRef = B7394886229F292E00C47603 /* icybay.jpg */; }; + B7394894229F292F00C47603 /* lakemcdonald.jpg in Resources */ = {isa = PBXBuildFile; fileRef = B7394887229F292E00C47603 /* lakemcdonald.jpg */; }; + B7394895229F292F00C47603 /* turtlerock.jpg in Resources */ = {isa = PBXBuildFile; fileRef = B7394888229F292E00C47603 /* turtlerock.jpg */; }; + B7394896229F292F00C47603 /* umbagog.jpg in Resources */ = {isa = PBXBuildFile; fileRef = B7394889229F292E00C47603 /* umbagog.jpg */; }; + B7394897229F292F00C47603 /* hiddenlake.jpg in Resources */ = {isa = PBXBuildFile; fileRef = B739488A229F292E00C47603 /* hiddenlake.jpg */; }; + B7394898229F292F00C47603 /* stmarylake.jpg in Resources */ = {isa = PBXBuildFile; fileRef = B739488B229F292E00C47603 /* stmarylake.jpg */; }; + B7394899229F292F00C47603 /* twinlake.jpg in Resources */ = {isa = PBXBuildFile; fileRef = B739488C229F292E00C47603 /* twinlake.jpg */; }; + B739489A229F292F00C47603 /* silversalmoncreek.jpg in Resources */ = {isa = PBXBuildFile; fileRef = B739488D229F292E00C47603 /* silversalmoncreek.jpg */; }; + B739489B229F292F00C47603 /* landmarkData.json in Resources */ = {isa = PBXBuildFile; fileRef = B739488E229F292E00C47603 /* landmarkData.json */; }; + B739489C229F292F00C47603 /* chincoteague.jpg in Resources */ = {isa = PBXBuildFile; fileRef = B739488F229F292F00C47603 /* chincoteague.jpg */; }; + B739489D229F292F00C47603 /* chilkoottrail.jpg in Resources */ = {isa = PBXBuildFile; fileRef = B7394890229F292F00C47603 /* chilkoottrail.jpg */; }; + B739489F229F2D9700C47603 /* LandmarkRow.swift in Sources */ = {isa = PBXBuildFile; fileRef = B739489E229F2D9700C47603 /* LandmarkRow.swift */; }; + B73948A1229F2E1F00C47603 /* LandmarkList.swift in Sources */ = {isa = PBXBuildFile; fileRef = B73948A0229F2E1F00C47603 /* LandmarkList.swift */; }; + B73948A3229F3E2200C47603 /* charleyrivers.jpg in Resources */ = {isa = PBXBuildFile; fileRef = B73948A2229F3E2200C47603 /* charleyrivers.jpg */; }; + B7D2AAC5229F4D7C0061E5F5 /* UserData.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7D2AAC4229F4D7C0061E5F5 /* UserData.swift */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + B7394862229F194000C47603 /* Landmarks.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Landmarks.app; sourceTree = BUILT_PRODUCTS_DIR; }; + B7394865229F194000C47603 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + B7394867229F194000C47603 /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = ""; }; + B7394869229F194000C47603 /* LandmarkDetail.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LandmarkDetail.swift; sourceTree = ""; }; + B739486B229F194200C47603 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + B739486E229F194200C47603 /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = ""; }; + B7394871229F194200C47603 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + B7394873229F194200C47603 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + B7394879229F1B3F00C47603 /* CircleImage.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CircleImage.swift; sourceTree = ""; }; + B739487B229F1B6800C47603 /* MapView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MapView.swift; sourceTree = ""; }; + B739487F229F28B900C47603 /* Landmark.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Landmark.swift; sourceTree = ""; }; + B7394880229F28B900C47603 /* Data.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Data.swift; sourceTree = ""; }; + B7394884229F292D00C47603 /* rainbowlake.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = rainbowlake.jpg; sourceTree = ""; }; + B7394886229F292E00C47603 /* icybay.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = icybay.jpg; sourceTree = ""; }; + B7394887229F292E00C47603 /* lakemcdonald.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = lakemcdonald.jpg; sourceTree = ""; }; + B7394888229F292E00C47603 /* turtlerock.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = turtlerock.jpg; sourceTree = ""; }; + B7394889229F292E00C47603 /* umbagog.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = umbagog.jpg; sourceTree = ""; }; + B739488A229F292E00C47603 /* hiddenlake.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = hiddenlake.jpg; sourceTree = ""; }; + B739488B229F292E00C47603 /* stmarylake.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = stmarylake.jpg; sourceTree = ""; }; + B739488C229F292E00C47603 /* twinlake.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = twinlake.jpg; sourceTree = ""; }; + B739488D229F292E00C47603 /* silversalmoncreek.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = silversalmoncreek.jpg; sourceTree = ""; }; + B739488E229F292E00C47603 /* landmarkData.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = landmarkData.json; sourceTree = ""; }; + B739488F229F292F00C47603 /* chincoteague.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = chincoteague.jpg; sourceTree = ""; }; + B7394890229F292F00C47603 /* chilkoottrail.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = chilkoottrail.jpg; sourceTree = ""; }; + B739489E229F2D9700C47603 /* LandmarkRow.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = LandmarkRow.swift; path = "Supporting Views/LandmarkRow.swift"; sourceTree = ""; }; + B73948A0229F2E1F00C47603 /* LandmarkList.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LandmarkList.swift; sourceTree = ""; }; + B73948A2229F3E2200C47603 /* charleyrivers.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = charleyrivers.jpg; sourceTree = ""; }; + B7D2AAC4229F4D7C0061E5F5 /* UserData.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UserData.swift; sourceTree = ""; }; + C4E4AAA0C4E4035000000001 /* README.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; name = README.md; path = ../README.md; sourceTree = ""; }; + E161B9F0E161E81000000001 /* LICENSE.txt */ = {isa = PBXFileReference; includeInIndex = 1; path = LICENSE.txt; sourceTree = ""; }; + E388E810E388DE8000000001 /* SampleCode.xcconfig */ = {isa = PBXFileReference; name = SampleCode.xcconfig; path = ../Configuration/SampleCode.xcconfig; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + B739485F229F194000C47603 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + B7394859229F194000C47603 = { + isa = PBXGroup; + children = ( + C4E4AAA0C4E4035000000001 /* README.md */, + B7394864229F194000C47603 /* Landmarks */, + B7394863229F194000C47603 /* Products */, + E388E310E388E2D000000001 /* Configuration */, + E165E430E166469000000001 /* LICENSE */, + ); + sourceTree = ""; + }; + B7394863229F194000C47603 /* Products */ = { + isa = PBXGroup; + children = ( + B7394862229F194000C47603 /* Landmarks.app */, + ); + name = Products; + sourceTree = ""; + }; + B7394864229F194000C47603 /* Landmarks */ = { + isa = PBXGroup; + children = ( + B739487E229F282200C47603 /* Models */, + B7394865229F194000C47603 /* AppDelegate.swift */, + B7394867229F194000C47603 /* SceneDelegate.swift */, + B73948A0229F2E1F00C47603 /* LandmarkList.swift */, + B739489E229F2D9700C47603 /* LandmarkRow.swift */, + B7394869229F194000C47603 /* LandmarkDetail.swift */, + B739487D229F1C0100C47603 /* Supporting Views */, + B7394883229F291A00C47603 /* Resources */, + B739486B229F194200C47603 /* Assets.xcassets */, + B7394870229F194200C47603 /* LaunchScreen.storyboard */, + B7394873229F194200C47603 /* Info.plist */, + B739486D229F194200C47603 /* Preview Content */, + ); + path = Landmarks; + sourceTree = ""; + }; + B739486D229F194200C47603 /* Preview Content */ = { + isa = PBXGroup; + children = ( + B739486E229F194200C47603 /* Preview Assets.xcassets */, + ); + path = "Preview Content"; + sourceTree = ""; + }; + B739487D229F1C0100C47603 /* Supporting Views */ = { + isa = PBXGroup; + children = ( + B7394879229F1B3F00C47603 /* CircleImage.swift */, + B739487B229F1B6800C47603 /* MapView.swift */, + ); + path = "Supporting Views"; + sourceTree = ""; + }; + B739487E229F282200C47603 /* Models */ = { + isa = PBXGroup; + children = ( + B7394880229F28B900C47603 /* Data.swift */, + B739487F229F28B900C47603 /* Landmark.swift */, + B7D2AAC4229F4D7C0061E5F5 /* UserData.swift */, + ); + path = Models; + sourceTree = ""; + }; + B7394883229F291A00C47603 /* Resources */ = { + isa = PBXGroup; + children = ( + B739488E229F292E00C47603 /* landmarkData.json */, + B7394890229F292F00C47603 /* chilkoottrail.jpg */, + B739488F229F292F00C47603 /* chincoteague.jpg */, + B739488A229F292E00C47603 /* hiddenlake.jpg */, + B7394886229F292E00C47603 /* icybay.jpg */, + B7394887229F292E00C47603 /* lakemcdonald.jpg */, + B7394884229F292D00C47603 /* rainbowlake.jpg */, + B739488D229F292E00C47603 /* silversalmoncreek.jpg */, + B739488B229F292E00C47603 /* stmarylake.jpg */, + B7394888229F292E00C47603 /* turtlerock.jpg */, + B739488C229F292E00C47603 /* twinlake.jpg */, + B7394889229F292E00C47603 /* umbagog.jpg */, + B73948A2229F3E2200C47603 /* charleyrivers.jpg */, + ); + path = Resources; + sourceTree = ""; + }; + E165E430E166469000000001 /* LICENSE */ = { + isa = PBXGroup; + children = ( + E161B9F0E161E81000000001 /* LICENSE.txt */, + ); + name = LICENSE; + path = ../LICENSE; + sourceTree = ""; + }; + E388E310E388E2D000000001 /* Configuration */ = { + isa = PBXGroup; + children = ( + E388E810E388DE8000000001 /* SampleCode.xcconfig */, + ); + name = Configuration; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + B7394861229F194000C47603 /* Landmarks */ = { + isa = PBXNativeTarget; + buildConfigurationList = B7394876229F194200C47603 /* Build configuration list for PBXNativeTarget "Landmarks" */; + buildPhases = ( + B739485E229F194000C47603 /* Sources */, + B739485F229F194000C47603 /* Frameworks */, + B7394860229F194000C47603 /* Resources */, + C602AC70C605937000000001, + ); + buildRules = ( + ); + dependencies = ( + ); + name = Landmarks; + productName = Landmarks; + productReference = B7394862229F194000C47603 /* Landmarks.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + B739485A229F194000C47603 /* Project object */ = { + isa = PBXProject; + attributes = { + LastSwiftUpdateCheck = 1100; + LastUpgradeCheck = 1100; + ORGANIZATIONNAME = Apple; + TargetAttributes = { + B7394861229F194000C47603 = { + CreatedOnToolsVersion = 11.0; + }; + }; + }; + buildConfigurationList = B739485D229F194000C47603 /* Build configuration list for PBXProject "HandlingUserInput" */; + compatibilityVersion = "Xcode 9.3"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = B7394859229F194000C47603; + productRefGroup = B7394863229F194000C47603 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + B7394861229F194000C47603 /* Landmarks */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + B7394860229F194000C47603 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + B739489A229F292F00C47603 /* silversalmoncreek.jpg in Resources */, + B7394894229F292F00C47603 /* lakemcdonald.jpg in Resources */, + B7394872229F194200C47603 /* LaunchScreen.storyboard in Resources */, + B73948A3229F3E2200C47603 /* charleyrivers.jpg in Resources */, + B7394891229F292F00C47603 /* rainbowlake.jpg in Resources */, + B739486F229F194200C47603 /* Preview Assets.xcassets in Resources */, + B7394895229F292F00C47603 /* turtlerock.jpg in Resources */, + B739486C229F194200C47603 /* Assets.xcassets in Resources */, + B7394899229F292F00C47603 /* twinlake.jpg in Resources */, + B7394896229F292F00C47603 /* umbagog.jpg in Resources */, + B739489D229F292F00C47603 /* chilkoottrail.jpg in Resources */, + B739489C229F292F00C47603 /* chincoteague.jpg in Resources */, + B739489B229F292F00C47603 /* landmarkData.json in Resources */, + B7394893229F292F00C47603 /* icybay.jpg in Resources */, + B7394897229F292F00C47603 /* hiddenlake.jpg in Resources */, + B7394898229F292F00C47603 /* stmarylake.jpg in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + B739485E229F194000C47603 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + B7394882229F28B900C47603 /* Data.swift in Sources */, + B7394866229F194000C47603 /* AppDelegate.swift in Sources */, + B739487A229F1B3F00C47603 /* CircleImage.swift in Sources */, + B739487C229F1B6800C47603 /* MapView.swift in Sources */, + B73948A1229F2E1F00C47603 /* LandmarkList.swift in Sources */, + B7394868229F194000C47603 /* SceneDelegate.swift in Sources */, + B739486A229F194000C47603 /* LandmarkDetail.swift in Sources */, + B739489F229F2D9700C47603 /* LandmarkRow.swift in Sources */, + B7D2AAC5229F4D7C0061E5F5 /* UserData.swift in Sources */, + B7394881229F28B900C47603 /* Landmark.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXVariantGroup section */ + B7394870229F194200C47603 /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + B7394871229F194200C47603 /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + B7394874229F194200C47603 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = E388E810E388DE8000000001 /* SampleCode.xcconfig */; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 13.0; + MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; + MTL_FAST_MATH = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + }; + name = Debug; + }; + B7394875229F194200C47603 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = E388E810E388DE8000000001 /* SampleCode.xcconfig */; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 13.0; + MTL_ENABLE_DEBUG_INFO = NO; + MTL_FAST_MATH = YES; + SDKROOT = iphoneos; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + B7394877229F194200C47603 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = E388E810E388DE8000000001 /* SampleCode.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_ASSET_PATHS = "Landmarks/Preview\\ Content"; + DEVELOPMENT_TEAM = ""; + ENABLE_PREVIEWS = YES; + INFOPLIST_FILE = Landmarks/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = "com.example.apple-samplecode.Landmarks${SAMPLE_CODE_DISAMBIGUATOR}"; + PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE_SPECIFIER = ""; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + B7394878229F194200C47603 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = E388E810E388DE8000000001 /* SampleCode.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_ASSET_PATHS = "Landmarks/Preview\\ Content"; + DEVELOPMENT_TEAM = ""; + ENABLE_PREVIEWS = YES; + INFOPLIST_FILE = Landmarks/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = "com.example.apple-samplecode.Landmarks${SAMPLE_CODE_DISAMBIGUATOR}"; + PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE_SPECIFIER = ""; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + B739485D229F194000C47603 /* Build configuration list for PBXProject "HandlingUserInput" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + B7394874229F194200C47603 /* Debug */, + B7394875229F194200C47603 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + B7394876229F194200C47603 /* Build configuration list for PBXNativeTarget "Landmarks" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + B7394877229F194200C47603 /* Debug */, + B7394878229F194200C47603 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = B739485A229F194000C47603 /* Project object */; +} diff --git a/Examples/HandlingUserInput/Complete/Landmarks/HandlingUserInput.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/Examples/HandlingUserInput/Complete/Landmarks/HandlingUserInput.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings new file mode 100755 index 0000000..3ddf867 --- /dev/null +++ b/Examples/HandlingUserInput/Complete/Landmarks/HandlingUserInput.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings @@ -0,0 +1,8 @@ + + + + + BuildSystemType + Latest + + diff --git a/Examples/HandlingUserInput/Complete/Landmarks/Landmarks/AppDelegate.swift b/Examples/HandlingUserInput/Complete/Landmarks/Landmarks/AppDelegate.swift new file mode 100755 index 0000000..e22943b --- /dev/null +++ b/Examples/HandlingUserInput/Complete/Landmarks/Landmarks/AppDelegate.swift @@ -0,0 +1,36 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +The application delegate. +*/ + +import UIKit + +@UIApplicationMain +class AppDelegate: UIResponder, UIApplicationDelegate { + + func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { + // Override point for customization after application launch. + return true + } + + func applicationWillTerminate(_ application: UIApplication) { + // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. + } + + // MARK: UISceneSession Lifecycle + func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration { + // Called when a new scene session is being created. + // Use this method to select a configuration to create the new scene with. + return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role) + } + + func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set) { + // Called when the user discards a scene session. + // If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions. + // Use this method to release any resources that were specific to the discarded scenes, as they will not return. + } + +} + diff --git a/Examples/HandlingUserInput/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/Contents.json b/Examples/HandlingUserInput/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100755 index 0000000..fa0d2db --- /dev/null +++ b/Examples/HandlingUserInput/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,113 @@ +{ + "images" : [ + { + "size" : "20x20", + "idiom" : "iphone", + "filename" : "landmark_app_icon_40x40.png", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "20x20", + "scale" : "3x" + }, + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "landmark_app_icon_58x58.png", + "scale" : "2x" + }, + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "landmark_app_icon_87x87.png", + "scale" : "3x" + }, + { + "size" : "40x40", + "idiom" : "iphone", + "filename" : "landmark_app_icon_80x80.png", + "scale" : "2x" + }, + { + "size" : "40x40", + "idiom" : "iphone", + "filename" : "landmark_app_icon_120x120.png", + "scale" : "3x" + }, + { + "size" : "60x60", + "idiom" : "iphone", + "filename" : "landmark_app_icon_120x120-1.png", + "scale" : "2x" + }, + { + "size" : "60x60", + "idiom" : "iphone", + "filename" : "landmark_app_icon_180x180.png", + "scale" : "3x" + }, + { + "idiom" : "ipad", + "size" : "20x20", + "scale" : "1x" + }, + { + "size" : "20x20", + "idiom" : "ipad", + "filename" : "landmark_app_icon_40x40-1.png", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "29x29", + "scale" : "1x" + }, + { + "size" : "29x29", + "idiom" : "ipad", + "filename" : "landmark_app_icon_58x58-1.png", + "scale" : "2x" + }, + { + "size" : "40x40", + "idiom" : "ipad", + "filename" : "landmark_app_icon_40x40-2.png", + "scale" : "1x" + }, + { + "size" : "40x40", + "idiom" : "ipad", + "filename" : "landmark_app_icon_80x80-1.png", + "scale" : "2x" + }, + { + "size" : "76x76", + "idiom" : "ipad", + "filename" : "landmark_app_icon_76x76.png", + "scale" : "1x" + }, + { + "size" : "76x76", + "idiom" : "ipad", + "filename" : "landmark_app_icon_152x152.png", + "scale" : "2x" + }, + { + "size" : "83.5x83.5", + "idiom" : "ipad", + "filename" : "landmark_app_icon_167x167.png", + "scale" : "2x" + }, + { + "size" : "1024x1024", + "idiom" : "ios-marketing", + "filename" : "landmark_app_icon_1024x1024.png", + "scale" : "1x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Examples/HandlingUserInput/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_1024x1024.png b/Examples/HandlingUserInput/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_1024x1024.png new file mode 100755 index 0000000..00d81c1 Binary files /dev/null and b/Examples/HandlingUserInput/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_1024x1024.png differ diff --git a/Examples/HandlingUserInput/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_120x120-1.png b/Examples/HandlingUserInput/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_120x120-1.png new file mode 100755 index 0000000..d382b8b Binary files /dev/null and b/Examples/HandlingUserInput/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_120x120-1.png differ diff --git a/Examples/HandlingUserInput/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_120x120.png b/Examples/HandlingUserInput/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_120x120.png new file mode 100755 index 0000000..d382b8b Binary files /dev/null and b/Examples/HandlingUserInput/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_120x120.png differ diff --git a/Examples/HandlingUserInput/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_152x152.png b/Examples/HandlingUserInput/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_152x152.png new file mode 100755 index 0000000..11057f8 Binary files /dev/null and b/Examples/HandlingUserInput/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_152x152.png differ diff --git a/Examples/HandlingUserInput/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_167x167.png b/Examples/HandlingUserInput/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_167x167.png new file mode 100755 index 0000000..f73bc26 Binary files /dev/null and b/Examples/HandlingUserInput/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_167x167.png differ diff --git a/Examples/HandlingUserInput/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_180x180.png b/Examples/HandlingUserInput/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_180x180.png new file mode 100755 index 0000000..b02738c Binary files /dev/null and b/Examples/HandlingUserInput/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_180x180.png differ diff --git a/Examples/HandlingUserInput/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_40x40-1.png b/Examples/HandlingUserInput/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_40x40-1.png new file mode 100755 index 0000000..abaff0e Binary files /dev/null and b/Examples/HandlingUserInput/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_40x40-1.png differ diff --git a/Examples/HandlingUserInput/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_40x40-2.png b/Examples/HandlingUserInput/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_40x40-2.png new file mode 100755 index 0000000..abaff0e Binary files /dev/null and b/Examples/HandlingUserInput/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_40x40-2.png differ diff --git a/Examples/HandlingUserInput/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_40x40.png b/Examples/HandlingUserInput/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_40x40.png new file mode 100755 index 0000000..abaff0e Binary files /dev/null and b/Examples/HandlingUserInput/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_40x40.png differ diff --git a/Examples/HandlingUserInput/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_58x58-1.png b/Examples/HandlingUserInput/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_58x58-1.png new file mode 100755 index 0000000..cf7c73d Binary files /dev/null and b/Examples/HandlingUserInput/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_58x58-1.png differ diff --git a/Examples/HandlingUserInput/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_58x58.png b/Examples/HandlingUserInput/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_58x58.png new file mode 100755 index 0000000..cf7c73d Binary files /dev/null and b/Examples/HandlingUserInput/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_58x58.png differ diff --git a/Examples/HandlingUserInput/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_76x76.png b/Examples/HandlingUserInput/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_76x76.png new file mode 100755 index 0000000..3eff85b Binary files /dev/null and b/Examples/HandlingUserInput/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_76x76.png differ diff --git a/Examples/HandlingUserInput/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_80x80-1.png b/Examples/HandlingUserInput/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_80x80-1.png new file mode 100755 index 0000000..6f33f66 Binary files /dev/null and b/Examples/HandlingUserInput/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_80x80-1.png differ diff --git a/Examples/HandlingUserInput/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_80x80.png b/Examples/HandlingUserInput/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_80x80.png new file mode 100755 index 0000000..6f33f66 Binary files /dev/null and b/Examples/HandlingUserInput/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_80x80.png differ diff --git a/Examples/HandlingUserInput/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_87x87.png b/Examples/HandlingUserInput/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_87x87.png new file mode 100755 index 0000000..9e1616c Binary files /dev/null and b/Examples/HandlingUserInput/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_87x87.png differ diff --git a/Examples/HandlingUserInput/Complete/Landmarks/Landmarks/Assets.xcassets/Contents.json b/Examples/HandlingUserInput/Complete/Landmarks/Landmarks/Assets.xcassets/Contents.json new file mode 100755 index 0000000..da4a164 --- /dev/null +++ b/Examples/HandlingUserInput/Complete/Landmarks/Landmarks/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Examples/HandlingUserInput/Complete/Landmarks/Landmarks/Assets.xcassets/turtlerock.imageset/Contents.json b/Examples/HandlingUserInput/Complete/Landmarks/Landmarks/Assets.xcassets/turtlerock.imageset/Contents.json new file mode 100755 index 0000000..5bfd7bf --- /dev/null +++ b/Examples/HandlingUserInput/Complete/Landmarks/Landmarks/Assets.xcassets/turtlerock.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "turtlerock.jpg", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Examples/HandlingUserInput/Complete/Landmarks/Landmarks/Assets.xcassets/turtlerock.imageset/turtlerock.jpg b/Examples/HandlingUserInput/Complete/Landmarks/Landmarks/Assets.xcassets/turtlerock.imageset/turtlerock.jpg new file mode 100755 index 0000000..68bcd3e Binary files /dev/null and b/Examples/HandlingUserInput/Complete/Landmarks/Landmarks/Assets.xcassets/turtlerock.imageset/turtlerock.jpg differ diff --git a/Examples/HandlingUserInput/Complete/Landmarks/Landmarks/Base.lproj/LaunchScreen.storyboard b/Examples/HandlingUserInput/Complete/Landmarks/Landmarks/Base.lproj/LaunchScreen.storyboard new file mode 100755 index 0000000..865e932 --- /dev/null +++ b/Examples/HandlingUserInput/Complete/Landmarks/Landmarks/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Examples/HandlingUserInput/Complete/Landmarks/Landmarks/Info.plist b/Examples/HandlingUserInput/Complete/Landmarks/Landmarks/Info.plist new file mode 100755 index 0000000..e8bb4c6 --- /dev/null +++ b/Examples/HandlingUserInput/Complete/Landmarks/Landmarks/Info.plist @@ -0,0 +1,62 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + $(PRODUCT_BUNDLE_PACKAGE_TYPE) + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1 + LSRequiresIPhoneOS + + UIApplicationSceneManifest + + UIApplicationSupportsMultipleScenes + + UISceneConfigurations + + UIWindowSceneSessionRoleApplication + + + UILaunchStoryboardName + LaunchScreen + UISceneConfigurationName + Default Configuration + UISceneDelegateClassName + $(PRODUCT_MODULE_NAME).SceneDelegate + + + + + UILaunchStoryboardName + LaunchScreen + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/Examples/HandlingUserInput/Complete/Landmarks/Landmarks/LandmarkDetail.swift b/Examples/HandlingUserInput/Complete/Landmarks/Landmarks/LandmarkDetail.swift new file mode 100755 index 0000000..6c290a3 --- /dev/null +++ b/Examples/HandlingUserInput/Complete/Landmarks/Landmarks/LandmarkDetail.swift @@ -0,0 +1,71 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +A view showing the details for a landmark. +*/ + +import SwiftUI + +struct LandmarkDetail: View { + @EnvironmentObject var userData: UserData + var landmark: Landmark + + var landmarkIndex: Int { + userData.landmarks.firstIndex(where: { $0.id == landmark.id })! + } + + var body: some View { + VStack { + MapView(coordinate: landmark.locationCoordinate) + .edgesIgnoringSafeArea(.top) + .frame(height: 300) + + CircleImage(image: landmark.image(forSize: 250)) + .offset(x: 0, y: -130) + .padding(.bottom, -130) + + VStack(alignment: .leading) { + HStack { + Text(verbatim: landmark.name) + .font(.title) + + Button(action: { + self.userData.landmarks[self.landmarkIndex] + .isFavorite.toggle() + }) { + if self.userData.landmarks[self.landmarkIndex] + .isFavorite { + Image(systemName: "star.fill") + .foregroundColor(Color.yellow) + } else { + Image(systemName: "star") + .foregroundColor(Color.gray) + } + } + } + + HStack(alignment: .top) { + Text(verbatim: landmark.park) + .font(.subheadline) + Spacer() + Text(verbatim: landmark.state) + .font(.subheadline) + } + } + .padding() + + Spacer() + } + } +} + +#if DEBUG +struct LandmarkDetail_Preview: PreviewProvider { + static var previews: some View { + let userData = UserData() + return LandmarkDetail(landmark: userData.landmarks[0]) + .environmentObject(userData) + } +} +#endif diff --git a/Examples/HandlingUserInput/Complete/Landmarks/Landmarks/LandmarkList.swift b/Examples/HandlingUserInput/Complete/Landmarks/Landmarks/LandmarkList.swift new file mode 100755 index 0000000..c17b5f3 --- /dev/null +++ b/Examples/HandlingUserInput/Complete/Landmarks/Landmarks/LandmarkList.swift @@ -0,0 +1,45 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +A view showing a list of landmarks. +*/ + +import SwiftUI + +struct LandmarkList: View { + @EnvironmentObject private var userData: UserData + + var body: some View { + NavigationView { + List { + Toggle(isOn: $userData.showFavoritesOnly) { + Text("Show Favorites Only") + } + + ForEach(userData.landmarks) { landmark in + if !self.userData.showFavoritesOnly || landmark.isFavorite { + NavigationButton( + destination: LandmarkDetail(landmark: landmark)) { + LandmarkRow(landmark: landmark) + } + } + } + } + .navigationBarTitle(Text("Landmarks"), displayMode: .large) + } + } +} + +#if DEBUG +struct LandmarksList_Previews: PreviewProvider { + static var previews: some View { + ForEach(["iPhone SE", "iPhone XS Max"].identified(by: \.self)) { deviceName in + LandmarkList() + .previewDevice(PreviewDevice(rawValue: deviceName)) + .previewDisplayName(deviceName) + } + .environmentObject(UserData()) + } +} +#endif diff --git a/Examples/HandlingUserInput/Complete/Landmarks/Landmarks/Models/Data.swift b/Examples/HandlingUserInput/Complete/Landmarks/Landmarks/Models/Data.swift new file mode 100755 index 0000000..78837f6 --- /dev/null +++ b/Examples/HandlingUserInput/Complete/Landmarks/Landmarks/Models/Data.swift @@ -0,0 +1,93 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +Helpers for loading images and data. +*/ + +import UIKit +import SwiftUI +import CoreLocation + +let landmarkData: [Landmark] = load("landmarkData.json") + +func load(_ filename: String, as type: T.Type = T.self) -> T { + let data: Data + + guard let file = Bundle.main.url(forResource: filename, withExtension: nil) + else { + fatalError("Couldn't find \(filename) in main bundle.") + } + + do { + data = try Data(contentsOf: file) + } catch { + fatalError("Couldn't load \(filename) from main bundle:\n\(error)") + } + + do { + let decoder = JSONDecoder() + return try decoder.decode(T.self, from: data) + } catch { + fatalError("Couldn't parse \(filename) as \(T.self):\n\(error)") + } +} + +final class ImageStore { + fileprivate typealias _ImageDictionary = [String: [Int: CGImage]] + fileprivate var images: _ImageDictionary = [:] + + fileprivate static var originalSize = 250 + fileprivate static var scale = 2 + + static var shared = ImageStore() + + func image(name: String, size: Int) -> Image { + let index = _guaranteeInitialImage(name: name) + + let sizedImage = images.values[index][size] + ?? _sizeImage(images.values[index][ImageStore.originalSize]!, to: size * ImageStore.scale) + images.values[index][size] = sizedImage + + return Image(sizedImage, scale: Length(ImageStore.scale), label: Text(verbatim: name)) + } + + fileprivate func _guaranteeInitialImage(name: String) -> _ImageDictionary.Index { + if let index = images.index(forKey: name) { return index } + + guard + let url = Bundle.main.url(forResource: name, withExtension: "jpg"), + let imageSource = CGImageSourceCreateWithURL(url as NSURL, nil), + let image = CGImageSourceCreateImageAtIndex(imageSource, 0, nil) + else { + fatalError("Couldn't load image \(name).jpg from main bundle.") + } + + images[name] = [ImageStore.originalSize: image] + return images.index(forKey: name)! + } + + fileprivate func _sizeImage(_ image: CGImage, to size: Int) -> CGImage { + guard + let colorSpace = image.colorSpace, + let context = CGContext( + data: nil, + width: size, height: size, + bitsPerComponent: image.bitsPerComponent, + bytesPerRow: image.bytesPerRow, + space: colorSpace, + bitmapInfo: image.bitmapInfo.rawValue) + else { + fatalError("Couldn't create graphics context.") + } + context.interpolationQuality = .high + context.draw(image, in: CGRect(x: 0, y: 0, width: size, height: size)) + + if let sizedImage = context.makeImage() { + return sizedImage + } else { + fatalError("Couldn't resize image.") + } + } +} + diff --git a/Examples/HandlingUserInput/Complete/Landmarks/Landmarks/Models/Landmark.swift b/Examples/HandlingUserInput/Complete/Landmarks/Landmarks/Models/Landmark.swift new file mode 100755 index 0000000..79b9aa4 --- /dev/null +++ b/Examples/HandlingUserInput/Complete/Landmarks/Landmarks/Models/Landmark.swift @@ -0,0 +1,42 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +The model for an individual landmark. +*/ + +import SwiftUI +import CoreLocation + +struct Landmark: Hashable, Codable, Identifiable { + var id: Int + var name: String + fileprivate var imageName: String + fileprivate var coordinates: Coordinates + var state: String + var park: String + var category: Category + var isFavorite: Bool + + var locationCoordinate: CLLocationCoordinate2D { + CLLocationCoordinate2D( + latitude: coordinates.latitude, + longitude: coordinates.longitude) + } + + func image(forSize size: Int) -> Image { + ImageStore.shared.image(name: imageName, size: size) + } + + enum Category: String, CaseIterable, Codable, Hashable { + case featured = "Featured" + case lakes = "Lakes" + case rivers = "Rivers" + case mountains = "Mountains" + } +} + +struct Coordinates: Hashable, Codable { + var latitude: Double + var longitude: Double +} diff --git a/Examples/HandlingUserInput/Complete/Landmarks/Landmarks/Models/UserData.swift b/Examples/HandlingUserInput/Complete/Landmarks/Landmarks/Models/UserData.swift new file mode 100755 index 0000000..db31fb0 --- /dev/null +++ b/Examples/HandlingUserInput/Complete/Landmarks/Landmarks/Models/UserData.swift @@ -0,0 +1,25 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +A model object that stores app data. +*/ + +import Combine +import SwiftUI + +final class UserData: BindableObject { + let didChange = PassthroughSubject() + + var showFavoritesOnly = false { + didSet { + didChange.send(self) + } + } + + var landmarks = landmarkData { + didSet { + didChange.send(self) + } + } +} diff --git a/Examples/HandlingUserInput/Complete/Landmarks/Landmarks/Preview Content/Preview Assets.xcassets/Contents.json b/Examples/HandlingUserInput/Complete/Landmarks/Landmarks/Preview Content/Preview Assets.xcassets/Contents.json new file mode 100755 index 0000000..da4a164 --- /dev/null +++ b/Examples/HandlingUserInput/Complete/Landmarks/Landmarks/Preview Content/Preview Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Examples/HandlingUserInput/Complete/Landmarks/Landmarks/Resources/charleyrivers.jpg b/Examples/HandlingUserInput/Complete/Landmarks/Landmarks/Resources/charleyrivers.jpg new file mode 100755 index 0000000..17ff44b Binary files /dev/null and b/Examples/HandlingUserInput/Complete/Landmarks/Landmarks/Resources/charleyrivers.jpg differ diff --git a/Examples/HandlingUserInput/Complete/Landmarks/Landmarks/Resources/chilkoottrail.jpg b/Examples/HandlingUserInput/Complete/Landmarks/Landmarks/Resources/chilkoottrail.jpg new file mode 100755 index 0000000..e7f805e Binary files /dev/null and b/Examples/HandlingUserInput/Complete/Landmarks/Landmarks/Resources/chilkoottrail.jpg differ diff --git a/Examples/HandlingUserInput/Complete/Landmarks/Landmarks/Resources/chincoteague.jpg b/Examples/HandlingUserInput/Complete/Landmarks/Landmarks/Resources/chincoteague.jpg new file mode 100755 index 0000000..5f47986 Binary files /dev/null and b/Examples/HandlingUserInput/Complete/Landmarks/Landmarks/Resources/chincoteague.jpg differ diff --git a/Examples/HandlingUserInput/Complete/Landmarks/Landmarks/Resources/hiddenlake.jpg b/Examples/HandlingUserInput/Complete/Landmarks/Landmarks/Resources/hiddenlake.jpg new file mode 100755 index 0000000..d8e804c Binary files /dev/null and b/Examples/HandlingUserInput/Complete/Landmarks/Landmarks/Resources/hiddenlake.jpg differ diff --git a/Examples/HandlingUserInput/Complete/Landmarks/Landmarks/Resources/icybay.jpg b/Examples/HandlingUserInput/Complete/Landmarks/Landmarks/Resources/icybay.jpg new file mode 100755 index 0000000..feb1764 Binary files /dev/null and b/Examples/HandlingUserInput/Complete/Landmarks/Landmarks/Resources/icybay.jpg differ diff --git a/Examples/HandlingUserInput/Complete/Landmarks/Landmarks/Resources/lakemcdonald.jpg b/Examples/HandlingUserInput/Complete/Landmarks/Landmarks/Resources/lakemcdonald.jpg new file mode 100755 index 0000000..bd9d6b9 Binary files /dev/null and b/Examples/HandlingUserInput/Complete/Landmarks/Landmarks/Resources/lakemcdonald.jpg differ diff --git a/Examples/HandlingUserInput/Complete/Landmarks/Landmarks/Resources/landmarkData.json b/Examples/HandlingUserInput/Complete/Landmarks/Landmarks/Resources/landmarkData.json new file mode 100755 index 0000000..e5b14fc --- /dev/null +++ b/Examples/HandlingUserInput/Complete/Landmarks/Landmarks/Resources/landmarkData.json @@ -0,0 +1,182 @@ +[ + { + "name": "Turtle Rock", + "category": "Rivers", + "city": "Twentynine Palms", + "state": "California", + "id": 1001, + "isFeatured": true, + "isFavorite": true, + "park": "Joshua Tree National Park", + "coordinates": { + "longitude": -116.166868, + "latitude": 34.011286 + }, + "imageName": "turtlerock" + }, + { + "name": "Silver Salmon Creek", + "category": "Lakes", + "city": "Port Alsworth", + "state": "Alaska", + "id": 1002, + "isFeatured": false, + "isFavorite": false, + "park": "Lake Clark National Park and Preserve", + "coordinates": { + "longitude": -152.665167, + "latitude": 59.980167 + }, + "imageName": "silversalmoncreek" + }, + { + "name": "Chilkoot Trail", + "category": "Mountains", + "city": "Skagway", + "state": "Alaska", + "id": 1003, + "isFeatured": false, + "isFavorite": true, + "park": "Klondike Gold Rush National Historical Park", + "coordinates": { + "longitude": -135.334571, + "latitude": 59.560551 + }, + "imageName": "chilkoottrail" + }, + { + "name": "St. Mary Lake", + "category": "Lakes", + "city": "Browning", + "state": "Montana", + "id": 1004, + "isFeatured": true, + "isFavorite": true, + "park": "Glacier National Park", + "coordinates": { + "longitude": -113.536248, + "latitude": 48.69423 + }, + "imageName": "stmarylake" + }, + { + "name": "Twin Lake", + "category": "Lakes", + "city": "Twin Lakes", + "state": "Alaska", + "id": 1005, + "isFeatured": false, + "isFavorite": false, + "park": "Lake Clark National Park and Preserve", + "coordinates": { + "longitude": -153.849883, + "latitude": 60.641684 + }, + "imageName": "twinlake" + }, + { + "name": "Lake McDonald", + "category": "Mountains", + "city": "West Glacier", + "state": "Montana", + "id": 1006, + "isFeatured": false, + "isFavorite": false, + "park": "Glacier National Park", + "coordinates": { + "longitude": -113.934831, + "latitude": 48.56002 + }, + "imageName": "lakemcdonald" + }, + { + "name": "Charley Rivers", + "category": "Rivers", + "city": "Eaking", + "state": "Alaska", + "id": 1007, + "isFeatured": true, + "isFavorite": false, + "park": "Charley Rivers National Preserve", + "coordinates": { + "longitude": -143.122586, + "latitude": 65.350021 + }, + "imageName": "charleyrivers", + }, + { + "name": "Icy Bay", + "category": "Mountains", + "city": "Icy Bay", + "state": "Alaska", + "id": 1008, + "isFeatured": false, + "isFavorite": false, + "park": "Wrangell-St. Elias National Park and Preserve", + "coordinates": { + "longitude": -141.518167, + "latitude": 60.089917 + }, + "imageName": "icybay" + }, + { + "name": "Rainbow Lake", + "category": "Lakes", + "city": "Willow", + "state": "Alaska", + "id": 1009, + "isFeatured": false, + "isFavorite": false, + "park": "State Recreation Area", + "coordinates": { + "longitude": -150.086103, + "latitude": 61.694334 + }, + "imageName": "rainbowlake" + }, + { + "name": "Hidden Lake", + "category": "Lakes", + "city": "Newhalem", + "state": "Washington", + "id": 1010, + "isFeatured": false, + "isFavorite": false, + "park": "North Cascades National Park", + "coordinates": { + "longitude": -121.17799, + "latitude": 48.495442 + }, + "imageName": "hiddenlake" + }, + { + "name": "Chincoteague", + "category": "Rivers", + "city": "Chincoteague", + "state": "Virginia", + "id": 1011, + "isFeatured": false, + "isFavorite": false, + "park": "Chincoteague National Wildlife Refuge", + "coordinates": { + "longitude": -75.383212, + "latitude": 37.91531 + }, + "imageName": "chincoteague" + }, + { + "name": "Lake Umbagog", + "category": "Lakes", + "city": "Errol", + "state": "New Hampshire", + "id": 1012, + "isFeatured": true, + "isFavorite": false, + "park": "Umbagog National Wildlife Refuge", + "coordinates": { + "longitude": -71.056816, + "latitude": 44.747408 + }, + "imageName": "umbagog" + } +] diff --git a/Examples/HandlingUserInput/Complete/Landmarks/Landmarks/Resources/rainbowlake.jpg b/Examples/HandlingUserInput/Complete/Landmarks/Landmarks/Resources/rainbowlake.jpg new file mode 100755 index 0000000..6da43dd Binary files /dev/null and b/Examples/HandlingUserInput/Complete/Landmarks/Landmarks/Resources/rainbowlake.jpg differ diff --git a/Examples/HandlingUserInput/Complete/Landmarks/Landmarks/Resources/silversalmoncreek.jpg b/Examples/HandlingUserInput/Complete/Landmarks/Landmarks/Resources/silversalmoncreek.jpg new file mode 100755 index 0000000..f657532 Binary files /dev/null and b/Examples/HandlingUserInput/Complete/Landmarks/Landmarks/Resources/silversalmoncreek.jpg differ diff --git a/Examples/HandlingUserInput/Complete/Landmarks/Landmarks/Resources/stmarylake.jpg b/Examples/HandlingUserInput/Complete/Landmarks/Landmarks/Resources/stmarylake.jpg new file mode 100755 index 0000000..1c71de4 Binary files /dev/null and b/Examples/HandlingUserInput/Complete/Landmarks/Landmarks/Resources/stmarylake.jpg differ diff --git a/Examples/HandlingUserInput/Complete/Landmarks/Landmarks/Resources/turtlerock.jpg b/Examples/HandlingUserInput/Complete/Landmarks/Landmarks/Resources/turtlerock.jpg new file mode 100755 index 0000000..f7a6e6d Binary files /dev/null and b/Examples/HandlingUserInput/Complete/Landmarks/Landmarks/Resources/turtlerock.jpg differ diff --git a/Examples/HandlingUserInput/Complete/Landmarks/Landmarks/Resources/twinlake.jpg b/Examples/HandlingUserInput/Complete/Landmarks/Landmarks/Resources/twinlake.jpg new file mode 100755 index 0000000..3e7a57c Binary files /dev/null and b/Examples/HandlingUserInput/Complete/Landmarks/Landmarks/Resources/twinlake.jpg differ diff --git a/Examples/HandlingUserInput/Complete/Landmarks/Landmarks/Resources/umbagog.jpg b/Examples/HandlingUserInput/Complete/Landmarks/Landmarks/Resources/umbagog.jpg new file mode 100755 index 0000000..56291c6 Binary files /dev/null and b/Examples/HandlingUserInput/Complete/Landmarks/Landmarks/Resources/umbagog.jpg differ diff --git a/Examples/HandlingUserInput/Complete/Landmarks/Landmarks/SceneDelegate.swift b/Examples/HandlingUserInput/Complete/Landmarks/Landmarks/SceneDelegate.swift new file mode 100755 index 0000000..96df0dc --- /dev/null +++ b/Examples/HandlingUserInput/Complete/Landmarks/Landmarks/SceneDelegate.swift @@ -0,0 +1,56 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +The scene delegate. +*/ + +import UIKit +import SwiftUI + +class SceneDelegate: UIResponder, UIWindowSceneDelegate { + + var window: UIWindow? + + func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) { + // Use this method to optionally configure and attach the UIWindow `window` to the provided UIWindowScene `scene`. + // If using a storyboard, the `window` property will automatically be initialized and attached to the scene. + // This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead). + + // Use a UIHostingController as window root view controller + let window = UIWindow(frame: UIScreen.main.bounds) + window.rootViewController = UIHostingController(rootView: LandmarkList().environmentObject(UserData())) + self.window = window + window.makeKeyAndVisible() + } + + func sceneDidDisconnect(_ scene: UIScene) { + // Called as the scene is being released by the system. + // This occurs shortly after the scene enters the background, or when its session is discarded. + // Release any resources associated with this scene that can be re-created the next time the scene connects. + // The scene may re-connect later, as its session was not neccessarily discarded (see `application:didDiscardSceneSessions` instead). + } + + func sceneDidBecomeActive(_ scene: UIScene) { + // Called when the scene has moved from an inactive state to an active state. + // Use this method to restart any tasks that were paused (or not yet started) when the scene was inactive. + } + + func sceneWillResignActive(_ scene: UIScene) { + // Called when the scene will move from an active state to an inactive state. + // This may occur due to temporary interruptions (ex. an incoming phone call). + } + + func sceneWillEnterForeground(_ scene: UIScene) { + // Called as the scene transitions from the background to the foreground. + // Use this method to undo the changes made on entering the background. + } + + func sceneDidEnterBackground(_ scene: UIScene) { + // Called as the scene transitions from the foreground to the background. + // Use this method to save data, release shared resources, and store enough scene-specific state information + // to restore the scene back to its current state. + } + +} + diff --git a/Examples/HandlingUserInput/Complete/Landmarks/Landmarks/Supporting Views/CircleImage.swift b/Examples/HandlingUserInput/Complete/Landmarks/Landmarks/Supporting Views/CircleImage.swift new file mode 100755 index 0000000..ae44439 --- /dev/null +++ b/Examples/HandlingUserInput/Complete/Landmarks/Landmarks/Supporting Views/CircleImage.swift @@ -0,0 +1,27 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +A view that clips an image to a circle and adds a stroke and shadow. +*/ + +import SwiftUI + +struct CircleImage: View { + var image: Image + + var body: some View { + image + .clipShape(Circle()) + .overlay(Circle().stroke(Color.white, lineWidth: 4)) + .shadow(radius: 10) + } +} + +#if DEBUG +struct CircleImage_Previews: PreviewProvider { + static var previews: some View { + CircleImage(image: Image("turtlerock")) + } +} +#endif diff --git a/Examples/HandlingUserInput/Complete/Landmarks/Landmarks/Supporting Views/LandmarkRow.swift b/Examples/HandlingUserInput/Complete/Landmarks/Landmarks/Supporting Views/LandmarkRow.swift new file mode 100755 index 0000000..2f8110c --- /dev/null +++ b/Examples/HandlingUserInput/Complete/Landmarks/Landmarks/Supporting Views/LandmarkRow.swift @@ -0,0 +1,38 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +A single row to be displayed in a list of landmarks. +*/ + +import SwiftUI + +struct LandmarkRow: View { + var landmark: Landmark + + var body: some View { + HStack { + landmark.image(forSize: 50) + Text(verbatim: landmark.name) + Spacer() + + if landmark.isFavorite { + Image(systemName: "star.fill") + .imageScale(.medium) + .foregroundColor(.yellow) + } + } + } +} + +#if DEBUG +struct LandmarkRow_Previews: PreviewProvider { + static var previews: some View { + Group { + LandmarkRow(landmark: landmarkData[0]) + LandmarkRow(landmark: landmarkData[1]) + } + .previewLayout(.fixed(width: 300, height: 70)) + } +} +#endif diff --git a/Examples/HandlingUserInput/Complete/Landmarks/Landmarks/Supporting Views/MapView.swift b/Examples/HandlingUserInput/Complete/Landmarks/Landmarks/Supporting Views/MapView.swift new file mode 100755 index 0000000..5a8c64b --- /dev/null +++ b/Examples/HandlingUserInput/Complete/Landmarks/Landmarks/Supporting Views/MapView.swift @@ -0,0 +1,31 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +A view that hosts an `MKMapView`. +*/ + +import SwiftUI +import MapKit + +struct MapView: UIViewRepresentable { + var coordinate: CLLocationCoordinate2D + + func makeUIView(context: Context) -> MKMapView { + MKMapView(frame: .zero) + } + + func updateUIView(_ view: MKMapView, context: Context) { + let span = MKCoordinateSpan(latitudeDelta: 0.02, longitudeDelta: 0.02) + let region = MKCoordinateRegion(center: coordinate, span: span) + view.setRegion(region, animated: true) + } +} + +#if DEBUG +struct MapView_Previews: PreviewProvider { + static var previews: some View { + MapView(coordinate: landmarkData[0].locationCoordinate) + } +} +#endif diff --git a/Examples/HandlingUserInput/Complete/README.md b/Examples/HandlingUserInput/Complete/README.md new file mode 100755 index 0000000..89559f8 --- /dev/null +++ b/Examples/HandlingUserInput/Complete/README.md @@ -0,0 +1,3 @@ +# Completed Project: Handling User Input + +Explore the completed project for the [Handling User Input](https://developer.apple.com/tutorials/swiftui/handling-user-input) tutorial. diff --git a/Examples/HandlingUserInput/StartingPoint/.gitignore b/Examples/HandlingUserInput/StartingPoint/.gitignore new file mode 100755 index 0000000..9e50718 --- /dev/null +++ b/Examples/HandlingUserInput/StartingPoint/.gitignore @@ -0,0 +1,21 @@ +# See LICENSE folder for this sample’s licensing information. +# +# Apple sample code gitignore configuration. + +# Finder +.DS_Store + +# Xcode - User files +xcuserdata/ + +**/*.xcodeproj/project.xcworkspace/* +!**/*.xcodeproj/project.xcworkspace/xcshareddata + +**/*.xcodeproj/project.xcworkspace/xcshareddata/* +!**/*.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings + +**/*.playground/playground.xcworkspace/* +!**/*.playground/playground.xcworkspace/xcshareddata + +**/*.playground/playground.xcworkspace/xcshareddata/* +!**/*.playground/playground.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings diff --git a/Examples/HandlingUserInput/StartingPoint/Configuration/SampleCode.xcconfig b/Examples/HandlingUserInput/StartingPoint/Configuration/SampleCode.xcconfig new file mode 100755 index 0000000..db86c06 --- /dev/null +++ b/Examples/HandlingUserInput/StartingPoint/Configuration/SampleCode.xcconfig @@ -0,0 +1,13 @@ +// +// See LICENSE folder for this sample’s licensing information. +// +// SampleCode.xcconfig +// + +// The `SAMPLE_CODE_DISAMBIGUATOR` configuration is to make it easier to build +// and run a sample code project. Once you set your project's development team, +// you'll have a unique bundle identifier. This is because the bundle identifier +// is derived based on the 'SAMPLE_CODE_DISAMBIGUATOR' value. Do not use this +// approach in your own projects—it's only useful for sample code projects because +// they are frequently downloaded and don't have a development team set. +SAMPLE_CODE_DISAMBIGUATOR=${DEVELOPMENT_TEAM} diff --git a/Examples/HandlingUserInput/StartingPoint/LICENSE/LICENSE.txt b/Examples/HandlingUserInput/StartingPoint/LICENSE/LICENSE.txt new file mode 100755 index 0000000..94e3d54 --- /dev/null +++ b/Examples/HandlingUserInput/StartingPoint/LICENSE/LICENSE.txt @@ -0,0 +1,8 @@ +Copyright © 2019 Apple Inc. + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + diff --git a/Examples/HandlingUserInput/StartingPoint/Landmarks/HandlingUserInput.xcodeproj/.xcodesamplecode.plist b/Examples/HandlingUserInput/StartingPoint/Landmarks/HandlingUserInput.xcodeproj/.xcodesamplecode.plist new file mode 100755 index 0000000..5dd5da8 --- /dev/null +++ b/Examples/HandlingUserInput/StartingPoint/Landmarks/HandlingUserInput.xcodeproj/.xcodesamplecode.plist @@ -0,0 +1,5 @@ + + + + + diff --git a/Examples/HandlingUserInput/StartingPoint/Landmarks/HandlingUserInput.xcodeproj/project.pbxproj b/Examples/HandlingUserInput/StartingPoint/Landmarks/HandlingUserInput.xcodeproj/project.pbxproj new file mode 100755 index 0000000..bb2fb8f --- /dev/null +++ b/Examples/HandlingUserInput/StartingPoint/Landmarks/HandlingUserInput.xcodeproj/project.pbxproj @@ -0,0 +1,477 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 50; + objects = { + +/* Begin PBXBuildFile section */ + B7394866229F194000C47603 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7394865229F194000C47603 /* AppDelegate.swift */; }; + B7394868229F194000C47603 /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7394867229F194000C47603 /* SceneDelegate.swift */; }; + B739486A229F194000C47603 /* LandmarkDetail.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7394869229F194000C47603 /* LandmarkDetail.swift */; }; + B739486C229F194200C47603 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = B739486B229F194200C47603 /* Assets.xcassets */; }; + B739486F229F194200C47603 /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = B739486E229F194200C47603 /* Preview Assets.xcassets */; }; + B7394872229F194200C47603 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = B7394870229F194200C47603 /* LaunchScreen.storyboard */; }; + B739487A229F1B3F00C47603 /* CircleImage.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7394879229F1B3F00C47603 /* CircleImage.swift */; }; + B739487C229F1B6800C47603 /* MapView.swift in Sources */ = {isa = PBXBuildFile; fileRef = B739487B229F1B6800C47603 /* MapView.swift */; }; + B7394881229F28B900C47603 /* Landmark.swift in Sources */ = {isa = PBXBuildFile; fileRef = B739487F229F28B900C47603 /* Landmark.swift */; }; + B7394882229F28B900C47603 /* Data.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7394880229F28B900C47603 /* Data.swift */; }; + B7394891229F292F00C47603 /* rainbowlake.jpg in Resources */ = {isa = PBXBuildFile; fileRef = B7394884229F292D00C47603 /* rainbowlake.jpg */; }; + B7394893229F292F00C47603 /* icybay.jpg in Resources */ = {isa = PBXBuildFile; fileRef = B7394886229F292E00C47603 /* icybay.jpg */; }; + B7394894229F292F00C47603 /* lakemcdonald.jpg in Resources */ = {isa = PBXBuildFile; fileRef = B7394887229F292E00C47603 /* lakemcdonald.jpg */; }; + B7394895229F292F00C47603 /* turtlerock.jpg in Resources */ = {isa = PBXBuildFile; fileRef = B7394888229F292E00C47603 /* turtlerock.jpg */; }; + B7394896229F292F00C47603 /* umbagog.jpg in Resources */ = {isa = PBXBuildFile; fileRef = B7394889229F292E00C47603 /* umbagog.jpg */; }; + B7394897229F292F00C47603 /* hiddenlake.jpg in Resources */ = {isa = PBXBuildFile; fileRef = B739488A229F292E00C47603 /* hiddenlake.jpg */; }; + B7394898229F292F00C47603 /* stmarylake.jpg in Resources */ = {isa = PBXBuildFile; fileRef = B739488B229F292E00C47603 /* stmarylake.jpg */; }; + B7394899229F292F00C47603 /* twinlake.jpg in Resources */ = {isa = PBXBuildFile; fileRef = B739488C229F292E00C47603 /* twinlake.jpg */; }; + B739489A229F292F00C47603 /* silversalmoncreek.jpg in Resources */ = {isa = PBXBuildFile; fileRef = B739488D229F292E00C47603 /* silversalmoncreek.jpg */; }; + B739489B229F292F00C47603 /* landmarkData.json in Resources */ = {isa = PBXBuildFile; fileRef = B739488E229F292E00C47603 /* landmarkData.json */; }; + B739489C229F292F00C47603 /* chincoteague.jpg in Resources */ = {isa = PBXBuildFile; fileRef = B739488F229F292F00C47603 /* chincoteague.jpg */; }; + B739489D229F292F00C47603 /* chilkoottrail.jpg in Resources */ = {isa = PBXBuildFile; fileRef = B7394890229F292F00C47603 /* chilkoottrail.jpg */; }; + B739489F229F2D9700C47603 /* LandmarkRow.swift in Sources */ = {isa = PBXBuildFile; fileRef = B739489E229F2D9700C47603 /* LandmarkRow.swift */; }; + B73948A1229F2E1F00C47603 /* LandmarkList.swift in Sources */ = {isa = PBXBuildFile; fileRef = B73948A0229F2E1F00C47603 /* LandmarkList.swift */; }; + B73948A3229F3E2200C47603 /* charleyrivers.jpg in Resources */ = {isa = PBXBuildFile; fileRef = B73948A2229F3E2200C47603 /* charleyrivers.jpg */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + 5C0310E05C01FC6000000001 /* SampleCode.xcconfig */ = {isa = PBXFileReference; name = SampleCode.xcconfig; path = ../Configuration/SampleCode.xcconfig; sourceTree = ""; }; + 5C52ED405C52E8B000000001 /* LICENSE.txt */ = {isa = PBXFileReference; includeInIndex = 1; path = LICENSE.txt; sourceTree = ""; }; + B7394862229F194000C47603 /* Landmarks.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Landmarks.app; sourceTree = BUILT_PRODUCTS_DIR; }; + B7394865229F194000C47603 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + B7394867229F194000C47603 /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = ""; }; + B7394869229F194000C47603 /* LandmarkDetail.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LandmarkDetail.swift; sourceTree = ""; }; + B739486B229F194200C47603 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + B739486E229F194200C47603 /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = ""; }; + B7394871229F194200C47603 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + B7394873229F194200C47603 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + B7394879229F1B3F00C47603 /* CircleImage.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CircleImage.swift; sourceTree = ""; }; + B739487B229F1B6800C47603 /* MapView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MapView.swift; sourceTree = ""; }; + B739487F229F28B900C47603 /* Landmark.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Landmark.swift; sourceTree = ""; }; + B7394880229F28B900C47603 /* Data.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Data.swift; sourceTree = ""; }; + B7394884229F292D00C47603 /* rainbowlake.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = rainbowlake.jpg; sourceTree = ""; }; + B7394886229F292E00C47603 /* icybay.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = icybay.jpg; sourceTree = ""; }; + B7394887229F292E00C47603 /* lakemcdonald.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = lakemcdonald.jpg; sourceTree = ""; }; + B7394888229F292E00C47603 /* turtlerock.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = turtlerock.jpg; sourceTree = ""; }; + B7394889229F292E00C47603 /* umbagog.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = umbagog.jpg; sourceTree = ""; }; + B739488A229F292E00C47603 /* hiddenlake.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = hiddenlake.jpg; sourceTree = ""; }; + B739488B229F292E00C47603 /* stmarylake.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = stmarylake.jpg; sourceTree = ""; }; + B739488C229F292E00C47603 /* twinlake.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = twinlake.jpg; sourceTree = ""; }; + B739488D229F292E00C47603 /* silversalmoncreek.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = silversalmoncreek.jpg; sourceTree = ""; }; + B739488E229F292E00C47603 /* landmarkData.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = landmarkData.json; sourceTree = ""; }; + B739488F229F292F00C47603 /* chincoteague.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = chincoteague.jpg; sourceTree = ""; }; + B7394890229F292F00C47603 /* chilkoottrail.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = chilkoottrail.jpg; sourceTree = ""; }; + B739489E229F2D9700C47603 /* LandmarkRow.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = LandmarkRow.swift; path = "Supporting Views/LandmarkRow.swift"; sourceTree = ""; }; + B73948A0229F2E1F00C47603 /* LandmarkList.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LandmarkList.swift; sourceTree = ""; }; + B73948A2229F3E2200C47603 /* charleyrivers.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = charleyrivers.jpg; sourceTree = ""; }; + C4E4AAA0C4E4035000000001 /* README.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; name = README.md; path = ../README.md; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + B739485F229F194000C47603 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 5C0225D05C02F54000000001 /* Configuration */ = { + isa = PBXGroup; + children = ( + 5C0310E05C01FC6000000001 /* SampleCode.xcconfig */, + ); + name = Configuration; + sourceTree = ""; + }; + 5C52DEF05C52DC5000000001 /* LICENSE */ = { + isa = PBXGroup; + children = ( + 5C52ED405C52E8B000000001 /* LICENSE.txt */, + ); + name = LICENSE; + path = ../LICENSE; + sourceTree = ""; + }; + B7394859229F194000C47603 = { + isa = PBXGroup; + children = ( + C4E4AAA0C4E4035000000001 /* README.md */, + B7394864229F194000C47603 /* Landmarks */, + B7394863229F194000C47603 /* Products */, + 5C0225D05C02F54000000001 /* Configuration */, + 5C52DEF05C52DC5000000001 /* LICENSE */, + ); + sourceTree = ""; + }; + B7394863229F194000C47603 /* Products */ = { + isa = PBXGroup; + children = ( + B7394862229F194000C47603 /* Landmarks.app */, + ); + name = Products; + sourceTree = ""; + }; + B7394864229F194000C47603 /* Landmarks */ = { + isa = PBXGroup; + children = ( + B739487E229F282200C47603 /* Models */, + B7394865229F194000C47603 /* AppDelegate.swift */, + B7394867229F194000C47603 /* SceneDelegate.swift */, + B73948A0229F2E1F00C47603 /* LandmarkList.swift */, + B739489E229F2D9700C47603 /* LandmarkRow.swift */, + B7394869229F194000C47603 /* LandmarkDetail.swift */, + B739487D229F1C0100C47603 /* Supporting Views */, + B7394883229F291A00C47603 /* Resources */, + B739486B229F194200C47603 /* Assets.xcassets */, + B7394870229F194200C47603 /* LaunchScreen.storyboard */, + B7394873229F194200C47603 /* Info.plist */, + B739486D229F194200C47603 /* Preview Content */, + ); + path = Landmarks; + sourceTree = ""; + }; + B739486D229F194200C47603 /* Preview Content */ = { + isa = PBXGroup; + children = ( + B739486E229F194200C47603 /* Preview Assets.xcassets */, + ); + path = "Preview Content"; + sourceTree = ""; + }; + B739487D229F1C0100C47603 /* Supporting Views */ = { + isa = PBXGroup; + children = ( + B7394879229F1B3F00C47603 /* CircleImage.swift */, + B739487B229F1B6800C47603 /* MapView.swift */, + ); + path = "Supporting Views"; + sourceTree = ""; + }; + B739487E229F282200C47603 /* Models */ = { + isa = PBXGroup; + children = ( + B7394880229F28B900C47603 /* Data.swift */, + B739487F229F28B900C47603 /* Landmark.swift */, + ); + path = Models; + sourceTree = ""; + }; + B7394883229F291A00C47603 /* Resources */ = { + isa = PBXGroup; + children = ( + B739488E229F292E00C47603 /* landmarkData.json */, + B7394890229F292F00C47603 /* chilkoottrail.jpg */, + B739488F229F292F00C47603 /* chincoteague.jpg */, + B739488A229F292E00C47603 /* hiddenlake.jpg */, + B7394886229F292E00C47603 /* icybay.jpg */, + B7394887229F292E00C47603 /* lakemcdonald.jpg */, + B7394884229F292D00C47603 /* rainbowlake.jpg */, + B739488D229F292E00C47603 /* silversalmoncreek.jpg */, + B739488B229F292E00C47603 /* stmarylake.jpg */, + B7394888229F292E00C47603 /* turtlerock.jpg */, + B739488C229F292E00C47603 /* twinlake.jpg */, + B7394889229F292E00C47603 /* umbagog.jpg */, + B73948A2229F3E2200C47603 /* charleyrivers.jpg */, + ); + path = Resources; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + B7394861229F194000C47603 /* Landmarks */ = { + isa = PBXNativeTarget; + buildConfigurationList = B7394876229F194200C47603 /* Build configuration list for PBXNativeTarget "Landmarks" */; + buildPhases = ( + B739485E229F194000C47603 /* Sources */, + B739485F229F194000C47603 /* Frameworks */, + B7394860229F194000C47603 /* Resources */, + C602AC70C605937000000001, + ); + buildRules = ( + ); + dependencies = ( + ); + name = Landmarks; + productName = Landmarks; + productReference = B7394862229F194000C47603 /* Landmarks.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + B739485A229F194000C47603 /* Project object */ = { + isa = PBXProject; + attributes = { + LastSwiftUpdateCheck = 1100; + LastUpgradeCheck = 1100; + ORGANIZATIONNAME = Apple; + TargetAttributes = { + B7394861229F194000C47603 = { + CreatedOnToolsVersion = 11.0; + }; + }; + }; + buildConfigurationList = B739485D229F194000C47603 /* Build configuration list for PBXProject "HandlingUserInput" */; + compatibilityVersion = "Xcode 9.3"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = B7394859229F194000C47603; + productRefGroup = B7394863229F194000C47603 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + B7394861229F194000C47603 /* Landmarks */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + B7394860229F194000C47603 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + B739489A229F292F00C47603 /* silversalmoncreek.jpg in Resources */, + B7394894229F292F00C47603 /* lakemcdonald.jpg in Resources */, + B7394872229F194200C47603 /* LaunchScreen.storyboard in Resources */, + B73948A3229F3E2200C47603 /* charleyrivers.jpg in Resources */, + B7394891229F292F00C47603 /* rainbowlake.jpg in Resources */, + B739486F229F194200C47603 /* Preview Assets.xcassets in Resources */, + B7394895229F292F00C47603 /* turtlerock.jpg in Resources */, + B739486C229F194200C47603 /* Assets.xcassets in Resources */, + B7394899229F292F00C47603 /* twinlake.jpg in Resources */, + B7394896229F292F00C47603 /* umbagog.jpg in Resources */, + B739489D229F292F00C47603 /* chilkoottrail.jpg in Resources */, + B739489C229F292F00C47603 /* chincoteague.jpg in Resources */, + B739489B229F292F00C47603 /* landmarkData.json in Resources */, + B7394893229F292F00C47603 /* icybay.jpg in Resources */, + B7394897229F292F00C47603 /* hiddenlake.jpg in Resources */, + B7394898229F292F00C47603 /* stmarylake.jpg in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + B739485E229F194000C47603 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + B7394882229F28B900C47603 /* Data.swift in Sources */, + B7394866229F194000C47603 /* AppDelegate.swift in Sources */, + B739487A229F1B3F00C47603 /* CircleImage.swift in Sources */, + B739487C229F1B6800C47603 /* MapView.swift in Sources */, + B73948A1229F2E1F00C47603 /* LandmarkList.swift in Sources */, + B7394868229F194000C47603 /* SceneDelegate.swift in Sources */, + B739486A229F194000C47603 /* LandmarkDetail.swift in Sources */, + B739489F229F2D9700C47603 /* LandmarkRow.swift in Sources */, + B7394881229F28B900C47603 /* Landmark.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXVariantGroup section */ + B7394870229F194200C47603 /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + B7394871229F194200C47603 /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + B7394874229F194200C47603 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 5C0310E05C01FC6000000001 /* SampleCode.xcconfig */; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 13.0; + MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; + MTL_FAST_MATH = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + }; + name = Debug; + }; + B7394875229F194200C47603 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 5C0310E05C01FC6000000001 /* SampleCode.xcconfig */; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 13.0; + MTL_ENABLE_DEBUG_INFO = NO; + MTL_FAST_MATH = YES; + SDKROOT = iphoneos; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + B7394877229F194200C47603 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 5C0310E05C01FC6000000001 /* SampleCode.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_ASSET_PATHS = "Landmarks/Preview\\ Content"; + DEVELOPMENT_TEAM = ""; + ENABLE_PREVIEWS = YES; + INFOPLIST_FILE = Landmarks/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = "com.example.apple-samplecode.Landmarks${SAMPLE_CODE_DISAMBIGUATOR}"; + PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE_SPECIFIER = ""; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + B7394878229F194200C47603 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 5C0310E05C01FC6000000001 /* SampleCode.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_ASSET_PATHS = "Landmarks/Preview\\ Content"; + DEVELOPMENT_TEAM = ""; + ENABLE_PREVIEWS = YES; + INFOPLIST_FILE = Landmarks/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = "com.example.apple-samplecode.Landmarks${SAMPLE_CODE_DISAMBIGUATOR}"; + PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE_SPECIFIER = ""; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + B739485D229F194000C47603 /* Build configuration list for PBXProject "HandlingUserInput" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + B7394874229F194200C47603 /* Debug */, + B7394875229F194200C47603 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + B7394876229F194200C47603 /* Build configuration list for PBXNativeTarget "Landmarks" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + B7394877229F194200C47603 /* Debug */, + B7394878229F194200C47603 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = B739485A229F194000C47603 /* Project object */; +} diff --git a/Examples/HandlingUserInput/StartingPoint/Landmarks/HandlingUserInput.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/Examples/HandlingUserInput/StartingPoint/Landmarks/HandlingUserInput.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings new file mode 100755 index 0000000..3ddf867 --- /dev/null +++ b/Examples/HandlingUserInput/StartingPoint/Landmarks/HandlingUserInput.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings @@ -0,0 +1,8 @@ + + + + + BuildSystemType + Latest + + diff --git a/Examples/HandlingUserInput/StartingPoint/Landmarks/Landmarks/AppDelegate.swift b/Examples/HandlingUserInput/StartingPoint/Landmarks/Landmarks/AppDelegate.swift new file mode 100755 index 0000000..e22943b --- /dev/null +++ b/Examples/HandlingUserInput/StartingPoint/Landmarks/Landmarks/AppDelegate.swift @@ -0,0 +1,36 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +The application delegate. +*/ + +import UIKit + +@UIApplicationMain +class AppDelegate: UIResponder, UIApplicationDelegate { + + func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { + // Override point for customization after application launch. + return true + } + + func applicationWillTerminate(_ application: UIApplication) { + // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. + } + + // MARK: UISceneSession Lifecycle + func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration { + // Called when a new scene session is being created. + // Use this method to select a configuration to create the new scene with. + return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role) + } + + func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set) { + // Called when the user discards a scene session. + // If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions. + // Use this method to release any resources that were specific to the discarded scenes, as they will not return. + } + +} + diff --git a/Examples/HandlingUserInput/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/Contents.json b/Examples/HandlingUserInput/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100755 index 0000000..fa0d2db --- /dev/null +++ b/Examples/HandlingUserInput/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,113 @@ +{ + "images" : [ + { + "size" : "20x20", + "idiom" : "iphone", + "filename" : "landmark_app_icon_40x40.png", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "20x20", + "scale" : "3x" + }, + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "landmark_app_icon_58x58.png", + "scale" : "2x" + }, + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "landmark_app_icon_87x87.png", + "scale" : "3x" + }, + { + "size" : "40x40", + "idiom" : "iphone", + "filename" : "landmark_app_icon_80x80.png", + "scale" : "2x" + }, + { + "size" : "40x40", + "idiom" : "iphone", + "filename" : "landmark_app_icon_120x120.png", + "scale" : "3x" + }, + { + "size" : "60x60", + "idiom" : "iphone", + "filename" : "landmark_app_icon_120x120-1.png", + "scale" : "2x" + }, + { + "size" : "60x60", + "idiom" : "iphone", + "filename" : "landmark_app_icon_180x180.png", + "scale" : "3x" + }, + { + "idiom" : "ipad", + "size" : "20x20", + "scale" : "1x" + }, + { + "size" : "20x20", + "idiom" : "ipad", + "filename" : "landmark_app_icon_40x40-1.png", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "29x29", + "scale" : "1x" + }, + { + "size" : "29x29", + "idiom" : "ipad", + "filename" : "landmark_app_icon_58x58-1.png", + "scale" : "2x" + }, + { + "size" : "40x40", + "idiom" : "ipad", + "filename" : "landmark_app_icon_40x40-2.png", + "scale" : "1x" + }, + { + "size" : "40x40", + "idiom" : "ipad", + "filename" : "landmark_app_icon_80x80-1.png", + "scale" : "2x" + }, + { + "size" : "76x76", + "idiom" : "ipad", + "filename" : "landmark_app_icon_76x76.png", + "scale" : "1x" + }, + { + "size" : "76x76", + "idiom" : "ipad", + "filename" : "landmark_app_icon_152x152.png", + "scale" : "2x" + }, + { + "size" : "83.5x83.5", + "idiom" : "ipad", + "filename" : "landmark_app_icon_167x167.png", + "scale" : "2x" + }, + { + "size" : "1024x1024", + "idiom" : "ios-marketing", + "filename" : "landmark_app_icon_1024x1024.png", + "scale" : "1x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Examples/HandlingUserInput/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_1024x1024.png b/Examples/HandlingUserInput/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_1024x1024.png new file mode 100755 index 0000000..00d81c1 Binary files /dev/null and b/Examples/HandlingUserInput/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_1024x1024.png differ diff --git a/Examples/HandlingUserInput/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_120x120-1.png b/Examples/HandlingUserInput/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_120x120-1.png new file mode 100755 index 0000000..d382b8b Binary files /dev/null and b/Examples/HandlingUserInput/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_120x120-1.png differ diff --git a/Examples/HandlingUserInput/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_120x120.png b/Examples/HandlingUserInput/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_120x120.png new file mode 100755 index 0000000..d382b8b Binary files /dev/null and b/Examples/HandlingUserInput/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_120x120.png differ diff --git a/Examples/HandlingUserInput/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_152x152.png b/Examples/HandlingUserInput/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_152x152.png new file mode 100755 index 0000000..11057f8 Binary files /dev/null and b/Examples/HandlingUserInput/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_152x152.png differ diff --git a/Examples/HandlingUserInput/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_167x167.png b/Examples/HandlingUserInput/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_167x167.png new file mode 100755 index 0000000..f73bc26 Binary files /dev/null and b/Examples/HandlingUserInput/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_167x167.png differ diff --git a/Examples/HandlingUserInput/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_180x180.png b/Examples/HandlingUserInput/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_180x180.png new file mode 100755 index 0000000..b02738c Binary files /dev/null and b/Examples/HandlingUserInput/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_180x180.png differ diff --git a/Examples/HandlingUserInput/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_40x40-1.png b/Examples/HandlingUserInput/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_40x40-1.png new file mode 100755 index 0000000..abaff0e Binary files /dev/null and b/Examples/HandlingUserInput/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_40x40-1.png differ diff --git a/Examples/HandlingUserInput/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_40x40-2.png b/Examples/HandlingUserInput/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_40x40-2.png new file mode 100755 index 0000000..abaff0e Binary files /dev/null and b/Examples/HandlingUserInput/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_40x40-2.png differ diff --git a/Examples/HandlingUserInput/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_40x40.png b/Examples/HandlingUserInput/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_40x40.png new file mode 100755 index 0000000..abaff0e Binary files /dev/null and b/Examples/HandlingUserInput/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_40x40.png differ diff --git a/Examples/HandlingUserInput/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_58x58-1.png b/Examples/HandlingUserInput/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_58x58-1.png new file mode 100755 index 0000000..cf7c73d Binary files /dev/null and b/Examples/HandlingUserInput/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_58x58-1.png differ diff --git a/Examples/HandlingUserInput/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_58x58.png b/Examples/HandlingUserInput/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_58x58.png new file mode 100755 index 0000000..cf7c73d Binary files /dev/null and b/Examples/HandlingUserInput/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_58x58.png differ diff --git a/Examples/HandlingUserInput/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_76x76.png b/Examples/HandlingUserInput/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_76x76.png new file mode 100755 index 0000000..3eff85b Binary files /dev/null and b/Examples/HandlingUserInput/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_76x76.png differ diff --git a/Examples/HandlingUserInput/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_80x80-1.png b/Examples/HandlingUserInput/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_80x80-1.png new file mode 100755 index 0000000..6f33f66 Binary files /dev/null and b/Examples/HandlingUserInput/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_80x80-1.png differ diff --git a/Examples/HandlingUserInput/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_80x80.png b/Examples/HandlingUserInput/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_80x80.png new file mode 100755 index 0000000..6f33f66 Binary files /dev/null and b/Examples/HandlingUserInput/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_80x80.png differ diff --git a/Examples/HandlingUserInput/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_87x87.png b/Examples/HandlingUserInput/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_87x87.png new file mode 100755 index 0000000..9e1616c Binary files /dev/null and b/Examples/HandlingUserInput/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_87x87.png differ diff --git a/Examples/HandlingUserInput/StartingPoint/Landmarks/Landmarks/Assets.xcassets/Contents.json b/Examples/HandlingUserInput/StartingPoint/Landmarks/Landmarks/Assets.xcassets/Contents.json new file mode 100755 index 0000000..da4a164 --- /dev/null +++ b/Examples/HandlingUserInput/StartingPoint/Landmarks/Landmarks/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Examples/HandlingUserInput/StartingPoint/Landmarks/Landmarks/Assets.xcassets/turtlerock.imageset/Contents.json b/Examples/HandlingUserInput/StartingPoint/Landmarks/Landmarks/Assets.xcassets/turtlerock.imageset/Contents.json new file mode 100755 index 0000000..5bfd7bf --- /dev/null +++ b/Examples/HandlingUserInput/StartingPoint/Landmarks/Landmarks/Assets.xcassets/turtlerock.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "turtlerock.jpg", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Examples/HandlingUserInput/StartingPoint/Landmarks/Landmarks/Assets.xcassets/turtlerock.imageset/turtlerock.jpg b/Examples/HandlingUserInput/StartingPoint/Landmarks/Landmarks/Assets.xcassets/turtlerock.imageset/turtlerock.jpg new file mode 100755 index 0000000..68bcd3e Binary files /dev/null and b/Examples/HandlingUserInput/StartingPoint/Landmarks/Landmarks/Assets.xcassets/turtlerock.imageset/turtlerock.jpg differ diff --git a/Examples/HandlingUserInput/StartingPoint/Landmarks/Landmarks/Base.lproj/LaunchScreen.storyboard b/Examples/HandlingUserInput/StartingPoint/Landmarks/Landmarks/Base.lproj/LaunchScreen.storyboard new file mode 100755 index 0000000..865e932 --- /dev/null +++ b/Examples/HandlingUserInput/StartingPoint/Landmarks/Landmarks/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Examples/HandlingUserInput/StartingPoint/Landmarks/Landmarks/Info.plist b/Examples/HandlingUserInput/StartingPoint/Landmarks/Landmarks/Info.plist new file mode 100755 index 0000000..e8bb4c6 --- /dev/null +++ b/Examples/HandlingUserInput/StartingPoint/Landmarks/Landmarks/Info.plist @@ -0,0 +1,62 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + $(PRODUCT_BUNDLE_PACKAGE_TYPE) + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1 + LSRequiresIPhoneOS + + UIApplicationSceneManifest + + UIApplicationSupportsMultipleScenes + + UISceneConfigurations + + UIWindowSceneSessionRoleApplication + + + UILaunchStoryboardName + LaunchScreen + UISceneConfigurationName + Default Configuration + UISceneDelegateClassName + $(PRODUCT_MODULE_NAME).SceneDelegate + + + + + UILaunchStoryboardName + LaunchScreen + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/Examples/HandlingUserInput/StartingPoint/Landmarks/Landmarks/LandmarkDetail.swift b/Examples/HandlingUserInput/StartingPoint/Landmarks/Landmarks/LandmarkDetail.swift new file mode 100755 index 0000000..e957172 --- /dev/null +++ b/Examples/HandlingUserInput/StartingPoint/Landmarks/Landmarks/LandmarkDetail.swift @@ -0,0 +1,48 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +A view showing the details for a landmark. +*/ + +import SwiftUI + +struct LandmarkDetail: View { + var landmark: Landmark + + var body: some View { + VStack { + MapView(coordinate: landmark.locationCoordinate) + .frame(height: 300) + + CircleImage(image: landmark.image(forSize: 250)) + .offset(x: 0, y: -130) + .padding(.bottom, -130) + + VStack(alignment: .leading) { + Text(landmark.name) + .font(.title) + + HStack(alignment: .top) { + Text(landmark.park) + .font(.subheadline) + Spacer() + Text(landmark.state) + .font(.subheadline) + } + } + .padding() + + Spacer() + } + .navigationBarTitle(Text(verbatim: landmark.name), displayMode: .inline) + } +} + +#if DEBUG +struct LandmarkDetail_Previews: PreviewProvider { + static var previews: some View { + LandmarkDetail(landmark: landmarkData[0]) + } +} +#endif diff --git a/Examples/HandlingUserInput/StartingPoint/Landmarks/Landmarks/LandmarkList.swift b/Examples/HandlingUserInput/StartingPoint/Landmarks/Landmarks/LandmarkList.swift new file mode 100755 index 0000000..1c5b7ee --- /dev/null +++ b/Examples/HandlingUserInput/StartingPoint/Landmarks/Landmarks/LandmarkList.swift @@ -0,0 +1,33 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +A view showing a list of landmarks. +*/ + +import SwiftUI + +struct LandmarkList: View { + var body: some View { + NavigationView { + List(landmarkData) { landmark in + NavigationButton(destination: LandmarkDetail(landmark: landmark)) { + LandmarkRow(landmark: landmark) + } + } + .navigationBarTitle(Text("Landmarks"), displayMode: .large) + } + } +} + +#if DEBUG +struct LandmarkList_Previews: PreviewProvider { + static var previews: some View { + ForEach(["iPhone SE", "iPhone XS Max"].identified(by: \.self)) { deviceName in + LandmarkList() + .previewDevice(PreviewDevice(rawValue: deviceName)) + .previewDisplayName(deviceName) + } + } +} +#endif diff --git a/Examples/HandlingUserInput/StartingPoint/Landmarks/Landmarks/Models/Data.swift b/Examples/HandlingUserInput/StartingPoint/Landmarks/Landmarks/Models/Data.swift new file mode 100755 index 0000000..78837f6 --- /dev/null +++ b/Examples/HandlingUserInput/StartingPoint/Landmarks/Landmarks/Models/Data.swift @@ -0,0 +1,93 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +Helpers for loading images and data. +*/ + +import UIKit +import SwiftUI +import CoreLocation + +let landmarkData: [Landmark] = load("landmarkData.json") + +func load(_ filename: String, as type: T.Type = T.self) -> T { + let data: Data + + guard let file = Bundle.main.url(forResource: filename, withExtension: nil) + else { + fatalError("Couldn't find \(filename) in main bundle.") + } + + do { + data = try Data(contentsOf: file) + } catch { + fatalError("Couldn't load \(filename) from main bundle:\n\(error)") + } + + do { + let decoder = JSONDecoder() + return try decoder.decode(T.self, from: data) + } catch { + fatalError("Couldn't parse \(filename) as \(T.self):\n\(error)") + } +} + +final class ImageStore { + fileprivate typealias _ImageDictionary = [String: [Int: CGImage]] + fileprivate var images: _ImageDictionary = [:] + + fileprivate static var originalSize = 250 + fileprivate static var scale = 2 + + static var shared = ImageStore() + + func image(name: String, size: Int) -> Image { + let index = _guaranteeInitialImage(name: name) + + let sizedImage = images.values[index][size] + ?? _sizeImage(images.values[index][ImageStore.originalSize]!, to: size * ImageStore.scale) + images.values[index][size] = sizedImage + + return Image(sizedImage, scale: Length(ImageStore.scale), label: Text(verbatim: name)) + } + + fileprivate func _guaranteeInitialImage(name: String) -> _ImageDictionary.Index { + if let index = images.index(forKey: name) { return index } + + guard + let url = Bundle.main.url(forResource: name, withExtension: "jpg"), + let imageSource = CGImageSourceCreateWithURL(url as NSURL, nil), + let image = CGImageSourceCreateImageAtIndex(imageSource, 0, nil) + else { + fatalError("Couldn't load image \(name).jpg from main bundle.") + } + + images[name] = [ImageStore.originalSize: image] + return images.index(forKey: name)! + } + + fileprivate func _sizeImage(_ image: CGImage, to size: Int) -> CGImage { + guard + let colorSpace = image.colorSpace, + let context = CGContext( + data: nil, + width: size, height: size, + bitsPerComponent: image.bitsPerComponent, + bytesPerRow: image.bytesPerRow, + space: colorSpace, + bitmapInfo: image.bitmapInfo.rawValue) + else { + fatalError("Couldn't create graphics context.") + } + context.interpolationQuality = .high + context.draw(image, in: CGRect(x: 0, y: 0, width: size, height: size)) + + if let sizedImage = context.makeImage() { + return sizedImage + } else { + fatalError("Couldn't resize image.") + } + } +} + diff --git a/Examples/HandlingUserInput/StartingPoint/Landmarks/Landmarks/Models/Landmark.swift b/Examples/HandlingUserInput/StartingPoint/Landmarks/Landmarks/Models/Landmark.swift new file mode 100755 index 0000000..79b9aa4 --- /dev/null +++ b/Examples/HandlingUserInput/StartingPoint/Landmarks/Landmarks/Models/Landmark.swift @@ -0,0 +1,42 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +The model for an individual landmark. +*/ + +import SwiftUI +import CoreLocation + +struct Landmark: Hashable, Codable, Identifiable { + var id: Int + var name: String + fileprivate var imageName: String + fileprivate var coordinates: Coordinates + var state: String + var park: String + var category: Category + var isFavorite: Bool + + var locationCoordinate: CLLocationCoordinate2D { + CLLocationCoordinate2D( + latitude: coordinates.latitude, + longitude: coordinates.longitude) + } + + func image(forSize size: Int) -> Image { + ImageStore.shared.image(name: imageName, size: size) + } + + enum Category: String, CaseIterable, Codable, Hashable { + case featured = "Featured" + case lakes = "Lakes" + case rivers = "Rivers" + case mountains = "Mountains" + } +} + +struct Coordinates: Hashable, Codable { + var latitude: Double + var longitude: Double +} diff --git a/Examples/HandlingUserInput/StartingPoint/Landmarks/Landmarks/Preview Content/Preview Assets.xcassets/Contents.json b/Examples/HandlingUserInput/StartingPoint/Landmarks/Landmarks/Preview Content/Preview Assets.xcassets/Contents.json new file mode 100755 index 0000000..da4a164 --- /dev/null +++ b/Examples/HandlingUserInput/StartingPoint/Landmarks/Landmarks/Preview Content/Preview Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Examples/HandlingUserInput/StartingPoint/Landmarks/Landmarks/Resources/charleyrivers.jpg b/Examples/HandlingUserInput/StartingPoint/Landmarks/Landmarks/Resources/charleyrivers.jpg new file mode 100755 index 0000000..17ff44b Binary files /dev/null and b/Examples/HandlingUserInput/StartingPoint/Landmarks/Landmarks/Resources/charleyrivers.jpg differ diff --git a/Examples/HandlingUserInput/StartingPoint/Landmarks/Landmarks/Resources/chilkoottrail.jpg b/Examples/HandlingUserInput/StartingPoint/Landmarks/Landmarks/Resources/chilkoottrail.jpg new file mode 100755 index 0000000..e7f805e Binary files /dev/null and b/Examples/HandlingUserInput/StartingPoint/Landmarks/Landmarks/Resources/chilkoottrail.jpg differ diff --git a/Examples/HandlingUserInput/StartingPoint/Landmarks/Landmarks/Resources/chincoteague.jpg b/Examples/HandlingUserInput/StartingPoint/Landmarks/Landmarks/Resources/chincoteague.jpg new file mode 100755 index 0000000..5f47986 Binary files /dev/null and b/Examples/HandlingUserInput/StartingPoint/Landmarks/Landmarks/Resources/chincoteague.jpg differ diff --git a/Examples/HandlingUserInput/StartingPoint/Landmarks/Landmarks/Resources/hiddenlake.jpg b/Examples/HandlingUserInput/StartingPoint/Landmarks/Landmarks/Resources/hiddenlake.jpg new file mode 100755 index 0000000..d8e804c Binary files /dev/null and b/Examples/HandlingUserInput/StartingPoint/Landmarks/Landmarks/Resources/hiddenlake.jpg differ diff --git a/Examples/HandlingUserInput/StartingPoint/Landmarks/Landmarks/Resources/icybay.jpg b/Examples/HandlingUserInput/StartingPoint/Landmarks/Landmarks/Resources/icybay.jpg new file mode 100755 index 0000000..feb1764 Binary files /dev/null and b/Examples/HandlingUserInput/StartingPoint/Landmarks/Landmarks/Resources/icybay.jpg differ diff --git a/Examples/HandlingUserInput/StartingPoint/Landmarks/Landmarks/Resources/lakemcdonald.jpg b/Examples/HandlingUserInput/StartingPoint/Landmarks/Landmarks/Resources/lakemcdonald.jpg new file mode 100755 index 0000000..bd9d6b9 Binary files /dev/null and b/Examples/HandlingUserInput/StartingPoint/Landmarks/Landmarks/Resources/lakemcdonald.jpg differ diff --git a/Examples/HandlingUserInput/StartingPoint/Landmarks/Landmarks/Resources/landmarkData.json b/Examples/HandlingUserInput/StartingPoint/Landmarks/Landmarks/Resources/landmarkData.json new file mode 100755 index 0000000..e5b14fc --- /dev/null +++ b/Examples/HandlingUserInput/StartingPoint/Landmarks/Landmarks/Resources/landmarkData.json @@ -0,0 +1,182 @@ +[ + { + "name": "Turtle Rock", + "category": "Rivers", + "city": "Twentynine Palms", + "state": "California", + "id": 1001, + "isFeatured": true, + "isFavorite": true, + "park": "Joshua Tree National Park", + "coordinates": { + "longitude": -116.166868, + "latitude": 34.011286 + }, + "imageName": "turtlerock" + }, + { + "name": "Silver Salmon Creek", + "category": "Lakes", + "city": "Port Alsworth", + "state": "Alaska", + "id": 1002, + "isFeatured": false, + "isFavorite": false, + "park": "Lake Clark National Park and Preserve", + "coordinates": { + "longitude": -152.665167, + "latitude": 59.980167 + }, + "imageName": "silversalmoncreek" + }, + { + "name": "Chilkoot Trail", + "category": "Mountains", + "city": "Skagway", + "state": "Alaska", + "id": 1003, + "isFeatured": false, + "isFavorite": true, + "park": "Klondike Gold Rush National Historical Park", + "coordinates": { + "longitude": -135.334571, + "latitude": 59.560551 + }, + "imageName": "chilkoottrail" + }, + { + "name": "St. Mary Lake", + "category": "Lakes", + "city": "Browning", + "state": "Montana", + "id": 1004, + "isFeatured": true, + "isFavorite": true, + "park": "Glacier National Park", + "coordinates": { + "longitude": -113.536248, + "latitude": 48.69423 + }, + "imageName": "stmarylake" + }, + { + "name": "Twin Lake", + "category": "Lakes", + "city": "Twin Lakes", + "state": "Alaska", + "id": 1005, + "isFeatured": false, + "isFavorite": false, + "park": "Lake Clark National Park and Preserve", + "coordinates": { + "longitude": -153.849883, + "latitude": 60.641684 + }, + "imageName": "twinlake" + }, + { + "name": "Lake McDonald", + "category": "Mountains", + "city": "West Glacier", + "state": "Montana", + "id": 1006, + "isFeatured": false, + "isFavorite": false, + "park": "Glacier National Park", + "coordinates": { + "longitude": -113.934831, + "latitude": 48.56002 + }, + "imageName": "lakemcdonald" + }, + { + "name": "Charley Rivers", + "category": "Rivers", + "city": "Eaking", + "state": "Alaska", + "id": 1007, + "isFeatured": true, + "isFavorite": false, + "park": "Charley Rivers National Preserve", + "coordinates": { + "longitude": -143.122586, + "latitude": 65.350021 + }, + "imageName": "charleyrivers", + }, + { + "name": "Icy Bay", + "category": "Mountains", + "city": "Icy Bay", + "state": "Alaska", + "id": 1008, + "isFeatured": false, + "isFavorite": false, + "park": "Wrangell-St. Elias National Park and Preserve", + "coordinates": { + "longitude": -141.518167, + "latitude": 60.089917 + }, + "imageName": "icybay" + }, + { + "name": "Rainbow Lake", + "category": "Lakes", + "city": "Willow", + "state": "Alaska", + "id": 1009, + "isFeatured": false, + "isFavorite": false, + "park": "State Recreation Area", + "coordinates": { + "longitude": -150.086103, + "latitude": 61.694334 + }, + "imageName": "rainbowlake" + }, + { + "name": "Hidden Lake", + "category": "Lakes", + "city": "Newhalem", + "state": "Washington", + "id": 1010, + "isFeatured": false, + "isFavorite": false, + "park": "North Cascades National Park", + "coordinates": { + "longitude": -121.17799, + "latitude": 48.495442 + }, + "imageName": "hiddenlake" + }, + { + "name": "Chincoteague", + "category": "Rivers", + "city": "Chincoteague", + "state": "Virginia", + "id": 1011, + "isFeatured": false, + "isFavorite": false, + "park": "Chincoteague National Wildlife Refuge", + "coordinates": { + "longitude": -75.383212, + "latitude": 37.91531 + }, + "imageName": "chincoteague" + }, + { + "name": "Lake Umbagog", + "category": "Lakes", + "city": "Errol", + "state": "New Hampshire", + "id": 1012, + "isFeatured": true, + "isFavorite": false, + "park": "Umbagog National Wildlife Refuge", + "coordinates": { + "longitude": -71.056816, + "latitude": 44.747408 + }, + "imageName": "umbagog" + } +] diff --git a/Examples/HandlingUserInput/StartingPoint/Landmarks/Landmarks/Resources/rainbowlake.jpg b/Examples/HandlingUserInput/StartingPoint/Landmarks/Landmarks/Resources/rainbowlake.jpg new file mode 100755 index 0000000..6da43dd Binary files /dev/null and b/Examples/HandlingUserInput/StartingPoint/Landmarks/Landmarks/Resources/rainbowlake.jpg differ diff --git a/Examples/HandlingUserInput/StartingPoint/Landmarks/Landmarks/Resources/silversalmoncreek.jpg b/Examples/HandlingUserInput/StartingPoint/Landmarks/Landmarks/Resources/silversalmoncreek.jpg new file mode 100755 index 0000000..f657532 Binary files /dev/null and b/Examples/HandlingUserInput/StartingPoint/Landmarks/Landmarks/Resources/silversalmoncreek.jpg differ diff --git a/Examples/HandlingUserInput/StartingPoint/Landmarks/Landmarks/Resources/stmarylake.jpg b/Examples/HandlingUserInput/StartingPoint/Landmarks/Landmarks/Resources/stmarylake.jpg new file mode 100755 index 0000000..1c71de4 Binary files /dev/null and b/Examples/HandlingUserInput/StartingPoint/Landmarks/Landmarks/Resources/stmarylake.jpg differ diff --git a/Examples/HandlingUserInput/StartingPoint/Landmarks/Landmarks/Resources/turtlerock.jpg b/Examples/HandlingUserInput/StartingPoint/Landmarks/Landmarks/Resources/turtlerock.jpg new file mode 100755 index 0000000..f7a6e6d Binary files /dev/null and b/Examples/HandlingUserInput/StartingPoint/Landmarks/Landmarks/Resources/turtlerock.jpg differ diff --git a/Examples/HandlingUserInput/StartingPoint/Landmarks/Landmarks/Resources/twinlake.jpg b/Examples/HandlingUserInput/StartingPoint/Landmarks/Landmarks/Resources/twinlake.jpg new file mode 100755 index 0000000..3e7a57c Binary files /dev/null and b/Examples/HandlingUserInput/StartingPoint/Landmarks/Landmarks/Resources/twinlake.jpg differ diff --git a/Examples/HandlingUserInput/StartingPoint/Landmarks/Landmarks/Resources/umbagog.jpg b/Examples/HandlingUserInput/StartingPoint/Landmarks/Landmarks/Resources/umbagog.jpg new file mode 100755 index 0000000..56291c6 Binary files /dev/null and b/Examples/HandlingUserInput/StartingPoint/Landmarks/Landmarks/Resources/umbagog.jpg differ diff --git a/Examples/HandlingUserInput/StartingPoint/Landmarks/Landmarks/SceneDelegate.swift b/Examples/HandlingUserInput/StartingPoint/Landmarks/Landmarks/SceneDelegate.swift new file mode 100755 index 0000000..c4d69a9 --- /dev/null +++ b/Examples/HandlingUserInput/StartingPoint/Landmarks/Landmarks/SceneDelegate.swift @@ -0,0 +1,56 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +The scene delegate. +*/ + +import UIKit +import SwiftUI + +class SceneDelegate: UIResponder, UIWindowSceneDelegate { + + var window: UIWindow? + + func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) { + // Use this method to optionally configure and attach the UIWindow `window` to the provided UIWindowScene `scene`. + // If using a storyboard, the `window` property will automatically be initialized and attached to the scene. + // This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead). + + // Use a UIHostingController as window root view controller + let window = UIWindow(frame: UIScreen.main.bounds) + window.rootViewController = UIHostingController(rootView: LandmarkList()) + self.window = window + window.makeKeyAndVisible() + } + + func sceneDidDisconnect(_ scene: UIScene) { + // Called as the scene is being released by the system. + // This occurs shortly after the scene enters the background, or when its session is discarded. + // Release any resources associated with this scene that can be re-created the next time the scene connects. + // The scene may re-connect later, as its session was not neccessarily discarded (see `application:didDiscardSceneSessions` instead). + } + + func sceneDidBecomeActive(_ scene: UIScene) { + // Called when the scene has moved from an inactive state to an active state. + // Use this method to restart any tasks that were paused (or not yet started) when the scene was inactive. + } + + func sceneWillResignActive(_ scene: UIScene) { + // Called when the scene will move from an active state to an inactive state. + // This may occur due to temporary interruptions (ex. an incoming phone call). + } + + func sceneWillEnterForeground(_ scene: UIScene) { + // Called as the scene transitions from the background to the foreground. + // Use this method to undo the changes made on entering the background. + } + + func sceneDidEnterBackground(_ scene: UIScene) { + // Called as the scene transitions from the foreground to the background. + // Use this method to save data, release shared resources, and store enough scene-specific state information + // to restore the scene back to its current state. + } + +} + diff --git a/Examples/HandlingUserInput/StartingPoint/Landmarks/Landmarks/Supporting Views/CircleImage.swift b/Examples/HandlingUserInput/StartingPoint/Landmarks/Landmarks/Supporting Views/CircleImage.swift new file mode 100755 index 0000000..ae44439 --- /dev/null +++ b/Examples/HandlingUserInput/StartingPoint/Landmarks/Landmarks/Supporting Views/CircleImage.swift @@ -0,0 +1,27 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +A view that clips an image to a circle and adds a stroke and shadow. +*/ + +import SwiftUI + +struct CircleImage: View { + var image: Image + + var body: some View { + image + .clipShape(Circle()) + .overlay(Circle().stroke(Color.white, lineWidth: 4)) + .shadow(radius: 10) + } +} + +#if DEBUG +struct CircleImage_Previews: PreviewProvider { + static var previews: some View { + CircleImage(image: Image("turtlerock")) + } +} +#endif diff --git a/Examples/HandlingUserInput/StartingPoint/Landmarks/Landmarks/Supporting Views/LandmarkRow.swift b/Examples/HandlingUserInput/StartingPoint/Landmarks/Landmarks/Supporting Views/LandmarkRow.swift new file mode 100755 index 0000000..2f8110c --- /dev/null +++ b/Examples/HandlingUserInput/StartingPoint/Landmarks/Landmarks/Supporting Views/LandmarkRow.swift @@ -0,0 +1,38 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +A single row to be displayed in a list of landmarks. +*/ + +import SwiftUI + +struct LandmarkRow: View { + var landmark: Landmark + + var body: some View { + HStack { + landmark.image(forSize: 50) + Text(verbatim: landmark.name) + Spacer() + + if landmark.isFavorite { + Image(systemName: "star.fill") + .imageScale(.medium) + .foregroundColor(.yellow) + } + } + } +} + +#if DEBUG +struct LandmarkRow_Previews: PreviewProvider { + static var previews: some View { + Group { + LandmarkRow(landmark: landmarkData[0]) + LandmarkRow(landmark: landmarkData[1]) + } + .previewLayout(.fixed(width: 300, height: 70)) + } +} +#endif diff --git a/Examples/HandlingUserInput/StartingPoint/Landmarks/Landmarks/Supporting Views/MapView.swift b/Examples/HandlingUserInput/StartingPoint/Landmarks/Landmarks/Supporting Views/MapView.swift new file mode 100755 index 0000000..5a8c64b --- /dev/null +++ b/Examples/HandlingUserInput/StartingPoint/Landmarks/Landmarks/Supporting Views/MapView.swift @@ -0,0 +1,31 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +A view that hosts an `MKMapView`. +*/ + +import SwiftUI +import MapKit + +struct MapView: UIViewRepresentable { + var coordinate: CLLocationCoordinate2D + + func makeUIView(context: Context) -> MKMapView { + MKMapView(frame: .zero) + } + + func updateUIView(_ view: MKMapView, context: Context) { + let span = MKCoordinateSpan(latitudeDelta: 0.02, longitudeDelta: 0.02) + let region = MKCoordinateRegion(center: coordinate, span: span) + view.setRegion(region, animated: true) + } +} + +#if DEBUG +struct MapView_Previews: PreviewProvider { + static var previews: some View { + MapView(coordinate: landmarkData[0].locationCoordinate) + } +} +#endif diff --git a/Examples/HandlingUserInput/StartingPoint/README.md b/Examples/HandlingUserInput/StartingPoint/README.md new file mode 100755 index 0000000..6d73973 --- /dev/null +++ b/Examples/HandlingUserInput/StartingPoint/README.md @@ -0,0 +1,3 @@ +# Handling User Input + +Use this project to code along with the [Handling User Input](https://developer.apple.com/tutorials/swiftui/handling-user-input) tutorial. diff --git a/Examples/InterfacingWithUIKit/Complete/.gitignore b/Examples/InterfacingWithUIKit/Complete/.gitignore new file mode 100755 index 0000000..9e50718 --- /dev/null +++ b/Examples/InterfacingWithUIKit/Complete/.gitignore @@ -0,0 +1,21 @@ +# See LICENSE folder for this sample’s licensing information. +# +# Apple sample code gitignore configuration. + +# Finder +.DS_Store + +# Xcode - User files +xcuserdata/ + +**/*.xcodeproj/project.xcworkspace/* +!**/*.xcodeproj/project.xcworkspace/xcshareddata + +**/*.xcodeproj/project.xcworkspace/xcshareddata/* +!**/*.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings + +**/*.playground/playground.xcworkspace/* +!**/*.playground/playground.xcworkspace/xcshareddata + +**/*.playground/playground.xcworkspace/xcshareddata/* +!**/*.playground/playground.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings diff --git a/Examples/InterfacingWithUIKit/Complete/Configuration/SampleCode.xcconfig b/Examples/InterfacingWithUIKit/Complete/Configuration/SampleCode.xcconfig new file mode 100755 index 0000000..db86c06 --- /dev/null +++ b/Examples/InterfacingWithUIKit/Complete/Configuration/SampleCode.xcconfig @@ -0,0 +1,13 @@ +// +// See LICENSE folder for this sample’s licensing information. +// +// SampleCode.xcconfig +// + +// The `SAMPLE_CODE_DISAMBIGUATOR` configuration is to make it easier to build +// and run a sample code project. Once you set your project's development team, +// you'll have a unique bundle identifier. This is because the bundle identifier +// is derived based on the 'SAMPLE_CODE_DISAMBIGUATOR' value. Do not use this +// approach in your own projects—it's only useful for sample code projects because +// they are frequently downloaded and don't have a development team set. +SAMPLE_CODE_DISAMBIGUATOR=${DEVELOPMENT_TEAM} diff --git a/Examples/InterfacingWithUIKit/Complete/LICENSE/LICENSE.txt b/Examples/InterfacingWithUIKit/Complete/LICENSE/LICENSE.txt new file mode 100755 index 0000000..94e3d54 --- /dev/null +++ b/Examples/InterfacingWithUIKit/Complete/LICENSE/LICENSE.txt @@ -0,0 +1,8 @@ +Copyright © 2019 Apple Inc. + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + diff --git a/Examples/InterfacingWithUIKit/Complete/Landmarks/InterfacingWithUIKit.xcodeproj/.xcodesamplecode.plist b/Examples/InterfacingWithUIKit/Complete/Landmarks/InterfacingWithUIKit.xcodeproj/.xcodesamplecode.plist new file mode 100755 index 0000000..5dd5da8 --- /dev/null +++ b/Examples/InterfacingWithUIKit/Complete/Landmarks/InterfacingWithUIKit.xcodeproj/.xcodesamplecode.plist @@ -0,0 +1,5 @@ + + + + + diff --git a/Examples/InterfacingWithUIKit/Complete/Landmarks/InterfacingWithUIKit.xcodeproj/project.pbxproj b/Examples/InterfacingWithUIKit/Complete/Landmarks/InterfacingWithUIKit.xcodeproj/project.pbxproj new file mode 100755 index 0000000..1905aaf --- /dev/null +++ b/Examples/InterfacingWithUIKit/Complete/Landmarks/InterfacingWithUIKit.xcodeproj/project.pbxproj @@ -0,0 +1,589 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 50; + objects = { + +/* Begin PBXBuildFile section */ + B7310DD1229F6839001079B9 /* HexagonParameters.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7310DD0229F6839001079B9 /* HexagonParameters.swift */; }; + B7310DD3229F6CA9001079B9 /* Badge.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7310DD2229F6CA9001079B9 /* Badge.swift */; }; + B7394866229F194000C47603 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7394865229F194000C47603 /* AppDelegate.swift */; }; + B7394868229F194000C47603 /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7394867229F194000C47603 /* SceneDelegate.swift */; }; + B739486A229F194000C47603 /* LandmarkDetail.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7394869229F194000C47603 /* LandmarkDetail.swift */; }; + B739486C229F194200C47603 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = B739486B229F194200C47603 /* Assets.xcassets */; }; + B739486F229F194200C47603 /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = B739486E229F194200C47603 /* Preview Assets.xcassets */; }; + B7394872229F194200C47603 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = B7394870229F194200C47603 /* LaunchScreen.storyboard */; }; + B739487A229F1B3F00C47603 /* CircleImage.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7394879229F1B3F00C47603 /* CircleImage.swift */; }; + B739487C229F1B6800C47603 /* MapView.swift in Sources */ = {isa = PBXBuildFile; fileRef = B739487B229F1B6800C47603 /* MapView.swift */; }; + B7394881229F28B900C47603 /* Landmark.swift in Sources */ = {isa = PBXBuildFile; fileRef = B739487F229F28B900C47603 /* Landmark.swift */; }; + B7394891229F292F00C47603 /* rainbowlake.jpg in Resources */ = {isa = PBXBuildFile; fileRef = B7394884229F292D00C47603 /* rainbowlake.jpg */; }; + B7394893229F292F00C47603 /* icybay.jpg in Resources */ = {isa = PBXBuildFile; fileRef = B7394886229F292E00C47603 /* icybay.jpg */; }; + B7394894229F292F00C47603 /* lakemcdonald.jpg in Resources */ = {isa = PBXBuildFile; fileRef = B7394887229F292E00C47603 /* lakemcdonald.jpg */; }; + B7394895229F292F00C47603 /* turtlerock.jpg in Resources */ = {isa = PBXBuildFile; fileRef = B7394888229F292E00C47603 /* turtlerock.jpg */; }; + B7394896229F292F00C47603 /* umbagog.jpg in Resources */ = {isa = PBXBuildFile; fileRef = B7394889229F292E00C47603 /* umbagog.jpg */; }; + B7394897229F292F00C47603 /* hiddenlake.jpg in Resources */ = {isa = PBXBuildFile; fileRef = B739488A229F292E00C47603 /* hiddenlake.jpg */; }; + B7394898229F292F00C47603 /* stmarylake.jpg in Resources */ = {isa = PBXBuildFile; fileRef = B739488B229F292E00C47603 /* stmarylake.jpg */; }; + B7394899229F292F00C47603 /* twinlake.jpg in Resources */ = {isa = PBXBuildFile; fileRef = B739488C229F292E00C47603 /* twinlake.jpg */; }; + B739489A229F292F00C47603 /* silversalmoncreek.jpg in Resources */ = {isa = PBXBuildFile; fileRef = B739488D229F292E00C47603 /* silversalmoncreek.jpg */; }; + B739489B229F292F00C47603 /* landmarkData.json in Resources */ = {isa = PBXBuildFile; fileRef = B739488E229F292E00C47603 /* landmarkData.json */; }; + B739489C229F292F00C47603 /* chincoteague.jpg in Resources */ = {isa = PBXBuildFile; fileRef = B739488F229F292F00C47603 /* chincoteague.jpg */; }; + B739489D229F292F00C47603 /* chilkoottrail.jpg in Resources */ = {isa = PBXBuildFile; fileRef = B7394890229F292F00C47603 /* chilkoottrail.jpg */; }; + B739489F229F2D9700C47603 /* LandmarkRow.swift in Sources */ = {isa = PBXBuildFile; fileRef = B739489E229F2D9700C47603 /* LandmarkRow.swift */; }; + B73948A1229F2E1F00C47603 /* LandmarkList.swift in Sources */ = {isa = PBXBuildFile; fileRef = B73948A0229F2E1F00C47603 /* LandmarkList.swift */; }; + B73948A3229F3E2200C47603 /* charleyrivers.jpg in Resources */ = {isa = PBXBuildFile; fileRef = B73948A2229F3E2200C47603 /* charleyrivers.jpg */; }; + B7D2AAC5229F4D7C0061E5F5 /* UserData.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7D2AAC4229F4D7C0061E5F5 /* UserData.swift */; }; + B7D587AE229F7382006E8DCF /* BadgeBackground.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7D587AD229F7382006E8DCF /* BadgeBackground.swift */; }; + B7D587B0229F73C1006E8DCF /* BadgeSymbol.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7D587AF229F73C1006E8DCF /* BadgeSymbol.swift */; }; + B7D587B2229F7406006E8DCF /* RotatedBadgeSymbol.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7D587B1229F7406006E8DCF /* RotatedBadgeSymbol.swift */; }; + B7D587B6229F825D006E8DCF /* HikeView.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7D587B5229F825D006E8DCF /* HikeView.swift */; }; + B7D587B8229F826D006E8DCF /* GraphCapsule.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7D587B7229F826D006E8DCF /* GraphCapsule.swift */; }; + B7D587BA229F8288006E8DCF /* Hike.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7D587B9229F8288006E8DCF /* Hike.swift */; }; + B7D587BC229F82EB006E8DCF /* HikeDetail.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7D587BB229F82EB006E8DCF /* HikeDetail.swift */; }; + B7D587BE229F82FF006E8DCF /* HikeGraph.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7D587BD229F82FF006E8DCF /* HikeGraph.swift */; }; + B7D587C0229F830B006E8DCF /* hikeData.json in Resources */ = {isa = PBXBuildFile; fileRef = B7D587BF229F830B006E8DCF /* hikeData.json */; }; + B7D587D222A0892C006E8DCF /* Home.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7D587D122A0892C006E8DCF /* Home.swift */; }; + B7D587D422A08965006E8DCF /* CategoryRow.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7D587D322A08965006E8DCF /* CategoryRow.swift */; }; + B7D587D622A08C97006E8DCF /* Profile.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7D587D522A08C97006E8DCF /* Profile.swift */; }; + B7D587D922A08D33006E8DCF /* ProfileHost.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7D587D822A08D33006E8DCF /* ProfileHost.swift */; }; + B7D587DB22A08D67006E8DCF /* ProfileSummary.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7D587DA22A08D67006E8DCF /* ProfileSummary.swift */; }; + B7D587DD22A08DD6006E8DCF /* HikeBadge.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7D587DC22A08DD6006E8DCF /* HikeBadge.swift */; }; + B7D587DF22A08E1A006E8DCF /* ProfileEditor.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7D587DE22A08E1A006E8DCF /* ProfileEditor.swift */; }; + B7D587E122A0914D006E8DCF /* FeatureCard.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7D587E022A0914D006E8DCF /* FeatureCard.swift */; }; + B7D587E522A097E2006E8DCF /* charleyrivers_feature.jpg in Resources */ = {isa = PBXBuildFile; fileRef = B7D587E222A097E2006E8DCF /* charleyrivers_feature.jpg */; }; + B7D587E622A097E2006E8DCF /* stmarylake_feature.jpg in Resources */ = {isa = PBXBuildFile; fileRef = B7D587E322A097E2006E8DCF /* stmarylake_feature.jpg */; }; + B7D587E722A097E2006E8DCF /* turtlerock_feature.jpg in Resources */ = {isa = PBXBuildFile; fileRef = B7D587E422A097E2006E8DCF /* turtlerock_feature.jpg */; }; + B7D587E922A09809006E8DCF /* Data.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7D587E822A09809006E8DCF /* Data.swift */; }; + B7D587EB22A09A86006E8DCF /* PageViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7D587EA22A09A86006E8DCF /* PageViewController.swift */; }; + B7D587ED22A09B79006E8DCF /* PageView.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7D587EC22A09B79006E8DCF /* PageView.swift */; }; + B7D587EF22A09D0C006E8DCF /* PageControl.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7D587EE22A09D0C006E8DCF /* PageControl.swift */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + 7D5949007D59D84000000001 /* LICENSE.txt */ = {isa = PBXFileReference; includeInIndex = 1; path = LICENSE.txt; sourceTree = ""; }; + 7D7349B07D72194000000001 /* SampleCode.xcconfig */ = {isa = PBXFileReference; name = SampleCode.xcconfig; path = ../Configuration/SampleCode.xcconfig; sourceTree = ""; }; + B7310DD0229F6839001079B9 /* HexagonParameters.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HexagonParameters.swift; sourceTree = ""; }; + B7310DD2229F6CA9001079B9 /* Badge.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Badge.swift; sourceTree = ""; }; + B7394862229F194000C47603 /* Landmarks.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Landmarks.app; sourceTree = BUILT_PRODUCTS_DIR; }; + B7394865229F194000C47603 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + B7394867229F194000C47603 /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = ""; }; + B7394869229F194000C47603 /* LandmarkDetail.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LandmarkDetail.swift; sourceTree = ""; }; + B739486B229F194200C47603 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + B739486E229F194200C47603 /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = ""; }; + B7394871229F194200C47603 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + B7394873229F194200C47603 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + B7394879229F1B3F00C47603 /* CircleImage.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CircleImage.swift; sourceTree = ""; }; + B739487B229F1B6800C47603 /* MapView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MapView.swift; sourceTree = ""; }; + B739487F229F28B900C47603 /* Landmark.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Landmark.swift; sourceTree = ""; }; + B7394884229F292D00C47603 /* rainbowlake.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = rainbowlake.jpg; sourceTree = ""; }; + B7394886229F292E00C47603 /* icybay.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = icybay.jpg; sourceTree = ""; }; + B7394887229F292E00C47603 /* lakemcdonald.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = lakemcdonald.jpg; sourceTree = ""; }; + B7394888229F292E00C47603 /* turtlerock.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = turtlerock.jpg; sourceTree = ""; }; + B7394889229F292E00C47603 /* umbagog.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = umbagog.jpg; sourceTree = ""; }; + B739488A229F292E00C47603 /* hiddenlake.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = hiddenlake.jpg; sourceTree = ""; }; + B739488B229F292E00C47603 /* stmarylake.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = stmarylake.jpg; sourceTree = ""; }; + B739488C229F292E00C47603 /* twinlake.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = twinlake.jpg; sourceTree = ""; }; + B739488D229F292E00C47603 /* silversalmoncreek.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = silversalmoncreek.jpg; sourceTree = ""; }; + B739488E229F292E00C47603 /* landmarkData.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = landmarkData.json; sourceTree = ""; }; + B739488F229F292F00C47603 /* chincoteague.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = chincoteague.jpg; sourceTree = ""; }; + B7394890229F292F00C47603 /* chilkoottrail.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = chilkoottrail.jpg; sourceTree = ""; }; + B739489E229F2D9700C47603 /* LandmarkRow.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = LandmarkRow.swift; path = "Supporting Views/LandmarkRow.swift"; sourceTree = ""; }; + B73948A0229F2E1F00C47603 /* LandmarkList.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LandmarkList.swift; sourceTree = ""; }; + B73948A2229F3E2200C47603 /* charleyrivers.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = charleyrivers.jpg; sourceTree = ""; }; + B7D2AAC4229F4D7C0061E5F5 /* UserData.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UserData.swift; sourceTree = ""; }; + B7D587AD229F7382006E8DCF /* BadgeBackground.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BadgeBackground.swift; sourceTree = ""; }; + B7D587AF229F73C1006E8DCF /* BadgeSymbol.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BadgeSymbol.swift; sourceTree = ""; }; + B7D587B1229F7406006E8DCF /* RotatedBadgeSymbol.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RotatedBadgeSymbol.swift; sourceTree = ""; }; + B7D587B5229F825D006E8DCF /* HikeView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HikeView.swift; sourceTree = ""; }; + B7D587B7229F826D006E8DCF /* GraphCapsule.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GraphCapsule.swift; sourceTree = ""; }; + B7D587B9229F8288006E8DCF /* Hike.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Hike.swift; sourceTree = ""; }; + B7D587BB229F82EB006E8DCF /* HikeDetail.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HikeDetail.swift; sourceTree = ""; }; + B7D587BD229F82FF006E8DCF /* HikeGraph.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HikeGraph.swift; sourceTree = ""; }; + B7D587BF229F830B006E8DCF /* hikeData.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = hikeData.json; sourceTree = ""; }; + B7D587D122A0892C006E8DCF /* Home.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Home.swift; sourceTree = ""; }; + B7D587D322A08965006E8DCF /* CategoryRow.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CategoryRow.swift; sourceTree = ""; }; + B7D587D522A08C97006E8DCF /* Profile.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Profile.swift; sourceTree = ""; }; + B7D587D822A08D33006E8DCF /* ProfileHost.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProfileHost.swift; sourceTree = ""; }; + B7D587DA22A08D67006E8DCF /* ProfileSummary.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProfileSummary.swift; sourceTree = ""; }; + B7D587DC22A08DD6006E8DCF /* HikeBadge.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HikeBadge.swift; sourceTree = ""; }; + B7D587DE22A08E1A006E8DCF /* ProfileEditor.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProfileEditor.swift; sourceTree = ""; }; + B7D587E022A0914D006E8DCF /* FeatureCard.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FeatureCard.swift; sourceTree = ""; }; + B7D587E222A097E2006E8DCF /* charleyrivers_feature.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = charleyrivers_feature.jpg; sourceTree = ""; }; + B7D587E322A097E2006E8DCF /* stmarylake_feature.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = stmarylake_feature.jpg; sourceTree = ""; }; + B7D587E422A097E2006E8DCF /* turtlerock_feature.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = turtlerock_feature.jpg; sourceTree = ""; }; + B7D587E822A09809006E8DCF /* Data.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Data.swift; sourceTree = ""; }; + B7D587EA22A09A86006E8DCF /* PageViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PageViewController.swift; sourceTree = ""; }; + B7D587EC22A09B79006E8DCF /* PageView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PageView.swift; sourceTree = ""; }; + B7D587EE22A09D0C006E8DCF /* PageControl.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PageControl.swift; sourceTree = ""; }; + C4E4AAA0C4E4035000000001 /* README.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; name = README.md; path = ../README.md; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + B739485F229F194000C47603 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 7D59C6607D59CD8000000001 /* LICENSE */ = { + isa = PBXGroup; + children = ( + 7D5949007D59D84000000001 /* LICENSE.txt */, + ); + name = LICENSE; + path = ../LICENSE; + sourceTree = ""; + }; + 7D7215E07D7215A000000001 /* Configuration */ = { + isa = PBXGroup; + children = ( + 7D7349B07D72194000000001 /* SampleCode.xcconfig */, + ); + name = Configuration; + sourceTree = ""; + }; + B7394859229F194000C47603 = { + isa = PBXGroup; + children = ( + C4E4AAA0C4E4035000000001 /* README.md */, + B7394864229F194000C47603 /* Landmarks */, + B7394863229F194000C47603 /* Products */, + 7D7215E07D7215A000000001 /* Configuration */, + 7D59C6607D59CD8000000001 /* LICENSE */, + ); + sourceTree = ""; + }; + B7394863229F194000C47603 /* Products */ = { + isa = PBXGroup; + children = ( + B7394862229F194000C47603 /* Landmarks.app */, + ); + name = Products; + sourceTree = ""; + }; + B7394864229F194000C47603 /* Landmarks */ = { + isa = PBXGroup; + children = ( + B739487E229F282200C47603 /* Models */, + B7D587D722A08D16006E8DCF /* Profiles */, + B7394865229F194000C47603 /* AppDelegate.swift */, + B7394867229F194000C47603 /* SceneDelegate.swift */, + B7D587D122A0892C006E8DCF /* Home.swift */, + B7D587D322A08965006E8DCF /* CategoryRow.swift */, + B7D587EA22A09A86006E8DCF /* PageViewController.swift */, + B7D587EC22A09B79006E8DCF /* PageView.swift */, + B7D587EE22A09D0C006E8DCF /* PageControl.swift */, + B73948A0229F2E1F00C47603 /* LandmarkList.swift */, + B739489E229F2D9700C47603 /* LandmarkRow.swift */, + B7394869229F194000C47603 /* LandmarkDetail.swift */, + B7D587B5229F825D006E8DCF /* HikeView.swift */, + B7D587BB229F82EB006E8DCF /* HikeDetail.swift */, + B7D587DC22A08DD6006E8DCF /* HikeBadge.swift */, + B7310DD0229F6839001079B9 /* HexagonParameters.swift */, + B739487D229F1C0100C47603 /* Supporting Views */, + B7394883229F291A00C47603 /* Resources */, + B739486B229F194200C47603 /* Assets.xcassets */, + B7394870229F194200C47603 /* LaunchScreen.storyboard */, + B7394873229F194200C47603 /* Info.plist */, + B739486D229F194200C47603 /* Preview Content */, + ); + path = Landmarks; + sourceTree = ""; + }; + B739486D229F194200C47603 /* Preview Content */ = { + isa = PBXGroup; + children = ( + B739486E229F194200C47603 /* Preview Assets.xcassets */, + ); + path = "Preview Content"; + sourceTree = ""; + }; + B739487D229F1C0100C47603 /* Supporting Views */ = { + isa = PBXGroup; + children = ( + B7D587E022A0914D006E8DCF /* FeatureCard.swift */, + B7394879229F1B3F00C47603 /* CircleImage.swift */, + B739487B229F1B6800C47603 /* MapView.swift */, + B7310DD2229F6CA9001079B9 /* Badge.swift */, + B7D587AF229F73C1006E8DCF /* BadgeSymbol.swift */, + B7D587B1229F7406006E8DCF /* RotatedBadgeSymbol.swift */, + B7D587AD229F7382006E8DCF /* BadgeBackground.swift */, + B7D587BD229F82FF006E8DCF /* HikeGraph.swift */, + B7D587B7229F826D006E8DCF /* GraphCapsule.swift */, + ); + path = "Supporting Views"; + sourceTree = ""; + }; + B739487E229F282200C47603 /* Models */ = { + isa = PBXGroup; + children = ( + B7D587D522A08C97006E8DCF /* Profile.swift */, + B739487F229F28B900C47603 /* Landmark.swift */, + B7D587E822A09809006E8DCF /* Data.swift */, + B7D587B9229F8288006E8DCF /* Hike.swift */, + B7D2AAC4229F4D7C0061E5F5 /* UserData.swift */, + ); + path = Models; + sourceTree = ""; + }; + B7394883229F291A00C47603 /* Resources */ = { + isa = PBXGroup; + children = ( + B739488E229F292E00C47603 /* landmarkData.json */, + B7D587BF229F830B006E8DCF /* hikeData.json */, + B7D587E222A097E2006E8DCF /* charleyrivers_feature.jpg */, + B7D587E322A097E2006E8DCF /* stmarylake_feature.jpg */, + B7D587E422A097E2006E8DCF /* turtlerock_feature.jpg */, + B7394890229F292F00C47603 /* chilkoottrail.jpg */, + B739488F229F292F00C47603 /* chincoteague.jpg */, + B739488A229F292E00C47603 /* hiddenlake.jpg */, + B7394886229F292E00C47603 /* icybay.jpg */, + B7394887229F292E00C47603 /* lakemcdonald.jpg */, + B7394884229F292D00C47603 /* rainbowlake.jpg */, + B739488D229F292E00C47603 /* silversalmoncreek.jpg */, + B739488B229F292E00C47603 /* stmarylake.jpg */, + B7394888229F292E00C47603 /* turtlerock.jpg */, + B739488C229F292E00C47603 /* twinlake.jpg */, + B7394889229F292E00C47603 /* umbagog.jpg */, + B73948A2229F3E2200C47603 /* charleyrivers.jpg */, + ); + path = Resources; + sourceTree = ""; + }; + B7D587D722A08D16006E8DCF /* Profiles */ = { + isa = PBXGroup; + children = ( + B7D587D822A08D33006E8DCF /* ProfileHost.swift */, + B7D587DA22A08D67006E8DCF /* ProfileSummary.swift */, + B7D587DE22A08E1A006E8DCF /* ProfileEditor.swift */, + ); + path = Profiles; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + B7394861229F194000C47603 /* Landmarks */ = { + isa = PBXNativeTarget; + buildConfigurationList = B7394876229F194200C47603 /* Build configuration list for PBXNativeTarget "Landmarks" */; + buildPhases = ( + B739485E229F194000C47603 /* Sources */, + B739485F229F194000C47603 /* Frameworks */, + B7394860229F194000C47603 /* Resources */, + C602AC70C605937000000001, + ); + buildRules = ( + ); + dependencies = ( + ); + name = Landmarks; + productName = Landmarks; + productReference = B7394862229F194000C47603 /* Landmarks.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + B739485A229F194000C47603 /* Project object */ = { + isa = PBXProject; + attributes = { + LastSwiftUpdateCheck = 1100; + LastUpgradeCheck = 1100; + ORGANIZATIONNAME = Apple; + TargetAttributes = { + B7394861229F194000C47603 = { + CreatedOnToolsVersion = 11.0; + }; + }; + }; + buildConfigurationList = B739485D229F194000C47603 /* Build configuration list for PBXProject "InterfacingWithUIKit" */; + compatibilityVersion = "Xcode 9.3"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = B7394859229F194000C47603; + productRefGroup = B7394863229F194000C47603 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + B7394861229F194000C47603 /* Landmarks */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + B7394860229F194000C47603 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + B739489A229F292F00C47603 /* silversalmoncreek.jpg in Resources */, + B7394894229F292F00C47603 /* lakemcdonald.jpg in Resources */, + B7D587C0229F830B006E8DCF /* hikeData.json in Resources */, + B7394872229F194200C47603 /* LaunchScreen.storyboard in Resources */, + B73948A3229F3E2200C47603 /* charleyrivers.jpg in Resources */, + B7394891229F292F00C47603 /* rainbowlake.jpg in Resources */, + B7D587E522A097E2006E8DCF /* charleyrivers_feature.jpg in Resources */, + B739486F229F194200C47603 /* Preview Assets.xcassets in Resources */, + B7394895229F292F00C47603 /* turtlerock.jpg in Resources */, + B739486C229F194200C47603 /* Assets.xcassets in Resources */, + B7394899229F292F00C47603 /* twinlake.jpg in Resources */, + B7D587E622A097E2006E8DCF /* stmarylake_feature.jpg in Resources */, + B7394896229F292F00C47603 /* umbagog.jpg in Resources */, + B739489D229F292F00C47603 /* chilkoottrail.jpg in Resources */, + B739489C229F292F00C47603 /* chincoteague.jpg in Resources */, + B739489B229F292F00C47603 /* landmarkData.json in Resources */, + B7394893229F292F00C47603 /* icybay.jpg in Resources */, + B7394897229F292F00C47603 /* hiddenlake.jpg in Resources */, + B7394898229F292F00C47603 /* stmarylake.jpg in Resources */, + B7D587E722A097E2006E8DCF /* turtlerock_feature.jpg in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + B739485E229F194000C47603 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + B7310DD3229F6CA9001079B9 /* Badge.swift in Sources */, + B7D587E122A0914D006E8DCF /* FeatureCard.swift in Sources */, + B7394866229F194000C47603 /* AppDelegate.swift in Sources */, + B7D587D922A08D33006E8DCF /* ProfileHost.swift in Sources */, + B7D587D622A08C97006E8DCF /* Profile.swift in Sources */, + B7D587B8229F826D006E8DCF /* GraphCapsule.swift in Sources */, + B7D587D422A08965006E8DCF /* CategoryRow.swift in Sources */, + B7D587E922A09809006E8DCF /* Data.swift in Sources */, + B739487A229F1B3F00C47603 /* CircleImage.swift in Sources */, + B739487C229F1B6800C47603 /* MapView.swift in Sources */, + B7D587BA229F8288006E8DCF /* Hike.swift in Sources */, + B7D587BC229F82EB006E8DCF /* HikeDetail.swift in Sources */, + B7D587B6229F825D006E8DCF /* HikeView.swift in Sources */, + B7310DD1229F6839001079B9 /* HexagonParameters.swift in Sources */, + B73948A1229F2E1F00C47603 /* LandmarkList.swift in Sources */, + B7D587B0229F73C1006E8DCF /* BadgeSymbol.swift in Sources */, + B7D587B2229F7406006E8DCF /* RotatedBadgeSymbol.swift in Sources */, + B7D587DD22A08DD6006E8DCF /* HikeBadge.swift in Sources */, + B7D587D222A0892C006E8DCF /* Home.swift in Sources */, + B7D587BE229F82FF006E8DCF /* HikeGraph.swift in Sources */, + B7394868229F194000C47603 /* SceneDelegate.swift in Sources */, + B7D587AE229F7382006E8DCF /* BadgeBackground.swift in Sources */, + B7D587EB22A09A86006E8DCF /* PageViewController.swift in Sources */, + B739486A229F194000C47603 /* LandmarkDetail.swift in Sources */, + B739489F229F2D9700C47603 /* LandmarkRow.swift in Sources */, + B7D587ED22A09B79006E8DCF /* PageView.swift in Sources */, + B7D587DB22A08D67006E8DCF /* ProfileSummary.swift in Sources */, + B7D587EF22A09D0C006E8DCF /* PageControl.swift in Sources */, + B7D2AAC5229F4D7C0061E5F5 /* UserData.swift in Sources */, + B7394881229F28B900C47603 /* Landmark.swift in Sources */, + B7D587DF22A08E1A006E8DCF /* ProfileEditor.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXVariantGroup section */ + B7394870229F194200C47603 /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + B7394871229F194200C47603 /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + B7394874229F194200C47603 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 7D7349B07D72194000000001 /* SampleCode.xcconfig */; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 13.0; + MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; + MTL_FAST_MATH = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + }; + name = Debug; + }; + B7394875229F194200C47603 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 7D7349B07D72194000000001 /* SampleCode.xcconfig */; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 13.0; + MTL_ENABLE_DEBUG_INFO = NO; + MTL_FAST_MATH = YES; + SDKROOT = iphoneos; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + B7394877229F194200C47603 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 7D7349B07D72194000000001 /* SampleCode.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_ASSET_PATHS = "Landmarks/Preview\\ Content"; + DEVELOPMENT_TEAM = ""; + ENABLE_PREVIEWS = YES; + INFOPLIST_FILE = Landmarks/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = "com.example.apple-samplecode.Landmarks${SAMPLE_CODE_DISAMBIGUATOR}"; + PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE_SPECIFIER = ""; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + B7394878229F194200C47603 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 7D7349B07D72194000000001 /* SampleCode.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_ASSET_PATHS = "Landmarks/Preview\\ Content"; + DEVELOPMENT_TEAM = ""; + ENABLE_PREVIEWS = YES; + INFOPLIST_FILE = Landmarks/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = "com.example.apple-samplecode.Landmarks${SAMPLE_CODE_DISAMBIGUATOR}"; + PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE_SPECIFIER = ""; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + B739485D229F194000C47603 /* Build configuration list for PBXProject "InterfacingWithUIKit" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + B7394874229F194200C47603 /* Debug */, + B7394875229F194200C47603 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + B7394876229F194200C47603 /* Build configuration list for PBXNativeTarget "Landmarks" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + B7394877229F194200C47603 /* Debug */, + B7394878229F194200C47603 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = B739485A229F194000C47603 /* Project object */; +} diff --git a/Examples/InterfacingWithUIKit/Complete/Landmarks/InterfacingWithUIKit.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/Examples/InterfacingWithUIKit/Complete/Landmarks/InterfacingWithUIKit.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings new file mode 100755 index 0000000..3ddf867 --- /dev/null +++ b/Examples/InterfacingWithUIKit/Complete/Landmarks/InterfacingWithUIKit.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings @@ -0,0 +1,8 @@ + + + + + BuildSystemType + Latest + + diff --git a/Examples/InterfacingWithUIKit/Complete/Landmarks/Landmarks/AppDelegate.swift b/Examples/InterfacingWithUIKit/Complete/Landmarks/Landmarks/AppDelegate.swift new file mode 100755 index 0000000..e22943b --- /dev/null +++ b/Examples/InterfacingWithUIKit/Complete/Landmarks/Landmarks/AppDelegate.swift @@ -0,0 +1,36 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +The application delegate. +*/ + +import UIKit + +@UIApplicationMain +class AppDelegate: UIResponder, UIApplicationDelegate { + + func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { + // Override point for customization after application launch. + return true + } + + func applicationWillTerminate(_ application: UIApplication) { + // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. + } + + // MARK: UISceneSession Lifecycle + func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration { + // Called when a new scene session is being created. + // Use this method to select a configuration to create the new scene with. + return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role) + } + + func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set) { + // Called when the user discards a scene session. + // If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions. + // Use this method to release any resources that were specific to the discarded scenes, as they will not return. + } + +} + diff --git a/Examples/InterfacingWithUIKit/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/Contents.json b/Examples/InterfacingWithUIKit/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100755 index 0000000..fa0d2db --- /dev/null +++ b/Examples/InterfacingWithUIKit/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,113 @@ +{ + "images" : [ + { + "size" : "20x20", + "idiom" : "iphone", + "filename" : "landmark_app_icon_40x40.png", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "20x20", + "scale" : "3x" + }, + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "landmark_app_icon_58x58.png", + "scale" : "2x" + }, + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "landmark_app_icon_87x87.png", + "scale" : "3x" + }, + { + "size" : "40x40", + "idiom" : "iphone", + "filename" : "landmark_app_icon_80x80.png", + "scale" : "2x" + }, + { + "size" : "40x40", + "idiom" : "iphone", + "filename" : "landmark_app_icon_120x120.png", + "scale" : "3x" + }, + { + "size" : "60x60", + "idiom" : "iphone", + "filename" : "landmark_app_icon_120x120-1.png", + "scale" : "2x" + }, + { + "size" : "60x60", + "idiom" : "iphone", + "filename" : "landmark_app_icon_180x180.png", + "scale" : "3x" + }, + { + "idiom" : "ipad", + "size" : "20x20", + "scale" : "1x" + }, + { + "size" : "20x20", + "idiom" : "ipad", + "filename" : "landmark_app_icon_40x40-1.png", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "29x29", + "scale" : "1x" + }, + { + "size" : "29x29", + "idiom" : "ipad", + "filename" : "landmark_app_icon_58x58-1.png", + "scale" : "2x" + }, + { + "size" : "40x40", + "idiom" : "ipad", + "filename" : "landmark_app_icon_40x40-2.png", + "scale" : "1x" + }, + { + "size" : "40x40", + "idiom" : "ipad", + "filename" : "landmark_app_icon_80x80-1.png", + "scale" : "2x" + }, + { + "size" : "76x76", + "idiom" : "ipad", + "filename" : "landmark_app_icon_76x76.png", + "scale" : "1x" + }, + { + "size" : "76x76", + "idiom" : "ipad", + "filename" : "landmark_app_icon_152x152.png", + "scale" : "2x" + }, + { + "size" : "83.5x83.5", + "idiom" : "ipad", + "filename" : "landmark_app_icon_167x167.png", + "scale" : "2x" + }, + { + "size" : "1024x1024", + "idiom" : "ios-marketing", + "filename" : "landmark_app_icon_1024x1024.png", + "scale" : "1x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Examples/InterfacingWithUIKit/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_1024x1024.png b/Examples/InterfacingWithUIKit/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_1024x1024.png new file mode 100755 index 0000000..00d81c1 Binary files /dev/null and b/Examples/InterfacingWithUIKit/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_1024x1024.png differ diff --git a/Examples/InterfacingWithUIKit/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_120x120-1.png b/Examples/InterfacingWithUIKit/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_120x120-1.png new file mode 100755 index 0000000..d382b8b Binary files /dev/null and b/Examples/InterfacingWithUIKit/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_120x120-1.png differ diff --git a/Examples/InterfacingWithUIKit/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_120x120.png b/Examples/InterfacingWithUIKit/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_120x120.png new file mode 100755 index 0000000..d382b8b Binary files /dev/null and b/Examples/InterfacingWithUIKit/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_120x120.png differ diff --git a/Examples/InterfacingWithUIKit/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_152x152.png b/Examples/InterfacingWithUIKit/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_152x152.png new file mode 100755 index 0000000..11057f8 Binary files /dev/null and b/Examples/InterfacingWithUIKit/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_152x152.png differ diff --git a/Examples/InterfacingWithUIKit/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_167x167.png b/Examples/InterfacingWithUIKit/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_167x167.png new file mode 100755 index 0000000..f73bc26 Binary files /dev/null and b/Examples/InterfacingWithUIKit/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_167x167.png differ diff --git a/Examples/InterfacingWithUIKit/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_180x180.png b/Examples/InterfacingWithUIKit/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_180x180.png new file mode 100755 index 0000000..b02738c Binary files /dev/null and b/Examples/InterfacingWithUIKit/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_180x180.png differ diff --git a/Examples/InterfacingWithUIKit/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_40x40-1.png b/Examples/InterfacingWithUIKit/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_40x40-1.png new file mode 100755 index 0000000..abaff0e Binary files /dev/null and b/Examples/InterfacingWithUIKit/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_40x40-1.png differ diff --git a/Examples/InterfacingWithUIKit/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_40x40-2.png b/Examples/InterfacingWithUIKit/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_40x40-2.png new file mode 100755 index 0000000..abaff0e Binary files /dev/null and b/Examples/InterfacingWithUIKit/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_40x40-2.png differ diff --git a/Examples/InterfacingWithUIKit/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_40x40.png b/Examples/InterfacingWithUIKit/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_40x40.png new file mode 100755 index 0000000..abaff0e Binary files /dev/null and b/Examples/InterfacingWithUIKit/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_40x40.png differ diff --git a/Examples/InterfacingWithUIKit/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_58x58-1.png b/Examples/InterfacingWithUIKit/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_58x58-1.png new file mode 100755 index 0000000..cf7c73d Binary files /dev/null and b/Examples/InterfacingWithUIKit/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_58x58-1.png differ diff --git a/Examples/InterfacingWithUIKit/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_58x58.png b/Examples/InterfacingWithUIKit/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_58x58.png new file mode 100755 index 0000000..cf7c73d Binary files /dev/null and b/Examples/InterfacingWithUIKit/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_58x58.png differ diff --git a/Examples/InterfacingWithUIKit/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_76x76.png b/Examples/InterfacingWithUIKit/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_76x76.png new file mode 100755 index 0000000..3eff85b Binary files /dev/null and b/Examples/InterfacingWithUIKit/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_76x76.png differ diff --git a/Examples/InterfacingWithUIKit/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_80x80-1.png b/Examples/InterfacingWithUIKit/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_80x80-1.png new file mode 100755 index 0000000..6f33f66 Binary files /dev/null and b/Examples/InterfacingWithUIKit/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_80x80-1.png differ diff --git a/Examples/InterfacingWithUIKit/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_80x80.png b/Examples/InterfacingWithUIKit/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_80x80.png new file mode 100755 index 0000000..6f33f66 Binary files /dev/null and b/Examples/InterfacingWithUIKit/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_80x80.png differ diff --git a/Examples/InterfacingWithUIKit/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_87x87.png b/Examples/InterfacingWithUIKit/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_87x87.png new file mode 100755 index 0000000..9e1616c Binary files /dev/null and b/Examples/InterfacingWithUIKit/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_87x87.png differ diff --git a/Examples/InterfacingWithUIKit/Complete/Landmarks/Landmarks/Assets.xcassets/Contents.json b/Examples/InterfacingWithUIKit/Complete/Landmarks/Landmarks/Assets.xcassets/Contents.json new file mode 100755 index 0000000..da4a164 --- /dev/null +++ b/Examples/InterfacingWithUIKit/Complete/Landmarks/Landmarks/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Examples/InterfacingWithUIKit/Complete/Landmarks/Landmarks/Assets.xcassets/turtlerock.imageset/Contents.json b/Examples/InterfacingWithUIKit/Complete/Landmarks/Landmarks/Assets.xcassets/turtlerock.imageset/Contents.json new file mode 100755 index 0000000..5bfd7bf --- /dev/null +++ b/Examples/InterfacingWithUIKit/Complete/Landmarks/Landmarks/Assets.xcassets/turtlerock.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "turtlerock.jpg", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Examples/InterfacingWithUIKit/Complete/Landmarks/Landmarks/Assets.xcassets/turtlerock.imageset/turtlerock.jpg b/Examples/InterfacingWithUIKit/Complete/Landmarks/Landmarks/Assets.xcassets/turtlerock.imageset/turtlerock.jpg new file mode 100755 index 0000000..68bcd3e Binary files /dev/null and b/Examples/InterfacingWithUIKit/Complete/Landmarks/Landmarks/Assets.xcassets/turtlerock.imageset/turtlerock.jpg differ diff --git a/Examples/InterfacingWithUIKit/Complete/Landmarks/Landmarks/Base.lproj/LaunchScreen.storyboard b/Examples/InterfacingWithUIKit/Complete/Landmarks/Landmarks/Base.lproj/LaunchScreen.storyboard new file mode 100755 index 0000000..865e932 --- /dev/null +++ b/Examples/InterfacingWithUIKit/Complete/Landmarks/Landmarks/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Examples/InterfacingWithUIKit/Complete/Landmarks/Landmarks/CategoryRow.swift b/Examples/InterfacingWithUIKit/Complete/Landmarks/Landmarks/CategoryRow.swift new file mode 100755 index 0000000..1f4fbd8 --- /dev/null +++ b/Examples/InterfacingWithUIKit/Complete/Landmarks/Landmarks/CategoryRow.swift @@ -0,0 +1,64 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +A view showing a scrollable list of landmarks. +*/ + +import SwiftUI + +struct CategoryRow: View { + var categoryName: String + var items: [Landmark] + + var body: some View { + VStack(alignment: .leading) { + Text(self.categoryName) + .font(.headline) + .padding(.leading, 15) + .padding(.top, 5) + + ScrollView(showsHorizontalIndicator: false) { + HStack(alignment: .top, spacing: 0) { + ForEach(self.items.identified(by: \.name)) { landmark in + NavigationButton( + destination: LandmarkDetail( + landmark: landmark + ) + ) { + CategoryItem(landmark: landmark) + } + } + } + } + .frame(height: 185) + } + } +} + +struct CategoryItem: View { + var landmark: Landmark + var body: some View { + VStack(alignment: .leading) { + landmark + .image(forSize: 155) + .renderingMode(.original) + .cornerRadius(5) + Text(landmark.name) + .color(.primary) + .font(.caption) + } + .padding(.leading, 15) + } +} + +#if DEBUG +struct CategoryRow_Previews: PreviewProvider { + static var previews: some View { + CategoryRow( + categoryName: landmarkData[0].category.rawValue, + items: Array(landmarkData.prefix(4)) + ) + } +} +#endif diff --git a/Examples/InterfacingWithUIKit/Complete/Landmarks/Landmarks/HexagonParameters.swift b/Examples/InterfacingWithUIKit/Complete/Landmarks/Landmarks/HexagonParameters.swift new file mode 100755 index 0000000..8decba4 --- /dev/null +++ b/Examples/InterfacingWithUIKit/Complete/Landmarks/Landmarks/HexagonParameters.swift @@ -0,0 +1,57 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +Size, position, and other information used to draw a badge. +*/ + +import SwiftUI + +struct HexagonParameters { + struct Segment { + let useWidth: (CGFloat, CGFloat, CGFloat) + let xFactors: (CGFloat, CGFloat, CGFloat) + let useHeight: (CGFloat, CGFloat, CGFloat) + let yFactors: (CGFloat, CGFloat, CGFloat) + } + + static let adjustment: CGFloat = 0.085 + static let points = [ + Segment( + useWidth: (1.00, 1.00, 1.00), + xFactors: (0.60, 0.40, 0.50), + useHeight: (1.00, 1.00, 0.00), + yFactors: (0.05, 0.05, 0.00) + ), + Segment( + useWidth: (1.00, 1.00, 0.00), + xFactors: (0.05, 0.00, 0.00), + useHeight: (1.00, 1.00, 1.00), + yFactors: (0.20 + adjustment, 0.30 + adjustment, 0.25 + adjustment) + ), + Segment( + useWidth: (1.00, 1.00, 0.00), + xFactors: (0.00, 0.05, 0.00), + useHeight: (1.00, 1.00, 1.00), + yFactors: (0.70 - adjustment, 0.80 - adjustment, 0.75 - adjustment) + ), + Segment( + useWidth: (1.00, 1.00, 1.00), + xFactors: (0.40, 0.60, 0.50), + useHeight: (1.00, 1.00, 1.00), + yFactors: (0.95, 0.95, 1.00) + ), + Segment( + useWidth: (1.00, 1.00, 1.00), + xFactors: (0.95, 1.00, 1.00), + useHeight: (1.00, 1.00, 1.00), + yFactors: (0.80 - adjustment, 0.70 - adjustment, 0.75 - adjustment) + ), + Segment( + useWidth: (1.00, 1.00, 1.00), + xFactors: (1.00, 0.95, 1.00), + useHeight: (1.00, 1.00, 1.00), + yFactors: (0.30 + adjustment, 0.20 + adjustment, 0.25 + adjustment) + ) + ] +} diff --git a/Examples/InterfacingWithUIKit/Complete/Landmarks/Landmarks/HikeBadge.swift b/Examples/InterfacingWithUIKit/Complete/Landmarks/Landmarks/HikeBadge.swift new file mode 100755 index 0000000..52716cf --- /dev/null +++ b/Examples/InterfacingWithUIKit/Complete/Landmarks/Landmarks/HikeBadge.swift @@ -0,0 +1,31 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +A view that shows a badge for hiking. +*/ + +import SwiftUI + +struct HikeBadge: View { + var name: String + var body: some View { + VStack(alignment: .center) { + Badge() + .frame(width: 300, height: 300) + .scaleEffect(1.0 / 3.0) + .frame(width: 100, height: 100) + Text(name) + .font(.caption) + .accessibility(label: Text("Badge for \(name).")) + } + } +} + +#if DEBUG +struct HikeBadge_Previews: PreviewProvider { + static var previews: some View { + HikeBadge(name: "Preview Testing") + } +} +#endif diff --git a/Examples/InterfacingWithUIKit/Complete/Landmarks/Landmarks/HikeDetail.swift b/Examples/InterfacingWithUIKit/Complete/Landmarks/Landmarks/HikeDetail.swift new file mode 100755 index 0000000..3406a6d --- /dev/null +++ b/Examples/InterfacingWithUIKit/Complete/Landmarks/Landmarks/HikeDetail.swift @@ -0,0 +1,49 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +A view showing the details for a hike. +*/ + +import SwiftUI + +struct HikeDetail: View { + let hike: Hike + @State var dataToShow = \Hike.Observation.elevation + + var buttons = [ + ("Elevation", \Hike.Observation.elevation), + ("Heart Rate", \Hike.Observation.heartRate), + ("Pace", \Hike.Observation.pace), + ] + + var body: some View { + return VStack { + HikeGraph(hike: hike, path: dataToShow) + .frame(height: 200, alignment: .center) + + HStack(spacing: 25) { + ForEach(buttons.identified(by: \.0)) { value in + Button(action: { + self.dataToShow = value.1 + }) { + Text(verbatim: value.0) + .font(.system(size: 15)) + .color(value.1 == self.dataToShow + ? Color.gray + : Color.accentColor) + .animation(nil) + } + } + } + } + } +} + +#if DEBUG +struct HikeDetail_Previews: PreviewProvider { + static var previews: some View { + HikeDetail(hike: hikeData[0]) + } +} +#endif diff --git a/Examples/InterfacingWithUIKit/Complete/Landmarks/Landmarks/HikeView.swift b/Examples/InterfacingWithUIKit/Complete/Landmarks/Landmarks/HikeView.swift new file mode 100755 index 0000000..f4c02cc --- /dev/null +++ b/Examples/InterfacingWithUIKit/Complete/Landmarks/Landmarks/HikeView.swift @@ -0,0 +1,68 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +A view displaying inforamtion about a hike, including an elevation graph. +*/ + +import SwiftUI + +struct HikeView: View { + var hike: Hike + @State private var showDetail = false + + var transition: AnyTransition { + let insertion = AnyTransition.move(edge: .trailing) + .combined(with: .opacity) + let removal = AnyTransition.scale() + .combined(with: .opacity) + return .asymmetric(insertion: insertion, removal: removal) + } + + var body: some View { + VStack { + HStack { + HikeGraph(hike: hike, path: \.elevation) + .frame(width: 50, height: 30) + .animation(nil) + + VStack(alignment: .leading) { + Text(verbatim: hike.name) + .font(.headline) + Text(verbatim: hike.distanceText) + } + + Spacer() + + Button(action: { + withAnimation { + self.showDetail.toggle() + } + }) { + Image(systemName: "chevron.right.circle") + .imageScale(.large) + .rotationEffect(.degrees(showDetail ? 90 : 0)) + .scaleEffect(showDetail ? 1.5 : 1) + .padding() + } + } + + if showDetail { + HikeDetail(hike: hike) + .transition(transition) + } + } + } +} + +#if DEBUG +struct HikeView_Previews: PreviewProvider { + static var previews: some View { + VStack { + HikeView(hike: hikeData[0]) + .padding() + Spacer() + } + } +} +#endif diff --git a/Examples/InterfacingWithUIKit/Complete/Landmarks/Landmarks/Home.swift b/Examples/InterfacingWithUIKit/Complete/Landmarks/Landmarks/Home.swift new file mode 100755 index 0000000..5237246 --- /dev/null +++ b/Examples/InterfacingWithUIKit/Complete/Landmarks/Landmarks/Home.swift @@ -0,0 +1,67 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +A view showing featured landmarks above a list of all of the landmarks. +*/ + +import SwiftUI + +struct CategoryHome: View { + var categories: [String: [Landmark]] { + .init( + grouping: landmarkData, + by: { $0.category.rawValue } + ) + } + + var featured: [Landmark] { + landmarkData.filter { $0.isFeatured } + } + + var body: some View { + NavigationView { + List { + FeaturedLandmarks(landmarks: featured) + .scaledToFill() + .frame(height: 200) + .clipped() + .listRowInsets(EdgeInsets()) + + ForEach(categories.keys.sorted().identified(by: \.self)) { key in + CategoryRow(categoryName: key, items: self.categories[key]!) + } + .listRowInsets(EdgeInsets()) + + NavigationButton(destination: LandmarkList()) { + Text("See All") + } + } + .navigationBarTitle(Text("Featured")) + .navigationBarItems(trailing: + PresentationButton( + Image(systemName: "person.crop.circle") + .imageScale(.large) + .accessibility(label: Text("User Profile")) + .padding(), + destination: ProfileHost() + ) + ) + } + } +} + +struct FeaturedLandmarks: View { + var landmarks: [Landmark] + var body: some View { + landmarks[0].image(forSize: 250).resizable() + } +} + +#if DEBUG +struct CategoryHome_Previews: PreviewProvider { + static var previews: some View { + CategoryHome() + } +} +#endif diff --git a/Examples/InterfacingWithUIKit/Complete/Landmarks/Landmarks/Info.plist b/Examples/InterfacingWithUIKit/Complete/Landmarks/Landmarks/Info.plist new file mode 100755 index 0000000..e8bb4c6 --- /dev/null +++ b/Examples/InterfacingWithUIKit/Complete/Landmarks/Landmarks/Info.plist @@ -0,0 +1,62 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + $(PRODUCT_BUNDLE_PACKAGE_TYPE) + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1 + LSRequiresIPhoneOS + + UIApplicationSceneManifest + + UIApplicationSupportsMultipleScenes + + UISceneConfigurations + + UIWindowSceneSessionRoleApplication + + + UILaunchStoryboardName + LaunchScreen + UISceneConfigurationName + Default Configuration + UISceneDelegateClassName + $(PRODUCT_MODULE_NAME).SceneDelegate + + + + + UILaunchStoryboardName + LaunchScreen + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/Examples/InterfacingWithUIKit/Complete/Landmarks/Landmarks/LandmarkDetail.swift b/Examples/InterfacingWithUIKit/Complete/Landmarks/Landmarks/LandmarkDetail.swift new file mode 100755 index 0000000..6c290a3 --- /dev/null +++ b/Examples/InterfacingWithUIKit/Complete/Landmarks/Landmarks/LandmarkDetail.swift @@ -0,0 +1,71 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +A view showing the details for a landmark. +*/ + +import SwiftUI + +struct LandmarkDetail: View { + @EnvironmentObject var userData: UserData + var landmark: Landmark + + var landmarkIndex: Int { + userData.landmarks.firstIndex(where: { $0.id == landmark.id })! + } + + var body: some View { + VStack { + MapView(coordinate: landmark.locationCoordinate) + .edgesIgnoringSafeArea(.top) + .frame(height: 300) + + CircleImage(image: landmark.image(forSize: 250)) + .offset(x: 0, y: -130) + .padding(.bottom, -130) + + VStack(alignment: .leading) { + HStack { + Text(verbatim: landmark.name) + .font(.title) + + Button(action: { + self.userData.landmarks[self.landmarkIndex] + .isFavorite.toggle() + }) { + if self.userData.landmarks[self.landmarkIndex] + .isFavorite { + Image(systemName: "star.fill") + .foregroundColor(Color.yellow) + } else { + Image(systemName: "star") + .foregroundColor(Color.gray) + } + } + } + + HStack(alignment: .top) { + Text(verbatim: landmark.park) + .font(.subheadline) + Spacer() + Text(verbatim: landmark.state) + .font(.subheadline) + } + } + .padding() + + Spacer() + } + } +} + +#if DEBUG +struct LandmarkDetail_Preview: PreviewProvider { + static var previews: some View { + let userData = UserData() + return LandmarkDetail(landmark: userData.landmarks[0]) + .environmentObject(userData) + } +} +#endif diff --git a/Examples/InterfacingWithUIKit/Complete/Landmarks/Landmarks/LandmarkList.swift b/Examples/InterfacingWithUIKit/Complete/Landmarks/Landmarks/LandmarkList.swift new file mode 100755 index 0000000..c17b5f3 --- /dev/null +++ b/Examples/InterfacingWithUIKit/Complete/Landmarks/Landmarks/LandmarkList.swift @@ -0,0 +1,45 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +A view showing a list of landmarks. +*/ + +import SwiftUI + +struct LandmarkList: View { + @EnvironmentObject private var userData: UserData + + var body: some View { + NavigationView { + List { + Toggle(isOn: $userData.showFavoritesOnly) { + Text("Show Favorites Only") + } + + ForEach(userData.landmarks) { landmark in + if !self.userData.showFavoritesOnly || landmark.isFavorite { + NavigationButton( + destination: LandmarkDetail(landmark: landmark)) { + LandmarkRow(landmark: landmark) + } + } + } + } + .navigationBarTitle(Text("Landmarks"), displayMode: .large) + } + } +} + +#if DEBUG +struct LandmarksList_Previews: PreviewProvider { + static var previews: some View { + ForEach(["iPhone SE", "iPhone XS Max"].identified(by: \.self)) { deviceName in + LandmarkList() + .previewDevice(PreviewDevice(rawValue: deviceName)) + .previewDisplayName(deviceName) + } + .environmentObject(UserData()) + } +} +#endif diff --git a/Examples/InterfacingWithUIKit/Complete/Landmarks/Landmarks/Models/Data.swift b/Examples/InterfacingWithUIKit/Complete/Landmarks/Landmarks/Models/Data.swift new file mode 100755 index 0000000..761ce0a --- /dev/null +++ b/Examples/InterfacingWithUIKit/Complete/Landmarks/Landmarks/Models/Data.swift @@ -0,0 +1,100 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +Helpers for loading images and data. +*/ + +import Foundation +import CoreLocation +import UIKit +import SwiftUI + +let landmarkData: [Landmark] = load("landmarkData.json") +let features = landmarkData.filter { $0.isFeatured } +let hikeData: [Hike] = load("hikeData.json") + +func load(_ filename: String, as type: T.Type = T.self) -> T { + let data: Data + + guard let file = Bundle.main.url(forResource: filename, withExtension: nil) + else { + fatalError("Couldn't find \(filename) in main bundle.") + } + + do { + data = try Data(contentsOf: file) + } catch { + fatalError("Couldn't load \(filename) from main bundle:\n\(error)") + } + + do { + let decoder = JSONDecoder() + return try decoder.decode(T.self, from: data) + } catch { + fatalError("Couldn't parse \(filename) as \(T.self):\n\(error)") + } +} + +final class ImageStore { + fileprivate typealias _ImageDictionary = [String: [Int: CGImage]] + fileprivate var images: _ImageDictionary = [:] + + fileprivate static var originalSize = 250 + fileprivate static var scale = 2 + + static var shared = ImageStore() + + func image(name: String, size: Int) -> Image { + let index = _guaranteeInitialImage(name: name) + + let sizedImage = images.values[index][size] + ?? _sizeImage(images.values[index][ImageStore.originalSize]!, to: size * ImageStore.scale) + images.values[index][size] = sizedImage + + return Image(sizedImage, scale: Length(ImageStore.scale), label: Text(verbatim: name)) + } + + static func loadImage(name: String) -> CGImage { + guard + let url = Bundle.main.url(forResource: name, withExtension: "jpg"), + let imageSource = CGImageSourceCreateWithURL(url as NSURL, nil), + let image = CGImageSourceCreateImageAtIndex(imageSource, 0, nil) + else { + fatalError("Couldn't load image \(name).jpg from main bundle.") + } + return image + } + + fileprivate func _guaranteeInitialImage(name: String) -> _ImageDictionary.Index { + if let index = images.index(forKey: name) { return index } + + let image = ImageStore.loadImage(name: name) + images[name] = [ImageStore.originalSize: image] + return images.index(forKey: name)! + } + + fileprivate func _sizeImage(_ image: CGImage, to size: Int) -> CGImage { + guard + let colorSpace = image.colorSpace, + let context = CGContext( + data: nil, + width: size, height: size, + bitsPerComponent: image.bitsPerComponent, + bytesPerRow: image.bytesPerRow, + space: colorSpace, + bitmapInfo: image.bitmapInfo.rawValue) + else { + fatalError("Couldn't create graphics context.") + } + context.interpolationQuality = .high + context.draw(image, in: CGRect(x: 0, y: 0, width: size, height: size)) + + if let sizedImage = context.makeImage() { + return sizedImage + } else { + fatalError("Couldn't resize image.") + } + } +} + diff --git a/Examples/InterfacingWithUIKit/Complete/Landmarks/Landmarks/Models/Hike.swift b/Examples/InterfacingWithUIKit/Complete/Landmarks/Landmarks/Models/Hike.swift new file mode 100755 index 0000000..dfd2bb8 --- /dev/null +++ b/Examples/InterfacingWithUIKit/Complete/Landmarks/Landmarks/Models/Hike.swift @@ -0,0 +1,31 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +The model for a hike. +*/ + +import SwiftUI + +struct Hike: Codable, Hashable, Identifiable { + var name: String + var id: Int + var distance: Double + var difficulty: Int + var observations: [Observation] + + static var formatter = LengthFormatter() + + var distanceText: String { + return Hike.formatter + .string(fromValue: distance, unit: .kilometer) + } + + struct Observation: Codable, Hashable { + var distanceFromStart: Double + + var elevation: Range + var pace: Range + var heartRate: Range + } +} diff --git a/Examples/InterfacingWithUIKit/Complete/Landmarks/Landmarks/Models/Landmark.swift b/Examples/InterfacingWithUIKit/Complete/Landmarks/Landmarks/Models/Landmark.swift new file mode 100755 index 0000000..fafe700 --- /dev/null +++ b/Examples/InterfacingWithUIKit/Complete/Landmarks/Landmarks/Models/Landmark.swift @@ -0,0 +1,52 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +The model for an individual landmark. +*/ + +import SwiftUI +import CoreLocation + +struct Landmark: Hashable, Codable, Identifiable { + var id: Int + var name: String + fileprivate var imageName: String + fileprivate var coordinates: Coordinates + var state: String + var park: String + var category: Category + var isFavorite: Bool + var isFeatured: Bool + + var locationCoordinate: CLLocationCoordinate2D { + CLLocationCoordinate2D( + latitude: coordinates.latitude, + longitude: coordinates.longitude) + } + + var featureImage: Image? { + guard isFeatured else { return nil } + + return Image( + ImageStore.loadImage(name: "\(imageName)_feature"), + scale: 2, + label: Text(verbatim: name)) + } + + func image(forSize size: Int) -> Image { + ImageStore.shared.image(name: imageName, size: size) + } + + enum Category: String, CaseIterable, Codable, Hashable { + case featured = "Featured" + case lakes = "Lakes" + case rivers = "Rivers" + case mountains = "Mountains" + } +} + +struct Coordinates: Hashable, Codable { + var latitude: Double + var longitude: Double +} diff --git a/Examples/InterfacingWithUIKit/Complete/Landmarks/Landmarks/Models/Profile.swift b/Examples/InterfacingWithUIKit/Complete/Landmarks/Landmarks/Models/Profile.swift new file mode 100755 index 0000000..7c30519 --- /dev/null +++ b/Examples/InterfacingWithUIKit/Complete/Landmarks/Landmarks/Models/Profile.swift @@ -0,0 +1,30 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +An object that models a user profile. +*/ +import Foundation + +struct Profile { + var username: String + var prefersNotifications: Bool + var seasonalPhoto: Season + var goalDate: Date + + static let `default` = Self(username: "g_kumar", prefersNotifications: true, seasonalPhoto: .winter) + + init(username: String, prefersNotifications: Bool = true, seasonalPhoto: Season = .winter) { + self.username = username + self.prefersNotifications = prefersNotifications + self.seasonalPhoto = seasonalPhoto + self.goalDate = Date() + } + + enum Season: String, CaseIterable { + case spring = "🌷" + case summer = "🌞" + case autumn = "🍂" + case winter = "☃️" + } +} diff --git a/Examples/InterfacingWithUIKit/Complete/Landmarks/Landmarks/Models/UserData.swift b/Examples/InterfacingWithUIKit/Complete/Landmarks/Landmarks/Models/UserData.swift new file mode 100755 index 0000000..db31fb0 --- /dev/null +++ b/Examples/InterfacingWithUIKit/Complete/Landmarks/Landmarks/Models/UserData.swift @@ -0,0 +1,25 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +A model object that stores app data. +*/ + +import Combine +import SwiftUI + +final class UserData: BindableObject { + let didChange = PassthroughSubject() + + var showFavoritesOnly = false { + didSet { + didChange.send(self) + } + } + + var landmarks = landmarkData { + didSet { + didChange.send(self) + } + } +} diff --git a/Examples/InterfacingWithUIKit/Complete/Landmarks/Landmarks/PageControl.swift b/Examples/InterfacingWithUIKit/Complete/Landmarks/Landmarks/PageControl.swift new file mode 100755 index 0000000..40c3259 --- /dev/null +++ b/Examples/InterfacingWithUIKit/Complete/Landmarks/Landmarks/PageControl.swift @@ -0,0 +1,47 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +A view wrapping a UIPageControl. +*/ + +import SwiftUI + +import UIKit + +struct PageControl: UIViewRepresentable { + var numberOfPages: Int + @Binding var currentPage: Int + + func makeCoordinator() -> Coordinator { + Coordinator(self) + } + + func makeUIView(context: Context) -> UIPageControl { + let control = UIPageControl() + control.numberOfPages = numberOfPages + control.addTarget( + context.coordinator, + action: #selector(Coordinator.updateCurrentPage(sender:)), + for: .valueChanged) + + return control + } + + func updateUIView(_ uiView: UIPageControl, context: Context) { + uiView.currentPage = currentPage + } + + class Coordinator: NSObject { + var control: PageControl + + init(_ control: PageControl) { + self.control = control + } + + @objc + func updateCurrentPage(sender: UIPageControl) { + control.currentPage = sender.currentPage + } + } +} diff --git a/Examples/InterfacingWithUIKit/Complete/Landmarks/Landmarks/PageView.swift b/Examples/InterfacingWithUIKit/Complete/Landmarks/Landmarks/PageView.swift new file mode 100755 index 0000000..16e1f00 --- /dev/null +++ b/Examples/InterfacingWithUIKit/Complete/Landmarks/Landmarks/PageView.swift @@ -0,0 +1,33 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +A view for bridging a UIPageViewController. +*/ + +import SwiftUI + +struct PageView: View { + var viewControllers: [UIHostingController] + @State var currentPage = 0 + + init(_ views: [Page]) { + self.viewControllers = views.map { UIHostingController(rootView: $0) } + } + + var body: some View { + ZStack(alignment: .bottomTrailing) { + PageViewController(controllers: viewControllers, currentPage: $currentPage) + PageControl(numberOfPages: viewControllers.count, currentPage: $currentPage) + .padding(.trailing) + } + } +} + +#if DEBUG +struct PageView_Previews: PreviewProvider { + static var previews: some View { + PageView(features.map { FeatureCard(landmark: $0) }) + } +} +#endif diff --git a/Examples/InterfacingWithUIKit/Complete/Landmarks/Landmarks/PageViewController.swift b/Examples/InterfacingWithUIKit/Complete/Landmarks/Landmarks/PageViewController.swift new file mode 100755 index 0000000..a9410cb --- /dev/null +++ b/Examples/InterfacingWithUIKit/Complete/Landmarks/Landmarks/PageViewController.swift @@ -0,0 +1,73 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +A view that wraps a UIPageViewController. +*/ + +import SwiftUI +import UIKit + +struct PageViewController: UIViewControllerRepresentable { + var controllers: [UIViewController] + @Binding var currentPage: Int + + func makeCoordinator() -> Coordinator { + Coordinator(self) + } + + func makeUIViewController(context: Context) -> UIPageViewController { + let pageViewController = UIPageViewController( + transitionStyle: .scroll, + navigationOrientation: .horizontal) + pageViewController.dataSource = context.coordinator + pageViewController.delegate = context.coordinator + + return pageViewController + } + + func updateUIViewController(_ pageViewController: UIPageViewController, context: Context) { + pageViewController.setViewControllers( + [controllers[currentPage]], direction: .forward, animated: true) + } + + class Coordinator: NSObject, UIPageViewControllerDataSource, UIPageViewControllerDelegate { + var parent: PageViewController + + init(_ pageViewController: PageViewController) { + self.parent = pageViewController + } + + func pageViewController( + _ pageViewController: UIPageViewController, + viewControllerBefore viewController: UIViewController) -> UIViewController? { + guard let index = parent.controllers.firstIndex(of: viewController) else { + return nil + } + if index == 0 { + return parent.controllers.last + } + return parent.controllers[index - 1] + } + + func pageViewController( + _ pageViewController: UIPageViewController, + viewControllerAfter viewController: UIViewController) -> UIViewController? { + guard let index = parent.controllers.firstIndex(of: viewController) else { + return nil + } + if index + 1 == parent.controllers.count { + return parent.controllers.first + } + return parent.controllers[index + 1] + } + + func pageViewController(_ pageViewController: UIPageViewController, didFinishAnimating finished: Bool, previousViewControllers: [UIViewController], transitionCompleted completed: Bool) { + if completed, + let visibleViewController = pageViewController.viewControllers?.first, + let index = parent.controllers.firstIndex(of: visibleViewController) { + parent.currentPage = index + } + } + } +} diff --git a/Examples/InterfacingWithUIKit/Complete/Landmarks/Landmarks/Preview Content/Preview Assets.xcassets/Contents.json b/Examples/InterfacingWithUIKit/Complete/Landmarks/Landmarks/Preview Content/Preview Assets.xcassets/Contents.json new file mode 100755 index 0000000..da4a164 --- /dev/null +++ b/Examples/InterfacingWithUIKit/Complete/Landmarks/Landmarks/Preview Content/Preview Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Examples/InterfacingWithUIKit/Complete/Landmarks/Landmarks/Profiles/ProfileEditor.swift b/Examples/InterfacingWithUIKit/Complete/Landmarks/Landmarks/Profiles/ProfileEditor.swift new file mode 100755 index 0000000..ca4cdda --- /dev/null +++ b/Examples/InterfacingWithUIKit/Complete/Landmarks/Landmarks/Profiles/ProfileEditor.swift @@ -0,0 +1,56 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +An editable profile view. +*/ + +import SwiftUI + +struct ProfileEditor: View { + @Binding var profile: Profile + + var body: some View { + List { + HStack { + Text("Username").bold() + Divider() + TextField($profile.username) + } + + Toggle(isOn: $profile.prefersNotifications) { + Text("Enable Notifications") + } + + VStack(alignment: .leading, spacing: 20) { + Text("Seasonal Photo").bold() + + SegmentedControl(selection: $profile.seasonalPhoto) { + ForEach(Profile.Season.allCases.identified(by: \.self)) { season in + Text(season.rawValue).tag(season) + } + } + } + .padding(.top) + + VStack(alignment: .leading, spacing: 20) { + Text("Goal Date").bold() + DatePicker( + $profile.goalDate, + minimumDate: Calendar.current.date(byAdding: .year, value: -1, to: profile.goalDate), + maximumDate: Calendar.current.date(byAdding: .year, value: 1, to: profile.goalDate), + displayedComponents: .date + ) + } + .padding(.top) + } + } +} + +#if DEBUG +struct ProfileEditor_Previews: PreviewProvider { + static var previews: some View { + ProfileEditor(profile: .constant(.default)) + } +} +#endif diff --git a/Examples/InterfacingWithUIKit/Complete/Landmarks/Landmarks/Profiles/ProfileHost.swift b/Examples/InterfacingWithUIKit/Complete/Landmarks/Landmarks/Profiles/ProfileHost.swift new file mode 100755 index 0000000..534c771 --- /dev/null +++ b/Examples/InterfacingWithUIKit/Complete/Landmarks/Landmarks/Profiles/ProfileHost.swift @@ -0,0 +1,50 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +A view that hosts the profile viewer and editor. +*/ + +import SwiftUI + +struct ProfileHost: View { + @Environment(\.editMode) var mode + @State var profile = Profile.default + @State var draftProfile = Profile.default + + var body: some View { + VStack(alignment: .leading, spacing: 20) { + HStack { + if self.mode?.value == .active { + Button(action: { + self.profile = self.draftProfile + self.mode?.animation().value = .inactive + }) { + Text("Done") + } + } + + Spacer() + + EditButton() + } + if self.mode?.value == .inactive { + ProfileSummary(profile: profile) + } else { + ProfileEditor(profile: $draftProfile) + .onDisappear { + self.draftProfile = self.profile + } + } + } + .padding() + } +} + +#if DEBUG +struct ProfileHost_Previews: PreviewProvider { + static var previews: some View { + ProfileHost() + } +} +#endif diff --git a/Examples/InterfacingWithUIKit/Complete/Landmarks/Landmarks/Profiles/ProfileSummary.swift b/Examples/InterfacingWithUIKit/Complete/Landmarks/Landmarks/Profiles/ProfileSummary.swift new file mode 100755 index 0000000..6d31231 --- /dev/null +++ b/Examples/InterfacingWithUIKit/Complete/Landmarks/Landmarks/Profiles/ProfileSummary.swift @@ -0,0 +1,65 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +A view that summarizes a profile. +*/ + +import SwiftUI + +struct ProfileSummary: View { + var profile: Profile + + static var goalFormat: DateFormatter { + let formatter = DateFormatter() + formatter.dateFormat = "MMMM d, yyyy" + return formatter + } + + var body: some View { + List { + Text(profile.username) + .bold() + .font(.title) + + Text("Notifications: \(self.profile.prefersNotifications ? "On": "Off" )") + + Text("Seasonal Photos: \(self.profile.seasonalPhoto.rawValue)") + + Text("Goal Date: \(self.profile.goalDate, formatter: Self.goalFormat)") + + VStack(alignment: .leading) { + Text("Completed Badges") + .font(.headline) + ScrollView { + HStack { + HikeBadge(name: "First Hike") + + HikeBadge(name: "Earth Day") + .hueRotation(Angle(degrees: 90)) + + HikeBadge(name: "Tenth Hike") + .grayscale(0.5) + .hueRotation(Angle(degrees: 45)) + } + } + .frame(height: 140) + } + + VStack(alignment: .leading) { + Text("Recent Hikes") + .font(.headline) + + HikeView(hike: hikeData[0]) + } + } + } +} + +#if DEBUG +struct ProfileSummary_Previews: PreviewProvider { + static var previews: some View { + ProfileSummary(profile: Profile.default) + } +} +#endif diff --git a/Examples/InterfacingWithUIKit/Complete/Landmarks/Landmarks/Resources/charleyrivers.jpg b/Examples/InterfacingWithUIKit/Complete/Landmarks/Landmarks/Resources/charleyrivers.jpg new file mode 100755 index 0000000..17ff44b Binary files /dev/null and b/Examples/InterfacingWithUIKit/Complete/Landmarks/Landmarks/Resources/charleyrivers.jpg differ diff --git a/Examples/InterfacingWithUIKit/Complete/Landmarks/Landmarks/Resources/charleyrivers_feature.jpg b/Examples/InterfacingWithUIKit/Complete/Landmarks/Landmarks/Resources/charleyrivers_feature.jpg new file mode 100755 index 0000000..af1d114 Binary files /dev/null and b/Examples/InterfacingWithUIKit/Complete/Landmarks/Landmarks/Resources/charleyrivers_feature.jpg differ diff --git a/Examples/InterfacingWithUIKit/Complete/Landmarks/Landmarks/Resources/chilkoottrail.jpg b/Examples/InterfacingWithUIKit/Complete/Landmarks/Landmarks/Resources/chilkoottrail.jpg new file mode 100755 index 0000000..e7f805e Binary files /dev/null and b/Examples/InterfacingWithUIKit/Complete/Landmarks/Landmarks/Resources/chilkoottrail.jpg differ diff --git a/Examples/InterfacingWithUIKit/Complete/Landmarks/Landmarks/Resources/chincoteague.jpg b/Examples/InterfacingWithUIKit/Complete/Landmarks/Landmarks/Resources/chincoteague.jpg new file mode 100755 index 0000000..5f47986 Binary files /dev/null and b/Examples/InterfacingWithUIKit/Complete/Landmarks/Landmarks/Resources/chincoteague.jpg differ diff --git a/Examples/InterfacingWithUIKit/Complete/Landmarks/Landmarks/Resources/hiddenlake.jpg b/Examples/InterfacingWithUIKit/Complete/Landmarks/Landmarks/Resources/hiddenlake.jpg new file mode 100755 index 0000000..d8e804c Binary files /dev/null and b/Examples/InterfacingWithUIKit/Complete/Landmarks/Landmarks/Resources/hiddenlake.jpg differ diff --git a/Examples/InterfacingWithUIKit/Complete/Landmarks/Landmarks/Resources/hikeData.json b/Examples/InterfacingWithUIKit/Complete/Landmarks/Landmarks/Resources/hikeData.json new file mode 100755 index 0000000..3fb1e96 --- /dev/null +++ b/Examples/InterfacingWithUIKit/Complete/Landmarks/Landmarks/Resources/hikeData.json @@ -0,0 +1,1882 @@ +[ + { + "name":"Lonesome Ridge Trail", + "id":1001, + "distance":4.5, + "difficulty":3, + "observations":[ + { + "elevation":[ + 291.65263635636268, + 309.26016677925196 + ], + "pace":[ + 396.08716481908732, + 403.68937873525232 + ], + "heartRate":[ + 117.16351898665887, + 121.95815455919609 + ], + "distanceFromStart":0 + }, + { + "elevation":[ + 299.24001936628116, + 317.44584350790012 + ], + "pace":[ + 380.19020240756623, + 395.3978319010256 + ], + "heartRate":[ + 117.6410892152911, + 124.82185220506081 + ], + "distanceFromStart":0.375 + }, + { + "elevation":[ + 303.62145464574394, + 336.05569457646544 + ], + "pace":[ + 380.55927782266116, + 397.60789726832775 + ], + "heartRate":[ + 121.52696452049059, + 127.31525441110122 + ], + "distanceFromStart":0.75 + }, + { + "elevation":[ + 319.90393365162629, + 346.26966025518789 + ], + "pace":[ + 357.94116421258531, + 398.0750288648062 + ], + "heartRate":[ + 123.75908585923588, + 132.77069404486801 + ], + "distanceFromStart":1.125 + }, + { + "elevation":[ + 354.17104439267905, + 403.57031216972939 + ], + "pace":[ + 335.07385149392701, + 397.82674381875808 + ], + "heartRate":[ + 130.8235194572915, + 140.55700591418218 + ], + "distanceFromStart":1.5 + }, + { + "elevation":[ + 357.42992871175124, + 385.92155620623635 + ], + "pace":[ + 395.16168913839374, + 404.60294066527558 + ], + "heartRate":[ + 131.5456052446734, + 134.65984504627627 + ], + "distanceFromStart":1.875 + }, + { + "elevation":[ + 345.47736721935661, + 363.18776661379422 + ], + "pace":[ + 340.82303041339082, + 404.71689228682374 + ], + "heartRate":[ + 125.1949698433959, + 131.31354363122026 + ], + "distanceFromStart":2.25 + }, + { + "elevation":[ + 346.23343025200535, + 497.23376445462401 + ], + "pace":[ + 261.27629148816021, + 331.68516208719467 + ], + "heartRate":[ + 131.67810544238606, + 154.26779645311458 + ], + "distanceFromStart":2.625 + }, + { + "elevation":[ + 491.57378483134391, + 547.49535224251053 + ], + "pace":[ + 296.05298644112088, + 401.14092967732398 + ], + "heartRate":[ + 151.36398089694217, + 166.20454793289232 + ], + "distanceFromStart":3 + }, + { + "elevation":[ + 472.06803233416338, + 531.92570520228401 + ], + "pace":[ + 395.50830663514012, + 401.67837917543591 + ], + "heartRate":[ + 134.41798110234078, + 151.90886697564241 + ], + "distanceFromStart":3.375 + }, + { + "elevation":[ + 339.81419476005283, + 461.03832527824829 + ], + "pace":[ + 395.31160487975183, + 404.49550455974907 + ], + "heartRate":[ + 129.97753472415462, + 138.13531094848992 + ], + "distanceFromStart":3.75 + }, + { + "elevation":[ + 303.1495508565697, + 342.3532820173541 + ], + "pace":[ + 395.02844559698116, + 402.65878340653796 + ], + "heartRate":[ + 127.72304232462609, + 133.26322270764186 + ], + "distanceFromStart":4.125 + } + ] + }, + { + "name":"Lonesome Ridge Trail", + "id":1002, + "distance":4.5, + "difficulty":3, + "observations":[ + { + "elevation":[ + 291.65263635636268, + 309.26016677925196 + ], + "pace":[ + 396.08716481908732, + 403.68937873525232 + ], + "heartRate":[ + 117.16351898665887, + 121.95815455919609 + ], + "distanceFromStart":0 + }, + { + "elevation":[ + 299.24001936628116, + 317.44584350790012 + ], + "pace":[ + 380.19020240756623, + 395.3978319010256 + ], + "heartRate":[ + 117.6410892152911, + 124.82185220506081 + ], + "distanceFromStart":0.375 + }, + { + "elevation":[ + 303.62145464574394, + 336.05569457646544 + ], + "pace":[ + 380.55927782266116, + 397.60789726832775 + ], + "heartRate":[ + 121.52696452049059, + 127.31525441110122 + ], + "distanceFromStart":0.75 + }, + { + "elevation":[ + 319.90393365162629, + 346.26966025518789 + ], + "pace":[ + 357.94116421258531, + 398.0750288648062 + ], + "heartRate":[ + 123.75908585923588, + 132.77069404486801 + ], + "distanceFromStart":1.125 + }, + { + "elevation":[ + 354.17104439267905, + 403.57031216972939 + ], + "pace":[ + 335.07385149392701, + 397.82674381875808 + ], + "heartRate":[ + 130.8235194572915, + 140.55700591418218 + ], + "distanceFromStart":1.5 + }, + { + "elevation":[ + 357.42992871175124, + 385.92155620623635 + ], + "pace":[ + 395.16168913839374, + 404.60294066527558 + ], + "heartRate":[ + 131.5456052446734, + 134.65984504627627 + ], + "distanceFromStart":1.875 + }, + { + "elevation":[ + 345.47736721935661, + 363.18776661379422 + ], + "pace":[ + 340.82303041339082, + 404.71689228682374 + ], + "heartRate":[ + 125.1949698433959, + 131.31354363122026 + ], + "distanceFromStart":2.25 + }, + { + "elevation":[ + 346.23343025200535, + 497.23376445462401 + ], + "pace":[ + 261.27629148816021, + 331.68516208719467 + ], + "heartRate":[ + 131.67810544238606, + 154.26779645311458 + ], + "distanceFromStart":2.625 + }, + { + "elevation":[ + 491.57378483134391, + 547.49535224251053 + ], + "pace":[ + 296.05298644112088, + 401.14092967732398 + ], + "heartRate":[ + 151.36398089694217, + 166.20454793289232 + ], + "distanceFromStart":3 + }, + { + "elevation":[ + 472.06803233416338, + 531.92570520228401 + ], + "pace":[ + 395.50830663514012, + 401.67837917543591 + ], + "heartRate":[ + 134.41798110234078, + 151.90886697564241 + ], + "distanceFromStart":3.375 + }, + { + "elevation":[ + 339.81419476005283, + 461.03832527824829 + ], + "pace":[ + 395.31160487975183, + 404.49550455974907 + ], + "heartRate":[ + 129.97753472415462, + 138.13531094848992 + ], + "distanceFromStart":3.75 + }, + { + "elevation":[ + 303.1495508565697, + 342.3532820173541 + ], + "pace":[ + 395.02844559698116, + 402.65878340653796 + ], + "heartRate":[ + 127.72304232462609, + 133.26322270764186 + ], + "distanceFromStart":4.125 + } + ] + }, + { + "name":"Lonesome Ridge Trail", + "id":1003, + "distance":4.5, + "difficulty":3, + "observations":[ + { + "elevation":[ + 291.65263635636268, + 309.26016677925196 + ], + "pace":[ + 396.08716481908732, + 403.68937873525232 + ], + "heartRate":[ + 117.16351898665887, + 121.95815455919609 + ], + "distanceFromStart":0 + }, + { + "elevation":[ + 299.24001936628116, + 317.44584350790012 + ], + "pace":[ + 380.19020240756623, + 395.3978319010256 + ], + "heartRate":[ + 117.6410892152911, + 124.82185220506081 + ], + "distanceFromStart":0.375 + }, + { + "elevation":[ + 303.62145464574394, + 336.05569457646544 + ], + "pace":[ + 380.55927782266116, + 397.60789726832775 + ], + "heartRate":[ + 121.52696452049059, + 127.31525441110122 + ], + "distanceFromStart":0.75 + }, + { + "elevation":[ + 319.90393365162629, + 346.26966025518789 + ], + "pace":[ + 357.94116421258531, + 398.0750288648062 + ], + "heartRate":[ + 123.75908585923588, + 132.77069404486801 + ], + "distanceFromStart":1.125 + }, + { + "elevation":[ + 354.17104439267905, + 403.57031216972939 + ], + "pace":[ + 335.07385149392701, + 397.82674381875808 + ], + "heartRate":[ + 130.8235194572915, + 140.55700591418218 + ], + "distanceFromStart":1.5 + }, + { + "elevation":[ + 357.42992871175124, + 385.92155620623635 + ], + "pace":[ + 395.16168913839374, + 404.60294066527558 + ], + "heartRate":[ + 131.5456052446734, + 134.65984504627627 + ], + "distanceFromStart":1.875 + }, + { + "elevation":[ + 345.47736721935661, + 363.18776661379422 + ], + "pace":[ + 340.82303041339082, + 404.71689228682374 + ], + "heartRate":[ + 125.1949698433959, + 131.31354363122026 + ], + "distanceFromStart":2.25 + }, + { + "elevation":[ + 346.23343025200535, + 497.23376445462401 + ], + "pace":[ + 261.27629148816021, + 331.68516208719467 + ], + "heartRate":[ + 131.67810544238606, + 154.26779645311458 + ], + "distanceFromStart":2.625 + }, + { + "elevation":[ + 491.57378483134391, + 547.49535224251053 + ], + "pace":[ + 296.05298644112088, + 401.14092967732398 + ], + "heartRate":[ + 151.36398089694217, + 166.20454793289232 + ], + "distanceFromStart":3 + }, + { + "elevation":[ + 472.06803233416338, + 531.92570520228401 + ], + "pace":[ + 395.50830663514012, + 401.67837917543591 + ], + "heartRate":[ + 134.41798110234078, + 151.90886697564241 + ], + "distanceFromStart":3.375 + }, + { + "elevation":[ + 339.81419476005283, + 461.03832527824829 + ], + "pace":[ + 395.31160487975183, + 404.49550455974907 + ], + "heartRate":[ + 129.97753472415462, + 138.13531094848992 + ], + "distanceFromStart":3.75 + }, + { + "elevation":[ + 303.1495508565697, + 342.3532820173541 + ], + "pace":[ + 395.02844559698116, + 402.65878340653796 + ], + "heartRate":[ + 127.72304232462609, + 133.26322270764186 + ], + "distanceFromStart":4.125 + } + ] + }, + { + "name":"Lonesome Ridge Trail", + "id":1004, + "distance":4.5, + "difficulty":3, + "observations":[ + { + "elevation":[ + 291.65263635636268, + 309.26016677925196 + ], + "pace":[ + 396.08716481908732, + 403.68937873525232 + ], + "heartRate":[ + 117.16351898665887, + 121.95815455919609 + ], + "distanceFromStart":0 + }, + { + "elevation":[ + 299.24001936628116, + 317.44584350790012 + ], + "pace":[ + 380.19020240756623, + 395.3978319010256 + ], + "heartRate":[ + 117.6410892152911, + 124.82185220506081 + ], + "distanceFromStart":0.375 + }, + { + "elevation":[ + 303.62145464574394, + 336.05569457646544 + ], + "pace":[ + 380.55927782266116, + 397.60789726832775 + ], + "heartRate":[ + 121.52696452049059, + 127.31525441110122 + ], + "distanceFromStart":0.75 + }, + { + "elevation":[ + 319.90393365162629, + 346.26966025518789 + ], + "pace":[ + 357.94116421258531, + 398.0750288648062 + ], + "heartRate":[ + 123.75908585923588, + 132.77069404486801 + ], + "distanceFromStart":1.125 + }, + { + "elevation":[ + 354.17104439267905, + 403.57031216972939 + ], + "pace":[ + 335.07385149392701, + 397.82674381875808 + ], + "heartRate":[ + 130.8235194572915, + 140.55700591418218 + ], + "distanceFromStart":1.5 + }, + { + "elevation":[ + 357.42992871175124, + 385.92155620623635 + ], + "pace":[ + 395.16168913839374, + 404.60294066527558 + ], + "heartRate":[ + 131.5456052446734, + 134.65984504627627 + ], + "distanceFromStart":1.875 + }, + { + "elevation":[ + 345.47736721935661, + 363.18776661379422 + ], + "pace":[ + 340.82303041339082, + 404.71689228682374 + ], + "heartRate":[ + 125.1949698433959, + 131.31354363122026 + ], + "distanceFromStart":2.25 + }, + { + "elevation":[ + 346.23343025200535, + 497.23376445462401 + ], + "pace":[ + 261.27629148816021, + 331.68516208719467 + ], + "heartRate":[ + 131.67810544238606, + 154.26779645311458 + ], + "distanceFromStart":2.625 + }, + { + "elevation":[ + 491.57378483134391, + 547.49535224251053 + ], + "pace":[ + 296.05298644112088, + 401.14092967732398 + ], + "heartRate":[ + 151.36398089694217, + 166.20454793289232 + ], + "distanceFromStart":3 + }, + { + "elevation":[ + 472.06803233416338, + 531.92570520228401 + ], + "pace":[ + 395.50830663514012, + 401.67837917543591 + ], + "heartRate":[ + 134.41798110234078, + 151.90886697564241 + ], + "distanceFromStart":3.375 + }, + { + "elevation":[ + 339.81419476005283, + 461.03832527824829 + ], + "pace":[ + 395.31160487975183, + 404.49550455974907 + ], + "heartRate":[ + 129.97753472415462, + 138.13531094848992 + ], + "distanceFromStart":3.75 + }, + { + "elevation":[ + 303.1495508565697, + 342.3532820173541 + ], + "pace":[ + 395.02844559698116, + 402.65878340653796 + ], + "heartRate":[ + 127.72304232462609, + 133.26322270764186 + ], + "distanceFromStart":4.125 + } + ] + }, + { + "name":"Lonesome Ridge Trail", + "id":1005, + "distance":4.5, + "difficulty":3, + "observations":[ + { + "elevation":[ + 291.65263635636268, + 309.26016677925196 + ], + "pace":[ + 396.08716481908732, + 403.68937873525232 + ], + "heartRate":[ + 117.16351898665887, + 121.95815455919609 + ], + "distanceFromStart":0 + }, + { + "elevation":[ + 299.24001936628116, + 317.44584350790012 + ], + "pace":[ + 380.19020240756623, + 395.3978319010256 + ], + "heartRate":[ + 117.6410892152911, + 124.82185220506081 + ], + "distanceFromStart":0.375 + }, + { + "elevation":[ + 303.62145464574394, + 336.05569457646544 + ], + "pace":[ + 380.55927782266116, + 397.60789726832775 + ], + "heartRate":[ + 121.52696452049059, + 127.31525441110122 + ], + "distanceFromStart":0.75 + }, + { + "elevation":[ + 319.90393365162629, + 346.26966025518789 + ], + "pace":[ + 357.94116421258531, + 398.0750288648062 + ], + "heartRate":[ + 123.75908585923588, + 132.77069404486801 + ], + "distanceFromStart":1.125 + }, + { + "elevation":[ + 354.17104439267905, + 403.57031216972939 + ], + "pace":[ + 335.07385149392701, + 397.82674381875808 + ], + "heartRate":[ + 130.8235194572915, + 140.55700591418218 + ], + "distanceFromStart":1.5 + }, + { + "elevation":[ + 357.42992871175124, + 385.92155620623635 + ], + "pace":[ + 395.16168913839374, + 404.60294066527558 + ], + "heartRate":[ + 131.5456052446734, + 134.65984504627627 + ], + "distanceFromStart":1.875 + }, + { + "elevation":[ + 345.47736721935661, + 363.18776661379422 + ], + "pace":[ + 340.82303041339082, + 404.71689228682374 + ], + "heartRate":[ + 125.1949698433959, + 131.31354363122026 + ], + "distanceFromStart":2.25 + }, + { + "elevation":[ + 346.23343025200535, + 497.23376445462401 + ], + "pace":[ + 261.27629148816021, + 331.68516208719467 + ], + "heartRate":[ + 131.67810544238606, + 154.26779645311458 + ], + "distanceFromStart":2.625 + }, + { + "elevation":[ + 491.57378483134391, + 547.49535224251053 + ], + "pace":[ + 296.05298644112088, + 401.14092967732398 + ], + "heartRate":[ + 151.36398089694217, + 166.20454793289232 + ], + "distanceFromStart":3 + }, + { + "elevation":[ + 472.06803233416338, + 531.92570520228401 + ], + "pace":[ + 395.50830663514012, + 401.67837917543591 + ], + "heartRate":[ + 134.41798110234078, + 151.90886697564241 + ], + "distanceFromStart":3.375 + }, + { + "elevation":[ + 339.81419476005283, + 461.03832527824829 + ], + "pace":[ + 395.31160487975183, + 404.49550455974907 + ], + "heartRate":[ + 129.97753472415462, + 138.13531094848992 + ], + "distanceFromStart":3.75 + }, + { + "elevation":[ + 303.1495508565697, + 342.3532820173541 + ], + "pace":[ + 395.02844559698116, + 402.65878340653796 + ], + "heartRate":[ + 127.72304232462609, + 133.26322270764186 + ], + "distanceFromStart":4.125 + } + ] + }, + { + "name":"Lonesome Ridge Trail", + "id":1006, + "distance":4.5, + "difficulty":3, + "observations":[ + { + "elevation":[ + 291.65263635636268, + 309.26016677925196 + ], + "pace":[ + 396.08716481908732, + 403.68937873525232 + ], + "heartRate":[ + 117.16351898665887, + 121.95815455919609 + ], + "distanceFromStart":0 + }, + { + "elevation":[ + 299.24001936628116, + 317.44584350790012 + ], + "pace":[ + 380.19020240756623, + 395.3978319010256 + ], + "heartRate":[ + 117.6410892152911, + 124.82185220506081 + ], + "distanceFromStart":0.375 + }, + { + "elevation":[ + 303.62145464574394, + 336.05569457646544 + ], + "pace":[ + 380.55927782266116, + 397.60789726832775 + ], + "heartRate":[ + 121.52696452049059, + 127.31525441110122 + ], + "distanceFromStart":0.75 + }, + { + "elevation":[ + 319.90393365162629, + 346.26966025518789 + ], + "pace":[ + 357.94116421258531, + 398.0750288648062 + ], + "heartRate":[ + 123.75908585923588, + 132.77069404486801 + ], + "distanceFromStart":1.125 + }, + { + "elevation":[ + 354.17104439267905, + 403.57031216972939 + ], + "pace":[ + 335.07385149392701, + 397.82674381875808 + ], + "heartRate":[ + 130.8235194572915, + 140.55700591418218 + ], + "distanceFromStart":1.5 + }, + { + "elevation":[ + 357.42992871175124, + 385.92155620623635 + ], + "pace":[ + 395.16168913839374, + 404.60294066527558 + ], + "heartRate":[ + 131.5456052446734, + 134.65984504627627 + ], + "distanceFromStart":1.875 + }, + { + "elevation":[ + 345.47736721935661, + 363.18776661379422 + ], + "pace":[ + 340.82303041339082, + 404.71689228682374 + ], + "heartRate":[ + 125.1949698433959, + 131.31354363122026 + ], + "distanceFromStart":2.25 + }, + { + "elevation":[ + 346.23343025200535, + 497.23376445462401 + ], + "pace":[ + 261.27629148816021, + 331.68516208719467 + ], + "heartRate":[ + 131.67810544238606, + 154.26779645311458 + ], + "distanceFromStart":2.625 + }, + { + "elevation":[ + 491.57378483134391, + 547.49535224251053 + ], + "pace":[ + 296.05298644112088, + 401.14092967732398 + ], + "heartRate":[ + 151.36398089694217, + 166.20454793289232 + ], + "distanceFromStart":3 + }, + { + "elevation":[ + 472.06803233416338, + 531.92570520228401 + ], + "pace":[ + 395.50830663514012, + 401.67837917543591 + ], + "heartRate":[ + 134.41798110234078, + 151.90886697564241 + ], + "distanceFromStart":3.375 + }, + { + "elevation":[ + 339.81419476005283, + 461.03832527824829 + ], + "pace":[ + 395.31160487975183, + 404.49550455974907 + ], + "heartRate":[ + 129.97753472415462, + 138.13531094848992 + ], + "distanceFromStart":3.75 + }, + { + "elevation":[ + 303.1495508565697, + 342.3532820173541 + ], + "pace":[ + 395.02844559698116, + 402.65878340653796 + ], + "heartRate":[ + 127.72304232462609, + 133.26322270764186 + ], + "distanceFromStart":4.125 + } + ] + }, + { + "name":"Lonesome Ridge Trail", + "id":1007, + "distance":4.5, + "difficulty":3, + "observations":[ + { + "elevation":[ + 291.65263635636268, + 309.26016677925196 + ], + "pace":[ + 396.08716481908732, + 403.68937873525232 + ], + "heartRate":[ + 117.16351898665887, + 121.95815455919609 + ], + "distanceFromStart":0 + }, + { + "elevation":[ + 299.24001936628116, + 317.44584350790012 + ], + "pace":[ + 380.19020240756623, + 395.3978319010256 + ], + "heartRate":[ + 117.6410892152911, + 124.82185220506081 + ], + "distanceFromStart":0.375 + }, + { + "elevation":[ + 303.62145464574394, + 336.05569457646544 + ], + "pace":[ + 380.55927782266116, + 397.60789726832775 + ], + "heartRate":[ + 121.52696452049059, + 127.31525441110122 + ], + "distanceFromStart":0.75 + }, + { + "elevation":[ + 319.90393365162629, + 346.26966025518789 + ], + "pace":[ + 357.94116421258531, + 398.0750288648062 + ], + "heartRate":[ + 123.75908585923588, + 132.77069404486801 + ], + "distanceFromStart":1.125 + }, + { + "elevation":[ + 354.17104439267905, + 403.57031216972939 + ], + "pace":[ + 335.07385149392701, + 397.82674381875808 + ], + "heartRate":[ + 130.8235194572915, + 140.55700591418218 + ], + "distanceFromStart":1.5 + }, + { + "elevation":[ + 357.42992871175124, + 385.92155620623635 + ], + "pace":[ + 395.16168913839374, + 404.60294066527558 + ], + "heartRate":[ + 131.5456052446734, + 134.65984504627627 + ], + "distanceFromStart":1.875 + }, + { + "elevation":[ + 345.47736721935661, + 363.18776661379422 + ], + "pace":[ + 340.82303041339082, + 404.71689228682374 + ], + "heartRate":[ + 125.1949698433959, + 131.31354363122026 + ], + "distanceFromStart":2.25 + }, + { + "elevation":[ + 346.23343025200535, + 497.23376445462401 + ], + "pace":[ + 261.27629148816021, + 331.68516208719467 + ], + "heartRate":[ + 131.67810544238606, + 154.26779645311458 + ], + "distanceFromStart":2.625 + }, + { + "elevation":[ + 491.57378483134391, + 547.49535224251053 + ], + "pace":[ + 296.05298644112088, + 401.14092967732398 + ], + "heartRate":[ + 151.36398089694217, + 166.20454793289232 + ], + "distanceFromStart":3 + }, + { + "elevation":[ + 472.06803233416338, + 531.92570520228401 + ], + "pace":[ + 395.50830663514012, + 401.67837917543591 + ], + "heartRate":[ + 134.41798110234078, + 151.90886697564241 + ], + "distanceFromStart":3.375 + }, + { + "elevation":[ + 339.81419476005283, + 461.03832527824829 + ], + "pace":[ + 395.31160487975183, + 404.49550455974907 + ], + "heartRate":[ + 129.97753472415462, + 138.13531094848992 + ], + "distanceFromStart":3.75 + }, + { + "elevation":[ + 303.1495508565697, + 342.3532820173541 + ], + "pace":[ + 395.02844559698116, + 402.65878340653796 + ], + "heartRate":[ + 127.72304232462609, + 133.26322270764186 + ], + "distanceFromStart":4.125 + } + ] + }, + { + "name":"Lonesome Ridge Trail", + "id":1008, + "distance":4.5, + "difficulty":3, + "observations":[ + { + "elevation":[ + 291.65263635636268, + 309.26016677925196 + ], + "pace":[ + 396.08716481908732, + 403.68937873525232 + ], + "heartRate":[ + 117.16351898665887, + 121.95815455919609 + ], + "distanceFromStart":0 + }, + { + "elevation":[ + 299.24001936628116, + 317.44584350790012 + ], + "pace":[ + 380.19020240756623, + 395.3978319010256 + ], + "heartRate":[ + 117.6410892152911, + 124.82185220506081 + ], + "distanceFromStart":0.375 + }, + { + "elevation":[ + 303.62145464574394, + 336.05569457646544 + ], + "pace":[ + 380.55927782266116, + 397.60789726832775 + ], + "heartRate":[ + 121.52696452049059, + 127.31525441110122 + ], + "distanceFromStart":0.75 + }, + { + "elevation":[ + 319.90393365162629, + 346.26966025518789 + ], + "pace":[ + 357.94116421258531, + 398.0750288648062 + ], + "heartRate":[ + 123.75908585923588, + 132.77069404486801 + ], + "distanceFromStart":1.125 + }, + { + "elevation":[ + 354.17104439267905, + 403.57031216972939 + ], + "pace":[ + 335.07385149392701, + 397.82674381875808 + ], + "heartRate":[ + 130.8235194572915, + 140.55700591418218 + ], + "distanceFromStart":1.5 + }, + { + "elevation":[ + 357.42992871175124, + 385.92155620623635 + ], + "pace":[ + 395.16168913839374, + 404.60294066527558 + ], + "heartRate":[ + 131.5456052446734, + 134.65984504627627 + ], + "distanceFromStart":1.875 + }, + { + "elevation":[ + 345.47736721935661, + 363.18776661379422 + ], + "pace":[ + 340.82303041339082, + 404.71689228682374 + ], + "heartRate":[ + 125.1949698433959, + 131.31354363122026 + ], + "distanceFromStart":2.25 + }, + { + "elevation":[ + 346.23343025200535, + 497.23376445462401 + ], + "pace":[ + 261.27629148816021, + 331.68516208719467 + ], + "heartRate":[ + 131.67810544238606, + 154.26779645311458 + ], + "distanceFromStart":2.625 + }, + { + "elevation":[ + 491.57378483134391, + 547.49535224251053 + ], + "pace":[ + 296.05298644112088, + 401.14092967732398 + ], + "heartRate":[ + 151.36398089694217, + 166.20454793289232 + ], + "distanceFromStart":3 + }, + { + "elevation":[ + 472.06803233416338, + 531.92570520228401 + ], + "pace":[ + 395.50830663514012, + 401.67837917543591 + ], + "heartRate":[ + 134.41798110234078, + 151.90886697564241 + ], + "distanceFromStart":3.375 + }, + { + "elevation":[ + 339.81419476005283, + 461.03832527824829 + ], + "pace":[ + 395.31160487975183, + 404.49550455974907 + ], + "heartRate":[ + 129.97753472415462, + 138.13531094848992 + ], + "distanceFromStart":3.75 + }, + { + "elevation":[ + 303.1495508565697, + 342.3532820173541 + ], + "pace":[ + 395.02844559698116, + 402.65878340653796 + ], + "heartRate":[ + 127.72304232462609, + 133.26322270764186 + ], + "distanceFromStart":4.125 + } + ] + }, + { + "name":"Lonesome Ridge Trail", + "id":1009, + "distance":4.5, + "difficulty":3, + "observations":[ + { + "elevation":[ + 291.65263635636268, + 309.26016677925196 + ], + "pace":[ + 396.08716481908732, + 403.68937873525232 + ], + "heartRate":[ + 117.16351898665887, + 121.95815455919609 + ], + "distanceFromStart":0 + }, + { + "elevation":[ + 299.24001936628116, + 317.44584350790012 + ], + "pace":[ + 380.19020240756623, + 395.3978319010256 + ], + "heartRate":[ + 117.6410892152911, + 124.82185220506081 + ], + "distanceFromStart":0.375 + }, + { + "elevation":[ + 303.62145464574394, + 336.05569457646544 + ], + "pace":[ + 380.55927782266116, + 397.60789726832775 + ], + "heartRate":[ + 121.52696452049059, + 127.31525441110122 + ], + "distanceFromStart":0.75 + }, + { + "elevation":[ + 319.90393365162629, + 346.26966025518789 + ], + "pace":[ + 357.94116421258531, + 398.0750288648062 + ], + "heartRate":[ + 123.75908585923588, + 132.77069404486801 + ], + "distanceFromStart":1.125 + }, + { + "elevation":[ + 354.17104439267905, + 403.57031216972939 + ], + "pace":[ + 335.07385149392701, + 397.82674381875808 + ], + "heartRate":[ + 130.8235194572915, + 140.55700591418218 + ], + "distanceFromStart":1.5 + }, + { + "elevation":[ + 357.42992871175124, + 385.92155620623635 + ], + "pace":[ + 395.16168913839374, + 404.60294066527558 + ], + "heartRate":[ + 131.5456052446734, + 134.65984504627627 + ], + "distanceFromStart":1.875 + }, + { + "elevation":[ + 345.47736721935661, + 363.18776661379422 + ], + "pace":[ + 340.82303041339082, + 404.71689228682374 + ], + "heartRate":[ + 125.1949698433959, + 131.31354363122026 + ], + "distanceFromStart":2.25 + }, + { + "elevation":[ + 346.23343025200535, + 497.23376445462401 + ], + "pace":[ + 261.27629148816021, + 331.68516208719467 + ], + "heartRate":[ + 131.67810544238606, + 154.26779645311458 + ], + "distanceFromStart":2.625 + }, + { + "elevation":[ + 491.57378483134391, + 547.49535224251053 + ], + "pace":[ + 296.05298644112088, + 401.14092967732398 + ], + "heartRate":[ + 151.36398089694217, + 166.20454793289232 + ], + "distanceFromStart":3 + }, + { + "elevation":[ + 472.06803233416338, + 531.92570520228401 + ], + "pace":[ + 395.50830663514012, + 401.67837917543591 + ], + "heartRate":[ + 134.41798110234078, + 151.90886697564241 + ], + "distanceFromStart":3.375 + }, + { + "elevation":[ + 339.81419476005283, + 461.03832527824829 + ], + "pace":[ + 395.31160487975183, + 404.49550455974907 + ], + "heartRate":[ + 129.97753472415462, + 138.13531094848992 + ], + "distanceFromStart":3.75 + }, + { + "elevation":[ + 303.1495508565697, + 342.3532820173541 + ], + "pace":[ + 395.02844559698116, + 402.65878340653796 + ], + "heartRate":[ + 127.72304232462609, + 133.26322270764186 + ], + "distanceFromStart":4.125 + } + ] + }, + { + "name":"Lonesome Ridge Trail", + "id":1010, + "distance":4.5, + "difficulty":3, + "observations":[ + { + "elevation":[ + 291.65263635636268, + 309.26016677925196 + ], + "pace":[ + 396.08716481908732, + 403.68937873525232 + ], + "heartRate":[ + 117.16351898665887, + 121.95815455919609 + ], + "distanceFromStart":0 + }, + { + "elevation":[ + 299.24001936628116, + 317.44584350790012 + ], + "pace":[ + 380.19020240756623, + 395.3978319010256 + ], + "heartRate":[ + 117.6410892152911, + 124.82185220506081 + ], + "distanceFromStart":0.375 + }, + { + "elevation":[ + 303.62145464574394, + 336.05569457646544 + ], + "pace":[ + 380.55927782266116, + 397.60789726832775 + ], + "heartRate":[ + 121.52696452049059, + 127.31525441110122 + ], + "distanceFromStart":0.75 + }, + { + "elevation":[ + 319.90393365162629, + 346.26966025518789 + ], + "pace":[ + 357.94116421258531, + 398.0750288648062 + ], + "heartRate":[ + 123.75908585923588, + 132.77069404486801 + ], + "distanceFromStart":1.125 + }, + { + "elevation":[ + 354.17104439267905, + 403.57031216972939 + ], + "pace":[ + 335.07385149392701, + 397.82674381875808 + ], + "heartRate":[ + 130.8235194572915, + 140.55700591418218 + ], + "distanceFromStart":1.5 + }, + { + "elevation":[ + 357.42992871175124, + 385.92155620623635 + ], + "pace":[ + 395.16168913839374, + 404.60294066527558 + ], + "heartRate":[ + 131.5456052446734, + 134.65984504627627 + ], + "distanceFromStart":1.875 + }, + { + "elevation":[ + 345.47736721935661, + 363.18776661379422 + ], + "pace":[ + 340.82303041339082, + 404.71689228682374 + ], + "heartRate":[ + 125.1949698433959, + 131.31354363122026 + ], + "distanceFromStart":2.25 + }, + { + "elevation":[ + 346.23343025200535, + 497.23376445462401 + ], + "pace":[ + 261.27629148816021, + 331.68516208719467 + ], + "heartRate":[ + 131.67810544238606, + 154.26779645311458 + ], + "distanceFromStart":2.625 + }, + { + "elevation":[ + 491.57378483134391, + 547.49535224251053 + ], + "pace":[ + 296.05298644112088, + 401.14092967732398 + ], + "heartRate":[ + 151.36398089694217, + 166.20454793289232 + ], + "distanceFromStart":3 + }, + { + "elevation":[ + 472.06803233416338, + 531.92570520228401 + ], + "pace":[ + 395.50830663514012, + 401.67837917543591 + ], + "heartRate":[ + 134.41798110234078, + 151.90886697564241 + ], + "distanceFromStart":3.375 + }, + { + "elevation":[ + 339.81419476005283, + 461.03832527824829 + ], + "pace":[ + 395.31160487975183, + 404.49550455974907 + ], + "heartRate":[ + 129.97753472415462, + 138.13531094848992 + ], + "distanceFromStart":3.75 + }, + { + "elevation":[ + 303.1495508565697, + 342.3532820173541 + ], + "pace":[ + 395.02844559698116, + 402.65878340653796 + ], + "heartRate":[ + 127.72304232462609, + 133.26322270764186 + ], + "distanceFromStart":4.125 + } + ] + } +] diff --git a/Examples/InterfacingWithUIKit/Complete/Landmarks/Landmarks/Resources/icybay.jpg b/Examples/InterfacingWithUIKit/Complete/Landmarks/Landmarks/Resources/icybay.jpg new file mode 100755 index 0000000..feb1764 Binary files /dev/null and b/Examples/InterfacingWithUIKit/Complete/Landmarks/Landmarks/Resources/icybay.jpg differ diff --git a/Examples/InterfacingWithUIKit/Complete/Landmarks/Landmarks/Resources/lakemcdonald.jpg b/Examples/InterfacingWithUIKit/Complete/Landmarks/Landmarks/Resources/lakemcdonald.jpg new file mode 100755 index 0000000..bd9d6b9 Binary files /dev/null and b/Examples/InterfacingWithUIKit/Complete/Landmarks/Landmarks/Resources/lakemcdonald.jpg differ diff --git a/Examples/InterfacingWithUIKit/Complete/Landmarks/Landmarks/Resources/landmarkData.json b/Examples/InterfacingWithUIKit/Complete/Landmarks/Landmarks/Resources/landmarkData.json new file mode 100755 index 0000000..a25b4e4 --- /dev/null +++ b/Examples/InterfacingWithUIKit/Complete/Landmarks/Landmarks/Resources/landmarkData.json @@ -0,0 +1,182 @@ +[ + { + "name": "Turtle Rock", + "category": "Rivers", + "city": "Twentynine Palms", + "state": "California", + "id": 1001, + "isFeatured": true, + "isFavorite": true, + "park": "Joshua Tree National Park", + "coordinates": { + "longitude": -116.166868, + "latitude": 34.011286 + }, + "imageName": "turtlerock" + }, + { + "name": "Silver Salmon Creek", + "category": "Lakes", + "city": "Port Alsworth", + "state": "Alaska", + "id": 1002, + "isFeatured": false, + "isFavorite": false, + "park": "Lake Clark National Park and Preserve", + "coordinates": { + "longitude": -152.665167, + "latitude": 59.980167 + }, + "imageName": "silversalmoncreek" + }, + { + "name": "Chilkoot Trail", + "category": "Mountains", + "city": "Skagway", + "state": "Alaska", + "id": 1003, + "isFeatured": false, + "isFavorite": true, + "park": "Klondike Gold Rush National Historical Park", + "coordinates": { + "longitude": -135.334571, + "latitude": 59.560551 + }, + "imageName": "chilkoottrail" + }, + { + "name": "St. Mary Lake", + "category": "Lakes", + "city": "Browning", + "state": "Montana", + "id": 1004, + "isFeatured": true, + "isFavorite": true, + "park": "Glacier National Park", + "coordinates": { + "longitude": -113.536248, + "latitude": 48.69423 + }, + "imageName": "stmarylake" + }, + { + "name": "Twin Lake", + "category": "Lakes", + "city": "Twin Lakes", + "state": "Alaska", + "id": 1005, + "isFeatured": false, + "isFavorite": false, + "park": "Lake Clark National Park and Preserve", + "coordinates": { + "longitude": -153.849883, + "latitude": 60.641684 + }, + "imageName": "twinlake" + }, + { + "name": "Lake McDonald", + "category": "Mountains", + "city": "West Glacier", + "state": "Montana", + "id": 1006, + "isFeatured": false, + "isFavorite": false, + "park": "Glacier National Park", + "coordinates": { + "longitude": -113.934831, + "latitude": 48.56002 + }, + "imageName": "lakemcdonald" + }, + { + "name": "Charley Rivers", + "category": "Rivers", + "city": "Eaking", + "state": "Alaska", + "id": 1007, + "isFeatured": true, + "isFavorite": false, + "park": "Charley Rivers National Preserve", + "coordinates": { + "longitude": -143.122586, + "latitude": 65.350021 + }, + "imageName": "charleyrivers", + }, + { + "name": "Icy Bay", + "category": "Mountains", + "city": "Icy Bay", + "state": "Alaska", + "id": 1008, + "isFeatured": false, + "isFavorite": false, + "park": "Wrangell-St. Elias National Park and Preserve", + "coordinates": { + "longitude": -141.518167, + "latitude": 60.089917 + }, + "imageName": "icybay" + }, + { + "name": "Rainbow Lake", + "category": "Lakes", + "city": "Willow", + "state": "Alaska", + "id": 1009, + "isFeatured": false, + "isFavorite": false, + "park": "State Recreation Area", + "coordinates": { + "longitude": -150.086103, + "latitude": 61.694334 + }, + "imageName": "rainbowlake" + }, + { + "name": "Hidden Lake", + "category": "Lakes", + "city": "Newhalem", + "state": "Washington", + "id": 1010, + "isFeatured": false, + "isFavorite": false, + "park": "North Cascades National Park", + "coordinates": { + "longitude": -121.17799, + "latitude": 48.495442 + }, + "imageName": "hiddenlake" + }, + { + "name": "Chincoteague", + "category": "Rivers", + "city": "Chincoteague", + "state": "Virginia", + "id": 1011, + "isFeatured": false, + "isFavorite": false, + "park": "Chincoteague National Wildlife Refuge", + "coordinates": { + "longitude": -75.383212, + "latitude": 37.91531 + }, + "imageName": "chincoteague" + }, + { + "name": "Lake Umbagog", + "category": "Lakes", + "city": "Errol", + "state": "New Hampshire", + "id": 1012, + "isFeatured": false, + "isFavorite": false, + "park": "Umbagog National Wildlife Refuge", + "coordinates": { + "longitude": -71.056816, + "latitude": 44.747408 + }, + "imageName": "umbagog" + } +] diff --git a/Examples/InterfacingWithUIKit/Complete/Landmarks/Landmarks/Resources/rainbowlake.jpg b/Examples/InterfacingWithUIKit/Complete/Landmarks/Landmarks/Resources/rainbowlake.jpg new file mode 100755 index 0000000..6da43dd Binary files /dev/null and b/Examples/InterfacingWithUIKit/Complete/Landmarks/Landmarks/Resources/rainbowlake.jpg differ diff --git a/Examples/InterfacingWithUIKit/Complete/Landmarks/Landmarks/Resources/silversalmoncreek.jpg b/Examples/InterfacingWithUIKit/Complete/Landmarks/Landmarks/Resources/silversalmoncreek.jpg new file mode 100755 index 0000000..f657532 Binary files /dev/null and b/Examples/InterfacingWithUIKit/Complete/Landmarks/Landmarks/Resources/silversalmoncreek.jpg differ diff --git a/Examples/InterfacingWithUIKit/Complete/Landmarks/Landmarks/Resources/stmarylake.jpg b/Examples/InterfacingWithUIKit/Complete/Landmarks/Landmarks/Resources/stmarylake.jpg new file mode 100755 index 0000000..1c71de4 Binary files /dev/null and b/Examples/InterfacingWithUIKit/Complete/Landmarks/Landmarks/Resources/stmarylake.jpg differ diff --git a/Examples/InterfacingWithUIKit/Complete/Landmarks/Landmarks/Resources/stmarylake_feature.jpg b/Examples/InterfacingWithUIKit/Complete/Landmarks/Landmarks/Resources/stmarylake_feature.jpg new file mode 100755 index 0000000..5eb97b1 Binary files /dev/null and b/Examples/InterfacingWithUIKit/Complete/Landmarks/Landmarks/Resources/stmarylake_feature.jpg differ diff --git a/Examples/InterfacingWithUIKit/Complete/Landmarks/Landmarks/Resources/turtlerock.jpg b/Examples/InterfacingWithUIKit/Complete/Landmarks/Landmarks/Resources/turtlerock.jpg new file mode 100755 index 0000000..f7a6e6d Binary files /dev/null and b/Examples/InterfacingWithUIKit/Complete/Landmarks/Landmarks/Resources/turtlerock.jpg differ diff --git a/Examples/InterfacingWithUIKit/Complete/Landmarks/Landmarks/Resources/turtlerock_feature.jpg b/Examples/InterfacingWithUIKit/Complete/Landmarks/Landmarks/Resources/turtlerock_feature.jpg new file mode 100755 index 0000000..448c70f Binary files /dev/null and b/Examples/InterfacingWithUIKit/Complete/Landmarks/Landmarks/Resources/turtlerock_feature.jpg differ diff --git a/Examples/InterfacingWithUIKit/Complete/Landmarks/Landmarks/Resources/twinlake.jpg b/Examples/InterfacingWithUIKit/Complete/Landmarks/Landmarks/Resources/twinlake.jpg new file mode 100755 index 0000000..3e7a57c Binary files /dev/null and b/Examples/InterfacingWithUIKit/Complete/Landmarks/Landmarks/Resources/twinlake.jpg differ diff --git a/Examples/InterfacingWithUIKit/Complete/Landmarks/Landmarks/Resources/umbagog.jpg b/Examples/InterfacingWithUIKit/Complete/Landmarks/Landmarks/Resources/umbagog.jpg new file mode 100755 index 0000000..56291c6 Binary files /dev/null and b/Examples/InterfacingWithUIKit/Complete/Landmarks/Landmarks/Resources/umbagog.jpg differ diff --git a/Examples/InterfacingWithUIKit/Complete/Landmarks/Landmarks/SceneDelegate.swift b/Examples/InterfacingWithUIKit/Complete/Landmarks/Landmarks/SceneDelegate.swift new file mode 100755 index 0000000..0f5f17e --- /dev/null +++ b/Examples/InterfacingWithUIKit/Complete/Landmarks/Landmarks/SceneDelegate.swift @@ -0,0 +1,56 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +The scene delegate. +*/ + +import UIKit +import SwiftUI + +class SceneDelegate: UIResponder, UIWindowSceneDelegate { + + var window: UIWindow? + + func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) { + // Use this method to optionally configure and attach the UIWindow `window` to the provided UIWindowScene `scene`. + // If using a storyboard, the `window` property will automatically be initialized and attached to the scene. + // This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead). + + // Use a UIHostingController as window root view controller + let window = UIWindow(frame: UIScreen.main.bounds) + window.rootViewController = UIHostingController(rootView: CategoryHome().environmentObject(UserData())) + self.window = window + window.makeKeyAndVisible() + } + + func sceneDidDisconnect(_ scene: UIScene) { + // Called as the scene is being released by the system. + // This occurs shortly after the scene enters the background, or when its session is discarded. + // Release any resources associated with this scene that can be re-created the next time the scene connects. + // The scene may re-connect later, as its session was not neccessarily discarded (see `application:didDiscardSceneSessions` instead). + } + + func sceneDidBecomeActive(_ scene: UIScene) { + // Called when the scene has moved from an inactive state to an active state. + // Use this method to restart any tasks that were paused (or not yet started) when the scene was inactive. + } + + func sceneWillResignActive(_ scene: UIScene) { + // Called when the scene will move from an active state to an inactive state. + // This may occur due to temporary interruptions (ex. an incoming phone call). + } + + func sceneWillEnterForeground(_ scene: UIScene) { + // Called as the scene transitions from the background to the foreground. + // Use this method to undo the changes made on entering the background. + } + + func sceneDidEnterBackground(_ scene: UIScene) { + // Called as the scene transitions from the foreground to the background. + // Use this method to save data, release shared resources, and store enough scene-specific state information + // to restore the scene back to its current state. + } + +} + diff --git a/Examples/InterfacingWithUIKit/Complete/Landmarks/Landmarks/Supporting Views/Badge.swift b/Examples/InterfacingWithUIKit/Complete/Landmarks/Landmarks/Supporting Views/Badge.swift new file mode 100755 index 0000000..59f03b2 --- /dev/null +++ b/Examples/InterfacingWithUIKit/Complete/Landmarks/Landmarks/Supporting Views/Badge.swift @@ -0,0 +1,41 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +A view that displays a badge. +*/ + +import SwiftUI + +struct Badge: View { + static let rotationCount = 8 + + var badgeSymbols: some View { + ForEach(0.. + var overallRange: Range + + var heightRatio: Length { + max(Length(magnitude(of: range) / magnitude(of: overallRange)), 0.15) + } + + var offsetRatio: Length { + Length((range.lowerBound - overallRange.lowerBound) / magnitude(of: overallRange)) + } + + var animation: Animation { + Animation.spring(initialVelocity: 5) + .speed(2) + .delay(0.03 * Double(index)) + } + + var body: some View { + Capsule() + .fill(Color.white) + .frame(height: height * heightRatio, alignment: .bottom) + .offset(x: 0, y: height * -offsetRatio) + .animation(animation) + } +} + +#if DEBUG +struct GraphCapsule_Previews: PreviewProvider { + static var previews: some View { + GraphCapsule(index: 0, height: 150, range: 10..<50, overallRange: 0..<100) + } +} +#endif diff --git a/Examples/InterfacingWithUIKit/Complete/Landmarks/Landmarks/Supporting Views/HikeGraph.swift b/Examples/InterfacingWithUIKit/Complete/Landmarks/Landmarks/Supporting Views/HikeGraph.swift new file mode 100755 index 0000000..7df5194 --- /dev/null +++ b/Examples/InterfacingWithUIKit/Complete/Landmarks/Landmarks/Supporting Views/HikeGraph.swift @@ -0,0 +1,74 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +The elevation, heart rate, and pace of a hike plotted on a graph. +*/ + +import SwiftUI + +func rangeOfRanges(_ ranges: C) -> Range + where C.Element == Range { + guard !ranges.isEmpty else { return 0..<0 } + let low = ranges.lazy.map { $0.lowerBound }.min()! + let high = ranges.lazy.map { $0.upperBound }.max()! + return low..) -> Double { + return range.upperBound - range.lowerBound +} + +struct HikeGraph: View { + var hike: Hike + var path: KeyPath> + + var color: Color { + switch path { + case \.elevation: + return .gray + case \.heartRate: + return Color(hue: 0, saturation: 0.5, brightness: 0.7) + case \.pace: + return Color(hue: 0.7, saturation: 0.4, brightness: 0.7) + default: + return .black + } + } + + var body: some View { + let data = hike.observations + let overallRange = rangeOfRanges(data.lazy.map { $0[keyPath: self.path] }) + let maxMagnitude = data.map { magnitude(of: $0[keyPath: path]) }.max()! + let heightRatio = 1 - Length(maxMagnitude / magnitude(of: overallRange)) + + return GeometryReader { proxy in + HStack(alignment: .bottom, spacing: proxy.size.width / 120) { + ForEach(data.indices) { index in + GraphCapsule( + index: index, + height: proxy.size.height, + range: data[index][keyPath: self.path], + overallRange: overallRange) + .colorMultiply(self.color) + } + .offset(x: 0, y: proxy.size.height * heightRatio) + } + } + } +} + +#if DEBUG +struct HikeGraph_Previews: PreviewProvider { + static var previews: some View { + Group { + HikeGraph(hike: hikeData[0], path: \.elevation) + .frame(height: 200) + HikeGraph(hike: hikeData[0], path: \.heartRate) + .frame(height: 200) + HikeGraph(hike: hikeData[0], path: \.pace) + .frame(height: 200) + } + } +} +#endif diff --git a/Examples/InterfacingWithUIKit/Complete/Landmarks/Landmarks/Supporting Views/LandmarkRow.swift b/Examples/InterfacingWithUIKit/Complete/Landmarks/Landmarks/Supporting Views/LandmarkRow.swift new file mode 100755 index 0000000..2f8110c --- /dev/null +++ b/Examples/InterfacingWithUIKit/Complete/Landmarks/Landmarks/Supporting Views/LandmarkRow.swift @@ -0,0 +1,38 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +A single row to be displayed in a list of landmarks. +*/ + +import SwiftUI + +struct LandmarkRow: View { + var landmark: Landmark + + var body: some View { + HStack { + landmark.image(forSize: 50) + Text(verbatim: landmark.name) + Spacer() + + if landmark.isFavorite { + Image(systemName: "star.fill") + .imageScale(.medium) + .foregroundColor(.yellow) + } + } + } +} + +#if DEBUG +struct LandmarkRow_Previews: PreviewProvider { + static var previews: some View { + Group { + LandmarkRow(landmark: landmarkData[0]) + LandmarkRow(landmark: landmarkData[1]) + } + .previewLayout(.fixed(width: 300, height: 70)) + } +} +#endif diff --git a/Examples/InterfacingWithUIKit/Complete/Landmarks/Landmarks/Supporting Views/MapView.swift b/Examples/InterfacingWithUIKit/Complete/Landmarks/Landmarks/Supporting Views/MapView.swift new file mode 100755 index 0000000..5a8c64b --- /dev/null +++ b/Examples/InterfacingWithUIKit/Complete/Landmarks/Landmarks/Supporting Views/MapView.swift @@ -0,0 +1,31 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +A view that hosts an `MKMapView`. +*/ + +import SwiftUI +import MapKit + +struct MapView: UIViewRepresentable { + var coordinate: CLLocationCoordinate2D + + func makeUIView(context: Context) -> MKMapView { + MKMapView(frame: .zero) + } + + func updateUIView(_ view: MKMapView, context: Context) { + let span = MKCoordinateSpan(latitudeDelta: 0.02, longitudeDelta: 0.02) + let region = MKCoordinateRegion(center: coordinate, span: span) + view.setRegion(region, animated: true) + } +} + +#if DEBUG +struct MapView_Previews: PreviewProvider { + static var previews: some View { + MapView(coordinate: landmarkData[0].locationCoordinate) + } +} +#endif diff --git a/Examples/InterfacingWithUIKit/Complete/Landmarks/Landmarks/Supporting Views/RotatedBadgeSymbol.swift b/Examples/InterfacingWithUIKit/Complete/Landmarks/Landmarks/Supporting Views/RotatedBadgeSymbol.swift new file mode 100755 index 0000000..a7e4b53 --- /dev/null +++ b/Examples/InterfacingWithUIKit/Complete/Landmarks/Landmarks/Supporting Views/RotatedBadgeSymbol.swift @@ -0,0 +1,26 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +A view that displays a rotated version of a badge symbol. +*/ + +import SwiftUI + +struct RotatedBadgeSymbol: View { + let angle: Angle + + var body: some View { + BadgeSymbol() + .padding(-60) + .rotationEffect(angle, anchor: .bottom) + } +} + +#if DEBUG +struct RotatedBadgeSymbol_Previews: PreviewProvider { + static var previews: some View { + RotatedBadgeSymbol(angle: .init(degrees: 5)) + } +} +#endif diff --git a/Examples/InterfacingWithUIKit/Complete/README.md b/Examples/InterfacingWithUIKit/Complete/README.md new file mode 100755 index 0000000..4bfcd0b --- /dev/null +++ b/Examples/InterfacingWithUIKit/Complete/README.md @@ -0,0 +1,3 @@ +# Completed Project: Interfacing with UIKit + +Explore the completed project for the [Interfacing with UIKit](https://developer.apple.com/tutorials/swiftui/interfacing-with-uikit) tutorial. \ No newline at end of file diff --git a/Examples/InterfacingWithUIKit/StartingPoint/.gitignore b/Examples/InterfacingWithUIKit/StartingPoint/.gitignore new file mode 100755 index 0000000..9e50718 --- /dev/null +++ b/Examples/InterfacingWithUIKit/StartingPoint/.gitignore @@ -0,0 +1,21 @@ +# See LICENSE folder for this sample’s licensing information. +# +# Apple sample code gitignore configuration. + +# Finder +.DS_Store + +# Xcode - User files +xcuserdata/ + +**/*.xcodeproj/project.xcworkspace/* +!**/*.xcodeproj/project.xcworkspace/xcshareddata + +**/*.xcodeproj/project.xcworkspace/xcshareddata/* +!**/*.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings + +**/*.playground/playground.xcworkspace/* +!**/*.playground/playground.xcworkspace/xcshareddata + +**/*.playground/playground.xcworkspace/xcshareddata/* +!**/*.playground/playground.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings diff --git a/Examples/InterfacingWithUIKit/StartingPoint/Configuration/SampleCode.xcconfig b/Examples/InterfacingWithUIKit/StartingPoint/Configuration/SampleCode.xcconfig new file mode 100755 index 0000000..db86c06 --- /dev/null +++ b/Examples/InterfacingWithUIKit/StartingPoint/Configuration/SampleCode.xcconfig @@ -0,0 +1,13 @@ +// +// See LICENSE folder for this sample’s licensing information. +// +// SampleCode.xcconfig +// + +// The `SAMPLE_CODE_DISAMBIGUATOR` configuration is to make it easier to build +// and run a sample code project. Once you set your project's development team, +// you'll have a unique bundle identifier. This is because the bundle identifier +// is derived based on the 'SAMPLE_CODE_DISAMBIGUATOR' value. Do not use this +// approach in your own projects—it's only useful for sample code projects because +// they are frequently downloaded and don't have a development team set. +SAMPLE_CODE_DISAMBIGUATOR=${DEVELOPMENT_TEAM} diff --git a/Examples/InterfacingWithUIKit/StartingPoint/LICENSE/LICENSE.txt b/Examples/InterfacingWithUIKit/StartingPoint/LICENSE/LICENSE.txt new file mode 100755 index 0000000..94e3d54 --- /dev/null +++ b/Examples/InterfacingWithUIKit/StartingPoint/LICENSE/LICENSE.txt @@ -0,0 +1,8 @@ +Copyright © 2019 Apple Inc. + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + diff --git a/Examples/InterfacingWithUIKit/StartingPoint/Landmarks/InterfacingWithUIKit.xcodeproj/.xcodesamplecode.plist b/Examples/InterfacingWithUIKit/StartingPoint/Landmarks/InterfacingWithUIKit.xcodeproj/.xcodesamplecode.plist new file mode 100755 index 0000000..5dd5da8 --- /dev/null +++ b/Examples/InterfacingWithUIKit/StartingPoint/Landmarks/InterfacingWithUIKit.xcodeproj/.xcodesamplecode.plist @@ -0,0 +1,5 @@ + + + + + diff --git a/Examples/InterfacingWithUIKit/StartingPoint/Landmarks/InterfacingWithUIKit.xcodeproj/project.pbxproj b/Examples/InterfacingWithUIKit/StartingPoint/Landmarks/InterfacingWithUIKit.xcodeproj/project.pbxproj new file mode 100755 index 0000000..34c3ca1 --- /dev/null +++ b/Examples/InterfacingWithUIKit/StartingPoint/Landmarks/InterfacingWithUIKit.xcodeproj/project.pbxproj @@ -0,0 +1,577 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 50; + objects = { + +/* Begin PBXBuildFile section */ + B7310DD1229F6839001079B9 /* HexagonParameters.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7310DD0229F6839001079B9 /* HexagonParameters.swift */; }; + B7310DD3229F6CA9001079B9 /* Badge.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7310DD2229F6CA9001079B9 /* Badge.swift */; }; + B7394866229F194000C47603 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7394865229F194000C47603 /* AppDelegate.swift */; }; + B7394868229F194000C47603 /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7394867229F194000C47603 /* SceneDelegate.swift */; }; + B739486A229F194000C47603 /* LandmarkDetail.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7394869229F194000C47603 /* LandmarkDetail.swift */; }; + B739486C229F194200C47603 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = B739486B229F194200C47603 /* Assets.xcassets */; }; + B739486F229F194200C47603 /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = B739486E229F194200C47603 /* Preview Assets.xcassets */; }; + B7394872229F194200C47603 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = B7394870229F194200C47603 /* LaunchScreen.storyboard */; }; + B739487A229F1B3F00C47603 /* CircleImage.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7394879229F1B3F00C47603 /* CircleImage.swift */; }; + B739487C229F1B6800C47603 /* MapView.swift in Sources */ = {isa = PBXBuildFile; fileRef = B739487B229F1B6800C47603 /* MapView.swift */; }; + B7394881229F28B900C47603 /* Landmark.swift in Sources */ = {isa = PBXBuildFile; fileRef = B739487F229F28B900C47603 /* Landmark.swift */; }; + B7394891229F292F00C47603 /* rainbowlake.jpg in Resources */ = {isa = PBXBuildFile; fileRef = B7394884229F292D00C47603 /* rainbowlake.jpg */; }; + B7394893229F292F00C47603 /* icybay.jpg in Resources */ = {isa = PBXBuildFile; fileRef = B7394886229F292E00C47603 /* icybay.jpg */; }; + B7394894229F292F00C47603 /* lakemcdonald.jpg in Resources */ = {isa = PBXBuildFile; fileRef = B7394887229F292E00C47603 /* lakemcdonald.jpg */; }; + B7394895229F292F00C47603 /* turtlerock.jpg in Resources */ = {isa = PBXBuildFile; fileRef = B7394888229F292E00C47603 /* turtlerock.jpg */; }; + B7394896229F292F00C47603 /* umbagog.jpg in Resources */ = {isa = PBXBuildFile; fileRef = B7394889229F292E00C47603 /* umbagog.jpg */; }; + B7394897229F292F00C47603 /* hiddenlake.jpg in Resources */ = {isa = PBXBuildFile; fileRef = B739488A229F292E00C47603 /* hiddenlake.jpg */; }; + B7394898229F292F00C47603 /* stmarylake.jpg in Resources */ = {isa = PBXBuildFile; fileRef = B739488B229F292E00C47603 /* stmarylake.jpg */; }; + B7394899229F292F00C47603 /* twinlake.jpg in Resources */ = {isa = PBXBuildFile; fileRef = B739488C229F292E00C47603 /* twinlake.jpg */; }; + B739489A229F292F00C47603 /* silversalmoncreek.jpg in Resources */ = {isa = PBXBuildFile; fileRef = B739488D229F292E00C47603 /* silversalmoncreek.jpg */; }; + B739489B229F292F00C47603 /* landmarkData.json in Resources */ = {isa = PBXBuildFile; fileRef = B739488E229F292E00C47603 /* landmarkData.json */; }; + B739489C229F292F00C47603 /* chincoteague.jpg in Resources */ = {isa = PBXBuildFile; fileRef = B739488F229F292F00C47603 /* chincoteague.jpg */; }; + B739489D229F292F00C47603 /* chilkoottrail.jpg in Resources */ = {isa = PBXBuildFile; fileRef = B7394890229F292F00C47603 /* chilkoottrail.jpg */; }; + B739489F229F2D9700C47603 /* LandmarkRow.swift in Sources */ = {isa = PBXBuildFile; fileRef = B739489E229F2D9700C47603 /* LandmarkRow.swift */; }; + B73948A1229F2E1F00C47603 /* LandmarkList.swift in Sources */ = {isa = PBXBuildFile; fileRef = B73948A0229F2E1F00C47603 /* LandmarkList.swift */; }; + B73948A3229F3E2200C47603 /* charleyrivers.jpg in Resources */ = {isa = PBXBuildFile; fileRef = B73948A2229F3E2200C47603 /* charleyrivers.jpg */; }; + B7D2AAC5229F4D7C0061E5F5 /* UserData.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7D2AAC4229F4D7C0061E5F5 /* UserData.swift */; }; + B7D587AE229F7382006E8DCF /* BadgeBackground.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7D587AD229F7382006E8DCF /* BadgeBackground.swift */; }; + B7D587B0229F73C1006E8DCF /* BadgeSymbol.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7D587AF229F73C1006E8DCF /* BadgeSymbol.swift */; }; + B7D587B2229F7406006E8DCF /* RotatedBadgeSymbol.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7D587B1229F7406006E8DCF /* RotatedBadgeSymbol.swift */; }; + B7D587B6229F825D006E8DCF /* HikeView.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7D587B5229F825D006E8DCF /* HikeView.swift */; }; + B7D587B8229F826D006E8DCF /* GraphCapsule.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7D587B7229F826D006E8DCF /* GraphCapsule.swift */; }; + B7D587BA229F8288006E8DCF /* Hike.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7D587B9229F8288006E8DCF /* Hike.swift */; }; + B7D587BC229F82EB006E8DCF /* HikeDetail.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7D587BB229F82EB006E8DCF /* HikeDetail.swift */; }; + B7D587BE229F82FF006E8DCF /* HikeGraph.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7D587BD229F82FF006E8DCF /* HikeGraph.swift */; }; + B7D587C0229F830B006E8DCF /* hikeData.json in Resources */ = {isa = PBXBuildFile; fileRef = B7D587BF229F830B006E8DCF /* hikeData.json */; }; + B7D587D222A0892C006E8DCF /* Home.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7D587D122A0892C006E8DCF /* Home.swift */; }; + B7D587D422A08965006E8DCF /* CategoryRow.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7D587D322A08965006E8DCF /* CategoryRow.swift */; }; + B7D587D622A08C97006E8DCF /* Profile.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7D587D522A08C97006E8DCF /* Profile.swift */; }; + B7D587D922A08D33006E8DCF /* ProfileHost.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7D587D822A08D33006E8DCF /* ProfileHost.swift */; }; + B7D587DB22A08D67006E8DCF /* ProfileSummary.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7D587DA22A08D67006E8DCF /* ProfileSummary.swift */; }; + B7D587DD22A08DD6006E8DCF /* HikeBadge.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7D587DC22A08DD6006E8DCF /* HikeBadge.swift */; }; + B7D587DF22A08E1A006E8DCF /* ProfileEditor.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7D587DE22A08E1A006E8DCF /* ProfileEditor.swift */; }; + B7D587E122A0914D006E8DCF /* FeatureCard.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7D587E022A0914D006E8DCF /* FeatureCard.swift */; }; + B7D587E522A097E2006E8DCF /* charleyrivers_feature.jpg in Resources */ = {isa = PBXBuildFile; fileRef = B7D587E222A097E2006E8DCF /* charleyrivers_feature.jpg */; }; + B7D587E622A097E2006E8DCF /* stmarylake_feature.jpg in Resources */ = {isa = PBXBuildFile; fileRef = B7D587E322A097E2006E8DCF /* stmarylake_feature.jpg */; }; + B7D587E722A097E2006E8DCF /* turtlerock_feature.jpg in Resources */ = {isa = PBXBuildFile; fileRef = B7D587E422A097E2006E8DCF /* turtlerock_feature.jpg */; }; + B7D587E922A09809006E8DCF /* Data.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7D587E822A09809006E8DCF /* Data.swift */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + 184943801849325000000001 /* SampleCode.xcconfig */ = {isa = PBXFileReference; name = SampleCode.xcconfig; path = ../Configuration/SampleCode.xcconfig; sourceTree = ""; }; + 187E8B20187E899000000001 /* LICENSE.txt */ = {isa = PBXFileReference; includeInIndex = 1; path = LICENSE.txt; sourceTree = ""; }; + B7310DD0229F6839001079B9 /* HexagonParameters.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HexagonParameters.swift; sourceTree = ""; }; + B7310DD2229F6CA9001079B9 /* Badge.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Badge.swift; sourceTree = ""; }; + B7394862229F194000C47603 /* Landmarks.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Landmarks.app; sourceTree = BUILT_PRODUCTS_DIR; }; + B7394865229F194000C47603 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + B7394867229F194000C47603 /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = ""; }; + B7394869229F194000C47603 /* LandmarkDetail.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LandmarkDetail.swift; sourceTree = ""; }; + B739486B229F194200C47603 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + B739486E229F194200C47603 /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = ""; }; + B7394871229F194200C47603 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + B7394873229F194200C47603 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + B7394879229F1B3F00C47603 /* CircleImage.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CircleImage.swift; sourceTree = ""; }; + B739487B229F1B6800C47603 /* MapView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MapView.swift; sourceTree = ""; }; + B739487F229F28B900C47603 /* Landmark.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Landmark.swift; sourceTree = ""; }; + B7394884229F292D00C47603 /* rainbowlake.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = rainbowlake.jpg; sourceTree = ""; }; + B7394886229F292E00C47603 /* icybay.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = icybay.jpg; sourceTree = ""; }; + B7394887229F292E00C47603 /* lakemcdonald.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = lakemcdonald.jpg; sourceTree = ""; }; + B7394888229F292E00C47603 /* turtlerock.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = turtlerock.jpg; sourceTree = ""; }; + B7394889229F292E00C47603 /* umbagog.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = umbagog.jpg; sourceTree = ""; }; + B739488A229F292E00C47603 /* hiddenlake.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = hiddenlake.jpg; sourceTree = ""; }; + B739488B229F292E00C47603 /* stmarylake.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = stmarylake.jpg; sourceTree = ""; }; + B739488C229F292E00C47603 /* twinlake.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = twinlake.jpg; sourceTree = ""; }; + B739488D229F292E00C47603 /* silversalmoncreek.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = silversalmoncreek.jpg; sourceTree = ""; }; + B739488E229F292E00C47603 /* landmarkData.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = landmarkData.json; sourceTree = ""; }; + B739488F229F292F00C47603 /* chincoteague.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = chincoteague.jpg; sourceTree = ""; }; + B7394890229F292F00C47603 /* chilkoottrail.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = chilkoottrail.jpg; sourceTree = ""; }; + B739489E229F2D9700C47603 /* LandmarkRow.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = LandmarkRow.swift; path = "Supporting Views/LandmarkRow.swift"; sourceTree = ""; }; + B73948A0229F2E1F00C47603 /* LandmarkList.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LandmarkList.swift; sourceTree = ""; }; + B73948A2229F3E2200C47603 /* charleyrivers.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = charleyrivers.jpg; sourceTree = ""; }; + B7D2AAC4229F4D7C0061E5F5 /* UserData.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UserData.swift; sourceTree = ""; }; + B7D587AD229F7382006E8DCF /* BadgeBackground.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BadgeBackground.swift; sourceTree = ""; }; + B7D587AF229F73C1006E8DCF /* BadgeSymbol.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BadgeSymbol.swift; sourceTree = ""; }; + B7D587B1229F7406006E8DCF /* RotatedBadgeSymbol.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RotatedBadgeSymbol.swift; sourceTree = ""; }; + B7D587B5229F825D006E8DCF /* HikeView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HikeView.swift; sourceTree = ""; }; + B7D587B7229F826D006E8DCF /* GraphCapsule.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GraphCapsule.swift; sourceTree = ""; }; + B7D587B9229F8288006E8DCF /* Hike.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Hike.swift; sourceTree = ""; }; + B7D587BB229F82EB006E8DCF /* HikeDetail.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HikeDetail.swift; sourceTree = ""; }; + B7D587BD229F82FF006E8DCF /* HikeGraph.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HikeGraph.swift; sourceTree = ""; }; + B7D587BF229F830B006E8DCF /* hikeData.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = hikeData.json; sourceTree = ""; }; + B7D587D122A0892C006E8DCF /* Home.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Home.swift; sourceTree = ""; }; + B7D587D322A08965006E8DCF /* CategoryRow.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CategoryRow.swift; sourceTree = ""; }; + B7D587D522A08C97006E8DCF /* Profile.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Profile.swift; sourceTree = ""; }; + B7D587D822A08D33006E8DCF /* ProfileHost.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProfileHost.swift; sourceTree = ""; }; + B7D587DA22A08D67006E8DCF /* ProfileSummary.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProfileSummary.swift; sourceTree = ""; }; + B7D587DC22A08DD6006E8DCF /* HikeBadge.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HikeBadge.swift; sourceTree = ""; }; + B7D587DE22A08E1A006E8DCF /* ProfileEditor.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProfileEditor.swift; sourceTree = ""; }; + B7D587E022A0914D006E8DCF /* FeatureCard.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FeatureCard.swift; sourceTree = ""; }; + B7D587E222A097E2006E8DCF /* charleyrivers_feature.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = charleyrivers_feature.jpg; sourceTree = ""; }; + B7D587E322A097E2006E8DCF /* stmarylake_feature.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = stmarylake_feature.jpg; sourceTree = ""; }; + B7D587E422A097E2006E8DCF /* turtlerock_feature.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = turtlerock_feature.jpg; sourceTree = ""; }; + B7D587E822A09809006E8DCF /* Data.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Data.swift; sourceTree = ""; }; + C4E4AAA0C4E4035000000001 /* README.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; name = README.md; path = ../README.md; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + B739485F229F194000C47603 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 1848B9A01848B96000000001 /* Configuration */ = { + isa = PBXGroup; + children = ( + 184943801849325000000001 /* SampleCode.xcconfig */, + ); + name = Configuration; + sourceTree = ""; + }; + 187E7D00187E74D000000001 /* LICENSE */ = { + isa = PBXGroup; + children = ( + 187E8B20187E899000000001 /* LICENSE.txt */, + ); + name = LICENSE; + path = ../LICENSE; + sourceTree = ""; + }; + B7394859229F194000C47603 = { + isa = PBXGroup; + children = ( + C4E4AAA0C4E4035000000001 /* README.md */, + B7394864229F194000C47603 /* Landmarks */, + B7394863229F194000C47603 /* Products */, + 1848B9A01848B96000000001 /* Configuration */, + 187E7D00187E74D000000001 /* LICENSE */, + ); + sourceTree = ""; + }; + B7394863229F194000C47603 /* Products */ = { + isa = PBXGroup; + children = ( + B7394862229F194000C47603 /* Landmarks.app */, + ); + name = Products; + sourceTree = ""; + }; + B7394864229F194000C47603 /* Landmarks */ = { + isa = PBXGroup; + children = ( + B739487E229F282200C47603 /* Models */, + B7D587D722A08D16006E8DCF /* Profiles */, + B7394865229F194000C47603 /* AppDelegate.swift */, + B7394867229F194000C47603 /* SceneDelegate.swift */, + B7D587D122A0892C006E8DCF /* Home.swift */, + B7D587D322A08965006E8DCF /* CategoryRow.swift */, + B73948A0229F2E1F00C47603 /* LandmarkList.swift */, + B739489E229F2D9700C47603 /* LandmarkRow.swift */, + B7394869229F194000C47603 /* LandmarkDetail.swift */, + B7D587B5229F825D006E8DCF /* HikeView.swift */, + B7D587BB229F82EB006E8DCF /* HikeDetail.swift */, + B7D587DC22A08DD6006E8DCF /* HikeBadge.swift */, + B7310DD0229F6839001079B9 /* HexagonParameters.swift */, + B739487D229F1C0100C47603 /* Supporting Views */, + B7394883229F291A00C47603 /* Resources */, + B739486B229F194200C47603 /* Assets.xcassets */, + B7394870229F194200C47603 /* LaunchScreen.storyboard */, + B7394873229F194200C47603 /* Info.plist */, + B739486D229F194200C47603 /* Preview Content */, + ); + path = Landmarks; + sourceTree = ""; + }; + B739486D229F194200C47603 /* Preview Content */ = { + isa = PBXGroup; + children = ( + B739486E229F194200C47603 /* Preview Assets.xcassets */, + ); + path = "Preview Content"; + sourceTree = ""; + }; + B739487D229F1C0100C47603 /* Supporting Views */ = { + isa = PBXGroup; + children = ( + B7D587E022A0914D006E8DCF /* FeatureCard.swift */, + B7394879229F1B3F00C47603 /* CircleImage.swift */, + B739487B229F1B6800C47603 /* MapView.swift */, + B7310DD2229F6CA9001079B9 /* Badge.swift */, + B7D587AF229F73C1006E8DCF /* BadgeSymbol.swift */, + B7D587B1229F7406006E8DCF /* RotatedBadgeSymbol.swift */, + B7D587AD229F7382006E8DCF /* BadgeBackground.swift */, + B7D587BD229F82FF006E8DCF /* HikeGraph.swift */, + B7D587B7229F826D006E8DCF /* GraphCapsule.swift */, + ); + path = "Supporting Views"; + sourceTree = ""; + }; + B739487E229F282200C47603 /* Models */ = { + isa = PBXGroup; + children = ( + B7D587D522A08C97006E8DCF /* Profile.swift */, + B739487F229F28B900C47603 /* Landmark.swift */, + B7D587E822A09809006E8DCF /* Data.swift */, + B7D587B9229F8288006E8DCF /* Hike.swift */, + B7D2AAC4229F4D7C0061E5F5 /* UserData.swift */, + ); + path = Models; + sourceTree = ""; + }; + B7394883229F291A00C47603 /* Resources */ = { + isa = PBXGroup; + children = ( + B739488E229F292E00C47603 /* landmarkData.json */, + B7D587BF229F830B006E8DCF /* hikeData.json */, + B7D587E222A097E2006E8DCF /* charleyrivers_feature.jpg */, + B7D587E322A097E2006E8DCF /* stmarylake_feature.jpg */, + B7D587E422A097E2006E8DCF /* turtlerock_feature.jpg */, + B7394890229F292F00C47603 /* chilkoottrail.jpg */, + B739488F229F292F00C47603 /* chincoteague.jpg */, + B739488A229F292E00C47603 /* hiddenlake.jpg */, + B7394886229F292E00C47603 /* icybay.jpg */, + B7394887229F292E00C47603 /* lakemcdonald.jpg */, + B7394884229F292D00C47603 /* rainbowlake.jpg */, + B739488D229F292E00C47603 /* silversalmoncreek.jpg */, + B739488B229F292E00C47603 /* stmarylake.jpg */, + B7394888229F292E00C47603 /* turtlerock.jpg */, + B739488C229F292E00C47603 /* twinlake.jpg */, + B7394889229F292E00C47603 /* umbagog.jpg */, + B73948A2229F3E2200C47603 /* charleyrivers.jpg */, + ); + path = Resources; + sourceTree = ""; + }; + B7D587D722A08D16006E8DCF /* Profiles */ = { + isa = PBXGroup; + children = ( + B7D587D822A08D33006E8DCF /* ProfileHost.swift */, + B7D587DA22A08D67006E8DCF /* ProfileSummary.swift */, + B7D587DE22A08E1A006E8DCF /* ProfileEditor.swift */, + ); + path = Profiles; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + B7394861229F194000C47603 /* Landmarks */ = { + isa = PBXNativeTarget; + buildConfigurationList = B7394876229F194200C47603 /* Build configuration list for PBXNativeTarget "Landmarks" */; + buildPhases = ( + B739485E229F194000C47603 /* Sources */, + B739485F229F194000C47603 /* Frameworks */, + B7394860229F194000C47603 /* Resources */, + C602AC70C605937000000001, + ); + buildRules = ( + ); + dependencies = ( + ); + name = Landmarks; + productName = Landmarks; + productReference = B7394862229F194000C47603 /* Landmarks.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + B739485A229F194000C47603 /* Project object */ = { + isa = PBXProject; + attributes = { + LastSwiftUpdateCheck = 1100; + LastUpgradeCheck = 1100; + ORGANIZATIONNAME = Apple; + TargetAttributes = { + B7394861229F194000C47603 = { + CreatedOnToolsVersion = 11.0; + }; + }; + }; + buildConfigurationList = B739485D229F194000C47603 /* Build configuration list for PBXProject "InterfacingWithUIKit" */; + compatibilityVersion = "Xcode 9.3"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = B7394859229F194000C47603; + productRefGroup = B7394863229F194000C47603 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + B7394861229F194000C47603 /* Landmarks */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + B7394860229F194000C47603 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + B739489A229F292F00C47603 /* silversalmoncreek.jpg in Resources */, + B7394894229F292F00C47603 /* lakemcdonald.jpg in Resources */, + B7D587C0229F830B006E8DCF /* hikeData.json in Resources */, + B7394872229F194200C47603 /* LaunchScreen.storyboard in Resources */, + B73948A3229F3E2200C47603 /* charleyrivers.jpg in Resources */, + B7394891229F292F00C47603 /* rainbowlake.jpg in Resources */, + B7D587E522A097E2006E8DCF /* charleyrivers_feature.jpg in Resources */, + B739486F229F194200C47603 /* Preview Assets.xcassets in Resources */, + B7394895229F292F00C47603 /* turtlerock.jpg in Resources */, + B739486C229F194200C47603 /* Assets.xcassets in Resources */, + B7394899229F292F00C47603 /* twinlake.jpg in Resources */, + B7D587E622A097E2006E8DCF /* stmarylake_feature.jpg in Resources */, + B7394896229F292F00C47603 /* umbagog.jpg in Resources */, + B739489D229F292F00C47603 /* chilkoottrail.jpg in Resources */, + B739489C229F292F00C47603 /* chincoteague.jpg in Resources */, + B739489B229F292F00C47603 /* landmarkData.json in Resources */, + B7394893229F292F00C47603 /* icybay.jpg in Resources */, + B7394897229F292F00C47603 /* hiddenlake.jpg in Resources */, + B7394898229F292F00C47603 /* stmarylake.jpg in Resources */, + B7D587E722A097E2006E8DCF /* turtlerock_feature.jpg in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + B739485E229F194000C47603 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + B7310DD3229F6CA9001079B9 /* Badge.swift in Sources */, + B7D587E122A0914D006E8DCF /* FeatureCard.swift in Sources */, + B7394866229F194000C47603 /* AppDelegate.swift in Sources */, + B7D587D922A08D33006E8DCF /* ProfileHost.swift in Sources */, + B7D587D622A08C97006E8DCF /* Profile.swift in Sources */, + B7D587B8229F826D006E8DCF /* GraphCapsule.swift in Sources */, + B7D587D422A08965006E8DCF /* CategoryRow.swift in Sources */, + B7D587E922A09809006E8DCF /* Data.swift in Sources */, + B739487A229F1B3F00C47603 /* CircleImage.swift in Sources */, + B739487C229F1B6800C47603 /* MapView.swift in Sources */, + B7D587BA229F8288006E8DCF /* Hike.swift in Sources */, + B7D587BC229F82EB006E8DCF /* HikeDetail.swift in Sources */, + B7D587B6229F825D006E8DCF /* HikeView.swift in Sources */, + B7310DD1229F6839001079B9 /* HexagonParameters.swift in Sources */, + B73948A1229F2E1F00C47603 /* LandmarkList.swift in Sources */, + B7D587B0229F73C1006E8DCF /* BadgeSymbol.swift in Sources */, + B7D587B2229F7406006E8DCF /* RotatedBadgeSymbol.swift in Sources */, + B7D587DD22A08DD6006E8DCF /* HikeBadge.swift in Sources */, + B7D587D222A0892C006E8DCF /* Home.swift in Sources */, + B7D587BE229F82FF006E8DCF /* HikeGraph.swift in Sources */, + B7394868229F194000C47603 /* SceneDelegate.swift in Sources */, + B7D587AE229F7382006E8DCF /* BadgeBackground.swift in Sources */, + B739486A229F194000C47603 /* LandmarkDetail.swift in Sources */, + B739489F229F2D9700C47603 /* LandmarkRow.swift in Sources */, + B7D587DB22A08D67006E8DCF /* ProfileSummary.swift in Sources */, + B7D2AAC5229F4D7C0061E5F5 /* UserData.swift in Sources */, + B7394881229F28B900C47603 /* Landmark.swift in Sources */, + B7D587DF22A08E1A006E8DCF /* ProfileEditor.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXVariantGroup section */ + B7394870229F194200C47603 /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + B7394871229F194200C47603 /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + B7394874229F194200C47603 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 184943801849325000000001 /* SampleCode.xcconfig */; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 13.0; + MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; + MTL_FAST_MATH = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + }; + name = Debug; + }; + B7394875229F194200C47603 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 184943801849325000000001 /* SampleCode.xcconfig */; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 13.0; + MTL_ENABLE_DEBUG_INFO = NO; + MTL_FAST_MATH = YES; + SDKROOT = iphoneos; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + B7394877229F194200C47603 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 184943801849325000000001 /* SampleCode.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_ASSET_PATHS = "Landmarks/Preview\\ Content"; + DEVELOPMENT_TEAM = ""; + ENABLE_PREVIEWS = YES; + INFOPLIST_FILE = Landmarks/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = "com.example.apple-samplecode.Landmarks${SAMPLE_CODE_DISAMBIGUATOR}"; + PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE_SPECIFIER = ""; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + B7394878229F194200C47603 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 184943801849325000000001 /* SampleCode.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_ASSET_PATHS = "Landmarks/Preview\\ Content"; + DEVELOPMENT_TEAM = ""; + ENABLE_PREVIEWS = YES; + INFOPLIST_FILE = Landmarks/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = "com.example.apple-samplecode.Landmarks${SAMPLE_CODE_DISAMBIGUATOR}"; + PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE_SPECIFIER = ""; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + B739485D229F194000C47603 /* Build configuration list for PBXProject "InterfacingWithUIKit" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + B7394874229F194200C47603 /* Debug */, + B7394875229F194200C47603 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + B7394876229F194200C47603 /* Build configuration list for PBXNativeTarget "Landmarks" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + B7394877229F194200C47603 /* Debug */, + B7394878229F194200C47603 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = B739485A229F194000C47603 /* Project object */; +} diff --git a/Examples/InterfacingWithUIKit/StartingPoint/Landmarks/InterfacingWithUIKit.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/Examples/InterfacingWithUIKit/StartingPoint/Landmarks/InterfacingWithUIKit.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings new file mode 100755 index 0000000..3ddf867 --- /dev/null +++ b/Examples/InterfacingWithUIKit/StartingPoint/Landmarks/InterfacingWithUIKit.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings @@ -0,0 +1,8 @@ + + + + + BuildSystemType + Latest + + diff --git a/Examples/InterfacingWithUIKit/StartingPoint/Landmarks/Landmarks/AppDelegate.swift b/Examples/InterfacingWithUIKit/StartingPoint/Landmarks/Landmarks/AppDelegate.swift new file mode 100755 index 0000000..e22943b --- /dev/null +++ b/Examples/InterfacingWithUIKit/StartingPoint/Landmarks/Landmarks/AppDelegate.swift @@ -0,0 +1,36 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +The application delegate. +*/ + +import UIKit + +@UIApplicationMain +class AppDelegate: UIResponder, UIApplicationDelegate { + + func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { + // Override point for customization after application launch. + return true + } + + func applicationWillTerminate(_ application: UIApplication) { + // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. + } + + // MARK: UISceneSession Lifecycle + func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration { + // Called when a new scene session is being created. + // Use this method to select a configuration to create the new scene with. + return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role) + } + + func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set) { + // Called when the user discards a scene session. + // If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions. + // Use this method to release any resources that were specific to the discarded scenes, as they will not return. + } + +} + diff --git a/Examples/InterfacingWithUIKit/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/Contents.json b/Examples/InterfacingWithUIKit/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100755 index 0000000..fa0d2db --- /dev/null +++ b/Examples/InterfacingWithUIKit/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,113 @@ +{ + "images" : [ + { + "size" : "20x20", + "idiom" : "iphone", + "filename" : "landmark_app_icon_40x40.png", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "20x20", + "scale" : "3x" + }, + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "landmark_app_icon_58x58.png", + "scale" : "2x" + }, + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "landmark_app_icon_87x87.png", + "scale" : "3x" + }, + { + "size" : "40x40", + "idiom" : "iphone", + "filename" : "landmark_app_icon_80x80.png", + "scale" : "2x" + }, + { + "size" : "40x40", + "idiom" : "iphone", + "filename" : "landmark_app_icon_120x120.png", + "scale" : "3x" + }, + { + "size" : "60x60", + "idiom" : "iphone", + "filename" : "landmark_app_icon_120x120-1.png", + "scale" : "2x" + }, + { + "size" : "60x60", + "idiom" : "iphone", + "filename" : "landmark_app_icon_180x180.png", + "scale" : "3x" + }, + { + "idiom" : "ipad", + "size" : "20x20", + "scale" : "1x" + }, + { + "size" : "20x20", + "idiom" : "ipad", + "filename" : "landmark_app_icon_40x40-1.png", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "29x29", + "scale" : "1x" + }, + { + "size" : "29x29", + "idiom" : "ipad", + "filename" : "landmark_app_icon_58x58-1.png", + "scale" : "2x" + }, + { + "size" : "40x40", + "idiom" : "ipad", + "filename" : "landmark_app_icon_40x40-2.png", + "scale" : "1x" + }, + { + "size" : "40x40", + "idiom" : "ipad", + "filename" : "landmark_app_icon_80x80-1.png", + "scale" : "2x" + }, + { + "size" : "76x76", + "idiom" : "ipad", + "filename" : "landmark_app_icon_76x76.png", + "scale" : "1x" + }, + { + "size" : "76x76", + "idiom" : "ipad", + "filename" : "landmark_app_icon_152x152.png", + "scale" : "2x" + }, + { + "size" : "83.5x83.5", + "idiom" : "ipad", + "filename" : "landmark_app_icon_167x167.png", + "scale" : "2x" + }, + { + "size" : "1024x1024", + "idiom" : "ios-marketing", + "filename" : "landmark_app_icon_1024x1024.png", + "scale" : "1x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Examples/InterfacingWithUIKit/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_1024x1024.png b/Examples/InterfacingWithUIKit/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_1024x1024.png new file mode 100755 index 0000000..00d81c1 Binary files /dev/null and b/Examples/InterfacingWithUIKit/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_1024x1024.png differ diff --git a/Examples/InterfacingWithUIKit/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_120x120-1.png b/Examples/InterfacingWithUIKit/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_120x120-1.png new file mode 100755 index 0000000..d382b8b Binary files /dev/null and b/Examples/InterfacingWithUIKit/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_120x120-1.png differ diff --git a/Examples/InterfacingWithUIKit/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_120x120.png b/Examples/InterfacingWithUIKit/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_120x120.png new file mode 100755 index 0000000..d382b8b Binary files /dev/null and b/Examples/InterfacingWithUIKit/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_120x120.png differ diff --git a/Examples/InterfacingWithUIKit/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_152x152.png b/Examples/InterfacingWithUIKit/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_152x152.png new file mode 100755 index 0000000..11057f8 Binary files /dev/null and b/Examples/InterfacingWithUIKit/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_152x152.png differ diff --git a/Examples/InterfacingWithUIKit/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_167x167.png b/Examples/InterfacingWithUIKit/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_167x167.png new file mode 100755 index 0000000..f73bc26 Binary files /dev/null and b/Examples/InterfacingWithUIKit/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_167x167.png differ diff --git a/Examples/InterfacingWithUIKit/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_180x180.png b/Examples/InterfacingWithUIKit/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_180x180.png new file mode 100755 index 0000000..b02738c Binary files /dev/null and b/Examples/InterfacingWithUIKit/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_180x180.png differ diff --git a/Examples/InterfacingWithUIKit/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_40x40-1.png b/Examples/InterfacingWithUIKit/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_40x40-1.png new file mode 100755 index 0000000..abaff0e Binary files /dev/null and b/Examples/InterfacingWithUIKit/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_40x40-1.png differ diff --git a/Examples/InterfacingWithUIKit/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_40x40-2.png b/Examples/InterfacingWithUIKit/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_40x40-2.png new file mode 100755 index 0000000..abaff0e Binary files /dev/null and b/Examples/InterfacingWithUIKit/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_40x40-2.png differ diff --git a/Examples/InterfacingWithUIKit/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_40x40.png b/Examples/InterfacingWithUIKit/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_40x40.png new file mode 100755 index 0000000..abaff0e Binary files /dev/null and b/Examples/InterfacingWithUIKit/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_40x40.png differ diff --git a/Examples/InterfacingWithUIKit/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_58x58-1.png b/Examples/InterfacingWithUIKit/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_58x58-1.png new file mode 100755 index 0000000..cf7c73d Binary files /dev/null and b/Examples/InterfacingWithUIKit/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_58x58-1.png differ diff --git a/Examples/InterfacingWithUIKit/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_58x58.png b/Examples/InterfacingWithUIKit/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_58x58.png new file mode 100755 index 0000000..cf7c73d Binary files /dev/null and b/Examples/InterfacingWithUIKit/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_58x58.png differ diff --git a/Examples/InterfacingWithUIKit/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_76x76.png b/Examples/InterfacingWithUIKit/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_76x76.png new file mode 100755 index 0000000..3eff85b Binary files /dev/null and b/Examples/InterfacingWithUIKit/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_76x76.png differ diff --git a/Examples/InterfacingWithUIKit/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_80x80-1.png b/Examples/InterfacingWithUIKit/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_80x80-1.png new file mode 100755 index 0000000..6f33f66 Binary files /dev/null and b/Examples/InterfacingWithUIKit/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_80x80-1.png differ diff --git a/Examples/InterfacingWithUIKit/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_80x80.png b/Examples/InterfacingWithUIKit/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_80x80.png new file mode 100755 index 0000000..6f33f66 Binary files /dev/null and b/Examples/InterfacingWithUIKit/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_80x80.png differ diff --git a/Examples/InterfacingWithUIKit/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_87x87.png b/Examples/InterfacingWithUIKit/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_87x87.png new file mode 100755 index 0000000..9e1616c Binary files /dev/null and b/Examples/InterfacingWithUIKit/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_87x87.png differ diff --git a/Examples/InterfacingWithUIKit/StartingPoint/Landmarks/Landmarks/Assets.xcassets/Contents.json b/Examples/InterfacingWithUIKit/StartingPoint/Landmarks/Landmarks/Assets.xcassets/Contents.json new file mode 100755 index 0000000..da4a164 --- /dev/null +++ b/Examples/InterfacingWithUIKit/StartingPoint/Landmarks/Landmarks/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Examples/InterfacingWithUIKit/StartingPoint/Landmarks/Landmarks/Assets.xcassets/turtlerock.imageset/Contents.json b/Examples/InterfacingWithUIKit/StartingPoint/Landmarks/Landmarks/Assets.xcassets/turtlerock.imageset/Contents.json new file mode 100755 index 0000000..5bfd7bf --- /dev/null +++ b/Examples/InterfacingWithUIKit/StartingPoint/Landmarks/Landmarks/Assets.xcassets/turtlerock.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "turtlerock.jpg", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Examples/InterfacingWithUIKit/StartingPoint/Landmarks/Landmarks/Assets.xcassets/turtlerock.imageset/turtlerock.jpg b/Examples/InterfacingWithUIKit/StartingPoint/Landmarks/Landmarks/Assets.xcassets/turtlerock.imageset/turtlerock.jpg new file mode 100755 index 0000000..68bcd3e Binary files /dev/null and b/Examples/InterfacingWithUIKit/StartingPoint/Landmarks/Landmarks/Assets.xcassets/turtlerock.imageset/turtlerock.jpg differ diff --git a/Examples/InterfacingWithUIKit/StartingPoint/Landmarks/Landmarks/Base.lproj/LaunchScreen.storyboard b/Examples/InterfacingWithUIKit/StartingPoint/Landmarks/Landmarks/Base.lproj/LaunchScreen.storyboard new file mode 100755 index 0000000..865e932 --- /dev/null +++ b/Examples/InterfacingWithUIKit/StartingPoint/Landmarks/Landmarks/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Examples/InterfacingWithUIKit/StartingPoint/Landmarks/Landmarks/CategoryRow.swift b/Examples/InterfacingWithUIKit/StartingPoint/Landmarks/Landmarks/CategoryRow.swift new file mode 100755 index 0000000..1f4fbd8 --- /dev/null +++ b/Examples/InterfacingWithUIKit/StartingPoint/Landmarks/Landmarks/CategoryRow.swift @@ -0,0 +1,64 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +A view showing a scrollable list of landmarks. +*/ + +import SwiftUI + +struct CategoryRow: View { + var categoryName: String + var items: [Landmark] + + var body: some View { + VStack(alignment: .leading) { + Text(self.categoryName) + .font(.headline) + .padding(.leading, 15) + .padding(.top, 5) + + ScrollView(showsHorizontalIndicator: false) { + HStack(alignment: .top, spacing: 0) { + ForEach(self.items.identified(by: \.name)) { landmark in + NavigationButton( + destination: LandmarkDetail( + landmark: landmark + ) + ) { + CategoryItem(landmark: landmark) + } + } + } + } + .frame(height: 185) + } + } +} + +struct CategoryItem: View { + var landmark: Landmark + var body: some View { + VStack(alignment: .leading) { + landmark + .image(forSize: 155) + .renderingMode(.original) + .cornerRadius(5) + Text(landmark.name) + .color(.primary) + .font(.caption) + } + .padding(.leading, 15) + } +} + +#if DEBUG +struct CategoryRow_Previews: PreviewProvider { + static var previews: some View { + CategoryRow( + categoryName: landmarkData[0].category.rawValue, + items: Array(landmarkData.prefix(4)) + ) + } +} +#endif diff --git a/Examples/InterfacingWithUIKit/StartingPoint/Landmarks/Landmarks/HexagonParameters.swift b/Examples/InterfacingWithUIKit/StartingPoint/Landmarks/Landmarks/HexagonParameters.swift new file mode 100755 index 0000000..8decba4 --- /dev/null +++ b/Examples/InterfacingWithUIKit/StartingPoint/Landmarks/Landmarks/HexagonParameters.swift @@ -0,0 +1,57 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +Size, position, and other information used to draw a badge. +*/ + +import SwiftUI + +struct HexagonParameters { + struct Segment { + let useWidth: (CGFloat, CGFloat, CGFloat) + let xFactors: (CGFloat, CGFloat, CGFloat) + let useHeight: (CGFloat, CGFloat, CGFloat) + let yFactors: (CGFloat, CGFloat, CGFloat) + } + + static let adjustment: CGFloat = 0.085 + static let points = [ + Segment( + useWidth: (1.00, 1.00, 1.00), + xFactors: (0.60, 0.40, 0.50), + useHeight: (1.00, 1.00, 0.00), + yFactors: (0.05, 0.05, 0.00) + ), + Segment( + useWidth: (1.00, 1.00, 0.00), + xFactors: (0.05, 0.00, 0.00), + useHeight: (1.00, 1.00, 1.00), + yFactors: (0.20 + adjustment, 0.30 + adjustment, 0.25 + adjustment) + ), + Segment( + useWidth: (1.00, 1.00, 0.00), + xFactors: (0.00, 0.05, 0.00), + useHeight: (1.00, 1.00, 1.00), + yFactors: (0.70 - adjustment, 0.80 - adjustment, 0.75 - adjustment) + ), + Segment( + useWidth: (1.00, 1.00, 1.00), + xFactors: (0.40, 0.60, 0.50), + useHeight: (1.00, 1.00, 1.00), + yFactors: (0.95, 0.95, 1.00) + ), + Segment( + useWidth: (1.00, 1.00, 1.00), + xFactors: (0.95, 1.00, 1.00), + useHeight: (1.00, 1.00, 1.00), + yFactors: (0.80 - adjustment, 0.70 - adjustment, 0.75 - adjustment) + ), + Segment( + useWidth: (1.00, 1.00, 1.00), + xFactors: (1.00, 0.95, 1.00), + useHeight: (1.00, 1.00, 1.00), + yFactors: (0.30 + adjustment, 0.20 + adjustment, 0.25 + adjustment) + ) + ] +} diff --git a/Examples/InterfacingWithUIKit/StartingPoint/Landmarks/Landmarks/HikeBadge.swift b/Examples/InterfacingWithUIKit/StartingPoint/Landmarks/Landmarks/HikeBadge.swift new file mode 100755 index 0000000..52716cf --- /dev/null +++ b/Examples/InterfacingWithUIKit/StartingPoint/Landmarks/Landmarks/HikeBadge.swift @@ -0,0 +1,31 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +A view that shows a badge for hiking. +*/ + +import SwiftUI + +struct HikeBadge: View { + var name: String + var body: some View { + VStack(alignment: .center) { + Badge() + .frame(width: 300, height: 300) + .scaleEffect(1.0 / 3.0) + .frame(width: 100, height: 100) + Text(name) + .font(.caption) + .accessibility(label: Text("Badge for \(name).")) + } + } +} + +#if DEBUG +struct HikeBadge_Previews: PreviewProvider { + static var previews: some View { + HikeBadge(name: "Preview Testing") + } +} +#endif diff --git a/Examples/InterfacingWithUIKit/StartingPoint/Landmarks/Landmarks/HikeDetail.swift b/Examples/InterfacingWithUIKit/StartingPoint/Landmarks/Landmarks/HikeDetail.swift new file mode 100755 index 0000000..3406a6d --- /dev/null +++ b/Examples/InterfacingWithUIKit/StartingPoint/Landmarks/Landmarks/HikeDetail.swift @@ -0,0 +1,49 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +A view showing the details for a hike. +*/ + +import SwiftUI + +struct HikeDetail: View { + let hike: Hike + @State var dataToShow = \Hike.Observation.elevation + + var buttons = [ + ("Elevation", \Hike.Observation.elevation), + ("Heart Rate", \Hike.Observation.heartRate), + ("Pace", \Hike.Observation.pace), + ] + + var body: some View { + return VStack { + HikeGraph(hike: hike, path: dataToShow) + .frame(height: 200, alignment: .center) + + HStack(spacing: 25) { + ForEach(buttons.identified(by: \.0)) { value in + Button(action: { + self.dataToShow = value.1 + }) { + Text(verbatim: value.0) + .font(.system(size: 15)) + .color(value.1 == self.dataToShow + ? Color.gray + : Color.accentColor) + .animation(nil) + } + } + } + } + } +} + +#if DEBUG +struct HikeDetail_Previews: PreviewProvider { + static var previews: some View { + HikeDetail(hike: hikeData[0]) + } +} +#endif diff --git a/Examples/InterfacingWithUIKit/StartingPoint/Landmarks/Landmarks/HikeView.swift b/Examples/InterfacingWithUIKit/StartingPoint/Landmarks/Landmarks/HikeView.swift new file mode 100755 index 0000000..f4c02cc --- /dev/null +++ b/Examples/InterfacingWithUIKit/StartingPoint/Landmarks/Landmarks/HikeView.swift @@ -0,0 +1,68 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +A view displaying inforamtion about a hike, including an elevation graph. +*/ + +import SwiftUI + +struct HikeView: View { + var hike: Hike + @State private var showDetail = false + + var transition: AnyTransition { + let insertion = AnyTransition.move(edge: .trailing) + .combined(with: .opacity) + let removal = AnyTransition.scale() + .combined(with: .opacity) + return .asymmetric(insertion: insertion, removal: removal) + } + + var body: some View { + VStack { + HStack { + HikeGraph(hike: hike, path: \.elevation) + .frame(width: 50, height: 30) + .animation(nil) + + VStack(alignment: .leading) { + Text(verbatim: hike.name) + .font(.headline) + Text(verbatim: hike.distanceText) + } + + Spacer() + + Button(action: { + withAnimation { + self.showDetail.toggle() + } + }) { + Image(systemName: "chevron.right.circle") + .imageScale(.large) + .rotationEffect(.degrees(showDetail ? 90 : 0)) + .scaleEffect(showDetail ? 1.5 : 1) + .padding() + } + } + + if showDetail { + HikeDetail(hike: hike) + .transition(transition) + } + } + } +} + +#if DEBUG +struct HikeView_Previews: PreviewProvider { + static var previews: some View { + VStack { + HikeView(hike: hikeData[0]) + .padding() + Spacer() + } + } +} +#endif diff --git a/Examples/InterfacingWithUIKit/StartingPoint/Landmarks/Landmarks/Home.swift b/Examples/InterfacingWithUIKit/StartingPoint/Landmarks/Landmarks/Home.swift new file mode 100755 index 0000000..5237246 --- /dev/null +++ b/Examples/InterfacingWithUIKit/StartingPoint/Landmarks/Landmarks/Home.swift @@ -0,0 +1,67 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +A view showing featured landmarks above a list of all of the landmarks. +*/ + +import SwiftUI + +struct CategoryHome: View { + var categories: [String: [Landmark]] { + .init( + grouping: landmarkData, + by: { $0.category.rawValue } + ) + } + + var featured: [Landmark] { + landmarkData.filter { $0.isFeatured } + } + + var body: some View { + NavigationView { + List { + FeaturedLandmarks(landmarks: featured) + .scaledToFill() + .frame(height: 200) + .clipped() + .listRowInsets(EdgeInsets()) + + ForEach(categories.keys.sorted().identified(by: \.self)) { key in + CategoryRow(categoryName: key, items: self.categories[key]!) + } + .listRowInsets(EdgeInsets()) + + NavigationButton(destination: LandmarkList()) { + Text("See All") + } + } + .navigationBarTitle(Text("Featured")) + .navigationBarItems(trailing: + PresentationButton( + Image(systemName: "person.crop.circle") + .imageScale(.large) + .accessibility(label: Text("User Profile")) + .padding(), + destination: ProfileHost() + ) + ) + } + } +} + +struct FeaturedLandmarks: View { + var landmarks: [Landmark] + var body: some View { + landmarks[0].image(forSize: 250).resizable() + } +} + +#if DEBUG +struct CategoryHome_Previews: PreviewProvider { + static var previews: some View { + CategoryHome() + } +} +#endif diff --git a/Examples/InterfacingWithUIKit/StartingPoint/Landmarks/Landmarks/Info.plist b/Examples/InterfacingWithUIKit/StartingPoint/Landmarks/Landmarks/Info.plist new file mode 100755 index 0000000..e8bb4c6 --- /dev/null +++ b/Examples/InterfacingWithUIKit/StartingPoint/Landmarks/Landmarks/Info.plist @@ -0,0 +1,62 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + $(PRODUCT_BUNDLE_PACKAGE_TYPE) + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1 + LSRequiresIPhoneOS + + UIApplicationSceneManifest + + UIApplicationSupportsMultipleScenes + + UISceneConfigurations + + UIWindowSceneSessionRoleApplication + + + UILaunchStoryboardName + LaunchScreen + UISceneConfigurationName + Default Configuration + UISceneDelegateClassName + $(PRODUCT_MODULE_NAME).SceneDelegate + + + + + UILaunchStoryboardName + LaunchScreen + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/Examples/InterfacingWithUIKit/StartingPoint/Landmarks/Landmarks/LandmarkDetail.swift b/Examples/InterfacingWithUIKit/StartingPoint/Landmarks/Landmarks/LandmarkDetail.swift new file mode 100755 index 0000000..6c290a3 --- /dev/null +++ b/Examples/InterfacingWithUIKit/StartingPoint/Landmarks/Landmarks/LandmarkDetail.swift @@ -0,0 +1,71 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +A view showing the details for a landmark. +*/ + +import SwiftUI + +struct LandmarkDetail: View { + @EnvironmentObject var userData: UserData + var landmark: Landmark + + var landmarkIndex: Int { + userData.landmarks.firstIndex(where: { $0.id == landmark.id })! + } + + var body: some View { + VStack { + MapView(coordinate: landmark.locationCoordinate) + .edgesIgnoringSafeArea(.top) + .frame(height: 300) + + CircleImage(image: landmark.image(forSize: 250)) + .offset(x: 0, y: -130) + .padding(.bottom, -130) + + VStack(alignment: .leading) { + HStack { + Text(verbatim: landmark.name) + .font(.title) + + Button(action: { + self.userData.landmarks[self.landmarkIndex] + .isFavorite.toggle() + }) { + if self.userData.landmarks[self.landmarkIndex] + .isFavorite { + Image(systemName: "star.fill") + .foregroundColor(Color.yellow) + } else { + Image(systemName: "star") + .foregroundColor(Color.gray) + } + } + } + + HStack(alignment: .top) { + Text(verbatim: landmark.park) + .font(.subheadline) + Spacer() + Text(verbatim: landmark.state) + .font(.subheadline) + } + } + .padding() + + Spacer() + } + } +} + +#if DEBUG +struct LandmarkDetail_Preview: PreviewProvider { + static var previews: some View { + let userData = UserData() + return LandmarkDetail(landmark: userData.landmarks[0]) + .environmentObject(userData) + } +} +#endif diff --git a/Examples/InterfacingWithUIKit/StartingPoint/Landmarks/Landmarks/LandmarkList.swift b/Examples/InterfacingWithUIKit/StartingPoint/Landmarks/Landmarks/LandmarkList.swift new file mode 100755 index 0000000..c17b5f3 --- /dev/null +++ b/Examples/InterfacingWithUIKit/StartingPoint/Landmarks/Landmarks/LandmarkList.swift @@ -0,0 +1,45 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +A view showing a list of landmarks. +*/ + +import SwiftUI + +struct LandmarkList: View { + @EnvironmentObject private var userData: UserData + + var body: some View { + NavigationView { + List { + Toggle(isOn: $userData.showFavoritesOnly) { + Text("Show Favorites Only") + } + + ForEach(userData.landmarks) { landmark in + if !self.userData.showFavoritesOnly || landmark.isFavorite { + NavigationButton( + destination: LandmarkDetail(landmark: landmark)) { + LandmarkRow(landmark: landmark) + } + } + } + } + .navigationBarTitle(Text("Landmarks"), displayMode: .large) + } + } +} + +#if DEBUG +struct LandmarksList_Previews: PreviewProvider { + static var previews: some View { + ForEach(["iPhone SE", "iPhone XS Max"].identified(by: \.self)) { deviceName in + LandmarkList() + .previewDevice(PreviewDevice(rawValue: deviceName)) + .previewDisplayName(deviceName) + } + .environmentObject(UserData()) + } +} +#endif diff --git a/Examples/InterfacingWithUIKit/StartingPoint/Landmarks/Landmarks/Models/Data.swift b/Examples/InterfacingWithUIKit/StartingPoint/Landmarks/Landmarks/Models/Data.swift new file mode 100755 index 0000000..761ce0a --- /dev/null +++ b/Examples/InterfacingWithUIKit/StartingPoint/Landmarks/Landmarks/Models/Data.swift @@ -0,0 +1,100 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +Helpers for loading images and data. +*/ + +import Foundation +import CoreLocation +import UIKit +import SwiftUI + +let landmarkData: [Landmark] = load("landmarkData.json") +let features = landmarkData.filter { $0.isFeatured } +let hikeData: [Hike] = load("hikeData.json") + +func load(_ filename: String, as type: T.Type = T.self) -> T { + let data: Data + + guard let file = Bundle.main.url(forResource: filename, withExtension: nil) + else { + fatalError("Couldn't find \(filename) in main bundle.") + } + + do { + data = try Data(contentsOf: file) + } catch { + fatalError("Couldn't load \(filename) from main bundle:\n\(error)") + } + + do { + let decoder = JSONDecoder() + return try decoder.decode(T.self, from: data) + } catch { + fatalError("Couldn't parse \(filename) as \(T.self):\n\(error)") + } +} + +final class ImageStore { + fileprivate typealias _ImageDictionary = [String: [Int: CGImage]] + fileprivate var images: _ImageDictionary = [:] + + fileprivate static var originalSize = 250 + fileprivate static var scale = 2 + + static var shared = ImageStore() + + func image(name: String, size: Int) -> Image { + let index = _guaranteeInitialImage(name: name) + + let sizedImage = images.values[index][size] + ?? _sizeImage(images.values[index][ImageStore.originalSize]!, to: size * ImageStore.scale) + images.values[index][size] = sizedImage + + return Image(sizedImage, scale: Length(ImageStore.scale), label: Text(verbatim: name)) + } + + static func loadImage(name: String) -> CGImage { + guard + let url = Bundle.main.url(forResource: name, withExtension: "jpg"), + let imageSource = CGImageSourceCreateWithURL(url as NSURL, nil), + let image = CGImageSourceCreateImageAtIndex(imageSource, 0, nil) + else { + fatalError("Couldn't load image \(name).jpg from main bundle.") + } + return image + } + + fileprivate func _guaranteeInitialImage(name: String) -> _ImageDictionary.Index { + if let index = images.index(forKey: name) { return index } + + let image = ImageStore.loadImage(name: name) + images[name] = [ImageStore.originalSize: image] + return images.index(forKey: name)! + } + + fileprivate func _sizeImage(_ image: CGImage, to size: Int) -> CGImage { + guard + let colorSpace = image.colorSpace, + let context = CGContext( + data: nil, + width: size, height: size, + bitsPerComponent: image.bitsPerComponent, + bytesPerRow: image.bytesPerRow, + space: colorSpace, + bitmapInfo: image.bitmapInfo.rawValue) + else { + fatalError("Couldn't create graphics context.") + } + context.interpolationQuality = .high + context.draw(image, in: CGRect(x: 0, y: 0, width: size, height: size)) + + if let sizedImage = context.makeImage() { + return sizedImage + } else { + fatalError("Couldn't resize image.") + } + } +} + diff --git a/Examples/InterfacingWithUIKit/StartingPoint/Landmarks/Landmarks/Models/Hike.swift b/Examples/InterfacingWithUIKit/StartingPoint/Landmarks/Landmarks/Models/Hike.swift new file mode 100755 index 0000000..dfd2bb8 --- /dev/null +++ b/Examples/InterfacingWithUIKit/StartingPoint/Landmarks/Landmarks/Models/Hike.swift @@ -0,0 +1,31 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +The model for a hike. +*/ + +import SwiftUI + +struct Hike: Codable, Hashable, Identifiable { + var name: String + var id: Int + var distance: Double + var difficulty: Int + var observations: [Observation] + + static var formatter = LengthFormatter() + + var distanceText: String { + return Hike.formatter + .string(fromValue: distance, unit: .kilometer) + } + + struct Observation: Codable, Hashable { + var distanceFromStart: Double + + var elevation: Range + var pace: Range + var heartRate: Range + } +} diff --git a/Examples/InterfacingWithUIKit/StartingPoint/Landmarks/Landmarks/Models/Landmark.swift b/Examples/InterfacingWithUIKit/StartingPoint/Landmarks/Landmarks/Models/Landmark.swift new file mode 100755 index 0000000..fafe700 --- /dev/null +++ b/Examples/InterfacingWithUIKit/StartingPoint/Landmarks/Landmarks/Models/Landmark.swift @@ -0,0 +1,52 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +The model for an individual landmark. +*/ + +import SwiftUI +import CoreLocation + +struct Landmark: Hashable, Codable, Identifiable { + var id: Int + var name: String + fileprivate var imageName: String + fileprivate var coordinates: Coordinates + var state: String + var park: String + var category: Category + var isFavorite: Bool + var isFeatured: Bool + + var locationCoordinate: CLLocationCoordinate2D { + CLLocationCoordinate2D( + latitude: coordinates.latitude, + longitude: coordinates.longitude) + } + + var featureImage: Image? { + guard isFeatured else { return nil } + + return Image( + ImageStore.loadImage(name: "\(imageName)_feature"), + scale: 2, + label: Text(verbatim: name)) + } + + func image(forSize size: Int) -> Image { + ImageStore.shared.image(name: imageName, size: size) + } + + enum Category: String, CaseIterable, Codable, Hashable { + case featured = "Featured" + case lakes = "Lakes" + case rivers = "Rivers" + case mountains = "Mountains" + } +} + +struct Coordinates: Hashable, Codable { + var latitude: Double + var longitude: Double +} diff --git a/Examples/InterfacingWithUIKit/StartingPoint/Landmarks/Landmarks/Models/Profile.swift b/Examples/InterfacingWithUIKit/StartingPoint/Landmarks/Landmarks/Models/Profile.swift new file mode 100755 index 0000000..7c30519 --- /dev/null +++ b/Examples/InterfacingWithUIKit/StartingPoint/Landmarks/Landmarks/Models/Profile.swift @@ -0,0 +1,30 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +An object that models a user profile. +*/ +import Foundation + +struct Profile { + var username: String + var prefersNotifications: Bool + var seasonalPhoto: Season + var goalDate: Date + + static let `default` = Self(username: "g_kumar", prefersNotifications: true, seasonalPhoto: .winter) + + init(username: String, prefersNotifications: Bool = true, seasonalPhoto: Season = .winter) { + self.username = username + self.prefersNotifications = prefersNotifications + self.seasonalPhoto = seasonalPhoto + self.goalDate = Date() + } + + enum Season: String, CaseIterable { + case spring = "🌷" + case summer = "🌞" + case autumn = "🍂" + case winter = "☃️" + } +} diff --git a/Examples/InterfacingWithUIKit/StartingPoint/Landmarks/Landmarks/Models/UserData.swift b/Examples/InterfacingWithUIKit/StartingPoint/Landmarks/Landmarks/Models/UserData.swift new file mode 100755 index 0000000..db31fb0 --- /dev/null +++ b/Examples/InterfacingWithUIKit/StartingPoint/Landmarks/Landmarks/Models/UserData.swift @@ -0,0 +1,25 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +A model object that stores app data. +*/ + +import Combine +import SwiftUI + +final class UserData: BindableObject { + let didChange = PassthroughSubject() + + var showFavoritesOnly = false { + didSet { + didChange.send(self) + } + } + + var landmarks = landmarkData { + didSet { + didChange.send(self) + } + } +} diff --git a/Examples/InterfacingWithUIKit/StartingPoint/Landmarks/Landmarks/Preview Content/Preview Assets.xcassets/Contents.json b/Examples/InterfacingWithUIKit/StartingPoint/Landmarks/Landmarks/Preview Content/Preview Assets.xcassets/Contents.json new file mode 100755 index 0000000..da4a164 --- /dev/null +++ b/Examples/InterfacingWithUIKit/StartingPoint/Landmarks/Landmarks/Preview Content/Preview Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Examples/InterfacingWithUIKit/StartingPoint/Landmarks/Landmarks/Profiles/ProfileEditor.swift b/Examples/InterfacingWithUIKit/StartingPoint/Landmarks/Landmarks/Profiles/ProfileEditor.swift new file mode 100755 index 0000000..ca4cdda --- /dev/null +++ b/Examples/InterfacingWithUIKit/StartingPoint/Landmarks/Landmarks/Profiles/ProfileEditor.swift @@ -0,0 +1,56 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +An editable profile view. +*/ + +import SwiftUI + +struct ProfileEditor: View { + @Binding var profile: Profile + + var body: some View { + List { + HStack { + Text("Username").bold() + Divider() + TextField($profile.username) + } + + Toggle(isOn: $profile.prefersNotifications) { + Text("Enable Notifications") + } + + VStack(alignment: .leading, spacing: 20) { + Text("Seasonal Photo").bold() + + SegmentedControl(selection: $profile.seasonalPhoto) { + ForEach(Profile.Season.allCases.identified(by: \.self)) { season in + Text(season.rawValue).tag(season) + } + } + } + .padding(.top) + + VStack(alignment: .leading, spacing: 20) { + Text("Goal Date").bold() + DatePicker( + $profile.goalDate, + minimumDate: Calendar.current.date(byAdding: .year, value: -1, to: profile.goalDate), + maximumDate: Calendar.current.date(byAdding: .year, value: 1, to: profile.goalDate), + displayedComponents: .date + ) + } + .padding(.top) + } + } +} + +#if DEBUG +struct ProfileEditor_Previews: PreviewProvider { + static var previews: some View { + ProfileEditor(profile: .constant(.default)) + } +} +#endif diff --git a/Examples/InterfacingWithUIKit/StartingPoint/Landmarks/Landmarks/Profiles/ProfileHost.swift b/Examples/InterfacingWithUIKit/StartingPoint/Landmarks/Landmarks/Profiles/ProfileHost.swift new file mode 100755 index 0000000..534c771 --- /dev/null +++ b/Examples/InterfacingWithUIKit/StartingPoint/Landmarks/Landmarks/Profiles/ProfileHost.swift @@ -0,0 +1,50 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +A view that hosts the profile viewer and editor. +*/ + +import SwiftUI + +struct ProfileHost: View { + @Environment(\.editMode) var mode + @State var profile = Profile.default + @State var draftProfile = Profile.default + + var body: some View { + VStack(alignment: .leading, spacing: 20) { + HStack { + if self.mode?.value == .active { + Button(action: { + self.profile = self.draftProfile + self.mode?.animation().value = .inactive + }) { + Text("Done") + } + } + + Spacer() + + EditButton() + } + if self.mode?.value == .inactive { + ProfileSummary(profile: profile) + } else { + ProfileEditor(profile: $draftProfile) + .onDisappear { + self.draftProfile = self.profile + } + } + } + .padding() + } +} + +#if DEBUG +struct ProfileHost_Previews: PreviewProvider { + static var previews: some View { + ProfileHost() + } +} +#endif diff --git a/Examples/InterfacingWithUIKit/StartingPoint/Landmarks/Landmarks/Profiles/ProfileSummary.swift b/Examples/InterfacingWithUIKit/StartingPoint/Landmarks/Landmarks/Profiles/ProfileSummary.swift new file mode 100755 index 0000000..6d31231 --- /dev/null +++ b/Examples/InterfacingWithUIKit/StartingPoint/Landmarks/Landmarks/Profiles/ProfileSummary.swift @@ -0,0 +1,65 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +A view that summarizes a profile. +*/ + +import SwiftUI + +struct ProfileSummary: View { + var profile: Profile + + static var goalFormat: DateFormatter { + let formatter = DateFormatter() + formatter.dateFormat = "MMMM d, yyyy" + return formatter + } + + var body: some View { + List { + Text(profile.username) + .bold() + .font(.title) + + Text("Notifications: \(self.profile.prefersNotifications ? "On": "Off" )") + + Text("Seasonal Photos: \(self.profile.seasonalPhoto.rawValue)") + + Text("Goal Date: \(self.profile.goalDate, formatter: Self.goalFormat)") + + VStack(alignment: .leading) { + Text("Completed Badges") + .font(.headline) + ScrollView { + HStack { + HikeBadge(name: "First Hike") + + HikeBadge(name: "Earth Day") + .hueRotation(Angle(degrees: 90)) + + HikeBadge(name: "Tenth Hike") + .grayscale(0.5) + .hueRotation(Angle(degrees: 45)) + } + } + .frame(height: 140) + } + + VStack(alignment: .leading) { + Text("Recent Hikes") + .font(.headline) + + HikeView(hike: hikeData[0]) + } + } + } +} + +#if DEBUG +struct ProfileSummary_Previews: PreviewProvider { + static var previews: some View { + ProfileSummary(profile: Profile.default) + } +} +#endif diff --git a/Examples/InterfacingWithUIKit/StartingPoint/Landmarks/Landmarks/Resources/charleyrivers.jpg b/Examples/InterfacingWithUIKit/StartingPoint/Landmarks/Landmarks/Resources/charleyrivers.jpg new file mode 100755 index 0000000..17ff44b Binary files /dev/null and b/Examples/InterfacingWithUIKit/StartingPoint/Landmarks/Landmarks/Resources/charleyrivers.jpg differ diff --git a/Examples/InterfacingWithUIKit/StartingPoint/Landmarks/Landmarks/Resources/charleyrivers_feature.jpg b/Examples/InterfacingWithUIKit/StartingPoint/Landmarks/Landmarks/Resources/charleyrivers_feature.jpg new file mode 100755 index 0000000..af1d114 Binary files /dev/null and b/Examples/InterfacingWithUIKit/StartingPoint/Landmarks/Landmarks/Resources/charleyrivers_feature.jpg differ diff --git a/Examples/InterfacingWithUIKit/StartingPoint/Landmarks/Landmarks/Resources/chilkoottrail.jpg b/Examples/InterfacingWithUIKit/StartingPoint/Landmarks/Landmarks/Resources/chilkoottrail.jpg new file mode 100755 index 0000000..e7f805e Binary files /dev/null and b/Examples/InterfacingWithUIKit/StartingPoint/Landmarks/Landmarks/Resources/chilkoottrail.jpg differ diff --git a/Examples/InterfacingWithUIKit/StartingPoint/Landmarks/Landmarks/Resources/chincoteague.jpg b/Examples/InterfacingWithUIKit/StartingPoint/Landmarks/Landmarks/Resources/chincoteague.jpg new file mode 100755 index 0000000..5f47986 Binary files /dev/null and b/Examples/InterfacingWithUIKit/StartingPoint/Landmarks/Landmarks/Resources/chincoteague.jpg differ diff --git a/Examples/InterfacingWithUIKit/StartingPoint/Landmarks/Landmarks/Resources/hiddenlake.jpg b/Examples/InterfacingWithUIKit/StartingPoint/Landmarks/Landmarks/Resources/hiddenlake.jpg new file mode 100755 index 0000000..d8e804c Binary files /dev/null and b/Examples/InterfacingWithUIKit/StartingPoint/Landmarks/Landmarks/Resources/hiddenlake.jpg differ diff --git a/Examples/InterfacingWithUIKit/StartingPoint/Landmarks/Landmarks/Resources/hikeData.json b/Examples/InterfacingWithUIKit/StartingPoint/Landmarks/Landmarks/Resources/hikeData.json new file mode 100755 index 0000000..3fb1e96 --- /dev/null +++ b/Examples/InterfacingWithUIKit/StartingPoint/Landmarks/Landmarks/Resources/hikeData.json @@ -0,0 +1,1882 @@ +[ + { + "name":"Lonesome Ridge Trail", + "id":1001, + "distance":4.5, + "difficulty":3, + "observations":[ + { + "elevation":[ + 291.65263635636268, + 309.26016677925196 + ], + "pace":[ + 396.08716481908732, + 403.68937873525232 + ], + "heartRate":[ + 117.16351898665887, + 121.95815455919609 + ], + "distanceFromStart":0 + }, + { + "elevation":[ + 299.24001936628116, + 317.44584350790012 + ], + "pace":[ + 380.19020240756623, + 395.3978319010256 + ], + "heartRate":[ + 117.6410892152911, + 124.82185220506081 + ], + "distanceFromStart":0.375 + }, + { + "elevation":[ + 303.62145464574394, + 336.05569457646544 + ], + "pace":[ + 380.55927782266116, + 397.60789726832775 + ], + "heartRate":[ + 121.52696452049059, + 127.31525441110122 + ], + "distanceFromStart":0.75 + }, + { + "elevation":[ + 319.90393365162629, + 346.26966025518789 + ], + "pace":[ + 357.94116421258531, + 398.0750288648062 + ], + "heartRate":[ + 123.75908585923588, + 132.77069404486801 + ], + "distanceFromStart":1.125 + }, + { + "elevation":[ + 354.17104439267905, + 403.57031216972939 + ], + "pace":[ + 335.07385149392701, + 397.82674381875808 + ], + "heartRate":[ + 130.8235194572915, + 140.55700591418218 + ], + "distanceFromStart":1.5 + }, + { + "elevation":[ + 357.42992871175124, + 385.92155620623635 + ], + "pace":[ + 395.16168913839374, + 404.60294066527558 + ], + "heartRate":[ + 131.5456052446734, + 134.65984504627627 + ], + "distanceFromStart":1.875 + }, + { + "elevation":[ + 345.47736721935661, + 363.18776661379422 + ], + "pace":[ + 340.82303041339082, + 404.71689228682374 + ], + "heartRate":[ + 125.1949698433959, + 131.31354363122026 + ], + "distanceFromStart":2.25 + }, + { + "elevation":[ + 346.23343025200535, + 497.23376445462401 + ], + "pace":[ + 261.27629148816021, + 331.68516208719467 + ], + "heartRate":[ + 131.67810544238606, + 154.26779645311458 + ], + "distanceFromStart":2.625 + }, + { + "elevation":[ + 491.57378483134391, + 547.49535224251053 + ], + "pace":[ + 296.05298644112088, + 401.14092967732398 + ], + "heartRate":[ + 151.36398089694217, + 166.20454793289232 + ], + "distanceFromStart":3 + }, + { + "elevation":[ + 472.06803233416338, + 531.92570520228401 + ], + "pace":[ + 395.50830663514012, + 401.67837917543591 + ], + "heartRate":[ + 134.41798110234078, + 151.90886697564241 + ], + "distanceFromStart":3.375 + }, + { + "elevation":[ + 339.81419476005283, + 461.03832527824829 + ], + "pace":[ + 395.31160487975183, + 404.49550455974907 + ], + "heartRate":[ + 129.97753472415462, + 138.13531094848992 + ], + "distanceFromStart":3.75 + }, + { + "elevation":[ + 303.1495508565697, + 342.3532820173541 + ], + "pace":[ + 395.02844559698116, + 402.65878340653796 + ], + "heartRate":[ + 127.72304232462609, + 133.26322270764186 + ], + "distanceFromStart":4.125 + } + ] + }, + { + "name":"Lonesome Ridge Trail", + "id":1002, + "distance":4.5, + "difficulty":3, + "observations":[ + { + "elevation":[ + 291.65263635636268, + 309.26016677925196 + ], + "pace":[ + 396.08716481908732, + 403.68937873525232 + ], + "heartRate":[ + 117.16351898665887, + 121.95815455919609 + ], + "distanceFromStart":0 + }, + { + "elevation":[ + 299.24001936628116, + 317.44584350790012 + ], + "pace":[ + 380.19020240756623, + 395.3978319010256 + ], + "heartRate":[ + 117.6410892152911, + 124.82185220506081 + ], + "distanceFromStart":0.375 + }, + { + "elevation":[ + 303.62145464574394, + 336.05569457646544 + ], + "pace":[ + 380.55927782266116, + 397.60789726832775 + ], + "heartRate":[ + 121.52696452049059, + 127.31525441110122 + ], + "distanceFromStart":0.75 + }, + { + "elevation":[ + 319.90393365162629, + 346.26966025518789 + ], + "pace":[ + 357.94116421258531, + 398.0750288648062 + ], + "heartRate":[ + 123.75908585923588, + 132.77069404486801 + ], + "distanceFromStart":1.125 + }, + { + "elevation":[ + 354.17104439267905, + 403.57031216972939 + ], + "pace":[ + 335.07385149392701, + 397.82674381875808 + ], + "heartRate":[ + 130.8235194572915, + 140.55700591418218 + ], + "distanceFromStart":1.5 + }, + { + "elevation":[ + 357.42992871175124, + 385.92155620623635 + ], + "pace":[ + 395.16168913839374, + 404.60294066527558 + ], + "heartRate":[ + 131.5456052446734, + 134.65984504627627 + ], + "distanceFromStart":1.875 + }, + { + "elevation":[ + 345.47736721935661, + 363.18776661379422 + ], + "pace":[ + 340.82303041339082, + 404.71689228682374 + ], + "heartRate":[ + 125.1949698433959, + 131.31354363122026 + ], + "distanceFromStart":2.25 + }, + { + "elevation":[ + 346.23343025200535, + 497.23376445462401 + ], + "pace":[ + 261.27629148816021, + 331.68516208719467 + ], + "heartRate":[ + 131.67810544238606, + 154.26779645311458 + ], + "distanceFromStart":2.625 + }, + { + "elevation":[ + 491.57378483134391, + 547.49535224251053 + ], + "pace":[ + 296.05298644112088, + 401.14092967732398 + ], + "heartRate":[ + 151.36398089694217, + 166.20454793289232 + ], + "distanceFromStart":3 + }, + { + "elevation":[ + 472.06803233416338, + 531.92570520228401 + ], + "pace":[ + 395.50830663514012, + 401.67837917543591 + ], + "heartRate":[ + 134.41798110234078, + 151.90886697564241 + ], + "distanceFromStart":3.375 + }, + { + "elevation":[ + 339.81419476005283, + 461.03832527824829 + ], + "pace":[ + 395.31160487975183, + 404.49550455974907 + ], + "heartRate":[ + 129.97753472415462, + 138.13531094848992 + ], + "distanceFromStart":3.75 + }, + { + "elevation":[ + 303.1495508565697, + 342.3532820173541 + ], + "pace":[ + 395.02844559698116, + 402.65878340653796 + ], + "heartRate":[ + 127.72304232462609, + 133.26322270764186 + ], + "distanceFromStart":4.125 + } + ] + }, + { + "name":"Lonesome Ridge Trail", + "id":1003, + "distance":4.5, + "difficulty":3, + "observations":[ + { + "elevation":[ + 291.65263635636268, + 309.26016677925196 + ], + "pace":[ + 396.08716481908732, + 403.68937873525232 + ], + "heartRate":[ + 117.16351898665887, + 121.95815455919609 + ], + "distanceFromStart":0 + }, + { + "elevation":[ + 299.24001936628116, + 317.44584350790012 + ], + "pace":[ + 380.19020240756623, + 395.3978319010256 + ], + "heartRate":[ + 117.6410892152911, + 124.82185220506081 + ], + "distanceFromStart":0.375 + }, + { + "elevation":[ + 303.62145464574394, + 336.05569457646544 + ], + "pace":[ + 380.55927782266116, + 397.60789726832775 + ], + "heartRate":[ + 121.52696452049059, + 127.31525441110122 + ], + "distanceFromStart":0.75 + }, + { + "elevation":[ + 319.90393365162629, + 346.26966025518789 + ], + "pace":[ + 357.94116421258531, + 398.0750288648062 + ], + "heartRate":[ + 123.75908585923588, + 132.77069404486801 + ], + "distanceFromStart":1.125 + }, + { + "elevation":[ + 354.17104439267905, + 403.57031216972939 + ], + "pace":[ + 335.07385149392701, + 397.82674381875808 + ], + "heartRate":[ + 130.8235194572915, + 140.55700591418218 + ], + "distanceFromStart":1.5 + }, + { + "elevation":[ + 357.42992871175124, + 385.92155620623635 + ], + "pace":[ + 395.16168913839374, + 404.60294066527558 + ], + "heartRate":[ + 131.5456052446734, + 134.65984504627627 + ], + "distanceFromStart":1.875 + }, + { + "elevation":[ + 345.47736721935661, + 363.18776661379422 + ], + "pace":[ + 340.82303041339082, + 404.71689228682374 + ], + "heartRate":[ + 125.1949698433959, + 131.31354363122026 + ], + "distanceFromStart":2.25 + }, + { + "elevation":[ + 346.23343025200535, + 497.23376445462401 + ], + "pace":[ + 261.27629148816021, + 331.68516208719467 + ], + "heartRate":[ + 131.67810544238606, + 154.26779645311458 + ], + "distanceFromStart":2.625 + }, + { + "elevation":[ + 491.57378483134391, + 547.49535224251053 + ], + "pace":[ + 296.05298644112088, + 401.14092967732398 + ], + "heartRate":[ + 151.36398089694217, + 166.20454793289232 + ], + "distanceFromStart":3 + }, + { + "elevation":[ + 472.06803233416338, + 531.92570520228401 + ], + "pace":[ + 395.50830663514012, + 401.67837917543591 + ], + "heartRate":[ + 134.41798110234078, + 151.90886697564241 + ], + "distanceFromStart":3.375 + }, + { + "elevation":[ + 339.81419476005283, + 461.03832527824829 + ], + "pace":[ + 395.31160487975183, + 404.49550455974907 + ], + "heartRate":[ + 129.97753472415462, + 138.13531094848992 + ], + "distanceFromStart":3.75 + }, + { + "elevation":[ + 303.1495508565697, + 342.3532820173541 + ], + "pace":[ + 395.02844559698116, + 402.65878340653796 + ], + "heartRate":[ + 127.72304232462609, + 133.26322270764186 + ], + "distanceFromStart":4.125 + } + ] + }, + { + "name":"Lonesome Ridge Trail", + "id":1004, + "distance":4.5, + "difficulty":3, + "observations":[ + { + "elevation":[ + 291.65263635636268, + 309.26016677925196 + ], + "pace":[ + 396.08716481908732, + 403.68937873525232 + ], + "heartRate":[ + 117.16351898665887, + 121.95815455919609 + ], + "distanceFromStart":0 + }, + { + "elevation":[ + 299.24001936628116, + 317.44584350790012 + ], + "pace":[ + 380.19020240756623, + 395.3978319010256 + ], + "heartRate":[ + 117.6410892152911, + 124.82185220506081 + ], + "distanceFromStart":0.375 + }, + { + "elevation":[ + 303.62145464574394, + 336.05569457646544 + ], + "pace":[ + 380.55927782266116, + 397.60789726832775 + ], + "heartRate":[ + 121.52696452049059, + 127.31525441110122 + ], + "distanceFromStart":0.75 + }, + { + "elevation":[ + 319.90393365162629, + 346.26966025518789 + ], + "pace":[ + 357.94116421258531, + 398.0750288648062 + ], + "heartRate":[ + 123.75908585923588, + 132.77069404486801 + ], + "distanceFromStart":1.125 + }, + { + "elevation":[ + 354.17104439267905, + 403.57031216972939 + ], + "pace":[ + 335.07385149392701, + 397.82674381875808 + ], + "heartRate":[ + 130.8235194572915, + 140.55700591418218 + ], + "distanceFromStart":1.5 + }, + { + "elevation":[ + 357.42992871175124, + 385.92155620623635 + ], + "pace":[ + 395.16168913839374, + 404.60294066527558 + ], + "heartRate":[ + 131.5456052446734, + 134.65984504627627 + ], + "distanceFromStart":1.875 + }, + { + "elevation":[ + 345.47736721935661, + 363.18776661379422 + ], + "pace":[ + 340.82303041339082, + 404.71689228682374 + ], + "heartRate":[ + 125.1949698433959, + 131.31354363122026 + ], + "distanceFromStart":2.25 + }, + { + "elevation":[ + 346.23343025200535, + 497.23376445462401 + ], + "pace":[ + 261.27629148816021, + 331.68516208719467 + ], + "heartRate":[ + 131.67810544238606, + 154.26779645311458 + ], + "distanceFromStart":2.625 + }, + { + "elevation":[ + 491.57378483134391, + 547.49535224251053 + ], + "pace":[ + 296.05298644112088, + 401.14092967732398 + ], + "heartRate":[ + 151.36398089694217, + 166.20454793289232 + ], + "distanceFromStart":3 + }, + { + "elevation":[ + 472.06803233416338, + 531.92570520228401 + ], + "pace":[ + 395.50830663514012, + 401.67837917543591 + ], + "heartRate":[ + 134.41798110234078, + 151.90886697564241 + ], + "distanceFromStart":3.375 + }, + { + "elevation":[ + 339.81419476005283, + 461.03832527824829 + ], + "pace":[ + 395.31160487975183, + 404.49550455974907 + ], + "heartRate":[ + 129.97753472415462, + 138.13531094848992 + ], + "distanceFromStart":3.75 + }, + { + "elevation":[ + 303.1495508565697, + 342.3532820173541 + ], + "pace":[ + 395.02844559698116, + 402.65878340653796 + ], + "heartRate":[ + 127.72304232462609, + 133.26322270764186 + ], + "distanceFromStart":4.125 + } + ] + }, + { + "name":"Lonesome Ridge Trail", + "id":1005, + "distance":4.5, + "difficulty":3, + "observations":[ + { + "elevation":[ + 291.65263635636268, + 309.26016677925196 + ], + "pace":[ + 396.08716481908732, + 403.68937873525232 + ], + "heartRate":[ + 117.16351898665887, + 121.95815455919609 + ], + "distanceFromStart":0 + }, + { + "elevation":[ + 299.24001936628116, + 317.44584350790012 + ], + "pace":[ + 380.19020240756623, + 395.3978319010256 + ], + "heartRate":[ + 117.6410892152911, + 124.82185220506081 + ], + "distanceFromStart":0.375 + }, + { + "elevation":[ + 303.62145464574394, + 336.05569457646544 + ], + "pace":[ + 380.55927782266116, + 397.60789726832775 + ], + "heartRate":[ + 121.52696452049059, + 127.31525441110122 + ], + "distanceFromStart":0.75 + }, + { + "elevation":[ + 319.90393365162629, + 346.26966025518789 + ], + "pace":[ + 357.94116421258531, + 398.0750288648062 + ], + "heartRate":[ + 123.75908585923588, + 132.77069404486801 + ], + "distanceFromStart":1.125 + }, + { + "elevation":[ + 354.17104439267905, + 403.57031216972939 + ], + "pace":[ + 335.07385149392701, + 397.82674381875808 + ], + "heartRate":[ + 130.8235194572915, + 140.55700591418218 + ], + "distanceFromStart":1.5 + }, + { + "elevation":[ + 357.42992871175124, + 385.92155620623635 + ], + "pace":[ + 395.16168913839374, + 404.60294066527558 + ], + "heartRate":[ + 131.5456052446734, + 134.65984504627627 + ], + "distanceFromStart":1.875 + }, + { + "elevation":[ + 345.47736721935661, + 363.18776661379422 + ], + "pace":[ + 340.82303041339082, + 404.71689228682374 + ], + "heartRate":[ + 125.1949698433959, + 131.31354363122026 + ], + "distanceFromStart":2.25 + }, + { + "elevation":[ + 346.23343025200535, + 497.23376445462401 + ], + "pace":[ + 261.27629148816021, + 331.68516208719467 + ], + "heartRate":[ + 131.67810544238606, + 154.26779645311458 + ], + "distanceFromStart":2.625 + }, + { + "elevation":[ + 491.57378483134391, + 547.49535224251053 + ], + "pace":[ + 296.05298644112088, + 401.14092967732398 + ], + "heartRate":[ + 151.36398089694217, + 166.20454793289232 + ], + "distanceFromStart":3 + }, + { + "elevation":[ + 472.06803233416338, + 531.92570520228401 + ], + "pace":[ + 395.50830663514012, + 401.67837917543591 + ], + "heartRate":[ + 134.41798110234078, + 151.90886697564241 + ], + "distanceFromStart":3.375 + }, + { + "elevation":[ + 339.81419476005283, + 461.03832527824829 + ], + "pace":[ + 395.31160487975183, + 404.49550455974907 + ], + "heartRate":[ + 129.97753472415462, + 138.13531094848992 + ], + "distanceFromStart":3.75 + }, + { + "elevation":[ + 303.1495508565697, + 342.3532820173541 + ], + "pace":[ + 395.02844559698116, + 402.65878340653796 + ], + "heartRate":[ + 127.72304232462609, + 133.26322270764186 + ], + "distanceFromStart":4.125 + } + ] + }, + { + "name":"Lonesome Ridge Trail", + "id":1006, + "distance":4.5, + "difficulty":3, + "observations":[ + { + "elevation":[ + 291.65263635636268, + 309.26016677925196 + ], + "pace":[ + 396.08716481908732, + 403.68937873525232 + ], + "heartRate":[ + 117.16351898665887, + 121.95815455919609 + ], + "distanceFromStart":0 + }, + { + "elevation":[ + 299.24001936628116, + 317.44584350790012 + ], + "pace":[ + 380.19020240756623, + 395.3978319010256 + ], + "heartRate":[ + 117.6410892152911, + 124.82185220506081 + ], + "distanceFromStart":0.375 + }, + { + "elevation":[ + 303.62145464574394, + 336.05569457646544 + ], + "pace":[ + 380.55927782266116, + 397.60789726832775 + ], + "heartRate":[ + 121.52696452049059, + 127.31525441110122 + ], + "distanceFromStart":0.75 + }, + { + "elevation":[ + 319.90393365162629, + 346.26966025518789 + ], + "pace":[ + 357.94116421258531, + 398.0750288648062 + ], + "heartRate":[ + 123.75908585923588, + 132.77069404486801 + ], + "distanceFromStart":1.125 + }, + { + "elevation":[ + 354.17104439267905, + 403.57031216972939 + ], + "pace":[ + 335.07385149392701, + 397.82674381875808 + ], + "heartRate":[ + 130.8235194572915, + 140.55700591418218 + ], + "distanceFromStart":1.5 + }, + { + "elevation":[ + 357.42992871175124, + 385.92155620623635 + ], + "pace":[ + 395.16168913839374, + 404.60294066527558 + ], + "heartRate":[ + 131.5456052446734, + 134.65984504627627 + ], + "distanceFromStart":1.875 + }, + { + "elevation":[ + 345.47736721935661, + 363.18776661379422 + ], + "pace":[ + 340.82303041339082, + 404.71689228682374 + ], + "heartRate":[ + 125.1949698433959, + 131.31354363122026 + ], + "distanceFromStart":2.25 + }, + { + "elevation":[ + 346.23343025200535, + 497.23376445462401 + ], + "pace":[ + 261.27629148816021, + 331.68516208719467 + ], + "heartRate":[ + 131.67810544238606, + 154.26779645311458 + ], + "distanceFromStart":2.625 + }, + { + "elevation":[ + 491.57378483134391, + 547.49535224251053 + ], + "pace":[ + 296.05298644112088, + 401.14092967732398 + ], + "heartRate":[ + 151.36398089694217, + 166.20454793289232 + ], + "distanceFromStart":3 + }, + { + "elevation":[ + 472.06803233416338, + 531.92570520228401 + ], + "pace":[ + 395.50830663514012, + 401.67837917543591 + ], + "heartRate":[ + 134.41798110234078, + 151.90886697564241 + ], + "distanceFromStart":3.375 + }, + { + "elevation":[ + 339.81419476005283, + 461.03832527824829 + ], + "pace":[ + 395.31160487975183, + 404.49550455974907 + ], + "heartRate":[ + 129.97753472415462, + 138.13531094848992 + ], + "distanceFromStart":3.75 + }, + { + "elevation":[ + 303.1495508565697, + 342.3532820173541 + ], + "pace":[ + 395.02844559698116, + 402.65878340653796 + ], + "heartRate":[ + 127.72304232462609, + 133.26322270764186 + ], + "distanceFromStart":4.125 + } + ] + }, + { + "name":"Lonesome Ridge Trail", + "id":1007, + "distance":4.5, + "difficulty":3, + "observations":[ + { + "elevation":[ + 291.65263635636268, + 309.26016677925196 + ], + "pace":[ + 396.08716481908732, + 403.68937873525232 + ], + "heartRate":[ + 117.16351898665887, + 121.95815455919609 + ], + "distanceFromStart":0 + }, + { + "elevation":[ + 299.24001936628116, + 317.44584350790012 + ], + "pace":[ + 380.19020240756623, + 395.3978319010256 + ], + "heartRate":[ + 117.6410892152911, + 124.82185220506081 + ], + "distanceFromStart":0.375 + }, + { + "elevation":[ + 303.62145464574394, + 336.05569457646544 + ], + "pace":[ + 380.55927782266116, + 397.60789726832775 + ], + "heartRate":[ + 121.52696452049059, + 127.31525441110122 + ], + "distanceFromStart":0.75 + }, + { + "elevation":[ + 319.90393365162629, + 346.26966025518789 + ], + "pace":[ + 357.94116421258531, + 398.0750288648062 + ], + "heartRate":[ + 123.75908585923588, + 132.77069404486801 + ], + "distanceFromStart":1.125 + }, + { + "elevation":[ + 354.17104439267905, + 403.57031216972939 + ], + "pace":[ + 335.07385149392701, + 397.82674381875808 + ], + "heartRate":[ + 130.8235194572915, + 140.55700591418218 + ], + "distanceFromStart":1.5 + }, + { + "elevation":[ + 357.42992871175124, + 385.92155620623635 + ], + "pace":[ + 395.16168913839374, + 404.60294066527558 + ], + "heartRate":[ + 131.5456052446734, + 134.65984504627627 + ], + "distanceFromStart":1.875 + }, + { + "elevation":[ + 345.47736721935661, + 363.18776661379422 + ], + "pace":[ + 340.82303041339082, + 404.71689228682374 + ], + "heartRate":[ + 125.1949698433959, + 131.31354363122026 + ], + "distanceFromStart":2.25 + }, + { + "elevation":[ + 346.23343025200535, + 497.23376445462401 + ], + "pace":[ + 261.27629148816021, + 331.68516208719467 + ], + "heartRate":[ + 131.67810544238606, + 154.26779645311458 + ], + "distanceFromStart":2.625 + }, + { + "elevation":[ + 491.57378483134391, + 547.49535224251053 + ], + "pace":[ + 296.05298644112088, + 401.14092967732398 + ], + "heartRate":[ + 151.36398089694217, + 166.20454793289232 + ], + "distanceFromStart":3 + }, + { + "elevation":[ + 472.06803233416338, + 531.92570520228401 + ], + "pace":[ + 395.50830663514012, + 401.67837917543591 + ], + "heartRate":[ + 134.41798110234078, + 151.90886697564241 + ], + "distanceFromStart":3.375 + }, + { + "elevation":[ + 339.81419476005283, + 461.03832527824829 + ], + "pace":[ + 395.31160487975183, + 404.49550455974907 + ], + "heartRate":[ + 129.97753472415462, + 138.13531094848992 + ], + "distanceFromStart":3.75 + }, + { + "elevation":[ + 303.1495508565697, + 342.3532820173541 + ], + "pace":[ + 395.02844559698116, + 402.65878340653796 + ], + "heartRate":[ + 127.72304232462609, + 133.26322270764186 + ], + "distanceFromStart":4.125 + } + ] + }, + { + "name":"Lonesome Ridge Trail", + "id":1008, + "distance":4.5, + "difficulty":3, + "observations":[ + { + "elevation":[ + 291.65263635636268, + 309.26016677925196 + ], + "pace":[ + 396.08716481908732, + 403.68937873525232 + ], + "heartRate":[ + 117.16351898665887, + 121.95815455919609 + ], + "distanceFromStart":0 + }, + { + "elevation":[ + 299.24001936628116, + 317.44584350790012 + ], + "pace":[ + 380.19020240756623, + 395.3978319010256 + ], + "heartRate":[ + 117.6410892152911, + 124.82185220506081 + ], + "distanceFromStart":0.375 + }, + { + "elevation":[ + 303.62145464574394, + 336.05569457646544 + ], + "pace":[ + 380.55927782266116, + 397.60789726832775 + ], + "heartRate":[ + 121.52696452049059, + 127.31525441110122 + ], + "distanceFromStart":0.75 + }, + { + "elevation":[ + 319.90393365162629, + 346.26966025518789 + ], + "pace":[ + 357.94116421258531, + 398.0750288648062 + ], + "heartRate":[ + 123.75908585923588, + 132.77069404486801 + ], + "distanceFromStart":1.125 + }, + { + "elevation":[ + 354.17104439267905, + 403.57031216972939 + ], + "pace":[ + 335.07385149392701, + 397.82674381875808 + ], + "heartRate":[ + 130.8235194572915, + 140.55700591418218 + ], + "distanceFromStart":1.5 + }, + { + "elevation":[ + 357.42992871175124, + 385.92155620623635 + ], + "pace":[ + 395.16168913839374, + 404.60294066527558 + ], + "heartRate":[ + 131.5456052446734, + 134.65984504627627 + ], + "distanceFromStart":1.875 + }, + { + "elevation":[ + 345.47736721935661, + 363.18776661379422 + ], + "pace":[ + 340.82303041339082, + 404.71689228682374 + ], + "heartRate":[ + 125.1949698433959, + 131.31354363122026 + ], + "distanceFromStart":2.25 + }, + { + "elevation":[ + 346.23343025200535, + 497.23376445462401 + ], + "pace":[ + 261.27629148816021, + 331.68516208719467 + ], + "heartRate":[ + 131.67810544238606, + 154.26779645311458 + ], + "distanceFromStart":2.625 + }, + { + "elevation":[ + 491.57378483134391, + 547.49535224251053 + ], + "pace":[ + 296.05298644112088, + 401.14092967732398 + ], + "heartRate":[ + 151.36398089694217, + 166.20454793289232 + ], + "distanceFromStart":3 + }, + { + "elevation":[ + 472.06803233416338, + 531.92570520228401 + ], + "pace":[ + 395.50830663514012, + 401.67837917543591 + ], + "heartRate":[ + 134.41798110234078, + 151.90886697564241 + ], + "distanceFromStart":3.375 + }, + { + "elevation":[ + 339.81419476005283, + 461.03832527824829 + ], + "pace":[ + 395.31160487975183, + 404.49550455974907 + ], + "heartRate":[ + 129.97753472415462, + 138.13531094848992 + ], + "distanceFromStart":3.75 + }, + { + "elevation":[ + 303.1495508565697, + 342.3532820173541 + ], + "pace":[ + 395.02844559698116, + 402.65878340653796 + ], + "heartRate":[ + 127.72304232462609, + 133.26322270764186 + ], + "distanceFromStart":4.125 + } + ] + }, + { + "name":"Lonesome Ridge Trail", + "id":1009, + "distance":4.5, + "difficulty":3, + "observations":[ + { + "elevation":[ + 291.65263635636268, + 309.26016677925196 + ], + "pace":[ + 396.08716481908732, + 403.68937873525232 + ], + "heartRate":[ + 117.16351898665887, + 121.95815455919609 + ], + "distanceFromStart":0 + }, + { + "elevation":[ + 299.24001936628116, + 317.44584350790012 + ], + "pace":[ + 380.19020240756623, + 395.3978319010256 + ], + "heartRate":[ + 117.6410892152911, + 124.82185220506081 + ], + "distanceFromStart":0.375 + }, + { + "elevation":[ + 303.62145464574394, + 336.05569457646544 + ], + "pace":[ + 380.55927782266116, + 397.60789726832775 + ], + "heartRate":[ + 121.52696452049059, + 127.31525441110122 + ], + "distanceFromStart":0.75 + }, + { + "elevation":[ + 319.90393365162629, + 346.26966025518789 + ], + "pace":[ + 357.94116421258531, + 398.0750288648062 + ], + "heartRate":[ + 123.75908585923588, + 132.77069404486801 + ], + "distanceFromStart":1.125 + }, + { + "elevation":[ + 354.17104439267905, + 403.57031216972939 + ], + "pace":[ + 335.07385149392701, + 397.82674381875808 + ], + "heartRate":[ + 130.8235194572915, + 140.55700591418218 + ], + "distanceFromStart":1.5 + }, + { + "elevation":[ + 357.42992871175124, + 385.92155620623635 + ], + "pace":[ + 395.16168913839374, + 404.60294066527558 + ], + "heartRate":[ + 131.5456052446734, + 134.65984504627627 + ], + "distanceFromStart":1.875 + }, + { + "elevation":[ + 345.47736721935661, + 363.18776661379422 + ], + "pace":[ + 340.82303041339082, + 404.71689228682374 + ], + "heartRate":[ + 125.1949698433959, + 131.31354363122026 + ], + "distanceFromStart":2.25 + }, + { + "elevation":[ + 346.23343025200535, + 497.23376445462401 + ], + "pace":[ + 261.27629148816021, + 331.68516208719467 + ], + "heartRate":[ + 131.67810544238606, + 154.26779645311458 + ], + "distanceFromStart":2.625 + }, + { + "elevation":[ + 491.57378483134391, + 547.49535224251053 + ], + "pace":[ + 296.05298644112088, + 401.14092967732398 + ], + "heartRate":[ + 151.36398089694217, + 166.20454793289232 + ], + "distanceFromStart":3 + }, + { + "elevation":[ + 472.06803233416338, + 531.92570520228401 + ], + "pace":[ + 395.50830663514012, + 401.67837917543591 + ], + "heartRate":[ + 134.41798110234078, + 151.90886697564241 + ], + "distanceFromStart":3.375 + }, + { + "elevation":[ + 339.81419476005283, + 461.03832527824829 + ], + "pace":[ + 395.31160487975183, + 404.49550455974907 + ], + "heartRate":[ + 129.97753472415462, + 138.13531094848992 + ], + "distanceFromStart":3.75 + }, + { + "elevation":[ + 303.1495508565697, + 342.3532820173541 + ], + "pace":[ + 395.02844559698116, + 402.65878340653796 + ], + "heartRate":[ + 127.72304232462609, + 133.26322270764186 + ], + "distanceFromStart":4.125 + } + ] + }, + { + "name":"Lonesome Ridge Trail", + "id":1010, + "distance":4.5, + "difficulty":3, + "observations":[ + { + "elevation":[ + 291.65263635636268, + 309.26016677925196 + ], + "pace":[ + 396.08716481908732, + 403.68937873525232 + ], + "heartRate":[ + 117.16351898665887, + 121.95815455919609 + ], + "distanceFromStart":0 + }, + { + "elevation":[ + 299.24001936628116, + 317.44584350790012 + ], + "pace":[ + 380.19020240756623, + 395.3978319010256 + ], + "heartRate":[ + 117.6410892152911, + 124.82185220506081 + ], + "distanceFromStart":0.375 + }, + { + "elevation":[ + 303.62145464574394, + 336.05569457646544 + ], + "pace":[ + 380.55927782266116, + 397.60789726832775 + ], + "heartRate":[ + 121.52696452049059, + 127.31525441110122 + ], + "distanceFromStart":0.75 + }, + { + "elevation":[ + 319.90393365162629, + 346.26966025518789 + ], + "pace":[ + 357.94116421258531, + 398.0750288648062 + ], + "heartRate":[ + 123.75908585923588, + 132.77069404486801 + ], + "distanceFromStart":1.125 + }, + { + "elevation":[ + 354.17104439267905, + 403.57031216972939 + ], + "pace":[ + 335.07385149392701, + 397.82674381875808 + ], + "heartRate":[ + 130.8235194572915, + 140.55700591418218 + ], + "distanceFromStart":1.5 + }, + { + "elevation":[ + 357.42992871175124, + 385.92155620623635 + ], + "pace":[ + 395.16168913839374, + 404.60294066527558 + ], + "heartRate":[ + 131.5456052446734, + 134.65984504627627 + ], + "distanceFromStart":1.875 + }, + { + "elevation":[ + 345.47736721935661, + 363.18776661379422 + ], + "pace":[ + 340.82303041339082, + 404.71689228682374 + ], + "heartRate":[ + 125.1949698433959, + 131.31354363122026 + ], + "distanceFromStart":2.25 + }, + { + "elevation":[ + 346.23343025200535, + 497.23376445462401 + ], + "pace":[ + 261.27629148816021, + 331.68516208719467 + ], + "heartRate":[ + 131.67810544238606, + 154.26779645311458 + ], + "distanceFromStart":2.625 + }, + { + "elevation":[ + 491.57378483134391, + 547.49535224251053 + ], + "pace":[ + 296.05298644112088, + 401.14092967732398 + ], + "heartRate":[ + 151.36398089694217, + 166.20454793289232 + ], + "distanceFromStart":3 + }, + { + "elevation":[ + 472.06803233416338, + 531.92570520228401 + ], + "pace":[ + 395.50830663514012, + 401.67837917543591 + ], + "heartRate":[ + 134.41798110234078, + 151.90886697564241 + ], + "distanceFromStart":3.375 + }, + { + "elevation":[ + 339.81419476005283, + 461.03832527824829 + ], + "pace":[ + 395.31160487975183, + 404.49550455974907 + ], + "heartRate":[ + 129.97753472415462, + 138.13531094848992 + ], + "distanceFromStart":3.75 + }, + { + "elevation":[ + 303.1495508565697, + 342.3532820173541 + ], + "pace":[ + 395.02844559698116, + 402.65878340653796 + ], + "heartRate":[ + 127.72304232462609, + 133.26322270764186 + ], + "distanceFromStart":4.125 + } + ] + } +] diff --git a/Examples/InterfacingWithUIKit/StartingPoint/Landmarks/Landmarks/Resources/icybay.jpg b/Examples/InterfacingWithUIKit/StartingPoint/Landmarks/Landmarks/Resources/icybay.jpg new file mode 100755 index 0000000..feb1764 Binary files /dev/null and b/Examples/InterfacingWithUIKit/StartingPoint/Landmarks/Landmarks/Resources/icybay.jpg differ diff --git a/Examples/InterfacingWithUIKit/StartingPoint/Landmarks/Landmarks/Resources/lakemcdonald.jpg b/Examples/InterfacingWithUIKit/StartingPoint/Landmarks/Landmarks/Resources/lakemcdonald.jpg new file mode 100755 index 0000000..bd9d6b9 Binary files /dev/null and b/Examples/InterfacingWithUIKit/StartingPoint/Landmarks/Landmarks/Resources/lakemcdonald.jpg differ diff --git a/Examples/InterfacingWithUIKit/StartingPoint/Landmarks/Landmarks/Resources/landmarkData.json b/Examples/InterfacingWithUIKit/StartingPoint/Landmarks/Landmarks/Resources/landmarkData.json new file mode 100755 index 0000000..a25b4e4 --- /dev/null +++ b/Examples/InterfacingWithUIKit/StartingPoint/Landmarks/Landmarks/Resources/landmarkData.json @@ -0,0 +1,182 @@ +[ + { + "name": "Turtle Rock", + "category": "Rivers", + "city": "Twentynine Palms", + "state": "California", + "id": 1001, + "isFeatured": true, + "isFavorite": true, + "park": "Joshua Tree National Park", + "coordinates": { + "longitude": -116.166868, + "latitude": 34.011286 + }, + "imageName": "turtlerock" + }, + { + "name": "Silver Salmon Creek", + "category": "Lakes", + "city": "Port Alsworth", + "state": "Alaska", + "id": 1002, + "isFeatured": false, + "isFavorite": false, + "park": "Lake Clark National Park and Preserve", + "coordinates": { + "longitude": -152.665167, + "latitude": 59.980167 + }, + "imageName": "silversalmoncreek" + }, + { + "name": "Chilkoot Trail", + "category": "Mountains", + "city": "Skagway", + "state": "Alaska", + "id": 1003, + "isFeatured": false, + "isFavorite": true, + "park": "Klondike Gold Rush National Historical Park", + "coordinates": { + "longitude": -135.334571, + "latitude": 59.560551 + }, + "imageName": "chilkoottrail" + }, + { + "name": "St. Mary Lake", + "category": "Lakes", + "city": "Browning", + "state": "Montana", + "id": 1004, + "isFeatured": true, + "isFavorite": true, + "park": "Glacier National Park", + "coordinates": { + "longitude": -113.536248, + "latitude": 48.69423 + }, + "imageName": "stmarylake" + }, + { + "name": "Twin Lake", + "category": "Lakes", + "city": "Twin Lakes", + "state": "Alaska", + "id": 1005, + "isFeatured": false, + "isFavorite": false, + "park": "Lake Clark National Park and Preserve", + "coordinates": { + "longitude": -153.849883, + "latitude": 60.641684 + }, + "imageName": "twinlake" + }, + { + "name": "Lake McDonald", + "category": "Mountains", + "city": "West Glacier", + "state": "Montana", + "id": 1006, + "isFeatured": false, + "isFavorite": false, + "park": "Glacier National Park", + "coordinates": { + "longitude": -113.934831, + "latitude": 48.56002 + }, + "imageName": "lakemcdonald" + }, + { + "name": "Charley Rivers", + "category": "Rivers", + "city": "Eaking", + "state": "Alaska", + "id": 1007, + "isFeatured": true, + "isFavorite": false, + "park": "Charley Rivers National Preserve", + "coordinates": { + "longitude": -143.122586, + "latitude": 65.350021 + }, + "imageName": "charleyrivers", + }, + { + "name": "Icy Bay", + "category": "Mountains", + "city": "Icy Bay", + "state": "Alaska", + "id": 1008, + "isFeatured": false, + "isFavorite": false, + "park": "Wrangell-St. Elias National Park and Preserve", + "coordinates": { + "longitude": -141.518167, + "latitude": 60.089917 + }, + "imageName": "icybay" + }, + { + "name": "Rainbow Lake", + "category": "Lakes", + "city": "Willow", + "state": "Alaska", + "id": 1009, + "isFeatured": false, + "isFavorite": false, + "park": "State Recreation Area", + "coordinates": { + "longitude": -150.086103, + "latitude": 61.694334 + }, + "imageName": "rainbowlake" + }, + { + "name": "Hidden Lake", + "category": "Lakes", + "city": "Newhalem", + "state": "Washington", + "id": 1010, + "isFeatured": false, + "isFavorite": false, + "park": "North Cascades National Park", + "coordinates": { + "longitude": -121.17799, + "latitude": 48.495442 + }, + "imageName": "hiddenlake" + }, + { + "name": "Chincoteague", + "category": "Rivers", + "city": "Chincoteague", + "state": "Virginia", + "id": 1011, + "isFeatured": false, + "isFavorite": false, + "park": "Chincoteague National Wildlife Refuge", + "coordinates": { + "longitude": -75.383212, + "latitude": 37.91531 + }, + "imageName": "chincoteague" + }, + { + "name": "Lake Umbagog", + "category": "Lakes", + "city": "Errol", + "state": "New Hampshire", + "id": 1012, + "isFeatured": false, + "isFavorite": false, + "park": "Umbagog National Wildlife Refuge", + "coordinates": { + "longitude": -71.056816, + "latitude": 44.747408 + }, + "imageName": "umbagog" + } +] diff --git a/Examples/InterfacingWithUIKit/StartingPoint/Landmarks/Landmarks/Resources/rainbowlake.jpg b/Examples/InterfacingWithUIKit/StartingPoint/Landmarks/Landmarks/Resources/rainbowlake.jpg new file mode 100755 index 0000000..6da43dd Binary files /dev/null and b/Examples/InterfacingWithUIKit/StartingPoint/Landmarks/Landmarks/Resources/rainbowlake.jpg differ diff --git a/Examples/InterfacingWithUIKit/StartingPoint/Landmarks/Landmarks/Resources/silversalmoncreek.jpg b/Examples/InterfacingWithUIKit/StartingPoint/Landmarks/Landmarks/Resources/silversalmoncreek.jpg new file mode 100755 index 0000000..f657532 Binary files /dev/null and b/Examples/InterfacingWithUIKit/StartingPoint/Landmarks/Landmarks/Resources/silversalmoncreek.jpg differ diff --git a/Examples/InterfacingWithUIKit/StartingPoint/Landmarks/Landmarks/Resources/stmarylake.jpg b/Examples/InterfacingWithUIKit/StartingPoint/Landmarks/Landmarks/Resources/stmarylake.jpg new file mode 100755 index 0000000..1c71de4 Binary files /dev/null and b/Examples/InterfacingWithUIKit/StartingPoint/Landmarks/Landmarks/Resources/stmarylake.jpg differ diff --git a/Examples/InterfacingWithUIKit/StartingPoint/Landmarks/Landmarks/Resources/stmarylake_feature.jpg b/Examples/InterfacingWithUIKit/StartingPoint/Landmarks/Landmarks/Resources/stmarylake_feature.jpg new file mode 100755 index 0000000..5eb97b1 Binary files /dev/null and b/Examples/InterfacingWithUIKit/StartingPoint/Landmarks/Landmarks/Resources/stmarylake_feature.jpg differ diff --git a/Examples/InterfacingWithUIKit/StartingPoint/Landmarks/Landmarks/Resources/turtlerock.jpg b/Examples/InterfacingWithUIKit/StartingPoint/Landmarks/Landmarks/Resources/turtlerock.jpg new file mode 100755 index 0000000..f7a6e6d Binary files /dev/null and b/Examples/InterfacingWithUIKit/StartingPoint/Landmarks/Landmarks/Resources/turtlerock.jpg differ diff --git a/Examples/InterfacingWithUIKit/StartingPoint/Landmarks/Landmarks/Resources/turtlerock_feature.jpg b/Examples/InterfacingWithUIKit/StartingPoint/Landmarks/Landmarks/Resources/turtlerock_feature.jpg new file mode 100755 index 0000000..448c70f Binary files /dev/null and b/Examples/InterfacingWithUIKit/StartingPoint/Landmarks/Landmarks/Resources/turtlerock_feature.jpg differ diff --git a/Examples/InterfacingWithUIKit/StartingPoint/Landmarks/Landmarks/Resources/twinlake.jpg b/Examples/InterfacingWithUIKit/StartingPoint/Landmarks/Landmarks/Resources/twinlake.jpg new file mode 100755 index 0000000..3e7a57c Binary files /dev/null and b/Examples/InterfacingWithUIKit/StartingPoint/Landmarks/Landmarks/Resources/twinlake.jpg differ diff --git a/Examples/InterfacingWithUIKit/StartingPoint/Landmarks/Landmarks/Resources/umbagog.jpg b/Examples/InterfacingWithUIKit/StartingPoint/Landmarks/Landmarks/Resources/umbagog.jpg new file mode 100755 index 0000000..56291c6 Binary files /dev/null and b/Examples/InterfacingWithUIKit/StartingPoint/Landmarks/Landmarks/Resources/umbagog.jpg differ diff --git a/Examples/InterfacingWithUIKit/StartingPoint/Landmarks/Landmarks/SceneDelegate.swift b/Examples/InterfacingWithUIKit/StartingPoint/Landmarks/Landmarks/SceneDelegate.swift new file mode 100755 index 0000000..0f5f17e --- /dev/null +++ b/Examples/InterfacingWithUIKit/StartingPoint/Landmarks/Landmarks/SceneDelegate.swift @@ -0,0 +1,56 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +The scene delegate. +*/ + +import UIKit +import SwiftUI + +class SceneDelegate: UIResponder, UIWindowSceneDelegate { + + var window: UIWindow? + + func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) { + // Use this method to optionally configure and attach the UIWindow `window` to the provided UIWindowScene `scene`. + // If using a storyboard, the `window` property will automatically be initialized and attached to the scene. + // This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead). + + // Use a UIHostingController as window root view controller + let window = UIWindow(frame: UIScreen.main.bounds) + window.rootViewController = UIHostingController(rootView: CategoryHome().environmentObject(UserData())) + self.window = window + window.makeKeyAndVisible() + } + + func sceneDidDisconnect(_ scene: UIScene) { + // Called as the scene is being released by the system. + // This occurs shortly after the scene enters the background, or when its session is discarded. + // Release any resources associated with this scene that can be re-created the next time the scene connects. + // The scene may re-connect later, as its session was not neccessarily discarded (see `application:didDiscardSceneSessions` instead). + } + + func sceneDidBecomeActive(_ scene: UIScene) { + // Called when the scene has moved from an inactive state to an active state. + // Use this method to restart any tasks that were paused (or not yet started) when the scene was inactive. + } + + func sceneWillResignActive(_ scene: UIScene) { + // Called when the scene will move from an active state to an inactive state. + // This may occur due to temporary interruptions (ex. an incoming phone call). + } + + func sceneWillEnterForeground(_ scene: UIScene) { + // Called as the scene transitions from the background to the foreground. + // Use this method to undo the changes made on entering the background. + } + + func sceneDidEnterBackground(_ scene: UIScene) { + // Called as the scene transitions from the foreground to the background. + // Use this method to save data, release shared resources, and store enough scene-specific state information + // to restore the scene back to its current state. + } + +} + diff --git a/Examples/InterfacingWithUIKit/StartingPoint/Landmarks/Landmarks/Supporting Views/Badge.swift b/Examples/InterfacingWithUIKit/StartingPoint/Landmarks/Landmarks/Supporting Views/Badge.swift new file mode 100755 index 0000000..59f03b2 --- /dev/null +++ b/Examples/InterfacingWithUIKit/StartingPoint/Landmarks/Landmarks/Supporting Views/Badge.swift @@ -0,0 +1,41 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +A view that displays a badge. +*/ + +import SwiftUI + +struct Badge: View { + static let rotationCount = 8 + + var badgeSymbols: some View { + ForEach(0.. + var overallRange: Range + + var heightRatio: Length { + max(Length(magnitude(of: range) / magnitude(of: overallRange)), 0.15) + } + + var offsetRatio: Length { + Length((range.lowerBound - overallRange.lowerBound) / magnitude(of: overallRange)) + } + + var animation: Animation { + Animation.spring(initialVelocity: 5) + .speed(2) + .delay(0.03 * Double(index)) + } + + var body: some View { + Capsule() + .fill(Color.white) + .frame(height: height * heightRatio, alignment: .bottom) + .offset(x: 0, y: height * -offsetRatio) + .animation(animation) + } +} + +#if DEBUG +struct GraphCapsule_Previews: PreviewProvider { + static var previews: some View { + GraphCapsule(index: 0, height: 150, range: 10..<50, overallRange: 0..<100) + } +} +#endif diff --git a/Examples/InterfacingWithUIKit/StartingPoint/Landmarks/Landmarks/Supporting Views/HikeGraph.swift b/Examples/InterfacingWithUIKit/StartingPoint/Landmarks/Landmarks/Supporting Views/HikeGraph.swift new file mode 100755 index 0000000..7df5194 --- /dev/null +++ b/Examples/InterfacingWithUIKit/StartingPoint/Landmarks/Landmarks/Supporting Views/HikeGraph.swift @@ -0,0 +1,74 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +The elevation, heart rate, and pace of a hike plotted on a graph. +*/ + +import SwiftUI + +func rangeOfRanges(_ ranges: C) -> Range + where C.Element == Range { + guard !ranges.isEmpty else { return 0..<0 } + let low = ranges.lazy.map { $0.lowerBound }.min()! + let high = ranges.lazy.map { $0.upperBound }.max()! + return low..) -> Double { + return range.upperBound - range.lowerBound +} + +struct HikeGraph: View { + var hike: Hike + var path: KeyPath> + + var color: Color { + switch path { + case \.elevation: + return .gray + case \.heartRate: + return Color(hue: 0, saturation: 0.5, brightness: 0.7) + case \.pace: + return Color(hue: 0.7, saturation: 0.4, brightness: 0.7) + default: + return .black + } + } + + var body: some View { + let data = hike.observations + let overallRange = rangeOfRanges(data.lazy.map { $0[keyPath: self.path] }) + let maxMagnitude = data.map { magnitude(of: $0[keyPath: path]) }.max()! + let heightRatio = 1 - Length(maxMagnitude / magnitude(of: overallRange)) + + return GeometryReader { proxy in + HStack(alignment: .bottom, spacing: proxy.size.width / 120) { + ForEach(data.indices) { index in + GraphCapsule( + index: index, + height: proxy.size.height, + range: data[index][keyPath: self.path], + overallRange: overallRange) + .colorMultiply(self.color) + } + .offset(x: 0, y: proxy.size.height * heightRatio) + } + } + } +} + +#if DEBUG +struct HikeGraph_Previews: PreviewProvider { + static var previews: some View { + Group { + HikeGraph(hike: hikeData[0], path: \.elevation) + .frame(height: 200) + HikeGraph(hike: hikeData[0], path: \.heartRate) + .frame(height: 200) + HikeGraph(hike: hikeData[0], path: \.pace) + .frame(height: 200) + } + } +} +#endif diff --git a/Examples/InterfacingWithUIKit/StartingPoint/Landmarks/Landmarks/Supporting Views/LandmarkRow.swift b/Examples/InterfacingWithUIKit/StartingPoint/Landmarks/Landmarks/Supporting Views/LandmarkRow.swift new file mode 100755 index 0000000..2f8110c --- /dev/null +++ b/Examples/InterfacingWithUIKit/StartingPoint/Landmarks/Landmarks/Supporting Views/LandmarkRow.swift @@ -0,0 +1,38 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +A single row to be displayed in a list of landmarks. +*/ + +import SwiftUI + +struct LandmarkRow: View { + var landmark: Landmark + + var body: some View { + HStack { + landmark.image(forSize: 50) + Text(verbatim: landmark.name) + Spacer() + + if landmark.isFavorite { + Image(systemName: "star.fill") + .imageScale(.medium) + .foregroundColor(.yellow) + } + } + } +} + +#if DEBUG +struct LandmarkRow_Previews: PreviewProvider { + static var previews: some View { + Group { + LandmarkRow(landmark: landmarkData[0]) + LandmarkRow(landmark: landmarkData[1]) + } + .previewLayout(.fixed(width: 300, height: 70)) + } +} +#endif diff --git a/Examples/InterfacingWithUIKit/StartingPoint/Landmarks/Landmarks/Supporting Views/MapView.swift b/Examples/InterfacingWithUIKit/StartingPoint/Landmarks/Landmarks/Supporting Views/MapView.swift new file mode 100755 index 0000000..5a8c64b --- /dev/null +++ b/Examples/InterfacingWithUIKit/StartingPoint/Landmarks/Landmarks/Supporting Views/MapView.swift @@ -0,0 +1,31 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +A view that hosts an `MKMapView`. +*/ + +import SwiftUI +import MapKit + +struct MapView: UIViewRepresentable { + var coordinate: CLLocationCoordinate2D + + func makeUIView(context: Context) -> MKMapView { + MKMapView(frame: .zero) + } + + func updateUIView(_ view: MKMapView, context: Context) { + let span = MKCoordinateSpan(latitudeDelta: 0.02, longitudeDelta: 0.02) + let region = MKCoordinateRegion(center: coordinate, span: span) + view.setRegion(region, animated: true) + } +} + +#if DEBUG +struct MapView_Previews: PreviewProvider { + static var previews: some View { + MapView(coordinate: landmarkData[0].locationCoordinate) + } +} +#endif diff --git a/Examples/InterfacingWithUIKit/StartingPoint/Landmarks/Landmarks/Supporting Views/RotatedBadgeSymbol.swift b/Examples/InterfacingWithUIKit/StartingPoint/Landmarks/Landmarks/Supporting Views/RotatedBadgeSymbol.swift new file mode 100755 index 0000000..a7e4b53 --- /dev/null +++ b/Examples/InterfacingWithUIKit/StartingPoint/Landmarks/Landmarks/Supporting Views/RotatedBadgeSymbol.swift @@ -0,0 +1,26 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +A view that displays a rotated version of a badge symbol. +*/ + +import SwiftUI + +struct RotatedBadgeSymbol: View { + let angle: Angle + + var body: some View { + BadgeSymbol() + .padding(-60) + .rotationEffect(angle, anchor: .bottom) + } +} + +#if DEBUG +struct RotatedBadgeSymbol_Previews: PreviewProvider { + static var previews: some View { + RotatedBadgeSymbol(angle: .init(degrees: 5)) + } +} +#endif diff --git a/Examples/InterfacingWithUIKit/StartingPoint/README.md b/Examples/InterfacingWithUIKit/StartingPoint/README.md new file mode 100755 index 0000000..4a86ad6 --- /dev/null +++ b/Examples/InterfacingWithUIKit/StartingPoint/README.md @@ -0,0 +1,3 @@ +# Interfacing with UIKit + +Use this project to code along with the [Interfacing with UIKit](https://developer.apple.com/tutorials/swiftui/interfacing-with-uikit) tutorial. \ No newline at end of file diff --git a/Examples/WorkingWithUIControls/Complete/.gitignore b/Examples/WorkingWithUIControls/Complete/.gitignore new file mode 100755 index 0000000..9e50718 --- /dev/null +++ b/Examples/WorkingWithUIControls/Complete/.gitignore @@ -0,0 +1,21 @@ +# See LICENSE folder for this sample’s licensing information. +# +# Apple sample code gitignore configuration. + +# Finder +.DS_Store + +# Xcode - User files +xcuserdata/ + +**/*.xcodeproj/project.xcworkspace/* +!**/*.xcodeproj/project.xcworkspace/xcshareddata + +**/*.xcodeproj/project.xcworkspace/xcshareddata/* +!**/*.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings + +**/*.playground/playground.xcworkspace/* +!**/*.playground/playground.xcworkspace/xcshareddata + +**/*.playground/playground.xcworkspace/xcshareddata/* +!**/*.playground/playground.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings diff --git a/Examples/WorkingWithUIControls/Complete/Configuration/SampleCode.xcconfig b/Examples/WorkingWithUIControls/Complete/Configuration/SampleCode.xcconfig new file mode 100755 index 0000000..db86c06 --- /dev/null +++ b/Examples/WorkingWithUIControls/Complete/Configuration/SampleCode.xcconfig @@ -0,0 +1,13 @@ +// +// See LICENSE folder for this sample’s licensing information. +// +// SampleCode.xcconfig +// + +// The `SAMPLE_CODE_DISAMBIGUATOR` configuration is to make it easier to build +// and run a sample code project. Once you set your project's development team, +// you'll have a unique bundle identifier. This is because the bundle identifier +// is derived based on the 'SAMPLE_CODE_DISAMBIGUATOR' value. Do not use this +// approach in your own projects—it's only useful for sample code projects because +// they are frequently downloaded and don't have a development team set. +SAMPLE_CODE_DISAMBIGUATOR=${DEVELOPMENT_TEAM} diff --git a/Examples/WorkingWithUIControls/Complete/LICENSE/LICENSE.txt b/Examples/WorkingWithUIControls/Complete/LICENSE/LICENSE.txt new file mode 100755 index 0000000..94e3d54 --- /dev/null +++ b/Examples/WorkingWithUIControls/Complete/LICENSE/LICENSE.txt @@ -0,0 +1,8 @@ +Copyright © 2019 Apple Inc. + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + diff --git a/Examples/WorkingWithUIControls/Complete/Landmarks/Landmarks/AppDelegate.swift b/Examples/WorkingWithUIControls/Complete/Landmarks/Landmarks/AppDelegate.swift new file mode 100755 index 0000000..e22943b --- /dev/null +++ b/Examples/WorkingWithUIControls/Complete/Landmarks/Landmarks/AppDelegate.swift @@ -0,0 +1,36 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +The application delegate. +*/ + +import UIKit + +@UIApplicationMain +class AppDelegate: UIResponder, UIApplicationDelegate { + + func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { + // Override point for customization after application launch. + return true + } + + func applicationWillTerminate(_ application: UIApplication) { + // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. + } + + // MARK: UISceneSession Lifecycle + func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration { + // Called when a new scene session is being created. + // Use this method to select a configuration to create the new scene with. + return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role) + } + + func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set) { + // Called when the user discards a scene session. + // If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions. + // Use this method to release any resources that were specific to the discarded scenes, as they will not return. + } + +} + diff --git a/Examples/WorkingWithUIControls/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/Contents.json b/Examples/WorkingWithUIControls/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100755 index 0000000..8eb9b4e --- /dev/null +++ b/Examples/WorkingWithUIControls/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,113 @@ +{ + "images" : [ + { + "size" : "20x20", + "idiom" : "iphone", + "filename" : "landmark_app_icon_40x40.png", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "20x20", + "scale" : "3x" + }, + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "landmark_app_icon_58x58.png", + "scale" : "2x" + }, + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "landmark_app_icon_87x87.png", + "scale" : "3x" + }, + { + "size" : "40x40", + "idiom" : "iphone", + "filename" : "landmark_app_icon_80x80.png", + "scale" : "2x" + }, + { + "size" : "40x40", + "idiom" : "iphone", + "filename" : "landmark_app_icon_120x120.png", + "scale" : "3x" + }, + { + "size" : "60x60", + "idiom" : "iphone", + "filename" : "landmark_app_icon_120x120-1.png", + "scale" : "2x" + }, + { + "size" : "60x60", + "idiom" : "iphone", + "filename" : "landmark_app_icon_180x180.png", + "scale" : "3x" + }, + { + "idiom" : "ipad", + "size" : "20x20", + "scale" : "1x" + }, + { + "size" : "20x20", + "idiom" : "ipad", + "filename" : "landmark_app_icon_40x40-2.png", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "29x29", + "scale" : "1x" + }, + { + "size" : "29x29", + "idiom" : "ipad", + "filename" : "landmark_app_icon_58x58-1.png", + "scale" : "2x" + }, + { + "size" : "40x40", + "idiom" : "ipad", + "filename" : "landmark_app_icon_40x40-1.png", + "scale" : "1x" + }, + { + "size" : "40x40", + "idiom" : "ipad", + "filename" : "landmark_app_icon_80x80-1.png", + "scale" : "2x" + }, + { + "size" : "76x76", + "idiom" : "ipad", + "filename" : "landmark_app_icon_76x76.png", + "scale" : "1x" + }, + { + "size" : "76x76", + "idiom" : "ipad", + "filename" : "landmark_app_icon_152x152.png", + "scale" : "2x" + }, + { + "size" : "83.5x83.5", + "idiom" : "ipad", + "filename" : "landmark_app_icon_167x167.png", + "scale" : "2x" + }, + { + "size" : "1024x1024", + "idiom" : "ios-marketing", + "filename" : "landmark_app_icon_1024x1024.png", + "scale" : "1x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Examples/WorkingWithUIControls/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_1024x1024.png b/Examples/WorkingWithUIControls/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_1024x1024.png new file mode 100755 index 0000000..00d81c1 Binary files /dev/null and b/Examples/WorkingWithUIControls/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_1024x1024.png differ diff --git a/Examples/WorkingWithUIControls/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_120x120-1.png b/Examples/WorkingWithUIControls/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_120x120-1.png new file mode 100755 index 0000000..d382b8b Binary files /dev/null and b/Examples/WorkingWithUIControls/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_120x120-1.png differ diff --git a/Examples/WorkingWithUIControls/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_120x120.png b/Examples/WorkingWithUIControls/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_120x120.png new file mode 100755 index 0000000..d382b8b Binary files /dev/null and b/Examples/WorkingWithUIControls/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_120x120.png differ diff --git a/Examples/WorkingWithUIControls/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_152x152.png b/Examples/WorkingWithUIControls/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_152x152.png new file mode 100755 index 0000000..11057f8 Binary files /dev/null and b/Examples/WorkingWithUIControls/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_152x152.png differ diff --git a/Examples/WorkingWithUIControls/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_167x167.png b/Examples/WorkingWithUIControls/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_167x167.png new file mode 100755 index 0000000..f73bc26 Binary files /dev/null and b/Examples/WorkingWithUIControls/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_167x167.png differ diff --git a/Examples/WorkingWithUIControls/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_180x180.png b/Examples/WorkingWithUIControls/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_180x180.png new file mode 100755 index 0000000..b02738c Binary files /dev/null and b/Examples/WorkingWithUIControls/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_180x180.png differ diff --git a/Examples/WorkingWithUIControls/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_40x40-1.png b/Examples/WorkingWithUIControls/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_40x40-1.png new file mode 100755 index 0000000..abaff0e Binary files /dev/null and b/Examples/WorkingWithUIControls/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_40x40-1.png differ diff --git a/Examples/WorkingWithUIControls/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_40x40-2.png b/Examples/WorkingWithUIControls/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_40x40-2.png new file mode 100755 index 0000000..abaff0e Binary files /dev/null and b/Examples/WorkingWithUIControls/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_40x40-2.png differ diff --git a/Examples/WorkingWithUIControls/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_40x40.png b/Examples/WorkingWithUIControls/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_40x40.png new file mode 100755 index 0000000..abaff0e Binary files /dev/null and b/Examples/WorkingWithUIControls/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_40x40.png differ diff --git a/Examples/WorkingWithUIControls/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_58x58-1.png b/Examples/WorkingWithUIControls/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_58x58-1.png new file mode 100755 index 0000000..cf7c73d Binary files /dev/null and b/Examples/WorkingWithUIControls/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_58x58-1.png differ diff --git a/Examples/WorkingWithUIControls/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_58x58.png b/Examples/WorkingWithUIControls/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_58x58.png new file mode 100755 index 0000000..cf7c73d Binary files /dev/null and b/Examples/WorkingWithUIControls/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_58x58.png differ diff --git a/Examples/WorkingWithUIControls/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_76x76.png b/Examples/WorkingWithUIControls/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_76x76.png new file mode 100755 index 0000000..3eff85b Binary files /dev/null and b/Examples/WorkingWithUIControls/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_76x76.png differ diff --git a/Examples/WorkingWithUIControls/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_80x80-1.png b/Examples/WorkingWithUIControls/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_80x80-1.png new file mode 100755 index 0000000..6f33f66 Binary files /dev/null and b/Examples/WorkingWithUIControls/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_80x80-1.png differ diff --git a/Examples/WorkingWithUIControls/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_80x80.png b/Examples/WorkingWithUIControls/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_80x80.png new file mode 100755 index 0000000..6f33f66 Binary files /dev/null and b/Examples/WorkingWithUIControls/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_80x80.png differ diff --git a/Examples/WorkingWithUIControls/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_87x87.png b/Examples/WorkingWithUIControls/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_87x87.png new file mode 100755 index 0000000..9e1616c Binary files /dev/null and b/Examples/WorkingWithUIControls/Complete/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_87x87.png differ diff --git a/Examples/WorkingWithUIControls/Complete/Landmarks/Landmarks/Assets.xcassets/Contents.json b/Examples/WorkingWithUIControls/Complete/Landmarks/Landmarks/Assets.xcassets/Contents.json new file mode 100755 index 0000000..da4a164 --- /dev/null +++ b/Examples/WorkingWithUIControls/Complete/Landmarks/Landmarks/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Examples/WorkingWithUIControls/Complete/Landmarks/Landmarks/Assets.xcassets/turtlerock.imageset/Contents.json b/Examples/WorkingWithUIControls/Complete/Landmarks/Landmarks/Assets.xcassets/turtlerock.imageset/Contents.json new file mode 100755 index 0000000..5bfd7bf --- /dev/null +++ b/Examples/WorkingWithUIControls/Complete/Landmarks/Landmarks/Assets.xcassets/turtlerock.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "turtlerock.jpg", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Examples/WorkingWithUIControls/Complete/Landmarks/Landmarks/Assets.xcassets/turtlerock.imageset/turtlerock.jpg b/Examples/WorkingWithUIControls/Complete/Landmarks/Landmarks/Assets.xcassets/turtlerock.imageset/turtlerock.jpg new file mode 100755 index 0000000..68bcd3e Binary files /dev/null and b/Examples/WorkingWithUIControls/Complete/Landmarks/Landmarks/Assets.xcassets/turtlerock.imageset/turtlerock.jpg differ diff --git a/Examples/WorkingWithUIControls/Complete/Landmarks/Landmarks/Base.lproj/LaunchScreen.storyboard b/Examples/WorkingWithUIControls/Complete/Landmarks/Landmarks/Base.lproj/LaunchScreen.storyboard new file mode 100755 index 0000000..865e932 --- /dev/null +++ b/Examples/WorkingWithUIControls/Complete/Landmarks/Landmarks/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Examples/WorkingWithUIControls/Complete/Landmarks/Landmarks/CategoryRow.swift b/Examples/WorkingWithUIControls/Complete/Landmarks/Landmarks/CategoryRow.swift new file mode 100755 index 0000000..1f4fbd8 --- /dev/null +++ b/Examples/WorkingWithUIControls/Complete/Landmarks/Landmarks/CategoryRow.swift @@ -0,0 +1,64 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +A view showing a scrollable list of landmarks. +*/ + +import SwiftUI + +struct CategoryRow: View { + var categoryName: String + var items: [Landmark] + + var body: some View { + VStack(alignment: .leading) { + Text(self.categoryName) + .font(.headline) + .padding(.leading, 15) + .padding(.top, 5) + + ScrollView(showsHorizontalIndicator: false) { + HStack(alignment: .top, spacing: 0) { + ForEach(self.items.identified(by: \.name)) { landmark in + NavigationButton( + destination: LandmarkDetail( + landmark: landmark + ) + ) { + CategoryItem(landmark: landmark) + } + } + } + } + .frame(height: 185) + } + } +} + +struct CategoryItem: View { + var landmark: Landmark + var body: some View { + VStack(alignment: .leading) { + landmark + .image(forSize: 155) + .renderingMode(.original) + .cornerRadius(5) + Text(landmark.name) + .color(.primary) + .font(.caption) + } + .padding(.leading, 15) + } +} + +#if DEBUG +struct CategoryRow_Previews: PreviewProvider { + static var previews: some View { + CategoryRow( + categoryName: landmarkData[0].category.rawValue, + items: Array(landmarkData.prefix(4)) + ) + } +} +#endif diff --git a/Examples/WorkingWithUIControls/Complete/Landmarks/Landmarks/HexagonParameters.swift b/Examples/WorkingWithUIControls/Complete/Landmarks/Landmarks/HexagonParameters.swift new file mode 100755 index 0000000..8decba4 --- /dev/null +++ b/Examples/WorkingWithUIControls/Complete/Landmarks/Landmarks/HexagonParameters.swift @@ -0,0 +1,57 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +Size, position, and other information used to draw a badge. +*/ + +import SwiftUI + +struct HexagonParameters { + struct Segment { + let useWidth: (CGFloat, CGFloat, CGFloat) + let xFactors: (CGFloat, CGFloat, CGFloat) + let useHeight: (CGFloat, CGFloat, CGFloat) + let yFactors: (CGFloat, CGFloat, CGFloat) + } + + static let adjustment: CGFloat = 0.085 + static let points = [ + Segment( + useWidth: (1.00, 1.00, 1.00), + xFactors: (0.60, 0.40, 0.50), + useHeight: (1.00, 1.00, 0.00), + yFactors: (0.05, 0.05, 0.00) + ), + Segment( + useWidth: (1.00, 1.00, 0.00), + xFactors: (0.05, 0.00, 0.00), + useHeight: (1.00, 1.00, 1.00), + yFactors: (0.20 + adjustment, 0.30 + adjustment, 0.25 + adjustment) + ), + Segment( + useWidth: (1.00, 1.00, 0.00), + xFactors: (0.00, 0.05, 0.00), + useHeight: (1.00, 1.00, 1.00), + yFactors: (0.70 - adjustment, 0.80 - adjustment, 0.75 - adjustment) + ), + Segment( + useWidth: (1.00, 1.00, 1.00), + xFactors: (0.40, 0.60, 0.50), + useHeight: (1.00, 1.00, 1.00), + yFactors: (0.95, 0.95, 1.00) + ), + Segment( + useWidth: (1.00, 1.00, 1.00), + xFactors: (0.95, 1.00, 1.00), + useHeight: (1.00, 1.00, 1.00), + yFactors: (0.80 - adjustment, 0.70 - adjustment, 0.75 - adjustment) + ), + Segment( + useWidth: (1.00, 1.00, 1.00), + xFactors: (1.00, 0.95, 1.00), + useHeight: (1.00, 1.00, 1.00), + yFactors: (0.30 + adjustment, 0.20 + adjustment, 0.25 + adjustment) + ) + ] +} diff --git a/Examples/WorkingWithUIControls/Complete/Landmarks/Landmarks/HikeBadge.swift b/Examples/WorkingWithUIControls/Complete/Landmarks/Landmarks/HikeBadge.swift new file mode 100755 index 0000000..52716cf --- /dev/null +++ b/Examples/WorkingWithUIControls/Complete/Landmarks/Landmarks/HikeBadge.swift @@ -0,0 +1,31 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +A view that shows a badge for hiking. +*/ + +import SwiftUI + +struct HikeBadge: View { + var name: String + var body: some View { + VStack(alignment: .center) { + Badge() + .frame(width: 300, height: 300) + .scaleEffect(1.0 / 3.0) + .frame(width: 100, height: 100) + Text(name) + .font(.caption) + .accessibility(label: Text("Badge for \(name).")) + } + } +} + +#if DEBUG +struct HikeBadge_Previews: PreviewProvider { + static var previews: some View { + HikeBadge(name: "Preview Testing") + } +} +#endif diff --git a/Examples/WorkingWithUIControls/Complete/Landmarks/Landmarks/HikeDetail.swift b/Examples/WorkingWithUIControls/Complete/Landmarks/Landmarks/HikeDetail.swift new file mode 100755 index 0000000..3406a6d --- /dev/null +++ b/Examples/WorkingWithUIControls/Complete/Landmarks/Landmarks/HikeDetail.swift @@ -0,0 +1,49 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +A view showing the details for a hike. +*/ + +import SwiftUI + +struct HikeDetail: View { + let hike: Hike + @State var dataToShow = \Hike.Observation.elevation + + var buttons = [ + ("Elevation", \Hike.Observation.elevation), + ("Heart Rate", \Hike.Observation.heartRate), + ("Pace", \Hike.Observation.pace), + ] + + var body: some View { + return VStack { + HikeGraph(hike: hike, path: dataToShow) + .frame(height: 200, alignment: .center) + + HStack(spacing: 25) { + ForEach(buttons.identified(by: \.0)) { value in + Button(action: { + self.dataToShow = value.1 + }) { + Text(verbatim: value.0) + .font(.system(size: 15)) + .color(value.1 == self.dataToShow + ? Color.gray + : Color.accentColor) + .animation(nil) + } + } + } + } + } +} + +#if DEBUG +struct HikeDetail_Previews: PreviewProvider { + static var previews: some View { + HikeDetail(hike: hikeData[0]) + } +} +#endif diff --git a/Examples/WorkingWithUIControls/Complete/Landmarks/Landmarks/HikeView.swift b/Examples/WorkingWithUIControls/Complete/Landmarks/Landmarks/HikeView.swift new file mode 100755 index 0000000..f4c02cc --- /dev/null +++ b/Examples/WorkingWithUIControls/Complete/Landmarks/Landmarks/HikeView.swift @@ -0,0 +1,68 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +A view displaying inforamtion about a hike, including an elevation graph. +*/ + +import SwiftUI + +struct HikeView: View { + var hike: Hike + @State private var showDetail = false + + var transition: AnyTransition { + let insertion = AnyTransition.move(edge: .trailing) + .combined(with: .opacity) + let removal = AnyTransition.scale() + .combined(with: .opacity) + return .asymmetric(insertion: insertion, removal: removal) + } + + var body: some View { + VStack { + HStack { + HikeGraph(hike: hike, path: \.elevation) + .frame(width: 50, height: 30) + .animation(nil) + + VStack(alignment: .leading) { + Text(verbatim: hike.name) + .font(.headline) + Text(verbatim: hike.distanceText) + } + + Spacer() + + Button(action: { + withAnimation { + self.showDetail.toggle() + } + }) { + Image(systemName: "chevron.right.circle") + .imageScale(.large) + .rotationEffect(.degrees(showDetail ? 90 : 0)) + .scaleEffect(showDetail ? 1.5 : 1) + .padding() + } + } + + if showDetail { + HikeDetail(hike: hike) + .transition(transition) + } + } + } +} + +#if DEBUG +struct HikeView_Previews: PreviewProvider { + static var previews: some View { + VStack { + HikeView(hike: hikeData[0]) + .padding() + Spacer() + } + } +} +#endif diff --git a/Examples/WorkingWithUIControls/Complete/Landmarks/Landmarks/Home.swift b/Examples/WorkingWithUIControls/Complete/Landmarks/Landmarks/Home.swift new file mode 100755 index 0000000..5237246 --- /dev/null +++ b/Examples/WorkingWithUIControls/Complete/Landmarks/Landmarks/Home.swift @@ -0,0 +1,67 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +A view showing featured landmarks above a list of all of the landmarks. +*/ + +import SwiftUI + +struct CategoryHome: View { + var categories: [String: [Landmark]] { + .init( + grouping: landmarkData, + by: { $0.category.rawValue } + ) + } + + var featured: [Landmark] { + landmarkData.filter { $0.isFeatured } + } + + var body: some View { + NavigationView { + List { + FeaturedLandmarks(landmarks: featured) + .scaledToFill() + .frame(height: 200) + .clipped() + .listRowInsets(EdgeInsets()) + + ForEach(categories.keys.sorted().identified(by: \.self)) { key in + CategoryRow(categoryName: key, items: self.categories[key]!) + } + .listRowInsets(EdgeInsets()) + + NavigationButton(destination: LandmarkList()) { + Text("See All") + } + } + .navigationBarTitle(Text("Featured")) + .navigationBarItems(trailing: + PresentationButton( + Image(systemName: "person.crop.circle") + .imageScale(.large) + .accessibility(label: Text("User Profile")) + .padding(), + destination: ProfileHost() + ) + ) + } + } +} + +struct FeaturedLandmarks: View { + var landmarks: [Landmark] + var body: some View { + landmarks[0].image(forSize: 250).resizable() + } +} + +#if DEBUG +struct CategoryHome_Previews: PreviewProvider { + static var previews: some View { + CategoryHome() + } +} +#endif diff --git a/Examples/WorkingWithUIControls/Complete/Landmarks/Landmarks/Info.plist b/Examples/WorkingWithUIControls/Complete/Landmarks/Landmarks/Info.plist new file mode 100755 index 0000000..e8bb4c6 --- /dev/null +++ b/Examples/WorkingWithUIControls/Complete/Landmarks/Landmarks/Info.plist @@ -0,0 +1,62 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + $(PRODUCT_BUNDLE_PACKAGE_TYPE) + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1 + LSRequiresIPhoneOS + + UIApplicationSceneManifest + + UIApplicationSupportsMultipleScenes + + UISceneConfigurations + + UIWindowSceneSessionRoleApplication + + + UILaunchStoryboardName + LaunchScreen + UISceneConfigurationName + Default Configuration + UISceneDelegateClassName + $(PRODUCT_MODULE_NAME).SceneDelegate + + + + + UILaunchStoryboardName + LaunchScreen + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/Examples/WorkingWithUIControls/Complete/Landmarks/Landmarks/LandmarkDetail.swift b/Examples/WorkingWithUIControls/Complete/Landmarks/Landmarks/LandmarkDetail.swift new file mode 100755 index 0000000..6c290a3 --- /dev/null +++ b/Examples/WorkingWithUIControls/Complete/Landmarks/Landmarks/LandmarkDetail.swift @@ -0,0 +1,71 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +A view showing the details for a landmark. +*/ + +import SwiftUI + +struct LandmarkDetail: View { + @EnvironmentObject var userData: UserData + var landmark: Landmark + + var landmarkIndex: Int { + userData.landmarks.firstIndex(where: { $0.id == landmark.id })! + } + + var body: some View { + VStack { + MapView(coordinate: landmark.locationCoordinate) + .edgesIgnoringSafeArea(.top) + .frame(height: 300) + + CircleImage(image: landmark.image(forSize: 250)) + .offset(x: 0, y: -130) + .padding(.bottom, -130) + + VStack(alignment: .leading) { + HStack { + Text(verbatim: landmark.name) + .font(.title) + + Button(action: { + self.userData.landmarks[self.landmarkIndex] + .isFavorite.toggle() + }) { + if self.userData.landmarks[self.landmarkIndex] + .isFavorite { + Image(systemName: "star.fill") + .foregroundColor(Color.yellow) + } else { + Image(systemName: "star") + .foregroundColor(Color.gray) + } + } + } + + HStack(alignment: .top) { + Text(verbatim: landmark.park) + .font(.subheadline) + Spacer() + Text(verbatim: landmark.state) + .font(.subheadline) + } + } + .padding() + + Spacer() + } + } +} + +#if DEBUG +struct LandmarkDetail_Preview: PreviewProvider { + static var previews: some View { + let userData = UserData() + return LandmarkDetail(landmark: userData.landmarks[0]) + .environmentObject(userData) + } +} +#endif diff --git a/Examples/WorkingWithUIControls/Complete/Landmarks/Landmarks/LandmarkList.swift b/Examples/WorkingWithUIControls/Complete/Landmarks/Landmarks/LandmarkList.swift new file mode 100755 index 0000000..c17b5f3 --- /dev/null +++ b/Examples/WorkingWithUIControls/Complete/Landmarks/Landmarks/LandmarkList.swift @@ -0,0 +1,45 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +A view showing a list of landmarks. +*/ + +import SwiftUI + +struct LandmarkList: View { + @EnvironmentObject private var userData: UserData + + var body: some View { + NavigationView { + List { + Toggle(isOn: $userData.showFavoritesOnly) { + Text("Show Favorites Only") + } + + ForEach(userData.landmarks) { landmark in + if !self.userData.showFavoritesOnly || landmark.isFavorite { + NavigationButton( + destination: LandmarkDetail(landmark: landmark)) { + LandmarkRow(landmark: landmark) + } + } + } + } + .navigationBarTitle(Text("Landmarks"), displayMode: .large) + } + } +} + +#if DEBUG +struct LandmarksList_Previews: PreviewProvider { + static var previews: some View { + ForEach(["iPhone SE", "iPhone XS Max"].identified(by: \.self)) { deviceName in + LandmarkList() + .previewDevice(PreviewDevice(rawValue: deviceName)) + .previewDisplayName(deviceName) + } + .environmentObject(UserData()) + } +} +#endif diff --git a/Examples/WorkingWithUIControls/Complete/Landmarks/Landmarks/Models/Data.swift b/Examples/WorkingWithUIControls/Complete/Landmarks/Landmarks/Models/Data.swift new file mode 100755 index 0000000..248d3b2 --- /dev/null +++ b/Examples/WorkingWithUIControls/Complete/Landmarks/Landmarks/Models/Data.swift @@ -0,0 +1,95 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +Helpers for loading images and data. +*/ + +import Foundation +import CoreLocation +import UIKit +import SwiftUI + +let landmarkData: [Landmark] = load("landmarkData.json") +let hikeData: [Hike] = load("hikeData.json") + +func load(_ filename: String, as type: T.Type = T.self) -> T { + let data: Data + + guard let file = Bundle.main.url(forResource: filename, withExtension: nil) + else { + fatalError("Couldn't find \(filename) in main bundle.") + } + + do { + data = try Data(contentsOf: file) + } catch { + fatalError("Couldn't load \(filename) from main bundle:\n\(error)") + } + + do { + let decoder = JSONDecoder() + return try decoder.decode(T.self, from: data) + } catch { + fatalError("Couldn't parse \(filename) as \(T.self):\n\(error)") + } +} + +final class ImageStore { + fileprivate typealias _ImageDictionary = [String: [Int: CGImage]] + fileprivate var images: _ImageDictionary = [:] + + fileprivate static var originalSize = 250 + fileprivate static var scale = 2 + + static var shared = ImageStore() + + func image(name: String, size: Int) -> Image { + let index = _guaranteeInitialImage(name: name) + + let sizedImage = images.values[index][size] + ?? _sizeImage(images.values[index][ImageStore.originalSize]!, to: size * ImageStore.scale) + images.values[index][size] = sizedImage + + return Image(sizedImage, scale: Length(ImageStore.scale), label: Text(verbatim: name)) + } + + fileprivate func _guaranteeInitialImage(name: String) -> _ImageDictionary.Index { + if let index = images.index(forKey: name) { return index } + + guard + let url = Bundle.main.url(forResource: name, withExtension: "jpg"), + let imageSource = CGImageSourceCreateWithURL(url as NSURL, nil), + let image = CGImageSourceCreateImageAtIndex(imageSource, 0, nil) + else { + fatalError("Couldn't load image \(name).jpg from main bundle.") + } + + images[name] = [ImageStore.originalSize: image] + return images.index(forKey: name)! + } + + fileprivate func _sizeImage(_ image: CGImage, to size: Int) -> CGImage { + guard + let colorSpace = image.colorSpace, + let context = CGContext( + data: nil, + width: size, height: size, + bitsPerComponent: image.bitsPerComponent, + bytesPerRow: image.bytesPerRow, + space: colorSpace, + bitmapInfo: image.bitmapInfo.rawValue) + else { + fatalError("Couldn't create graphics context.") + } + context.interpolationQuality = .high + context.draw(image, in: CGRect(x: 0, y: 0, width: size, height: size)) + + if let sizedImage = context.makeImage() { + return sizedImage + } else { + fatalError("Couldn't resize image.") + } + } +} + diff --git a/Examples/WorkingWithUIControls/Complete/Landmarks/Landmarks/Models/Hike.swift b/Examples/WorkingWithUIControls/Complete/Landmarks/Landmarks/Models/Hike.swift new file mode 100755 index 0000000..dfd2bb8 --- /dev/null +++ b/Examples/WorkingWithUIControls/Complete/Landmarks/Landmarks/Models/Hike.swift @@ -0,0 +1,31 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +The model for a hike. +*/ + +import SwiftUI + +struct Hike: Codable, Hashable, Identifiable { + var name: String + var id: Int + var distance: Double + var difficulty: Int + var observations: [Observation] + + static var formatter = LengthFormatter() + + var distanceText: String { + return Hike.formatter + .string(fromValue: distance, unit: .kilometer) + } + + struct Observation: Codable, Hashable { + var distanceFromStart: Double + + var elevation: Range + var pace: Range + var heartRate: Range + } +} diff --git a/Examples/WorkingWithUIControls/Complete/Landmarks/Landmarks/Models/Landmark.swift b/Examples/WorkingWithUIControls/Complete/Landmarks/Landmarks/Models/Landmark.swift new file mode 100755 index 0000000..4a7586d --- /dev/null +++ b/Examples/WorkingWithUIControls/Complete/Landmarks/Landmarks/Models/Landmark.swift @@ -0,0 +1,43 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +The model for an individual landmark. +*/ + +import SwiftUI +import CoreLocation + +struct Landmark: Hashable, Codable, Identifiable { + var id: Int + var name: String + fileprivate var imageName: String + fileprivate var coordinates: Coordinates + var state: String + var park: String + var category: Category + var isFavorite: Bool + var isFeatured: Bool + + var locationCoordinate: CLLocationCoordinate2D { + CLLocationCoordinate2D( + latitude: coordinates.latitude, + longitude: coordinates.longitude) + } + + func image(forSize size: Int) -> Image { + ImageStore.shared.image(name: imageName, size: size) + } + + enum Category: String, CaseIterable, Codable, Hashable { + case featured = "Featured" + case lakes = "Lakes" + case rivers = "Rivers" + case mountains = "Mountains" + } +} + +struct Coordinates: Hashable, Codable { + var latitude: Double + var longitude: Double +} diff --git a/Examples/WorkingWithUIControls/Complete/Landmarks/Landmarks/Models/Profile.swift b/Examples/WorkingWithUIControls/Complete/Landmarks/Landmarks/Models/Profile.swift new file mode 100755 index 0000000..7c30519 --- /dev/null +++ b/Examples/WorkingWithUIControls/Complete/Landmarks/Landmarks/Models/Profile.swift @@ -0,0 +1,30 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +An object that models a user profile. +*/ +import Foundation + +struct Profile { + var username: String + var prefersNotifications: Bool + var seasonalPhoto: Season + var goalDate: Date + + static let `default` = Self(username: "g_kumar", prefersNotifications: true, seasonalPhoto: .winter) + + init(username: String, prefersNotifications: Bool = true, seasonalPhoto: Season = .winter) { + self.username = username + self.prefersNotifications = prefersNotifications + self.seasonalPhoto = seasonalPhoto + self.goalDate = Date() + } + + enum Season: String, CaseIterable { + case spring = "🌷" + case summer = "🌞" + case autumn = "🍂" + case winter = "☃️" + } +} diff --git a/Examples/WorkingWithUIControls/Complete/Landmarks/Landmarks/Models/UserData.swift b/Examples/WorkingWithUIControls/Complete/Landmarks/Landmarks/Models/UserData.swift new file mode 100755 index 0000000..db31fb0 --- /dev/null +++ b/Examples/WorkingWithUIControls/Complete/Landmarks/Landmarks/Models/UserData.swift @@ -0,0 +1,25 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +A model object that stores app data. +*/ + +import Combine +import SwiftUI + +final class UserData: BindableObject { + let didChange = PassthroughSubject() + + var showFavoritesOnly = false { + didSet { + didChange.send(self) + } + } + + var landmarks = landmarkData { + didSet { + didChange.send(self) + } + } +} diff --git a/Examples/WorkingWithUIControls/Complete/Landmarks/Landmarks/Preview Content/Preview Assets.xcassets/Contents.json b/Examples/WorkingWithUIControls/Complete/Landmarks/Landmarks/Preview Content/Preview Assets.xcassets/Contents.json new file mode 100755 index 0000000..da4a164 --- /dev/null +++ b/Examples/WorkingWithUIControls/Complete/Landmarks/Landmarks/Preview Content/Preview Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Examples/WorkingWithUIControls/Complete/Landmarks/Landmarks/Profiles/ProfileEditor.swift b/Examples/WorkingWithUIControls/Complete/Landmarks/Landmarks/Profiles/ProfileEditor.swift new file mode 100755 index 0000000..ca4cdda --- /dev/null +++ b/Examples/WorkingWithUIControls/Complete/Landmarks/Landmarks/Profiles/ProfileEditor.swift @@ -0,0 +1,56 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +An editable profile view. +*/ + +import SwiftUI + +struct ProfileEditor: View { + @Binding var profile: Profile + + var body: some View { + List { + HStack { + Text("Username").bold() + Divider() + TextField($profile.username) + } + + Toggle(isOn: $profile.prefersNotifications) { + Text("Enable Notifications") + } + + VStack(alignment: .leading, spacing: 20) { + Text("Seasonal Photo").bold() + + SegmentedControl(selection: $profile.seasonalPhoto) { + ForEach(Profile.Season.allCases.identified(by: \.self)) { season in + Text(season.rawValue).tag(season) + } + } + } + .padding(.top) + + VStack(alignment: .leading, spacing: 20) { + Text("Goal Date").bold() + DatePicker( + $profile.goalDate, + minimumDate: Calendar.current.date(byAdding: .year, value: -1, to: profile.goalDate), + maximumDate: Calendar.current.date(byAdding: .year, value: 1, to: profile.goalDate), + displayedComponents: .date + ) + } + .padding(.top) + } + } +} + +#if DEBUG +struct ProfileEditor_Previews: PreviewProvider { + static var previews: some View { + ProfileEditor(profile: .constant(.default)) + } +} +#endif diff --git a/Examples/WorkingWithUIControls/Complete/Landmarks/Landmarks/Profiles/ProfileHost.swift b/Examples/WorkingWithUIControls/Complete/Landmarks/Landmarks/Profiles/ProfileHost.swift new file mode 100755 index 0000000..534c771 --- /dev/null +++ b/Examples/WorkingWithUIControls/Complete/Landmarks/Landmarks/Profiles/ProfileHost.swift @@ -0,0 +1,50 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +A view that hosts the profile viewer and editor. +*/ + +import SwiftUI + +struct ProfileHost: View { + @Environment(\.editMode) var mode + @State var profile = Profile.default + @State var draftProfile = Profile.default + + var body: some View { + VStack(alignment: .leading, spacing: 20) { + HStack { + if self.mode?.value == .active { + Button(action: { + self.profile = self.draftProfile + self.mode?.animation().value = .inactive + }) { + Text("Done") + } + } + + Spacer() + + EditButton() + } + if self.mode?.value == .inactive { + ProfileSummary(profile: profile) + } else { + ProfileEditor(profile: $draftProfile) + .onDisappear { + self.draftProfile = self.profile + } + } + } + .padding() + } +} + +#if DEBUG +struct ProfileHost_Previews: PreviewProvider { + static var previews: some View { + ProfileHost() + } +} +#endif diff --git a/Examples/WorkingWithUIControls/Complete/Landmarks/Landmarks/Profiles/ProfileSummary.swift b/Examples/WorkingWithUIControls/Complete/Landmarks/Landmarks/Profiles/ProfileSummary.swift new file mode 100755 index 0000000..6d31231 --- /dev/null +++ b/Examples/WorkingWithUIControls/Complete/Landmarks/Landmarks/Profiles/ProfileSummary.swift @@ -0,0 +1,65 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +A view that summarizes a profile. +*/ + +import SwiftUI + +struct ProfileSummary: View { + var profile: Profile + + static var goalFormat: DateFormatter { + let formatter = DateFormatter() + formatter.dateFormat = "MMMM d, yyyy" + return formatter + } + + var body: some View { + List { + Text(profile.username) + .bold() + .font(.title) + + Text("Notifications: \(self.profile.prefersNotifications ? "On": "Off" )") + + Text("Seasonal Photos: \(self.profile.seasonalPhoto.rawValue)") + + Text("Goal Date: \(self.profile.goalDate, formatter: Self.goalFormat)") + + VStack(alignment: .leading) { + Text("Completed Badges") + .font(.headline) + ScrollView { + HStack { + HikeBadge(name: "First Hike") + + HikeBadge(name: "Earth Day") + .hueRotation(Angle(degrees: 90)) + + HikeBadge(name: "Tenth Hike") + .grayscale(0.5) + .hueRotation(Angle(degrees: 45)) + } + } + .frame(height: 140) + } + + VStack(alignment: .leading) { + Text("Recent Hikes") + .font(.headline) + + HikeView(hike: hikeData[0]) + } + } + } +} + +#if DEBUG +struct ProfileSummary_Previews: PreviewProvider { + static var previews: some View { + ProfileSummary(profile: Profile.default) + } +} +#endif diff --git a/Examples/WorkingWithUIControls/Complete/Landmarks/Landmarks/Resources/charleyrivers.jpg b/Examples/WorkingWithUIControls/Complete/Landmarks/Landmarks/Resources/charleyrivers.jpg new file mode 100755 index 0000000..17ff44b Binary files /dev/null and b/Examples/WorkingWithUIControls/Complete/Landmarks/Landmarks/Resources/charleyrivers.jpg differ diff --git a/Examples/WorkingWithUIControls/Complete/Landmarks/Landmarks/Resources/chilkoottrail.jpg b/Examples/WorkingWithUIControls/Complete/Landmarks/Landmarks/Resources/chilkoottrail.jpg new file mode 100755 index 0000000..e7f805e Binary files /dev/null and b/Examples/WorkingWithUIControls/Complete/Landmarks/Landmarks/Resources/chilkoottrail.jpg differ diff --git a/Examples/WorkingWithUIControls/Complete/Landmarks/Landmarks/Resources/chincoteague.jpg b/Examples/WorkingWithUIControls/Complete/Landmarks/Landmarks/Resources/chincoteague.jpg new file mode 100755 index 0000000..5f47986 Binary files /dev/null and b/Examples/WorkingWithUIControls/Complete/Landmarks/Landmarks/Resources/chincoteague.jpg differ diff --git a/Examples/WorkingWithUIControls/Complete/Landmarks/Landmarks/Resources/hiddenlake.jpg b/Examples/WorkingWithUIControls/Complete/Landmarks/Landmarks/Resources/hiddenlake.jpg new file mode 100755 index 0000000..d8e804c Binary files /dev/null and b/Examples/WorkingWithUIControls/Complete/Landmarks/Landmarks/Resources/hiddenlake.jpg differ diff --git a/Examples/WorkingWithUIControls/Complete/Landmarks/Landmarks/Resources/hikeData.json b/Examples/WorkingWithUIControls/Complete/Landmarks/Landmarks/Resources/hikeData.json new file mode 100755 index 0000000..3fb1e96 --- /dev/null +++ b/Examples/WorkingWithUIControls/Complete/Landmarks/Landmarks/Resources/hikeData.json @@ -0,0 +1,1882 @@ +[ + { + "name":"Lonesome Ridge Trail", + "id":1001, + "distance":4.5, + "difficulty":3, + "observations":[ + { + "elevation":[ + 291.65263635636268, + 309.26016677925196 + ], + "pace":[ + 396.08716481908732, + 403.68937873525232 + ], + "heartRate":[ + 117.16351898665887, + 121.95815455919609 + ], + "distanceFromStart":0 + }, + { + "elevation":[ + 299.24001936628116, + 317.44584350790012 + ], + "pace":[ + 380.19020240756623, + 395.3978319010256 + ], + "heartRate":[ + 117.6410892152911, + 124.82185220506081 + ], + "distanceFromStart":0.375 + }, + { + "elevation":[ + 303.62145464574394, + 336.05569457646544 + ], + "pace":[ + 380.55927782266116, + 397.60789726832775 + ], + "heartRate":[ + 121.52696452049059, + 127.31525441110122 + ], + "distanceFromStart":0.75 + }, + { + "elevation":[ + 319.90393365162629, + 346.26966025518789 + ], + "pace":[ + 357.94116421258531, + 398.0750288648062 + ], + "heartRate":[ + 123.75908585923588, + 132.77069404486801 + ], + "distanceFromStart":1.125 + }, + { + "elevation":[ + 354.17104439267905, + 403.57031216972939 + ], + "pace":[ + 335.07385149392701, + 397.82674381875808 + ], + "heartRate":[ + 130.8235194572915, + 140.55700591418218 + ], + "distanceFromStart":1.5 + }, + { + "elevation":[ + 357.42992871175124, + 385.92155620623635 + ], + "pace":[ + 395.16168913839374, + 404.60294066527558 + ], + "heartRate":[ + 131.5456052446734, + 134.65984504627627 + ], + "distanceFromStart":1.875 + }, + { + "elevation":[ + 345.47736721935661, + 363.18776661379422 + ], + "pace":[ + 340.82303041339082, + 404.71689228682374 + ], + "heartRate":[ + 125.1949698433959, + 131.31354363122026 + ], + "distanceFromStart":2.25 + }, + { + "elevation":[ + 346.23343025200535, + 497.23376445462401 + ], + "pace":[ + 261.27629148816021, + 331.68516208719467 + ], + "heartRate":[ + 131.67810544238606, + 154.26779645311458 + ], + "distanceFromStart":2.625 + }, + { + "elevation":[ + 491.57378483134391, + 547.49535224251053 + ], + "pace":[ + 296.05298644112088, + 401.14092967732398 + ], + "heartRate":[ + 151.36398089694217, + 166.20454793289232 + ], + "distanceFromStart":3 + }, + { + "elevation":[ + 472.06803233416338, + 531.92570520228401 + ], + "pace":[ + 395.50830663514012, + 401.67837917543591 + ], + "heartRate":[ + 134.41798110234078, + 151.90886697564241 + ], + "distanceFromStart":3.375 + }, + { + "elevation":[ + 339.81419476005283, + 461.03832527824829 + ], + "pace":[ + 395.31160487975183, + 404.49550455974907 + ], + "heartRate":[ + 129.97753472415462, + 138.13531094848992 + ], + "distanceFromStart":3.75 + }, + { + "elevation":[ + 303.1495508565697, + 342.3532820173541 + ], + "pace":[ + 395.02844559698116, + 402.65878340653796 + ], + "heartRate":[ + 127.72304232462609, + 133.26322270764186 + ], + "distanceFromStart":4.125 + } + ] + }, + { + "name":"Lonesome Ridge Trail", + "id":1002, + "distance":4.5, + "difficulty":3, + "observations":[ + { + "elevation":[ + 291.65263635636268, + 309.26016677925196 + ], + "pace":[ + 396.08716481908732, + 403.68937873525232 + ], + "heartRate":[ + 117.16351898665887, + 121.95815455919609 + ], + "distanceFromStart":0 + }, + { + "elevation":[ + 299.24001936628116, + 317.44584350790012 + ], + "pace":[ + 380.19020240756623, + 395.3978319010256 + ], + "heartRate":[ + 117.6410892152911, + 124.82185220506081 + ], + "distanceFromStart":0.375 + }, + { + "elevation":[ + 303.62145464574394, + 336.05569457646544 + ], + "pace":[ + 380.55927782266116, + 397.60789726832775 + ], + "heartRate":[ + 121.52696452049059, + 127.31525441110122 + ], + "distanceFromStart":0.75 + }, + { + "elevation":[ + 319.90393365162629, + 346.26966025518789 + ], + "pace":[ + 357.94116421258531, + 398.0750288648062 + ], + "heartRate":[ + 123.75908585923588, + 132.77069404486801 + ], + "distanceFromStart":1.125 + }, + { + "elevation":[ + 354.17104439267905, + 403.57031216972939 + ], + "pace":[ + 335.07385149392701, + 397.82674381875808 + ], + "heartRate":[ + 130.8235194572915, + 140.55700591418218 + ], + "distanceFromStart":1.5 + }, + { + "elevation":[ + 357.42992871175124, + 385.92155620623635 + ], + "pace":[ + 395.16168913839374, + 404.60294066527558 + ], + "heartRate":[ + 131.5456052446734, + 134.65984504627627 + ], + "distanceFromStart":1.875 + }, + { + "elevation":[ + 345.47736721935661, + 363.18776661379422 + ], + "pace":[ + 340.82303041339082, + 404.71689228682374 + ], + "heartRate":[ + 125.1949698433959, + 131.31354363122026 + ], + "distanceFromStart":2.25 + }, + { + "elevation":[ + 346.23343025200535, + 497.23376445462401 + ], + "pace":[ + 261.27629148816021, + 331.68516208719467 + ], + "heartRate":[ + 131.67810544238606, + 154.26779645311458 + ], + "distanceFromStart":2.625 + }, + { + "elevation":[ + 491.57378483134391, + 547.49535224251053 + ], + "pace":[ + 296.05298644112088, + 401.14092967732398 + ], + "heartRate":[ + 151.36398089694217, + 166.20454793289232 + ], + "distanceFromStart":3 + }, + { + "elevation":[ + 472.06803233416338, + 531.92570520228401 + ], + "pace":[ + 395.50830663514012, + 401.67837917543591 + ], + "heartRate":[ + 134.41798110234078, + 151.90886697564241 + ], + "distanceFromStart":3.375 + }, + { + "elevation":[ + 339.81419476005283, + 461.03832527824829 + ], + "pace":[ + 395.31160487975183, + 404.49550455974907 + ], + "heartRate":[ + 129.97753472415462, + 138.13531094848992 + ], + "distanceFromStart":3.75 + }, + { + "elevation":[ + 303.1495508565697, + 342.3532820173541 + ], + "pace":[ + 395.02844559698116, + 402.65878340653796 + ], + "heartRate":[ + 127.72304232462609, + 133.26322270764186 + ], + "distanceFromStart":4.125 + } + ] + }, + { + "name":"Lonesome Ridge Trail", + "id":1003, + "distance":4.5, + "difficulty":3, + "observations":[ + { + "elevation":[ + 291.65263635636268, + 309.26016677925196 + ], + "pace":[ + 396.08716481908732, + 403.68937873525232 + ], + "heartRate":[ + 117.16351898665887, + 121.95815455919609 + ], + "distanceFromStart":0 + }, + { + "elevation":[ + 299.24001936628116, + 317.44584350790012 + ], + "pace":[ + 380.19020240756623, + 395.3978319010256 + ], + "heartRate":[ + 117.6410892152911, + 124.82185220506081 + ], + "distanceFromStart":0.375 + }, + { + "elevation":[ + 303.62145464574394, + 336.05569457646544 + ], + "pace":[ + 380.55927782266116, + 397.60789726832775 + ], + "heartRate":[ + 121.52696452049059, + 127.31525441110122 + ], + "distanceFromStart":0.75 + }, + { + "elevation":[ + 319.90393365162629, + 346.26966025518789 + ], + "pace":[ + 357.94116421258531, + 398.0750288648062 + ], + "heartRate":[ + 123.75908585923588, + 132.77069404486801 + ], + "distanceFromStart":1.125 + }, + { + "elevation":[ + 354.17104439267905, + 403.57031216972939 + ], + "pace":[ + 335.07385149392701, + 397.82674381875808 + ], + "heartRate":[ + 130.8235194572915, + 140.55700591418218 + ], + "distanceFromStart":1.5 + }, + { + "elevation":[ + 357.42992871175124, + 385.92155620623635 + ], + "pace":[ + 395.16168913839374, + 404.60294066527558 + ], + "heartRate":[ + 131.5456052446734, + 134.65984504627627 + ], + "distanceFromStart":1.875 + }, + { + "elevation":[ + 345.47736721935661, + 363.18776661379422 + ], + "pace":[ + 340.82303041339082, + 404.71689228682374 + ], + "heartRate":[ + 125.1949698433959, + 131.31354363122026 + ], + "distanceFromStart":2.25 + }, + { + "elevation":[ + 346.23343025200535, + 497.23376445462401 + ], + "pace":[ + 261.27629148816021, + 331.68516208719467 + ], + "heartRate":[ + 131.67810544238606, + 154.26779645311458 + ], + "distanceFromStart":2.625 + }, + { + "elevation":[ + 491.57378483134391, + 547.49535224251053 + ], + "pace":[ + 296.05298644112088, + 401.14092967732398 + ], + "heartRate":[ + 151.36398089694217, + 166.20454793289232 + ], + "distanceFromStart":3 + }, + { + "elevation":[ + 472.06803233416338, + 531.92570520228401 + ], + "pace":[ + 395.50830663514012, + 401.67837917543591 + ], + "heartRate":[ + 134.41798110234078, + 151.90886697564241 + ], + "distanceFromStart":3.375 + }, + { + "elevation":[ + 339.81419476005283, + 461.03832527824829 + ], + "pace":[ + 395.31160487975183, + 404.49550455974907 + ], + "heartRate":[ + 129.97753472415462, + 138.13531094848992 + ], + "distanceFromStart":3.75 + }, + { + "elevation":[ + 303.1495508565697, + 342.3532820173541 + ], + "pace":[ + 395.02844559698116, + 402.65878340653796 + ], + "heartRate":[ + 127.72304232462609, + 133.26322270764186 + ], + "distanceFromStart":4.125 + } + ] + }, + { + "name":"Lonesome Ridge Trail", + "id":1004, + "distance":4.5, + "difficulty":3, + "observations":[ + { + "elevation":[ + 291.65263635636268, + 309.26016677925196 + ], + "pace":[ + 396.08716481908732, + 403.68937873525232 + ], + "heartRate":[ + 117.16351898665887, + 121.95815455919609 + ], + "distanceFromStart":0 + }, + { + "elevation":[ + 299.24001936628116, + 317.44584350790012 + ], + "pace":[ + 380.19020240756623, + 395.3978319010256 + ], + "heartRate":[ + 117.6410892152911, + 124.82185220506081 + ], + "distanceFromStart":0.375 + }, + { + "elevation":[ + 303.62145464574394, + 336.05569457646544 + ], + "pace":[ + 380.55927782266116, + 397.60789726832775 + ], + "heartRate":[ + 121.52696452049059, + 127.31525441110122 + ], + "distanceFromStart":0.75 + }, + { + "elevation":[ + 319.90393365162629, + 346.26966025518789 + ], + "pace":[ + 357.94116421258531, + 398.0750288648062 + ], + "heartRate":[ + 123.75908585923588, + 132.77069404486801 + ], + "distanceFromStart":1.125 + }, + { + "elevation":[ + 354.17104439267905, + 403.57031216972939 + ], + "pace":[ + 335.07385149392701, + 397.82674381875808 + ], + "heartRate":[ + 130.8235194572915, + 140.55700591418218 + ], + "distanceFromStart":1.5 + }, + { + "elevation":[ + 357.42992871175124, + 385.92155620623635 + ], + "pace":[ + 395.16168913839374, + 404.60294066527558 + ], + "heartRate":[ + 131.5456052446734, + 134.65984504627627 + ], + "distanceFromStart":1.875 + }, + { + "elevation":[ + 345.47736721935661, + 363.18776661379422 + ], + "pace":[ + 340.82303041339082, + 404.71689228682374 + ], + "heartRate":[ + 125.1949698433959, + 131.31354363122026 + ], + "distanceFromStart":2.25 + }, + { + "elevation":[ + 346.23343025200535, + 497.23376445462401 + ], + "pace":[ + 261.27629148816021, + 331.68516208719467 + ], + "heartRate":[ + 131.67810544238606, + 154.26779645311458 + ], + "distanceFromStart":2.625 + }, + { + "elevation":[ + 491.57378483134391, + 547.49535224251053 + ], + "pace":[ + 296.05298644112088, + 401.14092967732398 + ], + "heartRate":[ + 151.36398089694217, + 166.20454793289232 + ], + "distanceFromStart":3 + }, + { + "elevation":[ + 472.06803233416338, + 531.92570520228401 + ], + "pace":[ + 395.50830663514012, + 401.67837917543591 + ], + "heartRate":[ + 134.41798110234078, + 151.90886697564241 + ], + "distanceFromStart":3.375 + }, + { + "elevation":[ + 339.81419476005283, + 461.03832527824829 + ], + "pace":[ + 395.31160487975183, + 404.49550455974907 + ], + "heartRate":[ + 129.97753472415462, + 138.13531094848992 + ], + "distanceFromStart":3.75 + }, + { + "elevation":[ + 303.1495508565697, + 342.3532820173541 + ], + "pace":[ + 395.02844559698116, + 402.65878340653796 + ], + "heartRate":[ + 127.72304232462609, + 133.26322270764186 + ], + "distanceFromStart":4.125 + } + ] + }, + { + "name":"Lonesome Ridge Trail", + "id":1005, + "distance":4.5, + "difficulty":3, + "observations":[ + { + "elevation":[ + 291.65263635636268, + 309.26016677925196 + ], + "pace":[ + 396.08716481908732, + 403.68937873525232 + ], + "heartRate":[ + 117.16351898665887, + 121.95815455919609 + ], + "distanceFromStart":0 + }, + { + "elevation":[ + 299.24001936628116, + 317.44584350790012 + ], + "pace":[ + 380.19020240756623, + 395.3978319010256 + ], + "heartRate":[ + 117.6410892152911, + 124.82185220506081 + ], + "distanceFromStart":0.375 + }, + { + "elevation":[ + 303.62145464574394, + 336.05569457646544 + ], + "pace":[ + 380.55927782266116, + 397.60789726832775 + ], + "heartRate":[ + 121.52696452049059, + 127.31525441110122 + ], + "distanceFromStart":0.75 + }, + { + "elevation":[ + 319.90393365162629, + 346.26966025518789 + ], + "pace":[ + 357.94116421258531, + 398.0750288648062 + ], + "heartRate":[ + 123.75908585923588, + 132.77069404486801 + ], + "distanceFromStart":1.125 + }, + { + "elevation":[ + 354.17104439267905, + 403.57031216972939 + ], + "pace":[ + 335.07385149392701, + 397.82674381875808 + ], + "heartRate":[ + 130.8235194572915, + 140.55700591418218 + ], + "distanceFromStart":1.5 + }, + { + "elevation":[ + 357.42992871175124, + 385.92155620623635 + ], + "pace":[ + 395.16168913839374, + 404.60294066527558 + ], + "heartRate":[ + 131.5456052446734, + 134.65984504627627 + ], + "distanceFromStart":1.875 + }, + { + "elevation":[ + 345.47736721935661, + 363.18776661379422 + ], + "pace":[ + 340.82303041339082, + 404.71689228682374 + ], + "heartRate":[ + 125.1949698433959, + 131.31354363122026 + ], + "distanceFromStart":2.25 + }, + { + "elevation":[ + 346.23343025200535, + 497.23376445462401 + ], + "pace":[ + 261.27629148816021, + 331.68516208719467 + ], + "heartRate":[ + 131.67810544238606, + 154.26779645311458 + ], + "distanceFromStart":2.625 + }, + { + "elevation":[ + 491.57378483134391, + 547.49535224251053 + ], + "pace":[ + 296.05298644112088, + 401.14092967732398 + ], + "heartRate":[ + 151.36398089694217, + 166.20454793289232 + ], + "distanceFromStart":3 + }, + { + "elevation":[ + 472.06803233416338, + 531.92570520228401 + ], + "pace":[ + 395.50830663514012, + 401.67837917543591 + ], + "heartRate":[ + 134.41798110234078, + 151.90886697564241 + ], + "distanceFromStart":3.375 + }, + { + "elevation":[ + 339.81419476005283, + 461.03832527824829 + ], + "pace":[ + 395.31160487975183, + 404.49550455974907 + ], + "heartRate":[ + 129.97753472415462, + 138.13531094848992 + ], + "distanceFromStart":3.75 + }, + { + "elevation":[ + 303.1495508565697, + 342.3532820173541 + ], + "pace":[ + 395.02844559698116, + 402.65878340653796 + ], + "heartRate":[ + 127.72304232462609, + 133.26322270764186 + ], + "distanceFromStart":4.125 + } + ] + }, + { + "name":"Lonesome Ridge Trail", + "id":1006, + "distance":4.5, + "difficulty":3, + "observations":[ + { + "elevation":[ + 291.65263635636268, + 309.26016677925196 + ], + "pace":[ + 396.08716481908732, + 403.68937873525232 + ], + "heartRate":[ + 117.16351898665887, + 121.95815455919609 + ], + "distanceFromStart":0 + }, + { + "elevation":[ + 299.24001936628116, + 317.44584350790012 + ], + "pace":[ + 380.19020240756623, + 395.3978319010256 + ], + "heartRate":[ + 117.6410892152911, + 124.82185220506081 + ], + "distanceFromStart":0.375 + }, + { + "elevation":[ + 303.62145464574394, + 336.05569457646544 + ], + "pace":[ + 380.55927782266116, + 397.60789726832775 + ], + "heartRate":[ + 121.52696452049059, + 127.31525441110122 + ], + "distanceFromStart":0.75 + }, + { + "elevation":[ + 319.90393365162629, + 346.26966025518789 + ], + "pace":[ + 357.94116421258531, + 398.0750288648062 + ], + "heartRate":[ + 123.75908585923588, + 132.77069404486801 + ], + "distanceFromStart":1.125 + }, + { + "elevation":[ + 354.17104439267905, + 403.57031216972939 + ], + "pace":[ + 335.07385149392701, + 397.82674381875808 + ], + "heartRate":[ + 130.8235194572915, + 140.55700591418218 + ], + "distanceFromStart":1.5 + }, + { + "elevation":[ + 357.42992871175124, + 385.92155620623635 + ], + "pace":[ + 395.16168913839374, + 404.60294066527558 + ], + "heartRate":[ + 131.5456052446734, + 134.65984504627627 + ], + "distanceFromStart":1.875 + }, + { + "elevation":[ + 345.47736721935661, + 363.18776661379422 + ], + "pace":[ + 340.82303041339082, + 404.71689228682374 + ], + "heartRate":[ + 125.1949698433959, + 131.31354363122026 + ], + "distanceFromStart":2.25 + }, + { + "elevation":[ + 346.23343025200535, + 497.23376445462401 + ], + "pace":[ + 261.27629148816021, + 331.68516208719467 + ], + "heartRate":[ + 131.67810544238606, + 154.26779645311458 + ], + "distanceFromStart":2.625 + }, + { + "elevation":[ + 491.57378483134391, + 547.49535224251053 + ], + "pace":[ + 296.05298644112088, + 401.14092967732398 + ], + "heartRate":[ + 151.36398089694217, + 166.20454793289232 + ], + "distanceFromStart":3 + }, + { + "elevation":[ + 472.06803233416338, + 531.92570520228401 + ], + "pace":[ + 395.50830663514012, + 401.67837917543591 + ], + "heartRate":[ + 134.41798110234078, + 151.90886697564241 + ], + "distanceFromStart":3.375 + }, + { + "elevation":[ + 339.81419476005283, + 461.03832527824829 + ], + "pace":[ + 395.31160487975183, + 404.49550455974907 + ], + "heartRate":[ + 129.97753472415462, + 138.13531094848992 + ], + "distanceFromStart":3.75 + }, + { + "elevation":[ + 303.1495508565697, + 342.3532820173541 + ], + "pace":[ + 395.02844559698116, + 402.65878340653796 + ], + "heartRate":[ + 127.72304232462609, + 133.26322270764186 + ], + "distanceFromStart":4.125 + } + ] + }, + { + "name":"Lonesome Ridge Trail", + "id":1007, + "distance":4.5, + "difficulty":3, + "observations":[ + { + "elevation":[ + 291.65263635636268, + 309.26016677925196 + ], + "pace":[ + 396.08716481908732, + 403.68937873525232 + ], + "heartRate":[ + 117.16351898665887, + 121.95815455919609 + ], + "distanceFromStart":0 + }, + { + "elevation":[ + 299.24001936628116, + 317.44584350790012 + ], + "pace":[ + 380.19020240756623, + 395.3978319010256 + ], + "heartRate":[ + 117.6410892152911, + 124.82185220506081 + ], + "distanceFromStart":0.375 + }, + { + "elevation":[ + 303.62145464574394, + 336.05569457646544 + ], + "pace":[ + 380.55927782266116, + 397.60789726832775 + ], + "heartRate":[ + 121.52696452049059, + 127.31525441110122 + ], + "distanceFromStart":0.75 + }, + { + "elevation":[ + 319.90393365162629, + 346.26966025518789 + ], + "pace":[ + 357.94116421258531, + 398.0750288648062 + ], + "heartRate":[ + 123.75908585923588, + 132.77069404486801 + ], + "distanceFromStart":1.125 + }, + { + "elevation":[ + 354.17104439267905, + 403.57031216972939 + ], + "pace":[ + 335.07385149392701, + 397.82674381875808 + ], + "heartRate":[ + 130.8235194572915, + 140.55700591418218 + ], + "distanceFromStart":1.5 + }, + { + "elevation":[ + 357.42992871175124, + 385.92155620623635 + ], + "pace":[ + 395.16168913839374, + 404.60294066527558 + ], + "heartRate":[ + 131.5456052446734, + 134.65984504627627 + ], + "distanceFromStart":1.875 + }, + { + "elevation":[ + 345.47736721935661, + 363.18776661379422 + ], + "pace":[ + 340.82303041339082, + 404.71689228682374 + ], + "heartRate":[ + 125.1949698433959, + 131.31354363122026 + ], + "distanceFromStart":2.25 + }, + { + "elevation":[ + 346.23343025200535, + 497.23376445462401 + ], + "pace":[ + 261.27629148816021, + 331.68516208719467 + ], + "heartRate":[ + 131.67810544238606, + 154.26779645311458 + ], + "distanceFromStart":2.625 + }, + { + "elevation":[ + 491.57378483134391, + 547.49535224251053 + ], + "pace":[ + 296.05298644112088, + 401.14092967732398 + ], + "heartRate":[ + 151.36398089694217, + 166.20454793289232 + ], + "distanceFromStart":3 + }, + { + "elevation":[ + 472.06803233416338, + 531.92570520228401 + ], + "pace":[ + 395.50830663514012, + 401.67837917543591 + ], + "heartRate":[ + 134.41798110234078, + 151.90886697564241 + ], + "distanceFromStart":3.375 + }, + { + "elevation":[ + 339.81419476005283, + 461.03832527824829 + ], + "pace":[ + 395.31160487975183, + 404.49550455974907 + ], + "heartRate":[ + 129.97753472415462, + 138.13531094848992 + ], + "distanceFromStart":3.75 + }, + { + "elevation":[ + 303.1495508565697, + 342.3532820173541 + ], + "pace":[ + 395.02844559698116, + 402.65878340653796 + ], + "heartRate":[ + 127.72304232462609, + 133.26322270764186 + ], + "distanceFromStart":4.125 + } + ] + }, + { + "name":"Lonesome Ridge Trail", + "id":1008, + "distance":4.5, + "difficulty":3, + "observations":[ + { + "elevation":[ + 291.65263635636268, + 309.26016677925196 + ], + "pace":[ + 396.08716481908732, + 403.68937873525232 + ], + "heartRate":[ + 117.16351898665887, + 121.95815455919609 + ], + "distanceFromStart":0 + }, + { + "elevation":[ + 299.24001936628116, + 317.44584350790012 + ], + "pace":[ + 380.19020240756623, + 395.3978319010256 + ], + "heartRate":[ + 117.6410892152911, + 124.82185220506081 + ], + "distanceFromStart":0.375 + }, + { + "elevation":[ + 303.62145464574394, + 336.05569457646544 + ], + "pace":[ + 380.55927782266116, + 397.60789726832775 + ], + "heartRate":[ + 121.52696452049059, + 127.31525441110122 + ], + "distanceFromStart":0.75 + }, + { + "elevation":[ + 319.90393365162629, + 346.26966025518789 + ], + "pace":[ + 357.94116421258531, + 398.0750288648062 + ], + "heartRate":[ + 123.75908585923588, + 132.77069404486801 + ], + "distanceFromStart":1.125 + }, + { + "elevation":[ + 354.17104439267905, + 403.57031216972939 + ], + "pace":[ + 335.07385149392701, + 397.82674381875808 + ], + "heartRate":[ + 130.8235194572915, + 140.55700591418218 + ], + "distanceFromStart":1.5 + }, + { + "elevation":[ + 357.42992871175124, + 385.92155620623635 + ], + "pace":[ + 395.16168913839374, + 404.60294066527558 + ], + "heartRate":[ + 131.5456052446734, + 134.65984504627627 + ], + "distanceFromStart":1.875 + }, + { + "elevation":[ + 345.47736721935661, + 363.18776661379422 + ], + "pace":[ + 340.82303041339082, + 404.71689228682374 + ], + "heartRate":[ + 125.1949698433959, + 131.31354363122026 + ], + "distanceFromStart":2.25 + }, + { + "elevation":[ + 346.23343025200535, + 497.23376445462401 + ], + "pace":[ + 261.27629148816021, + 331.68516208719467 + ], + "heartRate":[ + 131.67810544238606, + 154.26779645311458 + ], + "distanceFromStart":2.625 + }, + { + "elevation":[ + 491.57378483134391, + 547.49535224251053 + ], + "pace":[ + 296.05298644112088, + 401.14092967732398 + ], + "heartRate":[ + 151.36398089694217, + 166.20454793289232 + ], + "distanceFromStart":3 + }, + { + "elevation":[ + 472.06803233416338, + 531.92570520228401 + ], + "pace":[ + 395.50830663514012, + 401.67837917543591 + ], + "heartRate":[ + 134.41798110234078, + 151.90886697564241 + ], + "distanceFromStart":3.375 + }, + { + "elevation":[ + 339.81419476005283, + 461.03832527824829 + ], + "pace":[ + 395.31160487975183, + 404.49550455974907 + ], + "heartRate":[ + 129.97753472415462, + 138.13531094848992 + ], + "distanceFromStart":3.75 + }, + { + "elevation":[ + 303.1495508565697, + 342.3532820173541 + ], + "pace":[ + 395.02844559698116, + 402.65878340653796 + ], + "heartRate":[ + 127.72304232462609, + 133.26322270764186 + ], + "distanceFromStart":4.125 + } + ] + }, + { + "name":"Lonesome Ridge Trail", + "id":1009, + "distance":4.5, + "difficulty":3, + "observations":[ + { + "elevation":[ + 291.65263635636268, + 309.26016677925196 + ], + "pace":[ + 396.08716481908732, + 403.68937873525232 + ], + "heartRate":[ + 117.16351898665887, + 121.95815455919609 + ], + "distanceFromStart":0 + }, + { + "elevation":[ + 299.24001936628116, + 317.44584350790012 + ], + "pace":[ + 380.19020240756623, + 395.3978319010256 + ], + "heartRate":[ + 117.6410892152911, + 124.82185220506081 + ], + "distanceFromStart":0.375 + }, + { + "elevation":[ + 303.62145464574394, + 336.05569457646544 + ], + "pace":[ + 380.55927782266116, + 397.60789726832775 + ], + "heartRate":[ + 121.52696452049059, + 127.31525441110122 + ], + "distanceFromStart":0.75 + }, + { + "elevation":[ + 319.90393365162629, + 346.26966025518789 + ], + "pace":[ + 357.94116421258531, + 398.0750288648062 + ], + "heartRate":[ + 123.75908585923588, + 132.77069404486801 + ], + "distanceFromStart":1.125 + }, + { + "elevation":[ + 354.17104439267905, + 403.57031216972939 + ], + "pace":[ + 335.07385149392701, + 397.82674381875808 + ], + "heartRate":[ + 130.8235194572915, + 140.55700591418218 + ], + "distanceFromStart":1.5 + }, + { + "elevation":[ + 357.42992871175124, + 385.92155620623635 + ], + "pace":[ + 395.16168913839374, + 404.60294066527558 + ], + "heartRate":[ + 131.5456052446734, + 134.65984504627627 + ], + "distanceFromStart":1.875 + }, + { + "elevation":[ + 345.47736721935661, + 363.18776661379422 + ], + "pace":[ + 340.82303041339082, + 404.71689228682374 + ], + "heartRate":[ + 125.1949698433959, + 131.31354363122026 + ], + "distanceFromStart":2.25 + }, + { + "elevation":[ + 346.23343025200535, + 497.23376445462401 + ], + "pace":[ + 261.27629148816021, + 331.68516208719467 + ], + "heartRate":[ + 131.67810544238606, + 154.26779645311458 + ], + "distanceFromStart":2.625 + }, + { + "elevation":[ + 491.57378483134391, + 547.49535224251053 + ], + "pace":[ + 296.05298644112088, + 401.14092967732398 + ], + "heartRate":[ + 151.36398089694217, + 166.20454793289232 + ], + "distanceFromStart":3 + }, + { + "elevation":[ + 472.06803233416338, + 531.92570520228401 + ], + "pace":[ + 395.50830663514012, + 401.67837917543591 + ], + "heartRate":[ + 134.41798110234078, + 151.90886697564241 + ], + "distanceFromStart":3.375 + }, + { + "elevation":[ + 339.81419476005283, + 461.03832527824829 + ], + "pace":[ + 395.31160487975183, + 404.49550455974907 + ], + "heartRate":[ + 129.97753472415462, + 138.13531094848992 + ], + "distanceFromStart":3.75 + }, + { + "elevation":[ + 303.1495508565697, + 342.3532820173541 + ], + "pace":[ + 395.02844559698116, + 402.65878340653796 + ], + "heartRate":[ + 127.72304232462609, + 133.26322270764186 + ], + "distanceFromStart":4.125 + } + ] + }, + { + "name":"Lonesome Ridge Trail", + "id":1010, + "distance":4.5, + "difficulty":3, + "observations":[ + { + "elevation":[ + 291.65263635636268, + 309.26016677925196 + ], + "pace":[ + 396.08716481908732, + 403.68937873525232 + ], + "heartRate":[ + 117.16351898665887, + 121.95815455919609 + ], + "distanceFromStart":0 + }, + { + "elevation":[ + 299.24001936628116, + 317.44584350790012 + ], + "pace":[ + 380.19020240756623, + 395.3978319010256 + ], + "heartRate":[ + 117.6410892152911, + 124.82185220506081 + ], + "distanceFromStart":0.375 + }, + { + "elevation":[ + 303.62145464574394, + 336.05569457646544 + ], + "pace":[ + 380.55927782266116, + 397.60789726832775 + ], + "heartRate":[ + 121.52696452049059, + 127.31525441110122 + ], + "distanceFromStart":0.75 + }, + { + "elevation":[ + 319.90393365162629, + 346.26966025518789 + ], + "pace":[ + 357.94116421258531, + 398.0750288648062 + ], + "heartRate":[ + 123.75908585923588, + 132.77069404486801 + ], + "distanceFromStart":1.125 + }, + { + "elevation":[ + 354.17104439267905, + 403.57031216972939 + ], + "pace":[ + 335.07385149392701, + 397.82674381875808 + ], + "heartRate":[ + 130.8235194572915, + 140.55700591418218 + ], + "distanceFromStart":1.5 + }, + { + "elevation":[ + 357.42992871175124, + 385.92155620623635 + ], + "pace":[ + 395.16168913839374, + 404.60294066527558 + ], + "heartRate":[ + 131.5456052446734, + 134.65984504627627 + ], + "distanceFromStart":1.875 + }, + { + "elevation":[ + 345.47736721935661, + 363.18776661379422 + ], + "pace":[ + 340.82303041339082, + 404.71689228682374 + ], + "heartRate":[ + 125.1949698433959, + 131.31354363122026 + ], + "distanceFromStart":2.25 + }, + { + "elevation":[ + 346.23343025200535, + 497.23376445462401 + ], + "pace":[ + 261.27629148816021, + 331.68516208719467 + ], + "heartRate":[ + 131.67810544238606, + 154.26779645311458 + ], + "distanceFromStart":2.625 + }, + { + "elevation":[ + 491.57378483134391, + 547.49535224251053 + ], + "pace":[ + 296.05298644112088, + 401.14092967732398 + ], + "heartRate":[ + 151.36398089694217, + 166.20454793289232 + ], + "distanceFromStart":3 + }, + { + "elevation":[ + 472.06803233416338, + 531.92570520228401 + ], + "pace":[ + 395.50830663514012, + 401.67837917543591 + ], + "heartRate":[ + 134.41798110234078, + 151.90886697564241 + ], + "distanceFromStart":3.375 + }, + { + "elevation":[ + 339.81419476005283, + 461.03832527824829 + ], + "pace":[ + 395.31160487975183, + 404.49550455974907 + ], + "heartRate":[ + 129.97753472415462, + 138.13531094848992 + ], + "distanceFromStart":3.75 + }, + { + "elevation":[ + 303.1495508565697, + 342.3532820173541 + ], + "pace":[ + 395.02844559698116, + 402.65878340653796 + ], + "heartRate":[ + 127.72304232462609, + 133.26322270764186 + ], + "distanceFromStart":4.125 + } + ] + } +] diff --git a/Examples/WorkingWithUIControls/Complete/Landmarks/Landmarks/Resources/icybay.jpg b/Examples/WorkingWithUIControls/Complete/Landmarks/Landmarks/Resources/icybay.jpg new file mode 100755 index 0000000..feb1764 Binary files /dev/null and b/Examples/WorkingWithUIControls/Complete/Landmarks/Landmarks/Resources/icybay.jpg differ diff --git a/Examples/WorkingWithUIControls/Complete/Landmarks/Landmarks/Resources/lakemcdonald.jpg b/Examples/WorkingWithUIControls/Complete/Landmarks/Landmarks/Resources/lakemcdonald.jpg new file mode 100755 index 0000000..bd9d6b9 Binary files /dev/null and b/Examples/WorkingWithUIControls/Complete/Landmarks/Landmarks/Resources/lakemcdonald.jpg differ diff --git a/Examples/WorkingWithUIControls/Complete/Landmarks/Landmarks/Resources/landmarkData.json b/Examples/WorkingWithUIControls/Complete/Landmarks/Landmarks/Resources/landmarkData.json new file mode 100755 index 0000000..e5b14fc --- /dev/null +++ b/Examples/WorkingWithUIControls/Complete/Landmarks/Landmarks/Resources/landmarkData.json @@ -0,0 +1,182 @@ +[ + { + "name": "Turtle Rock", + "category": "Rivers", + "city": "Twentynine Palms", + "state": "California", + "id": 1001, + "isFeatured": true, + "isFavorite": true, + "park": "Joshua Tree National Park", + "coordinates": { + "longitude": -116.166868, + "latitude": 34.011286 + }, + "imageName": "turtlerock" + }, + { + "name": "Silver Salmon Creek", + "category": "Lakes", + "city": "Port Alsworth", + "state": "Alaska", + "id": 1002, + "isFeatured": false, + "isFavorite": false, + "park": "Lake Clark National Park and Preserve", + "coordinates": { + "longitude": -152.665167, + "latitude": 59.980167 + }, + "imageName": "silversalmoncreek" + }, + { + "name": "Chilkoot Trail", + "category": "Mountains", + "city": "Skagway", + "state": "Alaska", + "id": 1003, + "isFeatured": false, + "isFavorite": true, + "park": "Klondike Gold Rush National Historical Park", + "coordinates": { + "longitude": -135.334571, + "latitude": 59.560551 + }, + "imageName": "chilkoottrail" + }, + { + "name": "St. Mary Lake", + "category": "Lakes", + "city": "Browning", + "state": "Montana", + "id": 1004, + "isFeatured": true, + "isFavorite": true, + "park": "Glacier National Park", + "coordinates": { + "longitude": -113.536248, + "latitude": 48.69423 + }, + "imageName": "stmarylake" + }, + { + "name": "Twin Lake", + "category": "Lakes", + "city": "Twin Lakes", + "state": "Alaska", + "id": 1005, + "isFeatured": false, + "isFavorite": false, + "park": "Lake Clark National Park and Preserve", + "coordinates": { + "longitude": -153.849883, + "latitude": 60.641684 + }, + "imageName": "twinlake" + }, + { + "name": "Lake McDonald", + "category": "Mountains", + "city": "West Glacier", + "state": "Montana", + "id": 1006, + "isFeatured": false, + "isFavorite": false, + "park": "Glacier National Park", + "coordinates": { + "longitude": -113.934831, + "latitude": 48.56002 + }, + "imageName": "lakemcdonald" + }, + { + "name": "Charley Rivers", + "category": "Rivers", + "city": "Eaking", + "state": "Alaska", + "id": 1007, + "isFeatured": true, + "isFavorite": false, + "park": "Charley Rivers National Preserve", + "coordinates": { + "longitude": -143.122586, + "latitude": 65.350021 + }, + "imageName": "charleyrivers", + }, + { + "name": "Icy Bay", + "category": "Mountains", + "city": "Icy Bay", + "state": "Alaska", + "id": 1008, + "isFeatured": false, + "isFavorite": false, + "park": "Wrangell-St. Elias National Park and Preserve", + "coordinates": { + "longitude": -141.518167, + "latitude": 60.089917 + }, + "imageName": "icybay" + }, + { + "name": "Rainbow Lake", + "category": "Lakes", + "city": "Willow", + "state": "Alaska", + "id": 1009, + "isFeatured": false, + "isFavorite": false, + "park": "State Recreation Area", + "coordinates": { + "longitude": -150.086103, + "latitude": 61.694334 + }, + "imageName": "rainbowlake" + }, + { + "name": "Hidden Lake", + "category": "Lakes", + "city": "Newhalem", + "state": "Washington", + "id": 1010, + "isFeatured": false, + "isFavorite": false, + "park": "North Cascades National Park", + "coordinates": { + "longitude": -121.17799, + "latitude": 48.495442 + }, + "imageName": "hiddenlake" + }, + { + "name": "Chincoteague", + "category": "Rivers", + "city": "Chincoteague", + "state": "Virginia", + "id": 1011, + "isFeatured": false, + "isFavorite": false, + "park": "Chincoteague National Wildlife Refuge", + "coordinates": { + "longitude": -75.383212, + "latitude": 37.91531 + }, + "imageName": "chincoteague" + }, + { + "name": "Lake Umbagog", + "category": "Lakes", + "city": "Errol", + "state": "New Hampshire", + "id": 1012, + "isFeatured": true, + "isFavorite": false, + "park": "Umbagog National Wildlife Refuge", + "coordinates": { + "longitude": -71.056816, + "latitude": 44.747408 + }, + "imageName": "umbagog" + } +] diff --git a/Examples/WorkingWithUIControls/Complete/Landmarks/Landmarks/Resources/rainbowlake.jpg b/Examples/WorkingWithUIControls/Complete/Landmarks/Landmarks/Resources/rainbowlake.jpg new file mode 100755 index 0000000..6da43dd Binary files /dev/null and b/Examples/WorkingWithUIControls/Complete/Landmarks/Landmarks/Resources/rainbowlake.jpg differ diff --git a/Examples/WorkingWithUIControls/Complete/Landmarks/Landmarks/Resources/silversalmoncreek.jpg b/Examples/WorkingWithUIControls/Complete/Landmarks/Landmarks/Resources/silversalmoncreek.jpg new file mode 100755 index 0000000..f657532 Binary files /dev/null and b/Examples/WorkingWithUIControls/Complete/Landmarks/Landmarks/Resources/silversalmoncreek.jpg differ diff --git a/Examples/WorkingWithUIControls/Complete/Landmarks/Landmarks/Resources/stmarylake.jpg b/Examples/WorkingWithUIControls/Complete/Landmarks/Landmarks/Resources/stmarylake.jpg new file mode 100755 index 0000000..1c71de4 Binary files /dev/null and b/Examples/WorkingWithUIControls/Complete/Landmarks/Landmarks/Resources/stmarylake.jpg differ diff --git a/Examples/WorkingWithUIControls/Complete/Landmarks/Landmarks/Resources/turtlerock.jpg b/Examples/WorkingWithUIControls/Complete/Landmarks/Landmarks/Resources/turtlerock.jpg new file mode 100755 index 0000000..f7a6e6d Binary files /dev/null and b/Examples/WorkingWithUIControls/Complete/Landmarks/Landmarks/Resources/turtlerock.jpg differ diff --git a/Examples/WorkingWithUIControls/Complete/Landmarks/Landmarks/Resources/twinlake.jpg b/Examples/WorkingWithUIControls/Complete/Landmarks/Landmarks/Resources/twinlake.jpg new file mode 100755 index 0000000..3e7a57c Binary files /dev/null and b/Examples/WorkingWithUIControls/Complete/Landmarks/Landmarks/Resources/twinlake.jpg differ diff --git a/Examples/WorkingWithUIControls/Complete/Landmarks/Landmarks/Resources/umbagog.jpg b/Examples/WorkingWithUIControls/Complete/Landmarks/Landmarks/Resources/umbagog.jpg new file mode 100755 index 0000000..56291c6 Binary files /dev/null and b/Examples/WorkingWithUIControls/Complete/Landmarks/Landmarks/Resources/umbagog.jpg differ diff --git a/Examples/WorkingWithUIControls/Complete/Landmarks/Landmarks/SceneDelegate.swift b/Examples/WorkingWithUIControls/Complete/Landmarks/Landmarks/SceneDelegate.swift new file mode 100755 index 0000000..0f5f17e --- /dev/null +++ b/Examples/WorkingWithUIControls/Complete/Landmarks/Landmarks/SceneDelegate.swift @@ -0,0 +1,56 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +The scene delegate. +*/ + +import UIKit +import SwiftUI + +class SceneDelegate: UIResponder, UIWindowSceneDelegate { + + var window: UIWindow? + + func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) { + // Use this method to optionally configure and attach the UIWindow `window` to the provided UIWindowScene `scene`. + // If using a storyboard, the `window` property will automatically be initialized and attached to the scene. + // This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead). + + // Use a UIHostingController as window root view controller + let window = UIWindow(frame: UIScreen.main.bounds) + window.rootViewController = UIHostingController(rootView: CategoryHome().environmentObject(UserData())) + self.window = window + window.makeKeyAndVisible() + } + + func sceneDidDisconnect(_ scene: UIScene) { + // Called as the scene is being released by the system. + // This occurs shortly after the scene enters the background, or when its session is discarded. + // Release any resources associated with this scene that can be re-created the next time the scene connects. + // The scene may re-connect later, as its session was not neccessarily discarded (see `application:didDiscardSceneSessions` instead). + } + + func sceneDidBecomeActive(_ scene: UIScene) { + // Called when the scene has moved from an inactive state to an active state. + // Use this method to restart any tasks that were paused (or not yet started) when the scene was inactive. + } + + func sceneWillResignActive(_ scene: UIScene) { + // Called when the scene will move from an active state to an inactive state. + // This may occur due to temporary interruptions (ex. an incoming phone call). + } + + func sceneWillEnterForeground(_ scene: UIScene) { + // Called as the scene transitions from the background to the foreground. + // Use this method to undo the changes made on entering the background. + } + + func sceneDidEnterBackground(_ scene: UIScene) { + // Called as the scene transitions from the foreground to the background. + // Use this method to save data, release shared resources, and store enough scene-specific state information + // to restore the scene back to its current state. + } + +} + diff --git a/Examples/WorkingWithUIControls/Complete/Landmarks/Landmarks/Supporting Views/Badge.swift b/Examples/WorkingWithUIControls/Complete/Landmarks/Landmarks/Supporting Views/Badge.swift new file mode 100755 index 0000000..59f03b2 --- /dev/null +++ b/Examples/WorkingWithUIControls/Complete/Landmarks/Landmarks/Supporting Views/Badge.swift @@ -0,0 +1,41 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +A view that displays a badge. +*/ + +import SwiftUI + +struct Badge: View { + static let rotationCount = 8 + + var badgeSymbols: some View { + ForEach(0.. + var overallRange: Range + + var heightRatio: Length { + max(Length(magnitude(of: range) / magnitude(of: overallRange)), 0.15) + } + + var offsetRatio: Length { + Length((range.lowerBound - overallRange.lowerBound) / magnitude(of: overallRange)) + } + + var animation: Animation { + Animation.spring(initialVelocity: 5) + .speed(2) + .delay(0.03 * Double(index)) + } + + var body: some View { + Capsule() + .fill(Color.white) + .frame(height: height * heightRatio, alignment: .bottom) + .offset(x: 0, y: height * -offsetRatio) + .animation(animation) + } +} + +#if DEBUG +struct GraphCapsule_Previews: PreviewProvider { + static var previews: some View { + GraphCapsule(index: 0, height: 150, range: 10..<50, overallRange: 0..<100) + } +} +#endif diff --git a/Examples/WorkingWithUIControls/Complete/Landmarks/Landmarks/Supporting Views/HikeGraph.swift b/Examples/WorkingWithUIControls/Complete/Landmarks/Landmarks/Supporting Views/HikeGraph.swift new file mode 100755 index 0000000..7df5194 --- /dev/null +++ b/Examples/WorkingWithUIControls/Complete/Landmarks/Landmarks/Supporting Views/HikeGraph.swift @@ -0,0 +1,74 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +The elevation, heart rate, and pace of a hike plotted on a graph. +*/ + +import SwiftUI + +func rangeOfRanges(_ ranges: C) -> Range + where C.Element == Range { + guard !ranges.isEmpty else { return 0..<0 } + let low = ranges.lazy.map { $0.lowerBound }.min()! + let high = ranges.lazy.map { $0.upperBound }.max()! + return low..) -> Double { + return range.upperBound - range.lowerBound +} + +struct HikeGraph: View { + var hike: Hike + var path: KeyPath> + + var color: Color { + switch path { + case \.elevation: + return .gray + case \.heartRate: + return Color(hue: 0, saturation: 0.5, brightness: 0.7) + case \.pace: + return Color(hue: 0.7, saturation: 0.4, brightness: 0.7) + default: + return .black + } + } + + var body: some View { + let data = hike.observations + let overallRange = rangeOfRanges(data.lazy.map { $0[keyPath: self.path] }) + let maxMagnitude = data.map { magnitude(of: $0[keyPath: path]) }.max()! + let heightRatio = 1 - Length(maxMagnitude / magnitude(of: overallRange)) + + return GeometryReader { proxy in + HStack(alignment: .bottom, spacing: proxy.size.width / 120) { + ForEach(data.indices) { index in + GraphCapsule( + index: index, + height: proxy.size.height, + range: data[index][keyPath: self.path], + overallRange: overallRange) + .colorMultiply(self.color) + } + .offset(x: 0, y: proxy.size.height * heightRatio) + } + } + } +} + +#if DEBUG +struct HikeGraph_Previews: PreviewProvider { + static var previews: some View { + Group { + HikeGraph(hike: hikeData[0], path: \.elevation) + .frame(height: 200) + HikeGraph(hike: hikeData[0], path: \.heartRate) + .frame(height: 200) + HikeGraph(hike: hikeData[0], path: \.pace) + .frame(height: 200) + } + } +} +#endif diff --git a/Examples/WorkingWithUIControls/Complete/Landmarks/Landmarks/Supporting Views/LandmarkRow.swift b/Examples/WorkingWithUIControls/Complete/Landmarks/Landmarks/Supporting Views/LandmarkRow.swift new file mode 100755 index 0000000..2f8110c --- /dev/null +++ b/Examples/WorkingWithUIControls/Complete/Landmarks/Landmarks/Supporting Views/LandmarkRow.swift @@ -0,0 +1,38 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +A single row to be displayed in a list of landmarks. +*/ + +import SwiftUI + +struct LandmarkRow: View { + var landmark: Landmark + + var body: some View { + HStack { + landmark.image(forSize: 50) + Text(verbatim: landmark.name) + Spacer() + + if landmark.isFavorite { + Image(systemName: "star.fill") + .imageScale(.medium) + .foregroundColor(.yellow) + } + } + } +} + +#if DEBUG +struct LandmarkRow_Previews: PreviewProvider { + static var previews: some View { + Group { + LandmarkRow(landmark: landmarkData[0]) + LandmarkRow(landmark: landmarkData[1]) + } + .previewLayout(.fixed(width: 300, height: 70)) + } +} +#endif diff --git a/Examples/WorkingWithUIControls/Complete/Landmarks/Landmarks/Supporting Views/MapView.swift b/Examples/WorkingWithUIControls/Complete/Landmarks/Landmarks/Supporting Views/MapView.swift new file mode 100755 index 0000000..5a8c64b --- /dev/null +++ b/Examples/WorkingWithUIControls/Complete/Landmarks/Landmarks/Supporting Views/MapView.swift @@ -0,0 +1,31 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +A view that hosts an `MKMapView`. +*/ + +import SwiftUI +import MapKit + +struct MapView: UIViewRepresentable { + var coordinate: CLLocationCoordinate2D + + func makeUIView(context: Context) -> MKMapView { + MKMapView(frame: .zero) + } + + func updateUIView(_ view: MKMapView, context: Context) { + let span = MKCoordinateSpan(latitudeDelta: 0.02, longitudeDelta: 0.02) + let region = MKCoordinateRegion(center: coordinate, span: span) + view.setRegion(region, animated: true) + } +} + +#if DEBUG +struct MapView_Previews: PreviewProvider { + static var previews: some View { + MapView(coordinate: landmarkData[0].locationCoordinate) + } +} +#endif diff --git a/Examples/WorkingWithUIControls/Complete/Landmarks/Landmarks/Supporting Views/RotatedBadgeSymbol.swift b/Examples/WorkingWithUIControls/Complete/Landmarks/Landmarks/Supporting Views/RotatedBadgeSymbol.swift new file mode 100755 index 0000000..a7e4b53 --- /dev/null +++ b/Examples/WorkingWithUIControls/Complete/Landmarks/Landmarks/Supporting Views/RotatedBadgeSymbol.swift @@ -0,0 +1,26 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +A view that displays a rotated version of a badge symbol. +*/ + +import SwiftUI + +struct RotatedBadgeSymbol: View { + let angle: Angle + + var body: some View { + BadgeSymbol() + .padding(-60) + .rotationEffect(angle, anchor: .bottom) + } +} + +#if DEBUG +struct RotatedBadgeSymbol_Previews: PreviewProvider { + static var previews: some View { + RotatedBadgeSymbol(angle: .init(degrees: 5)) + } +} +#endif diff --git a/Examples/WorkingWithUIControls/Complete/Landmarks/WorkingWithUIControls.xcodeproj/.xcodesamplecode.plist b/Examples/WorkingWithUIControls/Complete/Landmarks/WorkingWithUIControls.xcodeproj/.xcodesamplecode.plist new file mode 100755 index 0000000..5dd5da8 --- /dev/null +++ b/Examples/WorkingWithUIControls/Complete/Landmarks/WorkingWithUIControls.xcodeproj/.xcodesamplecode.plist @@ -0,0 +1,5 @@ + + + + + diff --git a/Examples/WorkingWithUIControls/Complete/Landmarks/WorkingWithUIControls.xcodeproj/project.pbxproj b/Examples/WorkingWithUIControls/Complete/Landmarks/WorkingWithUIControls.xcodeproj/project.pbxproj new file mode 100755 index 0000000..f8ece51 --- /dev/null +++ b/Examples/WorkingWithUIControls/Complete/Landmarks/WorkingWithUIControls.xcodeproj/project.pbxproj @@ -0,0 +1,561 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 50; + objects = { + +/* Begin PBXBuildFile section */ + B7310DD1229F6839001079B9 /* HexagonParameters.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7310DD0229F6839001079B9 /* HexagonParameters.swift */; }; + B7310DD3229F6CA9001079B9 /* Badge.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7310DD2229F6CA9001079B9 /* Badge.swift */; }; + B7394866229F194000C47603 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7394865229F194000C47603 /* AppDelegate.swift */; }; + B7394868229F194000C47603 /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7394867229F194000C47603 /* SceneDelegate.swift */; }; + B739486A229F194000C47603 /* LandmarkDetail.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7394869229F194000C47603 /* LandmarkDetail.swift */; }; + B739486C229F194200C47603 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = B739486B229F194200C47603 /* Assets.xcassets */; }; + B739486F229F194200C47603 /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = B739486E229F194200C47603 /* Preview Assets.xcassets */; }; + B7394872229F194200C47603 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = B7394870229F194200C47603 /* LaunchScreen.storyboard */; }; + B739487A229F1B3F00C47603 /* CircleImage.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7394879229F1B3F00C47603 /* CircleImage.swift */; }; + B739487C229F1B6800C47603 /* MapView.swift in Sources */ = {isa = PBXBuildFile; fileRef = B739487B229F1B6800C47603 /* MapView.swift */; }; + B7394881229F28B900C47603 /* Landmark.swift in Sources */ = {isa = PBXBuildFile; fileRef = B739487F229F28B900C47603 /* Landmark.swift */; }; + B7394882229F28B900C47603 /* Data.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7394880229F28B900C47603 /* Data.swift */; }; + B7394891229F292F00C47603 /* rainbowlake.jpg in Resources */ = {isa = PBXBuildFile; fileRef = B7394884229F292D00C47603 /* rainbowlake.jpg */; }; + B7394893229F292F00C47603 /* icybay.jpg in Resources */ = {isa = PBXBuildFile; fileRef = B7394886229F292E00C47603 /* icybay.jpg */; }; + B7394894229F292F00C47603 /* lakemcdonald.jpg in Resources */ = {isa = PBXBuildFile; fileRef = B7394887229F292E00C47603 /* lakemcdonald.jpg */; }; + B7394895229F292F00C47603 /* turtlerock.jpg in Resources */ = {isa = PBXBuildFile; fileRef = B7394888229F292E00C47603 /* turtlerock.jpg */; }; + B7394896229F292F00C47603 /* umbagog.jpg in Resources */ = {isa = PBXBuildFile; fileRef = B7394889229F292E00C47603 /* umbagog.jpg */; }; + B7394897229F292F00C47603 /* hiddenlake.jpg in Resources */ = {isa = PBXBuildFile; fileRef = B739488A229F292E00C47603 /* hiddenlake.jpg */; }; + B7394898229F292F00C47603 /* stmarylake.jpg in Resources */ = {isa = PBXBuildFile; fileRef = B739488B229F292E00C47603 /* stmarylake.jpg */; }; + B7394899229F292F00C47603 /* twinlake.jpg in Resources */ = {isa = PBXBuildFile; fileRef = B739488C229F292E00C47603 /* twinlake.jpg */; }; + B739489A229F292F00C47603 /* silversalmoncreek.jpg in Resources */ = {isa = PBXBuildFile; fileRef = B739488D229F292E00C47603 /* silversalmoncreek.jpg */; }; + B739489B229F292F00C47603 /* landmarkData.json in Resources */ = {isa = PBXBuildFile; fileRef = B739488E229F292E00C47603 /* landmarkData.json */; }; + B739489C229F292F00C47603 /* chincoteague.jpg in Resources */ = {isa = PBXBuildFile; fileRef = B739488F229F292F00C47603 /* chincoteague.jpg */; }; + B739489D229F292F00C47603 /* chilkoottrail.jpg in Resources */ = {isa = PBXBuildFile; fileRef = B7394890229F292F00C47603 /* chilkoottrail.jpg */; }; + B739489F229F2D9700C47603 /* LandmarkRow.swift in Sources */ = {isa = PBXBuildFile; fileRef = B739489E229F2D9700C47603 /* LandmarkRow.swift */; }; + B73948A1229F2E1F00C47603 /* LandmarkList.swift in Sources */ = {isa = PBXBuildFile; fileRef = B73948A0229F2E1F00C47603 /* LandmarkList.swift */; }; + B73948A3229F3E2200C47603 /* charleyrivers.jpg in Resources */ = {isa = PBXBuildFile; fileRef = B73948A2229F3E2200C47603 /* charleyrivers.jpg */; }; + B7D2AAC5229F4D7C0061E5F5 /* UserData.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7D2AAC4229F4D7C0061E5F5 /* UserData.swift */; }; + B7D587AE229F7382006E8DCF /* BadgeBackground.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7D587AD229F7382006E8DCF /* BadgeBackground.swift */; }; + B7D587B0229F73C1006E8DCF /* BadgeSymbol.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7D587AF229F73C1006E8DCF /* BadgeSymbol.swift */; }; + B7D587B2229F7406006E8DCF /* RotatedBadgeSymbol.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7D587B1229F7406006E8DCF /* RotatedBadgeSymbol.swift */; }; + B7D587B6229F825D006E8DCF /* HikeView.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7D587B5229F825D006E8DCF /* HikeView.swift */; }; + B7D587B8229F826D006E8DCF /* GraphCapsule.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7D587B7229F826D006E8DCF /* GraphCapsule.swift */; }; + B7D587BA229F8288006E8DCF /* Hike.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7D587B9229F8288006E8DCF /* Hike.swift */; }; + B7D587BC229F82EB006E8DCF /* HikeDetail.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7D587BB229F82EB006E8DCF /* HikeDetail.swift */; }; + B7D587BE229F82FF006E8DCF /* HikeGraph.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7D587BD229F82FF006E8DCF /* HikeGraph.swift */; }; + B7D587C0229F830B006E8DCF /* hikeData.json in Resources */ = {isa = PBXBuildFile; fileRef = B7D587BF229F830B006E8DCF /* hikeData.json */; }; + B7D587D222A0892C006E8DCF /* Home.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7D587D122A0892C006E8DCF /* Home.swift */; }; + B7D587D422A08965006E8DCF /* CategoryRow.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7D587D322A08965006E8DCF /* CategoryRow.swift */; }; + B7D587D622A08C97006E8DCF /* Profile.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7D587D522A08C97006E8DCF /* Profile.swift */; }; + B7D587D922A08D33006E8DCF /* ProfileHost.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7D587D822A08D33006E8DCF /* ProfileHost.swift */; }; + B7D587DB22A08D67006E8DCF /* ProfileSummary.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7D587DA22A08D67006E8DCF /* ProfileSummary.swift */; }; + B7D587DD22A08DD6006E8DCF /* HikeBadge.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7D587DC22A08DD6006E8DCF /* HikeBadge.swift */; }; + B7D587DF22A08E1A006E8DCF /* ProfileEditor.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7D587DE22A08E1A006E8DCF /* ProfileEditor.swift */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + B7310DD0229F6839001079B9 /* HexagonParameters.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HexagonParameters.swift; sourceTree = ""; }; + B7310DD2229F6CA9001079B9 /* Badge.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Badge.swift; sourceTree = ""; }; + B7394862229F194000C47603 /* Landmarks.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Landmarks.app; sourceTree = BUILT_PRODUCTS_DIR; }; + B7394865229F194000C47603 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + B7394867229F194000C47603 /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = ""; }; + B7394869229F194000C47603 /* LandmarkDetail.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LandmarkDetail.swift; sourceTree = ""; }; + B739486B229F194200C47603 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + B739486E229F194200C47603 /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = ""; }; + B7394871229F194200C47603 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + B7394873229F194200C47603 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + B7394879229F1B3F00C47603 /* CircleImage.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CircleImage.swift; sourceTree = ""; }; + B739487B229F1B6800C47603 /* MapView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MapView.swift; sourceTree = ""; }; + B739487F229F28B900C47603 /* Landmark.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Landmark.swift; sourceTree = ""; }; + B7394880229F28B900C47603 /* Data.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Data.swift; sourceTree = ""; }; + B7394884229F292D00C47603 /* rainbowlake.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = rainbowlake.jpg; sourceTree = ""; }; + B7394886229F292E00C47603 /* icybay.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = icybay.jpg; sourceTree = ""; }; + B7394887229F292E00C47603 /* lakemcdonald.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = lakemcdonald.jpg; sourceTree = ""; }; + B7394888229F292E00C47603 /* turtlerock.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = turtlerock.jpg; sourceTree = ""; }; + B7394889229F292E00C47603 /* umbagog.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = umbagog.jpg; sourceTree = ""; }; + B739488A229F292E00C47603 /* hiddenlake.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = hiddenlake.jpg; sourceTree = ""; }; + B739488B229F292E00C47603 /* stmarylake.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = stmarylake.jpg; sourceTree = ""; }; + B739488C229F292E00C47603 /* twinlake.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = twinlake.jpg; sourceTree = ""; }; + B739488D229F292E00C47603 /* silversalmoncreek.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = silversalmoncreek.jpg; sourceTree = ""; }; + B739488E229F292E00C47603 /* landmarkData.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = landmarkData.json; sourceTree = ""; }; + B739488F229F292F00C47603 /* chincoteague.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = chincoteague.jpg; sourceTree = ""; }; + B7394890229F292F00C47603 /* chilkoottrail.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = chilkoottrail.jpg; sourceTree = ""; }; + B739489E229F2D9700C47603 /* LandmarkRow.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = LandmarkRow.swift; path = "Supporting Views/LandmarkRow.swift"; sourceTree = ""; }; + B73948A0229F2E1F00C47603 /* LandmarkList.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LandmarkList.swift; sourceTree = ""; }; + B73948A2229F3E2200C47603 /* charleyrivers.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = charleyrivers.jpg; sourceTree = ""; }; + B7D2AAC4229F4D7C0061E5F5 /* UserData.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UserData.swift; sourceTree = ""; }; + B7D587AD229F7382006E8DCF /* BadgeBackground.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BadgeBackground.swift; sourceTree = ""; }; + B7D587AF229F73C1006E8DCF /* BadgeSymbol.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BadgeSymbol.swift; sourceTree = ""; }; + B7D587B1229F7406006E8DCF /* RotatedBadgeSymbol.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RotatedBadgeSymbol.swift; sourceTree = ""; }; + B7D587B5229F825D006E8DCF /* HikeView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HikeView.swift; sourceTree = ""; }; + B7D587B7229F826D006E8DCF /* GraphCapsule.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GraphCapsule.swift; sourceTree = ""; }; + B7D587B9229F8288006E8DCF /* Hike.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Hike.swift; sourceTree = ""; }; + B7D587BB229F82EB006E8DCF /* HikeDetail.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HikeDetail.swift; sourceTree = ""; }; + B7D587BD229F82FF006E8DCF /* HikeGraph.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HikeGraph.swift; sourceTree = ""; }; + B7D587BF229F830B006E8DCF /* hikeData.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = hikeData.json; sourceTree = ""; }; + B7D587D122A0892C006E8DCF /* Home.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Home.swift; sourceTree = ""; }; + B7D587D322A08965006E8DCF /* CategoryRow.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CategoryRow.swift; sourceTree = ""; }; + B7D587D522A08C97006E8DCF /* Profile.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Profile.swift; sourceTree = ""; }; + B7D587D822A08D33006E8DCF /* ProfileHost.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProfileHost.swift; sourceTree = ""; }; + B7D587DA22A08D67006E8DCF /* ProfileSummary.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProfileSummary.swift; sourceTree = ""; }; + B7D587DC22A08DD6006E8DCF /* HikeBadge.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HikeBadge.swift; sourceTree = ""; }; + B7D587DE22A08E1A006E8DCF /* ProfileEditor.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProfileEditor.swift; sourceTree = ""; }; + C30D96E0C30D9A6000000001 /* SampleCode.xcconfig */ = {isa = PBXFileReference; name = SampleCode.xcconfig; path = ../Configuration/SampleCode.xcconfig; sourceTree = ""; }; + C35276F0C352949000000001 /* LICENSE.txt */ = {isa = PBXFileReference; includeInIndex = 1; path = LICENSE.txt; sourceTree = ""; }; + C4E4AAA0C4E4035000000001 /* README.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; name = README.md; path = ../README.md; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + B739485F229F194000C47603 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + B7394859229F194000C47603 = { + isa = PBXGroup; + children = ( + C4E4AAA0C4E4035000000001 /* README.md */, + B7394864229F194000C47603 /* Landmarks */, + B7394863229F194000C47603 /* Products */, + C16018F0C1601FC000000001 /* Configuration */, + C3527360C3512CA000000001 /* LICENSE */, + ); + sourceTree = ""; + }; + B7394863229F194000C47603 /* Products */ = { + isa = PBXGroup; + children = ( + B7394862229F194000C47603 /* Landmarks.app */, + ); + name = Products; + sourceTree = ""; + }; + B7394864229F194000C47603 /* Landmarks */ = { + isa = PBXGroup; + children = ( + B739487E229F282200C47603 /* Models */, + B7D587D722A08D16006E8DCF /* Profiles */, + B7394865229F194000C47603 /* AppDelegate.swift */, + B7394867229F194000C47603 /* SceneDelegate.swift */, + B7D587D122A0892C006E8DCF /* Home.swift */, + B7D587D322A08965006E8DCF /* CategoryRow.swift */, + B73948A0229F2E1F00C47603 /* LandmarkList.swift */, + B739489E229F2D9700C47603 /* LandmarkRow.swift */, + B7394869229F194000C47603 /* LandmarkDetail.swift */, + B7D587B5229F825D006E8DCF /* HikeView.swift */, + B7D587BB229F82EB006E8DCF /* HikeDetail.swift */, + B7D587DC22A08DD6006E8DCF /* HikeBadge.swift */, + B7310DD0229F6839001079B9 /* HexagonParameters.swift */, + B739487D229F1C0100C47603 /* Supporting Views */, + B7394883229F291A00C47603 /* Resources */, + B739486B229F194200C47603 /* Assets.xcassets */, + B7394870229F194200C47603 /* LaunchScreen.storyboard */, + B7394873229F194200C47603 /* Info.plist */, + B739486D229F194200C47603 /* Preview Content */, + ); + path = Landmarks; + sourceTree = ""; + }; + B739486D229F194200C47603 /* Preview Content */ = { + isa = PBXGroup; + children = ( + B739486E229F194200C47603 /* Preview Assets.xcassets */, + ); + path = "Preview Content"; + sourceTree = ""; + }; + B739487D229F1C0100C47603 /* Supporting Views */ = { + isa = PBXGroup; + children = ( + B7394879229F1B3F00C47603 /* CircleImage.swift */, + B739487B229F1B6800C47603 /* MapView.swift */, + B7310DD2229F6CA9001079B9 /* Badge.swift */, + B7D587AF229F73C1006E8DCF /* BadgeSymbol.swift */, + B7D587B1229F7406006E8DCF /* RotatedBadgeSymbol.swift */, + B7D587AD229F7382006E8DCF /* BadgeBackground.swift */, + B7D587BD229F82FF006E8DCF /* HikeGraph.swift */, + B7D587B7229F826D006E8DCF /* GraphCapsule.swift */, + ); + path = "Supporting Views"; + sourceTree = ""; + }; + B739487E229F282200C47603 /* Models */ = { + isa = PBXGroup; + children = ( + B7D587D522A08C97006E8DCF /* Profile.swift */, + B7394880229F28B900C47603 /* Data.swift */, + B739487F229F28B900C47603 /* Landmark.swift */, + B7D587B9229F8288006E8DCF /* Hike.swift */, + B7D2AAC4229F4D7C0061E5F5 /* UserData.swift */, + ); + path = Models; + sourceTree = ""; + }; + B7394883229F291A00C47603 /* Resources */ = { + isa = PBXGroup; + children = ( + B739488E229F292E00C47603 /* landmarkData.json */, + B7D587BF229F830B006E8DCF /* hikeData.json */, + B7394890229F292F00C47603 /* chilkoottrail.jpg */, + B739488F229F292F00C47603 /* chincoteague.jpg */, + B739488A229F292E00C47603 /* hiddenlake.jpg */, + B7394886229F292E00C47603 /* icybay.jpg */, + B7394887229F292E00C47603 /* lakemcdonald.jpg */, + B7394884229F292D00C47603 /* rainbowlake.jpg */, + B739488D229F292E00C47603 /* silversalmoncreek.jpg */, + B739488B229F292E00C47603 /* stmarylake.jpg */, + B7394888229F292E00C47603 /* turtlerock.jpg */, + B739488C229F292E00C47603 /* twinlake.jpg */, + B7394889229F292E00C47603 /* umbagog.jpg */, + B73948A2229F3E2200C47603 /* charleyrivers.jpg */, + ); + path = Resources; + sourceTree = ""; + }; + B7D587D722A08D16006E8DCF /* Profiles */ = { + isa = PBXGroup; + children = ( + B7D587D822A08D33006E8DCF /* ProfileHost.swift */, + B7D587DA22A08D67006E8DCF /* ProfileSummary.swift */, + B7D587DE22A08E1A006E8DCF /* ProfileEditor.swift */, + ); + path = Profiles; + sourceTree = ""; + }; + C16018F0C1601FC000000001 /* Configuration */ = { + isa = PBXGroup; + children = ( + C30D96E0C30D9A6000000001 /* SampleCode.xcconfig */, + ); + name = Configuration; + sourceTree = ""; + }; + C3527360C3512CA000000001 /* LICENSE */ = { + isa = PBXGroup; + children = ( + C35276F0C352949000000001 /* LICENSE.txt */, + ); + name = LICENSE; + path = ../LICENSE; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + B7394861229F194000C47603 /* Landmarks */ = { + isa = PBXNativeTarget; + buildConfigurationList = B7394876229F194200C47603 /* Build configuration list for PBXNativeTarget "Landmarks" */; + buildPhases = ( + B739485E229F194000C47603 /* Sources */, + B739485F229F194000C47603 /* Frameworks */, + B7394860229F194000C47603 /* Resources */, + C602AC70C605937000000001, + ); + buildRules = ( + ); + dependencies = ( + ); + name = Landmarks; + productName = Landmarks; + productReference = B7394862229F194000C47603 /* Landmarks.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + B739485A229F194000C47603 /* Project object */ = { + isa = PBXProject; + attributes = { + LastSwiftUpdateCheck = 1100; + LastUpgradeCheck = 1100; + ORGANIZATIONNAME = Apple; + TargetAttributes = { + B7394861229F194000C47603 = { + CreatedOnToolsVersion = 11.0; + }; + }; + }; + buildConfigurationList = B739485D229F194000C47603 /* Build configuration list for PBXProject "WorkingWithUIControls" */; + compatibilityVersion = "Xcode 9.3"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = B7394859229F194000C47603; + productRefGroup = B7394863229F194000C47603 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + B7394861229F194000C47603 /* Landmarks */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + B7394860229F194000C47603 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + B739489A229F292F00C47603 /* silversalmoncreek.jpg in Resources */, + B7394894229F292F00C47603 /* lakemcdonald.jpg in Resources */, + B7D587C0229F830B006E8DCF /* hikeData.json in Resources */, + B7394872229F194200C47603 /* LaunchScreen.storyboard in Resources */, + B73948A3229F3E2200C47603 /* charleyrivers.jpg in Resources */, + B7394891229F292F00C47603 /* rainbowlake.jpg in Resources */, + B739486F229F194200C47603 /* Preview Assets.xcassets in Resources */, + B7394895229F292F00C47603 /* turtlerock.jpg in Resources */, + B739486C229F194200C47603 /* Assets.xcassets in Resources */, + B7394899229F292F00C47603 /* twinlake.jpg in Resources */, + B7394896229F292F00C47603 /* umbagog.jpg in Resources */, + B739489D229F292F00C47603 /* chilkoottrail.jpg in Resources */, + B739489C229F292F00C47603 /* chincoteague.jpg in Resources */, + B739489B229F292F00C47603 /* landmarkData.json in Resources */, + B7394893229F292F00C47603 /* icybay.jpg in Resources */, + B7394897229F292F00C47603 /* hiddenlake.jpg in Resources */, + B7394898229F292F00C47603 /* stmarylake.jpg in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + B739485E229F194000C47603 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + B7394882229F28B900C47603 /* Data.swift in Sources */, + B7310DD3229F6CA9001079B9 /* Badge.swift in Sources */, + B7394866229F194000C47603 /* AppDelegate.swift in Sources */, + B7D587D922A08D33006E8DCF /* ProfileHost.swift in Sources */, + B7D587D622A08C97006E8DCF /* Profile.swift in Sources */, + B7D587B8229F826D006E8DCF /* GraphCapsule.swift in Sources */, + B7D587D422A08965006E8DCF /* CategoryRow.swift in Sources */, + B739487A229F1B3F00C47603 /* CircleImage.swift in Sources */, + B739487C229F1B6800C47603 /* MapView.swift in Sources */, + B7D587BA229F8288006E8DCF /* Hike.swift in Sources */, + B7D587BC229F82EB006E8DCF /* HikeDetail.swift in Sources */, + B7D587B6229F825D006E8DCF /* HikeView.swift in Sources */, + B7310DD1229F6839001079B9 /* HexagonParameters.swift in Sources */, + B73948A1229F2E1F00C47603 /* LandmarkList.swift in Sources */, + B7D587B0229F73C1006E8DCF /* BadgeSymbol.swift in Sources */, + B7D587B2229F7406006E8DCF /* RotatedBadgeSymbol.swift in Sources */, + B7D587DD22A08DD6006E8DCF /* HikeBadge.swift in Sources */, + B7D587D222A0892C006E8DCF /* Home.swift in Sources */, + B7D587BE229F82FF006E8DCF /* HikeGraph.swift in Sources */, + B7394868229F194000C47603 /* SceneDelegate.swift in Sources */, + B7D587AE229F7382006E8DCF /* BadgeBackground.swift in Sources */, + B739486A229F194000C47603 /* LandmarkDetail.swift in Sources */, + B739489F229F2D9700C47603 /* LandmarkRow.swift in Sources */, + B7D587DB22A08D67006E8DCF /* ProfileSummary.swift in Sources */, + B7D2AAC5229F4D7C0061E5F5 /* UserData.swift in Sources */, + B7394881229F28B900C47603 /* Landmark.swift in Sources */, + B7D587DF22A08E1A006E8DCF /* ProfileEditor.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXVariantGroup section */ + B7394870229F194200C47603 /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + B7394871229F194200C47603 /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + B7394874229F194200C47603 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = C30D96E0C30D9A6000000001 /* SampleCode.xcconfig */; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 13.0; + MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; + MTL_FAST_MATH = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + }; + name = Debug; + }; + B7394875229F194200C47603 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = C30D96E0C30D9A6000000001 /* SampleCode.xcconfig */; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 13.0; + MTL_ENABLE_DEBUG_INFO = NO; + MTL_FAST_MATH = YES; + SDKROOT = iphoneos; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + B7394877229F194200C47603 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = C30D96E0C30D9A6000000001 /* SampleCode.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_ASSET_PATHS = "Landmarks/Preview\\ Content"; + DEVELOPMENT_TEAM = ""; + ENABLE_PREVIEWS = YES; + INFOPLIST_FILE = Landmarks/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = "com.example.apple-samplecode.Landmarks${SAMPLE_CODE_DISAMBIGUATOR}"; + PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE_SPECIFIER = ""; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + B7394878229F194200C47603 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = C30D96E0C30D9A6000000001 /* SampleCode.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_ASSET_PATHS = "Landmarks/Preview\\ Content"; + DEVELOPMENT_TEAM = ""; + ENABLE_PREVIEWS = YES; + INFOPLIST_FILE = Landmarks/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = "com.example.apple-samplecode.Landmarks${SAMPLE_CODE_DISAMBIGUATOR}"; + PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE_SPECIFIER = ""; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + B739485D229F194000C47603 /* Build configuration list for PBXProject "WorkingWithUIControls" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + B7394874229F194200C47603 /* Debug */, + B7394875229F194200C47603 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + B7394876229F194200C47603 /* Build configuration list for PBXNativeTarget "Landmarks" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + B7394877229F194200C47603 /* Debug */, + B7394878229F194200C47603 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = B739485A229F194000C47603 /* Project object */; +} diff --git a/Examples/WorkingWithUIControls/Complete/Landmarks/WorkingWithUIControls.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/Examples/WorkingWithUIControls/Complete/Landmarks/WorkingWithUIControls.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings new file mode 100755 index 0000000..3ddf867 --- /dev/null +++ b/Examples/WorkingWithUIControls/Complete/Landmarks/WorkingWithUIControls.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings @@ -0,0 +1,8 @@ + + + + + BuildSystemType + Latest + + diff --git a/Examples/WorkingWithUIControls/Complete/README.md b/Examples/WorkingWithUIControls/Complete/README.md new file mode 100755 index 0000000..5cb1edb --- /dev/null +++ b/Examples/WorkingWithUIControls/Complete/README.md @@ -0,0 +1,3 @@ +# Completed Project: Working with UI Controls + +Explore the completed project for the [Working with UI Controls](https://developer.apple.com/tutorials/swiftui/working-with-ui-controls) tutorial. \ No newline at end of file diff --git a/Examples/WorkingWithUIControls/StartingPoint/.gitignore b/Examples/WorkingWithUIControls/StartingPoint/.gitignore new file mode 100755 index 0000000..9e50718 --- /dev/null +++ b/Examples/WorkingWithUIControls/StartingPoint/.gitignore @@ -0,0 +1,21 @@ +# See LICENSE folder for this sample’s licensing information. +# +# Apple sample code gitignore configuration. + +# Finder +.DS_Store + +# Xcode - User files +xcuserdata/ + +**/*.xcodeproj/project.xcworkspace/* +!**/*.xcodeproj/project.xcworkspace/xcshareddata + +**/*.xcodeproj/project.xcworkspace/xcshareddata/* +!**/*.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings + +**/*.playground/playground.xcworkspace/* +!**/*.playground/playground.xcworkspace/xcshareddata + +**/*.playground/playground.xcworkspace/xcshareddata/* +!**/*.playground/playground.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings diff --git a/Examples/WorkingWithUIControls/StartingPoint/Configuration/SampleCode.xcconfig b/Examples/WorkingWithUIControls/StartingPoint/Configuration/SampleCode.xcconfig new file mode 100755 index 0000000..db86c06 --- /dev/null +++ b/Examples/WorkingWithUIControls/StartingPoint/Configuration/SampleCode.xcconfig @@ -0,0 +1,13 @@ +// +// See LICENSE folder for this sample’s licensing information. +// +// SampleCode.xcconfig +// + +// The `SAMPLE_CODE_DISAMBIGUATOR` configuration is to make it easier to build +// and run a sample code project. Once you set your project's development team, +// you'll have a unique bundle identifier. This is because the bundle identifier +// is derived based on the 'SAMPLE_CODE_DISAMBIGUATOR' value. Do not use this +// approach in your own projects—it's only useful for sample code projects because +// they are frequently downloaded and don't have a development team set. +SAMPLE_CODE_DISAMBIGUATOR=${DEVELOPMENT_TEAM} diff --git a/Examples/WorkingWithUIControls/StartingPoint/LICENSE/LICENSE.txt b/Examples/WorkingWithUIControls/StartingPoint/LICENSE/LICENSE.txt new file mode 100755 index 0000000..94e3d54 --- /dev/null +++ b/Examples/WorkingWithUIControls/StartingPoint/LICENSE/LICENSE.txt @@ -0,0 +1,8 @@ +Copyright © 2019 Apple Inc. + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + diff --git a/Examples/WorkingWithUIControls/StartingPoint/Landmarks/Landmarks/AppDelegate.swift b/Examples/WorkingWithUIControls/StartingPoint/Landmarks/Landmarks/AppDelegate.swift new file mode 100755 index 0000000..e22943b --- /dev/null +++ b/Examples/WorkingWithUIControls/StartingPoint/Landmarks/Landmarks/AppDelegate.swift @@ -0,0 +1,36 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +The application delegate. +*/ + +import UIKit + +@UIApplicationMain +class AppDelegate: UIResponder, UIApplicationDelegate { + + func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { + // Override point for customization after application launch. + return true + } + + func applicationWillTerminate(_ application: UIApplication) { + // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. + } + + // MARK: UISceneSession Lifecycle + func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration { + // Called when a new scene session is being created. + // Use this method to select a configuration to create the new scene with. + return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role) + } + + func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set) { + // Called when the user discards a scene session. + // If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions. + // Use this method to release any resources that were specific to the discarded scenes, as they will not return. + } + +} + diff --git a/Examples/WorkingWithUIControls/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/Contents.json b/Examples/WorkingWithUIControls/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100755 index 0000000..fa0d2db --- /dev/null +++ b/Examples/WorkingWithUIControls/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,113 @@ +{ + "images" : [ + { + "size" : "20x20", + "idiom" : "iphone", + "filename" : "landmark_app_icon_40x40.png", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "20x20", + "scale" : "3x" + }, + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "landmark_app_icon_58x58.png", + "scale" : "2x" + }, + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "landmark_app_icon_87x87.png", + "scale" : "3x" + }, + { + "size" : "40x40", + "idiom" : "iphone", + "filename" : "landmark_app_icon_80x80.png", + "scale" : "2x" + }, + { + "size" : "40x40", + "idiom" : "iphone", + "filename" : "landmark_app_icon_120x120.png", + "scale" : "3x" + }, + { + "size" : "60x60", + "idiom" : "iphone", + "filename" : "landmark_app_icon_120x120-1.png", + "scale" : "2x" + }, + { + "size" : "60x60", + "idiom" : "iphone", + "filename" : "landmark_app_icon_180x180.png", + "scale" : "3x" + }, + { + "idiom" : "ipad", + "size" : "20x20", + "scale" : "1x" + }, + { + "size" : "20x20", + "idiom" : "ipad", + "filename" : "landmark_app_icon_40x40-1.png", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "29x29", + "scale" : "1x" + }, + { + "size" : "29x29", + "idiom" : "ipad", + "filename" : "landmark_app_icon_58x58-1.png", + "scale" : "2x" + }, + { + "size" : "40x40", + "idiom" : "ipad", + "filename" : "landmark_app_icon_40x40-2.png", + "scale" : "1x" + }, + { + "size" : "40x40", + "idiom" : "ipad", + "filename" : "landmark_app_icon_80x80-1.png", + "scale" : "2x" + }, + { + "size" : "76x76", + "idiom" : "ipad", + "filename" : "landmark_app_icon_76x76.png", + "scale" : "1x" + }, + { + "size" : "76x76", + "idiom" : "ipad", + "filename" : "landmark_app_icon_152x152.png", + "scale" : "2x" + }, + { + "size" : "83.5x83.5", + "idiom" : "ipad", + "filename" : "landmark_app_icon_167x167.png", + "scale" : "2x" + }, + { + "size" : "1024x1024", + "idiom" : "ios-marketing", + "filename" : "landmark_app_icon_1024x1024.png", + "scale" : "1x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Examples/WorkingWithUIControls/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_1024x1024.png b/Examples/WorkingWithUIControls/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_1024x1024.png new file mode 100755 index 0000000..00d81c1 Binary files /dev/null and b/Examples/WorkingWithUIControls/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_1024x1024.png differ diff --git a/Examples/WorkingWithUIControls/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_120x120-1.png b/Examples/WorkingWithUIControls/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_120x120-1.png new file mode 100755 index 0000000..d382b8b Binary files /dev/null and b/Examples/WorkingWithUIControls/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_120x120-1.png differ diff --git a/Examples/WorkingWithUIControls/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_120x120.png b/Examples/WorkingWithUIControls/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_120x120.png new file mode 100755 index 0000000..d382b8b Binary files /dev/null and b/Examples/WorkingWithUIControls/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_120x120.png differ diff --git a/Examples/WorkingWithUIControls/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_152x152.png b/Examples/WorkingWithUIControls/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_152x152.png new file mode 100755 index 0000000..11057f8 Binary files /dev/null and b/Examples/WorkingWithUIControls/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_152x152.png differ diff --git a/Examples/WorkingWithUIControls/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_167x167.png b/Examples/WorkingWithUIControls/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_167x167.png new file mode 100755 index 0000000..f73bc26 Binary files /dev/null and b/Examples/WorkingWithUIControls/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_167x167.png differ diff --git a/Examples/WorkingWithUIControls/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_180x180.png b/Examples/WorkingWithUIControls/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_180x180.png new file mode 100755 index 0000000..b02738c Binary files /dev/null and b/Examples/WorkingWithUIControls/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_180x180.png differ diff --git a/Examples/WorkingWithUIControls/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_40x40-1.png b/Examples/WorkingWithUIControls/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_40x40-1.png new file mode 100755 index 0000000..abaff0e Binary files /dev/null and b/Examples/WorkingWithUIControls/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_40x40-1.png differ diff --git a/Examples/WorkingWithUIControls/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_40x40-2.png b/Examples/WorkingWithUIControls/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_40x40-2.png new file mode 100755 index 0000000..abaff0e Binary files /dev/null and b/Examples/WorkingWithUIControls/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_40x40-2.png differ diff --git a/Examples/WorkingWithUIControls/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_40x40.png b/Examples/WorkingWithUIControls/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_40x40.png new file mode 100755 index 0000000..abaff0e Binary files /dev/null and b/Examples/WorkingWithUIControls/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_40x40.png differ diff --git a/Examples/WorkingWithUIControls/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_58x58-1.png b/Examples/WorkingWithUIControls/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_58x58-1.png new file mode 100755 index 0000000..cf7c73d Binary files /dev/null and b/Examples/WorkingWithUIControls/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_58x58-1.png differ diff --git a/Examples/WorkingWithUIControls/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_58x58.png b/Examples/WorkingWithUIControls/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_58x58.png new file mode 100755 index 0000000..cf7c73d Binary files /dev/null and b/Examples/WorkingWithUIControls/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_58x58.png differ diff --git a/Examples/WorkingWithUIControls/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_76x76.png b/Examples/WorkingWithUIControls/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_76x76.png new file mode 100755 index 0000000..3eff85b Binary files /dev/null and b/Examples/WorkingWithUIControls/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_76x76.png differ diff --git a/Examples/WorkingWithUIControls/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_80x80-1.png b/Examples/WorkingWithUIControls/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_80x80-1.png new file mode 100755 index 0000000..6f33f66 Binary files /dev/null and b/Examples/WorkingWithUIControls/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_80x80-1.png differ diff --git a/Examples/WorkingWithUIControls/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_80x80.png b/Examples/WorkingWithUIControls/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_80x80.png new file mode 100755 index 0000000..6f33f66 Binary files /dev/null and b/Examples/WorkingWithUIControls/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_80x80.png differ diff --git a/Examples/WorkingWithUIControls/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_87x87.png b/Examples/WorkingWithUIControls/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_87x87.png new file mode 100755 index 0000000..9e1616c Binary files /dev/null and b/Examples/WorkingWithUIControls/StartingPoint/Landmarks/Landmarks/Assets.xcassets/AppIcon.appiconset/landmark_app_icon_87x87.png differ diff --git a/Examples/WorkingWithUIControls/StartingPoint/Landmarks/Landmarks/Assets.xcassets/Contents.json b/Examples/WorkingWithUIControls/StartingPoint/Landmarks/Landmarks/Assets.xcassets/Contents.json new file mode 100755 index 0000000..da4a164 --- /dev/null +++ b/Examples/WorkingWithUIControls/StartingPoint/Landmarks/Landmarks/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Examples/WorkingWithUIControls/StartingPoint/Landmarks/Landmarks/Assets.xcassets/turtlerock.imageset/Contents.json b/Examples/WorkingWithUIControls/StartingPoint/Landmarks/Landmarks/Assets.xcassets/turtlerock.imageset/Contents.json new file mode 100755 index 0000000..5bfd7bf --- /dev/null +++ b/Examples/WorkingWithUIControls/StartingPoint/Landmarks/Landmarks/Assets.xcassets/turtlerock.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "turtlerock.jpg", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Examples/WorkingWithUIControls/StartingPoint/Landmarks/Landmarks/Assets.xcassets/turtlerock.imageset/turtlerock.jpg b/Examples/WorkingWithUIControls/StartingPoint/Landmarks/Landmarks/Assets.xcassets/turtlerock.imageset/turtlerock.jpg new file mode 100755 index 0000000..68bcd3e Binary files /dev/null and b/Examples/WorkingWithUIControls/StartingPoint/Landmarks/Landmarks/Assets.xcassets/turtlerock.imageset/turtlerock.jpg differ diff --git a/Examples/WorkingWithUIControls/StartingPoint/Landmarks/Landmarks/Base.lproj/LaunchScreen.storyboard b/Examples/WorkingWithUIControls/StartingPoint/Landmarks/Landmarks/Base.lproj/LaunchScreen.storyboard new file mode 100755 index 0000000..865e932 --- /dev/null +++ b/Examples/WorkingWithUIControls/StartingPoint/Landmarks/Landmarks/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Examples/WorkingWithUIControls/StartingPoint/Landmarks/Landmarks/CategoryRow.swift b/Examples/WorkingWithUIControls/StartingPoint/Landmarks/Landmarks/CategoryRow.swift new file mode 100755 index 0000000..1f4fbd8 --- /dev/null +++ b/Examples/WorkingWithUIControls/StartingPoint/Landmarks/Landmarks/CategoryRow.swift @@ -0,0 +1,64 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +A view showing a scrollable list of landmarks. +*/ + +import SwiftUI + +struct CategoryRow: View { + var categoryName: String + var items: [Landmark] + + var body: some View { + VStack(alignment: .leading) { + Text(self.categoryName) + .font(.headline) + .padding(.leading, 15) + .padding(.top, 5) + + ScrollView(showsHorizontalIndicator: false) { + HStack(alignment: .top, spacing: 0) { + ForEach(self.items.identified(by: \.name)) { landmark in + NavigationButton( + destination: LandmarkDetail( + landmark: landmark + ) + ) { + CategoryItem(landmark: landmark) + } + } + } + } + .frame(height: 185) + } + } +} + +struct CategoryItem: View { + var landmark: Landmark + var body: some View { + VStack(alignment: .leading) { + landmark + .image(forSize: 155) + .renderingMode(.original) + .cornerRadius(5) + Text(landmark.name) + .color(.primary) + .font(.caption) + } + .padding(.leading, 15) + } +} + +#if DEBUG +struct CategoryRow_Previews: PreviewProvider { + static var previews: some View { + CategoryRow( + categoryName: landmarkData[0].category.rawValue, + items: Array(landmarkData.prefix(4)) + ) + } +} +#endif diff --git a/Examples/WorkingWithUIControls/StartingPoint/Landmarks/Landmarks/HexagonParameters.swift b/Examples/WorkingWithUIControls/StartingPoint/Landmarks/Landmarks/HexagonParameters.swift new file mode 100755 index 0000000..8decba4 --- /dev/null +++ b/Examples/WorkingWithUIControls/StartingPoint/Landmarks/Landmarks/HexagonParameters.swift @@ -0,0 +1,57 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +Size, position, and other information used to draw a badge. +*/ + +import SwiftUI + +struct HexagonParameters { + struct Segment { + let useWidth: (CGFloat, CGFloat, CGFloat) + let xFactors: (CGFloat, CGFloat, CGFloat) + let useHeight: (CGFloat, CGFloat, CGFloat) + let yFactors: (CGFloat, CGFloat, CGFloat) + } + + static let adjustment: CGFloat = 0.085 + static let points = [ + Segment( + useWidth: (1.00, 1.00, 1.00), + xFactors: (0.60, 0.40, 0.50), + useHeight: (1.00, 1.00, 0.00), + yFactors: (0.05, 0.05, 0.00) + ), + Segment( + useWidth: (1.00, 1.00, 0.00), + xFactors: (0.05, 0.00, 0.00), + useHeight: (1.00, 1.00, 1.00), + yFactors: (0.20 + adjustment, 0.30 + adjustment, 0.25 + adjustment) + ), + Segment( + useWidth: (1.00, 1.00, 0.00), + xFactors: (0.00, 0.05, 0.00), + useHeight: (1.00, 1.00, 1.00), + yFactors: (0.70 - adjustment, 0.80 - adjustment, 0.75 - adjustment) + ), + Segment( + useWidth: (1.00, 1.00, 1.00), + xFactors: (0.40, 0.60, 0.50), + useHeight: (1.00, 1.00, 1.00), + yFactors: (0.95, 0.95, 1.00) + ), + Segment( + useWidth: (1.00, 1.00, 1.00), + xFactors: (0.95, 1.00, 1.00), + useHeight: (1.00, 1.00, 1.00), + yFactors: (0.80 - adjustment, 0.70 - adjustment, 0.75 - adjustment) + ), + Segment( + useWidth: (1.00, 1.00, 1.00), + xFactors: (1.00, 0.95, 1.00), + useHeight: (1.00, 1.00, 1.00), + yFactors: (0.30 + adjustment, 0.20 + adjustment, 0.25 + adjustment) + ) + ] +} diff --git a/Examples/WorkingWithUIControls/StartingPoint/Landmarks/Landmarks/HikeDetail.swift b/Examples/WorkingWithUIControls/StartingPoint/Landmarks/Landmarks/HikeDetail.swift new file mode 100755 index 0000000..3406a6d --- /dev/null +++ b/Examples/WorkingWithUIControls/StartingPoint/Landmarks/Landmarks/HikeDetail.swift @@ -0,0 +1,49 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +A view showing the details for a hike. +*/ + +import SwiftUI + +struct HikeDetail: View { + let hike: Hike + @State var dataToShow = \Hike.Observation.elevation + + var buttons = [ + ("Elevation", \Hike.Observation.elevation), + ("Heart Rate", \Hike.Observation.heartRate), + ("Pace", \Hike.Observation.pace), + ] + + var body: some View { + return VStack { + HikeGraph(hike: hike, path: dataToShow) + .frame(height: 200, alignment: .center) + + HStack(spacing: 25) { + ForEach(buttons.identified(by: \.0)) { value in + Button(action: { + self.dataToShow = value.1 + }) { + Text(verbatim: value.0) + .font(.system(size: 15)) + .color(value.1 == self.dataToShow + ? Color.gray + : Color.accentColor) + .animation(nil) + } + } + } + } + } +} + +#if DEBUG +struct HikeDetail_Previews: PreviewProvider { + static var previews: some View { + HikeDetail(hike: hikeData[0]) + } +} +#endif diff --git a/Examples/WorkingWithUIControls/StartingPoint/Landmarks/Landmarks/HikeView.swift b/Examples/WorkingWithUIControls/StartingPoint/Landmarks/Landmarks/HikeView.swift new file mode 100755 index 0000000..f4c02cc --- /dev/null +++ b/Examples/WorkingWithUIControls/StartingPoint/Landmarks/Landmarks/HikeView.swift @@ -0,0 +1,68 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +A view displaying inforamtion about a hike, including an elevation graph. +*/ + +import SwiftUI + +struct HikeView: View { + var hike: Hike + @State private var showDetail = false + + var transition: AnyTransition { + let insertion = AnyTransition.move(edge: .trailing) + .combined(with: .opacity) + let removal = AnyTransition.scale() + .combined(with: .opacity) + return .asymmetric(insertion: insertion, removal: removal) + } + + var body: some View { + VStack { + HStack { + HikeGraph(hike: hike, path: \.elevation) + .frame(width: 50, height: 30) + .animation(nil) + + VStack(alignment: .leading) { + Text(verbatim: hike.name) + .font(.headline) + Text(verbatim: hike.distanceText) + } + + Spacer() + + Button(action: { + withAnimation { + self.showDetail.toggle() + } + }) { + Image(systemName: "chevron.right.circle") + .imageScale(.large) + .rotationEffect(.degrees(showDetail ? 90 : 0)) + .scaleEffect(showDetail ? 1.5 : 1) + .padding() + } + } + + if showDetail { + HikeDetail(hike: hike) + .transition(transition) + } + } + } +} + +#if DEBUG +struct HikeView_Previews: PreviewProvider { + static var previews: some View { + VStack { + HikeView(hike: hikeData[0]) + .padding() + Spacer() + } + } +} +#endif diff --git a/Examples/WorkingWithUIControls/StartingPoint/Landmarks/Landmarks/Home.swift b/Examples/WorkingWithUIControls/StartingPoint/Landmarks/Landmarks/Home.swift new file mode 100755 index 0000000..9e5ac93 --- /dev/null +++ b/Examples/WorkingWithUIControls/StartingPoint/Landmarks/Landmarks/Home.swift @@ -0,0 +1,67 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +A view showing featured landmarks above a list of all of the landmarks. +*/ + +import SwiftUI + +struct CategoryHome: View { + var categories: [String: [Landmark]] { + .init( + grouping: landmarkData, + by: { $0.category.rawValue } + ) + } + + var featured: [Landmark] { + landmarkData.filter { $0.isFeatured } + } + + var body: some View { + NavigationView { + List { + FeaturedLandmarks(landmarks: featured) + .scaledToFill() + .frame(height: 200) + .clipped() + .listRowInsets(EdgeInsets()) + + ForEach(categories.keys.sorted().identified(by: \.self)) { key in + CategoryRow(categoryName: key, items: self.categories[key]!) + } + .listRowInsets(EdgeInsets()) + + NavigationButton(destination: LandmarkList()) { + Text("See All") + } + } + .navigationBarTitle(Text("Featured")) + .navigationBarItems(trailing: + PresentationButton( + Image(systemName: "person.crop.circle") + .imageScale(.large) + .accessibility(label: Text("User Profile")) + .padding(), + destination: Text("User Profile") + ) + ) + } + } +} + +struct FeaturedLandmarks: View { + var landmarks: [Landmark] + var body: some View { + landmarks[0].image(forSize: 250).resizable() + } +} + +#if DEBUG +struct CategoryHome_Previews: PreviewProvider { + static var previews: some View { + CategoryHome() + } +} +#endif diff --git a/Examples/WorkingWithUIControls/StartingPoint/Landmarks/Landmarks/Info.plist b/Examples/WorkingWithUIControls/StartingPoint/Landmarks/Landmarks/Info.plist new file mode 100755 index 0000000..e8bb4c6 --- /dev/null +++ b/Examples/WorkingWithUIControls/StartingPoint/Landmarks/Landmarks/Info.plist @@ -0,0 +1,62 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + $(PRODUCT_BUNDLE_PACKAGE_TYPE) + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1 + LSRequiresIPhoneOS + + UIApplicationSceneManifest + + UIApplicationSupportsMultipleScenes + + UISceneConfigurations + + UIWindowSceneSessionRoleApplication + + + UILaunchStoryboardName + LaunchScreen + UISceneConfigurationName + Default Configuration + UISceneDelegateClassName + $(PRODUCT_MODULE_NAME).SceneDelegate + + + + + UILaunchStoryboardName + LaunchScreen + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/Examples/WorkingWithUIControls/StartingPoint/Landmarks/Landmarks/LandmarkDetail.swift b/Examples/WorkingWithUIControls/StartingPoint/Landmarks/Landmarks/LandmarkDetail.swift new file mode 100755 index 0000000..6c290a3 --- /dev/null +++ b/Examples/WorkingWithUIControls/StartingPoint/Landmarks/Landmarks/LandmarkDetail.swift @@ -0,0 +1,71 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +A view showing the details for a landmark. +*/ + +import SwiftUI + +struct LandmarkDetail: View { + @EnvironmentObject var userData: UserData + var landmark: Landmark + + var landmarkIndex: Int { + userData.landmarks.firstIndex(where: { $0.id == landmark.id })! + } + + var body: some View { + VStack { + MapView(coordinate: landmark.locationCoordinate) + .edgesIgnoringSafeArea(.top) + .frame(height: 300) + + CircleImage(image: landmark.image(forSize: 250)) + .offset(x: 0, y: -130) + .padding(.bottom, -130) + + VStack(alignment: .leading) { + HStack { + Text(verbatim: landmark.name) + .font(.title) + + Button(action: { + self.userData.landmarks[self.landmarkIndex] + .isFavorite.toggle() + }) { + if self.userData.landmarks[self.landmarkIndex] + .isFavorite { + Image(systemName: "star.fill") + .foregroundColor(Color.yellow) + } else { + Image(systemName: "star") + .foregroundColor(Color.gray) + } + } + } + + HStack(alignment: .top) { + Text(verbatim: landmark.park) + .font(.subheadline) + Spacer() + Text(verbatim: landmark.state) + .font(.subheadline) + } + } + .padding() + + Spacer() + } + } +} + +#if DEBUG +struct LandmarkDetail_Preview: PreviewProvider { + static var previews: some View { + let userData = UserData() + return LandmarkDetail(landmark: userData.landmarks[0]) + .environmentObject(userData) + } +} +#endif diff --git a/Examples/WorkingWithUIControls/StartingPoint/Landmarks/Landmarks/LandmarkList.swift b/Examples/WorkingWithUIControls/StartingPoint/Landmarks/Landmarks/LandmarkList.swift new file mode 100755 index 0000000..c17b5f3 --- /dev/null +++ b/Examples/WorkingWithUIControls/StartingPoint/Landmarks/Landmarks/LandmarkList.swift @@ -0,0 +1,45 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +A view showing a list of landmarks. +*/ + +import SwiftUI + +struct LandmarkList: View { + @EnvironmentObject private var userData: UserData + + var body: some View { + NavigationView { + List { + Toggle(isOn: $userData.showFavoritesOnly) { + Text("Show Favorites Only") + } + + ForEach(userData.landmarks) { landmark in + if !self.userData.showFavoritesOnly || landmark.isFavorite { + NavigationButton( + destination: LandmarkDetail(landmark: landmark)) { + LandmarkRow(landmark: landmark) + } + } + } + } + .navigationBarTitle(Text("Landmarks"), displayMode: .large) + } + } +} + +#if DEBUG +struct LandmarksList_Previews: PreviewProvider { + static var previews: some View { + ForEach(["iPhone SE", "iPhone XS Max"].identified(by: \.self)) { deviceName in + LandmarkList() + .previewDevice(PreviewDevice(rawValue: deviceName)) + .previewDisplayName(deviceName) + } + .environmentObject(UserData()) + } +} +#endif diff --git a/Examples/WorkingWithUIControls/StartingPoint/Landmarks/Landmarks/Models/Data.swift b/Examples/WorkingWithUIControls/StartingPoint/Landmarks/Landmarks/Models/Data.swift new file mode 100755 index 0000000..248d3b2 --- /dev/null +++ b/Examples/WorkingWithUIControls/StartingPoint/Landmarks/Landmarks/Models/Data.swift @@ -0,0 +1,95 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +Helpers for loading images and data. +*/ + +import Foundation +import CoreLocation +import UIKit +import SwiftUI + +let landmarkData: [Landmark] = load("landmarkData.json") +let hikeData: [Hike] = load("hikeData.json") + +func load(_ filename: String, as type: T.Type = T.self) -> T { + let data: Data + + guard let file = Bundle.main.url(forResource: filename, withExtension: nil) + else { + fatalError("Couldn't find \(filename) in main bundle.") + } + + do { + data = try Data(contentsOf: file) + } catch { + fatalError("Couldn't load \(filename) from main bundle:\n\(error)") + } + + do { + let decoder = JSONDecoder() + return try decoder.decode(T.self, from: data) + } catch { + fatalError("Couldn't parse \(filename) as \(T.self):\n\(error)") + } +} + +final class ImageStore { + fileprivate typealias _ImageDictionary = [String: [Int: CGImage]] + fileprivate var images: _ImageDictionary = [:] + + fileprivate static var originalSize = 250 + fileprivate static var scale = 2 + + static var shared = ImageStore() + + func image(name: String, size: Int) -> Image { + let index = _guaranteeInitialImage(name: name) + + let sizedImage = images.values[index][size] + ?? _sizeImage(images.values[index][ImageStore.originalSize]!, to: size * ImageStore.scale) + images.values[index][size] = sizedImage + + return Image(sizedImage, scale: Length(ImageStore.scale), label: Text(verbatim: name)) + } + + fileprivate func _guaranteeInitialImage(name: String) -> _ImageDictionary.Index { + if let index = images.index(forKey: name) { return index } + + guard + let url = Bundle.main.url(forResource: name, withExtension: "jpg"), + let imageSource = CGImageSourceCreateWithURL(url as NSURL, nil), + let image = CGImageSourceCreateImageAtIndex(imageSource, 0, nil) + else { + fatalError("Couldn't load image \(name).jpg from main bundle.") + } + + images[name] = [ImageStore.originalSize: image] + return images.index(forKey: name)! + } + + fileprivate func _sizeImage(_ image: CGImage, to size: Int) -> CGImage { + guard + let colorSpace = image.colorSpace, + let context = CGContext( + data: nil, + width: size, height: size, + bitsPerComponent: image.bitsPerComponent, + bytesPerRow: image.bytesPerRow, + space: colorSpace, + bitmapInfo: image.bitmapInfo.rawValue) + else { + fatalError("Couldn't create graphics context.") + } + context.interpolationQuality = .high + context.draw(image, in: CGRect(x: 0, y: 0, width: size, height: size)) + + if let sizedImage = context.makeImage() { + return sizedImage + } else { + fatalError("Couldn't resize image.") + } + } +} + diff --git a/Examples/WorkingWithUIControls/StartingPoint/Landmarks/Landmarks/Models/Hike.swift b/Examples/WorkingWithUIControls/StartingPoint/Landmarks/Landmarks/Models/Hike.swift new file mode 100755 index 0000000..dfd2bb8 --- /dev/null +++ b/Examples/WorkingWithUIControls/StartingPoint/Landmarks/Landmarks/Models/Hike.swift @@ -0,0 +1,31 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +The model for a hike. +*/ + +import SwiftUI + +struct Hike: Codable, Hashable, Identifiable { + var name: String + var id: Int + var distance: Double + var difficulty: Int + var observations: [Observation] + + static var formatter = LengthFormatter() + + var distanceText: String { + return Hike.formatter + .string(fromValue: distance, unit: .kilometer) + } + + struct Observation: Codable, Hashable { + var distanceFromStart: Double + + var elevation: Range + var pace: Range + var heartRate: Range + } +} diff --git a/Examples/WorkingWithUIControls/StartingPoint/Landmarks/Landmarks/Models/Landmark.swift b/Examples/WorkingWithUIControls/StartingPoint/Landmarks/Landmarks/Models/Landmark.swift new file mode 100755 index 0000000..4a7586d --- /dev/null +++ b/Examples/WorkingWithUIControls/StartingPoint/Landmarks/Landmarks/Models/Landmark.swift @@ -0,0 +1,43 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +The model for an individual landmark. +*/ + +import SwiftUI +import CoreLocation + +struct Landmark: Hashable, Codable, Identifiable { + var id: Int + var name: String + fileprivate var imageName: String + fileprivate var coordinates: Coordinates + var state: String + var park: String + var category: Category + var isFavorite: Bool + var isFeatured: Bool + + var locationCoordinate: CLLocationCoordinate2D { + CLLocationCoordinate2D( + latitude: coordinates.latitude, + longitude: coordinates.longitude) + } + + func image(forSize size: Int) -> Image { + ImageStore.shared.image(name: imageName, size: size) + } + + enum Category: String, CaseIterable, Codable, Hashable { + case featured = "Featured" + case lakes = "Lakes" + case rivers = "Rivers" + case mountains = "Mountains" + } +} + +struct Coordinates: Hashable, Codable { + var latitude: Double + var longitude: Double +} diff --git a/Examples/WorkingWithUIControls/StartingPoint/Landmarks/Landmarks/Models/Profile.swift b/Examples/WorkingWithUIControls/StartingPoint/Landmarks/Landmarks/Models/Profile.swift new file mode 100755 index 0000000..98378c8 --- /dev/null +++ b/Examples/WorkingWithUIControls/StartingPoint/Landmarks/Landmarks/Models/Profile.swift @@ -0,0 +1,31 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +A model object that stores user profile data. +*/ + +import Foundation + +struct Profile { + var username: String + var prefersNotifications: Bool + var seasonalPhoto: Season + var goalDate: Date + + static let `default` = Self(username: "g_kumar", prefersNotifications: true, seasonalPhoto: .winter) + + init(username: String, prefersNotifications: Bool = true, seasonalPhoto: Season = .winter) { + self.username = username + self.prefersNotifications = prefersNotifications + self.seasonalPhoto = seasonalPhoto + self.goalDate = Date() + } + + enum Season: String, CaseIterable { + case spring = "🌷" + case summer = "🌞" + case autumn = "🍂" + case winter = "☃️" + } +} diff --git a/Examples/WorkingWithUIControls/StartingPoint/Landmarks/Landmarks/Models/UserData.swift b/Examples/WorkingWithUIControls/StartingPoint/Landmarks/Landmarks/Models/UserData.swift new file mode 100755 index 0000000..db31fb0 --- /dev/null +++ b/Examples/WorkingWithUIControls/StartingPoint/Landmarks/Landmarks/Models/UserData.swift @@ -0,0 +1,25 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +A model object that stores app data. +*/ + +import Combine +import SwiftUI + +final class UserData: BindableObject { + let didChange = PassthroughSubject() + + var showFavoritesOnly = false { + didSet { + didChange.send(self) + } + } + + var landmarks = landmarkData { + didSet { + didChange.send(self) + } + } +} diff --git a/Examples/WorkingWithUIControls/StartingPoint/Landmarks/Landmarks/Preview Content/Preview Assets.xcassets/Contents.json b/Examples/WorkingWithUIControls/StartingPoint/Landmarks/Landmarks/Preview Content/Preview Assets.xcassets/Contents.json new file mode 100755 index 0000000..da4a164 --- /dev/null +++ b/Examples/WorkingWithUIControls/StartingPoint/Landmarks/Landmarks/Preview Content/Preview Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Examples/WorkingWithUIControls/StartingPoint/Landmarks/Landmarks/Resources/charleyrivers.jpg b/Examples/WorkingWithUIControls/StartingPoint/Landmarks/Landmarks/Resources/charleyrivers.jpg new file mode 100755 index 0000000..17ff44b Binary files /dev/null and b/Examples/WorkingWithUIControls/StartingPoint/Landmarks/Landmarks/Resources/charleyrivers.jpg differ diff --git a/Examples/WorkingWithUIControls/StartingPoint/Landmarks/Landmarks/Resources/chilkoottrail.jpg b/Examples/WorkingWithUIControls/StartingPoint/Landmarks/Landmarks/Resources/chilkoottrail.jpg new file mode 100755 index 0000000..e7f805e Binary files /dev/null and b/Examples/WorkingWithUIControls/StartingPoint/Landmarks/Landmarks/Resources/chilkoottrail.jpg differ diff --git a/Examples/WorkingWithUIControls/StartingPoint/Landmarks/Landmarks/Resources/chincoteague.jpg b/Examples/WorkingWithUIControls/StartingPoint/Landmarks/Landmarks/Resources/chincoteague.jpg new file mode 100755 index 0000000..5f47986 Binary files /dev/null and b/Examples/WorkingWithUIControls/StartingPoint/Landmarks/Landmarks/Resources/chincoteague.jpg differ diff --git a/Examples/WorkingWithUIControls/StartingPoint/Landmarks/Landmarks/Resources/hiddenlake.jpg b/Examples/WorkingWithUIControls/StartingPoint/Landmarks/Landmarks/Resources/hiddenlake.jpg new file mode 100755 index 0000000..d8e804c Binary files /dev/null and b/Examples/WorkingWithUIControls/StartingPoint/Landmarks/Landmarks/Resources/hiddenlake.jpg differ diff --git a/Examples/WorkingWithUIControls/StartingPoint/Landmarks/Landmarks/Resources/hikeData.json b/Examples/WorkingWithUIControls/StartingPoint/Landmarks/Landmarks/Resources/hikeData.json new file mode 100755 index 0000000..3fb1e96 --- /dev/null +++ b/Examples/WorkingWithUIControls/StartingPoint/Landmarks/Landmarks/Resources/hikeData.json @@ -0,0 +1,1882 @@ +[ + { + "name":"Lonesome Ridge Trail", + "id":1001, + "distance":4.5, + "difficulty":3, + "observations":[ + { + "elevation":[ + 291.65263635636268, + 309.26016677925196 + ], + "pace":[ + 396.08716481908732, + 403.68937873525232 + ], + "heartRate":[ + 117.16351898665887, + 121.95815455919609 + ], + "distanceFromStart":0 + }, + { + "elevation":[ + 299.24001936628116, + 317.44584350790012 + ], + "pace":[ + 380.19020240756623, + 395.3978319010256 + ], + "heartRate":[ + 117.6410892152911, + 124.82185220506081 + ], + "distanceFromStart":0.375 + }, + { + "elevation":[ + 303.62145464574394, + 336.05569457646544 + ], + "pace":[ + 380.55927782266116, + 397.60789726832775 + ], + "heartRate":[ + 121.52696452049059, + 127.31525441110122 + ], + "distanceFromStart":0.75 + }, + { + "elevation":[ + 319.90393365162629, + 346.26966025518789 + ], + "pace":[ + 357.94116421258531, + 398.0750288648062 + ], + "heartRate":[ + 123.75908585923588, + 132.77069404486801 + ], + "distanceFromStart":1.125 + }, + { + "elevation":[ + 354.17104439267905, + 403.57031216972939 + ], + "pace":[ + 335.07385149392701, + 397.82674381875808 + ], + "heartRate":[ + 130.8235194572915, + 140.55700591418218 + ], + "distanceFromStart":1.5 + }, + { + "elevation":[ + 357.42992871175124, + 385.92155620623635 + ], + "pace":[ + 395.16168913839374, + 404.60294066527558 + ], + "heartRate":[ + 131.5456052446734, + 134.65984504627627 + ], + "distanceFromStart":1.875 + }, + { + "elevation":[ + 345.47736721935661, + 363.18776661379422 + ], + "pace":[ + 340.82303041339082, + 404.71689228682374 + ], + "heartRate":[ + 125.1949698433959, + 131.31354363122026 + ], + "distanceFromStart":2.25 + }, + { + "elevation":[ + 346.23343025200535, + 497.23376445462401 + ], + "pace":[ + 261.27629148816021, + 331.68516208719467 + ], + "heartRate":[ + 131.67810544238606, + 154.26779645311458 + ], + "distanceFromStart":2.625 + }, + { + "elevation":[ + 491.57378483134391, + 547.49535224251053 + ], + "pace":[ + 296.05298644112088, + 401.14092967732398 + ], + "heartRate":[ + 151.36398089694217, + 166.20454793289232 + ], + "distanceFromStart":3 + }, + { + "elevation":[ + 472.06803233416338, + 531.92570520228401 + ], + "pace":[ + 395.50830663514012, + 401.67837917543591 + ], + "heartRate":[ + 134.41798110234078, + 151.90886697564241 + ], + "distanceFromStart":3.375 + }, + { + "elevation":[ + 339.81419476005283, + 461.03832527824829 + ], + "pace":[ + 395.31160487975183, + 404.49550455974907 + ], + "heartRate":[ + 129.97753472415462, + 138.13531094848992 + ], + "distanceFromStart":3.75 + }, + { + "elevation":[ + 303.1495508565697, + 342.3532820173541 + ], + "pace":[ + 395.02844559698116, + 402.65878340653796 + ], + "heartRate":[ + 127.72304232462609, + 133.26322270764186 + ], + "distanceFromStart":4.125 + } + ] + }, + { + "name":"Lonesome Ridge Trail", + "id":1002, + "distance":4.5, + "difficulty":3, + "observations":[ + { + "elevation":[ + 291.65263635636268, + 309.26016677925196 + ], + "pace":[ + 396.08716481908732, + 403.68937873525232 + ], + "heartRate":[ + 117.16351898665887, + 121.95815455919609 + ], + "distanceFromStart":0 + }, + { + "elevation":[ + 299.24001936628116, + 317.44584350790012 + ], + "pace":[ + 380.19020240756623, + 395.3978319010256 + ], + "heartRate":[ + 117.6410892152911, + 124.82185220506081 + ], + "distanceFromStart":0.375 + }, + { + "elevation":[ + 303.62145464574394, + 336.05569457646544 + ], + "pace":[ + 380.55927782266116, + 397.60789726832775 + ], + "heartRate":[ + 121.52696452049059, + 127.31525441110122 + ], + "distanceFromStart":0.75 + }, + { + "elevation":[ + 319.90393365162629, + 346.26966025518789 + ], + "pace":[ + 357.94116421258531, + 398.0750288648062 + ], + "heartRate":[ + 123.75908585923588, + 132.77069404486801 + ], + "distanceFromStart":1.125 + }, + { + "elevation":[ + 354.17104439267905, + 403.57031216972939 + ], + "pace":[ + 335.07385149392701, + 397.82674381875808 + ], + "heartRate":[ + 130.8235194572915, + 140.55700591418218 + ], + "distanceFromStart":1.5 + }, + { + "elevation":[ + 357.42992871175124, + 385.92155620623635 + ], + "pace":[ + 395.16168913839374, + 404.60294066527558 + ], + "heartRate":[ + 131.5456052446734, + 134.65984504627627 + ], + "distanceFromStart":1.875 + }, + { + "elevation":[ + 345.47736721935661, + 363.18776661379422 + ], + "pace":[ + 340.82303041339082, + 404.71689228682374 + ], + "heartRate":[ + 125.1949698433959, + 131.31354363122026 + ], + "distanceFromStart":2.25 + }, + { + "elevation":[ + 346.23343025200535, + 497.23376445462401 + ], + "pace":[ + 261.27629148816021, + 331.68516208719467 + ], + "heartRate":[ + 131.67810544238606, + 154.26779645311458 + ], + "distanceFromStart":2.625 + }, + { + "elevation":[ + 491.57378483134391, + 547.49535224251053 + ], + "pace":[ + 296.05298644112088, + 401.14092967732398 + ], + "heartRate":[ + 151.36398089694217, + 166.20454793289232 + ], + "distanceFromStart":3 + }, + { + "elevation":[ + 472.06803233416338, + 531.92570520228401 + ], + "pace":[ + 395.50830663514012, + 401.67837917543591 + ], + "heartRate":[ + 134.41798110234078, + 151.90886697564241 + ], + "distanceFromStart":3.375 + }, + { + "elevation":[ + 339.81419476005283, + 461.03832527824829 + ], + "pace":[ + 395.31160487975183, + 404.49550455974907 + ], + "heartRate":[ + 129.97753472415462, + 138.13531094848992 + ], + "distanceFromStart":3.75 + }, + { + "elevation":[ + 303.1495508565697, + 342.3532820173541 + ], + "pace":[ + 395.02844559698116, + 402.65878340653796 + ], + "heartRate":[ + 127.72304232462609, + 133.26322270764186 + ], + "distanceFromStart":4.125 + } + ] + }, + { + "name":"Lonesome Ridge Trail", + "id":1003, + "distance":4.5, + "difficulty":3, + "observations":[ + { + "elevation":[ + 291.65263635636268, + 309.26016677925196 + ], + "pace":[ + 396.08716481908732, + 403.68937873525232 + ], + "heartRate":[ + 117.16351898665887, + 121.95815455919609 + ], + "distanceFromStart":0 + }, + { + "elevation":[ + 299.24001936628116, + 317.44584350790012 + ], + "pace":[ + 380.19020240756623, + 395.3978319010256 + ], + "heartRate":[ + 117.6410892152911, + 124.82185220506081 + ], + "distanceFromStart":0.375 + }, + { + "elevation":[ + 303.62145464574394, + 336.05569457646544 + ], + "pace":[ + 380.55927782266116, + 397.60789726832775 + ], + "heartRate":[ + 121.52696452049059, + 127.31525441110122 + ], + "distanceFromStart":0.75 + }, + { + "elevation":[ + 319.90393365162629, + 346.26966025518789 + ], + "pace":[ + 357.94116421258531, + 398.0750288648062 + ], + "heartRate":[ + 123.75908585923588, + 132.77069404486801 + ], + "distanceFromStart":1.125 + }, + { + "elevation":[ + 354.17104439267905, + 403.57031216972939 + ], + "pace":[ + 335.07385149392701, + 397.82674381875808 + ], + "heartRate":[ + 130.8235194572915, + 140.55700591418218 + ], + "distanceFromStart":1.5 + }, + { + "elevation":[ + 357.42992871175124, + 385.92155620623635 + ], + "pace":[ + 395.16168913839374, + 404.60294066527558 + ], + "heartRate":[ + 131.5456052446734, + 134.65984504627627 + ], + "distanceFromStart":1.875 + }, + { + "elevation":[ + 345.47736721935661, + 363.18776661379422 + ], + "pace":[ + 340.82303041339082, + 404.71689228682374 + ], + "heartRate":[ + 125.1949698433959, + 131.31354363122026 + ], + "distanceFromStart":2.25 + }, + { + "elevation":[ + 346.23343025200535, + 497.23376445462401 + ], + "pace":[ + 261.27629148816021, + 331.68516208719467 + ], + "heartRate":[ + 131.67810544238606, + 154.26779645311458 + ], + "distanceFromStart":2.625 + }, + { + "elevation":[ + 491.57378483134391, + 547.49535224251053 + ], + "pace":[ + 296.05298644112088, + 401.14092967732398 + ], + "heartRate":[ + 151.36398089694217, + 166.20454793289232 + ], + "distanceFromStart":3 + }, + { + "elevation":[ + 472.06803233416338, + 531.92570520228401 + ], + "pace":[ + 395.50830663514012, + 401.67837917543591 + ], + "heartRate":[ + 134.41798110234078, + 151.90886697564241 + ], + "distanceFromStart":3.375 + }, + { + "elevation":[ + 339.81419476005283, + 461.03832527824829 + ], + "pace":[ + 395.31160487975183, + 404.49550455974907 + ], + "heartRate":[ + 129.97753472415462, + 138.13531094848992 + ], + "distanceFromStart":3.75 + }, + { + "elevation":[ + 303.1495508565697, + 342.3532820173541 + ], + "pace":[ + 395.02844559698116, + 402.65878340653796 + ], + "heartRate":[ + 127.72304232462609, + 133.26322270764186 + ], + "distanceFromStart":4.125 + } + ] + }, + { + "name":"Lonesome Ridge Trail", + "id":1004, + "distance":4.5, + "difficulty":3, + "observations":[ + { + "elevation":[ + 291.65263635636268, + 309.26016677925196 + ], + "pace":[ + 396.08716481908732, + 403.68937873525232 + ], + "heartRate":[ + 117.16351898665887, + 121.95815455919609 + ], + "distanceFromStart":0 + }, + { + "elevation":[ + 299.24001936628116, + 317.44584350790012 + ], + "pace":[ + 380.19020240756623, + 395.3978319010256 + ], + "heartRate":[ + 117.6410892152911, + 124.82185220506081 + ], + "distanceFromStart":0.375 + }, + { + "elevation":[ + 303.62145464574394, + 336.05569457646544 + ], + "pace":[ + 380.55927782266116, + 397.60789726832775 + ], + "heartRate":[ + 121.52696452049059, + 127.31525441110122 + ], + "distanceFromStart":0.75 + }, + { + "elevation":[ + 319.90393365162629, + 346.26966025518789 + ], + "pace":[ + 357.94116421258531, + 398.0750288648062 + ], + "heartRate":[ + 123.75908585923588, + 132.77069404486801 + ], + "distanceFromStart":1.125 + }, + { + "elevation":[ + 354.17104439267905, + 403.57031216972939 + ], + "pace":[ + 335.07385149392701, + 397.82674381875808 + ], + "heartRate":[ + 130.8235194572915, + 140.55700591418218 + ], + "distanceFromStart":1.5 + }, + { + "elevation":[ + 357.42992871175124, + 385.92155620623635 + ], + "pace":[ + 395.16168913839374, + 404.60294066527558 + ], + "heartRate":[ + 131.5456052446734, + 134.65984504627627 + ], + "distanceFromStart":1.875 + }, + { + "elevation":[ + 345.47736721935661, + 363.18776661379422 + ], + "pace":[ + 340.82303041339082, + 404.71689228682374 + ], + "heartRate":[ + 125.1949698433959, + 131.31354363122026 + ], + "distanceFromStart":2.25 + }, + { + "elevation":[ + 346.23343025200535, + 497.23376445462401 + ], + "pace":[ + 261.27629148816021, + 331.68516208719467 + ], + "heartRate":[ + 131.67810544238606, + 154.26779645311458 + ], + "distanceFromStart":2.625 + }, + { + "elevation":[ + 491.57378483134391, + 547.49535224251053 + ], + "pace":[ + 296.05298644112088, + 401.14092967732398 + ], + "heartRate":[ + 151.36398089694217, + 166.20454793289232 + ], + "distanceFromStart":3 + }, + { + "elevation":[ + 472.06803233416338, + 531.92570520228401 + ], + "pace":[ + 395.50830663514012, + 401.67837917543591 + ], + "heartRate":[ + 134.41798110234078, + 151.90886697564241 + ], + "distanceFromStart":3.375 + }, + { + "elevation":[ + 339.81419476005283, + 461.03832527824829 + ], + "pace":[ + 395.31160487975183, + 404.49550455974907 + ], + "heartRate":[ + 129.97753472415462, + 138.13531094848992 + ], + "distanceFromStart":3.75 + }, + { + "elevation":[ + 303.1495508565697, + 342.3532820173541 + ], + "pace":[ + 395.02844559698116, + 402.65878340653796 + ], + "heartRate":[ + 127.72304232462609, + 133.26322270764186 + ], + "distanceFromStart":4.125 + } + ] + }, + { + "name":"Lonesome Ridge Trail", + "id":1005, + "distance":4.5, + "difficulty":3, + "observations":[ + { + "elevation":[ + 291.65263635636268, + 309.26016677925196 + ], + "pace":[ + 396.08716481908732, + 403.68937873525232 + ], + "heartRate":[ + 117.16351898665887, + 121.95815455919609 + ], + "distanceFromStart":0 + }, + { + "elevation":[ + 299.24001936628116, + 317.44584350790012 + ], + "pace":[ + 380.19020240756623, + 395.3978319010256 + ], + "heartRate":[ + 117.6410892152911, + 124.82185220506081 + ], + "distanceFromStart":0.375 + }, + { + "elevation":[ + 303.62145464574394, + 336.05569457646544 + ], + "pace":[ + 380.55927782266116, + 397.60789726832775 + ], + "heartRate":[ + 121.52696452049059, + 127.31525441110122 + ], + "distanceFromStart":0.75 + }, + { + "elevation":[ + 319.90393365162629, + 346.26966025518789 + ], + "pace":[ + 357.94116421258531, + 398.0750288648062 + ], + "heartRate":[ + 123.75908585923588, + 132.77069404486801 + ], + "distanceFromStart":1.125 + }, + { + "elevation":[ + 354.17104439267905, + 403.57031216972939 + ], + "pace":[ + 335.07385149392701, + 397.82674381875808 + ], + "heartRate":[ + 130.8235194572915, + 140.55700591418218 + ], + "distanceFromStart":1.5 + }, + { + "elevation":[ + 357.42992871175124, + 385.92155620623635 + ], + "pace":[ + 395.16168913839374, + 404.60294066527558 + ], + "heartRate":[ + 131.5456052446734, + 134.65984504627627 + ], + "distanceFromStart":1.875 + }, + { + "elevation":[ + 345.47736721935661, + 363.18776661379422 + ], + "pace":[ + 340.82303041339082, + 404.71689228682374 + ], + "heartRate":[ + 125.1949698433959, + 131.31354363122026 + ], + "distanceFromStart":2.25 + }, + { + "elevation":[ + 346.23343025200535, + 497.23376445462401 + ], + "pace":[ + 261.27629148816021, + 331.68516208719467 + ], + "heartRate":[ + 131.67810544238606, + 154.26779645311458 + ], + "distanceFromStart":2.625 + }, + { + "elevation":[ + 491.57378483134391, + 547.49535224251053 + ], + "pace":[ + 296.05298644112088, + 401.14092967732398 + ], + "heartRate":[ + 151.36398089694217, + 166.20454793289232 + ], + "distanceFromStart":3 + }, + { + "elevation":[ + 472.06803233416338, + 531.92570520228401 + ], + "pace":[ + 395.50830663514012, + 401.67837917543591 + ], + "heartRate":[ + 134.41798110234078, + 151.90886697564241 + ], + "distanceFromStart":3.375 + }, + { + "elevation":[ + 339.81419476005283, + 461.03832527824829 + ], + "pace":[ + 395.31160487975183, + 404.49550455974907 + ], + "heartRate":[ + 129.97753472415462, + 138.13531094848992 + ], + "distanceFromStart":3.75 + }, + { + "elevation":[ + 303.1495508565697, + 342.3532820173541 + ], + "pace":[ + 395.02844559698116, + 402.65878340653796 + ], + "heartRate":[ + 127.72304232462609, + 133.26322270764186 + ], + "distanceFromStart":4.125 + } + ] + }, + { + "name":"Lonesome Ridge Trail", + "id":1006, + "distance":4.5, + "difficulty":3, + "observations":[ + { + "elevation":[ + 291.65263635636268, + 309.26016677925196 + ], + "pace":[ + 396.08716481908732, + 403.68937873525232 + ], + "heartRate":[ + 117.16351898665887, + 121.95815455919609 + ], + "distanceFromStart":0 + }, + { + "elevation":[ + 299.24001936628116, + 317.44584350790012 + ], + "pace":[ + 380.19020240756623, + 395.3978319010256 + ], + "heartRate":[ + 117.6410892152911, + 124.82185220506081 + ], + "distanceFromStart":0.375 + }, + { + "elevation":[ + 303.62145464574394, + 336.05569457646544 + ], + "pace":[ + 380.55927782266116, + 397.60789726832775 + ], + "heartRate":[ + 121.52696452049059, + 127.31525441110122 + ], + "distanceFromStart":0.75 + }, + { + "elevation":[ + 319.90393365162629, + 346.26966025518789 + ], + "pace":[ + 357.94116421258531, + 398.0750288648062 + ], + "heartRate":[ + 123.75908585923588, + 132.77069404486801 + ], + "distanceFromStart":1.125 + }, + { + "elevation":[ + 354.17104439267905, + 403.57031216972939 + ], + "pace":[ + 335.07385149392701, + 397.82674381875808 + ], + "heartRate":[ + 130.8235194572915, + 140.55700591418218 + ], + "distanceFromStart":1.5 + }, + { + "elevation":[ + 357.42992871175124, + 385.92155620623635 + ], + "pace":[ + 395.16168913839374, + 404.60294066527558 + ], + "heartRate":[ + 131.5456052446734, + 134.65984504627627 + ], + "distanceFromStart":1.875 + }, + { + "elevation":[ + 345.47736721935661, + 363.18776661379422 + ], + "pace":[ + 340.82303041339082, + 404.71689228682374 + ], + "heartRate":[ + 125.1949698433959, + 131.31354363122026 + ], + "distanceFromStart":2.25 + }, + { + "elevation":[ + 346.23343025200535, + 497.23376445462401 + ], + "pace":[ + 261.27629148816021, + 331.68516208719467 + ], + "heartRate":[ + 131.67810544238606, + 154.26779645311458 + ], + "distanceFromStart":2.625 + }, + { + "elevation":[ + 491.57378483134391, + 547.49535224251053 + ], + "pace":[ + 296.05298644112088, + 401.14092967732398 + ], + "heartRate":[ + 151.36398089694217, + 166.20454793289232 + ], + "distanceFromStart":3 + }, + { + "elevation":[ + 472.06803233416338, + 531.92570520228401 + ], + "pace":[ + 395.50830663514012, + 401.67837917543591 + ], + "heartRate":[ + 134.41798110234078, + 151.90886697564241 + ], + "distanceFromStart":3.375 + }, + { + "elevation":[ + 339.81419476005283, + 461.03832527824829 + ], + "pace":[ + 395.31160487975183, + 404.49550455974907 + ], + "heartRate":[ + 129.97753472415462, + 138.13531094848992 + ], + "distanceFromStart":3.75 + }, + { + "elevation":[ + 303.1495508565697, + 342.3532820173541 + ], + "pace":[ + 395.02844559698116, + 402.65878340653796 + ], + "heartRate":[ + 127.72304232462609, + 133.26322270764186 + ], + "distanceFromStart":4.125 + } + ] + }, + { + "name":"Lonesome Ridge Trail", + "id":1007, + "distance":4.5, + "difficulty":3, + "observations":[ + { + "elevation":[ + 291.65263635636268, + 309.26016677925196 + ], + "pace":[ + 396.08716481908732, + 403.68937873525232 + ], + "heartRate":[ + 117.16351898665887, + 121.95815455919609 + ], + "distanceFromStart":0 + }, + { + "elevation":[ + 299.24001936628116, + 317.44584350790012 + ], + "pace":[ + 380.19020240756623, + 395.3978319010256 + ], + "heartRate":[ + 117.6410892152911, + 124.82185220506081 + ], + "distanceFromStart":0.375 + }, + { + "elevation":[ + 303.62145464574394, + 336.05569457646544 + ], + "pace":[ + 380.55927782266116, + 397.60789726832775 + ], + "heartRate":[ + 121.52696452049059, + 127.31525441110122 + ], + "distanceFromStart":0.75 + }, + { + "elevation":[ + 319.90393365162629, + 346.26966025518789 + ], + "pace":[ + 357.94116421258531, + 398.0750288648062 + ], + "heartRate":[ + 123.75908585923588, + 132.77069404486801 + ], + "distanceFromStart":1.125 + }, + { + "elevation":[ + 354.17104439267905, + 403.57031216972939 + ], + "pace":[ + 335.07385149392701, + 397.82674381875808 + ], + "heartRate":[ + 130.8235194572915, + 140.55700591418218 + ], + "distanceFromStart":1.5 + }, + { + "elevation":[ + 357.42992871175124, + 385.92155620623635 + ], + "pace":[ + 395.16168913839374, + 404.60294066527558 + ], + "heartRate":[ + 131.5456052446734, + 134.65984504627627 + ], + "distanceFromStart":1.875 + }, + { + "elevation":[ + 345.47736721935661, + 363.18776661379422 + ], + "pace":[ + 340.82303041339082, + 404.71689228682374 + ], + "heartRate":[ + 125.1949698433959, + 131.31354363122026 + ], + "distanceFromStart":2.25 + }, + { + "elevation":[ + 346.23343025200535, + 497.23376445462401 + ], + "pace":[ + 261.27629148816021, + 331.68516208719467 + ], + "heartRate":[ + 131.67810544238606, + 154.26779645311458 + ], + "distanceFromStart":2.625 + }, + { + "elevation":[ + 491.57378483134391, + 547.49535224251053 + ], + "pace":[ + 296.05298644112088, + 401.14092967732398 + ], + "heartRate":[ + 151.36398089694217, + 166.20454793289232 + ], + "distanceFromStart":3 + }, + { + "elevation":[ + 472.06803233416338, + 531.92570520228401 + ], + "pace":[ + 395.50830663514012, + 401.67837917543591 + ], + "heartRate":[ + 134.41798110234078, + 151.90886697564241 + ], + "distanceFromStart":3.375 + }, + { + "elevation":[ + 339.81419476005283, + 461.03832527824829 + ], + "pace":[ + 395.31160487975183, + 404.49550455974907 + ], + "heartRate":[ + 129.97753472415462, + 138.13531094848992 + ], + "distanceFromStart":3.75 + }, + { + "elevation":[ + 303.1495508565697, + 342.3532820173541 + ], + "pace":[ + 395.02844559698116, + 402.65878340653796 + ], + "heartRate":[ + 127.72304232462609, + 133.26322270764186 + ], + "distanceFromStart":4.125 + } + ] + }, + { + "name":"Lonesome Ridge Trail", + "id":1008, + "distance":4.5, + "difficulty":3, + "observations":[ + { + "elevation":[ + 291.65263635636268, + 309.26016677925196 + ], + "pace":[ + 396.08716481908732, + 403.68937873525232 + ], + "heartRate":[ + 117.16351898665887, + 121.95815455919609 + ], + "distanceFromStart":0 + }, + { + "elevation":[ + 299.24001936628116, + 317.44584350790012 + ], + "pace":[ + 380.19020240756623, + 395.3978319010256 + ], + "heartRate":[ + 117.6410892152911, + 124.82185220506081 + ], + "distanceFromStart":0.375 + }, + { + "elevation":[ + 303.62145464574394, + 336.05569457646544 + ], + "pace":[ + 380.55927782266116, + 397.60789726832775 + ], + "heartRate":[ + 121.52696452049059, + 127.31525441110122 + ], + "distanceFromStart":0.75 + }, + { + "elevation":[ + 319.90393365162629, + 346.26966025518789 + ], + "pace":[ + 357.94116421258531, + 398.0750288648062 + ], + "heartRate":[ + 123.75908585923588, + 132.77069404486801 + ], + "distanceFromStart":1.125 + }, + { + "elevation":[ + 354.17104439267905, + 403.57031216972939 + ], + "pace":[ + 335.07385149392701, + 397.82674381875808 + ], + "heartRate":[ + 130.8235194572915, + 140.55700591418218 + ], + "distanceFromStart":1.5 + }, + { + "elevation":[ + 357.42992871175124, + 385.92155620623635 + ], + "pace":[ + 395.16168913839374, + 404.60294066527558 + ], + "heartRate":[ + 131.5456052446734, + 134.65984504627627 + ], + "distanceFromStart":1.875 + }, + { + "elevation":[ + 345.47736721935661, + 363.18776661379422 + ], + "pace":[ + 340.82303041339082, + 404.71689228682374 + ], + "heartRate":[ + 125.1949698433959, + 131.31354363122026 + ], + "distanceFromStart":2.25 + }, + { + "elevation":[ + 346.23343025200535, + 497.23376445462401 + ], + "pace":[ + 261.27629148816021, + 331.68516208719467 + ], + "heartRate":[ + 131.67810544238606, + 154.26779645311458 + ], + "distanceFromStart":2.625 + }, + { + "elevation":[ + 491.57378483134391, + 547.49535224251053 + ], + "pace":[ + 296.05298644112088, + 401.14092967732398 + ], + "heartRate":[ + 151.36398089694217, + 166.20454793289232 + ], + "distanceFromStart":3 + }, + { + "elevation":[ + 472.06803233416338, + 531.92570520228401 + ], + "pace":[ + 395.50830663514012, + 401.67837917543591 + ], + "heartRate":[ + 134.41798110234078, + 151.90886697564241 + ], + "distanceFromStart":3.375 + }, + { + "elevation":[ + 339.81419476005283, + 461.03832527824829 + ], + "pace":[ + 395.31160487975183, + 404.49550455974907 + ], + "heartRate":[ + 129.97753472415462, + 138.13531094848992 + ], + "distanceFromStart":3.75 + }, + { + "elevation":[ + 303.1495508565697, + 342.3532820173541 + ], + "pace":[ + 395.02844559698116, + 402.65878340653796 + ], + "heartRate":[ + 127.72304232462609, + 133.26322270764186 + ], + "distanceFromStart":4.125 + } + ] + }, + { + "name":"Lonesome Ridge Trail", + "id":1009, + "distance":4.5, + "difficulty":3, + "observations":[ + { + "elevation":[ + 291.65263635636268, + 309.26016677925196 + ], + "pace":[ + 396.08716481908732, + 403.68937873525232 + ], + "heartRate":[ + 117.16351898665887, + 121.95815455919609 + ], + "distanceFromStart":0 + }, + { + "elevation":[ + 299.24001936628116, + 317.44584350790012 + ], + "pace":[ + 380.19020240756623, + 395.3978319010256 + ], + "heartRate":[ + 117.6410892152911, + 124.82185220506081 + ], + "distanceFromStart":0.375 + }, + { + "elevation":[ + 303.62145464574394, + 336.05569457646544 + ], + "pace":[ + 380.55927782266116, + 397.60789726832775 + ], + "heartRate":[ + 121.52696452049059, + 127.31525441110122 + ], + "distanceFromStart":0.75 + }, + { + "elevation":[ + 319.90393365162629, + 346.26966025518789 + ], + "pace":[ + 357.94116421258531, + 398.0750288648062 + ], + "heartRate":[ + 123.75908585923588, + 132.77069404486801 + ], + "distanceFromStart":1.125 + }, + { + "elevation":[ + 354.17104439267905, + 403.57031216972939 + ], + "pace":[ + 335.07385149392701, + 397.82674381875808 + ], + "heartRate":[ + 130.8235194572915, + 140.55700591418218 + ], + "distanceFromStart":1.5 + }, + { + "elevation":[ + 357.42992871175124, + 385.92155620623635 + ], + "pace":[ + 395.16168913839374, + 404.60294066527558 + ], + "heartRate":[ + 131.5456052446734, + 134.65984504627627 + ], + "distanceFromStart":1.875 + }, + { + "elevation":[ + 345.47736721935661, + 363.18776661379422 + ], + "pace":[ + 340.82303041339082, + 404.71689228682374 + ], + "heartRate":[ + 125.1949698433959, + 131.31354363122026 + ], + "distanceFromStart":2.25 + }, + { + "elevation":[ + 346.23343025200535, + 497.23376445462401 + ], + "pace":[ + 261.27629148816021, + 331.68516208719467 + ], + "heartRate":[ + 131.67810544238606, + 154.26779645311458 + ], + "distanceFromStart":2.625 + }, + { + "elevation":[ + 491.57378483134391, + 547.49535224251053 + ], + "pace":[ + 296.05298644112088, + 401.14092967732398 + ], + "heartRate":[ + 151.36398089694217, + 166.20454793289232 + ], + "distanceFromStart":3 + }, + { + "elevation":[ + 472.06803233416338, + 531.92570520228401 + ], + "pace":[ + 395.50830663514012, + 401.67837917543591 + ], + "heartRate":[ + 134.41798110234078, + 151.90886697564241 + ], + "distanceFromStart":3.375 + }, + { + "elevation":[ + 339.81419476005283, + 461.03832527824829 + ], + "pace":[ + 395.31160487975183, + 404.49550455974907 + ], + "heartRate":[ + 129.97753472415462, + 138.13531094848992 + ], + "distanceFromStart":3.75 + }, + { + "elevation":[ + 303.1495508565697, + 342.3532820173541 + ], + "pace":[ + 395.02844559698116, + 402.65878340653796 + ], + "heartRate":[ + 127.72304232462609, + 133.26322270764186 + ], + "distanceFromStart":4.125 + } + ] + }, + { + "name":"Lonesome Ridge Trail", + "id":1010, + "distance":4.5, + "difficulty":3, + "observations":[ + { + "elevation":[ + 291.65263635636268, + 309.26016677925196 + ], + "pace":[ + 396.08716481908732, + 403.68937873525232 + ], + "heartRate":[ + 117.16351898665887, + 121.95815455919609 + ], + "distanceFromStart":0 + }, + { + "elevation":[ + 299.24001936628116, + 317.44584350790012 + ], + "pace":[ + 380.19020240756623, + 395.3978319010256 + ], + "heartRate":[ + 117.6410892152911, + 124.82185220506081 + ], + "distanceFromStart":0.375 + }, + { + "elevation":[ + 303.62145464574394, + 336.05569457646544 + ], + "pace":[ + 380.55927782266116, + 397.60789726832775 + ], + "heartRate":[ + 121.52696452049059, + 127.31525441110122 + ], + "distanceFromStart":0.75 + }, + { + "elevation":[ + 319.90393365162629, + 346.26966025518789 + ], + "pace":[ + 357.94116421258531, + 398.0750288648062 + ], + "heartRate":[ + 123.75908585923588, + 132.77069404486801 + ], + "distanceFromStart":1.125 + }, + { + "elevation":[ + 354.17104439267905, + 403.57031216972939 + ], + "pace":[ + 335.07385149392701, + 397.82674381875808 + ], + "heartRate":[ + 130.8235194572915, + 140.55700591418218 + ], + "distanceFromStart":1.5 + }, + { + "elevation":[ + 357.42992871175124, + 385.92155620623635 + ], + "pace":[ + 395.16168913839374, + 404.60294066527558 + ], + "heartRate":[ + 131.5456052446734, + 134.65984504627627 + ], + "distanceFromStart":1.875 + }, + { + "elevation":[ + 345.47736721935661, + 363.18776661379422 + ], + "pace":[ + 340.82303041339082, + 404.71689228682374 + ], + "heartRate":[ + 125.1949698433959, + 131.31354363122026 + ], + "distanceFromStart":2.25 + }, + { + "elevation":[ + 346.23343025200535, + 497.23376445462401 + ], + "pace":[ + 261.27629148816021, + 331.68516208719467 + ], + "heartRate":[ + 131.67810544238606, + 154.26779645311458 + ], + "distanceFromStart":2.625 + }, + { + "elevation":[ + 491.57378483134391, + 547.49535224251053 + ], + "pace":[ + 296.05298644112088, + 401.14092967732398 + ], + "heartRate":[ + 151.36398089694217, + 166.20454793289232 + ], + "distanceFromStart":3 + }, + { + "elevation":[ + 472.06803233416338, + 531.92570520228401 + ], + "pace":[ + 395.50830663514012, + 401.67837917543591 + ], + "heartRate":[ + 134.41798110234078, + 151.90886697564241 + ], + "distanceFromStart":3.375 + }, + { + "elevation":[ + 339.81419476005283, + 461.03832527824829 + ], + "pace":[ + 395.31160487975183, + 404.49550455974907 + ], + "heartRate":[ + 129.97753472415462, + 138.13531094848992 + ], + "distanceFromStart":3.75 + }, + { + "elevation":[ + 303.1495508565697, + 342.3532820173541 + ], + "pace":[ + 395.02844559698116, + 402.65878340653796 + ], + "heartRate":[ + 127.72304232462609, + 133.26322270764186 + ], + "distanceFromStart":4.125 + } + ] + } +] diff --git a/Examples/WorkingWithUIControls/StartingPoint/Landmarks/Landmarks/Resources/icybay.jpg b/Examples/WorkingWithUIControls/StartingPoint/Landmarks/Landmarks/Resources/icybay.jpg new file mode 100755 index 0000000..feb1764 Binary files /dev/null and b/Examples/WorkingWithUIControls/StartingPoint/Landmarks/Landmarks/Resources/icybay.jpg differ diff --git a/Examples/WorkingWithUIControls/StartingPoint/Landmarks/Landmarks/Resources/lakemcdonald.jpg b/Examples/WorkingWithUIControls/StartingPoint/Landmarks/Landmarks/Resources/lakemcdonald.jpg new file mode 100755 index 0000000..bd9d6b9 Binary files /dev/null and b/Examples/WorkingWithUIControls/StartingPoint/Landmarks/Landmarks/Resources/lakemcdonald.jpg differ diff --git a/Examples/WorkingWithUIControls/StartingPoint/Landmarks/Landmarks/Resources/landmarkData.json b/Examples/WorkingWithUIControls/StartingPoint/Landmarks/Landmarks/Resources/landmarkData.json new file mode 100755 index 0000000..e5b14fc --- /dev/null +++ b/Examples/WorkingWithUIControls/StartingPoint/Landmarks/Landmarks/Resources/landmarkData.json @@ -0,0 +1,182 @@ +[ + { + "name": "Turtle Rock", + "category": "Rivers", + "city": "Twentynine Palms", + "state": "California", + "id": 1001, + "isFeatured": true, + "isFavorite": true, + "park": "Joshua Tree National Park", + "coordinates": { + "longitude": -116.166868, + "latitude": 34.011286 + }, + "imageName": "turtlerock" + }, + { + "name": "Silver Salmon Creek", + "category": "Lakes", + "city": "Port Alsworth", + "state": "Alaska", + "id": 1002, + "isFeatured": false, + "isFavorite": false, + "park": "Lake Clark National Park and Preserve", + "coordinates": { + "longitude": -152.665167, + "latitude": 59.980167 + }, + "imageName": "silversalmoncreek" + }, + { + "name": "Chilkoot Trail", + "category": "Mountains", + "city": "Skagway", + "state": "Alaska", + "id": 1003, + "isFeatured": false, + "isFavorite": true, + "park": "Klondike Gold Rush National Historical Park", + "coordinates": { + "longitude": -135.334571, + "latitude": 59.560551 + }, + "imageName": "chilkoottrail" + }, + { + "name": "St. Mary Lake", + "category": "Lakes", + "city": "Browning", + "state": "Montana", + "id": 1004, + "isFeatured": true, + "isFavorite": true, + "park": "Glacier National Park", + "coordinates": { + "longitude": -113.536248, + "latitude": 48.69423 + }, + "imageName": "stmarylake" + }, + { + "name": "Twin Lake", + "category": "Lakes", + "city": "Twin Lakes", + "state": "Alaska", + "id": 1005, + "isFeatured": false, + "isFavorite": false, + "park": "Lake Clark National Park and Preserve", + "coordinates": { + "longitude": -153.849883, + "latitude": 60.641684 + }, + "imageName": "twinlake" + }, + { + "name": "Lake McDonald", + "category": "Mountains", + "city": "West Glacier", + "state": "Montana", + "id": 1006, + "isFeatured": false, + "isFavorite": false, + "park": "Glacier National Park", + "coordinates": { + "longitude": -113.934831, + "latitude": 48.56002 + }, + "imageName": "lakemcdonald" + }, + { + "name": "Charley Rivers", + "category": "Rivers", + "city": "Eaking", + "state": "Alaska", + "id": 1007, + "isFeatured": true, + "isFavorite": false, + "park": "Charley Rivers National Preserve", + "coordinates": { + "longitude": -143.122586, + "latitude": 65.350021 + }, + "imageName": "charleyrivers", + }, + { + "name": "Icy Bay", + "category": "Mountains", + "city": "Icy Bay", + "state": "Alaska", + "id": 1008, + "isFeatured": false, + "isFavorite": false, + "park": "Wrangell-St. Elias National Park and Preserve", + "coordinates": { + "longitude": -141.518167, + "latitude": 60.089917 + }, + "imageName": "icybay" + }, + { + "name": "Rainbow Lake", + "category": "Lakes", + "city": "Willow", + "state": "Alaska", + "id": 1009, + "isFeatured": false, + "isFavorite": false, + "park": "State Recreation Area", + "coordinates": { + "longitude": -150.086103, + "latitude": 61.694334 + }, + "imageName": "rainbowlake" + }, + { + "name": "Hidden Lake", + "category": "Lakes", + "city": "Newhalem", + "state": "Washington", + "id": 1010, + "isFeatured": false, + "isFavorite": false, + "park": "North Cascades National Park", + "coordinates": { + "longitude": -121.17799, + "latitude": 48.495442 + }, + "imageName": "hiddenlake" + }, + { + "name": "Chincoteague", + "category": "Rivers", + "city": "Chincoteague", + "state": "Virginia", + "id": 1011, + "isFeatured": false, + "isFavorite": false, + "park": "Chincoteague National Wildlife Refuge", + "coordinates": { + "longitude": -75.383212, + "latitude": 37.91531 + }, + "imageName": "chincoteague" + }, + { + "name": "Lake Umbagog", + "category": "Lakes", + "city": "Errol", + "state": "New Hampshire", + "id": 1012, + "isFeatured": true, + "isFavorite": false, + "park": "Umbagog National Wildlife Refuge", + "coordinates": { + "longitude": -71.056816, + "latitude": 44.747408 + }, + "imageName": "umbagog" + } +] diff --git a/Examples/WorkingWithUIControls/StartingPoint/Landmarks/Landmarks/Resources/rainbowlake.jpg b/Examples/WorkingWithUIControls/StartingPoint/Landmarks/Landmarks/Resources/rainbowlake.jpg new file mode 100755 index 0000000..6da43dd Binary files /dev/null and b/Examples/WorkingWithUIControls/StartingPoint/Landmarks/Landmarks/Resources/rainbowlake.jpg differ diff --git a/Examples/WorkingWithUIControls/StartingPoint/Landmarks/Landmarks/Resources/silversalmoncreek.jpg b/Examples/WorkingWithUIControls/StartingPoint/Landmarks/Landmarks/Resources/silversalmoncreek.jpg new file mode 100755 index 0000000..f657532 Binary files /dev/null and b/Examples/WorkingWithUIControls/StartingPoint/Landmarks/Landmarks/Resources/silversalmoncreek.jpg differ diff --git a/Examples/WorkingWithUIControls/StartingPoint/Landmarks/Landmarks/Resources/stmarylake.jpg b/Examples/WorkingWithUIControls/StartingPoint/Landmarks/Landmarks/Resources/stmarylake.jpg new file mode 100755 index 0000000..1c71de4 Binary files /dev/null and b/Examples/WorkingWithUIControls/StartingPoint/Landmarks/Landmarks/Resources/stmarylake.jpg differ diff --git a/Examples/WorkingWithUIControls/StartingPoint/Landmarks/Landmarks/Resources/turtlerock.jpg b/Examples/WorkingWithUIControls/StartingPoint/Landmarks/Landmarks/Resources/turtlerock.jpg new file mode 100755 index 0000000..f7a6e6d Binary files /dev/null and b/Examples/WorkingWithUIControls/StartingPoint/Landmarks/Landmarks/Resources/turtlerock.jpg differ diff --git a/Examples/WorkingWithUIControls/StartingPoint/Landmarks/Landmarks/Resources/twinlake.jpg b/Examples/WorkingWithUIControls/StartingPoint/Landmarks/Landmarks/Resources/twinlake.jpg new file mode 100755 index 0000000..3e7a57c Binary files /dev/null and b/Examples/WorkingWithUIControls/StartingPoint/Landmarks/Landmarks/Resources/twinlake.jpg differ diff --git a/Examples/WorkingWithUIControls/StartingPoint/Landmarks/Landmarks/Resources/umbagog.jpg b/Examples/WorkingWithUIControls/StartingPoint/Landmarks/Landmarks/Resources/umbagog.jpg new file mode 100755 index 0000000..56291c6 Binary files /dev/null and b/Examples/WorkingWithUIControls/StartingPoint/Landmarks/Landmarks/Resources/umbagog.jpg differ diff --git a/Examples/WorkingWithUIControls/StartingPoint/Landmarks/Landmarks/SceneDelegate.swift b/Examples/WorkingWithUIControls/StartingPoint/Landmarks/Landmarks/SceneDelegate.swift new file mode 100755 index 0000000..0f5f17e --- /dev/null +++ b/Examples/WorkingWithUIControls/StartingPoint/Landmarks/Landmarks/SceneDelegate.swift @@ -0,0 +1,56 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +The scene delegate. +*/ + +import UIKit +import SwiftUI + +class SceneDelegate: UIResponder, UIWindowSceneDelegate { + + var window: UIWindow? + + func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) { + // Use this method to optionally configure and attach the UIWindow `window` to the provided UIWindowScene `scene`. + // If using a storyboard, the `window` property will automatically be initialized and attached to the scene. + // This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead). + + // Use a UIHostingController as window root view controller + let window = UIWindow(frame: UIScreen.main.bounds) + window.rootViewController = UIHostingController(rootView: CategoryHome().environmentObject(UserData())) + self.window = window + window.makeKeyAndVisible() + } + + func sceneDidDisconnect(_ scene: UIScene) { + // Called as the scene is being released by the system. + // This occurs shortly after the scene enters the background, or when its session is discarded. + // Release any resources associated with this scene that can be re-created the next time the scene connects. + // The scene may re-connect later, as its session was not neccessarily discarded (see `application:didDiscardSceneSessions` instead). + } + + func sceneDidBecomeActive(_ scene: UIScene) { + // Called when the scene has moved from an inactive state to an active state. + // Use this method to restart any tasks that were paused (or not yet started) when the scene was inactive. + } + + func sceneWillResignActive(_ scene: UIScene) { + // Called when the scene will move from an active state to an inactive state. + // This may occur due to temporary interruptions (ex. an incoming phone call). + } + + func sceneWillEnterForeground(_ scene: UIScene) { + // Called as the scene transitions from the background to the foreground. + // Use this method to undo the changes made on entering the background. + } + + func sceneDidEnterBackground(_ scene: UIScene) { + // Called as the scene transitions from the foreground to the background. + // Use this method to save data, release shared resources, and store enough scene-specific state information + // to restore the scene back to its current state. + } + +} + diff --git a/Examples/WorkingWithUIControls/StartingPoint/Landmarks/Landmarks/Supporting Views/Badge.swift b/Examples/WorkingWithUIControls/StartingPoint/Landmarks/Landmarks/Supporting Views/Badge.swift new file mode 100755 index 0000000..59f03b2 --- /dev/null +++ b/Examples/WorkingWithUIControls/StartingPoint/Landmarks/Landmarks/Supporting Views/Badge.swift @@ -0,0 +1,41 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +A view that displays a badge. +*/ + +import SwiftUI + +struct Badge: View { + static let rotationCount = 8 + + var badgeSymbols: some View { + ForEach(0.. + var overallRange: Range + + var heightRatio: Length { + max(Length(magnitude(of: range) / magnitude(of: overallRange)), 0.15) + } + + var offsetRatio: Length { + Length((range.lowerBound - overallRange.lowerBound) / magnitude(of: overallRange)) + } + + var animation: Animation { + Animation.spring(initialVelocity: 5) + .speed(2) + .delay(0.03 * Double(index)) + } + + var body: some View { + Capsule() + .fill(Color.white) + .frame(height: height * heightRatio, alignment: .bottom) + .offset(x: 0, y: height * -offsetRatio) + .animation(animation) + } +} + +#if DEBUG +struct GraphCapsule_Previews: PreviewProvider { + static var previews: some View { + GraphCapsule(index: 0, height: 150, range: 10..<50, overallRange: 0..<100) + } +} +#endif diff --git a/Examples/WorkingWithUIControls/StartingPoint/Landmarks/Landmarks/Supporting Views/HikeGraph.swift b/Examples/WorkingWithUIControls/StartingPoint/Landmarks/Landmarks/Supporting Views/HikeGraph.swift new file mode 100755 index 0000000..7df5194 --- /dev/null +++ b/Examples/WorkingWithUIControls/StartingPoint/Landmarks/Landmarks/Supporting Views/HikeGraph.swift @@ -0,0 +1,74 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +The elevation, heart rate, and pace of a hike plotted on a graph. +*/ + +import SwiftUI + +func rangeOfRanges(_ ranges: C) -> Range + where C.Element == Range { + guard !ranges.isEmpty else { return 0..<0 } + let low = ranges.lazy.map { $0.lowerBound }.min()! + let high = ranges.lazy.map { $0.upperBound }.max()! + return low..) -> Double { + return range.upperBound - range.lowerBound +} + +struct HikeGraph: View { + var hike: Hike + var path: KeyPath> + + var color: Color { + switch path { + case \.elevation: + return .gray + case \.heartRate: + return Color(hue: 0, saturation: 0.5, brightness: 0.7) + case \.pace: + return Color(hue: 0.7, saturation: 0.4, brightness: 0.7) + default: + return .black + } + } + + var body: some View { + let data = hike.observations + let overallRange = rangeOfRanges(data.lazy.map { $0[keyPath: self.path] }) + let maxMagnitude = data.map { magnitude(of: $0[keyPath: path]) }.max()! + let heightRatio = 1 - Length(maxMagnitude / magnitude(of: overallRange)) + + return GeometryReader { proxy in + HStack(alignment: .bottom, spacing: proxy.size.width / 120) { + ForEach(data.indices) { index in + GraphCapsule( + index: index, + height: proxy.size.height, + range: data[index][keyPath: self.path], + overallRange: overallRange) + .colorMultiply(self.color) + } + .offset(x: 0, y: proxy.size.height * heightRatio) + } + } + } +} + +#if DEBUG +struct HikeGraph_Previews: PreviewProvider { + static var previews: some View { + Group { + HikeGraph(hike: hikeData[0], path: \.elevation) + .frame(height: 200) + HikeGraph(hike: hikeData[0], path: \.heartRate) + .frame(height: 200) + HikeGraph(hike: hikeData[0], path: \.pace) + .frame(height: 200) + } + } +} +#endif diff --git a/Examples/WorkingWithUIControls/StartingPoint/Landmarks/Landmarks/Supporting Views/LandmarkRow.swift b/Examples/WorkingWithUIControls/StartingPoint/Landmarks/Landmarks/Supporting Views/LandmarkRow.swift new file mode 100755 index 0000000..2f8110c --- /dev/null +++ b/Examples/WorkingWithUIControls/StartingPoint/Landmarks/Landmarks/Supporting Views/LandmarkRow.swift @@ -0,0 +1,38 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +A single row to be displayed in a list of landmarks. +*/ + +import SwiftUI + +struct LandmarkRow: View { + var landmark: Landmark + + var body: some View { + HStack { + landmark.image(forSize: 50) + Text(verbatim: landmark.name) + Spacer() + + if landmark.isFavorite { + Image(systemName: "star.fill") + .imageScale(.medium) + .foregroundColor(.yellow) + } + } + } +} + +#if DEBUG +struct LandmarkRow_Previews: PreviewProvider { + static var previews: some View { + Group { + LandmarkRow(landmark: landmarkData[0]) + LandmarkRow(landmark: landmarkData[1]) + } + .previewLayout(.fixed(width: 300, height: 70)) + } +} +#endif diff --git a/Examples/WorkingWithUIControls/StartingPoint/Landmarks/Landmarks/Supporting Views/MapView.swift b/Examples/WorkingWithUIControls/StartingPoint/Landmarks/Landmarks/Supporting Views/MapView.swift new file mode 100755 index 0000000..5a8c64b --- /dev/null +++ b/Examples/WorkingWithUIControls/StartingPoint/Landmarks/Landmarks/Supporting Views/MapView.swift @@ -0,0 +1,31 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +A view that hosts an `MKMapView`. +*/ + +import SwiftUI +import MapKit + +struct MapView: UIViewRepresentable { + var coordinate: CLLocationCoordinate2D + + func makeUIView(context: Context) -> MKMapView { + MKMapView(frame: .zero) + } + + func updateUIView(_ view: MKMapView, context: Context) { + let span = MKCoordinateSpan(latitudeDelta: 0.02, longitudeDelta: 0.02) + let region = MKCoordinateRegion(center: coordinate, span: span) + view.setRegion(region, animated: true) + } +} + +#if DEBUG +struct MapView_Previews: PreviewProvider { + static var previews: some View { + MapView(coordinate: landmarkData[0].locationCoordinate) + } +} +#endif diff --git a/Examples/WorkingWithUIControls/StartingPoint/Landmarks/Landmarks/Supporting Views/RotatedBadgeSymbol.swift b/Examples/WorkingWithUIControls/StartingPoint/Landmarks/Landmarks/Supporting Views/RotatedBadgeSymbol.swift new file mode 100755 index 0000000..a7e4b53 --- /dev/null +++ b/Examples/WorkingWithUIControls/StartingPoint/Landmarks/Landmarks/Supporting Views/RotatedBadgeSymbol.swift @@ -0,0 +1,26 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +A view that displays a rotated version of a badge symbol. +*/ + +import SwiftUI + +struct RotatedBadgeSymbol: View { + let angle: Angle + + var body: some View { + BadgeSymbol() + .padding(-60) + .rotationEffect(angle, anchor: .bottom) + } +} + +#if DEBUG +struct RotatedBadgeSymbol_Previews: PreviewProvider { + static var previews: some View { + RotatedBadgeSymbol(angle: .init(degrees: 5)) + } +} +#endif diff --git a/Examples/WorkingWithUIControls/StartingPoint/Landmarks/WorkingWithUIControls.xcodeproj/.xcodesamplecode.plist b/Examples/WorkingWithUIControls/StartingPoint/Landmarks/WorkingWithUIControls.xcodeproj/.xcodesamplecode.plist new file mode 100755 index 0000000..5dd5da8 --- /dev/null +++ b/Examples/WorkingWithUIControls/StartingPoint/Landmarks/WorkingWithUIControls.xcodeproj/.xcodesamplecode.plist @@ -0,0 +1,5 @@ + + + + + diff --git a/Examples/WorkingWithUIControls/StartingPoint/Landmarks/WorkingWithUIControls.xcodeproj/project.pbxproj b/Examples/WorkingWithUIControls/StartingPoint/Landmarks/WorkingWithUIControls.xcodeproj/project.pbxproj new file mode 100755 index 0000000..0cffe0c --- /dev/null +++ b/Examples/WorkingWithUIControls/StartingPoint/Landmarks/WorkingWithUIControls.xcodeproj/project.pbxproj @@ -0,0 +1,537 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 50; + objects = { + +/* Begin PBXBuildFile section */ + B7310DD1229F6839001079B9 /* HexagonParameters.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7310DD0229F6839001079B9 /* HexagonParameters.swift */; }; + B7310DD3229F6CA9001079B9 /* Badge.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7310DD2229F6CA9001079B9 /* Badge.swift */; }; + B7394866229F194000C47603 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7394865229F194000C47603 /* AppDelegate.swift */; }; + B7394868229F194000C47603 /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7394867229F194000C47603 /* SceneDelegate.swift */; }; + B739486A229F194000C47603 /* LandmarkDetail.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7394869229F194000C47603 /* LandmarkDetail.swift */; }; + B739486C229F194200C47603 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = B739486B229F194200C47603 /* Assets.xcassets */; }; + B739486F229F194200C47603 /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = B739486E229F194200C47603 /* Preview Assets.xcassets */; }; + B7394872229F194200C47603 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = B7394870229F194200C47603 /* LaunchScreen.storyboard */; }; + B739487A229F1B3F00C47603 /* CircleImage.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7394879229F1B3F00C47603 /* CircleImage.swift */; }; + B739487C229F1B6800C47603 /* MapView.swift in Sources */ = {isa = PBXBuildFile; fileRef = B739487B229F1B6800C47603 /* MapView.swift */; }; + B7394881229F28B900C47603 /* Landmark.swift in Sources */ = {isa = PBXBuildFile; fileRef = B739487F229F28B900C47603 /* Landmark.swift */; }; + B7394882229F28B900C47603 /* Data.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7394880229F28B900C47603 /* Data.swift */; }; + B7394891229F292F00C47603 /* rainbowlake.jpg in Resources */ = {isa = PBXBuildFile; fileRef = B7394884229F292D00C47603 /* rainbowlake.jpg */; }; + B7394893229F292F00C47603 /* icybay.jpg in Resources */ = {isa = PBXBuildFile; fileRef = B7394886229F292E00C47603 /* icybay.jpg */; }; + B7394894229F292F00C47603 /* lakemcdonald.jpg in Resources */ = {isa = PBXBuildFile; fileRef = B7394887229F292E00C47603 /* lakemcdonald.jpg */; }; + B7394895229F292F00C47603 /* turtlerock.jpg in Resources */ = {isa = PBXBuildFile; fileRef = B7394888229F292E00C47603 /* turtlerock.jpg */; }; + B7394896229F292F00C47603 /* umbagog.jpg in Resources */ = {isa = PBXBuildFile; fileRef = B7394889229F292E00C47603 /* umbagog.jpg */; }; + B7394897229F292F00C47603 /* hiddenlake.jpg in Resources */ = {isa = PBXBuildFile; fileRef = B739488A229F292E00C47603 /* hiddenlake.jpg */; }; + B7394898229F292F00C47603 /* stmarylake.jpg in Resources */ = {isa = PBXBuildFile; fileRef = B739488B229F292E00C47603 /* stmarylake.jpg */; }; + B7394899229F292F00C47603 /* twinlake.jpg in Resources */ = {isa = PBXBuildFile; fileRef = B739488C229F292E00C47603 /* twinlake.jpg */; }; + B739489A229F292F00C47603 /* silversalmoncreek.jpg in Resources */ = {isa = PBXBuildFile; fileRef = B739488D229F292E00C47603 /* silversalmoncreek.jpg */; }; + B739489B229F292F00C47603 /* landmarkData.json in Resources */ = {isa = PBXBuildFile; fileRef = B739488E229F292E00C47603 /* landmarkData.json */; }; + B739489C229F292F00C47603 /* chincoteague.jpg in Resources */ = {isa = PBXBuildFile; fileRef = B739488F229F292F00C47603 /* chincoteague.jpg */; }; + B739489D229F292F00C47603 /* chilkoottrail.jpg in Resources */ = {isa = PBXBuildFile; fileRef = B7394890229F292F00C47603 /* chilkoottrail.jpg */; }; + B739489F229F2D9700C47603 /* LandmarkRow.swift in Sources */ = {isa = PBXBuildFile; fileRef = B739489E229F2D9700C47603 /* LandmarkRow.swift */; }; + B73948A1229F2E1F00C47603 /* LandmarkList.swift in Sources */ = {isa = PBXBuildFile; fileRef = B73948A0229F2E1F00C47603 /* LandmarkList.swift */; }; + B73948A3229F3E2200C47603 /* charleyrivers.jpg in Resources */ = {isa = PBXBuildFile; fileRef = B73948A2229F3E2200C47603 /* charleyrivers.jpg */; }; + B7D2AAC5229F4D7C0061E5F5 /* UserData.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7D2AAC4229F4D7C0061E5F5 /* UserData.swift */; }; + B7D587AE229F7382006E8DCF /* BadgeBackground.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7D587AD229F7382006E8DCF /* BadgeBackground.swift */; }; + B7D587B0229F73C1006E8DCF /* BadgeSymbol.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7D587AF229F73C1006E8DCF /* BadgeSymbol.swift */; }; + B7D587B2229F7406006E8DCF /* RotatedBadgeSymbol.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7D587B1229F7406006E8DCF /* RotatedBadgeSymbol.swift */; }; + B7D587B6229F825D006E8DCF /* HikeView.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7D587B5229F825D006E8DCF /* HikeView.swift */; }; + B7D587B8229F826D006E8DCF /* GraphCapsule.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7D587B7229F826D006E8DCF /* GraphCapsule.swift */; }; + B7D587BA229F8288006E8DCF /* Hike.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7D587B9229F8288006E8DCF /* Hike.swift */; }; + B7D587BC229F82EB006E8DCF /* HikeDetail.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7D587BB229F82EB006E8DCF /* HikeDetail.swift */; }; + B7D587BE229F82FF006E8DCF /* HikeGraph.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7D587BD229F82FF006E8DCF /* HikeGraph.swift */; }; + B7D587C0229F830B006E8DCF /* hikeData.json in Resources */ = {isa = PBXBuildFile; fileRef = B7D587BF229F830B006E8DCF /* hikeData.json */; }; + B7D587D222A0892C006E8DCF /* Home.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7D587D122A0892C006E8DCF /* Home.swift */; }; + B7D587D422A08965006E8DCF /* CategoryRow.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7D587D322A08965006E8DCF /* CategoryRow.swift */; }; + B7D587D622A08C97006E8DCF /* Profile.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7D587D522A08C97006E8DCF /* Profile.swift */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + A6DAFAD0A6DAE9D000000001 /* SampleCode.xcconfig */ = {isa = PBXFileReference; name = SampleCode.xcconfig; path = ../Configuration/SampleCode.xcconfig; sourceTree = ""; }; + A6FA8160A6FAB53000000001 /* LICENSE.txt */ = {isa = PBXFileReference; includeInIndex = 1; path = LICENSE.txt; sourceTree = ""; }; + B7310DD0229F6839001079B9 /* HexagonParameters.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HexagonParameters.swift; sourceTree = ""; }; + B7310DD2229F6CA9001079B9 /* Badge.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Badge.swift; sourceTree = ""; }; + B7394862229F194000C47603 /* Landmarks.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Landmarks.app; sourceTree = BUILT_PRODUCTS_DIR; }; + B7394865229F194000C47603 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + B7394867229F194000C47603 /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = ""; }; + B7394869229F194000C47603 /* LandmarkDetail.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LandmarkDetail.swift; sourceTree = ""; }; + B739486B229F194200C47603 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + B739486E229F194200C47603 /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = ""; }; + B7394871229F194200C47603 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + B7394873229F194200C47603 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + B7394879229F1B3F00C47603 /* CircleImage.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CircleImage.swift; sourceTree = ""; }; + B739487B229F1B6800C47603 /* MapView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MapView.swift; sourceTree = ""; }; + B739487F229F28B900C47603 /* Landmark.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Landmark.swift; sourceTree = ""; }; + B7394880229F28B900C47603 /* Data.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Data.swift; sourceTree = ""; }; + B7394884229F292D00C47603 /* rainbowlake.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = rainbowlake.jpg; sourceTree = ""; }; + B7394886229F292E00C47603 /* icybay.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = icybay.jpg; sourceTree = ""; }; + B7394887229F292E00C47603 /* lakemcdonald.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = lakemcdonald.jpg; sourceTree = ""; }; + B7394888229F292E00C47603 /* turtlerock.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = turtlerock.jpg; sourceTree = ""; }; + B7394889229F292E00C47603 /* umbagog.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = umbagog.jpg; sourceTree = ""; }; + B739488A229F292E00C47603 /* hiddenlake.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = hiddenlake.jpg; sourceTree = ""; }; + B739488B229F292E00C47603 /* stmarylake.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = stmarylake.jpg; sourceTree = ""; }; + B739488C229F292E00C47603 /* twinlake.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = twinlake.jpg; sourceTree = ""; }; + B739488D229F292E00C47603 /* silversalmoncreek.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = silversalmoncreek.jpg; sourceTree = ""; }; + B739488E229F292E00C47603 /* landmarkData.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = landmarkData.json; sourceTree = ""; }; + B739488F229F292F00C47603 /* chincoteague.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = chincoteague.jpg; sourceTree = ""; }; + B7394890229F292F00C47603 /* chilkoottrail.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = chilkoottrail.jpg; sourceTree = ""; }; + B739489E229F2D9700C47603 /* LandmarkRow.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = LandmarkRow.swift; path = "Supporting Views/LandmarkRow.swift"; sourceTree = ""; }; + B73948A0229F2E1F00C47603 /* LandmarkList.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LandmarkList.swift; sourceTree = ""; }; + B73948A2229F3E2200C47603 /* charleyrivers.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = charleyrivers.jpg; sourceTree = ""; }; + B7D2AAC4229F4D7C0061E5F5 /* UserData.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UserData.swift; sourceTree = ""; }; + B7D587AD229F7382006E8DCF /* BadgeBackground.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BadgeBackground.swift; sourceTree = ""; }; + B7D587AF229F73C1006E8DCF /* BadgeSymbol.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BadgeSymbol.swift; sourceTree = ""; }; + B7D587B1229F7406006E8DCF /* RotatedBadgeSymbol.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RotatedBadgeSymbol.swift; sourceTree = ""; }; + B7D587B5229F825D006E8DCF /* HikeView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HikeView.swift; sourceTree = ""; }; + B7D587B7229F826D006E8DCF /* GraphCapsule.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GraphCapsule.swift; sourceTree = ""; }; + B7D587B9229F8288006E8DCF /* Hike.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Hike.swift; sourceTree = ""; }; + B7D587BB229F82EB006E8DCF /* HikeDetail.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HikeDetail.swift; sourceTree = ""; }; + B7D587BD229F82FF006E8DCF /* HikeGraph.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HikeGraph.swift; sourceTree = ""; }; + B7D587BF229F830B006E8DCF /* hikeData.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = hikeData.json; sourceTree = ""; }; + B7D587D122A0892C006E8DCF /* Home.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Home.swift; sourceTree = ""; }; + B7D587D322A08965006E8DCF /* CategoryRow.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CategoryRow.swift; sourceTree = ""; }; + B7D587D522A08C97006E8DCF /* Profile.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Profile.swift; sourceTree = ""; }; + C4E4AAA0C4E4035000000001 /* README.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; name = README.md; path = ../README.md; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + B739485F229F194000C47603 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + A6DAF630A6DAF5F000000001 /* Configuration */ = { + isa = PBXGroup; + children = ( + A6DAFAD0A6DAE9D000000001 /* SampleCode.xcconfig */, + ); + name = Configuration; + sourceTree = ""; + }; + A6FAC320A6FA669000000001 /* LICENSE */ = { + isa = PBXGroup; + children = ( + A6FA8160A6FAB53000000001 /* LICENSE.txt */, + ); + name = LICENSE; + path = ../LICENSE; + sourceTree = ""; + }; + B7394859229F194000C47603 = { + isa = PBXGroup; + children = ( + C4E4AAA0C4E4035000000001 /* README.md */, + B7394864229F194000C47603 /* Landmarks */, + B7394863229F194000C47603 /* Products */, + A6DAF630A6DAF5F000000001 /* Configuration */, + A6FAC320A6FA669000000001 /* LICENSE */, + ); + sourceTree = ""; + }; + B7394863229F194000C47603 /* Products */ = { + isa = PBXGroup; + children = ( + B7394862229F194000C47603 /* Landmarks.app */, + ); + name = Products; + sourceTree = ""; + }; + B7394864229F194000C47603 /* Landmarks */ = { + isa = PBXGroup; + children = ( + B739487E229F282200C47603 /* Models */, + B7394865229F194000C47603 /* AppDelegate.swift */, + B7394867229F194000C47603 /* SceneDelegate.swift */, + B7D587D122A0892C006E8DCF /* Home.swift */, + B7D587D322A08965006E8DCF /* CategoryRow.swift */, + B73948A0229F2E1F00C47603 /* LandmarkList.swift */, + B739489E229F2D9700C47603 /* LandmarkRow.swift */, + B7394869229F194000C47603 /* LandmarkDetail.swift */, + B7D587B5229F825D006E8DCF /* HikeView.swift */, + B7D587BB229F82EB006E8DCF /* HikeDetail.swift */, + B7310DD0229F6839001079B9 /* HexagonParameters.swift */, + B739487D229F1C0100C47603 /* Supporting Views */, + B7394883229F291A00C47603 /* Resources */, + B739486B229F194200C47603 /* Assets.xcassets */, + B7394870229F194200C47603 /* LaunchScreen.storyboard */, + B7394873229F194200C47603 /* Info.plist */, + B739486D229F194200C47603 /* Preview Content */, + ); + path = Landmarks; + sourceTree = ""; + }; + B739486D229F194200C47603 /* Preview Content */ = { + isa = PBXGroup; + children = ( + B739486E229F194200C47603 /* Preview Assets.xcassets */, + ); + path = "Preview Content"; + sourceTree = ""; + }; + B739487D229F1C0100C47603 /* Supporting Views */ = { + isa = PBXGroup; + children = ( + B7394879229F1B3F00C47603 /* CircleImage.swift */, + B739487B229F1B6800C47603 /* MapView.swift */, + B7310DD2229F6CA9001079B9 /* Badge.swift */, + B7D587AF229F73C1006E8DCF /* BadgeSymbol.swift */, + B7D587B1229F7406006E8DCF /* RotatedBadgeSymbol.swift */, + B7D587AD229F7382006E8DCF /* BadgeBackground.swift */, + B7D587BD229F82FF006E8DCF /* HikeGraph.swift */, + B7D587B7229F826D006E8DCF /* GraphCapsule.swift */, + ); + path = "Supporting Views"; + sourceTree = ""; + }; + B739487E229F282200C47603 /* Models */ = { + isa = PBXGroup; + children = ( + B7D587D522A08C97006E8DCF /* Profile.swift */, + B7394880229F28B900C47603 /* Data.swift */, + B739487F229F28B900C47603 /* Landmark.swift */, + B7D587B9229F8288006E8DCF /* Hike.swift */, + B7D2AAC4229F4D7C0061E5F5 /* UserData.swift */, + ); + path = Models; + sourceTree = ""; + }; + B7394883229F291A00C47603 /* Resources */ = { + isa = PBXGroup; + children = ( + B739488E229F292E00C47603 /* landmarkData.json */, + B7D587BF229F830B006E8DCF /* hikeData.json */, + B7394890229F292F00C47603 /* chilkoottrail.jpg */, + B739488F229F292F00C47603 /* chincoteague.jpg */, + B739488A229F292E00C47603 /* hiddenlake.jpg */, + B7394886229F292E00C47603 /* icybay.jpg */, + B7394887229F292E00C47603 /* lakemcdonald.jpg */, + B7394884229F292D00C47603 /* rainbowlake.jpg */, + B739488D229F292E00C47603 /* silversalmoncreek.jpg */, + B739488B229F292E00C47603 /* stmarylake.jpg */, + B7394888229F292E00C47603 /* turtlerock.jpg */, + B739488C229F292E00C47603 /* twinlake.jpg */, + B7394889229F292E00C47603 /* umbagog.jpg */, + B73948A2229F3E2200C47603 /* charleyrivers.jpg */, + ); + path = Resources; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + B7394861229F194000C47603 /* Landmarks */ = { + isa = PBXNativeTarget; + buildConfigurationList = B7394876229F194200C47603 /* Build configuration list for PBXNativeTarget "Landmarks" */; + buildPhases = ( + B739485E229F194000C47603 /* Sources */, + B739485F229F194000C47603 /* Frameworks */, + B7394860229F194000C47603 /* Resources */, + C602AC70C605937000000001, + ); + buildRules = ( + ); + dependencies = ( + ); + name = Landmarks; + productName = Landmarks; + productReference = B7394862229F194000C47603 /* Landmarks.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + B739485A229F194000C47603 /* Project object */ = { + isa = PBXProject; + attributes = { + LastSwiftUpdateCheck = 1100; + LastUpgradeCheck = 1100; + ORGANIZATIONNAME = Apple; + TargetAttributes = { + B7394861229F194000C47603 = { + CreatedOnToolsVersion = 11.0; + }; + }; + }; + buildConfigurationList = B739485D229F194000C47603 /* Build configuration list for PBXProject "WorkingWithUIControls" */; + compatibilityVersion = "Xcode 9.3"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = B7394859229F194000C47603; + productRefGroup = B7394863229F194000C47603 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + B7394861229F194000C47603 /* Landmarks */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + B7394860229F194000C47603 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + B739489A229F292F00C47603 /* silversalmoncreek.jpg in Resources */, + B7394894229F292F00C47603 /* lakemcdonald.jpg in Resources */, + B7D587C0229F830B006E8DCF /* hikeData.json in Resources */, + B7394872229F194200C47603 /* LaunchScreen.storyboard in Resources */, + B73948A3229F3E2200C47603 /* charleyrivers.jpg in Resources */, + B7394891229F292F00C47603 /* rainbowlake.jpg in Resources */, + B739486F229F194200C47603 /* Preview Assets.xcassets in Resources */, + B7394895229F292F00C47603 /* turtlerock.jpg in Resources */, + B739486C229F194200C47603 /* Assets.xcassets in Resources */, + B7394899229F292F00C47603 /* twinlake.jpg in Resources */, + B7394896229F292F00C47603 /* umbagog.jpg in Resources */, + B739489D229F292F00C47603 /* chilkoottrail.jpg in Resources */, + B739489C229F292F00C47603 /* chincoteague.jpg in Resources */, + B739489B229F292F00C47603 /* landmarkData.json in Resources */, + B7394893229F292F00C47603 /* icybay.jpg in Resources */, + B7394897229F292F00C47603 /* hiddenlake.jpg in Resources */, + B7394898229F292F00C47603 /* stmarylake.jpg in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + B739485E229F194000C47603 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + B7394882229F28B900C47603 /* Data.swift in Sources */, + B7310DD3229F6CA9001079B9 /* Badge.swift in Sources */, + B7394866229F194000C47603 /* AppDelegate.swift in Sources */, + B7D587D622A08C97006E8DCF /* Profile.swift in Sources */, + B7D587B8229F826D006E8DCF /* GraphCapsule.swift in Sources */, + B7D587D422A08965006E8DCF /* CategoryRow.swift in Sources */, + B739487A229F1B3F00C47603 /* CircleImage.swift in Sources */, + B739487C229F1B6800C47603 /* MapView.swift in Sources */, + B7D587BA229F8288006E8DCF /* Hike.swift in Sources */, + B7D587BC229F82EB006E8DCF /* HikeDetail.swift in Sources */, + B7D587B6229F825D006E8DCF /* HikeView.swift in Sources */, + B7310DD1229F6839001079B9 /* HexagonParameters.swift in Sources */, + B73948A1229F2E1F00C47603 /* LandmarkList.swift in Sources */, + B7D587B0229F73C1006E8DCF /* BadgeSymbol.swift in Sources */, + B7D587B2229F7406006E8DCF /* RotatedBadgeSymbol.swift in Sources */, + B7D587D222A0892C006E8DCF /* Home.swift in Sources */, + B7D587BE229F82FF006E8DCF /* HikeGraph.swift in Sources */, + B7394868229F194000C47603 /* SceneDelegate.swift in Sources */, + B7D587AE229F7382006E8DCF /* BadgeBackground.swift in Sources */, + B739486A229F194000C47603 /* LandmarkDetail.swift in Sources */, + B739489F229F2D9700C47603 /* LandmarkRow.swift in Sources */, + B7D2AAC5229F4D7C0061E5F5 /* UserData.swift in Sources */, + B7394881229F28B900C47603 /* Landmark.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXVariantGroup section */ + B7394870229F194200C47603 /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + B7394871229F194200C47603 /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + B7394874229F194200C47603 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = A6DAFAD0A6DAE9D000000001 /* SampleCode.xcconfig */; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 13.0; + MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; + MTL_FAST_MATH = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + }; + name = Debug; + }; + B7394875229F194200C47603 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = A6DAFAD0A6DAE9D000000001 /* SampleCode.xcconfig */; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 13.0; + MTL_ENABLE_DEBUG_INFO = NO; + MTL_FAST_MATH = YES; + SDKROOT = iphoneos; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + B7394877229F194200C47603 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = A6DAFAD0A6DAE9D000000001 /* SampleCode.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_ASSET_PATHS = "Landmarks/Preview\\ Content"; + DEVELOPMENT_TEAM = ""; + ENABLE_PREVIEWS = YES; + INFOPLIST_FILE = Landmarks/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = "com.example.apple-samplecode.Landmarks${SAMPLE_CODE_DISAMBIGUATOR}"; + PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE_SPECIFIER = ""; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + B7394878229F194200C47603 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = A6DAFAD0A6DAE9D000000001 /* SampleCode.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_ASSET_PATHS = "Landmarks/Preview\\ Content"; + DEVELOPMENT_TEAM = ""; + ENABLE_PREVIEWS = YES; + INFOPLIST_FILE = Landmarks/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = "com.example.apple-samplecode.Landmarks${SAMPLE_CODE_DISAMBIGUATOR}"; + PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE_SPECIFIER = ""; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + B739485D229F194000C47603 /* Build configuration list for PBXProject "WorkingWithUIControls" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + B7394874229F194200C47603 /* Debug */, + B7394875229F194200C47603 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + B7394876229F194200C47603 /* Build configuration list for PBXNativeTarget "Landmarks" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + B7394877229F194200C47603 /* Debug */, + B7394878229F194200C47603 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = B739485A229F194000C47603 /* Project object */; +} diff --git a/Examples/WorkingWithUIControls/StartingPoint/Landmarks/WorkingWithUIControls.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/Examples/WorkingWithUIControls/StartingPoint/Landmarks/WorkingWithUIControls.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings new file mode 100755 index 0000000..3ddf867 --- /dev/null +++ b/Examples/WorkingWithUIControls/StartingPoint/Landmarks/WorkingWithUIControls.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings @@ -0,0 +1,8 @@ + + + + + BuildSystemType + Latest + + diff --git a/Examples/WorkingWithUIControls/StartingPoint/README.md b/Examples/WorkingWithUIControls/StartingPoint/README.md new file mode 100755 index 0000000..3314238 --- /dev/null +++ b/Examples/WorkingWithUIControls/StartingPoint/README.md @@ -0,0 +1,3 @@ +# Working with UI Controls + +Use this project to code along with the [Working with UI Controls](https://developer.apple.com/tutorials/swiftui/working-with-ui-controls) tutorial. \ No newline at end of file diff --git a/README.md b/README.md index fee4690..80e0f54 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,67 @@ -# SwiftUI Projects +# SwiftUI Examples Projects + +I add projects that use `SwiftUI`. If you have project, make a pull request. ## Navigate -- [1](#1) -- [1](#1) -- [1](#1) -- [1](#1) +- [Creating And Combining Views](#1) +- [Building Lists And Navigation](#1) +- [Handling User Input](#1) +- [Composing Complex Interfaces](#1) +- [Working With UIControls](#1) +- [Example To-Do App](#1) +- [Combine using GitHub API](#1) +- [Interfacing With UIKit](#1) +- [Drawing and Animation](#1) + - [Drawing Paths And Shapes](#1) + - [Animating Views And Transitions](#1) ## Projects +#### Creating And Combining Views + + + +#### Building Lists And Navigation + + + +#### Handling User Input + + + +#### Composing Complex Interfaces + + + +#### Working With UIControls + + + + +#### Example To-Do App + + + +#### Combine using GitHub API + + + +#### Interfacing With UIKit + + + +#### GitHub Search + + + +## Drawing and Animation + +#### Drawing Paths And Shapes + + + +#### Animating Views And Transitions + + diff --git a/Resources/AnimatingViewsAndTransitions.png b/Resources/AnimatingViewsAndTransitions.png new file mode 100755 index 0000000..4561dfd Binary files /dev/null and b/Resources/AnimatingViewsAndTransitions.png differ diff --git a/Resources/BuildingListsAndNavigation.png b/Resources/BuildingListsAndNavigation.png new file mode 100755 index 0000000..14604c5 Binary files /dev/null and b/Resources/BuildingListsAndNavigation.png differ diff --git a/Resources/CombineUsingGitHubAPI.png b/Resources/CombineUsingGitHubAPI.png new file mode 100644 index 0000000..278656c Binary files /dev/null and b/Resources/CombineUsingGitHubAPI.png differ diff --git a/Resources/ComposingComplexInterfaces.png b/Resources/ComposingComplexInterfaces.png new file mode 100755 index 0000000..32b636f Binary files /dev/null and b/Resources/ComposingComplexInterfaces.png differ diff --git a/Resources/CreatingAndCombiningViews.png b/Resources/CreatingAndCombiningViews.png new file mode 100755 index 0000000..f8692a4 Binary files /dev/null and b/Resources/CreatingAndCombiningViews.png differ diff --git a/Resources/DrawingPathsAndShapes.png b/Resources/DrawingPathsAndShapes.png new file mode 100755 index 0000000..807bab5 Binary files /dev/null and b/Resources/DrawingPathsAndShapes.png differ diff --git a/Resources/ExampleToDoApp.png b/Resources/ExampleToDoApp.png new file mode 100644 index 0000000..a12ed1b Binary files /dev/null and b/Resources/ExampleToDoApp.png differ diff --git a/Resources/GitHubSearch.png b/Resources/GitHubSearch.png new file mode 100644 index 0000000..8245ece Binary files /dev/null and b/Resources/GitHubSearch.png differ diff --git a/Resources/HandlingUserInput.png b/Resources/HandlingUserInput.png new file mode 100755 index 0000000..09fe868 Binary files /dev/null and b/Resources/HandlingUserInput.png differ diff --git a/Resources/InterfacingWithUIKit.png b/Resources/InterfacingWithUIKit.png new file mode 100755 index 0000000..580bc25 Binary files /dev/null and b/Resources/InterfacingWithUIKit.png differ diff --git a/Resources/WorkingWithUIControls.png b/Resources/WorkingWithUIControls.png new file mode 100755 index 0000000..e9bc64f Binary files /dev/null and b/Resources/WorkingWithUIControls.png differ diff --git a/Resources/WorkingWithUIControls2.png b/Resources/WorkingWithUIControls2.png new file mode 100755 index 0000000..30b3b79 Binary files /dev/null and b/Resources/WorkingWithUIControls2.png differ