From 0bf4cfb9e7815955a712c5c045572f44e96aa1be Mon Sep 17 00:00:00 2001 From: Jacob Krall Date: Sun, 9 Feb 2014 15:47:09 -0500 Subject: [PATCH 01/13] Created YATC project --- .gitignore | 3 + YATC.xcodeproj/project.pbxproj | 476 ++++++++++++++++++ YATC/Base.lproj/Main.storyboard | 26 + .../AppIcon.appiconset/Contents.json | 23 + .../LaunchImage.launchimage/Contents.json | 23 + YATC/TCAppDelegate.h | 15 + YATC/TCAppDelegate.m | 46 ++ YATC/TCViewController.h | 13 + YATC/TCViewController.m | 29 ++ YATC/YATC-Info.plist | 40 ++ YATC/YATC-Prefix.pch | 16 + YATC/en.lproj/InfoPlist.strings | 2 + YATC/main.m | 18 + YATCTests/YATCTests-Info.plist | 22 + YATCTests/YATCTests.m | 34 ++ YATCTests/en.lproj/InfoPlist.strings | 2 + 16 files changed, 788 insertions(+) create mode 100644 .gitignore create mode 100644 YATC.xcodeproj/project.pbxproj create mode 100644 YATC/Base.lproj/Main.storyboard create mode 100644 YATC/Images.xcassets/AppIcon.appiconset/Contents.json create mode 100644 YATC/Images.xcassets/LaunchImage.launchimage/Contents.json create mode 100644 YATC/TCAppDelegate.h create mode 100644 YATC/TCAppDelegate.m create mode 100644 YATC/TCViewController.h create mode 100644 YATC/TCViewController.m create mode 100644 YATC/YATC-Info.plist create mode 100644 YATC/YATC-Prefix.pch create mode 100644 YATC/en.lproj/InfoPlist.strings create mode 100644 YATC/main.m create mode 100644 YATCTests/YATCTests-Info.plist create mode 100644 YATCTests/YATCTests.m create mode 100644 YATCTests/en.lproj/InfoPlist.strings diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..6ff7573 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +**/*.xcworkspace +xcuserdata +*.pbxuser diff --git a/YATC.xcodeproj/project.pbxproj b/YATC.xcodeproj/project.pbxproj new file mode 100644 index 0000000..2c6e62e --- /dev/null +++ b/YATC.xcodeproj/project.pbxproj @@ -0,0 +1,476 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 16736E6718A81FE600404622 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 16736E6618A81FE600404622 /* Foundation.framework */; }; + 16736E6918A81FE600404622 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 16736E6818A81FE600404622 /* CoreGraphics.framework */; }; + 16736E6B18A81FE600404622 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 16736E6A18A81FE600404622 /* UIKit.framework */; }; + 16736E7118A81FE600404622 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 16736E6F18A81FE600404622 /* InfoPlist.strings */; }; + 16736E7318A81FE600404622 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 16736E7218A81FE600404622 /* main.m */; }; + 16736E7718A81FE600404622 /* TCAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 16736E7618A81FE600404622 /* TCAppDelegate.m */; }; + 16736E7A18A81FE600404622 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 16736E7818A81FE600404622 /* Main.storyboard */; }; + 16736E7D18A81FE600404622 /* TCViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 16736E7C18A81FE600404622 /* TCViewController.m */; }; + 16736E7F18A81FE600404622 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 16736E7E18A81FE600404622 /* Images.xcassets */; }; + 16736E8618A81FE600404622 /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 16736E8518A81FE600404622 /* XCTest.framework */; }; + 16736E8718A81FE600404622 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 16736E6618A81FE600404622 /* Foundation.framework */; }; + 16736E8818A81FE600404622 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 16736E6A18A81FE600404622 /* UIKit.framework */; }; + 16736E9018A81FE600404622 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 16736E8E18A81FE600404622 /* InfoPlist.strings */; }; + 16736E9218A81FE600404622 /* YATCTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 16736E9118A81FE600404622 /* YATCTests.m */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 16736E8918A81FE600404622 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 16736E5B18A81FE600404622 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 16736E6218A81FE600404622; + remoteInfo = YATC; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 16736E6318A81FE600404622 /* YATC.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = YATC.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 16736E6618A81FE600404622 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; + 16736E6818A81FE600404622 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; + 16736E6A18A81FE600404622 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; + 16736E6E18A81FE600404622 /* YATC-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "YATC-Info.plist"; sourceTree = ""; }; + 16736E7018A81FE600404622 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 16736E7218A81FE600404622 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + 16736E7418A81FE600404622 /* YATC-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "YATC-Prefix.pch"; sourceTree = ""; }; + 16736E7518A81FE600404622 /* TCAppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = TCAppDelegate.h; sourceTree = ""; }; + 16736E7618A81FE600404622 /* TCAppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = TCAppDelegate.m; sourceTree = ""; }; + 16736E7918A81FE600404622 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 16736E7B18A81FE600404622 /* TCViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = TCViewController.h; sourceTree = ""; }; + 16736E7C18A81FE600404622 /* TCViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = TCViewController.m; sourceTree = ""; }; + 16736E7E18A81FE600404622 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; + 16736E8418A81FE600404622 /* YATCTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = YATCTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + 16736E8518A81FE600404622 /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; + 16736E8D18A81FE600404622 /* YATCTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "YATCTests-Info.plist"; sourceTree = ""; }; + 16736E8F18A81FE600404622 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 16736E9118A81FE600404622 /* YATCTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = YATCTests.m; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 16736E6018A81FE600404622 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 16736E6918A81FE600404622 /* CoreGraphics.framework in Frameworks */, + 16736E6B18A81FE600404622 /* UIKit.framework in Frameworks */, + 16736E6718A81FE600404622 /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 16736E8118A81FE600404622 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 16736E8618A81FE600404622 /* XCTest.framework in Frameworks */, + 16736E8818A81FE600404622 /* UIKit.framework in Frameworks */, + 16736E8718A81FE600404622 /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 16736E5A18A81FE600404622 = { + isa = PBXGroup; + children = ( + 16736E6C18A81FE600404622 /* YATC */, + 16736E8B18A81FE600404622 /* YATCTests */, + 16736E6518A81FE600404622 /* Frameworks */, + 16736E6418A81FE600404622 /* Products */, + ); + sourceTree = ""; + }; + 16736E6418A81FE600404622 /* Products */ = { + isa = PBXGroup; + children = ( + 16736E6318A81FE600404622 /* YATC.app */, + 16736E8418A81FE600404622 /* YATCTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 16736E6518A81FE600404622 /* Frameworks */ = { + isa = PBXGroup; + children = ( + 16736E6618A81FE600404622 /* Foundation.framework */, + 16736E6818A81FE600404622 /* CoreGraphics.framework */, + 16736E6A18A81FE600404622 /* UIKit.framework */, + 16736E8518A81FE600404622 /* XCTest.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + 16736E6C18A81FE600404622 /* YATC */ = { + isa = PBXGroup; + children = ( + 16736E7518A81FE600404622 /* TCAppDelegate.h */, + 16736E7618A81FE600404622 /* TCAppDelegate.m */, + 16736E7818A81FE600404622 /* Main.storyboard */, + 16736E7B18A81FE600404622 /* TCViewController.h */, + 16736E7C18A81FE600404622 /* TCViewController.m */, + 16736E7E18A81FE600404622 /* Images.xcassets */, + 16736E6D18A81FE600404622 /* Supporting Files */, + ); + path = YATC; + sourceTree = ""; + }; + 16736E6D18A81FE600404622 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 16736E6E18A81FE600404622 /* YATC-Info.plist */, + 16736E6F18A81FE600404622 /* InfoPlist.strings */, + 16736E7218A81FE600404622 /* main.m */, + 16736E7418A81FE600404622 /* YATC-Prefix.pch */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; + 16736E8B18A81FE600404622 /* YATCTests */ = { + isa = PBXGroup; + children = ( + 16736E9118A81FE600404622 /* YATCTests.m */, + 16736E8C18A81FE600404622 /* Supporting Files */, + ); + path = YATCTests; + sourceTree = ""; + }; + 16736E8C18A81FE600404622 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 16736E8D18A81FE600404622 /* YATCTests-Info.plist */, + 16736E8E18A81FE600404622 /* InfoPlist.strings */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 16736E6218A81FE600404622 /* YATC */ = { + isa = PBXNativeTarget; + buildConfigurationList = 16736E9518A81FE600404622 /* Build configuration list for PBXNativeTarget "YATC" */; + buildPhases = ( + 16736E5F18A81FE600404622 /* Sources */, + 16736E6018A81FE600404622 /* Frameworks */, + 16736E6118A81FE600404622 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = YATC; + productName = YATC; + productReference = 16736E6318A81FE600404622 /* YATC.app */; + productType = "com.apple.product-type.application"; + }; + 16736E8318A81FE600404622 /* YATCTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 16736E9818A81FE600404622 /* Build configuration list for PBXNativeTarget "YATCTests" */; + buildPhases = ( + 16736E8018A81FE600404622 /* Sources */, + 16736E8118A81FE600404622 /* Frameworks */, + 16736E8218A81FE600404622 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 16736E8A18A81FE600404622 /* PBXTargetDependency */, + ); + name = YATCTests; + productName = YATCTests; + productReference = 16736E8418A81FE600404622 /* YATCTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 16736E5B18A81FE600404622 /* Project object */ = { + isa = PBXProject; + attributes = { + CLASSPREFIX = TC; + LastUpgradeCheck = 0500; + ORGANIZATIONNAME = "Jacob Krall"; + TargetAttributes = { + 16736E8318A81FE600404622 = { + TestTargetID = 16736E6218A81FE600404622; + }; + }; + }; + buildConfigurationList = 16736E5E18A81FE600404622 /* Build configuration list for PBXProject "YATC" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 16736E5A18A81FE600404622; + productRefGroup = 16736E6418A81FE600404622 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 16736E6218A81FE600404622 /* YATC */, + 16736E8318A81FE600404622 /* YATCTests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 16736E6118A81FE600404622 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 16736E7F18A81FE600404622 /* Images.xcassets in Resources */, + 16736E7118A81FE600404622 /* InfoPlist.strings in Resources */, + 16736E7A18A81FE600404622 /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 16736E8218A81FE600404622 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 16736E9018A81FE600404622 /* InfoPlist.strings in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 16736E5F18A81FE600404622 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 16736E7D18A81FE600404622 /* TCViewController.m in Sources */, + 16736E7318A81FE600404622 /* main.m in Sources */, + 16736E7718A81FE600404622 /* TCAppDelegate.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 16736E8018A81FE600404622 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 16736E9218A81FE600404622 /* YATCTests.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 16736E8A18A81FE600404622 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 16736E6218A81FE600404622 /* YATC */; + targetProxy = 16736E8918A81FE600404622 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + 16736E6F18A81FE600404622 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 16736E7018A81FE600404622 /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; + 16736E7818A81FE600404622 /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 16736E7918A81FE600404622 /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + 16736E8E18A81FE600404622 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 16736E8F18A81FE600404622 /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 16736E9318A81FE600404622 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)"; + 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__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + 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; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + }; + name = Debug; + }; + 16736E9418A81FE600404622 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)"; + 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__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = YES; + ENABLE_NS_ASSERTIONS = NO; + 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; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + SDKROOT = iphoneos; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 16736E9618A81FE600404622 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "YATC/YATC-Prefix.pch"; + INFOPLIST_FILE = "YATC/YATC-Info.plist"; + PRODUCT_NAME = "$(TARGET_NAME)"; + WRAPPER_EXTENSION = app; + }; + name = Debug; + }; + 16736E9718A81FE600404622 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "YATC/YATC-Prefix.pch"; + INFOPLIST_FILE = "YATC/YATC-Info.plist"; + PRODUCT_NAME = "$(TARGET_NAME)"; + WRAPPER_EXTENSION = app; + }; + name = Release; + }; + 16736E9918A81FE600404622 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)"; + BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/YATC.app/YATC"; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + "$(DEVELOPER_FRAMEWORKS_DIR)", + ); + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "YATC/YATC-Prefix.pch"; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + INFOPLIST_FILE = "YATCTests/YATCTests-Info.plist"; + PRODUCT_NAME = "$(TARGET_NAME)"; + TEST_HOST = "$(BUNDLE_LOADER)"; + WRAPPER_EXTENSION = xctest; + }; + name = Debug; + }; + 16736E9A18A81FE600404622 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)"; + BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/YATC.app/YATC"; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + "$(DEVELOPER_FRAMEWORKS_DIR)", + ); + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "YATC/YATC-Prefix.pch"; + INFOPLIST_FILE = "YATCTests/YATCTests-Info.plist"; + PRODUCT_NAME = "$(TARGET_NAME)"; + TEST_HOST = "$(BUNDLE_LOADER)"; + WRAPPER_EXTENSION = xctest; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 16736E5E18A81FE600404622 /* Build configuration list for PBXProject "YATC" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 16736E9318A81FE600404622 /* Debug */, + 16736E9418A81FE600404622 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 16736E9518A81FE600404622 /* Build configuration list for PBXNativeTarget "YATC" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 16736E9618A81FE600404622 /* Debug */, + 16736E9718A81FE600404622 /* Release */, + ); + defaultConfigurationIsVisible = 0; + }; + 16736E9818A81FE600404622 /* Build configuration list for PBXNativeTarget "YATCTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 16736E9918A81FE600404622 /* Debug */, + 16736E9A18A81FE600404622 /* Release */, + ); + defaultConfigurationIsVisible = 0; + }; +/* End XCConfigurationList section */ + }; + rootObject = 16736E5B18A81FE600404622 /* Project object */; +} diff --git a/YATC/Base.lproj/Main.storyboard b/YATC/Base.lproj/Main.storyboard new file mode 100644 index 0000000..657d33c --- /dev/null +++ b/YATC/Base.lproj/Main.storyboard @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/YATC/Images.xcassets/AppIcon.appiconset/Contents.json b/YATC/Images.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..a396706 --- /dev/null +++ b/YATC/Images.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/YATC/Images.xcassets/LaunchImage.launchimage/Contents.json b/YATC/Images.xcassets/LaunchImage.launchimage/Contents.json new file mode 100644 index 0000000..c79ebd3 --- /dev/null +++ b/YATC/Images.xcassets/LaunchImage.launchimage/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "orientation" : "portrait", + "idiom" : "iphone", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + }, + { + "orientation" : "portrait", + "idiom" : "iphone", + "subtype" : "retina4", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/YATC/TCAppDelegate.h b/YATC/TCAppDelegate.h new file mode 100644 index 0000000..6048985 --- /dev/null +++ b/YATC/TCAppDelegate.h @@ -0,0 +1,15 @@ +// +// TCAppDelegate.h +// YATC +// +// Created by Jacob Krall on 2/9/14. +// Copyright (c) 2014 Jacob Krall. All rights reserved. +// + +#import + +@interface TCAppDelegate : UIResponder + +@property (strong, nonatomic) UIWindow *window; + +@end diff --git a/YATC/TCAppDelegate.m b/YATC/TCAppDelegate.m new file mode 100644 index 0000000..d27a7a2 --- /dev/null +++ b/YATC/TCAppDelegate.m @@ -0,0 +1,46 @@ +// +// TCAppDelegate.m +// YATC +// +// Created by Jacob Krall on 2/9/14. +// Copyright (c) 2014 Jacob Krall. All rights reserved. +// + +#import "TCAppDelegate.h" + +@implementation TCAppDelegate + +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions +{ + // Override point for customization after application launch. + return YES; +} + +- (void)applicationWillResignActive:(UIApplication *)application +{ + // 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. + // 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. +} + +- (void)applicationDidEnterBackground:(UIApplication *)application +{ + // 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. + // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. +} + +- (void)applicationWillEnterForeground:(UIApplication *)application +{ + // 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. +} + +- (void)applicationDidBecomeActive:(UIApplication *)application +{ + // 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. +} + +- (void)applicationWillTerminate:(UIApplication *)application +{ + // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. +} + +@end diff --git a/YATC/TCViewController.h b/YATC/TCViewController.h new file mode 100644 index 0000000..3af8a07 --- /dev/null +++ b/YATC/TCViewController.h @@ -0,0 +1,13 @@ +// +// TCViewController.h +// YATC +// +// Created by Jacob Krall on 2/9/14. +// Copyright (c) 2014 Jacob Krall. All rights reserved. +// + +#import + +@interface TCViewController : UIViewController + +@end diff --git a/YATC/TCViewController.m b/YATC/TCViewController.m new file mode 100644 index 0000000..68ebdbf --- /dev/null +++ b/YATC/TCViewController.m @@ -0,0 +1,29 @@ +// +// TCViewController.m +// YATC +// +// Created by Jacob Krall on 2/9/14. +// Copyright (c) 2014 Jacob Krall. All rights reserved. +// + +#import "TCViewController.h" + +@interface TCViewController () + +@end + +@implementation TCViewController + +- (void)viewDidLoad +{ + [super viewDidLoad]; + // Do any additional setup after loading the view, typically from a nib. +} + +- (void)didReceiveMemoryWarning +{ + [super didReceiveMemoryWarning]; + // Dispose of any resources that can be recreated. +} + +@end diff --git a/YATC/YATC-Info.plist b/YATC/YATC-Info.plist new file mode 100644 index 0000000..e59cb7f --- /dev/null +++ b/YATC/YATC-Info.plist @@ -0,0 +1,40 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleDisplayName + ${PRODUCT_NAME} + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + net.jkrall.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1.0 + LSRequiresIPhoneOS + + UIMainStoryboardFile + Main + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/YATC/YATC-Prefix.pch b/YATC/YATC-Prefix.pch new file mode 100644 index 0000000..82a2bb4 --- /dev/null +++ b/YATC/YATC-Prefix.pch @@ -0,0 +1,16 @@ +// +// Prefix header +// +// The contents of this file are implicitly included at the beginning of every source file. +// + +#import + +#ifndef __IPHONE_5_0 +#warning "This project uses features only available in iOS SDK 5.0 and later." +#endif + +#ifdef __OBJC__ + #import + #import +#endif diff --git a/YATC/en.lproj/InfoPlist.strings b/YATC/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/YATC/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/YATC/main.m b/YATC/main.m new file mode 100644 index 0000000..29bcea8 --- /dev/null +++ b/YATC/main.m @@ -0,0 +1,18 @@ +// +// main.m +// YATC +// +// Created by Jacob Krall on 2/9/14. +// Copyright (c) 2014 Jacob Krall. All rights reserved. +// + +#import + +#import "TCAppDelegate.h" + +int main(int argc, char * argv[]) +{ + @autoreleasepool { + return UIApplicationMain(argc, argv, nil, NSStringFromClass([TCAppDelegate class])); + } +} diff --git a/YATCTests/YATCTests-Info.plist b/YATCTests/YATCTests-Info.plist new file mode 100644 index 0000000..8de2a9c --- /dev/null +++ b/YATCTests/YATCTests-Info.plist @@ -0,0 +1,22 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + net.jkrall.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + + diff --git a/YATCTests/YATCTests.m b/YATCTests/YATCTests.m new file mode 100644 index 0000000..3179e21 --- /dev/null +++ b/YATCTests/YATCTests.m @@ -0,0 +1,34 @@ +// +// YATCTests.m +// YATCTests +// +// Created by Jacob Krall on 2/9/14. +// Copyright (c) 2014 Jacob Krall. All rights reserved. +// + +#import + +@interface YATCTests : XCTestCase + +@end + +@implementation YATCTests + +- (void)setUp +{ + [super setUp]; + // Put setup code here. This method is called before the invocation of each test method in the class. +} + +- (void)tearDown +{ + // Put teardown code here. This method is called after the invocation of each test method in the class. + [super tearDown]; +} + +- (void)testExample +{ + XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__); +} + +@end diff --git a/YATCTests/en.lproj/InfoPlist.strings b/YATCTests/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/YATCTests/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + From ed3bdfe5673357ece5b3062b4cee460818ad531c Mon Sep 17 00:00:00 2001 From: Jacob Krall Date: Sun, 9 Feb 2014 16:05:44 -0500 Subject: [PATCH 02/13] Use a good base Navigation Controller so it looks like the spec --- YATC/Base.lproj/Main.storyboard | 49 +++++++++++++++++++++++++-------- 1 file changed, 38 insertions(+), 11 deletions(-) diff --git a/YATC/Base.lproj/Main.storyboard b/YATC/Base.lproj/Main.storyboard index 657d33c..cc2b94b 100644 --- a/YATC/Base.lproj/Main.storyboard +++ b/YATC/Base.lproj/Main.storyboard @@ -1,21 +1,48 @@ - + - + - - + + - - + + - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From 10a5ce9c6321c585c022197e9600e8680d775891 Mon Sep 17 00:00:00 2001 From: Jacob Krall Date: Sun, 9 Feb 2014 16:37:07 -0500 Subject: [PATCH 03/13] Start acting like a UITableViewController --- YATC/Base.lproj/Main.storyboard | 28 ++++++++++++++++++++++------ YATC/TCViewController.h | 2 +- YATC/TCViewController.m | 19 +++++++++++++++---- 3 files changed, 38 insertions(+), 11 deletions(-) diff --git a/YATC/Base.lproj/Main.storyboard b/YATC/Base.lproj/Main.storyboard index cc2b94b..b9442e2 100644 --- a/YATC/Base.lproj/Main.storyboard +++ b/YATC/Base.lproj/Main.storyboard @@ -4,21 +4,37 @@ - + - - + + - - + + - + + + + + diff --git a/YATC/TCViewController.h b/YATC/TCViewController.h index 3af8a07..dfc8fe0 100644 --- a/YATC/TCViewController.h +++ b/YATC/TCViewController.h @@ -8,6 +8,6 @@ #import -@interface TCViewController : UIViewController +@interface TCViewController : UITableViewController @end diff --git a/YATC/TCViewController.m b/YATC/TCViewController.m index 68ebdbf..af19caf 100644 --- a/YATC/TCViewController.m +++ b/YATC/TCViewController.m @@ -10,6 +10,8 @@ @interface TCViewController () +@property NSArray *entries; + @end @implementation TCViewController @@ -17,13 +19,22 @@ @implementation TCViewController - (void)viewDidLoad { [super viewDidLoad]; - // Do any additional setup after loading the view, typically from a nib. } -- (void)didReceiveMemoryWarning +- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView +{ + return 1; +} + +- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section +{ + return 4; // self.entries.count; +} + +- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { - [super didReceiveMemoryWarning]; - // Dispose of any resources that can be recreated. + UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"cell"]; + return cell; } @end From 2a209b556daa526466da96b13175065633579f95 Mon Sep 17 00:00:00 2001 From: Jacob Krall Date: Sun, 9 Feb 2014 17:22:38 -0500 Subject: [PATCH 04/13] =?UTF-8?q?Use=20the=20Social=20framework=20to=20loa?= =?UTF-8?q?d=20a=20list=20of=20100=20tweets=20from=20the=20(first)=20user?= =?UTF-8?q?=E2=80=99s=20timeline.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- YATC.xcodeproj/project.pbxproj | 6 +++ YATC/TCViewController.m | 87 +++++++++++++++++++++++++++++++++- 2 files changed, 92 insertions(+), 1 deletion(-) diff --git a/YATC.xcodeproj/project.pbxproj b/YATC.xcodeproj/project.pbxproj index 2c6e62e..0672b93 100644 --- a/YATC.xcodeproj/project.pbxproj +++ b/YATC.xcodeproj/project.pbxproj @@ -21,6 +21,7 @@ 16736E8818A81FE600404622 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 16736E6A18A81FE600404622 /* UIKit.framework */; }; 16736E9018A81FE600404622 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 16736E8E18A81FE600404622 /* InfoPlist.strings */; }; 16736E9218A81FE600404622 /* YATCTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 16736E9118A81FE600404622 /* YATCTests.m */; }; + 16736E9C18A82D0A00404622 /* Social.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 16736E9B18A82D0A00404622 /* Social.framework */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -53,6 +54,7 @@ 16736E8D18A81FE600404622 /* YATCTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "YATCTests-Info.plist"; sourceTree = ""; }; 16736E8F18A81FE600404622 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 16736E9118A81FE600404622 /* YATCTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = YATCTests.m; sourceTree = ""; }; + 16736E9B18A82D0A00404622 /* Social.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Social.framework; path = System/Library/Frameworks/Social.framework; sourceTree = SDKROOT; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -60,6 +62,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 16736E9C18A82D0A00404622 /* Social.framework in Frameworks */, 16736E6918A81FE600404622 /* CoreGraphics.framework in Frameworks */, 16736E6B18A81FE600404622 /* UIKit.framework in Frameworks */, 16736E6718A81FE600404622 /* Foundation.framework in Frameworks */, @@ -101,6 +104,7 @@ 16736E6518A81FE600404622 /* Frameworks */ = { isa = PBXGroup; children = ( + 16736E9B18A82D0A00404622 /* Social.framework */, 16736E6618A81FE600404622 /* Foundation.framework */, 16736E6818A81FE600404622 /* CoreGraphics.framework */, 16736E6A18A81FE600404622 /* UIKit.framework */, @@ -461,6 +465,7 @@ 16736E9718A81FE600404622 /* Release */, ); defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; }; 16736E9818A81FE600404622 /* Build configuration list for PBXNativeTarget "YATCTests" */ = { isa = XCConfigurationList; @@ -469,6 +474,7 @@ 16736E9A18A81FE600404622 /* Release */, ); defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; }; /* End XCConfigurationList section */ }; diff --git a/YATC/TCViewController.m b/YATC/TCViewController.m index af19caf..7400598 100644 --- a/YATC/TCViewController.m +++ b/YATC/TCViewController.m @@ -6,19 +6,104 @@ // Copyright (c) 2014 Jacob Krall. All rights reserved. // +#import +#import #import "TCViewController.h" @interface TCViewController () @property NSArray *entries; +// Twitter connection code shamelessly stolen from +// https://dev.twitter.com/docs/ios/making-api-requests-slrequest +@property (nonatomic) ACAccountStore *accountStore; + @end @implementation TCViewController +- (BOOL)userHasAccessToTwitter +{ + return [SLComposeViewController isAvailableForServiceType:SLServiceTypeTwitter]; +} + - (void)viewDidLoad { [super viewDidLoad]; + self.entries = @[]; + [self fetchTimelineForUser]; +} + +- (void)fetchTimelineForUser +{ + if (!self.accountStore) { + _accountStore = [[ACAccountStore alloc] init]; + } + // Step 0: Check that the user has local Twitter accounts + if ([self userHasAccessToTwitter]) { + // Step 1: Obtain access to the user's Twitter accounts + ACAccountType *twitterAccountType = + [self.accountStore accountTypeWithAccountTypeIdentifier: + ACAccountTypeIdentifierTwitter]; + + [self.accountStore + requestAccessToAccountsWithType:twitterAccountType + options:nil + completion:^(BOOL granted, NSError *error) { + if (granted) { + // Step 2: Create a request + NSArray *twitterAccounts = + [self.accountStore accountsWithAccountType:twitterAccountType]; + NSURL *url = [NSURL URLWithString:@"https://api.twitter.com" + @"/1.1/statuses/home_timeline.json"]; + NSDictionary *params = @{@"include_rts" : @"0", + @"trim_user" : @"1", + @"count" : @"100"}; + SLRequest *request = + [SLRequest requestForServiceType:SLServiceTypeTwitter + requestMethod:SLRequestMethodGET + URL:url + parameters:params]; + // Attach an account to the request + [request setAccount:[twitterAccounts lastObject]]; + + // Step 3: Execute the request + [request performRequestWithHandler: + ^(NSData *responseData, + NSHTTPURLResponse *urlResponse, + NSError *error) { + if (responseData) { + if (urlResponse.statusCode >= 200 && + urlResponse.statusCode < 300) { + NSError *jsonError; + NSDictionary *timelineData = + [NSJSONSerialization + JSONObjectWithData:responseData + options:NSJSONReadingAllowFragments error:&jsonError]; + if (timelineData) { + NSLog(@"Timeline Response: %@\n", timelineData); + } + else { + // Our JSON deserialization went awry + NSLog(@"JSON Error: %@", [jsonError localizedDescription]); + } + } + else { + // The server did not respond ... were we rate-limited? + NSLog(@"The response status code is %d", + urlResponse.statusCode); + } + } + }]; + } + else { + // Access was not granted, or an error occurred + NSLog(@"%@", [error localizedDescription]); + } + }]; + } else { + NSLog(@"!userHasAccessToTwitter"); + } } - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView @@ -28,7 +113,7 @@ - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { - return 4; // self.entries.count; + return self.entries.count; } - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath From 02f42218ea4db613f0dc4db6ab49dfb90ac3e542 Mon Sep 17 00:00:00 2001 From: Jacob Krall Date: Sun, 9 Feb 2014 18:02:57 -0500 Subject: [PATCH 05/13] =?UTF-8?q?Hook=20up=20the=20data.=20Use=20a=20Subti?= =?UTF-8?q?tle=20style=20in=20`cell`=20so=20I=20don=E2=80=99t=20have=20to?= =?UTF-8?q?=20remember=20how=20to=20look=20up=20labels.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit (Also, fix a warning regarding int vs. long when switching to a 64 bit build.) --- YATC/Base.lproj/Main.storyboard | 16 ++++++++-------- YATC/TCViewController.m | 20 +++++++++++++------- 2 files changed, 21 insertions(+), 15 deletions(-) diff --git a/YATC/Base.lproj/Main.storyboard b/YATC/Base.lproj/Main.storyboard index b9442e2..591f166 100644 --- a/YATC/Base.lproj/Main.storyboard +++ b/YATC/Base.lproj/Main.storyboard @@ -13,23 +13,23 @@ - + - + + + diff --git a/YATC/TCViewController.m b/YATC/TCViewController.m index 0839289..3d917d6 100644 --- a/YATC/TCViewController.m +++ b/YATC/TCViewController.m @@ -31,14 +31,26 @@ - (void)viewDidLoad { [super viewDidLoad]; self.entries = @[]; + _accountStore = [[ACAccountStore alloc] init]; [self fetchTimelineForUser]; + [self setupRefreshControl]; +} + +- (void) setupRefreshControl +{ + // HACK: If I just use `self.refreshControl` here, a wacky blank cell + // remains at the top of the TableView after refresh. + // Using a brand-new UIRefreshControl eliminates this bug. + UIRefreshControl *refreshControl = [UIRefreshControl new]; + [refreshControl addTarget:self action:@selector(fetchTimelineForUser) + forControlEvents:UIControlEventValueChanged]; + refreshControl.attributedTitle = [[NSAttributedString alloc] initWithString:@"Updating data…"]; + + [self setRefreshControl:refreshControl]; } - (void)fetchTimelineForUser { - if (!self.accountStore) { - _accountStore = [[ACAccountStore alloc] init]; - } // Step 0: Check that the user has local Twitter accounts if ([self userHasAccessToTwitter]) { // Step 1: Obtain access to the user's Twitter accounts @@ -83,6 +95,7 @@ - (void)fetchTimelineForUser NSLog(@"got %ld", (long)(timelineData.count)); dispatch_async(dispatch_get_main_queue(), ^{ [self.tableView reloadData]; + [self.refreshControl endRefreshing]; }); } else { From a5868e9b134a12190ab0cea33dcdca8487190d6f Mon Sep 17 00:00:00 2001 From: Jacob Krall Date: Mon, 17 Feb 2014 21:15:14 -0500 Subject: [PATCH 08/13] based on github/gitignore: Objective-C.gitignore --- .gitignore | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 6ff7573..3fcfb6e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,24 @@ -**/*.xcworkspace -xcuserdata +# OS X +.DS_Store + +# Xcode +build/ *.pbxuser +!default.pbxuser +*.mode1v3 +!default.mode1v3 +*.mode2v3 +!default.mode2v3 +*.perspectivev3 +!default.perspectivev3 +xcuserdata +*.xccheckout +profile +*.moved-aside +DerivedData +*.hmap +*.ipa +**/*.xcworkspace + +# CocoaPods +Pods From a0f04a2660f6abfbd7e1191f9f253ac8c22449c9 Mon Sep 17 00:00:00 2001 From: Jacob Krall Date: Mon, 17 Feb 2014 21:20:40 -0500 Subject: [PATCH 09/13] Use three-letter class prefix `TWC` --- YATC.xcodeproj/project.pbxproj | 26 +++++++++---------- YATC/Base.lproj/Main.storyboard | 2 +- YATC/{TCAppDelegate.h => TWCAppDelegate.h} | 4 +-- YATC/{TCAppDelegate.m => TWCAppDelegate.m} | 6 ++--- ...TCViewController.h => TWCViewController.h} | 4 +-- ...TCViewController.m => TWCViewController.m} | 8 +++--- YATC/main.m | 4 +-- 7 files changed, 27 insertions(+), 27 deletions(-) rename YATC/{TCAppDelegate.h => TWCAppDelegate.h} (69%) rename YATC/{TCAppDelegate.m => TWCAppDelegate.m} (96%) rename YATC/{TCViewController.h => TWCViewController.h} (65%) rename YATC/{TCViewController.m => TWCViewController.m} (97%) diff --git a/YATC.xcodeproj/project.pbxproj b/YATC.xcodeproj/project.pbxproj index 0672b93..50f558c 100644 --- a/YATC.xcodeproj/project.pbxproj +++ b/YATC.xcodeproj/project.pbxproj @@ -12,9 +12,9 @@ 16736E6B18A81FE600404622 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 16736E6A18A81FE600404622 /* UIKit.framework */; }; 16736E7118A81FE600404622 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 16736E6F18A81FE600404622 /* InfoPlist.strings */; }; 16736E7318A81FE600404622 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 16736E7218A81FE600404622 /* main.m */; }; - 16736E7718A81FE600404622 /* TCAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 16736E7618A81FE600404622 /* TCAppDelegate.m */; }; + 16736E7718A81FE600404622 /* TWCAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 16736E7618A81FE600404622 /* TWCAppDelegate.m */; }; 16736E7A18A81FE600404622 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 16736E7818A81FE600404622 /* Main.storyboard */; }; - 16736E7D18A81FE600404622 /* TCViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 16736E7C18A81FE600404622 /* TCViewController.m */; }; + 16736E7D18A81FE600404622 /* TWCViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 16736E7C18A81FE600404622 /* TWCViewController.m */; }; 16736E7F18A81FE600404622 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 16736E7E18A81FE600404622 /* Images.xcassets */; }; 16736E8618A81FE600404622 /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 16736E8518A81FE600404622 /* XCTest.framework */; }; 16736E8718A81FE600404622 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 16736E6618A81FE600404622 /* Foundation.framework */; }; @@ -43,11 +43,11 @@ 16736E7018A81FE600404622 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 16736E7218A81FE600404622 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 16736E7418A81FE600404622 /* YATC-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "YATC-Prefix.pch"; sourceTree = ""; }; - 16736E7518A81FE600404622 /* TCAppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = TCAppDelegate.h; sourceTree = ""; }; - 16736E7618A81FE600404622 /* TCAppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = TCAppDelegate.m; sourceTree = ""; }; + 16736E7518A81FE600404622 /* TWCAppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = TWCAppDelegate.h; sourceTree = ""; }; + 16736E7618A81FE600404622 /* TWCAppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = TWCAppDelegate.m; sourceTree = ""; }; 16736E7918A81FE600404622 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; - 16736E7B18A81FE600404622 /* TCViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = TCViewController.h; sourceTree = ""; }; - 16736E7C18A81FE600404622 /* TCViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = TCViewController.m; sourceTree = ""; }; + 16736E7B18A81FE600404622 /* TWCViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = TWCViewController.h; sourceTree = ""; }; + 16736E7C18A81FE600404622 /* TWCViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = TWCViewController.m; sourceTree = ""; }; 16736E7E18A81FE600404622 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; 16736E8418A81FE600404622 /* YATCTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = YATCTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 16736E8518A81FE600404622 /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; @@ -116,11 +116,11 @@ 16736E6C18A81FE600404622 /* YATC */ = { isa = PBXGroup; children = ( - 16736E7518A81FE600404622 /* TCAppDelegate.h */, - 16736E7618A81FE600404622 /* TCAppDelegate.m */, + 16736E7518A81FE600404622 /* TWCAppDelegate.h */, + 16736E7618A81FE600404622 /* TWCAppDelegate.m */, 16736E7818A81FE600404622 /* Main.storyboard */, - 16736E7B18A81FE600404622 /* TCViewController.h */, - 16736E7C18A81FE600404622 /* TCViewController.m */, + 16736E7B18A81FE600404622 /* TWCViewController.h */, + 16736E7C18A81FE600404622 /* TWCViewController.m */, 16736E7E18A81FE600404622 /* Images.xcassets */, 16736E6D18A81FE600404622 /* Supporting Files */, ); @@ -200,7 +200,7 @@ 16736E5B18A81FE600404622 /* Project object */ = { isa = PBXProject; attributes = { - CLASSPREFIX = TC; + CLASSPREFIX = TWC; LastUpgradeCheck = 0500; ORGANIZATIONNAME = "Jacob Krall"; TargetAttributes = { @@ -254,9 +254,9 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - 16736E7D18A81FE600404622 /* TCViewController.m in Sources */, + 16736E7D18A81FE600404622 /* TWCViewController.m in Sources */, 16736E7318A81FE600404622 /* main.m in Sources */, - 16736E7718A81FE600404622 /* TCAppDelegate.m in Sources */, + 16736E7718A81FE600404622 /* TWCAppDelegate.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/YATC/Base.lproj/Main.storyboard b/YATC/Base.lproj/Main.storyboard index 816c91f..038169d 100644 --- a/YATC/Base.lproj/Main.storyboard +++ b/YATC/Base.lproj/Main.storyboard @@ -7,7 +7,7 @@ - + diff --git a/YATC/TCAppDelegate.h b/YATC/TWCAppDelegate.h similarity index 69% rename from YATC/TCAppDelegate.h rename to YATC/TWCAppDelegate.h index 6048985..635238c 100644 --- a/YATC/TCAppDelegate.h +++ b/YATC/TWCAppDelegate.h @@ -1,5 +1,5 @@ // -// TCAppDelegate.h +// TWCAppDelegate.h // YATC // // Created by Jacob Krall on 2/9/14. @@ -8,7 +8,7 @@ #import -@interface TCAppDelegate : UIResponder +@interface TWCAppDelegate : UIResponder @property (strong, nonatomic) UIWindow *window; diff --git a/YATC/TCAppDelegate.m b/YATC/TWCAppDelegate.m similarity index 96% rename from YATC/TCAppDelegate.m rename to YATC/TWCAppDelegate.m index d27a7a2..4f10fb5 100644 --- a/YATC/TCAppDelegate.m +++ b/YATC/TWCAppDelegate.m @@ -1,14 +1,14 @@ // -// TCAppDelegate.m +// TWCAppDelegate.m // YATC // // Created by Jacob Krall on 2/9/14. // Copyright (c) 2014 Jacob Krall. All rights reserved. // -#import "TCAppDelegate.h" +#import "TWCAppDelegate.h" -@implementation TCAppDelegate +@implementation TWCAppDelegate - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { diff --git a/YATC/TCViewController.h b/YATC/TWCViewController.h similarity index 65% rename from YATC/TCViewController.h rename to YATC/TWCViewController.h index dfc8fe0..9d88f03 100644 --- a/YATC/TCViewController.h +++ b/YATC/TWCViewController.h @@ -1,5 +1,5 @@ // -// TCViewController.h +// TWCViewController.h // YATC // // Created by Jacob Krall on 2/9/14. @@ -8,6 +8,6 @@ #import -@interface TCViewController : UITableViewController +@interface TWCViewController : UITableViewController @end diff --git a/YATC/TCViewController.m b/YATC/TWCViewController.m similarity index 97% rename from YATC/TCViewController.m rename to YATC/TWCViewController.m index 3d917d6..6dfa9fa 100644 --- a/YATC/TCViewController.m +++ b/YATC/TWCViewController.m @@ -1,5 +1,5 @@ // -// TCViewController.m +// TWCViewController.m // YATC // // Created by Jacob Krall on 2/9/14. @@ -8,9 +8,9 @@ #import #import -#import "TCViewController.h" +#import "TWCViewController.h" -@interface TCViewController () +@interface TWCViewController () @property NSArray *entries; @@ -20,7 +20,7 @@ @interface TCViewController () @end -@implementation TCViewController +@implementation TWCViewController - (BOOL)userHasAccessToTwitter { diff --git a/YATC/main.m b/YATC/main.m index 29bcea8..4748b27 100644 --- a/YATC/main.m +++ b/YATC/main.m @@ -8,11 +8,11 @@ #import -#import "TCAppDelegate.h" +#import "TWCAppDelegate.h" int main(int argc, char * argv[]) { @autoreleasepool { - return UIApplicationMain(argc, argv, nil, NSStringFromClass([TCAppDelegate class])); + return UIApplicationMain(argc, argv, nil, NSStringFromClass([TWCAppDelegate class])); } } From 5588196f28fa58dbadd35d27634822a5e9814ee2 Mon Sep 17 00:00:00 2001 From: Jacob Krall Date: Mon, 17 Feb 2014 21:25:30 -0500 Subject: [PATCH 10/13] Explicitly use modules --- YATC/TWCAppDelegate.h | 2 +- YATC/TWCViewController.h | 2 +- YATC/TWCViewController.m | 4 ++-- YATC/YATC-Prefix.pch | 4 ++-- YATC/main.m | 2 +- YATCTests/YATCTests.m | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/YATC/TWCAppDelegate.h b/YATC/TWCAppDelegate.h index 635238c..27fc3c5 100644 --- a/YATC/TWCAppDelegate.h +++ b/YATC/TWCAppDelegate.h @@ -6,7 +6,7 @@ // Copyright (c) 2014 Jacob Krall. All rights reserved. // -#import +@import UIKit; @interface TWCAppDelegate : UIResponder diff --git a/YATC/TWCViewController.h b/YATC/TWCViewController.h index 9d88f03..ee3d036 100644 --- a/YATC/TWCViewController.h +++ b/YATC/TWCViewController.h @@ -6,7 +6,7 @@ // Copyright (c) 2014 Jacob Krall. All rights reserved. // -#import +@import UIKit; @interface TWCViewController : UITableViewController diff --git a/YATC/TWCViewController.m b/YATC/TWCViewController.m index 6dfa9fa..30ccc18 100644 --- a/YATC/TWCViewController.m +++ b/YATC/TWCViewController.m @@ -6,8 +6,8 @@ // Copyright (c) 2014 Jacob Krall. All rights reserved. // -#import -#import +@import Accounts; +@import Social; #import "TWCViewController.h" @interface TWCViewController () diff --git a/YATC/YATC-Prefix.pch b/YATC/YATC-Prefix.pch index 82a2bb4..7825372 100644 --- a/YATC/YATC-Prefix.pch +++ b/YATC/YATC-Prefix.pch @@ -11,6 +11,6 @@ #endif #ifdef __OBJC__ - #import - #import + @import UIKit; + @import Foundation; #endif diff --git a/YATC/main.m b/YATC/main.m index 4748b27..af02fa4 100644 --- a/YATC/main.m +++ b/YATC/main.m @@ -6,7 +6,7 @@ // Copyright (c) 2014 Jacob Krall. All rights reserved. // -#import +@import UIKit; #import "TWCAppDelegate.h" diff --git a/YATCTests/YATCTests.m b/YATCTests/YATCTests.m index 3179e21..f179b7c 100644 --- a/YATCTests/YATCTests.m +++ b/YATCTests/YATCTests.m @@ -6,7 +6,7 @@ // Copyright (c) 2014 Jacob Krall. All rights reserved. // -#import +@import XCTest; @interface YATCTests : XCTestCase From 60fe3a4e8a3397fe17b474ce83897f2ce6368d35 Mon Sep 17 00:00:00 2001 From: Jacob Krall Date: Mon, 17 Feb 2014 21:40:23 -0500 Subject: [PATCH 11/13] Use `dequeueReusableCellWithIdentifier:forIndexPath:` instead of `dequeueReusableCellWithIdentifier:` --- YATC/TWCViewController.m | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/YATC/TWCViewController.m b/YATC/TWCViewController.m index 30ccc18..c96211b 100644 --- a/YATC/TWCViewController.m +++ b/YATC/TWCViewController.m @@ -133,7 +133,9 @@ - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { - UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"cell"]; + UITableViewCell *cell = [tableView + dequeueReusableCellWithIdentifier:@"cell" + forIndexPath:indexPath]; NSDictionary* tweet = self.entries[indexPath.row]; cell.textLabel.text = tweet[@"user"][@"screen_name"]; From 6928963d6fc8ec2d4f12e7895a9d62be1b823705 Mon Sep 17 00:00:00 2001 From: Jacob Krall Date: Mon, 17 Feb 2014 21:42:23 -0500 Subject: [PATCH 12/13] Use fewer `[]` --- YATC/TWCViewController.m | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/YATC/TWCViewController.m b/YATC/TWCViewController.m index c96211b..f61a615 100644 --- a/YATC/TWCViewController.m +++ b/YATC/TWCViewController.m @@ -31,7 +31,7 @@ - (void)viewDidLoad { [super viewDidLoad]; self.entries = @[]; - _accountStore = [[ACAccountStore alloc] init]; + _accountStore = [ACAccountStore new]; [self fetchTimelineForUser]; [self setupRefreshControl]; } @@ -46,7 +46,7 @@ - (void) setupRefreshControl forControlEvents:UIControlEventValueChanged]; refreshControl.attributedTitle = [[NSAttributedString alloc] initWithString:@"Updating data…"]; - [self setRefreshControl:refreshControl]; + self.refreshControl = refreshControl; } - (void)fetchTimelineForUser From 822d28fd1de6f4fef76350a9b91a09b4d2e98d97 Mon Sep 17 00:00:00 2001 From: Jacob Krall Date: Mon, 17 Feb 2014 21:47:50 -0500 Subject: [PATCH 13/13] Use initWithCoder to do initialization, not viewDidLoad --- YATC/TWCViewController.m | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/YATC/TWCViewController.m b/YATC/TWCViewController.m index f61a615..282f45c 100644 --- a/YATC/TWCViewController.m +++ b/YATC/TWCViewController.m @@ -30,12 +30,22 @@ - (BOOL)userHasAccessToTwitter - (void)viewDidLoad { [super viewDidLoad]; - self.entries = @[]; - _accountStore = [ACAccountStore new]; + [self fetchTimelineForUser]; [self setupRefreshControl]; } +- (id)initWithCoder:(NSCoder *)aDecoder +{ + if(self = [super initWithCoder:aDecoder]) + { + self.entries = @[]; + self.accountStore = [ACAccountStore new]; + } + + return self; +} + - (void) setupRefreshControl { // HACK: If I just use `self.refreshControl` here, a wacky blank cell