Skip to content

Commit

Permalink
Merge branch 'release/1.1.7'
Browse files Browse the repository at this point in the history
  • Loading branch information
superjohan committed Oct 1, 2017
2 parents af7df2c + 7ee3d2e commit e0c51e7
Show file tree
Hide file tree
Showing 32 changed files with 292 additions and 269 deletions.
58 changes: 50 additions & 8 deletions deko.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
9070355E166E252E001FE82B /* DekoSceneManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 9070355D166E252E001FE82B /* DekoSceneManager.m */; };
90703561166E26D0001FE82B /* DekoScene.m in Sources */ = {isa = PBXBuildFile; fileRef = 90703560166E26CF001FE82B /* DekoScene.m */; };
907C3B851675069500149188 /* DekoTutorialHelper.m in Sources */ = {isa = PBXBuildFile; fileRef = 907C3B841675069500149188 /* DekoTutorialHelper.m */; };
907C3C001F74F73E00D49B6D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 907C3BFF1F74F73E00D49B6D /* LaunchScreen.storyboard */; };
907E727A16675DC70070829F /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 907E727916675DC70070829F /* SystemConfiguration.framework */; };
907E728016675E210070829F /* libsqlite3.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 907E727F16675E210070829F /* libsqlite3.dylib */; };
907E728216675E2F0070829F /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 907E728116675E2F0070829F /* AudioToolbox.framework */; };
Expand Down Expand Up @@ -125,6 +126,7 @@
90703560166E26CF001FE82B /* DekoScene.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DekoScene.m; sourceTree = "<group>"; };
907C3B831675069500149188 /* DekoTutorialHelper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DekoTutorialHelper.h; sourceTree = "<group>"; };
907C3B841675069500149188 /* DekoTutorialHelper.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DekoTutorialHelper.m; sourceTree = "<group>"; };
907C3BFF1F74F73E00D49B6D /* LaunchScreen.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = LaunchScreen.storyboard; sourceTree = "<group>"; };
907E727916675DC70070829F /* SystemConfiguration.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SystemConfiguration.framework; path = System/Library/Frameworks/SystemConfiguration.framework; sourceTree = SDKROOT; };
907E727F16675E210070829F /* libsqlite3.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libsqlite3.dylib; path = usr/lib/libsqlite3.dylib; sourceTree = SDKROOT; };
907E728116675E2F0070829F /* AudioToolbox.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioToolbox.framework; path = System/Library/Frameworks/AudioToolbox.framework; sourceTree = SDKROOT; };
Expand Down Expand Up @@ -255,6 +257,7 @@
9053F9F916AEA86A00B3192B /* Localizable.strings */,
905F09A11663567E0001AD10 /* deko-Info.plist */,
905F09A21663567E0001AD10 /* InfoPlist.strings */,
907C3BFF1F74F73E00D49B6D /* LaunchScreen.storyboard */,
);
name = "Supporting Files";
sourceTree = "<group>";
Expand Down Expand Up @@ -385,7 +388,7 @@
isa = PBXProject;
attributes = {
CLASSPREFIX = Deko;
LastUpgradeCheck = 0450;
LastUpgradeCheck = 0900;
ORGANIZATIONNAME = "Aero Deko";
TargetAttributes = {
905F09941663567E0001AD10 = {
Expand Down Expand Up @@ -423,6 +426,7 @@
905F09A41663567E0001AD10 /* InfoPlist.strings in Resources */,
90002E7619ED136F00F559DD /* Images.xcassets in Resources */,
9053F9F716AEA86A00B3192B /* Localizable.strings in Resources */,
907C3C001F74F73E00D49B6D /* LaunchScreen.storyboard in Resources */,
90BDCA1B16C4F9F200B7B964 /* Lantinghei_1.ttf in Resources */,
90BDCA2116C4FC1700B7B964 /* AppleSDGothicNeo-UltraLight.otf in Resources */,
);
Expand Down Expand Up @@ -480,7 +484,6 @@
90B4AB141700D7E500EA63B7 /* fi */,
);
name = Localizable.strings;
path = ..;
sourceTree = "<group>";
};
905F09A21663567E0001AD10 /* InfoPlist.strings */ = {
Expand All @@ -503,25 +506,45 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
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_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_LITERAL_CONVERSION = YES;
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[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
);
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 7.1;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
TARGETED_DEVICE_FAMILY = "1,2";
Expand All @@ -532,18 +555,37 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
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_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_LITERAL_CONVERSION = YES;
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[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = YES;
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_NO_COMMON_BLOCKS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 7.1;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1";
SDKROOT = iphoneos;
TARGETED_DEVICE_FAMILY = "1,2";
Expand All @@ -555,7 +597,6 @@
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
FRAMEWORK_SEARCH_PATHS = (
Expand All @@ -565,11 +606,12 @@
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "deko/deko-Prefix.pch";
INFOPLIST_FILE = "deko/deko-Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 7.1;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"\"$(SRCROOT)/deko\"",
);
PRODUCT_BUNDLE_IDENTIFIER = "com.aerodeko.${PRODUCT_NAME:rfc1034identifier}";
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE = "";
WRAPPER_EXTENSION = app;
Expand All @@ -580,7 +622,6 @@
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
FRAMEWORK_SEARCH_PATHS = (
Expand All @@ -590,11 +631,12 @@
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "deko/deko-Prefix.pch";
INFOPLIST_FILE = "deko/deko-Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 7.1;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"\"$(SRCROOT)/deko\"",
);
PRODUCT_BUNDLE_IDENTIFIER = "com.aerodeko.${PRODUCT_NAME:rfc1034identifier}";
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE = "";
WRAPPER_EXTENSION = app;
Expand Down
29 changes: 10 additions & 19 deletions deko/ALAssetsLibrary+CustomPhotoAlbum.m
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ @implementation ALAssetsLibrary(CustomPhotoAlbum)

- (void)saveImageData:(NSData *)imageData toAlbum:(NSString *)albumName withCompletionBlock:(SaveImageCompletion)completionBlock
{
[self writeImageDataToSavedPhotosAlbum:imageData metadata:nil completionBlock:^(NSURL *assetURL, NSError *error)
{
[self writeImageDataToSavedPhotosAlbum:imageData metadata:nil completionBlock:^(NSURL *assetURL, NSError *error) {
if (error != nil)
{
completionBlock(error);
Expand All @@ -27,18 +26,15 @@ - (void)addAssetURL:(NSURL *)assetURL toAlbum:(NSString *)albumName withCompleti
{
__block BOOL albumWasFound = NO;

[self enumerateGroupsWithTypes:ALAssetsGroupAlbum usingBlock:^(ALAssetsGroup *group, BOOL *stop)
{
if ([albumName compare:[group valueForProperty:ALAssetsGroupPropertyName]]==NSOrderedSame)
[self enumerateGroupsWithTypes:ALAssetsGroupAlbum usingBlock:^(ALAssetsGroup *group, BOOL *stop) {
if ([albumName compare:[group valueForProperty:ALAssetsGroupPropertyName]] == NSOrderedSame)
{
albumWasFound = YES;

[self assetForURL:assetURL resultBlock:^(ALAsset *asset)
{
[self assetForURL:assetURL resultBlock:^(ALAsset *asset) {
[group addAsset: asset];
completionBlock(nil);
}
failureBlock:completionBlock];
} failureBlock:completionBlock];

return;
}
Expand All @@ -47,21 +43,16 @@ - (void)addAssetURL:(NSURL *)assetURL toAlbum:(NSString *)albumName withCompleti
{
__weak ALAssetsLibrary *weakSelf = self;

[self addAssetsGroupAlbumWithName:albumName resultBlock:^(ALAssetsGroup *group)
{
[weakSelf assetForURL:assetURL resultBlock:^(ALAsset *asset)
{
[self addAssetsGroupAlbumWithName:albumName resultBlock:^(ALAssetsGroup *group) {
[weakSelf assetForURL:assetURL resultBlock:^(ALAsset *asset) {
[group addAsset:asset];
completionBlock(nil);
}
failureBlock:completionBlock];
}
failureBlock:completionBlock];
} failureBlock:completionBlock];
} failureBlock:completionBlock];

return;
}
}
failureBlock:completionBlock];
} failureBlock:completionBlock];
}

@end
10 changes: 10 additions & 0 deletions deko/DekoConstants.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,19 @@
static const CGFloat DekoBackgroundColor = 0.93;
static const CGFloat DekoThumbnailSize = 100.0;
static const CGFloat DekoLaunchBackgroundColor = 0.1568627451;
static const CGFloat DekoiPadOffset = 238.0;
static const CGFloat DekoiPhone6PlusOffset = ((2662.0 - 2208.0) / 3.0); // whee
static const CGFloat DekoiPhone6WidthOffset = 51.0;
static const CGFloat DekoiPhone6HeightOffset = 137.0;
static const CGFloat DekoiPhoneWidthOffset = 52.0;
static const CGFloat DekoiPhoneHeightOffset = 128.0;
static const CGFloat DekoiPhone4WidthOffset = 50.0;
static const CGFloat DekoiPhone4HeightOffset = 118.0;
static const NSTimeInterval DekoLogoAnimationDuration = 2.0;

typedef NS_ENUM(NSInteger, DekoDeviceType)
{
DekoDeviceTypeInvalid,
DekoDeviceTypeiPad,
DekoDeviceTypeiPhone6Plus,
DekoDeviceTypeiPhone6,
Expand Down
21 changes: 7 additions & 14 deletions deko/DekoCreditsViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -25,28 +25,21 @@ @implementation DekoCreditsViewController

- (void)_dismiss
{
[self dismissViewControllerAnimated:YES completion:^
{
[self dismissViewControllerAnimated:YES completion:^{
AELOG_DEBUG(@"Credits dismissed");
}];
}

- (void)_animateLayers
{
[UIView animateWithDuration:UINavigationControllerHideShowBarDuration delay:5.0 options:0 animations:^
{
[UIView animateWithDuration:UINavigationControllerHideShowBarDuration delay:5.0 options:0 animations:^{
self.layer1.alpha = 0;
self.layer2.alpha = 1;
}
completion:^(BOOL finished1)
{
[UIView animateWithDuration:UINavigationControllerHideShowBarDuration delay:5.0 options:0 animations:^
{
} completion:^(BOOL finished1) {
[UIView animateWithDuration:UINavigationControllerHideShowBarDuration delay:5.0 options:0 animations:^{
self.layer1.alpha = 1;
self.layer2.alpha = 0;
}
completion:^(BOOL finished2)
{
} completion:^(BOOL finished2) {
[self _animateLayers];
}];
}];
Expand Down Expand Up @@ -117,8 +110,8 @@ - (void)viewDidLoad
versionLabel.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleTopMargin;
[versionLabel sizeToFit];
versionLabel.frame = AECGRectPlace(versionLabel.frame,
CGRectGetMaxX(self.view.bounds) - CGRectGetWidth(versionLabel.bounds) - 10.0,
CGRectGetMaxY(self.view.bounds) - CGRectGetHeight(versionLabel.bounds) - 10.0);
CGRectGetMaxX(self.view.bounds) - CGRectGetWidth(versionLabel.bounds) - 20.0,
CGRectGetMaxY(self.view.bounds) - CGRectGetHeight(versionLabel.bounds) - 20.0);
[self.view addSubview:versionLabel];
}

Expand Down
7 changes: 4 additions & 3 deletions deko/DekoFunctions.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

#import "DekoConstants.h"

DekoDeviceType DekoGetCurrentDeviceType();
BOOL DekoShouldAutorotate();
BOOL DekoFloatsAreEqual(float float1, float float2);
extern DekoDeviceType DekoGetCurrentDeviceType(void);
extern BOOL DekoShouldAutorotate(void);
extern BOOL DekoFloatsAreEqual(float float1, float float2);
extern CGFloat DekoGetSquareOffset(void);
22 changes: 22 additions & 0 deletions deko/DekoFunctions.m
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,25 @@ BOOL DekoFloatsAreEqual(float float1, float float2)

return (float1 < (float2 + epsilon) && float1 > (float2 - epsilon));
}

CGFloat DekoGetSquareOffset()
{
DekoDeviceType deviceType = DekoGetCurrentDeviceType();

switch (deviceType)
{
case DekoDeviceTypeiPad:
return DekoiPadOffset;
case DekoDeviceTypeiPhone6Plus:
return DekoiPhone6PlusOffset;
case DekoDeviceTypeiPhone6:
return DekoiPhone6HeightOffset;
case DekoDeviceTypeiPhone5:
return DekoiPhoneHeightOffset;
case DekoDeviceTypeiPhone:
return DekoiPhone4HeightOffset;
default:
AELOG_ERROR(@"Unknown device type: %ld", (long)deviceType);
return DekoDeviceTypeInvalid;
}
}
2 changes: 1 addition & 1 deletion deko/DekoGalleryItemView.m
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ @implementation DekoGalleryItemView

#pragma mark - UIView

- (id)initWithFrame:(CGRect)frame
- (instancetype)initWithFrame:(CGRect)frame
{
if ((self = [super initWithFrame:frame]))
{
Expand Down
6 changes: 2 additions & 4 deletions deko/DekoGalleryViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,9 @@ - (DekoGalleryItemView *)_itemViewForIndexPath:(NSIndexPath *)indexPath

- (CGFloat)_paddingForCollectionView
{
CGFloat spacing = 1.0;
CGFloat width = MIN(self.view.bounds.size.width, self.view.bounds.size.height);
CGFloat amountOfItemsPerLine = floor(width / 100.0);
CGFloat padding = (((NSInteger)width % (NSInteger)DekoThumbnailSize) / 2.0) - (((amountOfItemsPerLine - 1) * spacing) / 2.0);
CGFloat padding = (((NSInteger)width % (NSInteger)DekoThumbnailSize) / 2.0) - (((amountOfItemsPerLine - 1) * DekoCollectionViewSpacing) / 2.0);

return padding;
}
Expand Down Expand Up @@ -173,8 +172,7 @@ - (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cell
}

DekoScene *scene = self.scenes[indexPath.item];
[self.sceneManager loadThumbnailForSceneID:scene.id completion:^(UIImage *thumbnail)
{
[self.sceneManager loadThumbnailForSceneID:scene.id completion:^(UIImage *thumbnail) {
itemView.thumbnail = thumbnail;
}];
[cell.contentView addSubview:itemView];
Expand Down
2 changes: 1 addition & 1 deletion deko/DekoIAPManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ extern NSString * const DekoIAPManagerProVersionPurchasedNotification;
@interface DekoIAPManager : NSObject

@property (nonatomic, assign, readonly) BOOL proPurchased;
@property (nonatomic, readonly, copy) NSString *priceForProVersion;

- (void)startManager;
- (void)purchaseProVersion:(void (^)(NSError *error))completionBlock;
- (NSString *)priceForProVersion;
- (void)restorePurchases;

@end
Loading

0 comments on commit e0c51e7

Please sign in to comment.