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

Shoot is Swift2.3 #96

Merged
merged 3 commits into from
Sep 22, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 11 additions & 0 deletions Shoot/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,15 @@ use_frameworks!
target 'Shoot' do
pod 'AeroGearHttp', :git => 'http://github.com/aerogear/aerogear-ios-http'
pod 'AeroGearOAuth2', :git => 'http://github.com/aerogear/aerogear-ios-oauth2'
end

# Workaround to fix swifft version to 2.3 for Pods.
# it could be removed once CocoaPods 1.1.0 is released.
# https://github.com/CocoaPods/CocoaPods/issues/5521
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['SWIFT_VERSION'] = '2.3'
end
end
end
6 changes: 6 additions & 0 deletions Shoot/Shoot.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -198,9 +198,11 @@
TargetAttributes = {
48F709FA19B59E9800DDB152 = {
CreatedOnToolsVersion = 6.0;
LastSwiftMigration = 0800;
};
48F70A0C19B59E9800DDB152 = {
CreatedOnToolsVersion = 6.0;
LastSwiftMigration = 0800;
TestTargetID = 48F709FA19B59E9800DDB152;
};
};
Expand Down Expand Up @@ -433,6 +435,7 @@
ONLY_ACTIVE_ARCH = YES;
PRODUCT_BUNDLE_IDENTIFIER = org.aerogear.shoot;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 2.3;
};
name = Debug;
};
Expand All @@ -448,6 +451,7 @@
ONLY_ACTIVE_ARCH = NO;
PRODUCT_BUNDLE_IDENTIFIER = org.aerogear.shoot;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 2.3;
};
name = Release;
};
Expand All @@ -467,6 +471,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "org.aerogear.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 2.3;
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Shoot.app/Shoot";
};
name = Debug;
Expand All @@ -483,6 +488,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "org.aerogear.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 2.3;
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Shoot.app/Shoot";
};
name = Release;
Expand Down
7 changes: 7 additions & 0 deletions Shoot/Shoot/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>

<key>NSCameraUsageDescription</key>
<string>This app needs access to the camera to take photos.</string>
<key>NSPhotoLibraryUsageDescription</key>
<string>This app needs access to photos.</string>


<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
Expand Down
4 changes: 2 additions & 2 deletions Shoot/Shoot/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class ViewController: UIViewController, UIImagePickerControllerDelegate, UINavig
super.viewDidLoad()

// Let's register for settings update notification
NSNotificationCenter.defaultCenter().addObserver(self, selector: "handleSettingsChangedNotification",
NSNotificationCenter.defaultCenter().addObserver(self, selector: #selector(ViewController.handleSettingsChangedNotification),
name: NSUserDefaultsDidChangeNotification, object: nil)
self.http = Http()
self.useCamera()
Expand Down Expand Up @@ -179,7 +179,7 @@ class ViewController: UIViewController, UIImagePickerControllerDelegate, UINavig
self.dismissViewControllerAnimated(true, completion:nil)
let image: UIImage = info[UIImagePickerControllerOriginalImage] as! UIImage
if (newMedia == true) {
UIImageWriteToSavedPhotosAlbum(image, self, Selector("image:didFinishSavingWithError:contextInfo:"), nil)
UIImageWriteToSavedPhotosAlbum(image, self, #selector(ViewController.image(_:didFinishSavingWithError:contextInfo:)), nil)
} else {
let imageURL:NSURL = info[UIImagePickerControllerReferenceURL] as! NSURL
let assetslibrary = ALAssetsLibrary()
Expand Down