Skip to content

Commit

Permalink
Add default bundle in parameters, cleaning
Browse files Browse the repository at this point in the history
  • Loading branch information
alexiscreuzot committed Jan 16, 2023
1 parent 0b678b1 commit 230f7d1
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 43 deletions.
32 changes: 17 additions & 15 deletions SwiftyGif.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,12 @@
EF34CB5522A524F6002A6C92 /* single_frame_Zt2012.gif in Resources */ = {isa = PBXBuildFile; fileRef = EF26CB8A22A167B100E92383 /* single_frame_Zt2012.gif */; };
EF34CB5622A524FA002A6C92 /* 20000x20000.gif in Resources */ = {isa = PBXBuildFile; fileRef = EF26CB8C22A16DB900E92383 /* 20000x20000.gif */; };
EF34CB5722A524FE002A6C92 /* no_property_dictionary.gif in Resources */ = {isa = PBXBuildFile; fileRef = EF26CB8822A166E400E92383 /* no_property_dictionary.gif */; };
EF34CB5822A52506002A6C92 /* sample.jpg in Resources */ = {isa = PBXBuildFile; fileRef = EF26CB8E22A1796800E92383 /* sample.jpg */; };
EF34CB5F22A52909002A6C92 /* SnapshotTesting.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = EF34CB5E22A52909002A6C92 /* SnapshotTesting.framework */; };
EF34CB6122A52929002A6C92 /* SnapshotTesting.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = EF34CB5E22A52909002A6C92 /* SnapshotTesting.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
EF34CB6322A54271002A6C92 /* 15MB_Einstein_rings_zoom.gif in Resources */ = {isa = PBXBuildFile; fileRef = EF34CB6222A54271002A6C92 /* 15MB_Einstein_rings_zoom.gif */; };
EF34CB6422A54ABC002A6C92 /* no_property_dictionary.gif in Resources */ = {isa = PBXBuildFile; fileRef = EF26CB8822A166E400E92383 /* no_property_dictionary.gif */; };
EF34CB6522A54AC0002A6C92 /* single_frame_Zt2012.gif in Resources */ = {isa = PBXBuildFile; fileRef = EF26CB8A22A167B100E92383 /* single_frame_Zt2012.gif */; };
EF34CB6722A54ACE002A6C92 /* 20000x20000.gif in Resources */ = {isa = PBXBuildFile; fileRef = EF26CB8C22A16DB900E92383 /* 20000x20000.gif */; };
EF34CB6822A54AD3002A6C92 /* sample.jpg in Resources */ = {isa = PBXBuildFile; fileRef = EF26CB8E22A1796800E92383 /* sample.jpg */; };
FA57CC981CB3EDAA000F3476 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = FA57CC871CB3EDAA000F3476 /* AppDelegate.swift */; };
FA57CC991CB3EDAA000F3476 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = FA57CC881CB3EDAA000F3476 /* Assets.xcassets */; };
FA57CC9A1CB3EDAA000F3476 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = FA57CC8A1CB3EDAA000F3476 /* LaunchScreen.storyboard */; };
Expand Down Expand Up @@ -119,7 +117,6 @@
EF26CB8822A166E400E92383 /* no_property_dictionary.gif */ = {isa = PBXFileReference; lastKnownFileType = image.gif; path = no_property_dictionary.gif; sourceTree = "<group>"; };
EF26CB8A22A167B100E92383 /* single_frame_Zt2012.gif */ = {isa = PBXFileReference; lastKnownFileType = image.gif; path = single_frame_Zt2012.gif; sourceTree = "<group>"; };
EF26CB8C22A16DB900E92383 /* 20000x20000.gif */ = {isa = PBXFileReference; lastKnownFileType = image.gif; path = 20000x20000.gif; sourceTree = "<group>"; };
EF26CB8E22A1796800E92383 /* sample.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = sample.jpg; sourceTree = "<group>"; };
EF34CB4A22A51591002A6C92 /* SwiftyGifTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = SwiftyGifTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
EF34CB4C22A51591002A6C92 /* SwiftyGifTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SwiftyGifTests.swift; sourceTree = "<group>"; };
EF34CB4E22A51591002A6C92 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
Expand Down Expand Up @@ -219,7 +216,6 @@
EF26CB8822A166E400E92383 /* no_property_dictionary.gif */,
EF26CB8A22A167B100E92383 /* single_frame_Zt2012.gif */,
EF26CB8C22A16DB900E92383 /* 20000x20000.gif */,
EF26CB8E22A1796800E92383 /* sample.jpg */,
);
path = Images;
sourceTree = "<group>";
Expand Down Expand Up @@ -438,7 +434,7 @@
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 1150;
LastUpgradeCheck = 1000;
LastUpgradeCheck = 1410;
ORGANIZATIONNAME = alexiscreuzot;
TargetAttributes = {
2301889724D95CA100EFE1BC = {
Expand Down Expand Up @@ -513,7 +509,6 @@
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
EF34CB5822A52506002A6C92 /* sample.jpg in Resources */,
EF34CB5522A524F6002A6C92 /* single_frame_Zt2012.gif in Resources */,
EF34CB5622A524FA002A6C92 /* 20000x20000.gif in Resources */,
EF34CB5722A524FE002A6C92 /* no_property_dictionary.gif in Resources */,
Expand All @@ -532,7 +527,6 @@
FAF19DE11CC90F9200454324 /* 3.gif in Resources */,
EF34CB6722A54ACE002A6C92 /* 20000x20000.gif in Resources */,
FA57CCA31CB3EDAA000F3476 /* 5.gif in Resources */,
EF34CB6822A54AD3002A6C92 /* sample.jpg in Resources */,
FAC7163D1CCA26AE0018A0CF /* 4.gif in Resources */,
FA57CC9A1CB3EDAA000F3476 /* LaunchScreen.storyboard in Resources */,
EF34CB6422A54ABC002A6C92 /* no_property_dictionary.gif in Resources */,
Expand Down Expand Up @@ -649,6 +643,7 @@
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
CODE_SIGN_STYLE = Automatic;
DEAD_CODE_STRIPPING = YES;
DEVELOPMENT_TEAM = 57W7KG4A63;
EXECUTABLE_PREFIX = lib;
GCC_C_LANGUAGE_STANDARD = gnu11;
Expand All @@ -671,6 +666,7 @@
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
CODE_SIGN_STYLE = Automatic;
DEAD_CODE_STRIPPING = YES;
DEVELOPMENT_TEAM = 57W7KG4A63;
EXECUTABLE_PREFIX = lib;
GCC_C_LANGUAGE_STANDARD = gnu11;
Expand All @@ -693,8 +689,10 @@
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
CODE_SIGN_ENTITLEMENTS = SwiftyGifMacExample/SwiftyGifMacExample.entitlements;
CODE_SIGN_IDENTITY = "-";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
DEAD_CODE_STRIPPING = YES;
DEVELOPMENT_TEAM = 57W7KG4A63;
ENABLE_HARDENED_RUNTIME = YES;
GCC_C_LANGUAGE_STANDARD = gnu11;
Expand All @@ -721,8 +719,10 @@
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
CODE_SIGN_ENTITLEMENTS = SwiftyGifMacExample/SwiftyGifMacExample.entitlements;
CODE_SIGN_IDENTITY = "-";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
DEAD_CODE_STRIPPING = YES;
DEVELOPMENT_TEAM = 57W7KG4A63;
ENABLE_HARDENED_RUNTIME = YES;
GCC_C_LANGUAGE_STANDARD = gnu11;
Expand Down Expand Up @@ -750,7 +750,7 @@
DYLIB_INSTALL_NAME_BASE = "@rpath";
INFOPLIST_FILE = SwiftyGif/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.alexiscreuzot.SwiftyGif.SwiftyGif;
PRODUCT_NAME = "$(TARGET_NAME)";
Expand All @@ -775,7 +775,7 @@
DYLIB_INSTALL_NAME_BASE = "@rpath";
INFOPLIST_FILE = SwiftyGif/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.alexiscreuzot.SwiftyGif.SwiftyGif;
PRODUCT_NAME = "$(TARGET_NAME)";
Expand All @@ -802,7 +802,7 @@
);
GCC_C_LANGUAGE_STANDARD = gnu11;
INFOPLIST_FILE = SwiftyGifTests/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES;
Expand Down Expand Up @@ -830,7 +830,7 @@
);
GCC_C_LANGUAGE_STANDARD = gnu11;
INFOPLIST_FILE = SwiftyGifTests/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
MTL_FAST_MATH = YES;
PRODUCT_BUNDLE_IDENTIFIER = BillChan.SwiftyGifTests;
Expand Down Expand Up @@ -863,6 +863,7 @@
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
Expand All @@ -887,7 +888,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
Expand Down Expand Up @@ -920,6 +921,7 @@
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
Expand All @@ -938,7 +940,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
Expand All @@ -955,7 +957,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
DEVELOPMENT_TEAM = "";
INFOPLIST_FILE = "$(SRCROOT)/SwiftyGifExample/Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.alexiscreuzot.SwiftyGif;
PRODUCT_NAME = "$(TARGET_NAME)";
Expand All @@ -970,7 +972,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
DEVELOPMENT_TEAM = "";
INFOPLIST_FILE = "$(SRCROOT)/SwiftyGifExample/Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.alexiscreuzot.SwiftyGif;
PRODUCT_NAME = "$(TARGET_NAME)";
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 = "1000"
LastUpgradeVersion = "1410"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down Expand Up @@ -29,8 +29,6 @@
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
Expand All @@ -51,8 +49,6 @@
ReferencedContainer = "container:SwiftyGif.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
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 = "1000"
LastUpgradeVersion = "1410"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand All @@ -27,6 +27,15 @@
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "FA29E9311CA9340E00E579D5"
BuildableName = "SwiftyGifExample.app"
BlueprintName = "SwiftyGifExample"
ReferencedContainer = "container:SwiftyGif.xcodeproj">
</BuildableReference>
</MacroExpansion>
<Testables>
<TestableReference
skipped = "NO">
Expand All @@ -39,17 +48,6 @@
</BuildableReference>
</TestableReference>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "FA29E9311CA9340E00E579D5"
BuildableName = "SwiftyGifExample.app"
BlueprintName = "SwiftyGifExample"
ReferencedContainer = "container:SwiftyGif.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
Expand All @@ -71,8 +69,6 @@
ReferencedContainer = "container:SwiftyGif.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
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 = "1150"
LastUpgradeVersion = "1410"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
7 changes: 3 additions & 4 deletions SwiftyGif/NSImage+SwiftyGif.swift
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public extension NSImage {
///
/// - Parameter imageName: Filename
/// - Parameter levelOfIntegrity: 0 to 1, 1 meaning no frame skipping
convenience init?(imageName: String, levelOfIntegrity: GifLevelOfIntegrity = .default, bundle: Bundle) throws {
convenience init?(imageName: String, levelOfIntegrity: GifLevelOfIntegrity = .default, bundle: Bundle = Bundle.main) throws {
self.init()

do {
Expand Down Expand Up @@ -121,9 +121,8 @@ public extension NSImage {
///
/// - Parameter name: Filename
/// - Parameter levelOfIntegrity: 0 to 1, 1 meaning no frame skipping
func setGif(_ name: String, levelOfIntegrity: GifLevelOfIntegrity, bundle: Bundle) throws {
giflog(bundle)

func setGif(_ name: String, levelOfIntegrity: GifLevelOfIntegrity, bundle: Bundle = Bundle.main) throws {

if let url = bundle.url(forResource: name,
withExtension: name.pathExtension() == "gif" ? "" : "gif") {
if let data = try? Data(contentsOf: url) {
Expand Down
8 changes: 4 additions & 4 deletions SwiftyGif/UIImage+SwiftyGif.swift
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public extension UIImage {
///
/// - Parameter imageName: Filename
/// - Parameter levelOfIntegrity: 0 to 1, 1 meaning no frame skipping
convenience init?(imageName: String, levelOfIntegrity: GifLevelOfIntegrity = .default, bundle: Bundle) throws {
convenience init?(imageName: String, levelOfIntegrity: GifLevelOfIntegrity = .default, bundle: Bundle = Bundle.main) throws {
self.init()

do {
Expand Down Expand Up @@ -81,7 +81,7 @@ public extension UIImage {
///
/// - Parameter gifName: Filename
/// - Parameter levelOfIntegrity: 0 to 1, 1 meaning no frame skipping
convenience init(gifName: String, levelOfIntegrity: GifLevelOfIntegrity = .default, bundle: Bundle) throws {
convenience init(gifName: String, levelOfIntegrity: GifLevelOfIntegrity = .default, bundle: Bundle = Bundle.main) throws {
self.init()
try setGif(gifName, levelOfIntegrity: levelOfIntegrity, bundle: bundle)
}
Expand All @@ -102,7 +102,7 @@ public extension UIImage {
/// Set backing data for this gif. Overwrites any existing data.
///
/// - Parameter name: Filename
func setGif(_ name: String, bundle: Bundle) throws {
func setGif(_ name: String, bundle: Bundle = Bundle.main) throws {
try setGif(name, levelOfIntegrity: .default, bundle: bundle)
}

Expand All @@ -121,7 +121,7 @@ public extension UIImage {
///
/// - Parameter name: Filename
/// - Parameter levelOfIntegrity: 0 to 1, 1 meaning no frame skipping
func setGif(_ name: String, levelOfIntegrity: GifLevelOfIntegrity, bundle: Bundle) throws {
func setGif(_ name: String, levelOfIntegrity: GifLevelOfIntegrity, bundle: Bundle = Bundle.main) throws {
giflog(bundle.debugDescription)
if let url = bundle.url(forResource: name, withExtension: name.pathExtension() == "gif" ? "" : "gif") {
if let data = try? Data(contentsOf: url) {
Expand Down

0 comments on commit 230f7d1

Please sign in to comment.