Skip to content

Commit

Permalink
Merge pull request #185 from hyperoslo/fix/swift4
Browse files Browse the repository at this point in the history
Update project to Swift 4
  • Loading branch information
onmyway133 authored Oct 18, 2017
2 parents c0f2f17 + 3f82c02 commit 8515f4d
Show file tree
Hide file tree
Showing 9 changed files with 62 additions and 87 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
13 changes: 5 additions & 8 deletions Demo/WhisperDemo/Podfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '9.0'

platform :ios, '8.0'

use_frameworks!
inhibit_all_warnings!

pod 'Whisper', path: '../../'
target 'WhisperDemo'
target 'WhisperDemo' do
use_frameworks!
pod 'Whisper', path: '../../'
end
6 changes: 3 additions & 3 deletions Demo/WhisperDemo/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
PODS:
- Whisper (5.0.0)
- Whisper (6.0.0)

DEPENDENCIES:
- Whisper (from `../../`)
Expand All @@ -9,8 +9,8 @@ EXTERNAL SOURCES:
:path: ../../

SPEC CHECKSUMS:
Whisper: 39b833d0f279912a7f38a19c4ba603435514a550
Whisper: e378cccfd5c65f159b434af7e22f26cfcac85354

PODFILE CHECKSUM: e20a3f258a5cd7e57b37f62aadb18fd14d135133
PODFILE CHECKSUM: f52f1d3574ddf7c89d7e8d81959a128778d1ac51

COCOAPODS: 1.3.1
72 changes: 40 additions & 32 deletions Demo/WhisperDemo/WhisperDemo.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
29AD42A01BBC2BD2004292F1 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 29AD429F1BBC2BD2004292F1 /* ViewController.swift */; };
29AD42A51BBC2BD2004292F1 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 29AD42A41BBC2BD2004292F1 /* Assets.xcassets */; };
29AD42A81BBC2BD2004292F1 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 29AD42A61BBC2BD2004292F1 /* LaunchScreen.storyboard */; };
927D368A05BDABD5E87F619D /* Pods_WhisperDemo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3921969B70815F246AED7F27 /* Pods_WhisperDemo.framework */; };
F0A980C33596AF684B3D9EB0 /* Pods_WhisperDemo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AD9E11F8DF355CB269D58C5F /* Pods_WhisperDemo.framework */; };
/* End PBXBuildFile section */

