Skip to content

Commit

Permalink
Merge pull request #70 from prolificinteractive/feature/qakit
Browse files Browse the repository at this point in the history
QAKit subspec and Swift 4 update
  • Loading branch information
ghvg1313 authored Sep 27, 2017
2 parents 4dbc5ca + 04d9ac4 commit 2cb83dd
Show file tree
Hide file tree
Showing 36 changed files with 501 additions and 172 deletions.
2 changes: 1 addition & 1 deletion .swift-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.0
4.0
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# * https://github.com/supermarin/xcpretty#usage

language: objective-c
osx_image: xcode8
osx_image: xcode9
# cache: cocoapods
# podfile: Example/Podfile

Expand All @@ -12,5 +12,5 @@ before_install:
- pod install --project-directory=Example

script:
- set -o pipefail && travis_retry xcodebuild test -project Yoshi/Yoshi.xcodeproj -scheme YoshiTests -destination 'platform=iOS Simulator,name=iPhone 6,OS=10.0' | xcpretty
- set -o pipefail && travis_retry xcodebuild test -project Yoshi/Yoshi.xcodeproj -scheme YoshiTests -destination 'platform=iOS Simulator,name=iPhone 6,OS=11.0' | xcpretty
- pod lib lint --allow-warnings
5 changes: 0 additions & 5 deletions Example/.swiftlint.yml

This file was deleted.

2 changes: 1 addition & 1 deletion Example/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ use_frameworks!

target 'YoshiExample' do
pod "Instabug", '5.2.4'
pod "Yoshi", :path => "../"
pod "Yoshi", :path => "../", :subspecs => ['QAKit']
end
10 changes: 6 additions & 4 deletions Example/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
PODS:
- Instabug (5.2.4)
- Yoshi (2.2.2)
- Yoshi/Core (2.2.2)
- Yoshi/QAKit (2.2.2):
- Yoshi/Core

DEPENDENCIES:
- Instabug (= 5.2.4)
- Yoshi (from `../`)
- Yoshi/QAKit (from `../`)

EXTERNAL SOURCES:
Yoshi:
:path: "../"

SPEC CHECKSUMS:
Instabug: 6fa40a5e2a4620f0589dfc8e4e01b1018c8c42b1
Yoshi: 20d266a5fb676360f491d36162beafb9119e562b
Yoshi: 032a56c87369104a3a1ee80a247e551d91bddc99

PODFILE CHECKSUM: 67468572b9edbd35e0be95ab66757a16545f110b
PODFILE CHECKSUM: 3e1269998b54f9d27d611d2231c251556652c10a

