Skip to content

Commit

Permalink
Add foundation for NPCricket
Browse files Browse the repository at this point in the history
This commit adds a basic foundation for cricket. It's setup as a
cocoapod library and includes an example project.

Currently it functions with a single handler: the build-in email
composer.
  • Loading branch information
nebs committed May 9, 2015
1 parent 19f4bfe commit 0a5ff85
Show file tree
Hide file tree
Showing 291 changed files with 6,905 additions and 151 deletions.
141 changes: 124 additions & 17 deletions Example/NPCricket.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

10 changes: 10 additions & 0 deletions Example/NPCricket.xcworkspace/contents.xcworkspacedata

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

53 changes: 38 additions & 15 deletions Example/NPCricket/Base.lproj/Main_iPad.storyboard
Original file line number Diff line number Diff line change
@@ -1,30 +1,53 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="5023" systemVersion="13A603" targetRuntime="iOS.CocoaTouch.iPad" propertyAccessControl="none" useAutolayout="YES" initialViewController="BYZ-38-t0r">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="7702" systemVersion="14B25" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="bsx-Y8-Jae">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="3733"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="7701"/>
</dependencies>
<scenes>
<!--class Prefix:identifier View Controller-->
<scene sceneID="tne-QT-ifu">
<!--View Controller-->
<scene sceneID="FgR-oy-Z74">
<objects>
<viewController id="BYZ-38-t0r" customClass="NPViewController" sceneMemberID="viewController">
<viewController id="bsx-Y8-Jae" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="y3c-jy-aDJ"/>
<viewControllerLayoutGuide type="bottom" id="wfy-db-euE"/>
<viewControllerLayoutGuide type="top" id="jMg-Dr-Lwt"/>
<viewControllerLayoutGuide type="bottom" id="97y-D4-xsu"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC">
<view key="view" contentMode="scaleToFill" id="oRa-pQ-OeQ">
<rect key="frame" x="0.0" y="0.0" width="768" height="1024"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
<subviews>
<imageView userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="sheep" translatesAutoresizingMaskIntoConstraints="NO" id="6of-10-imu">
<rect key="frame" x="0.0" y="0.0" width="768" height="1024"/>
</imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Welcome to Cricket!" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="yHS-Cg-DvT">
<rect key="frame" x="178" y="461" width="413" height="101"/>
<constraints>
<constraint firstAttribute="height" constant="101" id="5vF-3g-9kP"/>
<constraint firstAttribute="width" constant="413" id="YbJ-ZO-YV1"/>
</constraints>
<fontDescription key="fontDescription" type="system" pointSize="39"/>
<color key="textColor" red="1" green="1" blue="1" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<constraints>
<constraint firstItem="6of-10-imu" firstAttribute="leading" secondItem="oRa-pQ-OeQ" secondAttribute="leading" id="0aV-Qc-fYE"/>
<constraint firstAttribute="centerY" secondItem="yHS-Cg-DvT" secondAttribute="centerY" id="CQh-Aa-8rx"/>
<constraint firstAttribute="centerX" secondItem="yHS-Cg-DvT" secondAttribute="centerX" id="HEs-u6-H45"/>
<constraint firstItem="97y-D4-xsu" firstAttribute="top" secondItem="6of-10-imu" secondAttribute="bottom" id="anr-a2-8Bd"/>
<constraint firstAttribute="trailing" secondItem="6of-10-imu" secondAttribute="trailing" id="eL1-1S-vZU"/>
<constraint firstItem="6of-10-imu" firstAttribute="top" secondItem="oRa-pQ-OeQ" secondAttribute="top" id="pNf-1k-4db"/>
</constraints>
</view>
<simulatedScreenMetrics key="simulatedDestinationMetrics" type="iPad"/>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
<placeholder placeholderIdentifier="IBFirstResponder" id="JzM-SD-phg" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="473" y="415"/>
</scene>
</scenes>
<simulatedMetricsContainer key="defaultSimulatedMetrics">
<simulatedStatusBarMetrics key="statusBar"/>
<simulatedOrientationMetrics key="orientation"/>
<simulatedScreenMetrics key="destination"/>
</simulatedMetricsContainer>
<resources>
<image name="sheep" width="2296" height="1288"/>
</resources>
</document>
32 changes: 29 additions & 3 deletions Example/NPCricket/Base.lproj/Main_iPhone.storyboard
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="5023" systemVersion="13A603" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" initialViewController="vXZ-lx-hvc">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="7702" systemVersion="14B25" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" initialViewController="vXZ-lx-hvc">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="3733"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="7701"/>
</dependencies>
<scenes>
<!--class Prefix:identifier View Controller-->
<!--View Controller-->
<scene sceneID="ufC-wZ-h7g">
<objects>
<viewController id="vXZ-lx-hvc" customClass="NPViewController" sceneMemberID="viewController">
Expand All @@ -15,13 +15,39 @@
<view key="view" contentMode="scaleToFill" id="kh9-bI-dsS">
<rect key="frame" x="0.0" y="0.0" width="320" height="568"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<subviews>
<imageView userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="sheep" translatesAutoresizingMaskIntoConstraints="NO" id="4G5-Zk-wdr">
<rect key="frame" x="0.0" y="0.0" width="320" height="568"/>
</imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Welcome to Cricket!" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="9n8-AF-fEr">
<rect key="frame" x="58" y="254" width="205" height="60"/>
<constraints>
<constraint firstAttribute="width" constant="205" id="FCM-PO-YZ7"/>
<constraint firstAttribute="height" constant="60" id="hdO-mO-eHF"/>
</constraints>
<fontDescription key="fontDescription" type="system" pointSize="21"/>
<color key="textColor" red="1" green="1" blue="1" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
<constraints>
<constraint firstAttribute="trailing" secondItem="4G5-Zk-wdr" secondAttribute="trailing" id="7Wr-6i-8NG"/>
<constraint firstAttribute="centerX" secondItem="9n8-AF-fEr" secondAttribute="centerX" id="95E-jO-vkC"/>
<constraint firstItem="2fi-mo-0CV" firstAttribute="top" secondItem="4G5-Zk-wdr" secondAttribute="bottom" id="FwH-jj-ljE"/>
<constraint firstItem="4G5-Zk-wdr" firstAttribute="top" secondItem="kh9-bI-dsS" secondAttribute="top" id="GYN-M7-mxZ"/>
<constraint firstItem="4G5-Zk-wdr" firstAttribute="leading" secondItem="kh9-bI-dsS" secondAttribute="leading" id="blv-hf-hhe"/>
<constraint firstAttribute="centerY" secondItem="9n8-AF-fEr" secondAttribute="centerY" id="x1L-Hj-EEB"/>
</constraints>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="x5A-6p-PRh" sceneMemberID="firstResponder"/>
</objects>
</scene>
</scenes>
<resources>
<image name="sheep" width="2296" height="1288"/>
</resources>
<simulatedMetricsContainer key="defaultSimulatedMetrics">
<simulatedStatusBarMetrics key="statusBar"/>
<simulatedOrientationMetrics key="orientation"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@
"size" : "60x60",
"scale" : "2x"
},
{
"idiom" : "iphone",
"size" : "60x60",
"scale" : "3x"
},
{
"idiom" : "ipad",
"size" : "29x29",
Expand Down Expand Up @@ -50,4 +55,4 @@
"version" : 1,
"author" : "xcode"
}
}
}
21 changes: 21 additions & 0 deletions Example/NPCricket/Images.xcassets/sheep.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x",
"filename" : "sheep.jpeg"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 0 additions & 8 deletions Example/NPCricket/NPAppDelegate.h
Original file line number Diff line number Diff line change
@@ -1,11 +1,3 @@
//
// NPAppDelegate.h
// NPCricket
//
// Created by CocoaPods on 05/09/2015.
// Copyright (c) 2014 Nebojsa Petrovic. All rights reserved.
//

