Refactor ActivityIndicator

This commit is contained in:
Peter 2019-08-02 02:13:32 +03:00
parent 9953b26b64
commit fa720e03de
4 changed files with 659 additions and 63 deletions

View File

@ -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 */;
}

View 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>

View 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>

View File

@ -15,55 +15,55 @@ private func convertIndicatorColor(_ color: UIColor) -> UIColor {
}
}
enum ActivityIndicatorType: Equatable {
public enum ActivityIndicatorType: Equatable {
case navigationAccent(PresentationTheme)
case custom(UIColor, CGFloat, CGFloat, Bool)
static func ==(lhs: ActivityIndicatorType, rhs: ActivityIndicatorType) -> Bool {
public static func ==(lhs: ActivityIndicatorType, rhs: ActivityIndicatorType) -> Bool {
switch lhs {
case let .navigationAccent(lhsTheme):
if case let .navigationAccent(rhsTheme) = rhs, lhsTheme === rhsTheme {
return true
} else {
return false
}
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 {
return true
} else {
return false
}
case let .navigationAccent(lhsTheme):
if case let .navigationAccent(rhsTheme) = rhs, lhsTheme === rhsTheme {
return true
} else {
return false
}
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 {
return true
} else {
return false
}
}
}
}
enum ActivityIndicatorSpeed {
public enum ActivityIndicatorSpeed {
case regular
case slow
}
final class ActivityIndicator: ASDisplayNode {
var type: ActivityIndicatorType {
public final class ActivityIndicator: ASDisplayNode {
public var type: ActivityIndicatorType {
didSet {
switch self.type {
case let .navigationAccent(theme):
self.indicatorNode.image = PresentationResourcesRootController.navigationIndefiniteActivityImage(theme)
case let .custom(color, diameter, lineWidth, _):
self.indicatorNode.image = generateIndefiniteActivityIndicatorImage(color: color, diameter: diameter, lineWidth: lineWidth)
case let .navigationAccent(theme):
self.indicatorNode.image = PresentationResourcesRootController.navigationIndefiniteActivityImage(theme)
case let .custom(color, diameter, lineWidth, _):
self.indicatorNode.image = generateIndefiniteActivityIndicatorImage(color: color, diameter: diameter, lineWidth: lineWidth)
}
switch self.type {
case let .navigationAccent(theme):
self.indicatorView?.color = theme.rootController.navigationBar.controlColor
case let .custom(color, diameter, lineWidth, _):
self.indicatorView?.color = convertIndicatorColor(color)
case let .navigationAccent(theme):
self.indicatorView?.color = theme.rootController.navigationBar.controlColor
case let .custom(color, _, _, _):
self.indicatorView?.color = convertIndicatorColor(color)
}
}
}
private var currentInHierarchy = false
override var isHidden: Bool {
override public var isHidden: Bool {
didSet {
self.updateAnimation()
}
@ -74,7 +74,7 @@ final class ActivityIndicator: ASDisplayNode {
private let indicatorNode: ASImageNode
private var indicatorView: UIActivityIndicatorView?
init(type: ActivityIndicatorType, speed: ActivityIndicatorSpeed = .regular) {
public init(type: ActivityIndicatorType, speed: ActivityIndicatorSpeed = .regular) {
self.type = type
self.speed = speed
@ -86,28 +86,28 @@ final class ActivityIndicator: ASDisplayNode {
super.init()
switch type {
case let .navigationAccent(theme):
self.indicatorNode.image = PresentationResourcesRootController.navigationIndefiniteActivityImage(theme)
case let .custom(color, diameter, lineWidth, forceCustom):
self.indicatorNode.image = generateIndefiniteActivityIndicatorImage(color: color, diameter: diameter, lineWidth: lineWidth)
if forceCustom {
self.addSubnode(self.indicatorNode)
}
case let .navigationAccent(theme):
self.indicatorNode.image = PresentationResourcesRootController.navigationIndefiniteActivityImage(theme)
case let .custom(color, diameter, lineWidth, forceCustom):
self.indicatorNode.image = generateIndefiniteActivityIndicatorImage(color: color, diameter: diameter, lineWidth: lineWidth)
if forceCustom {
self.addSubnode(self.indicatorNode)
}
}
}
override func didLoad() {
override public func didLoad() {
super.didLoad()
let indicatorView = UIActivityIndicatorView(activityIndicatorStyle: .whiteLarge)
let indicatorView = UIActivityIndicatorView(style: .whiteLarge)
switch self.type {
case let .navigationAccent(theme):
indicatorView.color = theme.rootController.navigationBar.controlColor
case let .custom(color, _, _, forceCustom):
indicatorView.color = convertIndicatorColor(color)
if !forceCustom {
self.view.addSubview(indicatorView)
}
case let .navigationAccent(theme):
indicatorView.color = theme.rootController.navigationBar.controlColor
case let .custom(color, _, _, forceCustom):
indicatorView.color = convertIndicatorColor(color)
if !forceCustom {
self.view.addSubview(indicatorView)
}
}
self.indicatorView = indicatorView
let size = self.bounds.size
@ -122,17 +122,17 @@ final class ActivityIndicator: ASDisplayNode {
if self.isAnimating {
self.indicatorView?.startAnimating()
let basicAnimation = CABasicAnimation(keyPath: "transform.rotation.z")
basicAnimation.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseInEaseOut)
basicAnimation.timingFunction = CAMediaTimingFunction(name: CAMediaTimingFunctionName.easeInEaseOut)
switch self.speed {
case .regular:
basicAnimation.duration = 0.5
case .slow:
basicAnimation.duration = 0.7
case .regular:
basicAnimation.duration = 0.5
case .slow:
basicAnimation.duration = 0.7
}
basicAnimation.fromValue = NSNumber(value: Float(0.0))
basicAnimation.toValue = NSNumber(value: Float.pi * 2.0)
basicAnimation.repeatCount = Float.infinity
basicAnimation.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionLinear)
basicAnimation.timingFunction = CAMediaTimingFunction(name: CAMediaTimingFunctionName.linear)
basicAnimation.beginTime = 1.0
self.indicatorNode.layer.add(basicAnimation, forKey: "progressRotation")
@ -148,30 +148,30 @@ final class ActivityIndicator: ASDisplayNode {
self.isAnimating = !self.isHidden && self.currentInHierarchy
}
override func willEnterHierarchy() {
override public func willEnterHierarchy() {
super.willEnterHierarchy()
self.currentInHierarchy = true
self.updateAnimation()
}
override func didExitHierarchy() {
override public func didExitHierarchy() {
super.didExitHierarchy()
self.currentInHierarchy = false
self.updateAnimation()
}
override func calculateSizeThatFits(_ constrainedSize: CGSize) -> CGSize {
override public func calculateSizeThatFits(_ constrainedSize: CGSize) -> CGSize {
switch self.type {
case .navigationAccent:
return CGSize(width: 22.0, height: 22.0)
case let .custom(_, diameter, _, _):
return CGSize(width: diameter, height: diameter)
case .navigationAccent:
return CGSize(width: 22.0, height: 22.0)
case let .custom(_, diameter, _, _):
return CGSize(width: diameter, height: diameter)
}
}
override func layout() {
override public func layout() {
super.layout()
let size = self.bounds.size
@ -183,12 +183,12 @@ final class ActivityIndicator: ASDisplayNode {
let indicatorSize: CGSize
let shouldScale: Bool
switch self.type {
case .navigationAccent:
indicatorSize = CGSize(width: 22.0, height: 22.0)
shouldScale = false
case let .custom(_, diameter, _, forceDefault):
indicatorSize = CGSize(width: diameter, height: diameter)
shouldScale = !forceDefault
case .navigationAccent:
indicatorSize = CGSize(width: 22.0, height: 22.0)
shouldScale = false
case let .custom(_, diameter, _, forceDefault):
indicatorSize = CGSize(width: diameter, height: diameter)
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)
if shouldScale, let indicatorView = self.indicatorView {