COCOAPODS: 1.2.0
55 changes: 36 additions & 19 deletions Example/YoshiExample.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
276BCED41C29F060002138C7 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 276BCED21C29F060002138C7 /* Main.storyboard */; };
276BCED61C29F060002138C7 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 276BCED51C29F060002138C7 /* Assets.xcassets */; };
276BCED91C29F060002138C7 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 276BCED71C29F060002138C7 /* LaunchScreen.storyboard */; };
32CF65FF1F7B052F001A712A /* YoshiBaseEnvironment.swift in Sources */ = {isa = PBXBuildFile; fileRef = 32CF65FE1F7B0515001A712A /* YoshiBaseEnvironment.swift */; };
6A80770C715FF7079F982454 /* Pods_YoshiExample.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 38AED69D51CB2462EC94055C /* Pods_YoshiExample.framework */; };
94E2C9C11F081DDE00811CE9 /* DateSelectorMenu.swift in Sources */ = {isa = PBXBuildFile; fileRef = 94E2C9C01F081DDE00811CE9 /* DateSelectorMenu.swift */; };
94E2C9C91F081F5900811CE9 /* CustomCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 94E2C9C71F081F5900811CE9 /* CustomCell.xib */; };
Expand All @@ -27,6 +28,7 @@
276BCED81C29F060002138C7 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
276BCEDA1C29F060002138C7 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
27C7F7EB1CF51D4D0069687F /* YoshiExample-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "YoshiExample-Bridging-Header.h"; sourceTree = "<group>"; };
32CF65FE1F7B0515001A712A /* YoshiBaseEnvironment.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YoshiBaseEnvironment.swift; sourceTree = "<group>"; };
38AED69D51CB2462EC94055C /* Pods_YoshiExample.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_YoshiExample.framework; sourceTree = BUILT_PRODUCTS_DIR; };
4B69EFE97A45841AA3569F78 /* Pods-YoshiExample.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-YoshiExample.release.xcconfig"; path = "Pods/Target Support Files/Pods-YoshiExample/Pods-YoshiExample.release.xcconfig"; sourceTree = "<group>"; };
611645F651489CBB0C351E8B /* Pods-YoshiExample.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-YoshiExample.debug.xcconfig"; path = "Pods/Target Support Files/Pods-YoshiExample/Pods-YoshiExample.debug.xcconfig"; sourceTree = "<group>"; };
Expand Down Expand Up @@ -70,6 +72,7 @@
isa = PBXGroup;
children = (
94E2C9B91F080A0E00811CE9 /* Custom Menus */,
32CF65FD1F7B050F001A712A /* Cutstom Class */,
276BCECE1C29F060002138C7 /* AppDelegate.swift */,
276BCED01C29F060002138C7 /* ViewController.swift */,
276BCED21C29F060002138C7 /* Main.storyboard */,
Expand All @@ -81,6 +84,14 @@
path = YoshiExample;
sourceTree = "<group>";
};
32CF65FD1F7B050F001A712A /* Cutstom Class */ = {
isa = PBXGroup;
children = (
32CF65FE1F7B0515001A712A /* YoshiBaseEnvironment.swift */,
);
path = "Cutstom Class";
sourceTree = "<group>";
};
94E2C9B91F080A0E00811CE9 /* Custom Menus */ = {
isa = PBXGroup;
children = (
Expand Down Expand Up @@ -128,7 +139,6 @@
276BCEC71C29F060002138C7 /* Sources */,
276BCEC81C29F060002138C7 /* Frameworks */,
276BCEC91C29F060002138C7 /* Resources */,
27AFFEF61C6574CB00C656BA /* SwiftLint */,
9807FA47239685B35BD1B1CC /* [CP] Embed Pods Frameworks */,
2FE9A2C899648AB92ACEAA90 /* [CP] Copy Pods Resources */,
);
Expand All @@ -148,12 +158,12 @@
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0730;
LastUpgradeCheck = 0810;
LastUpgradeCheck = 0900;
ORGANIZATIONNAME = "Prolific Interactive";
TargetAttributes = {
276BCECA1C29F060002138C7 = {
CreatedOnToolsVersion = 7.2;
LastSwiftMigration = 0800;
LastSwiftMigration = 0900;
ProvisioningStyle = Automatic;
};
};
Expand Down Expand Up @@ -191,20 +201,6 @@
/* End PBXResourcesBuildPhase section */

/* Begin PBXShellScriptBuildPhase section */
27AFFEF61C6574CB00C656BA /* SwiftLint */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = SwiftLint;
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "if which swiftlint >/dev/null; then\nswiftlint\nelse\necho \"warning: SwiftLint not installed, download from https://github.com/realm/SwiftLint\"\nfi";
};
2FE9A2C899648AB92ACEAA90 /* [CP] Copy Pods Resources */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
Expand Down Expand Up @@ -261,6 +257,7 @@
94E2C9CA1F081F5900811CE9 /* CustomUIMenu.swift in Sources */,
276BCECF1C29F060002138C7 /* AppDelegate.swift in Sources */,
94E2C9C11F081DDE00811CE9 /* DateSelectorMenu.swift in Sources */,
32CF65FF1F7B052F001A712A /* YoshiBaseEnvironment.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -294,14 +291,20 @@
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = 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_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
Expand Down Expand Up @@ -341,14 +344,20 @@
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = 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_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
Expand Down Expand Up @@ -381,15 +390,19 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = "";
INFOPLIST_FILE = YoshiExample/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.prolificinteractive.YoshiExample;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE = "";
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_OBJC_BRIDGING_HEADER = "YoshiExample/YoshiExample-Bridging-Header.h";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 3.0;
SWIFT_SWIFT3_OBJC_INFERENCE = Off;
SWIFT_VERSION = 4.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
Expand All @@ -403,14 +416,18 @@
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = "";
INFOPLIST_FILE = YoshiExample/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.prolificinteractive.YoshiExample;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE = "";
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_OBJC_BRIDGING_HEADER = "YoshiExample/YoshiExample-Bridging-Header.h";
SWIFT_VERSION = 3.0;
SWIFT_SWIFT3_OBJC_INFERENCE = Off;
SWIFT_VERSION = 4.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Release;
Expand Down
28 changes: 10 additions & 18 deletions Example/YoshiExample/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -41,25 +41,16 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
Yoshi.setupDebugMenu(menu)
}

private var homeViewController: ViewController? {
return window?.rootViewController as? ViewController
}

private func environmentMenu() -> YoshiSubmenu {

var environmentSelections = [YoshiSingleSelection]()

let production = YoshiSingleSelection(title: "Production", subtitle: "https://mobile-api.com")
let staging = YoshiSingleSelection(title: "Staging", subtitle: "https://staging.mobile-api.com")
let qa = YoshiSingleSelection(title: "QA", subtitle: "http://qa.mobile-api.com")

environmentSelections = [production, staging, qa]

return YoshiSingleSelectionMenu(title: "Environment",
options: environmentSelections,
selectedIndex: 0,
didSelect: { selection in
NotificationCenter.default.post(name:
NSNotification.Name(rawValue:
Notifications.EnvironmentUpdatedNotification),
object: selection.title)
})
let environmentOptions = [YoshiBaseEnvironment.qa, YoshiBaseEnvironment.production]
let environmentManager = YoshiEnvironmentManager(environments: environmentOptions) { [weak self] (environment) in
self?.homeViewController?.updateEnvironment(name: environment.name, url: environment.baseURL)
}
return YoshiEnvironmentMenu(environmentManager: environmentManager)
}

private func dateSelectorMenu() -> YoshiDateSelectorMenu {
Expand Down Expand Up @@ -88,6 +79,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
subtitle: "12345567890",
completion: nil)
}

private func menuWithCustomUI() -> YoshiGenericMenu {
return CustomUIMenu()
}
Expand Down
30 changes: 17 additions & 13 deletions Example/YoshiExample/Base.lproj/Main.storyboard
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="10116" systemVersion="15E65" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="BYZ-38-t0r">
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="13196" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="BYZ-38-t0r">
<device id="retina4_7" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="10085"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13173"/>
<capability name="Constraints to layout margins" minToolsVersion="6.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
<!--View Controller-->
Expand All @@ -15,16 +19,16 @@
<viewControllerLayoutGuide type="bottom" id="wfy-db-euE"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC">
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Environment:" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumScaleFactor="0.5" translatesAutoresizingMaskIntoConstraints="NO" id="rgN-qB-zwZ">
<rect key="frame" x="20" y="320" width="274" height="21"/>
<rect key="frame" x="16" y="353" width="165" height="21"/>
<constraints>
<constraint firstAttribute="height" constant="25" id="JDg-5Y-J39"/>
</constraints>
<fontDescription key="fontDescription" type="system" weight="semibold" pointSize="17"/>
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
<variation key="default">
<mask key="constraints">
Expand All @@ -33,12 +37,12 @@
</variation>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Environment Date:" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumScaleFactor="0.5" translatesAutoresizingMaskIntoConstraints="NO" id="Zpa-vq-ZVH">
<rect key="frame" x="20" y="260" width="274" height="21"/>
<rect key="frame" x="16" y="293" width="165" height="21"/>
<constraints>
<constraint firstAttribute="height" constant="25" id="WOT-BP-AgW"/>
</constraints>
<fontDescription key="fontDescription" type="system" weight="semibold" pointSize="17"/>
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
<variation key="default">
<mask key="constraints">
Expand All @@ -47,12 +51,12 @@
</variation>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="wln-Kr-fbl" userLabel="Environment">
<rect key="frame" x="307" y="330" width="273" height="0.0"/>
<rect key="frame" x="194" y="363.5" width="165" height="0.0"/>
<constraints>
<constraint firstAttribute="height" constant="25" id="lGH-wq-eOU"/>
</constraints>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
<variation key="default">
<mask key="constraints">
Expand All @@ -61,12 +65,12 @@
</variation>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="eUX-Fc-fPW" userLabel="EnvironmentDate">
<rect key="frame" x="307" y="270" width="273" height="0.0"/>
<rect key="frame" x="194" y="303.5" width="165" height="0.0"/>
<constraints>
<constraint firstAttribute="height" constant="25" id="KGr-H9-4H2"/>
</constraints>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
<variation key="default">
<mask key="constraints">
Expand All @@ -75,7 +79,7 @@
</variation>
</label>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstItem="eUX-Fc-fPW" firstAttribute="trailing" secondItem="8bC-Xf-vdC" secondAttribute="trailingMargin" id="1L4-6D-teZ"/>
<constraint firstItem="eUX-Fc-fPW" firstAttribute="centerY" secondItem="8bC-Xf-vdC" secondAttribute="centerY" constant="-30" id="8ZB-qa-rgN"/>
Expand Down
Loading

0 comments on commit 2cb83dd

Please sign in to comment.