/* Begin PBXContainerItemProxy section */
Expand All @@ -37,10 +37,10 @@
29AD42A41BBC2BD2004292F1 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
29AD42A71BBC2BD2004292F1 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
29AD42A91BBC2BD2004292F1 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
3921969B70815F246AED7F27 /* Pods_WhisperDemo.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_WhisperDemo.framework; sourceTree = BUILT_PRODUCTS_DIR; };
6F0DEAB1F8C735F802579CE1 /* Pods.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods.framework; sourceTree = BUILT_PRODUCTS_DIR; };
955FFF144EC297785D2EF6F9 /* Pods-WhisperDemo.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-WhisperDemo.debug.xcconfig"; path = "Pods/Target Support Files/Pods-WhisperDemo/Pods-WhisperDemo.debug.xcconfig"; sourceTree = "<group>"; };
E7E536866D2D92CA0E048ABC /* Pods-WhisperDemo.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-WhisperDemo.release.xcconfig"; path = "Pods/Target Support Files/Pods-WhisperDemo/Pods-WhisperDemo.release.xcconfig"; sourceTree = "<group>"; };
AD9E11F8DF355CB269D58C5F /* Pods_WhisperDemo.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_WhisperDemo.framework; sourceTree = BUILT_PRODUCTS_DIR; };
B056A0C0A940EF3C92E08D24 /* Pods-WhisperDemo.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-WhisperDemo.debug.xcconfig"; path = "Pods/Target Support Files/Pods-WhisperDemo/Pods-WhisperDemo.debug.xcconfig"; sourceTree = "<group>"; };
EF03BCFAFBE8B2FA7C98C617 /* Pods-WhisperDemo.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-WhisperDemo.release.xcconfig"; path = "Pods/Target Support Files/Pods-WhisperDemo/Pods-WhisperDemo.release.xcconfig"; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
Expand All @@ -55,7 +55,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
927D368A05BDABD5E87F619D /* Pods_WhisperDemo.framework in Frameworks */,
F0A980C33596AF684B3D9EB0 /* Pods_WhisperDemo.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand All @@ -66,7 +66,7 @@
isa = PBXGroup;
children = (
6F0DEAB1F8C735F802579CE1 /* Pods.framework */,
3921969B70815F246AED7F27 /* Pods_WhisperDemo.framework */,
AD9E11F8DF355CB269D58C5F /* Pods_WhisperDemo.framework */,
);
name = Frameworks;
sourceTree = "<group>";
Expand All @@ -87,7 +87,7 @@
290531401C206A6400FB382C /* WhisperTests */,
29AD429B1BBC2BD2004292F1 /* Products */,
029D90BE27CCA78731543D55 /* Frameworks */,
C6105C06E05EE7306BB12C3D /* Pods */,
92E7BFA29EF63C51C080FD06 /* Pods */,
);
sourceTree = "<group>";
};
Expand All @@ -113,11 +113,11 @@
path = WhisperDemo;
sourceTree = "<group>";
};
C6105C06E05EE7306BB12C3D /* Pods */ = {
92E7BFA29EF63C51C080FD06 /* Pods */ = {
isa = PBXGroup;
children = (
955FFF144EC297785D2EF6F9 /* Pods-WhisperDemo.debug.xcconfig */,
E7E536866D2D92CA0E048ABC /* Pods-WhisperDemo.release.xcconfig */,
B056A0C0A940EF3C92E08D24 /* Pods-WhisperDemo.debug.xcconfig */,
EF03BCFAFBE8B2FA7C98C617 /* Pods-WhisperDemo.release.xcconfig */,
);
name = Pods;
sourceTree = "<group>";
Expand Down Expand Up @@ -147,12 +147,12 @@
isa = PBXNativeTarget;
buildConfigurationList = 29AD42AC1BBC2BD2004292F1 /* Build configuration list for PBXNativeTarget "WhisperDemo" */;
buildPhases = (
7C2AD771C3E0C8D8C952C8C1 /* [CP] Check Pods Manifest.lock */,
C522021051BE11D3DAB44930 /* [CP] Check Pods Manifest.lock */,
29AD42961BBC2BD2004292F1 /* Sources */,
29AD42971BBC2BD2004292F1 /* Frameworks */,
29AD42981BBC2BD2004292F1 /* Resources */,
386529A60BE25BE05191D829 /* [CP] Embed Pods Frameworks */,
BCC353EC93296D0E781E45A8 /* [CP] Copy Pods Resources */,
D5B676FD334912E862F55066 /* [CP] Embed Pods Frameworks */,
BB4915A56966DA1B990596E3 /* [CP] Copy Pods Resources */,
);
buildRules = (
);
Expand All @@ -170,7 +170,7 @@
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0720;
LastUpgradeCheck = 0800;
LastUpgradeCheck = 0900;
ORGANIZATIONNAME = "Ramon Gilabert Llop";
TargetAttributes = {
290531351C206A3800FB382C = {
Expand Down Expand Up @@ -224,25 +224,22 @@
/* End PBXResourcesBuildPhase section */

/* Begin PBXShellScriptBuildPhase section */
386529A60BE25BE05191D829 /* [CP] Embed Pods Frameworks */ = {
BB4915A56966DA1B990596E3 /* [CP] Copy Pods Resources */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
"${SRCROOT}/Pods/Target Support Files/Pods-WhisperDemo/Pods-WhisperDemo-frameworks.sh",
"${BUILT_PRODUCTS_DIR}/Whisper/Whisper.framework",
);
name = "[CP] Embed Pods Frameworks";
name = "[CP] Copy Pods Resources";
outputPaths = (
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Whisper.framework",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-WhisperDemo/Pods-WhisperDemo-frameworks.sh\"\n";
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-WhisperDemo/Pods-WhisperDemo-resources.sh\"\n";
showEnvVarsInLog = 0;
};
7C2AD771C3E0C8D8C952C8C1 /* [CP] Check Pods Manifest.lock */ = {
C522021051BE11D3DAB44930 /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
Expand All @@ -260,19 +257,22 @@
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
showEnvVarsInLog = 0;
};
BCC353EC93296D0E781E45A8 /* [CP] Copy Pods Resources */ = {
D5B676FD334912E862F55066 /* [CP] Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
"${SRCROOT}/Pods/Target Support Files/Pods-WhisperDemo/Pods-WhisperDemo-frameworks.sh",
"${BUILT_PRODUCTS_DIR}/Whisper/Whisper.framework",
);
name = "[CP] Copy Pods Resources";
name = "[CP] Embed Pods Frameworks";
outputPaths = (
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Whisper.framework",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-WhisperDemo/Pods-WhisperDemo-resources.sh\"\n";
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-WhisperDemo/Pods-WhisperDemo-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
/* End PBXShellScriptBuildPhase section */
Expand Down Expand Up @@ -326,7 +326,6 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = no.hyper.WhisperTests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 3.0;
TEST_TARGET_NAME = WhisperDemo;
USES_XCTRUNNER = YES;
};
Expand All @@ -340,7 +339,6 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = no.hyper.WhisperTests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 3.0;
TEST_TARGET_NAME = WhisperDemo;
USES_XCTRUNNER = YES;
};
Expand All @@ -354,14 +352,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 @@ -389,7 +393,7 @@
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 3.0;
SWIFT_VERSION = 4.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
Expand All @@ -402,14 +406,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 All @@ -430,15 +440,15 @@
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
SWIFT_VERSION = 3.0;
SWIFT_VERSION = 4.0;
TARGETED_DEVICE_FAMILY = "1,2";
VALIDATE_PRODUCT = YES;
};
name = Release;
};
29AD42AD1BBC2BD2004292F1 /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 955FFF144EC297785D2EF6F9 /* Pods-WhisperDemo.debug.xcconfig */;
baseConfigurationReference = B056A0C0A940EF3C92E08D24 /* Pods-WhisperDemo.debug.xcconfig */;
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
Expand All @@ -448,13 +458,12 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = no.hyper.WhisperDemo;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 3.0;
};
name = Debug;
};
29AD42AE1BBC2BD2004292F1 /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = E7E536866D2D92CA0E048ABC /* Pods-WhisperDemo.release.xcconfig */;
baseConfigurationReference = EF03BCFAFBE8B2FA7C98C617 /* Pods-WhisperDemo.release.xcconfig */;
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
Expand All @@ -464,7 +473,6 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = no.hyper.WhisperDemo;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 3.0;
};
name = Release;
};
Expand Down

