This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| func testControllerShowsAlertIfUserLogsInWithEmptyUsernameAndPasswordTextField() { | |
| // mock of LoginViewController | |
| class MockLoginViewController: LoginViewController { | |
| var presentViewControllerTarget: UIViewController? | |
| override func presentViewController(viewControllerToPresent: UIViewController, animated flag: Bool, completion: (() -> Void)?) { | |
| presentViewControllerTarget = viewControllerToPresent | |
| } | |
| } | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Sample 1: Calling segue to transition to another ViewController by tapping a UICollectionView cell | |
| func testSUT_CanTransitionToTargetViewController_WhenCollectionViewCellTapped() { | |
| // declare mock | |
| class MockViewController: ViewController { | |
| var segueIdentifier: NSString? | |
| override private func performSegueWithIdentifier(identifier: String, sender: AnyObject?) { | |
| segueIdentifier = identifier |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| func testControllerCanPresentSchoolDataWithCustomSchoolView() { | |
| // get target CustomView | |
| let subviews = self.viewControllerUnderTest.scrollView.subviews | |
| var schoolViews = [SchoolView]() | |
| for currentView in subviews { | |
| if(currentView.isKindOfClass(SchoolView)) { | |
| schoolViews.append(currentView as! SchoolView) | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| override func tableView(tableView: UITableView, willDisplayCell cell: UITableViewCell, forRowAtIndexPath indexPath: NSIndexPath) { | |
| // for removing the leading margin of the tableview cell's separator line (i.e. the separator is drawn across the entire screen) | |
| if (tableView.respondsToSelector("setSeparatorInset:")) { | |
| tableView.separatorInset = UIEdgeInsetsZero | |
| } | |
| if (tableView.respondsToSelector("setLayoutMargins:")) { | |
| tableView.layoutMargins = UIEdgeInsetsZero | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Notes for Creating a Cocoa Pod | |
| Pod Version: 0.39.0 | |
| OS: OS X El Capitain (10.11.3) | |
| - - - - - - - - - - - - - - - - - - - - - - - | |
| 1. Install CocoaPods (https://guides.cocoapods.org/using/getting-started.html) | |
| 2. Create Xcode project to author the Pod |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Sample code for using Rollbar to report run-time exceptions ... | |
| public class ErrorReporter { | |
| public static void initializeErrorLogging(Context context) { | |
| Rollbar.init(context, Configuration.ROLLBAR_CLIENT_SIDE_TOKEN, Configuration.ROLLBAR_DEPLOYMENT_STATUS); | |
| } | |
| /** |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Trying to Install Perfect framework on Ubuntu 14.04 EC2 instance | |
| Target Ubuntu: | |
| AWS AMI Name is Ubuntu Server 14.04 LTS (HVM), SSD Volume Type - ami-9abea4fb | |
| // install dependencies | |
| $ sudo apt-get update | |
| $ sudo apt-get --assume-yes install git clang libicu-dev libssl-dev libevent-dev libsqlite3-dev libsqlite3-dev libcurl4-openssl-dev uuid-dev make | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Trying to Install Perfect framework on Ubuntu 14.04 EC2 instance | |
| Target Ubuntu: | |
| AWS AMI Name is Ubuntu Server 14.04 LTS (HVM), SSD Volume Type - ami-9abea4fb | |
| // install dependencies | |
| $ sudo apt-get update | |
| $ sudo apt-get --assume-yes install git clang libicu-dev libssl-dev libevent-dev libsqlite3-dev libsqlite3-dev libcurl4-openssl-dev uuid-dev make | |
| // install swift snapshot |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| dependencies { | |
| compile fileTree(dir: 'libs', include: ['*.jar']) | |
| testCompile 'junit:junit:4.12' | |
| compile 'com.android.support:appcompat-v7:23.2.0' | |
| compile 'com.google.android.gms:play-services:8.4.0' | |
| compile 'com.google.maps.android:android-maps-utils:0.4+' | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class PointOfInterest implements ClusterItem { | |
| private LatLng mLatLng; | |
| /** | |
| * For instantiating a new PointOfInterest | |
| * @param latitude The latitude for the point of interest | |
| * @param longitude The longitude for the point of interest | |
| */ | |
| public PointOfInterest(double latitude, double longitude) { |