├── .gitignore ├── .travis.yml ├── Example ├── Podfile ├── Podfile.lock ├── Pods │ ├── Headers │ │ └── Public │ │ │ └── SpriteKitAutoLayout │ │ │ ├── NSLayoutConstraint+SKAL.h │ │ │ ├── SKALUtils.h │ │ │ ├── SKNode+SKAL.h │ │ │ ├── SKView+SKAL.h │ │ │ └── SpriteKitAutoLayout.h │ ├── Local Podspecs │ │ └── SpriteKitAutoLayout.podspec │ ├── Manifest.lock │ ├── Pods.xcodeproj │ │ └── project.pbxproj │ └── Target Support Files │ │ ├── Pods-SpriteKitAutoLayout-SpriteKitAutoLayout │ │ ├── Pods-SpriteKitAutoLayout-SpriteKitAutoLayout-Private.xcconfig │ │ ├── Pods-SpriteKitAutoLayout-SpriteKitAutoLayout-dummy.m │ │ ├── Pods-SpriteKitAutoLayout-SpriteKitAutoLayout-prefix.pch │ │ └── Pods-SpriteKitAutoLayout-SpriteKitAutoLayout.xcconfig │ │ ├── Pods-SpriteKitAutoLayout │ │ ├── Pods-SpriteKitAutoLayout-acknowledgements.markdown │ │ ├── Pods-SpriteKitAutoLayout-acknowledgements.plist │ │ ├── Pods-SpriteKitAutoLayout-dummy.m │ │ ├── Pods-SpriteKitAutoLayout-environment.h │ │ ├── Pods-SpriteKitAutoLayout-resources.sh │ │ ├── Pods-SpriteKitAutoLayout.debug.xcconfig │ │ └── Pods-SpriteKitAutoLayout.release.xcconfig │ │ ├── Pods-SpriteKitAutoLayoutOSX-SpriteKitAutoLayout │ │ ├── Pods-SpriteKitAutoLayoutOSX-SpriteKitAutoLayout-Private.xcconfig │ │ ├── Pods-SpriteKitAutoLayoutOSX-SpriteKitAutoLayout-dummy.m │ │ ├── Pods-SpriteKitAutoLayoutOSX-SpriteKitAutoLayout-prefix.pch │ │ └── Pods-SpriteKitAutoLayoutOSX-SpriteKitAutoLayout.xcconfig │ │ ├── Pods-SpriteKitAutoLayoutOSX │ │ ├── Pods-SpriteKitAutoLayoutOSX-acknowledgements.markdown │ │ ├── Pods-SpriteKitAutoLayoutOSX-acknowledgements.plist │ │ ├── Pods-SpriteKitAutoLayoutOSX-dummy.m │ │ ├── Pods-SpriteKitAutoLayoutOSX-environment.h │ │ ├── Pods-SpriteKitAutoLayoutOSX-resources.sh │ │ ├── Pods-SpriteKitAutoLayoutOSX.debug.xcconfig │ │ └── Pods-SpriteKitAutoLayoutOSX.release.xcconfig │ │ ├── Pods-Tests-SpriteKitAutoLayout │ │ ├── Pods-Tests-SpriteKitAutoLayout-Private.xcconfig │ │ ├── Pods-Tests-SpriteKitAutoLayout-dummy.m │ │ ├── Pods-Tests-SpriteKitAutoLayout-prefix.pch │ │ └── Pods-Tests-SpriteKitAutoLayout.xcconfig │ │ └── Pods-Tests │ │ ├── Pods-Tests-acknowledgements.markdown │ │ ├── Pods-Tests-acknowledgements.plist │ │ ├── Pods-Tests-dummy.m │ │ ├── Pods-Tests-environment.h │ │ ├── Pods-Tests-resources.sh │ │ ├── Pods-Tests.debug.xcconfig │ │ └── Pods-Tests.release.xcconfig ├── Shared │ ├── CommonScene.swift │ ├── DemoScene1.swift │ ├── DemoScene2.swift │ ├── DemoScene3.swift │ ├── Images.xcassets │ │ └── back.imageset │ │ │ ├── Contents.json │ │ │ └── back.pdf │ └── MainScene.swift ├── SpriteKitAutoLayout.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ └── contents.xcworkspacedata │ └── xcshareddata │ │ └── xcschemes │ │ ├── SpriteKitAutoLayoutOSX.xcscheme │ │ └── SpriteKitAutoLayoutiOS.xcscheme ├── SpriteKitAutoLayout.xcworkspace │ └── contents.xcworkspacedata ├── SpriteKitAutoLayout │ ├── Images.xcassets │ │ ├── AppIcon.appiconset │ │ │ └── Contents.json │ │ └── LaunchImage.launchimage │ │ │ └── Contents.json │ ├── SKALAppDelegate.h │ ├── SKALAppDelegate.m │ ├── SKALViewController.h │ ├── SKALViewController.m │ ├── SpriteKitAutoLayout-Bridging-Header.h │ ├── SpriteKitAutoLayout-Info.plist │ ├── SpriteKitAutoLayout-Prefix.pch │ ├── en.lproj │ │ └── InfoPlist.strings │ └── main.m ├── SpriteKitAutoLayoutOSX │ ├── AppDelegate.h │ ├── AppDelegate.m │ ├── Base.lproj │ │ └── MainMenu.xib │ ├── FlippedSKView.h │ ├── FlippedSKView.m │ ├── Images.xcassets │ │ ├── AppIcon.appiconset │ │ │ └── Contents.json │ │ └── Spaceship.imageset │ │ │ ├── Contents.json │ │ │ └── Spaceship.png │ ├── Info.plist │ ├── SpriteKitAutoLayoutOSX-Bridging-Header.h │ └── main.m └── Tests │ ├── Tests-Bridging-Header.h │ ├── Tests-Info.plist │ ├── Tests-Prefix.pch │ ├── Tests.m │ ├── Tests.swift │ └── en.lproj │ └── InfoPlist.strings ├── LICENSE ├── Pod ├── Assets │ └── .gitkeep └── Classes │ ├── .gitkeep │ ├── NSLayoutConstraint+SKAL.h │ ├── NSLayoutConstraint+SKAL.m │ ├── SKALPlatformView+SKALInternal.h │ ├── SKALPlatformView+SKALInternal.m │ ├── SKALUtils.h │ ├── SKALUtils.m │ ├── SKNode+SKAL.h │ ├── SKNode+SKAL.m │ ├── SKNode+SKALInternal.h │ ├── SKNode+SKALInternal.m │ ├── SKView+SKAL.h │ ├── SKView+SKAL.m │ └── SpriteKitAutoLayout.h ├── README.md └── SpriteKitAutoLayout.podspec /.gitignore: -------------------------------------------------------------------------------- 1 | # OS X 2 | .DS_Store 3 | 4 | # Xcode 5 | build/ 6 | *.pbxuser 7 | !default.pbxuser 8 | *.mode1v3 9 | !default.mode1v3 10 | *.mode2v3 11 | !default.mode2v3 12 | *.perspectivev3 13 | !default.perspectivev3 14 | xcuserdata 15 | *.xccheckout 16 | profile 17 | *.moved-aside 18 | DerivedData 19 | *.hmap 20 | *.ipa 21 | 22 | # Bundler 23 | .bundle 24 | 25 | # We recommend against adding the Pods directory to your .gitignore. However 26 | # you should judge for yourself, the pros and cons are mentioned at: 27 | # http://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control 28 | # 29 | # Note: if you ignore the Pods directory, make sure to uncomment 30 | # `pod install` in .travis.yml 31 | # 32 | # Pods/ 33 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | # references: 2 | # * http://www.objc.io/issue-6/travis-ci.html 3 | # * https://github.com/supermarin/xcpretty#usage 4 | 5 | language: objective-c 6 | # cache: cocoapods 7 | # podfile: Example/Podfile 8 | # before_install: cd Example && pod install && cd - 9 | install: 10 | - gem install xcpretty --no-rdoc --no-ri --no-document --quiet 11 | script: 12 | - set -o pipefail && xcodebuild test -workspace Example/SpriteKitAutoLayout.xcworkspace -scheme SpriteKitAutoLayoutiOS -sdk iphonesimulator ONLY_ACTIVE_ARCH=NO | xcpretty -c 13 | -------------------------------------------------------------------------------- /Example/Podfile: -------------------------------------------------------------------------------- 1 | source 'https://github.com/CocoaPods/Specs.git' 2 | 3 | target 'SpriteKitAutoLayout', :exclusive => true do 4 | platform :ios, '7.0' 5 | pod "SpriteKitAutoLayout", :path => "../" 6 | end 7 | 8 | target 'SpriteKitAutoLayoutOSX', :exclusive => true do 9 | platform :osx, '10.9' 10 | pod "SpriteKitAutoLayout", :path => "../" 11 | end 12 | 13 | target 'Tests', :exclusive => true do 14 | platform :ios, '7.0' 15 | pod "SpriteKitAutoLayout", :path => "../" 16 | end 17 | -------------------------------------------------------------------------------- /Example/Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - SpriteKitAutoLayout (0.1.0) 3 | 4 | DEPENDENCIES: 5 | - SpriteKitAutoLayout (from `../`) 6 | 7 | EXTERNAL SOURCES: 8 | SpriteKitAutoLayout: 9 | :path: ../ 10 | 11 | SPEC CHECKSUMS: 12 | SpriteKitAutoLayout: 29b4583e2d473b4fa757302966b23c05457e429c 13 | 14 | COCOAPODS: 0.35.0 15 | -------------------------------------------------------------------------------- /Example/Pods/Headers/Public/SpriteKitAutoLayout/NSLayoutConstraint+SKAL.h: -------------------------------------------------------------------------------- 1 | ../../../../../Pod/Classes/NSLayoutConstraint+SKAL.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Public/SpriteKitAutoLayout/SKALUtils.h: -------------------------------------------------------------------------------- 1 | ../../../../../Pod/Classes/SKALUtils.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Public/SpriteKitAutoLayout/SKNode+SKAL.h: -------------------------------------------------------------------------------- 1 | ../../../../../Pod/Classes/SKNode+SKAL.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Public/SpriteKitAutoLayout/SKView+SKAL.h: -------------------------------------------------------------------------------- 1 | ../../../../../Pod/Classes/SKView+SKAL.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Public/SpriteKitAutoLayout/SpriteKitAutoLayout.h: -------------------------------------------------------------------------------- 1 | ../../../../../Pod/Classes/SpriteKitAutoLayout.h -------------------------------------------------------------------------------- /Example/Pods/Local Podspecs/SpriteKitAutoLayout.podspec: -------------------------------------------------------------------------------- 1 | Pod::Spec.new do |s| 2 | s.name = "SpriteKitAutoLayout" 3 | s.version = "0.1.0" 4 | s.summary = "Auto Layout support for SpriteKit (iOS & OSX)" 5 | s.description = <<-DESC 6 | This library enables Auto Layout support for SpriteKit. 7 | Works both for iOS and OSX. 8 | 9 | * Markdown format. 10 | * Don't worry about the indent, we strip it! 11 | DESC 12 | s.homepage = "https://github.com/mgrebenets/SpriteKitAutoLayout" 13 | # s.screenshots = "www.example.com/screenshots_1", "www.example.com/screenshots_2" 14 | s.license = 'MIT' 15 | s.author = { "Maksym Grebenets" => "mgrebenets@gmail.com" } 16 | s.source = { :git => "https://github.com/mgrebenets/SpriteKitAutoLayout.git", :tag => s.version.to_s } 17 | s.social_media_url = 'https://twitter.com/mgrebenets' 18 | 19 | # all platforms, so no s.platform here 20 | s.requires_arc = true 21 | 22 | s.source_files = 'Pod/Classes' 23 | s.public_header_files = ['Pod/Classes/**/*.h'] 24 | s.private_header_files = ['Pod/Classes/**/*Internal*.h'] 25 | s.frameworks = 'SpriteKit' 26 | #s.xcconfig = { 'GCC_PREPROCESSOR_DEFINITIONS[config=Debug]' => '$(inherited) SKAL_DEBUG=1' } 27 | end 28 | -------------------------------------------------------------------------------- /Example/Pods/Manifest.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - SpriteKitAutoLayout (0.1.0) 3 | 4 | DEPENDENCIES: 5 | - SpriteKitAutoLayout (from `../`) 6 | 7 | EXTERNAL SOURCES: 8 | SpriteKitAutoLayout: 9 | :path: ../ 10 | 11 | SPEC CHECKSUMS: 12 | SpriteKitAutoLayout: 29b4583e2d473b4fa757302966b23c05457e429c 13 | 14 | COCOAPODS: 0.35.0 15 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-SpriteKitAutoLayout-SpriteKitAutoLayout/Pods-SpriteKitAutoLayout-SpriteKitAutoLayout-Private.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Pods-SpriteKitAutoLayout-SpriteKitAutoLayout.xcconfig" 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Build" "${PODS_ROOT}/Headers/Build/SpriteKitAutoLayout" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/SpriteKitAutoLayout" 4 | OTHER_LDFLAGS = ${PODS_SPRITEKITAUTOLAYOUT_SPRITEKITAUTOLAYOUT_OTHER_LDFLAGS} -ObjC 5 | PODS_ROOT = ${SRCROOT} -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-SpriteKitAutoLayout-SpriteKitAutoLayout/Pods-SpriteKitAutoLayout-SpriteKitAutoLayout-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_SpriteKitAutoLayout_SpriteKitAutoLayout : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_SpriteKitAutoLayout_SpriteKitAutoLayout 5 | @end 6 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-SpriteKitAutoLayout-SpriteKitAutoLayout/Pods-SpriteKitAutoLayout-SpriteKitAutoLayout-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #endif 4 | 5 | #import "Pods-SpriteKitAutoLayout-environment.h" 6 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-SpriteKitAutoLayout-SpriteKitAutoLayout/Pods-SpriteKitAutoLayout-SpriteKitAutoLayout.xcconfig: -------------------------------------------------------------------------------- 1 | PODS_SPRITEKITAUTOLAYOUT_SPRITEKITAUTOLAYOUT_OTHER_LDFLAGS = -framework "SpriteKit" -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-SpriteKitAutoLayout/Pods-SpriteKitAutoLayout-acknowledgements.markdown: -------------------------------------------------------------------------------- 1 | # Acknowledgements 2 | This application makes use of the following third party libraries: 3 | 4 | ## SpriteKitAutoLayout 5 | 6 | Copyright (c) 2014 Maksym Grebenets 7 | 8 | Permission is hereby granted, free of charge, to any person obtaining a copy 9 | of this software and associated documentation files (the "Software"), to deal 10 | in the Software without restriction, including without limitation the rights 11 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | copies of the Software, and to permit persons to whom the Software is 13 | furnished to do so, subject to the following conditions: 14 | 15 | The above copyright notice and this permission notice shall be included in 16 | all copies or substantial portions of the Software. 17 | 18 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | THE SOFTWARE. 25 | 26 | Generated by CocoaPods - http://cocoapods.org 27 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-SpriteKitAutoLayout/Pods-SpriteKitAutoLayout-acknowledgements.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreferenceSpecifiers 6 | 7 | 8 | FooterText 9 | This application makes use of the following third party libraries: 10 | Title 11 | Acknowledgements 12 | Type 13 | PSGroupSpecifier 14 | 15 | 16 | FooterText 17 | Copyright (c) 2014 Maksym Grebenets <mgrebenets@gmail.com> 18 | 19 | Permission is hereby granted, free of charge, to any person obtaining a copy 20 | of this software and associated documentation files (the "Software"), to deal 21 | in the Software without restriction, including without limitation the rights 22 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 23 | copies of the Software, and to permit persons to whom the Software is 24 | furnished to do so, subject to the following conditions: 25 | 26 | The above copyright notice and this permission notice shall be included in 27 | all copies or substantial portions of the Software. 28 | 29 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 30 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 31 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 32 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 33 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 34 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 35 | THE SOFTWARE. 36 | 37 | Title 38 | SpriteKitAutoLayout 39 | Type 40 | PSGroupSpecifier 41 | 42 | 43 | FooterText 44 | Generated by CocoaPods - http://cocoapods.org 45 | Title 46 | 47 | Type 48 | PSGroupSpecifier 49 | 50 | 51 | StringsTable 52 | Acknowledgements 53 | Title 54 | Acknowledgements 55 | 56 | 57 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-SpriteKitAutoLayout/Pods-SpriteKitAutoLayout-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_SpriteKitAutoLayout : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_SpriteKitAutoLayout 5 | @end 6 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-SpriteKitAutoLayout/Pods-SpriteKitAutoLayout-environment.h: -------------------------------------------------------------------------------- 1 | 2 | // To check if a library is compiled with CocoaPods you 3 | // can use the `COCOAPODS` macro definition which is 4 | // defined in the xcconfigs so it is available in 5 | // headers also when they are imported in the client 6 | // project. 7 | 8 | 9 | // SpriteKitAutoLayout 10 | #define COCOAPODS_POD_AVAILABLE_SpriteKitAutoLayout 11 | #define COCOAPODS_VERSION_MAJOR_SpriteKitAutoLayout 0 12 | #define COCOAPODS_VERSION_MINOR_SpriteKitAutoLayout 1 13 | #define COCOAPODS_VERSION_PATCH_SpriteKitAutoLayout 0 14 | 15 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-SpriteKitAutoLayout/Pods-SpriteKitAutoLayout-resources.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | mkdir -p "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 5 | 6 | RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt 7 | > "$RESOURCES_TO_COPY" 8 | 9 | install_resource() 10 | { 11 | case $1 in 12 | *.storyboard) 13 | echo "ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile ${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .storyboard`.storyboardc ${PODS_ROOT}/$1 --sdk ${SDKROOT}" 14 | ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .storyboard`.storyboardc" "${PODS_ROOT}/$1" --sdk "${SDKROOT}" 15 | ;; 16 | *.xib) 17 | echo "ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile ${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .xib`.nib ${PODS_ROOT}/$1 --sdk ${SDKROOT}" 18 | ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .xib`.nib" "${PODS_ROOT}/$1" --sdk "${SDKROOT}" 19 | ;; 20 | *.framework) 21 | echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 22 | mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 23 | echo "rsync -av ${PODS_ROOT}/$1 ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 24 | rsync -av "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 25 | ;; 26 | *.xcdatamodel) 27 | echo "xcrun momc \"${PODS_ROOT}/$1\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1"`.mom\"" 28 | xcrun momc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodel`.mom" 29 | ;; 30 | *.xcdatamodeld) 31 | echo "xcrun momc \"${PODS_ROOT}/$1\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodeld`.momd\"" 32 | xcrun momc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodeld`.momd" 33 | ;; 34 | *.xcmappingmodel) 35 | echo "xcrun mapc \"${PODS_ROOT}/$1\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcmappingmodel`.cdm\"" 36 | xcrun mapc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcmappingmodel`.cdm" 37 | ;; 38 | *.xcassets) 39 | ;; 40 | /*) 41 | echo "$1" 42 | echo "$1" >> "$RESOURCES_TO_COPY" 43 | ;; 44 | *) 45 | echo "${PODS_ROOT}/$1" 46 | echo "${PODS_ROOT}/$1" >> "$RESOURCES_TO_COPY" 47 | ;; 48 | esac 49 | } 50 | 51 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 52 | if [[ "${ACTION}" == "install" ]]; then 53 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 54 | fi 55 | rm -f "$RESOURCES_TO_COPY" 56 | 57 | if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ `find . -name '*.xcassets' | wc -l` -ne 0 ] 58 | then 59 | case "${TARGETED_DEVICE_FAMILY}" in 60 | 1,2) 61 | TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone" 62 | ;; 63 | 1) 64 | TARGET_DEVICE_ARGS="--target-device iphone" 65 | ;; 66 | 2) 67 | TARGET_DEVICE_ARGS="--target-device ipad" 68 | ;; 69 | *) 70 | TARGET_DEVICE_ARGS="--target-device mac" 71 | ;; 72 | esac 73 | find "${PWD}" -name "*.xcassets" -print0 | xargs -0 actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${IPHONEOS_DEPLOYMENT_TARGET}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 74 | fi 75 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-SpriteKitAutoLayout/Pods-SpriteKitAutoLayout.debug.xcconfig: -------------------------------------------------------------------------------- 1 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 2 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/SpriteKitAutoLayout" 3 | OTHER_CFLAGS = $(inherited) -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/SpriteKitAutoLayout" 4 | OTHER_LDFLAGS = -ObjC -l"Pods-SpriteKitAutoLayout-SpriteKitAutoLayout" -framework "SpriteKit" 5 | OTHER_LIBTOOLFLAGS = $(OTHER_LDFLAGS) 6 | PODS_ROOT = ${SRCROOT}/Pods -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-SpriteKitAutoLayout/Pods-SpriteKitAutoLayout.release.xcconfig: -------------------------------------------------------------------------------- 1 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 2 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/SpriteKitAutoLayout" 3 | OTHER_CFLAGS = $(inherited) -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/SpriteKitAutoLayout" 4 | OTHER_LDFLAGS = -ObjC -l"Pods-SpriteKitAutoLayout-SpriteKitAutoLayout" -framework "SpriteKit" 5 | OTHER_LIBTOOLFLAGS = $(OTHER_LDFLAGS) 6 | PODS_ROOT = ${SRCROOT}/Pods -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-SpriteKitAutoLayoutOSX-SpriteKitAutoLayout/Pods-SpriteKitAutoLayoutOSX-SpriteKitAutoLayout-Private.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Pods-SpriteKitAutoLayoutOSX-SpriteKitAutoLayout.xcconfig" 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Build" "${PODS_ROOT}/Headers/Build/SpriteKitAutoLayout" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/SpriteKitAutoLayout" 4 | OTHER_LDFLAGS = ${PODS_SPRITEKITAUTOLAYOUTOSX_SPRITEKITAUTOLAYOUT_OTHER_LDFLAGS} -ObjC 5 | PODS_ROOT = ${SRCROOT} -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-SpriteKitAutoLayoutOSX-SpriteKitAutoLayout/Pods-SpriteKitAutoLayoutOSX-SpriteKitAutoLayout-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_SpriteKitAutoLayoutOSX_SpriteKitAutoLayout : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_SpriteKitAutoLayoutOSX_SpriteKitAutoLayout 5 | @end 6 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-SpriteKitAutoLayoutOSX-SpriteKitAutoLayout/Pods-SpriteKitAutoLayoutOSX-SpriteKitAutoLayout-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #endif 4 | 5 | #import "Pods-SpriteKitAutoLayoutOSX-environment.h" 6 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-SpriteKitAutoLayoutOSX-SpriteKitAutoLayout/Pods-SpriteKitAutoLayoutOSX-SpriteKitAutoLayout.xcconfig: -------------------------------------------------------------------------------- 1 | PODS_SPRITEKITAUTOLAYOUTOSX_SPRITEKITAUTOLAYOUT_OTHER_LDFLAGS = -framework "SpriteKit" -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-SpriteKitAutoLayoutOSX/Pods-SpriteKitAutoLayoutOSX-acknowledgements.markdown: -------------------------------------------------------------------------------- 1 | # Acknowledgements 2 | This application makes use of the following third party libraries: 3 | 4 | ## SpriteKitAutoLayout 5 | 6 | Copyright (c) 2014 Maksym Grebenets 7 | 8 | Permission is hereby granted, free of charge, to any person obtaining a copy 9 | of this software and associated documentation files (the "Software"), to deal 10 | in the Software without restriction, including without limitation the rights 11 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | copies of the Software, and to permit persons to whom the Software is 13 | furnished to do so, subject to the following conditions: 14 | 15 | The above copyright notice and this permission notice shall be included in 16 | all copies or substantial portions of the Software. 17 | 18 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | THE SOFTWARE. 25 | 26 | Generated by CocoaPods - http://cocoapods.org 27 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-SpriteKitAutoLayoutOSX/Pods-SpriteKitAutoLayoutOSX-acknowledgements.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreferenceSpecifiers 6 | 7 | 8 | FooterText 9 | This application makes use of the following third party libraries: 10 | Title 11 | Acknowledgements 12 | Type 13 | PSGroupSpecifier 14 | 15 | 16 | FooterText 17 | Copyright (c) 2014 Maksym Grebenets <mgrebenets@gmail.com> 18 | 19 | Permission is hereby granted, free of charge, to any person obtaining a copy 20 | of this software and associated documentation files (the "Software"), to deal 21 | in the Software without restriction, including without limitation the rights 22 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 23 | copies of the Software, and to permit persons to whom the Software is 24 | furnished to do so, subject to the following conditions: 25 | 26 | The above copyright notice and this permission notice shall be included in 27 | all copies or substantial portions of the Software. 28 | 29 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 30 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 31 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 32 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 33 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 34 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 35 | THE SOFTWARE. 36 | 37 | Title 38 | SpriteKitAutoLayout 39 | Type 40 | PSGroupSpecifier 41 | 42 | 43 | FooterText 44 | Generated by CocoaPods - http://cocoapods.org 45 | Title 46 | 47 | Type 48 | PSGroupSpecifier 49 | 50 | 51 | StringsTable 52 | Acknowledgements 53 | Title 54 | Acknowledgements 55 | 56 | 57 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-SpriteKitAutoLayoutOSX/Pods-SpriteKitAutoLayoutOSX-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_SpriteKitAutoLayoutOSX : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_SpriteKitAutoLayoutOSX 5 | @end 6 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-SpriteKitAutoLayoutOSX/Pods-SpriteKitAutoLayoutOSX-environment.h: -------------------------------------------------------------------------------- 1 | 2 | // To check if a library is compiled with CocoaPods you 3 | // can use the `COCOAPODS` macro definition which is 4 | // defined in the xcconfigs so it is available in 5 | // headers also when they are imported in the client 6 | // project. 7 | 8 | 9 | // SpriteKitAutoLayout 10 | #define COCOAPODS_POD_AVAILABLE_SpriteKitAutoLayout 11 | #define COCOAPODS_VERSION_MAJOR_SpriteKitAutoLayout 0 12 | #define COCOAPODS_VERSION_MINOR_SpriteKitAutoLayout 1 13 | #define COCOAPODS_VERSION_PATCH_SpriteKitAutoLayout 0 14 | 15 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-SpriteKitAutoLayoutOSX/Pods-SpriteKitAutoLayoutOSX-resources.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | mkdir -p "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 5 | 6 | RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt 7 | > "$RESOURCES_TO_COPY" 8 | 9 | install_resource() 10 | { 11 | case $1 in 12 | *.storyboard) 13 | echo "ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile ${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .storyboard`.storyboardc ${PODS_ROOT}/$1 --sdk ${SDKROOT}" 14 | ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .storyboard`.storyboardc" "${PODS_ROOT}/$1" --sdk "${SDKROOT}" 15 | ;; 16 | *.xib) 17 | echo "ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile ${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .xib`.nib ${PODS_ROOT}/$1 --sdk ${SDKROOT}" 18 | ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .xib`.nib" "${PODS_ROOT}/$1" --sdk "${SDKROOT}" 19 | ;; 20 | *.framework) 21 | echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 22 | mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 23 | echo "rsync -av ${PODS_ROOT}/$1 ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 24 | rsync -av "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 25 | ;; 26 | *.xcdatamodel) 27 | echo "xcrun momc \"${PODS_ROOT}/$1\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1"`.mom\"" 28 | xcrun momc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodel`.mom" 29 | ;; 30 | *.xcdatamodeld) 31 | echo "xcrun momc \"${PODS_ROOT}/$1\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodeld`.momd\"" 32 | xcrun momc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodeld`.momd" 33 | ;; 34 | *.xcmappingmodel) 35 | echo "xcrun mapc \"${PODS_ROOT}/$1\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcmappingmodel`.cdm\"" 36 | xcrun mapc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcmappingmodel`.cdm" 37 | ;; 38 | *.xcassets) 39 | ;; 40 | /*) 41 | echo "$1" 42 | echo "$1" >> "$RESOURCES_TO_COPY" 43 | ;; 44 | *) 45 | echo "${PODS_ROOT}/$1" 46 | echo "${PODS_ROOT}/$1" >> "$RESOURCES_TO_COPY" 47 | ;; 48 | esac 49 | } 50 | 51 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 52 | if [[ "${ACTION}" == "install" ]]; then 53 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 54 | fi 55 | rm -f "$RESOURCES_TO_COPY" 56 | 57 | if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ `find . -name '*.xcassets' | wc -l` -ne 0 ] 58 | then 59 | case "${TARGETED_DEVICE_FAMILY}" in 60 | 1,2) 61 | TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone" 62 | ;; 63 | 1) 64 | TARGET_DEVICE_ARGS="--target-device iphone" 65 | ;; 66 | 2) 67 | TARGET_DEVICE_ARGS="--target-device ipad" 68 | ;; 69 | *) 70 | TARGET_DEVICE_ARGS="--target-device mac" 71 | ;; 72 | esac 73 | find "${PWD}" -name "*.xcassets" -print0 | xargs -0 actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${IPHONEOS_DEPLOYMENT_TARGET}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 74 | fi 75 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-SpriteKitAutoLayoutOSX/Pods-SpriteKitAutoLayoutOSX.debug.xcconfig: -------------------------------------------------------------------------------- 1 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 2 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/SpriteKitAutoLayout" 3 | OTHER_CFLAGS = $(inherited) -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/SpriteKitAutoLayout" 4 | OTHER_LDFLAGS = -ObjC -l"Pods-SpriteKitAutoLayoutOSX-SpriteKitAutoLayout" -framework "SpriteKit" 5 | OTHER_LIBTOOLFLAGS = $(OTHER_LDFLAGS) 6 | PODS_ROOT = ${SRCROOT}/Pods -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-SpriteKitAutoLayoutOSX/Pods-SpriteKitAutoLayoutOSX.release.xcconfig: -------------------------------------------------------------------------------- 1 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 2 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/SpriteKitAutoLayout" 3 | OTHER_CFLAGS = $(inherited) -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/SpriteKitAutoLayout" 4 | OTHER_LDFLAGS = -ObjC -l"Pods-SpriteKitAutoLayoutOSX-SpriteKitAutoLayout" -framework "SpriteKit" 5 | OTHER_LIBTOOLFLAGS = $(OTHER_LDFLAGS) 6 | PODS_ROOT = ${SRCROOT}/Pods -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-Tests-SpriteKitAutoLayout/Pods-Tests-SpriteKitAutoLayout-Private.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Pods-Tests-SpriteKitAutoLayout.xcconfig" 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Build" "${PODS_ROOT}/Headers/Build/SpriteKitAutoLayout" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/SpriteKitAutoLayout" 4 | OTHER_LDFLAGS = ${PODS_TESTS_SPRITEKITAUTOLAYOUT_OTHER_LDFLAGS} -ObjC 5 | PODS_ROOT = ${SRCROOT} -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-Tests-SpriteKitAutoLayout/Pods-Tests-SpriteKitAutoLayout-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_Tests_SpriteKitAutoLayout : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_Tests_SpriteKitAutoLayout 5 | @end 6 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-Tests-SpriteKitAutoLayout/Pods-Tests-SpriteKitAutoLayout-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #endif 4 | 5 | #import "Pods-Tests-environment.h" 6 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-Tests-SpriteKitAutoLayout/Pods-Tests-SpriteKitAutoLayout.xcconfig: -------------------------------------------------------------------------------- 1 | PODS_TESTS_SPRITEKITAUTOLAYOUT_OTHER_LDFLAGS = -framework "SpriteKit" -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-Tests/Pods-Tests-acknowledgements.markdown: -------------------------------------------------------------------------------- 1 | # Acknowledgements 2 | This application makes use of the following third party libraries: 3 | 4 | ## SpriteKitAutoLayout 5 | 6 | Copyright (c) 2014 Maksym Grebenets 7 | 8 | Permission is hereby granted, free of charge, to any person obtaining a copy 9 | of this software and associated documentation files (the "Software"), to deal 10 | in the Software without restriction, including without limitation the rights 11 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | copies of the Software, and to permit persons to whom the Software is 13 | furnished to do so, subject to the following conditions: 14 | 15 | The above copyright notice and this permission notice shall be included in 16 | all copies or substantial portions of the Software. 17 | 18 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | THE SOFTWARE. 25 | 26 | Generated by CocoaPods - http://cocoapods.org 27 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-Tests/Pods-Tests-acknowledgements.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreferenceSpecifiers 6 | 7 | 8 | FooterText 9 | This application makes use of the following third party libraries: 10 | Title 11 | Acknowledgements 12 | Type 13 | PSGroupSpecifier 14 | 15 | 16 | FooterText 17 | Copyright (c) 2014 Maksym Grebenets <mgrebenets@gmail.com> 18 | 19 | Permission is hereby granted, free of charge, to any person obtaining a copy 20 | of this software and associated documentation files (the "Software"), to deal 21 | in the Software without restriction, including without limitation the rights 22 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 23 | copies of the Software, and to permit persons to whom the Software is 24 | furnished to do so, subject to the following conditions: 25 | 26 | The above copyright notice and this permission notice shall be included in 27 | all copies or substantial portions of the Software. 28 | 29 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 30 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 31 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 32 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 33 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 34 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 35 | THE SOFTWARE. 36 | 37 | Title 38 | SpriteKitAutoLayout 39 | Type 40 | PSGroupSpecifier 41 | 42 | 43 | FooterText 44 | Generated by CocoaPods - http://cocoapods.org 45 | Title 46 | 47 | Type 48 | PSGroupSpecifier 49 | 50 | 51 | StringsTable 52 | Acknowledgements 53 | Title 54 | Acknowledgements 55 | 56 | 57 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-Tests/Pods-Tests-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_Tests : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_Tests 5 | @end 6 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-Tests/Pods-Tests-environment.h: -------------------------------------------------------------------------------- 1 | 2 | // To check if a library is compiled with CocoaPods you 3 | // can use the `COCOAPODS` macro definition which is 4 | // defined in the xcconfigs so it is available in 5 | // headers also when they are imported in the client 6 | // project. 7 | 8 | 9 | // SpriteKitAutoLayout 10 | #define COCOAPODS_POD_AVAILABLE_SpriteKitAutoLayout 11 | #define COCOAPODS_VERSION_MAJOR_SpriteKitAutoLayout 0 12 | #define COCOAPODS_VERSION_MINOR_SpriteKitAutoLayout 1 13 | #define COCOAPODS_VERSION_PATCH_SpriteKitAutoLayout 0 14 | 15 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-Tests/Pods-Tests-resources.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | mkdir -p "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 5 | 6 | RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt 7 | > "$RESOURCES_TO_COPY" 8 | 9 | install_resource() 10 | { 11 | case $1 in 12 | *.storyboard) 13 | echo "ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile ${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .storyboard`.storyboardc ${PODS_ROOT}/$1 --sdk ${SDKROOT}" 14 | ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .storyboard`.storyboardc" "${PODS_ROOT}/$1" --sdk "${SDKROOT}" 15 | ;; 16 | *.xib) 17 | echo "ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile ${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .xib`.nib ${PODS_ROOT}/$1 --sdk ${SDKROOT}" 18 | ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .xib`.nib" "${PODS_ROOT}/$1" --sdk "${SDKROOT}" 19 | ;; 20 | *.framework) 21 | echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 22 | mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 23 | echo "rsync -av ${PODS_ROOT}/$1 ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 24 | rsync -av "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 25 | ;; 26 | *.xcdatamodel) 27 | echo "xcrun momc \"${PODS_ROOT}/$1\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1"`.mom\"" 28 | xcrun momc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodel`.mom" 29 | ;; 30 | *.xcdatamodeld) 31 | echo "xcrun momc \"${PODS_ROOT}/$1\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodeld`.momd\"" 32 | xcrun momc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodeld`.momd" 33 | ;; 34 | *.xcmappingmodel) 35 | echo "xcrun mapc \"${PODS_ROOT}/$1\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcmappingmodel`.cdm\"" 36 | xcrun mapc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcmappingmodel`.cdm" 37 | ;; 38 | *.xcassets) 39 | ;; 40 | /*) 41 | echo "$1" 42 | echo "$1" >> "$RESOURCES_TO_COPY" 43 | ;; 44 | *) 45 | echo "${PODS_ROOT}/$1" 46 | echo "${PODS_ROOT}/$1" >> "$RESOURCES_TO_COPY" 47 | ;; 48 | esac 49 | } 50 | 51 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 52 | if [[ "${ACTION}" == "install" ]]; then 53 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 54 | fi 55 | rm -f "$RESOURCES_TO_COPY" 56 | 57 | if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ `find . -name '*.xcassets' | wc -l` -ne 0 ] 58 | then 59 | case "${TARGETED_DEVICE_FAMILY}" in 60 | 1,2) 61 | TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone" 62 | ;; 63 | 1) 64 | TARGET_DEVICE_ARGS="--target-device iphone" 65 | ;; 66 | 2) 67 | TARGET_DEVICE_ARGS="--target-device ipad" 68 | ;; 69 | *) 70 | TARGET_DEVICE_ARGS="--target-device mac" 71 | ;; 72 | esac 73 | find "${PWD}" -name "*.xcassets" -print0 | xargs -0 actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${IPHONEOS_DEPLOYMENT_TARGET}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 74 | fi 75 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-Tests/Pods-Tests.debug.xcconfig: -------------------------------------------------------------------------------- 1 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 2 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/SpriteKitAutoLayout" 3 | OTHER_CFLAGS = $(inherited) -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/SpriteKitAutoLayout" 4 | OTHER_LDFLAGS = -ObjC -l"Pods-Tests-SpriteKitAutoLayout" -framework "SpriteKit" 5 | OTHER_LIBTOOLFLAGS = $(OTHER_LDFLAGS) 6 | PODS_ROOT = ${SRCROOT}/Pods -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-Tests/Pods-Tests.release.xcconfig: -------------------------------------------------------------------------------- 1 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 2 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/SpriteKitAutoLayout" 3 | OTHER_CFLAGS = $(inherited) -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/SpriteKitAutoLayout" 4 | OTHER_LDFLAGS = -ObjC -l"Pods-Tests-SpriteKitAutoLayout" -framework "SpriteKit" 5 | OTHER_LIBTOOLFLAGS = $(OTHER_LDFLAGS) 6 | PODS_ROOT = ${SRCROOT}/Pods -------------------------------------------------------------------------------- /Example/Shared/CommonScene.swift: -------------------------------------------------------------------------------- 1 | // 2 | // CommonScene.swift 3 | // SpriteKitAutoLayout 4 | // 5 | // Created by Maksym Grebenets on 17/12/2014. 6 | // Copyright (c) 2014 Maksym Grebenets. All rights reserved. 7 | // 8 | 9 | import SpriteKit 10 | 11 | class CommonScene: SKScene { 12 | 13 | let BackButtonName = "backButton" 14 | 15 | func addBackButton() { 16 | let backButton = SKSpriteNode(imageNamed: "back") 17 | backButton.name = BackButtonName 18 | backButton.autoLayoutEnabled = true 19 | addChild(backButton) 20 | 21 | // back button 22 | let nodesDic = self.nodesDic() 23 | 24 | var format = "H:|[\(BackButtonName)(80)]" 25 | var constraints = NSLayoutConstraint.constraintsWithVisualFormat(format, options: .DirectionLeadingToTrailing, metrics: nil, views: nodesDic) 26 | self.addConstraints(constraints) 27 | format = "V:[\(BackButtonName)(80)]|" 28 | constraints = NSLayoutConstraint.constraintsWithVisualFormat(format, options: .DirectionLeadingToTrailing, metrics: nil, views: nodesDic) 29 | self.addConstraints(constraints) 30 | } 31 | 32 | override func didChangeSize(oldSize: CGSize) { 33 | dispatch_async(dispatch_get_main_queue()) { 34 | self.autoLayoutNodes() 35 | } 36 | } 37 | 38 | #if os(iOS) 39 | override func touchesBegan(touches: NSSet, withEvent event: UIEvent) { 40 | let touch = touches.allObjects.first! as UITouch 41 | let touchLocation = touch.locationInNode(self) 42 | handleTouchBeganAtLocation(touchLocation) 43 | } 44 | #else 45 | override func mouseDown(theEvent: NSEvent) { 46 | var touchLocation = theEvent.locationInNode(self) 47 | if view!.flipped { 48 | touchLocation.y = CGRectGetHeight(frame) - touchLocation.y 49 | } 50 | handleTouchBeganAtLocation(touchLocation) 51 | } 52 | #endif 53 | 54 | func handleTouchBeganAtLocation(location: CGPoint) { 55 | // override in subclasses 56 | } 57 | 58 | func touchedBack(location: CGPoint) -> Bool { 59 | return (CGRectContainsPoint(childNodeWithName(BackButtonName)!.frame, location)) 60 | } 61 | 62 | func goBack() { 63 | let skView = self.view! as SKView 64 | var scene = MainScene(size: view!.frame.size) 65 | scene.scaleMode = .ResizeFill 66 | skView.presentScene(scene) 67 | } 68 | } -------------------------------------------------------------------------------- /Example/Shared/DemoScene1.swift: -------------------------------------------------------------------------------- 1 | // 2 | // DemoScene1.swift 3 | // SpriteKitAutoLayout 4 | // 5 | // Created by Maksym Grebenets on 14/12/2014. 6 | // Copyright (c) 2014 i4nApps. All rights reserved. 7 | // 8 | 9 | import SpriteKit 10 | 11 | class DemoScene1: CommonScene { 12 | override func didMoveToView(view: SKView) { 13 | self.name = "DemoScene1" 14 | 15 | addBackButton() 16 | 17 | let label1 = SKLabelNode() 18 | label1.text = "H:|[label1(W)] + V:|[label1(H)]" 19 | label1.autoLayoutEnabled = true 20 | label1.name = "label1" 21 | addChild(label1) 22 | let label2 = SKLabelNode() 23 | label2.text = "H:[label2(W)]| + V:[label2(H)]|" 24 | label2.autoLayoutEnabled = true 25 | label2.name = "label2" 26 | addChild(label2) 27 | 28 | 29 | // sized sprite with anchor at (0,0) 30 | let sizeSpriteAnchorZero = SKSpriteNode(color: SKColor.greenColor(), size: CGSizeZero) 31 | sizeSpriteAnchorZero.name = "sizeSpriteAnchorZero" 32 | sizeSpriteAnchorZero.autoLayoutEnabled = true 33 | sizeSpriteAnchorZero.anchorPoint = CGPointZero 34 | addChild(sizeSpriteAnchorZero) 35 | 36 | // sized sprite with default anchor (0.5,0.5) 37 | let sizeSpriteAnchorDefault = SKSpriteNode(color: SKColor.yellowColor(), size: CGSizeZero) 38 | sizeSpriteAnchorDefault.name = "sizeSpriteAnchorDefault" 39 | sizeSpriteAnchorDefault.autoLayoutEnabled = true 40 | // sizeSpriteAnchorDefault.anchorPoint = CGPointZero // default is 0.5, 0.5 41 | addChild(sizeSpriteAnchorDefault) 42 | 43 | 44 | // sized sprite with anchor at (1,1) 45 | let sizeSpriteAnchorOneOne = SKSpriteNode(color: SKColor.blueColor(), size: CGSizeZero) 46 | sizeSpriteAnchorOneOne.name = "sizeSpriteAnchorOneOne" 47 | sizeSpriteAnchorOneOne.autoLayoutEnabled = true 48 | sizeSpriteAnchorOneOne.anchorPoint = CGPointMake(1, 1) 49 | addChild(sizeSpriteAnchorOneOne) 50 | 51 | // sized sprite with anchor at (0,1) 52 | let sizeSpriteAnchorZeroOne = SKSpriteNode(color: SKColor.redColor(), size: CGSizeZero) 53 | sizeSpriteAnchorZeroOne.name = "sizeSpriteAnchorZeroOne" 54 | sizeSpriteAnchorZeroOne.autoLayoutEnabled = true 55 | sizeSpriteAnchorZeroOne.anchorPoint = CGPointMake(0, 1) 56 | addChild(sizeSpriteAnchorZeroOne) 57 | 58 | // sized sprite with anchor at (0.5,0) 59 | let sizeSpriteAnchorHalfZero = SKSpriteNode(color: SKColor.purpleColor(), size: CGSizeZero) 60 | sizeSpriteAnchorHalfZero.name = "sizeSpriteAnchorHalfZero" 61 | sizeSpriteAnchorHalfZero.autoLayoutEnabled = true 62 | sizeSpriteAnchorHalfZero.anchorPoint = CGPointMake(0.5, 0) 63 | addChild(sizeSpriteAnchorHalfZero) 64 | 65 | // sized sprite with anchor at (0.2,0.65) 66 | let sizeSpriteAnchorCustom = SKSpriteNode(color: SKColor.cyanColor(), size: CGSizeZero) 67 | sizeSpriteAnchorCustom.name = "sizeSpriteAnchorCustom" 68 | sizeSpriteAnchorCustom.autoLayoutEnabled = true 69 | sizeSpriteAnchorCustom.anchorPoint = CGPointMake(0.2, 0.65) 70 | addChild(sizeSpriteAnchorCustom) 71 | 72 | // sizeless node that contains buttons 73 | let buttonsNode = SKNode() 74 | buttonsNode.name = "buttonsNode" 75 | buttonsNode.autoLayoutEnabled = true 76 | addChild(buttonsNode) 77 | 78 | // buttons inside buttons node 79 | var button1 = SKSpriteNode(color: SKColor.redColor(), size: CGSizeZero) 80 | button1.name = "button1" 81 | button1.autoLayoutEnabled = true 82 | var button2 = SKSpriteNode(color: SKColor.brownColor(), size: CGSizeZero) 83 | button2.name = "button2" 84 | button2.autoLayoutEnabled = true 85 | var button3 = SKSpriteNode(color: SKColor.orangeColor(), size: CGSizeZero) 86 | button3.name = "button3" 87 | button3.autoLayoutEnabled = true 88 | 89 | let buttons = [button1, button2, button3] 90 | buttons.map { buttonsNode.addChild($0) } 91 | 92 | 93 | // All the nodes are added, cached child nodes dictionary ro reuse later 94 | let nodesDic = self.nodesDic() 95 | 96 | let buttonsNodesDic = buttonsNode.nodesDic() 97 | 98 | var format = "" 99 | var constraints = [AnyObject]() 100 | 101 | // labels layout 102 | format = "H:|[label1(\(Float(label2.frame.width)))]" 103 | constraints = NSLayoutConstraint.constraintsWithVisualFormat(format, options: .DirectionLeadingToTrailing, metrics: nil, views: nodesDic) 104 | self.addConstraints(constraints) 105 | format = "V:|[label1(\(Float(label2.frame.height)))]" 106 | constraints = NSLayoutConstraint.constraintsWithVisualFormat(format, options: .DirectionLeadingToTrailing, metrics: nil, views: nodesDic) 107 | self.addConstraints(constraints) 108 | 109 | format = "H:[label2(\(Float(label2.frame.width)))]|" 110 | constraints = NSLayoutConstraint.constraintsWithVisualFormat(format, options: .DirectionLeadingToTrailing, metrics: nil, views: nodesDic) 111 | self.addConstraints(constraints) 112 | 113 | format = "V:[label2(\(Float(label2.frame.height)))]|" 114 | constraints = NSLayoutConstraint.constraintsWithVisualFormat(format, options: .DirectionLeadingToTrailing, metrics: nil, views: nodesDic) 115 | self.addConstraints(constraints) 116 | 117 | // put all sized and anchored color sprites in the top right corner 118 | // give them all different size to see how they align there 119 | 120 | let sizedSpritesLayoutData = [ 121 | (name: sizeSpriteAnchorZero.name!, size: 120), 122 | (name: sizeSpriteAnchorDefault.name!, size: 100), 123 | (name: sizeSpriteAnchorOneOne.name!, size: 80), 124 | (name: sizeSpriteAnchorZeroOne.name!, size: 60), 125 | (name: sizeSpriteAnchorHalfZero.name!, size: 40), 126 | (name: sizeSpriteAnchorCustom.name!, size: 20), 127 | ] 128 | 129 | for data in sizedSpritesLayoutData { 130 | var format = "H:[\(data.name)(\(Float(data.size)))]|" 131 | var constraints = NSLayoutConstraint.constraintsWithVisualFormat(format, options: .DirectionLeadingToTrailing, metrics: nil, views: nodesDic) 132 | self.addConstraints(constraints) 133 | 134 | format = "V:|[\(data.name)(\(Float(data.size)))]" 135 | constraints = NSLayoutConstraint.constraintsWithVisualFormat(format, options: .DirectionLeadingToTrailing, metrics: nil, views: nodesDic) 136 | self.addConstraints(constraints) 137 | 138 | } 139 | 140 | // tell buttons node to be in the center 141 | // by pinning it to superview 142 | format = "H:|-100-[buttonsNode]-120-|" 143 | constraints = NSLayoutConstraint.constraintsWithVisualFormat(format, options: .DirectionLeadingToTrailing, metrics: nil, views: nodesDic) 144 | self.addConstraints(constraints) 145 | 146 | format = "V:|-100-[buttonsNode]-100-|" 147 | constraints = NSLayoutConstraint.constraintsWithVisualFormat(format, options: .DirectionLeadingToTrailing, metrics: nil, views: nodesDic) 148 | self.addConstraints(constraints) 149 | 150 | // now tell the buttons to align themselves inside buttons node 151 | 152 | // use width of the parent 153 | format = "H:|[button1]|" 154 | constraints = NSLayoutConstraint.constraintsWithVisualFormat(format, options: .DirectionLeadingToTrailing, metrics: nil, views: buttonsNodesDic) 155 | buttonsNode.addConstraints(constraints) 156 | format = "H:|[button2]|" 157 | constraints = NSLayoutConstraint.constraintsWithVisualFormat(format, options: .DirectionLeadingToTrailing, metrics: nil, views: buttonsNodesDic) 158 | buttonsNode.addConstraints(constraints) 159 | format = "H:|[button3]|" 160 | constraints = NSLayoutConstraint.constraintsWithVisualFormat(format, options: .DirectionLeadingToTrailing, metrics: nil, views: buttonsNodesDic) 161 | buttonsNode.addConstraints(constraints) 162 | 163 | // align vertically using custom padding 164 | // let the buttons resize their height, make sure height is same for all 165 | format = "V:|[button1]-40-[button2(button1)]-40-[button3(button1)]|" 166 | constraints = NSLayoutConstraint.constraintsWithVisualFormat(format, options: .DirectionLeadingToTrailing, metrics: nil, views: buttonsNodesDic) 167 | buttonsNode.addConstraints(constraints) 168 | 169 | } 170 | 171 | override func handleTouchBeganAtLocation(location: CGPoint) { 172 | if touchedBack(location) { 173 | goBack() 174 | } 175 | } 176 | } 177 | -------------------------------------------------------------------------------- /Example/Shared/DemoScene2.swift: -------------------------------------------------------------------------------- 1 | // 2 | // DemoScene2.swift 3 | // SpriteKitAutoLayout 4 | // 5 | // Created by Maksym Grebenets on 17/12/2014. 6 | // Copyright (c) 2014 Maksym Grebenets. All rights reserved. 7 | // 8 | 9 | import SpriteKit 10 | 11 | class DemoScene2: CommonScene { 12 | override func didMoveToView(view: SKView) { 13 | addBackButton() 14 | } 15 | 16 | override func handleTouchBeganAtLocation(location: CGPoint) { 17 | if touchedBack(location) { 18 | goBack() 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Example/Shared/DemoScene3.swift: -------------------------------------------------------------------------------- 1 | // 2 | // DemoScene3.swift 3 | // SpriteKitAutoLayout 4 | // 5 | // Created by Maksym Grebenets on 17/12/2014. 6 | // Copyright (c) 2014 Maksym Grebenets. All rights reserved. 7 | // 8 | 9 | import SpriteKit 10 | 11 | class DemoScene3: CommonScene { 12 | override func didMoveToView(view: SKView) { 13 | addBackButton() 14 | } 15 | 16 | override func handleTouchBeganAtLocation(location: CGPoint) { 17 | if touchedBack(location) { 18 | goBack() 19 | } 20 | } 21 | } 22 | 23 | -------------------------------------------------------------------------------- /Example/Shared/Images.xcassets/back.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "back.pdf" 6 | } 7 | ], 8 | "info" : { 9 | "version" : 1, 10 | "author" : "xcode" 11 | } 12 | } -------------------------------------------------------------------------------- /Example/Shared/Images.xcassets/back.imageset/back.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mgrebenets/SpriteKitAutoLayout/0c48175ea821fe8019c3405b6de3009810c8c00b/Example/Shared/Images.xcassets/back.imageset/back.pdf -------------------------------------------------------------------------------- /Example/Shared/MainScene.swift: -------------------------------------------------------------------------------- 1 | // 2 | // MainScene.swift 3 | // SpriteKitAutoLayout 4 | // 5 | // Created by Maksym Grebenets on 17/12/2014. 6 | // Copyright (c) 2014 Maksym Grebenets. All rights reserved. 7 | // 8 | 9 | class MainScene: CommonScene { 10 | override func didMoveToView(view: SKView) { 11 | 12 | self.name = "MainScene" 13 | 14 | for i in 1...3 { 15 | var label = SKLabelNode() 16 | label.text = "Demo \(i)" 17 | label.name = "label\(i)" 18 | label.horizontalAlignmentMode = .Right 19 | label.verticalAlignmentMode = .Baseline 20 | label.autoLayoutEnabled = true 21 | addChild(label) 22 | 23 | var c = NSLayoutConstraint(item: label, attribute: .CenterX, relatedBy: .Equal, toItem: self, attribute: .CenterX, multiplier: 1, constant: 1) 24 | addConstraint(c) 25 | } 26 | 27 | var format = "V:|-20-[label1]-20-[label2(label1)]-20-[label3(label1)]-40-|" 28 | var constraints = NSLayoutConstraint.constraintsWithVisualFormat(format, options: .DirectionLeadingToTrailing, metrics: nil, views: nodesDic()) 29 | addConstraints(constraints) 30 | } 31 | 32 | override func handleTouchBeganAtLocation(location: CGPoint) { 33 | 34 | var scene: SKScene! 35 | 36 | if (CGRectContainsPoint(childNodeWithName("label1")!.frame, location)) { 37 | scene = DemoScene1(size: view!.frame.size) 38 | } else if (CGRectContainsPoint(childNodeWithName("label2")!.frame, location)) { 39 | scene = DemoScene2(size: view!.frame.size) 40 | } else if (CGRectContainsPoint(childNodeWithName("label3")!.frame, location)) { 41 | scene = DemoScene3(size: view!.frame.size) 42 | } 43 | 44 | if let scene = scene { 45 | let skView = self.view! as SKView 46 | scene.scaleMode = .ResizeFill 47 | println("===Subviews count before: \(skView.subviews.count)") 48 | // println("===Constraints count before: \(skView.constraints().count)") 49 | skView.presentScene(scene) 50 | println("===Subviews count after: \(skView.subviews.count)") 51 | // println("===Constraints count after: \(skView.constraints().count)") 52 | } 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /Example/SpriteKitAutoLayout.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 4DF89F9E4AA3C69B0E03AD10 /* libPods-SpriteKitAutoLayoutOSX.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 062069C35F49C2FCB6A68DDA /* libPods-SpriteKitAutoLayoutOSX.a */; }; 11 | 5813BB331A4124A0008C0FB0 /* FlippedSKView.m in Sources */ = {isa = PBXBuildFile; fileRef = 5813BB311A4124A0008C0FB0 /* FlippedSKView.m */; }; 12 | 5813BB341A4124EA008C0FB0 /* MainScene.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5855B8DB1A4105A40092A320 /* MainScene.swift */; }; 13 | 5813BB351A4124EA008C0FB0 /* DemoScene1.swift in Sources */ = {isa = PBXBuildFile; fileRef = 589577E81A41025E0071B4CB /* DemoScene1.swift */; }; 14 | 5813BB361A4124EA008C0FB0 /* DemoScene2.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5855B8DD1A41124C0092A320 /* DemoScene2.swift */; }; 15 | 5813BB371A4124EA008C0FB0 /* DemoScene3.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5855B8DF1A41126D0092A320 /* DemoScene3.swift */; }; 16 | 5813BB381A4124EA008C0FB0 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 5855B8E11A41181D0092A320 /* Images.xcassets */; }; 17 | 5855B8DC1A4105A40092A320 /* MainScene.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5855B8DB1A4105A40092A320 /* MainScene.swift */; }; 18 | 5855B8DE1A41124C0092A320 /* DemoScene2.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5855B8DD1A41124C0092A320 /* DemoScene2.swift */; }; 19 | 5855B8E01A41126D0092A320 /* DemoScene3.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5855B8DF1A41126D0092A320 /* DemoScene3.swift */; }; 20 | 5855B8E21A41181D0092A320 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 5855B8E11A41181D0092A320 /* Images.xcassets */; }; 21 | 589577E51A40F49C0071B4CB /* SpriteKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 589577E41A40F49C0071B4CB /* SpriteKit.framework */; }; 22 | 589577E61A40F4AE0071B4CB /* SpriteKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 589577E41A40F49C0071B4CB /* SpriteKit.framework */; }; 23 | 589577E91A41025E0071B4CB /* DemoScene1.swift in Sources */ = {isa = PBXBuildFile; fileRef = 589577E81A41025E0071B4CB /* DemoScene1.swift */; }; 24 | 58EA688A1A43879000B16EB8 /* Tests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 58EA68891A43879000B16EB8 /* Tests.swift */; }; 25 | 58EA6ADD1A4123620069A377 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 58EA6ADC1A4123620069A377 /* AppDelegate.m */; }; 26 | 58EA6ADF1A4123620069A377 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 58EA6ADE1A4123620069A377 /* main.m */; }; 27 | 58EA6AE61A4123620069A377 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 58EA6AE51A4123620069A377 /* Images.xcassets */; }; 28 | 58EA6AE91A4123620069A377 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 58EA6AE71A4123620069A377 /* MainMenu.xib */; }; 29 | 58F07C311A412FAA00A5691A /* CommonScene.swift in Sources */ = {isa = PBXBuildFile; fileRef = 58F07C301A412FAA00A5691A /* CommonScene.swift */; }; 30 | 58F07C321A412FAA00A5691A /* CommonScene.swift in Sources */ = {isa = PBXBuildFile; fileRef = 58F07C301A412FAA00A5691A /* CommonScene.swift */; }; 31 | 6003F58E195388D20070C39A /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F58D195388D20070C39A /* Foundation.framework */; }; 32 | 6003F590195388D20070C39A /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F58F195388D20070C39A /* CoreGraphics.framework */; }; 33 | 6003F598195388D20070C39A /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 6003F596195388D20070C39A /* InfoPlist.strings */; }; 34 | 6003F59A195388D20070C39A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 6003F599195388D20070C39A /* main.m */; }; 35 | 6003F59E195388D20070C39A /* SKALAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 6003F59D195388D20070C39A /* SKALAppDelegate.m */; }; 36 | 6003F5A7195388D20070C39A /* SKALViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 6003F5A6195388D20070C39A /* SKALViewController.m */; }; 37 | 6003F5A9195388D20070C39A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 6003F5A8195388D20070C39A /* Images.xcassets */; }; 38 | 6003F5B0195388D20070C39A /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F5AF195388D20070C39A /* XCTest.framework */; }; 39 | 6003F5B1195388D20070C39A /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F58D195388D20070C39A /* Foundation.framework */; }; 40 | 6003F5BA195388D20070C39A /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 6003F5B8195388D20070C39A /* InfoPlist.strings */; }; 41 | 6003F5BC195388D20070C39A /* Tests.m in Sources */ = {isa = PBXBuildFile; fileRef = 6003F5BB195388D20070C39A /* Tests.m */; }; 42 | 6772D4643C2F71B5D5C72391 /* libPods-SpriteKitAutoLayout.a in Frameworks */ = {isa = PBXBuildFile; fileRef = D412D1E1C9171A29C5D0CFC3 /* libPods-SpriteKitAutoLayout.a */; }; 43 | E3FE457DB2AE8099FA6F3002 /* libPods-Tests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = A9687CA1EA92ADF6DD7288A4 /* libPods-Tests.a */; }; 44 | /* End PBXBuildFile section */ 45 | 46 | /* Begin PBXContainerItemProxy section */ 47 | 6003F5B3195388D20070C39A /* PBXContainerItemProxy */ = { 48 | isa = PBXContainerItemProxy; 49 | containerPortal = 6003F582195388D10070C39A /* Project object */; 50 | proxyType = 1; 51 | remoteGlobalIDString = 6003F589195388D20070C39A; 52 | remoteInfo = SpriteKitAutoLayout; 53 | }; 54 | /* End PBXContainerItemProxy section */ 55 | 56 | /* Begin PBXFileReference section */ 57 | 062069C35F49C2FCB6A68DDA /* libPods-SpriteKitAutoLayoutOSX.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-SpriteKitAutoLayoutOSX.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 58 | 09CED9AA2C0966EDAF8BED2C /* Pods-SpriteKitAutoLayoutOSX.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SpriteKitAutoLayoutOSX.release.xcconfig"; path = "Pods/Target Support Files/Pods-SpriteKitAutoLayoutOSX/Pods-SpriteKitAutoLayoutOSX.release.xcconfig"; sourceTree = ""; }; 59 | 1A1CF39440CF791CF4506561 /* LICENSE */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = LICENSE; path = ../LICENSE; sourceTree = ""; }; 60 | 3E58117C8F33BE839F0BD8B6 /* README.md */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = net.daringfireball.markdown; name = README.md; path = ../README.md; sourceTree = ""; }; 61 | 510BD2E90A965F38226783E8 /* Pods-Tests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Tests.release.xcconfig"; path = "Pods/Target Support Files/Pods-Tests/Pods-Tests.release.xcconfig"; sourceTree = ""; }; 62 | 5813BB301A4124A0008C0FB0 /* FlippedSKView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FlippedSKView.h; sourceTree = ""; }; 63 | 5813BB311A4124A0008C0FB0 /* FlippedSKView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FlippedSKView.m; sourceTree = ""; }; 64 | 5813BB321A4124A0008C0FB0 /* SpriteKitAutoLayoutOSX-Bridging-Header.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "SpriteKitAutoLayoutOSX-Bridging-Header.h"; sourceTree = ""; }; 65 | 5855B8DB1A4105A40092A320 /* MainScene.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MainScene.swift; sourceTree = ""; }; 66 | 5855B8DD1A41124C0092A320 /* DemoScene2.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DemoScene2.swift; sourceTree = ""; }; 67 | 5855B8DF1A41126D0092A320 /* DemoScene3.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DemoScene3.swift; sourceTree = ""; }; 68 | 5855B8E11A41181D0092A320 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; 69 | 589577E41A40F49C0071B4CB /* SpriteKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SpriteKit.framework; path = System/Library/Frameworks/SpriteKit.framework; sourceTree = SDKROOT; }; 70 | 589577E71A41025E0071B4CB /* SpriteKitAutoLayout-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "SpriteKitAutoLayout-Bridging-Header.h"; path = "SpriteKitAutoLayout/SpriteKitAutoLayout-Bridging-Header.h"; sourceTree = SOURCE_ROOT; }; 71 | 589577E81A41025E0071B4CB /* DemoScene1.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DemoScene1.swift; sourceTree = ""; }; 72 | 58EA68881A43878F00B16EB8 /* Tests-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Tests-Bridging-Header.h"; sourceTree = ""; }; 73 | 58EA68891A43879000B16EB8 /* Tests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Tests.swift; sourceTree = ""; }; 74 | 58EA6AD71A4123620069A377 /* SpriteKitAutoLayoutOSX.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SpriteKitAutoLayoutOSX.app; sourceTree = BUILT_PRODUCTS_DIR; }; 75 | 58EA6ADA1A4123620069A377 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 76 | 58EA6ADB1A4123620069A377 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 77 | 58EA6ADC1A4123620069A377 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 78 | 58EA6ADE1A4123620069A377 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 79 | 58EA6AE51A4123620069A377 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; 80 | 58EA6AE81A4123620069A377 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/MainMenu.xib; sourceTree = ""; }; 81 | 58F07C301A412FAA00A5691A /* CommonScene.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CommonScene.swift; sourceTree = ""; }; 82 | 5C646EF1D789DB9C3FF62F85 /* Pods-Tests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Tests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-Tests/Pods-Tests.debug.xcconfig"; sourceTree = ""; }; 83 | 6003F58A195388D20070C39A /* SpriteKitAutoLayout.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SpriteKitAutoLayout.app; sourceTree = BUILT_PRODUCTS_DIR; }; 84 | 6003F58D195388D20070C39A /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; 85 | 6003F58F195388D20070C39A /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; 86 | 6003F591195388D20070C39A /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; 87 | 6003F595195388D20070C39A /* SpriteKitAutoLayout-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "SpriteKitAutoLayout-Info.plist"; sourceTree = ""; }; 88 | 6003F597195388D20070C39A /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 89 | 6003F599195388D20070C39A /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 90 | 6003F59B195388D20070C39A /* SpriteKitAutoLayout-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "SpriteKitAutoLayout-Prefix.pch"; sourceTree = ""; }; 91 | 6003F59C195388D20070C39A /* SKALAppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SKALAppDelegate.h; sourceTree = ""; }; 92 | 6003F59D195388D20070C39A /* SKALAppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SKALAppDelegate.m; sourceTree = ""; }; 93 | 6003F5A5195388D20070C39A /* SKALViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SKALViewController.h; sourceTree = ""; }; 94 | 6003F5A6195388D20070C39A /* SKALViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SKALViewController.m; sourceTree = ""; }; 95 | 6003F5A8195388D20070C39A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; 96 | 6003F5AE195388D20070C39A /* Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = Tests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 97 | 6003F5AF195388D20070C39A /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; 98 | 6003F5B7195388D20070C39A /* Tests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Tests-Info.plist"; sourceTree = ""; }; 99 | 6003F5B9195388D20070C39A /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 100 | 6003F5BB195388D20070C39A /* Tests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = Tests.m; sourceTree = ""; }; 101 | 606FC2411953D9B200FFA9A0 /* Tests-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Tests-Prefix.pch"; sourceTree = ""; }; 102 | 6DA7E4E7DF643CD593252D73 /* SpriteKitAutoLayout.podspec */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = SpriteKitAutoLayout.podspec; path = ../SpriteKitAutoLayout.podspec; sourceTree = ""; }; 103 | 7A6B13FE7C2AB2DCED3D12AE /* Pods-SpriteKitAutoLayout.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SpriteKitAutoLayout.release.xcconfig"; path = "Pods/Target Support Files/Pods-SpriteKitAutoLayout/Pods-SpriteKitAutoLayout.release.xcconfig"; sourceTree = ""; }; 104 | 92E568652D1DD9FBFFB5C889 /* Pods-SpriteKitAutoLayoutOSX.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SpriteKitAutoLayoutOSX.debug.xcconfig"; path = "Pods/Target Support Files/Pods-SpriteKitAutoLayoutOSX/Pods-SpriteKitAutoLayoutOSX.debug.xcconfig"; sourceTree = ""; }; 105 | A9687CA1EA92ADF6DD7288A4 /* libPods-Tests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-Tests.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 106 | AD9A17B5B9A541F3763EA6D4 /* Pods-SpriteKitAutoLayout.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SpriteKitAutoLayout.debug.xcconfig"; path = "Pods/Target Support Files/Pods-SpriteKitAutoLayout/Pods-SpriteKitAutoLayout.debug.xcconfig"; sourceTree = ""; }; 107 | D412D1E1C9171A29C5D0CFC3 /* libPods-SpriteKitAutoLayout.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-SpriteKitAutoLayout.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 108 | /* End PBXFileReference section */ 109 | 110 | /* Begin PBXFrameworksBuildPhase section */ 111 | 58EA6AD41A4123620069A377 /* Frameworks */ = { 112 | isa = PBXFrameworksBuildPhase; 113 | buildActionMask = 2147483647; 114 | files = ( 115 | 4DF89F9E4AA3C69B0E03AD10 /* libPods-SpriteKitAutoLayoutOSX.a in Frameworks */, 116 | ); 117 | runOnlyForDeploymentPostprocessing = 0; 118 | }; 119 | 6003F587195388D20070C39A /* Frameworks */ = { 120 | isa = PBXFrameworksBuildPhase; 121 | buildActionMask = 2147483647; 122 | files = ( 123 | 6003F590195388D20070C39A /* CoreGraphics.framework in Frameworks */, 124 | 589577E51A40F49C0071B4CB /* SpriteKit.framework in Frameworks */, 125 | 6003F58E195388D20070C39A /* Foundation.framework in Frameworks */, 126 | 6772D4643C2F71B5D5C72391 /* libPods-SpriteKitAutoLayout.a in Frameworks */, 127 | ); 128 | runOnlyForDeploymentPostprocessing = 0; 129 | }; 130 | 6003F5AB195388D20070C39A /* Frameworks */ = { 131 | isa = PBXFrameworksBuildPhase; 132 | buildActionMask = 2147483647; 133 | files = ( 134 | 6003F5B0195388D20070C39A /* XCTest.framework in Frameworks */, 135 | 589577E61A40F4AE0071B4CB /* SpriteKit.framework in Frameworks */, 136 | 6003F5B1195388D20070C39A /* Foundation.framework in Frameworks */, 137 | E3FE457DB2AE8099FA6F3002 /* libPods-Tests.a in Frameworks */, 138 | ); 139 | runOnlyForDeploymentPostprocessing = 0; 140 | }; 141 | /* End PBXFrameworksBuildPhase section */ 142 | 143 | /* Begin PBXGroup section */ 144 | 1C589DC4FF574BC370C793F6 /* Pods */ = { 145 | isa = PBXGroup; 146 | children = ( 147 | AD9A17B5B9A541F3763EA6D4 /* Pods-SpriteKitAutoLayout.debug.xcconfig */, 148 | 7A6B13FE7C2AB2DCED3D12AE /* Pods-SpriteKitAutoLayout.release.xcconfig */, 149 | 5C646EF1D789DB9C3FF62F85 /* Pods-Tests.debug.xcconfig */, 150 | 510BD2E90A965F38226783E8 /* Pods-Tests.release.xcconfig */, 151 | 92E568652D1DD9FBFFB5C889 /* Pods-SpriteKitAutoLayoutOSX.debug.xcconfig */, 152 | 09CED9AA2C0966EDAF8BED2C /* Pods-SpriteKitAutoLayoutOSX.release.xcconfig */, 153 | ); 154 | name = Pods; 155 | sourceTree = ""; 156 | }; 157 | 589577EA1A4102730071B4CB /* Shared */ = { 158 | isa = PBXGroup; 159 | children = ( 160 | 58F07C301A412FAA00A5691A /* CommonScene.swift */, 161 | 5855B8DB1A4105A40092A320 /* MainScene.swift */, 162 | 589577E81A41025E0071B4CB /* DemoScene1.swift */, 163 | 5855B8DD1A41124C0092A320 /* DemoScene2.swift */, 164 | 5855B8DF1A41126D0092A320 /* DemoScene3.swift */, 165 | 5855B8E11A41181D0092A320 /* Images.xcassets */, 166 | ); 167 | path = Shared; 168 | sourceTree = ""; 169 | }; 170 | 58EA6AD81A4123620069A377 /* SpriteKitAutoLayoutOSX */ = { 171 | isa = PBXGroup; 172 | children = ( 173 | 58EA6ADB1A4123620069A377 /* AppDelegate.h */, 174 | 58EA6ADC1A4123620069A377 /* AppDelegate.m */, 175 | 5813BB301A4124A0008C0FB0 /* FlippedSKView.h */, 176 | 5813BB311A4124A0008C0FB0 /* FlippedSKView.m */, 177 | 58EA6AE51A4123620069A377 /* Images.xcassets */, 178 | 58EA6AE71A4123620069A377 /* MainMenu.xib */, 179 | 58EA6AD91A4123620069A377 /* Supporting Files */, 180 | ); 181 | path = SpriteKitAutoLayoutOSX; 182 | sourceTree = ""; 183 | }; 184 | 58EA6AD91A4123620069A377 /* Supporting Files */ = { 185 | isa = PBXGroup; 186 | children = ( 187 | 5813BB321A4124A0008C0FB0 /* SpriteKitAutoLayoutOSX-Bridging-Header.h */, 188 | 58EA6ADA1A4123620069A377 /* Info.plist */, 189 | 58EA6ADE1A4123620069A377 /* main.m */, 190 | ); 191 | name = "Supporting Files"; 192 | sourceTree = ""; 193 | }; 194 | 6003F581195388D10070C39A = { 195 | isa = PBXGroup; 196 | children = ( 197 | 589577EA1A4102730071B4CB /* Shared */, 198 | 60FF7A9C1954A5C5007DD14C /* Podspec Metadata */, 199 | 6003F593195388D20070C39A /* SpriteKitAutoLayout */, 200 | 58EA6AD81A4123620069A377 /* SpriteKitAutoLayoutOSX */, 201 | 6003F5B5195388D20070C39A /* Tests */, 202 | 6003F58C195388D20070C39A /* Frameworks */, 203 | 6003F58B195388D20070C39A /* Products */, 204 | 1C589DC4FF574BC370C793F6 /* Pods */, 205 | ); 206 | sourceTree = ""; 207 | }; 208 | 6003F58B195388D20070C39A /* Products */ = { 209 | isa = PBXGroup; 210 | children = ( 211 | 6003F58A195388D20070C39A /* SpriteKitAutoLayout.app */, 212 | 6003F5AE195388D20070C39A /* Tests.xctest */, 213 | 58EA6AD71A4123620069A377 /* SpriteKitAutoLayoutOSX.app */, 214 | ); 215 | name = Products; 216 | sourceTree = ""; 217 | }; 218 | 6003F58C195388D20070C39A /* Frameworks */ = { 219 | isa = PBXGroup; 220 | children = ( 221 | 589577E41A40F49C0071B4CB /* SpriteKit.framework */, 222 | 6003F58D195388D20070C39A /* Foundation.framework */, 223 | 6003F58F195388D20070C39A /* CoreGraphics.framework */, 224 | 6003F591195388D20070C39A /* UIKit.framework */, 225 | 6003F5AF195388D20070C39A /* XCTest.framework */, 226 | D412D1E1C9171A29C5D0CFC3 /* libPods-SpriteKitAutoLayout.a */, 227 | A9687CA1EA92ADF6DD7288A4 /* libPods-Tests.a */, 228 | 062069C35F49C2FCB6A68DDA /* libPods-SpriteKitAutoLayoutOSX.a */, 229 | ); 230 | name = Frameworks; 231 | sourceTree = ""; 232 | }; 233 | 6003F593195388D20070C39A /* SpriteKitAutoLayout */ = { 234 | isa = PBXGroup; 235 | children = ( 236 | 6003F59C195388D20070C39A /* SKALAppDelegate.h */, 237 | 6003F59D195388D20070C39A /* SKALAppDelegate.m */, 238 | 6003F5A5195388D20070C39A /* SKALViewController.h */, 239 | 6003F5A6195388D20070C39A /* SKALViewController.m */, 240 | 6003F5A8195388D20070C39A /* Images.xcassets */, 241 | 6003F594195388D20070C39A /* Supporting Files */, 242 | ); 243 | path = SpriteKitAutoLayout; 244 | sourceTree = ""; 245 | }; 246 | 6003F594195388D20070C39A /* Supporting Files */ = { 247 | isa = PBXGroup; 248 | children = ( 249 | 6003F595195388D20070C39A /* SpriteKitAutoLayout-Info.plist */, 250 | 6003F596195388D20070C39A /* InfoPlist.strings */, 251 | 6003F599195388D20070C39A /* main.m */, 252 | 6003F59B195388D20070C39A /* SpriteKitAutoLayout-Prefix.pch */, 253 | 589577E71A41025E0071B4CB /* SpriteKitAutoLayout-Bridging-Header.h */, 254 | ); 255 | name = "Supporting Files"; 256 | sourceTree = ""; 257 | }; 258 | 6003F5B5195388D20070C39A /* Tests */ = { 259 | isa = PBXGroup; 260 | children = ( 261 | 58EA68891A43879000B16EB8 /* Tests.swift */, 262 | 6003F5BB195388D20070C39A /* Tests.m */, 263 | 6003F5B6195388D20070C39A /* Supporting Files */, 264 | ); 265 | path = Tests; 266 | sourceTree = ""; 267 | }; 268 | 6003F5B6195388D20070C39A /* Supporting Files */ = { 269 | isa = PBXGroup; 270 | children = ( 271 | 6003F5B7195388D20070C39A /* Tests-Info.plist */, 272 | 6003F5B8195388D20070C39A /* InfoPlist.strings */, 273 | 606FC2411953D9B200FFA9A0 /* Tests-Prefix.pch */, 274 | 58EA68881A43878F00B16EB8 /* Tests-Bridging-Header.h */, 275 | ); 276 | name = "Supporting Files"; 277 | sourceTree = ""; 278 | }; 279 | 60FF7A9C1954A5C5007DD14C /* Podspec Metadata */ = { 280 | isa = PBXGroup; 281 | children = ( 282 | 6DA7E4E7DF643CD593252D73 /* SpriteKitAutoLayout.podspec */, 283 | 3E58117C8F33BE839F0BD8B6 /* README.md */, 284 | 1A1CF39440CF791CF4506561 /* LICENSE */, 285 | ); 286 | name = "Podspec Metadata"; 287 | sourceTree = ""; 288 | }; 289 | /* End PBXGroup section */ 290 | 291 | /* Begin PBXNativeTarget section */ 292 | 58EA6AD61A4123620069A377 /* SpriteKitAutoLayoutOSX */ = { 293 | isa = PBXNativeTarget; 294 | buildConfigurationList = 58EA6AF61A4123620069A377 /* Build configuration list for PBXNativeTarget "SpriteKitAutoLayoutOSX" */; 295 | buildPhases = ( 296 | 9F61C6D1D79FA37F3622A39B /* Check Pods Manifest.lock */, 297 | 58EA6AD31A4123620069A377 /* Sources */, 298 | 58EA6AD41A4123620069A377 /* Frameworks */, 299 | 58EA6AD51A4123620069A377 /* Resources */, 300 | EF8D8E2D430C27A1DF936D5C /* Copy Pods Resources */, 301 | ); 302 | buildRules = ( 303 | ); 304 | dependencies = ( 305 | ); 306 | name = SpriteKitAutoLayoutOSX; 307 | productName = SpriteKitAutoLayoutOSX; 308 | productReference = 58EA6AD71A4123620069A377 /* SpriteKitAutoLayoutOSX.app */; 309 | productType = "com.apple.product-type.application"; 310 | }; 311 | 6003F589195388D20070C39A /* SpriteKitAutoLayout */ = { 312 | isa = PBXNativeTarget; 313 | buildConfigurationList = 6003F5BF195388D20070C39A /* Build configuration list for PBXNativeTarget "SpriteKitAutoLayout" */; 314 | buildPhases = ( 315 | 723529D65C13B804AF8108E0 /* Check Pods Manifest.lock */, 316 | 6003F586195388D20070C39A /* Sources */, 317 | 6003F587195388D20070C39A /* Frameworks */, 318 | 6003F588195388D20070C39A /* Resources */, 319 | 87A7D6CA0B53488B0EA6094F /* Copy Pods Resources */, 320 | ); 321 | buildRules = ( 322 | ); 323 | dependencies = ( 324 | ); 325 | name = SpriteKitAutoLayout; 326 | productName = SpriteKitAutoLayout; 327 | productReference = 6003F58A195388D20070C39A /* SpriteKitAutoLayout.app */; 328 | productType = "com.apple.product-type.application"; 329 | }; 330 | 6003F5AD195388D20070C39A /* Tests */ = { 331 | isa = PBXNativeTarget; 332 | buildConfigurationList = 6003F5C2195388D20070C39A /* Build configuration list for PBXNativeTarget "Tests" */; 333 | buildPhases = ( 334 | 7931CE56829775B2EF79EF87 /* Check Pods Manifest.lock */, 335 | 6003F5AA195388D20070C39A /* Sources */, 336 | 6003F5AB195388D20070C39A /* Frameworks */, 337 | 6003F5AC195388D20070C39A /* Resources */, 338 | B67E74FEF9CEFE141BFE3E77 /* Copy Pods Resources */, 339 | ); 340 | buildRules = ( 341 | ); 342 | dependencies = ( 343 | 6003F5B4195388D20070C39A /* PBXTargetDependency */, 344 | ); 345 | name = Tests; 346 | productName = SpriteKitAutoLayoutTests; 347 | productReference = 6003F5AE195388D20070C39A /* Tests.xctest */; 348 | productType = "com.apple.product-type.bundle.unit-test"; 349 | }; 350 | /* End PBXNativeTarget section */ 351 | 352 | /* Begin PBXProject section */ 353 | 6003F582195388D10070C39A /* Project object */ = { 354 | isa = PBXProject; 355 | attributes = { 356 | CLASSPREFIX = SKAL; 357 | LastUpgradeCheck = 0510; 358 | ORGANIZATIONNAME = maksym.grebenets; 359 | TargetAttributes = { 360 | 58EA6AD61A4123620069A377 = { 361 | CreatedOnToolsVersion = 6.1.1; 362 | }; 363 | 6003F5AD195388D20070C39A = { 364 | TestTargetID = 6003F589195388D20070C39A; 365 | }; 366 | }; 367 | }; 368 | buildConfigurationList = 6003F585195388D10070C39A /* Build configuration list for PBXProject "SpriteKitAutoLayout" */; 369 | compatibilityVersion = "Xcode 3.2"; 370 | developmentRegion = English; 371 | hasScannedForEncodings = 0; 372 | knownRegions = ( 373 | en, 374 | Base, 375 | ); 376 | mainGroup = 6003F581195388D10070C39A; 377 | productRefGroup = 6003F58B195388D20070C39A /* Products */; 378 | projectDirPath = ""; 379 | projectRoot = ""; 380 | targets = ( 381 | 6003F589195388D20070C39A /* SpriteKitAutoLayout */, 382 | 58EA6AD61A4123620069A377 /* SpriteKitAutoLayoutOSX */, 383 | 6003F5AD195388D20070C39A /* Tests */, 384 | ); 385 | }; 386 | /* End PBXProject section */ 387 | 388 | /* Begin PBXResourcesBuildPhase section */ 389 | 58EA6AD51A4123620069A377 /* Resources */ = { 390 | isa = PBXResourcesBuildPhase; 391 | buildActionMask = 2147483647; 392 | files = ( 393 | 5813BB381A4124EA008C0FB0 /* Images.xcassets in Resources */, 394 | 58EA6AE61A4123620069A377 /* Images.xcassets in Resources */, 395 | 58EA6AE91A4123620069A377 /* MainMenu.xib in Resources */, 396 | ); 397 | runOnlyForDeploymentPostprocessing = 0; 398 | }; 399 | 6003F588195388D20070C39A /* Resources */ = { 400 | isa = PBXResourcesBuildPhase; 401 | buildActionMask = 2147483647; 402 | files = ( 403 | 5855B8E21A41181D0092A320 /* Images.xcassets in Resources */, 404 | 6003F5A9195388D20070C39A /* Images.xcassets in Resources */, 405 | 6003F598195388D20070C39A /* InfoPlist.strings in Resources */, 406 | ); 407 | runOnlyForDeploymentPostprocessing = 0; 408 | }; 409 | 6003F5AC195388D20070C39A /* Resources */ = { 410 | isa = PBXResourcesBuildPhase; 411 | buildActionMask = 2147483647; 412 | files = ( 413 | 6003F5BA195388D20070C39A /* InfoPlist.strings in Resources */, 414 | ); 415 | runOnlyForDeploymentPostprocessing = 0; 416 | }; 417 | /* End PBXResourcesBuildPhase section */ 418 | 419 | /* Begin PBXShellScriptBuildPhase section */ 420 | 723529D65C13B804AF8108E0 /* Check Pods Manifest.lock */ = { 421 | isa = PBXShellScriptBuildPhase; 422 | buildActionMask = 2147483647; 423 | files = ( 424 | ); 425 | inputPaths = ( 426 | ); 427 | name = "Check Pods Manifest.lock"; 428 | outputPaths = ( 429 | ); 430 | runOnlyForDeploymentPostprocessing = 0; 431 | shellPath = /bin/sh; 432 | shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n"; 433 | showEnvVarsInLog = 0; 434 | }; 435 | 7931CE56829775B2EF79EF87 /* Check Pods Manifest.lock */ = { 436 | isa = PBXShellScriptBuildPhase; 437 | buildActionMask = 2147483647; 438 | files = ( 439 | ); 440 | inputPaths = ( 441 | ); 442 | name = "Check Pods Manifest.lock"; 443 | outputPaths = ( 444 | ); 445 | runOnlyForDeploymentPostprocessing = 0; 446 | shellPath = /bin/sh; 447 | shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n"; 448 | showEnvVarsInLog = 0; 449 | }; 450 | 87A7D6CA0B53488B0EA6094F /* Copy Pods Resources */ = { 451 | isa = PBXShellScriptBuildPhase; 452 | buildActionMask = 2147483647; 453 | files = ( 454 | ); 455 | inputPaths = ( 456 | ); 457 | name = "Copy Pods Resources"; 458 | outputPaths = ( 459 | ); 460 | runOnlyForDeploymentPostprocessing = 0; 461 | shellPath = /bin/sh; 462 | shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-SpriteKitAutoLayout/Pods-SpriteKitAutoLayout-resources.sh\"\n"; 463 | showEnvVarsInLog = 0; 464 | }; 465 | 9F61C6D1D79FA37F3622A39B /* Check Pods Manifest.lock */ = { 466 | isa = PBXShellScriptBuildPhase; 467 | buildActionMask = 2147483647; 468 | files = ( 469 | ); 470 | inputPaths = ( 471 | ); 472 | name = "Check Pods Manifest.lock"; 473 | outputPaths = ( 474 | ); 475 | runOnlyForDeploymentPostprocessing = 0; 476 | shellPath = /bin/sh; 477 | shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n"; 478 | showEnvVarsInLog = 0; 479 | }; 480 | B67E74FEF9CEFE141BFE3E77 /* Copy Pods Resources */ = { 481 | isa = PBXShellScriptBuildPhase; 482 | buildActionMask = 2147483647; 483 | files = ( 484 | ); 485 | inputPaths = ( 486 | ); 487 | name = "Copy Pods Resources"; 488 | outputPaths = ( 489 | ); 490 | runOnlyForDeploymentPostprocessing = 0; 491 | shellPath = /bin/sh; 492 | shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-Tests/Pods-Tests-resources.sh\"\n"; 493 | showEnvVarsInLog = 0; 494 | }; 495 | EF8D8E2D430C27A1DF936D5C /* Copy Pods Resources */ = { 496 | isa = PBXShellScriptBuildPhase; 497 | buildActionMask = 2147483647; 498 | files = ( 499 | ); 500 | inputPaths = ( 501 | ); 502 | name = "Copy Pods Resources"; 503 | outputPaths = ( 504 | ); 505 | runOnlyForDeploymentPostprocessing = 0; 506 | shellPath = /bin/sh; 507 | shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-SpriteKitAutoLayoutOSX/Pods-SpriteKitAutoLayoutOSX-resources.sh\"\n"; 508 | showEnvVarsInLog = 0; 509 | }; 510 | /* End PBXShellScriptBuildPhase section */ 511 | 512 | /* Begin PBXSourcesBuildPhase section */ 513 | 58EA6AD31A4123620069A377 /* Sources */ = { 514 | isa = PBXSourcesBuildPhase; 515 | buildActionMask = 2147483647; 516 | files = ( 517 | 5813BB371A4124EA008C0FB0 /* DemoScene3.swift in Sources */, 518 | 58EA6ADF1A4123620069A377 /* main.m in Sources */, 519 | 5813BB341A4124EA008C0FB0 /* MainScene.swift in Sources */, 520 | 58F07C321A412FAA00A5691A /* CommonScene.swift in Sources */, 521 | 5813BB351A4124EA008C0FB0 /* DemoScene1.swift in Sources */, 522 | 58EA6ADD1A4123620069A377 /* AppDelegate.m in Sources */, 523 | 5813BB361A4124EA008C0FB0 /* DemoScene2.swift in Sources */, 524 | 5813BB331A4124A0008C0FB0 /* FlippedSKView.m in Sources */, 525 | ); 526 | runOnlyForDeploymentPostprocessing = 0; 527 | }; 528 | 6003F586195388D20070C39A /* Sources */ = { 529 | isa = PBXSourcesBuildPhase; 530 | buildActionMask = 2147483647; 531 | files = ( 532 | 5855B8E01A41126D0092A320 /* DemoScene3.swift in Sources */, 533 | 6003F59E195388D20070C39A /* SKALAppDelegate.m in Sources */, 534 | 6003F5A7195388D20070C39A /* SKALViewController.m in Sources */, 535 | 58F07C311A412FAA00A5691A /* CommonScene.swift in Sources */, 536 | 6003F59A195388D20070C39A /* main.m in Sources */, 537 | 5855B8DC1A4105A40092A320 /* MainScene.swift in Sources */, 538 | 5855B8DE1A41124C0092A320 /* DemoScene2.swift in Sources */, 539 | 589577E91A41025E0071B4CB /* DemoScene1.swift in Sources */, 540 | ); 541 | runOnlyForDeploymentPostprocessing = 0; 542 | }; 543 | 6003F5AA195388D20070C39A /* Sources */ = { 544 | isa = PBXSourcesBuildPhase; 545 | buildActionMask = 2147483647; 546 | files = ( 547 | 6003F5BC195388D20070C39A /* Tests.m in Sources */, 548 | 58EA688A1A43879000B16EB8 /* Tests.swift in Sources */, 549 | ); 550 | runOnlyForDeploymentPostprocessing = 0; 551 | }; 552 | /* End PBXSourcesBuildPhase section */ 553 | 554 | /* Begin PBXTargetDependency section */ 555 | 6003F5B4195388D20070C39A /* PBXTargetDependency */ = { 556 | isa = PBXTargetDependency; 557 | target = 6003F589195388D20070C39A /* SpriteKitAutoLayout */; 558 | targetProxy = 6003F5B3195388D20070C39A /* PBXContainerItemProxy */; 559 | }; 560 | /* End PBXTargetDependency section */ 561 | 562 | /* Begin PBXVariantGroup section */ 563 | 58EA6AE71A4123620069A377 /* MainMenu.xib */ = { 564 | isa = PBXVariantGroup; 565 | children = ( 566 | 58EA6AE81A4123620069A377 /* Base */, 567 | ); 568 | name = MainMenu.xib; 569 | sourceTree = ""; 570 | }; 571 | 6003F596195388D20070C39A /* InfoPlist.strings */ = { 572 | isa = PBXVariantGroup; 573 | children = ( 574 | 6003F597195388D20070C39A /* en */, 575 | ); 576 | name = InfoPlist.strings; 577 | sourceTree = ""; 578 | }; 579 | 6003F5B8195388D20070C39A /* InfoPlist.strings */ = { 580 | isa = PBXVariantGroup; 581 | children = ( 582 | 6003F5B9195388D20070C39A /* en */, 583 | ); 584 | name = InfoPlist.strings; 585 | sourceTree = ""; 586 | }; 587 | /* End PBXVariantGroup section */ 588 | 589 | /* Begin XCBuildConfiguration section */ 590 | 58EA6AF71A4123620069A377 /* Debug */ = { 591 | isa = XCBuildConfiguration; 592 | baseConfigurationReference = 92E568652D1DD9FBFFB5C889 /* Pods-SpriteKitAutoLayoutOSX.debug.xcconfig */; 593 | buildSettings = { 594 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 595 | CLANG_WARN_UNREACHABLE_CODE = YES; 596 | CODE_SIGN_IDENTITY = "-"; 597 | COMBINE_HIDPI_IMAGES = YES; 598 | ENABLE_STRICT_OBJC_MSGSEND = YES; 599 | GCC_PREPROCESSOR_DEFINITIONS = ( 600 | "DEBUG=1", 601 | "$(inherited)", 602 | ); 603 | INFOPLIST_FILE = SpriteKitAutoLayoutOSX/Info.plist; 604 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks"; 605 | MACOSX_DEPLOYMENT_TARGET = 10.9; 606 | MTL_ENABLE_DEBUG_INFO = YES; 607 | PRODUCT_NAME = "$(TARGET_NAME)"; 608 | SDKROOT = macosx; 609 | SWIFT_OBJC_BRIDGING_HEADER = "SpriteKitAutoLayoutOSX/SpriteKitAutoLayoutOSX-Bridging-Header.h"; 610 | }; 611 | name = Debug; 612 | }; 613 | 58EA6AF81A4123620069A377 /* Release */ = { 614 | isa = XCBuildConfiguration; 615 | baseConfigurationReference = 09CED9AA2C0966EDAF8BED2C /* Pods-SpriteKitAutoLayoutOSX.release.xcconfig */; 616 | buildSettings = { 617 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 618 | CLANG_WARN_UNREACHABLE_CODE = YES; 619 | CODE_SIGN_IDENTITY = "-"; 620 | COMBINE_HIDPI_IMAGES = YES; 621 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 622 | ENABLE_STRICT_OBJC_MSGSEND = YES; 623 | INFOPLIST_FILE = SpriteKitAutoLayoutOSX/Info.plist; 624 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks"; 625 | MACOSX_DEPLOYMENT_TARGET = 10.9; 626 | MTL_ENABLE_DEBUG_INFO = NO; 627 | PRODUCT_NAME = "$(TARGET_NAME)"; 628 | SDKROOT = macosx; 629 | SWIFT_OBJC_BRIDGING_HEADER = "SpriteKitAutoLayoutOSX/SpriteKitAutoLayoutOSX-Bridging-Header.h"; 630 | }; 631 | name = Release; 632 | }; 633 | 6003F5BD195388D20070C39A /* Debug */ = { 634 | isa = XCBuildConfiguration; 635 | buildSettings = { 636 | ALWAYS_SEARCH_USER_PATHS = NO; 637 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 638 | CLANG_CXX_LIBRARY = "libc++"; 639 | CLANG_ENABLE_MODULES = YES; 640 | CLANG_ENABLE_OBJC_ARC = YES; 641 | CLANG_WARN_BOOL_CONVERSION = YES; 642 | CLANG_WARN_CONSTANT_CONVERSION = YES; 643 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 644 | CLANG_WARN_EMPTY_BODY = YES; 645 | CLANG_WARN_ENUM_CONVERSION = YES; 646 | CLANG_WARN_INT_CONVERSION = YES; 647 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 648 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 649 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 650 | COPY_PHASE_STRIP = NO; 651 | GCC_C_LANGUAGE_STANDARD = gnu99; 652 | GCC_DYNAMIC_NO_PIC = NO; 653 | GCC_OPTIMIZATION_LEVEL = 0; 654 | GCC_PREPROCESSOR_DEFINITIONS = ( 655 | "DEBUG=1", 656 | "$(inherited)", 657 | ); 658 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 659 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 660 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 661 | GCC_WARN_UNDECLARED_SELECTOR = YES; 662 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 663 | GCC_WARN_UNUSED_FUNCTION = YES; 664 | GCC_WARN_UNUSED_VARIABLE = YES; 665 | IPHONEOS_DEPLOYMENT_TARGET = 7.1; 666 | MACOSX_DEPLOYMENT_TARGET = 10.9; 667 | ONLY_ACTIVE_ARCH = YES; 668 | SDKROOT = iphoneos; 669 | TARGETED_DEVICE_FAMILY = "1,2"; 670 | }; 671 | name = Debug; 672 | }; 673 | 6003F5BE195388D20070C39A /* Release */ = { 674 | isa = XCBuildConfiguration; 675 | buildSettings = { 676 | ALWAYS_SEARCH_USER_PATHS = NO; 677 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 678 | CLANG_CXX_LIBRARY = "libc++"; 679 | CLANG_ENABLE_MODULES = YES; 680 | CLANG_ENABLE_OBJC_ARC = YES; 681 | CLANG_WARN_BOOL_CONVERSION = YES; 682 | CLANG_WARN_CONSTANT_CONVERSION = YES; 683 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 684 | CLANG_WARN_EMPTY_BODY = YES; 685 | CLANG_WARN_ENUM_CONVERSION = YES; 686 | CLANG_WARN_INT_CONVERSION = YES; 687 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 688 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 689 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 690 | COPY_PHASE_STRIP = YES; 691 | ENABLE_NS_ASSERTIONS = NO; 692 | GCC_C_LANGUAGE_STANDARD = gnu99; 693 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 694 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 695 | GCC_WARN_UNDECLARED_SELECTOR = YES; 696 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 697 | GCC_WARN_UNUSED_FUNCTION = YES; 698 | GCC_WARN_UNUSED_VARIABLE = YES; 699 | IPHONEOS_DEPLOYMENT_TARGET = 7.1; 700 | MACOSX_DEPLOYMENT_TARGET = 10.9; 701 | SDKROOT = iphoneos; 702 | TARGETED_DEVICE_FAMILY = "1,2"; 703 | VALIDATE_PRODUCT = YES; 704 | }; 705 | name = Release; 706 | }; 707 | 6003F5C0195388D20070C39A /* Debug */ = { 708 | isa = XCBuildConfiguration; 709 | baseConfigurationReference = AD9A17B5B9A541F3763EA6D4 /* Pods-SpriteKitAutoLayout.debug.xcconfig */; 710 | buildSettings = { 711 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 712 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; 713 | CLANG_ENABLE_MODULES = YES; 714 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 715 | GCC_PREFIX_HEADER = "SpriteKitAutoLayout/SpriteKitAutoLayout-Prefix.pch"; 716 | INFOPLIST_FILE = "SpriteKitAutoLayout/SpriteKitAutoLayout-Info.plist"; 717 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 718 | PRODUCT_NAME = "$(TARGET_NAME)"; 719 | SWIFT_OBJC_BRIDGING_HEADER = "SpriteKitAutoLayout/SpriteKitAutoLayout-Bridging-Header.h"; 720 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 721 | WRAPPER_EXTENSION = app; 722 | }; 723 | name = Debug; 724 | }; 725 | 6003F5C1195388D20070C39A /* Release */ = { 726 | isa = XCBuildConfiguration; 727 | baseConfigurationReference = 7A6B13FE7C2AB2DCED3D12AE /* Pods-SpriteKitAutoLayout.release.xcconfig */; 728 | buildSettings = { 729 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 730 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; 731 | CLANG_ENABLE_MODULES = YES; 732 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 733 | GCC_PREFIX_HEADER = "SpriteKitAutoLayout/SpriteKitAutoLayout-Prefix.pch"; 734 | INFOPLIST_FILE = "SpriteKitAutoLayout/SpriteKitAutoLayout-Info.plist"; 735 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 736 | PRODUCT_NAME = "$(TARGET_NAME)"; 737 | SWIFT_OBJC_BRIDGING_HEADER = "SpriteKitAutoLayout/SpriteKitAutoLayout-Bridging-Header.h"; 738 | WRAPPER_EXTENSION = app; 739 | }; 740 | name = Release; 741 | }; 742 | 6003F5C3195388D20070C39A /* Debug */ = { 743 | isa = XCBuildConfiguration; 744 | baseConfigurationReference = 5C646EF1D789DB9C3FF62F85 /* Pods-Tests.debug.xcconfig */; 745 | buildSettings = { 746 | BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/SpriteKitAutoLayout.app/SpriteKitAutoLayout"; 747 | CLANG_ENABLE_MODULES = YES; 748 | FRAMEWORK_SEARCH_PATHS = ( 749 | "$(SDKROOT)/Developer/Library/Frameworks", 750 | "$(inherited)", 751 | "$(DEVELOPER_FRAMEWORKS_DIR)", 752 | ); 753 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 754 | GCC_PREFIX_HEADER = "Tests/Tests-Prefix.pch"; 755 | GCC_PREPROCESSOR_DEFINITIONS = ( 756 | "DEBUG=1", 757 | "$(inherited)", 758 | ); 759 | INFOPLIST_FILE = "Tests/Tests-Info.plist"; 760 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 761 | PRODUCT_NAME = "$(TARGET_NAME)"; 762 | SWIFT_OBJC_BRIDGING_HEADER = "Tests/Tests-Bridging-Header.h"; 763 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 764 | TEST_HOST = "$(BUNDLE_LOADER)"; 765 | WRAPPER_EXTENSION = xctest; 766 | }; 767 | name = Debug; 768 | }; 769 | 6003F5C4195388D20070C39A /* Release */ = { 770 | isa = XCBuildConfiguration; 771 | baseConfigurationReference = 510BD2E90A965F38226783E8 /* Pods-Tests.release.xcconfig */; 772 | buildSettings = { 773 | BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/SpriteKitAutoLayout.app/SpriteKitAutoLayout"; 774 | CLANG_ENABLE_MODULES = YES; 775 | FRAMEWORK_SEARCH_PATHS = ( 776 | "$(SDKROOT)/Developer/Library/Frameworks", 777 | "$(inherited)", 778 | "$(DEVELOPER_FRAMEWORKS_DIR)", 779 | ); 780 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 781 | GCC_PREFIX_HEADER = "Tests/Tests-Prefix.pch"; 782 | INFOPLIST_FILE = "Tests/Tests-Info.plist"; 783 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 784 | PRODUCT_NAME = "$(TARGET_NAME)"; 785 | SWIFT_OBJC_BRIDGING_HEADER = "Tests/Tests-Bridging-Header.h"; 786 | TEST_HOST = "$(BUNDLE_LOADER)"; 787 | WRAPPER_EXTENSION = xctest; 788 | }; 789 | name = Release; 790 | }; 791 | /* End XCBuildConfiguration section */ 792 | 793 | /* Begin XCConfigurationList section */ 794 | 58EA6AF61A4123620069A377 /* Build configuration list for PBXNativeTarget "SpriteKitAutoLayoutOSX" */ = { 795 | isa = XCConfigurationList; 796 | buildConfigurations = ( 797 | 58EA6AF71A4123620069A377 /* Debug */, 798 | 58EA6AF81A4123620069A377 /* Release */, 799 | ); 800 | defaultConfigurationIsVisible = 0; 801 | defaultConfigurationName = Release; 802 | }; 803 | 6003F585195388D10070C39A /* Build configuration list for PBXProject "SpriteKitAutoLayout" */ = { 804 | isa = XCConfigurationList; 805 | buildConfigurations = ( 806 | 6003F5BD195388D20070C39A /* Debug */, 807 | 6003F5BE195388D20070C39A /* Release */, 808 | ); 809 | defaultConfigurationIsVisible = 0; 810 | defaultConfigurationName = Release; 811 | }; 812 | 6003F5BF195388D20070C39A /* Build configuration list for PBXNativeTarget "SpriteKitAutoLayout" */ = { 813 | isa = XCConfigurationList; 814 | buildConfigurations = ( 815 | 6003F5C0195388D20070C39A /* Debug */, 816 | 6003F5C1195388D20070C39A /* Release */, 817 | ); 818 | defaultConfigurationIsVisible = 0; 819 | defaultConfigurationName = Release; 820 | }; 821 | 6003F5C2195388D20070C39A /* Build configuration list for PBXNativeTarget "Tests" */ = { 822 | isa = XCConfigurationList; 823 | buildConfigurations = ( 824 | 6003F5C3195388D20070C39A /* Debug */, 825 | 6003F5C4195388D20070C39A /* Release */, 826 | ); 827 | defaultConfigurationIsVisible = 0; 828 | defaultConfigurationName = Release; 829 | }; 830 | /* End XCConfigurationList section */ 831 | }; 832 | rootObject = 6003F582195388D10070C39A /* Project object */; 833 | } 834 | -------------------------------------------------------------------------------- /Example/SpriteKitAutoLayout.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Example/SpriteKitAutoLayout.xcodeproj/xcshareddata/xcschemes/SpriteKitAutoLayoutOSX.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 39 | 40 | 41 | 42 | 51 | 52 | 58 | 59 | 60 | 61 | 62 | 63 | 69 | 70 | 76 | 77 | 78 | 79 | 81 | 82 | 85 | 86 | 87 | -------------------------------------------------------------------------------- /Example/SpriteKitAutoLayout.xcodeproj/xcshareddata/xcschemes/SpriteKitAutoLayoutiOS.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 33 | 39 | 40 | 41 | 42 | 43 | 49 | 50 | 51 | 52 | 61 | 62 | 68 | 69 | 70 | 71 | 72 | 73 | 79 | 80 | 86 | 87 | 88 | 89 | 91 | 92 | 95 | 96 | 97 | -------------------------------------------------------------------------------- /Example/SpriteKitAutoLayout.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Example/SpriteKitAutoLayout/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "40x40", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "60x60", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "60x60", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "ipad", 25 | "size" : "29x29", 26 | "scale" : "1x" 27 | }, 28 | { 29 | "idiom" : "ipad", 30 | "size" : "29x29", 31 | "scale" : "2x" 32 | }, 33 | { 34 | "idiom" : "ipad", 35 | "size" : "40x40", 36 | "scale" : "1x" 37 | }, 38 | { 39 | "idiom" : "ipad", 40 | "size" : "40x40", 41 | "scale" : "2x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "76x76", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "size" : "76x76", 51 | "scale" : "2x" 52 | } 53 | ], 54 | "info" : { 55 | "version" : 1, 56 | "author" : "xcode" 57 | } 58 | } -------------------------------------------------------------------------------- /Example/SpriteKitAutoLayout/Images.xcassets/LaunchImage.launchimage/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "orientation" : "portrait", 5 | "idiom" : "iphone", 6 | "extent" : "full-screen", 7 | "minimum-system-version" : "7.0", 8 | "scale" : "2x" 9 | }, 10 | { 11 | "orientation" : "portrait", 12 | "idiom" : "iphone", 13 | "subtype" : "retina4", 14 | "extent" : "full-screen", 15 | "minimum-system-version" : "7.0", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "orientation" : "portrait", 20 | "idiom" : "ipad", 21 | "extent" : "full-screen", 22 | "minimum-system-version" : "7.0", 23 | "scale" : "1x" 24 | }, 25 | { 26 | "orientation" : "landscape", 27 | "idiom" : "ipad", 28 | "extent" : "full-screen", 29 | "minimum-system-version" : "7.0", 30 | "scale" : "1x" 31 | }, 32 | { 33 | "orientation" : "portrait", 34 | "idiom" : "ipad", 35 | "extent" : "full-screen", 36 | "minimum-system-version" : "7.0", 37 | "scale" : "2x" 38 | }, 39 | { 40 | "orientation" : "landscape", 41 | "idiom" : "ipad", 42 | "extent" : "full-screen", 43 | "minimum-system-version" : "7.0", 44 | "scale" : "2x" 45 | } 46 | ], 47 | "info" : { 48 | "version" : 1, 49 | "author" : "xcode" 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /Example/SpriteKitAutoLayout/SKALAppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // SKALAppDelegate.h 3 | // SpriteKitAutoLayout 4 | // 5 | // Created by CocoaPods on 12/17/2014. 6 | // Copyright (c) 2014 Maksym Grebenets. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface SKALAppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /Example/SpriteKitAutoLayout/SKALAppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // SKALAppDelegate.m 3 | // SpriteKitAutoLayout 4 | // 5 | // Created by CocoaPods on 12/17/2014. 6 | // Copyright (c) 2014 Maksym Grebenets. All rights reserved. 7 | // 8 | 9 | #import "SKALAppDelegate.h" 10 | #import "SKALViewController.h" 11 | 12 | @implementation SKALAppDelegate 13 | 14 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 15 | { 16 | // Override point for customization after application launch. 17 | 18 | self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; 19 | self.window.rootViewController = [[SKALViewController alloc] init]; 20 | [self.window makeKeyAndVisible]; 21 | 22 | return YES; 23 | } 24 | 25 | - (void)applicationWillResignActive:(UIApplication *)application 26 | { 27 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 28 | // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. 29 | } 30 | 31 | - (void)applicationDidEnterBackground:(UIApplication *)application 32 | { 33 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 34 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 35 | } 36 | 37 | - (void)applicationWillEnterForeground:(UIApplication *)application 38 | { 39 | // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. 40 | } 41 | 42 | - (void)applicationDidBecomeActive:(UIApplication *)application 43 | { 44 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 45 | } 46 | 47 | - (void)applicationWillTerminate:(UIApplication *)application 48 | { 49 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 50 | } 51 | 52 | @end 53 | -------------------------------------------------------------------------------- /Example/SpriteKitAutoLayout/SKALViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // SKALViewController.h 3 | // SpriteKitAutoLayout 4 | // 5 | // Created by Maksym Grebenets on 12/17/2014. 6 | // Copyright (c) 2014 Maksym Grebenets. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface SKALViewController : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Example/SpriteKitAutoLayout/SKALViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // SKALViewController.m 3 | // SpriteKitAutoLayout 4 | // 5 | // Created by Maksym Grebenets on 12/17/2014. 6 | // Copyright (c) 2014 Maksym Grebenets. All rights reserved. 7 | // 8 | 9 | @import SpriteKit; 10 | #import "SKALViewController.h" 11 | #import "SpriteKitAutoLayout-Swift.h" 12 | 13 | @interface SKALViewController () 14 | 15 | @end 16 | 17 | @implementation SKALViewController 18 | 19 | - (void)loadView { 20 | self.view = [[SKView alloc] init]; 21 | } 22 | 23 | - (void)viewDidLoad 24 | { 25 | [super viewDidLoad]; 26 | // Do any additional setup after loading the view, typically from a nib. 27 | 28 | SKView *skView = (SKView *)self.view; 29 | SKScene *scene = [[MainScene alloc] initWithSize: skView.bounds.size]; 30 | skView.showsFPS = YES; 31 | skView.showsNodeCount = YES; 32 | skView.ignoresSiblingOrder = YES; 33 | 34 | scene.scaleMode = SKSceneScaleModeResizeFill; 35 | 36 | [skView presentScene:scene]; 37 | } 38 | 39 | - (void)viewDidAppear:(BOOL)animated { 40 | [super viewDidAppear:animated]; 41 | } 42 | 43 | - (void)viewWillAppear:(BOOL)animated { 44 | [super viewWillAppear:animated]; 45 | } 46 | 47 | 48 | - (void)didReceiveMemoryWarning 49 | { 50 | [super didReceiveMemoryWarning]; 51 | // Dispose of any resources that can be recreated. 52 | } 53 | 54 | @end 55 | -------------------------------------------------------------------------------- /Example/SpriteKitAutoLayout/SpriteKitAutoLayout-Bridging-Header.h: -------------------------------------------------------------------------------- 1 | // 2 | // Use this file to import your target's public headers that you would like to expose to Swift. 3 | // 4 | 5 | #import 6 | -------------------------------------------------------------------------------- /Example/SpriteKitAutoLayout/SpriteKitAutoLayout-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIdentifier 12 | org.cocoapods.demo.$(PRODUCT_NAME:rfc1034identifier) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | ${PRODUCT_NAME} 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1.0 25 | LSRequiresIPhoneOS 26 | 27 | UIRequiredDeviceCapabilities 28 | 29 | armv7 30 | 31 | UIStatusBarHidden 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationLandscapeLeft 37 | UIInterfaceOrientationLandscapeRight 38 | UIInterfaceOrientationPortraitUpsideDown 39 | 40 | UISupportedInterfaceOrientations~ipad 41 | 42 | UIInterfaceOrientationPortrait 43 | UIInterfaceOrientationPortraitUpsideDown 44 | UIInterfaceOrientationLandscapeLeft 45 | UIInterfaceOrientationLandscapeRight 46 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /Example/SpriteKitAutoLayout/SpriteKitAutoLayout-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header 3 | // 4 | // The contents of this file are implicitly included at the beginning of every source file. 5 | // 6 | 7 | #import 8 | 9 | #ifndef __IPHONE_5_0 10 | #warning "This project uses features only available in iOS SDK 5.0 and later." 11 | #endif 12 | 13 | #ifdef __OBJC__ 14 | #import 15 | #import 16 | #endif 17 | -------------------------------------------------------------------------------- /Example/SpriteKitAutoLayout/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /Example/SpriteKitAutoLayout/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // SpriteKitAutoLayout 4 | // 5 | // Created by Maksym Grebenets on 12/17/2014. 6 | // Copyright (c) 2014 Maksym Grebenets. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "SKALAppDelegate.h" 12 | 13 | int main(int argc, char * argv[]) 14 | { 15 | @autoreleasepool { 16 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([SKALAppDelegate class])); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Example/SpriteKitAutoLayoutOSX/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // SpriteKitAutoLayoutOSX 4 | // 5 | 6 | // Copyright (c) 2014 Maksym Grebenets. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | @interface AppDelegate : NSObject 13 | 14 | @property (assign) IBOutlet NSWindow *window; 15 | @property (assign) IBOutlet SKView *skView; 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /Example/SpriteKitAutoLayoutOSX/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // SpriteKitAutoLayoutOSX 4 | // 5 | // Created by Maksym Grebenets on 17/12/2014. 6 | // Copyright (c) 2014 Maksym Grebenets. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | #import "SpriteKitAutoLayoutOSX-Swift.h" 11 | 12 | @implementation AppDelegate 13 | 14 | @synthesize window = _window; 15 | 16 | - (void)applicationDidFinishLaunching:(NSNotification *)aNotification { 17 | SKView *skView = self.skView; 18 | SKScene *scene = [[MainScene alloc] initWithSize: skView.bounds.size]; 19 | skView.showsFPS = YES; 20 | skView.showsNodeCount = YES; 21 | skView.ignoresSiblingOrder = YES; 22 | 23 | scene.scaleMode = SKSceneScaleModeResizeFill; 24 | 25 | [skView presentScene:scene]; 26 | } 27 | 28 | - (BOOL)applicationShouldTerminateAfterLastWindowClosed:(NSApplication *)sender { 29 | return YES; 30 | } 31 | 32 | @end 33 | -------------------------------------------------------------------------------- /Example/SpriteKitAutoLayoutOSX/Base.lproj/MainMenu.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | -------------------------------------------------------------------------------- /Example/SpriteKitAutoLayoutOSX/FlippedSKView.h: -------------------------------------------------------------------------------- 1 | // 2 | // FlippedSKView.h 3 | // SpriteKitAutoLayout 4 | // 5 | // Created by Maksym Grebenets on 17/12/2014. 6 | // Copyright (c) 2014 Maksym Grebenets. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface FlippedSKView : SKView 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Example/SpriteKitAutoLayoutOSX/FlippedSKView.m: -------------------------------------------------------------------------------- 1 | // 2 | // FlippedSKView.m 3 | // SpriteKitAutoLayout 4 | // 5 | // Created by Maksym Grebenets on 17/12/2014. 6 | // Copyright (c) 2014 Maksym Grebenets. All rights reserved. 7 | // 8 | 9 | #import "FlippedSKView.h" 10 | 11 | @implementation FlippedSKView 12 | 13 | - (void)drawRect:(NSRect)dirtyRect { 14 | [super drawRect:dirtyRect]; 15 | 16 | // Drawing code here. 17 | } 18 | 19 | - (BOOL)isFlipped { 20 | return YES; 21 | } 22 | 23 | @end 24 | -------------------------------------------------------------------------------- /Example/SpriteKitAutoLayoutOSX/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "mac", 5 | "size" : "16x16", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "mac", 10 | "size" : "16x16", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "mac", 15 | "size" : "32x32", 16 | "scale" : "1x" 17 | }, 18 | { 19 | "idiom" : "mac", 20 | "size" : "32x32", 21 | "scale" : "2x" 22 | }, 23 | { 24 | "idiom" : "mac", 25 | "size" : "128x128", 26 | "scale" : "1x" 27 | }, 28 | { 29 | "idiom" : "mac", 30 | "size" : "128x128", 31 | "scale" : "2x" 32 | }, 33 | { 34 | "idiom" : "mac", 35 | "size" : "256x256", 36 | "scale" : "1x" 37 | }, 38 | { 39 | "idiom" : "mac", 40 | "size" : "256x256", 41 | "scale" : "2x" 42 | }, 43 | { 44 | "idiom" : "mac", 45 | "size" : "512x512", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "mac", 50 | "size" : "512x512", 51 | "scale" : "2x" 52 | } 53 | ], 54 | "info" : { 55 | "version" : 1, 56 | "author" : "xcode" 57 | } 58 | } -------------------------------------------------------------------------------- /Example/SpriteKitAutoLayoutOSX/Images.xcassets/Spaceship.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x", 6 | "filename" : "Spaceship.png" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | } 12 | ], 13 | "info" : { 14 | "version" : 1, 15 | "author" : "xcode" 16 | } 17 | } -------------------------------------------------------------------------------- /Example/SpriteKitAutoLayoutOSX/Images.xcassets/Spaceship.imageset/Spaceship.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mgrebenets/SpriteKitAutoLayout/0c48175ea821fe8019c3405b6de3009810c8c00b/Example/SpriteKitAutoLayoutOSX/Images.xcassets/Spaceship.imageset/Spaceship.png -------------------------------------------------------------------------------- /Example/SpriteKitAutoLayoutOSX/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIconFile 10 | 11 | CFBundleIdentifier 12 | org.cocoapods.demo.$(PRODUCT_NAME:rfc1034identifier) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | $(PRODUCT_NAME) 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1 25 | LSMinimumSystemVersion 26 | $(MACOSX_DEPLOYMENT_TARGET) 27 | NSHumanReadableCopyright 28 | Copyright © 2014 Maksym Grebenets. All rights reserved. 29 | NSMainNibFile 30 | MainMenu 31 | NSPrincipalClass 32 | NSApplication 33 | 34 | 35 | -------------------------------------------------------------------------------- /Example/SpriteKitAutoLayoutOSX/SpriteKitAutoLayoutOSX-Bridging-Header.h: -------------------------------------------------------------------------------- 1 | // 2 | // Use this file to import your target's public headers that you would like to expose to Swift. 3 | // 4 | 5 | #import 6 | -------------------------------------------------------------------------------- /Example/SpriteKitAutoLayoutOSX/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // SpriteKitAutoLayoutOSX 4 | // 5 | // Created by Maksym Grebenets on 17/12/2014. 6 | // Copyright (c) 2014 Maksym Grebenets. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | int main(int argc, const char * argv[]) { 12 | return NSApplicationMain(argc, argv); 13 | } 14 | -------------------------------------------------------------------------------- /Example/Tests/Tests-Bridging-Header.h: -------------------------------------------------------------------------------- 1 | // 2 | // Test-Bridging-Header.h 3 | // SpriteKitAutoLayout 4 | // 5 | // Created by Maksym Grebenets on 19/12/2014. 6 | // Copyright (c) 2014 Maksym Grebenets. All rights reserved. 7 | // 8 | 9 | #import -------------------------------------------------------------------------------- /Example/Tests/Tests-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | org.cocoapods.demo.${PRODUCT_NAME:rfc1034identifier} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundlePackageType 14 | BNDL 15 | CFBundleShortVersionString 16 | 1.0 17 | CFBundleSignature 18 | ???? 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /Example/Tests/Tests-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header 3 | // 4 | // The contents of this file are implicitly included at the beginning of every test case source file. 5 | // 6 | 7 | #ifdef __OBJC__ 8 | 9 | 10 | 11 | #endif 12 | -------------------------------------------------------------------------------- /Example/Tests/Tests.m: -------------------------------------------------------------------------------- 1 | // 2 | // SpriteKitAutoLayoutTests.m 3 | // SpriteKitAutoLayoutTests 4 | // 5 | // Created by Maksym Grebenets on 12/17/2014. 6 | // Copyright (c) 2014 Maksym Grebenets. All rights reserved. 7 | // 8 | 9 | @import XCTest; 10 | #import "Tests-Swift.h" 11 | 12 | @interface SpriteKitAutoLayouTests: XCTestCase 13 | @end 14 | 15 | @implementation SpriteKitAutoLayouTests 16 | 17 | - (void)setUp { 18 | 19 | } 20 | 21 | - (void)tearDown { 22 | 23 | } 24 | 25 | - (void)testExample { 26 | XCTAssert(TRUE, @"Pass"); 27 | } 28 | 29 | @end 30 | 31 | 32 | -------------------------------------------------------------------------------- /Example/Tests/Tests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Tests.swift 3 | // SpriteKitAutoLayout 4 | // 5 | // Created by Maksym Grebenets on 19/12/2014. 6 | // Copyright (c) 2014 Maksym Grebenets. All rights reserved. 7 | // 8 | 9 | import XCTest 10 | 11 | class SKALSwiftTests: XCTestCase { 12 | override func setUp() { 13 | 14 | } 15 | 16 | override func tearDown() { 17 | 18 | } 19 | 20 | func test() { 21 | XCTAssert(true, "Pass") 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Example/Tests/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2014 Maksym Grebenets 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /Pod/Assets/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mgrebenets/SpriteKitAutoLayout/0c48175ea821fe8019c3405b6de3009810c8c00b/Pod/Assets/.gitkeep -------------------------------------------------------------------------------- /Pod/Classes/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mgrebenets/SpriteKitAutoLayout/0c48175ea821fe8019c3405b6de3009810c8c00b/Pod/Classes/.gitkeep -------------------------------------------------------------------------------- /Pod/Classes/NSLayoutConstraint+SKAL.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSLayoutConstraint+SKAL.h 3 | // Pods 4 | // 5 | // Created by Maksym Grebenets on 18/12/2014. 6 | // 7 | // 8 | 9 | @import SpriteKit; 10 | 11 | @interface NSLayoutConstraint (SKAL) 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Pod/Classes/NSLayoutConstraint+SKAL.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSLayoutConstraint+NSLayoutConstraint_SKAL.m 3 | // Pods 4 | // 5 | // Created by Maksym Grebenets on 18/12/2014. 6 | // 7 | // 8 | 9 | #import "NSLayoutConstraint+SKAL.h" 10 | #import "SKNode+SKALInternal.h" 11 | #import "SKALUtils.h" 12 | 13 | @import ObjectiveC.runtime; 14 | 15 | // Make it loadable 16 | SKAL_MAKE_CATEGORIES_LOADABLE(NSLayoutConstraint_SKAL) 17 | 18 | @implementation NSLayoutConstraint (SKAL) 19 | 20 | #pragma mark Swizzled Inializers 21 | + (NSArray *)SKALConstraintsWithVisualFormat:(NSString *)format 22 | options:(NSLayoutFormatOptions)opts 23 | metrics:(NSDictionary *)metrics 24 | views:(NSDictionary *)views 25 | { 26 | // here use the fact that VFH makes no sence with empty views dictionary 27 | // it should even assert when it's nil (TODO: check) 28 | // see the VFH syntax and make sure that at least one in [] format must exist 29 | // https://developer.apple.com/library/ios/documentation/UserExperience/Conceptual/AutolayoutPG/VisualFormatLanguage/VisualFormatLanguage.html 30 | NSParameterAssert(views); 31 | id firstView = views.allValues.firstObject; 32 | NSAssert(firstView, @"Views dictionary must have at least one view!"); 33 | NSMutableDictionary *unwrappedViews = [NSMutableDictionary dictionaryWithDictionary:views]; 34 | if ([firstView isKindOfClass:[SKNode class]]) { 35 | // dealing with SpriteKit support, unwrap all the views 36 | for (NSString *key in views.keyEnumerator) { 37 | unwrappedViews[key] = ((SKNode *)views[key]).internalLayoutProxyView; 38 | } 39 | } 40 | 41 | return [NSLayoutConstraint SKALConstraintsWithVisualFormat:format options:opts metrics:metrics views:unwrappedViews]; 42 | } 43 | 44 | // Initialize with items, attributes and relationship 45 | + (instancetype)SKALConstraintWithItem:(id)view1 46 | attribute:(NSLayoutAttribute)attr1 47 | relatedBy:(NSLayoutRelation)relation 48 | toItem:(id)view2 49 | attribute:(NSLayoutAttribute)attr2 50 | multiplier:(CGFloat)multiplier 51 | constant:(CGFloat)c 52 | { 53 | id unwrappedView1 = view1; 54 | id unwrappedView2 = view2; 55 | if ([view1 isKindOfClass:[SKNode class]]) { 56 | NSAssert(!view2 || [view2 isKindOfClass:[SKNode class]], @"All items must be SKNode subclass!"); 57 | // using for SpriteKit, unwrap views 58 | unwrappedView1 = ((SKNode *) view1).internalLayoutProxyView; 59 | unwrappedView2 = view2 ? ((SKNode *) view2).internalLayoutProxyView : nil; 60 | } 61 | return [NSLayoutConstraint SKALConstraintWithItem:unwrappedView1 attribute:attr1 relatedBy:relation toItem:unwrappedView2 attribute:attr2 multiplier:multiplier constant:c]; 62 | } 63 | 64 | #pragma mark Double Swizzle Guard 65 | 66 | // Declare double swizzle guard 67 | DECLARE_DOUBLE_SWIZZLE_GUARD() 68 | 69 | #pragma mark Loading Category 70 | + (void)load { 71 | // Protect from double swizzling 72 | PROTECT_FROM_DOUBLE_SWIZZLE() 73 | 74 | // Meta class 75 | Class metaClass = object_getClass((id)self); 76 | 77 | // Constraints with VFL 78 | SKALSwizzleMethod(metaClass, @selector(constraintsWithVisualFormat:options:metrics:views:), @selector(SKALConstraintsWithVisualFormat:options:metrics:views:)); 79 | 80 | // Constraint with items 81 | SKALSwizzleMethod(metaClass, @selector(constraintWithItem:attribute:relatedBy:toItem:attribute:multiplier:constant:), @selector(SKALConstraintWithItem:attribute:relatedBy:toItem:attribute:multiplier:constant:)); 82 | 83 | } 84 | 85 | @end 86 | -------------------------------------------------------------------------------- /Pod/Classes/SKALPlatformView+SKALInternal.h: -------------------------------------------------------------------------------- 1 | // 2 | // SKALPlatformView+SKALInternal.h 3 | // SpriteKitAutoLayout 4 | // 5 | // Created by Maksym Grebenets on 17/12/2014. 6 | // 7 | // 8 | 9 | 10 | @import SpriteKit; 11 | #import "SKALUtils.h" 12 | 13 | /** 14 | `SKALPlatformView` an adaptor category extending native platform view class (`UIView` or `NSView`). 15 | */ 16 | @interface SKALPlatformView (SKALInternal) 17 | 18 | /** 19 | Platform specific insert subview method. 20 | @param view The view to insert. 21 | @param index Index to insert the view at. 22 | */ 23 | - (void)SKALInsertSubview:(SKALPlatformView *)view atIndex:(NSInteger)index; 24 | 25 | /** 26 | Platform specific subviews layout. 27 | */ 28 | - (void)SKALLayoutSubviews; 29 | 30 | /** 31 | Returns view's layout rect (aka frame). 32 | @return Layout frame. 33 | */ 34 | - (CGRect)layoutRect; 35 | 36 | @end 37 | -------------------------------------------------------------------------------- /Pod/Classes/SKALPlatformView+SKALInternal.m: -------------------------------------------------------------------------------- 1 | // 2 | // SKALPlatformView+SKALInternal.m 3 | // SpriteKitAutoLayout 4 | // 5 | // Created by Maksym Grebenets on 17/12/2014. 6 | // 7 | // 8 | 9 | #import "SKALPlatformView+SKALInternal.h" 10 | 11 | @implementation SKALPlatformView (SKALInternal) 12 | 13 | #pragma mark - Managing Subviews 14 | - (void)SKALInsertSubview:(SKALPlatformView *)view atIndex:(NSInteger)index { 15 | #if TARGET_OS_IPHONE 16 | [self insertSubview:view atIndex:index]; 17 | #else 18 | // For now just add subview 19 | [self addSubview:view]; 20 | #endif 21 | } 22 | 23 | - (void)SKALLayoutSubviews { 24 | #if TARGET_OS_IPHONE 25 | [self layoutSubviews]; 26 | #else 27 | // For now just add subview 28 | [self layout]; 29 | #endif 30 | } 31 | 32 | #pragma mark - Layout Rect 33 | - (CGRect)layoutRect { 34 | // the root SKView's frame doesn't reflect rotation for iOS 7, fix it here 35 | // works for iOS8 and OSX since SKView is always root and it's origin is zero 36 | // yet returning frame for all other views is correct, since bounds doesn't have origin set 37 | return [self isKindOfClass:[SKView class]] ? self.bounds : self.frame; 38 | } 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /Pod/Classes/SKALUtils.h: -------------------------------------------------------------------------------- 1 | // 2 | // SKALUtils.h 3 | // SpriteKitAutoLayout 4 | // 5 | // Created by Maksym Grebenets on 16/12/2014. 6 | // Copyright (c) 2014 i4nApps. All rights reserved. 7 | // 8 | 9 | /** 10 | Cross platform defines 11 | */ 12 | #if TARGET_OS_IPHONE 13 | #define SKAL_IOS (YES) 14 | #define SKAL_OSX (NO) 15 | #define SKALPlatformView UIView 16 | #define SKALNSStringFromRect NSStringFromCGRect 17 | #define SKALNSStringFromSize NSStringFromCGSize 18 | #define SKALNSStringFromPoint NSStringFromCGPoint 19 | #else 20 | #define SKAL_IOS (NO) 21 | #define SKAL_OSX (YES) 22 | #define SKALPlatformView NSView 23 | #define SKALNSStringFromRect NSStringFromRect 24 | #define SKALNSStringFromSize NSStringFromSize 25 | #define SKALNSStringFromPoint NSStringFromPoint 26 | #endif 27 | 28 | 29 | // TODO: remove for production 30 | //#define SKAL_DEBUG DEBUG 31 | 32 | /** 33 | Logging 34 | */ 35 | #if SKAL_DEBUG 36 | #define SKALLogDebug(FORMAT, ...) fprintf(stderr,"%s\n", [[NSString stringWithFormat:FORMAT, ##__VA_ARGS__] UTF8String]); 37 | #else 38 | #define SKALLogDebug(...) 39 | #endif 40 | 41 | /** 42 | Make categories loadable 43 | */ 44 | #define SKAL_MAKE_CATEGORIES_LOADABLE(UNIQUE_NAME) @interface FORCELOAD_##UNIQUE_NAME : NSObject @end @implementation FORCELOAD_##UNIQUE_NAME @end 45 | 46 | /** 47 | Swizzle method. 48 | @param clazz Class for which the instance method will be swizzled. 49 | @param originalSelector Original selector to be replaced. 50 | @param newSelector New selector to be used instead of original. 51 | */ 52 | extern void SKALSwizzleMethod(Class clazz, SEL originalSelector, SEL newSelector); 53 | 54 | /** 55 | Define double swizzle guard 56 | @abstract A pair of special methods used to detect swizzling and prevent double swizzling 57 | This happens when category is loaded twice, for example for unit testing 58 | it's loaded once as part of test host bundle (app bundle) and then again 59 | as part of unit test bundle. 60 | Using dispatch_once doesn't help, since dispatch token is be different for each app bundle. 61 | 62 | Before swizzled, the method returns FALSE, indicating that no swizzling occured yet. 63 | Once swizzled, new implementation returns TRUE, indicating that swizzling has already happened. 64 | */ 65 | #define DECLARE_DOUBLE_SWIZZLE_GUARD() \ 66 | + (BOOL)SKALCategoryLoaded { return FALSE; } \ 67 | + (BOOL)SKALCategoryLoadedSwizzled { return TRUE; } 68 | 69 | /** 70 | Macro used to protect form double swizzling 71 | Checks if the special class method returns TRUE indicating that this category is already loaded 72 | and then returns. Otherwise swizzle guard method that returns FALSE with method that returns TRUE. 73 | */ 74 | #define PROTECT_FROM_DOUBLE_SWIZZLE() \ 75 | if ([self.class SKALCategoryLoaded]) { \ 76 | NSLog(@"SKAL category on %@ is already loaded!", NSStringFromClass(self.class)); \ 77 | return; \ 78 | } \ 79 | SKALSwizzleMethod(object_getClass((id)self), @selector(SKALCategoryLoaded), @selector(SKALCategoryLoadedSwizzled)); 80 | -------------------------------------------------------------------------------- /Pod/Classes/SKALUtils.m: -------------------------------------------------------------------------------- 1 | // 2 | // SKALUtils.m 3 | // SpriteKitAutoLayout 4 | // 5 | // Created by Maksym Grebenets on 16/12/2014. 6 | // Copyright (c) 2014 i4nApps. All rights reserved. 7 | // 8 | 9 | @import Foundation; 10 | @import ObjectiveC.runtime; 11 | 12 | // Swizzle 13 | void SKALSwizzleMethod(Class clazz, SEL originalSelector, SEL newSelector) { 14 | Method originalMethod = class_getInstanceMethod(clazz, originalSelector); 15 | Method newMethod = class_getInstanceMethod(clazz, newSelector); 16 | if(class_addMethod(clazz, originalSelector, method_getImplementation(newMethod), method_getTypeEncoding(newMethod))) { 17 | class_replaceMethod(clazz, newSelector, method_getImplementation(originalMethod), method_getTypeEncoding(originalMethod)); 18 | } else { 19 | method_exchangeImplementations(originalMethod, newMethod); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Pod/Classes/SKNode+SKAL.h: -------------------------------------------------------------------------------- 1 | // 2 | // SKNode+SKAL.h 3 | // SpriteKitAutoLayout 4 | // 5 | // Created by Maksym Grebenets on 14/12/2014. 6 | // Copyright (c) 2014 i4nApps. All rights reserved. 7 | // 8 | 9 | @import SpriteKit; 10 | 11 | #import "SKView+SKAL.h" 12 | #import "SKALUtils.h" 13 | 14 | /** 15 | Auto Layout extension for `SKNode` 16 | */ 17 | @interface SKNode (SKAL) 18 | 19 | #pragma mark Managing Constraints 20 | /** 21 | Returns the constraints held by the view. 22 | @return View contraints. 23 | */ 24 | - (NSArray *)constraints; 25 | 26 | /** 27 | Adds a constraint on the layout of the receiving view or its subviews. 28 | @param constraint Layout constraint. 29 | */ 30 | - (void)addConstraint:(NSLayoutConstraint *)constraint; 31 | 32 | /** 33 | Adds multiple constraints on the layout of the receiving view or its subviews. 34 | @param constraints Array of constraints to add. 35 | */ 36 | - (void)addConstraints:(NSArray *)constraints; 37 | 38 | /** 39 | Removes the specified constraint from the view. 40 | @param constraint Constraint to remove. 41 | */ 42 | - (void)removeConstraint:(NSLayoutConstraint *)constraint; 43 | 44 | /** 45 | Removes the specified constraints from the view. 46 | @param constraints Array of constraints to remove. 47 | */ 48 | - (void)removeConstraints:(NSArray *)constraints; 49 | 50 | #pragma mark Managing Nodes Layout 51 | 52 | /** 53 | Returns layout proxy view which is a platform specific view. 54 | UIView for UIKit app (iOS). 55 | NSView for AppKit app (OSX). 56 | */ 57 | - (SKALPlatformView *)layoutProxyView; 58 | 59 | /** 60 | Returns the frame of layout proxy view 61 | */ 62 | - (CGRect)layoutFrame; 63 | 64 | /** 65 | Returns dictionary of all child nodes that have name. 66 | Use it for creating constraints with visual formatting language. 67 | @return Dictionary nodes that have name. 68 | */ 69 | - (NSDictionary *)nodesDic; 70 | 71 | /** 72 | Autolayout enabled property. 73 | Enable it for nodes that need to use Auto Layout. 74 | */ 75 | @property (nonatomic, assign, getter=isAutoLayoutEnabled) BOOL autoLayoutEnabled; 76 | 77 | /** 78 | Auto layout nodes recursively. 79 | */ 80 | - (void)autoLayoutNodes; 81 | @end 82 | -------------------------------------------------------------------------------- /Pod/Classes/SKNode+SKAL.m: -------------------------------------------------------------------------------- 1 | // 2 | // SKNode+SKAL.m 3 | // SpriteKitAutoLayout 4 | // 5 | // Created by Maksym Grebenets on 14/12/2014. 6 | // Copyright (c) 2014 i4nApps. All rights reserved. 7 | // 8 | 9 | @import ObjectiveC.runtime; 10 | 11 | #import "SKNode+SKAL.h" 12 | #import "SKNode+SKALInternal.h" 13 | #import "SKALPlatformView+SKALInternal.h" 14 | #import "SKALUtils.h" 15 | 16 | /** 17 | `SizeableNode` protocol used to work with sizeable nodes. 18 | So far it's related `SKSpriteNode` and `SKVideoNode`. 19 | */ 20 | @protocol SizeableNode 21 | @required 22 | /** 23 | Anchor point. 24 | */ 25 | @property (nonatomic) CGPoint anchorPoint; 26 | /** 27 | Size. 28 | */ 29 | @property (nonatomic) CGSize size; 30 | @end 31 | 32 | // Make it loadable 33 | SKAL_MAKE_CATEGORIES_LOADABLE(SKNode_SKAL) 34 | 35 | // SKNode AutoLayout category implementation 36 | @implementation SKNode (SKAL) 37 | 38 | #pragma mark New Child Management Selectors 39 | - (void)removeLayoutProxyViewFromSuperview { 40 | if (self.internalLayoutProxyView.superview) { 41 | [self.internalLayoutProxyView removeFromSuperview]; 42 | } 43 | // OSX crash fix! Tried setting it to nil in swizzled dealloc - no luck. 44 | self.internalLayoutProxyView = nil; 45 | } 46 | 47 | - (void)SKALAddChild:(SKNode *)node { 48 | if (!node.internalLayoutProxyView.superview) { 49 | [self.internalLayoutProxyView addSubview:node.internalLayoutProxyView]; 50 | } 51 | [self SKALAddChild:node]; 52 | } 53 | 54 | - (void)SKALInsertChild:(SKNode *)node atIndex:(NSInteger)index { 55 | if (!node.internalLayoutProxyView.superview) { 56 | [self.internalLayoutProxyView SKALInsertSubview:node.internalLayoutProxyView atIndex:index]; 57 | } 58 | [self SKALInsertChild:node atIndex:index]; 59 | } 60 | 61 | - (void)SKALRemoveChildrenInArray:(NSArray *)nodes { 62 | for (SKNode *node in nodes) { 63 | [node removeLayoutProxyViewFromSuperview]; 64 | } 65 | [self SKALRemoveChildrenInArray:nodes]; 66 | } 67 | 68 | - (void)SKALRemoveAllChildren { 69 | for (SKNode *node in self.children) { 70 | [node removeLayoutProxyViewFromSuperview]; 71 | } 72 | [self SKALRemoveAllChildren]; 73 | } 74 | 75 | - (void)SKALRemoveFromParent { 76 | [self removeLayoutProxyViewFromSuperview]; 77 | [self SKALRemoveFromParent]; 78 | } 79 | 80 | #pragma mark Double Swizzle Guard 81 | 82 | // Declare double swizzle guard 83 | DECLARE_DOUBLE_SWIZZLE_GUARD() 84 | 85 | #pragma mark Loading Category 86 | + (void)load { 87 | static dispatch_once_t onceToken; 88 | dispatch_once(&onceToken, ^{ 89 | // Protect from double swizzling 90 | PROTECT_FROM_DOUBLE_SWIZZLE() 91 | 92 | // Swizzle time! 93 | Class nodeClass = [self class]; 94 | 95 | // Add child 96 | SKALSwizzleMethod(nodeClass, @selector(addChild:), @selector(SKALAddChild:)); 97 | 98 | // Insert child 99 | SKALSwizzleMethod(nodeClass, @selector(insertChild:atIndex:), @selector(SKALInsertChild:atIndex:)); 100 | 101 | // Remove childred in array 102 | SKALSwizzleMethod(nodeClass, @selector(removeChildrenInArray:), @selector(SKALRemoveChildrenInArray:)); 103 | 104 | // Remove all children 105 | SKALSwizzleMethod(nodeClass, @selector(removeAllChildren), @selector(SKALRemoveAllChildren)); 106 | 107 | // Remove from parent 108 | SKALSwizzleMethod(nodeClass, @selector(removeFromParent), @selector(SKALRemoveFromParent)); 109 | }); 110 | } 111 | 112 | #pragma mark - Managing Constraints 113 | - (NSArray *)constraints { 114 | return self.internalLayoutProxyView.constraints; 115 | } 116 | 117 | - (void)addConstraint:(NSLayoutConstraint *)constraint { 118 | [self.internalLayoutProxyView addConstraint:constraint]; 119 | } 120 | 121 | - (void)addConstraints:(NSArray *)constraints { 122 | [self.internalLayoutProxyView addConstraints:constraints]; 123 | } 124 | 125 | - (void)removeConstraint:(NSLayoutConstraint *)constraint { 126 | [self.internalLayoutProxyView removeConstraint:constraint]; 127 | } 128 | 129 | - (void)removeConstraints:(NSArray *)constraints { 130 | [self.internalLayoutProxyView removeConstraints:constraints]; 131 | } 132 | 133 | #pragma mark - Managing Layout 134 | - (SKALPlatformView *)layoutProxyView { 135 | return self.internalLayoutProxyView; 136 | } 137 | 138 | - (CGRect)layoutFrame { 139 | return self.layoutProxyView.frame; 140 | } 141 | 142 | - (NSDictionary *)nodesDic { 143 | NSMutableDictionary *namedNodes = [NSMutableDictionary dictionaryWithCapacity:self.children.count]; 144 | // Return only those children which have names 145 | [self enumerateChildNodesWithName:@"*" usingBlock:^(SKNode *node, BOOL *stop) { 146 | if (![node.name isEqualToString:@""]) { 147 | namedNodes[node.name] = node; 148 | } 149 | }]; 150 | return namedNodes; 151 | } 152 | 153 | @dynamic autoLayoutEnabled; 154 | - (void)setAutoLayoutEnabled:(BOOL)enabled { 155 | objc_setAssociatedObject(self, @selector(isAutoLayoutEnabled), @(enabled), OBJC_ASSOCIATION_ASSIGN); 156 | if (enabled) { 157 | self.internalLayoutProxyView.translatesAutoresizingMaskIntoConstraints = NO; 158 | } else { 159 | self.internalLayoutProxyView = nil; 160 | } 161 | } 162 | 163 | - (BOOL)isAutoLayoutEnabled { 164 | return [objc_getAssociatedObject(self, @selector(isAutoLayoutEnabled)) boolValue]; 165 | } 166 | 167 | - (void)autoLayoutNodes { 168 | SKALLogDebug(@"\n===Layout for %@===", self.name); 169 | [self layoutNodesRecursively]; 170 | } 171 | 172 | + (CGRect)flippedFrame:(CGRect)frame inParentRect:(CGRect)parentRect { 173 | return CGRectOffset(frame, 0, (CGRectGetHeight(parentRect) - 2 * frame.origin.y) * self.flipMultiplier); 174 | } 175 | 176 | - (void)layoutNodesRecursively { 177 | // need to add layout proxy view each time 178 | // there are cases like presenting scene for 1st time where nested nodes 179 | // would not be sized properly without this call 180 | [self.internalLayoutProxyView SKALLayoutSubviews]; 181 | 182 | // TODO: scene's anchor point will break things 183 | 184 | for (SKNode *child in self.children) { 185 | // Ignore autolayout for those nodes which we did not create 186 | // for example a Sprite node with text inside SKLabelNode 187 | if (!child.isAutoLayoutEnabled) { 188 | SKALLogDebug(@"\n\t--->Ignoring AutoLayout for child node\n\t\tName: %@\n\t\tClass: %@\n\t\tParent: %@", NSStringFromClass(child.class), child.name, self.name); 189 | continue; 190 | } 191 | 192 | // Flip the frame if required 193 | // to make visual formatting language fully compatible with UIKit/AppKit 194 | CGRect flippedFrame = [self.class flippedFrame:child.internalLayoutProxyView.layoutRect inParentRect:self.internalLayoutProxyView.layoutRect]; 195 | 196 | SKALLogDebug(@"\n---%@---\n\tParent proxy frame: %@\n\tChild proxy frame: %@\n\tFlipped proxy frame: %@\n\tParent node frame: %@\n\tChild node frame: %@", child.name, SKALNSStringFromRect(self.internalLayoutProxyView.layoutRect), SKALNSStringFromRect(child.internalLayoutProxyView.layoutRect), SKALNSStringFromRect(flippedFrame), SKALNSStringFromRect(self.frame), SKALNSStringFromRect(child.frame)); 197 | 198 | // Sizeable vs Sizeless nodes 199 | if ([child respondsToSelector:@selector(setSize:)]) { 200 | SKNode *sizeableChild = (SKNode *)child; 201 | // Set the size 202 | sizeableChild.size = flippedFrame.size; 203 | // set the position using frame's origin and node's anchor point 204 | // Also take flip into account 205 | sizeableChild.position = CGPointMake(flippedFrame.origin.x + sizeableChild.size.width * (sizeableChild.anchorPoint.x), flippedFrame.origin.y + sizeableChild.size.height * (sizeableChild.anchorPoint.y - self.class.flipMultiplier)); 206 | 207 | SKALLogDebug(@"\tSizeable(%@)\n\tframe: %@\n\tsize: %@\n\tanchor: %@\n\tposition: %@", child.name, SKALNSStringFromRect(sizeableChild.frame), SKALNSStringFromSize(sizeableChild.size), SKALNSStringFromPoint(sizeableChild.anchorPoint), SKALNSStringFromPoint(sizeableChild.position)); 208 | } else { 209 | // child position taking this child's frame into account and flip 210 | child.position = CGPointMake(flippedFrame.origin.x + CGRectGetWidth(child.frame) / 2, flippedFrame.origin.y - self.class.flipMultiplier * CGRectGetHeight(flippedFrame)); 211 | 212 | SKALLogDebug(@"\tSizeless(%@)\n\tframe: %@\n\tposition: %@", child.name, SKALNSStringFromRect(child.frame), SKALNSStringFromPoint(child.position)); 213 | } 214 | 215 | [child layoutNodesRecursively]; 216 | } 217 | } 218 | @end 219 | -------------------------------------------------------------------------------- /Pod/Classes/SKNode+SKALInternal.h: -------------------------------------------------------------------------------- 1 | // 2 | // SKNode+SKALInternal.h 3 | // SpriteKitAutoLayout 4 | // 5 | // Created by Maksym Grebenets on 16/12/2014. 6 | // Copyright (c) 2014 i4nApps. All rights reserved. 7 | // 8 | 9 | @import SpriteKit; 10 | #import "SKALUtils.h" 11 | 12 | /** 13 | Internal `SKNode` Auto Layout category. 14 | */ 15 | @interface SKNode (SKALInternal) 16 | /** 17 | Internal layout proxy view. 18 | Loaded laizily when node is added as a child. 19 | For scenes set with container SKView when scene is presented. 20 | */ 21 | @property (nonatomic, strong) SKALPlatformView *internalLayoutProxyView; 22 | 23 | /** 24 | Customazible Y coordinate flip flag. 25 | @return `YES` if Y coordinate is flipped. 26 | */ 27 | + (BOOL)isFlipped; 28 | 29 | /** 30 | Flip multiplier. 31 | @return Current flip multiplier. 32 | */ 33 | + (CGFloat)flipMultiplier; 34 | @end 35 | -------------------------------------------------------------------------------- /Pod/Classes/SKNode+SKALInternal.m: -------------------------------------------------------------------------------- 1 | // 2 | // SKNode+SKALInternal.m 3 | // SpriteKitAutoLayout 4 | // 5 | // Created by Maksym Grebenets on 16/12/2014. 6 | // Copyright (c) 2014 i4nApps. All rights reserved. 7 | // 8 | 9 | @import ObjectiveC.runtime; 10 | #import "SKNode+SKAL.h" 11 | #import "SKNode+SKALInternal.h" 12 | #import "SKALUtils.h" 13 | 14 | @implementation SKNode (SKALInternal) 15 | 16 | #pragma mark Layout Proxy View Property 17 | @dynamic internalLayoutProxyView; 18 | 19 | - (void)setInternalLayoutProxyView:(SKALPlatformView *)internalLayoutProxyView { 20 | objc_setAssociatedObject(self, @selector(internalLayoutProxyView), internalLayoutProxyView, OBJC_ASSOCIATION_RETAIN_NONATOMIC); 21 | } 22 | 23 | - (SKALPlatformView *)internalLayoutProxyView { 24 | SKALPlatformView *localLayoutProxyView = objc_getAssociatedObject(self, @selector(internalLayoutProxyView)); 25 | 26 | if (!localLayoutProxyView) { 27 | // TODO: consider using specific platform subclass for nodes that have 28 | // intrinsic size, e.g. backup SKLabelNode with UI/NSLabel 29 | // with same text, font and font size 30 | // though it adds additional burden of updating backing view 31 | // when label is updated 32 | // same goes for SKSpriteNode backup up by UIImageView or alike... 33 | 34 | // Make sure this proxy view is set to nil when node is no more to avoid OSX crashes! 35 | // look into swizzled "remove child" methods 36 | localLayoutProxyView = [[SKALPlatformView alloc] initWithFrame:self.frame]; 37 | localLayoutProxyView.hidden = YES; // want them hidden, those are just proxies 38 | self.internalLayoutProxyView = localLayoutProxyView; 39 | } 40 | 41 | return localLayoutProxyView; 42 | } 43 | 44 | #pragma mark Flipped Geometry 45 | + (BOOL)isFlipped { 46 | // Return YES for UIKit, NO for AppKit 47 | // to account for compatibility so that "V:|" alignemtns means "top" 48 | // This is needed since SpriteKit has it's coordinate system origin at bottom left corner by default 49 | 50 | // TODO: needs more research, this way works with default iOS setup 51 | // and with OSX setup where the root NSView returns YES for isFlipped 52 | return SKAL_IOS; 53 | } 54 | 55 | + (CGFloat)flipMultiplier { 56 | return self.isFlipped ? 1.0f : 0.0f; 57 | } 58 | 59 | @end 60 | -------------------------------------------------------------------------------- /Pod/Classes/SKView+SKAL.h: -------------------------------------------------------------------------------- 1 | // 2 | // SKView+SKAL.h 3 | // SpriteKitAutoLayout 4 | // 5 | // Created by Maksym Grebenets on 16/12/2014. 6 | // Copyright (c) 2014 i4nApps. All rights reserved. 7 | // 8 | 9 | @import SpriteKit; 10 | 11 | /** 12 | `SKView` AutoLayout category. 13 | */ 14 | @interface SKView (SKAL) 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /Pod/Classes/SKView+SKAL.m: -------------------------------------------------------------------------------- 1 | // 2 | // SKView+SKAL.m 3 | // SpriteKitAutoLayout 4 | // 5 | // Created by Maksym Grebenets on 16/12/2014. 6 | // Copyright (c) 2014 i4nApps. All rights reserved. 7 | // 8 | 9 | @import ObjectiveC.runtime; 10 | 11 | #import "SKView+SKAL.h" 12 | #import "SKNode+SKALInternal.h" 13 | #import "SKALUtils.h" 14 | 15 | // Make it loadable 16 | SKAL_MAKE_CATEGORIES_LOADABLE(SKView_SKAL) 17 | 18 | // SKView AutoLayout category implementation 19 | @implementation SKView (SKAL) 20 | 21 | #pragma mark - Presenting Scene 22 | 23 | #pragma mark New Scene Management Selectors 24 | - (void)prepareForPresentingScene:(SKScene *)scene { 25 | 26 | // remove constraints 27 | [scene.internalLayoutProxyView removeConstraints:scene.internalLayoutProxyView.constraints]; 28 | 29 | // if don't copy will crash on OSX because mutating array while enumerating 30 | NSArray *subviews = [self.subviews copy]; 31 | for (SKALPlatformView *subview in subviews) { 32 | if (subview.superview) { 33 | [subview removeFromSuperview]; 34 | } 35 | } 36 | 37 | // Cause of OSX crashes if internal proxy views are not released properly (see node management) 38 | scene.internalLayoutProxyView = self; 39 | } 40 | 41 | - (void)SKALPresentScene:(SKScene *)scene { 42 | [self prepareForPresentingScene:scene]; 43 | [self SKALPresentScene:scene]; 44 | } 45 | 46 | - (void)SKALPresentScene:(SKScene *)scene transition:(SKTransition *)transition { 47 | [self prepareForPresentingScene:scene]; 48 | [self SKALPresentScene:scene transition:transition]; 49 | } 50 | 51 | #pragma mark Double Swizzle Guard 52 | 53 | // Declare double swizzle guard 54 | DECLARE_DOUBLE_SWIZZLE_GUARD() 55 | 56 | #pragma mark Loading Category 57 | + (void)load { 58 | static dispatch_once_t onceToken; 59 | dispatch_once(&onceToken, ^{ 60 | // Protect from double swizzling 61 | PROTECT_FROM_DOUBLE_SWIZZLE() 62 | 63 | // Swizzle time! 64 | Class viewClass = [self class]; 65 | 66 | // Present scene 67 | SKALSwizzleMethod(viewClass, @selector(presentScene:), @selector(SKALPresentScene:)); 68 | 69 | // Present scene with transition 70 | SKALSwizzleMethod(viewClass, @selector(presentScene:transition:), @selector(SKALPresentScene:transition:)); 71 | }); 72 | } 73 | 74 | @end -------------------------------------------------------------------------------- /Pod/Classes/SpriteKitAutoLayout.h: -------------------------------------------------------------------------------- 1 | // 2 | // SpriteKitAutoLayout.h 3 | // SpriteKitAutoLayout 4 | // 5 | // Created by Maksym Grebenets on 16/12/2014. 6 | // Copyright (c) 2014 i4nApps. All rights reserved. 7 | // 8 | 9 | // Umbrella Header 10 | 11 | #import "SKNode+SKAL.h" 12 | #import "NSLayoutConstraint+SKAL.h" 13 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # SpriteKitAutoLayout 2 | 3 | [![CI Status](http://img.shields.io/travis/mgrebenets/SpriteKitAutoLayout.svg?style=flat)](https://travis-ci.org/mgrebenets/SpriteKitAutoLayout) 4 | [![Version](https://img.shields.io/cocoapods/v/SpriteKitAutoLayout.svg?style=flat)](http://cocoadocs.org/docsets/SpriteKitAutoLayout) 5 | [![License](https://img.shields.io/cocoapods/l/SpriteKitAutoLayout.svg?style=flat)](http://cocoadocs.org/docsets/SpriteKitAutoLayout) 6 | [![Platform](https://img.shields.io/cocoapods/p/SpriteKitAutoLayout.svg?style=flat)](http://cocoadocs.org/docsets/SpriteKitAutoLayout) 7 | 8 | SpriteKitAutoLayout (SKAL) is a framework that brings the power of [Auto Layout](https://developer.apple.com/library/ios/documentation/UserExperience/Conceptual/AutolayoutPG/Introduction/Introduction.html) to your [SpriteKit](https://developer.apple.com/library/ios/documentation/GraphicsAnimation/Conceptual/SpriteKit_PG/Introduction/Introduction.html) apps. 9 | 10 | [![SpriteKitAutoLayout](http://img.youtube.com/vi/5BaXF5eCJp4/0.jpg)](http://www.youtube.com/watch?v=5BaXF5eCJp4) 11 | 12 | ## Good / Bad For 13 | SpriteKitAutoLayout is **good** for the same purpose Auto Layout is good with UIKit or AppKit, that is to layout your app UI elements, such as buttons, labels, etc. Auto Layout will handle your UI layout when your scene size changes (on rotation for iOS or window resize on OSX). 14 | 15 | It is **not good** for things that don't need any layout as such. For example a sprite that represents one of your (game) characters, which moves around, changes it's scale, rotates, animates and does other crazy things. 16 | 17 | ## Installation 18 | 19 | SpriteKitAutoLayout is available through [CocoaPods](http://cocoapods.org). To install it, simply add the following line to your Podfile: 20 | 21 | pod "SpriteKitAutoLayout" 22 | 23 | ## Usage 24 | 25 | Start with including the header file. 26 | 27 | ```objective-c 28 | #import 29 | ``` 30 | 31 | Put it in your Bridging Header if your project is Swift project. 32 | 33 | That's pretty much it in regards to configuration, now you can use Auto Layout for SpriteKit nodes the same way you do that for UIKit/AppKit views. 34 | 35 | The major difference is that you have to set `autoLayoutEnabled` to `true`, this is similar to setting `translatesAutoresizingMaskIntoConstraints` to `NO` in UIKit/AppKit. 36 | 37 | You also have to call `layoutNodes` method of `SKScene` excplicitly. The best way to do that is in `didChangeSize:` implementation. Note, that you have to dispatch it asynchronously on main queue if you want you UI updates to be properly applied. 38 | 39 | ```swift 40 | import SpriteKit 41 | 42 | class DemoScene: SKScene { 43 | override func didMoveToView(view: SKView) { 44 | super.didMoveToView(view) 45 | 46 | self.scaleMode = .ResizeFill 47 | self.name = "DemoScene" 48 | 49 | // Add label to put it left bottom corner 50 | let leftBottomLabel = SKLabelNode() 51 | leftBottomLabel.text = "Left Bottom" 52 | leftBottomLabel.name = "leftBottomLabel" // a C language identifier 53 | leftBottomLabel.autoLayoutEnabled = true // enable autolayout for this node 54 | addChild(leftBottomLabel) 55 | 56 | // Add color sprite with non-default anchor point to put in the center 57 | let centerSprite = SKSpriteNode(color: SKColor.greenColor(), size: CGSizeZero) 58 | centerSprite.name = "centerSprite" 59 | centerSprite.anchorPoint = CGPoint(x: 1, y: 1) // non-default anchor point 60 | centerSprite.autoLayoutEnabled = true 61 | addChild(centerSprite) 62 | 63 | // Get dictionary of all nodes in this scene 64 | let nodesDic = self.nodesDic() // self. is required to avoid compile error 65 | 66 | // Configure Auto Layout constraints 67 | 68 | // Pin label to left bottom corner, use label's intrinsic size 69 | let width = Float(leftBottomLabel.frame.width) 70 | var format = "H:|[leftBottomLabel(\(width))]" 71 | var constraints = NSLayoutConstraint.constraintsWithVisualFormat(format, options: .DirectionLeadingToTrailing, metrics: nil, views: nodesDic) 72 | addConstraints(constraints) // add constraints 73 | 74 | let height = Float(leftBottomLabel.frame.height) 75 | format = "V:|[leftBottomLabel(\(height))]" 76 | constraints = NSLayoutConstraint.constraintsWithVisualFormat(format, options: .DirectionLeadingToTrailing, metrics: nil, views: nodesDic) 77 | addConstraints(constraints) // add constraints 78 | 79 | // Put color sprite in the center 80 | // Make it's size related to parent (aka "superview") 81 | 82 | // Constraint center (x, y) to parent's (x, y) 83 | // it's save to do it here because parent is skene filling whole SKView 84 | var constraint = NSLayoutConstraint(item: centerSprite, attribute: .CenterX, relatedBy: .Equal, toItem: self, attribute: .CenterX, multiplier: 1, constant: 0) 85 | addConstraint(constraint) 86 | constraint = NSLayoutConstraint(item: centerSprite, attribute: .CenterY, relatedBy: .Equal, toItem: self, attribute: .CenterY, multiplier: 1, constant: 0) 87 | addConstraint(constraint) 88 | 89 | // Make the the centerSprite's width to be 20% of the parent's width 90 | constraint = NSLayoutConstraint(item: centerSprite, attribute: .Width, relatedBy: .Equal, toItem: self, attribute: .Width, multiplier: 0.2, constant: 0) 91 | addConstraint(constraint) 92 | 93 | // Make the centerSprite's height to be equal to centerSprite's width 94 | constraint = NSLayoutConstraint(item: centerSprite, attribute: .Height, relatedBy: .Equal, toItem: centerSprite, attribute: .Height, multiplier: 1, constant: 0) 95 | centerSprite.addConstraint(constraint) // centerSprite's constraint on itself 96 | } 97 | 98 | override func didChangeSize(oldSize: CGSize) { 99 | dispatch_async(dispatch_get_main_queue()) { 100 | layoutNodes() 101 | } 102 | } 103 | } 104 | ``` 105 | 106 | ### Use With Other Auto Layout Frameworks 107 | 108 | Want to use it with other Auto Layout wrappers and helpers? 109 | 110 | No problem, use SKNode's `layoutProxyView()` read-only property exposed since `0.2.0`. 111 | 112 | For example, this is what you code would look like with [Cartography](https://github.com/robb/Cartography). 113 | 114 | ```swift 115 | let button = SKSpriteNode(color: SKColor.greenColor(), size: CGSizeZero) 116 | button.autoLayoutEnabled = true 117 | addChild(button) 118 | 119 | layout(button.layoutProxyView()) { button in 120 | // button in closure is not the same as 'let button' declared before 121 | button.left == button.superview!.left // same as "H:|[button]" 122 | button.bottom == button.superview!.bottom // same as "V:|[button]" 123 | button.height == button.superview!.height * 0.1 124 | button.width == button.height 125 | } 126 | ``` 127 | 128 | ## Example 129 | 130 | To run the example project, clone the repo, and run `pod install` from the Example directory first. 131 | 132 | ## Requirements 133 | 134 | Just like SpriteKit itself SpriteKitAutoLayout is available both for iOS and OSX platforms. 135 | 136 | - Min iOS version is 7.0 137 | - Min OSX version is 10.9 138 | 139 | ## Limitations & Issues 140 | 141 | - Setting constraints for SKLabelNode is tricky if you want to use `.CenterX`, `.CenterY` or other attributes. 142 | - No support for intrinsic size on labels and sprites. 143 | 144 | ## Roadmap 145 | 146 | - Support for non-default anchor points for SKScene. Now works fine with (0.5, 0.5) only. 147 | - Support for concept of intrinsic size for SKLabelNode and SKSpriteNode. 148 | - More and more unit tests! 149 | - Make it more lightweight by using dummy subclass of CALayer for UIView instances. 150 | 151 | ## Author 152 | 153 | Maksym Grebenets, mgrebenets@gmail.com 154 | 155 | ## License 156 | 157 | SpriteKitAutoLayout is available under the MIT license. See the LICENSE file for more info. 158 | 159 | -------------------------------------------------------------------------------- /SpriteKitAutoLayout.podspec: -------------------------------------------------------------------------------- 1 | Pod::Spec.new do |s| 2 | s.name = "SpriteKitAutoLayout" 3 | s.version = "0.3.1" 4 | s.summary = "Auto Layout support for SpriteKit (iOS & OSX)" 5 | s.description = <<-DESC 6 | This library enables Auto Layout support for SpriteKit. 7 | Works both for iOS and OSX. 8 | DESC 9 | s.homepage = "https://github.com/mgrebenets/SpriteKitAutoLayout" 10 | # s.screenshots = "www.example.com/screenshots_1", "www.example.com/screenshots_2" 11 | s.license = 'MIT' 12 | s.author = { "Maksym Grebenets" => "mgrebenets@gmail.com" } 13 | s.source = { :git => "https://github.com/mgrebenets/SpriteKitAutoLayout.git", :tag => s.version.to_s } 14 | s.social_media_url = 'https://twitter.com/mgrebenets' 15 | 16 | # all platforms, so no s.platform here 17 | s.requires_arc = true 18 | 19 | s.source_files = 'Pod/Classes' 20 | s.public_header_files = ['Pod/Classes/**/*.h'] 21 | s.private_header_files = ['Pod/Classes/**/*Internal*.h'] 22 | s.frameworks = 'SpriteKit' 23 | #s.xcconfig = { 'GCC_PREPROCESSOR_DEFINITIONS[config=Debug]' => '$(inherited) SKAL_DEBUG=1' } 24 | end 25 | --------------------------------------------------------------------------------