Skip to content

Commit

Permalink
Use NS_ASSUME_NONNULL macro
Browse files Browse the repository at this point in the history
  • Loading branch information
Bei Li committed Feb 11, 2020
1 parent 057c899 commit b11d24d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -6,3 +6,4 @@ pyvenv.cfg
**/*.egg-info/*
generation/bin/*
generation/dist
.DS_Store
Expand Up @@ -78,8 +78,8 @@
DDF2F98523DF3FA400B7E8E9 /* LocalizedStringKit */ = {
isa = PBXGroup;
children = (
DDF2F99D23DF401600B7E8E9 /* LocalizedStringKit.m */,
DDF2F98623DF3FA400B7E8E9 /* LocalizedStringKit.h */,
DDF2F99D23DF401600B7E8E9 /* LocalizedStringKit.m */,
DDF2F98723DF3FA400B7E8E9 /* Info.plist */,
);
path = LocalizedStringKit;
Expand Down
10 changes: 7 additions & 3 deletions LocalizedStringKit/LocalizedStringKit/LocalizedStringKit.h
Expand Up @@ -4,6 +4,8 @@

@import Foundation;

NS_ASSUME_NONNULL_BEGIN

//! Project version number for LocalizedStringKit.
FOUNDATION_EXPORT double LocalizedStringKitVersionNumber;

Expand All @@ -14,7 +16,7 @@ FOUNDATION_EXPORT const unsigned char LocalizedStringKitVersionString[];
///
/// The `value` should be the English string and the `comment` should give context on where the string is used.
/// Ex: `Localized("Cancel", "Action sheet action title")
NSString * _Nonnull Localized(NSString * _Nonnull value, NSString * _Nonnull comment);
NSString *Localized(NSString *value, NSString *comment);

/// Additional localization function used to localize strings
///
Expand All @@ -24,11 +26,13 @@ NSString * _Nonnull Localized(NSString * _Nonnull value, NSString * _Nonnull com
///
/// Ex: `LocalizedWithKeyExtension("Archive", "Button title", "Archive action")
/// Ex: `LocalizedWithKeyExtension("Archive", "Folder title", "Archive folder")
NSString * _Nonnull LocalizedWithKeyExtension(NSString * _Nonnull value, NSString * _Nonnull comment, NSString * _Nonnull keyExtension);
NSString *LocalizedWithKeyExtension(NSString *value, NSString *comment, NSString *keyExtension);

/// Marks a string as not needing localization (to avoid false positives from
/// the static analyzer
NSString * _Nonnull LocalizationUnnecessary(NSString * _Nonnull value);
NSString *LocalizationUnnecessary(NSString *value);

/// Load the bundle which contains the localized strings
NSBundle * _Nullable getLocalizedStringKitBundle(void);

NS_ASSUME_NONNULL_END

0 comments on commit b11d24d

Please sign in to comment.