Skip to content

Commit

Permalink
Added nullability specifiers and updated project for Xcode 7
Browse files Browse the repository at this point in the history
  • Loading branch information
sbooth committed Oct 16, 2015
1 parent 4560be1 commit 3a7bcb5
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 25 deletions.
2 changes: 1 addition & 1 deletion Example-Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIdentifier</key>
<string>org.sbooth.${PRODUCT_NAME:rfc1034identifier}</string>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundlePackageType</key>
Expand Down
22 changes: 11 additions & 11 deletions SFBPopover.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,29 +59,29 @@ typedef NS_ENUM(NSUInteger, SFBPopoverPosition) {

// ========================================
// Creation
- (id) initWithContentView:(NSView *)contentView;
- (id) initWithContentViewController:(NSViewController *)contentViewController;
- (nullable id) initWithContentView:(nonnull NSView *)contentView;
- (nullable id) initWithContentViewController:(nonnull NSViewController *)contentViewController;

// ========================================
// Geometry determination
- (SFBPopoverPosition) bestPositionInWindow:(NSWindow *)window atPoint:(NSPoint)point;
- (SFBPopoverPosition) bestPositionInWindow:(nonnull NSWindow *)window atPoint:(NSPoint)point;

// ========================================
// Show the popover- prefer these to showWindow:
- (void) displayPopoverInWindow:(NSWindow *)window atPoint:(NSPoint)point;
- (void) displayPopoverInWindow:(NSWindow *)window atPoint:(NSPoint)point chooseBestLocation:(BOOL)chooseBestLocation;
- (void) displayPopoverInWindow:(nonnull NSWindow *)window atPoint:(NSPoint)point;
- (void) displayPopoverInWindow:(nonnull NSWindow *)window atPoint:(NSPoint)point chooseBestLocation:(BOOL)chooseBestLocation;

// ========================================
// Move the popover to a new attachment point (should be currently displayed)
- (void) movePopoverToPoint:(NSPoint)point;

// ========================================
// Close the popover
- (IBAction) closePopover:(id)sender;
- (IBAction) closePopover:(nullable id)sender;

// ========================================
// Returns the popover window
- (NSWindow *) popoverWindow;
- (nonnull NSWindow *) popoverWindow;

// ========================================
// Returns YES if the popover is visible
Expand All @@ -99,8 +99,8 @@ typedef NS_ENUM(NSUInteger, SFBPopoverPosition) {
- (void) setDistance:(CGFloat)distance;

// The popover's border color
- (NSColor *) borderColor;
- (void) setBorderColor:(NSColor *)borderColor;
- (nonnull NSColor *) borderColor;
- (void) setBorderColor:(nonnull NSColor *)borderColor;

// The width of the popover window's border
- (CGFloat) borderWidth;
Expand Down Expand Up @@ -131,8 +131,8 @@ typedef NS_ENUM(NSUInteger, SFBPopoverPosition) {
- (void) setViewMargin:(CGFloat)viewMargin;

// The popover's background color
- (NSColor *) backgroundColor;
- (void) setBackgroundColor:(NSColor *)backgroundColor;
- (nonnull NSColor *) backgroundColor;
- (void) setBackgroundColor:(nonnull NSColor *)backgroundColor;

// Specifies whether the popover may be moved by dragging
- (BOOL) isMovable;
Expand Down
5 changes: 0 additions & 5 deletions SFBPopover.m
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,6 @@ - (SFBPopoverWindowFrame *) popoverWindowFrame;

@implementation SFBPopover

- (id) init
{
return [self initWithContentViewController:nil];
}

- (id) initWithContentView:(NSView *)contentView
{
NSViewController *contentViewController = [[NSViewController alloc] init];
Expand Down
8 changes: 4 additions & 4 deletions SFBPopoverWindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@
- (CGFloat) distance;
- (void) setDistance:(CGFloat)distance;

- (NSColor *) borderColor;
- (void) setBorderColor:(NSColor *)borderColor;
- (nonnull NSColor *) borderColor;
- (void) setBorderColor:(nonnull NSColor *)borderColor;
- (CGFloat) borderWidth;
- (void) setBorderWidth:(CGFloat)borderWidth;
- (CGFloat) cornerRadius;
Expand All @@ -61,8 +61,8 @@

- (CGFloat) viewMargin;
- (void) setViewMargin:(CGFloat)viewMargin;
- (NSColor *) popoverBackgroundColor;
- (void) setPopoverBackgroundColor:(NSColor *)backgroundColor;
- (nonnull NSColor *) popoverBackgroundColor;
- (void) setPopoverBackgroundColor:(nonnull NSColor *)backgroundColor;

- (BOOL) isMovable;
- (void) setMovable:(BOOL)movable;
Expand Down
4 changes: 2 additions & 2 deletions SFBPopoverWindowFrame.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@

@property (nonatomic, assign) CGFloat distance;

@property (nonatomic, copy) NSColor * borderColor;
@property (nonatomic, copy, nonnull) NSColor * borderColor;
@property (nonatomic, assign) CGFloat borderWidth;
@property (nonatomic, assign) CGFloat cornerRadius;

Expand All @@ -52,7 +52,7 @@
@property (nonatomic, assign) BOOL drawRoundCornerBesideArrow;

@property (nonatomic, assign) CGFloat viewMargin;
@property (nonatomic, copy) NSColor * backgroundColor;
@property (nonatomic, copy, nonnull) NSColor * backgroundColor;

@property (nonatomic, assign, getter=isMovable) BOOL movable;
@property (nonatomic, assign, getter=isResizable) BOOL resizable;
Expand Down
2 changes: 1 addition & 1 deletion SFBPopovers-Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<key>CFBundleIconFile</key>
<string></string>
<key>CFBundleIdentifier</key>
<string>org.sbooth.${PRODUCT_NAME:rfc1034identifier}</string>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
Expand Down
7 changes: 6 additions & 1 deletion SFBPopovers.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@
32CE12BA1367854000CE7985 /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0510;
LastUpgradeCheck = 0700;
ORGANIZATIONNAME = sbooth.org;
};
buildConfigurationList = 32CE12BD1367854000CE7985 /* Build configuration list for PBXProject "SFBPopovers" */;
Expand Down Expand Up @@ -323,6 +323,7 @@
"-framework",
AppKit,
);
PRODUCT_BUNDLE_IDENTIFIER = "org.sbooth.${PRODUCT_NAME:rfc1034identifier}";
PRODUCT_NAME = Example;
};
name = Debug;
Expand All @@ -345,6 +346,7 @@
"-framework",
AppKit,
);
PRODUCT_BUNDLE_IDENTIFIER = "org.sbooth.${PRODUCT_NAME:rfc1034identifier}";
PRODUCT_NAME = Example;
};
name = Release;
Expand All @@ -353,6 +355,7 @@
isa = XCBuildConfiguration;
buildSettings = {
CLANG_ENABLE_OBJC_ARC = YES;
ENABLE_TESTABILITY = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
MACOSX_DEPLOYMENT_TARGET = 10.7;
ONLY_ACTIVE_ARCH = YES;
Expand Down Expand Up @@ -381,6 +384,7 @@
GCC_PREFIX_HEADER = "SFBPopovers-Prefix.pch";
INFOPLIST_FILE = "SFBPopovers-Info.plist";
INSTALL_PATH = "@rpath";
PRODUCT_BUNDLE_IDENTIFIER = "org.sbooth.${PRODUCT_NAME:rfc1034identifier}";
PRODUCT_NAME = "$(TARGET_NAME)";
WRAPPER_EXTENSION = framework;
};
Expand All @@ -399,6 +403,7 @@
GCC_PREFIX_HEADER = "SFBPopovers-Prefix.pch";
INFOPLIST_FILE = "SFBPopovers-Info.plist";
INSTALL_PATH = "@rpath";
PRODUCT_BUNDLE_IDENTIFIER = "org.sbooth.${PRODUCT_NAME:rfc1034identifier}";
PRODUCT_NAME = "$(TARGET_NAME)";
WRAPPER_EXTENSION = framework;
};
Expand Down

0 comments on commit 3a7bcb5

Please sign in to comment.