mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-16 05:55:20 +00:00
Refactor ActivityIndicator
This commit is contained in:
parent
9953b26b64
commit
fa720e03de
@ -0,0 +1,555 @@
|
|||||||
|
// !$*UTF8*$!
|
||||||
|
{
|
||||||
|
archiveVersion = 1;
|
||||||
|
classes = {
|
||||||
|
};
|
||||||
|
objectVersion = 50;
|
||||||
|
objects = {
|
||||||
|
|
||||||
|
/* Begin PBXBuildFile section */
|
||||||
|
D060183122F35C3D00796784 /* ActivityIndicator.h in Headers */ = {isa = PBXBuildFile; fileRef = D060182F22F35C3D00796784 /* ActivityIndicator.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||||
|
D060183C22F35C8100796784 /* ActivityIndicator.swift in Sources */ = {isa = PBXBuildFile; fileRef = D060183B22F35C8100796784 /* ActivityIndicator.swift */; };
|
||||||
|
D0A0B53122F3701A00628AF3 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D0A0B53022F3701A00628AF3 /* UIKit.framework */; };
|
||||||
|
D0A0B53322F3701F00628AF3 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D0A0B53222F3701E00628AF3 /* Foundation.framework */; };
|
||||||
|
D0A0B53522F3702100628AF3 /* AsyncDisplayKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D0A0B53422F3702100628AF3 /* AsyncDisplayKit.framework */; };
|
||||||
|
D0A0B53722F3702E00628AF3 /* TelegramPresentationData.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D0A0B53622F3702E00628AF3 /* TelegramPresentationData.framework */; };
|
||||||
|
/* End PBXBuildFile section */
|
||||||
|
|
||||||
|
/* Begin PBXFileReference section */
|
||||||
|
D060182C22F35C3D00796784 /* ActivityIndicator.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = ActivityIndicator.framework; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||||
|
D060182F22F35C3D00796784 /* ActivityIndicator.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ActivityIndicator.h; sourceTree = "<group>"; };
|
||||||
|
D060183022F35C3D00796784 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
|
||||||
|
D060183B22F35C8100796784 /* ActivityIndicator.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ActivityIndicator.swift; sourceTree = "<group>"; };
|
||||||
|
D0A0B53022F3701A00628AF3 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
|
||||||
|
D0A0B53222F3701E00628AF3 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
|
||||||
|
D0A0B53422F3702100628AF3 /* AsyncDisplayKit.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = AsyncDisplayKit.framework; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||||
|
D0A0B53622F3702E00628AF3 /* TelegramPresentationData.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = TelegramPresentationData.framework; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||||
|
/* End PBXFileReference section */
|
||||||
|
|
||||||
|
/* Begin PBXFrameworksBuildPhase section */
|
||||||
|
D060182922F35C3D00796784 /* Frameworks */ = {
|
||||||
|
isa = PBXFrameworksBuildPhase;
|
||||||
|
buildActionMask = 2147483647;
|
||||||
|
files = (
|
||||||
|
D0A0B53722F3702E00628AF3 /* TelegramPresentationData.framework in Frameworks */,
|
||||||
|
D0A0B53522F3702100628AF3 /* AsyncDisplayKit.framework in Frameworks */,
|
||||||
|
D0A0B53322F3701F00628AF3 /* Foundation.framework in Frameworks */,
|
||||||
|
D0A0B53122F3701A00628AF3 /* UIKit.framework in Frameworks */,
|
||||||
|
);
|
||||||
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
|
};
|
||||||
|
/* End PBXFrameworksBuildPhase section */
|
||||||
|
|
||||||
|
/* Begin PBXGroup section */
|
||||||
|
D060182222F35C3D00796784 = {
|
||||||
|
isa = PBXGroup;
|
||||||
|
children = (
|
||||||
|
D060183022F35C3D00796784 /* Info.plist */,
|
||||||
|
D060182E22F35C3D00796784 /* Sources */,
|
||||||
|
D060182D22F35C3D00796784 /* Products */,
|
||||||
|
D0A0B52F22F3701800628AF3 /* Frameworks */,
|
||||||
|
);
|
||||||
|
sourceTree = "<group>";
|
||||||
|
};
|
||||||
|
D060182D22F35C3D00796784 /* Products */ = {
|
||||||
|
isa = PBXGroup;
|
||||||
|
children = (
|
||||||
|
D060182C22F35C3D00796784 /* ActivityIndicator.framework */,
|
||||||
|
);
|
||||||
|
name = Products;
|
||||||
|
sourceTree = "<group>";
|
||||||
|
};
|
||||||
|
D060182E22F35C3D00796784 /* Sources */ = {
|
||||||
|
isa = PBXGroup;
|
||||||
|
children = (
|
||||||
|
D060183B22F35C8100796784 /* ActivityIndicator.swift */,
|
||||||
|
D060182F22F35C3D00796784 /* ActivityIndicator.h */,
|
||||||
|
);
|
||||||
|
path = Sources;
|
||||||
|
sourceTree = "<group>";
|
||||||
|
};
|
||||||
|
D0A0B52F22F3701800628AF3 /* Frameworks */ = {
|
||||||
|
isa = PBXGroup;
|
||||||
|
children = (
|
||||||
|
D0A0B53622F3702E00628AF3 /* TelegramPresentationData.framework */,
|
||||||
|
D0A0B53422F3702100628AF3 /* AsyncDisplayKit.framework */,
|
||||||
|
D0A0B53222F3701E00628AF3 /* Foundation.framework */,
|
||||||
|
D0A0B53022F3701A00628AF3 /* UIKit.framework */,
|
||||||
|
);
|
||||||
|
name = Frameworks;
|
||||||
|
sourceTree = "<group>";
|
||||||
|
};
|
||||||
|
/* End PBXGroup section */
|
||||||
|
|
||||||
|
/* Begin PBXHeadersBuildPhase section */
|
||||||
|
D060182722F35C3D00796784 /* Headers */ = {
|
||||||
|
isa = PBXHeadersBuildPhase;
|
||||||
|
buildActionMask = 2147483647;
|
||||||
|
files = (
|
||||||
|
D060183122F35C3D00796784 /* ActivityIndicator.h in Headers */,
|
||||||
|
);
|
||||||
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
|
};
|
||||||
|
/* End PBXHeadersBuildPhase section */
|
||||||
|
|
||||||
|
/* Begin PBXNativeTarget section */
|
||||||
|
D060182B22F35C3D00796784 /* ActivityIndicator */ = {
|
||||||
|
isa = PBXNativeTarget;
|
||||||
|
buildConfigurationList = D060183422F35C3D00796784 /* Build configuration list for PBXNativeTarget "ActivityIndicator" */;
|
||||||
|
buildPhases = (
|
||||||
|
D060182722F35C3D00796784 /* Headers */,
|
||||||
|
D060182822F35C3D00796784 /* Sources */,
|
||||||
|
D060182922F35C3D00796784 /* Frameworks */,
|
||||||
|
D060182A22F35C3D00796784 /* Resources */,
|
||||||
|
);
|
||||||
|
buildRules = (
|
||||||
|
);
|
||||||
|
dependencies = (
|
||||||
|
);
|
||||||
|
name = ActivityIndicator;
|
||||||
|
productName = ActivityIndicator;
|
||||||
|
productReference = D060182C22F35C3D00796784 /* ActivityIndicator.framework */;
|
||||||
|
productType = "com.apple.product-type.framework";
|
||||||
|
};
|
||||||
|
/* End PBXNativeTarget section */
|
||||||
|
|
||||||
|
/* Begin PBXProject section */
|
||||||
|
D060182322F35C3D00796784 /* Project object */ = {
|
||||||
|
isa = PBXProject;
|
||||||
|
attributes = {
|
||||||
|
DefaultBuildSystemTypeForWorkspace = Latest;
|
||||||
|
LastUpgradeCheck = 1010;
|
||||||
|
ORGANIZATIONNAME = "Telegram Messenger LLP";
|
||||||
|
TargetAttributes = {
|
||||||
|
D060182B22F35C3D00796784 = {
|
||||||
|
CreatedOnToolsVersion = 10.1;
|
||||||
|
LastSwiftMigration = 1010;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
buildConfigurationList = D060182622F35C3D00796784 /* Build configuration list for PBXProject "ActivityIndicator_Xcode" */;
|
||||||
|
compatibilityVersion = "Xcode 9.3";
|
||||||
|
developmentRegion = en;
|
||||||
|
hasScannedForEncodings = 0;
|
||||||
|
knownRegions = (
|
||||||
|
en,
|
||||||
|
);
|
||||||
|
mainGroup = D060182222F35C3D00796784;
|
||||||
|
productRefGroup = D060182D22F35C3D00796784 /* Products */;
|
||||||
|
projectDirPath = "";
|
||||||
|
projectRoot = "";
|
||||||
|
targets = (
|
||||||
|
D060182B22F35C3D00796784 /* ActivityIndicator */,
|
||||||
|
);
|
||||||
|
};
|
||||||
|
/* End PBXProject section */
|
||||||
|
|
||||||
|
/* Begin PBXResourcesBuildPhase section */
|
||||||
|
D060182A22F35C3D00796784 /* Resources */ = {
|
||||||
|
isa = PBXResourcesBuildPhase;
|
||||||
|
buildActionMask = 2147483647;
|
||||||
|
files = (
|
||||||
|
);
|
||||||
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
|
};
|
||||||
|
/* End PBXResourcesBuildPhase section */
|
||||||
|
|
||||||
|
/* Begin PBXSourcesBuildPhase section */
|
||||||
|
D060182822F35C3D00796784 /* Sources */ = {
|
||||||
|
isa = PBXSourcesBuildPhase;
|
||||||
|
buildActionMask = 2147483647;
|
||||||
|
files = (
|
||||||
|
D060183C22F35C8100796784 /* ActivityIndicator.swift in Sources */,
|
||||||
|
);
|
||||||
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
|
};
|
||||||
|
/* End PBXSourcesBuildPhase section */
|
||||||
|
|
||||||
|
/* Begin XCBuildConfiguration section */
|
||||||
|
D060183222F35C3D00796784 /* DebugAppStoreLLC */ = {
|
||||||
|
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;
|
||||||
|
CODE_SIGN_IDENTITY = "iPhone Developer";
|
||||||
|
COPY_PHASE_STRIP = NO;
|
||||||
|
CURRENT_PROJECT_VERSION = 1;
|
||||||
|
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 = 8.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";
|
||||||
|
VERSIONING_SYSTEM = "apple-generic";
|
||||||
|
VERSION_INFO_PREFIX = "";
|
||||||
|
};
|
||||||
|
name = DebugAppStoreLLC;
|
||||||
|
};
|
||||||
|
D060183322F35C3D00796784 /* ReleaseAppStoreLLC */ = {
|
||||||
|
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;
|
||||||
|
CODE_SIGN_IDENTITY = "iPhone Developer";
|
||||||
|
COPY_PHASE_STRIP = NO;
|
||||||
|
CURRENT_PROJECT_VERSION = 1;
|
||||||
|
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 = 8.0;
|
||||||
|
MTL_ENABLE_DEBUG_INFO = NO;
|
||||||
|
MTL_FAST_MATH = YES;
|
||||||
|
SDKROOT = iphoneos;
|
||||||
|
SWIFT_COMPILATION_MODE = wholemodule;
|
||||||
|
SWIFT_OPTIMIZATION_LEVEL = "-O";
|
||||||
|
VALIDATE_PRODUCT = YES;
|
||||||
|
VERSIONING_SYSTEM = "apple-generic";
|
||||||
|
VERSION_INFO_PREFIX = "";
|
||||||
|
};
|
||||||
|
name = ReleaseAppStoreLLC;
|
||||||
|
};
|
||||||
|
D060183522F35C3D00796784 /* DebugAppStoreLLC */ = {
|
||||||
|
isa = XCBuildConfiguration;
|
||||||
|
buildSettings = {
|
||||||
|
CLANG_ENABLE_MODULES = YES;
|
||||||
|
CODE_SIGN_IDENTITY = "";
|
||||||
|
CODE_SIGN_STYLE = Manual;
|
||||||
|
DEFINES_MODULE = YES;
|
||||||
|
DEVELOPMENT_TEAM = "";
|
||||||
|
DYLIB_COMPATIBILITY_VERSION = 1;
|
||||||
|
DYLIB_CURRENT_VERSION = 1;
|
||||||
|
DYLIB_INSTALL_NAME_BASE = "@rpath";
|
||||||
|
INFOPLIST_FILE = Info.plist;
|
||||||
|
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
|
||||||
|
LD_RUNPATH_SEARCH_PATHS = (
|
||||||
|
"$(inherited)",
|
||||||
|
"@executable_path/Frameworks",
|
||||||
|
"@loader_path/Frameworks",
|
||||||
|
);
|
||||||
|
MACH_O_TYPE = staticlib;
|
||||||
|
PRODUCT_BUNDLE_IDENTIFIER = org.telegram.ActivityIndicator;
|
||||||
|
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
|
||||||
|
PROVISIONING_PROFILE_SPECIFIER = "";
|
||||||
|
SKIP_INSTALL = YES;
|
||||||
|
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
|
||||||
|
SWIFT_VERSION = 4.2;
|
||||||
|
TARGETED_DEVICE_FAMILY = "1,2";
|
||||||
|
};
|
||||||
|
name = DebugAppStoreLLC;
|
||||||
|
};
|
||||||
|
D060183622F35C3D00796784 /* ReleaseAppStoreLLC */ = {
|
||||||
|
isa = XCBuildConfiguration;
|
||||||
|
buildSettings = {
|
||||||
|
CLANG_ENABLE_MODULES = YES;
|
||||||
|
CODE_SIGN_IDENTITY = "";
|
||||||
|
CODE_SIGN_STYLE = Manual;
|
||||||
|
DEFINES_MODULE = YES;
|
||||||
|
DEVELOPMENT_TEAM = "";
|
||||||
|
DYLIB_COMPATIBILITY_VERSION = 1;
|
||||||
|
DYLIB_CURRENT_VERSION = 1;
|
||||||
|
DYLIB_INSTALL_NAME_BASE = "@rpath";
|
||||||
|
INFOPLIST_FILE = Info.plist;
|
||||||
|
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
|
||||||
|
LD_RUNPATH_SEARCH_PATHS = (
|
||||||
|
"$(inherited)",
|
||||||
|
"@executable_path/Frameworks",
|
||||||
|
"@loader_path/Frameworks",
|
||||||
|
);
|
||||||
|
MACH_O_TYPE = staticlib;
|
||||||
|
PRODUCT_BUNDLE_IDENTIFIER = org.telegram.ActivityIndicator;
|
||||||
|
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
|
||||||
|
PROVISIONING_PROFILE_SPECIFIER = "";
|
||||||
|
SKIP_INSTALL = YES;
|
||||||
|
SWIFT_VERSION = 4.2;
|
||||||
|
TARGETED_DEVICE_FAMILY = "1,2";
|
||||||
|
};
|
||||||
|
name = ReleaseAppStoreLLC;
|
||||||
|
};
|
||||||
|
D060183722F35C5400796784 /* DebugHockeyapp */ = {
|
||||||
|
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;
|
||||||
|
CODE_SIGN_IDENTITY = "iPhone Developer";
|
||||||
|
COPY_PHASE_STRIP = NO;
|
||||||
|
CURRENT_PROJECT_VERSION = 1;
|
||||||
|
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 = 8.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";
|
||||||
|
VERSIONING_SYSTEM = "apple-generic";
|
||||||
|
VERSION_INFO_PREFIX = "";
|
||||||
|
};
|
||||||
|
name = DebugHockeyapp;
|
||||||
|
};
|
||||||
|
D060183822F35C5400796784 /* DebugHockeyapp */ = {
|
||||||
|
isa = XCBuildConfiguration;
|
||||||
|
buildSettings = {
|
||||||
|
CLANG_ENABLE_MODULES = YES;
|
||||||
|
CODE_SIGN_IDENTITY = "";
|
||||||
|
CODE_SIGN_STYLE = Manual;
|
||||||
|
DEFINES_MODULE = YES;
|
||||||
|
DEVELOPMENT_TEAM = "";
|
||||||
|
DYLIB_COMPATIBILITY_VERSION = 1;
|
||||||
|
DYLIB_CURRENT_VERSION = 1;
|
||||||
|
DYLIB_INSTALL_NAME_BASE = "@rpath";
|
||||||
|
INFOPLIST_FILE = Info.plist;
|
||||||
|
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
|
||||||
|
LD_RUNPATH_SEARCH_PATHS = (
|
||||||
|
"$(inherited)",
|
||||||
|
"@executable_path/Frameworks",
|
||||||
|
"@loader_path/Frameworks",
|
||||||
|
);
|
||||||
|
MACH_O_TYPE = staticlib;
|
||||||
|
PRODUCT_BUNDLE_IDENTIFIER = org.telegram.ActivityIndicator;
|
||||||
|
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
|
||||||
|
PROVISIONING_PROFILE_SPECIFIER = "";
|
||||||
|
SKIP_INSTALL = YES;
|
||||||
|
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
|
||||||
|
SWIFT_VERSION = 4.2;
|
||||||
|
TARGETED_DEVICE_FAMILY = "1,2";
|
||||||
|
};
|
||||||
|
name = DebugHockeyapp;
|
||||||
|
};
|
||||||
|
D060183922F35C5F00796784 /* ReleaseHockeyappInternal */ = {
|
||||||
|
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;
|
||||||
|
CODE_SIGN_IDENTITY = "iPhone Developer";
|
||||||
|
COPY_PHASE_STRIP = NO;
|
||||||
|
CURRENT_PROJECT_VERSION = 1;
|
||||||
|
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 = 8.0;
|
||||||
|
MTL_ENABLE_DEBUG_INFO = NO;
|
||||||
|
MTL_FAST_MATH = YES;
|
||||||
|
SDKROOT = iphoneos;
|
||||||
|
SWIFT_COMPILATION_MODE = wholemodule;
|
||||||
|
SWIFT_OPTIMIZATION_LEVEL = "-O";
|
||||||
|
VALIDATE_PRODUCT = YES;
|
||||||
|
VERSIONING_SYSTEM = "apple-generic";
|
||||||
|
VERSION_INFO_PREFIX = "";
|
||||||
|
};
|
||||||
|
name = ReleaseHockeyappInternal;
|
||||||
|
};
|
||||||
|
D060183A22F35C5F00796784 /* ReleaseHockeyappInternal */ = {
|
||||||
|
isa = XCBuildConfiguration;
|
||||||
|
buildSettings = {
|
||||||
|
CLANG_ENABLE_MODULES = YES;
|
||||||
|
CODE_SIGN_IDENTITY = "";
|
||||||
|
CODE_SIGN_STYLE = Manual;
|
||||||
|
DEFINES_MODULE = YES;
|
||||||
|
DEVELOPMENT_TEAM = "";
|
||||||
|
DYLIB_COMPATIBILITY_VERSION = 1;
|
||||||
|
DYLIB_CURRENT_VERSION = 1;
|
||||||
|
DYLIB_INSTALL_NAME_BASE = "@rpath";
|
||||||
|
INFOPLIST_FILE = Info.plist;
|
||||||
|
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
|
||||||
|
LD_RUNPATH_SEARCH_PATHS = (
|
||||||
|
"$(inherited)",
|
||||||
|
"@executable_path/Frameworks",
|
||||||
|
"@loader_path/Frameworks",
|
||||||
|
);
|
||||||
|
MACH_O_TYPE = staticlib;
|
||||||
|
PRODUCT_BUNDLE_IDENTIFIER = org.telegram.ActivityIndicator;
|
||||||
|
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
|
||||||
|
PROVISIONING_PROFILE_SPECIFIER = "";
|
||||||
|
SKIP_INSTALL = YES;
|
||||||
|
SWIFT_VERSION = 4.2;
|
||||||
|
TARGETED_DEVICE_FAMILY = "1,2";
|
||||||
|
};
|
||||||
|
name = ReleaseHockeyappInternal;
|
||||||
|
};
|
||||||
|
/* End XCBuildConfiguration section */
|
||||||
|
|
||||||
|
/* Begin XCConfigurationList section */
|
||||||
|
D060182622F35C3D00796784 /* Build configuration list for PBXProject "ActivityIndicator_Xcode" */ = {
|
||||||
|
isa = XCConfigurationList;
|
||||||
|
buildConfigurations = (
|
||||||
|
D060183222F35C3D00796784 /* DebugAppStoreLLC */,
|
||||||
|
D060183722F35C5400796784 /* DebugHockeyapp */,
|
||||||
|
D060183322F35C3D00796784 /* ReleaseAppStoreLLC */,
|
||||||
|
D060183922F35C5F00796784 /* ReleaseHockeyappInternal */,
|
||||||
|
);
|
||||||
|
defaultConfigurationIsVisible = 0;
|
||||||
|
defaultConfigurationName = ReleaseAppStoreLLC;
|
||||||
|
};
|
||||||
|
D060183422F35C3D00796784 /* Build configuration list for PBXNativeTarget "ActivityIndicator" */ = {
|
||||||
|
isa = XCConfigurationList;
|
||||||
|
buildConfigurations = (
|
||||||
|
D060183522F35C3D00796784 /* DebugAppStoreLLC */,
|
||||||
|
D060183822F35C5400796784 /* DebugHockeyapp */,
|
||||||
|
D060183622F35C3D00796784 /* ReleaseAppStoreLLC */,
|
||||||
|
D060183A22F35C5F00796784 /* ReleaseHockeyappInternal */,
|
||||||
|
);
|
||||||
|
defaultConfigurationIsVisible = 0;
|
||||||
|
defaultConfigurationName = ReleaseAppStoreLLC;
|
||||||
|
};
|
||||||
|
/* End XCConfigurationList section */
|
||||||
|
};
|
||||||
|
rootObject = D060182322F35C3D00796784 /* Project object */;
|
||||||
|
}
|
22
submodules/ActivityIndicator/Info.plist
Normal file
22
submodules/ActivityIndicator/Info.plist
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
<?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>FMWK</string>
|
||||||
|
<key>CFBundleShortVersionString</key>
|
||||||
|
<string>1.0</string>
|
||||||
|
<key>CFBundleVersion</key>
|
||||||
|
<string>$(CURRENT_PROJECT_VERSION)</string>
|
||||||
|
</dict>
|
||||||
|
</plist>
|
19
submodules/ActivityIndicator/Sources/ActivityIndicator.h
Normal file
19
submodules/ActivityIndicator/Sources/ActivityIndicator.h
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
//
|
||||||
|
// ActivityIndicator.h
|
||||||
|
// ActivityIndicator
|
||||||
|
//
|
||||||
|
// Created by Peter on 8/1/19.
|
||||||
|
// Copyright © 2019 Telegram Messenger LLP. All rights reserved.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import <UIKit/UIKit.h>
|
||||||
|
|
||||||
|
//! Project version number for ActivityIndicator.
|
||||||
|
FOUNDATION_EXPORT double ActivityIndicatorVersionNumber;
|
||||||
|
|
||||||
|
//! Project version string for ActivityIndicator.
|
||||||
|
FOUNDATION_EXPORT const unsigned char ActivityIndicatorVersionString[];
|
||||||
|
|
||||||
|
// In this header, you should import all the public headers of your framework using statements like #import <ActivityIndicator/PublicHeader.h>
|
||||||
|
|
||||||
|
|
@ -15,55 +15,55 @@ private func convertIndicatorColor(_ color: UIColor) -> UIColor {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
enum ActivityIndicatorType: Equatable {
|
public enum ActivityIndicatorType: Equatable {
|
||||||
case navigationAccent(PresentationTheme)
|
case navigationAccent(PresentationTheme)
|
||||||
case custom(UIColor, CGFloat, CGFloat, Bool)
|
case custom(UIColor, CGFloat, CGFloat, Bool)
|
||||||
|
|
||||||
static func ==(lhs: ActivityIndicatorType, rhs: ActivityIndicatorType) -> Bool {
|
public static func ==(lhs: ActivityIndicatorType, rhs: ActivityIndicatorType) -> Bool {
|
||||||
switch lhs {
|
switch lhs {
|
||||||
case let .navigationAccent(lhsTheme):
|
case let .navigationAccent(lhsTheme):
|
||||||
if case let .navigationAccent(rhsTheme) = rhs, lhsTheme === rhsTheme {
|
if case let .navigationAccent(rhsTheme) = rhs, lhsTheme === rhsTheme {
|
||||||
return true
|
return true
|
||||||
} else {
|
} else {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
case let .custom(lhsColor, lhsDiameter, lhsWidth, lhsForceCustom):
|
case let .custom(lhsColor, lhsDiameter, lhsWidth, lhsForceCustom):
|
||||||
if case let .custom(rhsColor, rhsDiameter, rhsWidth, rhsForceCustom) = rhs, lhsColor.isEqual(rhsColor), lhsDiameter == rhsDiameter, lhsWidth == rhsWidth, lhsForceCustom == rhsForceCustom {
|
if case let .custom(rhsColor, rhsDiameter, rhsWidth, rhsForceCustom) = rhs, lhsColor.isEqual(rhsColor), lhsDiameter == rhsDiameter, lhsWidth == rhsWidth, lhsForceCustom == rhsForceCustom {
|
||||||
return true
|
return true
|
||||||
} else {
|
} else {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
enum ActivityIndicatorSpeed {
|
public enum ActivityIndicatorSpeed {
|
||||||
case regular
|
case regular
|
||||||
case slow
|
case slow
|
||||||
}
|
}
|
||||||
|
|
||||||
final class ActivityIndicator: ASDisplayNode {
|
public final class ActivityIndicator: ASDisplayNode {
|
||||||
var type: ActivityIndicatorType {
|
public var type: ActivityIndicatorType {
|
||||||
didSet {
|
didSet {
|
||||||
switch self.type {
|
switch self.type {
|
||||||
case let .navigationAccent(theme):
|
case let .navigationAccent(theme):
|
||||||
self.indicatorNode.image = PresentationResourcesRootController.navigationIndefiniteActivityImage(theme)
|
self.indicatorNode.image = PresentationResourcesRootController.navigationIndefiniteActivityImage(theme)
|
||||||
case let .custom(color, diameter, lineWidth, _):
|
case let .custom(color, diameter, lineWidth, _):
|
||||||
self.indicatorNode.image = generateIndefiniteActivityIndicatorImage(color: color, diameter: diameter, lineWidth: lineWidth)
|
self.indicatorNode.image = generateIndefiniteActivityIndicatorImage(color: color, diameter: diameter, lineWidth: lineWidth)
|
||||||
}
|
}
|
||||||
|
|
||||||
switch self.type {
|
switch self.type {
|
||||||
case let .navigationAccent(theme):
|
case let .navigationAccent(theme):
|
||||||
self.indicatorView?.color = theme.rootController.navigationBar.controlColor
|
self.indicatorView?.color = theme.rootController.navigationBar.controlColor
|
||||||
case let .custom(color, diameter, lineWidth, _):
|
case let .custom(color, _, _, _):
|
||||||
self.indicatorView?.color = convertIndicatorColor(color)
|
self.indicatorView?.color = convertIndicatorColor(color)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private var currentInHierarchy = false
|
private var currentInHierarchy = false
|
||||||
|
|
||||||
override var isHidden: Bool {
|
override public var isHidden: Bool {
|
||||||
didSet {
|
didSet {
|
||||||
self.updateAnimation()
|
self.updateAnimation()
|
||||||
}
|
}
|
||||||
@ -74,7 +74,7 @@ final class ActivityIndicator: ASDisplayNode {
|
|||||||
private let indicatorNode: ASImageNode
|
private let indicatorNode: ASImageNode
|
||||||
private var indicatorView: UIActivityIndicatorView?
|
private var indicatorView: UIActivityIndicatorView?
|
||||||
|
|
||||||
init(type: ActivityIndicatorType, speed: ActivityIndicatorSpeed = .regular) {
|
public init(type: ActivityIndicatorType, speed: ActivityIndicatorSpeed = .regular) {
|
||||||
self.type = type
|
self.type = type
|
||||||
self.speed = speed
|
self.speed = speed
|
||||||
|
|
||||||
@ -86,28 +86,28 @@ final class ActivityIndicator: ASDisplayNode {
|
|||||||
super.init()
|
super.init()
|
||||||
|
|
||||||
switch type {
|
switch type {
|
||||||
case let .navigationAccent(theme):
|
case let .navigationAccent(theme):
|
||||||
self.indicatorNode.image = PresentationResourcesRootController.navigationIndefiniteActivityImage(theme)
|
self.indicatorNode.image = PresentationResourcesRootController.navigationIndefiniteActivityImage(theme)
|
||||||
case let .custom(color, diameter, lineWidth, forceCustom):
|
case let .custom(color, diameter, lineWidth, forceCustom):
|
||||||
self.indicatorNode.image = generateIndefiniteActivityIndicatorImage(color: color, diameter: diameter, lineWidth: lineWidth)
|
self.indicatorNode.image = generateIndefiniteActivityIndicatorImage(color: color, diameter: diameter, lineWidth: lineWidth)
|
||||||
if forceCustom {
|
if forceCustom {
|
||||||
self.addSubnode(self.indicatorNode)
|
self.addSubnode(self.indicatorNode)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override func didLoad() {
|
override public func didLoad() {
|
||||||
super.didLoad()
|
super.didLoad()
|
||||||
|
|
||||||
let indicatorView = UIActivityIndicatorView(activityIndicatorStyle: .whiteLarge)
|
let indicatorView = UIActivityIndicatorView(style: .whiteLarge)
|
||||||
switch self.type {
|
switch self.type {
|
||||||
case let .navigationAccent(theme):
|
case let .navigationAccent(theme):
|
||||||
indicatorView.color = theme.rootController.navigationBar.controlColor
|
indicatorView.color = theme.rootController.navigationBar.controlColor
|
||||||
case let .custom(color, _, _, forceCustom):
|
case let .custom(color, _, _, forceCustom):
|
||||||
indicatorView.color = convertIndicatorColor(color)
|
indicatorView.color = convertIndicatorColor(color)
|
||||||
if !forceCustom {
|
if !forceCustom {
|
||||||
self.view.addSubview(indicatorView)
|
self.view.addSubview(indicatorView)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
self.indicatorView = indicatorView
|
self.indicatorView = indicatorView
|
||||||
let size = self.bounds.size
|
let size = self.bounds.size
|
||||||
@ -122,17 +122,17 @@ final class ActivityIndicator: ASDisplayNode {
|
|||||||
if self.isAnimating {
|
if self.isAnimating {
|
||||||
self.indicatorView?.startAnimating()
|
self.indicatorView?.startAnimating()
|
||||||
let basicAnimation = CABasicAnimation(keyPath: "transform.rotation.z")
|
let basicAnimation = CABasicAnimation(keyPath: "transform.rotation.z")
|
||||||
basicAnimation.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseInEaseOut)
|
basicAnimation.timingFunction = CAMediaTimingFunction(name: CAMediaTimingFunctionName.easeInEaseOut)
|
||||||
switch self.speed {
|
switch self.speed {
|
||||||
case .regular:
|
case .regular:
|
||||||
basicAnimation.duration = 0.5
|
basicAnimation.duration = 0.5
|
||||||
case .slow:
|
case .slow:
|
||||||
basicAnimation.duration = 0.7
|
basicAnimation.duration = 0.7
|
||||||
}
|
}
|
||||||
basicAnimation.fromValue = NSNumber(value: Float(0.0))
|
basicAnimation.fromValue = NSNumber(value: Float(0.0))
|
||||||
basicAnimation.toValue = NSNumber(value: Float.pi * 2.0)
|
basicAnimation.toValue = NSNumber(value: Float.pi * 2.0)
|
||||||
basicAnimation.repeatCount = Float.infinity
|
basicAnimation.repeatCount = Float.infinity
|
||||||
basicAnimation.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionLinear)
|
basicAnimation.timingFunction = CAMediaTimingFunction(name: CAMediaTimingFunctionName.linear)
|
||||||
basicAnimation.beginTime = 1.0
|
basicAnimation.beginTime = 1.0
|
||||||
|
|
||||||
self.indicatorNode.layer.add(basicAnimation, forKey: "progressRotation")
|
self.indicatorNode.layer.add(basicAnimation, forKey: "progressRotation")
|
||||||
@ -148,30 +148,30 @@ final class ActivityIndicator: ASDisplayNode {
|
|||||||
self.isAnimating = !self.isHidden && self.currentInHierarchy
|
self.isAnimating = !self.isHidden && self.currentInHierarchy
|
||||||
}
|
}
|
||||||
|
|
||||||
override func willEnterHierarchy() {
|
override public func willEnterHierarchy() {
|
||||||
super.willEnterHierarchy()
|
super.willEnterHierarchy()
|
||||||
|
|
||||||
self.currentInHierarchy = true
|
self.currentInHierarchy = true
|
||||||
self.updateAnimation()
|
self.updateAnimation()
|
||||||
}
|
}
|
||||||
|
|
||||||
override func didExitHierarchy() {
|
override public func didExitHierarchy() {
|
||||||
super.didExitHierarchy()
|
super.didExitHierarchy()
|
||||||
|
|
||||||
self.currentInHierarchy = false
|
self.currentInHierarchy = false
|
||||||
self.updateAnimation()
|
self.updateAnimation()
|
||||||
}
|
}
|
||||||
|
|
||||||
override func calculateSizeThatFits(_ constrainedSize: CGSize) -> CGSize {
|
override public func calculateSizeThatFits(_ constrainedSize: CGSize) -> CGSize {
|
||||||
switch self.type {
|
switch self.type {
|
||||||
case .navigationAccent:
|
case .navigationAccent:
|
||||||
return CGSize(width: 22.0, height: 22.0)
|
return CGSize(width: 22.0, height: 22.0)
|
||||||
case let .custom(_, diameter, _, _):
|
case let .custom(_, diameter, _, _):
|
||||||
return CGSize(width: diameter, height: diameter)
|
return CGSize(width: diameter, height: diameter)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override func layout() {
|
override public func layout() {
|
||||||
super.layout()
|
super.layout()
|
||||||
|
|
||||||
let size = self.bounds.size
|
let size = self.bounds.size
|
||||||
@ -183,12 +183,12 @@ final class ActivityIndicator: ASDisplayNode {
|
|||||||
let indicatorSize: CGSize
|
let indicatorSize: CGSize
|
||||||
let shouldScale: Bool
|
let shouldScale: Bool
|
||||||
switch self.type {
|
switch self.type {
|
||||||
case .navigationAccent:
|
case .navigationAccent:
|
||||||
indicatorSize = CGSize(width: 22.0, height: 22.0)
|
indicatorSize = CGSize(width: 22.0, height: 22.0)
|
||||||
shouldScale = false
|
shouldScale = false
|
||||||
case let .custom(_, diameter, _, forceDefault):
|
case let .custom(_, diameter, _, forceDefault):
|
||||||
indicatorSize = CGSize(width: diameter, height: diameter)
|
indicatorSize = CGSize(width: diameter, height: diameter)
|
||||||
shouldScale = !forceDefault
|
shouldScale = !forceDefault
|
||||||
}
|
}
|
||||||
self.indicatorNode.frame = CGRect(origin: CGPoint(x: floor((size.width - indicatorSize.width) / 2.0), y: floor((size.height - indicatorSize.height) / 2.0)), size: indicatorSize)
|
self.indicatorNode.frame = CGRect(origin: CGPoint(x: floor((size.width - indicatorSize.width) / 2.0), y: floor((size.height - indicatorSize.height) / 2.0)), size: indicatorSize)
|
||||||
if shouldScale, let indicatorView = self.indicatorView {
|
if shouldScale, let indicatorView = self.indicatorView {
|
Loading…
x
Reference in New Issue
Block a user