-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Anton Kiland
committed
Jan 2, 2014
0 parents
commit a6138a4
Showing
10 changed files
with
500 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
build/* | ||
*.pbxuser | ||
!default.pbxuser | ||
*.mode1v3 | ||
!default.mode1v3 | ||
*.mode2v3 | ||
!default.mode2v3 | ||
*.perspectivev3 | ||
!default.perspectivev3 | ||
*.xcworkspace | ||
!default.xcworkspace | ||
xcuserdata | ||
profile | ||
*.moved-aside | ||
.DS_Store |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
<plist version="1.0"> | ||
<dict> | ||
<key>CFBundleDevelopmentRegion</key> | ||
<string>English</string> | ||
<key>CFBundleExecutable</key> | ||
<string>${EXECUTABLE_NAME}</string> | ||
<key>CFBundleIdentifier</key> | ||
<string>se.kiland.${PRODUCT_NAME:rfc1034identifier}</string> | ||
<key>CFBundleInfoDictionaryVersion</key> | ||
<string>6.0</string> | ||
<key>CFBundleName</key> | ||
<string>${PRODUCT_NAME}</string> | ||
<key>CFBundlePackageType</key> | ||
<string>BNDL</string> | ||
<key>CFBundleShortVersionString</key> | ||
<string>1.0</string> | ||
<key>CFBundleSignature</key> | ||
<string>????</string> | ||
<key>CFBundleVersion</key> | ||
<string>1</string> | ||
<key>LSRequiresIPhoneOS</key> | ||
<true/> | ||
<key>SBProceduralWallpaperClassNames</key> | ||
<array> | ||
<string>MagicWallpaper</string> | ||
</array> | ||
<key>NSHumanReadableCopyright</key> | ||
<string>Copyright © 2014 Anton Kiland. All rights reserved.</string> | ||
</dict> | ||
</plist> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#import <Foundation/Foundation.h> | ||
#import <SpringBoardFoundation/SBFProceduralWallpaper.h> | ||
|
||
@interface MagicWallpaper : SBFProceduralWallpaper | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
#import "MagicWallpaper.h" | ||
|
||
@interface MagicWallpaper () | ||
|
||
@end | ||
|
||
@implementation MagicWallpaper | ||
|
||
#pragma mark - Wallpaper information | ||
|
||
@synthesize delegate = _delegate; | ||
|
||
+ (NSString *)identifier | ||
{ | ||
return @"MagicWallpaper"; | ||
} | ||
|
||
+ (BOOL)colorChangesSignificantly | ||
{ | ||
return YES; | ||
} | ||
|
||
+ (NSArray *)presetWallpaperOptions | ||
{ | ||
return @[ | ||
@{ @"kSBUIMagicWallpaperThumbnailNameKey": @"magic-wallpaper1", | ||
@"color": @"red" }, | ||
@{ @"kSBUIMagicWallpaperThumbnailNameKey": @"magic-wallpaper2", | ||
@"color": @"green" } | ||
]; | ||
} | ||
|
||
- (void)setWallpaperOptions:(NSDictionary *)options | ||
{ | ||
UILabel *label = (UILabel *)[self viewWithTag:2]; | ||
if ([options[@"color"] isEqualToString:@"red"]) { | ||
label.textColor = [UIColor redColor]; | ||
} else { | ||
label.textColor = [UIColor greenColor]; | ||
} | ||
} | ||
|
||
- (void)setWallpaperVariant:(int)variant | ||
{ | ||
} | ||
|
||
|
||
#pragma mark - Wallpaper implementation | ||
|
||
- (id)initWithFrame:(CGRect)frame | ||
{ | ||
if (!(self = [super initWithFrame:frame])) | ||
return nil; | ||
|
||
UILabel *label = [[UILabel alloc] initWithFrame:self.bounds]; | ||
label.tag = 1; | ||
label.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; | ||
label.text = @"BBQ"; | ||
label.textColor = [UIColor whiteColor]; | ||
label.font = [UIFont boldSystemFontOfSize:50]; | ||
label.textAlignment = NSTextAlignmentCenter; | ||
[self addSubview:label]; | ||
|
||
label = [[UILabel alloc] initWithFrame:self.bounds]; | ||
label.tag = 2; | ||
label.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; | ||
label.text = @"BBQ"; | ||
label.textColor = [UIColor redColor]; | ||
label.font = [UIFont boldSystemFontOfSize:50]; | ||
label.textAlignment = NSTextAlignmentCenter; | ||
|
||
UIMotionEffectGroup *group = [[UIMotionEffectGroup alloc] init]; | ||
UIInterpolatingMotionEffect *xAxis = [[UIInterpolatingMotionEffect alloc] initWithKeyPath:@"center.x" type:UIInterpolatingMotionEffectTypeTiltAlongHorizontalAxis]; | ||
UIInterpolatingMotionEffect *yAxis = [[UIInterpolatingMotionEffect alloc] initWithKeyPath:@"center.y" type:UIInterpolatingMotionEffectTypeTiltAlongVerticalAxis]; | ||
|
||
NSArray *motionEffects = @[ xAxis, yAxis ]; | ||
for (UIInterpolatingMotionEffect *effect in motionEffects) { | ||
effect.maximumRelativeValue = @(100); | ||
effect.minimumRelativeValue = @(-100); | ||
} | ||
|
||
group.motionEffects = motionEffects; | ||
[label addMotionEffect:group]; | ||
|
||
[self addSubview:label]; | ||
|
||
return self; | ||
} | ||
|
||
- (void)setAnimating:(BOOL)animating | ||
{ | ||
} | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
// | ||
// Prefix header | ||
// | ||
// The contents of this file are implicitly included at the beginning of every source file. | ||
// | ||
|
||
#ifdef __OBJC__ | ||
#import <UIKit/UIKit.h> | ||
#import <Foundation/Foundation.h> | ||
#endif |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.