This file was deleted.

14 changes: 7 additions & 7 deletions Demo/WhisperDemo/WhisperDemo/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -124,30 +124,30 @@ class ViewController: UIViewController {

// MARK: Action methods

func presentButtonDidPress(_ button: UIButton) {
@objc func presentButtonDidPress(_ button: UIButton) {
guard let navigationController = navigationController else { return }
let message = Message(title: "This message will silent in 3 seconds.", backgroundColor: UIColor(red:0.89, green:0.09, blue:0.44, alpha:1))

Whisper.show(whisper: message, to: navigationController, action: .present)
hide(whisperFrom: navigationController, after: 3)
}

func showButtonDidPress(_ button: UIButton) {
@objc func showButtonDidPress(_ button: UIButton) {
guard let navigationController = navigationController else { return }

let message = Message(title: "Showing all the things.", backgroundColor: UIColor.black)
Whisper.show(whisper: message, to: navigationController)
}

func presentPermanentButtonDidPress(_ button: UIButton) {
@objc func presentPermanentButtonDidPress(_ button: UIButton) {
guard let navigationController = navigationController else { return }

let message = Message(title: "This is a permanent Whisper.", textColor: UIColor(red:0.87, green:0.34, blue:0.05, alpha:1),
backgroundColor: UIColor(red:1.000, green:0.973, blue:0.733, alpha: 1))
Whisper.show(whisper: message, to: navigationController, action: .present)
}

func presentNotificationDidPress(_ button: UIButton) {
@objc func presentNotificationDidPress(_ button: UIButton) {
let announcement = Announcement(title: "Ramon Gilabert", subtitle: "Vadym Markov just commented your post: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.'", image: UIImage(named: "avatar"), duration: 30)

if let navigationController = navigationController {
Expand All @@ -157,19 +157,19 @@ class ViewController: UIViewController {
}
}

func nextButtonDidPress() {
@objc func nextButtonDidPress() {
let controller = TableViewController()
navigationController?.pushViewController(controller, animated: true)
}

func showWhistleButtonDidPress(_ button: UIButton) {
@objc func showWhistleButtonDidPress(_ button: UIButton) {
let murmur = Murmur(title: "This is a small whistle...",
backgroundColor: UIColor(red: 0.975, green: 0.975, blue: 0.975, alpha: 1))

Whisper.show(whistle: murmur)
}

func presentWhistleButtonDidPress(_ button: UIButton) {
@objc func presentWhistleButtonDidPress(_ button: UIButton) {
let murmur = Murmur(title: "This is a permanent whistle...",
backgroundColor: UIColor.red,
titleColor: UIColor.white)
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
[![Carthage](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)
[![License](https://img.shields.io/cocoapods/l/Whisper.svg?style=flat)](http://cocoadocs.org/docsets/Whisper)
[![Platform](https://img.shields.io/cocoapods/p/Whisper.svg?style=flat)](http://cocoadocs.org/docsets/Whisper)
![Swift](https://img.shields.io/badge/%20in-swift%203.0-orange.svg)
![Swift](https://img.shields.io/badge/%20in-swift%204.0-orange.svg)

## Description :leaves:

Expand Down Expand Up @@ -109,7 +109,7 @@ In the future the idea is to keep improving and add some features:

## Author

[Hyper](http://hyper.no) made this with ❤️. If you’re using this library we probably want to [hire you](https://github.com/hyperoslo/iOS-playbook/blob/master/HYPER_RECIPES.md)! Send us an email at [email protected].
[Hyper](http://hyper.no) made this with ❤️

## Contribute

Expand Down
Loading

0 comments on commit 8515f4d

Please sign in to comment.