Permalink
Browse files

Initial commit

  • Loading branch information...
insidegui committed Nov 12, 2017
0 parents commit 678095966f6a4369c8c69d70e21cfd2876aa6a5b
Showing with 2,517 additions and 0 deletions.
  1. +23 −0 .gitignore
  2. +493 −0 AnimojiStudio.xcodeproj/project.pbxproj
  3. +7 −0 AnimojiStudio/AvatarKit/AVTAvatarView.h
  4. +17 −0 AnimojiStudio/AvatarKit/AVTPuppet.h
  5. +32 −0 AnimojiStudio/AvatarKit/AVTPuppetView.h
  6. +57 −0 AnimojiStudio/AvatarKit/AvatarKit.framework/AvatarKit.tbd
  7. +21 −0 AnimojiStudio/Bootstrap/ASAppearance.h
  8. +38 −0 AnimojiStudio/Bootstrap/ASAppearance.m
  9. +17 −0 AnimojiStudio/Bootstrap/AppDelegate.h
  10. +53 −0 AnimojiStudio/Bootstrap/AppDelegate.m
  11. +16 −0 AnimojiStudio/Bootstrap/main.m
  12. +18 −0 AnimojiStudio/Controllers/Error/ErrorViewController.h
  13. +66 −0 AnimojiStudio/Controllers/Error/ErrorViewController.m
  14. +16 −0 AnimojiStudio/Controllers/Misc/UIViewController+Children.h
  15. +34 −0 AnimojiStudio/Controllers/Misc/UIViewController+Children.m
  16. +23 −0 AnimojiStudio/Controllers/Recording/PuppetSelectionViewController.h
  17. +121 −0 AnimojiStudio/Controllers/Recording/PuppetSelectionViewController.m
  18. +13 −0 AnimojiStudio/Controllers/Recording/RecordingFlowController.h
  19. +225 −0 AnimojiStudio/Controllers/Recording/RecordingFlowController.m
  20. +26 −0 AnimojiStudio/Controllers/Recording/RecordingStatusViewController.h
  21. +112 −0 AnimojiStudio/Controllers/Recording/RecordingStatusViewController.m
  22. +30 −0 AnimojiStudio/Controllers/Recording/RecordingViewController.h
  23. +164 −0 AnimojiStudio/Controllers/Recording/RecordingViewController.m
  24. +15 −0 AnimojiStudio/Controllers/Sharing/SharingFlowController.h
  25. +68 −0 AnimojiStudio/Controllers/Sharing/SharingFlowController.m
  26. +25 −0 AnimojiStudio/Controllers/Sharing/VideoPreviewViewController.h
  27. +127 −0 AnimojiStudio/Controllers/Sharing/VideoPreviewViewController.m
  28. +32 −0 AnimojiStudio/Core/RecordingCoordinator.h
  29. +275 −0 AnimojiStudio/Core/RecordingCoordinator.m
  30. BIN AnimojiStudio/Resources/Assets.xcassets/AppIcon.appiconset/App Store.png
  31. +106 −0 AnimojiStudio/Resources/Assets.xcassets/AppIcon.appiconset/Contents.json
  32. BIN AnimojiStudio/Resources/Assets.xcassets/AppIcon.appiconset/iPad Settings@2x.png
  33. BIN AnimojiStudio/Resources/Assets.xcassets/AppIcon.appiconset/iPad Spotlight iOS 7,9.png
  34. BIN AnimojiStudio/Resources/Assets.xcassets/AppIcon.appiconset/iPad Spotlight iOS 7,9@2x.png
  35. BIN AnimojiStudio/Resources/Assets.xcassets/AppIcon.appiconset/iPhone App Icon iOS 7,9@2x-1.png
  36. BIN AnimojiStudio/Resources/Assets.xcassets/AppIcon.appiconset/iPhone App Icon iOS 7,9@2x.png
  37. BIN AnimojiStudio/Resources/Assets.xcassets/AppIcon.appiconset/iPhone App Icon iOS 7,9@3x.png
  38. BIN AnimojiStudio/Resources/Assets.xcassets/AppIcon.appiconset/iPhone notification iOS 7,11@3x.png
  39. +41 −0 AnimojiStudio/Resources/Base.lproj/LaunchScreen.storyboard
  40. +56 −0 AnimojiStudio/Resources/Info.plist
  41. +17 −0 AnimojiStudio/Views/ASPuppetView.h
  42. +28 −0 AnimojiStudio/Views/ASPuppetView.m
  43. +15 −0 AnimojiStudio/Views/PuppetCollectionViewCell.h
  44. +68 −0 AnimojiStudio/Views/PuppetCollectionViewCell.m
  45. +22 −0 LICENSE
  46. BIN screenshots/screenshot_1.png
  47. BIN screenshots/screenshot_2.png
  48. BIN screenshots/screenshot_3.png
  49. BIN screenshots/screenshot_4.png
