Skip to content

Commit

Permalink
add dynamic framework target
Browse files Browse the repository at this point in the history
The zxcvbn Xcode project and /Zxcvbn folder now only contain the primary source files, the example project source has been moved into /Example. The project should continue to be usable by source / CocoaPods (though someone should verify the podfile tweaks are accurate) but now also offers a dynamic framework (iOS 8+) for easy integration via Carthage.

In addition to file moving, two small fixes were made:
- The JSON resources are fetched from the bundle by class rather than main bundle
- A couple of imports were missing that were previously provided via precompiled header
  • Loading branch information
pizthewiz committed Oct 26, 2015
1 parent fec6a97 commit 32d9cb0
Show file tree
Hide file tree
Showing 34 changed files with 924 additions and 419 deletions.
Expand Up @@ -5,16 +5,31 @@
"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",
Expand Down
28 changes: 28 additions & 0 deletions Example/Base.lproj/LaunchScreen.storyboard
@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="9059" systemVersion="15B42" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" initialViewController="01J-lp-oVM">
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="9049"/>
</dependencies>
<scenes>
<!--View Controller-->
<scene sceneID="EHf-IW-A2E">
<objects>
<viewController id="01J-lp-oVM" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="Llm-lL-Icb"/>
<viewControllerLayoutGuide type="bottom" id="xb3-aO-Qok"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<animations/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="53" y="375"/>
</scene>
</scenes>
</document>
File renamed without changes.
File renamed without changes.
2 changes: 2 additions & 0 deletions Zxcvbn/DBAppDelegate.h → Example/DBAppDelegate.h
Expand Up @@ -6,6 +6,8 @@
// Copyright (c) 2014 Dropbox. All rights reserved.
//

#include <UIKit/UIKit.h>

@interface DBAppDelegate : UIResponder <UIApplicationDelegate>

@property (strong, nonatomic) UIWindow *window;
Expand Down
2 changes: 1 addition & 1 deletion Zxcvbn/DBAppDelegate.m → Example/DBAppDelegate.m
Expand Up @@ -8,7 +8,7 @@

#import "DBAppDelegate.h"

#import "DBZxcvbn.h"
#import <Zxcvbn/DBZxcvbn.h>

@implementation DBAppDelegate

Expand Down
File renamed without changes.
Expand Up @@ -8,7 +8,7 @@

#import "DBCreateAccountViewController.h"

#import "DBPasswordStrengthMeterView.h"
#import <Zxcvbn/DBPasswordStrengthMeterView.h>

@interface DBCreateAccountViewController () <DBPasswordStrengthMeterViewDelegate>

Expand Down
12 changes: 6 additions & 6 deletions Zxcvbn/Zxcvbn-Info.plist → Example/Info.plist
Expand Up @@ -4,26 +4,26 @@
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleDisplayName</key>
<string>${PRODUCT_NAME}</string>
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>com.dropbox.${PRODUCT_NAME:rfc1034identifier}</string>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>${PRODUCT_NAME}</string>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1.0</string>
<string>1</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIMainStoryboardFile</key>
<string>Main_iPhone</string>
<key>UIMainStoryboardFile~ipad</key>
Expand Down
File renamed without changes.
471 changes: 188 additions & 283 deletions Zxcvbn.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

This file was deleted.

99 changes: 99 additions & 0 deletions Zxcvbn.xcodeproj/xcshareddata/xcschemes/Zxcvbn.xcscheme
@@ -0,0 +1,99 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0710"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "D80ECB671BDEAA420055EF0A"
BuildableName = "Zxcvbn.framework"
BlueprintName = "Zxcvbn"
ReferencedContainer = "container:Zxcvbn.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "D80ECB711BDEAA420055EF0A"
BuildableName = "ZxcvbnTests.xctest"
BlueprintName = "ZxcvbnTests"
ReferencedContainer = "container:Zxcvbn.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "D80ECB671BDEAA420055EF0A"
BuildableName = "Zxcvbn.framework"
BlueprintName = "Zxcvbn"
ReferencedContainer = "container:Zxcvbn.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "D80ECB671BDEAA420055EF0A"
BuildableName = "Zxcvbn.framework"
BlueprintName = "Zxcvbn"
ReferencedContainer = "container:Zxcvbn.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "D80ECB671BDEAA420055EF0A"
BuildableName = "Zxcvbn.framework"
BlueprintName = "Zxcvbn"
ReferencedContainer = "container:Zxcvbn.xcodeproj">
</BuildableReference>
</MacroExpansion>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
2 changes: 2 additions & 0 deletions Zxcvbn/Zxcvbn/DBMatcher.h → Zxcvbn/DBMatcher.h
Expand Up @@ -6,6 +6,8 @@
// Copyright (c) 2014 Dropbox. All rights reserved.
//

#import <Foundation/Foundation.h>

@interface DBMatcher : NSObject

@property (nonatomic, assign) NSUInteger keyboardAverageDegree;
Expand Down
4 changes: 2 additions & 2 deletions Zxcvbn/Zxcvbn/DBMatcher.m → Zxcvbn/DBMatcher.m
Expand Up @@ -606,7 +606,7 @@ - (NSArray *)loadFrequencyLists
{
NSMutableArray *dictionaryMatchers = [[NSMutableArray alloc] init];

NSString *filePath = [[NSBundle mainBundle] pathForResource:@"frequency_lists" ofType:@"json"];
NSString *filePath = [[NSBundle bundleForClass:[self class]] pathForResource:@"frequency_lists" ofType:@"json"];
NSData *data = [NSData dataWithContentsOfFile:filePath];

NSError *error;
Expand All @@ -629,7 +629,7 @@ - (NSArray *)loadFrequencyLists

- (NSDictionary *)loadAdjacencyGraphs
{
NSString *filePath = [[NSBundle mainBundle] pathForResource:@"adjacency_graphs" ofType:@"json"];
NSString *filePath = [[NSBundle bundleForClass:[self class]] pathForResource:@"adjacency_graphs" ofType:@"json"];
NSData *data = [NSData dataWithContentsOfFile:filePath];

NSError *error;
Expand Down
2 changes: 2 additions & 0 deletions Zxcvbn/Zxcvbn/DBScorer.h → Zxcvbn/DBScorer.h
Expand Up @@ -6,6 +6,8 @@
// Copyright (c) 2014 Dropbox. All rights reserved.
//

#import <Foundation/Foundation.h>

@class DBResult;

@interface DBScorer : NSObject
Expand Down
File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions Zxcvbn/Zxcvbn/DBZxcvbn.m → Zxcvbn/DBZxcvbn.m
Expand Up @@ -7,6 +7,7 @@
//

#import "DBZxcvbn.h"
#import <QuartzCore/QuartzCore.h>

@interface DBZxcvbn ()

Expand Down
51 changes: 0 additions & 51 deletions Zxcvbn/Images.xcassets/LaunchImage.launchimage/Contents.json

This file was deleted.

26 changes: 26 additions & 0 deletions Zxcvbn/Info.plist
@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>NSPrincipalClass</key>
<string></string>
</dict>
</plist>

0 comments on commit 32d9cb0

Please sign in to comment.