From aba8dd3356b0832dc1c11c4fbff6e2f1f0292dda Mon Sep 17 00:00:00 2001 From: Baris Sencan Date: Tue, 24 Feb 2015 22:41:56 -0800 Subject: [PATCH 1/2] Initial commit for examples --- Examples/SimpleExample/Cartfile | 1 + Examples/SimpleExample/Cartfile.resolved | 1 + .../SimpleExample.xcodeproj/project.pbxproj | 418 ++++++++++++++++++ .../contents.xcworkspacedata | 7 + .../SimpleExample/AppDelegate.swift | 24 + .../SimpleExample/Base.lproj/LaunchScreen.xib | 41 ++ .../SimpleExample/ExampleViewController.swift | 58 +++ .../AppIcon.appiconset/Contents.json | 68 +++ .../SimpleExample/SimpleExample/Info.plist | 47 ++ .../SimpleExampleTests/Info.plist | 24 + .../SimpleExampleTests.swift | 36 ++ 11 files changed, 725 insertions(+) create mode 100644 Examples/SimpleExample/Cartfile create mode 100644 Examples/SimpleExample/Cartfile.resolved create mode 100644 Examples/SimpleExample/SimpleExample.xcodeproj/project.pbxproj create mode 100644 Examples/SimpleExample/SimpleExample.xcodeproj/project.xcworkspace/contents.xcworkspacedata create mode 100644 Examples/SimpleExample/SimpleExample/AppDelegate.swift create mode 100644 Examples/SimpleExample/SimpleExample/Base.lproj/LaunchScreen.xib create mode 100644 Examples/SimpleExample/SimpleExample/ExampleViewController.swift create mode 100644 Examples/SimpleExample/SimpleExample/Images.xcassets/AppIcon.appiconset/Contents.json create mode 100644 Examples/SimpleExample/SimpleExample/Info.plist create mode 100644 Examples/SimpleExample/SimpleExampleTests/Info.plist create mode 100644 Examples/SimpleExample/SimpleExampleTests/SimpleExampleTests.swift diff --git a/Examples/SimpleExample/Cartfile b/Examples/SimpleExample/Cartfile new file mode 100644 index 0000000..9202f74 --- /dev/null +++ b/Examples/SimpleExample/Cartfile @@ -0,0 +1 @@ +github "isair/ManualLayout" diff --git a/Examples/SimpleExample/Cartfile.resolved b/Examples/SimpleExample/Cartfile.resolved new file mode 100644 index 0000000..e5375bb --- /dev/null +++ b/Examples/SimpleExample/Cartfile.resolved @@ -0,0 +1 @@ +github "isair/ManualLayout" "0.2.0" diff --git a/Examples/SimpleExample/SimpleExample.xcodeproj/project.pbxproj b/Examples/SimpleExample/SimpleExample.xcodeproj/project.pbxproj new file mode 100644 index 0000000..275e994 --- /dev/null +++ b/Examples/SimpleExample/SimpleExample.xcodeproj/project.pbxproj @@ -0,0 +1,418 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 5F67BC1A1A9D9F9200347483 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5F67BC191A9D9F9200347483 /* AppDelegate.swift */; }; + 5F67BC1C1A9D9F9200347483 /* ExampleViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5F67BC1B1A9D9F9200347483 /* ExampleViewController.swift */; }; + 5F67BC211A9D9F9200347483 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 5F67BC201A9D9F9200347483 /* Images.xcassets */; }; + 5F67BC241A9D9F9200347483 /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 5F67BC221A9D9F9200347483 /* LaunchScreen.xib */; }; + 5F67BC301A9D9F9200347483 /* SimpleExampleTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5F67BC2F1A9D9F9200347483 /* SimpleExampleTests.swift */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 5F67BC2A1A9D9F9200347483 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 5F67BC0C1A9D9F9200347483 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 5F67BC131A9D9F9200347483; + remoteInfo = SimpleExample; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 5F67BC141A9D9F9200347483 /* SimpleExample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SimpleExample.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 5F67BC181A9D9F9200347483 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 5F67BC191A9D9F9200347483 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + 5F67BC1B1A9D9F9200347483 /* ExampleViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ExampleViewController.swift; sourceTree = ""; }; + 5F67BC201A9D9F9200347483 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; + 5F67BC231A9D9F9200347483 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = ""; }; + 5F67BC291A9D9F9200347483 /* SimpleExampleTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = SimpleExampleTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + 5F67BC2E1A9D9F9200347483 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 5F67BC2F1A9D9F9200347483 /* SimpleExampleTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SimpleExampleTests.swift; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 5F67BC111A9D9F9200347483 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 5F67BC261A9D9F9200347483 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 5F67BC0B1A9D9F9200347483 = { + isa = PBXGroup; + children = ( + 5F67BC161A9D9F9200347483 /* SimpleExample */, + 5F67BC2C1A9D9F9200347483 /* SimpleExampleTests */, + 5F67BC151A9D9F9200347483 /* Products */, + ); + sourceTree = ""; + }; + 5F67BC151A9D9F9200347483 /* Products */ = { + isa = PBXGroup; + children = ( + 5F67BC141A9D9F9200347483 /* SimpleExample.app */, + 5F67BC291A9D9F9200347483 /* SimpleExampleTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 5F67BC161A9D9F9200347483 /* SimpleExample */ = { + isa = PBXGroup; + children = ( + 5F67BC191A9D9F9200347483 /* AppDelegate.swift */, + 5F67BC1B1A9D9F9200347483 /* ExampleViewController.swift */, + 5F67BC391A9DA02800347483 /* Resources */, + 5F67BC171A9D9F9200347483 /* Supporting Files */, + ); + path = SimpleExample; + sourceTree = ""; + }; + 5F67BC171A9D9F9200347483 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 5F67BC181A9D9F9200347483 /* Info.plist */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; + 5F67BC2C1A9D9F9200347483 /* SimpleExampleTests */ = { + isa = PBXGroup; + children = ( + 5F67BC2F1A9D9F9200347483 /* SimpleExampleTests.swift */, + 5F67BC2D1A9D9F9200347483 /* Supporting Files */, + ); + path = SimpleExampleTests; + sourceTree = ""; + }; + 5F67BC2D1A9D9F9200347483 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 5F67BC2E1A9D9F9200347483 /* Info.plist */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; + 5F67BC391A9DA02800347483 /* Resources */ = { + isa = PBXGroup; + children = ( + 5F67BC221A9D9F9200347483 /* LaunchScreen.xib */, + 5F67BC201A9D9F9200347483 /* Images.xcassets */, + ); + name = Resources; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 5F67BC131A9D9F9200347483 /* SimpleExample */ = { + isa = PBXNativeTarget; + buildConfigurationList = 5F67BC331A9D9F9200347483 /* Build configuration list for PBXNativeTarget "SimpleExample" */; + buildPhases = ( + 5F67BC101A9D9F9200347483 /* Sources */, + 5F67BC111A9D9F9200347483 /* Frameworks */, + 5F67BC121A9D9F9200347483 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = SimpleExample; + productName = SimpleExample; + productReference = 5F67BC141A9D9F9200347483 /* SimpleExample.app */; + productType = "com.apple.product-type.application"; + }; + 5F67BC281A9D9F9200347483 /* SimpleExampleTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 5F67BC361A9D9F9200347483 /* Build configuration list for PBXNativeTarget "SimpleExampleTests" */; + buildPhases = ( + 5F67BC251A9D9F9200347483 /* Sources */, + 5F67BC261A9D9F9200347483 /* Frameworks */, + 5F67BC271A9D9F9200347483 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 5F67BC2B1A9D9F9200347483 /* PBXTargetDependency */, + ); + name = SimpleExampleTests; + productName = SimpleExampleTests; + productReference = 5F67BC291A9D9F9200347483 /* SimpleExampleTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 5F67BC0C1A9D9F9200347483 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0610; + ORGANIZATIONNAME = "Baris Sencan"; + TargetAttributes = { + 5F67BC131A9D9F9200347483 = { + CreatedOnToolsVersion = 6.1.1; + }; + 5F67BC281A9D9F9200347483 = { + CreatedOnToolsVersion = 6.1.1; + TestTargetID = 5F67BC131A9D9F9200347483; + }; + }; + }; + buildConfigurationList = 5F67BC0F1A9D9F9200347483 /* Build configuration list for PBXProject "SimpleExample" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 5F67BC0B1A9D9F9200347483; + productRefGroup = 5F67BC151A9D9F9200347483 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 5F67BC131A9D9F9200347483 /* SimpleExample */, + 5F67BC281A9D9F9200347483 /* SimpleExampleTests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 5F67BC121A9D9F9200347483 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 5F67BC241A9D9F9200347483 /* LaunchScreen.xib in Resources */, + 5F67BC211A9D9F9200347483 /* Images.xcassets in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 5F67BC271A9D9F9200347483 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 5F67BC101A9D9F9200347483 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 5F67BC1C1A9D9F9200347483 /* ExampleViewController.swift in Sources */, + 5F67BC1A1A9D9F9200347483 /* AppDelegate.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 5F67BC251A9D9F9200347483 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 5F67BC301A9D9F9200347483 /* SimpleExampleTests.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 5F67BC2B1A9D9F9200347483 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 5F67BC131A9D9F9200347483 /* SimpleExample */; + targetProxy = 5F67BC2A1A9D9F9200347483 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + 5F67BC221A9D9F9200347483 /* LaunchScreen.xib */ = { + isa = PBXVariantGroup; + children = ( + 5F67BC231A9D9F9200347483 /* Base */, + ); + name = LaunchScreen.xib; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 5F67BC311A9D9F9200347483 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_SYMBOLS_PRIVATE_EXTERN = NO; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 8.1; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + 5F67BC321A9D9F9200347483 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = YES; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 8.1; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 5F67BC341A9D9F9200347483 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + INFOPLIST_FILE = SimpleExample/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Debug; + }; + 5F67BC351A9D9F9200347483 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + INFOPLIST_FILE = SimpleExample/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Release; + }; + 5F67BC371A9D9F9200347483 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + ); + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + INFOPLIST_FILE = SimpleExampleTests/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_NAME = "$(TARGET_NAME)"; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/SimpleExample.app/SimpleExample"; + }; + name = Debug; + }; + 5F67BC381A9D9F9200347483 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + ); + INFOPLIST_FILE = SimpleExampleTests/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_NAME = "$(TARGET_NAME)"; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/SimpleExample.app/SimpleExample"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 5F67BC0F1A9D9F9200347483 /* Build configuration list for PBXProject "SimpleExample" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 5F67BC311A9D9F9200347483 /* Debug */, + 5F67BC321A9D9F9200347483 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 5F67BC331A9D9F9200347483 /* Build configuration list for PBXNativeTarget "SimpleExample" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 5F67BC341A9D9F9200347483 /* Debug */, + 5F67BC351A9D9F9200347483 /* Release */, + ); + defaultConfigurationIsVisible = 0; + }; + 5F67BC361A9D9F9200347483 /* Build configuration list for PBXNativeTarget "SimpleExampleTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 5F67BC371A9D9F9200347483 /* Debug */, + 5F67BC381A9D9F9200347483 /* Release */, + ); + defaultConfigurationIsVisible = 0; + }; +/* End XCConfigurationList section */ + }; + rootObject = 5F67BC0C1A9D9F9200347483 /* Project object */; +} diff --git a/Examples/SimpleExample/SimpleExample.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/Examples/SimpleExample/SimpleExample.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..0816af4 --- /dev/null +++ b/Examples/SimpleExample/SimpleExample.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/Examples/SimpleExample/SimpleExample/AppDelegate.swift b/Examples/SimpleExample/SimpleExample/AppDelegate.swift new file mode 100644 index 0000000..0d6a0ad --- /dev/null +++ b/Examples/SimpleExample/SimpleExample/AppDelegate.swift @@ -0,0 +1,24 @@ +// +// AppDelegate.swift +// SimpleExample +// +// Created by Baris Sencan on 24/02/15. +// Copyright (c) 2015 Baris Sencan. All rights reserved. +// + +import UIKit + +@UIApplicationMain +class AppDelegate: UIResponder, UIApplicationDelegate { + var window: UIWindow? + + func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { + let window = UIWindow(frame: UIScreen.mainScreen().bounds) + window.backgroundColor = UIColor.whiteColor() + window.rootViewController = ExampleViewController() + window.makeKeyAndVisible() + self.window = window + return true + } +} + diff --git a/Examples/SimpleExample/SimpleExample/Base.lproj/LaunchScreen.xib b/Examples/SimpleExample/SimpleExample/Base.lproj/LaunchScreen.xib new file mode 100644 index 0000000..4671a0c --- /dev/null +++ b/Examples/SimpleExample/SimpleExample/Base.lproj/LaunchScreen.xib @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Examples/SimpleExample/SimpleExample/ExampleViewController.swift b/Examples/SimpleExample/SimpleExample/ExampleViewController.swift new file mode 100644 index 0000000..6ddcc0f --- /dev/null +++ b/Examples/SimpleExample/SimpleExample/ExampleViewController.swift @@ -0,0 +1,58 @@ +// +// ViewController.swift +// SimpleExample +// +// Created by Baris Sencan on 24/02/15. +// Copyright (c) 2015 Baris Sencan. All rights reserved. +// + +import UIKit +import ManualLayout + +internal final class ExampleViewController: UIViewController { + let titleLabel = UILabel(frame: CGRectZero) + let subtitleLabel = UILabel(frame: CGRectZero) + let yinView = UIView(frame: CGRectZero) + + override init() { + super.init(nibName: nil, bundle: nil) + titleLabel.attributedText = NSAttributedString( + string: "Hello World!", + attributes: generateTextStyle()) + subtitleLabel.attributedText = NSAttributedString( + string: "Lorem ipsum dolor sit amet, consectetur adipiscing elit.", + attributes: generateTextStyle(smaller: true) + yinView.backgroundColor = UIColor.blackColor() + } + + required override init(coder aDecoder: NSCoder) { + fatalError("storyboards are incompatible with truth and beauty") + } + + override func viewDidLoad() { + super.viewDidLoad() + view.backgroundColor = UIColor.whiteColor() + view.addSubview(titleLabel) + view.addSubview(subtitleLabel) + view.addSubview(yinView) + } + + override func viewWillLayoutSubviews() { + titleLabel.sizeToFit() + titleLabel.top = 20 + titleLabel.centerX = view.centerX + subtitleLabel.sizeToFit() + subtitleLabel.top = titleLabel.bottom + 8 + subtitleLabel.centerX = view.centerX + yinView.top = view.height / 2 + yinView.right2 = view.width + yinView.bottom2 = view.height + } + + private func generateTextStyle(smaller: Bool = false) -> [NSObject: AnyObject] { + return [ + NSFontAttributeName: UIFont.systemFontOfSize(smaller ? 14 : 16), + NSForegroundColorAttributeName: UIColor.blackColor() + ] + } +} diff --git a/Examples/SimpleExample/SimpleExample/Images.xcassets/AppIcon.appiconset/Contents.json b/Examples/SimpleExample/SimpleExample/Images.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..36d2c80 --- /dev/null +++ b/Examples/SimpleExample/SimpleExample/Images.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,68 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "3x" + }, + { + "idiom" : "ipad", + "size" : "29x29", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "40x40", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "76x76", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "76x76", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Examples/SimpleExample/SimpleExample/Info.plist b/Examples/SimpleExample/SimpleExample/Info.plist new file mode 100644 index 0000000..f2a67e9 --- /dev/null +++ b/Examples/SimpleExample/SimpleExample/Info.plist @@ -0,0 +1,47 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + com.bsencan.ManualLayout.$(PRODUCT_NAME:rfc1034identifier) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + LSRequiresIPhoneOS + + UILaunchStoryboardName + LaunchScreen + UIMainStoryboardFile + Main + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/Examples/SimpleExample/SimpleExampleTests/Info.plist b/Examples/SimpleExample/SimpleExampleTests/Info.plist new file mode 100644 index 0000000..0a22b38 --- /dev/null +++ b/Examples/SimpleExample/SimpleExampleTests/Info.plist @@ -0,0 +1,24 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + com.bsencan.ManualLayout.$(PRODUCT_NAME:rfc1034identifier) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + + diff --git a/Examples/SimpleExample/SimpleExampleTests/SimpleExampleTests.swift b/Examples/SimpleExample/SimpleExampleTests/SimpleExampleTests.swift new file mode 100644 index 0000000..25e6f88 --- /dev/null +++ b/Examples/SimpleExample/SimpleExampleTests/SimpleExampleTests.swift @@ -0,0 +1,36 @@ +// +// SimpleExampleTests.swift +// SimpleExampleTests +// +// Created by Baris Sencan on 24/02/15. +// Copyright (c) 2015 Baris Sencan. All rights reserved. +// + +import UIKit +import XCTest + +class SimpleExampleTests: XCTestCase { + + override func setUp() { + super.setUp() + // Put setup code here. This method is called before the invocation of each test method in the class. + } + + override func tearDown() { + // Put teardown code here. This method is called after the invocation of each test method in the class. + super.tearDown() + } + + func testExample() { + // This is an example of a functional test case. + XCTAssert(true, "Pass") + } + + func testPerformanceExample() { + // This is an example of a performance test case. + self.measureBlock() { + // Put the code you want to measure the time of here. + } + } + +} From f145508f5c4a2a5ad10d4429717cc7ac89dde8a9 Mon Sep 17 00:00:00 2001 From: Baris Sencan Date: Wed, 25 Feb 2015 00:12:07 -0800 Subject: [PATCH 2/2] Complete first example --- .../SimpleExample.xcodeproj/project.pbxproj | 28 +++++++++++++++++++ .../SimpleExample/ExampleViewController.swift | 10 +++---- .../SimpleExample/SimpleExample/Info.plist | 2 -- 3 files changed, 33 insertions(+), 7 deletions(-) diff --git a/Examples/SimpleExample/SimpleExample.xcodeproj/project.pbxproj b/Examples/SimpleExample/SimpleExample.xcodeproj/project.pbxproj index 275e994..653f93d 100644 --- a/Examples/SimpleExample/SimpleExample.xcodeproj/project.pbxproj +++ b/Examples/SimpleExample/SimpleExample.xcodeproj/project.pbxproj @@ -12,6 +12,8 @@ 5F67BC211A9D9F9200347483 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 5F67BC201A9D9F9200347483 /* Images.xcassets */; }; 5F67BC241A9D9F9200347483 /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 5F67BC221A9D9F9200347483 /* LaunchScreen.xib */; }; 5F67BC301A9D9F9200347483 /* SimpleExampleTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5F67BC2F1A9D9F9200347483 /* SimpleExampleTests.swift */; }; + 5F67BC3B1A9DB71100347483 /* ManualLayout.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5F67BC3A1A9DB71100347483 /* ManualLayout.framework */; }; + 5F67BC3C1A9DB71100347483 /* ManualLayout.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 5F67BC3A1A9DB71100347483 /* ManualLayout.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -24,6 +26,20 @@ }; /* End PBXContainerItemProxy section */ +/* Begin PBXCopyFilesBuildPhase section */ + 5F67BC3D1A9DB71100347483 /* Embed Frameworks */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 10; + files = ( + 5F67BC3C1A9DB71100347483 /* ManualLayout.framework in Embed Frameworks */, + ); + name = "Embed Frameworks"; + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXCopyFilesBuildPhase section */ + /* Begin PBXFileReference section */ 5F67BC141A9D9F9200347483 /* SimpleExample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SimpleExample.app; sourceTree = BUILT_PRODUCTS_DIR; }; 5F67BC181A9D9F9200347483 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; @@ -34,6 +50,7 @@ 5F67BC291A9D9F9200347483 /* SimpleExampleTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = SimpleExampleTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 5F67BC2E1A9D9F9200347483 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 5F67BC2F1A9D9F9200347483 /* SimpleExampleTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SimpleExampleTests.swift; sourceTree = ""; }; + 5F67BC3A1A9DB71100347483 /* ManualLayout.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ManualLayout.framework; path = Carthage/Build/iOS/ManualLayout.framework; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -41,6 +58,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 5F67BC3B1A9DB71100347483 /* ManualLayout.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -57,6 +75,7 @@ 5F67BC0B1A9D9F9200347483 = { isa = PBXGroup; children = ( + 5F67BC3A1A9DB71100347483 /* ManualLayout.framework */, 5F67BC161A9D9F9200347483 /* SimpleExample */, 5F67BC2C1A9D9F9200347483 /* SimpleExampleTests */, 5F67BC151A9D9F9200347483 /* Products */, @@ -127,6 +146,7 @@ 5F67BC101A9D9F9200347483 /* Sources */, 5F67BC111A9D9F9200347483 /* Frameworks */, 5F67BC121A9D9F9200347483 /* Resources */, + 5F67BC3D1A9DB71100347483 /* Embed Frameworks */, ); buildRules = ( ); @@ -334,6 +354,10 @@ isa = XCBuildConfiguration; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/Carthage/Build/iOS", + ); INFOPLIST_FILE = SimpleExample/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -344,6 +368,10 @@ isa = XCBuildConfiguration; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/Carthage/Build/iOS", + ); INFOPLIST_FILE = SimpleExample/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_NAME = "$(TARGET_NAME)"; diff --git a/Examples/SimpleExample/SimpleExample/ExampleViewController.swift b/Examples/SimpleExample/SimpleExample/ExampleViewController.swift index 6ddcc0f..07ac996 100644 --- a/Examples/SimpleExample/SimpleExample/ExampleViewController.swift +++ b/Examples/SimpleExample/SimpleExample/ExampleViewController.swift @@ -21,11 +21,11 @@ internal final class ExampleViewController: UIViewController { attributes: generateTextStyle()) subtitleLabel.attributedText = NSAttributedString( string: "Lorem ipsum dolor sit amet, consectetur adipiscing elit.", - attributes: generateTextStyle(smaller: true) - yinView.backgroundColor = UIColor.blackColor() + attributes: generateTextStyle(smaller: true)) + yinView.backgroundColor = UIColor.blackColor() } - required override init(coder aDecoder: NSCoder) { + required init(coder aDecoder: NSCoder) { fatalError("storyboards are incompatible with truth and beauty") } @@ -39,7 +39,7 @@ internal final class ExampleViewController: UIViewController { override func viewWillLayoutSubviews() { titleLabel.sizeToFit() - titleLabel.top = 20 + titleLabel.top = 40 titleLabel.centerX = view.centerX subtitleLabel.sizeToFit() subtitleLabel.top = titleLabel.bottom + 8 @@ -51,7 +51,7 @@ internal final class ExampleViewController: UIViewController { private func generateTextStyle(smaller: Bool = false) -> [NSObject: AnyObject] { return [ - NSFontAttributeName: UIFont.systemFontOfSize(smaller ? 14 : 16), + NSFontAttributeName: UIFont.systemFontOfSize(smaller ? 14 : 18), NSForegroundColorAttributeName: UIColor.blackColor() ] } diff --git a/Examples/SimpleExample/SimpleExample/Info.plist b/Examples/SimpleExample/SimpleExample/Info.plist index f2a67e9..232a7c2 100644 --- a/Examples/SimpleExample/SimpleExample/Info.plist +++ b/Examples/SimpleExample/SimpleExample/Info.plist @@ -24,8 +24,6 @@ UILaunchStoryboardName LaunchScreen - UIMainStoryboardFile - Main UIRequiredDeviceCapabilities armv7