Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Swift 2 #6

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion circle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ machine:
LANG: en_US.UTF-8
LC_CTYPE: en_US.UTF-8
xcode:
version: "6.3.1"
version: "7.0"
dependencies:
pre:
- xcrun instruments -w "iPhone 6 (8.3 Simulator)" || exit 0
Expand Down
10 changes: 9 additions & 1 deletion src/Bequest.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,8 @@
5E6B02221A1D2DA500EB5CCC /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0610;
LastSwiftUpdateCheck = 0700;
LastUpgradeCheck = 0700;
ORGANIZATIONNAME = BQST;
TargetAttributes = {
5E6B02291A1D2DA500EB5CCC = {
Expand Down Expand Up @@ -564,6 +565,7 @@
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
GCC_OPTIMIZATION_LEVEL = 0;
Expand Down Expand Up @@ -705,6 +707,7 @@
GCC_WARN_PEDANTIC = YES;
GCC_WARN_STRICT_SELECTOR_MATCH = YES;
INFOPLIST_FILE = "Bequest/Supporting Files/Info.plist";
PRODUCT_BUNDLE_IDENTIFIER = "net.splinesoft.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Bequest/Supporting Files/Bequest-Bridging-Header.h";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
Expand All @@ -729,6 +732,7 @@
GCC_WARN_PEDANTIC = YES;
GCC_WARN_STRICT_SELECTOR_MATCH = YES;
INFOPLIST_FILE = "Bequest/Supporting Files/Info.plist";
PRODUCT_BUNDLE_IDENTIFIER = "net.splinesoft.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Bequest/Supporting Files/Bequest-Bridging-Header.h";
};
Expand All @@ -749,6 +753,7 @@
);
INFOPLIST_FILE = BequestTests/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "net.splinesoft.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "$(SRCROOT)/BequestTests/BequestTestsBridgingHeader.h";
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Bequest.app/Bequest";
Expand All @@ -766,6 +771,7 @@
);
INFOPLIST_FILE = BequestTests/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "net.splinesoft.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "$(SRCROOT)/BequestTests/BequestTestsBridgingHeader.h";
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Bequest.app/Bequest";
Expand Down Expand Up @@ -864,6 +870,7 @@
GCC_WARN_PEDANTIC = YES;
GCC_WARN_STRICT_SELECTOR_MATCH = YES;
INFOPLIST_FILE = "Bequest/Supporting Files/Info.plist";
PRODUCT_BUNDLE_IDENTIFIER = "net.splinesoft.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Bequest/Supporting Files/Bequest-Bridging-Header.h";
};
Expand All @@ -880,6 +887,7 @@
);
INFOPLIST_FILE = BequestTests/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "net.splinesoft.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "$(SRCROOT)/BequestTests/BequestTestsBridgingHeader.h";
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Bequest.app/Bequest";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0610"
LastUpgradeVersion = "0700"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down Expand Up @@ -62,6 +62,8 @@
ReferencedContainer = "container:Bequest.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
Expand All @@ -71,8 +73,10 @@
buildConfiguration = "Adhoc"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<BuildableProductRunnable>
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "5E6B02291A1D2DA500EB5CCC"
Expand All @@ -90,7 +94,8 @@
useCustomWorkingDirectory = "NO"
buildConfiguration = "Adhoc"
debugDocumentVersioning = "YES">
<BuildableProductRunnable>
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "5E6B02291A1D2DA500EB5CCC"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0610"
LastUpgradeVersion = "0700"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down Expand Up @@ -40,6 +40,7 @@
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
codeCoverageEnabled = "YES"
buildConfiguration = "Debug">
<Testables>
<TestableReference
Expand All @@ -62,6 +63,8 @@
ReferencedContainer = "container:Bequest.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
Expand All @@ -71,8 +74,10 @@
buildConfiguration = "Debug"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<BuildableProductRunnable>
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "5E6B02291A1D2DA500EB5CCC"
Expand All @@ -90,7 +95,8 @@
useCustomWorkingDirectory = "NO"
buildConfiguration = "Debug"
debugDocumentVersioning = "YES">
<BuildableProductRunnable>
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "5E6B02291A1D2DA500EB5CCC"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0610"
LastUpgradeVersion = "0700"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down Expand Up @@ -62,6 +62,8 @@
ReferencedContainer = "container:Bequest.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
Expand All @@ -71,8 +73,10 @@
buildConfiguration = "Release"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<BuildableProductRunnable>
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "5E6B02291A1D2DA500EB5CCC"
Expand All @@ -90,7 +94,8 @@
useCustomWorkingDirectory = "NO"
buildConfiguration = "Release"
debugDocumentVersioning = "YES">
<BuildableProductRunnable>
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "5E6B02291A1D2DA500EB5CCC"
Expand Down
2 changes: 1 addition & 1 deletion src/Bequest/Additions/NSData+BQSTAdditions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ extension NSData {
return convertedString
}