#import <UIKit/UIKit.h>

@interface NPAppDelegate : UIResponder <UIApplicationDelegate>
Expand Down
43 changes: 11 additions & 32 deletions Example/NPCricket/NPAppDelegate.m
Original file line number Diff line number Diff line change
@@ -1,46 +1,25 @@
//
// NPAppDelegate.m
// NPCricket
//
// Created by CocoaPods on 05/09/2015.
// Copyright (c) 2014 Nebojsa Petrovic. All rights reserved.
//

#import "NPAppDelegate.h"
#import <NPCricket/NPCricket.h>

@implementation NPAppDelegate

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
// Override point for customization after application launch.
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
[NPCricket setupWithHandler:[NPCricketInternalEmailComposerHandler emailComposerWithToEmailAddress:@"[email protected]" subjectPrefix:@"iOS"]];
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)applicationDidBecomeActive:(UIApplication *)application {
[self becomeFirstResponder];
}

- (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.
- (BOOL)canBecomeFirstResponder {
return YES;
}

- (void)applicationWillTerminate:(UIApplication *)application
{
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
- (void)motionBegan:(UIEventSubtype)motion withEvent:(UIEvent *)event {
if (motion == UIEventSubtypeMotionShake) {
[NPCricket show];
}
}

@end
2 changes: 1 addition & 1 deletion Example/NPCricket/NPCricket-Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
</array>
</dict>
</plist>
9 changes: 0 additions & 9 deletions Example/NPCricket/NPViewController.h
Original file line number Diff line number Diff line change
@@ -1,13 +1,4 @@
//
// NPViewController.h
// NPCricket
//
// Created by Nebojsa Petrovic on 05/09/2015.
// Copyright (c) 2014 Nebojsa Petrovic. All rights reserved.
//

#import <UIKit/UIKit.h>

@interface NPViewController : UIViewController

@end
25 changes: 0 additions & 25 deletions Example/NPCricket/NPViewController.m
Original file line number Diff line number Diff line change
@@ -1,29 +1,4 @@
//
// NPViewController.m
// NPCricket
//
// Created by Nebojsa Petrovic on 05/09/2015.
// Copyright (c) 2014 Nebojsa Petrovic. All rights reserved.
//

#import "NPViewController.h"

@interface NPViewController ()

@end

@implementation NPViewController

- (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
20 changes: 20 additions & 0 deletions Example/Podfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
PODS:
- Expecta (1.0.0)
- NPCricket (0.1.0)
- Specta (1.0.0)

DEPENDENCIES:
- Expecta
- NPCricket (from `../`)
- Specta

EXTERNAL SOURCES:
NPCricket:
:path: ../

SPEC CHECKSUMS:
Expecta: 32604574add2c46a36f8d2f716b6c5736eb75024
NPCricket: 79c9cb07d386b38f0fbb38355af40b1c831819c2
Specta: 96fe05fe5c7348b5223f85e862904f6e832abb14

COCOAPODS: 0.37.1
25 changes: 25 additions & 0 deletions Example/Pods/Expecta/Expecta/EXPBlockDefinedMatcher.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 0a5ff85

Please sign in to comment.