@@ -0,0 +1,23 @@
.DS_Store
__MACOSX
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3
*.xcworkspace
!default.xcworkspace
xcuserdata
profile
*.moved-aside
DerivedData
.idea/
Crashlytics.sh
generatechangelog.sh
Pods/
Carthage
Provisioning
Crashlytics.sh

Large diffs are not rendered by default.

Oops, something went wrong.
@@ -0,0 +1,7 @@
@import SceneKit;
@class AVTAvatarInstance;
@interface AVTAvatarView : SCNView
@property (nonatomic, retain) AVTAvatarInstance *avatarInstance;
@end
@@ -0,0 +1,17 @@
@import Foundation;
@import SceneKit;
@class AVTAvatarInstance;
@interface AVTPuppet: NSObject
+ (instancetype)puppetNamed:(NSString *)name options:(NSDictionary *)options;
+ (NSArray <NSString *> *)puppetNames;
+ (UIImage *)thumbnailForPuppetNamed:(NSString *)name options:(NSDictionary *)options;
@property (readonly) SCNNode *avatarNode;
@property (readonly) SCNNode *lightingNode;
@end
#define ASPuppet NSClassFromString(@"AVTPuppet")
@@ -0,0 +1,32 @@
@import Foundation;
@import ARKit;
@class AVTPuppet;
#import "AVTAvatarView.h"
@interface AVTPuppetView: AVTAvatarView
@property (getter=isPreviewing, nonatomic, readonly) bool previewing;
@property (getter=isRecording, nonatomic, readonly) bool recording;
- (void)audioPlayerItemDidReachEnd:(id)arg1;
- (bool)exportMovieToURL:(NSURL *)movieURL options:(NSDictionary *)options completionHandler:(void (^)(NSError *error))completion;
- (NSTimeInterval)recordingDuration;
- (void)startPreviewing;
- (void)startRecording;
- (void)stopPreviewing;
- (void)stopRecording;
- (void)faceIsFullyActive;
- (void)fadePuppetToWhite:(int)arg;
- (void)setup;
@property (readonly) AVTPuppet *puppet;
@property (nonatomic, readonly) ARSession *arSession;
@end
@@ -0,0 +1,57 @@
---
archs: [ arm64 ]
platform: ios
install-name: /System/Library/PrivateFrameworks/AvatarKit.framework/AvatarKit
current-version: 181.3
exports:
- archs: [ arm64 ]
symbols: [ _ARBlendShapeLocationFromIndex, _ARBlendShapeLocationToAVTMorphTargetName,
_ARBlendShapeLocationToIndex, _AVTAssetIndexToAssetUID,
_AVTAssetUIDFromPackAndAssetID, _AVTAssetUIDToAssetIndex,
_AVTAvatarBackgroundColorDidUpdate, _AVTAvatarComponentDidChange,
_AVTAvatarComponentDidUpdate, _AVTAvatarComponentSyncUpdateNotification,
_AVTAvatarDidAddPreset, _AVTAvatarEyeColorDidUpdate,
_AVTAvatarHairVariantDidChange, _AVTAvatarMorphVariantDidChange,
_AVTAvatarPhysicalizedMorpherSpecializationSimulationFactors,
_AVTAvatarRigDidChange, _AVTAvatarSkinDidUpdate,
_AVTAvatarSpecializationPhysicalizedMorpher, _AVTBoneParameters,
_AVTColorPalettes, _AVTComponentTypeToString, _AVTDebugViewValueForIndex,
_AVTDecodeColor, _AVTDecodeFloat, _AVTDecodeMaterial,
_AVTEncodeColor, _AVTEncodeFloat, _AVTEncodeMaterial,
_AVTErrorDomain, _AVTFacialFeatureToString, _AVTGetColorComponents,
_AVTLivePreviewAnimationKey, _AVTMaterialNameForTemplateMaterialName,
_AVTMorphTargetNameFromARIndex, _AVTMovieCodecKey,
_AVTMovieRateKey, _AVTMovieSizeKey, _AVTPresetCategoryToComponentType,
_AVTPresetCategoryToFacialFeature, _AVTPresetCategoryToString,
_AVTPuppetColorVariant, _AVTPuppetThumbnailSize,
_AVTPuppetThumbnailSizeLarge, _AVTPuppetThumbnailSizeSmall,
_AVTRigFromString, _AVTRigToString, _AVTSnapshotAnimatedKey,
_AVTSnapshotAnimationClipKey, _AVTSnapshotAnimationDurationKey,
_AVTSnapshotAntialiasedKey, _AVTSnapshotAsH264Key,
_AVTSnapshotBackgroundColorKey, _AVTSnapshotBodilessKey,
_AVTSnapshotDestinationPathKey, _AVTSnapshotJitteredKey,
_AVTSnapshotQualityKey, _AVTSnapshotRateKey, _AVTSnapshotScaleFactorKey,
_AVTSnapshotSizeKey, _AVTSnapshotUpscaleKey, _AVTTemplateMaterialWithName,
_AvatarKitVersionNumber, _AvatarKitVersionString,
_PerfTimesAverageLatency, _PerfTimesAverageLatencyForKind,
_PerfTimesCreate, _PerfTimesForEach, _PerfTimesFree,
_PerfTimesMax, _PerfTimesMaxForKind, _PerfTimesMin,
_PerfTimesMinForKind, _PerfTimesNextIndex, _PerfTimesPush,
_sharedInstance ]
objc-classes: [ _AVTAnimationClip, _AVTAnimationExtra, _AVTAsset,
_AVTAssetInfo, _AVTAvatar, _AVTAvatarAssetLibrary,
_AVTAvatarEditorView, _AVTAvatarInstance, _AVTAvatarSkeletonInstance,
_AVTAvatarView, _AVTColorPreset, _AVTComponent,
_AVTComponentInstance, _AVTCorrectiveMorpherDescriptor,
_AVTEncodingContext, _AVTMaterial, _AVTParameterValue,
_AVTPhysicalizedMorpherDescriptor, _AVTPhysicsController,
_AVTPhysicsRig, _AVTPreset, _AVTPupilDirectionDescriptor,
_AVTPuppet, _AVTPuppetDebugView, _AVTPuppetGridView,
_AVTPuppetView, _AVTResourceLocator, _AVTRig, _AVTRigSettings,
_AVTRigValue, _AVTSnapshotBuilder ]
objc-ivars: [ _AVTPreset._asset, _AVTPreset._category, _AVTPreset._identifier,
_AVTPreset._intensity, _AVTPreset._modularCompositionIndex,
_AVTPreset._params, _AVTPreset._rigs, _AVTPreset._variant,
_AVTRig._elevation, _AVTRig._owner, _AVTRig._rotation,
_AVTRig._scale, _AVTRig._spacing, _AVTRig._type ]
...
@@ -0,0 +1,21 @@
//
// ASAppearance.h
// AnimojiStudio
//
// Created by Guilherme Rambo on 11/11/17.
// Copyright © 2017 Guilherme Rambo. All rights reserved.
//
@import UIKit;
@interface UIColor (AnimojiStudio)
+ (UIColor *)primaryColor;
@end
@interface ASAppearance : NSObject
+ (void)install;
@end
@@ -0,0 +1,38 @@
//
// ASAppearance.m
// AnimojiStudio
//
// Created by Guilherme Rambo on 11/11/17.
// Copyright © 2017 Guilherme Rambo. All rights reserved.
//
#import "ASAppearance.h"
@implementation UIColor (AnimojiStudio)
+ (UIColor *)primaryColor
{
return [UIColor colorWithRed:0.30 green:0.15 blue:0.96 alpha:1.00];
}
@end
@implementation ASAppearance
+ (void)install
{
[UIWindow appearance].tintColor = [UIColor primaryColor];
[UINavigationBar appearance].tintColor = [UIColor primaryColor];
[UIButton appearance].tintColor = [UIColor primaryColor];
[UIBarButtonItem appearance].tintColor = [UIColor primaryColor];
[UISwitch appearance].tintColor = [UIColor primaryColor];
[UISwitch appearance].onTintColor = [UIColor primaryColor];
[UINavigationBar appearance].prefersLargeTitles = YES;
NSDictionary *attrs = @{NSForegroundColorAttributeName: [UIColor primaryColor]};
[UINavigationBar appearance].largeTitleTextAttributes = attrs;
[UINavigationBar appearance].titleTextAttributes = attrs;
}
@end
@@ -0,0 +1,17 @@
//
// AppDelegate.h
// AnimojiStudio
//
// Created by Guilherme Rambo on 11/11/17.
// Copyright © 2017 Guilherme Rambo. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface AppDelegate : UIResponder <UIApplicationDelegate>
@property (strong, nonatomic) UIWindow *window;
@end
@@ -0,0 +1,53 @@
//
// AppDelegate.m
// AnimojiStudio
//
// Created by Guilherme Rambo on 11/11/17.
// Copyright © 2017 Guilherme Rambo. All rights reserved.
//
#import "AppDelegate.h"
#import "ASAppearance.h"
#import "ErrorViewController.h"
#import "RecordingFlowController.h"
@interface AppDelegate ()
@property (nonatomic, strong) RecordingFlowController *recordingFlow;
@end
@implementation AppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
[ASAppearance install];
self.window = [UIWindow new];
[self.window setOpaque:YES];
[self.window setBackgroundColor:[UIColor whiteColor]];
if (![[NSBundle bundleWithPath:@"/System/Library/PrivateFrameworks/AvatarKit.framework"] load]) {
[self showErrorMessage:@"This app is only supported on iPhone X"];
[self.window makeKeyAndVisible];
return YES;
}
self.recordingFlow = [RecordingFlowController new];
[self.window setRootViewController:self.recordingFlow];
[self.window makeKeyAndVisible];
return YES;
}
- (void)showErrorMessage:(NSString *)errorMessage
{
ErrorViewController *controller = [ErrorViewController new];
controller.message = errorMessage;
[self.window setRootViewController:controller];
}
@end
@@ -0,0 +1,16 @@
//
// main.m
// AnimojiStudio
//
// Created by Guilherme Rambo on 11/11/17.
// Copyright © 2017 Guilherme Rambo. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "AppDelegate.h"
int main(int argc, char * argv[]) {
@autoreleasepool {
return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
}
}
@@ -0,0 +1,18 @@
//
// ViewController.h
// AnimojiStudio
//
// Created by Guilherme Rambo on 11/11/17.
// Copyright © 2017 Guilherme Rambo. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface ErrorViewController : UIViewController
- (instancetype)init;
@property (nonatomic, copy) NSString *message;
@end
@@ -0,0 +1,66 @@
//
// ViewController.m
// AnimojiStudio
//
// Created by Guilherme Rambo on 11/11/17.
// Copyright © 2017 Guilherme Rambo. All rights reserved.
//
#import "ErrorViewController.h"
@interface ErrorViewController ()
@property (nonatomic, strong) UILabel *messageLabel;
@end
@implementation ErrorViewController
- (instancetype)init
{
self = [super initWithNibName:nil bundle:nil];
return self;
}
- (void)viewDidLoad {
[super viewDidLoad];
[self build];
[self update];
}
- (void)build
{
UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(userTapped:)];
[self.view addGestureRecognizer:tap];
self.messageLabel = [UILabel new];
self.messageLabel.textAlignment = NSTextAlignmentCenter;
self.messageLabel.translatesAutoresizingMaskIntoConstraints = NO;
self.messageLabel.textColor = [UIColor lightGrayColor];
[self.view addSubview:self.messageLabel];
[self.messageLabel.leadingAnchor constraintEqualToAnchor:self.view.leadingAnchor constant:22].active = YES;
[self.messageLabel.trailingAnchor constraintEqualToAnchor:self.view.trailingAnchor constant:-22].active = YES;
[self.messageLabel.centerYAnchor constraintEqualToAnchor:self.view.centerYAnchor].active = YES;
}
- (void)setMessage:(NSString *)message
{
_message = [message copy];
[self update];
}
- (void)update
{
self.messageLabel.text = self.message;
}
- (IBAction)userTapped:(id)sender
{
[[UIApplication sharedApplication] sendAction:NSSelectorFromString(@"suspend") to:[UIApplication sharedApplication] from:self forEvent:nil];
}
@end
@@ -0,0 +1,16 @@
//
// UIViewController+Children.h
// AnimojiStudio
//
// Created by Guilherme Rambo on 11/11/17.
// Copyright © 2017 Guilherme Rambo. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface UIViewController (Children)
- (void)installChildViewController:(UIViewController *)child;
- (void)presentErrorControllerWithMessage:(NSString *)message;
@end
Oops, something went wrong.

0 comments on commit 6780959

Please sign in to comment.