func BQSTString(#contentType: String?) -> NSString {
func BQSTString(contentType contentType: String?) -> NSString {
var string: NSString?

if let contentTypeComponents = contentType?.componentsSeparatedByString(";") {
Expand Down
2 changes: 1 addition & 1 deletion src/Bequest/Additions/UIViewController+BQSTAlerts.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ extension UIViewController {
}

func BQSTShowSimpleErrorAlert(title: String, error: NSError?) {
println("Request error: \(error)")
print("Request error: \(error)", appendNewline: false)

let msg: String = (error?.userInfo?[NSUnderlyingErrorKey] as! NSError).localizedDescription
?? BQSTLocalizedString("REQUEST_RESPONSE_GENERIC_ERROR")
Expand Down
2 changes: 1 addition & 1 deletion src/Bequest/Controllers/BQSTNavigationController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class BQSTNavigationController: UINavigationController {
return self.visibleViewController.shouldAutorotate()
}

override func supportedInterfaceOrientations() -> Int {
override func supportedInterfaceOrientations() -> UIInterfaceOrientationMask {
return self.visibleViewController.supportedInterfaceOrientations()
}

Expand Down
8 changes: 4 additions & 4 deletions src/Bequest/Controllers/BQSTRequestController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -148,19 +148,19 @@ class BQSTRequestController: UIViewController, UICollectionViewDelegate, UIColle

let request: NSURLRequest = BQSTRequestManager.sharedManager.currentRequest

if count(request.URL!.absoluteString!) == 0 {
if (request.URL!.absoluteString!).characters.count == 0 {
self.BQSTShowSimpleErrorAlert(BQSTLocalizedString("REQUEST_URL_MISSING"),
message: BQSTLocalizedString("REQUEST_URL_MISSING_DETAIL"))
return
}

if request.HTTPMethod == nil || count(request.HTTPMethod!) == 0 {
if request.HTTPMethod == nil || (request.HTTPMethod!).characters.count == 0 {
self.BQSTShowSimpleErrorAlert(BQSTLocalizedString("REQUEST_METHOD_MISSING"),
message: BQSTLocalizedString("REQUEST_METHOD_MISSING_DETAIL"))
return
}

println("Sending a request of type \(request.HTTPMethod!) to URL \(request.URL!)")
print("Sending a request of type \(request.HTTPMethod!) to URL \(request.URL!)", appendNewline: false)

self.progressButton.progressPercentage = 0
self.progressButton.progressState = .Loading
Expand Down Expand Up @@ -217,7 +217,7 @@ class BQSTRequestController: UIViewController, UICollectionViewDelegate, UIColle
/// MARK: UICollectionViewDelegate

func collectionView(collectionView: UICollectionView, didSelectItemAtIndexPath indexPath: NSIndexPath) {
println("Selected index \(indexPath)")
print("Selected index \(indexPath)", appendNewline: false)
}

/// MARK: UICollectionViewDelegateFlowLayout
Expand Down
12 changes: 6 additions & 6 deletions src/Bequest/Controllers/BQSTResponseController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ class BQSTResponseController: UITableViewController {
}

if requestHeaders.count > 0 {
let sortedNames: [NSObject] = (requestHeaders.keys.array.sorted {
let sortedNames: [NSObject] = (requestHeaders.keys.array.sort {
return ($0 as! String) < ($1 as! String)
})

Expand All @@ -185,7 +185,7 @@ class BQSTResponseController: UITableViewController {
// Response Headers
if let responseHeaders = response?.allHeaderFields {
if responseHeaders.count > 0 {
let sortedNames: [NSObject] = (responseHeaders.keys.array.sorted {
let sortedNames: [NSObject] = (responseHeaders.keys.array.sort {
return ($0 as! String) < ($1 as! String)
})

Expand Down Expand Up @@ -213,13 +213,13 @@ class BQSTResponseController: UITableViewController {
case .HTML, .TXT:
let str = parsedResponse?.object as? String

if str != nil && count(str!) > 0 {
if str != nil && (str!).characters.count > 0 {
addBodySection()
}
case .JSON:
let dict = parsedResponse?.object as? [NSObject:AnyObject]

if dict != nil && count(dict!) > 0 {
if dict != nil && (dict!).count > 0 {
addBodySection()
}
default:
Expand Down Expand Up @@ -339,7 +339,7 @@ class BQSTResponseController: UITableViewController {
override func tableView(tableView: UITableView,
canPerformAction action: Selector,
forRowAtIndexPath indexPath: NSIndexPath,
withSender sender: AnyObject) -> Bool {
withSender sender: AnyObject?) -> Bool {

switch self.responseSectionAtIndex(indexPath.section) {
case .ResponseHeaders, .RequestHeaders, .Request:
Expand All @@ -352,7 +352,7 @@ class BQSTResponseController: UITableViewController {
override func tableView(tableView: UITableView,
performAction action: Selector,
forRowAtIndexPath indexPath: NSIndexPath,
withSender sender: AnyObject!) {
withSender sender: AnyObject?) {

switch self.responseSectionAtIndex(indexPath.section) {
case .ResponseHeaders, .RequestHeaders, .Request:
Expand Down
4 changes: 2 additions & 2 deletions src/Bequest/Networking/BQSTHTTPResponse.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public enum BQSTJSONResult {
public static func resultForData(data: NSData, options: NSJSONReadingOptions = .AllowFragments) -> BQSTJSONResult {

var error: NSError?
var object = NSJSONSerialization.JSONObjectWithData(data, options: options, error: &error) as? BQSTJSONResponse
var object = NSJSONSerialization.JSONObjectWithData(data, options: options) as? BQSTJSONResponse

if object != nil {
return .Success(object!)
Expand Down Expand Up @@ -77,7 +77,7 @@ public struct BQSTHTTPResponse {

serializedResponse.contentType = contentType

println("content-type: \(contentTypeRaw)")
print("content-type: \(contentTypeRaw)", appendNewline: false)

switch contentType {
case .JSON:
Expand Down
2 changes: 1 addition & 1 deletion src/Bequest/Supporting Files/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>net.splinesoft.$(PRODUCT_NAME:rfc1034identifier)</string>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
Expand Down
2 changes: 1 addition & 1 deletion src/BequestTests/BQSTKIFTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class BQSTKIFTests: KIFTestCase {

private func setUpRequest(url: String, method: String) {
tester.clearTextFromAndThenEnterText(url, intoViewWithAccessibilityLabel: "URL")
tester.tapViewWithAccessibilityLabel(count(method) > 0 ? method: "GET")
tester.tapViewWithAccessibilityLabel(method.characters.count > 0 ? method: "GET")
}

override func beforeAll() {
Expand Down
2 changes: 1 addition & 1 deletion src/BequestTests/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>net.splinesoft.$(PRODUCT_NAME:rfc1034identifier)</string>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
Expand Down
4 changes: 2 additions & 2 deletions src/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ def import_pods
pod 'TTTAttributedLabel'
pod 'JTSImageViewController'
pod 'CYRTextView'
pod 'SnapKit'
pod 'SnapKit', :git => '[email protected]:SnapKit/SnapKit.git', :branch => 'swift-2.0'

# Networking
pod 'Alamofire'
pod 'Alamofire', :git => '[email protected]:Alamofire/Alamofire.git', :branch => 'swift-2.0'
end

target :Bequest do
Expand Down
Loading