Skip to content

Commit 8bd4e72

Browse files
committed
Fix macOS Demo applicationDidFinishLaunching not called
1 parent a47bc00 commit 8bd4e72

File tree

6 files changed

+47
-4
lines changed

6 files changed

+47
-4
lines changed

Examples/SDWebImage Demo.xcodeproj/project.pbxproj

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,13 @@
33
archiveVersion = 1;
44
classes = {
55
};
6-
objectVersion = 46;
6+
objectVersion = 52;
77
objects = {
88

99
/* Begin PBXBuildFile section */
1010
32892E311FAE898C00BE8320 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 32892E301FAE898C00BE8320 /* Assets.xcassets */; };
1111
32892E351FAE89FE00BE8320 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 32892E341FAE89FD00BE8320 /* LaunchScreen.storyboard */; };
12+
328CA3AB29980A840063950F /* WindowController.m in Sources */ = {isa = PBXBuildFile; fileRef = 328CA3AA29980A840063950F /* WindowController.m */; };
1213
3E75A9861742DBE700DA412D /* CustomPathImages in Resources */ = {isa = PBXBuildFile; fileRef = 3E75A9851742DBE700DA412D /* CustomPathImages */; };
1314
4314D1AA1D0E1181004B36C9 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 4314D1A91D0E1181004B36C9 /* main.m */; };
1415
4314D1AD1D0E1181004B36C9 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 4314D1AC1D0E1181004B36C9 /* AppDelegate.m */; };
@@ -136,6 +137,8 @@
136137
327E1C604113A7CEC9AC02DB /* Pods-SDWebImage Watch Demo Extension.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SDWebImage Watch Demo Extension.debug.xcconfig"; path = "../Pods/Target Support Files/Pods-SDWebImage Watch Demo Extension/Pods-SDWebImage Watch Demo Extension.debug.xcconfig"; sourceTree = "<group>"; };
137138
32892E301FAE898C00BE8320 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
138139
32892E341FAE89FD00BE8320 /* LaunchScreen.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = LaunchScreen.storyboard; sourceTree = "<group>"; };
140+
328CA3A929980A840063950F /* WindowController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WindowController.h; sourceTree = "<group>"; };
141+
328CA3AA29980A840063950F /* WindowController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = WindowController.m; sourceTree = "<group>"; };
139142
3E75A9851742DBE700DA412D /* CustomPathImages */ = {isa = PBXFileReference; lastKnownFileType = folder; path = CustomPathImages; sourceTree = SOURCE_ROOT; };
140143
4314D1A61D0E1181004B36C9 /* SDWebImage TV Demo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "SDWebImage TV Demo.app"; sourceTree = BUILT_PRODUCTS_DIR; };
141144
4314D1A91D0E1181004B36C9 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
@@ -275,6 +278,8 @@
275278
children = (
276279
43A629D11D0DFD000089D7DD /* AppDelegate.h */,
277280
43A629D21D0DFD000089D7DD /* AppDelegate.m */,
281+
328CA3A929980A840063950F /* WindowController.h */,
282+
328CA3AA29980A840063950F /* WindowController.m */,
278283
43A629D71D0DFD000089D7DD /* ViewController.h */,
279284
43A629D81D0DFD000089D7DD /* ViewController.m */,
280285
43A629DA1D0DFD000089D7DD /* Assets.xcassets */,
@@ -804,6 +809,7 @@
804809
buildActionMask = 2147483647;
805810
files = (
806811
43A629D91D0DFD000089D7DD /* ViewController.m in Sources */,
812+
328CA3AB29980A840063950F /* WindowController.m in Sources */,
807813
43A629D61D0DFD000089D7DD /* main.m in Sources */,
808814
43A629D31D0DFD000089D7DD /* AppDelegate.m in Sources */,
809815
);

Examples/SDWebImage OSX Demo/AppDelegate.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
@interface AppDelegate : NSObject <NSApplicationDelegate>
1212

13+
@property (strong, nonatomic) NSWindowController *windowController;
1314

1415
@end
1516

Examples/SDWebImage OSX Demo/AppDelegate.m

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,12 @@ - (void)applicationDidFinishLaunching:(NSNotification *)aNotification {
3030
// For HEIC animated image. Animated image is new introduced in iOS 13, but it contains performance issue for now.
3131
[[SDImageCodersManager sharedManager] addCoder:[SDImageHEICCoder sharedCoder]];
3232
}
33+
34+
NSStoryboard *mainStoryboard = [NSStoryboard storyboardWithName:@"Main" bundle:nil];
35+
NSWindowController *initialController = [mainStoryboard instantiateControllerWithIdentifier:@"MainWindowController"];
36+
self.windowController = initialController;
37+
[initialController showWindow:self];
38+
[initialController.window makeKeyAndOrderFront:self];
3339
}
3440

3541
- (void)applicationWillTerminate:(NSNotification *)aNotification {

Examples/SDWebImage OSX Demo/Base.lproj/Main.storyboard

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<document type="com.apple.InterfaceBuilder3.Cocoa.Storyboard.XIB" version="3.0" toolsVersion="14490.70" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" initialViewController="B8D-0N-5wS">
2+
<document type="com.apple.InterfaceBuilder3.Cocoa.Storyboard.XIB" version="3.0" toolsVersion="21507" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
33
<dependencies>
44
<deployment identifier="macosx"/>
5-
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="14490.70"/>
5+
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="21507"/>
66
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
77
</dependencies>
88
<scenes>
@@ -651,7 +651,7 @@
651651
<!--Window Controller-->
652652
<scene sceneID="R2V-B0-nI4">
653653
<objects>
654-
<windowController id="B8D-0N-5wS" sceneMemberID="viewController">
654+
<windowController storyboardIdentifier="MainWindowController" id="B8D-0N-5wS" customClass="WindowController" sceneMemberID="viewController">
655655
<window key="window" title="Window" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" releasedWhenClosed="NO" visibleAtLaunch="NO" animationBehavior="default" id="IQv-IB-iLA">
656656
<windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES" resizable="YES"/>
657657
<windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/>
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
/*
2+
* This file is part of the SDWebImage package.
3+
* (c) Olivier Poitrey <[email protected]>
4+
*
5+
* For the full copyright and license information, please view the LICENSE
6+
* file that was distributed with this source code.
7+
*/
8+
9+
#import <Cocoa/Cocoa.h>
10+
11+
NS_ASSUME_NONNULL_BEGIN
12+
13+
@interface WindowController : NSWindowController
14+
15+
@end
16+
17+
NS_ASSUME_NONNULL_END
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
/*
2+
* This file is part of the SDWebImage package.
3+
* (c) Olivier Poitrey <[email protected]>
4+
*
5+
* For the full copyright and license information, please view the LICENSE
6+
* file that was distributed with this source code.
7+
*/
8+
9+
#import "WindowController.h"
10+
11+
@implementation WindowController
12+
13+
@end

0 commit comments

Comments
 (0)