├── .gitignore ├── Cartfile ├── Cartfile.resolved ├── Crashlytics.framework ├── Crashlytics ├── Headers │ ├── Answers.h │ ├── CLSLogging.h │ ├── CLSReport.h │ ├── CLSStackFrame.h │ └── Crashlytics.h ├── Info.plist ├── Modules │ └── module.modulemap ├── run └── submit ├── Fabric.framework ├── Fabric ├── Headers │ ├── FABAttributes.h │ └── Fabric.h ├── Info.plist ├── Modules │ └── module.modulemap └── run ├── LICENSE ├── README.md ├── beauties ├── AboutViewController.swift ├── AppDelegate.swift ├── Base.lproj │ ├── LaunchScreen.xib │ └── Main.storyboard ├── BeautyCollectionViewCell.swift ├── BeautyCollectionViewFooter.swift ├── BeautyImageEntity.swift ├── BlurView.swift ├── HistoryViewController.swift ├── Images.xcassets │ └── AppIcon.appiconset │ │ ├── Contents.json │ │ ├── Icon-29@2x.png │ │ ├── Icon-29@3x.png │ │ ├── Icon-40@2x.png │ │ ├── Icon-40@3x.png │ │ ├── Icon-60@2x.png │ │ └── Icon-60@3x.png ├── Info.plist ├── MoreViewController.swift ├── TodayViewController.swift ├── Utils.swift ├── history@2x.png ├── logo.png ├── setting@2x.png └── today@2x.png ├── beautiesTests ├── Info.plist └── beautiesTests.swift ├── beauty.xcodeproj ├── project.pbxproj └── project.xcworkspace │ └── contents.xcworkspacedata └── demos ├── alipay.png ├── demo.png └── logo.png /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | # 3 | build/ 4 | *.pbxuser 5 | !default.pbxuser 6 | *.mode1v3 7 | !default.mode1v3 8 | *.mode2v3 9 | !default.mode2v3 10 | *.perspectivev3 11 | !default.perspectivev3 12 | xcuserdata 13 | *.xccheckout 14 | *.moved-aside 15 | DerivedData 16 | *.hmap 17 | *.ipa 18 | *.xcuserstate 19 | 20 | # CocoaPods 21 | # 22 | # We recommend against adding the Pods directory to your .gitignore. However 23 | # you should judge for yourself, the pros and cons are mentioned at: 24 | # http://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control 25 | # 26 | # Pods/ 27 | 28 | # Carthage 29 | # 30 | # Add this line if you want to avoid checking in source code from Carthage dependencies. 31 | Carthage/Checkouts 32 | Carthage/Build 33 | -------------------------------------------------------------------------------- /Cartfile: -------------------------------------------------------------------------------- 1 | github "onevcat/Kingfisher" >= 1.6 2 | github "Alamofire/Alamofire" ~> 2.0 3 | -------------------------------------------------------------------------------- /Cartfile.resolved: -------------------------------------------------------------------------------- 1 | github "Alamofire/Alamofire" "2.0.2" 2 | github "onevcat/Kingfisher" "1.6.0" 3 | -------------------------------------------------------------------------------- /Crashlytics.framework/Crashlytics: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liushuaikobe/beauties/a6564f2a1e16f478b8b2f0c6a51c6348f621df18/Crashlytics.framework/Crashlytics -------------------------------------------------------------------------------- /Crashlytics.framework/Headers/Answers.h: -------------------------------------------------------------------------------- 1 | // 2 | // Answers.h 3 | // Crashlytics 4 | // 5 | // Copyright (c) 2015 Crashlytics, Inc. All rights reserved. 6 | // 7 | 8 | #import 9 | #import 10 | 11 | FAB_START_NONNULL 12 | 13 | @interface Answers : NSObject 14 | 15 | /** 16 | * Log a Sign Up event to see users signing up for your app in real-time, understand how 17 | * many users are signing up with different methods and their success rate signing up. 18 | * 19 | * @param signUpMethodOrNil The method by which a user logged in, e.g. Twitter or Digits. 20 | * @param signUpSucceededOrNil The ultimate success or failure of the login 21 | * @param customAttributesOrNil A dictionary of custom attributes to associate with this purchase. 22 | */ 23 | + (void)logSignUpWithMethod:(NSString * FAB_NULLABLE)signUpMethodOrNil 24 | success:(NSNumber * FAB_NULLABLE)signUpSucceededOrNil 25 | customAttributes:(NSDictionary * FAB_NULLABLE)customAttributesOrNil; 26 | 27 | /** 28 | * Log an Log In event to see users logging into your app in real-time, understand how many 29 | * users are logging in with different methods and their success rate logging into your app. 30 | * 31 | * @param loginMethodOrNil The method by which a user logged in, e.g. email, Twitter or Digits. 32 | * @param loginSucceededOrNil The ultimate success or failure of the login 33 | * @param customAttributesOrNil A dictionary of custom attributes to associate with this purchase. 34 | */ 35 | + (void)logLoginWithMethod:(NSString * FAB_NULLABLE)loginMethodOrNil 36 | success:(NSNumber * FAB_NULLABLE)loginSucceededOrNil 37 | customAttributes:(NSDictionary * FAB_NULLABLE)customAttributesOrNil; 38 | 39 | /** 40 | * Log a Share event to see users sharing from your app in real-time, letting you 41 | * understand what content they're sharing from the type or genre down to the specific id. 42 | * 43 | * @param shareMethodOrNil The method by which a user shared, e.g. email, Twitter, SMS. 44 | * @param contentNameOrNil The human readable name for this piece of content. 45 | * @param contentTypeOrNil The type of content shared. 46 | * @param contentIdOrNil The unique identifier for this piece of content. Useful for finding the top shared item. 47 | * @param customAttributesOrNil A dictionary of custom attributes to associate with this event. 48 | */ 49 | + (void)logShareWithMethod:(NSString * FAB_NULLABLE)shareMethodOrNil 50 | contentName:(NSString * FAB_NULLABLE)contentNameOrNil 51 | contentType:(NSString * FAB_NULLABLE)contentTypeOrNil 52 | contentId:(NSString * FAB_NULLABLE)contentIdOrNil 53 | customAttributes:(NSDictionary * FAB_NULLABLE)customAttributesOrNil; 54 | 55 | /** 56 | * Log an Invite Event to track how users are inviting other users into 57 | * your application. 58 | * 59 | * @param inviteMethodOrNil The method of invitation, e.g. GameCenter, Twitter, email. 60 | * @param customAttributesOrNil A dictionary of custom attributes to associate with this purchase. 61 | */ 62 | + (void)logInviteWithMethod:(NSString * FAB_NULLABLE)inviteMethodOrNil 63 | customAttributes:(NSDictionary * FAB_NULLABLE)customAttributesOrNil; 64 | 65 | /** 66 | * Log a Purchase event to see your revenue in real-time, understand how many users are making purchases, see which 67 | * items are most popular, and track plenty of other important purchase-related metrics. 68 | * 69 | * @param itemPriceOrNil The purchased item's price. 70 | * @param currencyOrNil The ISO4217 currency code. Example: USD 71 | * @param purchaseSucceededOrNil Was the purchase succesful or unsuccesful 72 | * @param itemNameOrNil The human-readable form of the item's name. Example: 73 | * @param itemIdOrNil The machine-readable, unique item identifier Example: SKU 74 | * @param itemTypeOrNil The type, or genre of the item. Example: Song 75 | * @param customAttributesOrNil A dictionary of custom attributes to associate with this purchase. 76 | */ 77 | + (void)logPurchaseWithPrice:(NSDecimalNumber * FAB_NULLABLE)itemPriceOrNil 78 | currency:(NSString * FAB_NULLABLE)currencyOrNil 79 | success:(NSNumber * FAB_NULLABLE)purchaseSucceededOrNil 80 | itemName:(NSString * FAB_NULLABLE)itemNameOrNil 81 | itemType:(NSString * FAB_NULLABLE)itemTypeOrNil 82 | itemId:(NSString * FAB_NULLABLE)itemIdOrNil 83 | customAttributes:(NSDictionary * FAB_NULLABLE)customAttributesOrNil; 84 | 85 | /** 86 | * Log a Level Start Event to track where users are in your game. 87 | * 88 | * @param levelNameOrNil The level name 89 | * @param customAttributesOrNil A dictionary of custom attributes to associate with this level start event. 90 | */ 91 | + (void)logLevelStart:(NSString * FAB_NULLABLE)levelNameOrNil 92 | customAttributes:(NSDictionary * FAB_NULLABLE)customAttributesOrNil; 93 | 94 | /** 95 | * Log a Level End event to track how users are completing levels in your game. 96 | * 97 | * @param levelNameOrNil The name of the level completed, E.G. "1" or "Training" 98 | * @param scoreOrNil The score the user completed the level with. 99 | * @param levelCompletedSuccesfullyOrNil A boolean representing whether or not the level was completed succesfully. 100 | * @param customAttributesOrNil A dictionary of custom attributes to associate with this purchase. 101 | */ 102 | + (void)logLevelEnd:(NSString * FAB_NULLABLE)levelNameOrNil 103 | score:(NSNumber * FAB_NULLABLE)scoreOrNil 104 | success:(NSNumber * FAB_NULLABLE)levelCompletedSuccesfullyOrNil 105 | customAttributes:(NSDictionary * FAB_NULLABLE)customAttributesOrNil; 106 | 107 | /** 108 | * Log an Add to Cart event to see users adding items to a shopping cart in real-time, understand how 109 | * many users start the purchase flow, see which items are most popular, and track plenty of other important 110 | * purchase-related metrics. 111 | * 112 | * @param itemPriceOrNil The purchased item's price. 113 | * @param currencyOrNil The ISO4217 currency code. Example: USD 114 | * @param itemNameOrNil The human-readable form of the item's name. Example: 115 | * @param itemTypeOrNil The type, or genre of the item. Example: Song 116 | * @param itemIdOrNil The machine-readable, unique item identifier Example: SKU 117 | * @param customAttributesOrNil A dictionary of custom attributes to associate with this purchase. 118 | */ 119 | + (void)logAddToCartWithPrice:(NSDecimalNumber * FAB_NULLABLE)itemPriceOrNil 120 | currency:(NSString * FAB_NULLABLE)currencyOrNil 121 | itemName:(NSString * FAB_NULLABLE)itemNameOrNil 122 | itemType:(NSString * FAB_NULLABLE)itemTypeOrNil 123 | itemId:(NSString * FAB_NULLABLE)itemIdOrNil 124 | customAttributes:(NSDictionary * FAB_NULLABLE)customAttributesOrNil; 125 | 126 | /** 127 | * Log a Start Checkout event to see users moving through the purchase funnel in real-time, understand how many 128 | * users are doing this and how much they're spending per checkout, and see how it related to other important 129 | * purchase-related metrics. 130 | * 131 | * @param totalPriceOrNil The total price of the cart. 132 | * @param currencyOrNil The ISO4217 currency code. Example: USD 133 | * @param itemCountOrNil The number of items in the cart. 134 | * @param customAttributesOrNil A dictionary of custom attributes to associate with this purchase. 135 | */ 136 | + (void)logStartCheckoutWithPrice:(NSDecimalNumber * FAB_NULLABLE)totalPriceOrNil 137 | currency:(NSString * FAB_NULLABLE)currencyOrNil 138 | itemCount:(NSNumber * FAB_NULLABLE)itemCountOrNil 139 | customAttributes:(NSDictionary * FAB_NULLABLE)customAttributesOrNil; 140 | 141 | /** 142 | * Log a Rating event to see users rating content within your app in real-time and understand what 143 | * content is most engaging, from the type or genre down to the specific id. 144 | * 145 | * @param ratingOrNil The integer rating given by the user. 146 | * @param contentNameOrNil The human readable name for this piece of content. 147 | * @param contentTypeOrNil The type of content shared. 148 | * @param contentIdOrNil The unique identifier for this piece of content. Useful for finding the top shared item. 149 | * @param customAttributesOrNil A dictionary of custom attributes to associate with this event. 150 | */ 151 | + (void)logRating:(NSNumber * FAB_NULLABLE)ratingOrNil 152 | contentName:(NSString * FAB_NULLABLE)contentNameOrNil 153 | contentType:(NSString * FAB_NULLABLE)contentTypeOrNil 154 | contentId:(NSString * FAB_NULLABLE)contentIdOrNil 155 | customAttributes:(NSDictionary * FAB_NULLABLE)customAttributesOrNil; 156 | 157 | /** 158 | * Log a Content View event to see users viewing content within your app in real-time and 159 | * understand what content is most engaging, from the type or genre down to the specific id. 160 | * 161 | * @param contentNameOrNil The human readable name for this piece of content. 162 | * @param contentTypeOrNil The type of content shared. 163 | * @param contentIdOrNil The unique identifier for this piece of content. Useful for finding the top shared item. 164 | * @param customAttributesOrNil A dictionary of custom attributes to associate with this event. 165 | */ 166 | + (void)logContentViewWithName:(NSString * FAB_NULLABLE)contentNameOrNil 167 | contentType:(NSString * FAB_NULLABLE)contentTypeOrNil 168 | contentId:(NSString * FAB_NULLABLE)contentIdOrNil 169 | customAttributes:(NSDictionary * FAB_NULLABLE)customAttributesOrNil; 170 | 171 | /** 172 | * Log a Search event allows you to see users searching within your app in real-time and understand 173 | * exactly what they're searching for. 174 | * 175 | * @param queryOrNil The user's query. 176 | * @param customAttributesOrNil A dictionary of custom attributes to associate with this event. 177 | */ 178 | + (void)logSearchWithQuery:(NSString * FAB_NULLABLE)queryOrNil 179 | customAttributes:(NSDictionary * FAB_NULLABLE)customAttributesOrNil; 180 | 181 | /** 182 | * Log a Custom Event to see user actions that are uniquely important for your app in real-time, to see how often 183 | * they're performing these actions with breakdowns by different categories you add. Use a human-readable name for 184 | * the name of the event, since this is how the event will appear in Answers. 185 | * 186 | * @param eventName The human-readable name for the event. 187 | * @param customAttributesOrNil A dictionary of custom attributes to associate with this purchase. Attribute keys 188 | * must be NSString and and values must be NSNumber or NSString. 189 | * @discussion How we treat NSNumbers: 190 | * We will provide information about the distribution of values over time. 191 | * 192 | * How we treat NSStrings: 193 | * NSStrings are used as categorical data, allowing comparison across different category values. 194 | * Strings are limited to a maximum length of 100 characters, attributes over this length will be 195 | * truncated. 196 | * 197 | * When tracking the Tweet views to better understand user engagement, sending the tweet's length 198 | * and the type of media present in the tweet allows you to track how tweet length and the type of media influence 199 | * engagement. 200 | */ 201 | + (void)logCustomEventWithName:(NSString *)eventName 202 | customAttributes:(NSDictionary * FAB_NULLABLE)customAttributesOrNil; 203 | 204 | @end 205 | 206 | FAB_END_NONNULL 207 | -------------------------------------------------------------------------------- /Crashlytics.framework/Headers/CLSLogging.h: -------------------------------------------------------------------------------- 1 | // 2 | // CLSLogging.h 3 | // Crashlytics 4 | // 5 | // Copyright (c) 2015 Crashlytics, Inc. All rights reserved. 6 | // 7 | #ifdef __OBJC__ 8 | #import 9 | #import 10 | 11 | FAB_START_NONNULL 12 | #endif 13 | 14 | 15 | 16 | /** 17 | * 18 | * The CLS_LOG macro provides as easy way to gather more information in your log messages that are 19 | * sent with your crash data. CLS_LOG prepends your custom log message with the function name and 20 | * line number where the macro was used. If your app was built with the DEBUG preprocessor macro 21 | * defined CLS_LOG uses the CLSNSLog function which forwards your log message to NSLog and CLSLog. 22 | * If the DEBUG preprocessor macro is not defined CLS_LOG uses CLSLog only. 23 | * 24 | * Example output: 25 | * -[AppDelegate login:] line 134 $ login start 26 | * 27 | * If you would like to change this macro, create a new header file, unset our define and then define 28 | * your own version. Make sure this new header file is imported after the Crashlytics header file. 29 | * 30 | * #undef CLS_LOG 31 | * #define CLS_LOG(__FORMAT__, ...) CLSNSLog... 32 | * 33 | **/ 34 | #ifdef __OBJC__ 35 | #ifdef DEBUG 36 | #define CLS_LOG(__FORMAT__, ...) CLSNSLog((@"%s line %d $ " __FORMAT__), __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__) 37 | #else 38 | #define CLS_LOG(__FORMAT__, ...) CLSLog((@"%s line %d $ " __FORMAT__), __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__) 39 | #endif 40 | #endif 41 | 42 | /** 43 | * 44 | * Add logging that will be sent with your crash data. This logging will not show up in the system.log 45 | * and will only be visible in your Crashlytics dashboard. 46 | * 47 | **/ 48 | 49 | #ifdef __OBJC__ 50 | OBJC_EXTERN void CLSLog(NSString *format, ...) NS_FORMAT_FUNCTION(1,2); 51 | OBJC_EXTERN void CLSLogv(NSString *format, va_list ap) NS_FORMAT_FUNCTION(1,0); 52 | 53 | /** 54 | * 55 | * Add logging that will be sent with your crash data. This logging will show up in the system.log 56 | * and your Crashlytics dashboard. It is not recommended for Release builds. 57 | * 58 | **/ 59 | OBJC_EXTERN void CLSNSLog(NSString *format, ...) NS_FORMAT_FUNCTION(1,2); 60 | OBJC_EXTERN void CLSNSLogv(NSString *format, va_list ap) NS_FORMAT_FUNCTION(1,0); 61 | 62 | 63 | FAB_END_NONNULL 64 | #endif 65 | -------------------------------------------------------------------------------- /Crashlytics.framework/Headers/CLSReport.h: -------------------------------------------------------------------------------- 1 | // 2 | // CLSReport.h 3 | // Crashlytics 4 | // 5 | // Copyright (c) 2015 Crashlytics, Inc. All rights reserved. 6 | // 7 | 8 | #import 9 | #import 10 | 11 | FAB_START_NONNULL 12 | 13 | /** 14 | * The CLSCrashReport protocol is deprecated. See the CLSReport class and the CrashyticsDelegate changes for details. 15 | **/ 16 | @protocol CLSCrashReport 17 | 18 | @property (nonatomic, copy, readonly) NSString *identifier; 19 | @property (nonatomic, copy, readonly) NSDictionary *customKeys; 20 | @property (nonatomic, copy, readonly) NSString *bundleVersion; 21 | @property (nonatomic, copy, readonly) NSString *bundleShortVersionString; 22 | @property (nonatomic, copy, readonly) NSDate *crashedOnDate; 23 | @property (nonatomic, copy, readonly) NSString *OSVersion; 24 | @property (nonatomic, copy, readonly) NSString *OSBuildVersion; 25 | 26 | @end 27 | 28 | /** 29 | * The CLSReport exposes an interface to the phsyical report that Crashlytics has created. You can 30 | * use this class to get information about the event, and can also set some values after the 31 | * event has occured. 32 | **/ 33 | @interface CLSReport : NSObject 34 | 35 | - (instancetype)init NS_UNAVAILABLE; 36 | 37 | /** 38 | * Returns the session identifier for the report. 39 | **/ 40 | @property (nonatomic, copy, readonly) NSString *identifier; 41 | 42 | /** 43 | * Returns the custom key value data for the report. 44 | **/ 45 | @property (nonatomic, copy, readonly) NSDictionary *customKeys; 46 | 47 | /** 48 | * Returns the CFBundleVersion of the application that generated the report. 49 | **/ 50 | @property (nonatomic, copy, readonly) NSString *bundleVersion; 51 | 52 | /** 53 | * Returns the CFBundleShortVersionString of the application that generated the report. 54 | **/ 55 | @property (nonatomic, copy, readonly) NSString *bundleShortVersionString; 56 | 57 | /** 58 | * Returns the date that the report was created. 59 | **/ 60 | @property (nonatomic, copy, readonly) NSDate *dateCreated; 61 | 62 | /** 63 | * Returns the os version that the application crashed on. 64 | **/ 65 | @property (nonatomic, copy, readonly) NSString *OSVersion; 66 | 67 | /** 68 | * Returns the os build version that the application crashed on. 69 | **/ 70 | @property (nonatomic, copy, readonly) NSString *OSBuildVersion; 71 | 72 | /** 73 | * Returns YES if the report contains any crash information. If the report 74 | * contains only NSErrors, this will return NO. 75 | **/ 76 | @property (nonatomic, assign, readonly) BOOL isCrash; 77 | 78 | /** 79 | * You can use this method to set, after the event, additional custom keys. The rules 80 | * and semantics for this method are the same as those documented in Crashlytics.h. Be aware 81 | * that the maximum size and count of custom keys is still enforced, and you can overwrite keys 82 | * and/or cause excess keys to be deleted by using this method. 83 | **/ 84 | - (void)setObjectValue:(id FAB_NULLABLE)value forKey:(NSString *)key; 85 | 86 | /** 87 | * Record an application-specific user identifier. See Crashlytics.h for details. 88 | **/ 89 | @property (nonatomic, copy) NSString * FAB_NULLABLE userIdentifier; 90 | 91 | /** 92 | * Record a user name. See Crashlytics.h for details. 93 | **/ 94 | @property (nonatomic, copy) NSString * FAB_NULLABLE userName; 95 | 96 | /** 97 | * Record a user email. See Crashlytics.h for details. 98 | **/ 99 | @property (nonatomic, copy) NSString * FAB_NULLABLE userEmail; 100 | 101 | @end 102 | 103 | FAB_END_NONNULL 104 | -------------------------------------------------------------------------------- /Crashlytics.framework/Headers/CLSStackFrame.h: -------------------------------------------------------------------------------- 1 | // 2 | // CLSStackFrame.h 3 | // Crashlytics 4 | // 5 | // Copyright 2015 Crashlytics, Inc. All rights reserved. 6 | // 7 | 8 | #import 9 | #import 10 | 11 | FAB_START_NONNULL 12 | 13 | /** 14 | * 15 | * This class is used in conjunction with -[Crashlytics recordCustomExceptionName:reason:frameArray:] to 16 | * record information about non-ObjC/C++ exceptions. All information included here will be displayed 17 | * in the Crashlytics UI, and can influence crash grouping. Be particularly careful with the use of the 18 | * address property. If set, Crashlytics will attempt symbolication and could overwrite other properities 19 | * in the process. 20 | * 21 | **/ 22 | @interface CLSStackFrame : NSObject 23 | 24 | + (instancetype)stackFrame; 25 | + (instancetype)stackFrameWithAddress:(NSUInteger)address; 26 | + (instancetype)stackFrameWithSymbol:(NSString *)symbol; 27 | 28 | @property (nonatomic, copy) NSString * FAB_NULLABLE symbol; 29 | @property (nonatomic, copy) NSString * FAB_NULLABLE library; 30 | @property (nonatomic, copy) NSString * FAB_NULLABLE fileName; 31 | @property (nonatomic, assign) uint32_t lineNumber; 32 | @property (nonatomic, assign) uint64_t offset; 33 | @property (nonatomic, assign) uint64_t address; 34 | 35 | @end 36 | 37 | FAB_END_NONNULL 38 | -------------------------------------------------------------------------------- /Crashlytics.framework/Headers/Crashlytics.h: -------------------------------------------------------------------------------- 1 | // 2 | // Crashlytics.h 3 | // Crashlytics 4 | // 5 | // Copyright (c) 2015 Crashlytics, Inc. All rights reserved. 6 | // 7 | 8 | #import 9 | 10 | #import 11 | #import "CLSLogging.h" 12 | #import "CLSReport.h" 13 | #import "CLSStackFrame.h" 14 | #import "Answers.h" 15 | 16 | #define CLS_DEPRECATED(x) __attribute__ ((deprecated(x))) 17 | 18 | FAB_START_NONNULL 19 | 20 | @protocol CrashlyticsDelegate; 21 | 22 | /** 23 | * Crashlytics. Handles configuration and initialization of Crashlytics. 24 | */ 25 | @interface Crashlytics : NSObject 26 | 27 | @property (nonatomic, readonly, copy) NSString *apiKey; 28 | @property (nonatomic, readonly, copy) NSString *version; 29 | @property (nonatomic, assign) BOOL debugMode; 30 | 31 | /** 32 | * 33 | * The delegate can be used to influence decisions on reporting and behavior, as well as reacting 34 | * to previous crashes. 35 | * 36 | * Make certain that the delegate is setup before starting Crashlytics with startWithAPIKey:... or 37 | * via +[Fabric with:...]. Failure to do will result in missing any delegate callbacks that occur 38 | * synchronously during start. 39 | * 40 | **/ 41 | @property (nonatomic, assign) id FAB_NULLABLE delegate; 42 | 43 | /** 44 | * The recommended way to install Crashlytics into your application is to place a call to +startWithAPIKey: 45 | * in your -application:didFinishLaunchingWithOptions: or -applicationDidFinishLaunching: 46 | * method. 47 | * 48 | * Note: Starting with 3.0, the submission process has been significantly improved. The delay parameter 49 | * is no longer required to throttle submissions on launch, performance will be great without it. 50 | * 51 | * @param apiKey The Crashlytics API Key for this app 52 | * 53 | * @return The singleton Crashlytics instance 54 | */ 55 | + (Crashlytics *)startWithAPIKey:(NSString *)apiKey; 56 | + (Crashlytics *)startWithAPIKey:(NSString *)apiKey afterDelay:(NSTimeInterval)delay CLS_DEPRECATED("Crashlytics no longer needs or uses the delay parameter. Please use +startWithAPIKey: instead."); 57 | 58 | /** 59 | * If you need the functionality provided by the CrashlyticsDelegate protocol, you can use 60 | * these convenience methods to activate the framework and set the delegate in one call. 61 | * 62 | * @param apiKey The Crashlytics API Key for this app 63 | * @param delegate A delegate object which conforms to CrashlyticsDelegate. 64 | * 65 | * @return The singleton Crashlytics instance 66 | */ 67 | + (Crashlytics *)startWithAPIKey:(NSString *)apiKey delegate:(id FAB_NULLABLE)delegate; 68 | + (Crashlytics *)startWithAPIKey:(NSString *)apiKey delegate:(id FAB_NULLABLE)delegate afterDelay:(NSTimeInterval)delay CLS_DEPRECATED("Crashlytics no longer needs or uses the delay parameter. Please use +startWithAPIKey:delegate: instead."); 69 | 70 | /** 71 | * Access the singleton Crashlytics instance. 72 | * 73 | * @return The singleton Crashlytics instance 74 | */ 75 | + (Crashlytics *)sharedInstance; 76 | 77 | /** 78 | * The easiest way to cause a crash - great for testing! 79 | */ 80 | - (void)crash; 81 | 82 | /** 83 | * The easiest way to cause a crash with an exception - great for testing. 84 | */ 85 | - (void)throwException; 86 | 87 | /** 88 | * Specify a user identifier which will be visible in the Crashlytics UI. 89 | * 90 | * Many of our customers have requested the ability to tie crashes to specific end-users of their 91 | * application in order to facilitate responses to support requests or permit the ability to reach 92 | * out for more information. We allow you to specify up to three separate values for display within 93 | * the Crashlytics UI - but please be mindful of your end-user's privacy. 94 | * 95 | * We recommend specifying a user identifier - an arbitrary string that ties an end-user to a record 96 | * in your system. This could be a database id, hash, or other value that is meaningless to a 97 | * third-party observer but can be indexed and queried by you. 98 | * 99 | * Optionally, you may also specify the end-user's name or username, as well as email address if you 100 | * do not have a system that works well with obscured identifiers. 101 | * 102 | * Pursuant to our EULA, this data is transferred securely throughout our system and we will not 103 | * disseminate end-user data unless required to by law. That said, if you choose to provide end-user 104 | * contact information, we strongly recommend that you disclose this in your application's privacy 105 | * policy. Data privacy is of our utmost concern. 106 | * 107 | * @param identifier An arbitrary user identifier string which ties an end-user to a record in your system. 108 | */ 109 | - (void)setUserIdentifier:(NSString * FAB_NULLABLE)identifier; 110 | 111 | /** 112 | * Specify a user name which will be visible in the Crashlytics UI. 113 | * Please be mindful of your end-user's privacy and see if setUserIdentifier: can fulfil your needs. 114 | * @see setUserIdentifier: 115 | * 116 | * @param name An end user's name. 117 | */ 118 | - (void)setUserName:(NSString * FAB_NULLABLE)name; 119 | 120 | /** 121 | * Specify a user email which will be visible in the Crashlytics UI. 122 | * Please be mindful of your end-user's privacy and see if setUserIdentifier: can fulfil your needs. 123 | * 124 | * @see setUserIdentifier: 125 | * 126 | * @param email An end user's email address. 127 | */ 128 | - (void)setUserEmail:(NSString * FAB_NULLABLE)email; 129 | 130 | + (void)setUserIdentifier:(NSString * FAB_NULLABLE)identifier CLS_DEPRECATED("Please access this method via +sharedInstance"); 131 | + (void)setUserName:(NSString * FAB_NULLABLE)name CLS_DEPRECATED("Please access this method via +sharedInstance"); 132 | + (void)setUserEmail:(NSString * FAB_NULLABLE)email CLS_DEPRECATED("Please access this method via +sharedInstance"); 133 | 134 | /** 135 | * Set a value for a for a key to be associated with your crash data which will be visible in the Crashlytics UI. 136 | * When setting an object value, the object is converted to a string. This is typically done by calling 137 | * -[NSObject description]. 138 | * 139 | * @param value The object to be associated with the key 140 | * @param key The key with which to associate the value 141 | */ 142 | - (void)setObjectValue:(id FAB_NULLABLE)value forKey:(NSString *)key; 143 | 144 | /** 145 | * Set an int value for a key to be associated with your crash data which will be visible in the Crashlytics UI. 146 | * 147 | * @param value The integer value to be set 148 | * @param key The key with which to associate the value 149 | */ 150 | - (void)setIntValue:(int)value forKey:(NSString *)key; 151 | 152 | /** 153 | * Set an BOOL value for a key to be associated with your crash data which will be visible in the Crashlytics UI. 154 | * 155 | * @param value The BOOL value to be set 156 | * @param key The key with which to associate the value 157 | */ 158 | - (void)setBoolValue:(BOOL)value forKey:(NSString *)key; 159 | 160 | /** 161 | * Set an float value for a key to be associated with your crash data which will be visible in the Crashlytics UI. 162 | * 163 | * @param value The float value to be set 164 | * @param key The key with which to associate the value 165 | */ 166 | - (void)setFloatValue:(float)value forKey:(NSString *)key; 167 | 168 | + (void)setObjectValue:(id FAB_NULLABLE)value forKey:(NSString *)key CLS_DEPRECATED("Please access this method via +sharedInstance"); 169 | + (void)setIntValue:(int)value forKey:(NSString *)key CLS_DEPRECATED("Please access this method via +sharedInstance"); 170 | + (void)setBoolValue:(BOOL)value forKey:(NSString *)key CLS_DEPRECATED("Please access this method via +sharedInstance"); 171 | + (void)setFloatValue:(float)value forKey:(NSString *)key CLS_DEPRECATED("Please access this method via +sharedInstance"); 172 | 173 | /** 174 | * This method can be used to record a single exception structure in a report. This is particularly useful 175 | * when your code interacts with non-native languages like Lua, C#, or Javascript. This call can be 176 | * expensive and should only be used shortly before process termination. This API is not intended be to used 177 | * to log NSException objects. All safely-reportable NSExceptions are automatically captured by 178 | * Crashlytics. 179 | * 180 | * @param name The name of the custom exception 181 | * @param reason The reason this exception occured 182 | * @param frameArray An array of CLSStackFrame objects 183 | */ 184 | - (void)recordCustomExceptionName:(NSString *)name reason:(NSString * FAB_NULLABLE)reason frameArray:(NSArray *)frameArray; 185 | 186 | 187 | 188 | 189 | - (void)logEvent:(NSString *)eventName CLS_DEPRECATED("Please refer to Answers +logCustomEventWithName:"); 190 | - (void)logEvent:(NSString *)eventName attributes:(NSDictionary * FAB_NULLABLE) attributes CLS_DEPRECATED("Please refer to Answers +logCustomEventWithName:"); 191 | + (void)logEvent:(NSString *)eventName CLS_DEPRECATED("Please refer to Answers +logCustomEventWithName:"); 192 | + (void)logEvent:(NSString *)eventName attributes:(NSDictionary * FAB_NULLABLE) attributes CLS_DEPRECATED("Please refer to Answers +logCustomEventWithName:"); 193 | @end 194 | 195 | /** 196 | * 197 | * The CrashlyticsDelegate protocol provides a mechanism for your application to take 198 | * action on events that occur in the Crashlytics crash reporting system. You can make 199 | * use of these calls by assigning an object to the Crashlytics' delegate property directly, 200 | * or through the convenience +startWithAPIKey:delegate: method. 201 | * 202 | */ 203 | @protocol CrashlyticsDelegate 204 | @optional 205 | 206 | 207 | - (void)crashlyticsDidDetectCrashDuringPreviousExecution:(Crashlytics *)crashlytics CLS_DEPRECATED("Please refer to -crashlyticsDidDetectReportForLastExecution:"); 208 | - (void)crashlytics:(Crashlytics *)crashlytics didDetectCrashDuringPreviousExecution:(id )crash CLS_DEPRECATED("Please refer to -crashlyticsDidDetectReportForLastExecution:"); 209 | 210 | /** 211 | * 212 | * Called when a Crashlytics instance has determined that the last execution of the 213 | * application ended in a crash. This is called synchronously on Crashlytics 214 | * initialization. Your delegate must invoke the completionHandler, but does not need to do so 215 | * synchronously, or even on the main thread. Invoking completionHandler with NO will cause the 216 | * detected report to be deleted and not submitted to Crashlytics. This is useful for 217 | * implementing permission prompts, or other more-complex forms of logic around submitting crashes. 218 | * 219 | * @warning Failure to invoke the completionHandler will prevent submissions from being reported. Watch out. 220 | * 221 | * @warning Just implementing this delegate method will disable all forms of synchronous report submission. This can 222 | * impact the reliability of reporting crashes very early in application launch. 223 | * 224 | * @param report The CLSReport object representing the last detected crash 225 | * @param completionHandler The completion handler to call when your logic has completed. 226 | * 227 | */ 228 | - (void)crashlyticsDidDetectReportForLastExecution:(CLSReport *)report completionHandler:(void (^)(BOOL submit))completionHandler; 229 | 230 | /** 231 | * If your app is running on an OS that supports it (OS X 10.9+, iOS 7.0+), Crashlytics will submit 232 | * most reports using out-of-process background networking operations. This results in a significant 233 | * improvement in reliability of reporting, as well as power and performance wins for your users. 234 | * If you don't want this functionality, you can disable by returning NO from this method. 235 | * 236 | * @warning Background submission is not supported for extensions on iOS or OS X. 237 | * 238 | * @param crashlytics The Crashlytics singleton instance 239 | * 240 | * @return Return NO if you don't want out-of-process background network operations. 241 | * 242 | */ 243 | - (BOOL)crashlyticsCanUseBackgroundSessions:(Crashlytics *)crashlytics; 244 | 245 | @end 246 | 247 | /** 248 | * `CrashlyticsKit` can be used as a parameter to `[Fabric with:@[CrashlyticsKit]];` in Objective-C. In Swift, use Crashlytics.sharedInstance() 249 | */ 250 | #define CrashlyticsKit [Crashlytics sharedInstance] 251 | 252 | FAB_END_NONNULL 253 | -------------------------------------------------------------------------------- /Crashlytics.framework/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | BuildMachineOSBuild 6 | 14E46 7 | CFBundleDevelopmentRegion 8 | English 9 | CFBundleExecutable 10 | Crashlytics 11 | CFBundleIdentifier 12 | com.twitter.crashlytics.ios 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | Crashlytics 17 | CFBundlePackageType 18 | FMWK 19 | CFBundleShortVersionString 20 | 3.1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleSupportedPlatforms 24 | 25 | iPhoneOS 26 | 27 | CFBundleVersion 28 | 65 29 | DTCompiler 30 | com.apple.compilers.llvm.clang.1_0 31 | DTPlatformBuild 32 | 12H141 33 | DTPlatformName 34 | iphoneos 35 | DTPlatformVersion 36 | 8.4 37 | DTSDKBuild 38 | 12H141 39 | DTSDKName 40 | iphoneos8.4 41 | DTXcode 42 | 0640 43 | DTXcodeBuild 44 | 6E35b 45 | MinimumOSVersion 46 | 5.0 47 | NSHumanReadableCopyright 48 | Copyright © 2015 Crashlytics, Inc. All rights reserved. 49 | UIDeviceFamily 50 | 51 | 1 52 | 2 53 | 54 | 55 | 56 | -------------------------------------------------------------------------------- /Crashlytics.framework/Modules/module.modulemap: -------------------------------------------------------------------------------- 1 | framework module Crashlytics { 2 | header "Crashlytics.h" 3 | header "Answers.h" 4 | header "CLSLogging.h" 5 | header "CLSReport.h" 6 | header "CLSStackFrame.h" 7 | 8 | export * 9 | 10 | link "z" 11 | link "c++" 12 | } 13 | -------------------------------------------------------------------------------- /Crashlytics.framework/run: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liushuaikobe/beauties/a6564f2a1e16f478b8b2f0c6a51c6348f621df18/Crashlytics.framework/run -------------------------------------------------------------------------------- /Crashlytics.framework/submit: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liushuaikobe/beauties/a6564f2a1e16f478b8b2f0c6a51c6348f621df18/Crashlytics.framework/submit -------------------------------------------------------------------------------- /Fabric.framework/Fabric: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liushuaikobe/beauties/a6564f2a1e16f478b8b2f0c6a51c6348f621df18/Fabric.framework/Fabric -------------------------------------------------------------------------------- /Fabric.framework/Headers/FABAttributes.h: -------------------------------------------------------------------------------- 1 | // 2 | // FABAttributes.h 3 | // Fabric 4 | // 5 | // Created by Priyanka Joshi on 3/3/15. 6 | // Copyright (c) 2015 Twitter. All rights reserved. 7 | // 8 | 9 | #pragma once 10 | 11 | #define FAB_UNAVAILABLE(x) __attribute__((unavailable(x))) 12 | 13 | #if __has_feature(nullability) 14 | #define FAB_NONNULL __nonnull 15 | #define FAB_NULLABLE __nullable 16 | #define FAB_START_NONNULL _Pragma("clang assume_nonnull begin") 17 | #define FAB_END_NONNULL _Pragma("clang assume_nonnull end") 18 | #else 19 | #define FAB_NONNULL 20 | #define FAB_NULLABLE 21 | #define FAB_START_NONNULL 22 | #define FAB_END_NONNULL 23 | #endif 24 | -------------------------------------------------------------------------------- /Fabric.framework/Headers/Fabric.h: -------------------------------------------------------------------------------- 1 | // 2 | // Fabric.h 3 | // 4 | // Copyright (c) 2014 Twitter. All rights reserved. 5 | // 6 | 7 | #import 8 | #import "FABAttributes.h" 9 | 10 | FAB_START_NONNULL 11 | 12 | /** 13 | * Fabric Base. Coordinates configuration and starts all provided kits. 14 | */ 15 | @interface Fabric : NSObject 16 | 17 | /** 18 | * Initialize Fabric and all provided kits. Call this method within your App Delegate's 19 | * `application:didFinishLaunchingWithOptions:` and provide the kits you wish to use. 20 | * 21 | * For example, in Objective-C: 22 | * 23 | * `[Fabric with:@[TwitterKit, CrashlyticsKit, MoPubKit]];` 24 | * 25 | * Swift: 26 | * 27 | * `Fabric.with([Twitter(), Crashlytics(), MoPub()])` 28 | * 29 | * Only the first call to this method is honored. Subsequent calls are no-ops. 30 | * 31 | * @param kits An array of kit instances. Kits may provide a macro such as CrashlyticsKit which can be passed in as array elements in objective-c. 32 | * 33 | * @return Returns the shared Fabric instance. In most cases this can be ignored. 34 | */ 35 | + (instancetype)with:(NSArray *)kits; 36 | 37 | /** 38 | * Returns the Fabric singleton object. 39 | */ 40 | + (instancetype)sharedSDK; 41 | 42 | /** 43 | * This BOOL enables or disables debug logging, such as kit version information. The default value is NO. 44 | */ 45 | @property (nonatomic, assign) BOOL debug; 46 | 47 | /** 48 | * Unavailable. Use `+sharedSDK` to retrieve the shared Fabric instance. 49 | */ 50 | - (id)init FAB_UNAVAILABLE("Use +sharedSDK to retrieve the shared Fabric instance."); 51 | 52 | /** 53 | * Returns Fabrics's instance of the specified kit. 54 | * 55 | * @param klass The class of the kit. 56 | * 57 | * @return The kit instance of class klass which was provided to with: or nil. 58 | */ 59 | - (id FAB_NULLABLE)kitForClass:(Class)klass; 60 | 61 | /** 62 | * Returns a dictionary containing the kit configuration info for the provided kit. 63 | * The configuration information is parsed from the application's Info.plist. This 64 | * method is primarily intended to be used by kits to retrieve their configuration. 65 | * 66 | * @param kitInstance An instance of the kit whose configuration should be returned. 67 | * 68 | * @return A dictionary containing kit specific configuration information or nil if none exists. 69 | */ 70 | - (NSDictionary * FAB_NULLABLE)configurationDictionaryForKit:(id)kitInstance; 71 | 72 | @end 73 | 74 | FAB_END_NONNULL 75 | 76 | -------------------------------------------------------------------------------- /Fabric.framework/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | BuildMachineOSBuild 6 | 13F34 7 | CFBundleDevelopmentRegion 8 | en 9 | CFBundleExecutable 10 | Fabric 11 | CFBundleIdentifier 12 | io.fabric.sdk.ios 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | Fabric 17 | CFBundlePackageType 18 | FMWK 19 | CFBundleShortVersionString 20 | 1.2.8 21 | CFBundleSignature 22 | ???? 23 | CFBundleSupportedPlatforms 24 | 25 | iPhoneOS 26 | 27 | CFBundleVersion 28 | 20 29 | DTCompiler 30 | com.apple.compilers.llvm.clang.1_0 31 | DTPlatformBuild 32 | 12B411 33 | DTPlatformName 34 | iphoneos 35 | DTPlatformVersion 36 | 8.1 37 | DTSDKBuild 38 | 12B411 39 | DTSDKName 40 | iphoneos8.1 41 | DTXcode 42 | 0611 43 | DTXcodeBuild 44 | 6A2008a 45 | MinimumOSVersion 46 | 5.0 47 | NSHumanReadableCopyright 48 | Copyright © 2015 Twitter. All rights reserved. 49 | UIDeviceFamily 50 | 51 | 1 52 | 2 53 | 54 | 55 | 56 | -------------------------------------------------------------------------------- /Fabric.framework/Modules/module.modulemap: -------------------------------------------------------------------------------- 1 | framework module Fabric { 2 | umbrella header "Fabric.h" 3 | 4 | export * 5 | module * { export * } 6 | } -------------------------------------------------------------------------------- /Fabric.framework/run: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liushuaikobe/beauties/a6564f2a1e16f478b8b2f0c6a51c6348f621df18/Fabric.framework/run -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Shuai Liu 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # ![logo](./demos/logo.png) 2 | 3 | It's a project made while I'm learning Swift. The data is fetched from [http://gank.io/](http://gank.io/) by [@daimajia](https://github.com/daimajia). 4 | 5 | API of gank.io: [http://gank.io/api](http://gank.io/api). 6 | 7 | ~~I get the image by parsing the HTML, but you can use its [API](http://gank.io/api) now.~~ 8 | 9 | ### Demo 10 | 11 | ![demo](./demos/demo.png) 12 | 13 | ### Keywords 14 | 15 | * [Carthage](https://github.com/Carthage/Carthage) 16 | * [Alamofire](https://github.com/Alamofire/Alamofire) 17 | * [Kingfisher](https://github.com/onevcat/Kingfisher) 18 | * ~~[CHTCollectionViewWaterfallLayout](https://github.com/chiahsien/CHTCollectionViewWaterfallLayout)~~ 19 | * `UIBlurEffect` 20 | * Sketch 21 | 22 | ### License 23 | 24 | The MIT (buy me coffee by alipay) License (MIT) 25 | 26 | ![donate](http://7xjdjy.com1.z0.glb.clouddn.com/donate.png) 27 | -------------------------------------------------------------------------------- /beauties/AboutViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AboutViewController.swift 3 | // beauties 4 | // 5 | // Created by Shuai Liu on 15/8/6. 6 | // Copyright (c) 2015年 Shuai Liu. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | import UIKit 11 | 12 | class AboutViewController: UIViewController { 13 | @IBOutlet weak var linkLabel: UILabel! 14 | 15 | override func viewDidLoad() { 16 | super.viewDidLoad() 17 | linkLabel.textColor = UIColor(red: 65.0 / 255.0, green: 131.0 / 255.0, blue: 196.0 / 255.0, alpha: 1) 18 | 19 | let tapGesture = UITapGestureRecognizer(target: self, action: "gotoURL") 20 | linkLabel.addGestureRecognizer(tapGesture) 21 | } 22 | 23 | func gotoURL() { 24 | let url = NSURL(string: linkLabel.text!)! 25 | UIApplication.sharedApplication().openURL(url) 26 | } 27 | } -------------------------------------------------------------------------------- /beauties/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // beauties 4 | // 5 | // Created by Shuai Liu on 15/6/27. 6 | // Copyright (c) 2015年 Shuai Liu. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | import Fabric 11 | import Crashlytics 12 | 13 | @UIApplicationMain 14 | class AppDelegate: UIResponder, UIApplicationDelegate { 15 | 16 | var window: UIWindow? 17 | 18 | 19 | func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { 20 | // Override point for customization after application launch. 21 | Fabric.with([Crashlytics()]) 22 | UITabBar.appearance().tintColor = ThemeColor 23 | UINavigationBar.appearance().tintColor = ThemeColor 24 | UITableViewCell.appearance().tintColor = ThemeColor 25 | return true 26 | } 27 | 28 | func applicationWillResignActive(application: UIApplication) { 29 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 30 | // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. 31 | } 32 | 33 | func applicationDidEnterBackground(application: UIApplication) { 34 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 35 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 36 | } 37 | 38 | func applicationWillEnterForeground(application: UIApplication) { 39 | // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. 40 | } 41 | 42 | func applicationDidBecomeActive(application: UIApplication) { 43 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 44 | } 45 | 46 | func applicationWillTerminate(application: UIApplication) { 47 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 48 | } 49 | 50 | 51 | } 52 | 53 | -------------------------------------------------------------------------------- /beauties/Base.lproj/LaunchScreen.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /beauties/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 143 | 149 | 150 | 151 | 152 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | -------------------------------------------------------------------------------- /beauties/BeautyCollectionViewCell.swift: -------------------------------------------------------------------------------- 1 | // 2 | // BeautyCollectionViewCell.swift 3 | // beauties 4 | // 5 | // Created by Shuai Liu on 15/7/1. 6 | // Copyright (c) 2015年 Shuai Liu. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | import UIKit 11 | import Kingfisher 12 | 13 | class BeautyCollectionViewCell: UICollectionViewCell { 14 | 15 | var imageView: UIImageView 16 | 17 | override init(frame: CGRect) { 18 | imageView = UIImageView() 19 | super.init(frame: frame) 20 | commonInit() 21 | } 22 | 23 | required init?(coder aDecoder: NSCoder) { 24 | imageView = UIImageView() 25 | super.init(coder: aDecoder) 26 | commonInit() 27 | } 28 | 29 | override func prepareForReuse() { 30 | super.prepareForReuse() 31 | self.imageView.alpha = 0 32 | } 33 | 34 | func commonInit() -> Void { 35 | self.clipsToBounds = false 36 | self.layer.borderWidth = 10 37 | self.layer.borderColor = UIColor.whiteColor().CGColor 38 | self.layer.shadowColor = UIColor(red: 187 / 255.0, green: 187 / 255.0, blue: 187 / 255.0, alpha: 1).CGColor 39 | self.layer.shadowOpacity = 0.5 40 | self.layer.shadowOffset = CGSizeMake(2, 6) 41 | 42 | self.imageView.clipsToBounds = true 43 | self.imageView.frame = self.bounds 44 | self.imageView.autoresizingMask = [.FlexibleWidth, .FlexibleHeight] 45 | self.imageView.contentMode = .ScaleAspectFill 46 | self.addSubview(self.imageView) 47 | } 48 | 49 | func bindData(entity: BeautyImageEntity) -> Void { 50 | 51 | if let urlString = entity.imageUrl { 52 | if let url = NSURL(string: urlString) { 53 | self.imageView.kf_setImageWithURL(url, placeholderImage: nil, optionsInfo: nil, completionHandler: { 54 | [weak self](image, error, cacheType, imageURL) -> () in 55 | UIView.animateWithDuration(0.5, delay: 0, options: .CurveEaseIn, animations: { () -> Void in 56 | self?.imageView.alpha = 1 57 | }, completion: nil) 58 | }) 59 | } 60 | } 61 | } 62 | } -------------------------------------------------------------------------------- /beauties/BeautyCollectionViewFooter.swift: -------------------------------------------------------------------------------- 1 | // 2 | // BeautyCollectionViewFooter.swift 3 | // beauties 4 | // 5 | // Created by Shuai Liu on 15/8/5. 6 | // Copyright (c) 2015年 Shuai Liu. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | import UIKit 11 | 12 | class BeautyCollectionViewFooter: UICollectionReusableView { 13 | 14 | var loadingIndicator: UIActivityIndicatorView 15 | 16 | override init(frame: CGRect) { 17 | loadingIndicator = UIActivityIndicatorView(activityIndicatorStyle: .Gray) 18 | super.init(frame: frame) 19 | self.commonInit() 20 | } 21 | 22 | required init?(coder aDecoder: NSCoder) { 23 | loadingIndicator = UIActivityIndicatorView(activityIndicatorStyle: .Gray) 24 | super.init(coder: aDecoder) 25 | self.commonInit() 26 | } 27 | 28 | private func commonInit() { 29 | self.addSubview(loadingIndicator) 30 | } 31 | 32 | override func layoutSubviews() { 33 | super.layoutSubviews() 34 | self.loadingIndicator.center = CGPointMake(CGRectGetMidX(self.bounds), CGRectGetMidY(self.bounds)) 35 | } 36 | 37 | func startAnimating() { 38 | self.loadingIndicator.startAnimating() 39 | } 40 | 41 | func stopAnimating() { 42 | self.loadingIndicator.stopAnimating() 43 | } 44 | } -------------------------------------------------------------------------------- /beauties/BeautyImageEntity.swift: -------------------------------------------------------------------------------- 1 | // 2 | // BeautyImageEntity.swift 3 | // beauties 4 | // 5 | // Created by Shuai Liu on 15/6/30. 6 | // Copyright (c) 2015年 Shuai Liu. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | class BeautyImageEntity: NSObject, NSCoding { 12 | var imageUrl: String? 13 | var imageHeight: Int? 14 | var imageWidth: Int? 15 | 16 | override var description: String { 17 | return "imageUrl: \(self.imageUrl), imageHeight: \(self.imageHeight), imageWidth: \(self.imageWidth)" 18 | } 19 | 20 | override init() { 21 | 22 | } 23 | 24 | required init?(coder aDecoder: NSCoder) { 25 | imageUrl = aDecoder.decodeObjectForKey("imageUrl") as? String 26 | imageHeight = aDecoder.decodeObjectForKey("imageHeight") as? Int 27 | imageWidth = aDecoder.decodeObjectForKey("imageWidth") as? Int 28 | } 29 | 30 | func encodeWithCoder(aCoder: NSCoder) { 31 | if imageUrl != nil { 32 | aCoder.encodeObject(imageUrl, forKey: "imageUrl") 33 | } 34 | if imageHeight != nil { 35 | aCoder.encodeObject(imageHeight, forKey: "imageHeight") 36 | } 37 | if imageWidth != nil { 38 | aCoder.encodeObject(imageWidth, forKey: "imageWidth") 39 | } 40 | } 41 | } -------------------------------------------------------------------------------- /beauties/BlurView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // BlurView.swift 3 | // beauties 4 | // 5 | // Created by Shuai Liu on 15/7/1. 6 | // Copyright (c) 2015年 Shuai Liu. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | import UIKit 11 | 12 | extension UIView { 13 | func applyBlurEffect() -> Void { 14 | let blurEffect = UIBlurEffect(style: .Light) 15 | let visualEffectView = UIVisualEffectView(effect: blurEffect) 16 | visualEffectView.frame = self.bounds 17 | self.addSubview(visualEffectView) 18 | } 19 | } -------------------------------------------------------------------------------- /beauties/HistoryViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // HistoryViewController.swift 3 | // beauties 4 | // 5 | // Created by Shuai Liu on 15/7/1. 6 | // Copyright (c) 2015年 Shuai Liu. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | import UIKit 11 | 12 | class HistoryViewController: UIViewController, UICollectionViewDelegateFlowLayout, UICollectionViewDelegate, UICollectionViewDataSource, UIScrollViewDelegate { 13 | 14 | // ---------------- Views 15 | var beautyCollectionView: UICollectionView! 16 | var refreshControl: UIRefreshControl! 17 | // ---------------- Data 18 | var beauties: [BeautyImageEntity] 19 | let sharedMargin = 10 20 | var page = 1 21 | var isLoadingNow = false 22 | 23 | override init(nibName nibNameOrNil: String?, bundle nibBundleOrNil: NSBundle?) { 24 | beauties = [] 25 | super.init(nibName: nibNameOrNil, bundle: nibBundleOrNil) 26 | } 27 | 28 | required init?(coder aDecoder: NSCoder) { 29 | beauties = [] 30 | super.init(coder: aDecoder) 31 | } 32 | 33 | override func viewDidLoad() { 34 | super.viewDidLoad() 35 | self.view.backgroundColor = ThemeColor 36 | self.edgesForExtendedLayout = .None 37 | self.automaticallyAdjustsScrollViewInsets = true 38 | 39 | let statusBarHeight: CGFloat = 20 40 | 41 | let collectionViewLayout = UICollectionViewFlowLayout() 42 | collectionViewLayout.itemSize = CGSizeMake((CGRectGetWidth(self.view.bounds) - 10 * 3) / 2, 200) 43 | collectionViewLayout.minimumLineSpacing = 10 44 | collectionViewLayout.minimumInteritemSpacing = 10 45 | collectionViewLayout.sectionInset = UIEdgeInsetsMake(0, 10, CGRectGetHeight(self.tabBarController!.tabBar.frame) + statusBarHeight + 10, 10) 46 | 47 | var frame = self.view.bounds 48 | frame.origin.y += statusBarHeight 49 | self.beautyCollectionView = UICollectionView(frame: frame, collectionViewLayout: collectionViewLayout) 50 | self.beautyCollectionView.alwaysBounceVertical = true 51 | self.beautyCollectionView.backgroundColor = UIColor.clearColor() 52 | self.beautyCollectionView.collectionViewLayout = collectionViewLayout 53 | self.beautyCollectionView.delegate = self 54 | self.beautyCollectionView.dataSource = self 55 | self.beautyCollectionView.registerClass(BeautyCollectionViewCell.self, forCellWithReuseIdentifier: "BeautyCollectionViewCell") 56 | self.beautyCollectionView.registerClass(BeautyCollectionViewFooter.self, forSupplementaryViewOfKind:UICollectionElementKindSectionFooter, withReuseIdentifier: "BeautyCollectionViewFoooter") 57 | self.view.addSubview(self.beautyCollectionView!) 58 | 59 | self.refreshControl = UIRefreshControl() 60 | self.refreshControl.addTarget(self, action: Selector("refreshData"), forControlEvents: .ValueChanged) 61 | self.beautyCollectionView.addSubview(self.refreshControl) 62 | 63 | // start loading data 64 | self.refreshData() 65 | } 66 | 67 | // MARK: fetch DATA 68 | 69 | func refreshData() { 70 | page = 1 71 | self.beauties.removeAll(keepCapacity: false) 72 | self.fetchNextPage(page) 73 | } 74 | 75 | func fetchNextPage(page: Int) { 76 | if (self.page > BeautyDateUtil.MAX_PAGE) { 77 | return 78 | } 79 | if (self.isLoadingNow) { 80 | return 81 | } 82 | 83 | self.isLoadingNow = true 84 | print("---------- Starting Page \(page) ----------") 85 | 86 | NetworkUtil.getBeauties(page) { 87 | [weak self] result, error in 88 | print("---------- Finished Page \(page) ----------") 89 | 90 | if let sself = self { 91 | 92 | sself.isLoadingNow = false 93 | sself.refreshControl.endRefreshing() 94 | 95 | if error == nil { 96 | sself.page += 1 97 | sself.beauties += result.map(sself.buildEntityWithURLString) 98 | sself.setBGI() 99 | sself.beautyCollectionView.reloadData() 100 | } 101 | } 102 | } 103 | } 104 | 105 | // set Blur Background Image 106 | func setBGI() { 107 | if self.beauties.count == 0 { 108 | return 109 | } 110 | let beautyEntity = self.beauties[0] 111 | 112 | let bgi = UIImageView(frame: self.view.bounds) 113 | bgi.contentMode = .ScaleToFill 114 | self.view.addSubview(bgi) 115 | self.view.sendSubviewToBack(bgi) 116 | 117 | bgi.kf_setImageWithURL(NSURL(string: beautyEntity.imageUrl!)!, placeholderImage: nil, optionsInfo: nil) { 118 | image, error, cacheType, imageURL in 119 | bgi.applyBlurEffect() 120 | } 121 | } 122 | 123 | func buildEntityWithURLString(url: String) -> BeautyImageEntity { 124 | let b = BeautyImageEntity() 125 | b.imageUrl = url 126 | return b 127 | } 128 | 129 | // MARK: UIScrollViewDelegate 130 | func scrollViewDidEndDragging(scrollView: UIScrollView, willDecelerate decelerate: Bool) { 131 | if (scrollView.contentOffset.y + CGRectGetHeight(scrollView.bounds) > scrollView.contentSize.height) { 132 | self.fetchNextPage(self.page) 133 | } 134 | } 135 | 136 | // MARK: UICollectionViewDataSource 137 | 138 | func collectionView(collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { 139 | return beauties.count 140 | } 141 | 142 | func collectionView(collectionView: UICollectionView, cellForItemAtIndexPath indexPath: NSIndexPath) -> UICollectionViewCell { 143 | let cell = collectionView.dequeueReusableCellWithReuseIdentifier("BeautyCollectionViewCell", forIndexPath: indexPath) as! BeautyCollectionViewCell 144 | if (indexPath.row < beauties.count) { 145 | let entity = beauties[indexPath.row] 146 | cell.bindData(entity) 147 | } 148 | return cell 149 | } 150 | 151 | func collectionView(collectionView: UICollectionView, viewForSupplementaryElementOfKind kind: String, atIndexPath indexPath: NSIndexPath) -> UICollectionReusableView { 152 | let footer: BeautyCollectionViewFooter = collectionView.dequeueReusableSupplementaryViewOfKind(kind, withReuseIdentifier: "BeautyCollectionViewFoooter", forIndexPath: indexPath) as! BeautyCollectionViewFooter 153 | if (kind == UICollectionElementKindSectionFooter) { 154 | footer.startAnimating() 155 | } 156 | return footer 157 | } 158 | 159 | // MARK: UICollectionViewDelegate 160 | 161 | func collectionView(collectionView: UICollectionView, didSelectItemAtIndexPath indexPath: NSIndexPath) { 162 | if (indexPath.row < self.beauties.count) { 163 | let entity = self.beauties[indexPath.row] 164 | let todayViewController = TodayViewController() 165 | todayViewController.todayBeauty = entity 166 | todayViewController.canBeClosed = true 167 | self.presentViewController(todayViewController, animated: true, completion: nil) 168 | } 169 | } 170 | 171 | // MARK: UICollectionViewDelegateFlowLayout 172 | 173 | func collectionView(collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, referenceSizeForFooterInSection section: Int) -> CGSize { 174 | if page >= BeautyDateUtil.MAX_PAGE { 175 | return CGSizeZero 176 | } else { 177 | return CGSizeMake(CGRectGetWidth(collectionView.bounds), 50) 178 | } 179 | } 180 | } -------------------------------------------------------------------------------- /beauties/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "size" : "29x29", 5 | "idiom" : "iphone", 6 | "filename" : "Icon-29@2x.png", 7 | "scale" : "2x" 8 | }, 9 | { 10 | "size" : "29x29", 11 | "idiom" : "iphone", 12 | "filename" : "Icon-29@3x.png", 13 | "scale" : "3x" 14 | }, 15 | { 16 | "size" : "40x40", 17 | "idiom" : "iphone", 18 | "filename" : "Icon-40@2x.png", 19 | "scale" : "2x" 20 | }, 21 | { 22 | "size" : "40x40", 23 | "idiom" : "iphone", 24 | "filename" : "Icon-40@3x.png", 25 | "scale" : "3x" 26 | }, 27 | { 28 | "size" : "60x60", 29 | "idiom" : "iphone", 30 | "filename" : "Icon-60@2x.png", 31 | "scale" : "2x" 32 | }, 33 | { 34 | "size" : "60x60", 35 | "idiom" : "iphone", 36 | "filename" : "Icon-60@3x.png", 37 | "scale" : "3x" 38 | } 39 | ], 40 | "info" : { 41 | "version" : 1, 42 | "author" : "xcode" 43 | } 44 | } -------------------------------------------------------------------------------- /beauties/Images.xcassets/AppIcon.appiconset/Icon-29@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liushuaikobe/beauties/a6564f2a1e16f478b8b2f0c6a51c6348f621df18/beauties/Images.xcassets/AppIcon.appiconset/Icon-29@2x.png -------------------------------------------------------------------------------- /beauties/Images.xcassets/AppIcon.appiconset/Icon-29@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liushuaikobe/beauties/a6564f2a1e16f478b8b2f0c6a51c6348f621df18/beauties/Images.xcassets/AppIcon.appiconset/Icon-29@3x.png -------------------------------------------------------------------------------- /beauties/Images.xcassets/AppIcon.appiconset/Icon-40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liushuaikobe/beauties/a6564f2a1e16f478b8b2f0c6a51c6348f621df18/beauties/Images.xcassets/AppIcon.appiconset/Icon-40@2x.png -------------------------------------------------------------------------------- /beauties/Images.xcassets/AppIcon.appiconset/Icon-40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liushuaikobe/beauties/a6564f2a1e16f478b8b2f0c6a51c6348f621df18/beauties/Images.xcassets/AppIcon.appiconset/Icon-40@3x.png -------------------------------------------------------------------------------- /beauties/Images.xcassets/AppIcon.appiconset/Icon-60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liushuaikobe/beauties/a6564f2a1e16f478b8b2f0c6a51c6348f621df18/beauties/Images.xcassets/AppIcon.appiconset/Icon-60@2x.png -------------------------------------------------------------------------------- /beauties/Images.xcassets/AppIcon.appiconset/Icon-60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liushuaikobe/beauties/a6564f2a1e16f478b8b2f0c6a51c6348f621df18/beauties/Images.xcassets/AppIcon.appiconset/Icon-60@3x.png -------------------------------------------------------------------------------- /beauties/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | 美妹 9 | CFBundleExecutable 10 | $(EXECUTABLE_NAME) 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | $(PRODUCT_NAME) 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1 25 | Fabric 26 | 27 | APIKey 28 | 5b6d196a58f4acbc481f40758c365e9b14ae8732 29 | Kits 30 | 31 | 32 | KitInfo 33 | 34 | KitName 35 | Crashlytics 36 | 37 | 38 | 39 | LSRequiresIPhoneOS 40 | 41 | UILaunchStoryboardName 42 | LaunchScreen 43 | UIMainStoryboardFile 44 | Main 45 | UIRequiredDeviceCapabilities 46 | 47 | armv7 48 | 49 | UISupportedInterfaceOrientations 50 | 51 | UIInterfaceOrientationPortrait 52 | UIInterfaceOrientationLandscapeLeft 53 | UIInterfaceOrientationLandscapeRight 54 | 55 | NSAppTransportSecurity 56 | 57 | NSAllowsArbitraryLoads 58 | 59 | 60 | 61 | 62 | -------------------------------------------------------------------------------- /beauties/MoreViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // MoreViewController.swift 3 | // beauties 4 | // 5 | // Created by Shuai Liu on 15/8/3. 6 | // Copyright (c) 2015年 Shuai Liu. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | import UIKit 11 | 12 | class MoreViewController: UITableViewController { 13 | 14 | var logoImage: UIImageView! 15 | 16 | @IBOutlet weak var appStoreCell: UITableViewCell! 17 | override func viewDidLoad() { 18 | super.viewDidLoad() 19 | 20 | self.tableView.tableFooterView = UIView() 21 | 22 | logoImage = UIImageView(image: UIImage(named: "logo.png")) 23 | logoImage.backgroundColor = UIColor.clearColor() 24 | logoImage.contentMode = .ScaleAspectFit 25 | self.view.addSubview(logoImage) 26 | self.view.bringSubviewToFront(logoImage) 27 | } 28 | 29 | override func viewDidLayoutSubviews() { 30 | super.viewDidLayoutSubviews() 31 | logoImage.center = CGPointMake(CGRectGetMidX(self.view.bounds), CGRectGetHeight(self.view.bounds) - 200 - CGRectGetMinY(logoImage.bounds)) 32 | var frame = logoImage.frame 33 | frame.size = CGSizeMake(120, 110) 34 | logoImage.frame = frame 35 | } 36 | 37 | override func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) { 38 | if let clickedCell = tableView.cellForRowAtIndexPath(indexPath) { 39 | if clickedCell == appStoreCell { 40 | let appURL = NSURL(string: "itms-apps://itunes.apple.com/app/1033020551")! 41 | UIApplication.sharedApplication().openURL(appURL) 42 | } 43 | } 44 | } 45 | } -------------------------------------------------------------------------------- /beauties/TodayViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.swift 3 | // beauties 4 | // 5 | // Created by Shuai Liu on 15/6/27. 6 | // Copyright (c) 2015年 Shuai Liu. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | import UIKit 11 | import Kingfisher 12 | 13 | class TodayViewController: UIViewController { 14 | 15 | var beautyImageView: UIImageView! 16 | var loadingIndicator: UIActivityIndicatorView! 17 | 18 | var todayBeauty: BeautyImageEntity? 19 | var canBeClosed: Bool 20 | 21 | override init(nibName nibNameOrNil: String?, bundle nibBundleOrNil: NSBundle?) { 22 | canBeClosed = false 23 | super.init(nibName: nibNameOrNil, bundle: nibBundleOrNil) 24 | } 25 | 26 | required init?(coder aDecoder: NSCoder) { 27 | canBeClosed = false 28 | super.init(coder: aDecoder) 29 | } 30 | 31 | override func viewDidLoad() { 32 | super.viewDidLoad() 33 | self.view.backgroundColor = ThemeColor 34 | self.edgesForExtendedLayout = .None 35 | 36 | loadingIndicator = UIActivityIndicatorView(activityIndicatorStyle: .Gray) 37 | loadingIndicator.hidesWhenStopped = true 38 | self.view.addSubview(loadingIndicator) 39 | loadingIndicator.startAnimating() 40 | 41 | beautyImageView = UIImageView(frame: self.view.bounds) 42 | beautyImageView.autoresizingMask = [.FlexibleWidth, .FlexibleHeight] 43 | beautyImageView.contentMode = .ScaleAspectFit 44 | beautyImageView.userInteractionEnabled = true 45 | beautyImageView.backgroundColor = UIColor.clearColor() 46 | self.view.addSubview(beautyImageView) 47 | 48 | if canBeClosed { 49 | let swipeGesture = UISwipeGestureRecognizer(target: self, action: "onSwipe:") 50 | swipeGesture.direction = UISwipeGestureRecognizerDirection.Down 51 | beautyImageView.addGestureRecognizer(swipeGesture) 52 | 53 | let tapGesture = UITapGestureRecognizer(target: self, action: "onSwipe:") 54 | beautyImageView.addGestureRecognizer(tapGesture) 55 | } 56 | 57 | let longPressGenture = UILongPressGestureRecognizer(target: self, action: "onLongPress:") 58 | beautyImageView.addGestureRecognizer(longPressGenture) 59 | 60 | let setImage: BeautyImageEntity -> Void = { 61 | 62 | 63 | 64 | if let imageURLString = $0.imageUrl { 65 | if let imageURL = NSURL(string: imageURLString) { 66 | self.beautyImageView.alpha = 0 67 | KingfisherManager.sharedManager.retrieveImageWithURL(imageURL, optionsInfo: nil, progressBlock: nil, completionHandler: { 68 | [weak self](image, error, cacheType, imageURL) -> () in 69 | 70 | dispatch_async(dispatch_get_main_queue(), { 71 | self?.loadingIndicator.stopAnimating() 72 | if let beauty = image { 73 | self?.beautyImageView.image = beauty 74 | self?.setBackgroundImage(beauty) 75 | UIView.animateWithDuration(0.7, delay: 0, options: .CurveEaseIn, animations: { 76 | self?.beautyImageView.alpha = 1 77 | }, completion: nil) 78 | } 79 | self?.view.setNeedsLayout() 80 | }) 81 | 82 | }) 83 | } 84 | } 85 | }; 86 | 87 | if todayBeauty != nil { 88 | setImage(todayBeauty!) 89 | return 90 | } 91 | 92 | NetworkUtil.getTodayBeauty { 93 | [weak self] urls in 94 | 95 | if let sself = self { 96 | if urls.count > 0 { 97 | sself.todayBeauty = BeautyImageEntity() 98 | sself.todayBeauty!.imageUrl = urls[0] 99 | setImage(sself.todayBeauty!) 100 | } 101 | } 102 | } 103 | } 104 | 105 | override func viewDidLayoutSubviews() { 106 | super.viewDidLayoutSubviews() 107 | 108 | if (loadingIndicator.isAnimating()) { 109 | loadingIndicator.center = CGPointMake(CGRectGetMidX(self.view.bounds), CGRectGetMidY(self.view.bounds)) 110 | } 111 | } 112 | 113 | func onSwipe(sender: UISwipeGestureRecognizer) { 114 | if canBeClosed { 115 | self.dismissViewControllerAnimated(true, completion: nil) 116 | } 117 | } 118 | 119 | func onLongPress(sender: UILongPressGestureRecognizer) { 120 | if sender.state == .Began { 121 | let alertController = UIAlertController(title: nil, message: nil, preferredStyle: .ActionSheet) 122 | 123 | let cancelAction = UIAlertAction(title: "取消", style: .Cancel, handler: nil) 124 | alertController.addAction(cancelAction) 125 | 126 | let saveAction = UIAlertAction(title: "保存", style: .Default, handler: { 127 | (action) -> Void in 128 | self.saveImage() 129 | }) 130 | alertController.addAction(saveAction) 131 | 132 | let shareAction = UIAlertAction(title: "分享", style: .Default, handler: { 133 | (action) -> Void in 134 | self.shareImage() 135 | }) 136 | alertController.addAction(shareAction) 137 | 138 | self.presentViewController(alertController, animated: true, completion: nil) 139 | } 140 | } 141 | 142 | func setBackgroundImage(image: UIImage) { 143 | let bgi = UIImageView(image: image) 144 | bgi.contentMode = .ScaleToFill 145 | bgi.frame = self.view.bounds 146 | self.view.addSubview(bgi) 147 | self.view.sendSubviewToBack(bgi) 148 | bgi.applyBlurEffect() 149 | } 150 | 151 | func saveImage() { 152 | if let image = self.beautyImageView.image { 153 | UIImageWriteToSavedPhotosAlbum(image, self, Selector("saveImageFinished:error:contextInfo:"), nil) 154 | } 155 | } 156 | 157 | func shareImage() { 158 | if let image = self.beautyImageView.image { 159 | let text = "分享漂亮妹纸一枚~" 160 | let activityController = UIActivityViewController(activityItems: [text, image], applicationActivities: nil) 161 | [self .presentViewController(activityController, animated: true, completion: nil)] 162 | } 163 | } 164 | 165 | func saveImageFinished(image: UIImage, error: NSErrorPointer, contextInfo: UnsafePointer<()>) { 166 | var message = "保存成功 (ฅ´ω`ฅ)" 167 | var OKTitle = "好的" 168 | if error != nil { 169 | print(error.memory) 170 | message = "保存失败 (´◔ ‸◔')" 171 | OKTitle = "好吧" 172 | } 173 | let alertController = UIAlertController(title: nil, message: message, preferredStyle: .Alert) 174 | 175 | let OKAction = UIAlertAction(title: OKTitle, style: .Default, handler: nil) 176 | alertController.addAction(OKAction) 177 | 178 | self.presentViewController(alertController, animated: true, completion: nil) 179 | } 180 | } 181 | 182 | -------------------------------------------------------------------------------- /beauties/Utils.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Utils.swift 3 | // beauties 4 | // 5 | // Created by Shuai Liu on 15/7/4. 6 | // Copyright (c) 2015年 Shuai Liu. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | import UIKit 11 | import Alamofire 12 | 13 | let ThemeColor = UIColor(red: 222.0 / 255.0, green: 110.0 / 255.0, blue: 75.0 / 255.0, alpha: 1) 14 | 15 | let DEBUG = true 16 | 17 | class BeautyDateUtil { 18 | 19 | static let PAGE_SIZE = 20 20 | static let API_FORMAT = "yyyy/MM/dd" 21 | static let MAX_PAGE = 5 22 | 23 | class func generateHistoryDateString(page: Int) -> [String] { 24 | return self.generateHistoryDateString(format: self.API_FORMAT, historyCount: self.PAGE_SIZE, page: page) 25 | } 26 | 27 | class func generateHistoryDateString(format format: String, historyCount: Int, page: Int) -> [String] { 28 | 29 | let today = NSDate() 30 | let calendar = NSCalendar.currentCalendar() 31 | let formatter = NSDateFormatter() 32 | formatter.dateFormat = format 33 | 34 | let unit = ((page - 1) * self.PAGE_SIZE)...(page * self.PAGE_SIZE - 1) 35 | return unit.map({calendar.dateByAddingUnit(.Day, value: -$0, toDate: today, options: [])}).filter({$0 != nil}).map({formatter.stringFromDate($0!)}) 36 | } 37 | 38 | class func todayString() -> String { 39 | let today = NSDate() 40 | let formatter = NSDateFormatter() 41 | formatter.dateFormat = self.API_FORMAT 42 | return formatter.stringFromDate(today) 43 | } 44 | } 45 | 46 | class NetworkUtil { 47 | static let API_DATA_URL = "http://gank.avosapps.com/api/data/%E7%A6%8F%E5%88%A9/" 48 | static let API_DAY_URL = "http://gank.avosapps.com/api/day/" 49 | static let API_RANDOM_URL = "http://gank.avosapps.com/api/random/data/%E7%A6%8F%E5%88%A9/" 50 | 51 | static let PAGE_SIZE = 20 52 | 53 | class func getBeauties(page: Int, complete: ([String], ErrorType?) -> Void) { 54 | 55 | let url = "\(API_DATA_URL)\(PAGE_SIZE)/\(page)" 56 | 57 | if (DEBUG) { 58 | print(url) 59 | } 60 | 61 | Alamofire.request(.GET, url).responseJSON { 62 | _, _, result in 63 | switch result { 64 | case let .Success(json): 65 | complete(NetworkUtil.parseBeautyList(json), nil) 66 | case let .Failure(_, error): 67 | print(error) 68 | complete([String](), error) 69 | } 70 | } 71 | } 72 | 73 | class func getTodayBeauty(complete: [String] -> Void) { 74 | 75 | if (DEBUG) { 76 | print(API_DAY_URL + BeautyDateUtil.todayString()) 77 | } 78 | 79 | Alamofire.request(.GET, API_DAY_URL + BeautyDateUtil.todayString()).responseJSON { 80 | _, _, result in 81 | 82 | switch result { 83 | case let .Success(json): 84 | if let j = json as? Dictionary { 85 | if let category = j["category"] as? [String] { 86 | if category.contains("福利") { 87 | if let results = j["results"] as? Dictionary { 88 | if let fulis = results["福利"] as? [Dictionary] { 89 | var ret = [String]() 90 | for fuli in fulis { 91 | ret.append(fuli["url"] as! String) 92 | } 93 | complete(ret) 94 | return 95 | } 96 | } 97 | } 98 | } 99 | } 100 | // No Beauty today, get a random beauty 101 | NetworkUtil.getRandomBeauty(1, complete: complete) 102 | case let .Failure(_, error): 103 | print(error) 104 | complete([String]()) 105 | } 106 | 107 | } 108 | } 109 | 110 | class func getRandomBeauty(count: Int, complete: [String] -> Void) { 111 | 112 | let url = "\(API_RANDOM_URL)\(count)" 113 | 114 | if (DEBUG) { 115 | print("Random URL --> \(url)") 116 | } 117 | 118 | Alamofire.request(.GET, url).responseJSON { 119 | _, _, result in 120 | 121 | switch result { 122 | case let .Success(json): 123 | complete(NetworkUtil.parseBeautyList(json)) 124 | case let .Failure(_, error): 125 | print(error) 126 | complete([String]()) 127 | } 128 | } 129 | } 130 | 131 | class func parseBeautyList(json: AnyObject?) -> [String] { 132 | var ret = [String]() 133 | if let j = json as? Dictionary { 134 | if let results = j["results"] as? [Dictionary] { 135 | for b in results { 136 | ret.append(b["url"] as! String) 137 | } 138 | } 139 | } 140 | return ret 141 | } 142 | } -------------------------------------------------------------------------------- /beauties/history@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liushuaikobe/beauties/a6564f2a1e16f478b8b2f0c6a51c6348f621df18/beauties/history@2x.png -------------------------------------------------------------------------------- /beauties/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liushuaikobe/beauties/a6564f2a1e16f478b8b2f0c6a51c6348f621df18/beauties/logo.png -------------------------------------------------------------------------------- /beauties/setting@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liushuaikobe/beauties/a6564f2a1e16f478b8b2f0c6a51c6348f621df18/beauties/setting@2x.png -------------------------------------------------------------------------------- /beauties/today@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liushuaikobe/beauties/a6564f2a1e16f478b8b2f0c6a51c6348f621df18/beauties/today@2x.png -------------------------------------------------------------------------------- /beautiesTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /beautiesTests/beautiesTests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // beautiesTests.swift 3 | // beautiesTests 4 | // 5 | // Created by Shuai Liu on 15/6/27. 6 | // Copyright (c) 2015年 Shuai Liu. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | import XCTest 11 | 12 | class beautiesTests: XCTestCase { 13 | 14 | override func setUp() { 15 | super.setUp() 16 | // Put setup code here. This method is called before the invocation of each test method in the class. 17 | } 18 | 19 | override func tearDown() { 20 | // Put teardown code here. This method is called after the invocation of each test method in the class. 21 | super.tearDown() 22 | } 23 | 24 | func testExample() { 25 | // This is an example of a functional test case. 26 | XCTAssert(true, "Pass") 27 | } 28 | 29 | func testPerformanceExample() { 30 | // This is an example of a performance test case. 31 | self.measureBlock() { 32 | // Put the code you want to measure the time of here. 33 | } 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /beauty.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 4B1366421B3EF8A100986654 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B1366411B3EF8A100986654 /* AppDelegate.swift */; }; 11 | 4B1366441B3EF8A100986654 /* TodayViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B1366431B3EF8A100986654 /* TodayViewController.swift */; }; 12 | 4B1366471B3EF8A100986654 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 4B1366451B3EF8A100986654 /* Main.storyboard */; }; 13 | 4B1366491B3EF8A100986654 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 4B1366481B3EF8A100986654 /* Images.xcassets */; }; 14 | 4B13664C1B3EF8A100986654 /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 4B13664A1B3EF8A100986654 /* LaunchScreen.xib */; }; 15 | 4B1366581B3EF8A100986654 /* beautiesTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B1366571B3EF8A100986654 /* beautiesTests.swift */; }; 16 | 4B459D2E1B47780C00975776 /* Utils.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B459D2D1B47780C00975776 /* Utils.swift */; }; 17 | 4B4903B81B6FADFF004D5458 /* MoreViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B4903B71B6FADFF004D5458 /* MoreViewController.swift */; }; 18 | 4B4903BB1B6FB23A004D5458 /* logo.png in Resources */ = {isa = PBXBuildFile; fileRef = 4B4903BA1B6FB23A004D5458 /* logo.png */; }; 19 | 4B7AC9791B44169200E19056 /* BlurView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B7AC9781B44169200E19056 /* BlurView.swift */; }; 20 | 4B7AC97E1B441DC700E19056 /* HistoryViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B7AC97D1B441DC700E19056 /* HistoryViewController.swift */; }; 21 | 4B7AC9801B4423AD00E19056 /* BeautyCollectionViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B7AC97F1B4423AD00E19056 /* BeautyCollectionViewCell.swift */; }; 22 | 4B8A88D71B73A386005470F0 /* AboutViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B8A88D61B73A386005470F0 /* AboutViewController.swift */; }; 23 | 4BC431171B76446E00FB6895 /* today@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4BC431141B76446E00FB6895 /* today@2x.png */; }; 24 | 4BC431181B76446E00FB6895 /* history@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4BC431151B76446E00FB6895 /* history@2x.png */; }; 25 | 4BC431191B76446E00FB6895 /* setting@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4BC431161B76446E00FB6895 /* setting@2x.png */; }; 26 | 4BD0DD3F1B42C84F00F08CF5 /* Kingfisher.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4BD0DD3D1B42C84F00F08CF5 /* Kingfisher.framework */; }; 27 | 4BD0DD431B42CBA400F08CF5 /* BeautyImageEntity.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4BD0DD421B42CBA400F08CF5 /* BeautyImageEntity.swift */; }; 28 | 4BE566D21B74F1FE0079197A /* Fabric.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4BE566D01B74F1FE0079197A /* Fabric.framework */; }; 29 | 4BE566D31B74F1FE0079197A /* Crashlytics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4BE566D11B74F1FE0079197A /* Crashlytics.framework */; }; 30 | 4BF4E6E61B72531100986D21 /* BeautyCollectionViewFooter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4BF4E6E51B72531100986D21 /* BeautyCollectionViewFooter.swift */; }; 31 | 4BF7FF0E1BAE6069008DC2C9 /* Alamofire.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4BF7FF0D1BAE6069008DC2C9 /* Alamofire.framework */; }; 32 | /* End PBXBuildFile section */ 33 | 34 | /* Begin PBXContainerItemProxy section */ 35 | 4B1366521B3EF8A100986654 /* PBXContainerItemProxy */ = { 36 | isa = PBXContainerItemProxy; 37 | containerPortal = 4B1366341B3EF8A100986654 /* Project object */; 38 | proxyType = 1; 39 | remoteGlobalIDString = 4B13663B1B3EF8A100986654; 40 | remoteInfo = beauties; 41 | }; 42 | /* End PBXContainerItemProxy section */ 43 | 44 | /* Begin PBXFileReference section */ 45 | 4B13663C1B3EF8A100986654 /* beauty.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = beauty.app; sourceTree = BUILT_PRODUCTS_DIR; }; 46 | 4B1366401B3EF8A100986654 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 47 | 4B1366411B3EF8A100986654 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 48 | 4B1366431B3EF8A100986654 /* TodayViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TodayViewController.swift; sourceTree = ""; }; 49 | 4B1366461B3EF8A100986654 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 50 | 4B1366481B3EF8A100986654 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; 51 | 4B13664B1B3EF8A100986654 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = ""; }; 52 | 4B1366511B3EF8A100986654 /* beautyTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = beautyTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 53 | 4B1366561B3EF8A100986654 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 54 | 4B1366571B3EF8A100986654 /* beautiesTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = beautiesTests.swift; sourceTree = ""; }; 55 | 4B459D2D1B47780C00975776 /* Utils.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Utils.swift; sourceTree = ""; }; 56 | 4B4903B71B6FADFF004D5458 /* MoreViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MoreViewController.swift; sourceTree = ""; }; 57 | 4B4903BA1B6FB23A004D5458 /* logo.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = logo.png; sourceTree = ""; }; 58 | 4B7AC9781B44169200E19056 /* BlurView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BlurView.swift; sourceTree = ""; }; 59 | 4B7AC97D1B441DC700E19056 /* HistoryViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HistoryViewController.swift; sourceTree = ""; }; 60 | 4B7AC97F1B4423AD00E19056 /* BeautyCollectionViewCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BeautyCollectionViewCell.swift; sourceTree = ""; }; 61 | 4B8A88D61B73A386005470F0 /* AboutViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AboutViewController.swift; sourceTree = ""; }; 62 | 4BC431141B76446E00FB6895 /* today@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "today@2x.png"; sourceTree = ""; }; 63 | 4BC431151B76446E00FB6895 /* history@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "history@2x.png"; sourceTree = ""; }; 64 | 4BC431161B76446E00FB6895 /* setting@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "setting@2x.png"; sourceTree = ""; }; 65 | 4BD0DD3D1B42C84F00F08CF5 /* Kingfisher.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Kingfisher.framework; path = Carthage/Build/iOS/Kingfisher.framework; sourceTree = ""; }; 66 | 4BD0DD421B42CBA400F08CF5 /* BeautyImageEntity.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BeautyImageEntity.swift; sourceTree = ""; }; 67 | 4BE566D01B74F1FE0079197A /* Fabric.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = Fabric.framework; sourceTree = SOURCE_ROOT; }; 68 | 4BE566D11B74F1FE0079197A /* Crashlytics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = Crashlytics.framework; sourceTree = SOURCE_ROOT; }; 69 | 4BF4E6E51B72531100986D21 /* BeautyCollectionViewFooter.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BeautyCollectionViewFooter.swift; sourceTree = ""; }; 70 | 4BF7FF0D1BAE6069008DC2C9 /* Alamofire.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Alamofire.framework; path = Carthage/Build/iOS/Alamofire.framework; sourceTree = ""; }; 71 | /* End PBXFileReference section */ 72 | 73 | /* Begin PBXFrameworksBuildPhase section */ 74 | 4B1366391B3EF8A100986654 /* Frameworks */ = { 75 | isa = PBXFrameworksBuildPhase; 76 | buildActionMask = 2147483647; 77 | files = ( 78 | 4BF7FF0E1BAE6069008DC2C9 /* Alamofire.framework in Frameworks */, 79 | 4BD0DD3F1B42C84F00F08CF5 /* Kingfisher.framework in Frameworks */, 80 | 4BE566D31B74F1FE0079197A /* Crashlytics.framework in Frameworks */, 81 | 4BE566D21B74F1FE0079197A /* Fabric.framework in Frameworks */, 82 | ); 83 | runOnlyForDeploymentPostprocessing = 0; 84 | }; 85 | 4B13664E1B3EF8A100986654 /* Frameworks */ = { 86 | isa = PBXFrameworksBuildPhase; 87 | buildActionMask = 2147483647; 88 | files = ( 89 | ); 90 | runOnlyForDeploymentPostprocessing = 0; 91 | }; 92 | /* End PBXFrameworksBuildPhase section */ 93 | 94 | /* Begin PBXGroup section */ 95 | 4B0DBFF41B3F9A4E009250A1 /* Utils */ = { 96 | isa = PBXGroup; 97 | children = ( 98 | 4B7AC9781B44169200E19056 /* BlurView.swift */, 99 | 4B459D2D1B47780C00975776 /* Utils.swift */, 100 | ); 101 | name = Utils; 102 | sourceTree = ""; 103 | }; 104 | 4B1366331B3EF8A100986654 = { 105 | isa = PBXGroup; 106 | children = ( 107 | 4BF7FF0D1BAE6069008DC2C9 /* Alamofire.framework */, 108 | 4BD0DD3D1B42C84F00F08CF5 /* Kingfisher.framework */, 109 | 4B13663E1B3EF8A100986654 /* beauties */, 110 | 4B1366541B3EF8A100986654 /* beautiesTests */, 111 | 4B13663D1B3EF8A100986654 /* Products */, 112 | ); 113 | sourceTree = ""; 114 | }; 115 | 4B13663D1B3EF8A100986654 /* Products */ = { 116 | isa = PBXGroup; 117 | children = ( 118 | 4B13663C1B3EF8A100986654 /* beauty.app */, 119 | 4B1366511B3EF8A100986654 /* beautyTests.xctest */, 120 | ); 121 | name = Products; 122 | sourceTree = ""; 123 | }; 124 | 4B13663E1B3EF8A100986654 /* beauties */ = { 125 | isa = PBXGroup; 126 | children = ( 127 | 4BE566D01B74F1FE0079197A /* Fabric.framework */, 128 | 4BE566D11B74F1FE0079197A /* Crashlytics.framework */, 129 | 4B4903B91B6FB1F4004D5458 /* images */, 130 | 4BD0DD411B42CB8400F08CF5 /* Entiy */, 131 | 4B0DBFF41B3F9A4E009250A1 /* Utils */, 132 | 4B1366411B3EF8A100986654 /* AppDelegate.swift */, 133 | 4B1366431B3EF8A100986654 /* TodayViewController.swift */, 134 | 4B7AC97D1B441DC700E19056 /* HistoryViewController.swift */, 135 | 4B1366451B3EF8A100986654 /* Main.storyboard */, 136 | 4B1366481B3EF8A100986654 /* Images.xcassets */, 137 | 4B13664A1B3EF8A100986654 /* LaunchScreen.xib */, 138 | 4B13663F1B3EF8A100986654 /* Supporting Files */, 139 | 4B7AC97F1B4423AD00E19056 /* BeautyCollectionViewCell.swift */, 140 | 4B4903B71B6FADFF004D5458 /* MoreViewController.swift */, 141 | 4BF4E6E51B72531100986D21 /* BeautyCollectionViewFooter.swift */, 142 | 4B8A88D61B73A386005470F0 /* AboutViewController.swift */, 143 | ); 144 | path = beauties; 145 | sourceTree = ""; 146 | }; 147 | 4B13663F1B3EF8A100986654 /* Supporting Files */ = { 148 | isa = PBXGroup; 149 | children = ( 150 | 4B1366401B3EF8A100986654 /* Info.plist */, 151 | ); 152 | name = "Supporting Files"; 153 | sourceTree = ""; 154 | }; 155 | 4B1366541B3EF8A100986654 /* beautiesTests */ = { 156 | isa = PBXGroup; 157 | children = ( 158 | 4B1366571B3EF8A100986654 /* beautiesTests.swift */, 159 | 4B1366551B3EF8A100986654 /* Supporting Files */, 160 | ); 161 | path = beautiesTests; 162 | sourceTree = ""; 163 | }; 164 | 4B1366551B3EF8A100986654 /* Supporting Files */ = { 165 | isa = PBXGroup; 166 | children = ( 167 | 4B1366561B3EF8A100986654 /* Info.plist */, 168 | ); 169 | name = "Supporting Files"; 170 | sourceTree = ""; 171 | }; 172 | 4B4903B91B6FB1F4004D5458 /* images */ = { 173 | isa = PBXGroup; 174 | children = ( 175 | 4BC431141B76446E00FB6895 /* today@2x.png */, 176 | 4BC431151B76446E00FB6895 /* history@2x.png */, 177 | 4BC431161B76446E00FB6895 /* setting@2x.png */, 178 | 4B4903BA1B6FB23A004D5458 /* logo.png */, 179 | ); 180 | name = images; 181 | sourceTree = ""; 182 | }; 183 | 4BD0DD411B42CB8400F08CF5 /* Entiy */ = { 184 | isa = PBXGroup; 185 | children = ( 186 | 4BD0DD421B42CBA400F08CF5 /* BeautyImageEntity.swift */, 187 | ); 188 | name = Entiy; 189 | sourceTree = ""; 190 | }; 191 | /* End PBXGroup section */ 192 | 193 | /* Begin PBXNativeTarget section */ 194 | 4B13663B1B3EF8A100986654 /* beauty */ = { 195 | isa = PBXNativeTarget; 196 | buildConfigurationList = 4B13665B1B3EF8A100986654 /* Build configuration list for PBXNativeTarget "beauty" */; 197 | buildPhases = ( 198 | 4B1366381B3EF8A100986654 /* Sources */, 199 | 4B1366391B3EF8A100986654 /* Frameworks */, 200 | 4B13663A1B3EF8A100986654 /* Resources */, 201 | 4BD0DD3C1B42C7FC00F08CF5 /* ShellScript */, 202 | 4BE566CF1B74F1B10079197A /* ShellScript */, 203 | ); 204 | buildRules = ( 205 | ); 206 | dependencies = ( 207 | ); 208 | name = beauty; 209 | productName = beauties; 210 | productReference = 4B13663C1B3EF8A100986654 /* beauty.app */; 211 | productType = "com.apple.product-type.application"; 212 | }; 213 | 4B1366501B3EF8A100986654 /* beautyTests */ = { 214 | isa = PBXNativeTarget; 215 | buildConfigurationList = 4B13665E1B3EF8A100986654 /* Build configuration list for PBXNativeTarget "beautyTests" */; 216 | buildPhases = ( 217 | 4B13664D1B3EF8A100986654 /* Sources */, 218 | 4B13664E1B3EF8A100986654 /* Frameworks */, 219 | 4B13664F1B3EF8A100986654 /* Resources */, 220 | ); 221 | buildRules = ( 222 | ); 223 | dependencies = ( 224 | 4B1366531B3EF8A100986654 /* PBXTargetDependency */, 225 | ); 226 | name = beautyTests; 227 | productName = beautiesTests; 228 | productReference = 4B1366511B3EF8A100986654 /* beautyTests.xctest */; 229 | productType = "com.apple.product-type.bundle.unit-test"; 230 | }; 231 | /* End PBXNativeTarget section */ 232 | 233 | /* Begin PBXProject section */ 234 | 4B1366341B3EF8A100986654 /* Project object */ = { 235 | isa = PBXProject; 236 | attributes = { 237 | LastSwiftMigration = 0700; 238 | LastSwiftUpdateCheck = 0700; 239 | LastUpgradeCheck = 0700; 240 | ORGANIZATIONNAME = "Shuai Liu"; 241 | TargetAttributes = { 242 | 4B13663B1B3EF8A100986654 = { 243 | CreatedOnToolsVersion = 6.3.2; 244 | DevelopmentTeam = 2C24N82JDX; 245 | }; 246 | 4B1366501B3EF8A100986654 = { 247 | CreatedOnToolsVersion = 6.3.2; 248 | TestTargetID = 4B13663B1B3EF8A100986654; 249 | }; 250 | }; 251 | }; 252 | buildConfigurationList = 4B1366371B3EF8A100986654 /* Build configuration list for PBXProject "beauty" */; 253 | compatibilityVersion = "Xcode 3.2"; 254 | developmentRegion = English; 255 | hasScannedForEncodings = 0; 256 | knownRegions = ( 257 | en, 258 | Base, 259 | ); 260 | mainGroup = 4B1366331B3EF8A100986654; 261 | productRefGroup = 4B13663D1B3EF8A100986654 /* Products */; 262 | projectDirPath = ""; 263 | projectRoot = ""; 264 | targets = ( 265 | 4B13663B1B3EF8A100986654 /* beauty */, 266 | 4B1366501B3EF8A100986654 /* beautyTests */, 267 | ); 268 | }; 269 | /* End PBXProject section */ 270 | 271 | /* Begin PBXResourcesBuildPhase section */ 272 | 4B13663A1B3EF8A100986654 /* Resources */ = { 273 | isa = PBXResourcesBuildPhase; 274 | buildActionMask = 2147483647; 275 | files = ( 276 | 4BC431171B76446E00FB6895 /* today@2x.png in Resources */, 277 | 4B4903BB1B6FB23A004D5458 /* logo.png in Resources */, 278 | 4BC431191B76446E00FB6895 /* setting@2x.png in Resources */, 279 | 4B1366471B3EF8A100986654 /* Main.storyboard in Resources */, 280 | 4BC431181B76446E00FB6895 /* history@2x.png in Resources */, 281 | 4B13664C1B3EF8A100986654 /* LaunchScreen.xib in Resources */, 282 | 4B1366491B3EF8A100986654 /* Images.xcassets in Resources */, 283 | ); 284 | runOnlyForDeploymentPostprocessing = 0; 285 | }; 286 | 4B13664F1B3EF8A100986654 /* Resources */ = { 287 | isa = PBXResourcesBuildPhase; 288 | buildActionMask = 2147483647; 289 | files = ( 290 | ); 291 | runOnlyForDeploymentPostprocessing = 0; 292 | }; 293 | /* End PBXResourcesBuildPhase section */ 294 | 295 | /* Begin PBXShellScriptBuildPhase section */ 296 | 4BD0DD3C1B42C7FC00F08CF5 /* ShellScript */ = { 297 | isa = PBXShellScriptBuildPhase; 298 | buildActionMask = 2147483647; 299 | files = ( 300 | ); 301 | inputPaths = ( 302 | "$(SRCROOT)/Carthage/Build/iOS/Kingfisher.framework", 303 | "$(SRCROOT)/Carthage/Build/iOS/Alamofire.framework", 304 | ); 305 | outputPaths = ( 306 | ); 307 | runOnlyForDeploymentPostprocessing = 0; 308 | shellPath = /bin/sh; 309 | shellScript = "/usr/local/bin/carthage copy-frameworks"; 310 | }; 311 | 4BE566CF1B74F1B10079197A /* ShellScript */ = { 312 | isa = PBXShellScriptBuildPhase; 313 | buildActionMask = 2147483647; 314 | files = ( 315 | ); 316 | inputPaths = ( 317 | ); 318 | outputPaths = ( 319 | ); 320 | runOnlyForDeploymentPostprocessing = 0; 321 | shellPath = /bin/sh; 322 | shellScript = "./Fabric.framework/run 5b6d196a58f4acbc481f40758c365e9b14ae8732 3490fc62e207b8c7ec5ae2d4a8578db972041bdd761c9d59f51f7b5ca63b611f"; 323 | }; 324 | /* End PBXShellScriptBuildPhase section */ 325 | 326 | /* Begin PBXSourcesBuildPhase section */ 327 | 4B1366381B3EF8A100986654 /* Sources */ = { 328 | isa = PBXSourcesBuildPhase; 329 | buildActionMask = 2147483647; 330 | files = ( 331 | 4B4903B81B6FADFF004D5458 /* MoreViewController.swift in Sources */, 332 | 4B7AC9801B4423AD00E19056 /* BeautyCollectionViewCell.swift in Sources */, 333 | 4B8A88D71B73A386005470F0 /* AboutViewController.swift in Sources */, 334 | 4BD0DD431B42CBA400F08CF5 /* BeautyImageEntity.swift in Sources */, 335 | 4BF4E6E61B72531100986D21 /* BeautyCollectionViewFooter.swift in Sources */, 336 | 4B7AC9791B44169200E19056 /* BlurView.swift in Sources */, 337 | 4B7AC97E1B441DC700E19056 /* HistoryViewController.swift in Sources */, 338 | 4B1366441B3EF8A100986654 /* TodayViewController.swift in Sources */, 339 | 4B1366421B3EF8A100986654 /* AppDelegate.swift in Sources */, 340 | 4B459D2E1B47780C00975776 /* Utils.swift in Sources */, 341 | ); 342 | runOnlyForDeploymentPostprocessing = 0; 343 | }; 344 | 4B13664D1B3EF8A100986654 /* Sources */ = { 345 | isa = PBXSourcesBuildPhase; 346 | buildActionMask = 2147483647; 347 | files = ( 348 | 4B1366581B3EF8A100986654 /* beautiesTests.swift in Sources */, 349 | ); 350 | runOnlyForDeploymentPostprocessing = 0; 351 | }; 352 | /* End PBXSourcesBuildPhase section */ 353 | 354 | /* Begin PBXTargetDependency section */ 355 | 4B1366531B3EF8A100986654 /* PBXTargetDependency */ = { 356 | isa = PBXTargetDependency; 357 | target = 4B13663B1B3EF8A100986654 /* beauty */; 358 | targetProxy = 4B1366521B3EF8A100986654 /* PBXContainerItemProxy */; 359 | }; 360 | /* End PBXTargetDependency section */ 361 | 362 | /* Begin PBXVariantGroup section */ 363 | 4B1366451B3EF8A100986654 /* Main.storyboard */ = { 364 | isa = PBXVariantGroup; 365 | children = ( 366 | 4B1366461B3EF8A100986654 /* Base */, 367 | ); 368 | name = Main.storyboard; 369 | sourceTree = ""; 370 | }; 371 | 4B13664A1B3EF8A100986654 /* LaunchScreen.xib */ = { 372 | isa = PBXVariantGroup; 373 | children = ( 374 | 4B13664B1B3EF8A100986654 /* Base */, 375 | ); 376 | name = LaunchScreen.xib; 377 | sourceTree = ""; 378 | }; 379 | /* End PBXVariantGroup section */ 380 | 381 | /* Begin XCBuildConfiguration section */ 382 | 4B1366591B3EF8A100986654 /* Debug */ = { 383 | isa = XCBuildConfiguration; 384 | buildSettings = { 385 | ALWAYS_SEARCH_USER_PATHS = NO; 386 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 387 | CLANG_CXX_LIBRARY = "libc++"; 388 | CLANG_ENABLE_MODULES = YES; 389 | CLANG_ENABLE_OBJC_ARC = YES; 390 | CLANG_WARN_BOOL_CONVERSION = YES; 391 | CLANG_WARN_CONSTANT_CONVERSION = YES; 392 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 393 | CLANG_WARN_EMPTY_BODY = YES; 394 | CLANG_WARN_ENUM_CONVERSION = YES; 395 | CLANG_WARN_INT_CONVERSION = YES; 396 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 397 | CLANG_WARN_UNREACHABLE_CODE = YES; 398 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 399 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 400 | COPY_PHASE_STRIP = NO; 401 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 402 | ENABLE_STRICT_OBJC_MSGSEND = YES; 403 | ENABLE_TESTABILITY = YES; 404 | GCC_C_LANGUAGE_STANDARD = gnu99; 405 | GCC_DYNAMIC_NO_PIC = NO; 406 | GCC_NO_COMMON_BLOCKS = YES; 407 | GCC_OPTIMIZATION_LEVEL = 0; 408 | GCC_PREPROCESSOR_DEFINITIONS = ( 409 | "DEBUG=1", 410 | "$(inherited)", 411 | ); 412 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 413 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 414 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 415 | GCC_WARN_UNDECLARED_SELECTOR = YES; 416 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 417 | GCC_WARN_UNUSED_FUNCTION = YES; 418 | GCC_WARN_UNUSED_VARIABLE = YES; 419 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 420 | MTL_ENABLE_DEBUG_INFO = YES; 421 | ONLY_ACTIVE_ARCH = YES; 422 | SDKROOT = iphoneos; 423 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 424 | }; 425 | name = Debug; 426 | }; 427 | 4B13665A1B3EF8A100986654 /* Release */ = { 428 | isa = XCBuildConfiguration; 429 | buildSettings = { 430 | ALWAYS_SEARCH_USER_PATHS = NO; 431 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 432 | CLANG_CXX_LIBRARY = "libc++"; 433 | CLANG_ENABLE_MODULES = YES; 434 | CLANG_ENABLE_OBJC_ARC = YES; 435 | CLANG_WARN_BOOL_CONVERSION = YES; 436 | CLANG_WARN_CONSTANT_CONVERSION = YES; 437 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 438 | CLANG_WARN_EMPTY_BODY = YES; 439 | CLANG_WARN_ENUM_CONVERSION = YES; 440 | CLANG_WARN_INT_CONVERSION = YES; 441 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 442 | CLANG_WARN_UNREACHABLE_CODE = YES; 443 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 444 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 445 | COPY_PHASE_STRIP = NO; 446 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 447 | ENABLE_NS_ASSERTIONS = NO; 448 | ENABLE_STRICT_OBJC_MSGSEND = YES; 449 | GCC_C_LANGUAGE_STANDARD = gnu99; 450 | GCC_NO_COMMON_BLOCKS = YES; 451 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 452 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 453 | GCC_WARN_UNDECLARED_SELECTOR = YES; 454 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 455 | GCC_WARN_UNUSED_FUNCTION = YES; 456 | GCC_WARN_UNUSED_VARIABLE = YES; 457 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 458 | MTL_ENABLE_DEBUG_INFO = NO; 459 | SDKROOT = iphoneos; 460 | VALIDATE_PRODUCT = YES; 461 | }; 462 | name = Release; 463 | }; 464 | 4B13665C1B3EF8A100986654 /* Debug */ = { 465 | isa = XCBuildConfiguration; 466 | buildSettings = { 467 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 468 | CODE_SIGN_IDENTITY = "iPhone Developer"; 469 | FRAMEWORK_SEARCH_PATHS = ( 470 | "$(inherited)", 471 | "$(PROJECT_DIR)/Carthage/Build/iOS", 472 | "$(PROJECT_DIR)", 473 | ); 474 | INFOPLIST_FILE = beauties/Info.plist; 475 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 476 | PRODUCT_BUNDLE_IDENTIFIER = "vars.me.$(PRODUCT_NAME:rfc1034identifier)"; 477 | PRODUCT_NAME = beauty; 478 | PROVISIONING_PROFILE = "1e021d34-b179-4904-94ce-d3c038ab20ef"; 479 | }; 480 | name = Debug; 481 | }; 482 | 4B13665D1B3EF8A100986654 /* Release */ = { 483 | isa = XCBuildConfiguration; 484 | buildSettings = { 485 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 486 | CODE_SIGN_IDENTITY = "iPhone Developer"; 487 | FRAMEWORK_SEARCH_PATHS = ( 488 | "$(inherited)", 489 | "$(PROJECT_DIR)/Carthage/Build/iOS", 490 | "$(PROJECT_DIR)", 491 | ); 492 | INFOPLIST_FILE = beauties/Info.plist; 493 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 494 | PRODUCT_BUNDLE_IDENTIFIER = "vars.me.$(PRODUCT_NAME:rfc1034identifier)"; 495 | PRODUCT_NAME = beauty; 496 | PROVISIONING_PROFILE = "1e021d34-b179-4904-94ce-d3c038ab20ef"; 497 | }; 498 | name = Release; 499 | }; 500 | 4B13665F1B3EF8A100986654 /* Debug */ = { 501 | isa = XCBuildConfiguration; 502 | buildSettings = { 503 | BUNDLE_LOADER = "$(TEST_HOST)"; 504 | FRAMEWORK_SEARCH_PATHS = ( 505 | "$(SDKROOT)/Developer/Library/Frameworks", 506 | "$(inherited)", 507 | ); 508 | GCC_PREPROCESSOR_DEFINITIONS = ( 509 | "DEBUG=1", 510 | "$(inherited)", 511 | ); 512 | INFOPLIST_FILE = beautiesTests/Info.plist; 513 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 514 | PRODUCT_BUNDLE_IDENTIFIER = "vars.me.$(PRODUCT_NAME:rfc1034identifier)"; 515 | PRODUCT_NAME = beautyTests; 516 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/beauty.app/beauty"; 517 | }; 518 | name = Debug; 519 | }; 520 | 4B1366601B3EF8A100986654 /* Release */ = { 521 | isa = XCBuildConfiguration; 522 | buildSettings = { 523 | BUNDLE_LOADER = "$(TEST_HOST)"; 524 | FRAMEWORK_SEARCH_PATHS = ( 525 | "$(SDKROOT)/Developer/Library/Frameworks", 526 | "$(inherited)", 527 | ); 528 | INFOPLIST_FILE = beautiesTests/Info.plist; 529 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 530 | PRODUCT_BUNDLE_IDENTIFIER = "vars.me.$(PRODUCT_NAME:rfc1034identifier)"; 531 | PRODUCT_NAME = beautyTests; 532 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/beauty.app/beauty"; 533 | }; 534 | name = Release; 535 | }; 536 | /* End XCBuildConfiguration section */ 537 | 538 | /* Begin XCConfigurationList section */ 539 | 4B1366371B3EF8A100986654 /* Build configuration list for PBXProject "beauty" */ = { 540 | isa = XCConfigurationList; 541 | buildConfigurations = ( 542 | 4B1366591B3EF8A100986654 /* Debug */, 543 | 4B13665A1B3EF8A100986654 /* Release */, 544 | ); 545 | defaultConfigurationIsVisible = 0; 546 | defaultConfigurationName = Release; 547 | }; 548 | 4B13665B1B3EF8A100986654 /* Build configuration list for PBXNativeTarget "beauty" */ = { 549 | isa = XCConfigurationList; 550 | buildConfigurations = ( 551 | 4B13665C1B3EF8A100986654 /* Debug */, 552 | 4B13665D1B3EF8A100986654 /* Release */, 553 | ); 554 | defaultConfigurationIsVisible = 0; 555 | defaultConfigurationName = Release; 556 | }; 557 | 4B13665E1B3EF8A100986654 /* Build configuration list for PBXNativeTarget "beautyTests" */ = { 558 | isa = XCConfigurationList; 559 | buildConfigurations = ( 560 | 4B13665F1B3EF8A100986654 /* Debug */, 561 | 4B1366601B3EF8A100986654 /* Release */, 562 | ); 563 | defaultConfigurationIsVisible = 0; 564 | defaultConfigurationName = Release; 565 | }; 566 | /* End XCConfigurationList section */ 567 | }; 568 | rootObject = 4B1366341B3EF8A100986654 /* Project object */; 569 | } 570 | -------------------------------------------------------------------------------- /beauty.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /demos/alipay.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liushuaikobe/beauties/a6564f2a1e16f478b8b2f0c6a51c6348f621df18/demos/alipay.png -------------------------------------------------------------------------------- /demos/demo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liushuaikobe/beauties/a6564f2a1e16f478b8b2f0c6a51c6348f621df18/demos/demo.png -------------------------------------------------------------------------------- /demos/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liushuaikobe/beauties/a6564f2a1e16f478b8b2f0c6a51c6348f621df18/demos/logo.png --------------------------------------------------------------------------------