mirror of
https://github.com/ivanvorobei/SwiftUI.git
synced 2026-03-17 23:13:58 +01:00
Add projects
This commit is contained in:
386
Examples/InstaFake/Instagram-SWUI.xcodeproj/project.pbxproj
Executable file
386
Examples/InstaFake/Instagram-SWUI.xcodeproj/project.pbxproj
Executable file
@@ -0,0 +1,386 @@
|
||||
// !$*UTF8*$!
|
||||
{
|
||||
archiveVersion = 1;
|
||||
classes = {
|
||||
};
|
||||
objectVersion = 50;
|
||||
objects = {
|
||||
|
||||
/* Begin PBXBuildFile section */
|
||||
C313C0B822A6FBAC00FF2AFB /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = C313C0B722A6FBAC00FF2AFB /* AppDelegate.swift */; };
|
||||
C313C0BA22A6FBAC00FF2AFB /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = C313C0B922A6FBAC00FF2AFB /* SceneDelegate.swift */; };
|
||||
C313C0BD22A6FBAC00FF2AFB /* Instagram_SWUI.xcdatamodeld in Sources */ = {isa = PBXBuildFile; fileRef = C313C0BB22A6FBAC00FF2AFB /* Instagram_SWUI.xcdatamodeld */; };
|
||||
C313C0BF22A6FBAC00FF2AFB /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = C313C0BE22A6FBAC00FF2AFB /* ContentView.swift */; };
|
||||
C313C0C122A6FBAE00FF2AFB /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = C313C0C022A6FBAE00FF2AFB /* Assets.xcassets */; };
|
||||
C313C0C422A6FBAE00FF2AFB /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = C313C0C322A6FBAE00FF2AFB /* Preview Assets.xcassets */; };
|
||||
C313C0C722A6FBAE00FF2AFB /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = C313C0C522A6FBAE00FF2AFB /* LaunchScreen.storyboard */; };
|
||||
C313C0F422A727EE00FF2AFB /* InstaPhoto.swift in Sources */ = {isa = PBXBuildFile; fileRef = C313C0F322A727EE00FF2AFB /* InstaPhoto.swift */; };
|
||||
C313C10222A778D100FF2AFB /* PhotoLibrary.swift in Sources */ = {isa = PBXBuildFile; fileRef = C313C10122A778D100FF2AFB /* PhotoLibrary.swift */; };
|
||||
C313C10822A8301D00FF2AFB /* CameraView.swift in Sources */ = {isa = PBXBuildFile; fileRef = C313C10722A8301D00FF2AFB /* CameraView.swift */; };
|
||||
C34D712822A9B14700E60D50 /* CameraViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = C34D712722A9B14700E60D50 /* CameraViewController.swift */; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
C313C0B422A6FBAC00FF2AFB /* Instagram-SWUI.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Instagram-SWUI.app"; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
C313C0B722A6FBAC00FF2AFB /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
|
||||
C313C0B922A6FBAC00FF2AFB /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = "<group>"; };
|
||||
C313C0BC22A6FBAC00FF2AFB /* Instagram_SWUI.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = Instagram_SWUI.xcdatamodel; sourceTree = "<group>"; };
|
||||
C313C0BE22A6FBAC00FF2AFB /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = "<group>"; };
|
||||
C313C0C022A6FBAE00FF2AFB /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
|
||||
C313C0C322A6FBAE00FF2AFB /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = "<group>"; };
|
||||
C313C0C622A6FBAE00FF2AFB /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
|
||||
C313C0C822A6FBAE00FF2AFB /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
|
||||
C313C0F322A727EE00FF2AFB /* InstaPhoto.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = InstaPhoto.swift; sourceTree = "<group>"; };
|
||||
C313C10122A778D100FF2AFB /* PhotoLibrary.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PhotoLibrary.swift; sourceTree = "<group>"; };
|
||||
C313C10722A8301D00FF2AFB /* CameraView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CameraView.swift; sourceTree = "<group>"; };
|
||||
C34D712722A9B14700E60D50 /* CameraViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CameraViewController.swift; sourceTree = "<group>"; };
|
||||
C34D712922A9C1CF00E60D50 /* Instagram-SWUI.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = "Instagram-SWUI.entitlements"; sourceTree = "<group>"; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
/* Begin PBXFrameworksBuildPhase section */
|
||||
C313C0B122A6FBAC00FF2AFB /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXFrameworksBuildPhase section */
|
||||
|
||||
/* Begin PBXGroup section */
|
||||
C313C0AB22A6FBAC00FF2AFB = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
C313C0B622A6FBAC00FF2AFB /* Instagram-SWUI */,
|
||||
C313C0B522A6FBAC00FF2AFB /* Products */,
|
||||
);
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
C313C0B522A6FBAC00FF2AFB /* Products */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
C313C0B422A6FBAC00FF2AFB /* Instagram-SWUI.app */,
|
||||
);
|
||||
name = Products;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
C313C0B622A6FBAC00FF2AFB /* Instagram-SWUI */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
C34D712922A9C1CF00E60D50 /* Instagram-SWUI.entitlements */,
|
||||
C313C0B722A6FBAC00FF2AFB /* AppDelegate.swift */,
|
||||
C313C0B922A6FBAC00FF2AFB /* SceneDelegate.swift */,
|
||||
C34D712722A9B14700E60D50 /* CameraViewController.swift */,
|
||||
C313C0BE22A6FBAC00FF2AFB /* ContentView.swift */,
|
||||
C313C10722A8301D00FF2AFB /* CameraView.swift */,
|
||||
C313C0F322A727EE00FF2AFB /* InstaPhoto.swift */,
|
||||
C313C10122A778D100FF2AFB /* PhotoLibrary.swift */,
|
||||
C313C0C022A6FBAE00FF2AFB /* Assets.xcassets */,
|
||||
C313C0C522A6FBAE00FF2AFB /* LaunchScreen.storyboard */,
|
||||
C313C0C822A6FBAE00FF2AFB /* Info.plist */,
|
||||
C313C0BB22A6FBAC00FF2AFB /* Instagram_SWUI.xcdatamodeld */,
|
||||
C313C0C222A6FBAE00FF2AFB /* Preview Content */,
|
||||
);
|
||||
path = "Instagram-SWUI";
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
C313C0C222A6FBAE00FF2AFB /* Preview Content */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
C313C0C322A6FBAE00FF2AFB /* Preview Assets.xcassets */,
|
||||
);
|
||||
path = "Preview Content";
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
/* End PBXGroup section */
|
||||
|
||||
/* Begin PBXNativeTarget section */
|
||||
C313C0B322A6FBAC00FF2AFB /* Instagram-SWUI */ = {
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = C313C0CB22A6FBAE00FF2AFB /* Build configuration list for PBXNativeTarget "Instagram-SWUI" */;
|
||||
buildPhases = (
|
||||
C313C0B022A6FBAC00FF2AFB /* Sources */,
|
||||
C313C0B122A6FBAC00FF2AFB /* Frameworks */,
|
||||
C313C0B222A6FBAC00FF2AFB /* Resources */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
dependencies = (
|
||||
);
|
||||
name = "Instagram-SWUI";
|
||||
productName = "Instagram-SWUI";
|
||||
productReference = C313C0B422A6FBAC00FF2AFB /* Instagram-SWUI.app */;
|
||||
productType = "com.apple.product-type.application";
|
||||
};
|
||||
/* End PBXNativeTarget section */
|
||||
|
||||
/* Begin PBXProject section */
|
||||
C313C0AC22A6FBAC00FF2AFB /* Project object */ = {
|
||||
isa = PBXProject;
|
||||
attributes = {
|
||||
LastSwiftUpdateCheck = 1100;
|
||||
LastUpgradeCheck = 1100;
|
||||
ORGANIZATIONNAME = "leavenstee llc";
|
||||
TargetAttributes = {
|
||||
C313C0B322A6FBAC00FF2AFB = {
|
||||
CreatedOnToolsVersion = 11.0;
|
||||
};
|
||||
};
|
||||
};
|
||||
buildConfigurationList = C313C0AF22A6FBAC00FF2AFB /* Build configuration list for PBXProject "Instagram-SWUI" */;
|
||||
compatibilityVersion = "Xcode 9.3";
|
||||
developmentRegion = en;
|
||||
hasScannedForEncodings = 0;
|
||||
knownRegions = (
|
||||
en,
|
||||
Base,
|
||||
);
|
||||
mainGroup = C313C0AB22A6FBAC00FF2AFB;
|
||||
productRefGroup = C313C0B522A6FBAC00FF2AFB /* Products */;
|
||||
projectDirPath = "";
|
||||
projectRoot = "";
|
||||
targets = (
|
||||
C313C0B322A6FBAC00FF2AFB /* Instagram-SWUI */,
|
||||
);
|
||||
};
|
||||
/* End PBXProject section */
|
||||
|
||||
/* Begin PBXResourcesBuildPhase section */
|
||||
C313C0B222A6FBAC00FF2AFB /* Resources */ = {
|
||||
isa = PBXResourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
C313C0C722A6FBAE00FF2AFB /* LaunchScreen.storyboard in Resources */,
|
||||
C313C0C422A6FBAE00FF2AFB /* Preview Assets.xcassets in Resources */,
|
||||
C313C0C122A6FBAE00FF2AFB /* Assets.xcassets in Resources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXResourcesBuildPhase section */
|
||||
|
||||
/* Begin PBXSourcesBuildPhase section */
|
||||
C313C0B022A6FBAC00FF2AFB /* Sources */ = {
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
C313C0B822A6FBAC00FF2AFB /* AppDelegate.swift in Sources */,
|
||||
C313C0BD22A6FBAC00FF2AFB /* Instagram_SWUI.xcdatamodeld in Sources */,
|
||||
C313C0F422A727EE00FF2AFB /* InstaPhoto.swift in Sources */,
|
||||
C313C10222A778D100FF2AFB /* PhotoLibrary.swift in Sources */,
|
||||
C313C0BF22A6FBAC00FF2AFB /* ContentView.swift in Sources */,
|
||||
C34D712822A9B14700E60D50 /* CameraViewController.swift in Sources */,
|
||||
C313C0BA22A6FBAC00FF2AFB /* SceneDelegate.swift in Sources */,
|
||||
C313C10822A8301D00FF2AFB /* CameraView.swift in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXSourcesBuildPhase section */
|
||||
|
||||
/* Begin PBXVariantGroup section */
|
||||
C313C0C522A6FBAE00FF2AFB /* LaunchScreen.storyboard */ = {
|
||||
isa = PBXVariantGroup;
|
||||
children = (
|
||||
C313C0C622A6FBAE00FF2AFB /* Base */,
|
||||
);
|
||||
name = LaunchScreen.storyboard;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
/* End PBXVariantGroup section */
|
||||
|
||||
/* Begin XCBuildConfiguration section */
|
||||
C313C0C922A6FBAE00FF2AFB /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
CLANG_ANALYZER_NONNULL = YES;
|
||||
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
|
||||
CLANG_CXX_LIBRARY = "libc++";
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
CLANG_ENABLE_OBJC_WEAK = YES;
|
||||
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
|
||||
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||
CLANG_WARN_COMMA = YES;
|
||||
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
|
||||
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
||||
CLANG_WARN_DOCUMENTATION_COMMENTS = 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_IMPLICIT_RETAIN_SELF = YES;
|
||||
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
|
||||
CLANG_WARN_STRICT_PROTOTYPES = YES;
|
||||
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
||||
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
COPY_PHASE_STRIP = NO;
|
||||
DEBUG_INFORMATION_FORMAT = dwarf;
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
ENABLE_TESTABILITY = YES;
|
||||
GCC_C_LANGUAGE_STANDARD = gnu11;
|
||||
GCC_DYNAMIC_NO_PIC = NO;
|
||||
GCC_NO_COMMON_BLOCKS = YES;
|
||||
GCC_OPTIMIZATION_LEVEL = 0;
|
||||
GCC_PREPROCESSOR_DEFINITIONS = (
|
||||
"DEBUG=1",
|
||||
"$(inherited)",
|
||||
);
|
||||
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
||||
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
|
||||
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
|
||||
MTL_FAST_MATH = YES;
|
||||
ONLY_ACTIVE_ARCH = YES;
|
||||
SDKROOT = iphoneos;
|
||||
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
|
||||
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
C313C0CA22A6FBAE00FF2AFB /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
CLANG_ANALYZER_NONNULL = YES;
|
||||
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
|
||||
CLANG_CXX_LIBRARY = "libc++";
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
CLANG_ENABLE_OBJC_WEAK = YES;
|
||||
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
|
||||
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||
CLANG_WARN_COMMA = YES;
|
||||
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
|
||||
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
||||
CLANG_WARN_DOCUMENTATION_COMMENTS = 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_IMPLICIT_RETAIN_SELF = YES;
|
||||
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
|
||||
CLANG_WARN_STRICT_PROTOTYPES = YES;
|
||||
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
||||
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
COPY_PHASE_STRIP = NO;
|
||||
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
||||
ENABLE_NS_ASSERTIONS = NO;
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
GCC_C_LANGUAGE_STANDARD = gnu11;
|
||||
GCC_NO_COMMON_BLOCKS = YES;
|
||||
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
||||
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
|
||||
MTL_ENABLE_DEBUG_INFO = NO;
|
||||
MTL_FAST_MATH = YES;
|
||||
SDKROOT = iphoneos;
|
||||
SWIFT_COMPILATION_MODE = wholemodule;
|
||||
SWIFT_OPTIMIZATION_LEVEL = "-O";
|
||||
VALIDATE_PRODUCT = YES;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
C313C0CC22A6FBAE00FF2AFB /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
CODE_SIGN_ENTITLEMENTS = "Instagram-SWUI/Instagram-SWUI.entitlements";
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
DEVELOPMENT_ASSET_PATHS = "Instagram-SWUI/Preview\\ Content";
|
||||
DEVELOPMENT_TEAM = D846Q7V7YL;
|
||||
ENABLE_PREVIEWS = YES;
|
||||
INFOPLIST_FILE = "Instagram-SWUI/Info.plist";
|
||||
LD_RUNPATH_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
);
|
||||
PRODUCT_BUNDLE_IDENTIFIER = "leavenstee.Instagram-SWUI";
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SUPPORTS_UIKITFORMAC = NO;
|
||||
SWIFT_VERSION = 5.0;
|
||||
TARGETED_DEVICE_FAMILY = "1,2";
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
C313C0CD22A6FBAE00FF2AFB /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
CODE_SIGN_ENTITLEMENTS = "Instagram-SWUI/Instagram-SWUI.entitlements";
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
DEVELOPMENT_ASSET_PATHS = "Instagram-SWUI/Preview\\ Content";
|
||||
DEVELOPMENT_TEAM = D846Q7V7YL;
|
||||
ENABLE_PREVIEWS = YES;
|
||||
INFOPLIST_FILE = "Instagram-SWUI/Info.plist";
|
||||
LD_RUNPATH_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
);
|
||||
PRODUCT_BUNDLE_IDENTIFIER = "leavenstee.Instagram-SWUI";
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SUPPORTS_UIKITFORMAC = NO;
|
||||
SWIFT_VERSION = 5.0;
|
||||
TARGETED_DEVICE_FAMILY = "1,2";
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
/* End XCBuildConfiguration section */
|
||||
|
||||
/* Begin XCConfigurationList section */
|
||||
C313C0AF22A6FBAC00FF2AFB /* Build configuration list for PBXProject "Instagram-SWUI" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
C313C0C922A6FBAE00FF2AFB /* Debug */,
|
||||
C313C0CA22A6FBAE00FF2AFB /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
C313C0CB22A6FBAE00FF2AFB /* Build configuration list for PBXNativeTarget "Instagram-SWUI" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
C313C0CC22A6FBAE00FF2AFB /* Debug */,
|
||||
C313C0CD22A6FBAE00FF2AFB /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
/* End XCConfigurationList section */
|
||||
|
||||
/* Begin XCVersionGroup section */
|
||||
C313C0BB22A6FBAC00FF2AFB /* Instagram_SWUI.xcdatamodeld */ = {
|
||||
isa = XCVersionGroup;
|
||||
children = (
|
||||
C313C0BC22A6FBAC00FF2AFB /* Instagram_SWUI.xcdatamodel */,
|
||||
);
|
||||
currentVersion = C313C0BC22A6FBAC00FF2AFB /* Instagram_SWUI.xcdatamodel */;
|
||||
path = Instagram_SWUI.xcdatamodeld;
|
||||
sourceTree = "<group>";
|
||||
versionGroupType = wrapper.xcdatamodel;
|
||||
};
|
||||
/* End XCVersionGroup section */
|
||||
};
|
||||
rootObject = C313C0AC22A6FBAC00FF2AFB /* Project object */;
|
||||
}
|
||||
7
Examples/InstaFake/Instagram-SWUI.xcodeproj/project.xcworkspace/contents.xcworkspacedata
generated
Executable file
7
Examples/InstaFake/Instagram-SWUI.xcodeproj/project.xcworkspace/contents.xcworkspacedata
generated
Executable file
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Workspace
|
||||
version = "1.0">
|
||||
<FileRef
|
||||
location = "self:Instagram-SWUI.xcodeproj">
|
||||
</FileRef>
|
||||
</Workspace>
|
||||
@@ -0,0 +1,8 @@
|
||||
<?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>IDEDidComputeMac32BitWarning</key>
|
||||
<true/>
|
||||
</dict>
|
||||
</plist>
|
||||
88
Examples/InstaFake/Instagram-SWUI/AppDelegate.swift
Executable file
88
Examples/InstaFake/Instagram-SWUI/AppDelegate.swift
Executable file
@@ -0,0 +1,88 @@
|
||||
//
|
||||
// AppDelegate.swift
|
||||
// Instagram-SWUI
|
||||
//
|
||||
// Created by Steven Lee on 6/4/19.
|
||||
// Copyright © 2019 leavenstee llc. All rights reserved.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
import CoreData
|
||||
|
||||
@UIApplicationMain
|
||||
class AppDelegate: UIResponder, UIApplicationDelegate {
|
||||
|
||||
|
||||
|
||||
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
|
||||
// Override point for customization after application launch.
|
||||
return true
|
||||
}
|
||||
|
||||
func applicationWillTerminate(_ application: UIApplication) {
|
||||
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
|
||||
// Saves changes in the application's managed object context before the application terminates.
|
||||
self.saveContext()
|
||||
}
|
||||
|
||||
// MARK: UISceneSession Lifecycle
|
||||
|
||||
func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration {
|
||||
// Called when a new scene session is being created.
|
||||
// Use this method to select a configuration to create the new scene with.
|
||||
return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role)
|
||||
}
|
||||
|
||||
func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set<UISceneSession>) {
|
||||
// Called when the user discards a scene session.
|
||||
// If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions.
|
||||
// Use this method to release any resources that were specific to the discarded scenes, as they will not return.
|
||||
}
|
||||
|
||||
// MARK: - Core Data stack
|
||||
|
||||
lazy var persistentContainer: NSPersistentContainer = {
|
||||
/*
|
||||
The persistent container for the application. This implementation
|
||||
creates and returns a container, having loaded the store for the
|
||||
application to it. This property is optional since there are legitimate
|
||||
error conditions that could cause the creation of the store to fail.
|
||||
*/
|
||||
let container = NSPersistentContainer(name: "Instagram_SWUI")
|
||||
container.loadPersistentStores(completionHandler: { (storeDescription, error) in
|
||||
if let error = error as NSError? {
|
||||
// Replace this implementation with code to handle the error appropriately.
|
||||
// fatalError() causes the application to generate a crash log and terminate. You should not use this function in a shipping application, although it may be useful during development.
|
||||
|
||||
/*
|
||||
Typical reasons for an error here include:
|
||||
* The parent directory does not exist, cannot be created, or disallows writing.
|
||||
* The persistent store is not accessible, due to permissions or data protection when the device is locked.
|
||||
* The device is out of space.
|
||||
* The store could not be migrated to the current model version.
|
||||
Check the error message to determine what the actual problem was.
|
||||
*/
|
||||
fatalError("Unresolved error \(error), \(error.userInfo)")
|
||||
}
|
||||
})
|
||||
return container
|
||||
}()
|
||||
|
||||
// MARK: - Core Data Saving support
|
||||
|
||||
func saveContext () {
|
||||
let context = persistentContainer.viewContext
|
||||
if context.hasChanges {
|
||||
do {
|
||||
try context.save()
|
||||
} catch {
|
||||
// Replace this implementation with code to handle the error appropriately.
|
||||
// fatalError() causes the application to generate a crash log and terminate. You should not use this function in a shipping application, although it may be useful during development.
|
||||
let nserror = error as NSError
|
||||
fatalError("Unresolved error \(nserror), \(nserror.userInfo)")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,98 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "iphone",
|
||||
"size" : "20x20",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "iphone",
|
||||
"size" : "20x20",
|
||||
"scale" : "3x"
|
||||
},
|
||||
{
|
||||
"idiom" : "iphone",
|
||||
"size" : "29x29",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "iphone",
|
||||
"size" : "29x29",
|
||||
"scale" : "3x"
|
||||
},
|
||||
{
|
||||
"idiom" : "iphone",
|
||||
"size" : "40x40",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "iphone",
|
||||
"size" : "40x40",
|
||||
"scale" : "3x"
|
||||
},
|
||||
{
|
||||
"idiom" : "iphone",
|
||||
"size" : "60x60",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "iphone",
|
||||
"size" : "60x60",
|
||||
"scale" : "3x"
|
||||
},
|
||||
{
|
||||
"idiom" : "ipad",
|
||||
"size" : "20x20",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "ipad",
|
||||
"size" : "20x20",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "ipad",
|
||||
"size" : "29x29",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "ipad",
|
||||
"size" : "29x29",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "ipad",
|
||||
"size" : "40x40",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "ipad",
|
||||
"size" : "40x40",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "ipad",
|
||||
"size" : "76x76",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "ipad",
|
||||
"size" : "76x76",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "ipad",
|
||||
"size" : "83.5x83.5",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "ios-marketing",
|
||||
"size" : "1024x1024",
|
||||
"scale" : "1x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
}
|
||||
}
|
||||
6
Examples/InstaFake/Instagram-SWUI/Assets.xcassets/Contents.json
Executable file
6
Examples/InstaFake/Instagram-SWUI/Assets.xcassets/Contents.json
Executable file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 1.7 MiB |
21
Examples/InstaFake/Instagram-SWUI/Assets.xcassets/badge.imageset/Contents.json
vendored
Executable file
21
Examples/InstaFake/Instagram-SWUI/Assets.xcassets/badge.imageset/Contents.json
vendored
Executable file
@@ -0,0 +1,21 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"filename" : "58120000553__7091B1D4-F645-4760-B5EE-D38E53D53F54.JPG",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
}
|
||||
}
|
||||
21
Examples/InstaFake/Instagram-SWUI/Assets.xcassets/burrito.imageset/Contents.json
vendored
Executable file
21
Examples/InstaFake/Instagram-SWUI/Assets.xcassets/burrito.imageset/Contents.json
vendored
Executable file
@@ -0,0 +1,21 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"filename" : "IMG_0163.jpeg",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
}
|
||||
}
|
||||
BIN
Examples/InstaFake/Instagram-SWUI/Assets.xcassets/burrito.imageset/IMG_0163.jpeg
vendored
Executable file
BIN
Examples/InstaFake/Instagram-SWUI/Assets.xcassets/burrito.imageset/IMG_0163.jpeg
vendored
Executable file
Binary file not shown.
|
After Width: | Height: | Size: 3.1 MiB |
15
Examples/InstaFake/Instagram-SWUI/Assets.xcassets/photo-camera.imageset/Contents.json
vendored
Executable file
15
Examples/InstaFake/Instagram-SWUI/Assets.xcassets/photo-camera.imageset/Contents.json
vendored
Executable file
@@ -0,0 +1,15 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"filename" : "photo-camera.png"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
},
|
||||
"properties" : {
|
||||
"template-rendering-intent" : "original"
|
||||
}
|
||||
}
|
||||
BIN
Examples/InstaFake/Instagram-SWUI/Assets.xcassets/photo-camera.imageset/photo-camera.png
vendored
Executable file
BIN
Examples/InstaFake/Instagram-SWUI/Assets.xcassets/photo-camera.imageset/photo-camera.png
vendored
Executable file
Binary file not shown.
|
After Width: | Height: | Size: 2.0 KiB |
21
Examples/InstaFake/Instagram-SWUI/Assets.xcassets/pizza.imageset/Contents.json
vendored
Executable file
21
Examples/InstaFake/Instagram-SWUI/Assets.xcassets/pizza.imageset/Contents.json
vendored
Executable file
@@ -0,0 +1,21 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"filename" : "IMG_0156.jpeg",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
}
|
||||
}
|
||||
BIN
Examples/InstaFake/Instagram-SWUI/Assets.xcassets/pizza.imageset/IMG_0156.jpeg
vendored
Executable file
BIN
Examples/InstaFake/Instagram-SWUI/Assets.xcassets/pizza.imageset/IMG_0156.jpeg
vendored
Executable file
Binary file not shown.
|
After Width: | Height: | Size: 3.0 MiB |
12
Examples/InstaFake/Instagram-SWUI/Assets.xcassets/wwdc.imageset/Contents.json
vendored
Executable file
12
Examples/InstaFake/Instagram-SWUI/Assets.xcassets/wwdc.imageset/Contents.json
vendored
Executable file
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"filename" : "wwdc.JPG"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
}
|
||||
}
|
||||
BIN
Examples/InstaFake/Instagram-SWUI/Assets.xcassets/wwdc.imageset/wwdc.JPG
vendored
Executable file
BIN
Examples/InstaFake/Instagram-SWUI/Assets.xcassets/wwdc.imageset/wwdc.JPG
vendored
Executable file
Binary file not shown.
|
After Width: | Height: | Size: 2.8 MiB |
25
Examples/InstaFake/Instagram-SWUI/Base.lproj/LaunchScreen.storyboard
Executable file
25
Examples/InstaFake/Instagram-SWUI/Base.lproj/LaunchScreen.storyboard
Executable file
@@ -0,0 +1,25 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="13122.16" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
|
||||
<dependencies>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13104.12"/>
|
||||
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
|
||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||
</dependencies>
|
||||
<scenes>
|
||||
<!--View Controller-->
|
||||
<scene sceneID="EHf-IW-A2E">
|
||||
<objects>
|
||||
<viewController id="01J-lp-oVM" sceneMemberID="viewController">
|
||||
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
|
||||
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<color key="backgroundColor" xcode11CocoaTouchSystemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
|
||||
<viewLayoutGuide key="safeArea" id="6Tk-OE-BBY"/>
|
||||
</view>
|
||||
</viewController>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
|
||||
</objects>
|
||||
<point key="canvasLocation" x="53" y="375"/>
|
||||
</scene>
|
||||
</scenes>
|
||||
</document>
|
||||
25
Examples/InstaFake/Instagram-SWUI/CameraView.swift
Executable file
25
Examples/InstaFake/Instagram-SWUI/CameraView.swift
Executable file
@@ -0,0 +1,25 @@
|
||||
//
|
||||
// CameraView.swift
|
||||
// Instagram-SWUI
|
||||
//
|
||||
// Created by Steven Lee on 6/5/19.
|
||||
// Copyright © 2019 leavenstee llc. All rights reserved.
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
import UIKit
|
||||
|
||||
struct CameraView : UIViewControllerRepresentable {
|
||||
func makeUIViewController(context: UIViewControllerRepresentableContext<CameraView>) -> CameraViewController {
|
||||
return CameraViewController()
|
||||
}
|
||||
|
||||
func updateUIViewController(_ uiViewController: CameraViewController, context: UIViewControllerRepresentableContext<CameraView>) {
|
||||
|
||||
}
|
||||
|
||||
typealias UIViewControllerType = CameraViewController
|
||||
|
||||
|
||||
}
|
||||
|
||||
152
Examples/InstaFake/Instagram-SWUI/CameraViewController.swift
Executable file
152
Examples/InstaFake/Instagram-SWUI/CameraViewController.swift
Executable file
@@ -0,0 +1,152 @@
|
||||
//
|
||||
// CameraViewController.swift
|
||||
// Instagram-SWUI
|
||||
//
|
||||
// Created by Steven Lee on 6/6/19.
|
||||
// Copyright © 2019 leavenstee llc. All rights reserved.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
|
||||
import AVFoundation
|
||||
|
||||
class CameraViewController: UIViewController {
|
||||
|
||||
var previewView: UIView!
|
||||
var captureButton: UIButton!
|
||||
|
||||
var captureSession: AVCaptureSession?
|
||||
var videoPreviewLayer: AVCaptureVideoPreviewLayer?
|
||||
var capturePhotoOutput: AVCapturePhotoOutput?
|
||||
var qrCodeFrameView: UIView?
|
||||
|
||||
override func viewDidLoad() {
|
||||
super.viewDidLoad()
|
||||
|
||||
previewView = UIView(frame: view.frame)
|
||||
captureButton = UIButton(frame: CGRect(x: 100, y: 100, width: 300, height: 300))
|
||||
captureButton.backgroundColor = .green
|
||||
|
||||
captureButton.layer.cornerRadius = captureButton.frame.size.width / 2
|
||||
captureButton.clipsToBounds = true
|
||||
|
||||
// Get an instance of the AVCaptureDevice class to initialize a device object and provide the video as the media type parameter
|
||||
guard let captureDevice = AVCaptureDevice.default(for: .video) else {
|
||||
fatalError("No video device found")
|
||||
}
|
||||
|
||||
do {
|
||||
// Get an instance of the AVCaptureDeviceInput class using the previous deivce object
|
||||
let input = try AVCaptureDeviceInput(device: captureDevice)
|
||||
|
||||
// Initialize the captureSession object
|
||||
captureSession = AVCaptureSession()
|
||||
|
||||
// Set the input devcie on the capture session
|
||||
captureSession?.addInput(input)
|
||||
|
||||
// Get an instance of ACCapturePhotoOutput class
|
||||
capturePhotoOutput = AVCapturePhotoOutput()
|
||||
capturePhotoOutput?.isHighResolutionCaptureEnabled = true
|
||||
|
||||
// Set the output on the capture session
|
||||
captureSession?.addOutput(capturePhotoOutput!)
|
||||
|
||||
// Initialize a AVCaptureMetadataOutput object and set it as the input device
|
||||
let captureMetadataOutput = AVCaptureMetadataOutput()
|
||||
captureSession?.addOutput(captureMetadataOutput)
|
||||
|
||||
//Initialise the video preview layer and add it as a sublayer to the viewPreview view's layer
|
||||
videoPreviewLayer = AVCaptureVideoPreviewLayer(session: captureSession!)
|
||||
videoPreviewLayer?.videoGravity = AVLayerVideoGravity.resizeAspectFill
|
||||
videoPreviewLayer?.frame = view.layer.bounds
|
||||
previewView.layer.addSublayer(videoPreviewLayer!)
|
||||
|
||||
//start video capture
|
||||
captureSession?.startRunning()
|
||||
|
||||
//Initialize QR Code Frame to highlight the QR code
|
||||
qrCodeFrameView = UIView()
|
||||
|
||||
if let qrCodeFrameView = qrCodeFrameView {
|
||||
qrCodeFrameView.layer.borderColor = UIColor.green.cgColor
|
||||
qrCodeFrameView.layer.borderWidth = 2
|
||||
view.addSubview(qrCodeFrameView)
|
||||
view.bringSubviewToFront(qrCodeFrameView)
|
||||
}
|
||||
} catch {
|
||||
//If any error occurs, simply print it out
|
||||
print(error)
|
||||
return
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
override func viewDidLayoutSubviews() {
|
||||
videoPreviewLayer?.frame = view.bounds
|
||||
if let previewLayer = videoPreviewLayer ,(previewLayer.connection?.isVideoOrientationSupported)! {
|
||||
previewLayer.connection?.videoOrientation = UIApplication.shared.statusBarOrientation.videoOrientation ?? .portrait
|
||||
}
|
||||
}
|
||||
|
||||
override func didReceiveMemoryWarning() {
|
||||
super.didReceiveMemoryWarning()
|
||||
// Dispose of any resources that can be recreated.
|
||||
}
|
||||
|
||||
@IBAction func onTapTakePhoto(_ sender: Any) {
|
||||
// Make sure capturePhotoOutput is valid
|
||||
guard let capturePhotoOutput = self.capturePhotoOutput else { return }
|
||||
|
||||
// Get an instance of AVCapturePhotoSettings class
|
||||
let photoSettings = AVCapturePhotoSettings()
|
||||
|
||||
// Set photo settings for our need
|
||||
photoSettings.isAutoStillImageStabilizationEnabled = true
|
||||
photoSettings.isHighResolutionPhotoEnabled = true
|
||||
photoSettings.flashMode = .auto
|
||||
|
||||
// Call capturePhoto method by passing our photo settings and a delegate implementing AVCapturePhotoCaptureDelegate
|
||||
capturePhotoOutput.capturePhoto(with: photoSettings, delegate: self)
|
||||
}
|
||||
}
|
||||
|
||||
extension CameraViewController : AVCapturePhotoCaptureDelegate {
|
||||
func photoOutput(_ captureOutput: AVCapturePhotoOutput,
|
||||
didFinishProcessingPhoto photoSampleBuffer: CMSampleBuffer?,
|
||||
previewPhoto previewPhotoSampleBuffer: CMSampleBuffer?,
|
||||
resolvedSettings: AVCaptureResolvedPhotoSettings,
|
||||
bracketSettings: AVCaptureBracketedStillImageSettings?,
|
||||
error: Error?) {
|
||||
// Make sure we get some photo sample buffer
|
||||
guard error == nil,
|
||||
let photoSampleBuffer = photoSampleBuffer else {
|
||||
print("Error capturing photo: \(String(describing: error))")
|
||||
return
|
||||
}
|
||||
|
||||
// Convert photo same buffer to a jpeg image data by using AVCapturePhotoOutput
|
||||
guard let imageData = AVCapturePhotoOutput.jpegPhotoDataRepresentation(forJPEGSampleBuffer: photoSampleBuffer, previewPhotoSampleBuffer: previewPhotoSampleBuffer) else {
|
||||
return
|
||||
}
|
||||
|
||||
// Initialise an UIImage with our image data
|
||||
let capturedImage = UIImage.init(data: imageData , scale: 1.0)
|
||||
if let image = capturedImage {
|
||||
// Save our captured image to photos album
|
||||
UIImageWriteToSavedPhotosAlbum(image, nil, nil, nil)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
extension UIInterfaceOrientation {
|
||||
var videoOrientation: AVCaptureVideoOrientation? {
|
||||
switch self {
|
||||
case .portraitUpsideDown: return .portraitUpsideDown
|
||||
case .landscapeRight: return .landscapeRight
|
||||
case .landscapeLeft: return .landscapeLeft
|
||||
case .portrait: return .portrait
|
||||
default: return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
116
Examples/InstaFake/Instagram-SWUI/ContentView.swift
Executable file
116
Examples/InstaFake/Instagram-SWUI/ContentView.swift
Executable file
@@ -0,0 +1,116 @@
|
||||
//
|
||||
// ContentView.swift
|
||||
// Instagram-SWUI
|
||||
//
|
||||
// Created by Steven Lee on 6/4/19.
|
||||
// Copyright © 2019 leavenstee llc. All rights reserved.
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
import AVKit
|
||||
import CoreLocation
|
||||
|
||||
struct ContentView : View {
|
||||
var instaPhotos: [InstaPhoto]
|
||||
|
||||
var body: some View {
|
||||
NavigationView {
|
||||
List {
|
||||
ForEach(instaPhotos.identified(by: \.id)) {
|
||||
ImageCell(photo: $0)
|
||||
}
|
||||
}.navigationBarTitle(Text("WWDC")).navigationBarItems(trailing: PresentationButton(Text("Camera"), destination: CameraView()))
|
||||
}
|
||||
}
|
||||
|
||||
func takePhoto() {
|
||||
// Open Camera
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#if DEBUG
|
||||
struct ContentView_Previews : PreviewProvider {
|
||||
static var previews: some View {
|
||||
ContentView(instaPhotos: [InstaPhoto(id: 0, username: "leavenstee", comments: ["Nice", "Cool","Lame"], likes: 100, image: "wwdc"),InstaPhoto(id: 0, username: "leavenstee", comments: ["Nice", "Cool","Lame","Nice", "Cool","Lame"], likes: 200, image: "pizza"),
|
||||
InstaPhoto(id: 0, username: "leavenstee", comments: ["Nice", "Cool","Lame","Nice", "Cool","Lame","Nice", "Cool","Lame","Nice", "Cool","Lame"], likes: 4440, image: "wwdc"),InstaPhoto(id: 0, username: "leavenstee", comments: ["Nice", "Cool"], likes: 20, image: "badge")])
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
struct ImageCell : View {
|
||||
@State var expanded = false
|
||||
@State var liked = false
|
||||
|
||||
var photo: InstaPhoto
|
||||
|
||||
var body: some View {
|
||||
return VStack(alignment: .leading) {
|
||||
HStack {
|
||||
Image("badge").resizable().scaledToFit().cornerRadius(100)
|
||||
Text(photo.username)
|
||||
Button(action: {}, label: {
|
||||
Text("...")
|
||||
})
|
||||
}.frame(height: 40)
|
||||
|
||||
Image(photo.image)
|
||||
.resizable()
|
||||
.scaledToFit()
|
||||
.cornerRadius(10)
|
||||
// Control Buttons
|
||||
HStack {
|
||||
Button(action: withAnimation { likeButtonPressed }, label: {
|
||||
Text( self.liked ? "❤️" :"💔")
|
||||
})
|
||||
Button(action: commentButtonPressed, label: {
|
||||
Text("🗣")
|
||||
})
|
||||
Button(action: likeButtonPressed, label: {
|
||||
Text("📪")
|
||||
})
|
||||
Spacer()
|
||||
Button(action: likeButtonPressed, label: {
|
||||
Text("📕")
|
||||
})
|
||||
}
|
||||
Text("\(photo.likes) Likes")
|
||||
.multilineTextAlignment(.leading)
|
||||
Text(photo.username)
|
||||
.multilineTextAlignment(.leading)
|
||||
Button(action: moreCommentsPressed, label: {
|
||||
Text("View All \(photo.comments.count) Comments")
|
||||
.fontWeight(.light)
|
||||
})
|
||||
if expanded {
|
||||
VStack {
|
||||
Text("Test Comment")
|
||||
Text("Test Comment")
|
||||
Text("Test Comment")
|
||||
Text("Test Comment")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func moreCommentsPressed() {
|
||||
expanded.toggle()
|
||||
}
|
||||
|
||||
func likeButtonPressed() {
|
||||
liked.toggle()
|
||||
}
|
||||
|
||||
func commentButtonPressed() {
|
||||
|
||||
}
|
||||
|
||||
func shareButtonPressed() {
|
||||
|
||||
}
|
||||
|
||||
func bookMarkButtonPressed() {
|
||||
|
||||
}
|
||||
}
|
||||
64
Examples/InstaFake/Instagram-SWUI/Info.plist
Executable file
64
Examples/InstaFake/Instagram-SWUI/Info.plist
Executable file
@@ -0,0 +1,64 @@
|
||||
<?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>$(DEVELOPMENT_LANGUAGE)</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>$(EXECUTABLE_NAME)</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>$(PRODUCT_NAME)</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.0</string>
|
||||
<key>NSCameraUsageDescription</key>
|
||||
<string>Let me use your camer for pics</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1</string>
|
||||
<key>LSRequiresIPhoneOS</key>
|
||||
<true/>
|
||||
<key>UIApplicationSceneManifest</key>
|
||||
<dict>
|
||||
<key>UIApplicationSupportsMultipleScenes</key>
|
||||
<false/>
|
||||
<key>UISceneConfigurations</key>
|
||||
<dict>
|
||||
<key>UIWindowSceneSessionRoleApplication</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>UILaunchStoryboardName</key>
|
||||
<string>LaunchScreen</string>
|
||||
<key>UISceneConfigurationName</key>
|
||||
<string>Default Configuration</string>
|
||||
<key>UISceneDelegateClassName</key>
|
||||
<string>$(PRODUCT_MODULE_NAME).SceneDelegate</string>
|
||||
</dict>
|
||||
</array>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>UILaunchStoryboardName</key>
|
||||
<string>LaunchScreen</string>
|
||||
<key>UIRequiredDeviceCapabilities</key>
|
||||
<array>
|
||||
<string>armv7</string>
|
||||
</array>
|
||||
<key>UISupportedInterfaceOrientations</key>
|
||||
<array>
|
||||
<string>UIInterfaceOrientationPortrait</string>
|
||||
<string>UIInterfaceOrientationLandscapeLeft</string>
|
||||
<string>UIInterfaceOrientationLandscapeRight</string>
|
||||
</array>
|
||||
<key>UISupportedInterfaceOrientations~ipad</key>
|
||||
<array>
|
||||
<string>UIInterfaceOrientationPortrait</string>
|
||||
<string>UIInterfaceOrientationPortraitUpsideDown</string>
|
||||
<string>UIInterfaceOrientationLandscapeLeft</string>
|
||||
<string>UIInterfaceOrientationLandscapeRight</string>
|
||||
</array>
|
||||
</dict>
|
||||
</plist>
|
||||
18
Examples/InstaFake/Instagram-SWUI/InstaPhoto.swift
Executable file
18
Examples/InstaFake/Instagram-SWUI/InstaPhoto.swift
Executable file
@@ -0,0 +1,18 @@
|
||||
//
|
||||
// InstaPhoto.swift
|
||||
// Instagram-SWUI
|
||||
//
|
||||
// Created by Steven Lee on 6/4/19.
|
||||
// Copyright © 2019 leavenstee llc. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import SwiftUI
|
||||
|
||||
struct InstaPhoto: Identifiable {
|
||||
let id: Int
|
||||
let username: String
|
||||
let comments: [String]
|
||||
let likes: Int
|
||||
let image: String
|
||||
}
|
||||
12
Examples/InstaFake/Instagram-SWUI/Instagram-SWUI.entitlements
Executable file
12
Examples/InstaFake/Instagram-SWUI/Instagram-SWUI.entitlements
Executable file
@@ -0,0 +1,12 @@
|
||||
<?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>com.apple.security.app-sandbox</key>
|
||||
<true/>
|
||||
<key>com.apple.security.device.camera</key>
|
||||
<true/>
|
||||
<key>com.apple.security.network.client</key>
|
||||
<true/>
|
||||
</dict>
|
||||
</plist>
|
||||
@@ -0,0 +1,8 @@
|
||||
<?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>_XCCurrentVersionName</key>
|
||||
<string>Instagram_SWUI.xcdatamodel</string>
|
||||
</dict>
|
||||
</plist>
|
||||
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||
<model type="com.apple.IDECoreDataModeler.DataModel" documentVersion="1.0" lastSavedToolsVersion="1" systemVersion="11A491" minimumToolsVersion="Automatic" sourceLanguage="Swift" usedWithCloudKit="false" userDefinedModelVersionIdentifier="">
|
||||
<elements/>
|
||||
</model>
|
||||
13
Examples/InstaFake/Instagram-SWUI/PhotoLibrary.swift
Executable file
13
Examples/InstaFake/Instagram-SWUI/PhotoLibrary.swift
Executable file
@@ -0,0 +1,13 @@
|
||||
//
|
||||
// PhotoLibrary.swift
|
||||
// Instagram-SWUI
|
||||
//
|
||||
// Created by Steven Lee on 6/4/19.
|
||||
// Copyright © 2019 leavenstee llc. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
struct PhotoLibrary {
|
||||
let photos: [InstaPhoto]
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
}
|
||||
}
|
||||
63
Examples/InstaFake/Instagram-SWUI/SceneDelegate.swift
Executable file
63
Examples/InstaFake/Instagram-SWUI/SceneDelegate.swift
Executable file
@@ -0,0 +1,63 @@
|
||||
//
|
||||
// SceneDelegate.swift
|
||||
// Instagram-SWUI
|
||||
//
|
||||
// Created by Steven Lee on 6/4/19.
|
||||
// Copyright © 2019 leavenstee llc. All rights reserved.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
import SwiftUI
|
||||
|
||||
class SceneDelegate: UIResponder, UIWindowSceneDelegate {
|
||||
|
||||
var window: UIWindow?
|
||||
|
||||
|
||||
func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {
|
||||
// Use this method to optionally configure and attach the UIWindow `window` to the provided UIWindowScene `scene`.
|
||||
// If using a storyboard, the `window` property will automatically be initialized and attached to the scene.
|
||||
// This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead).
|
||||
|
||||
// Use a UIHostingController as window root view controller
|
||||
let window = UIWindow(frame: UIScreen.main.bounds)
|
||||
window.rootViewController = UIHostingController(rootView: ContentView(instaPhotos: [InstaPhoto(id: 0, username: "leavenstee", comments: ["Nice", "Cool","Lame"], likes: 100, image: "wwdc"),InstaPhoto(id: 0, username: "leavenstee", comments: ["Nice", "Cool","Lame","Nice", "Cool","Lame"], likes: 200, image: "pizza"),
|
||||
InstaPhoto(id: 0, username: "leavenstee", comments: ["Nice", "Cool","Lame","Nice", "Cool","Lame","Nice", "Cool","Lame","Nice", "Cool","Lame"], likes: 4440, image: "wwdc"),InstaPhoto(id: 0, username: "leavenstee", comments: ["Nice", "Cool"], likes: 20, image: "badge")]))
|
||||
self.window = window
|
||||
window.makeKeyAndVisible()
|
||||
}
|
||||
|
||||
func sceneDidDisconnect(_ scene: UIScene) {
|
||||
// Called as the scene is being released by the system.
|
||||
// This occurs shortly after the scene enters the background, or when its session is discarded.
|
||||
// Release any resources associated with this scene that can be re-created the next time the scene connects.
|
||||
// The scene may re-connect later, as its session was not neccessarily discarded (see `application:didDiscardSceneSessions` instead).
|
||||
}
|
||||
|
||||
func sceneDidBecomeActive(_ scene: UIScene) {
|
||||
// Called when the scene has moved from an inactive state to an active state.
|
||||
// Use this method to restart any tasks that were paused (or not yet started) when the scene was inactive.
|
||||
}
|
||||
|
||||
func sceneWillResignActive(_ scene: UIScene) {
|
||||
// Called when the scene will move from an active state to an inactive state.
|
||||
// This may occur due to temporary interruptions (ex. an incoming phone call).
|
||||
}
|
||||
|
||||
func sceneWillEnterForeground(_ scene: UIScene) {
|
||||
// Called as the scene transitions from the background to the foreground.
|
||||
// Use this method to undo the changes made on entering the background.
|
||||
}
|
||||
|
||||
func sceneDidEnterBackground(_ scene: UIScene) {
|
||||
// Called as the scene transitions from the foreground to the background.
|
||||
// Use this method to save data, release shared resources, and store enough scene-specific state information
|
||||
// to restore the scene back to its current state.
|
||||
|
||||
// Save changes in the application's managed object context when the application transitions to the background.
|
||||
(UIApplication.shared.delegate as? AppDelegate)?.saveContext()
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user