├── .gitignore ├── .travis.yml ├── CMakeLists.txt ├── LICENSE ├── README.md ├── build.sh ├── icons ├── app │ ├── Icon@2x~ipad.png │ ├── Icon~ipad.png │ └── Icon~iphone.png ├── settings │ ├── Icon-Small.png │ └── Icon@2x.png └── spotlight │ ├── Icon.png │ └── Icon~ipad.png ├── images ├── ipad │ ├── Default-Landscape@2x~ipad.png │ ├── Default-Landscape~ipad.png │ ├── Default-Portrait@2x~ipad.png │ └── Default-Portrait~ipad.png └── iphone │ ├── Default-568h@2x.png │ └── Default@2x.png ├── plist.in ├── sources ├── AppDelegate.hpp ├── AppDelegate.mm ├── ViewController.hpp ├── ViewController.mm └── main.mm └── storyboards ├── MainStoryboard_iPad.storyboard └── MainStoryboard_iPhone.storyboard /.gitignore: -------------------------------------------------------------------------------- 1 | # mac 2 | .DS_Store 3 | */.DS_Store 4 | */*/.DS_Store 5 | */*/*/.DS_Store 6 | 7 | # temp build/install directories 8 | _builds/* 9 | _install/* 10 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: 2 | - objective-c 3 | 4 | before_install: 5 | - brew update 6 | 7 | install: 8 | - brew install cmake 9 | - cmake --version 10 | 11 | script: 12 | - chmod +x build.sh 13 | - ./build.sh 14 | -------------------------------------------------------------------------------- /CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2014, Ruslan Baratov 2 | # All rights reserved. 3 | 4 | cmake_minimum_required(VERSION 2.8.11) 5 | project(testapp) 6 | 7 | ### Emulate toolchain 8 | set(CMAKE_OSX_SYSROOT "iphoneos") 9 | set(CMAKE_XCODE_EFFECTIVE_PLATFORMS "-iphoneos;-iphonesimulator") 10 | set(CMAKE_DEBUG_POSTFIX d) 11 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") 12 | ### -- end 13 | 14 | if(NOT XCODE_VERSION) 15 | message(FATAL_ERROR "Xcode only") 16 | endif() 17 | 18 | set( 19 | SOURCES 20 | sources/AppDelegate.hpp 21 | sources/AppDelegate.mm 22 | sources/ViewController.hpp 23 | sources/ViewController.mm 24 | sources/main.mm 25 | ) 26 | 27 | set( 28 | IMAGES 29 | images/iphone/Default@2x.png # Retina, 640x960 30 | images/iphone/Default-568h@2x.png # Retina 4-inch, 640x1136 31 | # See plist.in: 32 | images/ipad/Default-Portrait~ipad.png # Portrait Non-Retina, 768x1024 33 | images/ipad/Default-Portrait@2x~ipad.png # Portrait Retina, 1536x2048 34 | images/ipad/Default-Landscape~ipad.png # Landscape Non-Retina, 1024x768 35 | images/ipad/Default-Landscape@2x~ipad.png # Landscape Retina, 2048x1536 36 | ) 37 | 38 | set( 39 | ICONS 40 | icons/app/Icon~iphone.png # iPhone Retina, 120x120 41 | icons/app/Icon~ipad.png # iPad Non-Retina, 76x76 42 | icons/app/Icon@2x~ipad.png # iPad Retina, 152x152 43 | icons/spotlight/Icon.png # iPhone/iPad Retina, 80x80 44 | icons/spotlight/Icon~ipad.png # iPad Non-Retina, 40x40 45 | icons/settings/Icon@2x.png # iPhone Retina, 58x58 46 | icons/settings/Icon-Small.png # iPad Non-Retina 29x29 47 | ) 48 | 49 | set( 50 | STORYBOARDS 51 | storyboards/MainStoryboard_iPad.storyboard 52 | storyboards/MainStoryboard_iPhone.storyboard 53 | ) 54 | 55 | add_executable( 56 | testapp 57 | ${ICONS} 58 | ${IMAGES} 59 | ${SOURCES} 60 | ${STORYBOARDS} 61 | ) 62 | 63 | set_target_properties( 64 | testapp 65 | PROPERTIES 66 | MACOSX_BUNDLE YES 67 | MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_LIST_DIR}/plist.in" 68 | XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "iPhone Developer" 69 | XCODE_ATTRIBUTE_TARGETED_DEVICE_FAMILY "1,2" 70 | XCODE_ATTRIBUTE_CLANG_ENABLE_OBJC_ARC YES 71 | XCODE_ATTRIBUTE_INSTALL_PATH "${CMAKE_BINARY_DIR}/ProductRelease" 72 | XCODE_ATTRIBUTE_COMBINE_HIDPI_IMAGES "NO" 73 | RESOURCE "${IMAGES};${STORYBOARDS};${ICONS}" 74 | ) 75 | 76 | set_target_properties( 77 | testapp 78 | PROPERTIES 79 | XCODE_ATTRIBUTE_PRODUCT_NAME 80 | "TestApp" 81 | XCODE_ATTRIBUTE_BUNDLE_IDENTIFIER 82 | "com.github.ruslo.TestApp" 83 | ) 84 | 85 | set_target_properties( 86 | testapp 87 | PROPERTIES 88 | XCODE_ATTRIBUTE_PRODUCT_NAME[variant=Debug] 89 | "TestApp-Dbg" 90 | XCODE_ATTRIBUTE_BUNDLE_IDENTIFIER[variant=Debug] 91 | "com.github.ruslo.TestApp.debug" 92 | ) 93 | 94 | target_link_libraries( 95 | testapp 96 | "-framework CoreGraphics" 97 | "-framework Foundation" 98 | "-framework UIKit" 99 | ) 100 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2014, forexample 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | 7 | * Redistributions of source code must retain the above copyright notice, this 8 | list of conditions and the following disclaimer. 9 | 10 | * Redistributions in binary form must reproduce the above copyright notice, 11 | this list of conditions and the following disclaimer in the documentation 12 | and/or other materials provided with the distribution. 13 | 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 15 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 17 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 18 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 20 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 21 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 22 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 23 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [![Build Status](https://travis-ci.org/forexample/testapp.svg?branch=master)](https://travis-ci.org/forexample/testapp) 2 | 3 | Simple iOS Application with iPad and iPhone storyboards. 4 | 5 | #### Usage: 6 | 7 | ```bash 8 | > git clone https://github.com/forexample/testapp 9 | > cd ./testapp 10 | > chmod +x build.sh 11 | > ./build.sh 12 | ``` 13 | -------------------------------------------------------------------------------- /build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e 2 | 3 | set -x 4 | 5 | rm -rf _builds 6 | 7 | cmake -H. -B_builds -GXcode 8 | 9 | open _builds/*.xcodeproj 10 | -------------------------------------------------------------------------------- /icons/app/Icon@2x~ipad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/forexample/testapp/9202304134862f043af740af27dc7efb3b3f565d/icons/app/Icon@2x~ipad.png -------------------------------------------------------------------------------- /icons/app/Icon~ipad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/forexample/testapp/9202304134862f043af740af27dc7efb3b3f565d/icons/app/Icon~ipad.png -------------------------------------------------------------------------------- /icons/app/Icon~iphone.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/forexample/testapp/9202304134862f043af740af27dc7efb3b3f565d/icons/app/Icon~iphone.png -------------------------------------------------------------------------------- /icons/settings/Icon-Small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/forexample/testapp/9202304134862f043af740af27dc7efb3b3f565d/icons/settings/Icon-Small.png -------------------------------------------------------------------------------- /icons/settings/Icon@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/forexample/testapp/9202304134862f043af740af27dc7efb3b3f565d/icons/settings/Icon@2x.png -------------------------------------------------------------------------------- /icons/spotlight/Icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/forexample/testapp/9202304134862f043af740af27dc7efb3b3f565d/icons/spotlight/Icon.png -------------------------------------------------------------------------------- /icons/spotlight/Icon~ipad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/forexample/testapp/9202304134862f043af740af27dc7efb3b3f565d/icons/spotlight/Icon~ipad.png -------------------------------------------------------------------------------- /images/ipad/Default-Landscape@2x~ipad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/forexample/testapp/9202304134862f043af740af27dc7efb3b3f565d/images/ipad/Default-Landscape@2x~ipad.png -------------------------------------------------------------------------------- /images/ipad/Default-Landscape~ipad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/forexample/testapp/9202304134862f043af740af27dc7efb3b3f565d/images/ipad/Default-Landscape~ipad.png -------------------------------------------------------------------------------- /images/ipad/Default-Portrait@2x~ipad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/forexample/testapp/9202304134862f043af740af27dc7efb3b3f565d/images/ipad/Default-Portrait@2x~ipad.png -------------------------------------------------------------------------------- /images/ipad/Default-Portrait~ipad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/forexample/testapp/9202304134862f043af740af27dc7efb3b3f565d/images/ipad/Default-Portrait~ipad.png -------------------------------------------------------------------------------- /images/iphone/Default-568h@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/forexample/testapp/9202304134862f043af740af27dc7efb3b3f565d/images/iphone/Default-568h@2x.png -------------------------------------------------------------------------------- /images/iphone/Default@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/forexample/testapp/9202304134862f043af740af27dc7efb3b3f565d/images/iphone/Default@2x.png -------------------------------------------------------------------------------- /plist.in: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 10 | CFBundleDevelopmentRegion 11 | en 12 | CFBundleDisplayName 13 | $(PRODUCT_NAME) 14 | CFBundleExecutable 15 | ${MACOSX_BUNDLE_EXECUTABLE_NAME} 16 | CFBundleGetInfoString 17 | ${MACOSX_BUNDLE_INFO_STRING} 18 | CFBundleIconFile 19 | ${MACOSX_BUNDLE_ICON_FILE} 20 | CFBundleIdentifier 21 | $(BUNDLE_IDENTIFIER) 22 | CFBundleInfoDictionaryVersion 23 | 6.0 24 | CFBundleLongVersionString 25 | ${MACOSX_BUNDLE_LONG_VERSION_STRING} 26 | CFBundleName 27 | ${MACOSX_BUNDLE_BUNDLE_NAME} 28 | CFBundlePackageType 29 | APPL 30 | CFBundleShortVersionString 31 | 1.0 32 | CFBundleSignature 33 | ???? 34 | CFBundleVersion 35 | 1.0 36 | CSResourcesFileMapped 37 | 38 | NSHumanReadableCopyright 39 | ${MACOSX_BUNDLE_COPYRIGHT} 40 | LSRequiresIPhoneOS 41 | 42 | UIRequiredDeviceCapabilities 43 | 44 | armv7 45 | 46 | UISupportedInterfaceOrientations 47 | 48 | UIInterfaceOrientationPortrait 49 | UIInterfaceOrientationLandscapeLeft 50 | UIInterfaceOrientationLandscapeRight 51 | 52 | UISupportedInterfaceOrientations~ipad 53 | 54 | UIInterfaceOrientationPortrait 55 | UIInterfaceOrientationPortraitUpsideDown 56 | UIInterfaceOrientationLandscapeLeft 57 | UIInterfaceOrientationLandscapeRight 58 | 59 | UILaunchImages~ipad 60 | 61 | 62 | UILaunchImageMinimumOSVersion 63 | 7.0 64 | UILaunchImageName 65 | Default-Landscape 66 | UILaunchImageOrientation 67 | Landscape 68 | UILaunchImageSize 69 | {768, 1024} 70 | 71 | 72 | UILaunchImageMinimumOSVersion 73 | 7.0 74 | UILaunchImageName 75 | Default-Portrait 76 | UILaunchImageOrientation 77 | Portrait 78 | UILaunchImageSize 79 | {768, 1024} 80 | 81 | 82 | UIMainStoryboardFile 83 | MainStoryboard_iPhone 84 | UIMainStoryboardFile~ipad 85 | MainStoryboard_iPad 86 | 87 | 88 | -------------------------------------------------------------------------------- /sources/AppDelegate.hpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2013, Ruslan Baratov 2 | // All rights reserved. 3 | 4 | #import // UIApplicationDelegate 5 | #import // UIResponder 6 | 7 | @class UIWindow; 8 | 9 | @interface AppDelegate : UIResponder 10 | 11 | @property (strong, nonatomic) UIWindow *window; // The app delegate 12 | // must implement the window property if it wants to 13 | // use a main storyboard file 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /sources/AppDelegate.mm: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2013, Ruslan Baratov 2 | // All rights reserved. 3 | 4 | #import "AppDelegate.hpp" 5 | 6 | @implementation AppDelegate 7 | 8 | @synthesize window = _window; 9 | 10 | #pragma mark - UIApplicationDelegate implementation 11 | 12 | - (BOOL)application:(UIApplication *)application 13 | didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 14 | // Override point for customization after application launch. 15 | return YES; 16 | } 17 | 18 | - (void)applicationWillResignActive:(UIApplication *)application { 19 | // Sent when the application is about to move from active to inactive 20 | // state. This can occur for certain types of temporary interruptions 21 | // (such as an incoming phone call or SMS message) or when the user 22 | // quits the application and it begins the transition to the background 23 | // state. Use this method to pause ongoing tasks, disable timers, and 24 | // throttle down OpenGL ES frame rates. Games should use this method 25 | // to pause the game. 26 | } 27 | 28 | - (void)applicationDidEnterBackground:(UIApplication *)application { 29 | // Use this method to release shared resources, save user data, 30 | // invalidate timers, and store enough application state information 31 | // to restore your application to its current state in case it is 32 | // terminated later. 33 | // If your application supports background execution, 34 | // this method is called instead of applicationWillTerminate: 35 | // when the user quits. 36 | } 37 | 38 | - (void)applicationWillEnterForeground:(UIApplication *)application { 39 | // Called as part of the transition from the background to the inactive 40 | // state; here you can undo many of the changes made on entering 41 | // the background. 42 | } 43 | 44 | - (void)applicationDidBecomeActive:(UIApplication *)application { 45 | // Restart any tasks that were paused (or not yet started) while 46 | // the application was inactive. If the application was previously 47 | // in the background, optionally refresh the user interface. 48 | } 49 | 50 | - (void)applicationWillTerminate:(UIApplication *)application { 51 | // Called when the application is about to terminate. 52 | // Save data if appropriate. See also applicationDidEnterBackground:. 53 | } 54 | 55 | @end 56 | -------------------------------------------------------------------------------- /sources/ViewController.hpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2013, Ruslan Baratov 2 | // All rights reserved. 3 | 4 | #import // UIViewController 5 | 6 | @interface ViewController : UIViewController 7 | 8 | @end 9 | -------------------------------------------------------------------------------- /sources/ViewController.mm: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2013, Ruslan Baratov 2 | // All rights reserved. 3 | 4 | #import "ViewController.hpp" 5 | 6 | @interface ViewController () 7 | 8 | @end 9 | 10 | @implementation ViewController 11 | 12 | #pragma mark - UIViewContoller override 13 | 14 | - (void)viewDidLoad { 15 | [super viewDidLoad]; 16 | // Do any additional setup after loading the view, typically from a nib. 17 | } 18 | 19 | - (void)didReceiveMemoryWarning { 20 | [super didReceiveMemoryWarning]; 21 | // Dispose of any resources that can be recreated. 22 | } 23 | 24 | @end 25 | -------------------------------------------------------------------------------- /sources/main.mm: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2013-2014, Ruslan Baratov 2 | // All rights reserved. 3 | 4 | #import "AppDelegate.hpp" // AppDelegate 5 | 6 | int main(int argc, char *argv[]) { 7 | @autoreleasepool { 8 | NSString *principalClassName = nullptr; // UIApplication is assumed 9 | return UIApplicationMain( 10 | argc, argv, principalClassName, NSStringFromClass([AppDelegate class]) 11 | ); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /storyboards/MainStoryboard_iPad.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /storyboards/MainStoryboard_iPhone.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | --------------------------------------------------------------------------------