Skip to content

Commit

Permalink
Updated all iOS and Mac sample applications for Swift 4.1, modernized…
Browse files Browse the repository at this point in the history
… some other pieces elsewhere.
  • Loading branch information
BradLarson committed Jul 4, 2018
1 parent d02d1f5 commit e4e32f9
Show file tree
Hide file tree
Showing 33 changed files with 357 additions and 158 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@
isa = PBXGroup;
children = (
BC9E35DF1E52585600B8604F /* GPUImage.framework */,
BC9E35E11E52585600B8604F /* GPUImage.xctest */,
BC9E35E11E52585600B8604F /* GPUImageTests_macOS.xctest */,
BC9E35E31E52585600B8604F /* GPUImage.framework */,
BC9E35E51E52585600B8604F /* GPUImageTests_iOS.xctest */,
);
Expand Down Expand Up @@ -211,12 +211,12 @@
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0720;
LastUpgradeCheck = 0800;
LastUpgradeCheck = 0940;
ORGANIZATIONNAME = "Sunset Lake Software LLC";
TargetAttributes = {
BC1E133A1C9F82B4008F844F = {
CreatedOnToolsVersion = 7.2.1;
LastSwiftMigration = 0800;
LastSwiftMigration = 0940;
};
};
};
Expand Down Expand Up @@ -252,10 +252,10 @@
remoteRef = BC9E35DE1E52585600B8604F /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
BC9E35E11E52585600B8604F /* GPUImage.xctest */ = {
BC9E35E11E52585600B8604F /* GPUImageTests_macOS.xctest */ = {
isa = PBXReferenceProxy;
fileType = wrapper.cfbundle;
path = GPUImage.xctest;
path = GPUImageTests_macOS.xctest;
remoteRef = BC9E35E01E52585600B8604F /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
Expand Down Expand Up @@ -337,13 +337,23 @@
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_DEPRECATED_OBJC_IMPLEMENTATIONS = 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_IMPLICIT_RETAIN_SELF = 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;
CODE_SIGN_IDENTITY = "-";
Expand Down Expand Up @@ -381,13 +391,23 @@
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_DEPRECATED_OBJC_IMPLEMENTATIONS = 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_IMPLICIT_RETAIN_SELF = 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;
CODE_SIGN_IDENTITY = "-";
Expand Down Expand Up @@ -418,7 +438,8 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.sunsetlakesoftware.FilterShowcase;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 3.0;
SWIFT_SWIFT3_OBJC_INFERENCE = On;
SWIFT_VERSION = 4.0;
};
name = Debug;
};
Expand All @@ -432,7 +453,8 @@
PRODUCT_BUNDLE_IDENTIFIER = com.sunsetlakesoftware.FilterShowcase;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
SWIFT_VERSION = 3.0;
SWIFT_SWIFT3_OBJC_INFERENCE = On;
SWIFT_VERSION = 4.0;
};
name = Release;
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class AppDelegate: NSObject, NSApplicationDelegate {
var windowController:FilterShowcaseWindowController?

func applicationDidFinishLaunching(_ aNotification: Notification) {
self.windowController = FilterShowcaseWindowController(windowNibName:"FilterShowcaseWindowController")
self.windowController = FilterShowcaseWindowController(windowNibName:NSNib.Name(rawValue: "FilterShowcaseWindowController"))
self.windowController?.showWindow(self)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class FilterShowcaseWindowController: NSWindowController {

@IBOutlet weak var filterSlider: NSSlider!

dynamic var currentSliderValue:Float = 0.5 {
@objc dynamic var currentSliderValue:Float = 0.5 {
willSet(newSliderValue) {
switch (currentFilterOperation!.sliderConfiguration) {
case .enabled: currentFilterOperation!.updateBasedOnSliderValue(newSliderValue)
Expand All @@ -30,7 +30,7 @@ class FilterShowcaseWindowController: NSWindowController {
super.windowDidLoad()

do {
videoCamera = try Camera(sessionPreset:AVCaptureSessionPreset1280x720)
videoCamera = try Camera(sessionPreset:.hd1280x720)
videoCamera.runBenchmark = true
videoCamera.startCapture()
} catch {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@
isa = PBXGroup;
children = (
BC9E36011E5258F800B8604F /* GPUImage.framework */,
BC9E36031E5258F800B8604F /* GPUImage.xctest */,
BC9E36031E5258F800B8604F /* GPUImageTests_macOS.xctest */,
BC9E36051E5258F800B8604F /* GPUImage.framework */,
BC9E36071E5258F800B8604F /* GPUImageTests_iOS.xctest */,
);
Expand Down Expand Up @@ -165,12 +165,12 @@
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0720;
LastUpgradeCheck = 0800;
LastUpgradeCheck = 0940;
ORGANIZATIONNAME = "Sunset Lake Software LLC";
TargetAttributes = {
BC1E13071C9F5DB9008F844F = {
CreatedOnToolsVersion = 7.2.1;
LastSwiftMigration = 0800;
LastSwiftMigration = 0940;
};
};
};
Expand Down Expand Up @@ -206,10 +206,10 @@
remoteRef = BC9E36001E5258F800B8604F /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
BC9E36031E5258F800B8604F /* GPUImage.xctest */ = {
BC9E36031E5258F800B8604F /* GPUImageTests_macOS.xctest */ = {
isa = PBXReferenceProxy;
fileType = wrapper.cfbundle;
path = GPUImage.xctest;
path = GPUImageTests_macOS.xctest;
remoteRef = BC9E36021E5258F800B8604F /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
Expand Down Expand Up @@ -281,13 +281,23 @@
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_DEPRECATED_OBJC_IMPLEMENTATIONS = 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_IMPLICIT_RETAIN_SELF = 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;
CODE_SIGN_IDENTITY = "-";
Expand Down Expand Up @@ -325,13 +335,23 @@
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_DEPRECATED_OBJC_IMPLEMENTATIONS = 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_IMPLICIT_RETAIN_SELF = 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;
CODE_SIGN_IDENTITY = "-";
Expand Down Expand Up @@ -362,7 +382,8 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.sunsetlakesoftware.SimpleImageFilter;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 3.0;
SWIFT_SWIFT3_OBJC_INFERENCE = On;
SWIFT_VERSION = 4.0;
};
name = Debug;
};
Expand All @@ -376,7 +397,8 @@
PRODUCT_BUNDLE_IDENTIFIER = com.sunsetlakesoftware.SimpleImageFilter;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
SWIFT_VERSION = 3.0;
SWIFT_SWIFT3_OBJC_INFERENCE = On;
SWIFT_VERSION = 4.0;
};
name = Release;
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ class AppDelegate: NSObject, NSApplicationDelegate {
var image:PictureInput!
var filter:SaturationAdjustment!

dynamic var filterValue = 1.0 {
@objc dynamic var filterValue = 1.0 {
didSet {
filter.saturation = GLfloat(filterValue)
image.processImage()
}
}

func applicationDidFinishLaunching(_ aNotification: Notification) {
let inputImage = NSImage(named:"Lambeau.jpg")!
let inputImage = NSImage(named:NSImage.Name(rawValue: "Lambeau.jpg"))!
image = PictureInput(image:inputImage)

filter = SaturationAdjustment()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
isa = PBXGroup;
children = (
BC9E36141E52594600B8604F /* GPUImage.framework */,
BC9E36161E52594600B8604F /* GPUImage.xctest */,
BC9E36161E52594600B8604F /* GPUImageTests_macOS.xctest */,
BC9E36181E52594600B8604F /* GPUImage.framework */,
BC9E361A1E52594600B8604F /* GPUImageTests_iOS.xctest */,
);
Expand Down Expand Up @@ -165,12 +165,12 @@
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0730;
LastUpgradeCheck = 0800;
LastUpgradeCheck = 0940;
ORGANIZATIONNAME = "Sunset Lake Software LLC";
TargetAttributes = {
BCC49F571CD5AF1D00B63EEB = {
CreatedOnToolsVersion = 7.3;
LastSwiftMigration = 0800;
LastSwiftMigration = 0940;
};
};
};
Expand Down Expand Up @@ -206,10 +206,10 @@
remoteRef = BC9E36131E52594600B8604F /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
BC9E36161E52594600B8604F /* GPUImage.xctest */ = {
BC9E36161E52594600B8604F /* GPUImageTests_macOS.xctest */ = {
isa = PBXReferenceProxy;
fileType = wrapper.cfbundle;
path = GPUImage.xctest;
path = GPUImageTests_macOS.xctest;
remoteRef = BC9E36151E52594600B8604F /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
Expand Down Expand Up @@ -282,13 +282,23 @@
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_DEPRECATED_OBJC_IMPLEMENTATIONS = 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_IMPLICIT_RETAIN_SELF = 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;
CODE_SIGN_IDENTITY = "-";
Expand Down Expand Up @@ -327,13 +337,23 @@
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_DEPRECATED_OBJC_IMPLEMENTATIONS = 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_IMPLICIT_RETAIN_SELF = 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;
CODE_SIGN_IDENTITY = "-";
Expand Down Expand Up @@ -364,7 +384,8 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.sunsetlakesoftware.SimpleMovieFilter;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 3.0;
SWIFT_SWIFT3_OBJC_INFERENCE = On;
SWIFT_VERSION = 4.0;
};
name = Debug;
};
Expand All @@ -378,7 +399,8 @@
PRODUCT_BUNDLE_IDENTIFIER = com.sunsetlakesoftware.SimpleMovieFilter;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
SWIFT_VERSION = 3.0;
SWIFT_SWIFT3_OBJC_INFERENCE = On;
SWIFT_VERSION = 4.0;
};
name = Release;
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class AppDelegate: NSObject, NSApplicationDelegate {
var movie:MovieInput!
var filter:Pixellate!

dynamic var filterValue = 0.05 {
@objc dynamic var filterValue = 0.05 {
didSet {
filter.fractionalWidthOfAPixel = GLfloat(filterValue)
}
Expand Down
Loading

0 comments on commit e4e32f9

Please sign in to comment.