repo_name
stringlengths
7
91
path
stringlengths
8
658
copies
stringclasses
125 values
size
stringlengths
3
6
content
stringlengths
118
674k
license
stringclasses
15 values
hash
stringlengths
32
32
line_mean
float64
6.09
99.2
line_max
int64
17
995
alpha_frac
float64
0.3
0.9
ratio
float64
2
9.18
autogenerated
bool
1 class
config_or_test
bool
2 classes
has_no_keywords
bool
2 classes
has_few_assignments
bool
1 class
GitTennis/SuccessFramework
Templates/_BusinessAppSwift_/_BusinessAppSwift_/Managers/KeychainManager.swift
2
3776
// // KeychainManager.swift // _BusinessAppSwift_ // // Created by Gytenis Mikulenas on 18/10/2016. // Copyright © 2016 Gytenis Mikulėnas // https://github.com/GitTennis/SuccessFramework // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in all // copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. All rights reserved. // import UIKit import KeychainAccess let kKeychainManagerAuthentificationTokenKey = "authentificationToken" class KeychainManager: KeychainManagerProtocol { init() { // ... } // MARK: KeychainManagerProtocol func authentificationToken()->String? { var token: String? do { try token = _keychainStore.getString(kKeychainManagerAuthentificationTokenKey) } catch let error { let error: ErrorEntity = ErrorEntity.init(code: 0, message: "KeychainManager: unable to retrieve stored token: " + stringify(object: error)) DDLogError(log: error.message!) } return token } func setAuthentificationToken(token: String?)->ErrorEntity? { var result: ErrorEntity? if let token = token { do { try _keychainStore.set(token, key: kKeychainManagerAuthentificationTokenKey) } catch let error { result = ErrorEntity.init(code: 0, message: "KeychainManager: unable to store token: " + stringify(object: error)) DDLogError(log: (result?.message!)!) } } else { do { try _keychainStore.remove(kKeychainManagerAuthentificationTokenKey) } catch let error { result = ErrorEntity.init(code: 0, message: "KeychainManager: unable to clear stored token: " + stringify(object: error)) DDLogError(log: (result?.message!)!) } } return result } // MARK: // MARK: Internal // MARK: internal var _keychainStore: Keychain = { let bundleIdentifier: String = Bundle.main.bundleIdentifier! // Access group: Create Keychain for Application Password //return Keychain(service: "com.example.github-token", accessGroup: "12ABCD3E4F.shared") // Create Keychain for Internet Password //let keychain = Keychain(server: "https://github.com", protocolType: .HTTPS) //let keychain = Keychain(server: "https://github.com", protocolType: .HTTPS, authenticationType: .HTMLForm) return Keychain(service: bundleIdentifier) }() }
mit
91e5bff8b5fb908568ac178530b9e67f
33.944444
152
0.620562
5.018617
false
false
false
false
huangboju/Moots
Examples/StickerDrag-Final_S3-b6/StickerDrag/ImageSourceView.swift
1
2430
/* * Copyright (c) 2016 Razeware LLC * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ import Cocoa class ImageSourceView: RoundedRectView { override func mouseDown(with theEvent: NSEvent) { //1. let pasteboardItem = NSPasteboardItem() pasteboardItem.setDataProvider(self, forTypes: [NSPasteboard.PasteboardType(rawValue: kUTTypeTIFF as String)]) //2. let draggingItem = NSDraggingItem(pasteboardWriter: pasteboardItem) draggingItem.setDraggingFrame(self.bounds, contents:snapshot()) //3. beginDraggingSession(with: [draggingItem], event: theEvent, source: self) } } // MARK: - NSDraggingSource extension ImageSourceView: NSDraggingSource { //1. func draggingSession(_ session: NSDraggingSession, sourceOperationMaskFor context: NSDraggingContext) -> NSDragOperation { return .generic } } // MARK: - NSDraggingSource extension ImageSourceView: NSPasteboardItemDataProvider { //2. func pasteboard(_ pasteboard: NSPasteboard?, item: NSPasteboardItem, provideDataForType type: NSPasteboard.PasteboardType) { //1. if let pasteboard = pasteboard, type.rawValue == String(kUTTypeTIFF), let image = NSImage(named:"unicorn") { //2. let finalImage = image.tintedImageWithColor(NSColor.randomColor()) //3. let tiffdata = finalImage.tiffRepresentation pasteboard.setData(tiffdata, forType:type) } } }
mit
25ebbe499d16dc44d978f41ea51e7b11
37.571429
126
0.744444
4.533582
false
false
false
false
huonw/swift
validation-test/compiler_crashers_fixed/28087-swift-genericsignature-profile.swift
65
2669
// This source file is part of the Swift.org open source project // Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors // Licensed under Apache License v2.0 with Runtime Library Exception // // See https://swift.org/LICENSE.txt for license information // See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors // RUN: not %target-swift-frontend %s -typecheck class a = { { protocol P{ va d: A? unit(2){{} class b class b<T where k.C(x: P extension NSData { func g:A{ }} " { va d} let a { func g: e where k.C(x class A{ class a { class b }}}}}class S<T{func a<h{func b<T where h.g=a{}}class d { }} println(2){ let t: A { func g: B{ println(2).B : T.B :{ class A { typealias e where B<f: Array<T where g: Array<T where h class b class b<T where h.B :P protocol c, { var d = e protocol P class b{ func f<T:b protocol c, class b<T where f: T.h : T:T? unit(object1: P { } var A { let a = f { private let t: A? nil private let t: Array<I : Array<I : T) { class func a {{ struct A {{ class A, b }{ class A : a = e? enum S<T where I.E == { enum S: { { var A : P {{{struct B<I : a = " func g: P class b<T where k.E == e? }} class a { " Void{class e?? unit(" if true{ println(object1: a { case c println(x func f<T where g: a = d:A<T where f<T where k.g =b<I : T) { class a<T where g<d = " var b } {class func f: d {} struct B<d : T.h : T.C() ? }}} private let d{ class B<T>() -> String { { func g: Array<T where f=b<T where h.h : P {} return x: A{ { }} class B<T.g == d<T A {struct B<I : d = e typealias e where I.E == e{ class b struct A { struct A, b }}}{{ class func unit<T where h.E == e: e?? { Void{ var b<d : Any { class b ( {func a<T where B:Any).E == e : P }} }}}}}class S<T{func a<h{func b<T where h.g=a{}}class d func a{} var d { class b(key: a = d} protocol e == e?? { return unit(object1: a {{ func g: e, d : Array<T where k.E == Int class A { enum S:P{ { class A, b = set { a = d} } protocol P { { class b<T where g: a { {class A : e, d = [Void{ va d> : e, b } {{var d = e, b : Array<I : Array<T where k.g =b class A, AnyObject, d = { protocol c, func a<I : Array<T where g: B<T where g: e:T let a = d<T where h.E == { var d = e:P struct A : A<T where f<T) { class e struct B<T where B<T:d{ struct B<T where g: T.map { b } extension NSData { struct Q<T class A : e: A<T where g: e where k.E == d:b() { { class A : A, d = " ( { protocol P { class b: A{{ let t: A{ ( " "" class B : Array<I : e where g<T where I.C(" println(key: Array<T) -> String { }}}}}class S<T{func a<h{func b<T where h.g=a{}}class d let t: A func a<T where g: Array<T where g: A<T where I.C(" class B let a {{ protocol P typealias e where g: e {{{ { class
apache-2.0
809fe338e6e27694835f51e29d92447a
17.406897
79
0.603972
2.378788
false
false
false
false
danielcwj16/ConnectedAlarmApp
Pods/JTAppleCalendar/Sources/JTAppleCalendarView.swift
2
47983
// // JTAppleCalendarView.swift // // Copyright (c) 2016-2017 JTAppleCalendar (https://github.com/patchthecode/JTAppleCalendar) // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. // let maxNumberOfDaysInWeek = 7 // Should not be changed let maxNumberOfRowsPerMonth = 6 // Should not be changed let developerErrorMessage = "There was an error in this code section. Please contact the developer on GitHub" let decorationViewID = "Are you ready for the life after this one?" /// An instance of JTAppleCalendarView (or simply, a calendar view) is a /// means for displaying and interacting with a gridstyle layout of date-cells open class JTAppleCalendarView: UICollectionView { /// Configures the size of your date cells @IBInspectable open var cellSize: CGFloat = 0 { didSet { if oldValue == cellSize { return } if scrollDirection == .horizontal { calendarViewLayout.cellSize.width = cellSize } else { calendarViewLayout.cellSize.height = cellSize } calendarViewLayout.invalidateLayout() calendarViewLayout.itemSizeWasSet = cellSize == 0 ? false: true } } /// The scroll direction of the sections in JTAppleCalendar. open var scrollDirection: UICollectionViewScrollDirection! { didSet { if oldValue == scrollDirection { return } calendarViewLayout.invalidateLayout() } } /// Enables/Disables the stretching of date cells. When enabled cells will stretch to fit the width of a month in case of a <= 5 row month. open var allowsDateCellStretching = true { didSet { calendarViewLayout.invalidateLayout() } } /// Alerts the calendar that range selection will be checked. If you are /// not using rangeSelection and you enable this, /// then whenever you click on a datecell, you may notice a very fast /// refreshing of the date-cells both left and right of the cell you /// just selected. open var isRangeSelectionUsed: Bool = false /// The object that acts as the delegate of the calendar view. weak open var calendarDelegate: JTAppleCalendarViewDelegate? { didSet { lastMonthSize = sizesForMonthSection() } } /// The object that acts as the data source of the calendar view. weak open var calendarDataSource: JTAppleCalendarViewDataSource? { didSet { setupMonthInfoAndMap() // Refetch the data source for a data source change } } var lastSavedContentOffset: CGFloat = 0.0 var triggerScrollToDateDelegate: Bool? = true var isScrollInProgress = false var isReloadDataInProgress = false var delayedExecutionClosure: [(() -> Void)] = [] let dateGenerator = JTAppleDateConfigGenerator() /// Implemented by subclasses to initialize a new object (the receiver) immediately after memory for it has been allocated. public init() { super.init(frame: .zero, collectionViewLayout: UICollectionViewFlowLayout()) setupNewLayout(from: collectionViewLayout as! JTAppleCalendarLayoutProtocol) } /// Initializes and returns a newly allocated collection view object with the specified frame and layout. public override init(frame: CGRect, collectionViewLayout layout: UICollectionViewLayout) { super.init(frame: frame, collectionViewLayout: UICollectionViewFlowLayout()) setupNewLayout(from: collectionViewLayout as! JTAppleCalendarLayoutProtocol) } /// Initializes using decoder object required public init?(coder aDecoder: NSCoder) { super.init(coder: aDecoder) setupNewLayout(from: collectionViewLayout as! JTAppleCalendarLayoutProtocol) } /// Notifies the container that the size of its view is about to change. public func viewWillTransition(to size: CGSize, with coordinator: UIViewControllerTransitionCoordinator, focusDateIndexPathAfterRotate: IndexPath? = nil) { calendarViewLayout.focusIndexPath = focusDateIndexPathAfterRotate coordinator.animate(alongsideTransition: { (context) -> Void in self.performBatchUpdates(nil, completion: nil) },completion: { (context) -> Void in self.calendarViewLayout.focusIndexPath = nil }) } /// Lays out subviews. override open func layoutSubviews() { super.layoutSubviews() if (collectionViewLayout as! JTAppleCalendarLayout).lastSetCollectionViewSize != frame { // ive seen that layout subview gets called. Calendar is setup, and then it gets called again // At this point, it already has generaed cells which needs to be invalidated. calendarViewLayout.invalidateLayout() layoutIfNeeded() } if !delayedExecutionClosure.isEmpty, isCalendarLayoutLoaded { executeDelayedTasks() } } func setupMonthInfoAndMap() { theData = setupMonthInfoDataForStartAndEndDate() } // Configuration parameters from the dataSource var cachedConfiguration: ConfigurationParameters! // Set the start of the month var startOfMonthCache: Date! // Set the end of month var endOfMonthCache: Date! var theSelectedIndexPaths: [IndexPath] = [] var theSelectedDates: [Date] = [] var initialScrollDate: Date? func firstContentOffset() -> CGPoint { var retval: CGPoint = .zero guard let date = initialScrollDate else { return retval } // Ensure date is within valid boundary let components = calendar.dateComponents([.year, .month, .day], from: date) let firstDayOfDate = calendar.date(from: components)! if !((firstDayOfDate >= self.startOfMonthCache!) && (firstDayOfDate <= self.endOfMonthCache!)) { return retval } // Get valid indexPath of date to scroll to let retrievedPathsFromDates = self.pathsFromDates([date]) if retrievedPathsFromDates.isEmpty { return retval } let sectionIndexPath = self.pathsFromDates([date])[0] if calendarViewLayout.thereAreHeaders && scrollDirection == .vertical { let indexPath = IndexPath(item: 0, section: sectionIndexPath.section) guard let attributes = self.layoutAttributesForSupplementaryElement(ofKind: UICollectionElementKindSectionHeader, at: indexPath) else { return retval } let maxYCalendarOffset = max(0, self.contentSize.height - self.frame.size.height) retval = CGPoint(x: attributes.frame.origin.x,y: min(maxYCalendarOffset, attributes.frame.origin.y)) // if self.scrollDirection == .horizontal { topOfHeader.x += extraAddedOffset} else { topOfHeader.y += extraAddedOffset } } else { switch self.scrollingMode { case .stopAtEach, .stopAtEachSection, .stopAtEachCalendarFrameWidth: if self.scrollDirection == .horizontal || (scrollDirection == .vertical && !calendarViewLayout.thereAreHeaders) { retval = self.targetPointForItemAt(indexPath: sectionIndexPath) ?? .zero } default: break } } return retval } open var sectionInset: UIEdgeInsets = UIEdgeInsetsMake(0, 0, 0, 0) { didSet { calendarViewLayout.invalidateLayout() } } open var minimumInteritemSpacing: CGFloat = 0 { didSet { calendarViewLayout.invalidateLayout() } } open var minimumLineSpacing: CGFloat = 0 { didSet { calendarViewLayout.invalidateLayout() } } lazy var theData: CalendarData = { return self.setupMonthInfoDataForStartAndEndDate() }() var lastMonthSize: [AnyHashable:CGFloat] = [:] var monthMap: [Int: Int] { get { return theData.sectionToMonthMap } set { theData.sectionToMonthMap = monthMap } } /// Configure the scrolling behavior open var scrollingMode: ScrollingMode = .stopAtEachCalendarFrameWidth { didSet { switch scrollingMode { case .stopAtEachCalendarFrameWidth: decelerationRate = UIScrollViewDecelerationRateFast case .stopAtEach, .stopAtEachSection: decelerationRate = UIScrollViewDecelerationRateFast case .nonStopToSection, .nonStopToCell, .nonStopTo, .none: decelerationRate = UIScrollViewDecelerationRateNormal } #if os(iOS) switch scrollingMode { case .stopAtEachCalendarFrameWidth: isPagingEnabled = true default: isPagingEnabled = false } #endif } } /// A semantic description of the view’s contents, used to determine whether the view should be flipped when switching between left-to-right and right-to-left layouts. open override var semanticContentAttribute: UISemanticContentAttribute { didSet { transform.a = semanticContentAttribute == .forceRightToLeft ? -1 : 1 calendarViewLayout.invalidateLayout() } } func developerError(string: String) { print(string) print(developerErrorMessage) assert(false) } func setupNewLayout(from oldLayout: JTAppleCalendarLayoutProtocol) { let newLayout = JTAppleCalendarLayout(withDelegate: self) newLayout.scrollDirection = oldLayout.scrollDirection newLayout.sectionInset = oldLayout.sectionInset newLayout.minimumInteritemSpacing = oldLayout.minimumInteritemSpacing newLayout.minimumLineSpacing = oldLayout.minimumLineSpacing collectionViewLayout = newLayout scrollDirection = newLayout.scrollDirection sectionInset = newLayout.sectionInset minimumLineSpacing = newLayout.minimumLineSpacing minimumInteritemSpacing = newLayout.minimumInteritemSpacing transform.a = semanticContentAttribute == .forceRightToLeft ? -1 : 1 super.dataSource = self super.delegate = self decelerationRate = UIScrollViewDecelerationRateFast #if os(iOS) if isPagingEnabled { scrollingMode = .stopAtEachCalendarFrameWidth } else { scrollingMode = .none } #endif } func validForwardAndBackwordSelectedIndexes(forIndexPath indexPath: IndexPath) -> [IndexPath] { var retval: [IndexPath] = [] if let validForwardIndex = calendarViewLayout.indexPath(direction: .next, of: indexPath.section, item: indexPath.item), theSelectedIndexPaths.contains(validForwardIndex) { retval.append(validForwardIndex) } if let validBackwardIndex = calendarViewLayout.indexPath(direction: .previous, of: indexPath.section, item: indexPath.item), theSelectedIndexPaths.contains(validBackwardIndex) { retval.append(validBackwardIndex) } return retval } func scrollTo(indexPath: IndexPath, triggerScrollToDateDelegate: Bool, isAnimationEnabled: Bool, position: UICollectionViewScrollPosition, extraAddedOffset: CGFloat, completionHandler: (() -> Void)?) { isScrollInProgress = true if let validCompletionHandler = completionHandler { self.delayedExecutionClosure.append(validCompletionHandler) } self.triggerScrollToDateDelegate = triggerScrollToDateDelegate DispatchQueue.main.async { self.scrollToItem(at: indexPath, at: position, animated: isAnimationEnabled) if (isAnimationEnabled && self.calendarOffsetIsAlreadyAtScrollPosition(forIndexPath: indexPath)) || !isAnimationEnabled { self.scrollViewDidEndScrollingAnimation(self) } self.isScrollInProgress = false } } func targetPointForItemAt(indexPath: IndexPath) -> CGPoint? { guard let targetCellFrame = calendarViewLayout.layoutAttributesForItem(at: indexPath)?.frame else { // Jt101 This was changed !! return nil } let theTargetContentOffset: CGFloat = scrollDirection == .horizontal ? targetCellFrame.origin.x : targetCellFrame.origin.y var fixedScrollSize: CGFloat = 0 switch scrollingMode { case .stopAtEachSection, .stopAtEachCalendarFrameWidth: if self.scrollDirection == .horizontal || (scrollDirection == .vertical && !calendarViewLayout.thereAreHeaders) { // Horizontal has a fixed width. // Vertical with no header has fixed height fixedScrollSize = calendarViewLayout.sizeOfContentForSection(0) } else { // JT101 will remodel this code. Just a quick fix fixedScrollSize = calendarViewLayout.sizeOfContentForSection(0) } case .stopAtEach(customInterval: let customVal): fixedScrollSize = customVal default: break } let section = CGFloat(Int(theTargetContentOffset / fixedScrollSize)) let destinationRectOffset = (fixedScrollSize * section) var x: CGFloat = 0 var y: CGFloat = 0 if scrollDirection == .horizontal { x = destinationRectOffset } else { y = destinationRectOffset } return CGPoint(x: x, y: y) } func calendarOffsetIsAlreadyAtScrollPosition(forOffset offset: CGPoint) -> Bool { var retval = false // If the scroll is set to animate, and the target content // offset is already on the screen, then the // didFinishScrollingAnimation // delegate will not get called. Once animation is on let's // force a scroll so the delegate MUST get caalled let theOffset = scrollDirection == .horizontal ? offset.x : offset.y let divValue = scrollDirection == .horizontal ? frame.width : frame.height let sectionForOffset = Int(theOffset / divValue) let calendarCurrentOffset = scrollDirection == .horizontal ? contentOffset.x : contentOffset.y if calendarCurrentOffset == theOffset || (scrollingMode.pagingIsEnabled() && (sectionForOffset == currentSection())) { retval = true } return retval } func calendarOffsetIsAlreadyAtScrollPosition(forIndexPath indexPath: IndexPath) -> Bool { var retval = false // If the scroll is set to animate, and the target content offset // is already on the screen, then the didFinishScrollingAnimation // delegate will not get called. Once animation is on let's force // a scroll so the delegate MUST get caalled if let attributes = calendarViewLayout.layoutAttributesForItem(at: indexPath) { // JT101 this was changed!!!! let layoutOffset: CGFloat let calendarOffset: CGFloat if scrollDirection == .horizontal { layoutOffset = attributes.frame.origin.x calendarOffset = contentOffset.x } else { layoutOffset = attributes.frame.origin.y calendarOffset = contentOffset.y } if calendarOffset == layoutOffset { retval = true } } return retval } func scrollToHeaderInSection(_ section: Int, triggerScrollToDateDelegate: Bool = false, withAnimation animation: Bool = true, extraAddedOffset: CGFloat, completionHandler: (() -> Void)? = nil) { if !calendarViewLayout.thereAreHeaders { return } let indexPath = IndexPath(item: 0, section: section) guard let attributes = self.layoutAttributesForSupplementaryElement(ofKind: UICollectionElementKindSectionHeader, at: indexPath) else { return } isScrollInProgress = true if let validHandler = completionHandler { self.delayedExecutionClosure.append(validHandler) } self.triggerScrollToDateDelegate = triggerScrollToDateDelegate let maxYCalendarOffset = max(0, self.contentSize.height - self.frame.size.height) var topOfHeader = CGPoint(x: attributes.frame.origin.x,y: min(maxYCalendarOffset, attributes.frame.origin.y)) if self.scrollDirection == .horizontal { topOfHeader.x += extraAddedOffset} else { topOfHeader.y += extraAddedOffset } DispatchQueue.main.async { self.setContentOffset(topOfHeader, animated: animation) if (animation && self.calendarOffsetIsAlreadyAtScrollPosition(forOffset: topOfHeader)) || !animation { self.scrollViewDidEndScrollingAnimation(self) } self.isScrollInProgress = false } } // Subclasses cannot use this function @available(*, unavailable) open override func reloadData() { super.reloadData() } func executeDelayedTasks() { let tasksToExecute = delayedExecutionClosure delayedExecutionClosure.removeAll() for aTaskToExecute in tasksToExecute { aTaskToExecute() } } // Only reload the dates if the datasource information has changed func reloadDelegateDataSource() -> Bool { var retval = false if let newDateBoundary = calendarDataSource?.configureCalendar(self) { // Jt101 do a check in each var to see if // user has bad star/end dates let newStartOfMonth = calendar.startOfMonth(for: newDateBoundary.startDate) let newEndOfMonth = calendar.endOfMonth(for: newDateBoundary.endDate) let oldStartOfMonth = calendar.startOfMonth(for: startDateCache) let oldEndOfMonth = calendar.endOfMonth(for: endDateCache) let newLastMonth = sizesForMonthSection() if newStartOfMonth != oldStartOfMonth || newEndOfMonth != oldEndOfMonth || newDateBoundary.calendar != cachedConfiguration.calendar || newDateBoundary.numberOfRows != cachedConfiguration.numberOfRows || newDateBoundary.generateInDates != cachedConfiguration.generateInDates || newDateBoundary.generateOutDates != cachedConfiguration.generateOutDates || newDateBoundary.firstDayOfWeek != cachedConfiguration.firstDayOfWeek || newDateBoundary.hasStrictBoundaries != cachedConfiguration.hasStrictBoundaries || lastMonthSize != newLastMonth || calendarViewLayout.updatedLayoutCellSize != calendarViewLayout.cellSize { lastMonthSize = newLastMonth retval = true } } return retval } func remapSelectedDatesWithCurrentLayout() -> (selected:(indexPaths:[IndexPath], counterPaths:[IndexPath]), selectedDates: [Date]) { var retval = (selected:(indexPaths:[IndexPath](), counterPaths:[IndexPath]()), selectedDates: [Date]()) if !selectedDates.isEmpty { let selectedDates = self.selectedDates // Get the new paths let newPaths = self.pathsFromDates(selectedDates) // Get the new counter Paths var newCounterPaths: [IndexPath] = [] for date in selectedDates { if let counterPath = self.indexPathOfdateCellCounterPath(date, dateOwner: .thisMonth) { newCounterPaths.append(counterPath) } } // Append paths retval.selected.indexPaths.append(contentsOf: newPaths) retval.selected.counterPaths.append(contentsOf: newCounterPaths) // Append dates to retval for allPaths in [newPaths, newCounterPaths] { for path in allPaths { guard let dateFromPath = dateOwnerInfoFromPath(path)?.date else { continue } retval.selectedDates.append(dateFromPath) } } } return retval } func restoreSelectionStateForCellAtIndexPath(_ indexPath: IndexPath) { if theSelectedIndexPaths.contains(indexPath) { selectItem(at: indexPath, animated: false, scrollPosition: UICollectionViewScrollPosition() ) } } } extension JTAppleCalendarView { func handleScroll(point: CGPoint? = nil, indexPath: IndexPath? = nil, triggerScrollToDateDelegate: Bool = true, isAnimationEnabled: Bool, position: UICollectionViewScrollPosition? = .left, extraAddedOffset: CGFloat = 0, completionHandler: (() -> Void)?) { if isScrollInProgress { return } // point takes preference if let validPoint = point { scrollTo(point: validPoint, triggerScrollToDateDelegate: triggerScrollToDateDelegate, isAnimationEnabled: isAnimationEnabled, extraAddedOffset: extraAddedOffset, completionHandler: completionHandler) } else { guard let validIndexPath = indexPath else { return } if calendarViewLayout.thereAreHeaders && scrollDirection == .vertical { scrollToHeaderInSection(validIndexPath.section, triggerScrollToDateDelegate: triggerScrollToDateDelegate, withAnimation: isAnimationEnabled, extraAddedOffset: extraAddedOffset, completionHandler: completionHandler) } else { scrollTo(indexPath:validIndexPath, triggerScrollToDateDelegate: triggerScrollToDateDelegate, isAnimationEnabled: isAnimationEnabled, position: position ?? .left, extraAddedOffset: extraAddedOffset, completionHandler: completionHandler) } } } func scrollTo(point: CGPoint, triggerScrollToDateDelegate: Bool? = nil, isAnimationEnabled: Bool, extraAddedOffset: CGFloat, completionHandler: (() -> Void)?) { isScrollInProgress = true if let validCompletionHandler = completionHandler { self.delayedExecutionClosure.append(validCompletionHandler) } self.triggerScrollToDateDelegate = triggerScrollToDateDelegate var point = point if scrollDirection == .horizontal { point.x += extraAddedOffset } else { point.y += extraAddedOffset } DispatchQueue.main.async() { self.setContentOffset(point, animated: isAnimationEnabled) if (isAnimationEnabled && self.calendarOffsetIsAlreadyAtScrollPosition(forOffset: point)) || !isAnimationEnabled { self.scrollViewDidEndScrollingAnimation(self) } self.isScrollInProgress = false } } func indexPathOfdateCellCounterPath(_ date: Date, dateOwner: DateOwner) -> IndexPath? { if (cachedConfiguration.generateInDates == .off || cachedConfiguration.generateInDates == .forFirstMonthOnly) && cachedConfiguration.generateOutDates == .off { return nil } var retval: IndexPath? if dateOwner != .thisMonth { // If the cell is anything but this month, then the cell belongs // to either a previous of following month // Get the indexPath of the counterpartCell let counterPathIndex = pathsFromDates([date]) if !counterPathIndex.isEmpty { retval = counterPathIndex[0] } } else { // If the date does belong to this month, // then lets find out if it has a counterpart date if date < startOfMonthCache || date > endOfMonthCache { return retval } guard let dayIndex = calendar.dateComponents([.day], from: date).day else { print("Invalid Index") return nil } if case 1...13 = dayIndex { // then check the previous month // get the index path of the last day of the previous month let periodApart = calendar.dateComponents([.month], from: startOfMonthCache, to: date) guard let monthSectionIndex = periodApart.month, monthSectionIndex - 1 >= 0 else { // If there is no previous months, // there are no counterpart dates return retval } let previousMonthInfo = monthInfo[monthSectionIndex - 1] // If there are no postdates for the previous month, // then there are no counterpart dates if previousMonthInfo.outDates < 1 || dayIndex > previousMonthInfo.outDates { return retval } guard let prevMonth = calendar.date(byAdding: .month, value: -1, to: date), let lastDayOfPrevMonth = calendar.endOfMonth(for: prevMonth) else { assert(false, "Error generating date in indexPathOfdateCellCounterPath(). Contact the developer on github") return retval } let indexPathOfLastDayOfPreviousMonth = pathsFromDates([lastDayOfPrevMonth]) if indexPathOfLastDayOfPreviousMonth.isEmpty { print("out of range error in indexPathOfdateCellCounterPath() upper. This should not happen. Contact developer on github") return retval } let lastDayIndexPath = indexPathOfLastDayOfPreviousMonth[0] var section = lastDayIndexPath.section var itemIndex = lastDayIndexPath.item + dayIndex // Determine if the sections/item needs to be adjusted let extraSection = itemIndex / collectionView(self, numberOfItemsInSection: section) let extraIndex = itemIndex % collectionView(self, numberOfItemsInSection: section) section += extraSection itemIndex = extraIndex let reCalcRapth = IndexPath(item: itemIndex, section: section) retval = reCalcRapth } else if case 25...31 = dayIndex { // check the following month let periodApart = calendar.dateComponents([.month], from: startOfMonthCache, to: date) let monthSectionIndex = periodApart.month! if monthSectionIndex + 1 >= monthInfo.count { return retval } // If there is no following months, there are no counterpart dates let followingMonthInfo = monthInfo[monthSectionIndex + 1] if followingMonthInfo.inDates < 1 { return retval } // If there are no predates for the following month then there are no counterpart dates let lastDateOfCurrentMonth = calendar.endOfMonth(for: date)! let lastDay = calendar.component(.day, from: lastDateOfCurrentMonth) let section = followingMonthInfo.startSection let index = dayIndex - lastDay + (followingMonthInfo.inDates - 1) if index < 0 { return retval } retval = IndexPath(item: index, section: section) } } return retval } func setupMonthInfoDataForStartAndEndDate() -> CalendarData { var months = [Month]() var monthMap = [Int: Int]() var totalSections = 0 var totalDays = 0 if let validConfig = calendarDataSource?.configureCalendar(self) { let comparison = validConfig.calendar.compare(validConfig.startDate, to: validConfig.endDate, toGranularity: .nanosecond) if comparison == ComparisonResult.orderedDescending { assert(false, "Error, your start date cannot be greater than your end date\n") return (CalendarData(months: [], totalSections: 0, sectionToMonthMap: [:], totalDays: 0)) } // Set the new cache cachedConfiguration = validConfig if let startMonth = calendar.startOfMonth(for: validConfig.startDate), let endMonth = calendar.endOfMonth(for: validConfig.endDate) { startOfMonthCache = startMonth endOfMonthCache = endMonth // Create the parameters for the date format generator let parameters = ConfigurationParameters(startDate: startOfMonthCache, endDate: endOfMonthCache, numberOfRows: validConfig.numberOfRows, calendar: calendar, generateInDates: validConfig.generateInDates, generateOutDates: validConfig.generateOutDates, firstDayOfWeek: validConfig.firstDayOfWeek, hasStrictBoundaries: validConfig.hasStrictBoundaries) let generatedData = dateGenerator.setupMonthInfoDataForStartAndEndDate(parameters) months = generatedData.months monthMap = generatedData.monthMap totalSections = generatedData.totalSections totalDays = generatedData.totalDays } } let data = CalendarData(months: months, totalSections: totalSections, sectionToMonthMap: monthMap, totalDays: totalDays) return data } func sizesForMonthSection() -> [AnyHashable:CGFloat] { var retval: [AnyHashable:CGFloat] = [:] guard let headerSizes = calendarDelegate?.calendarSizeForMonths(self), headerSizes.defaultSize > 0 else { return retval } // Build the default retval["default"] = headerSizes.defaultSize // Build the every-month data if let allMonths = headerSizes.months { for (size, months) in allMonths { for month in months { assert(retval[month] == nil, "You have duplicated months. Please revise your month size data.") retval[month] = size } } } // Build the specific month data if let specificSections = headerSizes.dates { for (size, dateArray) in specificSections { let paths = pathsFromDates(dateArray) for path in paths { retval[path.section] = size } } } return retval } func pathsFromDates(_ dates: [Date]) -> [IndexPath] { var returnPaths: [IndexPath] = [] for date in dates { if calendar.startOfDay(for: date) >= startOfMonthCache! && calendar.startOfDay(for: date) <= endOfMonthCache! { let periodApart = calendar.dateComponents([.month], from: startOfMonthCache, to: date) let day = calendar.dateComponents([.day], from: date).day! guard let monthSectionIndex = periodApart.month else { continue } let currentMonthInfo = monthInfo[monthSectionIndex] if let indexPath = currentMonthInfo.indexPath(forDay: day) { returnPaths.append(indexPath) } } } return returnPaths } func cellStateFromIndexPath(_ indexPath: IndexPath, withDateInfo info: (date: Date, owner: DateOwner)? = nil, cell: JTAppleCell? = nil) -> CellState { let validDateInfo: (date: Date, owner: DateOwner) if let nonNilDateInfo = info { validDateInfo = nonNilDateInfo } else { guard let newDateInfo = dateOwnerInfoFromPath(indexPath) else { developerError(string: "Error this should not be nil. " + "Contact developer Jay on github by opening a request") return CellState(isSelected: false, text: "", dateBelongsTo: .thisMonth, date: Date(), day: .sunday, row: { return 0 }, column: { return 0 }, dateSection: { return (range: (Date(), Date()), month: 0, rowCount: 0) }, selectedPosition: {return .left}, cell: {return nil}) } validDateInfo = newDateInfo } let date = validDateInfo.date let dateBelongsTo = validDateInfo.owner let currentDay = calendar.component(.day, from: date) let componentWeekDay = calendar.component(.weekday, from: date) let cellText = String(describing: currentDay) let dayOfWeek = DaysOfWeek(rawValue: componentWeekDay)! let rangePosition = { () -> SelectionRangePosition in if !self.theSelectedIndexPaths.contains(indexPath) { return .none } if self.selectedDates.count == 1 { return .full } guard let nextIndexPath = self.calendarViewLayout.indexPath(direction: .next, of: indexPath.section, item: indexPath.item), let previousIndexPath = self.calendarViewLayout.indexPath(direction: .previous, of: indexPath.section, item: indexPath.item) else { return .full } let selectedIndicesContainsPreviousPath = self.theSelectedIndexPaths.contains(previousIndexPath) let selectedIndicesContainsFollowingPath = self.theSelectedIndexPaths.contains(nextIndexPath) var position: SelectionRangePosition if selectedIndicesContainsPreviousPath == selectedIndicesContainsFollowingPath { position = selectedIndicesContainsPreviousPath == false ? .full : .middle } else { position = selectedIndicesContainsPreviousPath == false ? .left : .right } return position } let cellState = CellState( isSelected: theSelectedIndexPaths.contains(indexPath), text: cellText, dateBelongsTo: dateBelongsTo, date: date, day: dayOfWeek, row: { return indexPath.item / maxNumberOfDaysInWeek }, column: { return indexPath.item % maxNumberOfDaysInWeek }, dateSection: { return self.monthInfoFromSection(indexPath.section)! }, selectedPosition: rangePosition, cell: { return cell } ) return cellState } func batchReloadIndexPaths(_ indexPaths: [IndexPath]) { let visiblePaths = indexPathsForVisibleItems var visiblePathsToReload: [IndexPath] = [] var invisiblePathsToRelad: [IndexPath] = [] for path in indexPaths { if visiblePaths.contains(path) { visiblePathsToReload.append(path) } else { invisiblePathsToRelad.append(path) } } // Reload the invisible paths first. // Why reload invisible paths? because they have already been prefetched if !invisiblePathsToRelad.isEmpty { calendarViewLayout.shouldClearCacheOnInvalidate = false reloadItems(at: invisiblePathsToRelad) } // Reload the visible paths if !visiblePathsToReload.isEmpty { UICollectionView.performWithoutAnimation { self.calendarViewLayout.shouldClearCacheOnInvalidate = false performBatchUpdates({[unowned self] in self.reloadItems(at: visiblePathsToReload) }) } } } func selectDate(indexPath: IndexPath, date: Date, shouldTriggerSelecteionDelegate: Bool) -> Set<IndexPath> { var allIndexPathsToReload: Set<IndexPath> = [] selectItem(at: indexPath, animated: false, scrollPosition: []) allIndexPathsToReload.insert(indexPath) // If triggereing is enabled, then let their delegate // handle the reloading of view, else we will reload the data if shouldTriggerSelecteionDelegate { self.collectionView(self, didSelectItemAt: indexPath) } else { // Although we do not want the delegate triggered, // we still want counterpart cells to be selected addCellToSelectedSetIfUnselected(indexPath, date: date) let cellState = self.cellStateFromIndexPath(indexPath) if isRangeSelectionUsed { allIndexPathsToReload.formUnion(Set(validForwardAndBackwordSelectedIndexes(forIndexPath: indexPath))) } if let aSelectedCounterPartIndexPath = self.selectCounterPartCellIndexPathIfExists(indexPath, date: date, dateOwner: cellState.dateBelongsTo) { // If there was a counterpart cell then // it will also need to be reloaded allIndexPathsToReload.insert(aSelectedCounterPartIndexPath) if isRangeSelectionUsed { allIndexPathsToReload.formUnion(Set(validForwardAndBackwordSelectedIndexes(forIndexPath: aSelectedCounterPartIndexPath))) } } } return allIndexPathsToReload } func deselectDate(oldIndexPath: IndexPath, shouldTriggerSelecteionDelegate: Bool) -> Set<IndexPath> { var allIndexPathsToReload: Set<IndexPath> = [] if let index = self.theSelectedIndexPaths.index(of: oldIndexPath) { let oldDate = self.theSelectedDates[index] self.deselectItem(at: oldIndexPath, animated: false) self.theSelectedIndexPaths.remove(at: index) self.theSelectedDates.remove(at: index) // If delegate triggering is enabled, let the // delegate function handle the cell if shouldTriggerSelecteionDelegate { self.collectionView(self, didDeselectItemAt: oldIndexPath) } else { // Although we do not want the delegate triggered, // we still want counterpart cells to be deselected allIndexPathsToReload.insert(oldIndexPath) let cellState = self.cellStateFromIndexPath(oldIndexPath) if isRangeSelectionUsed { allIndexPathsToReload.formUnion(Set(validForwardAndBackwordSelectedIndexes(forIndexPath: oldIndexPath))) } if let anUnselectedCounterPartIndexPath = self.deselectCounterPartCellIndexPath(oldIndexPath, date: oldDate, dateOwner: cellState.dateBelongsTo) { // If there was a counterpart cell then // it will also need to be reloaded allIndexPathsToReload.insert(anUnselectedCounterPartIndexPath) if isRangeSelectionUsed { allIndexPathsToReload.formUnion(Set(validForwardAndBackwordSelectedIndexes(forIndexPath: anUnselectedCounterPartIndexPath))) } } } } return allIndexPathsToReload } func addCellToSelectedSetIfUnselected(_ indexPath: IndexPath, date: Date) { if self.theSelectedIndexPaths.contains(indexPath) == false { self.theSelectedIndexPaths.append(indexPath) self.theSelectedDates.append(date) } } func deleteCellFromSelectedSetIfSelected(_ indexPath: IndexPath) { if let index = self.theSelectedIndexPaths.index(of: indexPath) { self.theSelectedIndexPaths.remove(at: index) self.theSelectedDates.remove(at: index) } } func deselectCounterPartCellIndexPath(_ indexPath: IndexPath, date: Date, dateOwner: DateOwner) -> IndexPath? { if let counterPartCellIndexPath = indexPathOfdateCellCounterPath(date, dateOwner: dateOwner) { deleteCellFromSelectedSetIfSelected(counterPartCellIndexPath) return counterPartCellIndexPath } return nil } func selectCounterPartCellIndexPathIfExists(_ indexPath: IndexPath, date: Date, dateOwner: DateOwner) -> IndexPath? { if let counterPartCellIndexPath = indexPathOfdateCellCounterPath(date, dateOwner: dateOwner) { let dateComps = calendar.dateComponents([.month, .day, .year], from: date) guard let counterpartDate = calendar.date(from: dateComps) else { return nil } addCellToSelectedSetIfUnselected(counterPartCellIndexPath, date: counterpartDate) return counterPartCellIndexPath } return nil } func monthInfoFromSection(_ section: Int) -> (range: (start: Date, end: Date), month: Int, rowCount: Int)? { guard let monthIndex = monthMap[section] else { return nil } let monthData = monthInfo[monthIndex] guard let monthDataMapSection = monthData.sectionIndexMaps[section], let indices = monthData.boundaryIndicesFor(section: monthDataMapSection) else { return nil } let startIndexPath = IndexPath(item: indices.startIndex, section: section) let endIndexPath = IndexPath(item: indices.endIndex, section: section) guard let startDate = dateOwnerInfoFromPath(startIndexPath)?.date, let endDate = dateOwnerInfoFromPath(endIndexPath)?.date else { return nil } if let monthDate = calendar.date(byAdding: .month, value: monthIndex, to: startDateCache) { let monthNumber = calendar.dateComponents([.month], from: monthDate) let numberOfRowsForSection = monthData.numberOfRows(for: section, developerSetRows: cachedConfiguration.numberOfRows) return ((startDate, endDate), monthNumber.month!, numberOfRowsForSection) } return nil } /// Retrieves the current section public func currentSection() -> Int? { let minVisiblePaths = calendarViewLayout.minimumVisibleIndexPaths() return minVisiblePaths.cellIndex?.section } func dateSegmentInfoFrom(visible indexPaths: [IndexPath]) -> DateSegmentInfo { var inDates = [(Date, IndexPath)]() var monthDates = [(Date, IndexPath)]() var outDates = [(Date, IndexPath)]() for indexPath in indexPaths { let info = dateOwnerInfoFromPath(indexPath) if let validInfo = info { switch validInfo.owner { case .thisMonth: monthDates.append((validInfo.date, indexPath)) case .previousMonthWithinBoundary, .previousMonthOutsideBoundary: inDates.append((validInfo.date, indexPath)) default: outDates.append((validInfo.date, indexPath)) } } } let retval = DateSegmentInfo(indates: inDates, monthDates: monthDates, outdates: outDates) return retval } func dateOwnerInfoFromPath(_ indexPath: IndexPath) -> (date: Date, owner: DateOwner)? { // Returns nil if date is out of scope guard let monthIndex = monthMap[indexPath.section] else { return nil } let monthData = monthInfo[monthIndex] // Calculate the offset let offSet: Int var numberOfDaysToAddToOffset: Int = 0 switch monthData.sectionIndexMaps[indexPath.section]! { case 0: offSet = monthData.inDates default: offSet = 0 let currentSectionIndexMap = monthData.sectionIndexMaps[indexPath.section]! numberOfDaysToAddToOffset = monthData.sections[0..<currentSectionIndexMap].reduce(0, +) numberOfDaysToAddToOffset -= monthData.inDates } var dayIndex = 0 var dateOwner: DateOwner = .thisMonth let date: Date? if indexPath.item >= offSet && indexPath.item + numberOfDaysToAddToOffset < monthData.numberOfDaysInMonth + offSet { // This is a month date dayIndex = monthData.startDayIndex + indexPath.item - offSet + numberOfDaysToAddToOffset date = calendar.date(byAdding: .day, value: dayIndex, to: startOfMonthCache) } else if indexPath.item < offSet { // This is a preDate dayIndex = indexPath.item - offSet + monthData.startDayIndex date = calendar.date(byAdding: .day, value: dayIndex, to: startOfMonthCache) if date! < startOfMonthCache { dateOwner = .previousMonthOutsideBoundary } else { dateOwner = .previousMonthWithinBoundary } } else { // This is a postDate dayIndex = monthData.startDayIndex - offSet + indexPath.item + numberOfDaysToAddToOffset date = calendar.date(byAdding: .day, value: dayIndex, to: startOfMonthCache) if date! > endOfMonthCache { dateOwner = .followingMonthOutsideBoundary } else { dateOwner = .followingMonthWithinBoundary } } guard let validDate = date else { return nil } return (validDate, dateOwner) } }
mit
3789d454f974e8c58572d2997f3e699c
45.493217
205
0.61293
5.844214
false
false
false
false
1457792186/JWSwift
SwiftWX/LGWeChatKit/LGChatKit/utilities/LGAudioRecorder.swift
1
4121
// // LGAudioRecorder.swift // LGChatViewController // // Created by jamy on 10/13/15. // Copyright © 2015 jamy. All rights reserved. // import UIKit import AVFoundation protocol LGAudioRecorderDelegate { func audioRecorderUpdateMetra(_ metra: Float) } let soundPath = NSSearchPathForDirectoriesInDomains(.documentDirectory, .userDomainMask, true).first! let audioSettings: [String: AnyObject] = [AVLinearPCMIsFloatKey: NSNumber(value: false as Bool), AVLinearPCMIsBigEndianKey: NSNumber(value: false as Bool), AVLinearPCMBitDepthKey: NSNumber(value: 16 as Int32), AVFormatIDKey: NSNumber(value: kAudioFormatLinearPCM as UInt32), AVNumberOfChannelsKey: NSNumber(value: 1 as Int32), AVSampleRateKey: NSNumber(value: 16000 as Int32), AVEncoderAudioQualityKey: NSNumber(value: AVAudioQuality.medium.rawValue as Int)] class LGAudioRecorder: NSObject, AVAudioRecorderDelegate { var audioData: Data! var operationQueue: OperationQueue! var recorder: AVAudioRecorder! var startTime: Double! var endTimer: Double! var timeInterval: NSNumber! var delegate: LGAudioRecorderDelegate? convenience init(fileName: String) { self.init() let filePath = URL(fileURLWithPath: (soundPath as NSString).appendingPathComponent(fileName)) recorder = try! AVAudioRecorder(url: filePath, settings: audioSettings) recorder.delegate = self recorder.isMeteringEnabled = true } override init() { operationQueue = OperationQueue() super.init() } func startRecord() { startTime = Date().timeIntervalSince1970 perform(#selector(LGAudioRecorder.readyStartRecord), with: self, afterDelay: 0.5) } func readyStartRecord() { let audioSession = AVAudioSession.sharedInstance() do { try audioSession.setCategory(AVAudioSessionCategoryRecord) } catch { NSLog("setCategory fail") return } do { try audioSession.setActive(true) } catch { NSLog("setActive fail") return } recorder.record() let operation = BlockOperation() operation.addExecutionBlock(updateMeters) operationQueue.addOperation(operation) } func stopRecord() { endTimer = Date().timeIntervalSince1970 timeInterval = nil if (endTimer - startTime) < 0.5 { NSObject.cancelPreviousPerformRequests(withTarget: self, selector: #selector(LGAudioRecorder.readyStartRecord), object: self) } else { timeInterval = NSNumber(value: NSNumber(value: recorder.currentTime as Double).int32Value as Int32) if timeInterval.int32Value < 1 { perform(#selector(LGAudioRecorder.readyStopRecord), with: self, afterDelay: 0.4) } else { readyStopRecord() } } operationQueue.cancelAllOperations() } func readyStopRecord() { recorder.stop() let audioSession = AVAudioSession.sharedInstance() do { try audioSession.setActive(false, with: .notifyOthersOnDeactivation) } catch { // no-op } audioData = try? Data(contentsOf: recorder.url) } func updateMeters() { repeat { recorder.updateMeters() timeInterval = NSNumber(value: NSNumber(value: recorder.currentTime as Double).floatValue as Float) let averagePower = recorder.averagePower(forChannel: 0) // let pearPower = recorder.peakPowerForChannel(0) // NSLog("%@ %f %f", timeInterval, averagePower, pearPower) delegate?.audioRecorderUpdateMetra(averagePower) Thread.sleep(forTimeInterval: 0.2) } while(recorder.isRecording) } // MARK: audio delegate func audioRecorderEncodeErrorDidOccur(_ recorder: AVAudioRecorder, error: Error?) { NSLog("%@", (error?.localizedDescription)!) } }
apache-2.0
50138a2a9930774c14ab31b9069c6c6d
31.440945
137
0.641262
5.18239
false
false
false
false
SwiftArchitect/BezierCurveView
BezierCurveView/BezierCurveView.swift
1
8090
// @file: BezierCurveView.swift // @project: BezierCurveView // // Copyright © 2017, 2018 Xavier Schott // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. import UIKit @IBDesignable public class BezierCurveView: UIView { public enum Shape:NSInteger { case none = 0 case arrowHead case circle case disc } @IBInspectable public var lineWidth:CGFloat = 1.5 // MARK: Calculated properties var curveColor:UIColor { get { return tintColor ?? UIColor.black } } var handleColor: UIColor { get{ return UIColor.red } } // MARK: BezierCurveView override init(frame: CGRect) { super.init(frame: frame) contentMode = .redraw } public required init?(coder aDecoder: NSCoder) { super.init(coder: aDecoder) contentMode = .redraw } public override func draw(_ rect: CGRect) { if let context = UIGraphicsGetCurrentContext() { var handles:[BezierHandleProtocol] = [] for view in subviews { if let bezierCurveHandleView = view as? BezierHandleProtocol { handles.append(bezierCurveHandleView) } } if 2 == handles.count, let handle1 = handles.first, let handle2 = handles.last { // controls are expressed in relative terms against their anchors let cp1 = CGPoint(x: handle1.anchor.x + handle1.controlPoint.x, y: handle1.anchor.y + handle1.controlPoint.y) let cp2 = CGPoint(x: handle2.anchor.x + handle2.controlPoint.x, y: handle2.anchor.y + handle2.controlPoint.y) // Terminal shapes let anchor1 = drawShape(shape: handle1.terminalShape, size: handle1.terminalSize, o: handle1.anchor, m: cp1, inContext: context) let anchor2 = drawShape(shape: handle2.terminalShape, size: handle2.terminalSize, o: handle2.anchor, m: cp2, inContext: context) // Curve context.setStrokeColor(curveColor.cgColor) context.setLineWidth(lineWidth) context.beginPath() context.move(to: anchor1) context.addCurve(to: anchor2, control1: CGPoint(x: anchor1.x + handle1.controlPoint.x, y: anchor1.y + handle1.controlPoint.y), control2: CGPoint(x: anchor2.x + handle2.controlPoint.x, y: anchor2.y + handle2.controlPoint.y)) // Cubic curve context.strokePath() // Handles and control points drawHandle(handle: handle1, inContext: context) drawHandle(handle: handle2, inContext: context) } } } func drawHandle(handle:BezierHandleProtocol, inContext context:CGContext) { #if TARGET_INTERFACE_BUILDER // Control Points let cpRadius:CGFloat = 2 let cp = CGPoint(x: handle.anchor.x + handle.controlPoint.x, y: handle.anchor.y + handle.controlPoint.y) context.beginPath() context.move(to: handle.anchor) context.addLine(to: cp) context.setStrokeColor(handleColor.cgColor) context.setLineWidth(1) context.strokePath() context.setFillColor(handleColor.cgColor) context.fillEllipse(in: CGRect(x: cp.x-cpRadius, y: cp.y-cpRadius, width: cpRadius+cpRadius, height: cpRadius+cpRadius)) #endif // TARGET_INTERFACE_BUILDER } // Return the location of the new anchor point for the curve func drawShape(shape:BezierCurveView.Shape, size:CGFloat, o:CGPoint, m:CGPoint, inContext context:CGContext) -> CGPoint { switch shape { case .arrowHead: // Connect the arrowhead to the shaft let θ = radAngle(o:o, m:m) let π = CGFloat.pi let origin = polarToCartesian(o: o, r: -size, θ: θ + π) let shaft = polarToCartesian(o: origin, r: size/2, θ: θ + π) context.move(to: origin) context.addLine(to: shaft) context.setStrokeColor(curveColor.cgColor) context.setLineWidth(lineWidth) context.strokePath() // Draw arrowhead point and ears (retraction) let headPath = CGMutablePath() headPath.move(to: o) let ear1 = polarToCartesian(o: o, r: size, θ: θ + 0.3) headPath.addLine(to: ear1) let neck = polarToCartesian(o: origin, r: size/4, θ: θ + π) headPath.addLine(to: neck) let ear2 = polarToCartesian(o: o, r: size, θ: θ - 0.3) headPath.addLine( to: ear2) headPath.closeSubpath() context.setFillColor(curveColor.cgColor) context.addPath(headPath) context.fillPath() return origin case .circle: fallthrough case .disc: let θ = radAngle(o:o, m:m) let π = CGFloat.pi let origin = polarToCartesian(o: o, r: -size, θ: θ + π) context.addEllipse(in: CGRect(x: o.x - size, y: o.y - size, width: size + size, height: size + size)) if .circle == shape { context.setStrokeColor(curveColor.cgColor) context.setLineWidth(lineWidth) context.strokePath() } else { // .disc context.setFillColor(curveColor.cgColor) context.fillPath() } return origin case .none: return o } } func polarToCartesian(o:CGPoint, r:CGFloat, θ:CGFloat) -> CGPoint { let m = CGPoint(x: r * CGFloat(cos(θ)), y: r * CGFloat(sin(θ))) return CGPoint(x: o.x + m.x, y: o.y + m.y) } func radAngle(o:CGPoint, m:CGPoint) -> CGFloat { let vector = CGVector(dx: m.x - o.x, dy: m.y - o.y) return atan2(vector.dy, vector.dx) // in radians } }
mit
b933645a6973a46e061d5d816e640a31
36.170507
105
0.526655
4.68137
false
false
false
false
toshiapp/toshi-ios-client
Toshi/Models/Message.swift
1
5859
// Copyright (c) 2018 Token Browser, Inc // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. import Foundation import UIKit class Message: NSObject { var fiatValueString: String? var ethereumValueString: String? var messageId: String = UUID().uuidString var messageType: String = "Text" let signalMessage: TSMessage var attributedTitle: NSAttributedString? var attributedSubtitle: NSAttributedString? var attachment: TSAttachment? { if signalMessage.hasAttachments(), let attachmentId = (self.signalMessage.attachmentIds as? [String])?.first, let attachment = TSAttachment.fetch(uniqueId: attachmentId) { return attachment } return nil } private lazy var attachmentsCache: NSCache<NSString, UIImage> = { NSCache<NSString, UIImage>() }() private func streamImage(for stream: TSAttachmentStream) -> UIImage? { var image: UIImage? if let cachedImage = self.attachmentsCache.object(forKey: self.uniqueIdentifier() as NSString) { image = cachedImage } else { if let streamImage = stream.image() { attachmentsCache.setObject(streamImage, forKey: uniqueIdentifier() as NSString) image = streamImage } } return image } var image: UIImage? { if attachment is TSAttachmentPointer { return ImageAsset.placeholder } else if let stream = attachment as? TSAttachmentStream { guard let image = self.streamImage(for: stream) else { return ImageAsset.placeholder } // TODO: add play button if video return image } return nil } var title: String? { set { if let string = newValue { attributedTitle = NSAttributedString(string: string, attributes: [.font: Theme.semibold(size: 15), .foregroundColor: Theme.incomingMessageTextColor]) } else { attributedTitle = nil } } get { return attributedTitle?.string } } var subtitle: String? { set { if let string = newValue { attributedSubtitle = NSAttributedString(string: string, attributes: [.font: Theme.preferredRegularSmall(), .foregroundColor: Theme.incomingMessageTextColor]) } else { attributedSubtitle = nil } } get { return attributedSubtitle?.string } } var date: Date var isOutgoing: Bool = true var isActionable: Bool var deliveryStatus: TSOutgoingMessageState { return (self.signalMessage as? TSOutgoingMessage)?.messageState ?? .attemptingOut } var sofaWrapper: SofaWrapper? var isDisplayable: Bool { // we are displayable even if there's no sofa content but we have attachments guard self.attachment == nil else { return true } // we don't display them if sofa wrapper is nil guard let sofaWrapper = self.sofaWrapper else { return false } // if we have no attachments and still have a wrapper, if it's a .message but empty // it's a `wake up` message, so we don't display them either, if it is payment message and destination address is valid, if it is a status message having attributed text. if let message = sofaWrapper as? SofaMessage { guard !message.body.isEmpty else { return false } } else if let paymentRequest = sofaWrapper as? SofaPaymentRequest { guard EthereumAddress.validate(paymentRequest.destinationAddress) else { return false } } else if let status = sofaWrapper as? SofaStatus { guard status.attributedText != nil else { return false } } let typesThatShouldBeDisplayed: [SofaType] = [.message, .paymentRequest, .payment, .command, .status] return typesThatShouldBeDisplayed.contains(sofaWrapper.type) } var text: String? { guard let sofaWrapper = self.sofaWrapper else { return nil } switch sofaWrapper.type { case .message: return (sofaWrapper as? SofaMessage)?.body case .paymentRequest: return (sofaWrapper as? SofaPaymentRequest)?.body case .payment: return nil case .command: return (sofaWrapper as? SofaCommand)?.body default: return sofaWrapper.content } } var attributedText: NSAttributedString? { guard let sofaWrapper = self.sofaWrapper, sofaWrapper.type == .status else { return nil } return (sofaWrapper as? SofaStatus)?.attributedText } func uniqueIdentifier() -> String { return self.messageId } func type() -> String { return self.messageType } init(sofaWrapper: SofaWrapper?, signalMessage: TSMessage, date: Date? = nil, isOutgoing: Bool = true, shouldProcess: Bool = false) { self.sofaWrapper = sofaWrapper self.isOutgoing = isOutgoing self.signalMessage = signalMessage self.date = date ?? Date() self.isActionable = shouldProcess && !isOutgoing && (sofaWrapper?.type == .paymentRequest) super.init() } }
gpl-3.0
27347a88bc1188ba1556e96a82e6d1f2
33.464706
179
0.64243
4.870324
false
false
false
false
qiuncheng/study-for-swift
learn-rx-swift/Chocotastic-starter/Pods/RxCocoa/RxCocoa/iOS/Proxies/RxCollectionViewDataSourceProxy.swift
9
3916
// // RxCollectionViewDataSourceProxy.swift // RxCocoa // // Created by Krunoslav Zaher on 6/29/15. // Copyright © 2015 Krunoslav Zaher. All rights reserved. // #if os(iOS) || os(tvOS) import Foundation import UIKit #if !RX_NO_MODULE import RxSwift #endif let collectionViewDataSourceNotSet = CollectionViewDataSourceNotSet() class CollectionViewDataSourceNotSet : NSObject , UICollectionViewDataSource { func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { return 0 } // The cell that is returned must be retrieved from a call to -dequeueReusableCellWithReuseIdentifier:forIndexPath: func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { rxAbstractMethodWithMessage(dataSourceNotSet) } } /** For more information take a look at `DelegateProxyType`. */ public class RxCollectionViewDataSourceProxy : DelegateProxy , UICollectionViewDataSource , DelegateProxyType { /** Typed parent object. */ public weak private(set) var collectionView: UICollectionView? private weak var _requiredMethodsDataSource: UICollectionViewDataSource? = collectionViewDataSourceNotSet /** Initializes `RxCollectionViewDataSourceProxy` - parameter parentObject: Parent object for delegate proxy. */ public required init(parentObject: AnyObject) { self.collectionView = (parentObject as! UICollectionView) super.init(parentObject: parentObject) } // MARK: delegate /** Required delegate method implementation. */ public func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { return (_requiredMethodsDataSource ?? collectionViewDataSourceNotSet).collectionView(collectionView, numberOfItemsInSection: section) } /** Required delegate method implementation. */ public func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { return (_requiredMethodsDataSource ?? collectionViewDataSourceNotSet).collectionView(collectionView, cellForItemAt: indexPath) } // MARK: proxy /** For more information take a look at `DelegateProxyType`. */ public override class func createProxyForObject(_ object: AnyObject) -> AnyObject { let collectionView = (object as! UICollectionView) return castOrFatalError(collectionView.createRxDataSourceProxy()) } /** For more information take a look at `DelegateProxyType`. */ public override class func delegateAssociatedObjectTag() -> UnsafeRawPointer { return _pointer(&dataSourceAssociatedTag) } /** For more information take a look at `DelegateProxyType`. */ public class func setCurrentDelegate(_ delegate: AnyObject?, toObject object: AnyObject) { let collectionView: UICollectionView = castOrFatalError(object) collectionView.dataSource = castOptionalOrFatalError(delegate) } /** For more information take a look at `DelegateProxyType`. */ public class func currentDelegateFor(_ object: AnyObject) -> AnyObject? { let collectionView: UICollectionView = castOrFatalError(object) return collectionView.dataSource } /** For more information take a look at `DelegateProxyType`. */ public override func setForwardToDelegate(_ forwardToDelegate: AnyObject?, retainDelegate: Bool) { let requiredMethodsDataSource: UICollectionViewDataSource? = castOptionalOrFatalError(forwardToDelegate) _requiredMethodsDataSource = requiredMethodsDataSource ?? collectionViewDataSourceNotSet super.setForwardToDelegate(forwardToDelegate, retainDelegate: retainDelegate) } } #endif
mit
ff8980e720192c01d60cc8fdc985bf32
31.625
141
0.72567
6.107644
false
false
false
false
Karumi/MarvelApiClient
MarvelApiClient/MarvelAPIAuthentication.swift
1
1070
// // MarvelAPIAuthentication.swift // MarvelAPIClient // // Created by Pedro Vicente Gomez on 04/01/16. // Copyright © 2016 GoKarumi S.L. All rights reserved. // import Foundation import BothamNetworking class MarvelAPIAuthentication: BothamRequestInterceptor { private let timeProvider: TimeProvider init(timeProvider: TimeProvider) { self.timeProvider = timeProvider } func intercept(_ request: HTTPRequest) -> HTTPRequest { let timestamp = timeProvider.currentTimeMillis() let privateKey = MarvelAPIClient.privateKey let publicKey = MarvelAPIClient.publicKey let hash = MarvelHashGenerator.generateHash(timestamp: Int(timestamp), privateKey: privateKey, publicKey: publicKey) let authParams = [MarvelAPIParams.timestamp: "\(timestamp)", MarvelAPIParams.apiKey: publicKey, MarvelAPIParams.hash: hash] return request.appendingParameters(authParams) } }
apache-2.0
a3535591e19e58e8c7d0f024ba3bf64f
31.393939
78
0.647334
5.240196
false
false
false
false
jalehman/rottentomatoes
RottenTomatoes/MoviesListViewController.swift
1
4368
// // MoviesListViewController.swift // RottenTomatoes // // Created by Josh Lehman on 2/5/15. // Copyright (c) 2015 Josh Lehman. All rights reserved. // import UIKit import Bond import JGProgressHUD class MoviesListViewController: UIViewController, UISearchBarDelegate, UITableViewDelegate { // MARK: Properties var refreshControl: UIRefreshControl! @IBOutlet var tapGestureRecognizer: UITapGestureRecognizer! @IBOutlet weak var moviesListTableView: UITableView! @IBOutlet weak var moviesSearchBar: UISearchBar! @IBOutlet weak var networkErrorView: UIView! private let viewModel: MoviesListViewModel private var lastQuery: String? // MARK: API init(viewModel: MoviesListViewModel) { self.viewModel = viewModel super.init(nibName: "MoviesListViewController", bundle: nil) } required init(coder aDecoder: NSCoder) { fatalError("init(coder:) has not been implemented") } // MARK: UIViewController Impl override func viewDidLoad() { super.viewDidLoad() edgesForExtendedLayout = .None // Register the nib file with the tableview under a reuse identifier moviesListTableView.registerNib(UINib(nibName: "MovieTableViewCell", bundle: nil), forCellReuseIdentifier: "com.jl.movieCell") moviesSearchBar.delegate = self moviesListTableView.delegate = self tapGestureRecognizer.enabled = false refreshControl = UIRefreshControl() refreshControl.addTarget(self, action: "searchMovies", forControlEvents: .ValueChanged) moviesListTableView.insertSubview(refreshControl, atIndex: 0) networkErrorView.hidden = true moviesListTableView.separatorColor = UIColor.lightGrayColor() bindViewModel() } override func viewWillAppear(animated: Bool) { super.viewWillAppear(animated) navigationController?.navigationBar.alpha = 1 if lastQuery == nil || lastQuery != moviesSearchBar.text { searchMovies() } } override func viewWillDisappear(animated: Bool) { super.viewWillDisappear(animated) lastQuery = moviesSearchBar.text } // MARK: Actions @IBAction func tapGestureReceieved(sender: AnyObject) { moviesSearchBar.resignFirstResponder() if moviesSearchBar.text == "" && lastQuery != moviesSearchBar.text { searchMovies() } } // MARK: UISearchBarDelegate Impl func searchBarTextDidBeginEditing(searchBar: UISearchBar) { tapGestureRecognizer.enabled = true } func searchBarTextDidEndEditing(searchBar: UISearchBar) { tapGestureRecognizer.enabled = false } func searchBarSearchButtonClicked(searchBar: UISearchBar) { moviesSearchBar.resignFirstResponder() searchMovies() } // MARK: UITableViewDelegate Impl func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) { viewModel.showMovieDetailView(indexPath.row) tableView.deselectRowAtIndexPath(indexPath, animated: true) } func searchMovies() { let hud = JGProgressHUD(style: JGProgressHUDStyle.Dark) hud.textLabel.text = "Loading" hud.showInView(view) lastQuery = moviesSearchBar.text viewModel.fetchMovies(moviesSearchBar.text, completion: { hud.dismiss() self.refreshControl.endRefreshing() self.networkErrorView.hidden = true }, error: { (error: NSError) in hud.dismiss() self.refreshControl.endRefreshing() self.networkErrorView.hidden = false }) } // MARK: Private private func bindViewModel() { // From Bond example here: https://github.com/SwiftBond/Bond/blob/master/README.md#what-can-it-do viewModel.movies.map { [unowned self] (viewModel: MovieViewModel) -> MovieTableViewCell in let cell = self.moviesListTableView.dequeueReusableCellWithIdentifier("com.jl.movieCell") as MovieTableViewCell cell.bindViewModel(viewModel) return cell } ->> self.moviesListTableView } }
gpl-2.0
7ba652a3fae36d36ec2b2bd1885b2765
31.355556
134
0.655678
5.501259
false
false
false
false
manfengjun/KYMart
Section/Cart/Controller/KYCartViewController.swift
1
7899
// // KYCartViewController.swift // KYMart // // Created by Jun on 2017/6/10. // Copyright © 2017年 JUN. All rights reserved. // import UIKit fileprivate let CartTVCellIdentifier = "cartTVCell" class KYCartViewController: UIViewController { var CountResultClosure: ResultClosure? // 闭包 /// 是否全选 var isSelectAll = false /// 底部按钮 fileprivate lazy var bottomView:KYCartFootView = { let bottomView = KYCartFootView(frame: CGRect(x: 0, y: SCREEN_HEIGHT - 50 - 49, width: SCREEN_WIDTH, height: 50)) bottomView.selectAllResult({ self.isSelectAll = self.isSelectAll ? false : true bottomView.selectAllBtn.setImage(self.isSelectAll ? UIImage(named: "cart_select_yes") : UIImage(named: "cart_select_no"), for: .normal) let cart_form_datas = NSMutableArray() if let array = self.cartListModel?.storeList { for storeList in array { for cartList in storeList.cartList { let cart_form_data = KYCartFormModel() cartList.selected = self.isSelectAll ? "1" : "0" cart_form_data.cartID = cartList.id cart_form_data.goodsNum = cartList.goods_num cart_form_data.storeCount = cartList.store_count cart_form_data.selected = cartList.selected cart_form_datas.add(cart_form_data) } } self.dataRequest(cart_form_datas: cart_form_datas) } }) bottomView.balanceSelectResult({ /// 结算 var isHaveSelect = false if let array = self.cartListModel?.storeList { for storeList in array { for cartList in storeList.cartList { if cartList.selected == "1"{ isHaveSelect = true break } } } } if isHaveSelect { self.performSegue(withIdentifier: "C_order_SegueID", sender: "") } else{ Toast(content: "没有选择商品!") } }) return bottomView }() /// 列表 fileprivate lazy var tableView : UITableView = { let tableView = UITableView(frame: CGRect(x: 0, y: 0, width: SCREEN_WIDTH, height: SCREEN_HEIGHT - 113), style: .plain) tableView.showsVerticalScrollIndicator = false tableView.separatorStyle = .none tableView.register(UINib(nibName: "CartTVCell", bundle: nil), forCellReuseIdentifier: CartTVCellIdentifier) tableView.backgroundColor = UIColor.white tableView.delegate = self tableView.dataSource = self return tableView }() /// post更改参数 var cartForm:[KYCartFormModel] = [] /// 列表数据 var cartListModel:KYCartListModel?{ didSet { bottomView.cartListModel = cartListModel tableView.reloadData() } } override func viewDidLoad() { super.viewDidLoad() setupUI() // Do any additional setup after loading the view. } override func viewWillAppear(_ animated: Bool) { super.viewWillAppear(animated) UIApplication.shared.keyWindow?.addSubview(bottomView) dataRequest(cart_form_datas: nil) } override func viewWillDisappear(_ animated: Bool) { super.viewWillDisappear(animated) bottomView.removeFromSuperview() } func setupUI() { self.navigationItem.title = "购物车" view.addSubview(tableView) } override func didReceiveMemoryWarning() { super.didReceiveMemoryWarning() // Dispose of any resources that can be recreated. } /* // MARK: - Navigation // In a storyboard-based application, you will often want to do a little preparation before navigation override func prepare(for segue: UIStoryboardSegue, sender: Any?) { // Get the new view controller using segue.destinationViewController. // Pass the selected object to the new view controller. } */ } extension KYCartViewController{ func dataRequest(cart_form_datas:NSMutableArray?) { let user_id = SingleManager.instance.loginInfo?.user_id let unique_id = SingleManager.getUUID() let token = SingleManager.instance.loginInfo?.token var params:[String:String]? if cart_form_datas != nil && (cart_form_datas?.count)! > 0 { let jsonStr = cart_form_datas?.yy_modelToJSONString() params = [ "user_id":user_id!, "unique_id":unique_id, "token":token!,"cart_form_data":jsonStr!] } else { params = [ "user_id":user_id!, "unique_id":unique_id, "token":token!] } SJBRequestModel.push_fetchCartProductData(params: params! as [String : AnyObject]) { (response, status) in if status == 1{ self.cartListModel = response as? KYCartListModel } } } } extension KYCartViewController:UITableViewDelegate,UITableViewDataSource{ func numberOfSections(in tableView: UITableView) -> Int { if let storelist = cartListModel?.storeList { return storelist.count } return 0 } func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { if let storelist = cartListModel?.storeList { if let array = storelist[section].cartList { return array.count } } return 0 } func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { let cell = tableView.dequeueReusableCell(withIdentifier: CartTVCellIdentifier, for: indexPath) as! CartTVCell if let storelist = cartListModel?.storeList { if let array = storelist[indexPath.section].cartList { cell.model = array[indexPath.row] cell.cartChangeResult({ (response,index) in if index == 2{ if let id = response{ let unique_id = SingleManager.getUUID() let token = SingleManager.instance.loginInfo?.token let params = ["ids":id,"token":token!,"unique_id":unique_id] as [String : AnyObject] print(params) SJBRequestModel.push_fetchCartDelData(params: params) { (response, status) in if status == 1{ self.Toast(content: "删除成功!") self.dataRequest(cart_form_datas: nil) } else { self.Toast(content:response as! String) } } } } else { if response != nil{ if let temModel = response{ let cart_form_datas = NSMutableArray() cart_form_datas.add(temModel) self.dataRequest(cart_form_datas: cart_form_datas) } } } }) } } return cell } func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat { return 100 } }
mit
8df0a963c1a2fc165bb0c6991d5b5f6c
37.156098
147
0.534134
5.112418
false
false
false
false
niklassaers/Bolt-swift
Sources/Connection.swift
1
5470
import Foundation import PackStream #if os(Linux) import Dispatch #endif public class Connection: NSObject { private let settings: ConnectionSettings private var socket: SocketProtocol public var currentTransactionBookmark: String? public init(socket: SocketProtocol, settings: ConnectionSettings = ConnectionSettings() ) { self.socket = socket self.settings = settings super.init() } public func connect(completion: (_ success: Bool) throws -> Void) throws { try socket.connect(timeout: 5000) // in ms try initBolt() try initialize() try completion(true) } public func disconnect() { socket.disconnect() } private func initBolt() throws { try socket.send(bytes: [0x60, 0x60, 0xB0, 0x17, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00]) let response = try socket.receive(expectedNumberOfBytes: 4) let version = try UInt32.unpack(response[0..<response.count]) if version == 1 { // success } else { throw ConnectionError.unknownVersion } } private func initialize() throws { let message = Request.initialize(settings: settings) let chunks = try message.chunk() for chunk in chunks { try socket.send(bytes: chunk) } let maxChunkSize = Int32(Request.kMaxChunkSize) var responseData = try socket.receive(expectedNumberOfBytes: maxChunkSize) while (responseData[responseData.count - 1] == 0 && responseData[responseData.count - 2] == 0) == false { // chunk terminated by 0x00 0x00 let additionalResponseData = try socket.receive(expectedNumberOfBytes: maxChunkSize) responseData.append(contentsOf: additionalResponseData) } let unchunkedResponseDatas = try Response.unchunk(responseData) for unchunkedResponseData in unchunkedResponseDatas { let unpackedResponse = try Response.unpack(unchunkedResponseData) if unpackedResponse.category != .success { throw ConnectionError.authenticationError } } } public enum ConnectionError: Error { case unknownVersion case authenticationError case requestError } enum CommandResponse: Byte { case success = 0x70 case record = 0x71 case ignored = 0x7e case failure = 0x7f } private func chunkAndSend(request: Request) throws { let chunks = try request.chunk() for chunk in chunks { try socket.send(bytes: chunk) } } private func parseMeta(_ meta: [PackProtocol]) { for item in meta { if let map = item as? Map { for (key, value) in map.dictionary { switch key { case "bookmark": self.currentTransactionBookmark = value as? String case "stats": break case "result_available_after": break case "result_consumed_after": break case "type": break case "fields": break default: print("Couldn't parse metadata \(key)") } } } } } public func request(_ request: Request, completionHandler: (Bool, [Response]) throws -> Void) throws { try chunkAndSend(request: request) let maxChunkSize = Int32(Request.kMaxChunkSize) var responseData = try socket.receive(expectedNumberOfBytes: maxChunkSize) var i = 0 while responseData.count < 2 { // sometimes we just need to grab data over again - but how can we know? responseData = try socket.receive(expectedNumberOfBytes: maxChunkSize) i = i + 1 if i > 10 { break // something is absolutely off } } if responseData.count < 2 { print("Error, got too little data back") print(request) print(request.command) print(request.items) var responseData = try socket.receive(expectedNumberOfBytes: maxChunkSize) try completionHandler(false, []) return } while (responseData[responseData.count - 1] == 0 && responseData[responseData.count - 2] == 0) == false { // chunk terminated by 0x00 0x00 let additionalResponseData = try socket.receive(expectedNumberOfBytes: maxChunkSize) responseData.append(contentsOf: additionalResponseData) } let unchunkedResponsesAsBytes = try Response.unchunk(responseData) var responses = [Response]() var success = true for responseBytes in unchunkedResponsesAsBytes { let response = try Response.unpack(responseBytes) responses.append(response) if let error = response.asError() { throw error } if response.category != .record { parseMeta(response.items) } success = success && response.category != .failure } try completionHandler(success, responses) } }
bsd-3-clause
3805715b984b35445520493453c91c68
31.176471
152
0.577879
4.853594
false
false
false
false
joshaber/SwiftBox
SwiftBox/Layout.swift
1
1114
// // Layout.swift // SwiftBox // // Created by Josh Abernathy on 1/30/15. // Copyright (c) 2015 Josh Abernathy. All rights reserved. // import Foundation /// An evaluated layout. /// /// Layouts may not be created manually. They only ever come from laying out a /// Node. See Node.layout. public struct Layout { public let frame: CGRect public let children: [Layout] internal init(frame: CGRect, children: [Layout]) { self.frame = frame self.children = children } } extension Layout: CustomStringConvertible { public var description: String { return descriptionForDepth(0) } fileprivate func descriptionForDepth(_ depth: Int) -> String { let selfDescription = "{origin={\(frame.origin.x), \(frame.origin.y)}, size={\(frame.size.width), \(frame.size.height)}}" if children.count > 0 { let indentation = (0...depth).reduce("\n") { accum, _ in accum + "\t" } let childrenDescription = (children.map { $0.descriptionForDepth(depth + 1) }).joined(separator: indentation) return "\(selfDescription)\(indentation)\(childrenDescription)" } else { return selfDescription } } }
bsd-3-clause
f653b2e3a1211fb979330bc9f7d1bbb3
26.85
123
0.691203
3.470405
false
false
false
false
shuoli84/RxSwift
RxSwift/RxSwift/Observables/Implementations/ObserveOnDispatchQueue.swift
3
1737
// // ObserveOnDispatchQueue.swift // RxSwift // // Created by Krunoslav Zaher on 5/31/15. // Copyright (c) 2015 Krunoslav Zaher. All rights reserved. // import Foundation class ObserveOnDispatchQueueSink<O: ObserverType> : ScheduledSerialSchedulerObserver<O> { var disposeLock = Lock() var cancel: Disposable init(scheduler: SerialDispatchQueueScheduler, observer: O, cancel: Disposable) { self.cancel = cancel super.init(scheduler: scheduler, observer: observer) } override func dispose() { super.dispose() let toDispose = disposeLock.calculateLocked { () -> Disposable in let originalCancel = self.cancel self.cancel = NopDisposable.instance return originalCancel } toDispose.dispose() } } #if TRACE_RESOURCES public var numberOfDispatchQueueObservables: Int32 = 0 #endif class ObserveOnDispatchQueue<E> : Producer<E> { let scheduler: SerialDispatchQueueScheduler let source: Observable<E> init(source: Observable<E>, scheduler: SerialDispatchQueueScheduler) { self.scheduler = scheduler self.source = source #if TRACE_RESOURCES OSAtomicIncrement32(&numberOfDispatchQueueObservables) #endif } override func run<O : ObserverType where O.Element == E>(observer: O, cancel: Disposable, setSink: (Disposable) -> Void) -> Disposable { let sink = ObserveOnDispatchQueueSink(scheduler: scheduler, observer: observer, cancel: cancel) setSink(sink) return source.subscribeSafe(sink) } #if TRACE_RESOURCES deinit { OSAtomicDecrement32(&numberOfDispatchQueueObservables) } #endif }
mit
3a839c140438c9d7a5fbc5e128bb5b47
27.032258
140
0.671848
4.73297
false
false
false
false
wookay/Look
samples/LookSample/Pods/C4/C4/UI/C4Line.swift
3
5708
// Copyright © 2014 C4 // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to // deal in the Software without restriction, including without limitation the // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or // sell copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: The above copyright // notice and this permission notice shall be included in all copies or // substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS // IN THE SOFTWARE. import Foundation import CoreGraphics ///C4Line is a is a concrete subclass of C4Polygon that contains only two points. /// ///This subclass overrides the `points` variable so that it can only ever have 2 points, and also has an `endPoints` variable that allows the user to edit either end of the line (animatable). public class C4Line: C4Polygon { /// The end points the receiver's line. Animatable. /// /// Assigning a tuple of C4Point values to this object will cause the receiver to update itself. /// /// - returns: A tuple (2) of C4Points that make up the the begin and end points of the line. public var endPoints: (C4Point,C4Point) = (C4Point(),C4Point(100,0)){ didSet { updatePath() } } override func updatePath() { if pauseUpdates { return } let p = C4Path() p.moveToPoint(endPoints.0) p.addLineToPoint(endPoints.1) path = p adjustToFitPath() } /// The center point (top-left) of the receiver's frame. Animatable. /// /// - returns: A C4Point, the receiver's center. public override var center : C4Point { get { return C4Point(view.center) } set { let diff = newValue - center batchUpdates() { self.endPoints.0 += diff self.endPoints.1 += diff } } } /// The origin point (top-left) of the receiver's frame. Animatable. /// /// - returns: A C4Point, the receiver's origin. public override var origin : C4Point { get { return C4Point(view.frame.origin) } set { let diff = newValue - origin batchUpdates() { self.endPoints.0 += diff self.endPoints.1 += diff } } } /// The points that make up the line. Animatable. /// /// Assigning an array of C4Point values to this object will cause the receiver to update itself. /// /// - returns: A C4Point array of 2 points. public override var points : [C4Point] { get { return [endPoints.0,endPoints.1] } set { if newValue.count < 2 { print("Invalid point array. There must be at least 2 points to update the line.") } else { if newValue.count > 2 { print("Warning. The passed array has more than 2 points, only the first two will be used.") } batchUpdates() { self.endPoints.0 = newValue[0] self.endPoints.1 = newValue[1] } } } } /// Initializes a new C4Polygon using the specified array of points. /// /// Protects against trying to create a polygon with only 1 point (i.e. requires 2 points). /// Trims point array if count > 2. /// /// ```` /// let a = C4Point(100,100) /// let b = C4Point(200,200) /// /// let l = C4Line([a,b]) /// ```` /// /// - parameter points: An array of C4Point structs. public override init(_ points: [C4Point]) { let firstTwo = [C4Point](points[0...1]) super.init(firstTwo) let path = C4Path() path.moveToPoint(points[0]) for i in 1..<points.count { path.addLineToPoint(points[i]) } adjustToFitPath() } /// Initializes a new C4Line using the specified tuple of points. /// /// ```` /// let a = C4Point(100,100) /// let b = C4Point(200,200) /// /// let l = C4Line((a,b)) /// ```` /// /// - parameter points: A tuple of C4Point structs. public init(_ points: (C4Point, C4Point)) { self.endPoints = points super.init([points.0, points.1]) } /// Initializes a new C4Line using two specified points. /// /// ```` /// let a = C4Point(100,100) /// let b = C4Point(200,200) /// /// let l = C4Line(begin: a, end: b) /// ```` /// /// - parameter begin: The start point of the line. /// - parameter end: The end point of the line. public convenience init(begin: C4Point, end: C4Point) { let points = (begin, end) self.init(points) } required public init(coder: NSCoder) { fatalError("init(coder:) has not been implemented") } private var pauseUpdates = false func batchUpdates(updates: Void -> Void) { pauseUpdates = true updates() pauseUpdates = false updatePath() } }
mit
50858a3694da7871fb8293d3a54726ef
31.798851
191
0.587699
4.187087
false
false
false
false
brentsimmons/Frontier
BeforeTheRename/UserTalk/UserTalk/Node/FunctionNode.swift
1
1047
// // FunctionNode.swift // UserTalk // // Created by Brent Simmons on 5/4/17. // Copyright © 2017 Ranchero Software. All rights reserved. // import Foundation import FrontierData final class FunctionNode: CodeTreeNode { let operation: CodeTreeOperation = .functionOp let textPosition: TextPosition let name: String let paramHeader: [ParamHeaderNode] let blockNode: BlockNode init(_ textPosition: TextPosition, name: String, paramHeader: [ParamHeaderNode], blockNode: BlockNode) { self.textPosition = textPosition self.name = name self.paramHeader = paramHeader self.blockNode = blockNode } func evaluate(_ stack: Stack, _ breakOperation: inout CodeTreeOperation) throws -> Value { preconditionFailure("evaluate() should not be called on a Function Node.") } func call(_ stack: Stack, _ params: [ParamNode]) throws -> Value { if params.count > paramHeader.count { throw LangError(.tooManyParameters, textPosition: params[0].textPosition) } stack.push(self) defer { stack.pop() } // TODO } }
gpl-2.0
8f0dd1bb4c0410c76e4d468db1d60c1d
21.73913
105
0.724665
3.683099
false
false
false
false
jeannustre/HomeComics
HomeComics/BookDataSource.swift
1
3350
// // BookDataSource.swift // HomeComics // // Created by Jean Sarda on 07/05/2017. // Copyright © 2017 Jean Sarda. All rights reserved. // import UIKit import Alamofire import AlamofireObjectMapper import Chameleon fileprivate let cellIdentifier = "bookCell" class BookDataSource: NSObject { var books = [Book]() var filteredBooks = [Book]() var authors = [Author]() let defaults = UserDefaults.standard var searching = false private(set) lazy var cellBackgroundColor: UIColor = { return UIColor(hexString: UserDefaults.standard.string(forKey: "primaryColor")) }() func fetchBooks(completion: @escaping () -> ()) { let url = defaults.string(forKey: "serverBaseURL")! + "/book" Alamofire.request(url).responseArray { (response: DataResponse<[Book]>) in let bookArray = response.result.value if let bookArray = bookArray { self.books = bookArray let cdnAddress = self.defaults.string(forKey: "cdnBaseURL") for book in bookArray { let urlString = cdnAddress! + "/" + book.cover! book.cover = urlString.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) } } completion() } } func fetchAuthors(completion: @escaping () -> ()) { let url = defaults.string(forKey: "serverBaseURL")! + "/author" Alamofire.request(url).responseArray { (response: DataResponse<[Author]>) in let authorArray = response.result.value if let authorArray = authorArray { self.authors = authorArray } completion() } } func searchWith(_ string: String, completion: @escaping () ->()) { if string.isEmpty { searching = false completion() } else { searching = true let filtered = self.books.filter { ($0.title?.lowercased().contains(string.lowercased()))! } if filtered.count != filteredBooks.count { filteredBooks = filtered completion() } } } func setupCache() { } } //MARK: - CollectionView DataSource extension extension BookDataSource: UICollectionViewDataSource { func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { if self.searching { return filteredBooks.count } else { return books.count } } func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { let cell = collectionView.dequeueReusableCell(withReuseIdentifier: cellIdentifier, for: indexPath) as! BookCollectionViewCell let book = self.searching ? filteredBooks[indexPath.row] : books[indexPath.row] cell.configureWith(book: book, authors: self.authors, background: cellBackgroundColor) if let coverUrlString = book.cover { cell.imageURL = coverUrlString if let url = URL(string: cell.imageURL!) { cell.imageView.hnk_setImageFromURL(url) } else { print("invalid url?") } } return cell } }
gpl-3.0
9cf8fc2cb90ec5ce0f0343660d5479aa
32.158416
133
0.599582
5.097412
false
false
false
false
coolmacmaniac/swift-ios
DesignPatterns/DesignPatterns/Factory/DPStack.swift
1
1428
// // DPStack.swift // DesignPatterns // // Created by Sourabh on 26/06/17. // Copyright © 2017 Home. All rights reserved. // import Foundation /** Stack implementation of traversable data structure of type `DPTraversableType<T>` */ class DPStack<T>: DPTraversableType<T> { /** A reference to the element of type `DPTraversableElement<T>` at the top of the stack, may also be nil if the stack is empty */ private var top: DPTraversableElement<T>? override init() { top = nil } //MARK: - DPTraversableType methods public override func add(_ element: T) { let object = DPTraversableElement<T>(value: element) if nil != top { // if there exists prior element, then refer to it as previous object.previous = top } // update the top of stack top = object } public override func remove() -> T? { if nil == top { // if the stack is empty then there is nothing to return return nil } // move the top of stack to the previous element or nil if there isn't any let object = top top = top?.previous object?.previous = nil // return the value in the current element return object!.value } public override func hasMore() -> Bool { return nil != top } public override func traverse() { var element = top while nil != element { print("[\(element!.value)]", terminator: "->") element = element?.previous } print("[/]") } }
gpl-3.0
90f304b51cde81152b36466020e4249b
18.819444
124
0.652418
3.430288
false
false
false
false
airspeedswift/swift
test/IRGen/prespecialized-metadata/enum-inmodule-1argument-1conformance-public-1distinct_use.swift
3
6297
// RUN: %swift -prespecialize-generic-metadata -target %module-target-future -emit-ir %s | %FileCheck %s -DINT=i%target-ptrsize -DALIGNMENT=%target-alignment // REQUIRES: VENDOR=apple || OS=linux-gnu // UNSUPPORTED: CPU=i386 && OS=ios // UNSUPPORTED: CPU=armv7 && OS=ios // UNSUPPORTED: CPU=armv7s && OS=ios // CHECK: @"$sytN" = external{{( dllimport)?}} global %swift.full_type // CHECK: @"$s4main5ValueOySiGMf" = linkonce_odr hidden constant <{ // CHECK-SAME: i8**, // CHECK-SAME: [[INT]], // CHECK-SAME: %swift.type_descriptor*, // CHECK-SAME: %swift.type*, // CHECK-SAME: i8**, // CHECK-SAME: i64 // CHECK-SAME: }> <{ // CHECK-SAME: i8** getelementptr inbounds (%swift.enum_vwtable, %swift.enum_vwtable* @"$s4main5ValueOySiGWV", i32 0, i32 0), // CHECK-SAME: [[INT]] 513, // CHECK-SAME: %swift.type_descriptor* bitcast ( // CHECK-SAME: {{.*}}$s4main5ValueOMn{{.*}} to %swift.type_descriptor* // CHECK-SAME: ), // CHECK-SAME: %swift.type* @"$sSiN", // CHECK-SAME: i8** getelementptr inbounds ([1 x i8*], [1 x i8*]* @"$sSi4main1PAAWP", i32 0, i32 0), // CHECK-SAME: i64 3 // CHECK-SAME: }>, align [[ALIGNMENT]] public protocol P {} extension Int : P {} enum Value<First : P> { case first(First) } @inline(never) func consume<T>(_ t: T) { withExtendedLifetime(t) { t in } } // CHECK: define hidden swiftcc void @"$s4main4doityyF"() #{{[0-9]+}} { // CHECK: call swiftcc void @"$s4main7consumeyyxlF"( // CHECK-SAME: %swift.opaque* noalias nocapture %{{[0-9]+}}, // CHECK-SAME: %swift.type* getelementptr inbounds ( // CHECK-SAME: %swift.full_type, // CHECK-SAME: %swift.full_type* bitcast ( // CHECK-SAME: <{ // CHECK-SAME: i8**, // CHECK-SAME: [[INT]], // CHECK-SAME: %swift.type_descriptor*, // CHECK-SAME: %swift.type*, // CHECK-SAME: i8**, // CHECK-SAME: i64 // CHECK-SAME: }>* @"$s4main5ValueOySiGMf" // CHECK-SAME: to %swift.full_type* // CHECK-SAME: ), // CHECK-SAME: i32 0, // CHECK-SAME: i32 1 // CHECK-SAME: ) // CHECK-SAME: ) // CHECK: } func doit() { consume( Value.first(13) ) } doit() // CHECK: ; Function Attrs: noinline nounwind readnone // CHECK: define hidden swiftcc %swift.metadata_response @"$s4main5ValueOMa"([[INT]] %0, %swift.type* %1, i8** %2) #{{[0-9]+}} { // CHECK: entry: // CHECK: [[ERASED_TYPE:%[0-9]+]] = bitcast %swift.type* %1 to i8* // CHECK: [[ERASED_TABLE:%[0-9]+]] = bitcast i8** %2 to i8* // CHECK: br label %[[TYPE_COMPARISON_LABEL:[0-9]+]] // CHECK: [[TYPE_COMPARISON_LABEL]]: // CHECK: [[EQUAL_TYPE:%[0-9]+]] = icmp eq i8* bitcast (%swift.type* @"$sSiN" to i8*), [[ERASED_TYPE]] // CHECK: [[EQUAL_TYPES:%[0-9]+]] = and i1 true, [[EQUAL_TYPE]] // CHECK: [[ARGUMENT_BUFFER:%[0-9]+]] = bitcast i8* [[ERASED_TABLE]] to i8** // CHECK: [[UNCAST_PROVIDED_PROTOCOL_DESCRIPTOR:%[0-9]+]] = load i8*, i8** [[ARGUMENT_BUFFER]], align 1 // CHECK: [[PROVIDED_PROTOCOL_DESCRIPTOR:%[0-9]+]] = bitcast i8* [[UNCAST_PROVIDED_PROTOCOL_DESCRIPTOR]] to %swift.protocol_conformance_descriptor* // CHECK-arm64e: [[ERASED_TABLE_INT:%[0-9]+]] = ptrtoint i8* [[ERASED_TABLE]] to i64 // CHECK-arm64e: [[TABLE_SIGNATURE:%[0-9]+]] = call i64 @llvm.ptrauth.blend.i64(i64 [[ERASED_TABLE_INT]], i64 50923) // CHECK-arm64e: [[PROVIDED_PROTOCOL_DESCRIPTOR_AUTHED:%[0-9]+]] = call i64 @llvm.ptrauth.auth.i64(i64 %13, i32 2, i64 [[TABLE_SIGNATURE]]) // CHECK-arm64e: [[PROVIDED_PROTOCOL_DESCRIPTOR_AUTHED_PTR:%[0-9]+]] = inttoptr i64 [[PROVIDED_PROTOCOL_DESCRIPTOR_AUTHED]] to %swift.protocol_conformance_descriptor* // CHECK-arm64e: [[PROVIDED_PROTOCOL_DESCRIPTOR_AUTHED_PTR_INT:%[0-9]+]] = ptrtoint %swift.protocol_conformance_descriptor* [[PROVIDED_PROTOCOL_DESCRIPTOR_AUTHED_PTR]] to i64 // CHECK-arm64e: [[PROVIDED_PROTOCOL_DESCRIPTOR_SIGNED_INT:%[0-9]+]] = call i64 @llvm.ptrauth.sign.i64(i64 [[PROVIDED_PROTOCOL_DESCRIPTOR_AUTHED_PTR_INT]], i32 2, i64 50923) // CHECK-arm64e: [[PROVIDED_PROTOCOL_DESCRIPTOR_SIGNED:%[0-9]+]] = inttoptr i64 [[PROVIDED_PROTOCOL_DESCRIPTOR_SIGNED_INT]] to %swift.protocol_conformance_descriptor* // CHECK: [[EQUAL_DESCRIPTORS:%[0-9]+]] = call swiftcc i1 @swift_compareProtocolConformanceDescriptors( // CHECK-SAME: %swift.protocol_conformance_descriptor* // CHECK-arm64e-SAME: [[PROVIDED_PROTOCOL_DESCRIPTOR_SIGNED]], // CHECK-i386-SAME: [[PROVIDED_PROTOCOL_DESCRIPTOR]], // CHECK-x86_64-SAME: [[PROVIDED_PROTOCOL_DESCRIPTOR]], // CHECK-armv7-SAME: [[PROVIDED_PROTOCOL_DESCRIPTOR]], // CHECK-armv7s-SAME: [[PROVIDED_PROTOCOL_DESCRIPTOR]], // CHECK-armv7k-SAME: [[PROVIDED_PROTOCOL_DESCRIPTOR]], // CHECK-arm64-SAME: [[PROVIDED_PROTOCOL_DESCRIPTOR]], // CHECK-SAME: %swift.protocol_conformance_descriptor* // CHECK-SAME: $sSi4main1PAAMc // CHECK-SAME: ) // CHECK: [[EQUAL_ARGUMENTS:%[0-9]+]] = and i1 [[EQUAL_TYPES]], [[EQUAL_DESCRIPTORS]] // CHECK: br i1 [[EQUAL_ARGUMENTS]], label %[[EXIT_PRESPECIALIZED:[0-9]+]], label %[[EXIT_NORMAL:[0-9]+]] // CHECK: [[EXIT_PRESPECIALIZED]]: // CHECK: ret %swift.metadata_response { // CHECK-SAME: %swift.type* getelementptr inbounds ( // CHECK-SAME: %swift.full_type, // CHECK-SAME: %swift.full_type* bitcast ( // CHECK-SAME: <{ // CHECK-SAME: i8**, // CHECK-SAME: [[INT]], // CHECK-SAME: %swift.type_descriptor*, // CHECK-SAME: %swift.type*, // CHECK-SAME: i8**, // CHECK-SAME: i64 // CHECK-SAME: }>* @"$s4main5ValueOySiGMf" // CHECK-SAME: to %swift.full_type* // CHECK-SAME: ), // CHECK-SAME: i32 0, // CHECK-SAME: i32 1 // CHECK-SAME: ), // CHECK-SAME: [[INT]] 0 // CHECK-SAME: } // CHECK: [[EXIT_NORMAL]]: // CHECK: {{%[0-9]+}} = call swiftcc %swift.metadata_response @__swift_instantiateGenericMetadata( // CHECK-SAME: [[INT]] %0, // CHECK-SAME: i8* [[ERASED_TYPE]], // CHECK-SAME: i8* [[ERASED_TABLE]], // CHECK-SAME: i8* undef, // CHECK-SAME: %swift.type_descriptor* bitcast ( // CHECK-SAME: {{.*}}$s4main5ValueOMn{{.*}} to %swift.type_descriptor* // CHECK-SAME: ) // CHECK-SAME: ) // CHECK: ret %swift.metadata_response {{%[0-9]+}} // CHECK: }
apache-2.0
c36b609a17a7ef886b0bcd1c46a5f132
47.438462
175
0.612355
2.968883
false
false
false
false
wikimedia/wikipedia-ios
Wikipedia/Code/LoginFunnel.swift
1
2772
// https://meta.wikimedia.org/wiki/Schema:MobileWikiAppiOSLoginAction @objc final class LoginFunnel: EventLoggingFunnel, EventLoggingStandardEventProviding { @objc public static let shared = LoginFunnel() private override init() { super.init(schema: "MobileWikiAppiOSLoginAction", version: 18121305) } private enum Action: String { case impression case loginStart = "login_start" case logout case loginSuccess = "login_success" case createAccountStart = "createaccount_start" case createAccountSuccess = "createaccount_success" } private func event(category: EventLoggingCategory, label: EventLoggingLabel?, action: Action, measure: Double? = nil) -> [String: Any] { let category = category.rawValue let action = action.rawValue var event: [String: Any] = ["category": category, "action": action, "primary_language": primaryLanguage(), "is_anon": isAnon] if let label = label?.rawValue { event["label"] = label } if let measure = measure { event["measure_time"] = Int(round(measure)) } return event } override func preprocessData(_ eventData: [AnyHashable: Any]) -> [AnyHashable: Any] { return wholeEvent(with: eventData) } // MARK: - Feed @objc public func logLoginImpressionInFeed() { log(event(category: .feed, label: .syncEducation, action: .impression)) } @objc public func logLoginStartInFeed() { log(event(category: .feed, label: .syncEducation, action: .loginStart)) } // MARK: - Login screen public func logSuccess(timeElapsed: Double?) { log(event(category: .login, label: nil, action: .loginSuccess, measure: timeElapsed)) } @objc public func logCreateAccountAttempt() { log(event(category: .login, label: nil, action: .createAccountStart)) } public func logCreateAccountSuccess(timeElapsed: Double?) { log(event(category: .login, label: nil, action: .createAccountSuccess, measure: timeElapsed)) } // MARK: - Settings @objc public func logLoginStartInSettings() { log(event(category: .setting, label: .login, action: .loginStart)) } @objc public func logLogoutInSettings() { log(event(category: .setting, label: .login, action: .logout)) } // MARK: - Sync popovers public func logLoginImpressionInSyncPopover() { log(event(category: .loginToSyncPopover, label: nil, action: .impression)) } public func logLoginStartInSyncPopover() { log(event(category: .loginToSyncPopover, label: nil, action: .loginStart)) } }
mit
b02e2be2700341eb3029ebd87a2ceef3
33.222222
140
0.636003
4.386076
false
false
false
false
Mikelulu/BaiSiBuDeQiJie
LKBS/Pods/BMPlayer/Source/BMPlayerItem.swift
1
2841
// // BMPlayerItem.swift // Pods // // Created by BrikerMan on 16/5/21. // // import Foundation import AVFoundation public struct BMPlayerResource { public let name : String public let cover : URL? public let subtitle: BMSubtitles? public let definitions: [BMPlayerResourceDefinition] /** Player recource item with url, used to play single difinition video - parameter name: video name - parameter url: video url - parameter cover: video cover, will show before playing, and hide when play - parameter subtitles: video subtitles */ public init(url: URL, name: String = "", cover: URL? = nil, subtitle: URL? = nil) { let definition = BMPlayerResourceDefinition(url: url, definition: "") var subtitles: BMSubtitles? = nil if let subtitle = subtitle { subtitles = BMSubtitles(url: subtitle) } self.init(name: name, definitions: [definition], cover: cover, subtitles: subtitles) } /** Play resouce with multi definitions - parameter name: video name - parameter definitions: video definitions - parameter cover: video cover - parameter subtitles: video subtitles */ public init(name: String = "", definitions: [BMPlayerResourceDefinition], cover: URL? = nil, subtitles: BMSubtitles? = nil) { self.name = name self.cover = cover self.subtitle = subtitles self.definitions = definitions } } public struct BMPlayerResourceDefinition { public let url: URL public let definition: String /// An instance of NSDictionary that contains keys for specifying options for the initialization of the AVURLAsset. See AVURLAssetPreferPreciseDurationAndTimingKey and AVURLAssetReferenceRestrictionsKey above. public var options: [String : Any]? var avURLAsset: AVURLAsset { get { return BMPlayerManager.asset(for: self) } } /** Video recource item with defination name and specifying options - parameter url: video url - parameter definition: url deifination - parameter options: specifying options for the initialization of the AVURLAsset you can add http-header or other options which mentions in https://developer.apple.com/reference/avfoundation/avurlasset/initialization_options to add http-header init options like this ``` let header = ["User-Agent":"BMPlayer"] let definiton.options = ["AVURLAssetHTTPHeaderFieldsKey":header] ``` */ public init(url: URL, definition: String, options: [String : Any]? = nil) { self.url = url self.definition = definition self.options = options } }
mit
201873dffd1a44c1dc5189818d26570a
31.655172
213
0.642731
4.719269
false
false
false
false
pluralsight/PSOperations
PSOperationsLocation/Location+tvOS.swift
1
2698
#if os(tvOS) import CoreLocation import Foundation import PSOperations public struct Location: CapabilityType { public static let name = "Location" public init() { } public func requestStatus(_ completion: @escaping (CapabilityStatus) -> Void) { guard CLLocationManager.locationServicesEnabled() else { completion(.notAvailable) return } let actual = CLLocationManager.authorizationStatus() switch actual { case .notDetermined: completion(.notDetermined) case .restricted: completion(.notAvailable) case .denied: completion(.denied) case .authorizedWhenInUse: completion(.authorized) case .authorizedAlways: fatalError(".Always should be unavailable on tvOS") @unknown default: completion(.notDetermined) } } public func authorize(_ completion: @escaping (CapabilityStatus) -> Void) { Authorizer.authorize(completion: completion) } } private let Authorizer = LocationAuthorizer() private class LocationAuthorizer: NSObject, CLLocationManagerDelegate { private let manager = CLLocationManager() private var completion: ((CapabilityStatus) -> Void)? override init() { super.init() manager.delegate = self } func authorize(completion: @escaping (CapabilityStatus) -> Void) { guard self.completion == nil else { fatalError("Attempting to authorize location when a request is already in-flight") } self.completion = completion let key = "NSLocationWhenInUseUsageDescription" manager.requestWhenInUseAuthorization() // This is helpful when developing an app. assert(Bundle.main.object(forInfoDictionaryKey: key) != nil, "Requesting location permission requires the \(key) key in your Info.plist") } @objc func locationManager(_ manager: CLLocationManager, didChangeAuthorization status: CLAuthorizationStatus) { if let completion = self.completion, manager == self.manager && status != .notDetermined { self.completion = nil switch status { case .authorizedWhenInUse: completion(.authorized) case .denied: completion(.denied) case .restricted: completion(.notAvailable) case .authorizedAlways: fatalError(".Always should be unavailable on tvOS") case .notDetermined: fatalError("Unreachable due to the if statement, but included to keep clang happy") @unknown default: completion(.notDetermined) } } } } #endif
apache-2.0
5cade366c6278e6b7851c3c6b90812bd
31.902439
145
0.648258
5.644351
false
false
false
false
inamiy/SwiftElm
SwiftElmPlayground.playground/Pages/Gesture.xcplaygroundpage/Contents.swift
1
3582
import UIKit import PlaygroundSupport import Result import ReactiveSwift import VTree import VTreeDebugger import SwiftElm struct Model: DebuggableModel { let rootSize = CGSize(width: 320, height: 480) let message: String let cursor: Cursor? var description: String { return message } struct Cursor { let frame: CGRect let backgroundColor: UIColor } } extension Model.Cursor { init?(msg: Msg) { switch msg { case let .tap(context): let frame = CGRect(origin: context.location, size: .zero) .insetBy(dx: -20, dy: -20) self = Model.Cursor(frame: frame, backgroundColor: .orange) case let .pan(context) where context.state == .changed: let frame = CGRect(origin: context.location, size: .zero) .insetBy(dx: -20, dy: -20) self = Model.Cursor(frame: frame, backgroundColor: .green) default: return nil } } } func update(_ model: Model, _ msg: Msg) -> Model? { print(msg) // Warning: impure logging let argsString = msg.rawMessage.arguments.map { "\($0)" }.joined(separator: "\n") let cursor = Model.Cursor(msg: msg) return Model( message: "\(msg.rawMessage.funcName)\n\(argsString)", cursor: cursor ) } func view(model: Model) -> VView<Msg> { let rootWidth = model.rootSize.width let rootHeight = model.rootSize.height func rootView(_ children: [AnyVTree<Msg>?]) -> VView<Msg> { return VView( styles: .init { $0.frame = CGRect(x: 0, y: 0, width: rootWidth, height: rootHeight) $0.backgroundColor = .white }, gestures: [.tap(^Msg.tap), .pan(^Msg.pan), .longPress(^Msg.longPress), .swipe(^Msg.swipe), .pinch(^Msg.pinch), .rotation(^Msg.rotation)], children: children.flatMap { $0 } ) } func label(_ message: String) -> VLabel<Msg> { return VLabel( key: key("label"), text: .text(message), styles: .init { $0.frame = CGRect(x: 0, y: 40, width: rootWidth, height: 300) $0.backgroundColor = .clear $0.textAlignment = .center $0.font = .systemFont(ofSize: 24) } ) } func noteLabel() -> VLabel<Msg> { return VLabel( key: key("noteLabel"), text: "Tap anywhere to test gesture.", styles: .init { $0.frame = CGRect(x: 0, y: 350, width: rootWidth, height: 80) $0.backgroundColor = .clear $0.textAlignment = .center $0.font = .systemFont(ofSize: 20) } ) } func cursorView(_ cursor: Model.Cursor) -> VView<Msg> { return VView( key: key("cursor"), styles: .init { $0.frame = cursor.frame $0.backgroundColor = cursor.backgroundColor } ) } return rootView([ *label(model.message), *noteLabel(), model.cursor.map(cursorView).map(*) ]) } // MARK: Main let initial = Model(message: "Initial", cursor: nil) //let program = Program(model: initial, update: update, view: view) let program = Program( model: DebugModel(initial), update: debugUpdate(update), view: debugView(view) ) program.window.bounds.size = initial.rootSize PlaygroundPage.current.liveView = program.window
mit
f5a24942fc5287a8547feb88f4184a97
25.932331
149
0.546622
3.984427
false
false
false
false
loudnate/xDripG5
CGMBLEKitTests/GlucoseBackfillMessageTests.swift
1
27102
// // GlucoseBackfillMessageTests.swift // xDripG5Tests // // Copyright © 2018 LoopKit Authors. All rights reserved. // import XCTest @testable import CGMBLEKit class GlucoseBackfillMessageTests: XCTestCase { func testTxMessage() { let message = GlucoseBackfillTxMessage(byte1: 5, byte2: 2, identifier: 0, startTime: 5439415, endTime: 5440614) // 20 minutes XCTAssertEqual(Data(hexadecimalString: "50050200b7ff5200660453000000000000007138")!, message.data) } func testRxMessage() { let message = GlucoseBackfillRxMessage(data: Data(hexadecimalString: "51000100b7ff52006604530032000000e6cb9805")!)! XCTAssertEqual(.ok, TransmitterStatus(rawValue: message.status)) XCTAssertEqual(1, message.backfillStatus) XCTAssertEqual(0, message.identifier) XCTAssertEqual(5439415, message.startTime) XCTAssertEqual(5440614, message.endTime) XCTAssertEqual(50, message.bufferLength) XCTAssertEqual(0xcbe6, message.bufferCRC) // 0xbc46 // 0b10111100 01000110 var buffer = GlucoseBackfillFrameBuffer(identifier: message.identifier) buffer.append(Data(hexadecimalString: "0100bc460000b7ff52008b0006eee30053008500")!) buffer.append(Data(hexadecimalString: "020006eb0f025300800006ee3a0353007e0006f5")!) buffer.append(Data(hexadecimalString: "030066045300790006f8")!) XCTAssertEqual(Int(message.bufferLength), buffer.count) XCTAssertEqual(message.bufferCRC, buffer.crc16) let messages = buffer.glucose XCTAssertEqual(139, messages[0].glucose) XCTAssertEqual(5439415, messages[0].timestamp) XCTAssertEqual(.known(.ok), CalibrationState(rawValue: messages[0].state)) XCTAssertEqual(-18, messages[0].trend) XCTAssertEqual(133, messages[1].glucose) XCTAssertEqual(5439715, messages[1].timestamp) XCTAssertEqual(.known(.ok), CalibrationState(rawValue: messages[1].state)) XCTAssertEqual(-21, messages[1].trend) XCTAssertEqual(128, messages[2].glucose) XCTAssertEqual(5440015, messages[2].timestamp) XCTAssertEqual(.known(.ok), CalibrationState(rawValue: messages[2].state)) XCTAssertEqual(-18, messages[2].trend) XCTAssertEqual(126, messages[3].glucose) XCTAssertEqual(5440314, messages[3].timestamp) XCTAssertEqual(.known(.ok), CalibrationState(rawValue: messages[3].state)) XCTAssertEqual(-11, messages[3].trend) XCTAssertEqual(121, messages[4].glucose) XCTAssertEqual(5440614, messages[4].timestamp) XCTAssertEqual(.known(.ok), CalibrationState(rawValue: messages[4].state)) XCTAssertEqual(-08, messages[4].trend) XCTAssertEqual(message.startTime, messages.first!.timestamp) XCTAssertEqual(message.endTime, messages.last!.timestamp) XCTAssertTrue(messages.first!.timestamp <= messages.last!.timestamp) } func testGlucoseBackfill2() { let message = GlucoseBackfillTxMessage(byte1: 5, byte2: 2, identifier: 0, startTime: 4648682, endTime: 4650182) // 25 minutes XCTAssertEqual(Data(hexadecimalString: "50050200eaee4600c6f446000000000000009f6d")!, message.data, message.data.hexadecimalString) let response = GlucoseBackfillRxMessage(data: Data(hexadecimalString: "51000103eaee4600c6f446003a0000004f3ac9e6")!)! XCTAssertEqual(.ok, TransmitterStatus(rawValue: response.status)) XCTAssertEqual(1, response.backfillStatus) XCTAssertEqual(3, response.identifier) XCTAssertEqual(4648682, response.startTime) XCTAssertEqual(4650182, response.endTime) XCTAssertEqual(58, response.bufferLength) XCTAssertEqual(0x3a4f, response.bufferCRC) // 0x6e3c // 0b01101110 00111100 var buffer = GlucoseBackfillFrameBuffer(identifier: 0xc0) buffer.append(Data(hexadecimalString: "01c06e3c0000eaee4600920007fd16f046009500")!) buffer.append(Data(hexadecimalString: "02c0070042f14600960007026ef2460099000704")!) buffer.append(Data(hexadecimalString: "03c09af3460093000700c6f44600900007fc")!) XCTAssertEqual(Int(response.bufferLength), buffer.count) XCTAssertEqual(response.bufferCRC, buffer.crc16) let messages = buffer.glucose XCTAssertEqual(response.startTime, messages.first!.timestamp) XCTAssertEqual(response.endTime, messages.last!.timestamp) XCTAssertTrue(messages.first!.timestamp <= messages.last!.timestamp) XCTAssertEqual(6, messages.count) } func testMalformedBackfill() { var buffer = GlucoseBackfillFrameBuffer(identifier: 0) buffer.append(Data(hexadecimalString: "0100bc460000b7ff52008b0006eee30053008500")!) buffer.append(Data(hexadecimalString: "020006eb0f025300800006ee3a0353007e0006")!) XCTAssertEqual(3, buffer.glucose.count) } func testGlucoseBackfill3() { let response = GlucoseBackfillRxMessage(data: Data(hexadecimalString: "510001023d6a0e00c16d0e00280000005b1a9154")!)! XCTAssertEqual(.ok, TransmitterStatus(rawValue: response.status)) XCTAssertEqual(1, response.backfillStatus) XCTAssertEqual(2, response.identifier) XCTAssertEqual(944701, response.startTime) XCTAssertEqual(945601, response.endTime) XCTAssertEqual(40, response.bufferLength) XCTAssertEqual(0x1A5B, response.bufferCRC) // 0x440c // 0b01000100 00001100 var buffer = GlucoseBackfillFrameBuffer(identifier: 0x80) buffer.append(Data(hexadecimalString: "0180440c00003d6a0e005c0007fe696b0e005d00")!) buffer.append(Data(hexadecimalString: "028007ff956c0e005e000700c16d0e005d000700")!) XCTAssertEqual(Int(response.bufferLength), buffer.count) XCTAssertEqual(response.bufferCRC, buffer.crc16) let messages = buffer.glucose XCTAssertEqual(response.startTime, messages.first!.timestamp) XCTAssertEqual(response.endTime, messages.last!.timestamp) XCTAssertTrue(messages.first!.timestamp <= messages.last!.timestamp) XCTAssertEqual(4, messages.count) } func testGlucoseBackfill4() { let response = GlucoseBackfillRxMessage(data: Data(hexadecimalString: "51000103c9740e004d780e0028000000235bd94c")!)! XCTAssertEqual(.ok, TransmitterStatus(rawValue: response.status)) XCTAssertEqual(1, response.backfillStatus) XCTAssertEqual(3, response.identifier) XCTAssertEqual(947401, response.startTime) XCTAssertEqual(948301, response.endTime) XCTAssertEqual(40, response.bufferLength) XCTAssertEqual(0x5B23, response.bufferCRC) // 0x04d0 // 0b00000100 11010000 var buffer = GlucoseBackfillFrameBuffer(identifier: 0xc0) buffer.append(Data(hexadecimalString: "01c04d0c0000c9740e005a000700f5750e005800")!) buffer.append(Data(hexadecimalString: "02c007ff21770e00590007ff4d780e0059000700")!) XCTAssertEqual(Int(response.bufferLength), buffer.count) XCTAssertEqual(response.bufferCRC, buffer.crc16) let messages = buffer.glucose XCTAssertEqual(response.startTime, messages.first!.timestamp) XCTAssertEqual(response.endTime, messages.last!.timestamp) XCTAssertTrue(messages.first!.timestamp <= messages.last!.timestamp) XCTAssertEqual(4, messages.count) } func testNotGlucoseBackfill1() { let response = GlucoseBackfillRxMessage(data: Data(hexadecimalString: "5100010339410e0085a90e00ac06000070ca9143")!)! XCTAssertEqual(.ok, TransmitterStatus(rawValue: response.status)) XCTAssertEqual(1, response.backfillStatus) XCTAssertEqual(3, response.identifier) XCTAssertEqual(934201, response.startTime) XCTAssertEqual(960901, response.endTime) XCTAssertEqual(1708, response.bufferLength) XCTAssertEqual(0xCA70, response.bufferCRC) // 0x4a4f // 0b01001010 01001111 var buffer = GlucoseBackfillFrameBuffer(identifier: 0xc0) buffer.append(Data(hexadecimalString: "01c04a4f4a5558ef554453b7392a0df008571a7f")!) buffer.append(Data(hexadecimalString: "02c0451e0d74bdec596b633cf2b03d511ef3d048")!) buffer.append(Data(hexadecimalString: "03c009145e959ca51f7a1663ca31676b175d7bc7")!) buffer.append(Data(hexadecimalString: "04c0de00c954fcd3281d5163ed873cdc136fca3e")!) buffer.append(Data(hexadecimalString: "05c0c7da188dd5fbb8997206da1cc8d0c22f8434")!) buffer.append(Data(hexadecimalString: "06c04d50b29df06b12e7162f2d73fd553e44e469")!) buffer.append(Data(hexadecimalString: "07c02b4bb61d66cf6e949ee0f07dbe0cc12127ae")!) buffer.append(Data(hexadecimalString: "08c03bf887be09ece7595adfee494b25368103b4")!) buffer.append(Data(hexadecimalString: "09c07eefb9b5398468a53f00355341d19b50c8b1")!) buffer.append(Data(hexadecimalString: "0ac028f0ddb4dc09a2c74deedf7fdff13fcd6b0e")!) buffer.append(Data(hexadecimalString: "0bc0ad2d7311ac9ec1908fb7ee5557c463ea4fea")!) buffer.append(Data(hexadecimalString: "0cc0bf3c62d9aa62d7c3d447c959b51d31fd016d")!) buffer.append(Data(hexadecimalString: "0dc0278116abd1252ad66c894a39ed7c6d72086e")!) buffer.append(Data(hexadecimalString: "0ec0aaee3bf9b05ccb7b23e1c27d777173c4d9fd")!) buffer.append(Data(hexadecimalString: "0fc044048720d76a696249737f999f944995e44e")!) buffer.append(Data(hexadecimalString: "10c0495e4cb7f22327a920a843de1b4522a68108")!) buffer.append(Data(hexadecimalString: "11c058c482389192ed920e322b71900d747a9492")!) buffer.append(Data(hexadecimalString: "12c0eac06906ff4863f0e8da07d1ead29fc15bd3")!) buffer.append(Data(hexadecimalString: "13c0c0be38548fe9e229c64c9c0f3e9b4c4c1d83")!) buffer.append(Data(hexadecimalString: "14c018a936bdde548e4244093e77c87adda0a1cf")!) buffer.append(Data(hexadecimalString: "15c0fb97d1d147dd0bc6552faa4d62ab553e1682")!) buffer.append(Data(hexadecimalString: "16c0f15f8cb77decb934bfe0c711a026dd4bf36b")!) buffer.append(Data(hexadecimalString: "17c0bd268b0eee07ed20a0f3856ea449b1503708")!) buffer.append(Data(hexadecimalString: "18c00872ed5a996a13480b81fc82b6ca1e7dd379")!) buffer.append(Data(hexadecimalString: "19c06fb4c5bc84e63688b0a77edbab85bfb61b45")!) buffer.append(Data(hexadecimalString: "1ac071d29d30edb43db6b8e114bbbcd67f9dd3a9")!) buffer.append(Data(hexadecimalString: "1bc0569e17a8a80c015def11ddce1b8f194ff6e2")!) buffer.append(Data(hexadecimalString: "1cc0df79ffbc1e077fe249b47550feb5dcd53044")!) buffer.append(Data(hexadecimalString: "1dc0b557e2ba03caed61de30221b0330e1cc49b1")!) buffer.append(Data(hexadecimalString: "1ec006f05e739d737939baf8b14a8b7a6faae96e")!) buffer.append(Data(hexadecimalString: "1fc00b82d430e9e75fb8e7e2affbdd292a41fad2")!) buffer.append(Data(hexadecimalString: "20c0fbf8e8f2686aaaf19d2809eecd3bd4f63516")!) buffer.append(Data(hexadecimalString: "21c0a7df809e73538e459c1a9cd27a566f636e22")!) buffer.append(Data(hexadecimalString: "22c0dbb3c23d7d7847dee77311287e6c6b192eb4")!) buffer.append(Data(hexadecimalString: "23c0d30038d70241a80b9e390778a897dd1632cc")!) buffer.append(Data(hexadecimalString: "24c0177b23127b464c07a499abeff05f13e40998")!) buffer.append(Data(hexadecimalString: "25c0855350c7c4a335e95d2e569996639e8341b4")!) buffer.append(Data(hexadecimalString: "26c0d42874475710a50764d4a4166c0e420aff7f")!) buffer.append(Data(hexadecimalString: "27c0facb1d61cb8057de64546fc9f24f93603093")!) buffer.append(Data(hexadecimalString: "28c080befb84f22c60d398f017dde114d0557b27")!) buffer.append(Data(hexadecimalString: "29c07555e92425342c0674b62fa517b13ba0e3b0")!) buffer.append(Data(hexadecimalString: "2ac0923624bce36c89fade1f66bd7ae1e8e7d598")!) buffer.append(Data(hexadecimalString: "2bc0d345ceea668373d31f95b03a6ee7fff1a3b5")!) buffer.append(Data(hexadecimalString: "2cc045e409b8d31dd53ae9d353f35738819fbb79")!) buffer.append(Data(hexadecimalString: "2dc0a5d31fd3c3b7b217d3f79b245d3714b0523d")!) buffer.append(Data(hexadecimalString: "2ec0eb576e0193584bff8ecada0dc54e4ebde86c")!) buffer.append(Data(hexadecimalString: "2fc092b8ef52003f8b76e90d920ca738c998bb70")!) buffer.append(Data(hexadecimalString: "30c07cfa0f7a69d14b79f605d254a164fd67c658")!) buffer.append(Data(hexadecimalString: "31c049a329162e03f41c12db845b73301f5bbb81")!) buffer.append(Data(hexadecimalString: "32c08a21ca0995b5aa413897ea9e2b7c563ced07")!) buffer.append(Data(hexadecimalString: "33c05d51a18e19209f1c55054bd2f74677c71070")!) buffer.append(Data(hexadecimalString: "34c0299e29ae5576a220b0b767fc4e898aaf2df1")!) buffer.append(Data(hexadecimalString: "35c0bbb554546b69c53b4b3a63bd524bfbe728e6")!) buffer.append(Data(hexadecimalString: "36c0cd4e8c6e10e72950e66bfa0d23b954a7aede")!) buffer.append(Data(hexadecimalString: "37c0ea5df836af737298d44b4b156ced47727920")!) buffer.append(Data(hexadecimalString: "38c02303edefc4916cfdba55829426c153d0d30c")!) buffer.append(Data(hexadecimalString: "39c0dfee091fea60c2da239c9aabef8eddbe49b5")!) buffer.append(Data(hexadecimalString: "3ac02788f23fb030e7606329ed24cbee10bc20eb")!) buffer.append(Data(hexadecimalString: "3bc00a601d46c10bab8cdf04513a47550b0e4fe5")!) buffer.append(Data(hexadecimalString: "3cc072ea5e514432c81e325464e1ac2d659378d2")!) buffer.append(Data(hexadecimalString: "3dc0f050e994caa508fdea7202ed70a4acc6e8ab")!) buffer.append(Data(hexadecimalString: "3ec069ab0d13863943415b492569db29b9594dbe")!) buffer.append(Data(hexadecimalString: "3fc02c37277a98b88956f0def9ad866f44ca6d9f")!) buffer.append(Data(hexadecimalString: "40c0e5bd6aa2dbd835fab2ec238de4a635a3f6cb")!) buffer.append(Data(hexadecimalString: "41c0aafa8812d94d5fe722b3ecfb74eb4c12c622")!) buffer.append(Data(hexadecimalString: "42c08c5b4bb2f28069fc6f9dcb26bc84c0cc01c7")!) buffer.append(Data(hexadecimalString: "43c04ad95cefa1f62a18fa2c5a05bac208685cdb")!) buffer.append(Data(hexadecimalString: "44c0ffe910ddc010b30f457578ab24a866b8a94d")!) buffer.append(Data(hexadecimalString: "45c01b0bb36e58f401eb15da2e6710721e39c573")!) buffer.append(Data(hexadecimalString: "46c06165075618fc9626c53acdd9cb8bcfb0719f")!) buffer.append(Data(hexadecimalString: "47c081599f76725e30d4de39cdcc7f7c0c918d68")!) buffer.append(Data(hexadecimalString: "48c0563b99dce4913105b793f4d539fe668feef6")!) buffer.append(Data(hexadecimalString: "49c04ebaaf9f4dfda6cac4d617cd07098fec39f0")!) buffer.append(Data(hexadecimalString: "4ac04c1ae961bc4f3e2cd395396dc8098bbf4bd5")!) buffer.append(Data(hexadecimalString: "4bc0d95ed88f296e8d68c35085af86e5ef8d8bf0")!) buffer.append(Data(hexadecimalString: "4cc0658ccce111259ce8ac5cbedfc46deda77433")!) buffer.append(Data(hexadecimalString: "4dc05fda2f8d2885082db4b1356c5e2a0e830471")!) buffer.append(Data(hexadecimalString: "4ec066c7813ff84a9da11fe343e5a95bbfa3082c")!) buffer.append(Data(hexadecimalString: "4fc03bcfd6fe6d9657d04f06ed7bc461ebe18d47")!) buffer.append(Data(hexadecimalString: "50c035bbe880ba24d7c84f73ae061b33d62a1845")!) buffer.append(Data(hexadecimalString: "51c0650f0a6bbc91b2771549cf49a5a4faf8b278")!) buffer.append(Data(hexadecimalString: "52c07ac551477e6cd10fe6a3b43d62b02569d110")!) buffer.append(Data(hexadecimalString: "53c005f79d6de0ec017e7a0c98961ce6770f885d")!) buffer.append(Data(hexadecimalString: "54c0d05fee0b5f5bf9de8c61b58f8634ecbf3347")!) buffer.append(Data(hexadecimalString: "55c0e0c7d345fbc40f35aed12e82f8ccb0ed9335")!) buffer.append(Data(hexadecimalString: "56c0b1c8b263179e")!) XCTAssertEqual(Int(response.bufferLength), buffer.count) XCTAssertEqual(response.bufferCRC, buffer.crc16) let messages = buffer.glucose XCTAssertNotEqual(response.startTime, messages.first!.timestamp) XCTAssertNotEqual(response.endTime, messages.last!.timestamp) XCTAssertEqual(191, messages.count) } func testNotGlucoseBackfill2() { let response = GlucoseBackfillRxMessage(data: Data(hexadecimalString: "51000102b1aa0e00e5b20e00a000000020a39b7e")!)! XCTAssertEqual(.ok, TransmitterStatus(rawValue: response.status)) XCTAssertEqual(1, response.backfillStatus) XCTAssertEqual(2, response.identifier) XCTAssertEqual(961201, response.startTime) XCTAssertEqual(963301, response.endTime) XCTAssertEqual(160, response.bufferLength) XCTAssertEqual(0xA320, response.bufferCRC) // 0xcde3 // 0b11001101 11100011 var buffer = GlucoseBackfillFrameBuffer(identifier: 0x80) buffer.append(Data(hexadecimalString: "0180cde3fd48248e37a7bf6c2d9d78d4bfef6d5b")!) buffer.append(Data(hexadecimalString: "02809f074c9039b6d3b841f422cf36398338f98c")!) buffer.append(Data(hexadecimalString: "038004160a5a1ad37c382f3ca23ea215c644f7b6")!) buffer.append(Data(hexadecimalString: "04802ed7376fa7c83c3ecf0b645233f9b3c80238")!) buffer.append(Data(hexadecimalString: "05805692724e630a703f01b0a942250f725553d2")!) buffer.append(Data(hexadecimalString: "06804ca2727a4051033a550da80905caf77c735d")!) buffer.append(Data(hexadecimalString: "07808f937b4b9602c5dd6fa13ae983e00783b28e")!) buffer.append(Data(hexadecimalString: "088069846e672c106b339159ead9ee1c08e1a159")!) XCTAssertEqual(Int(response.bufferLength), buffer.count) XCTAssertEqual(response.bufferCRC, buffer.crc16) let messages = buffer.glucose XCTAssertNotEqual(response.startTime, messages.first!.timestamp) XCTAssertNotEqual(response.endTime, messages.last!.timestamp) XCTAssertFalse(messages.first!.timestamp <= messages.last!.timestamp) XCTAssertEqual(17, messages.count) } func testNotGlucoseBackfill3() { let response = GlucoseBackfillRxMessage(data: Data(hexadecimalString: "51000102b6a36500010c6600ac0600000147db0a")!)! XCTAssertEqual(.ok, TransmitterStatus(rawValue: response.status)) XCTAssertEqual(1, response.backfillStatus) XCTAssertEqual(2, response.identifier) XCTAssertEqual(6661046, response.startTime) XCTAssertEqual(6687745, response.endTime) XCTAssertEqual(1708, response.bufferLength) XCTAssertEqual(0x4701, response.bufferCRC) var buffer = GlucoseBackfillFrameBuffer(identifier: 0x80) buffer.append(Data(hexadecimalString: "0180e1234bdf92845cec52822a8894854582b2b2")!) buffer.append(Data(hexadecimalString: "02800f8a38cc876ad33ae0acdc25921132cc6f0d")!) buffer.append(Data(hexadecimalString: "038032a6cd9e6d447916dd0b9699e499ae79b8d1")!) buffer.append(Data(hexadecimalString: "048045f4b95e0ad80955d3a899d6083bd142f863")!) buffer.append(Data(hexadecimalString: "05809cf9c189744ab66f6ca5c2833ef27442fa71")!) buffer.append(Data(hexadecimalString: "068053694b279275f0d23eb826681e20e5ebb79d")!) buffer.append(Data(hexadecimalString: "078098b921155eb5aed63119d5faec3ef3e53a37")!) buffer.append(Data(hexadecimalString: "08807c87277557a0828e8dc81ff76f1a6e197103")!) buffer.append(Data(hexadecimalString: "0980b8378b133898ce73f7989d67360123e9fdd8")!) buffer.append(Data(hexadecimalString: "0a80383ce19d943a38796b594ff95a2dc93bd6a2")!) buffer.append(Data(hexadecimalString: "0b806b548c5997dc67ed4fe07bcf236d59dd7f94")!) buffer.append(Data(hexadecimalString: "0c802cb2382f40a06fde5f2dff3f0b8226a11f12")!) buffer.append(Data(hexadecimalString: "0d8029800ae513c5b7bc8ea733544b7da84ded17")!) buffer.append(Data(hexadecimalString: "0e80a95b6c3d36183e4409f916a6f1f775af338e")!) buffer.append(Data(hexadecimalString: "0f80d098732f2abcf4a90628f321a048349142ff")!) buffer.append(Data(hexadecimalString: "108077294e9d029bdc0602c76671d88ff4a87596")!) buffer.append(Data(hexadecimalString: "1180bac50f8d705f6732c34b935a0b06545d6d8f")!) buffer.append(Data(hexadecimalString: "1280cf6b9eb0d2f0059c1a7b5c65acb83eb43836")!) buffer.append(Data(hexadecimalString: "13802f408f68fc7e48858daecf64d01f3f61827e")!) buffer.append(Data(hexadecimalString: "1480cd5975c1062ed45311a2602c0bbc9c78cf21")!) buffer.append(Data(hexadecimalString: "1580b6e27f3350bc7d4eb908313710931cbd4f23")!) buffer.append(Data(hexadecimalString: "168061f70e5e27e8b72faecfbb58b6b6ff65cbf0")!) buffer.append(Data(hexadecimalString: "178066bdd3a0b1e1ed0af8b2af88dcb1f4b1c3a4")!) buffer.append(Data(hexadecimalString: "18801eb9326019bca25b74804d196c04d079e495")!) buffer.append(Data(hexadecimalString: "1980a29097393f81aaef79ef421af54ccd3c35ed")!) buffer.append(Data(hexadecimalString: "1a80a3039b0372ddd79ef65293e4e99484573ab3")!) buffer.append(Data(hexadecimalString: "1b807e755140ea79b1913a7c491e606b7d1e4542")!) buffer.append(Data(hexadecimalString: "1c800c968daf03958bd8784e1cf8cea4fa903a80")!) buffer.append(Data(hexadecimalString: "1d8044c5c7baebadbf8e6877d725ab84484e6755")!) buffer.append(Data(hexadecimalString: "1e8036be160e8a03d2c07552fc513c8869170528")!) buffer.append(Data(hexadecimalString: "1f8038483ab634e7707e9ab8c8e3f87dd67f423f")!) buffer.append(Data(hexadecimalString: "2080f184e4457558d9b7944f21d6421b717ddfb1")!) buffer.append(Data(hexadecimalString: "2180bb4da6197852102a3a04b8acccea3c54f0f9")!) buffer.append(Data(hexadecimalString: "2280da93975f3ea1c39d2aff5dbbc4b183b66044")!) buffer.append(Data(hexadecimalString: "23804678951cdc83923fe5a88bda66221a48360b")!) buffer.append(Data(hexadecimalString: "2480aa9dc3fee16106bd551754d896da72ff772c")!) buffer.append(Data(hexadecimalString: "2580b825bb4eba580b57caadda1b90b449a8f2c5")!) buffer.append(Data(hexadecimalString: "2680117b62c286b395d2bf016848c65953595f19")!) buffer.append(Data(hexadecimalString: "27806d524b2b191bd9582f47fd3956ab851207af")!) buffer.append(Data(hexadecimalString: "2880c7df85c2ee5e9b3f5ae68ffba44a86e237e8")!) buffer.append(Data(hexadecimalString: "2980947fec3646851a510c8a61c0b3b7d90e410b")!) buffer.append(Data(hexadecimalString: "2a8014b04b3ff32e4d9d16f46880533cf4562af4")!) buffer.append(Data(hexadecimalString: "2b80c754e48edfa84f2f3b29976ce59cc110747d")!) buffer.append(Data(hexadecimalString: "2c8095a3ab4b66254954a51ca5e5c92d07be80fc")!) buffer.append(Data(hexadecimalString: "2d80bc4afa73d7f222f1b9e56083171057e32ca3")!) buffer.append(Data(hexadecimalString: "2e80c88dbe9a052d7ffd29d2f665bdd66811712f")!) buffer.append(Data(hexadecimalString: "2f804d2f9ee36fd6f3f48c30429c1629e39bbe3f")!) buffer.append(Data(hexadecimalString: "30808b01f598fc6420d85b3190d15f8d55f43faf")!) buffer.append(Data(hexadecimalString: "31801c171908c8ded10e81123f453c571c8f5199")!) buffer.append(Data(hexadecimalString: "32806275a5652f2447f63f1ab5d0dac84387d80c")!) buffer.append(Data(hexadecimalString: "3380f095361816ab06f0209a6ec3411c8f0c6ce1")!) buffer.append(Data(hexadecimalString: "3480a99ac0dae0c87f6a1d4ee4fe4e19671c29ba")!) buffer.append(Data(hexadecimalString: "3580811db50e1625a3b88305ea5c34b53e20700e")!) buffer.append(Data(hexadecimalString: "36800fbf211b6a454c788aa17b0cf14db76695a9")!) buffer.append(Data(hexadecimalString: "3780dfc186d1c189114f182709efc464f48c6b2f")!) buffer.append(Data(hexadecimalString: "38805e629e8e6457b1ec149897210cb6336b123f")!) buffer.append(Data(hexadecimalString: "398045d4dc9f4c074ec0e926a8d1768ae92b4866")!) buffer.append(Data(hexadecimalString: "3a801edf0d5d1c1a86c90c5eeef69e115fdd513a")!) buffer.append(Data(hexadecimalString: "3b8084223228b158081b465c74454450ec19a4c1")!) buffer.append(Data(hexadecimalString: "3c80fa306d71fc211bd9b9e55aeb16c582d21ec2")!) buffer.append(Data(hexadecimalString: "3d8072d8bbec74f1436958db431a92fc66cf5dd2")!) buffer.append(Data(hexadecimalString: "3e80888ef69a91f8dbb0ce70b6e5ec9289245878")!) buffer.append(Data(hexadecimalString: "3f8069c0d6d14e580be92f87a3255e124b25b451")!) buffer.append(Data(hexadecimalString: "4080b3cbae3d50ea52720bf5029243a4a9fea906")!) buffer.append(Data(hexadecimalString: "4180384321d07a4b5378aa272c9a7247830624b8")!) buffer.append(Data(hexadecimalString: "4280acf0b265dd82b68aeec5114161a34135b30e")!) buffer.append(Data(hexadecimalString: "43802d709c604266db64a4b5a5e6f6d8cfd7ece1")!) buffer.append(Data(hexadecimalString: "44807b48711b0630cd919dbf9ea7bf81efa1e8f1")!) buffer.append(Data(hexadecimalString: "4580c0282b679f9746ece875482d5e9a5ed59cb8")!) buffer.append(Data(hexadecimalString: "46808c7b718de4299f081449cce9aa9afadfcea9")!) buffer.append(Data(hexadecimalString: "478066cd4c36d6e816413b15955c958da4d8e866")!) buffer.append(Data(hexadecimalString: "48809b5170078157c542236bc7a09c96bc559069")!) buffer.append(Data(hexadecimalString: "49800be65a0bce639c69cd3d64db0fa22570756f")!) buffer.append(Data(hexadecimalString: "4a80e5ebd5381b077a8ac56e952b631256a076cc")!) buffer.append(Data(hexadecimalString: "4b80fb32d28e39021d49dc7b7ee65272ca1f28c1")!) buffer.append(Data(hexadecimalString: "4c8004486cc3dcad9f39c602d3ed9030e327cec3")!) buffer.append(Data(hexadecimalString: "4d809a5800c6d647c5f99e40a15327957745dce1")!) buffer.append(Data(hexadecimalString: "4e80d03a0b5368fda78b28d3975500ab160ac693")!) buffer.append(Data(hexadecimalString: "4f80dbc5ea65f540933f858a425ecdb378f62990")!) buffer.append(Data(hexadecimalString: "50802e7980ce9365ad4e434308fb2a8102dc9f6a")!) buffer.append(Data(hexadecimalString: "5180b71311e183ad9feecfd43b68072d5a9ad4af")!) buffer.append(Data(hexadecimalString: "5280e721c37d2b57f95cbf5f51025fb22b6ca60c")!) buffer.append(Data(hexadecimalString: "53805749eb01f070a5b015dcd0f68f5fea0b40c6")!) buffer.append(Data(hexadecimalString: "5480fae4ee747357e4d73265ad9411c565c41865")!) buffer.append(Data(hexadecimalString: "5580b75e9c62c7c2aa3ea3f94d219ef7330077d7")!) buffer.append(Data(hexadecimalString: "5680f2c59ee6b54a")!) XCTAssertEqual(Int(response.bufferLength), buffer.count) XCTAssertEqual(response.bufferCRC, buffer.crc16) let messages = buffer.glucose XCTAssertNotEqual(response.startTime, messages.first!.timestamp) XCTAssertNotEqual(response.endTime, messages.last!.timestamp) XCTAssertFalse(messages.first!.timestamp <= messages.last!.timestamp) XCTAssertEqual(191, messages.count) } }
mit
3e15150ebb1ed8c4aa760ce93d099f55
61.588915
138
0.76499
3.157889
false
false
false
false
AlbertXYZ/HDCP
HDCP/HDCP/HDHM09Controller.swift
1
7595
// // HDHM09Controller.swift // HDCP // // Created by 徐琰璋 on 16/1/18. // Copyright © 2016年 batonsoft. All rights reserved. // import UIKit class HDHM09Controller: UIViewController, UIScrollViewDelegate { var index: Int? var steps: Array<HDHM08StepModel>? var cancelBtn: UIButton? var imageScrollView: UIScrollView? var pageFlag: UILabel? var context: UILabel? /** * UIImageView重用 */ var centerImageView: UIImageView? var leftImageView: UIImageView? var rightImageView: UIImageView? override func viewDidLoad() { super.viewDidLoad() self.view.backgroundColor = UIColor.white setupUI() } deinit { HDLog.LogClassDestory("HDHM09Controller") } // MARK: - 创建UI视图 func setupUI() { createCancelBtn() createImageScrollView() createTextView() } func createCancelBtn() { if cancelBtn == nil { cancelBtn = UIButton(type: UIButton.ButtonType.custom) as UIButton cancelBtn?.setTitle("x", for: UIControl.State()) cancelBtn?.layer.cornerRadius = 15 cancelBtn?.titleLabel?.textAlignment = NSTextAlignment.center cancelBtn?.layer.masksToBounds = true cancelBtn?.setTitleColor(Constants.HDMainColor, for: UIControl.State.normal) cancelBtn?.layer.borderWidth = 0.5 cancelBtn?.addTarget(self, action: #selector(backAction), for: UIControl.Event.touchUpInside) cancelBtn?.layer.borderColor = Constants.HDMainColor.cgColor self.view.addSubview(cancelBtn!) unowned let WS = self cancelBtn?.snp.makeConstraints( { (make) -> Void in make.top.equalTo(WS.view).offset(50) make.right.equalTo(WS.view.snp.right).offset(-30) make.width.equalTo(30) make.height.equalTo(30) }) } } func createImageScrollView() { if imageScrollView == nil { imageScrollView = UIScrollView() imageScrollView!.isPagingEnabled = true imageScrollView!.isUserInteractionEnabled = true imageScrollView!.delegate = self imageScrollView!.showsVerticalScrollIndicator = false imageScrollView!.showsHorizontalScrollIndicator = false self.view.addSubview(imageScrollView!) unowned let WS = self imageScrollView!.snp.makeConstraints( { (make) -> Void in make.top.equalTo(WS.view).offset(Constants.HDSCREENHEIGHT / 2 - 100) make.left.equalTo(WS.view).offset(0) make.width.equalTo(Constants.HDSCREENWITH) make.height.equalTo(200) }) imageScrollView?.contentSize = CGSize(width: CGFloat(3) * Constants.HDSCREENWITH, height: 200) imageScrollView!.contentOffset = CGPoint(x: Constants.HDSCREENWITH, y: 0) centerImageView = UIImageView(frame: CGRect(x: Constants.HDSCREENWITH, y: 0, width: Constants.HDSCREENWITH, height: 200)) centerImageView!.contentMode = UIView.ContentMode.scaleToFill; imageScrollView?.addSubview(centerImageView!) leftImageView = UIImageView(frame: CGRect(x: 0, y: 0, width: Constants.HDSCREENWITH, height: 200)) leftImageView!.contentMode = UIView.ContentMode.scaleToFill; imageScrollView?.addSubview(leftImageView!) rightImageView = UIImageView(frame: CGRect(x: Constants.HDSCREENWITH * 2, y: 0, width: Constants.HDSCREENWITH, height: 200)) rightImageView!.contentMode = UIView.ContentMode.scaleToFill; imageScrollView?.addSubview(rightImageView!) } } func createTextView() { if pageFlag == nil { pageFlag = UILabel() pageFlag?.textColor = Constants.HDMainTextColor pageFlag?.font = UIFont.systemFont(ofSize: 26) self.view.addSubview(pageFlag!) unowned let WS = self pageFlag?.snp.makeConstraints( { (make) -> Void in make.width.equalTo(Constants.HDSCREENWITH - 60) make.height.equalTo(30) make.bottom.equalTo(WS.imageScrollView!.snp.top).offset(-5) make.left.equalTo(WS.view).offset(30) }) } if context == nil { context = UILabel() context?.numberOfLines = 0 context?.textColor = Constants.HDMainTextColor context?.font = UIFont.systemFont(ofSize: 18) self.view.addSubview(context!) unowned let WS = self context?.snp.makeConstraints( { (make) -> Void in make.width.equalTo(Constants.HDSCREENWITH - 60) make.height.equalTo(0) make.top.equalTo(WS.imageScrollView!.snp.bottom).offset(20) make.left.equalTo(WS.view).offset(30) }) } setInfoByCurrentImageIndex(index!) } // MARK: - events @objc func backAction() { self.dismiss(animated: true) { () -> Void in } } func loadImage() { if imageScrollView!.contentOffset.x > Constants.HDSCREENWITH { //向左滑动 index = (index! + 1 + (steps?.count)!) % (steps?.count)! } else if imageScrollView!.contentOffset.x < Constants.HDSCREENWITH { //向右滑动 index = (index! - 1 + (steps?.count)!) % (steps?.count)! } setInfoByCurrentImageIndex(index!) } func setInfoByCurrentImageIndex(_ index: Int) { let cmodel = steps![index] /// 文本信息 let str = String(format: "%d/%d", index + 1, (steps?.count)!) let str2: String = str.components(separatedBy: "/")[0] let attributed = NSMutableAttributedString(string: str) attributed.addAttribute(NSAttributedString.Key.font, value: UIFont.systemFont(ofSize: 26), range: NSMakeRange(0, str2.characters.count)) attributed.addAttribute(NSAttributedString.Key.foregroundColor, value: Constants.HDYellowColor, range: NSMakeRange(0, str2.characters.count)) pageFlag?.attributedText = attributed centerImageView!.kf.setImage(with: URL(string: cmodel.stepPhoto!), placeholder: UIImage(named: "noDataDefaultIcon"), options: nil, progressBlock: nil, completionHandler: nil) let lmodel = steps![((index - 1) + (steps?.count)!) % (steps?.count)!] leftImageView!.kf.setImage(with: URL(string: lmodel.stepPhoto!), placeholder: UIImage(named: "noDataDefaultIcon"), options: nil, progressBlock: nil, completionHandler: nil) let rmodel = steps![((index + 1) + (steps?.count)!) % (steps?.count)!] rightImageView!.kf.setImage(with: URL(string: rmodel.stepPhoto!), placeholder: UIImage(named: "noDataDefaultIcon"), options: nil, progressBlock: nil, completionHandler: nil) context?.text = cmodel.intro /// 计算文本高度 重新赋值 let rect = CoreUtils.getTextRectSize(cmodel.intro! as NSString, font: UIFont.systemFont(ofSize: 18), size: CGSize(width: Constants.HDSCREENWITH - 60, height: 999)) context?.snp.updateConstraints({ (make) -> Void in make.height.equalTo(rect.size.height + 10) }) } // MARK: - UIScrollView Delegate func scrollViewDidEndDecelerating(_ scrollView: UIScrollView) { loadImage() imageScrollView!.contentOffset = CGPoint(x: Constants.HDSCREENWITH, y: 0) } }
mit
e3a9fcc0c93d36db975c08fd235ecde1
30.772152
182
0.621248
4.558111
false
false
false
false
robtimp/xswift
exercises/rotational-cipher/Sources/RotationalCipher/RotationalCipherExample.swift
2
748
struct RotationalCipher { static func rotate(_ target: String, ROT: Int) -> String { var result = "" target.unicodeScalars.forEach { unicode in switch unicode.value { case 65...90: // A to Z var scalar = unicode.value + UInt32(ROT) if scalar > 90 { scalar -= 26 } result.append(Character(UnicodeScalar(scalar)!)) case 97...122: // a to z var scalar = unicode.value + UInt32(ROT) if scalar > 122 { scalar -= 26 } result.append(Character(UnicodeScalar(scalar)!)) default: result.append(Character(unicode)) } } return result } }
mit
11b35900533901a9d69186a2f22c6439
23.933333
64
0.5
4.857143
false
false
false
false
CharlinFeng/Reflect
Reflect/Parse2.swift
1
950
// // Test2.swift // Reflect // // Created by 成林 on 15/8/23. // Copyright (c) 2015年 冯成林. All rights reserved. // import UIKit import Foundation let Student2Dict = ["name": "jack", "age": 28, "bag": ["color": "blue", "price": 14.5]] as [String : Any] /** 在test1的基础上增加自定义对象 */ class Student2: Reflect { var name: String var age: NSNumber var bag: Bag required init(){ name = "" age = 0 bag = Bag() } class func parse(){ let stu2 = Student2.parse(dict: Student2Dict as NSDictionary) print("\(stu2)") } } class Bag: Reflect { var color: String var price: NSNumber required init(){ color = "" price = 0 } init (color: String, price: Float){ self.color = color self.price = NSNumber(floatLiteral: Double(price)) } }
mit
7478984ad38dc61fb57d958f0264472b
15.321429
105
0.519694
3.700405
false
false
false
false
gregomni/swift
test/Generics/sr7353.swift
3
512
// RUN: %target-swift-frontend -typecheck %s -debug-generic-signatures -requirement-machine-protocol-signatures=on 2>&1 | %FileCheck %s // CHECK-LABEL: sr7353.(file).P@ // CHECK-LABEL: <Self where Self == Self.[P]A.[Q]B, Self.[P]A : Q> protocol P { associatedtype A: Q where A.B == Self } // CHECK-LABEL: sr7353.(file).Q@ // CHECK-LABEL: <Self where Self == Self.[Q]B.[P]A, Self.[Q]B : P, Self.[Q]B == Self.[Q]C> protocol Q { associatedtype B: P where B.A == Self associatedtype C: P where C.A == Self }
apache-2.0
edab0ea076988d30fa542add329bb81c
35.571429
135
0.650391
2.797814
false
false
false
false
rvald/Wynfood.iOS
Wynfood/LogInView.swift
1
6691
// // LogInView.swift // Wynfood // // Created by craftman on 6/2/17. // Copyright © 2017 craftman. All rights reserved. // import UIKit import FirebaseAuth class LogInView: UIView, UITextFieldDelegate { // MARK: - Properties let authService = AuthenticationService() let dismissViewNotification = Notification.Name("WynfoodDismissViewNotification") let presentAlertNotification = Notification.Name("WynfoodPresentAlertNotification") let networkingService = NetworkingService() // MARK: - Intialization override init(frame: CGRect) { super.init(frame: frame) emailField.delegate = self passwordField.delegate = self self.addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(handleTap))) translatesAutoresizingMaskIntoConstraints = false setupView() } required init?(coder aDecoder: NSCoder) { fatalError("init(coder:) has not been implemented") } // MARK: - Views lazy var emailField: UITextField = { let field = UITextField() field.placeholder = "[email protected]" field.borderStyle = .none field.backgroundColor = UIColor.white field.layer.cornerRadius = 5.0 field.textAlignment = .center field.delegate = self field.translatesAutoresizingMaskIntoConstraints = false return field }() lazy var passwordField: UITextField = { let field = UITextField() field.placeholder = "Password1" field.borderStyle = .none field.backgroundColor = UIColor.white field.layer.cornerRadius = 5.0 field.textAlignment = .center field.isSecureTextEntry = true field.delegate = self field.translatesAutoresizingMaskIntoConstraints = false return field }() let logInButton: UIButton = { let button = UIButton(type: UIButtonType.system) button.setTitle("Log In", for: .normal) button.setTitleColor(UIColor(red: 0.0/255.0, green: 122.0/255.0, blue: 255.0/255.0, alpha: 1.0), for: .normal) button.backgroundColor = UIColor.white button.layer.cornerRadius = 5.0 button.addTarget(self, action: #selector(logInButtonTap), for: .touchUpInside) button.translatesAutoresizingMaskIntoConstraints = false return button }() // MARK: - Methods func setupView() { addSubview(emailField) addSubview(passwordField) addSubview(logInButton) // name field constraints addConstraint(NSLayoutConstraint(item: emailField, attribute: .top, relatedBy: .equal, toItem: self, attribute: .top, multiplier: 1.0, constant: 1.0)) addConstraints(NSLayoutConstraint.constraints(withVisualFormat: "H:|[v0]|", options: NSLayoutFormatOptions(), metrics: nil, views: ["v0": emailField])) addConstraints(NSLayoutConstraint.constraints(withVisualFormat: "V:[v0(44)]", options: NSLayoutFormatOptions(), metrics: nil, views: ["v0": emailField])) // password field constraints addConstraint(NSLayoutConstraint(item: passwordField, attribute: .top, relatedBy: .equal, toItem: emailField, attribute: .bottom, multiplier: 1.0, constant: 12.0)) addConstraints(NSLayoutConstraint.constraints(withVisualFormat: "H:|[v0]|", options: NSLayoutFormatOptions(), metrics: nil, views: ["v0": passwordField])) addConstraints(NSLayoutConstraint.constraints(withVisualFormat: "V:[v0(44)]", options: NSLayoutFormatOptions(), metrics: nil, views: ["v0": passwordField])) // login button constraints addConstraint(NSLayoutConstraint(item: logInButton, attribute: .top, relatedBy: .equal, toItem: passwordField, attribute: .bottom, multiplier: 1.0, constant: 12.0)) addConstraints(NSLayoutConstraint.constraints(withVisualFormat: "H:|[v0]|", options: NSLayoutFormatOptions(), metrics: nil, views: ["v0": logInButton])) addConstraints(NSLayoutConstraint.constraints(withVisualFormat: "V:[v0(44)]", options: NSLayoutFormatOptions(), metrics: nil, views: ["v0": logInButton])) } func handleTap(sender: UITapGestureRecognizer) { if sender.state == .ended { if emailField.isFirstResponder || passwordField.isFirstResponder { emailField.resignFirstResponder() passwordField.resignFirstResponder() } } } // MARK: - Actions func logInButtonTap(sender: UIButton, forEvent event: UIEvent) { UIView.animate(withDuration: 0.7) { sender.setTitle("Logging in ...", for: .normal) } if authService.isEmailAndPasswordValid(email: emailField.text!, password: passwordField.text!) { Auth.auth().signIn(withEmail: emailField.text!, password: passwordField.text!) { (user, error) in if error != nil { let info: [String: String] = ["message": (error?.localizedDescription)!] NotificationCenter.default.post(name: self.presentAlertNotification, object: nil, userInfo: info) self.emailField.text = "" self.passwordField.text = "" self.logInButton.setTitle("Log In", for: .normal) return } else { let email = self.emailField.text!.lowercased() let userName = self.authService.userNameFromEmail(email: email) let defaults = UserDefaults.standard defaults.set(userName, forKey: "UserName") defaults.set(email, forKey: "UserEmail") NotificationCenter.default.post(name: self.dismissViewNotification, object: nil) } } } else { let info: [String: String] = ["message": "Invalid Email or Password"] NotificationCenter.default.post(name: presentAlertNotification, object: nil, userInfo: info) self.logInButton.setTitle("Log In", for: .normal) } } // MARK: - Textfield Delegate func textFieldShouldReturn(_ textField: UITextField) -> Bool { resignFirstResponder() return true } }
apache-2.0
2cf00966ff7919eab960437fbd4621a0
37.448276
172
0.602691
5.373494
false
false
false
false
HarshilShah/DeckTransition
Source/DeckTransitioningDelegate.swift
1
5736
// // DeckTransitioningDelegate.swift // DeckTransition // // Created by Harshil Shah on 15/10/16. // Copyright © 2016 Harshil Shah. All rights reserved. // import UIKit /// The DeckTransitioningDelegate class vends out the presentation and animation /// controllers required to present a view controller with the Deck transition /// style /// /// The following snippet described the steps for presenting a given /// `ModalViewController` with the `DeckTransitioningDelegate` /// /// ```swift /// let modal = ModalViewController() /// let transitionDelegate = DeckTransitioningDelegate() /// modal.transitioningDelegate = transitionDelegate /// modal.modalPresentationStyle = .custom /// present(modal, animated: true, completion: nil) /// ``` public final class DeckTransitioningDelegate: NSObject, UIViewControllerTransitioningDelegate { // MARK: - Private variables private let isSwipeToDismissEnabled: Bool private let presentDuration: TimeInterval? private let presentAnimation: (() -> ())? private let presentCompletion: ((Bool) -> ())? private let dismissDuration: TimeInterval? private let dismissAnimation: (() -> ())? private let dismissCompletion: ((Bool) -> ())? // MARK: - Initializers /// Returns a transitioning delegate to perform a Deck transition. All /// parameters are optional. Swipe-to-dimiss is enabled by default. Leaving /// the duration parameters empty gives you animations with the default /// durations (0.3s for both) /// /// - Parameters: /// - isSwipeToDismissEnabled: Whether the modal view controller should /// be dismissed with a swipe gesture from top to bottom /// - presentDuration: The duration for the presentation animation /// - presentAnimation: An animation block that will be performed /// alongside the card presentation animation /// - presentCompletion: A block that will be run after the card has been /// presented /// - dismissDuration: The duration for the dismissal animation /// - dismissAnimation: An animation block that will be performed /// alongside the card dismissal animation /// - dismissCompletion: A block that will be run after the card has been /// dismissed @objc public init(isSwipeToDismissEnabled: Bool = true, presentDuration: NSNumber? = nil, presentAnimation: (() -> ())? = nil, presentCompletion: ((Bool) -> ())? = nil, dismissDuration: NSNumber? = nil, dismissAnimation: (() -> ())? = nil, dismissCompletion: ((Bool) -> ())? = nil) { self.isSwipeToDismissEnabled = isSwipeToDismissEnabled self.presentDuration = presentDuration?.doubleValue self.presentAnimation = presentAnimation self.presentCompletion = presentCompletion self.dismissDuration = dismissDuration?.doubleValue self.dismissAnimation = dismissAnimation self.dismissCompletion = dismissCompletion } // MARK: - UIViewControllerTransitioningDelegate /// Returns an animation controller that animates the modal presentation /// /// This is internal infrastructure handled entirely by UIKit and shouldn't /// be called directly /// /// - Parameters: /// - presented: The modal view controller to be presented onscreen /// - presenting: The view controller that will be presenting the modal /// - source: The view controller whose `present` method is called /// - Returns: An animation controller that animates the modal presentation public func animationController(forPresented presented: UIViewController, presenting: UIViewController, source: UIViewController) -> UIViewControllerAnimatedTransitioning? { return DeckPresentingAnimationController(duration: presentDuration) } /// Returns an animation controller that animates the modal dismissal /// /// This is internal infrastructure handled entirely by UIKit and shouldn't /// be called directly /// /// - Parameter dismissed: The modal view controller which will be dismissed /// - Returns: An animation controller that animates the modal dismisall public func animationController(forDismissed dismissed: UIViewController) -> UIViewControllerAnimatedTransitioning? { return DeckDismissingAnimationController(duration: dismissDuration) } /// Returns a presentation controller that manages the modal presentation /// /// This is internal infrastructure handled entirely by UIKit and shouldn't /// be called directly /// /// - Parameters: /// - presented: The modal view controller /// - presenting: The view controller which presented the modal /// - source: The view controller whose `present` method was called to /// present the modal /// - Returns: A presentation controller that manages the modal presentation public func presentationController(forPresented presented: UIViewController, presenting: UIViewController?, source: UIViewController) -> UIPresentationController? { let presentationController = DeckPresentationController( presentedViewController: presented, presenting: presenting, isSwipeToDismissGestureEnabled: isSwipeToDismissEnabled, presentAnimation: presentAnimation, presentCompletion: presentCompletion, dismissAnimation: dismissAnimation, dismissCompletion: dismissCompletion) presentationController.transitioningDelegate = self return presentationController } }
mit
023b7adb8be38128dad26e1e2b303bb0
45.25
177
0.693461
5.712151
false
false
false
false
imzyf/99-projects-of-swift
007-meun-button-animation/007-meun-button-animation/ChangeAnimationView.swift
1
8658
import UIKit import BezierPathLength class ChangeAnimationView: UIView, CAAnimationDelegate { // 按钮 三条线 var topLineLayer: CAShapeLayer! var middleLineLayer: CAShapeLayer! var bottomLineLayer: CAShapeLayer! let raduis: CGFloat = 50.0 let lineWidth: CGFloat = 50.0 let lineGapHeight: CGFloat = 10.0 let lineHeight: CGFloat = 8.0 let kStep1Duration: CGFloat = 0.3 let kStep2Duration: CGFloat = 0.3 let kStep3Duration: CGFloat = 1.0 let kStep4Duration: CGFloat = 1.0 let kTopY: CGFloat! let kCenterY: CGFloat! let kBottomY: CGFloat! override init(frame: CGRect) { kTopY = raduis - lineGapHeight kCenterY = kTopY + lineGapHeight + lineHeight kBottomY = kCenterY + lineGapHeight + lineHeight super.init(frame: frame) self.backgroundColor = .orange initLayers() animationStep1() } func initLayers() { // top let topLayer = CALayer() self.layer.addSublayer(topLayer) topLayer.frame = CGRect(x: (self.bounds.size.width - lineWidth)/2, y: kTopY, width: lineWidth, height: lineWidth) topLineLayer = CAShapeLayer() initLine(topLineLayer, in: topLayer) // middle let middleLayer = CALayer() self.layer.addSublayer(middleLayer) middleLayer.frame = topLayer.frame middleLayer.frame.origin.y = kCenterY middleLineLayer = CAShapeLayer() initLine(middleLineLayer, in: middleLayer) // buttom let bottomLayer = CALayer() self.layer.addSublayer(bottomLayer) bottomLayer.frame = topLayer.frame bottomLayer.frame.origin.y = kBottomY bottomLineLayer = CAShapeLayer() initLine(bottomLineLayer, in: bottomLayer) } // 初始化 每一条线 func initLine(_ lineLayer: CAShapeLayer, in layer: CALayer) { let initPath = UIBezierPath() initPath.move(to: CGPoint(x: 0, y: 0)) initPath.addLine(to: CGPoint(x: lineWidth, y: 0)) lineLayer.strokeColor = UIColor.white.cgColor lineLayer.fillColor = nil lineLayer.lineWidth = lineHeight lineLayer.lineCap = kCALineCapRound lineLayer.path = initPath.cgPath layer.addSublayer(lineLayer) } // 代理 func animationDidStop(_ anim: CAAnimation, finished flag: Bool) { if let animationID = anim.value(forKey: "animationID") { switch animationID as! String { case "step1": animationStep2() break case "step2": animationStep3() break case "step3": // 清除原来的路径 - don't know why middleLineLayer.path = nil topLineLayer.path = nil bottomLineLayer.path = nil initLayers() animationStep1() break default: break } } } func animationStep1() { let strokAnimation = CABasicAnimation(keyPath: "strokeEnd") strokAnimation.fromValue = 1.0 strokAnimation.toValue = 0.7 let pathAnimation = CABasicAnimation(keyPath: "position.x") pathAnimation.fromValue = 0.0 pathAnimation.toValue = -10.0 let animationGroup = CAAnimationGroup() animationGroup.animations = [strokAnimation, pathAnimation] animationGroup.duration = CFTimeInterval(kStep1Duration) animationGroup.setValue("step1", forKey: "animationID" ) animationGroup.delegate = self middleLineLayer.add(animationGroup, forKey: nil) } func animationStep2() { let strokAnimation = CABasicAnimation(keyPath: "strokeEnd") strokAnimation.fromValue = 0.7 strokAnimation.toValue = 0.5 let pathAnimation = CABasicAnimation(keyPath: "position.x") pathAnimation.fromValue = -10.0 pathAnimation.toValue = 0.5*lineWidth let animationGroup = CAAnimationGroup() animationGroup.animations = [strokAnimation, pathAnimation] animationGroup.duration = CFTimeInterval(kStep2Duration) animationGroup.setValue("step2", forKey: "animationID" ) animationGroup.delegate = self middleLineLayer.add(animationGroup, forKey: nil) } func animationStep3() { // 开始点 let startPoint = CGPoint(x: lineWidth/2, y: 0) // 1 - 向上的旋转 - endPoint 是圆上 -30° let angle: CGFloat = .pi * 30 / 180 // 结束点 var endPoint = CGPoint() endPoint.x = lineWidth/2.0 + cos(angle) * raduis endPoint.y = 0 - sin(angle) * raduis // 控制点 let controlPointX: CGFloat = lineWidth/2.0 + acos(angle) * raduis let controlPointY: CGFloat = 0 let controlPoint = CGPoint(x: controlPointX, y: controlPointY) let path = UIBezierPath() path.move(to: startPoint) path.addQuadCurve(to: endPoint, controlPoint: controlPoint) // 计算 ac 长度 let curveLength = path.length // 2 - 弧度 CD let pathCD = UIBezierPath(arcCenter: CGPoint(x: lineWidth/2, y: 0), radius: raduis, startAngle: .pi * 2 - angle , endAngle: .pi + angle , clockwise: false) path.append(pathCD) // 3 - DD' let pathDD = UIBezierPath(arcCenter: CGPoint(x: lineWidth/2, y: 0), radius: raduis, startAngle: .pi*3/2 - (.pi/2-angle) , endAngle: -.pi/2 - (.pi/2-angle) , clockwise: false) path.append(pathDD) middleLineLayer.path = path.cgPath // path 总长度 let pathTotalLength = path.length // 初始笔记:拐角弧线的三分之一 (视觉测试) let originPercent: CGFloat = curveLength/pathTotalLength/3 // 尾迹:拐角弧线 + 120° 弧线 let endPercent: CGFloat = (curveLength + raduis * (.pi - 2*angle))/pathTotalLength let endAnimation = CAKeyframeAnimation(keyPath: "strokeEnd") endAnimation.values = [originPercent, 1] let startAnimation = CAKeyframeAnimation(keyPath: "strokeStart") startAnimation.values = [0.0, endPercent] let animationGroup = CAAnimationGroup() animationGroup.animations = [startAnimation, endAnimation] animationGroup.duration = CFTimeInterval(kStep3Duration) animationGroup.setValue("step3", forKey: "animationID" ) animationGroup.delegate = self animationGroup.fillMode = kCAFillModeForwards animationGroup.isRemovedOnCompletion = false middleLineLayer.add(animationGroup, forKey: nil) animationStep3_1() } func animationStep3_1() { // 平移量 - don't know why let toValue: CGFloat = lineWidth * (1 - cos(.pi/4)) / 2.0; let xRotationAnimation = CAKeyframeAnimation(keyPath: "transform.translation.x") xRotationAnimation.values = [0,toValue] let angle10: CGFloat = .pi * 10 / 180 let zRotationAnimation = CAKeyframeAnimation(keyPath: "transform.rotation.z") zRotationAnimation.values = [0, angle10, -(angle10+CGFloat.pi/4), -CGFloat.pi/4] let zTopRotationAnimation = CAKeyframeAnimation(keyPath: "transform.rotation.z") zTopRotationAnimation.values = [0, -angle10, (angle10+CGFloat.pi/4), CGFloat.pi/4] var animationGroup = CAAnimationGroup() animationGroup.animations = [xRotationAnimation ,zTopRotationAnimation] animationGroup.duration = CFTimeInterval(kStep3Duration) animationGroup.delegate = self animationGroup.fillMode = kCAFillModeForwards animationGroup.isRemovedOnCompletion = false topLineLayer.add(animationGroup, forKey: nil) animationGroup = CAAnimationGroup() animationGroup.animations = [xRotationAnimation ,zRotationAnimation] animationGroup.duration = CFTimeInterval(kStep3Duration) animationGroup.delegate = self animationGroup.fillMode = kCAFillModeForwards animationGroup.isRemovedOnCompletion = false bottomLineLayer.add(animationGroup, forKey: nil) } required init?(coder aDecoder: NSCoder) { fatalError("init(coder:) has not been implemented") } }
mit
183f8031af2bf847dd6f3e3b77d27097
34.556485
182
0.611673
4.747486
false
false
false
false
loudnate/LoopKit
LoopKit/CarbKit/CachedCarbObject+CoreDataClass.swift
1
2075
// // CachedCarbObject+CoreDataClass.swift // LoopKit // // Copyright © 2018 LoopKit Authors. All rights reserved. // // import Foundation import CoreData import HealthKit class CachedCarbObject: NSManagedObject { var absorptionTime: TimeInterval? { get { willAccessValue(forKey: "absorptionTime") defer { didAccessValue(forKey: "absorptionTime") } return primitiveAbsorptionTime?.doubleValue } set { willChangeValue(forKey: "absorptionTime") defer { didChangeValue(forKey: "absorptionTime") } primitiveAbsorptionTime = newValue != nil ? NSNumber(value: newValue!) : nil } } var startDate: Date! { get { willAccessValue(forKey: "startDate") defer { didAccessValue(forKey: "startDate") } return primitiveStartDate! as Date } set { willChangeValue(forKey: "startDate") defer { didChangeValue(forKey: "startDate") } primitiveStartDate = newValue as NSDate } } var uploadState: UploadState { get { willAccessValue(forKey: "uploadState") defer { didAccessValue(forKey: "uploadState") } return UploadState(rawValue: primitiveUploadState!.intValue)! } set { willChangeValue(forKey: "uploadState") defer { didChangeValue(forKey: "uploadState") } primitiveUploadState = NSNumber(value: newValue.rawValue) } } } extension CachedCarbObject { func update(from entry: StoredCarbEntry) { uuid = entry.sampleUUID syncIdentifier = entry.syncIdentifier syncVersion = Int32(clamping: entry.syncVersion) startDate = entry.startDate grams = entry.quantity.doubleValue(for: .gram()) foodType = entry.foodType absorptionTime = entry.absorptionTime createdByCurrentApp = entry.createdByCurrentApp if let id = entry.externalID { externalID = id } } }
mit
5d95578e2c77be9e8ac405b7b14c5587
28.211268
88
0.612825
5.17207
false
false
false
false
biohazardlover/ByTrain
ByTrain/Station/StationsViewModel.swift
1
1358
// // StationsViewModel.swift // ByTrain // // Created by Leon Li on 19/01/2018. // Copyright © 2018 pp. All rights reserved. // import RxSwift class StationsViewModel: NSObject { func allStations() -> Observable<[StationGroup]> { return AllStationsService() .rx .response() .map { stations -> [StationGroup] in var stationGroups = [StationGroup]() for station in stations { if let stationNameIntials = station.stationNameIntials, let firstCharacter = stationNameIntials.first { let initial = String(firstCharacter).uppercased() if var stationGroup = (stationGroups.filter() { $0.initial == initial }).first { stationGroup.stations.append(station) } else { var stationGroup = StationGroup() stationGroup.initial = initial stationGroup.stations.append(station) stationGroups.append(stationGroup) } } } stationGroups.sort(by: { $0.initial <= $1.initial }) return stationGroups } } }
mit
60890a63d58e3158b1b4b59b127daff1
34.710526
123
0.490052
5.561475
false
false
false
false
prot3ct/Ventio
Ventio/Pods/Kingfisher/Sources/Image.swift
6
34186
// // Image.swift // Kingfisher // // Created by Wei Wang on 16/1/6. // // Copyright (c) 2017 Wei Wang <[email protected]> // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. #if os(macOS) import AppKit private var imagesKey: Void? private var durationKey: Void? #else import UIKit import MobileCoreServices private var imageSourceKey: Void? #endif private var animatedImageDataKey: Void? import ImageIO import CoreGraphics #if !os(watchOS) import Accelerate import CoreImage #endif // MARK: - Image Properties extension Kingfisher where Base: Image { fileprivate(set) var animatedImageData: Data? { get { return objc_getAssociatedObject(base, &animatedImageDataKey) as? Data } set { objc_setAssociatedObject(base, &animatedImageDataKey, newValue, .OBJC_ASSOCIATION_RETAIN_NONATOMIC) } } #if os(macOS) var cgImage: CGImage? { return base.cgImage(forProposedRect: nil, context: nil, hints: nil) } var scale: CGFloat { return 1.0 } fileprivate(set) var images: [Image]? { get { return objc_getAssociatedObject(base, &imagesKey) as? [Image] } set { objc_setAssociatedObject(base, &imagesKey, newValue, .OBJC_ASSOCIATION_RETAIN_NONATOMIC) } } fileprivate(set) var duration: TimeInterval { get { return objc_getAssociatedObject(base, &durationKey) as? TimeInterval ?? 0.0 } set { objc_setAssociatedObject(base, &durationKey, newValue, .OBJC_ASSOCIATION_RETAIN_NONATOMIC) } } var size: CGSize { return base.representations.reduce(CGSize.zero, { size, rep in return CGSize(width: max(size.width, CGFloat(rep.pixelsWide)), height: max(size.height, CGFloat(rep.pixelsHigh))) }) } #else var cgImage: CGImage? { return base.cgImage } var scale: CGFloat { return base.scale } var images: [Image]? { return base.images } var duration: TimeInterval { return base.duration } fileprivate(set) var imageSource: ImageSource? { get { return objc_getAssociatedObject(base, &imageSourceKey) as? ImageSource } set { objc_setAssociatedObject(base, &imageSourceKey, newValue, .OBJC_ASSOCIATION_RETAIN_NONATOMIC) } } var size: CGSize { return base.size } #endif } // MARK: - Image Conversion extension Kingfisher where Base: Image { #if os(macOS) static func image(cgImage: CGImage, scale: CGFloat, refImage: Image?) -> Image { return Image(cgImage: cgImage, size: CGSize.zero) } /** Normalize the image. This method does nothing in OS X. - returns: The image itself. */ public var normalized: Image { return base } static func animated(with images: [Image], forDuration forDurationduration: TimeInterval) -> Image? { return nil } #else static func image(cgImage: CGImage, scale: CGFloat, refImage: Image?) -> Image { if let refImage = refImage { return Image(cgImage: cgImage, scale: scale, orientation: refImage.imageOrientation) } else { return Image(cgImage: cgImage, scale: scale, orientation: .up) } } /** Normalize the image. This method will try to redraw an image with orientation and scale considered. - returns: The normalized image with orientation set to up and correct scale. */ public var normalized: Image { // prevent animated image (GIF) lose it's images guard images == nil else { return base } // No need to do anything if already up guard base.imageOrientation != .up else { return base } return draw(cgImage: nil, to: size) { base.draw(in: CGRect(origin: CGPoint.zero, size: size)) } } static func animated(with images: [Image], forDuration duration: TimeInterval) -> Image? { return .animatedImage(with: images, duration: duration) } #endif } // MARK: - Image Representation extension Kingfisher where Base: Image { // MARK: - PNG public func pngRepresentation() -> Data? { #if os(macOS) guard let cgimage = cgImage else { return nil } let rep = NSBitmapImageRep(cgImage: cgimage) return rep.representation(using: .PNG, properties: [:]) #else return UIImagePNGRepresentation(base) #endif } // MARK: - JPEG public func jpegRepresentation(compressionQuality: CGFloat) -> Data? { #if os(macOS) guard let cgImage = cgImage else { return nil } let rep = NSBitmapImageRep(cgImage: cgImage) return rep.representation(using:.JPEG, properties: [NSImageCompressionFactor: compressionQuality]) #else return UIImageJPEGRepresentation(base, compressionQuality) #endif } // MARK: - GIF public func gifRepresentation() -> Data? { return animatedImageData } } // MARK: - Create images from data extension Kingfisher where Base: Image { static func animated(with data: Data, scale: CGFloat = 1.0, duration: TimeInterval = 0.0, preloadAll: Bool, onlyFirstFrame: Bool = false) -> Image? { func decode(from imageSource: CGImageSource, for options: NSDictionary) -> ([Image], TimeInterval)? { //Calculates frame duration for a gif frame out of the kCGImagePropertyGIFDictionary dictionary func frameDuration(from gifInfo: NSDictionary?) -> Double { let gifDefaultFrameDuration = 0.100 guard let gifInfo = gifInfo else { return gifDefaultFrameDuration } let unclampedDelayTime = gifInfo[kCGImagePropertyGIFUnclampedDelayTime as String] as? NSNumber let delayTime = gifInfo[kCGImagePropertyGIFDelayTime as String] as? NSNumber let duration = unclampedDelayTime ?? delayTime guard let frameDuration = duration else { return gifDefaultFrameDuration } return frameDuration.doubleValue > 0.011 ? frameDuration.doubleValue : gifDefaultFrameDuration } let frameCount = CGImageSourceGetCount(imageSource) var images = [Image]() var gifDuration = 0.0 for i in 0 ..< frameCount { guard let imageRef = CGImageSourceCreateImageAtIndex(imageSource, i, options) else { return nil } if frameCount == 1 { // Single frame gifDuration = Double.infinity } else { // Animated GIF guard let properties = CGImageSourceCopyPropertiesAtIndex(imageSource, i, nil) else { return nil } let gifInfo = (properties as NSDictionary)[kCGImagePropertyGIFDictionary as String] as? NSDictionary gifDuration += frameDuration(from: gifInfo) } images.append(Kingfisher<Image>.image(cgImage: imageRef, scale: scale, refImage: nil)) if onlyFirstFrame { break } } return (images, gifDuration) } // Start of kf.animatedImageWithGIFData let options: NSDictionary = [kCGImageSourceShouldCache as String: true, kCGImageSourceTypeIdentifierHint as String: kUTTypeGIF] guard let imageSource = CGImageSourceCreateWithData(data as CFData, options) else { return nil } #if os(macOS) guard let (images, gifDuration) = decode(from: imageSource, for: options) else { return nil } let image: Image? if onlyFirstFrame { image = images.first } else { image = Image(data: data) image?.kf.images = images image?.kf.duration = gifDuration } image?.kf.animatedImageData = data return image #else let image: Image? if preloadAll || onlyFirstFrame { guard let (images, gifDuration) = decode(from: imageSource, for: options) else { return nil } image = onlyFirstFrame ? images.first : Kingfisher<Image>.animated(with: images, forDuration: duration <= 0.0 ? gifDuration : duration) } else { image = Image(data: data) image?.kf.imageSource = ImageSource(ref: imageSource) } image?.kf.animatedImageData = data return image #endif } static func image(data: Data, scale: CGFloat, preloadAllGIFData: Bool, onlyFirstFrame: Bool) -> Image? { var image: Image? #if os(macOS) switch data.kf.imageFormat { case .JPEG: image = Image(data: data) case .PNG: image = Image(data: data) case .GIF: image = Kingfisher<Image>.animated( with: data, scale: scale, duration: 0.0, preloadAll: preloadAllGIFData, onlyFirstFrame: onlyFirstFrame) case .unknown: image = Image(data: data) } #else switch data.kf.imageFormat { case .JPEG: image = Image(data: data, scale: scale) case .PNG: image = Image(data: data, scale: scale) case .GIF: image = Kingfisher<Image>.animated( with: data, scale: scale, duration: 0.0, preloadAll: preloadAllGIFData, onlyFirstFrame: onlyFirstFrame) case .unknown: image = Image(data: data, scale: scale) } #endif return image } } // MARK: - Image Transforming extension Kingfisher where Base: Image { // MARK: - Round Corner /// Create a round corner image based on `self`. /// /// - parameter radius: The round corner radius of creating image. /// - parameter size: The target size of creating image. /// /// - returns: An image with round corner of `self`. /// /// - Note: This method only works for CG-based image. public func image(withRoundRadius radius: CGFloat, fit size: CGSize) -> Image { guard let cgImage = cgImage else { assertionFailure("[Kingfisher] Round corner image only works for CG-based image.") return base } let rect = CGRect(origin: CGPoint(x: 0, y: 0), size: size) return draw(cgImage: cgImage, to: size) { #if os(macOS) let path = NSBezierPath(roundedRect: rect, xRadius: radius, yRadius: radius) path.windingRule = .evenOddWindingRule path.addClip() base.draw(in: rect) #else guard let context = UIGraphicsGetCurrentContext() else { assertionFailure("[Kingfisher] Failed to create CG context for image.") return } let path = UIBezierPath(roundedRect: rect, byRoundingCorners: .allCorners, cornerRadii: CGSize(width: radius, height: radius)).cgPath context.addPath(path) context.clip() base.draw(in: rect) #endif } } #if os(iOS) || os(tvOS) func resize(to size: CGSize, for contentMode: UIViewContentMode) -> Image { switch contentMode { case .scaleAspectFit: return resize(to: size, for: .aspectFit) case .scaleAspectFill: return resize(to: size, for: .aspectFill) default: return resize(to: size) } } #endif // MARK: - Resize /// Resize `self` to an image of new size. /// /// - parameter size: The target size. /// /// - returns: An image with new size. /// /// - Note: This method only works for CG-based image. public func resize(to size: CGSize) -> Image { guard let cgImage = cgImage else { assertionFailure("[Kingfisher] Resize only works for CG-based image.") return base } let rect = CGRect(origin: CGPoint(x: 0, y: 0), size: size) return draw(cgImage: cgImage, to: size) { #if os(macOS) base.draw(in: rect, from: NSRect.zero, operation: .copy, fraction: 1.0) #else base.draw(in: rect) #endif } } /// Resize `self` to an image of new size, respecting the content mode. /// /// - Parameters: /// - size: The target size. /// - contentMode: Content mode of output image should be. /// - Returns: An image with new size. public func resize(to size: CGSize, for contentMode: ContentMode) -> Image { switch contentMode { case .aspectFit: let newSize = self.size.kf.constrained(size) return resize(to: newSize) case .aspectFill: let newSize = self.size.kf.filling(size) return resize(to: newSize) default: return resize(to: size) } } public func crop(to size: CGSize, anchorOn anchor: CGPoint) -> Image { guard let cgImage = cgImage else { assertionFailure("[Kingfisher] Crop only works for CG-based image.") return base } let rect = self.size.kf.constrainedRect(for: size, anchor: anchor) guard let image = cgImage.cropping(to: rect) else { assertionFailure("[Kingfisher] Cropping image failed.") return base } return Kingfisher.image(cgImage: image, scale: scale, refImage: base) } // MARK: - Blur /// Create an image with blur effect based on `self`. /// /// - parameter radius: The blur radius should be used when creating blue. /// /// - returns: An image with blur effect applied. /// /// - Note: This method only works for CG-based image. public func blurred(withRadius radius: CGFloat) -> Image { #if os(watchOS) return base #else guard let cgImage = cgImage else { assertionFailure("[Kingfisher] Blur only works for CG-based image.") return base } // http://www.w3.org/TR/SVG/filters.html#feGaussianBlurElement // let d = floor(s * 3*sqrt(2*pi)/4 + 0.5) // if d is odd, use three box-blurs of size 'd', centered on the output pixel. let s = Float(max(radius, 2.0)) // We will do blur on a resized image (*0.5), so the blur radius could be half as well. // Fix the slow compiling time for Swift 3. // See https://github.com/onevcat/Kingfisher/issues/611 let pi2 = 2 * Float.pi let sqrtPi2 = sqrt(pi2) var targetRadius = floor(s * 3.0 * sqrtPi2 / 4.0 + 0.5) if targetRadius.isEven { targetRadius += 1 } let iterations: Int if radius < 0.5 { iterations = 1 } else if radius < 1.5 { iterations = 2 } else { iterations = 3 } let w = Int(size.width) let h = Int(size.height) let rowBytes = Int(CGFloat(cgImage.bytesPerRow)) func createEffectBuffer(_ context: CGContext) -> vImage_Buffer { let data = context.data let width = vImagePixelCount(context.width) let height = vImagePixelCount(context.height) let rowBytes = context.bytesPerRow return vImage_Buffer(data: data, height: height, width: width, rowBytes: rowBytes) } guard let context = beginContext(size: size) else { assertionFailure("[Kingfisher] Failed to create CG context for blurring image.") return base } defer { endContext() } context.draw(cgImage, in: CGRect(x: 0, y: 0, width: w, height: h)) var inBuffer = createEffectBuffer(context) guard let outContext = beginContext(size: size) else { assertionFailure("[Kingfisher] Failed to create CG context for blurring image.") return base } defer { endContext() } var outBuffer = createEffectBuffer(outContext) for _ in 0 ..< iterations { vImageBoxConvolve_ARGB8888(&inBuffer, &outBuffer, nil, 0, 0, UInt32(targetRadius), UInt32(targetRadius), nil, vImage_Flags(kvImageEdgeExtend)) (inBuffer, outBuffer) = (outBuffer, inBuffer) } #if os(macOS) let result = outContext.makeImage().flatMap { fixedForRetinaPixel(cgImage: $0, to: size) } #else let result = outContext.makeImage().flatMap { Image(cgImage: $0, scale: base.scale, orientation: base.imageOrientation) } #endif guard let blurredImage = result else { assertionFailure("[Kingfisher] Can not make an blurred image within this context.") return base } return blurredImage #endif } // MARK: - Overlay /// Create an image from `self` with a color overlay layer. /// /// - parameter color: The color should be use to overlay. /// - parameter fraction: Fraction of input color. From 0.0 to 1.0. 0.0 means solid color, 1.0 means transparent overlay. /// /// - returns: An image with a color overlay applied. /// /// - Note: This method only works for CG-based image. public func overlaying(with color: Color, fraction: CGFloat) -> Image { guard let cgImage = cgImage else { assertionFailure("[Kingfisher] Overlaying only works for CG-based image.") return base } let rect = CGRect(x: 0, y: 0, width: size.width, height: size.height) return draw(cgImage: cgImage, to: rect.size) { #if os(macOS) base.draw(in: rect) if fraction > 0 { color.withAlphaComponent(1 - fraction).set() NSRectFillUsingOperation(rect, .sourceAtop) } #else color.set() UIRectFill(rect) base.draw(in: rect, blendMode: .destinationIn, alpha: 1.0) if fraction > 0 { base.draw(in: rect, blendMode: .sourceAtop, alpha: fraction) } #endif } } // MARK: - Tint /// Create an image from `self` with a color tint. /// /// - parameter color: The color should be used to tint `self` /// /// - returns: An image with a color tint applied. public func tinted(with color: Color) -> Image { #if os(watchOS) return base #else return apply(.tint(color)) #endif } // MARK: - Color Control /// Create an image from `self` with color control. /// /// - parameter brightness: Brightness changing to image. /// - parameter contrast: Contrast changing to image. /// - parameter saturation: Saturation changing to image. /// - parameter inputEV: InputEV changing to image. /// /// - returns: An image with color control applied. public func adjusted(brightness: CGFloat, contrast: CGFloat, saturation: CGFloat, inputEV: CGFloat) -> Image { #if os(watchOS) return base #else return apply(.colorControl(brightness, contrast, saturation, inputEV)) #endif } } // MARK: - Decode extension Kingfisher where Base: Image { var decoded: Image? { return decoded(scale: scale) } func decoded(scale: CGFloat) -> Image { // prevent animated image (GIF) lose it's images #if os(iOS) if imageSource != nil { return base } #else if images != nil { return base } #endif guard let imageRef = self.cgImage else { assertionFailure("[Kingfisher] Decoding only works for CG-based image.") return base } let colorSpace = CGColorSpaceCreateDeviceRGB() guard let context = beginContext(size: CGSize(width: imageRef.width, height: imageRef.height)) else { assertionFailure("[Kingfisher] Decoding fails to create a valid context.") return base } defer { endContext() } let rect = CGRect(x: 0, y: 0, width: imageRef.width, height: imageRef.height) context.draw(imageRef, in: rect) let decompressedImageRef = context.makeImage() return Kingfisher<Image>.image(cgImage: decompressedImageRef!, scale: scale, refImage: base) } } /// Reference the source image reference class ImageSource { var imageRef: CGImageSource? init(ref: CGImageSource) { self.imageRef = ref } } // MARK: - Image format private struct ImageHeaderData { static var PNG: [UInt8] = [0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A] static var JPEG_SOI: [UInt8] = [0xFF, 0xD8] static var JPEG_IF: [UInt8] = [0xFF] static var GIF: [UInt8] = [0x47, 0x49, 0x46] } enum ImageFormat { case unknown, PNG, JPEG, GIF } // MARK: - Misc Helpers public struct DataProxy { fileprivate let base: Data init(proxy: Data) { base = proxy } } extension Data: KingfisherCompatible { public typealias CompatibleType = DataProxy public var kf: DataProxy { return DataProxy(proxy: self) } } extension DataProxy { var imageFormat: ImageFormat { var buffer = [UInt8](repeating: 0, count: 8) (base as NSData).getBytes(&buffer, length: 8) if buffer == ImageHeaderData.PNG { return .PNG } else if buffer[0] == ImageHeaderData.JPEG_SOI[0] && buffer[1] == ImageHeaderData.JPEG_SOI[1] && buffer[2] == ImageHeaderData.JPEG_IF[0] { return .JPEG } else if buffer[0] == ImageHeaderData.GIF[0] && buffer[1] == ImageHeaderData.GIF[1] && buffer[2] == ImageHeaderData.GIF[2] { return .GIF } return .unknown } } public struct CGSizeProxy { fileprivate let base: CGSize init(proxy: CGSize) { base = proxy } } extension CGSize: KingfisherCompatible { public typealias CompatibleType = CGSizeProxy public var kf: CGSizeProxy { return CGSizeProxy(proxy: self) } } extension CGSizeProxy { func constrained(_ size: CGSize) -> CGSize { let aspectWidth = round(aspectRatio * size.height) let aspectHeight = round(size.width / aspectRatio) return aspectWidth > size.width ? CGSize(width: size.width, height: aspectHeight) : CGSize(width: aspectWidth, height: size.height) } func filling(_ size: CGSize) -> CGSize { let aspectWidth = round(aspectRatio * size.height) let aspectHeight = round(size.width / aspectRatio) return aspectWidth < size.width ? CGSize(width: size.width, height: aspectHeight) : CGSize(width: aspectWidth, height: size.height) } private var aspectRatio: CGFloat { return base.height == 0.0 ? 1.0 : base.width / base.height } func constrainedRect(for size: CGSize, anchor: CGPoint) -> CGRect { let unifiedAnchor = CGPoint(x: anchor.x.clamped(to: 0.0...1.0), y: anchor.y.clamped(to: 0.0...1.0)) let x = unifiedAnchor.x * base.width - unifiedAnchor.x * size.width let y = unifiedAnchor.y * base.height - unifiedAnchor.y * size.height let r = CGRect(x: x, y: y, width: size.width, height: size.height) let ori = CGRect(origin: CGPoint.zero, size: base) return ori.intersection(r) } } extension Comparable { func clamped(to limits: ClosedRange<Self>) -> Self { return min(max(self, limits.lowerBound), limits.upperBound) } } extension Kingfisher where Base: Image { func beginContext(size: CGSize) -> CGContext? { #if os(macOS) guard let rep = NSBitmapImageRep( bitmapDataPlanes: nil, pixelsWide: Int(size.width), pixelsHigh: Int(size.height), bitsPerSample: cgImage?.bitsPerComponent ?? 8, samplesPerPixel: 4, hasAlpha: true, isPlanar: false, colorSpaceName: NSCalibratedRGBColorSpace, bytesPerRow: 0, bitsPerPixel: 0) else { assertionFailure("[Kingfisher] Image representation cannot be created.") return nil } rep.size = size NSGraphicsContext.saveGraphicsState() guard let context = NSGraphicsContext(bitmapImageRep: rep) else { assertionFailure("[Kingfisher] Image contenxt cannot be created.") return nil } NSGraphicsContext.setCurrent(context) return context.cgContext #else UIGraphicsBeginImageContextWithOptions(size, false, scale) let context = UIGraphicsGetCurrentContext() context?.scaleBy(x: 1.0, y: -1.0) context?.translateBy(x: 0, y: -size.height) return context #endif } func endContext() { #if os(macOS) NSGraphicsContext.restoreGraphicsState() #else UIGraphicsEndImageContext() #endif } func draw(cgImage: CGImage?, to size: CGSize, draw: ()->()) -> Image { #if os(macOS) guard let rep = NSBitmapImageRep( bitmapDataPlanes: nil, pixelsWide: Int(size.width), pixelsHigh: Int(size.height), bitsPerSample: cgImage?.bitsPerComponent ?? 8, samplesPerPixel: 4, hasAlpha: true, isPlanar: false, colorSpaceName: NSCalibratedRGBColorSpace, bytesPerRow: 0, bitsPerPixel: 0) else { assertionFailure("[Kingfisher] Image representation cannot be created.") return base } rep.size = size NSGraphicsContext.saveGraphicsState() let context = NSGraphicsContext(bitmapImageRep: rep) NSGraphicsContext.setCurrent(context) draw() NSGraphicsContext.restoreGraphicsState() let outputImage = Image(size: size) outputImage.addRepresentation(rep) return outputImage #else UIGraphicsBeginImageContextWithOptions(size, false, scale) defer { UIGraphicsEndImageContext() } draw() return UIGraphicsGetImageFromCurrentImageContext() ?? base #endif } #if os(macOS) func fixedForRetinaPixel(cgImage: CGImage, to size: CGSize) -> Image { let image = Image(cgImage: cgImage, size: base.size) let rect = CGRect(origin: CGPoint(x: 0, y: 0), size: size) return draw(cgImage: cgImage, to: self.size) { image.draw(in: rect, from: NSRect.zero, operation: .copy, fraction: 1.0) } } #endif } extension Float { var isEven: Bool { return truncatingRemainder(dividingBy: 2.0) == 0 } } // MARK: - Deprecated. Only for back compatibility. extension Image { /** Normalize the image. This method does nothing in OS X. - returns: The image itself. */ @available(*, deprecated, message: "Extensions directly on Image are deprecated. Use `kf.normalized` instead.", renamed: "kf.normalized") public func kf_normalized() -> Image { return kf.normalized } // MARK: - Round Corner /// Create a round corner image based on `self`. /// /// - parameter radius: The round corner radius of creating image. /// - parameter size: The target size of creating image. /// - parameter scale: The image scale of creating image. /// /// - returns: An image with round corner of `self`. /// /// - Note: This method only works for CG-based image. @available(*, deprecated, message: "Extensions directly on Image are deprecated. Use `kf.image(withRoundRadius:fit:scale:)` instead.", renamed: "kf.image") public func kf_image(withRoundRadius radius: CGFloat, fit size: CGSize, scale: CGFloat) -> Image { return kf.image(withRoundRadius: radius, fit: size) } // MARK: - Resize /// Resize `self` to an image of new size. /// /// - parameter size: The target size. /// /// - returns: An image with new size. /// /// - Note: This method only works for CG-based image. @available(*, deprecated, message: "Extensions directly on Image are deprecated. Use `kf.resize(to:)` instead.", renamed: "kf.resize") public func kf_resize(to size: CGSize) -> Image { return kf.resize(to: size) } // MARK: - Blur /// Create an image with blur effect based on `self`. /// /// - parameter radius: The blur radius should be used when creating blue. /// /// - returns: An image with blur effect applied. /// /// - Note: This method only works for CG-based image. @available(*, deprecated, message: "Extensions directly on Image are deprecated. Use `kf.blurred(withRadius:)` instead.", renamed: "kf.blurred") public func kf_blurred(withRadius radius: CGFloat) -> Image { return kf.blurred(withRadius: radius) } // MARK: - Overlay /// Create an image from `self` with a color overlay layer. /// /// - parameter color: The color should be use to overlay. /// - parameter fraction: Fraction of input color. From 0.0 to 1.0. 0.0 means solid color, 1.0 means transparent overlay. /// /// - returns: An image with a color overlay applied. /// /// - Note: This method only works for CG-based image. @available(*, deprecated, message: "Extensions directly on Image are deprecated. Use `kf.overlaying(with:fraction:)` instead.", renamed: "kf.overlaying") public func kf_overlaying(with color: Color, fraction: CGFloat) -> Image { return kf.overlaying(with: color, fraction: fraction) } // MARK: - Tint /// Create an image from `self` with a color tint. /// /// - parameter color: The color should be used to tint `self` /// /// - returns: An image with a color tint applied. @available(*, deprecated, message: "Extensions directly on Image are deprecated. Use `kf.tinted(with:)` instead.", renamed: "kf.tinted") public func kf_tinted(with color: Color) -> Image { return kf.tinted(with: color) } // MARK: - Color Control /// Create an image from `self` with color control. /// /// - parameter brightness: Brightness changing to image. /// - parameter contrast: Contrast changing to image. /// - parameter saturation: Saturation changing to image. /// - parameter inputEV: InputEV changing to image. /// /// - returns: An image with color control applied. @available(*, deprecated, message: "Extensions directly on Image are deprecated. Use `kf.adjusted` instead.", renamed: "kf.adjusted") public func kf_adjusted(brightness: CGFloat, contrast: CGFloat, saturation: CGFloat, inputEV: CGFloat) -> Image { return kf.adjusted(brightness: brightness, contrast: contrast, saturation: saturation, inputEV: inputEV) } } extension Kingfisher where Base: Image { @available(*, deprecated, message: "`scale` is not used. Use the version without scale instead. (Remove the `scale` argument)") public func image(withRoundRadius radius: CGFloat, fit size: CGSize, scale: CGFloat) -> Image { return image(withRoundRadius: radius, fit: size) } }
apache-2.0
6fe670e19946909b13f505cf6758f485
34.062564
158
0.578102
4.818323
false
false
false
false
gottesmm/swift
test/SILGen/tuples.swift
2
4204
// RUN: %target-swift-frontend -Xllvm -new-mangling-for-tests -emit-silgen %s | %FileCheck %s class C {} enum Foo { case X(C, Int) } // <rdar://problem/16020428> // CHECK-LABEL: sil hidden @_T06tuples8matchFooyAA0C0O1x_tF func matchFoo(x x: Foo) { switch x { case .X(let x): () } } protocol P { func foo() } struct A : P { func foo() {} } func make_int() -> Int { return 0 } func make_p() -> P { return A() } func make_xy() -> (x: Int, y: P) { return (make_int(), make_p()) } // CHECK-LABEL: sil hidden @_T06tuples17testShuffleOpaqueyyF func testShuffleOpaque() { // CHECK: [[X:%.*]] = alloc_box ${ var P } // CHECK-NEXT: [[PBX:%.*]] = project_box [[X]] // CHECK: [[Y:%.*]] = alloc_box ${ var Int } // CHECK-NEXT: [[PBY:%.*]] = project_box [[Y]] // CHECK: [[T0:%.*]] = function_ref @_T06tuples7make_xySi1x_AA1P_p1ytyF // CHECK-NEXT: [[T1:%.*]] = apply [[T0]]([[PBX]]) // CHECK-NEXT: store [[T1]] to [trivial] [[PBY]] var (x,y) : (y:P, x:Int) = make_xy() // CHECK-NEXT: [[PAIR:%.*]] = alloc_box ${ var (y: P, x: Int) } // CHECK-NEXT: [[PBPAIR:%.*]] = project_box [[PAIR]] // CHECK-NEXT: [[PAIR_0:%.*]] = tuple_element_addr [[PBPAIR]] : $*(y: P, x: Int), 0 // CHECK-NEXT: [[PAIR_1:%.*]] = tuple_element_addr [[PBPAIR]] : $*(y: P, x: Int), 1 // CHECK-NEXT: // function_ref // CHECK-NEXT: [[T0:%.*]] = function_ref @_T06tuples7make_xySi1x_AA1P_p1ytyF // CHECK-NEXT: [[T1:%.*]] = apply [[T0]]([[PAIR_0]]) // CHECK-NEXT: store [[T1]] to [trivial] [[PAIR_1]] var pair : (y:P, x:Int) = make_xy() // CHECK-NEXT: // function_ref // CHECK-NEXT: [[T0:%.*]] = function_ref @_T06tuples7make_xySi1x_AA1P_p1ytyF // CHECK-NEXT: [[TEMP:%.*]] = alloc_stack $P // CHECK-NEXT: [[T1:%.*]] = apply [[T0]]([[TEMP]]) // CHECK-NEXT: [[PAIR_0:%.*]] = tuple_element_addr [[PBPAIR]] : $*(y: P, x: Int), 0 // CHECK-NEXT: copy_addr [take] [[TEMP]] to [[PAIR_0]] // CHECK-NEXT: [[PAIR_1:%.*]] = tuple_element_addr [[PBPAIR]] : $*(y: P, x: Int), 1 // CHECK-NEXT: assign [[T1]] to [[PAIR_1]] // CHECK-NEXT: dealloc_stack [[TEMP]] pair = make_xy() } // CHECK-LABEL: testShuffleTuple func testShuffleTuple() { // CHECK: [[X:%.*]] = alloc_box ${ var P } // CHECK-NEXT: [[PBX:%.*]] = project_box [[X]] // CHECK: [[Y:%.*]] = alloc_box ${ var Int } // CHECK-NEXT: [[PBY:%.*]] = project_box [[Y]] // CHECK: [[T0:%.*]] = function_ref @_T06tuples8make_intSiyF // CHECK-NEXT: [[T1:%.*]] = apply [[T0]]() // CHECK-NEXT: store [[T1]] to [trivial] [[PBY]] // CHECK-NEXT: // function_ref // CHECK-NEXT: [[T0:%.*]] = function_ref @_T06tuples6make_pAA1P_pyF // CHECK-NEXT: apply [[T0]]([[PBX]]) var (x,y) : (y:P, x:Int) = (x: make_int(), y: make_p()) // CHECK-NEXT: [[PAIR:%.*]] = alloc_box ${ var (y: P, x: Int) } // CHECK-NEXT: [[PBPAIR:%.*]] = project_box [[PAIR]] // CHECK-NEXT: [[PAIR_0:%.*]] = tuple_element_addr [[PBPAIR]] : $*(y: P, x: Int), 0 // CHECK-NEXT: [[PAIR_1:%.*]] = tuple_element_addr [[PBPAIR]] : $*(y: P, x: Int), 1 // CHECK-NEXT: // function_ref // CHECK: [[T0:%.*]] = function_ref @_T06tuples8make_intSiyF // CHECK-NEXT: [[T1:%.*]] = apply [[T0]]() // CHECK-NEXT: store [[T1]] to [trivial] [[PAIR_1]] // CHECK-NEXT: // function_ref // CHECK-NEXT: [[T0:%.*]] = function_ref @_T06tuples6make_pAA1P_pyF // CHECK-NEXT: apply [[T0]]([[PAIR_0]]) var pair : (y:P, x:Int) = (x: make_int(), y: make_p()) // This isn't really optimal; we should be evaluating make_p directly // into the temporary. // CHECK-NEXT: // function_ref // CHECK: [[T0:%.*]] = function_ref @_T06tuples8make_intSiyF // CHECK-NEXT: [[INT:%.*]] = apply [[T0]]() // CHECK-NEXT: // function_ref // CHECK-NEXT: [[T0:%.*]] = function_ref @_T06tuples6make_pAA1P_pyF // CHECK-NEXT: [[TEMP:%.*]] = alloc_stack $P // CHECK-NEXT: apply [[T0]]([[TEMP]]) // CHECK-NEXT: [[PAIR_0:%.*]] = tuple_element_addr [[PBPAIR]] : $*(y: P, x: Int), 0 // CHECK-NEXT: copy_addr [take] [[TEMP]] to [[PAIR_0]] // CHECK-NEXT: [[PAIR_1:%.*]] = tuple_element_addr [[PBPAIR]] : $*(y: P, x: Int), 1 // CHECK-NEXT: assign [[INT]] to [[PAIR_1]] // CHECK-NEXT: dealloc_stack [[TEMP]] pair = (x: make_int(), y: make_p()) }
apache-2.0
03f80fc2768072cf7536b9d59c342a99
40.623762
93
0.540913
2.832884
false
false
false
false
ChaselAn/CodeLibrary
codeLibrary/codeLibrary/Extension/UIImageView+Extension.swift
1
1283
// // UIImageView+Extension.swift // codeLibrary // // Created by ancheng on 2017/1/2. // Copyright © 2017年 ac. All rights reserved. // import UIKit extension UIImageView { /// UIImageView的切圆角(ImageView的Image不能为nil!!!) /// /// - Parameter radius: 半径,不填的时候为ImageView宽的一半 func setViewCornerRadius(radius: CGFloat? = nil) { assert(self.image != nil, "UIImageView can't be nil") self.image = self.image?.cornerRadiusImage(radius: radius ?? self.bounds.width / 2, imgSize: self.bounds.size) } } extension UIImage { fileprivate func cornerRadiusImage(radius: CGFloat, imgSize: CGSize) -> UIImage { let rect = CGRect(x: 0, y: 0, width: imgSize.width, height: imgSize.height) UIGraphicsBeginImageContextWithOptions(imgSize, false, UIScreen.main.scale) let ctx = UIGraphicsGetCurrentContext() let path = UIBezierPath(roundedRect: rect, byRoundingCorners: .allCorners, cornerRadii: CGSize(width: radius, height: radius)) ctx?.addPath(path.cgPath) ctx?.clip() self.draw(in: rect) ctx?.drawPath(using: CGPathDrawingMode.fillStroke) let newImg = UIGraphicsGetImageFromCurrentImageContext() UIGraphicsEndImageContext() return newImg ?? UIImage() } }
mit
f88305c1b60b231e2084a168b455110c
29.7
130
0.708469
4.052805
false
false
false
false
programmerC/JNews
Pods/Alamofire/Source/ServerTrustPolicy.swift
1
13016
// // ServerTrustPolicy.swift // // Copyright (c) 2014-2016 Alamofire Software Foundation (http://alamofire.org/) // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. // import Foundation /// Responsible for managing the mapping of `ServerTrustPolicy` objects to a given host. public class ServerTrustPolicyManager { /// The dictionary of policies mapped to a particular host. public let policies: [String: ServerTrustPolicy] /** Initializes the `ServerTrustPolicyManager` instance with the given policies. Since different servers and web services can have different leaf certificates, intermediate and even root certficates, it is important to have the flexibility to specify evaluation policies on a per host basis. This allows for scenarios such as using default evaluation for host1, certificate pinning for host2, public key pinning for host3 and disabling evaluation for host4. - parameter policies: A dictionary of all policies mapped to a particular host. - returns: The new `ServerTrustPolicyManager` instance. */ public init(policies: [String: ServerTrustPolicy]) { self.policies = policies } /** Returns the `ServerTrustPolicy` for the given host if applicable. By default, this method will return the policy that perfectly matches the given host. Subclasses could override this method and implement more complex mapping implementations such as wildcards. - parameter host: The host to use when searching for a matching policy. - returns: The server trust policy for the given host if found. */ public func serverTrustPolicyForHost(host: String) -> ServerTrustPolicy? { return policies[host] } } // MARK: - extension NSURLSession { private struct AssociatedKeys { static var ManagerKey = "NSURLSession.ServerTrustPolicyManager" } var serverTrustPolicyManager: ServerTrustPolicyManager? { get { return objc_getAssociatedObject(self, &AssociatedKeys.ManagerKey) as? ServerTrustPolicyManager } set (manager) { objc_setAssociatedObject(self, &AssociatedKeys.ManagerKey, manager, .OBJC_ASSOCIATION_RETAIN_NONATOMIC) } } } // MARK: - ServerTrustPolicy /** The `ServerTrustPolicy` evaluates the server trust generally provided by an `NSURLAuthenticationChallenge` when connecting to a server over a secure HTTPS connection. The policy configuration then evaluates the server trust with a given set of criteria to determine whether the server trust is valid and the connection should be made. Using pinned certificates or public keys for evaluation helps prevent man-in-the-middle (MITM) attacks and other vulnerabilities. Applications dealing with sensitive customer data or financial information are strongly encouraged to route all communication over an HTTPS connection with pinning enabled. - PerformDefaultEvaluation: Uses the default server trust evaluation while allowing you to control whether to validate the host provided by the challenge. Applications are encouraged to always validate the host in production environments to guarantee the validity of the server's certificate chain. - PinCertificates: Uses the pinned certificates to validate the server trust. The server trust is considered valid if one of the pinned certificates match one of the server certificates. By validating both the certificate chain and host, certificate pinning provides a very secure form of server trust validation mitigating most, if not all, MITM attacks. Applications are encouraged to always validate the host and require a valid certificate chain in production environments. - PinPublicKeys: Uses the pinned public keys to validate the server trust. The server trust is considered valid if one of the pinned public keys match one of the server certificate public keys. By validating both the certificate chain and host, public key pinning provides a very secure form of server trust validation mitigating most, if not all, MITM attacks. Applications are encouraged to always validate the host and require a valid certificate chain in production environments. - DisableEvaluation: Disables all evaluation which in turn will always consider any server trust as valid. - CustomEvaluation: Uses the associated closure to evaluate the validity of the server trust. */ public enum ServerTrustPolicy { case PerformDefaultEvaluation(validateHost: Bool) case PinCertificates(certificates: [SecCertificate], validateCertificateChain: Bool, validateHost: Bool) case PinPublicKeys(publicKeys: [SecKey], validateCertificateChain: Bool, validateHost: Bool) case DisableEvaluation case CustomEvaluation((serverTrust: SecTrust, host: String) -> Bool) // MARK: - Bundle Location /** Returns all certificates within the given bundle with a `.cer` file extension. - parameter bundle: The bundle to search for all `.cer` files. - returns: All certificates within the given bundle. */ public static func certificatesInBundle(bundle: NSBundle = NSBundle.mainBundle()) -> [SecCertificate] { var certificates: [SecCertificate] = [] let paths = Set([".cer", ".CER", ".crt", ".CRT", ".der", ".DER"].map { fileExtension in bundle.pathsForResourcesOfType(fileExtension, inDirectory: nil) }.flatten()) for path in paths { if let certificateData = NSData(contentsOfFile: path), certificate = SecCertificateCreateWithData(nil, certificateData) { certificates.append(certificate) } } return certificates } /** Returns all public keys within the given bundle with a `.cer` file extension. - parameter bundle: The bundle to search for all `*.cer` files. - returns: All public keys within the given bundle. */ public static func publicKeysInBundle(bundle: NSBundle = NSBundle.mainBundle()) -> [SecKey] { var publicKeys: [SecKey] = [] for certificate in certificatesInBundle(bundle) { if let publicKey = publicKeyForCertificate(certificate) { publicKeys.append(publicKey) } } return publicKeys } // MARK: - Evaluation /** Evaluates whether the server trust is valid for the given host. - parameter serverTrust: The server trust to evaluate. - parameter host: The host of the challenge protection space. - returns: Whether the server trust is valid. */ public func evaluateServerTrust(serverTrust: SecTrust, isValidForHost host: String) -> Bool { var serverTrustIsValid = false switch self { case let .PerformDefaultEvaluation(validateHost): let policy = SecPolicyCreateSSL(true, validateHost ? host as CFString : nil) SecTrustSetPolicies(serverTrust, [policy]) serverTrustIsValid = trustIsValid(serverTrust) case let .PinCertificates(pinnedCertificates, validateCertificateChain, validateHost): if validateCertificateChain { let policy = SecPolicyCreateSSL(true, validateHost ? host as CFString : nil) SecTrustSetPolicies(serverTrust, [policy]) SecTrustSetAnchorCertificates(serverTrust, pinnedCertificates) SecTrustSetAnchorCertificatesOnly(serverTrust, true) serverTrustIsValid = trustIsValid(serverTrust) } else { let serverCertificatesDataArray = certificateDataForTrust(serverTrust) let pinnedCertificatesDataArray = certificateDataForCertificates(pinnedCertificates) outerLoop: for serverCertificateData in serverCertificatesDataArray { for pinnedCertificateData in pinnedCertificatesDataArray { if serverCertificateData.isEqualToData(pinnedCertificateData) { serverTrustIsValid = true break outerLoop } } } } case let .PinPublicKeys(pinnedPublicKeys, validateCertificateChain, validateHost): var certificateChainEvaluationPassed = true if validateCertificateChain { let policy = SecPolicyCreateSSL(true, validateHost ? host as CFString : nil) SecTrustSetPolicies(serverTrust, [policy]) certificateChainEvaluationPassed = trustIsValid(serverTrust) } if certificateChainEvaluationPassed { outerLoop: for serverPublicKey in ServerTrustPolicy.publicKeysForTrust(serverTrust) as [AnyObject] { for pinnedPublicKey in pinnedPublicKeys as [AnyObject] { if serverPublicKey.isEqual(pinnedPublicKey) { serverTrustIsValid = true break outerLoop } } } } case .DisableEvaluation: serverTrustIsValid = true case let .CustomEvaluation(closure): serverTrustIsValid = closure(serverTrust: serverTrust, host: host) } return serverTrustIsValid } // MARK: - Private - Trust Validation private func trustIsValid(trust: SecTrust) -> Bool { var isValid = false var result = SecTrustResultType(rawValue: 0) let status = SecTrustEvaluate(trust, &result!) if status == errSecSuccess { let unspecified = SecTrustResultType(rawValue: 4) let proceed = SecTrustResultType(rawValue: 1) isValid = result == unspecified || result == proceed } return isValid } // MARK: - Private - Certificate Data private func certificateDataForTrust(trust: SecTrust) -> [NSData] { var certificates: [SecCertificate] = [] for index in 0..<SecTrustGetCertificateCount(trust) { if let certificate = SecTrustGetCertificateAtIndex(trust, index) { certificates.append(certificate) } } return certificateDataForCertificates(certificates) } private func certificateDataForCertificates(certificates: [SecCertificate]) -> [NSData] { return certificates.map { SecCertificateCopyData($0) as NSData } } // MARK: - Private - Public Key Extraction private static func publicKeysForTrust(trust: SecTrust) -> [SecKey] { var publicKeys: [SecKey] = [] for index in 0..<SecTrustGetCertificateCount(trust) { if let certificate = SecTrustGetCertificateAtIndex(trust, index), publicKey = publicKeyForCertificate(certificate) { publicKeys.append(publicKey) } } return publicKeys } private static func publicKeyForCertificate(certificate: SecCertificate) -> SecKey? { var publicKey: SecKey? let policy = SecPolicyCreateBasicX509() var trust: SecTrust? let trustCreationStatus = SecTrustCreateWithCertificates(certificate, policy, &trust) if let trust = trust where trustCreationStatus == errSecSuccess { publicKey = SecTrustCopyPublicKey(trust) } return publicKey } }
gpl-3.0
6b44e2942629df445eae5d27d628cff7
41.815789
120
0.659726
6.023137
false
false
false
false
jokechat/swift3-novel
swift_novels/Pods/NVActivityIndicatorView/NVActivityIndicatorView/Animations/NVActivityIndicatorAnimationBallClipRotate.swift
8
1773
// // NVActivityIndicatorBallClipRotate.swift // NVActivityIndicatorViewDemo // // Created by Nguyen Vinh on 7/23/15. // Copyright (c) 2015 Nguyen Vinh. All rights reserved. // import UIKit class NVActivityIndicatorAnimationBallClipRotate: NVActivityIndicatorAnimationDelegate { func setUpAnimation(in layer: CALayer, size: CGSize, color: UIColor) { let duration: CFTimeInterval = 0.75 // Scale animation let scaleAnimation = CAKeyframeAnimation(keyPath: "transform.scale") scaleAnimation.keyTimes = [0, 0.5, 1] scaleAnimation.values = [1, 0.6, 1] // Rotate animation let rotateAnimation = CAKeyframeAnimation(keyPath: "transform.rotation.z") rotateAnimation.keyTimes = scaleAnimation.keyTimes rotateAnimation.values = [0, M_PI, 2 * M_PI] // Animation let animation = CAAnimationGroup() animation.animations = [scaleAnimation, rotateAnimation] animation.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionLinear) animation.duration = duration animation.repeatCount = HUGE animation.isRemovedOnCompletion = false // Draw circle let circle = NVActivityIndicatorShape.ringThirdFour.layerWith(size: CGSize(width: size.width, height: size.height), color: color) let frame = CGRect(x: (layer.bounds.size.width - size.width) / 2, y: (layer.bounds.size.height - size.height) / 2, width: size.width, height: size.height) circle.frame = frame circle.add(animation, forKey: "animation") layer.addSublayer(circle) } }
apache-2.0
a9d59f8026727ca81faa5538cae0d99d
35.9375
137
0.631134
5.10951
false
false
false
false
gribozavr/swift
test/expr/closure/closures.swift
2
28799
// RUN: %target-typecheck-verify-swift var func6 : (_ fn : (Int,Int) -> Int) -> () var func6a : ((Int, Int) -> Int) -> () var func6b : (Int, (Int, Int) -> Int) -> () func func6c(_ f: (Int, Int) -> Int, _ n: Int = 0) {} // Expressions can be auto-closurified, so that they can be evaluated separately // from their definition. var closure1 : () -> Int = {4} // Function producing 4 whenever it is called. var closure2 : (Int,Int) -> Int = { 4 } // expected-error{{contextual type for closure argument list expects 2 arguments, which cannot be implicitly ignored}} {{36-36= _,_ in}} var closure3a : () -> () -> (Int,Int) = {{ (4, 2) }} // multi-level closing. var closure3b : (Int,Int) -> (Int) -> (Int,Int) = {{ (4, 2) }} // expected-error{{contextual type for closure argument list expects 2 arguments, which cannot be implicitly ignored}} {{52-52=_,_ in }} // expected-error@-1 {{contextual type for closure argument list expects 1 argument, which cannot be implicitly ignored}} {{53-53= _ in}} var closure4 : (Int,Int) -> Int = { $0 + $1 } var closure5 : (Double) -> Int = { $0 + 1.0 // expected-error@-1 {{cannot convert value of type 'Double' to closure result type 'Int'}} } var closure6 = $0 // expected-error {{anonymous closure argument not contained in a closure}} var closure7 : Int = { 4 } // expected-error {{function produces expected type 'Int'; did you mean to call it with '()'?}} {{27-27=()}} // expected-note {{Remove '=' to make 'closure7' a computed property}}{{20-22=}} var capturedVariable = 1 var closure8 = { [capturedVariable] in capturedVariable += 1 // expected-error {{left side of mutating operator isn't mutable: 'capturedVariable' is an immutable capture}} } func funcdecl1(_ a: Int, _ y: Int) {} func funcdecl3() -> Int {} func funcdecl4(_ a: ((Int) -> Int), _ b: Int) {} func funcdecl5(_ a: Int, _ y: Int) { // Pass in a closure containing the call to funcdecl3. funcdecl4({ funcdecl3() }, 12) // expected-error {{contextual type for closure argument list expects 1 argument, which cannot be implicitly ignored}} {{14-14= _ in}} func6({$0 + $1}) // Closure with two named anonymous arguments func6({($0) + $1}) // Closure with sequence expr inferred type func6({($0) + $0}) // // expected-error {{contextual closure type '(Int, Int) -> Int' expects 2 arguments, but 1 was used in closure body}} var testfunc : ((), Int) -> Int // expected-note {{'testfunc' declared here}} testfunc({$0+1}) // expected-error {{missing argument for parameter #2 in call}} // expected-error@-1 {{cannot convert value of type '(Int) -> Int' to expected argument type '()'}} funcdecl5(1, 2) // recursion. // Element access from a tuple. var a : (Int, f : Int, Int) var b = a.1+a.f // Tuple expressions with named elements. var i : (y : Int, x : Int) = (x : 42, y : 11) funcdecl1(123, 444) // Calls. 4() // expected-error {{cannot call value of non-function type 'Int'}}{{4-6=}} // rdar://12017658 - Infer some argument types from func6. func6({ a, b -> Int in a+b}) // Return type inference. func6({ a,b in a+b }) // Infer incompatible type. func6({a,b -> Float in 4.0 }) // expected-error {{declared closure result 'Float' is incompatible with contextual type 'Int'}} {{17-22=Int}} // Pattern doesn't need to name arguments. func6({ _,_ in 4 }) func6({a,b in 4.0 }) // expected-error {{cannot convert value of type 'Double' to closure result type 'Int'}} // TODO: This diagnostic can be improved: rdar://22128205 func6({(a : Float, b) in 4 }) // expected-error {{cannot convert value of type '(Float, Int) -> Int' to expected argument type '(Int, Int) -> Int'}} var fn = {} var fn2 = { 4 } var c : Int = { a,b -> Int in a+b} // expected-error{{cannot convert value of type '(Int, Int) -> Int' to specified type 'Int'}} } func unlabeledClosureArgument() { func add(_ x: Int, y: Int) -> Int { return x + y } func6a({$0 + $1}) // single closure argument func6a(add) func6b(1, {$0 + $1}) // second arg is closure func6b(1, add) func6c({$0 + $1}) // second arg is default int func6c(add) } // rdar://11935352 - closure with no body. func closure_no_body(_ p: () -> ()) { return closure_no_body({}) } // rdar://12019415 func t() { let u8 : UInt8 = 1 let x : Bool = true if 0xA0..<0xBF ~= Int(u8) && x { } } // <rdar://problem/11927184> func f0(_ a: Any) -> Int { return 1 } assert(f0(1) == 1) var selfRef = { selfRef() } // expected-error {{variable used within its own initial value}} var nestedSelfRef = { var recursive = { nestedSelfRef() } // expected-error {{variable used within its own initial value}} recursive() } var shadowed = { (shadowed: Int) -> Int in let x = shadowed return x } // no-warning var shadowedShort = { (shadowedShort: Int) -> Int in shadowedShort+1 } // no-warning func anonymousClosureArgsInClosureWithArgs() { func f(_: String) {} var a1 = { () in $0 } // expected-error {{anonymous closure arguments cannot be used inside a closure that has explicit arguments}} var a2 = { () -> Int in $0 } // expected-error {{anonymous closure arguments cannot be used inside a closure that has explicit arguments}} var a3 = { (z: Int) in $0 } // expected-error {{anonymous closure arguments cannot be used inside a closure that has explicit arguments; did you mean 'z'?}} {{26-28=z}} var a4 = { (z: [Int], w: [Int]) in f($0.count) // expected-error {{anonymous closure arguments cannot be used inside a closure that has explicit arguments; did you mean 'z'?}} {{7-9=z}} expected-error {{cannot convert value of type 'Int' to expected argument type 'String'}} f($1.count) // expected-error {{anonymous closure arguments cannot be used inside a closure that has explicit arguments; did you mean 'w'?}} {{7-9=w}} expected-error {{cannot convert value of type 'Int' to expected argument type 'String'}} } var a5 = { (_: [Int], w: [Int]) in f($0.count) // expected-error {{anonymous closure arguments cannot be used inside a closure that has explicit arguments}} f($1.count) // expected-error {{anonymous closure arguments cannot be used inside a closure that has explicit arguments; did you mean 'w'?}} {{7-9=w}} expected-error {{cannot convert value of type 'Int' to expected argument type 'String'}} } } func doStuff(_ fn : @escaping () -> Int) {} func doVoidStuff(_ fn : @escaping () -> ()) {} // <rdar://problem/16193162> Require specifying self for locations in code where strong reference cycles are likely class ExplicitSelfRequiredTest { var x = 42 func method() -> Int { // explicit closure requires an explicit "self." base or an explicit capture. doVoidStuff({ self.x += 1 }) doVoidStuff({ [self] in x += 1 }) doVoidStuff({ [self = self] in x += 1 }) doVoidStuff({ [unowned self] in x += 1 }) doVoidStuff({ [unowned(unsafe) self] in x += 1 }) doVoidStuff({ [unowned self = self] in x += 1 }) doStuff({ [self] in x+1 }) doStuff({ [self = self] in x+1 }) doStuff({ self.x+1 }) doStuff({ [unowned self] in x+1 }) doStuff({ [unowned(unsafe) self] in x+1 }) doStuff({ [unowned self = self] in x+1 }) doStuff({ x+1 }) // expected-error {{reference to property 'x' in closure requires explicit use of 'self' to make capture semantics explicit}} expected-note{{capture 'self' explicitly to enable implicit 'self' in this closure}} {{14-14= [self] in}} expected-note{{reference 'self.' explicitly}} {{15-15=self.}} doVoidStuff({ doStuff({ x+1 })}) // expected-error {{reference to property 'x' in closure requires explicit use of 'self' to make capture semantics explicit}} expected-note{{capture 'self' explicitly to enable implicit 'self' in this closure}} {{28-28= [self] in}} expected-note{{reference 'self.' explicitly}} {{29-29=self.}} doVoidStuff({ x += 1 }) // expected-error {{reference to property 'x' in closure requires explicit use of 'self' to make capture semantics explicit}} expected-note{{capture 'self' explicitly to enable implicit 'self' in this closure}} {{18-18= [self] in}} expected-note{{reference 'self.' explicitly}} {{19-19=self.}} doVoidStuff({ _ = "\(x)"}) // expected-error {{reference to property 'x' in closure requires explicit use of 'self' to make capture semantics explicit}} expected-note{{capture 'self' explicitly to enable implicit 'self' in this closure}} {{18-18= [self] in}} expected-note{{reference 'self.' explicitly}} {{26-26=self.}} doVoidStuff({ [y = self] in x += 1 }) // expected-warning {{capture 'y' was never used}} expected-error {{reference to property 'x' in closure requires explicit use of 'self' to make capture semantics explicit}} expected-note{{capture 'self' explicitly to enable implicit 'self' in this closure}} {{20-20=self, }} expected-note{{reference 'self.' explicitly}} {{33-33=self.}} doStuff({ [y = self] in x+1 }) // expected-warning {{capture 'y' was never used}} expected-error {{reference to property 'x' in closure requires explicit use of 'self' to make capture semantics explicit}} expected-note{{capture 'self' explicitly to enable implicit 'self' in this closure}} {{16-16=self, }} expected-note{{reference 'self.' explicitly}} {{29-29=self.}} doVoidStuff({ [weak self] in x += 1 }) // expected-note {{weak capture of 'self' here does not enable implicit 'self'}} expected-warning {{variable 'self' was written to, but never read}} expected-error {{reference to property 'x' in closure requires explicit use of 'self' to make capture semantics explicit}} doStuff({ [weak self] in x+1 }) // expected-note {{weak capture of 'self' here does not enable implicit 'self'}} expected-warning {{variable 'self' was written to, but never read}} expected-error {{reference to property 'x' in closure requires explicit use of 'self' to make capture semantics explicit}} doVoidStuff({ [self = self.x] in x += 1 }) // expected-note {{variable other than 'self' captured here under the name 'self' does not enable implicit 'self'}} expected-warning {{capture 'self' was never used}} expected-error {{reference to property 'x' in closure requires explicit use of 'self' to make capture semantics explicit}} doStuff({ [self = self.x] in x+1 }) // expected-note {{variable other than 'self' captured here under the name 'self' does not enable implicit 'self'}} expected-warning {{capture 'self' was never used}} expected-error {{reference to property 'x' in closure requires explicit use of 'self' to make capture semantics explicit}} // Methods follow the same rules as properties, uses of 'self' without capturing must be marked with "self." doStuff { method() } // expected-error {{call to method 'method' in closure requires explicit use of 'self' to make capture semantics explicit}} expected-note{{capture 'self' explicitly to enable implicit 'self' in this closure}} {{14-14= [self] in}} expected-note{{reference 'self.' explicitly}} {{15-15=self.}} doVoidStuff { _ = method() } // expected-error {{call to method 'method' in closure requires explicit use of 'self' to make capture semantics explicit}} expected-note{{capture 'self' explicitly to enable implicit 'self' in this closure}} {{18-18= [self] in}} expected-note{{reference 'self.' explicitly}} {{23-23=self.}} doVoidStuff { _ = "\(method())" } // expected-error {{call to method 'method' in closure requires explicit use of 'self' to make capture semantics explicit}} expected-note{{capture 'self' explicitly to enable implicit 'self' in this closure}} {{18-18= [self] in}} expected-note{{reference 'self.' explicitly}} {{26-26=self.}} doVoidStuff { () -> () in _ = method() } // expected-error {{call to method 'method' in closure requires explicit use of 'self' to make capture semantics explicit}} expected-note{{capture 'self' explicitly to enable implicit 'self' in this closure}} {{18-18= [self]}} expected-note{{reference 'self.' explicitly}} {{35-35=self.}} doVoidStuff { [y = self] in _ = method() } // expected-warning {{capture 'y' was never used}} expected-error {{call to method 'method' in closure requires explicit use of 'self' to make capture semantics explicit}} expected-note{{capture 'self' explicitly to enable implicit 'self' in this closure}} {{20-20=self, }} expected-note{{reference 'self.' explicitly}} {{37-37=self.}} doStuff({ [y = self] in method() }) // expected-warning {{capture 'y' was never used}} expected-error {{call to method 'method' in closure requires explicit use of 'self' to make capture semantics explicit}} expected-note{{capture 'self' explicitly to enable implicit 'self' in this closure}} {{16-16=self, }} expected-note{{reference 'self.' explicitly}} {{29-29=self.}} doVoidStuff({ [weak self] in _ = method() }) // expected-note {{weak capture of 'self' here does not enable implicit 'self'}} expected-warning {{variable 'self' was written to, but never read}} expected-error {{call to method 'method' in closure requires explicit use of 'self' to make capture semantics explicit}} doStuff({ [weak self] in method() }) // expected-note {{weak capture of 'self' here does not enable implicit 'self'}} expected-warning {{variable 'self' was written to, but never read}} expected-error {{call to method 'method' in closure requires explicit use of 'self' to make capture semantics explicit}} doVoidStuff({ [self = self.x] in _ = method() }) // expected-note {{variable other than 'self' captured here under the name 'self' does not enable implicit 'self'}} expected-warning {{capture 'self' was never used}} expected-error {{call to method 'method' in closure requires explicit use of 'self' to make capture semantics explicit}} doStuff({ [self = self.x] in method() }) // expected-note {{variable other than 'self' captured here under the name 'self' does not enable implicit 'self'}} expected-warning {{capture 'self' was never used}} expected-error {{call to method 'method' in closure requires explicit use of 'self' to make capture semantics explicit}} doVoidStuff { _ = self.method() } doVoidStuff { [self] in _ = method() } doVoidStuff { [self = self] in _ = method() } doVoidStuff({ [unowned self] in _ = method() }) doVoidStuff({ [unowned(unsafe) self] in _ = method() }) doVoidStuff({ [unowned self = self] in _ = method() }) doStuff { self.method() } doStuff { [self] in method() } doStuff({ [self = self] in method() }) doStuff({ [unowned self] in method() }) doStuff({ [unowned(unsafe) self] in method() }) doStuff({ [unowned self = self] in method() }) // When there's no space between the opening brace and the first expression, insert it doStuff {method() } // expected-error {{call to method 'method' in closure requires explicit use of 'self' to make capture semantics explicit}} expected-note{{capture 'self' explicitly to enable implicit 'self' in this closure}} {{14-14= [self] in }} expected-note{{reference 'self.' explicitly}} {{14-14=self.}} doVoidStuff {_ = method() } // expected-error {{call to method 'method' in closure requires explicit use of 'self' to make capture semantics explicit}} expected-note{{capture 'self' explicitly to enable implicit 'self' in this closure}} {{18-18= [self] in }} expected-note{{reference 'self.' explicitly}} {{22-22=self.}} doVoidStuff {() -> () in _ = method() } // expected-error {{call to method 'method' in closure requires explicit use of 'self' to make capture semantics explicit}} expected-note{{capture 'self' explicitly to enable implicit 'self' in this closure}} {{18-18= [self]}} expected-note{{reference 'self.' explicitly}} {{34-34=self.}} // With an empty capture list, insertion should should be suggested without a comma doStuff { [] in method() } // expected-error {{call to method 'method' in closure requires explicit use of 'self' to make capture semantics explicit}} expected-note{{capture 'self' explicitly to enable implicit 'self' in this closure}} {{16-16=self}} expected-note{{reference 'self.' explicitly}} {{21-21=self.}} doStuff { [ ] in method() } // expected-error {{call to method 'method' in closure requires explicit use of 'self' to make capture semantics explicit}} expected-note{{capture 'self' explicitly to enable implicit 'self' in this closure}} {{16-16=self}} expected-note{{reference 'self.' explicitly}} {{23-23=self.}} doStuff { [ /* This space intentionally left blank. */ ] in method() } // expected-error {{call to method 'method' in closure requires explicit use of 'self' to make capture semantics explicit}} expected-note{{capture 'self' explicitly to enable implicit 'self' in this closure}} {{16-16=self}} expected-note{{reference 'self.' explicitly}} {{65-65=self.}} // expected-note@+1 {{capture 'self' explicitly to enable implicit 'self' in this closure}} {{16-16=self}} doStuff { [ // Nothing in this capture list! ] in method() // expected-error {{call to method 'method' in closure requires explicit use of 'self' to make capture semantics explicit}} expected-note{{reference 'self.' explicitly}} {{9-9=self.}} } // An inserted capture list should be on the same line as the opening brace, immediately following it. // expected-note@+1 {{capture 'self' explicitly to enable implicit 'self' in this closure}} {{14-14= [self] in}} doStuff { method() // expected-error {{call to method 'method' in closure requires explicit use of 'self' to make capture semantics explicit}} expected-note{{reference 'self.' explicitly}} {{7-7=self.}} } // expected-note@+2 {{capture 'self' explicitly to enable implicit 'self' in this closure}} {{14-14= [self] in}} // Note: Trailing whitespace on the following line is intentional and should not be removed! doStuff { method() // expected-error {{call to method 'method' in closure requires explicit use of 'self' to make capture semantics explicit}} expected-note{{reference 'self.' explicitly}} {{7-7=self.}} } // expected-note@+1 {{capture 'self' explicitly to enable implicit 'self' in this closure}} {{14-14= [self] in}} doStuff { // We have stuff to do. method() // expected-error {{call to method 'method' in closure requires explicit use of 'self' to make capture semantics explicit}} expected-note{{reference 'self.' explicitly}} {{7-7=self.}} } // expected-note@+1 {{capture 'self' explicitly to enable implicit 'self' in this closure}} {{14-14= [self] in}} doStuff {// We have stuff to do. method() // expected-error {{call to method 'method' in closure requires explicit use of 'self' to make capture semantics explicit}} expected-note{{reference 'self.' explicitly}} {{7-7=self.}} } // String interpolation should offer the diagnosis and fix-its at the expected locations doVoidStuff { _ = "\(method())" } // expected-error {{call to method 'method' in closure requires explicit use of 'self' to make capture semantics explicit}} expected-note{{reference 'self.' explicitly}} {{26-26=self.}} expected-note {{capture 'self' explicitly to enable implicit 'self' in this closure}} {{18-18= [self] in}} doVoidStuff { _ = "\(x+1)" } // expected-error {{reference to property 'x' in closure requires explicit use of 'self' to make capture semantics explicit}} expected-note{{reference 'self.' explicitly}} {{26-26=self.}} expected-note {{capture 'self' explicitly to enable implicit 'self' in this closure}} {{18-18= [self] in}} // If we already have a capture list, self should be added to the list let y = 1 doStuff { [y] in method() } // expected-warning {{capture 'y' was never used}} expected-error {{call to method 'method' in closure requires explicit use of 'self' to make capture semantics explicit}} expected-note{{capture 'self' explicitly to enable implicit 'self' in this closure}} {{16-16=self, }} expected-note{{reference 'self.' explicitly}} {{22-22=self.}} doStuff { [ // expected-note{{capture 'self' explicitly to enable implicit 'self' in this closure}} {{16-16=self, }} y // expected-warning {{capture 'y' was never used}} ] in method() } // expected-error {{call to method 'method' in closure requires explicit use of 'self' to make capture semantics explicit}} expected-note{{reference 'self.' explicitly}} {{14-14=self.}} // <rdar://problem/18877391> "self." shouldn't be required in the initializer expression in a capture list // This should not produce an error, "x" isn't being captured by the closure. doStuff({ [myX = x] in myX }) // This should produce an error, since x is used within the inner closure. doStuff({ [myX = {x}] in 4 }) // expected-error {{reference to property 'x' in closure requires explicit use of 'self' to make capture semantics explicit}} expected-note{{capture 'self' explicitly to enable implicit 'self' in this closure}} {{23-23= [self] in }} expected-note{{reference 'self.' explicitly}} {{23-23=self.}} // expected-warning @-1 {{capture 'myX' was never used}} return 42 } } // If the implicit self is of value type, no diagnostic should be produced. struct ImplicitSelfAllowedInStruct { var x = 42 mutating func method() -> Int { doStuff({ x+1 }) doVoidStuff({ x += 1 }) doStuff({ method() }) doVoidStuff({ _ = method() }) } func method2() -> Int { doStuff({ x+1 }) doVoidStuff({ _ = x+1 }) doStuff({ method2() }) doVoidStuff({ _ = method2() }) } } enum ImplicitSelfAllowedInEnum { case foo var x: Int { 42 } mutating func method() -> Int { doStuff({ x+1 }) doVoidStuff({ _ = x+1 }) doStuff({ method() }) doVoidStuff({ _ = method() }) } func method2() -> Int { doStuff({ x+1 }) doVoidStuff({ _ = x+1 }) doStuff({ method2() }) doVoidStuff({ _ = method2() }) } } class SomeClass { var field : SomeClass? func foo() -> Int {} } func testCaptureBehavior(_ ptr : SomeClass) { // Test normal captures. weak var wv : SomeClass? = ptr unowned let uv : SomeClass = ptr unowned(unsafe) let uv1 : SomeClass = ptr unowned(safe) let uv2 : SomeClass = ptr doStuff { wv!.foo() } doStuff { uv.foo() } doStuff { uv1.foo() } doStuff { uv2.foo() } // Capture list tests let v1 : SomeClass? = ptr let v2 : SomeClass = ptr doStuff { [weak v1] in v1!.foo() } // expected-warning @+2 {{variable 'v1' was written to, but never read}} doStuff { [weak v1, // expected-note {{previous}} weak v1] in v1!.foo() } // expected-error {{definition conflicts with previous value}} doStuff { [unowned v2] in v2.foo() } doStuff { [unowned(unsafe) v2] in v2.foo() } doStuff { [unowned(safe) v2] in v2.foo() } doStuff { [weak v1, weak v2] in v1!.foo() + v2!.foo() } let i = 42 // expected-warning @+1 {{variable 'i' was never mutated}} {{19-20=let}} doStuff { [weak i] in i! } // expected-error {{'weak' may only be applied to class and class-bound protocol types, not 'Int'}} } extension SomeClass { func bar() { doStuff { [unowned self] in self.foo() } doStuff { [unowned xyz = self.field!] in xyz.foo() } doStuff { [weak xyz = self.field] in xyz!.foo() } // rdar://16889886 - Assert when trying to weak capture a property of self in a lazy closure // FIXME: We should probably offer a fix-it to the field capture error and suppress the 'implicit self' error. https://bugs.swift.org/browse/SR-11634 doStuff { [weak self.field] in field!.foo() } // expected-error {{fields may only be captured by assigning to a specific name}} expected-error {{reference to property 'field' in closure requires explicit use of 'self' to make capture semantics explicit}} expected-note {{reference 'self.' explicitly}} {{36-36=self.}} expected-note {{capture 'self' explicitly to enable implicit 'self' in this closure}} {{16-16=self, }} // expected-warning @+1 {{variable 'self' was written to, but never read}} doStuff { [weak self&field] in 42 } // expected-error {{expected ']' at end of capture list}} } func strong_in_capture_list() { // <rdar://problem/18819742> QOI: "[strong self]" in capture list generates unhelpful error message _ = {[strong self] () -> () in return } // expected-error {{expected 'weak', 'unowned', or no specifier in capture list}} } } // <rdar://problem/16955318> Observed variable in a closure triggers an assertion var closureWithObservedProperty: () -> () = { var a: Int = 42 { // expected-warning {{variable 'a' was never used; consider replacing with '_' or removing it}} willSet { _ = "Will set a to \(newValue)" } didSet { _ = "Did set a with old value of \(oldValue)" } } } ; {}() // expected-error{{top-level statement cannot begin with a closure expression}} // rdar://19179412 - Crash on valid code. func rdar19179412() -> (Int) -> Int { return { x in class A { let d : Int = 0 } return 0 } } // Test coercion of single-expression closure return types to void. func takesVoidFunc(_ f: () -> ()) {} var i: Int = 1 // expected-warning @+1 {{expression of type 'Int' is unused}} takesVoidFunc({i}) // expected-warning @+1 {{expression of type 'Int' is unused}} var f1: () -> () = {i} var x = {return $0}(1) func returnsInt() -> Int { return 0 } takesVoidFunc(returnsInt) // expected-error {{cannot convert value of type '() -> Int' to expected argument type '() -> ()'}} takesVoidFunc({() -> Int in 0}) // expected-error {{declared closure result 'Int' is incompatible with contextual type '()'}} {{22-25=()}} // These used to crash the compiler, but were fixed to support the implementation of rdar://problem/17228969 Void(0) // expected-error{{argument passed to call that takes no arguments}} _ = {0} // <rdar://problem/22086634> "multi-statement closures require an explicit return type" should be an error not a note let samples = { // expected-error {{unable to infer complex closure return type; add explicit type to disambiguate}} {{16-16= () -> <#Result#> in }} if (i > 10) { return true } else { return false } }() // <rdar://problem/19756953> Swift error: cannot capture '$0' before it is declared func f(_ fp : (Bool, Bool) -> Bool) {} f { $0 && !$1 } // <rdar://problem/18123596> unexpected error on self. capture inside class method func TakesIntReturnsVoid(_ fp : ((Int) -> ())) {} struct TestStructWithStaticMethod { static func myClassMethod(_ count: Int) { // Shouldn't require "self." TakesIntReturnsVoid { _ in myClassMethod(0) } } } class TestClassWithStaticMethod { class func myClassMethod(_ count: Int) { // Shouldn't require "self." TakesIntReturnsVoid { _ in myClassMethod(0) } } } // Test that we can infer () as the result type of these closures. func genericOne<T>(_ a: () -> T) {} func genericTwo<T>(_ a: () -> T, _ b: () -> T) {} genericOne {} genericTwo({}, {}) // <rdar://problem/22344208> QoI: Warning for unused capture list variable should be customized class r22344208 { func f() { let q = 42 let _: () -> Int = { [unowned self, // expected-warning {{capture 'self' was never used}} q] in // expected-warning {{capture 'q' was never used}} 1 } } } var f = { (s: Undeclared) -> Int in 0 } // expected-error {{use of undeclared type 'Undeclared'}} // <rdar://problem/21375863> Swift compiler crashes when using closure, declared to return illegal type. func r21375863() { var width = 0 var height = 0 var bufs: [[UInt8]] = (0..<4).map { _ -> [asdf] in // expected-error {{use of undeclared type 'asdf'}} [UInt8](repeating: 0, count: width*height) } } // <rdar://problem/25993258> // Don't crash if we infer a closure argument to have a tuple type containing inouts. func r25993258_helper(_ fn: (inout Int, Int) -> ()) {} func r25993258a() { r25993258_helper { x in () } // expected-error {{contextual closure type '(inout Int, Int) -> ()' expects 2 arguments, but 1 was used in closure body}} } func r25993258b() { r25993258_helper { _ in () } // expected-error {{contextual closure type '(inout Int, Int) -> ()' expects 2 arguments, but 1 was used in closure body}} } // We have to map the captured var type into the right generic environment. class GenericClass<T> {} func lvalueCapture<T>(c: GenericClass<T>) { var cc = c weak var wc = c func innerGeneric<U>(_: U) { _ = cc _ = wc cc = wc! } } // Don't expose @lvalue-ness in diagnostics. let closure = { // expected-error {{unable to infer complex closure return type; add explicit type to disambiguate}} {{16-16= () -> <#Result#> in }} var helper = true return helper }
apache-2.0
a6d4e7eddb697e0847aefc8b379f84c6
58.379381
426
0.66287
3.777413
false
false
false
false
johnlui/Swift-MMP
Frameworks/Pitaya/PitayaTests/BasicTests.swift
1
2062
// // BasicTests.swift // Pitaya // // Created by 吕文翰 on 15/10/8. // Copyright © 2015年 http://lvwenhan.com. All rights reserved. // import XCTest import Pitaya class BasicTests: BaseTestCase { func testGET() { let expectation = self.expectation(description: "testGET") Pita.build(HTTPMethod: .GET, url: "http://tinylara.com:8000/pitaya.php") .onNetworkError({ (error) -> Void in XCTAssert(false, error.localizedDescription) }) .responseString { (string, response) -> Void in XCTAssert(string == "", "GET should success and return empty string with no params") expectation.fulfill() } waitForExpectations(timeout: self.defaultTimeout, handler: nil) } func testPOST() { let expectation = self.expectation(description: "testPOST") Pita.build(HTTPMethod: .POST, url: "http://tinylara.com:8000/pitaya.php") .onNetworkError({ (error) -> Void in XCTAssert(false, error.localizedDescription) }) .responseString { (string, response) -> Void in XCTAssert(string == "", "POST should success and return empty string with no params") expectation.fulfill() } waitForExpectations(timeout: self.defaultTimeout, handler: nil) } func testOneMoreThing() { // code here will not be used in reality forever, just for increasing testing coverage let expectation = self.expectation(description: "testOneMoreThing") Pitaya.DEBUG = true Pita.build(HTTPMethod: .GET, url: "http://tinylara.com:8000/pitaya.php") .responseString { (string, response) -> Void in XCTAssert(string == "", "GET should success and return empty string with no params") expectation.fulfill() } waitForExpectations(timeout: self.defaultTimeout, handler: nil) } }
mit
3fa0a7ebba9bd2238ebceb241b999f91
35.017544
101
0.589868
4.623874
false
true
false
false
GE-N/Leaflet
Pod/Classes/LeafletStyle.swift
1
1730
// // LeafletStyle.swift // Leaflet // // Created by Jerapong Nampetch on 12/28/2558 BE. // Copyright © 2558 Gomeeki. All rights reserved. // import Foundation public protocol LeafletStyle { var backgroundColor: UIColor? { get } var font: UIFont? { get } var textColor: UIColor? { get } var alignment: NSTextAlignment? { get } } public protocol GenericStyle : LeafletStyle { var border: CGFloat? { get } var acceptIcon: UIImage? { get } var acceptBackgroundColor: UIColor? { get } var declineIcon: UIImage? { get } var declineBackgroundColor: UIColor? { get } } public struct DefaultStyle : LeafletStyle { public var backgroundColor: UIColor? public var font: UIFont? public var textColor: UIColor? public var alignment: NSTextAlignment? public init() { backgroundColor = UIColor(red:0.98, green:0.98, blue:0.98, alpha:1) font = UIFont.systemFont(ofSize: 14) textColor = UIColor.black alignment = .left } } public struct InformStyle : GenericStyle { public var backgroundColor: UIColor? public var font: UIFont? public var textColor: UIColor? public var border: CGFloat? public var alignment: NSTextAlignment? public var acceptIcon: UIImage? public var acceptBackgroundColor: UIColor? public var declineIcon: UIImage? public var declineBackgroundColor: UIColor? public init() { backgroundColor = UIColor(red:0.98, green:0.98, blue:0.98, alpha:1) font = UIFont.systemFont(ofSize: 14) textColor = UIColor.black border = 1 alignment = .left acceptIcon = nil declineIcon = nil acceptBackgroundColor = nil declineBackgroundColor = nil } }
mit
835e498646c8508de5748e5f5bf9828d
25.6
71
0.67727
4.011601
false
false
false
false
juliobertolacini/ReduxPaperSwift
ReduxPaperScissors/Pods/ReSwift/ReSwift/Utils/Assertions.swift
13
1017
// // Assertions // Copyright © 2015 mohamede1945. All rights reserved. // https://github.com/mohamede1945/AssertionsTestingExample // import Foundation /// drop-in fatalError replacement for testing /** Swift.fatalError wrapper for catching in tests - parameter message: Message to be wrapped - parameter file: Calling file - parameter line: Calling line */ internal func raiseFatalError(_ message: @autoclosure () -> String = "", file: StaticString = #file, line: UInt = #line) -> Never { Assertions.fatalErrorClosure(message(), file, line) repeat { RunLoop.current.run() } while (true) } /// Stores custom assertions closures, by default it points to Swift functions. But test target can /// override them. internal class Assertions { internal static var fatalErrorClosure = swiftFatalErrorClosure internal static let swiftFatalErrorClosure: (String, StaticString, UInt) -> Void = { Swift.fatalError($0, file: $1, line: $2) } }
mit
5de9406eba76b4e331be135dfac4fd84
30.75
99
0.688976
4.360515
false
true
false
false
pixelspark/catena
Sources/CatenaSQL/SQLBlockchain.swift
1
32066
import Foundation import LoggerAPI import CatenaCore public class SQLLedger: Ledger { public typealias BlockchainType = SQLBlockchain public typealias ParametersType = SQLParameters public let mutex = Mutex() public let orphans = Orphans<SQLBlock>() public var longest: SQLBlockchain /** Instantiate an SQLLedger that tracks chains starting at the indicated genesis block and uses the indicated database file for storage. When`replay` is true, the ledger will process database transactions, whereas if it is false, the ledger will only validate transactions and participate in grant and other metadata processing. */ public init(genesis: SQLBlock, database path: String, replay: Bool) throws { self.longest = try SQLBlockchain(genesis: genesis, database: path, replay: replay) } public func canAccept(transaction: SQLTransaction, pool: SQLBlock?) throws -> Eligibility { if !transaction.isSignatureValid { Log.info("[Ledger] cannot accept tx \(transaction): signature invalid") return .never } // Perhaps the transaction is appendable to another pooled transaction? if let p = pool { for tr in p.payload.transactions { if tr.invoker == transaction.invoker && (tr.counter + 1) == transaction.counter { return .now } } } /* A transaction is acceptable when its counter is one above the stored counter for the invoker key, or zero when the invoker has no counter yet (not executed any transactions before on this chain). */ let counter = try self.mutex.locked { () -> SQLTransaction.CounterType? in return try self.longest.withUnverifiedTransactions { chain in return try chain.meta.users.counter(for: transaction.invoker) } } if let counter = counter { /* The transaction counter directly follows the counter in the ledger (but may conflict with another transaction in the pool). It is nevertheless acceptable. */ if (counter + 1) == transaction.counter { return .now } else if (counter + 1) < transaction.counter { /* The counter is too far ahead of the current counter, so it is acceptable in the future if transactions appear that use the intermediate counter values. */ return .future } else { /* The counter value is lower than what is currently in the ledger, so this transaction will never become acceptable. */ return .never } } else { /* No transactions have been made by this invoker yet on the ledger, so this should be the first one (with counter=0) to be acceptable now. If the counter value is higher, it may become acceptable in the future. */ if transaction.counter == 0 { return .now } else { return .future } } } } public struct SQLParameters: Parameters { public static let protocolVersion = "catena-v1" } public class SQLBlockchain: Blockchain { public typealias BlockType = SQLBlock public let genesis: SQLBlock public var highest: SQLBlock /** The SQL blockchain maintains a database (permanent) and a queue. When transactions are received, they are inserted in a queue. When this queue exceeds a certain size (`maxQueueSize`), the transactions are processed in the permanent database. If a chain splice/switch occurs that required rewinding to less than maxQueueSize blocks, this can be done efficiently by removing blocks from the queue. If the splice happens earlier, the full database needs to be rebuilt.*/ private(set) var database: Database public private(set) var meta: SQLMetadata private let maxQueueSize = 7 private var queue: [SQLBlock] = [] private let mutex = Mutex() let replay: Bool /** Number of blocks after which a difficulty retarget is performed. An interval of 10 will determine the difficulty for block 11 on blocks 0...10. */ let difficultyRetargetInterval: BlockType.IndexType = 10 /** The desired average time between blocks in seconds. A retarget will occur on average every `desiredTimeBetweenBlocks` * `difficultyRetargetInterval`. */ let desiredTimeBetweenBlocks: SQLBlock.TimestampType = 10 /** Lower bound for the amount of work that is ever required to be performed per block. */ let minimumAmountOfWorkPerBlock: SQLBlock.WorkType = 10 /** Upper bound for the amount of work that is ever required to be performed per block. */ let maximumAmountOfWorkPerBlock: SQLBlock.WorkType = 200 let databasePath: String private init(genesis: SQLBlock, highest: SQLBlock, database: Database, meta: SQLMetadata, replay: Bool, databasePath: String) { self.genesis = genesis self.highest = highest self.database = database self.meta = meta self.replay = replay self.databasePath = databasePath } /** Instantiate an SQL blockchain that starts at the indicated genesis block and is stored in the indicated database file. When `replay` is true, the chain also processes database transactions. When it is false, only validation and metadata operations are performed. */ init(genesis: SQLBlock, database path: String, replay: Bool) throws { let permDatabase = SQLiteDatabase() try permDatabase.open(path) self.replay = replay self.genesis = genesis self.highest = genesis self.databasePath = path self.database = permDatabase self.meta = try SQLMetadata(database: database) // Is this database already initialized? If so, check whether it replays if let databaseReplay = self.meta.isReplaying { if databaseReplay != replay { throw SQLMetadataError.replayMismatchError } } else { try self.meta.set(replaying: replay) } // Load chain from storage if let hh = self.meta.headHash { self.highest = try self.meta.get(block: hh)! Log.debug("[SQLLedger] Get highest: \(self.highest.signature!.stringValue)") } else { try self.meta.database.transaction { try self.meta.archive(block: genesis) try self.meta.set(head: genesis.signature!, index: genesis.index) } } } public func get(block hash: BlockType.HashType) throws -> SQLBlock? { if let b = try self.meta.get(block: hash) { return b } // Search queue for b in queue { if b.signature! == hash { return b } } return nil } public func get(at index: BlockType.IndexType) throws -> SQLBlock? { if let b = try self.meta.archive.get(at: index) { return b } // Search queue for b in queue { if b.index == index { return b } } return nil } private func totalWork(between: CountableClosedRange<SQLBlock.IndexType>) throws -> SQLBlock.WorkType { var totalWork: SQLBlock.WorkType = try self.meta.archive.totalWork(between: between) for b in queue { if b.index >= between.lowerBound && b.index <= between.upperBound { totalWork += b.work } } return totalWork } func process(block: SQLBlock) throws { try self.mutex.locked { try block.apply(database: self.database, meta: self.meta, replay: self.replay) } } /** Returns the set of block indices for the blocks that are included in the difficulty calculation for a block *following* the indicated block. If the block has index 20 and interval is 5, then the range will be 15...20. */ private func retargetingInterval(forBlockFollowing precedingBlock: SQLBlock) -> CountableClosedRange<SQLBlock.IndexType> { assert(difficultyRetargetInterval > self.maxQueueSize) let lastRetargetEnd = precedingBlock.index - (precedingBlock.index % difficultyRetargetInterval) if lastRetargetEnd < difficultyRetargetInterval { return 0...0 } let lastRetargetStart = max(0, lastRetargetEnd - difficultyRetargetInterval) return lastRetargetStart...lastRetargetEnd } public func difficulty(forBlockFollowing precedingBlock: SQLBlock) throws -> SQLBlock.WorkType { return try self.mutex.locked { let retargetRange = self.retargetingInterval(forBlockFollowing: precedingBlock) let lowerBlock = try self.get(at: retargetRange.lowerBound) let upperBlock = (precedingBlock.index == retargetRange.upperBound) ? precedingBlock : try self.get(at: retargetRange.upperBound) let totalWork = try self.totalWork(between: retargetRange) let totalTime = Int(upperBlock!.timestamp - lowerBlock!.timestamp) if totalTime <= 0 { return self.genesis.work } let desiredTotalTime = Int(desiredTimeBetweenBlocks) * Int(retargetRange.count) let previousDifficulty = totalWork / SQLBlock.WorkType(retargetRange.count) if totalTime > desiredTotalTime { return min(maximumAmountOfWorkPerBlock, max(minimumAmountOfWorkPerBlock, previousDifficulty - 1)) } else { return min(maximumAmountOfWorkPerBlock, max(minimumAmountOfWorkPerBlock, previousDifficulty + 1)) } } } /** Persist blocks currently in the queue up to the specified block index. */ public func persistBlocks(upToAndIncluding index: SQLBlock.IndexType) throws { return try self.mutex.locked { while self.queue.count > 0 && self.queue.first!.index <= index { let promoted = self.queue.removeFirst() Log.debug("[SQLBlockchain] promoting block \(promoted.index) to permanent storage which is now at \(self.meta.headIndex!)") if (self.meta.headIndex! + 1) != promoted.index { Log.info("[SQLBlockchain] need to replay first to \(promoted.index-1)") let prev = try self.get(block: promoted.previous)! try self.replayPermanentStorage(to: prev) } try self.process(block: promoted) Log.debug("[SQLBlockchain] promoted block \(promoted.index) to permanent storage; qs=\(self.queue.count)") } } } public func append(block: SQLBlock) throws -> Bool { return try self.mutex.locked { if try self.canAppend(block: block, to: self.highest) { self.queue.append(block) self.highest = block if self.queue.count > maxQueueSize { try persistBlocks(upToAndIncluding: self.queue.first!.index) } return true } return false } } public func unwind(to: SQLBlock) throws { do { try self.mutex.locked { Log.info("[SQLBlockchain] Unwind from #\(self.highest.index) to #\(to.index)") if self.meta.headIndex! <= to.index { // Unwinding within queue self.queue = self.queue.filter { return $0.index <= to.index } self.highest = to Log.debug("[SQLBlockchain] Permanent is at \(self.meta.headIndex!), replayed up to+including \(to.index), queue size is \(self.queue.count)") } else { // To-block is earlier than the head of permanent storage. Need to replay the full chain Log.info("[SQLBlockchain] Unwind requires a replay of the full chain, because target block (\(to.index)) << head of permanent history (\(self.meta.headIndex!)) ") try self.replayPermanentStorage(to: to) } // Right now we should be at the desired point assert(self.highest == to) } } catch { fatalError("[SQLBlockchain] unwind error: \(error.localizedDescription)") } } private func replayPermanentStorage(to: SQLBlock) throws { try self.mutex.locked { // Find blocks to be replayed // TODO: refactor so we can just walk the chain from old to new without creating a giant array var replay: [SQLBlock] = [] var current = to repeat { replay.append(current) if current.index != 0 { current = try self.get(block: current.previous)! } else { break } } while true // Empty the queue self.queue = [] // Remove database self.database.close() if self.databasePath != ":memory:" { let e = self.databasePath.withCString { cs -> Int32 in return unlink(cs) } if e != 0 { fatalError("[SQLLedger] Could not delete permanent database; err=\(e)") } } // Create new database let db = SQLiteDatabase() try db.open(self.databasePath) self.database = db self.meta = try SQLMetadata(database: self.database) // Replay blocks try self.database.transaction { for block in replay.reversed() { try self.process(block: block) self.highest = block } Log.info("[SQLLedger] replay on permanent storage is complete") } assert(self.highest == to, "replay should end up at desired block") } } public func withUnverifiedTransactions<T>(_ block: @escaping ((SQLBlockchain) throws -> (T))) rethrows -> T { return try self.mutex.locked { return try self.database.hypothetical { // Replay queued blocks for block in self.queue { try block.apply(database: self.database, meta: self.meta, replay: self.replay) } let unverifiedChain = SQLBlockchain(genesis: self.genesis, highest: self.highest, database: self.database, meta: self.meta, replay: self.replay, databasePath: self.databasePath) return try block(unverifiedChain) } } } } public class SQLDatabasesTable { let database: Database let table: SQLTable private let nameColumn = SQLColumn(name: "name") private let ownerColumn = SQLColumn(name: "owner") init(database: Database, table: SQLTable) throws { self.database = database self.table = table try database.transaction { if !(try database.exists(table: self.table.name)) { var cols = OrderedDictionary<SQLColumn, SQLType>() cols.append(.text, forKey: self.nameColumn) cols.append(.blob, forKey: self.ownerColumn) let createStatement = SQLStatement.createTable(table: self.table, schema: SQLSchema( columns: cols, primaryKey: self.nameColumn )) try _ = self.database.perform(createStatement.sql(dialect: self.database.dialect)) } } } public func owner(for database: SQLDatabase) throws -> SQLBlockchain.BlockType.IdentityType? { let selectStatement = SQLStatement.select(SQLSelect( these: [.column(self.ownerColumn)], from: self.table, joins: [], where: SQLExpression.binary(.column(self.nameColumn), .equals, .literalString(database.name.lowercased())), distinct: false, orders: [] )) let r = try self.database.perform(selectStatement.sql(dialect: self.database.dialect)) if r.hasRow, case .blob(let value) = r.values[0] { return try SQLBlockchain.BlockType.IdentityType(hash: value) } return nil } public func exists(database: SQLDatabase) throws -> Bool { return try self.owner(for: database) != nil } public func create(database: SQLDatabase, owner: SQLBlockchain.BlockType.IdentityType) throws { let insertStatement = SQLStatement.insert(SQLInsert( orReplace: false, into: self.table, columns: [self.nameColumn, self.ownerColumn], values: [[.literalString(database.name.lowercased()), .literalBlob(owner.hash)]] )) try _ = self.database.perform(insertStatement.sql(dialect: self.database.dialect)) } public func drop(database: SQLDatabase) throws { let dropStatement = SQLStatement.delete(from: self.table, where: .binary(.column(self.nameColumn), .equals, .literalString(database.name.lowercased())) ) try _ = self.database.perform(dropStatement.sql(dialect: self.database.dialect)) } /** Returns a list of databases with their owners */ public func list(for user: Data? = nil) throws -> [SQLDatabase: PublicKey] { var filter: SQLExpression? = nil if let u = user { filter = .binary(.column(self.ownerColumn), .equals, .literalBlob(u)) } let selectStatement = SQLStatement.select(SQLSelect( these: [.column(self.nameColumn), .column(self.ownerColumn)], from: self.table, joins: [], where: filter, distinct: false, orders: [] )) let r = try self.database.perform(selectStatement.sql(dialect: self.database.dialect)) var data: [SQLDatabase: PublicKey] = [:] while r.hasRow, case .text(let name) = r.values[0], case .blob(let owner) = r.values[1] { data[SQLDatabase(name: name)] = PublicKey(data: owner) r.step() } return data } } public class SQLUsersTable { let database: Database let table: SQLTable private let userColumn = SQLColumn(name: "user") private let counterColumn = SQLColumn(name: "counter") init(database: Database, table: SQLTable) throws { self.database = database self.table = table // Ensure the table exists try database.transaction { if !(try database.exists(table: self.table.name)) { var cols = OrderedDictionary<SQLColumn, SQLType>() cols.append(.blob, forKey: self.userColumn) cols.append(.int, forKey: self.counterColumn) let createStatement = SQLStatement.createTable(table: self.table, schema: SQLSchema( columns: cols, primaryKey: self.userColumn )) try _ = self.database.perform(createStatement.sql(dialect: self.database.dialect)) } } } public func counter(for key: PublicKey) throws -> SQLTransaction.CounterType? { let selectStatement = SQLStatement.select(SQLSelect( these: [.column(self.counterColumn)], from: self.table, joins: [], where: SQLExpression.binary(.column(self.userColumn), .equals, .literalBlob(key.data.sha256)), distinct: false, orders: [] )) let r = try self.database.perform(selectStatement.sql(dialect: self.database.dialect)) if r.hasRow, case .int(let value) = r.values[0] { return SQLTransaction.CounterType(value) } return nil } func setCounter(for key: PublicKey, to: SQLTransaction.CounterType) throws { let insertStatement = SQLStatement.insert(SQLInsert( orReplace: true, into: self.table, columns: [self.userColumn, self.counterColumn], values: [[SQLExpression.literalBlob(key.data.sha256), SQLExpression.literalInteger(Int(to))]] )) try _ = self.database.perform(insertStatement.sql(dialect: self.database.dialect)) } public func counters() throws -> [Data: Int] { let selectStatement = SQLStatement.select(SQLSelect( these: [.column(self.userColumn), .column(self.counterColumn)], from: self.table, joins: [], where: nil, distinct: false, orders: [] )) let r = try self.database.perform(selectStatement.sql(dialect: self.database.dialect)) var data: [Data: Int] = [:] while r.hasRow { if case .int(let counter) = r.values[1], case .blob(let user) = r.values[0] { data[user] = counter } r.step() } return data } } public class SQLKeyValueTable { let database: Database let table: SQLTable private let keyColumn = SQLColumn(name: "key") private let valueColumn = SQLColumn(name: "value") public init(database: Database, table: SQLTable) throws { self.database = database self.table = table // Ensure the table exists try database.transaction { if !(try database.exists(table: self.table.name)) { var cols = OrderedDictionary<SQLColumn, SQLType>() cols.append(.text, forKey: self.keyColumn) cols.append(.text, forKey: self.valueColumn) let createStatement = SQLStatement.createTable(table: self.table, schema: SQLSchema( columns: cols, primaryKey: self.keyColumn)) try _ = self.database.perform(createStatement.sql(dialect: self.database.dialect)) } } } public func get(_ key: String) throws -> String? { return try database.transaction { let selectStatement = SQLStatement.select(SQLSelect( these: [.column(self.valueColumn)], from: self.table, joins: [], where: SQLExpression.binary(.column(self.keyColumn), .equals, .literalString(key)), distinct: false, orders: [] )) let r = try self.database.perform(selectStatement.sql(dialect: self.database.dialect)) if r.hasRow, case .text(let value) = r.values[0] { return value } return nil } } public func set(key: String, value: String) throws { try database.transaction { let insertStatement = SQLStatement.insert(SQLInsert( orReplace: true, into: self.table, columns: [self.keyColumn, self.valueColumn], values: [[SQLExpression.literalString(key), SQLExpression.literalString(value)]] )) try _ = self.database.perform(insertStatement.sql(dialect: self.database.dialect)) } } } class SQLBlockArchive { let database: Database let table: SQLTable init(table: SQLTable, database: Database) throws { self.table = table self.database = database // This is a new file? if !(try database.exists(table: self.table.name)) { // Create block table try self.database.transaction(name: "init-block-archive") { // Version, nonce and timestamp need to be stored as blob because SQLite does not fully support Uint64s var cols = OrderedDictionary<SQLColumn, SQLType>() cols.append(SQLType.blob, forKey: SQLColumn(name: "signature")) cols.append(SQLType.blob, forKey: SQLColumn(name: "version")) cols.append(SQLType.int, forKey: SQLColumn(name: "index")) cols.append(SQLType.blob, forKey: SQLColumn(name: "nonce")) cols.append(SQLType.blob, forKey: SQLColumn(name: "previous")) cols.append(SQLType.blob, forKey: SQLColumn(name: "timestamp")) cols.append(SQLType.blob, forKey: SQLColumn(name: "miner")) cols.append(SQLType.blob, forKey: SQLColumn(name: "payload")) cols.append(SQLType.int, forKey: SQLColumn(name: "work")) let createStatement = SQLStatement.createTable(table: table, schema: SQLSchema(columns: cols, primaryKey: SQLColumn(name: "signature"))) _ = try self.database.perform(createStatement.sql(dialect: self.database.dialect)) let createIndexStatement = SQLStatement.createIndex(table: table, index: SQLIndex(name: SQLIndexName(name: "idx_index"), on: OrderedSet<SQLColumn>([ SQLColumn(name: "index") ]), unique: true)) _ = try self.database.perform(createIndexStatement.sql(dialect: self.database.dialect)) } } } func archive(block: SQLBlock) throws { var nonce = block.nonce var ts = block.timestamp var version = block.version let insertStatement = SQLStatement.insert(SQLInsert( orReplace: false, into: self.table, columns: ["signature", "index", "timestamp", "nonce", "previous", "payload", "version", "miner", "work"].map(SQLColumn.init), values: [[ .literalBlob(block.signature!.hash), .literalInteger(Int(block.index)), .literalBlob(Data(bytes: &ts, count: MemoryLayout<SQLBlock.TimestampType>.size)), .literalBlob(Data(bytes: &nonce, count: MemoryLayout<SQLBlock.NonceType>.size)), .literalBlob(block.previous.hash), .literalBlob(block.payloadData), .literalBlob(Data(bytes: &version, count: MemoryLayout<SQLBlock.VersionType>.size)), .literalBlob(block.miner.hash), .literalInteger(Int(block.signature!.difficulty)) ]])) _ = try database.perform(insertStatement.sql(dialect: database.dialect)) } func remove(block hash: SQLBlock.HashType) throws { let stmt = SQLStatement.delete(from: self.table, where: SQLExpression.binary(SQLExpression.column(SQLColumn(name: "signature")), .equals, .literalBlob(hash.hash))) _ = try self.database.perform(stmt.sql(dialect: self.database.dialect)) } func totalWork(between: CountableClosedRange<SQLBlock.IndexType>) throws -> SQLBlock.WorkType { let stmt = SQLStatement.select(SQLSelect( these: [SQLExpression.call(SQLFunction(name: "SUM"), parameters: [SQLExpression.column(SQLColumn(name: "work"))])], from: self.table, joins: [], where: SQLExpression.binary( SQLExpression.binary(SQLExpression.column(SQLColumn(name: "index")), .greaterThanOrEqual, .literalUnsigned(UInt(between.lowerBound))), SQLBinary.and, SQLExpression.binary(SQLExpression.column(SQLColumn(name: "index")), .lessThanOrEqual, .literalUnsigned(UInt(between.upperBound))) ), distinct: false )) let res = try self.database.perform(stmt.sql(dialect: self.database.dialect)) if res.hasRow, case .int(let work) = res.values[0] { return SQLBlock.WorkType(work) } else { throw SQLBlockError.metadataError } } func get(at index: SQLBlock.IndexType) throws -> SQLBlock? { return try get(having: SQLExpression.binary(SQLExpression.column(SQLColumn(name: "index")), .equals, .literalUnsigned(UInt(index)))) } func get(block hash: SQLBlock.HashType) throws -> SQLBlock? { let b = try get(having: SQLExpression.binary(SQLExpression.column(SQLColumn(name: "signature")), .equals, .literalBlob(hash.hash))) assert(b == nil || b!.signature == hash, "signature from archive doesn't match?!") return b } private func get(having: SQLExpression) throws -> SQLBlock? { let stmt = SQLStatement.select(SQLSelect( these: ["signature", "index", "nonce", "previous", "payload", "timestamp", "version", "miner"].map { return SQLExpression.column(SQLColumn(name: $0)) }, from: self.table, joins: [], where: having, distinct: false )) let res = try self.database.perform(stmt.sql(dialect: self.database.dialect)) if res.hasRow, case .int(let index) = res.values[1], case .blob(let nonce) = res.values[2], case .blob(let previousData) = res.values[3], case .blob(let timestamp) = res.values[5], case .blob(let version) = res.values[6], case .blob(let minerData) = res.values[7], case .blob(let signatureData) = res.values[0], version.count == MemoryLayout<SQLBlock.VersionType>.size, nonce.count == MemoryLayout<SQLBlock.NonceType>.size { let signature = try SQLBlock.HashType(hash: signatureData) let previous = try SQLBlock.HashType(hash: previousData) let miner = try SQLBlock.HashType(hash: minerData) assert(index >= 0, "Index must be positive") var nonceValue: SQLBlock.NonceType = 0 let buffer = UnsafeMutableBufferPointer(start: &nonceValue, count: 1) guard nonce.copyBytes(to: buffer) == MemoryLayout<SQLBlock.NonceType>.size else { throw SQLBlockError.metadataError } var versionValue: SQLBlock.VersionType = 0 let versionBuffer = UnsafeMutableBufferPointer(start: &versionValue, count: 1) guard version.copyBytes(to: versionBuffer) == MemoryLayout<SQLBlock.VersionType>.size else { throw SQLBlockError.metadataError } var tsValue: SQLBlock.TimestampType = 0 let tsBuffer = UnsafeMutableBufferPointer(start: &tsValue, count: 1) guard timestamp.copyBytes(to: tsBuffer) == MemoryLayout<SQLBlock.TimestampType>.size else { throw SQLBlockError.metadataError } // Payload can be null or block let payload: Data if case .blob(let payloadData) = res.values[4] { payload = payloadData } else if case .null = res.values[4] { payload = Data() } else { fatalError("invalid payload") } var block = try SQLBlock(version: versionValue, index: SQLBlock.IndexType(index), nonce: nonceValue, previous: previous, miner: miner, timestamp: tsValue, payload: payload) block.signature = signature assert(block.isSignatureValid, "persisted block signature is invalid! \(block)") return block } assert(!res.hasRow, "invalid block data from storage") return nil } } public class SQLPeerDatabase: PeerDatabase { let database: Database let table: SQLTable let uuidColumn = SQLColumn(name: "uuid") let urlColumn = SQLColumn(name: "url") public init(database: Database, table: SQLTable) throws { self.database = database self.table = table if try !self.database.exists(table: table.name) { let create = SQLStatement.createTable(table: self.table, schema: SQLSchema(primaryKey: uuidColumn, columns: (uuidColumn, .text), (urlColumn, .text) )) try _ = self.database.perform(create.sql(dialect: self.database.dialect)) } } public func rememberPeer(url: URL) throws { let uuid = UUID(uuidString: url.user!)! let insert = SQLStatement.insert(SQLInsert(orReplace: true, into: self.table, columns: [uuidColumn, urlColumn], values: [[ SQLExpression.literalString(uuid.uuidString), SQLExpression.literalString(url.absoluteString) ]])) try _ = self.database.perform(insert.sql(dialect: self.database.dialect)) } public func forgetAllPeers() throws { let delete = SQLStatement.delete(from: self.table, where: nil) try _ = self.database.perform(delete.sql(dialect: self.database.dialect)) } public func forgetPeer(uuid: UUID) throws { let delete = SQLStatement.delete(from: self.table, where: SQLExpression.binary( SQLExpression.column(self.uuidColumn), .equals, SQLExpression.literalString(uuid.uuidString) )) try _ = self.database.perform(delete.sql(dialect: self.database.dialect)) } public func peers() throws -> [URL] { let select = SQLStatement.select(SQLSelect(these: [SQLExpression.column(self.urlColumn)], from: self.table, joins: [], where: nil, distinct: false, orders: [])) let res = try self.database.perform(select.sql(dialect: self.database.dialect)) var urls: [URL] = [] while res.hasRow { if case .text(let urlString) = res.values[0], let u = URL(string: urlString) { urls.append(u) } res.step() } return urls } } public struct SQLMetadata { static let grantsTableName = "_grants" static let infoTableName = "_info" static let blocksTableName = "_blocks" static let usersTableName = "_users" static let databasesTableName = "_databases" /** All tables that are maintained for metadata, but invisible to chain queries. */ static let specialInvisibleTables = [infoTableName, blocksTableName, usersTableName, grantsTableName, databasesTableName] let database: Database internal let info: SQLKeyValueTable internal let grants: SQLGrants internal let users: SQLUsersTable internal let archive: SQLBlockArchive internal let databases: SQLDatabasesTable private let infoHeadHashKey = "head" private let infoHeadIndexKey = "index" private let infoReplayingKey = "replaying" private let infoTrueValue = "true" private let infoFalseValue = "false" public init(database: Database) throws { self.database = database self.info = try SQLKeyValueTable(database: database, table: SQLTable(name: SQLMetadata.infoTableName)) self.archive = try SQLBlockArchive(table: SQLTable(name: SQLMetadata.blocksTableName), database: database) self.grants = try SQLGrants(database: database, table: SQLTable(name: SQLMetadata.grantsTableName)) self.users = try SQLUsersTable(database: database, table: SQLTable(name: SQLMetadata.usersTableName)) self.databases = try SQLDatabasesTable(database: database, table: SQLTable(name: SQLMetadata.databasesTableName)) } var headHash: SQLBlock.HashType? { do { if let h = try self.info.get(self.infoHeadHashKey) { return try SQLBlock.HashType(hash: h) } return nil } catch { return nil } } var headIndex: SQLBlock.IndexType? { do { if let h = try self.info.get(self.infoHeadIndexKey), let hi = UInt(h) { return SQLBlock.IndexType(hi) } return nil } catch { return nil } } func set(head: SQLBlock.HashType, index: SQLBlock.IndexType) throws { try self.database.transaction(name: "metadata-set-\(index)-\(head.stringValue)") { try self.info.set(key: self.infoHeadHashKey, value: head.stringValue) try self.info.set(key: self.infoHeadIndexKey, value: String(index)) } } func set(replaying: Bool) throws { try self.database.transaction(name: "metadata-set-replay-\(index)") { try self.info.set(key: self.infoReplayingKey, value: replaying ? self.infoTrueValue : self.infoFalseValue) } } var isReplaying: Bool? { do { if let r = try self.info.get(self.infoReplayingKey) { return r == self.infoTrueValue } return nil } catch { return nil } } func archive(block: SQLBlock) throws { try self.archive.archive(block: block) } func remove(block hash: SQLBlock.HashType) throws { try self.archive.remove(block: hash) } func get(block hash: SQLBlock.HashType) throws -> SQLBlock? { return try self.archive.get(block: hash) } } enum SQLMetadataError: LocalizedError { case replayMismatchError var errorDescription: String? { switch self { case .replayMismatchError: return "the persisted database was created with a different replay setting." } } } enum SQLBlockError: LocalizedError { case metadataError case inconsecutiveBlockError case blockSignatureError case payloadSignatureError case tooManyTransactionsInBlockError var errorDescription: String? { switch self { case .metadataError: return "metadata error" case .inconsecutiveBlockError: return "inconsecutive block error" case .blockSignatureError: return "block signature error" case .payloadSignatureError: return "payload signature error" case .tooManyTransactionsInBlockError: return "too many transactions in a block" } } }
mit
af367e87905e3ac700e53b0841917fd4
33.368703
181
0.716959
3.510235
false
false
false
false
Adorkable/BingAPIiOS
BingAPI/Routes/SearchRoute.swift
1
3352
// // SearchRoute.swift // BingAPI // // Created by Ian on 6/12/15. // Copyright (c) 2015 Adorkable. All rights reserved. // import Foundation import AdorkableAPIBase public class SearchRoute: RouteBase<Bing> { public typealias ResultsHandler = (SuccessResult<[BingSearchResult]>) -> Void override public static var httpMethod : String { return "GET" } override public var path : String { return "/Bing/Search/Web" } var searchText : String init(searchText : String, timeoutInterval : NSTimeInterval = Bing.timeoutInterval, cachePolicy : NSURLRequestCachePolicy = Bing.cachePolicy) { self.searchText = searchText super.init(timeoutInterval: timeoutInterval, cachePolicy: cachePolicy) } override public var query : String { get { var result = "$format=json" RouteBase<Bing>.addParameter(&result, name: "Query", value: "\'\(self.searchText)\'") return result } } func start(configureUrlRequest : (urlRequest : NSMutableURLRequest) -> Void, resultsHandler : ResultsHandler) { let task = self.jsonTask(configureUrlRequest) { (result) -> Void in switch result { case .Success(let jsonObject): if let jsonDictionary = jsonObject as? NSDictionary { let parseResults = self.dynamicType.parseResults(jsonDictionary) resultsHandler(parseResults) } else { let error = NSError(domain: "In results expected Dictionary, unexpected format " + _stdlib_getDemangledTypeName(jsonObject), code: 0, userInfo: nil) resultsHandler(.Failure(error)) } break case .Failure(let error): resultsHandler(.Failure(error)) break } } if task != nil { task!.resume() } else { let error = NSError(domain: "Unable to create SearchRoute task", code: 0, userInfo: nil) resultsHandler(.Failure(error)) } } internal class func parseResults(jsonResponse : NSDictionary) -> SuccessResult<[BingSearchResult]> { var result = Array<BingSearchResult>() if let d = jsonResponse["d"] as? NSDictionary { if let searchResults = d["results"] as? NSArray { for searchResultObject in searchResults { if let searchResult = searchResultObject as? NSDictionary { if let searchResultObject = BingSearchResult(dictionary: searchResult) { result.append(searchResultObject) } else { let error = NSError(domain: "Unable to parse search result \(searchResult) into BingSearchResult object", code: 0, userInfo: nil) return .Failure(error) } } } } } return .Success(result) } }
mit
195c7a9bfaf4538f2b19c4c90d30ed3c
31.543689
168
0.52685
5.643098
false
false
false
false
slabgorb/Tiler
Tiler/MapList.swift
1
1600
// // MapList.swift // Tiler // // Created by Keith Avery on 3/27/16. // Copyright © 2016 Keith Avery. All rights reserved. // import Foundation class MapList: NSObject, NSCoding { // MARK:- Properties var list:[Map] = [] private let file:FileSaveHelper = FileSaveHelper(fileName: "Maps", fileExtension: .JSON) var count:Int { return list.count } // MARK:- Archiving Paths static let DocumentsDirectory = NSFileManager().URLsForDirectory(.DocumentDirectory, inDomains: .UserDomainMask).first! static let ArchiveURL = DocumentsDirectory.URLByAppendingPathComponent("mapList") // MARK:- Initializers init(maps:[Map]) { list = maps } // MARK:- NSCoding required init?(coder aDecoder: NSCoder) { if let rawList = aDecoder.decodeObjectForKey("list") as? NSArray { self.list = rawList.map({$0 as! Map}) } } func encodeWithCoder(aCoder: NSCoder) { aCoder.encodeObject(list, forKey:"list") } // MARK:- Methods func get(index:Int) -> Map { return list[index] } func set(index:Int, map:Map) -> Void { list[index] = map } subscript(index: Int) -> Map { get { return get(index) } set(newValue) { set(index, map:newValue) } } func append(map:Map) { list.append(map) } func remove(index:Int) { list.removeAtIndex(index) } func swapItems(from:Int, _ to:Int) { swap(&list[from], &list[to]) } }
mit
68158e0b4bc5a244e157d4715d6f72a0
20.621622
123
0.572858
4.1
false
false
false
false
Mars182838/WJCycleScrollView
WJCycleScrollViewDemo/ViewController.swift
1
2950
// // ViewController.swift // WJCycleScrollViewDemo // // Created by 俊王 on 16/6/1. // Copyright © 2016年 WJ. All rights reserved. // import UIKit class ViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() let imageNames = ["h1.jpg","h2.jpg","h3.jpg","h4.jpg"] //***********************本地图片 默认轮播 **************************// let cycleScrollView = WJCycleScrollView.init(frame: CGRectMake(0, 64, self.view.w, 180), images:imageNames) cycleScrollView.itemScrollBlock { (currentIndex:Int) in print("itemBlcok:\(currentIndex)") } cycleScrollView.clickItemBlock { (currentIndex:Int) in print("clickBlcok:\(currentIndex)") } self.view.addSubview(cycleScrollView) //*********************** 本地图片 & 控制是否轮播 **************************// let cycleScrollView1 = WJCycleScrollView.init(frame: CGRectMake(0,264, self.view.w, 180), images: imageNames, infiniteLoop: false) cycleScrollView1.itemScrollBlock { (currentIndex:Int) in print("itemBlcok:\(currentIndex)") } cycleScrollView1.clickItemBlock { (currentIndex:Int) in print("clickBlcok:\(currentIndex)") } self.view.addSubview(cycleScrollView1) //*********************** 网络图片 **************************// let urlImageNames = [ "https://ss2.baidu.com/-vo3dSag_xI4khGko9WTAnF6hhy/super/whfpf%3D425%2C260%2C50/sign=a4b3d7085dee3d6d2293d48b252b5910/0e2442a7d933c89524cd5cd4d51373f0830200ea.jpg", "https://ss0.baidu.com/-Po3dSag_xI4khGko9WTAnF6hhy/super/whfpf%3D425%2C260%2C50/sign=a41eb338dd33c895a62bcb3bb72e47c2/5fdf8db1cb134954a2192ccb524e9258d1094a1e.jpg", "http://c.hiphotos.baidu.com/image/w%3D400/sign=c2318ff84334970a4773112fa5c8d1c0/b7fd5266d0160924c1fae5ccd60735fae7cd340d.jpg" ] let cycleScrollView2 = WJCycleScrollView.init(frame: CGRectMake(0,464, self.view.w, 180), urlImages: urlImageNames, placeholderImage:UIImage.init(named: "placeholder")!) cycleScrollView2.titlesGroup = ["我们很好啊!","我们其实没那么好!!","我们非常棒哦!!!!"] cycleScrollView2.itemScrollBlock { (currentIndex:Int) in print("itemBlcok:\(currentIndex)") } cycleScrollView2.clickItemBlock { (currentIndex:Int) in print("clickBlcok:\(currentIndex)") } self.view.addSubview(cycleScrollView2) } override func didReceiveMemoryWarning() { super.didReceiveMemoryWarning() // Dispose of any resources that can be recreated. } }
mit
162020b08870dca7c75c78b5615738b2
34.17284
177
0.583012
3.738845
false
false
false
false
e78l/swift-corelibs-foundation
Foundation/CharacterSet.swift
2
20829
//===----------------------------------------------------------------------===// // // This source file is part of the Swift.org open source project // // Copyright (c) 2014 - 2016 Apple Inc. and the Swift project authors // Licensed under Apache License v2.0 with Runtime Library Exception // // See http://swift.org/LICENSE.txt for license information // See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors // //===----------------------------------------------------------------------===// private func _utfRangeToNSRange(_ inRange : Range<UnicodeScalar>) -> NSRange { return NSRange(location: Int(inRange.lowerBound.value), length: Int(inRange.upperBound.value - inRange.lowerBound.value)) } private func _utfRangeToNSRange(_ inRange : ClosedRange<UnicodeScalar>) -> NSRange { return NSRange(location: Int(inRange.lowerBound.value), length: Int(inRange.upperBound.value - inRange.lowerBound.value + 1)) } internal final class _SwiftNSCharacterSet : NSCharacterSet, _SwiftNativeFoundationType { internal typealias ImmutableType = NSCharacterSet internal typealias MutableType = NSMutableCharacterSet var __wrapped : _MutableUnmanagedWrapper<ImmutableType, MutableType> init(immutableObject: AnyObject) { // Take ownership. __wrapped = .Immutable(Unmanaged.passRetained(_unsafeReferenceCast(immutableObject, to: ImmutableType.self))) super.init() } init(mutableObject: AnyObject) { // Take ownership. __wrapped = .Mutable(Unmanaged.passRetained(_unsafeReferenceCast(mutableObject, to: MutableType.self))) super.init() } internal required init(unmanagedImmutableObject: Unmanaged<ImmutableType>) { // Take ownership. __wrapped = .Immutable(unmanagedImmutableObject) super.init() } internal required init(unmanagedMutableObject: Unmanaged<MutableType>) { // Take ownership. __wrapped = .Mutable(unmanagedMutableObject) super.init() } convenience required init(coder aDecoder: NSCoder) { fatalError("init(coder:) has not been implemented") } deinit { releaseWrappedObject() } override func copy(with zone: NSZone? = nil) -> Any { return _mapUnmanaged { $0.copy(with: zone) } } override func mutableCopy(with zone: NSZone? = nil) -> Any { return _mapUnmanaged { $0.mutableCopy(with: zone) } } public override var classForCoder: AnyClass { return NSCharacterSet.self } override var bitmapRepresentation: Data { return _mapUnmanaged { $0.bitmapRepresentation } } override var inverted : CharacterSet { return _mapUnmanaged { $0.inverted } } override func hasMemberInPlane(_ thePlane: UInt8) -> Bool { return _mapUnmanaged {$0.hasMemberInPlane(thePlane) } } override func characterIsMember(_ member: unichar) -> Bool { return _mapUnmanaged { $0.characterIsMember(member) } } override func longCharacterIsMember(_ member: UInt32) -> Bool { return _mapUnmanaged { $0.longCharacterIsMember(member) } } override func isSuperset(of other: CharacterSet) -> Bool { return _mapUnmanaged { $0.isSuperset(of: other) } } override var _cfObject: CFType { // We cannot inherit super's unsafeBitCast(self, to: CFType.self) here, because layout of _SwiftNSCharacterSet // is not compatible with CFCharacterSet. We need to bitcast the underlying NSCharacterSet instead. return _mapUnmanaged { unsafeBitCast($0, to: CFType.self) } } } /** A `CharacterSet` represents a set of Unicode-compliant characters. Foundation types use `CharacterSet` to group characters together for searching operations, so that they can find any of a particular set of characters during a search. This type provides "copy-on-write" behavior, and is also bridged to the Objective-C `NSCharacterSet` class. */ public struct CharacterSet : ReferenceConvertible, Equatable, Hashable, SetAlgebra, _MutablePairBoxing { public typealias ReferenceType = NSCharacterSet internal typealias SwiftNSWrapping = _SwiftNSCharacterSet internal typealias ImmutableType = SwiftNSWrapping.ImmutableType internal typealias MutableType = SwiftNSWrapping.MutableType internal var _wrapped : _SwiftNSCharacterSet // MARK: Init methods internal init(_bridged characterSet: NSCharacterSet) { // We must copy the input because it might be mutable; just like storing a value type in ObjC _wrapped = _SwiftNSCharacterSet(immutableObject: characterSet.copy() as! NSObject) } /// Initialize an empty instance. public init() { _wrapped = _SwiftNSCharacterSet(immutableObject: NSCharacterSet()) } /// Initialize with a range of integers. /// /// It is the caller's responsibility to ensure that the values represent valid `UnicodeScalar` values, if that is what is desired. public init(charactersIn range: Range<UnicodeScalar>) { _wrapped = _SwiftNSCharacterSet(immutableObject: NSCharacterSet(range: _utfRangeToNSRange(range))) } /// Initialize with a closed range of integers. /// /// It is the caller's responsibility to ensure that the values represent valid `UnicodeScalar` values, if that is what is desired. public init(charactersIn range: ClosedRange<UnicodeScalar>) { _wrapped = _SwiftNSCharacterSet(immutableObject: NSCharacterSet(range: _utfRangeToNSRange(range))) } /// Initialize with the characters in the given string. /// /// - parameter string: The string content to inspect for characters. public init(charactersIn string: String) { _wrapped = _SwiftNSCharacterSet(immutableObject: NSCharacterSet(charactersIn: string)) } /// Initialize with a bitmap representation. /// /// This method is useful for creating a character set object with data from a file or other external data source. /// - parameter data: The bitmap representation. public init(bitmapRepresentation data: Data) { _wrapped = _SwiftNSCharacterSet(immutableObject: NSCharacterSet(bitmapRepresentation: data)) } /// Initialize with the contents of a file. /// /// Returns `nil` if there was an error reading the file. /// - parameter file: The file to read. public init?(contentsOfFile file: String) { if let interior = NSCharacterSet(contentsOfFile: file) { _wrapped = _SwiftNSCharacterSet(immutableObject: interior) } else { return nil } } public func hash(into hasher: inout Hasher) { hasher.combine(_mapUnmanaged { $0 }) } public var description: String { return _mapUnmanaged { $0.description } } public var debugDescription: String { return _mapUnmanaged { $0.debugDescription } } private init(reference: NSCharacterSet) { _wrapped = _SwiftNSCharacterSet(immutableObject: reference) } // MARK: Static functions /// Returns a character set containing the characters in Unicode General Category Cc and Cf. public static var controlCharacters : CharacterSet { return NSCharacterSet.controlCharacters } /// Returns a character set containing the characters in Unicode General Category Zs and `CHARACTER TABULATION (U+0009)`. public static var whitespaces : CharacterSet { return NSCharacterSet.whitespaces } /// Returns a character set containing characters in Unicode General Category Z*, `U+000A ~ U+000D`, and `U+0085`. public static var whitespacesAndNewlines : CharacterSet { return NSCharacterSet.whitespacesAndNewlines } /// Returns a character set containing the characters in the category of Decimal Numbers. public static var decimalDigits : CharacterSet { return NSCharacterSet.decimalDigits } /// Returns a character set containing the characters in Unicode General Category L* & M*. public static var letters : CharacterSet { return NSCharacterSet.letters } /// Returns a character set containing the characters in Unicode General Category Ll. public static var lowercaseLetters : CharacterSet { return NSCharacterSet.lowercaseLetters } /// Returns a character set containing the characters in Unicode General Category Lu and Lt. public static var uppercaseLetters : CharacterSet { return NSCharacterSet.uppercaseLetters } /// Returns a character set containing the characters in Unicode General Category M*. public static var nonBaseCharacters : CharacterSet { return NSCharacterSet.nonBaseCharacters } /// Returns a character set containing the characters in Unicode General Categories L*, M*, and N*. public static var alphanumerics : CharacterSet { return NSCharacterSet.alphanumerics } /// Returns a character set containing individual Unicode characters that can also be represented as composed character sequences (such as for letters with accents), by the definition of "standard decomposition" in version 3.2 of the Unicode character encoding standard. public static var decomposables : CharacterSet { return NSCharacterSet.decomposables } /// Returns a character set containing values in the category of Non-Characters or that have not yet been defined in version 3.2 of the Unicode standard. public static var illegalCharacters : CharacterSet { return NSCharacterSet.illegalCharacters } /// Returns a character set containing the characters in Unicode General Category P*. public static var punctuationCharacters : CharacterSet { return NSCharacterSet.punctuationCharacters } /// Returns a character set containing the characters in Unicode General Category Lt. public static var capitalizedLetters : CharacterSet { return NSCharacterSet.capitalizedLetters } /// Returns a character set containing the characters in Unicode General Category S*. public static var symbols : CharacterSet { return NSCharacterSet.symbols } /// Returns a character set containing the newline characters (`U+000A ~ U+000D`, `U+0085`, `U+2028`, and `U+2029`). public static var newlines : CharacterSet { return NSCharacterSet.newlines } // MARK: Static functions, from NSURL /// Returns the character set for characters allowed in a user URL subcomponent. public static var urlUserAllowed : CharacterSet { return NSCharacterSet.urlUserAllowed } /// Returns the character set for characters allowed in a password URL subcomponent. public static var urlPasswordAllowed : CharacterSet { return NSCharacterSet.urlPasswordAllowed } /// Returns the character set for characters allowed in a host URL subcomponent. public static var urlHostAllowed : CharacterSet { return NSCharacterSet.urlHostAllowed } /// Returns the character set for characters allowed in a path URL component. public static var urlPathAllowed : CharacterSet { return NSCharacterSet.urlPathAllowed } /// Returns the character set for characters allowed in a query URL component. public static var urlQueryAllowed : CharacterSet { return NSCharacterSet.urlQueryAllowed } /// Returns the character set for characters allowed in a fragment URL component. public static var urlFragmentAllowed : CharacterSet { return NSCharacterSet.urlFragmentAllowed } // MARK: Immutable functions /// Returns a representation of the `CharacterSet` in binary format. public var bitmapRepresentation: Data { return _mapUnmanaged { $0.bitmapRepresentation } } /// Returns an inverted copy of the receiver. public var inverted : CharacterSet { return _mapUnmanaged { $0.inverted } } /// Returns true if the `CharacterSet` has a member in the specified plane. /// /// This method makes it easier to find the plane containing the members of the current character set. The Basic Multilingual Plane (BMP) is plane 0. public func hasMember(inPlane plane: UInt8) -> Bool { return _mapUnmanaged { $0.hasMemberInPlane(plane) } } // MARK: Mutable functions /// Insert a range of integer values in the `CharacterSet`. /// /// It is the caller's responsibility to ensure that the values represent valid `UnicodeScalar` values, if that is what is desired. public mutating func insert(charactersIn range: Range<UnicodeScalar>) { let nsRange = _utfRangeToNSRange(range) _applyUnmanagedMutation { $0.addCharacters(in: nsRange) } } /// Insert a closed range of integer values in the `CharacterSet`. /// /// It is the caller's responsibility to ensure that the values represent valid `UnicodeScalar` values, if that is what is desired. public mutating func insert(charactersIn range: ClosedRange<UnicodeScalar>) { let nsRange = _utfRangeToNSRange(range) _applyUnmanagedMutation { $0.addCharacters(in: nsRange) } } /// Remove a range of integer values from the `CharacterSet`. public mutating func remove(charactersIn range: Range<UnicodeScalar>) { let nsRange = _utfRangeToNSRange(range) _applyUnmanagedMutation { $0.removeCharacters(in: nsRange) } } /// Remove a closed range of integer values from the `CharacterSet`. public mutating func remove(charactersIn range: ClosedRange<UnicodeScalar>) { let nsRange = _utfRangeToNSRange(range) _applyUnmanagedMutation { $0.removeCharacters(in: nsRange) } } /// Insert the values from the specified string into the `CharacterSet`. public mutating func insert(charactersIn string: String) { _applyUnmanagedMutation { $0.addCharacters(in: string) } } /// Remove the values from the specified string from the `CharacterSet`. public mutating func remove(charactersIn string: String) { _applyUnmanagedMutation { $0.removeCharacters(in: string) } } /// Invert the contents of the `CharacterSet`. public mutating func invert() { _applyUnmanagedMutation { $0.invert() } } // ----- // MARK: - // MARK: SetAlgebraType /// Insert a `UnicodeScalar` representation of a character into the `CharacterSet`. /// /// `UnicodeScalar` values are available on `Swift.String.UnicodeScalarView`. @discardableResult public mutating func insert(_ character: UnicodeScalar) -> (inserted: Bool, memberAfterInsert: UnicodeScalar) { let nsRange = NSRange(location: Int(character.value), length: 1) _applyUnmanagedMutation { $0.addCharacters(in: nsRange) } // TODO: This should probably return the truth, but figuring it out requires two calls into NSCharacterSet return (true, character) } /// Insert a `UnicodeScalar` representation of a character into the `CharacterSet`. /// /// `UnicodeScalar` values are available on `Swift.String.UnicodeScalarView`. @discardableResult public mutating func update(with character: UnicodeScalar) -> UnicodeScalar? { let nsRange = NSRange(location: Int(character.value), length: 1) _applyUnmanagedMutation { $0.addCharacters(in: nsRange) } // TODO: This should probably return the truth, but figuring it out requires two calls into NSCharacterSet return character } /// Remove a `UnicodeScalar` representation of a character from the `CharacterSet`. /// /// `UnicodeScalar` values are available on `Swift.String.UnicodeScalarView`. @discardableResult public mutating func remove(_ character: UnicodeScalar) -> UnicodeScalar? { // TODO: Add method to NSCharacterSet to do this in one call let result : UnicodeScalar? = contains(character) ? character : nil let r = NSRange(location: Int(character.value), length: 1) _applyUnmanagedMutation { $0.removeCharacters(in: r) } return result } /// Test for membership of a particular `UnicodeScalar` in the `CharacterSet`. public func contains(_ member: UnicodeScalar) -> Bool { return _mapUnmanaged { $0.longCharacterIsMember(member.value) } } /// Returns a union of the `CharacterSet` with another `CharacterSet`. public func union(_ other: CharacterSet) -> CharacterSet { // The underlying collection does not have a method to return new CharacterSets with changes applied, so we will copy and apply here var result = self result.formUnion(other) return result } /// Sets the value to a union of the `CharacterSet` with another `CharacterSet`. public mutating func formUnion(_ other: CharacterSet) { _applyUnmanagedMutation { $0.formUnion(with: other) } } /// Returns an intersection of the `CharacterSet` with another `CharacterSet`. public func intersection(_ other: CharacterSet) -> CharacterSet { // The underlying collection does not have a method to return new CharacterSets with changes applied, so we will copy and apply here var result = self result.formIntersection(other) return result } /// Sets the value to an intersection of the `CharacterSet` with another `CharacterSet`. public mutating func formIntersection(_ other: CharacterSet) { _applyUnmanagedMutation { $0.formIntersection(with: other) } } /// Returns a `CharacterSet` created by removing elements in `other` from `self`. public func subtracting(_ other: CharacterSet) -> CharacterSet { return intersection(other.inverted) } /// Sets the value to a `CharacterSet` created by removing elements in `other` from `self`. public mutating func subtract(_ other: CharacterSet) { self = subtracting(other) } /// Returns an exclusive or of the `CharacterSet` with another `CharacterSet`. public func symmetricDifference(_ other: CharacterSet) -> CharacterSet { return union(other).subtracting(intersection(other)) } /// Sets the value to an exclusive or of the `CharacterSet` with another `CharacterSet`. public mutating func formSymmetricDifference(_ other: CharacterSet) { self = symmetricDifference(other) } /// Returns true if `self` is a superset of `other`. public func isSuperset(of other: CharacterSet) -> Bool { return _mapUnmanaged { $0.isSuperset(of: other) } } /// Returns true if the two `CharacterSet`s are equal. public static func ==(lhs : CharacterSet, rhs: CharacterSet) -> Bool { return lhs._mapUnmanaged { $0.isEqual(rhs) } } } // MARK: Objective-C Bridging extension CharacterSet : _ObjectiveCBridgeable { public static func _isBridgedToObjectiveC() -> Bool { return true } public static func _getObjectiveCType() -> Any.Type { return NSCharacterSet.self } @_semantics("convertToObjectiveC") public func _bridgeToObjectiveC() -> NSCharacterSet { return _wrapped } public static func _forceBridgeFromObjectiveC(_ input: NSCharacterSet, result: inout CharacterSet?) { result = CharacterSet(_bridged: input) } public static func _conditionallyBridgeFromObjectiveC(_ input: NSCharacterSet, result: inout CharacterSet?) -> Bool { result = CharacterSet(_bridged: input) return true } public static func _unconditionallyBridgeFromObjectiveC(_ source: NSCharacterSet?) -> CharacterSet { return CharacterSet(_bridged: source!) } } extension CharacterSet : Codable { private enum CodingKeys : Int, CodingKey { case bitmap } public init(from decoder: Decoder) throws { let container = try decoder.container(keyedBy: CodingKeys.self) let bitmap = try container.decode(Data.self, forKey: .bitmap) self.init(bitmapRepresentation: bitmap) } public func encode(to encoder: Encoder) throws { var container = encoder.container(keyedBy: CodingKeys.self) try container.encode(self.bitmapRepresentation, forKey: .bitmap) } }
apache-2.0
962790a9205f8cc1eeb71832be5a1464
38.448864
274
0.674588
5.24
false
false
false
false
schibsted/layout
LayoutTests/GeometryExpressionTests.swift
1
10481
// Copyright © 2017 Schibsted. All rights reserved. import XCTest @testable import Layout extension CATransform3D: Equatable { public static func == (lhs: CATransform3D, rhs: CATransform3D) -> Bool { return CATransform3DEqualToTransform(lhs, rhs) } } class GeometryExpressionTests: XCTestCase { // MARK: CGPoint func testGetContentOffset() { let scrollView = UIScrollView() let node = LayoutNode(view: scrollView) XCTAssertEqual(try node.value(forSymbol: "contentOffset") as? CGPoint, scrollView.contentOffset) } func testGetContentOffsetX() { let scrollView = UIScrollView() let node = LayoutNode(view: scrollView) XCTAssertEqual(try node.doubleValue(forSymbol: "contentOffset.x"), Double(scrollView.contentOffset.x)) } func testSetContentOffset() { let offset = CGPoint(x: 5, y: 10) let node = LayoutNode( view: UIScrollView(), state: ["offset": offset], expressions: ["contentOffset": "offset"] ) XCTAssertTrue(node.validate().isEmpty) XCTAssertEqual(try node.value(forSymbol: "offset") as? CGPoint, offset) XCTAssertEqual(try node.value(forSymbol: "contentOffset") as? CGPoint, offset) } func testSetContentOffsetX() { let node = LayoutNode( view: UIScrollView(), expressions: ["contentOffset.x": "5"] ) XCTAssertTrue(node.validate().isEmpty) XCTAssertEqual(try node.doubleValue(forSymbol: "contentOffset.x"), 5) } // MARK: CGSize func testGetContentSize() { let scrollView = UIScrollView() let node = LayoutNode(view: scrollView) XCTAssertEqual(try node.value(forSymbol: "contentSize") as? CGSize, scrollView.contentSize) } func testGetContentSizeWidth() { let scrollView = UIScrollView() let node = LayoutNode(view: scrollView) XCTAssertEqual(try node.doubleValue(forSymbol: "contentSize.width"), Double(scrollView.contentSize.width)) } func testSetContentSize() { let size = CGSize(width: 5, height: 10) let node = LayoutNode( view: UIScrollView(), state: ["size": size], expressions: ["contentSize": "size"] ) XCTAssertTrue(node.validate().isEmpty) XCTAssertEqual(try node.value(forSymbol: "size") as? CGSize, size) XCTAssertEqual(try node.value(forSymbol: "contentSize") as? CGSize, size) } func testSetContentSizeWidth() { let node = LayoutNode( view: UIScrollView(), expressions: ["contentSize.width": "5"] ) XCTAssertTrue(node.validate().isEmpty) XCTAssertEqual(try node.doubleValue(forSymbol: "contentSize.width"), 5) } // MARK: CGRect func testGetContentsCenter() { let view = UIView() view.layer.contentsCenter = CGRect(x: 1, y: 2, width: 5, height: 10) let node = LayoutNode(view: view) XCTAssertEqual(try node.value(forSymbol: "layer.contentsCenter") as? CGRect, view.layer.contentsCenter) } func testGetContentsCenterX() { let view = UIView() view.layer.contentsCenter = CGRect(x: 1, y: 2, width: 5, height: 10) let node = LayoutNode(view: view) XCTAssertEqual(try node.value(forSymbol: "layer.contentsCenter.x") as? CGFloat, view.layer.contentsCenter.origin.x) } func testGetContentsCenterMinX() { let view = UIView() view.layer.contentsCenter = CGRect(x: 1, y: 2, width: 5, height: 10) let node = LayoutNode(view: view) XCTAssertEqual(try node.value(forSymbol: "layer.contentsCenter.minX") as? CGFloat, view.layer.contentsCenter.minX) } func testGetContentsCenterWidth() { let view = UIView() view.layer.contentsCenter = CGRect(x: 1, y: 2, width: 5, height: 10) let node = LayoutNode(view: view) XCTAssertEqual(try node.value(forSymbol: "layer.contentsCenter.width") as? CGFloat, view.layer.contentsCenter.width) } func testGetContentsCenterOrigin() { let view = UIView() view.layer.contentsCenter = CGRect(x: 1, y: 2, width: 5, height: 10) let node = LayoutNode(view: view) XCTAssertEqual(try node.value(forSymbol: "layer.contentsCenter.origin") as? CGPoint, view.layer.contentsCenter.origin) } func testGetContentsCenterOriginX() { let view = UIView() view.layer.contentsCenter = CGRect(x: 1, y: 2, width: 5, height: 10) let node = LayoutNode(view: view) XCTAssertEqual(try node.value(forSymbol: "layer.contentsCenter.origin.x") as? CGFloat, view.layer.contentsCenter.origin.x) } func testGetContentsCenterSize() { let view = UIView() view.layer.contentsCenter = CGRect(x: 1, y: 2, width: 5, height: 10) let node = LayoutNode(view: view) XCTAssertEqual(try node.value(forSymbol: "layer.contentsCenter.size") as? CGSize, view.layer.contentsCenter.size) } func testGetContentsCenterSizeWidth() { let view = UIView() view.layer.contentsCenter = CGRect(x: 1, y: 2, width: 5, height: 10) let node = LayoutNode(view: view) XCTAssertEqual(try node.value(forSymbol: "layer.contentsCenter.size.width") as? CGFloat, view.layer.contentsCenter.width) } func testSetContentsCenter() { let rect = CGRect(x: 1, y: 2, width: 5, height: 10) let node = LayoutNode( view: UIView(), state: ["rect": rect], expressions: ["layer.contentsCenter": "rect"] ) XCTAssertTrue(node.validate().isEmpty) XCTAssertEqual(try node.value(forSymbol: "rect") as? CGRect, rect) XCTAssertEqual(try node.value(forSymbol: "layer.contentsCenter") as? CGRect, rect) } func testSetContentsCenterX() { let value: CGFloat = 5.0 let node = LayoutNode( view: UIView(), expressions: ["layer.contentsCenter.x": "\(value)"] ) XCTAssertTrue(node.validate().isEmpty) XCTAssertEqual(try node.value(forSymbol: "layer.contentsCenter.x") as? CGFloat, value) } func testSetContentsCenterWidth() { let value: CGFloat = 5.0 let node = LayoutNode( view: UIView(), expressions: ["layer.contentsCenter.width": "\(value)"] ) XCTAssertTrue(node.validate().isEmpty) XCTAssertEqual(try node.value(forSymbol: "layer.contentsCenter.width") as? CGFloat, value) } func testSetContentsCenterOrigin() { let origin = CGPoint(x: 1, y: 2) let node = LayoutNode( view: UIView(), state: ["origin": origin], expressions: ["layer.contentsCenter.origin": "origin"] ) XCTAssertTrue(node.validate().isEmpty) XCTAssertEqual(try node.value(forSymbol: "origin") as? CGPoint, origin) XCTAssertEqual(try node.value(forSymbol: "layer.contentsCenter.origin") as? CGPoint, origin) } func testSetContentsCenterOriginX() { let value: CGFloat = 5.0 let node = LayoutNode( view: UIView(), expressions: ["layer.contentsCenter.origin.x": "\(value)"] ) XCTAssertTrue(node.validate().isEmpty) XCTAssertEqual(try node.value(forSymbol: "layer.contentsCenter.origin.x") as? CGFloat, value) } func testSetContentsCenterSize() { let size = CGSize(width: 1, height: 2) let node = LayoutNode( view: UIView(), state: ["size": size], expressions: ["layer.contentsCenter.size": "size"] ) XCTAssertTrue(node.validate().isEmpty) XCTAssertEqual(try node.value(forSymbol: "size") as? CGSize, size) XCTAssertEqual(try node.value(forSymbol: "layer.contentsCenter.size") as? CGSize, size) } func testSetContentsCenterSizeWidth() { let value: CGFloat = 5.0 let node = LayoutNode( view: UIView(), expressions: ["layer.contentsCenter.size.width": "\(value)"] ) XCTAssertTrue(node.validate().isEmpty) XCTAssertEqual(try node.value(forSymbol: "layer.contentsCenter.size.width") as? CGFloat, value) } // MARK: CGAffineTransform func testSetViewTransform() { let transform = CGAffineTransform(rotationAngle: .pi) let node = LayoutNode( state: ["rotation": transform], expressions: ["transform": "rotation"] ) XCTAssertTrue(node.validate().isEmpty) XCTAssertEqual(try node.value(forSymbol: "rotation") as? CGAffineTransform, transform) XCTAssertEqual(try node.value(forSymbol: "transform") as? CGAffineTransform, transform) } func testSetViewTransformRotation() { let node = LayoutNode( expressions: ["transform.rotation": "pi"] ) XCTAssertTrue(node.validate().isEmpty) XCTAssertEqual(try node.value(forSymbol: "transform.rotation") as? CGFloat, .pi) } func testSetViewTransformTranslation() { let node = LayoutNode( expressions: ["transform.translation.x": "5"] ) XCTAssertTrue(node.validate().isEmpty) XCTAssertEqual(try node.value(forSymbol: "transform.translation.x") as? CGFloat, 5) } // MARK: CATransform3D func testSetLayerTransform() { let transform = CATransform3DMakeRotation(.pi, 0, 0, 1) let node = LayoutNode( state: ["rotation": transform], expressions: ["layer.transform": "rotation"] ) XCTAssertTrue(node.validate().isEmpty) XCTAssertEqual(try node.value(forSymbol: "rotation") as? CATransform3D, transform) XCTAssertEqual(try node.value(forSymbol: "layer.transform") as? CATransform3D, transform) } func testSetLayerTransformRotation() { let node = LayoutNode( expressions: ["layer.transform.rotation": "pi"] ) XCTAssertTrue(node.validate().isEmpty) XCTAssertEqual(try node.value(forSymbol: "layer.transform.rotation") as? CGFloat, .pi) } func testSetSublayerTransformRotation() { let node = LayoutNode( expressions: ["layer.sublayerTransform.rotation": "pi"] ) XCTAssertTrue(node.validate().isEmpty) XCTAssertEqual(try node.value(forSymbol: "layer.sublayerTransform.rotation") as? CGFloat, .pi) } }
mit
fa654d80b2aae90a313426699944c1f8
37.248175
130
0.632729
4.403361
false
true
false
false
naoyashiga/UmartNews
BlogReader/URL.swift
1
1037
// // URL.swift // BlogReader // // Created by naoyashiga on 2015/04/01. // Copyright (c) 2015年 naoyashiga. All rights reserved. // import UIKit //let api = "https://keiba-news-api.herokuapp.com/" enum URL:String{ case MATOME = "https://keiba-news-api.herokuapp.com/matome" case PREDICT = "https://keiba-news-api.herokuapp.com/predict" case SPONAVI = "http://m.sports.yahoo.co.jp/keiba/schedule/list/" case MOVIE = "https://www.google.co.jp/search?hl=ja&q=%E7%AB%B6%E9%A6%AC&lr=lang_ja&gws_rd=ssl#q=%E7%AB%B6%E9%A6%AC&lr=lang_ja&hl=ja&tbs=lr:lang_1ja,qdr:d,srcf:H4sIAAAAAAAAANOuzC8tKU1K1UvOz1XLy0zOL8tMSc3XyypQy03MBPIzMkHsosTs0pLUPKAiEM8kPTE3tUgvL7VELSUxM6cSKgwAr8rCCEsAAAA&tbm=vid" case REALTIME = "http://realtime.search.yahoo.co.jp/search?fr=sfp_as&p=%E7%AB%B6%E9%A6%AC&ei=UTF-8&rkf=1" case NEWS = "https://www.google.co.jp/search?q=%E7%AB%B6%E9%A6%AC&lr=lang_ja&hl=ja&gl=jp&authuser=0&tbas=0&tbs=lr:lang_1ja,qdr:d&tbm=nws&source=lnt&sa=X&ei=LvAXVZ-NHYWomgXDroHYCw&ved=0CBMQpwU&biw=320&bih=568&dpr=2" }
mit
5484f9b2d9cb32f7d53d756e919f699e
53.526316
284
0.724638
2.037402
false
false
false
false
hughbe/phone-number-picker
src/Controller/PhoneNumberViewController.swift
1
5960
// // PhoneNumberViewController.swift // PhoneNumberPicker // // Created by Hugh Bellamy on 06/09/2015. // Copyright (c) 2015 Hugh Bellamy. All rights reserved. // import UIKit public protocol PhoneNumberViewControllerDelegate { func phoneNumberViewController(phoneNumberViewController: PhoneNumberViewController, didEnterPhoneNumber phoneNumber: String) func phoneNumberViewControllerDidCancel(phoneNumberViewController: PhoneNumberViewController) } public final class PhoneNumberViewController: UIViewController, CountriesViewControllerDelegate { public class func standardController() -> PhoneNumberViewController { return UIStoryboard(name: "PhoneNumberPicker", bundle: nil).instantiateViewController(withIdentifier: "PhoneNumber") as! PhoneNumberViewController } @IBOutlet weak public var countryButton: UIButton! @IBOutlet weak public var countryTextField: UITextField! @IBOutlet weak public var phoneNumberTextField: UITextField! @IBOutlet public var cancelBarButtonItem: UIBarButtonItem! @IBOutlet public var doneBarButtonItem: UIBarButtonItem! public var cancelBarButtonItemHidden = false { didSet { setupCancelButton() } } public var doneBarButtonItemHidden = false { didSet { setupDoneButton() } } private func setupCancelButton() { if let cancelBarButtonItem = cancelBarButtonItem { navigationItem.leftBarButtonItem = cancelBarButtonItemHidden ? nil: cancelBarButtonItem } } private func setupDoneButton() { if let doneBarButtonItem = doneBarButtonItem { navigationItem.rightBarButtonItem = doneBarButtonItemHidden ? nil: doneBarButtonItem } } @IBOutlet weak public var backgroundTapGestureRecognizer: UITapGestureRecognizer! public var delegate: PhoneNumberViewControllerDelegate? public var phoneNumber: String? { if let countryText = countryTextField.text, let phoneNumberText = phoneNumberTextField.text, !countryText.isEmpty && !phoneNumberText.isEmpty { return countryText + phoneNumberText } return nil } public var country = Country.currentCountry //MARK: Lifecycle override public func viewDidLoad() { super.viewDidLoad() setupCancelButton() setupDoneButton() updateCountry() phoneNumberTextField.becomeFirstResponder() } @IBAction private func changeCountry(sender: UIButton) { let countriesViewController = CountriesViewController.standardController() countriesViewController.delegate = self countriesViewController.cancelBarButtonItemHidden = true countriesViewController.selectedCountry = country countriesViewController.majorCountryLocaleIdentifiers = ["GB", "US", "IT", "DE", "RU", "BR", "IN"] navigationController?.pushViewController(countriesViewController, animated: true) } public func countriesViewControllerDidCancel(countriesViewController: CountriesViewController) { } public func countriesViewController(countriesViewController: CountriesViewController, didSelectCountry country: Country) { navigationController?.popViewController(animated: true) self.country = country updateCountry() } @IBAction private func textFieldDidChangeText(sender: UITextField) { if let countryText = sender.text, sender == countryTextField { country = Countries.countryFromPhoneExtension(phoneExtension: countryText) } updateTitle() } private func updateCountry() { countryTextField.text = country.phoneExtension updateCountryTextField() updateTitle() } private func updateTitle() { updateCountryTextField() if countryTextField.text == "+" { countryButton.setTitle("Select From List", for: []) } else { countryButton.setTitle(country.name, for: []) } var title = "Your Phone Number" if let newTitle = phoneNumber { title = newTitle } navigationItem.title = title validate() } private func updateCountryTextField() { if countryTextField.text == "+" { countryTextField.text = "" } else if let countryText = countryTextField.text, !countryText.hasPrefix("+") && !countryText.isEmpty { countryTextField.text = "+" + countryText } } @IBAction private func done(sender: UIBarButtonItem) { if !countryIsValid || !phoneNumberIsValid { return } if let phoneNumber = phoneNumber { delegate?.phoneNumberViewController(phoneNumberViewController: self, didEnterPhoneNumber: phoneNumber) } } @IBAction private func cancel(sender: UIBarButtonItem) { delegate?.phoneNumberViewControllerDidCancel(phoneNumberViewController: self) } @IBAction private func tappedBackground(sender: UITapGestureRecognizer) { view.endEditing(true) } //MARK: Validation public var countryIsValid: Bool { if let countryCodeLength = countryTextField.text?.length { return country != Country.emptyCountry && countryCodeLength > 1 && countryCodeLength < 5 } return false } public var phoneNumberIsValid: Bool { if let phoneNumberLength = phoneNumberTextField.text?.length { return phoneNumberLength > 5 && phoneNumberLength < 15 } return false } private func validate() { let validCountry = countryIsValid let validPhoneNumber = phoneNumberIsValid doneBarButtonItem.isEnabled = validCountry && validPhoneNumber } } private extension String { var length: Int { return utf16.count } }
mit
5a680f98ad6c4044f02a94899742040a
33.853801
154
0.678859
5.883514
false
false
false
false
tmandry/Swindler
Sources/Successes+PromiseKit.swift
1
1152
// Based on Any+PromiseKit.swift, // Created by Daniel Tartaglia on 11/4/15. // Copyright © 2015. MIT License. import PromiseKit /** Waits on all provided promises, then resolves to the result of the successful ones. - Param onError: A callback that is called each time any promise fails, with the index of the promise and the error. - Returns: A new promise that resolves once all the provided promises resolve, containing an array of the results from the successful promises. */ func successes<T>(_ promises: [Promise<T>], onError: @escaping (Int, Error) -> Void) -> Promise<[T]> { guard !promises.isEmpty else { return .value([]) } return Promise<[T]> { seal in var values = [T]() var countdown = promises.count for (index, promise) in promises.enumerated() { promise.done { value in values.append(value) }.ensure { countdown -= 1 if countdown == 0 { seal.fulfill(values) } }.catch { error in onError(index, error) } } } }
mit
b7e58716ddaf0031affafb663f5b00f2
34.96875
98
0.582103
4.513725
false
false
false
false
KoCMoHaBTa/MHAppKit
MHAppKit/ViewControllers/CollectionViewController.swift
1
9286
// // CollectionViewController.swift // MHAppKit // // Created by Milen Halachev on 3/21/15. // Copyright (c) 2015 Milen Halachev. All rights reserved. // #if canImport(UIKit) && !os(watchOS) import UIKit open class CollectionViewController: UICollectionViewController, UICollectionViewDelegateFlowLayout { open var prefersStatusBarHiddenValue: Bool? open override func viewDidLoad() { super.viewDidLoad() #if !os(tvOS) if self.enableRefreshing() { let refreshControl = UIRefreshControl() self.collectionView?.addSubview(refreshControl) self.collectionView?.alwaysBounceVertical = true refreshControl.addTarget(self, action: #selector(CollectionViewController.refreshControlAction(_:)), for: .valueChanged) self.refreshControl = refreshControl } #endif } open override func viewDidAppear(_ animated: Bool) { super.viewDidAppear(animated) self.collectionViewFlowLayout?.invalidateLayout() } open override func viewWillTransition(to size: CGSize, with coordinator: UIViewControllerTransitionCoordinator) { super.viewWillTransition(to: size, with: coordinator) coordinator.animate(alongsideTransition: { (ctx) -> Void in self.collectionViewFlowLayout?.invalidateLayout() }) { (ctx) -> Void in } } #if !os(tvOS) open override var prefersStatusBarHidden : Bool { return self.prefersStatusBarHiddenValue ?? super.prefersStatusBarHidden } #endif open var collectionViewFlowLayout: UICollectionViewFlowLayout? { return self.collectionViewLayout as? UICollectionViewFlowLayout } // MARK: - UICollectionViewDataSource & UICollectionViewDelegate open override func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { var cell = self.collectionView(collectionView, loadCellForItemAtIndexPath: indexPath) cell.contentView.frame = cell.bounds cell = self.collectionView(collectionView, configureCell: cell, forItemAtIndexPath: indexPath) return cell } //MARK: - Custom UICollectionViewDataSource & UICollectionViewDelegate open func collectionView(_ collectionView: UICollectionView, loadCellForItemAtIndexPath indexPath: IndexPath) -> UICollectionViewCell { let cellID = "CellID" let cell = collectionView.dequeueReusableCell(withReuseIdentifier: cellID, for: indexPath) return cell } open func collectionView(_ collectionView: UICollectionView, configureCell cell: UICollectionViewCell, forItemAtIndexPath indexPath: IndexPath) -> UICollectionViewCell { return cell } //square open func numberOfItems() -> UInt { return 0 } open func numberOfRows() -> UInt { return 0 } open func numberOfColumns() -> UInt { return 0 } //Indicate wherever to make items with equal width and height. Called when only either numberOfRows or numberOfColumns is specified. Defaults to YES open func shouldMakeSquareItems() -> Bool { return true } //MARK: - UICollectionViewDelegateFlowLayout open func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize { let containerSize = collectionView.bounds.size; // containerSize = [self getRotatedViewSize:collectionView]; if let layout = collectionViewLayout as? UICollectionViewFlowLayout { let CalculateLength = { (elementsCount: UInt, maxLength: CGFloat, padding: CGFloat) -> CGFloat in var length = maxLength length -= (padding * CGFloat(elementsCount - 1)) length /= CGFloat(elementsCount) return length } let padding = layout.minimumInteritemSpacing //equal square items let numberOfItems = self.numberOfItems() if numberOfItems > 0 { //calculate max length based on the layout var maxLength: CGFloat = 0 switch layout.scrollDirection { case .horizontal: maxLength = containerSize.height case .vertical: maxLength = containerSize.width @unknown default: maxLength = 0 } if (maxLength > 0) { let length = CalculateLength(numberOfItems, maxLength, padding) let size = CGSize(width: length, height: length) // NSLog(@"Size: %@; View: %@", NSStringFromCGSize(size), NSStringFromCGRect(collectionView.bounds)); return size } } //rectangle items var width: CGFloat = 0 var height: CGFloat = 0 let numberOfColumns = self.numberOfColumns() if numberOfColumns > 0 { let maxLength = containerSize.width let length = CalculateLength(numberOfColumns, maxLength, padding) width = length } let numberOfRows = self.numberOfRows() if numberOfRows > 0 { let maxLength = containerSize.height let length = CalculateLength(numberOfRows, maxLength, padding) height = length } //check if souhld make square items if width != 0 && height == 0 && self.shouldMakeSquareItems() { height = width } if width == 0 && height != 0 && self.shouldMakeSquareItems() { width = height } //check and set default values if width == 0 { width = layout.itemSize.width } if height == 0 { height = layout.itemSize.height } let size = CGSize(width: width, height: height) // NSLog(@"Size: %@; View: %@", NSStringFromCGSize(size), NSStringFromCGRect(collectionView.bounds)); return size } let size = CGSize(width: 10, height: 10) // NSLog(@"Size: %@; View: %@", NSStringFromCGSize(size), NSStringFromCGRect(collectionView.bounds)); return size } //MARK: - UIRefreshControl @available(tvOS, unavailable) @IBOutlet open var refreshControl: UIRefreshControl? //false by default @available(tvOS, unavailable) open func enableRefreshing() -> Bool { return false } //used by performRefresh @available(tvOS, unavailable) open func shouldRefresh() -> Bool { return false } @available(tvOS, unavailable) open func beginRefresh() { self.refreshControl?.beginRefreshing() // self.searchDisplayController?.searchBar.userInteractionEnabled = false } @available(tvOS, unavailable) open func endRefresh() { self.refreshControl?.endRefreshing() // self.searchDisplayController?.searchBar.userInteractionEnabled = true } //calls beginRefresh -> refreshControlActionWithCompletionBlock -> endRefresh @available(tvOS, unavailable) @IBAction open func refreshControlAction(_ sender: Any?) { self.beginRefresh() self.refreshControlActionWithCompletionBlock { [weak self] () -> Void in self?.endRefresh() } } //its bets to override this method and perform refresh process in it. Call completion block when done. @available(tvOS, unavailable) open func refreshControlActionWithCompletionBlock(_ completionBlock: @escaping () -> Void) { DispatchQueue.main.asyncAfter(deadline: DispatchTime.now() + Double((Int64)(1 * NSEC_PER_SEC)) / Double(NSEC_PER_SEC), execute: completionBlock) } //programatic refresh - shouldRefresh -> content inset (animated) -> refreshControlAction @available(tvOS, unavailable) open func performRefresh(_ animated: Bool = true) { if self.shouldRefresh() && self.refreshControl != nil { self.collectionView?.setContentOffset(CGPoint(x: 0, y: -self.refreshControl!.frame.size.height*2), animated: animated) self.refreshControl?.sendActions(for: UIControl.Event.valueChanged) } } } #endif
mit
69adae0d985a7ba687f48a6d5313356d
32.046263
173
0.577536
6.153744
false
false
false
false
invalidstream/radioonthetv
RadioOnTheTV/RadioOnTheTV/DetailViewController.swift
1
3008
// // DetailViewController.swift // RadioOnTheTV // // Created by Chris Adamson on 3/13/16. // Copyright © 2016 Subsequently & Furthermore, Inc. All rights reserved. // import UIKit class DetailViewController: UIViewController, WebRadioPlayerDelegate { @IBOutlet weak var stationNameLabel: UILabel! @IBOutlet weak var addressLabel: UILabel! @IBOutlet weak var playPauseButton: UIButton! private var player : WebRadioPlayer? var station : StationInfo? { didSet { if let station = station { // start playing this station player?.pause() player = WebRadioPlayer(stationURL: station.streamURL) player?.delegate = self stationNameLabel.text = station.name addressLabel.text = station.streamURL.description playPauseButton.enabled = true } else { playPauseButton.enabled = false } } } override weak var preferredFocusedView: UIView? { return playPauseButton.enabled ? playPauseButton : nil } override func viewDidLoad() { super.viewDidLoad() playPauseButton.enabled = false // Do any additional setup after loading the view. } func webRadioPlayerStateChanged(player: WebRadioPlayer) { NSLog ("state change: \(player.playerInfo.state)") updateButton() } private func updateButton() { let controlStates : [UIControlState] = [.Normal, .Selected, .Focused, .Highlighted, .Disabled] switch player?.playerInfo.state { case .None: playPauseButton.enabled = false case .Some(.Initialized), .Some(.Paused): playPauseButton.enabled = true setTitleForButton(playPauseButton, text: "Play", forControlStates: controlStates) case .Some(.Starting): playPauseButton.enabled = false setTitleForButton(playPauseButton, text: "Starting", forControlStates: controlStates) case .Some(.Playing): playPauseButton.enabled = true setTitleForButton(playPauseButton, text: "Pause", forControlStates: controlStates) case .Some(.Error): playPauseButton.enabled = false setTitleForButton(playPauseButton, text: "Error", forControlStates: controlStates) } updateFocusIfNeeded() } private func setTitleForButton(button: UIButton, text: String, forControlStates controlStates: [UIControlState]) { for controlState in controlStates { button.setTitle(text, forState: controlState) } } @IBAction func playPauseTriggered(sender: AnyObject) { switch player?.playerInfo.state { case .Some(.Initialized): player?.start() case .Some(.Paused): player?.resume() case .Some(.Playing): player?.pause() default: break } } }
cc0-1.0
00c72a2e7ba41979ef6d9b2179eb4097
32.786517
118
0.620219
5.166667
false
false
false
false
joerocca/GitHawk
Classes/Issues/IssueCommentModelHandling.swift
1
3480
// // IssueCommentModelHandling.swift // Freetime // // Created by Ryan Nystrom on 7/5/17. // Copyright © 2017 Ryan Nystrom. All rights reserved. // import UIKit func BodyHeightForComment( viewModel: Any, width: CGFloat, webviewCache: WebviewCellHeightCache?, imageCache: ImageCellHeightCache? ) -> CGFloat { if let viewModel = viewModel as? NSAttributedStringSizing { return viewModel.textViewSize(width).height } else if let viewModel = viewModel as? IssueCommentCodeBlockModel { let inset = IssueCommentCodeBlockCell.scrollViewInset return viewModel.contentSize.height + inset.top + inset.bottom } else if let viewModel = viewModel as? IssueCommentImageModel { return imageCache?.height(model: viewModel, width: width) ?? 200 } else if let viewModel = viewModel as? IssueCommentQuoteModel { return viewModel.quote.textViewSize(width).height } else if viewModel is IssueCommentHrModel { return 3.0 + IssueCommentHrCell.inset.top + IssueCommentHrCell.inset.bottom } else if let cache = webviewCache, let viewModel = viewModel as? IssueCommentHtmlModel { return cache.height(model: viewModel, width: width) } else if let viewModel = viewModel as? IssueCommentTableModel { let inset = IssueCommentTableCell.inset return viewModel.rowHeights.reduce(0) { $0 + $1 } + inset.top + inset.bottom } else { return Styles.Sizes.tableCellHeight } } func CellTypeForComment(viewModel: Any) -> AnyClass { switch viewModel { case is IssueCommentImageModel: return IssueCommentImageCell.self case is IssueCommentCodeBlockModel: return IssueCommentCodeBlockCell.self case is IssueCommentSummaryModel: return IssueCommentSummaryCell.self case is IssueCommentQuoteModel: return IssueCommentQuoteCell.self case is IssueCommentUnsupportedModel: return IssueCommentUnsupportedCell.self case is IssueCommentHtmlModel: return IssueCommentHtmlCell.self case is IssueCommentHrModel: return IssueCommentHrCell.self case is NSAttributedStringSizing: return IssueCommentTextCell.self case is IssueCommentTableModel: return IssueCommentTableCell.self default: fatalError("Unhandled model: \(viewModel)") } } func ExtraCommentCellConfigure( cell: UICollectionViewCell, imageDelegate: IssueCommentImageCellDelegate?, htmlDelegate: IssueCommentHtmlCellDelegate?, htmlNavigationDelegate: IssueCommentHtmlCellNavigationDelegate?, htmlImageDelegate: IssueCommentHtmlCellImageDelegate?, attributedDelegate: AttributedStringViewDelegate?, issueAttributedDelegate: AttributedStringViewIssueDelegate?, imageHeightDelegate: IssueCommentImageHeightCellDelegate ) { if let cell = cell as? IssueCommentImageCell { cell.delegate = imageDelegate cell.heightDelegate = imageHeightDelegate } else if let cell = cell as? IssueCommentHtmlCell { cell.delegate = htmlDelegate cell.navigationDelegate = htmlNavigationDelegate cell.imageDelegate = htmlImageDelegate } else if let cell = cell as? IssueCommentTextCell { cell.textView.delegate = attributedDelegate cell.textView.issueDelegate = issueAttributedDelegate } else if let cell = cell as? IssueCommentQuoteCell { cell.textView.delegate = attributedDelegate } else if let cell = cell as? IssueCommentTableCell { cell.delegate = attributedDelegate } }
mit
46ed623583bcb677d6050dd6e9ed5c29
43.602564
93
0.75079
5.071429
false
false
false
false
cuappdev/podcast-ios
old/Podcast/Date+.swift
1
2061
// // Util.swift // Podcast // // Created by Natasha Armbrust on 3/7/17. // Copyright © 2017 Cornell App Development. All rights reserved. // import UIKit extension Date { //format date interval between fromDate to toDate by greatest component between // i.e. if fromDate: March 7, 1989 toDate: March 8, 1989 // formatDateDifferenceByLargestComponent(fromDate, toDate) -> "1 day ago" // if fromDate: March 9, 2015 toDate: March 8, 2017 // formatDateDifferenceByLargestComponent(fromDate, toDate) -> "2 years ago" static func formatDateDifferenceByLargestComponent(fromDate: Date, toDate: Date) -> String { let secondsBetween = Int(toDate.timeIntervalSince(fromDate)) let hoursBetween = secondsBetween/3600 let daysBetween = hoursBetween/24 let weeksBetween = daysBetween/7 let monthsBetween = daysBetween/31 let yearsBetween = daysBetween/365 if yearsBetween > 0 { if yearsBetween < 2 { return String(yearsBetween) + " year ago" } return String(yearsBetween) + " years ago" } if monthsBetween > 0 { if monthsBetween < 2 { return String(monthsBetween) + " month ago" } return String(monthsBetween) + " months ago" } if weeksBetween > 0 { if weeksBetween < 2 { return String(weeksBetween) + " week ago" } return String(weeksBetween) + " weeks ago" } if daysBetween > 0 { if daysBetween < 2 { return String(daysBetween) + " day ago" } return String(daysBetween) + " days ago" } if hoursBetween > 0 { if hoursBetween < 2 { return String(hoursBetween) + " hour ago" } return String(hoursBetween) + " hours ago" } return "less than an hour ago" } }
mit
5263b188a8136293c738ab90c0bfc848
31.1875
96
0.554854
4.650113
false
false
false
false
nodes-vapor/admin-panel-provider
Sources/AdminPanelProvider/Tags/Leaf/DateGroup.swift
1
2912
import Leaf import Vapor public final class DateGroup: BasicTag { public init() {} public let name = "form:dategroup" public func run(arguments: ArgumentList) throws -> Node? { guard arguments.count >= 2, case .variable(let fieldsetPathNodes, value: let fieldset) = arguments.list[0], let fieldsetPath = fieldsetPathNodes.last else { throw Abort(.internalServerError, reason: "DateGroup parse error, expecting: #form:dategroup(\"fieldset.name\", \"default\", \"dateFormat\", \"startDate\", \"attributes\")") } // Retrieve input value, value from fieldset else passed default value let inputValue = fieldset?["value"]?.string ?? arguments[1]?.string ?? "" let label = fieldset?["label"]?.string let errors = fieldset?["errors"]?.array let hasErrors = !(errors?.isEmpty ?? true) let dateformat = arguments[2]?.string ?? "dd/mm/yyyy" let startDate = arguments[3]?.string ?? "" let attributesHTML: String if let attributesNode = arguments[4] { let attributes: [String] if let attrArray = attributesNode.array { attributes = attrArray.flatMap { $0.string } } else if let attrStr = attributesNode.string { attributes = attrStr.components(separatedBy: ",") } else { throw Abort(.internalServerError, reason: "DateGroup parse error, expecting: an array or comma separated list of custom attributes") } attributesHTML = attributes.joined(separator: ", ") } else { attributesHTML = "" } var template: [String] = [ "<div class=\"form-group action-wrapper\(hasErrors ? " has-error" : "")\">", "<div class=\"input-group date\" data-provide=\"datepicker\" data-date-format=\"\(dateformat)\" data-date-start-date=\"\(startDate)\">", "<input type=\"text\" class=\"form-control\" id='\(fieldsetPath)' name=\"\(fieldsetPath)\" value=\"\(inputValue)\" \(attributesHTML)>", "<div class=\"input-group-addon\">", "<span class=\"glyphicon glyphicon-th\"></span>", "</div></div>" ] // If Fieldset has errors then loop through them and add help-blocks if let errors = errors { for e in errors { guard let errorString = e.string else { continue } template.append("<span class='help-block'>\(errorString)</span>") } } template.append("</div>") if let label = label { template.insert("<label class=\"control-label\" for=\"\(fieldsetPath)\">\(label)</label>", at: 1) } return .bytes(template.joined(separator: "\n").bytes) } }
mit
c972455282294ab622ccae83db015c64
38.351351
185
0.558036
4.689211
false
false
false
false
qualaroo/QualarooSDKiOS
Qualaroo/Survey/Body/Question/List/AnswerListResponseBuilder.swift
1
1154
// // AnswerListResponseBuilder.swift // Qualaroo // // Copyright (c) 2018, Qualaroo, Inc. All Rights Reserved. // // Please refer to the LICENSE.md file for the terms and conditions // under which redistribution and use of this file is permitted. // import Foundation typealias ListSelection = (index: Int, text: String?) class AnswerListResponseBuilder: AbstractAnswerResponseBuilder { func response(idsAndTexts: [(Int, String?)]) -> NodeResponse? { let answers = idsAndTexts.map { answer($0) } if answers.contains(where: { $0 == nil }) { return nil } let model = QuestionResponse(id: question.questionId, alias: question.alias, answerList: answers.removeNils()) return NodeResponse.question(model) } private func answer(_ selection: ListSelection) -> AnswerResponse? { guard let answerIndex = answerId(forIndex: selection.index) else { return nil } let alias = answerAlias(forIndex: selection.index) return AnswerResponse(id: answerIndex, alias: alias, text: selection.text) } }
mit
b27cc31461208af35b98453000d7a6e9
33.969697
83
0.645581
4.30597
false
false
false
false
PointerFLY/ReaLog
Example/Example/AppDelegate.swift
1
3578
// // AppDelegate.swift // Example // // Created by PointerFLY on 07/02/2017. // Copyright © 2017 PointerFLY. All rights reserved. // import UIKit import ReaLog @UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { ReaLog.shared.enable() ReaLog.shared.addLog("Application finished launching") ReaLog.shared.dateFormatter.dateFormat = "HH:mm:ss" ReaLog.shared.window?.floatingBallFrame = CGRect(x: 20, y: 300, width: 60, height: 60) ReaLog.shared.window?.logViewFrame = CGRect(x: 100, y: 100, width: 10, height: 10) let previousDate = Date(); for _ in 0..<100 { let text = "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 interruptions (such as an incoming phone call or SMS message) or when tinterruptions (such as an incoming phone call or SMS" + "message) or when t. interruptions (such as an incoming phone call or SMS message) or when it is feasible." ReaLog.shared.addLog(text) } let newDate = Date(); print(newDate.timeIntervalSince(previousDate)) return true } func applicationWillResignActive(_ application: UIApplication) { // 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. // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. ReaLog.shared.addLog("Application will resign active") } func applicationDidEnterBackground(_ application: UIApplication) { // 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. // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. ReaLog.shared.addLog("Application did enter backgroud") } func applicationWillEnterForeground(_ application: UIApplication) { // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background. ReaLog.shared.addLog("Application will enter foreground") } func applicationDidBecomeActive(_ application: UIApplication) { // 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. ReaLog.shared.addLog("Application did become active") } func applicationWillTerminate(_ application: UIApplication) { // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. ReaLog.shared.addLog("Application will terminate") } }
mit
0e0588a6a5f4415de53d640abfa9fdf0
48
285
0.717361
4.954294
false
false
false
false
FsThatOne/FSTableCellFollowUp
FSTableCellFollowUp/FSTableCellFollowUp/ViewController.swift
1
2256
// // ViewController.swift // FSTableCellFollowUp // // Created by FS小一 on 15/7/20. // Copyright © 2015年 FSxiaoyi. All rights reserved. // import UIKit class ViewController: UITableViewController { // // let myView = UIView() var lastCell: Int = 0 var isAppear: Bool? override func viewDidLoad() { super.viewDidLoad() tableView.registerClass(UITableViewCell.self, forCellReuseIdentifier: "cell") tableView.rowHeight = 100 // view.frame = CGRect(x: 0, y: 667-120, width: 375, height: 120) // myView.backgroundColor = UIColor.greenColor() // let win = UIApplication.sharedApplication().keyWindow // win?.addSubview(myView) } override func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int { return 20 } override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell { let cell: UITableViewCell = tableView.dequeueReusableCellWithIdentifier("cell")! // if cell == nil { // cell = UITableViewCell() // tableView.registerClass(UITableViewCell.self, forCellReuseIdentifier: "cell") // } cell.textLabel!.text = NSString(string: "\(indexPath.row)") as String cell.backgroundColor = UIColor.greenColor() return cell } override func viewDidAppear(animated: Bool) { isAppear = true } override func tableView(tableView: UITableView, willDisplayCell cell: UITableViewCell, forRowAtIndexPath indexPath: NSIndexPath) { if (indexPath.row > lastCell) && isAppear == true { let rotation = CATransform3DMakeTranslation(0, 70, 0) cell.layer.shadowColor = UIColor.blackColor().CGColor cell.layer.shadowOffset = CGSize(width: 10, height: 10) cell.alpha = 0 cell.layer.transform = rotation UIView.animateWithDuration(1.5, animations: { () -> Void in cell.layer.transform = CATransform3DIdentity cell.alpha = 1 cell.layer.shadowOffset = CGSizeZero }) } lastCell = indexPath.row } }
mit
30564395eb96e3f84c55b9efd886abd2
31.594203
134
0.625167
4.88913
false
false
false
false
inket/stts
stts/ServiceTableView/ServiceTableRowView.swift
1
946
// // ServiceTableRowView.swift // stts // import Cocoa class ServiceTableRowView: NSTableRowView { var showSeparator = true var gradient: CAGradientLayer? override func layout() { super.layout() let width = frame.size.width let height = frame.size.height let gradient = self.gradient ?? CAGradientLayer() gradient.isHidden = !showSeparator self.wantsLayer = true self.layer?.insertSublayer(gradient, at: 0) self.gradient = gradient let separatorColor = NSColor.quaternaryLabelColor.cgColor gradient.colors = [NSColor.clear.cgColor, separatorColor, separatorColor, separatorColor, NSColor.clear.cgColor] gradient.locations = [0, 0.3, 0.5, 0.70, 1] gradient.startPoint = CGPoint(x: 0, y: 0.5) gradient.endPoint = CGPoint(x: 1, y: 0.5) gradient.frame = CGRect(x: 0, y: height - 1, width: width, height: 1) } }
mit
08a24c189d3cb4613734d5059637551d
27.666667
120
0.646934
4.131004
false
false
false
false
ioscolombia/Swift-Meetup
Playgrouds/playBucle.playground/section-1.swift
1
664
// Playground - noun: a place where people can play import UIKit var control:Int = 1 for (control; control<5; control++) { println("\(control)") } //flujos de control for in nos permite interactuar con las colecciones var nombres:[String] = ["Cesar", "Andres", "Pedro"] for nombre in nombres{ println("Hola, me llamo \(nombre)") } //----While var control2:Int = 1 while (control2 <= 10) { println("Se repite \(control2) veces") control2++; } //Do While------ //ha de hacer algo mientras se da una condicion var control3:Int = 1 do { println("se repite \(control3) veces") control3++ } while (control3 <= 10);
cc0-1.0
56d85a44e3a669531f886121f816453b
13.12766
70
0.628012
3.088372
false
false
false
false
khoren93/SwiftHub
SwiftHub/Models/Content.swift
1
1668
// // Content.swift // SwiftHub // // Created by Sygnoos9 on 11/6/18. // Copyright © 2018 Khoren Markosyan. All rights reserved. // // Model file Generated using JSONExport: https://github.com/Ahmed-Ali/JSONExport import Foundation import ObjectMapper enum ContentType: String { case file = "file" case dir = "dir" case symlink = "symlink" case submodule = "submodule" case unknown = "" } extension ContentType: Comparable { func priority() -> Int { switch self { case .file: return 0 case .dir: return 1 case .symlink: return 2 case .submodule: return 3 case .unknown: return 4 } } static func < (lhs: ContentType, rhs: ContentType) -> Bool { return lhs.priority() < rhs.priority() } } struct Content: Mappable { var content: String? var downloadUrl: String? var encoding: String? var gitUrl: String? var htmlUrl: String? var name: String? var path: String? var sha: String? var size: Int? var type: ContentType = .unknown var url: String? var target: String? var submoduleGitUrl: String? init?(map: Map) {} init() {} mutating func mapping(map: Map) { content <- map["content"] downloadUrl <- map["download_url"] encoding <- map["encoding"] gitUrl <- map["git_url"] htmlUrl <- map["html_url"] name <- map["name"] path <- map["path"] sha <- map["sha"] size <- map["size"] type <- map["type"] url <- map["url"] target <- map["target"] submoduleGitUrl <- map["submodule_git_url"] } }
mit
4709adb7a1b009fa73ada58ca3307fba
22.478873
82
0.577684
3.922353
false
false
false
false
narner/AudioKit
Playgrounds/AudioKitPlaygrounds/Playgrounds/Effects.playground/Pages/Reverb.xcplaygroundpage/Contents.swift
1
2380
//: ## Simple Reverb //: This is an implementation of Apple's simplest reverb which only allows you to set presets import AudioKitPlaygrounds import AudioKit let file = try AKAudioFile(readFileName: playgroundAudioFiles[0]) let player = try AKAudioPlayer(file: file) player.looping = true var reverb = AKReverb(player) reverb.dryWetMix = 0.5 AudioKit.output = reverb AudioKit.start() player.play() //: User Interface Set up import AudioKitUI class LiveView: AKLiveViewController { override func viewDidLoad() { addTitle("Reverb") addView(AKResourcesAudioFileLoaderView(player: player, filenames: playgroundAudioFiles)) addView(AKSlider(property: "Mix", value: reverb.dryWetMix) { sliderValue in reverb.dryWetMix = sliderValue }) let presets = ["Cathedral", "Large Hall", "Large Hall 2", "Large Room", "Large Room 2", "Medium Chamber", "Medium Hall", "Medium Hall 2", "Medium Hall 3", "Medium Room", "Plate", "Small Room"] addView(AKPresetLoaderView(presets: presets) { preset in switch preset { case "Cathedral": reverb.loadFactoryPreset(.cathedral) case "Large Hall": reverb.loadFactoryPreset(.largeHall) case "Large Hall 2": reverb.loadFactoryPreset(.largeHall2) case "Large Room": reverb.loadFactoryPreset(.largeRoom) case "Large Room 2": reverb.loadFactoryPreset(.largeRoom2) case "Medium Chamber": reverb.loadFactoryPreset(.mediumChamber) case "Medium Hall": reverb.loadFactoryPreset(.mediumHall) case "Medium Hall 2": reverb.loadFactoryPreset(.mediumHall2) case "Medium Hall 3": reverb.loadFactoryPreset(.mediumHall3) case "Medium Room": reverb.loadFactoryPreset(.mediumRoom) case "Plate": reverb.loadFactoryPreset(.plate) case "Small Room": reverb.loadFactoryPreset(.smallRoom) default: break } }) } } import PlaygroundSupport PlaygroundPage.current.needsIndefiniteExecution = true PlaygroundPage.current.liveView = LiveView()
mit
d6e29a32fc8399dc5131b3eb8cd0639c
31.60274
96
0.605462
5.173913
false
false
false
false
jeffmoran/Appointment
Appointment/Extensions/UIViewController+Extensions.swift
1
1035
// // UIViewController+Extensions.swift // Appointment // // Created by Jeffrey Moran on 10/22/20. // Copyright © 2020 Jeff Moran. All rights reserved. // import UIKit extension UIViewController { func presentAlert( title: String? = nil, message: String? = "", dismissActionTitle: String? = "Dismiss", defaultActionTitle: String? = nil, defaultActionAction: (() -> Void)? = nil ) { let alertController = UIAlertController(title: title, message: message, preferredStyle: .alert) if let defaultActionTitle = defaultActionTitle { alertController.addAction(UIAlertAction(title: defaultActionTitle, style: .default) { _ in defaultActionAction?() }) alertController.addAction(UIAlertAction(title: dismissActionTitle, style: .cancel)) } else { alertController.addAction(UIAlertAction(title: dismissActionTitle, style: .default)) } present(alertController, animated: true) } }
mit
c7d9afb224476aedd1102c9256da4e47
30.333333
103
0.644101
4.831776
false
false
false
false
rajeejones/SavingPennies
Saving Pennies/GameViewController.swift
1
14204
// // GameViewController.swift // Saving Pennies // // Created by Rajeé Jones on 7/21/16. // Copyright (c) 2016 Rajee Jones. All rights reserved. // import UIKit import SpriteKit var gameScore = 0 var level: Level! var currentLevelNum = 0 let formatter = NumberFormatter() typealias CompletionHandler = ((_ success:Bool) -> Void)? class GameViewController: UIViewController, BillPaymentDelegate, PausedViewDelegate { // Mark: Variables var scene: GameScene! var logicController:LogicController! var movesLeft = 0 var paidExpensesCount = 0 // Mark: Constants enum OverlayImageState { case GameOver, Shuffling, LevelComplete } // Mark: Outlets @IBOutlet weak var dueMessageLabel: UILabel! @IBOutlet weak var remainingMovesLabel: UILabel! @IBOutlet weak var bankAmountLabel: UILabel! @IBOutlet weak var gameContainerView: UIView! @IBOutlet weak var gameSkView: SKView! @IBOutlet weak var overlayImage: UIImageView! @IBOutlet weak var menuButton: UIButton! @IBOutlet weak var shuffleButton: UIButton! @IBOutlet weak var bankButton: UIButton! @IBOutlet weak var expensesPaidLabel: UILabel! @IBOutlet weak var expensesTableView: UITableView! @IBOutlet weak var expensesRemainingLabel: UILabel! // Mark: View Overrides override var prefersStatusBarHidden: Bool { get { return true } } override var shouldAutorotate: Bool { get { return true } } override var supportedInterfaceOrientations: UIInterfaceOrientationMask { get { return [UIInterfaceOrientationMask.portrait, UIInterfaceOrientationMask.portraitUpsideDown] } } override func viewDidLoad() { super.viewDidLoad() formatter.numberStyle = .currency formatter.locale = NSLocale.current overlayImage.isHidden = true; currentLevelNum = 0 setupLevel(levelNum: currentLevelNum) } func setupLevel(levelNum: Int) { // Configure the view. let skView = gameSkView as SKView skView.isMultipleTouchEnabled = false // Create and configure the scene. scene = GameScene(size: skView.bounds.size) //scene.backgroundColor = UIColor().UIColorFromHex(rgbValue: 0x4A4A4A) scene.scaleMode = .aspectFit level = Level(filename: "Level_\(levelNum)") paidExpensesCount = 0 logicController = LogicController(withLevel: level) scene.logicController = logicController scene.swipeHandler = handleSwipe scene.addTiles() setupExpenses() // Present the scene. skView.presentScene(scene) beginGame() } func setupExpenses() { expensesTableView.register(UINib(nibName: "ExpenseTableViewCell", bundle: nil), forCellReuseIdentifier: "Cell") expensesTableView.delegate = self expensesTableView.dataSource = self expensesTableView.separatorColor = UIColor.clear expensesRemainingLabel.text = "0/\(level.expenses.count)" expensesTableView.setContentOffset(CGPoint.zero, animated: true) expensesTableView.reloadData() } func beginGame() { scene.animateBeginGame() { } movesLeft = level.movesLeft gameScore = 0 updateLabels() logicController.resetComboMultiplier() shuffle() } func shuffle() { scene.removeAllCoinSprites() let newCoins = logicController.shuffle() scene.addSpritesForCoins(newCoins) } func showOverlay(overlayType: OverlayImageState) { switch overlayType { case .LevelComplete: overlayImage.image = #imageLiteral(resourceName: "LevelCompleteOverlay") break case .Shuffling: overlayImage.image = #imageLiteral(resourceName: "ShufflingOverlay") break case .GameOver: overlayImage.image = #imageLiteral(resourceName: "GameOverOverlay") break } overlayImage.isHidden = false scene.isUserInteractionEnabled = false } func hideOverlay(overlayType: OverlayImageState) { overlayImage.isHidden = true scene.isUserInteractionEnabled = true switch overlayType { case .LevelComplete: scene.animateGameOver() { self.setupLevel(levelNum: currentLevelNum) } break case .GameOver: scene.animateGameOver() { print("GAME OVER") self.performSegue(withIdentifier: "unwindToCharacterSelect", sender: self) } default: shuffle() } } func handleSwipe(_ swap: Swap) { view.isUserInteractionEnabled = false if logicController.isPossibleSwap(swap) { logicController.performSwap(swap) scene.animateSwap(swap, completion: handleMatches) } else { scene.animateInvalidSwap(swap) { self.view.isUserInteractionEnabled = true } } } func handleMatches() { let chains = logicController.removeMatches() if chains.count == 0 { beginNextTurn() return } scene.animateMatchedCoins(chains) { for chain in chains { gameScore += chain.score } self.updateLabels() let columns = self.logicController.fillHoles() self.scene.animateFallingCoins(columns) { let columns = self.logicController.topUpCoins() self.scene.animateNewCoins(columns) { self.handleMatches() } } } } func beginNextTurn() { logicController.resetComboMultiplier() logicController.detectPossibleSwaps() if level.possibleSwaps.count < 1 { showOverlay(overlayType: OverlayImageState.Shuffling) DispatchQueue.main.asyncAfter(deadline: .now() + 1.5) { self.hideOverlay(overlayType: OverlayImageState.Shuffling) } } view.isUserInteractionEnabled = true decrementMoves() } func updateLabels() { remainingMovesLabel.text = String(format: "%ld", movesLeft) bankAmountLabel.text = formatter.string(from: NSNumber(value: gameScore)) expensesTableView.reloadData() } func decrementMoves() { // if gameScore >= level.targetScore { // goToNextLevel() // } // else if movesLeft <= 1 { showOverlay(overlayType: GameViewController.OverlayImageState.GameOver) DispatchQueue.main.asyncAfter(deadline: .now() + 1.5) { self.hideOverlay(overlayType: GameViewController.OverlayImageState.GameOver) } } else { movesLeft -= 1 updateLabels() } } func goToNextLevel() { showOverlay(overlayType: GameViewController.OverlayImageState.LevelComplete) currentLevelNum = currentLevelNum < NumLevels ? currentLevelNum + 1 : 0 DispatchQueue.main.asyncAfter(deadline: .now() + 1.5) { self.hideOverlay(overlayType: GameViewController.OverlayImageState.LevelComplete) } } // Mark: Actions @IBAction func shuffleButtonPressed(_ sender: UIButton) { shuffle() decrementMoves() } @IBAction func settingsButtonPressed(_ sender: Any) { let xibView = Bundle.main.loadNibNamed("PausedView", owner: nil, options: nil)?[0] as! PausedView xibView.pausedViewDelegate = self PopupContainer.generatePopupWithView(xibView).show() } @IBAction func bankButtonPressed(_ sender: Any) { let xibView = Bundle.main.loadNibNamed("PausedView", owner: nil, options: nil)?[0] as! PausedView xibView.pausedViewDelegate = self PopupContainer.generatePopupWithView(xibView).show() } func payBill(forAmount: Int) { if (forAmount <= gameScore) { gameScore = gameScore - forAmount self.updateLabels() } else { let alert = UIAlertController(title: "Insufficient Funds", message: "You currently dont have enough money in the bank to pay this right now.", preferredStyle: .alert) alert.addAction(UIAlertAction.init(title: "Ok", style: .default, handler: nil)) self.present(alert, animated: true, completion: nil) } } func advanceLevel() { goToNextLevel() } func musicButtonToggled(button:UIButton) { if (!muteMusic) { if (!backgroundMusicPlayer.isPlaying) { backgroundMusicPlayer.play() } } else { backgroundMusicPlayer.pause() } } func exitButtonPressed() { self.performSegue(withIdentifier: "unwindToCharacterSelect", sender: self) } func restartButtonPressed() { beginGame() } } extension GameViewController: UITableViewDataSource, UITableViewDelegate, PayButtonDelegate { func tableView(_ tableView: UITableView, estimatedHeightForRowAt indexPath: IndexPath) -> CGFloat { return 44.0 } func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { return level.expenses.count } func numberOfSections(in tableView: UITableView) -> Int { return 1 } func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { var cell = UITableViewCell() cell = setupExpensesTableViewCell(tableView, indexPath: indexPath) return cell } func setupExpensesTableViewCell(_ tableView:UITableView,indexPath:IndexPath) -> UITableViewCell { let cell = tableView.dequeueReusableCell(withIdentifier: "Cell") as! ExpenseTableViewCell cell.itemLabel.text = level.expenses[indexPath.row].description cell.itemLabel.textColor = UIColor.brown cell.paid = level.expenses[indexPath.row].paid cell.payButtonDelegate = self cell.paymentAmount = level.expenses[indexPath.row].amount if cell.paid { cell.payBtn.alpha = 0 cell.paidCheckmarkImage.alpha = 1 } else if !cell.canBePaid() { cell.payBtn.borderColor = UIColor.clear cell.payBtn.setTitle(formatter.string(from: NSNumber(value: level.expenses[indexPath.row].amount)), for: UIControlState.normal) cell.payBtn.tintColor = UIColor.brown cell.payBtn.setTitleColor(UIColor.brown, for: UIControlState.normal) cell.payBtn.alpha = 1 cell.paidCheckmarkImage.alpha = 0 } else { cell.payBtn.borderColor = UIColor().brandGreen() cell.payBtn.setTitle("Pay!", for: UIControlState.normal) cell.payBtn.tintColor = UIColor().brandGreen() cell.payBtn.setTitleColor(UIColor().brandGreen(), for: UIControlState.normal) cell.payBtn.alpha = 1 cell.paidCheckmarkImage.alpha = 0 } cell.backgroundColor = UIColor.clear return cell } //PayButtonDelegate func payButtonPressed(amount: Int, cell: UITableViewCell) { // check if paid, then set the variable to paid, and change the image guard let expenseCell = cell as? ExpenseTableViewCell else { return } guard let cellIndex = expensesTableView.indexPath(for: expenseCell)?.row else { return } if expenseCell.canBePaid() { expenseCell.paid = true level.expenses[cellIndex].paid = true paidExpensesCount += 1 expenseCell.animateItemPaid() expensesTableView.reloadData() } payBill(forAmount: amount) var advance = false for expense in level.expenses { if expense.paid { advance = true } else { advance = false break } } expensesRemainingLabel.text = "\(paidExpensesCount)/\(level.expenses.count)" if advance { //resetExpenses() expensesTableView.reloadData() advanceLevel() } } func resetExpenses() { let numSections = expensesTableView.numberOfSections for section in 0 ..< numSections { let rowCount = expensesTableView.numberOfRows(inSection: section) for row in 0 ..< rowCount { if let cell = expensesTableView.cellForRow(at: IndexPath(row: row, section: section)) as? ExpenseTableViewCell { cell.reset() } //let cell = expensesTableView.cellForRow(at: IndexPath(row: row, section: section)) as? ExpenseTableViewCell } } } } extension UIColor { func UIColorFromHex(rgbValue:UInt32, alpha:Double=1.0)->UIColor { let red = CGFloat((rgbValue & 0xFF0000) >> 16)/256.0 let green = CGFloat((rgbValue & 0xFF00) >> 8)/256.0 let blue = CGFloat(rgbValue & 0xFF)/256.0 return UIColor(red:red, green:green, blue:blue, alpha:CGFloat(alpha)) } func brandGreen() -> UIColor { return UIColor().UIColorFromHex(rgbValue: 0x1EAA5F) } func brandRed() -> UIColor { return UIColor().UIColorFromHex(rgbValue: 0xEA4949) } }
gpl-3.0
5c05f86740ef33dd4a4fc80531baa707
29.943355
178
0.593396
5.202564
false
false
false
false
IvanVorobei/RequestPermission
Source/SPPermission/Dialog/Draw/SPPermissionDrawPermissionPack.swift
2
590046
// The MIT License (MIT) // Copyright © 2017 Ivan Vorobei ([email protected]) // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in all // copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. import UIKit extension SPPermissionDraw { public class PermissionPack : NSObject { @objc dynamic public class func drawCamera(frame targetFrame: CGRect = CGRect(x: 0, y: 0, width: 1000, height: 1000), resizing: ResizingBehavior = .aspectFit, white: UIColor = UIColor(red: 1.000, green: 1.000, blue: 1.000, alpha: 1.000), light: UIColor = UIColor(red: 0.769, green: 0.847, blue: 0.984, alpha: 1.000), medium: UIColor = UIColor(red: 0.478, green: 0.663, blue: 0.973, alpha: 1.000), dark: UIColor = UIColor(red: 0.000, green: 0.478, blue: 1.000, alpha: 1.000)) { //// General Declarations let context = UIGraphicsGetCurrentContext()! //// Resize to Target Frame context.saveGState() let resizedFrame: CGRect = resizing.apply(rect: CGRect(x: 0, y: 0, width: 1000, height: 1000), target: targetFrame) context.translateBy(x: resizedFrame.minX, y: resizedFrame.minY) context.scaleBy(x: resizedFrame.width / 1000, y: resizedFrame.height / 1000) //// Group 2 //// Bezier Drawing let bezierPath = UIBezierPath() bezierPath.move(to: CGPoint(x: 62, y: 750)) bezierPath.addLine(to: CGPoint(x: 62, y: 764)) bezierPath.addCurve(to: CGPoint(x: 75.89, y: 778), controlPoint1: CGPoint(x: 62, y: 771.7), controlPoint2: CGPoint(x: 68.25, y: 778)) bezierPath.addLine(to: CGPoint(x: 923.11, y: 778)) bezierPath.addCurve(to: CGPoint(x: 937, y: 764), controlPoint1: CGPoint(x: 930.75, y: 778), controlPoint2: CGPoint(x: 937, y: 771.7)) bezierPath.addLine(to: CGPoint(x: 937, y: 750)) bezierPath.addLine(to: CGPoint(x: 62, y: 750)) bezierPath.close() bezierPath.usesEvenOddFillRule = true light.setFill() bezierPath.fill() //// Bezier 2 Drawing let bezier2Path = UIBezierPath() bezier2Path.move(to: CGPoint(x: 90, y: 764)) bezier2Path.addLine(to: CGPoint(x: 90, y: 750)) bezier2Path.addLine(to: CGPoint(x: 62, y: 750)) bezier2Path.addLine(to: CGPoint(x: 62, y: 764)) bezier2Path.addCurve(to: CGPoint(x: 76, y: 778), controlPoint1: CGPoint(x: 62, y: 771.7), controlPoint2: CGPoint(x: 68.3, y: 778)) bezier2Path.addLine(to: CGPoint(x: 104, y: 778)) bezier2Path.addCurve(to: CGPoint(x: 90, y: 764), controlPoint1: CGPoint(x: 96.3, y: 778), controlPoint2: CGPoint(x: 90, y: 771.7)) bezier2Path.close() bezier2Path.usesEvenOddFillRule = true white.setFill() bezier2Path.fill() //// Rectangle Drawing let rectanglePath = UIBezierPath(rect: CGRect(x: 756, y: 250, width: 139, height: 56)) medium.setFill() rectanglePath.fill() //// Bezier 3 Drawing let bezier3Path = UIBezierPath() bezier3Path.move(to: CGPoint(x: 756.44, y: 305.51)) bezier3Path.addLine(to: CGPoint(x: 895.33, y: 305.51)) bezier3Path.addLine(to: CGPoint(x: 895.33, y: 249.84)) bezier3Path.addLine(to: CGPoint(x: 756.44, y: 249.84)) bezier3Path.addLine(to: CGPoint(x: 756.44, y: 305.51)) bezier3Path.close() bezier3Path.move(to: CGPoint(x: 478.66, y: 305.51)) bezier3Path.addLine(to: CGPoint(x: 617.55, y: 305.51)) bezier3Path.addLine(to: CGPoint(x: 617.55, y: 277.68)) bezier3Path.addLine(to: CGPoint(x: 478.66, y: 277.68)) bezier3Path.addLine(to: CGPoint(x: 478.66, y: 305.51)) bezier3Path.close() bezier3Path.move(to: CGPoint(x: 923.11, y: 222)) bezier3Path.addLine(to: CGPoint(x: 450.89, y: 222)) bezier3Path.addLine(to: CGPoint(x: 450.89, y: 277.68)) bezier3Path.addLine(to: CGPoint(x: 75.89, y: 277.68)) bezier3Path.addCurve(to: CGPoint(x: 62, y: 291.59), controlPoint1: CGPoint(x: 68.25, y: 277.68), controlPoint2: CGPoint(x: 62, y: 283.94)) bezier3Path.addLine(to: CGPoint(x: 62, y: 333.35)) bezier3Path.addLine(to: CGPoint(x: 284.22, y: 333.35)) bezier3Path.addLine(to: CGPoint(x: 296.44, y: 352)) bezier3Path.addCurve(to: CGPoint(x: 312, y: 347.27), controlPoint1: CGPoint(x: 300.89, y: 348.94), controlPoint2: CGPoint(x: 306.3, y: 347.27)) bezier3Path.addLine(to: CGPoint(x: 312, y: 333.35)) bezier3Path.addLine(to: CGPoint(x: 937, y: 333.35)) bezier3Path.addLine(to: CGPoint(x: 937, y: 235.92)) bezier3Path.addCurve(to: CGPoint(x: 923.11, y: 222), controlPoint1: CGPoint(x: 937, y: 228.26), controlPoint2: CGPoint(x: 930.74, y: 222)) bezier3Path.close() bezier3Path.usesEvenOddFillRule = true light.setFill() bezier3Path.fill() //// Bezier 4 Drawing let bezier4Path = UIBezierPath() bezier4Path.move(to: CGPoint(x: 90, y: 291)) bezier4Path.addCurve(to: CGPoint(x: 104, y: 277), controlPoint1: CGPoint(x: 90, y: 283.3), controlPoint2: CGPoint(x: 96.3, y: 277)) bezier4Path.addLine(to: CGPoint(x: 76, y: 277)) bezier4Path.addCurve(to: CGPoint(x: 62, y: 291), controlPoint1: CGPoint(x: 68.3, y: 277), controlPoint2: CGPoint(x: 62, y: 283.3)) bezier4Path.addLine(to: CGPoint(x: 62, y: 333)) bezier4Path.addLine(to: CGPoint(x: 90, y: 333)) bezier4Path.addLine(to: CGPoint(x: 90, y: 291)) bezier4Path.addLine(to: CGPoint(x: 90, y: 291)) bezier4Path.close() bezier4Path.usesEvenOddFillRule = true white.setFill() bezier4Path.fill() //// Rectangle 2 Drawing let rectangle2Path = UIBezierPath(rect: CGRect(x: 62, y: 333, width: 875, height: 417)) medium.setFill() rectangle2Path.fill() //// Oval Drawing let ovalPath = UIBezierPath(ovalIn: CGRect(x: 367, y: 347, width: 431, height: 431)) light.setFill() ovalPath.fill() //// Bezier 5 Drawing let bezier5Path = UIBezierPath() bezier5Path.move(to: CGPoint(x: 381.87, y: 562.5)) bezier5Path.addCurve(to: CGPoint(x: 590, y: 347.35), controlPoint1: CGPoint(x: 381.87, y: 445.83), controlPoint2: CGPoint(x: 474.46, y: 351.05)) bezier5Path.addCurve(to: CGPoint(x: 583.06, y: 347), controlPoint1: CGPoint(x: 587.67, y: 347.28), controlPoint2: CGPoint(x: 585.41, y: 347)) bezier5Path.addCurve(to: CGPoint(x: 368, y: 562.5), controlPoint1: CGPoint(x: 464.28, y: 347), controlPoint2: CGPoint(x: 368, y: 443.48)) bezier5Path.addCurve(to: CGPoint(x: 583.06, y: 778), controlPoint1: CGPoint(x: 368, y: 681.52), controlPoint2: CGPoint(x: 464.28, y: 778)) bezier5Path.addCurve(to: CGPoint(x: 590, y: 777.65), controlPoint1: CGPoint(x: 585.41, y: 778), controlPoint2: CGPoint(x: 587.67, y: 777.73)) bezier5Path.addCurve(to: CGPoint(x: 381.87, y: 562.5), controlPoint1: CGPoint(x: 474.46, y: 773.95), controlPoint2: CGPoint(x: 381.87, y: 679.17)) bezier5Path.close() bezier5Path.usesEvenOddFillRule = true white.setFill() bezier5Path.fill() //// Bezier 6 Drawing let bezier6Path = UIBezierPath() bezier6Path.move(to: CGPoint(x: 786.13, y: 562.5)) bezier6Path.addCurve(to: CGPoint(x: 578, y: 777.65), controlPoint1: CGPoint(x: 786.13, y: 679.17), controlPoint2: CGPoint(x: 693.54, y: 773.95)) bezier6Path.addCurve(to: CGPoint(x: 584.94, y: 778), controlPoint1: CGPoint(x: 580.32, y: 777.71), controlPoint2: CGPoint(x: 582.59, y: 778)) bezier6Path.addCurve(to: CGPoint(x: 800, y: 562.5), controlPoint1: CGPoint(x: 703.72, y: 778), controlPoint2: CGPoint(x: 800, y: 681.52)) bezier6Path.addCurve(to: CGPoint(x: 584.94, y: 347), controlPoint1: CGPoint(x: 800, y: 443.48), controlPoint2: CGPoint(x: 703.72, y: 347)) bezier6Path.addCurve(to: CGPoint(x: 578, y: 347.35), controlPoint1: CGPoint(x: 582.59, y: 347), controlPoint2: CGPoint(x: 580.32, y: 347.27)) bezier6Path.addCurve(to: CGPoint(x: 786.13, y: 562.5), controlPoint1: CGPoint(x: 693.54, y: 351.05), controlPoint2: CGPoint(x: 786.13, y: 445.83)) bezier6Path.close() bezier6Path.usesEvenOddFillRule = true white.setFill() bezier6Path.fill() //// Oval 2 Drawing let oval2Path = UIBezierPath(ovalIn: CGRect(x: 408.5, y: 389.5, width: 348, height: 347)) light.setFill() oval2Path.fill() //// Bezier 7 Drawing let bezier7Path = UIBezierPath() bezier7Path.move(to: CGPoint(x: 436.85, y: 563)) bezier7Path.addCurve(to: CGPoint(x: 597, y: 389.7), controlPoint1: CGPoint(x: 436.85, y: 471.61), controlPoint2: CGPoint(x: 507.4, y: 396.82)) bezier7Path.addCurve(to: CGPoint(x: 583.08, y: 389), controlPoint1: CGPoint(x: 592.39, y: 389.34), controlPoint2: CGPoint(x: 587.78, y: 389)) bezier7Path.addCurve(to: CGPoint(x: 409, y: 563), controlPoint1: CGPoint(x: 486.95, y: 389), controlPoint2: CGPoint(x: 409, y: 466.91)) bezier7Path.addCurve(to: CGPoint(x: 583.08, y: 737), controlPoint1: CGPoint(x: 409, y: 659.08), controlPoint2: CGPoint(x: 486.95, y: 737)) bezier7Path.addCurve(to: CGPoint(x: 597, y: 736.29), controlPoint1: CGPoint(x: 587.78, y: 737), controlPoint2: CGPoint(x: 592.39, y: 736.66)) bezier7Path.addCurve(to: CGPoint(x: 436.85, y: 563), controlPoint1: CGPoint(x: 507.4, y: 729.18), controlPoint2: CGPoint(x: 436.85, y: 654.38)) bezier7Path.close() bezier7Path.usesEvenOddFillRule = true medium.setFill() bezier7Path.fill() //// Oval 3 Drawing let oval3Path = UIBezierPath(ovalIn: CGRect(x: 478.45, y: 458.45, width: 209.1, height: 208)) medium.setFill() oval3Path.fill() //// Bezier 8 Drawing let bezier8Path = UIBezierPath() bezier8Path.move(to: CGPoint(x: 506.76, y: 562.5)) bezier8Path.addCurve(to: CGPoint(x: 597, y: 459.03), controlPoint1: CGPoint(x: 506.76, y: 509.54), controlPoint2: CGPoint(x: 546.08, y: 465.86)) bezier8Path.addCurve(to: CGPoint(x: 583.12, y: 458), controlPoint1: CGPoint(x: 592.45, y: 458.42), controlPoint2: CGPoint(x: 587.84, y: 458)) bezier8Path.addCurve(to: CGPoint(x: 479, y: 562.5), controlPoint1: CGPoint(x: 525.61, y: 458), controlPoint2: CGPoint(x: 479, y: 504.8)) bezier8Path.addCurve(to: CGPoint(x: 583.12, y: 667), controlPoint1: CGPoint(x: 479, y: 620.14), controlPoint2: CGPoint(x: 525.61, y: 667)) bezier8Path.addCurve(to: CGPoint(x: 597, y: 665.97), controlPoint1: CGPoint(x: 587.84, y: 667), controlPoint2: CGPoint(x: 592.45, y: 666.58)) bezier8Path.addCurve(to: CGPoint(x: 506.76, y: 562.5), controlPoint1: CGPoint(x: 546.08, y: 659.12), controlPoint2: CGPoint(x: 506.76, y: 615.4)) bezier8Path.close() bezier8Path.usesEvenOddFillRule = true white.setFill() bezier8Path.fill() //// Oval 4 Drawing let oval4Path = UIBezierPath(ovalIn: CGRect(x: 665.95, y: 271.05, width: 14, height: 13.9)) dark.setFill() oval4Path.fill() //// Oval 5 Drawing let oval5Path = UIBezierPath(ovalIn: CGRect(x: 665.95, y: 298.05, width: 14, height: 13.9)) dark.setFill() oval5Path.fill() //// Rectangle 3 Drawing let rectangle3Path = UIBezierPath(rect: CGRect(x: 423, y: 222, width: 28, height: 56)) light.setFill() rectangle3Path.fill() //// Rectangle 4 Drawing let rectangle4Path = UIBezierPath(rect: CGRect(x: 76, y: 250, width: 69, height: 28)) light.setFill() rectangle4Path.fill() //// Rectangle 5 Drawing let rectangle5Path = UIBezierPath(rect: CGRect(x: 187, y: 250, width: 56, height: 28)) light.setFill() rectangle5Path.fill() //// Rectangle 6 Drawing let rectangle6Path = UIBezierPath(rect: CGRect(x: 284, y: 250, width: 111, height: 28)) light.setFill() rectangle6Path.fill() //// Bezier 9 Drawing let bezier9Path = UIBezierPath() bezier9Path.move(to: CGPoint(x: 215, y: 229)) bezier9Path.addCurve(to: CGPoint(x: 187, y: 236), controlPoint1: CGPoint(x: 194, y: 229), controlPoint2: CGPoint(x: 187, y: 236)) bezier9Path.addLine(to: CGPoint(x: 187, y: 250)) bezier9Path.addLine(to: CGPoint(x: 243, y: 250)) bezier9Path.addLine(to: CGPoint(x: 243, y: 236)) bezier9Path.addCurve(to: CGPoint(x: 215, y: 229), controlPoint1: CGPoint(x: 243, y: 236), controlPoint2: CGPoint(x: 236, y: 229)) bezier9Path.close() bezier9Path.usesEvenOddFillRule = true light.setFill() bezier9Path.fill() //// Oval 6 Drawing let oval6Path = UIBezierPath(ovalIn: CGRect(x: 283.9, y: 347, width: 56.1, height: 55.9)) white.setFill() oval6Path.fill() //// Oval 7 Drawing let oval7Path = UIBezierPath(ovalIn: CGRect(x: 366.9, y: 361, width: 42.1, height: 41.9)) white.setFill() oval7Path.fill() //// Rectangle 7 Drawing let rectangle7Path = UIBezierPath(rect: CGRect(x: 479, y: 278, width: 139, height: 28)) light.setFill() rectangle7Path.fill() //// Oval 8 Drawing let oval8Path = UIBezierPath(ovalIn: CGRect(x: 798, y: 250, width: 56, height: 56)) white.setFill() oval8Path.fill() //// Bezier 10 Drawing let bezier10Path = UIBezierPath() bezier10Path.move(to: CGPoint(x: 62, y: 750)) bezier10Path.addLine(to: CGPoint(x: 90, y: 750)) bezier10Path.addLine(to: CGPoint(x: 90, y: 333)) bezier10Path.addLine(to: CGPoint(x: 62, y: 333)) bezier10Path.addLine(to: CGPoint(x: 62, y: 750)) bezier10Path.close() bezier10Path.usesEvenOddFillRule = true light.setFill() bezier10Path.fill() //// Rectangle 8 Drawing let rectangle8Path = UIBezierPath(rect: CGRect(x: 76, y: 250, width: 14, height: 14)) white.setFill() rectangle8Path.fill() //// Rectangle 9 Drawing let rectangle9Path = UIBezierPath(rect: CGRect(x: 284, y: 250, width: 14, height: 14)) white.setFill() rectangle9Path.fill() //// Rectangle 10 Drawing let rectangle10Path = UIBezierPath(rect: CGRect(x: 187, y: 250, width: 14, height: 14)) white.setFill() rectangle10Path.fill() //// Bezier 11 Drawing let bezier11Path = UIBezierPath() bezier11Path.move(to: CGPoint(x: 936.96, y: 757.2)) bezier11Path.addCurve(to: CGPoint(x: 930.01, y: 750.25), controlPoint1: CGPoint(x: 933.12, y: 757.2), controlPoint2: CGPoint(x: 930.01, y: 754.09)) bezier11Path.addLine(to: CGPoint(x: 930.01, y: 333.22)) bezier11Path.addCurve(to: CGPoint(x: 936.96, y: 326.27), controlPoint1: CGPoint(x: 930.01, y: 329.38), controlPoint2: CGPoint(x: 933.12, y: 326.27)) bezier11Path.addCurve(to: CGPoint(x: 943.9, y: 333.22), controlPoint1: CGPoint(x: 940.79, y: 326.27), controlPoint2: CGPoint(x: 943.9, y: 329.38)) bezier11Path.addLine(to: CGPoint(x: 943.9, y: 750.25)) bezier11Path.addCurve(to: CGPoint(x: 936.96, y: 757.2), controlPoint1: CGPoint(x: 943.9, y: 754.09), controlPoint2: CGPoint(x: 940.79, y: 757.2)) bezier11Path.close() bezier11Path.usesEvenOddFillRule = true dark.setFill() bezier11Path.fill() //// Bezier 12 Drawing let bezier12Path = UIBezierPath() bezier12Path.move(to: CGPoint(x: 61.95, y: 757.2)) bezier12Path.addCurve(to: CGPoint(x: 55, y: 750.25), controlPoint1: CGPoint(x: 58.11, y: 757.2), controlPoint2: CGPoint(x: 55, y: 754.09)) bezier12Path.addLine(to: CGPoint(x: 55, y: 333.22)) bezier12Path.addCurve(to: CGPoint(x: 61.95, y: 326.27), controlPoint1: CGPoint(x: 55, y: 329.38), controlPoint2: CGPoint(x: 58.11, y: 326.27)) bezier12Path.addCurve(to: CGPoint(x: 68.89, y: 333.22), controlPoint1: CGPoint(x: 65.78, y: 326.27), controlPoint2: CGPoint(x: 68.89, y: 329.38)) bezier12Path.addLine(to: CGPoint(x: 68.89, y: 750.25)) bezier12Path.addCurve(to: CGPoint(x: 61.95, y: 757.2), controlPoint1: CGPoint(x: 68.89, y: 754.09), controlPoint2: CGPoint(x: 65.78, y: 757.2)) bezier12Path.close() bezier12Path.usesEvenOddFillRule = true dark.setFill() bezier12Path.fill() //// Bezier 13 Drawing let bezier13Path = UIBezierPath() bezier13Path.move(to: CGPoint(x: 75.83, y: 785)) bezier13Path.addCurve(to: CGPoint(x: 55, y: 764.15), controlPoint1: CGPoint(x: 64.34, y: 785), controlPoint2: CGPoint(x: 55, y: 775.65)) bezier13Path.addCurve(to: CGPoint(x: 61.95, y: 757.2), controlPoint1: CGPoint(x: 55, y: 760.31), controlPoint2: CGPoint(x: 58.11, y: 757.2)) bezier13Path.addCurve(to: CGPoint(x: 68.89, y: 764.15), controlPoint1: CGPoint(x: 65.78, y: 757.2), controlPoint2: CGPoint(x: 68.89, y: 760.31)) bezier13Path.addCurve(to: CGPoint(x: 75.84, y: 771.1), controlPoint1: CGPoint(x: 68.89, y: 767.98), controlPoint2: CGPoint(x: 72, y: 771.1)) bezier13Path.addCurve(to: CGPoint(x: 82.78, y: 778.05), controlPoint1: CGPoint(x: 79.67, y: 771.1), controlPoint2: CGPoint(x: 82.78, y: 774.21)) bezier13Path.addCurve(to: CGPoint(x: 75.83, y: 785), controlPoint1: CGPoint(x: 82.78, y: 781.89), controlPoint2: CGPoint(x: 79.67, y: 785)) bezier13Path.close() bezier13Path.usesEvenOddFillRule = true dark.setFill() bezier13Path.fill() //// Bezier 14 Drawing let bezier14Path = UIBezierPath() bezier14Path.move(to: CGPoint(x: 923.07, y: 785)) bezier14Path.addCurve(to: CGPoint(x: 916.12, y: 778.05), controlPoint1: CGPoint(x: 919.23, y: 785), controlPoint2: CGPoint(x: 916.12, y: 781.89)) bezier14Path.addCurve(to: CGPoint(x: 923.07, y: 771.1), controlPoint1: CGPoint(x: 916.12, y: 774.21), controlPoint2: CGPoint(x: 919.23, y: 771.1)) bezier14Path.addCurve(to: CGPoint(x: 930.01, y: 764.15), controlPoint1: CGPoint(x: 926.89, y: 771.1), controlPoint2: CGPoint(x: 930.01, y: 767.98)) bezier14Path.addCurve(to: CGPoint(x: 936.96, y: 757.2), controlPoint1: CGPoint(x: 930.01, y: 760.31), controlPoint2: CGPoint(x: 933.12, y: 757.2)) bezier14Path.addCurve(to: CGPoint(x: 943.9, y: 764.15), controlPoint1: CGPoint(x: 940.79, y: 757.2), controlPoint2: CGPoint(x: 943.9, y: 760.31)) bezier14Path.addCurve(to: CGPoint(x: 923.07, y: 785), controlPoint1: CGPoint(x: 943.9, y: 775.65), controlPoint2: CGPoint(x: 934.55, y: 785)) bezier14Path.close() bezier14Path.usesEvenOddFillRule = true dark.setFill() bezier14Path.fill() //// Bezier 15 Drawing let bezier15Path = UIBezierPath() bezier15Path.move(to: CGPoint(x: 936.96, y: 242.87)) bezier15Path.addCurve(to: CGPoint(x: 930.01, y: 235.92), controlPoint1: CGPoint(x: 933.12, y: 242.87), controlPoint2: CGPoint(x: 930.01, y: 239.76)) bezier15Path.addCurve(to: CGPoint(x: 923.07, y: 228.97), controlPoint1: CGPoint(x: 930.01, y: 232.08), controlPoint2: CGPoint(x: 926.89, y: 228.97)) bezier15Path.addCurve(to: CGPoint(x: 916.12, y: 222.02), controlPoint1: CGPoint(x: 919.23, y: 228.97), controlPoint2: CGPoint(x: 916.12, y: 225.86)) bezier15Path.addCurve(to: CGPoint(x: 923.07, y: 215.07), controlPoint1: CGPoint(x: 916.12, y: 218.17), controlPoint2: CGPoint(x: 919.23, y: 215.07)) bezier15Path.addCurve(to: CGPoint(x: 943.9, y: 235.92), controlPoint1: CGPoint(x: 934.55, y: 215.07), controlPoint2: CGPoint(x: 943.9, y: 224.42)) bezier15Path.addCurve(to: CGPoint(x: 936.96, y: 242.87), controlPoint1: CGPoint(x: 943.9, y: 239.76), controlPoint2: CGPoint(x: 940.79, y: 242.87)) bezier15Path.close() bezier15Path.usesEvenOddFillRule = true dark.setFill() bezier15Path.fill() //// Bezier 16 Drawing let bezier16Path = UIBezierPath() bezier16Path.move(to: CGPoint(x: 923.07, y: 785)) bezier16Path.addLine(to: CGPoint(x: 75.83, y: 785)) bezier16Path.addCurve(to: CGPoint(x: 68.89, y: 778.05), controlPoint1: CGPoint(x: 72, y: 785), controlPoint2: CGPoint(x: 68.89, y: 781.89)) bezier16Path.addCurve(to: CGPoint(x: 75.83, y: 771.1), controlPoint1: CGPoint(x: 68.89, y: 774.21), controlPoint2: CGPoint(x: 72, y: 771.1)) bezier16Path.addLine(to: CGPoint(x: 923.07, y: 771.1)) bezier16Path.addCurve(to: CGPoint(x: 930.01, y: 778.05), controlPoint1: CGPoint(x: 926.9, y: 771.1), controlPoint2: CGPoint(x: 930.01, y: 774.21)) bezier16Path.addCurve(to: CGPoint(x: 923.07, y: 785), controlPoint1: CGPoint(x: 930.01, y: 781.89), controlPoint2: CGPoint(x: 926.9, y: 785)) bezier16Path.close() bezier16Path.usesEvenOddFillRule = true dark.setFill() bezier16Path.fill() //// Group 3 context.saveGState() context.beginTransparencyLayer(auxiliaryInfo: nil) //// Clip Clip let clipPath = UIBezierPath() clipPath.move(to: CGPoint(x: 298.06, y: 340.17)) clipPath.addLine(to: CGPoint(x: 61.95, y: 340.17)) clipPath.addCurve(to: CGPoint(x: 55, y: 333.22), controlPoint1: CGPoint(x: 58.11, y: 340.17), controlPoint2: CGPoint(x: 55, y: 337.07)) clipPath.addCurve(to: CGPoint(x: 61.95, y: 326.27), controlPoint1: CGPoint(x: 55, y: 329.38), controlPoint2: CGPoint(x: 58.11, y: 326.27)) clipPath.addLine(to: CGPoint(x: 298.06, y: 326.27)) clipPath.addCurve(to: CGPoint(x: 305, y: 333.22), controlPoint1: CGPoint(x: 301.9, y: 326.27), controlPoint2: CGPoint(x: 305, y: 329.38)) clipPath.addCurve(to: CGPoint(x: 298.06, y: 340.17), controlPoint1: CGPoint(x: 305, y: 337.07), controlPoint2: CGPoint(x: 301.9, y: 340.17)) clipPath.close() clipPath.usesEvenOddFillRule = true clipPath.addClip() //// Bezier 17 Drawing let bezier17Path = UIBezierPath() bezier17Path.move(to: CGPoint(x: 50, y: 321.27)) bezier17Path.addLine(to: CGPoint(x: 310, y: 321.27)) bezier17Path.addLine(to: CGPoint(x: 310, y: 345.17)) bezier17Path.addLine(to: CGPoint(x: 50, y: 345.17)) bezier17Path.addLine(to: CGPoint(x: 50, y: 321.27)) bezier17Path.close() dark.setFill() bezier17Path.fill() context.endTransparencyLayer() context.restoreGState() //// Bezier 19 Drawing let bezier19Path = UIBezierPath() bezier19Path.move(to: CGPoint(x: 583, y: 353.91)) bezier19Path.addCurve(to: CGPoint(x: 374.87, y: 562.5), controlPoint1: CGPoint(x: 468.24, y: 353.91), controlPoint2: CGPoint(x: 374.87, y: 447.48)) bezier19Path.addCurve(to: CGPoint(x: 480.68, y: 744.18), controlPoint1: CGPoint(x: 374.87, y: 637.55), controlPoint2: CGPoint(x: 415.42, y: 707.16)) bezier19Path.addCurve(to: CGPoint(x: 685.33, y: 744.18), controlPoint1: CGPoint(x: 542.95, y: 779.41), controlPoint2: CGPoint(x: 623.05, y: 779.41)) bezier19Path.addCurve(to: CGPoint(x: 791.13, y: 562.5), controlPoint1: CGPoint(x: 750.58, y: 707.16), controlPoint2: CGPoint(x: 791.13, y: 637.55)) bezier19Path.addCurve(to: CGPoint(x: 583, y: 353.91), controlPoint1: CGPoint(x: 791.13, y: 447.48), controlPoint2: CGPoint(x: 697.77, y: 353.91)) bezier19Path.close() bezier19Path.move(to: CGPoint(x: 583, y: 785)) bezier19Path.addCurve(to: CGPoint(x: 473.86, y: 756.29), controlPoint1: CGPoint(x: 544.82, y: 785), controlPoint2: CGPoint(x: 507.07, y: 775.07)) bezier19Path.addCurve(to: CGPoint(x: 361, y: 562.5), controlPoint1: CGPoint(x: 404.24, y: 716.8), controlPoint2: CGPoint(x: 361, y: 642.54)) bezier19Path.addCurve(to: CGPoint(x: 583, y: 340), controlPoint1: CGPoint(x: 361, y: 439.81), controlPoint2: CGPoint(x: 460.59, y: 340)) bezier19Path.addCurve(to: CGPoint(x: 805, y: 562.5), controlPoint1: CGPoint(x: 705.41, y: 340), controlPoint2: CGPoint(x: 805, y: 439.81)) bezier19Path.addCurve(to: CGPoint(x: 692.14, y: 756.29), controlPoint1: CGPoint(x: 805, y: 642.54), controlPoint2: CGPoint(x: 761.75, y: 716.8)) bezier19Path.addCurve(to: CGPoint(x: 583, y: 785), controlPoint1: CGPoint(x: 658.93, y: 775.07), controlPoint2: CGPoint(x: 621.19, y: 785)) bezier19Path.close() bezier19Path.usesEvenOddFillRule = true dark.setFill() bezier19Path.fill() //// Bezier 20 Drawing let bezier20Path = UIBezierPath() bezier20Path.move(to: CGPoint(x: 821.13, y: 618)) bezier20Path.addCurve(to: CGPoint(x: 819.74, y: 617.86), controlPoint1: CGPoint(x: 820.67, y: 618), controlPoint2: CGPoint(x: 820.21, y: 617.96)) bezier20Path.addCurve(to: CGPoint(x: 814.29, y: 609.64), controlPoint1: CGPoint(x: 815.95, y: 617.09), controlPoint2: CGPoint(x: 813.52, y: 613.41)) bezier20Path.addCurve(to: CGPoint(x: 819.03, y: 562.21), controlPoint1: CGPoint(x: 817.44, y: 594.18), controlPoint2: CGPoint(x: 819.03, y: 578.22)) bezier20Path.addCurve(to: CGPoint(x: 814.15, y: 514.4), controlPoint1: CGPoint(x: 819.03, y: 545.87), controlPoint2: CGPoint(x: 817.4, y: 529.78)) bezier20Path.addCurve(to: CGPoint(x: 819.55, y: 506.15), controlPoint1: CGPoint(x: 813.36, y: 510.64), controlPoint2: CGPoint(x: 815.79, y: 506.94)) bezier20Path.addCurve(to: CGPoint(x: 827.82, y: 511.54), controlPoint1: CGPoint(x: 823.32, y: 505.37), controlPoint2: CGPoint(x: 827.03, y: 507.76)) bezier20Path.addCurve(to: CGPoint(x: 833, y: 562.21), controlPoint1: CGPoint(x: 831.25, y: 527.86), controlPoint2: CGPoint(x: 833, y: 544.9)) bezier20Path.addCurve(to: CGPoint(x: 827.97, y: 612.42), controlPoint1: CGPoint(x: 833, y: 579.16), controlPoint2: CGPoint(x: 831.31, y: 596.05)) bezier20Path.addCurve(to: CGPoint(x: 821.13, y: 618), controlPoint1: CGPoint(x: 827.3, y: 615.73), controlPoint2: CGPoint(x: 824.38, y: 618)) bezier20Path.close() bezier20Path.usesEvenOddFillRule = true dark.setFill() bezier20Path.fill() //// Bezier 21 Drawing let bezier21Path = UIBezierPath() bezier21Path.move(to: CGPoint(x: 345.01, y: 618)) bezier21Path.addCurve(to: CGPoint(x: 338.18, y: 612.46), controlPoint1: CGPoint(x: 341.78, y: 618), controlPoint2: CGPoint(x: 338.87, y: 615.75)) bezier21Path.addCurve(to: CGPoint(x: 333, y: 561.78), controlPoint1: CGPoint(x: 334.74, y: 596.15), controlPoint2: CGPoint(x: 333, y: 579.11)) bezier21Path.addCurve(to: CGPoint(x: 338.04, y: 511.58), controlPoint1: CGPoint(x: 333, y: 544.84), controlPoint2: CGPoint(x: 334.69, y: 527.95)) bezier21Path.addCurve(to: CGPoint(x: 346.27, y: 506.14), controlPoint1: CGPoint(x: 338.8, y: 507.81), controlPoint2: CGPoint(x: 342.5, y: 505.39)) bezier21Path.addCurve(to: CGPoint(x: 351.72, y: 514.36), controlPoint1: CGPoint(x: 350.05, y: 506.91), controlPoint2: CGPoint(x: 352.49, y: 510.58)) bezier21Path.addCurve(to: CGPoint(x: 346.97, y: 561.78), controlPoint1: CGPoint(x: 348.57, y: 529.82), controlPoint2: CGPoint(x: 346.97, y: 545.78)) bezier21Path.addCurve(to: CGPoint(x: 351.85, y: 609.6), controlPoint1: CGPoint(x: 346.97, y: 578.14), controlPoint2: CGPoint(x: 348.62, y: 594.23)) bezier21Path.addCurve(to: CGPoint(x: 346.45, y: 617.85), controlPoint1: CGPoint(x: 352.64, y: 613.35), controlPoint2: CGPoint(x: 350.23, y: 617.06)) bezier21Path.addCurve(to: CGPoint(x: 345.01, y: 618), controlPoint1: CGPoint(x: 345.97, y: 617.96), controlPoint2: CGPoint(x: 345.49, y: 618)) bezier21Path.close() bezier21Path.usesEvenOddFillRule = true dark.setFill() bezier21Path.fill() //// Bezier 22 Drawing let bezier22Path = UIBezierPath() bezier22Path.move(to: CGPoint(x: 582.5, y: 395.88)) bezier22Path.addCurve(to: CGPoint(x: 415.88, y: 562.5), controlPoint1: CGPoint(x: 490.63, y: 395.88), controlPoint2: CGPoint(x: 415.88, y: 470.63)) bezier22Path.addCurve(to: CGPoint(x: 582.5, y: 729.12), controlPoint1: CGPoint(x: 415.88, y: 654.38), controlPoint2: CGPoint(x: 490.63, y: 729.12)) bezier22Path.addCurve(to: CGPoint(x: 749.12, y: 562.5), controlPoint1: CGPoint(x: 674.38, y: 729.12), controlPoint2: CGPoint(x: 749.12, y: 654.38)) bezier22Path.addCurve(to: CGPoint(x: 582.5, y: 395.88), controlPoint1: CGPoint(x: 749.12, y: 470.63), controlPoint2: CGPoint(x: 674.38, y: 395.88)) bezier22Path.close() bezier22Path.move(to: CGPoint(x: 582.5, y: 743)) bezier22Path.addCurve(to: CGPoint(x: 402, y: 562.5), controlPoint1: CGPoint(x: 482.97, y: 743), controlPoint2: CGPoint(x: 402, y: 662.02)) bezier22Path.addCurve(to: CGPoint(x: 582.5, y: 382), controlPoint1: CGPoint(x: 402, y: 462.97), controlPoint2: CGPoint(x: 482.97, y: 382)) bezier22Path.addCurve(to: CGPoint(x: 763, y: 562.5), controlPoint1: CGPoint(x: 682.03, y: 382), controlPoint2: CGPoint(x: 763, y: 462.97)) bezier22Path.addCurve(to: CGPoint(x: 582.5, y: 743), controlPoint1: CGPoint(x: 763, y: 662.02), controlPoint2: CGPoint(x: 682.03, y: 743)) bezier22Path.close() bezier22Path.usesEvenOddFillRule = true dark.setFill() bezier22Path.fill() //// Bezier 23 Drawing let bezier23Path = UIBezierPath() bezier23Path.move(to: CGPoint(x: 583, y: 465.87)) bezier23Path.addCurve(to: CGPoint(x: 485.87, y: 563), controlPoint1: CGPoint(x: 529.45, y: 465.87), controlPoint2: CGPoint(x: 485.87, y: 509.45)) bezier23Path.addCurve(to: CGPoint(x: 583, y: 660.13), controlPoint1: CGPoint(x: 485.87, y: 616.55), controlPoint2: CGPoint(x: 529.45, y: 660.13)) bezier23Path.addCurve(to: CGPoint(x: 680.13, y: 563), controlPoint1: CGPoint(x: 636.55, y: 660.13), controlPoint2: CGPoint(x: 680.13, y: 616.55)) bezier23Path.addCurve(to: CGPoint(x: 583, y: 465.87), controlPoint1: CGPoint(x: 680.13, y: 509.45), controlPoint2: CGPoint(x: 636.55, y: 465.87)) bezier23Path.close() bezier23Path.move(to: CGPoint(x: 583, y: 674)) bezier23Path.addCurve(to: CGPoint(x: 472, y: 563), controlPoint1: CGPoint(x: 521.8, y: 674), controlPoint2: CGPoint(x: 472, y: 624.21)) bezier23Path.addCurve(to: CGPoint(x: 583, y: 452), controlPoint1: CGPoint(x: 472, y: 501.8), controlPoint2: CGPoint(x: 521.8, y: 452)) bezier23Path.addCurve(to: CGPoint(x: 694, y: 563), controlPoint1: CGPoint(x: 644.2, y: 452), controlPoint2: CGPoint(x: 694, y: 501.8)) bezier23Path.addCurve(to: CGPoint(x: 583, y: 674), controlPoint1: CGPoint(x: 694, y: 624.21), controlPoint2: CGPoint(x: 644.2, y: 674)) bezier23Path.close() bezier23Path.usesEvenOddFillRule = true dark.setFill() bezier23Path.fill() //// Bezier 24 Drawing let bezier24Path = UIBezierPath() bezier24Path.move(to: CGPoint(x: 936.96, y: 757.23)) bezier24Path.addLine(to: CGPoint(x: 688.62, y: 757.23)) bezier24Path.addCurve(to: CGPoint(x: 681.68, y: 750.11), controlPoint1: CGPoint(x: 684.78, y: 757.23), controlPoint2: CGPoint(x: 681.68, y: 754.05)) bezier24Path.addCurve(to: CGPoint(x: 688.62, y: 743.01), controlPoint1: CGPoint(x: 681.68, y: 746.19), controlPoint2: CGPoint(x: 684.78, y: 743.01)) bezier24Path.addLine(to: CGPoint(x: 936.95, y: 743.01)) bezier24Path.addCurve(to: CGPoint(x: 943.9, y: 750.11), controlPoint1: CGPoint(x: 940.79, y: 743.01), controlPoint2: CGPoint(x: 943.9, y: 746.19)) bezier24Path.addCurve(to: CGPoint(x: 936.96, y: 757.23), controlPoint1: CGPoint(x: 943.9, y: 754.05), controlPoint2: CGPoint(x: 940.79, y: 757.23)) bezier24Path.close() bezier24Path.usesEvenOddFillRule = true dark.setFill() bezier24Path.fill() //// Bezier 25 Drawing let bezier25Path = UIBezierPath() bezier25Path.move(to: CGPoint(x: 476.95, y: 757.23)) bezier25Path.addLine(to: CGPoint(x: 61.95, y: 757.23)) bezier25Path.addCurve(to: CGPoint(x: 55, y: 750.11), controlPoint1: CGPoint(x: 58.11, y: 757.23), controlPoint2: CGPoint(x: 55, y: 754.05)) bezier25Path.addCurve(to: CGPoint(x: 61.95, y: 743.01), controlPoint1: CGPoint(x: 55, y: 746.19), controlPoint2: CGPoint(x: 58.11, y: 743.01)) bezier25Path.addLine(to: CGPoint(x: 476.95, y: 743.01)) bezier25Path.addCurve(to: CGPoint(x: 483.89, y: 750.11), controlPoint1: CGPoint(x: 480.79, y: 743.01), controlPoint2: CGPoint(x: 483.89, y: 746.19)) bezier25Path.addCurve(to: CGPoint(x: 476.95, y: 757.23), controlPoint1: CGPoint(x: 483.89, y: 754.05), controlPoint2: CGPoint(x: 480.79, y: 757.23)) bezier25Path.close() bezier25Path.usesEvenOddFillRule = true dark.setFill() bezier25Path.fill() //// Rectangle 11 Drawing let rectangle11Path = UIBezierPath(roundedRect: CGRect(x: 930, y: 229, width: 14, height: 97), cornerRadius: 7) dark.setFill() rectangle11Path.fill() //// Bezier 26 Drawing let bezier26Path = UIBezierPath() bezier26Path.move(to: CGPoint(x: 763.2, y: 298.43)) bezier26Path.addLine(to: CGPoint(x: 888.22, y: 298.43)) bezier26Path.addLine(to: CGPoint(x: 888.22, y: 256.75)) bezier26Path.addLine(to: CGPoint(x: 763.2, y: 256.75)) bezier26Path.addLine(to: CGPoint(x: 763.2, y: 298.43)) bezier26Path.close() bezier26Path.move(to: CGPoint(x: 895.17, y: 312.32)) bezier26Path.addLine(to: CGPoint(x: 756.26, y: 312.32)) bezier26Path.addCurve(to: CGPoint(x: 749.31, y: 305.37), controlPoint1: CGPoint(x: 752.42, y: 312.32), controlPoint2: CGPoint(x: 749.31, y: 309.21)) bezier26Path.addLine(to: CGPoint(x: 749.31, y: 249.8)) bezier26Path.addCurve(to: CGPoint(x: 756.26, y: 242.85), controlPoint1: CGPoint(x: 749.31, y: 245.96), controlPoint2: CGPoint(x: 752.42, y: 242.85)) bezier26Path.addLine(to: CGPoint(x: 895.17, y: 242.85)) bezier26Path.addCurve(to: CGPoint(x: 902.12, y: 249.8), controlPoint1: CGPoint(x: 899.01, y: 242.85), controlPoint2: CGPoint(x: 902.12, y: 245.96)) bezier26Path.addLine(to: CGPoint(x: 902.12, y: 305.37)) bezier26Path.addCurve(to: CGPoint(x: 895.17, y: 312.32), controlPoint1: CGPoint(x: 902.12, y: 309.21), controlPoint2: CGPoint(x: 899.01, y: 312.32)) bezier26Path.close() bezier26Path.usesEvenOddFillRule = true dark.setFill() bezier26Path.fill() //// Bezier 27 Drawing let bezier27Path = UIBezierPath() bezier27Path.move(to: CGPoint(x: 922.95, y: 228.96)) bezier27Path.addLine(to: CGPoint(x: 450.64, y: 228.96)) bezier27Path.addCurve(to: CGPoint(x: 443.69, y: 222.01), controlPoint1: CGPoint(x: 446.8, y: 228.96), controlPoint2: CGPoint(x: 443.69, y: 225.85)) bezier27Path.addCurve(to: CGPoint(x: 450.64, y: 215.07), controlPoint1: CGPoint(x: 443.69, y: 218.17), controlPoint2: CGPoint(x: 446.8, y: 215.07)) bezier27Path.addLine(to: CGPoint(x: 922.95, y: 215.07)) bezier27Path.addCurve(to: CGPoint(x: 929.9, y: 222.01), controlPoint1: CGPoint(x: 926.79, y: 215.07), controlPoint2: CGPoint(x: 929.9, y: 218.17)) bezier27Path.addCurve(to: CGPoint(x: 922.95, y: 228.96), controlPoint1: CGPoint(x: 929.9, y: 225.85), controlPoint2: CGPoint(x: 926.79, y: 228.96)) bezier27Path.close() bezier27Path.usesEvenOddFillRule = true dark.setFill() bezier27Path.fill() //// Rectangle 12 Drawing let rectangle12Path = UIBezierPath(roundedRect: CGRect(x: 443.7, y: 215.07, width: 13.9, height: 69.45), cornerRadius: 6.95) dark.setFill() rectangle12Path.fill() //// Bezier 28 Drawing let bezier28Path = UIBezierPath() bezier28Path.move(to: CGPoint(x: 451.05, y: 285)) bezier28Path.addLine(to: CGPoint(x: 75.95, y: 285)) bezier28Path.addCurve(to: CGPoint(x: 69, y: 278), controlPoint1: CGPoint(x: 72.11, y: 285), controlPoint2: CGPoint(x: 69, y: 281.87)) bezier28Path.addCurve(to: CGPoint(x: 75.95, y: 271), controlPoint1: CGPoint(x: 69, y: 274.13), controlPoint2: CGPoint(x: 72.11, y: 271)) bezier28Path.addLine(to: CGPoint(x: 451.05, y: 271)) bezier28Path.addCurve(to: CGPoint(x: 458, y: 278), controlPoint1: CGPoint(x: 454.89, y: 271), controlPoint2: CGPoint(x: 458, y: 274.13)) bezier28Path.addCurve(to: CGPoint(x: 451.05, y: 285), controlPoint1: CGPoint(x: 458, y: 281.87), controlPoint2: CGPoint(x: 454.89, y: 285)) bezier28Path.close() bezier28Path.usesEvenOddFillRule = true dark.setFill() bezier28Path.fill() //// Bezier 29 Drawing let bezier29Path = UIBezierPath() bezier29Path.move(to: CGPoint(x: 485.91, y: 299)) bezier29Path.addLine(to: CGPoint(x: 611.09, y: 299)) bezier29Path.addLine(to: CGPoint(x: 611.09, y: 285)) bezier29Path.addLine(to: CGPoint(x: 485.91, y: 285)) bezier29Path.addLine(to: CGPoint(x: 485.91, y: 299)) bezier29Path.close() bezier29Path.move(to: CGPoint(x: 618.05, y: 313)) bezier29Path.addLine(to: CGPoint(x: 478.96, y: 313)) bezier29Path.addCurve(to: CGPoint(x: 472, y: 306), controlPoint1: CGPoint(x: 475.11, y: 313), controlPoint2: CGPoint(x: 472, y: 309.87)) bezier29Path.addLine(to: CGPoint(x: 472, y: 278)) bezier29Path.addCurve(to: CGPoint(x: 478.96, y: 271), controlPoint1: CGPoint(x: 472, y: 274.13), controlPoint2: CGPoint(x: 475.11, y: 271)) bezier29Path.addLine(to: CGPoint(x: 618.05, y: 271)) bezier29Path.addCurve(to: CGPoint(x: 625, y: 278), controlPoint1: CGPoint(x: 621.89, y: 271), controlPoint2: CGPoint(x: 625, y: 274.13)) bezier29Path.addLine(to: CGPoint(x: 625, y: 306)) bezier29Path.addCurve(to: CGPoint(x: 618.05, y: 313), controlPoint1: CGPoint(x: 625, y: 309.87), controlPoint2: CGPoint(x: 621.89, y: 313)) bezier29Path.close() bezier29Path.usesEvenOddFillRule = true dark.setFill() bezier29Path.fill() //// Rectangle 13 Drawing let rectangle13Path = UIBezierPath(roundedRect: CGRect(x: 499, y: 271, width: 14, height: 42), cornerRadius: 7) dark.setFill() rectangle13Path.fill() //// Rectangle 14 Drawing let rectangle14Path = UIBezierPath(roundedRect: CGRect(x: 541, y: 271, width: 14, height: 42), cornerRadius: 7) dark.setFill() rectangle14Path.fill() //// Rectangle 15 Drawing let rectangle15Path = UIBezierPath(roundedRect: CGRect(x: 583, y: 271, width: 14, height: 42), cornerRadius: 7) dark.setFill() rectangle15Path.fill() //// Bezier 30 Drawing let bezier30Path = UIBezierPath() bezier30Path.move(to: CGPoint(x: 388, y: 368)) bezier30Path.addCurve(to: CGPoint(x: 374, y: 382), controlPoint1: CGPoint(x: 380.28, y: 368), controlPoint2: CGPoint(x: 374, y: 374.28)) bezier30Path.addCurve(to: CGPoint(x: 388, y: 396), controlPoint1: CGPoint(x: 374, y: 389.72), controlPoint2: CGPoint(x: 380.28, y: 396)) bezier30Path.addCurve(to: CGPoint(x: 402, y: 382), controlPoint1: CGPoint(x: 395.72, y: 396), controlPoint2: CGPoint(x: 402, y: 389.72)) bezier30Path.addCurve(to: CGPoint(x: 388, y: 368), controlPoint1: CGPoint(x: 402, y: 374.28), controlPoint2: CGPoint(x: 395.72, y: 368)) bezier30Path.close() bezier30Path.move(to: CGPoint(x: 388, y: 410)) bezier30Path.addCurve(to: CGPoint(x: 360, y: 382), controlPoint1: CGPoint(x: 372.56, y: 410), controlPoint2: CGPoint(x: 360, y: 397.44)) bezier30Path.addCurve(to: CGPoint(x: 388, y: 354), controlPoint1: CGPoint(x: 360, y: 366.56), controlPoint2: CGPoint(x: 372.56, y: 354)) bezier30Path.addCurve(to: CGPoint(x: 416, y: 382), controlPoint1: CGPoint(x: 403.44, y: 354), controlPoint2: CGPoint(x: 416, y: 366.56)) bezier30Path.addCurve(to: CGPoint(x: 388, y: 410), controlPoint1: CGPoint(x: 416, y: 397.44), controlPoint2: CGPoint(x: 403.44, y: 410)) bezier30Path.close() bezier30Path.usesEvenOddFillRule = true dark.setFill() bezier30Path.fill() //// Bezier 31 Drawing let bezier31Path = UIBezierPath() bezier31Path.move(to: CGPoint(x: 311.5, y: 354)) bezier31Path.addCurve(to: CGPoint(x: 299.94, y: 357.53), controlPoint1: CGPoint(x: 307.26, y: 354), controlPoint2: CGPoint(x: 303.27, y: 355.22)) bezier31Path.addCurve(to: CGPoint(x: 290.8, y: 375), controlPoint1: CGPoint(x: 294.21, y: 361.49), controlPoint2: CGPoint(x: 290.8, y: 368.01)) bezier31Path.addCurve(to: CGPoint(x: 311.5, y: 396), controlPoint1: CGPoint(x: 290.8, y: 386.58), controlPoint2: CGPoint(x: 300.09, y: 396)) bezier31Path.addCurve(to: CGPoint(x: 332.2, y: 375), controlPoint1: CGPoint(x: 322.91, y: 396), controlPoint2: CGPoint(x: 332.2, y: 386.58)) bezier31Path.addCurve(to: CGPoint(x: 311.5, y: 354), controlPoint1: CGPoint(x: 332.2, y: 363.42), controlPoint2: CGPoint(x: 322.91, y: 354)) bezier31Path.close() bezier31Path.move(to: CGPoint(x: 311.5, y: 410)) bezier31Path.addCurve(to: CGPoint(x: 277, y: 375), controlPoint1: CGPoint(x: 292.48, y: 410), controlPoint2: CGPoint(x: 277, y: 394.3)) bezier31Path.addCurve(to: CGPoint(x: 292.16, y: 345.97), controlPoint1: CGPoint(x: 277, y: 363.37), controlPoint2: CGPoint(x: 282.67, y: 352.52)) bezier31Path.addCurve(to: CGPoint(x: 311.5, y: 340), controlPoint1: CGPoint(x: 297.77, y: 342.07), controlPoint2: CGPoint(x: 304.46, y: 340)) bezier31Path.addCurve(to: CGPoint(x: 346, y: 375), controlPoint1: CGPoint(x: 330.52, y: 340), controlPoint2: CGPoint(x: 346, y: 355.7)) bezier31Path.addCurve(to: CGPoint(x: 311.5, y: 410), controlPoint1: CGPoint(x: 346, y: 394.3), controlPoint2: CGPoint(x: 330.52, y: 410)) bezier31Path.close() bezier31Path.usesEvenOddFillRule = true dark.setFill() bezier31Path.fill() //// Rectangle 16 Drawing let rectangle16Path = UIBezierPath(roundedRect: CGRect(x: 305, y: 312, width: 14, height: 42), cornerRadius: 7) dark.setFill() rectangle16Path.fill() //// Bezier 32 Drawing let bezier32Path = UIBezierPath() bezier32Path.move(to: CGPoint(x: 936.95, y: 340.31)) bezier32Path.addLine(to: CGPoint(x: 325.65, y: 340.31)) bezier32Path.addCurve(to: CGPoint(x: 318.71, y: 333.35), controlPoint1: CGPoint(x: 321.81, y: 340.31), controlPoint2: CGPoint(x: 318.71, y: 337.2)) bezier32Path.addCurve(to: CGPoint(x: 325.65, y: 326.4), controlPoint1: CGPoint(x: 318.71, y: 329.51), controlPoint2: CGPoint(x: 321.81, y: 326.4)) bezier32Path.addLine(to: CGPoint(x: 936.95, y: 326.4)) bezier32Path.addCurve(to: CGPoint(x: 943.9, y: 333.35), controlPoint1: CGPoint(x: 940.79, y: 326.4), controlPoint2: CGPoint(x: 943.9, y: 329.51)) bezier32Path.addCurve(to: CGPoint(x: 936.95, y: 340.31), controlPoint1: CGPoint(x: 943.9, y: 337.2), controlPoint2: CGPoint(x: 940.79, y: 340.31)) bezier32Path.close() bezier32Path.usesEvenOddFillRule = true dark.setFill() bezier32Path.fill() //// Rectangle 17 Drawing let rectangle17Path = UIBezierPath(roundedRect: CGRect(x: 415.95, y: 215.05, width: 13.9, height: 69.6), cornerRadius: 6.95) dark.setFill() rectangle17Path.fill() //// Rectangle 18 Drawing let rectangle18Path = UIBezierPath(roundedRect: CGRect(x: 415.95, y: 215.05, width: 41.7, height: 13.9), cornerRadius: 6.95) dark.setFill() rectangle18Path.fill() //// Bezier 33 Drawing let bezier33Path = UIBezierPath() bezier33Path.move(to: CGPoint(x: 284, y: 271)) bezier33Path.addCurve(to: CGPoint(x: 277, y: 264), controlPoint1: CGPoint(x: 280.13, y: 271), controlPoint2: CGPoint(x: 277, y: 267.87)) bezier33Path.addLine(to: CGPoint(x: 277, y: 250)) bezier33Path.addCurve(to: CGPoint(x: 284, y: 243), controlPoint1: CGPoint(x: 277, y: 246.13), controlPoint2: CGPoint(x: 280.13, y: 243)) bezier33Path.addCurve(to: CGPoint(x: 291, y: 250), controlPoint1: CGPoint(x: 287.87, y: 243), controlPoint2: CGPoint(x: 291, y: 246.13)) bezier33Path.addLine(to: CGPoint(x: 291, y: 264)) bezier33Path.addCurve(to: CGPoint(x: 284, y: 271), controlPoint1: CGPoint(x: 291, y: 267.87), controlPoint2: CGPoint(x: 287.87, y: 271)) bezier33Path.close() bezier33Path.usesEvenOddFillRule = true dark.setFill() bezier33Path.fill() //// Bezier 34 Drawing let bezier34Path = UIBezierPath() bezier34Path.move(to: CGPoint(x: 395.05, y: 257)) bezier34Path.addLine(to: CGPoint(x: 283.95, y: 257)) bezier34Path.addCurve(to: CGPoint(x: 277, y: 250), controlPoint1: CGPoint(x: 280.11, y: 257), controlPoint2: CGPoint(x: 277, y: 253.87)) bezier34Path.addCurve(to: CGPoint(x: 283.95, y: 243), controlPoint1: CGPoint(x: 277, y: 246.13), controlPoint2: CGPoint(x: 280.11, y: 243)) bezier34Path.addLine(to: CGPoint(x: 395.05, y: 243)) bezier34Path.addCurve(to: CGPoint(x: 402, y: 250), controlPoint1: CGPoint(x: 398.89, y: 243), controlPoint2: CGPoint(x: 402, y: 246.13)) bezier34Path.addCurve(to: CGPoint(x: 395.05, y: 257), controlPoint1: CGPoint(x: 402, y: 253.87), controlPoint2: CGPoint(x: 398.89, y: 257)) bezier34Path.close() bezier34Path.usesEvenOddFillRule = true dark.setFill() bezier34Path.fill() //// Rectangle 19 Drawing let rectangle19Path = UIBezierPath(roundedRect: CGRect(x: 388, y: 243, width: 14, height: 28), cornerRadius: 7) dark.setFill() rectangle19Path.fill() //// Rectangle 20 Drawing let rectangle20Path = UIBezierPath(roundedRect: CGRect(x: 305, y: 243, width: 14, height: 21), cornerRadius: 7) dark.setFill() rectangle20Path.fill() //// Rectangle 21 Drawing let rectangle21Path = UIBezierPath(roundedRect: CGRect(x: 333, y: 243, width: 14, height: 21), cornerRadius: 7) dark.setFill() rectangle21Path.fill() //// Rectangle 22 Drawing let rectangle22Path = UIBezierPath(roundedRect: CGRect(x: 361, y: 243, width: 14, height: 21), cornerRadius: 7) dark.setFill() rectangle22Path.fill() //// Rectangle 23 Drawing let rectangle23Path = UIBezierPath(roundedRect: CGRect(x: 166, y: 243, width: 97, height: 14), cornerRadius: 7) dark.setFill() rectangle23Path.fill() //// Rectangle 24 Drawing let rectangle24Path = UIBezierPath(roundedRect: CGRect(x: 69, y: 243, width: 14, height: 28), cornerRadius: 7) dark.setFill() rectangle24Path.fill() //// Rectangle 25 Drawing let rectangle25Path = UIBezierPath(roundedRect: CGRect(x: 69, y: 243, width: 83, height: 14), cornerRadius: 7) dark.setFill() rectangle25Path.fill() //// Rectangle 26 Drawing let rectangle26Path = UIBezierPath(roundedRect: CGRect(x: 138, y: 243, width: 14, height: 28), cornerRadius: 7) dark.setFill() rectangle26Path.fill() //// Rectangle 27 Drawing let rectangle27Path = UIBezierPath(roundedRect: CGRect(x: 180, y: 243, width: 14, height: 28), cornerRadius: 7) dark.setFill() rectangle27Path.fill() //// Rectangle 28 Drawing let rectangle28Path = UIBezierPath(roundedRect: CGRect(x: 236, y: 243, width: 14, height: 28), cornerRadius: 7) dark.setFill() rectangle28Path.fill() //// Bezier 35 Drawing let bezier35Path = UIBezierPath() bezier35Path.move(to: CGPoint(x: 242.05, y: 242.91)) bezier35Path.addCurve(to: CGPoint(x: 237.15, y: 240.88), controlPoint1: CGPoint(x: 240.28, y: 242.91), controlPoint2: CGPoint(x: 238.51, y: 242.24)) bezier35Path.addCurve(to: CGPoint(x: 214.34, y: 235.97), controlPoint1: CGPoint(x: 237.13, y: 240.88), controlPoint2: CGPoint(x: 231.08, y: 235.97)) bezier35Path.addCurve(to: CGPoint(x: 191.35, y: 241.05), controlPoint1: CGPoint(x: 197.41, y: 235.97), controlPoint2: CGPoint(x: 191.41, y: 241)) bezier35Path.addCurve(to: CGPoint(x: 181.65, y: 240.62), controlPoint1: CGPoint(x: 188.52, y: 243.48), controlPoint2: CGPoint(x: 184.2, y: 243.34)) bezier35Path.addCurve(to: CGPoint(x: 181.73, y: 231.05), controlPoint1: CGPoint(x: 179.11, y: 237.87), controlPoint2: CGPoint(x: 179.09, y: 233.7)) bezier35Path.addCurve(to: CGPoint(x: 214.34, y: 222.07), controlPoint1: CGPoint(x: 183.23, y: 229.55), controlPoint2: CGPoint(x: 191.83, y: 222.07)) bezier35Path.addCurve(to: CGPoint(x: 246.95, y: 231.05), controlPoint1: CGPoint(x: 236.86, y: 222.07), controlPoint2: CGPoint(x: 245.46, y: 229.55)) bezier35Path.addCurve(to: CGPoint(x: 246.95, y: 240.88), controlPoint1: CGPoint(x: 249.66, y: 233.77), controlPoint2: CGPoint(x: 249.66, y: 238.17)) bezier35Path.addCurve(to: CGPoint(x: 242.05, y: 242.91), controlPoint1: CGPoint(x: 245.59, y: 242.24), controlPoint2: CGPoint(x: 243.82, y: 242.91)) bezier35Path.close() bezier35Path.usesEvenOddFillRule = true dark.setFill() bezier35Path.fill() //// Bezier 36 Drawing let bezier36Path = UIBezierPath() bezier36Path.move(to: CGPoint(x: 61.93, y: 298.52)) bezier36Path.addCurve(to: CGPoint(x: 55, y: 291.57), controlPoint1: CGPoint(x: 58.1, y: 298.52), controlPoint2: CGPoint(x: 55, y: 295.41)) bezier36Path.addCurve(to: CGPoint(x: 75.78, y: 270.72), controlPoint1: CGPoint(x: 55, y: 280.07), controlPoint2: CGPoint(x: 64.32, y: 270.72)) bezier36Path.addCurve(to: CGPoint(x: 82.71, y: 277.67), controlPoint1: CGPoint(x: 79.61, y: 270.72), controlPoint2: CGPoint(x: 82.71, y: 273.82)) bezier36Path.addCurve(to: CGPoint(x: 75.78, y: 284.62), controlPoint1: CGPoint(x: 82.71, y: 281.51), controlPoint2: CGPoint(x: 79.61, y: 284.62)) bezier36Path.addCurve(to: CGPoint(x: 68.86, y: 291.57), controlPoint1: CGPoint(x: 71.96, y: 284.62), controlPoint2: CGPoint(x: 68.86, y: 287.73)) bezier36Path.addCurve(to: CGPoint(x: 61.93, y: 298.52), controlPoint1: CGPoint(x: 68.86, y: 295.41), controlPoint2: CGPoint(x: 65.76, y: 298.52)) bezier36Path.close() bezier36Path.usesEvenOddFillRule = true dark.setFill() bezier36Path.fill() //// Bezier 37 Drawing let bezier37Path = UIBezierPath() bezier37Path.move(to: CGPoint(x: 61.93, y: 326.32)) bezier37Path.addCurve(to: CGPoint(x: 55, y: 319.37), controlPoint1: CGPoint(x: 58.1, y: 326.32), controlPoint2: CGPoint(x: 55, y: 323.21)) bezier37Path.addLine(to: CGPoint(x: 55, y: 291.57)) bezier37Path.addCurve(to: CGPoint(x: 61.93, y: 284.62), controlPoint1: CGPoint(x: 55, y: 287.72), controlPoint2: CGPoint(x: 58.1, y: 284.62)) bezier37Path.addCurve(to: CGPoint(x: 68.86, y: 291.57), controlPoint1: CGPoint(x: 65.76, y: 284.62), controlPoint2: CGPoint(x: 68.86, y: 287.72)) bezier37Path.addLine(to: CGPoint(x: 68.86, y: 319.37)) bezier37Path.addCurve(to: CGPoint(x: 61.93, y: 326.32), controlPoint1: CGPoint(x: 68.86, y: 323.21), controlPoint2: CGPoint(x: 65.76, y: 326.32)) bezier37Path.close() bezier37Path.usesEvenOddFillRule = true dark.setFill() bezier37Path.fill() //// Bezier 38 Drawing let bezier38Path = UIBezierPath() bezier38Path.move(to: CGPoint(x: 825.5, y: 257)) bezier38Path.addCurve(to: CGPoint(x: 804.8, y: 278), controlPoint1: CGPoint(x: 814.09, y: 257), controlPoint2: CGPoint(x: 804.8, y: 266.42)) bezier38Path.addCurve(to: CGPoint(x: 825.5, y: 299), controlPoint1: CGPoint(x: 804.8, y: 289.58), controlPoint2: CGPoint(x: 814.09, y: 299)) bezier38Path.addCurve(to: CGPoint(x: 846.2, y: 278), controlPoint1: CGPoint(x: 836.91, y: 299), controlPoint2: CGPoint(x: 846.2, y: 289.58)) bezier38Path.addCurve(to: CGPoint(x: 825.5, y: 257), controlPoint1: CGPoint(x: 846.2, y: 266.42), controlPoint2: CGPoint(x: 836.91, y: 257)) bezier38Path.close() bezier38Path.move(to: CGPoint(x: 825.5, y: 313)) bezier38Path.addCurve(to: CGPoint(x: 791, y: 278), controlPoint1: CGPoint(x: 806.47, y: 313), controlPoint2: CGPoint(x: 791, y: 297.3)) bezier38Path.addCurve(to: CGPoint(x: 825.5, y: 243), controlPoint1: CGPoint(x: 791, y: 258.7), controlPoint2: CGPoint(x: 806.47, y: 243)) bezier38Path.addCurve(to: CGPoint(x: 860, y: 278), controlPoint1: CGPoint(x: 844.53, y: 243), controlPoint2: CGPoint(x: 860, y: 258.7)) bezier38Path.addCurve(to: CGPoint(x: 825.5, y: 313), controlPoint1: CGPoint(x: 860, y: 297.3), controlPoint2: CGPoint(x: 844.53, y: 313)) bezier38Path.close() bezier38Path.usesEvenOddFillRule = true dark.setFill() bezier38Path.fill() //// Oval 9 Drawing let oval9Path = UIBezierPath(ovalIn: CGRect(x: 82.95, y: 688.05, width: 14, height: 13.9)) dark.setFill() oval9Path.fill() //// Oval 10 Drawing let oval10Path = UIBezierPath(ovalIn: CGRect(x: 110.95, y: 715.05, width: 14, height: 13.9)) dark.setFill() oval10Path.fill() //// Oval 11 Drawing let oval11Path = UIBezierPath(ovalIn: CGRect(x: 82.95, y: 632.05, width: 14, height: 13.9)) dark.setFill() oval11Path.fill() //// Oval 12 Drawing let oval12Path = UIBezierPath(ovalIn: CGRect(x: 110.95, y: 660.05, width: 14, height: 13.9)) dark.setFill() oval12Path.fill() //// Oval 13 Drawing let oval13Path = UIBezierPath(ovalIn: CGRect(x: 138.95, y: 688.05, width: 14, height: 13.9)) dark.setFill() oval13Path.fill() //// Oval 14 Drawing let oval14Path = UIBezierPath(ovalIn: CGRect(x: 165.95, y: 715.05, width: 14, height: 13.9)) dark.setFill() oval14Path.fill() //// Oval 15 Drawing let oval15Path = UIBezierPath(ovalIn: CGRect(x: 82.95, y: 576.05, width: 14, height: 13.9)) dark.setFill() oval15Path.fill() //// Oval 16 Drawing let oval16Path = UIBezierPath(ovalIn: CGRect(x: 110.95, y: 604.05, width: 14, height: 13.9)) dark.setFill() oval16Path.fill() //// Oval 17 Drawing let oval17Path = UIBezierPath(ovalIn: CGRect(x: 138.95, y: 632.05, width: 14, height: 13.9)) dark.setFill() oval17Path.fill() //// Oval 18 Drawing let oval18Path = UIBezierPath(ovalIn: CGRect(x: 165.95, y: 660.05, width: 14, height: 13.9)) dark.setFill() oval18Path.fill() //// Oval 19 Drawing let oval19Path = UIBezierPath(ovalIn: CGRect(x: 193.95, y: 688.05, width: 14, height: 13.9)) dark.setFill() oval19Path.fill() //// Oval 20 Drawing let oval20Path = UIBezierPath(ovalIn: CGRect(x: 221.95, y: 715.05, width: 14, height: 13.9)) dark.setFill() oval20Path.fill() //// Oval 21 Drawing let oval21Path = UIBezierPath(ovalIn: CGRect(x: 82.95, y: 521.05, width: 14, height: 13.9)) dark.setFill() oval21Path.fill() //// Oval 22 Drawing let oval22Path = UIBezierPath(ovalIn: CGRect(x: 110.95, y: 549.05, width: 14, height: 13.9)) dark.setFill() oval22Path.fill() //// Oval 23 Drawing let oval23Path = UIBezierPath(ovalIn: CGRect(x: 138.95, y: 576.05, width: 14, height: 13.9)) dark.setFill() oval23Path.fill() //// Oval 24 Drawing let oval24Path = UIBezierPath(ovalIn: CGRect(x: 165.95, y: 604.05, width: 14, height: 13.9)) dark.setFill() oval24Path.fill() //// Oval 25 Drawing let oval25Path = UIBezierPath(ovalIn: CGRect(x: 193.95, y: 632.05, width: 14, height: 13.9)) dark.setFill() oval25Path.fill() //// Oval 26 Drawing let oval26Path = UIBezierPath(ovalIn: CGRect(x: 221.95, y: 660.05, width: 14, height: 13.9)) dark.setFill() oval26Path.fill() //// Oval 27 Drawing let oval27Path = UIBezierPath(ovalIn: CGRect(x: 249.95, y: 688.05, width: 14, height: 13.9)) dark.setFill() oval27Path.fill() //// Oval 28 Drawing let oval28Path = UIBezierPath(ovalIn: CGRect(x: 277.95, y: 715.05, width: 14, height: 13.9)) dark.setFill() oval28Path.fill() //// Oval 29 Drawing let oval29Path = UIBezierPath(ovalIn: CGRect(x: 82.95, y: 465.05, width: 14, height: 13.9)) dark.setFill() oval29Path.fill() //// Oval 30 Drawing let oval30Path = UIBezierPath(ovalIn: CGRect(x: 110.95, y: 493.05, width: 14, height: 13.9)) dark.setFill() oval30Path.fill() //// Oval 31 Drawing let oval31Path = UIBezierPath(ovalIn: CGRect(x: 138.95, y: 521.05, width: 14, height: 13.9)) dark.setFill() oval31Path.fill() //// Oval 32 Drawing let oval32Path = UIBezierPath(ovalIn: CGRect(x: 165.95, y: 549.05, width: 14, height: 13.9)) dark.setFill() oval32Path.fill() //// Oval 33 Drawing let oval33Path = UIBezierPath(ovalIn: CGRect(x: 193.95, y: 576.05, width: 14, height: 13.9)) dark.setFill() oval33Path.fill() //// Oval 34 Drawing let oval34Path = UIBezierPath(ovalIn: CGRect(x: 221.95, y: 604.05, width: 14, height: 13.9)) dark.setFill() oval34Path.fill() //// Oval 35 Drawing let oval35Path = UIBezierPath(ovalIn: CGRect(x: 249.95, y: 632.05, width: 14, height: 13.9)) dark.setFill() oval35Path.fill() //// Oval 36 Drawing let oval36Path = UIBezierPath(ovalIn: CGRect(x: 277.95, y: 660.05, width: 14, height: 13.9)) dark.setFill() oval36Path.fill() //// Oval 37 Drawing let oval37Path = UIBezierPath(ovalIn: CGRect(x: 304.95, y: 688.05, width: 14, height: 13.9)) dark.setFill() oval37Path.fill() //// Oval 38 Drawing let oval38Path = UIBezierPath(ovalIn: CGRect(x: 332.95, y: 715.05, width: 14, height: 13.9)) dark.setFill() oval38Path.fill() //// Oval 39 Drawing let oval39Path = UIBezierPath(ovalIn: CGRect(x: 82.95, y: 410.05, width: 14, height: 13.9)) dark.setFill() oval39Path.fill() //// Oval 40 Drawing let oval40Path = UIBezierPath(ovalIn: CGRect(x: 110.95, y: 437.05, width: 14, height: 13.9)) dark.setFill() oval40Path.fill() //// Oval 41 Drawing let oval41Path = UIBezierPath(ovalIn: CGRect(x: 138.95, y: 465.05, width: 14, height: 13.9)) dark.setFill() oval41Path.fill() //// Oval 42 Drawing let oval42Path = UIBezierPath(ovalIn: CGRect(x: 165.95, y: 493.05, width: 14, height: 13.9)) dark.setFill() oval42Path.fill() //// Oval 43 Drawing let oval43Path = UIBezierPath(ovalIn: CGRect(x: 193.95, y: 521.05, width: 14, height: 13.9)) dark.setFill() oval43Path.fill() //// Oval 44 Drawing let oval44Path = UIBezierPath(ovalIn: CGRect(x: 221.95, y: 549.05, width: 14, height: 13.9)) dark.setFill() oval44Path.fill() //// Oval 45 Drawing let oval45Path = UIBezierPath(ovalIn: CGRect(x: 249.95, y: 576.05, width: 14, height: 13.9)) dark.setFill() oval45Path.fill() //// Oval 46 Drawing let oval46Path = UIBezierPath(ovalIn: CGRect(x: 277.95, y: 604.05, width: 14, height: 13.9)) dark.setFill() oval46Path.fill() //// Oval 47 Drawing let oval47Path = UIBezierPath(ovalIn: CGRect(x: 304.95, y: 632.05, width: 14, height: 13.9)) dark.setFill() oval47Path.fill() //// Oval 48 Drawing let oval48Path = UIBezierPath(ovalIn: CGRect(x: 332.95, y: 660.05, width: 14, height: 13.9)) dark.setFill() oval48Path.fill() //// Oval 49 Drawing let oval49Path = UIBezierPath(ovalIn: CGRect(x: 360.95, y: 688.05, width: 14, height: 13.9)) dark.setFill() oval49Path.fill() //// Oval 50 Drawing let oval50Path = UIBezierPath(ovalIn: CGRect(x: 388.95, y: 715.05, width: 14, height: 13.9)) dark.setFill() oval50Path.fill() //// Oval 51 Drawing let oval51Path = UIBezierPath(ovalIn: CGRect(x: 110.95, y: 382.05, width: 14, height: 13.9)) dark.setFill() oval51Path.fill() //// Oval 52 Drawing let oval52Path = UIBezierPath(ovalIn: CGRect(x: 138.95, y: 410.05, width: 14, height: 13.9)) dark.setFill() oval52Path.fill() //// Oval 53 Drawing let oval53Path = UIBezierPath(ovalIn: CGRect(x: 165.95, y: 437.05, width: 14, height: 13.9)) dark.setFill() oval53Path.fill() //// Oval 54 Drawing let oval54Path = UIBezierPath(ovalIn: CGRect(x: 193.95, y: 465.05, width: 14, height: 13.9)) dark.setFill() oval54Path.fill() //// Oval 55 Drawing let oval55Path = UIBezierPath(ovalIn: CGRect(x: 221.95, y: 493.05, width: 14, height: 13.9)) dark.setFill() oval55Path.fill() //// Oval 56 Drawing let oval56Path = UIBezierPath(ovalIn: CGRect(x: 249.95, y: 521.05, width: 14, height: 13.9)) dark.setFill() oval56Path.fill() //// Oval 57 Drawing let oval57Path = UIBezierPath(ovalIn: CGRect(x: 277.95, y: 549.05, width: 14, height: 13.9)) dark.setFill() oval57Path.fill() //// Oval 58 Drawing let oval58Path = UIBezierPath(ovalIn: CGRect(x: 304.95, y: 576.05, width: 14, height: 13.9)) dark.setFill() oval58Path.fill() //// Oval 59 Drawing let oval59Path = UIBezierPath(ovalIn: CGRect(x: 165.95, y: 382.05, width: 14, height: 13.9)) dark.setFill() oval59Path.fill() //// Oval 60 Drawing let oval60Path = UIBezierPath(ovalIn: CGRect(x: 193.95, y: 410.05, width: 14, height: 13.9)) dark.setFill() oval60Path.fill() //// Oval 61 Drawing let oval61Path = UIBezierPath(ovalIn: CGRect(x: 221.95, y: 437.05, width: 14, height: 13.9)) dark.setFill() oval61Path.fill() //// Oval 62 Drawing let oval62Path = UIBezierPath(ovalIn: CGRect(x: 249.95, y: 465.05, width: 14, height: 13.9)) dark.setFill() oval62Path.fill() //// Oval 63 Drawing let oval63Path = UIBezierPath(ovalIn: CGRect(x: 277.95, y: 493.05, width: 14, height: 13.9)) dark.setFill() oval63Path.fill() //// Oval 64 Drawing let oval64Path = UIBezierPath(ovalIn: CGRect(x: 304.95, y: 521.05, width: 14, height: 13.9)) dark.setFill() oval64Path.fill() //// Oval 65 Drawing let oval65Path = UIBezierPath(ovalIn: CGRect(x: 221.95, y: 382.05, width: 14, height: 13.9)) dark.setFill() oval65Path.fill() //// Oval 66 Drawing let oval66Path = UIBezierPath(ovalIn: CGRect(x: 249.95, y: 410.05, width: 14, height: 13.9)) dark.setFill() oval66Path.fill() //// Oval 67 Drawing let oval67Path = UIBezierPath(ovalIn: CGRect(x: 82.95, y: 354.05, width: 14, height: 13.9)) dark.setFill() oval67Path.fill() //// Oval 68 Drawing let oval68Path = UIBezierPath(ovalIn: CGRect(x: 138.95, y: 354.05, width: 14, height: 13.9)) dark.setFill() oval68Path.fill() //// Oval 69 Drawing let oval69Path = UIBezierPath(ovalIn: CGRect(x: 193.95, y: 354.05, width: 14, height: 13.9)) dark.setFill() oval69Path.fill() //// Oval 70 Drawing let oval70Path = UIBezierPath(ovalIn: CGRect(x: 249.95, y: 354.05, width: 14, height: 13.9)) dark.setFill() oval70Path.fill() //// Oval 71 Drawing let oval71Path = UIBezierPath(ovalIn: CGRect(x: 277.95, y: 437.05, width: 14, height: 13.9)) dark.setFill() oval71Path.fill() //// Oval 72 Drawing let oval72Path = UIBezierPath(ovalIn: CGRect(x: 304.95, y: 465.05, width: 14, height: 13.9)) dark.setFill() oval72Path.fill() //// Oval 73 Drawing let oval73Path = UIBezierPath(ovalIn: CGRect(x: 360.95, y: 465.05, width: 14, height: 13.9)) dark.setFill() oval73Path.fill() //// Oval 74 Drawing let oval74Path = UIBezierPath(ovalIn: CGRect(x: 332.95, y: 437.05, width: 14, height: 13.9)) dark.setFill() oval74Path.fill() //// Oval 75 Drawing let oval75Path = UIBezierPath(ovalIn: CGRect(x: 777.95, y: 715.05, width: 14, height: 13.9)) dark.setFill() oval75Path.fill() //// Oval 76 Drawing let oval76Path = UIBezierPath(ovalIn: CGRect(x: 804.95, y: 688.05, width: 14, height: 13.9)) dark.setFill() oval76Path.fill() //// Oval 77 Drawing let oval77Path = UIBezierPath(ovalIn: CGRect(x: 832.95, y: 715.05, width: 14, height: 13.9)) dark.setFill() oval77Path.fill() //// Oval 78 Drawing let oval78Path = UIBezierPath(ovalIn: CGRect(x: 832.95, y: 660.05, width: 14, height: 13.9)) dark.setFill() oval78Path.fill() //// Oval 79 Drawing let oval79Path = UIBezierPath(ovalIn: CGRect(x: 804.95, y: 632.05, width: 14, height: 13.9)) dark.setFill() oval79Path.fill() //// Oval 80 Drawing let oval80Path = UIBezierPath(ovalIn: CGRect(x: 860.95, y: 688.05, width: 14, height: 13.9)) dark.setFill() oval80Path.fill() //// Oval 81 Drawing let oval81Path = UIBezierPath(ovalIn: CGRect(x: 888.95, y: 715.05, width: 14, height: 13.9)) dark.setFill() oval81Path.fill() //// Oval 82 Drawing let oval82Path = UIBezierPath(ovalIn: CGRect(x: 860.95, y: 632.05, width: 14, height: 13.9)) dark.setFill() oval82Path.fill() //// Oval 83 Drawing let oval83Path = UIBezierPath(ovalIn: CGRect(x: 888.95, y: 660.05, width: 14, height: 13.9)) dark.setFill() oval83Path.fill() //// Oval 84 Drawing let oval84Path = UIBezierPath(ovalIn: CGRect(x: 915.95, y: 688.05, width: 14, height: 13.9)) dark.setFill() oval84Path.fill() //// Oval 85 Drawing let oval85Path = UIBezierPath(ovalIn: CGRect(x: 860.95, y: 576.05, width: 14, height: 13.9)) dark.setFill() oval85Path.fill() //// Oval 86 Drawing let oval86Path = UIBezierPath(ovalIn: CGRect(x: 888.95, y: 604.05, width: 14, height: 13.9)) dark.setFill() oval86Path.fill() //// Oval 87 Drawing let oval87Path = UIBezierPath(ovalIn: CGRect(x: 915.95, y: 632.05, width: 14, height: 13.9)) dark.setFill() oval87Path.fill() //// Oval 88 Drawing let oval88Path = UIBezierPath(ovalIn: CGRect(x: 860.95, y: 521.05, width: 14, height: 13.9)) dark.setFill() oval88Path.fill() //// Oval 89 Drawing let oval89Path = UIBezierPath(ovalIn: CGRect(x: 804.95, y: 465.05, width: 14, height: 13.9)) dark.setFill() oval89Path.fill() //// Oval 90 Drawing let oval90Path = UIBezierPath(ovalIn: CGRect(x: 888.95, y: 549.05, width: 14, height: 13.9)) dark.setFill() oval90Path.fill() //// Oval 91 Drawing let oval91Path = UIBezierPath(ovalIn: CGRect(x: 915.95, y: 576.05, width: 14, height: 13.9)) dark.setFill() oval91Path.fill() //// Oval 92 Drawing let oval92Path = UIBezierPath(ovalIn: CGRect(x: 777.95, y: 382.05, width: 14, height: 13.9)) dark.setFill() oval92Path.fill() //// Oval 93 Drawing let oval93Path = UIBezierPath(ovalIn: CGRect(x: 804.95, y: 410.05, width: 14, height: 13.9)) dark.setFill() oval93Path.fill() //// Oval 94 Drawing let oval94Path = UIBezierPath(ovalIn: CGRect(x: 832.95, y: 437.05, width: 14, height: 13.9)) dark.setFill() oval94Path.fill() //// Oval 95 Drawing let oval95Path = UIBezierPath(ovalIn: CGRect(x: 860.95, y: 465.05, width: 14, height: 13.9)) dark.setFill() oval95Path.fill() //// Oval 96 Drawing let oval96Path = UIBezierPath(ovalIn: CGRect(x: 888.95, y: 493.05, width: 14, height: 13.9)) dark.setFill() oval96Path.fill() //// Oval 97 Drawing let oval97Path = UIBezierPath(ovalIn: CGRect(x: 915.95, y: 521.05, width: 14, height: 13.9)) dark.setFill() oval97Path.fill() //// Oval 98 Drawing let oval98Path = UIBezierPath(ovalIn: CGRect(x: 832.95, y: 382.05, width: 14, height: 13.9)) dark.setFill() oval98Path.fill() //// Oval 99 Drawing let oval99Path = UIBezierPath(ovalIn: CGRect(x: 860.95, y: 410.05, width: 14, height: 13.9)) dark.setFill() oval99Path.fill() //// Oval 100 Drawing let oval100Path = UIBezierPath(ovalIn: CGRect(x: 888.95, y: 437.05, width: 14, height: 13.9)) dark.setFill() oval100Path.fill() //// Oval 101 Drawing let oval101Path = UIBezierPath(ovalIn: CGRect(x: 915.95, y: 465.05, width: 14, height: 13.9)) dark.setFill() oval101Path.fill() //// Oval 102 Drawing let oval102Path = UIBezierPath(ovalIn: CGRect(x: 888.95, y: 382.05, width: 14, height: 13.9)) dark.setFill() oval102Path.fill() //// Oval 103 Drawing let oval103Path = UIBezierPath(ovalIn: CGRect(x: 915.95, y: 410.05, width: 14, height: 13.9)) dark.setFill() oval103Path.fill() //// Oval 104 Drawing let oval104Path = UIBezierPath(ovalIn: CGRect(x: 804.95, y: 354.05, width: 14, height: 13.9)) dark.setFill() oval104Path.fill() //// Oval 105 Drawing let oval105Path = UIBezierPath(ovalIn: CGRect(x: 749.95, y: 354.05, width: 14, height: 13.9)) dark.setFill() oval105Path.fill() //// Oval 106 Drawing let oval106Path = UIBezierPath(ovalIn: CGRect(x: 860.95, y: 354.05, width: 14, height: 13.9)) dark.setFill() oval106Path.fill() //// Oval 107 Drawing let oval107Path = UIBezierPath(ovalIn: CGRect(x: 915.95, y: 354.05, width: 14, height: 13.9)) dark.setFill() oval107Path.fill() context.restoreGState() } @objc dynamic public class func drawPhotoLibrary(frame targetFrame: CGRect = CGRect(x: 0, y: 0, width: 1000, height: 1000), resizing: ResizingBehavior = .aspectFit, white: UIColor = UIColor(red: 1.000, green: 1.000, blue: 1.000, alpha: 1.000), light: UIColor = UIColor(red: 0.769, green: 0.847, blue: 0.984, alpha: 1.000), medium: UIColor = UIColor(red: 0.478, green: 0.663, blue: 0.973, alpha: 1.000), dark: UIColor = UIColor(red: 0.000, green: 0.478, blue: 1.000, alpha: 1.000)) { //// General Declarations let context = UIGraphicsGetCurrentContext()! //// Resize to Target Frame context.saveGState() let resizedFrame: CGRect = resizing.apply(rect: CGRect(x: 0, y: 0, width: 1000, height: 1000), target: targetFrame) context.translateBy(x: resizedFrame.minX, y: resizedFrame.minY) context.scaleBy(x: resizedFrame.width / 1000, y: resizedFrame.height / 1000) //// Group 2 //// Bezier Drawing let bezierPath = UIBezierPath() bezierPath.move(to: CGPoint(x: 726.66, y: 204.8)) bezierPath.addLine(to: CGPoint(x: 776.92, y: 204.8)) bezierPath.addLine(to: CGPoint(x: 776.92, y: 129.2)) bezierPath.addLine(to: CGPoint(x: 726.66, y: 129.2)) bezierPath.addLine(to: CGPoint(x: 726.66, y: 204.8)) bezierPath.close() bezierPath.move(to: CGPoint(x: 601.02, y: 204.8)) bezierPath.addLine(to: CGPoint(x: 651.27, y: 204.8)) bezierPath.addLine(to: CGPoint(x: 651.27, y: 129.2)) bezierPath.addLine(to: CGPoint(x: 601.02, y: 129.2)) bezierPath.addLine(to: CGPoint(x: 601.02, y: 204.8)) bezierPath.close() bezierPath.move(to: CGPoint(x: 475.37, y: 204.8)) bezierPath.addLine(to: CGPoint(x: 525.63, y: 204.8)) bezierPath.addLine(to: CGPoint(x: 525.63, y: 129.2)) bezierPath.addLine(to: CGPoint(x: 475.37, y: 129.2)) bezierPath.addLine(to: CGPoint(x: 475.37, y: 204.8)) bezierPath.close() bezierPath.move(to: CGPoint(x: 349.73, y: 204.8)) bezierPath.addLine(to: CGPoint(x: 399.98, y: 204.8)) bezierPath.addLine(to: CGPoint(x: 399.98, y: 129.2)) bezierPath.addLine(to: CGPoint(x: 349.73, y: 129.2)) bezierPath.addLine(to: CGPoint(x: 349.73, y: 204.8)) bezierPath.close() bezierPath.move(to: CGPoint(x: 224.08, y: 204.8)) bezierPath.addLine(to: CGPoint(x: 274.34, y: 204.8)) bezierPath.addLine(to: CGPoint(x: 274.34, y: 129.2)) bezierPath.addLine(to: CGPoint(x: 224.08, y: 129.2)) bezierPath.addLine(to: CGPoint(x: 224.08, y: 204.8)) bezierPath.close() bezierPath.move(to: CGPoint(x: 852.31, y: 204.8)) bezierPath.addLine(to: CGPoint(x: 852.31, y: 129.2)) bezierPath.addLine(to: CGPoint(x: 890, y: 129.2)) bezierPath.addLine(to: CGPoint(x: 890, y: 104)) bezierPath.addLine(to: CGPoint(x: 111, y: 104)) bezierPath.addLine(to: CGPoint(x: 111, y: 129.2)) bezierPath.addLine(to: CGPoint(x: 148.69, y: 129.2)) bezierPath.addLine(to: CGPoint(x: 148.69, y: 204.8)) bezierPath.addLine(to: CGPoint(x: 111, y: 204.8)) bezierPath.addLine(to: CGPoint(x: 111, y: 230)) bezierPath.addLine(to: CGPoint(x: 890, y: 230)) bezierPath.addLine(to: CGPoint(x: 890, y: 204.8)) bezierPath.addLine(to: CGPoint(x: 852.31, y: 204.8)) bezierPath.close() bezierPath.usesEvenOddFillRule = true medium.setFill() bezierPath.fill() //// Bezier 2 Drawing let bezier2Path = UIBezierPath() bezier2Path.move(to: CGPoint(x: 726.66, y: 870.8)) bezier2Path.addLine(to: CGPoint(x: 776.92, y: 870.8)) bezier2Path.addLine(to: CGPoint(x: 776.92, y: 795.2)) bezier2Path.addLine(to: CGPoint(x: 726.66, y: 795.2)) bezier2Path.addLine(to: CGPoint(x: 726.66, y: 870.8)) bezier2Path.close() bezier2Path.move(to: CGPoint(x: 601.02, y: 870.8)) bezier2Path.addLine(to: CGPoint(x: 651.27, y: 870.8)) bezier2Path.addLine(to: CGPoint(x: 651.27, y: 795.2)) bezier2Path.addLine(to: CGPoint(x: 601.02, y: 795.2)) bezier2Path.addLine(to: CGPoint(x: 601.02, y: 870.8)) bezier2Path.close() bezier2Path.move(to: CGPoint(x: 475.37, y: 870.8)) bezier2Path.addLine(to: CGPoint(x: 525.63, y: 870.8)) bezier2Path.addLine(to: CGPoint(x: 525.63, y: 795.2)) bezier2Path.addLine(to: CGPoint(x: 475.37, y: 795.2)) bezier2Path.addLine(to: CGPoint(x: 475.37, y: 870.8)) bezier2Path.close() bezier2Path.move(to: CGPoint(x: 349.73, y: 870.8)) bezier2Path.addLine(to: CGPoint(x: 399.98, y: 870.8)) bezier2Path.addLine(to: CGPoint(x: 399.98, y: 795.2)) bezier2Path.addLine(to: CGPoint(x: 349.73, y: 795.2)) bezier2Path.addLine(to: CGPoint(x: 349.73, y: 870.8)) bezier2Path.close() bezier2Path.move(to: CGPoint(x: 224.08, y: 870.8)) bezier2Path.addLine(to: CGPoint(x: 274.34, y: 870.8)) bezier2Path.addLine(to: CGPoint(x: 274.34, y: 795.2)) bezier2Path.addLine(to: CGPoint(x: 224.08, y: 795.2)) bezier2Path.addLine(to: CGPoint(x: 224.08, y: 870.8)) bezier2Path.close() bezier2Path.move(to: CGPoint(x: 852.31, y: 870.8)) bezier2Path.addLine(to: CGPoint(x: 852.31, y: 795.2)) bezier2Path.addLine(to: CGPoint(x: 890, y: 795.2)) bezier2Path.addLine(to: CGPoint(x: 890, y: 770)) bezier2Path.addLine(to: CGPoint(x: 111, y: 770)) bezier2Path.addLine(to: CGPoint(x: 111, y: 795.2)) bezier2Path.addLine(to: CGPoint(x: 148.69, y: 795.2)) bezier2Path.addLine(to: CGPoint(x: 148.69, y: 870.8)) bezier2Path.addLine(to: CGPoint(x: 111, y: 870.8)) bezier2Path.addLine(to: CGPoint(x: 111, y: 896)) bezier2Path.addLine(to: CGPoint(x: 890, y: 896)) bezier2Path.addLine(to: CGPoint(x: 890, y: 870.8)) bezier2Path.addLine(to: CGPoint(x: 852.31, y: 870.8)) bezier2Path.close() bezier2Path.usesEvenOddFillRule = true medium.setFill() bezier2Path.fill() //// Bezier 3 Drawing let bezier3Path = UIBezierPath() bezier3Path.move(to: CGPoint(x: 111, y: 129)) bezier3Path.addLine(to: CGPoint(x: 890, y: 129)) bezier3Path.addLine(to: CGPoint(x: 890, y: 104)) bezier3Path.addLine(to: CGPoint(x: 111, y: 104)) bezier3Path.addLine(to: CGPoint(x: 111, y: 129)) bezier3Path.close() bezier3Path.usesEvenOddFillRule = true light.setFill() bezier3Path.fill() //// Rectangle Drawing let rectanglePath = UIBezierPath(rect: CGRect(x: 111, y: 230, width: 779, height: 540)) light.setFill() rectanglePath.fill() //// Bezier 4 Drawing let bezier4Path = UIBezierPath() bezier4Path.move(to: CGPoint(x: 427.35, y: 609.85)) bezier4Path.addLine(to: CGPoint(x: 354.67, y: 537.1)) bezier4Path.addCurve(to: CGPoint(x: 337.97, y: 513.33), controlPoint1: CGPoint(x: 347.64, y: 529.93), controlPoint2: CGPoint(x: 342.11, y: 522.01)) bezier4Path.addCurve(to: CGPoint(x: 354.67, y: 417.7), controlPoint1: CGPoint(x: 323.28, y: 482.04), controlPoint2: CGPoint(x: 328.93, y: 443.58)) bezier4Path.addCurve(to: CGPoint(x: 414.3, y: 393.05), controlPoint1: CGPoint(x: 371.24, y: 401.23), controlPoint2: CGPoint(x: 392.83, y: 393.05)) bezier4Path.addCurve(to: CGPoint(x: 473.94, y: 417.7), controlPoint1: CGPoint(x: 435.89, y: 393.05), controlPoint2: CGPoint(x: 457.49, y: 401.23)) bezier4Path.addLine(to: CGPoint(x: 499.54, y: 443.2)) bezier4Path.addLine(to: CGPoint(x: 525.04, y: 417.7)) bezier4Path.addCurve(to: CGPoint(x: 644.17, y: 417.7), controlPoint1: CGPoint(x: 558.04, y: 384.77), controlPoint2: CGPoint(x: 611.4, y: 384.77)) bezier4Path.addCurve(to: CGPoint(x: 661.01, y: 513.46), controlPoint1: CGPoint(x: 670.17, y: 443.58), controlPoint2: CGPoint(x: 675.7, y: 482.04)) bezier4Path.addCurve(to: CGPoint(x: 644.17, y: 537.1), controlPoint1: CGPoint(x: 656.99, y: 522.01), controlPoint2: CGPoint(x: 651.46, y: 530.05)) bezier4Path.addLine(to: CGPoint(x: 499.54, y: 682)) bezier4Path.addLine(to: CGPoint(x: 442.05, y: 624.44)) bezier4Path.addLine(to: CGPoint(x: 427.35, y: 609.85)) bezier4Path.close() bezier4Path.usesEvenOddFillRule = true white.setFill() bezier4Path.fill() //// Bezier 5 Drawing let bezier5Path = UIBezierPath() bezier5Path.move(to: CGPoint(x: 386, y: 686.45)) bezier5Path.addLine(to: CGPoint(x: 324, y: 713)) bezier5Path.addLine(to: CGPoint(x: 350.55, y: 651)) bezier5Path.addLine(to: CGPoint(x: 386, y: 686.45)) bezier5Path.close() bezier5Path.usesEvenOddFillRule = true white.setFill() bezier5Path.fill() //// Bezier 6 Drawing let bezier6Path = UIBezierPath() bezier6Path.move(to: CGPoint(x: 701.65, y: 372)) bezier6Path.addLine(to: CGPoint(x: 683.76, y: 372)) bezier6Path.addLine(to: CGPoint(x: 666, y: 354.24)) bezier6Path.addLine(to: CGPoint(x: 666, y: 336.35)) bezier6Path.addLine(to: CGPoint(x: 728.36, y: 274)) bezier6Path.addLine(to: CGPoint(x: 764, y: 309.65)) bezier6Path.addLine(to: CGPoint(x: 701.65, y: 372)) bezier6Path.close() bezier6Path.usesEvenOddFillRule = true medium.setFill() bezier6Path.fill() //// Bezier 7 Drawing let bezier7Path = UIBezierPath() bezier7Path.move(to: CGPoint(x: 116.57, y: 764.43)) bezier7Path.addLine(to: CGPoint(x: 883.43, y: 764.43)) bezier7Path.addLine(to: CGPoint(x: 883.43, y: 236.57)) bezier7Path.addLine(to: CGPoint(x: 116.57, y: 236.57)) bezier7Path.addLine(to: CGPoint(x: 116.57, y: 764.43)) bezier7Path.close() bezier7Path.move(to: CGPoint(x: 889.71, y: 777)) bezier7Path.addLine(to: CGPoint(x: 110.29, y: 777)) bezier7Path.addCurve(to: CGPoint(x: 104, y: 770.72), controlPoint1: CGPoint(x: 106.81, y: 777), controlPoint2: CGPoint(x: 104, y: 774.19)) bezier7Path.addLine(to: CGPoint(x: 104, y: 230.28)) bezier7Path.addCurve(to: CGPoint(x: 110.29, y: 224), controlPoint1: CGPoint(x: 104, y: 226.81), controlPoint2: CGPoint(x: 106.81, y: 224)) bezier7Path.addLine(to: CGPoint(x: 889.71, y: 224)) bezier7Path.addCurve(to: CGPoint(x: 896, y: 230.28), controlPoint1: CGPoint(x: 893.19, y: 224), controlPoint2: CGPoint(x: 896, y: 226.81)) bezier7Path.addLine(to: CGPoint(x: 896, y: 770.72)) bezier7Path.addCurve(to: CGPoint(x: 889.71, y: 777), controlPoint1: CGPoint(x: 896, y: 774.19), controlPoint2: CGPoint(x: 893.19, y: 777)) bezier7Path.close() bezier7Path.usesEvenOddFillRule = true dark.setFill() bezier7Path.fill() //// Bezier 8 Drawing let bezier8Path = UIBezierPath() bezier8Path.move(to: CGPoint(x: 889.75, y: 211)) bezier8Path.addLine(to: CGPoint(x: 852.25, y: 211)) bezier8Path.addCurve(to: CGPoint(x: 846, y: 204.71), controlPoint1: CGPoint(x: 848.8, y: 211), controlPoint2: CGPoint(x: 846, y: 208.19)) bezier8Path.addLine(to: CGPoint(x: 846, y: 129.29)) bezier8Path.addCurve(to: CGPoint(x: 852.25, y: 123), controlPoint1: CGPoint(x: 846, y: 125.81), controlPoint2: CGPoint(x: 848.8, y: 123)) bezier8Path.addLine(to: CGPoint(x: 889.75, y: 123)) bezier8Path.addCurve(to: CGPoint(x: 896, y: 129.29), controlPoint1: CGPoint(x: 893.2, y: 123), controlPoint2: CGPoint(x: 896, y: 125.81)) bezier8Path.addCurve(to: CGPoint(x: 889.75, y: 135.57), controlPoint1: CGPoint(x: 896, y: 132.76), controlPoint2: CGPoint(x: 893.2, y: 135.57)) bezier8Path.addLine(to: CGPoint(x: 858.5, y: 135.57)) bezier8Path.addLine(to: CGPoint(x: 858.5, y: 198.43)) bezier8Path.addLine(to: CGPoint(x: 889.75, y: 198.43)) bezier8Path.addCurve(to: CGPoint(x: 896, y: 204.71), controlPoint1: CGPoint(x: 893.2, y: 198.43), controlPoint2: CGPoint(x: 896, y: 201.24)) bezier8Path.addCurve(to: CGPoint(x: 889.75, y: 211), controlPoint1: CGPoint(x: 896, y: 208.19), controlPoint2: CGPoint(x: 893.2, y: 211)) bezier8Path.close() bezier8Path.usesEvenOddFillRule = true dark.setFill() bezier8Path.fill() //// Bezier 9 Drawing let bezier9Path = UIBezierPath() bezier9Path.move(to: CGPoint(x: 732.6, y: 198.43)) bezier9Path.addLine(to: CGPoint(x: 770.4, y: 198.43)) bezier9Path.addLine(to: CGPoint(x: 770.4, y: 135.57)) bezier9Path.addLine(to: CGPoint(x: 732.6, y: 135.57)) bezier9Path.addLine(to: CGPoint(x: 732.6, y: 198.43)) bezier9Path.close() bezier9Path.move(to: CGPoint(x: 776.7, y: 211)) bezier9Path.addLine(to: CGPoint(x: 726.3, y: 211)) bezier9Path.addCurve(to: CGPoint(x: 720, y: 204.71), controlPoint1: CGPoint(x: 722.82, y: 211), controlPoint2: CGPoint(x: 720, y: 208.19)) bezier9Path.addLine(to: CGPoint(x: 720, y: 129.29)) bezier9Path.addCurve(to: CGPoint(x: 726.3, y: 123), controlPoint1: CGPoint(x: 720, y: 125.81), controlPoint2: CGPoint(x: 722.82, y: 123)) bezier9Path.addLine(to: CGPoint(x: 776.7, y: 123)) bezier9Path.addCurve(to: CGPoint(x: 783, y: 129.29), controlPoint1: CGPoint(x: 780.18, y: 123), controlPoint2: CGPoint(x: 783, y: 125.81)) bezier9Path.addLine(to: CGPoint(x: 783, y: 204.71)) bezier9Path.addCurve(to: CGPoint(x: 776.7, y: 211), controlPoint1: CGPoint(x: 783, y: 208.19), controlPoint2: CGPoint(x: 780.18, y: 211)) bezier9Path.close() bezier9Path.usesEvenOddFillRule = true dark.setFill() bezier9Path.fill() //// Bezier 10 Drawing let bezier10Path = UIBezierPath() bezier10Path.move(to: CGPoint(x: 606.6, y: 198.43)) bezier10Path.addLine(to: CGPoint(x: 644.4, y: 198.43)) bezier10Path.addLine(to: CGPoint(x: 644.4, y: 135.57)) bezier10Path.addLine(to: CGPoint(x: 606.6, y: 135.57)) bezier10Path.addLine(to: CGPoint(x: 606.6, y: 198.43)) bezier10Path.close() bezier10Path.move(to: CGPoint(x: 650.7, y: 211)) bezier10Path.addLine(to: CGPoint(x: 600.3, y: 211)) bezier10Path.addCurve(to: CGPoint(x: 594, y: 204.71), controlPoint1: CGPoint(x: 596.82, y: 211), controlPoint2: CGPoint(x: 594, y: 208.19)) bezier10Path.addLine(to: CGPoint(x: 594, y: 129.29)) bezier10Path.addCurve(to: CGPoint(x: 600.3, y: 123), controlPoint1: CGPoint(x: 594, y: 125.81), controlPoint2: CGPoint(x: 596.82, y: 123)) bezier10Path.addLine(to: CGPoint(x: 650.7, y: 123)) bezier10Path.addCurve(to: CGPoint(x: 657, y: 129.29), controlPoint1: CGPoint(x: 654.18, y: 123), controlPoint2: CGPoint(x: 657, y: 125.81)) bezier10Path.addLine(to: CGPoint(x: 657, y: 204.71)) bezier10Path.addCurve(to: CGPoint(x: 650.7, y: 211), controlPoint1: CGPoint(x: 657, y: 208.19), controlPoint2: CGPoint(x: 654.18, y: 211)) bezier10Path.close() bezier10Path.usesEvenOddFillRule = true dark.setFill() bezier10Path.fill() //// Bezier 11 Drawing let bezier11Path = UIBezierPath() bezier11Path.move(to: CGPoint(x: 481.6, y: 198.43)) bezier11Path.addLine(to: CGPoint(x: 519.4, y: 198.43)) bezier11Path.addLine(to: CGPoint(x: 519.4, y: 135.57)) bezier11Path.addLine(to: CGPoint(x: 481.6, y: 135.57)) bezier11Path.addLine(to: CGPoint(x: 481.6, y: 198.43)) bezier11Path.close() bezier11Path.move(to: CGPoint(x: 525.7, y: 211)) bezier11Path.addLine(to: CGPoint(x: 475.3, y: 211)) bezier11Path.addCurve(to: CGPoint(x: 469, y: 204.71), controlPoint1: CGPoint(x: 471.82, y: 211), controlPoint2: CGPoint(x: 469, y: 208.19)) bezier11Path.addLine(to: CGPoint(x: 469, y: 129.29)) bezier11Path.addCurve(to: CGPoint(x: 475.3, y: 123), controlPoint1: CGPoint(x: 469, y: 125.81), controlPoint2: CGPoint(x: 471.82, y: 123)) bezier11Path.addLine(to: CGPoint(x: 525.7, y: 123)) bezier11Path.addCurve(to: CGPoint(x: 532, y: 129.29), controlPoint1: CGPoint(x: 529.18, y: 123), controlPoint2: CGPoint(x: 532, y: 125.81)) bezier11Path.addLine(to: CGPoint(x: 532, y: 204.71)) bezier11Path.addCurve(to: CGPoint(x: 525.7, y: 211), controlPoint1: CGPoint(x: 532, y: 208.19), controlPoint2: CGPoint(x: 529.18, y: 211)) bezier11Path.close() bezier11Path.usesEvenOddFillRule = true dark.setFill() bezier11Path.fill() //// Bezier 12 Drawing let bezier12Path = UIBezierPath() bezier12Path.move(to: CGPoint(x: 355.6, y: 198.43)) bezier12Path.addLine(to: CGPoint(x: 393.4, y: 198.43)) bezier12Path.addLine(to: CGPoint(x: 393.4, y: 135.57)) bezier12Path.addLine(to: CGPoint(x: 355.6, y: 135.57)) bezier12Path.addLine(to: CGPoint(x: 355.6, y: 198.43)) bezier12Path.close() bezier12Path.move(to: CGPoint(x: 399.7, y: 211)) bezier12Path.addLine(to: CGPoint(x: 349.3, y: 211)) bezier12Path.addCurve(to: CGPoint(x: 343, y: 204.71), controlPoint1: CGPoint(x: 345.82, y: 211), controlPoint2: CGPoint(x: 343, y: 208.19)) bezier12Path.addLine(to: CGPoint(x: 343, y: 129.29)) bezier12Path.addCurve(to: CGPoint(x: 349.3, y: 123), controlPoint1: CGPoint(x: 343, y: 125.81), controlPoint2: CGPoint(x: 345.82, y: 123)) bezier12Path.addLine(to: CGPoint(x: 399.7, y: 123)) bezier12Path.addCurve(to: CGPoint(x: 406, y: 129.29), controlPoint1: CGPoint(x: 403.18, y: 123), controlPoint2: CGPoint(x: 406, y: 125.81)) bezier12Path.addLine(to: CGPoint(x: 406, y: 204.71)) bezier12Path.addCurve(to: CGPoint(x: 399.7, y: 211), controlPoint1: CGPoint(x: 406, y: 208.19), controlPoint2: CGPoint(x: 403.18, y: 211)) bezier12Path.close() bezier12Path.usesEvenOddFillRule = true dark.setFill() bezier12Path.fill() //// Bezier 13 Drawing let bezier13Path = UIBezierPath() bezier13Path.move(to: CGPoint(x: 229.6, y: 198.43)) bezier13Path.addLine(to: CGPoint(x: 267.4, y: 198.43)) bezier13Path.addLine(to: CGPoint(x: 267.4, y: 135.57)) bezier13Path.addLine(to: CGPoint(x: 229.6, y: 135.57)) bezier13Path.addLine(to: CGPoint(x: 229.6, y: 198.43)) bezier13Path.close() bezier13Path.move(to: CGPoint(x: 273.7, y: 211)) bezier13Path.addLine(to: CGPoint(x: 223.3, y: 211)) bezier13Path.addCurve(to: CGPoint(x: 217, y: 204.71), controlPoint1: CGPoint(x: 219.82, y: 211), controlPoint2: CGPoint(x: 217, y: 208.19)) bezier13Path.addLine(to: CGPoint(x: 217, y: 129.29)) bezier13Path.addCurve(to: CGPoint(x: 223.3, y: 123), controlPoint1: CGPoint(x: 217, y: 125.81), controlPoint2: CGPoint(x: 219.82, y: 123)) bezier13Path.addLine(to: CGPoint(x: 273.7, y: 123)) bezier13Path.addCurve(to: CGPoint(x: 280, y: 129.29), controlPoint1: CGPoint(x: 277.18, y: 123), controlPoint2: CGPoint(x: 280, y: 125.81)) bezier13Path.addLine(to: CGPoint(x: 280, y: 204.71)) bezier13Path.addCurve(to: CGPoint(x: 273.7, y: 211), controlPoint1: CGPoint(x: 280, y: 208.19), controlPoint2: CGPoint(x: 277.18, y: 211)) bezier13Path.close() bezier13Path.usesEvenOddFillRule = true dark.setFill() bezier13Path.fill() //// Bezier 14 Drawing let bezier14Path = UIBezierPath() bezier14Path.move(to: CGPoint(x: 147.75, y: 211)) bezier14Path.addLine(to: CGPoint(x: 110.25, y: 211)) bezier14Path.addCurve(to: CGPoint(x: 104, y: 204.71), controlPoint1: CGPoint(x: 106.8, y: 211), controlPoint2: CGPoint(x: 104, y: 208.19)) bezier14Path.addCurve(to: CGPoint(x: 110.25, y: 198.43), controlPoint1: CGPoint(x: 104, y: 201.24), controlPoint2: CGPoint(x: 106.8, y: 198.43)) bezier14Path.addLine(to: CGPoint(x: 141.5, y: 198.43)) bezier14Path.addLine(to: CGPoint(x: 141.5, y: 135.57)) bezier14Path.addLine(to: CGPoint(x: 110.25, y: 135.57)) bezier14Path.addCurve(to: CGPoint(x: 104, y: 129.29), controlPoint1: CGPoint(x: 106.8, y: 135.57), controlPoint2: CGPoint(x: 104, y: 132.76)) bezier14Path.addCurve(to: CGPoint(x: 110.25, y: 123), controlPoint1: CGPoint(x: 104, y: 125.81), controlPoint2: CGPoint(x: 106.8, y: 123)) bezier14Path.addLine(to: CGPoint(x: 147.75, y: 123)) bezier14Path.addCurve(to: CGPoint(x: 154, y: 129.29), controlPoint1: CGPoint(x: 151.2, y: 123), controlPoint2: CGPoint(x: 154, y: 125.81)) bezier14Path.addLine(to: CGPoint(x: 154, y: 204.71)) bezier14Path.addCurve(to: CGPoint(x: 147.75, y: 211), controlPoint1: CGPoint(x: 154, y: 208.19), controlPoint2: CGPoint(x: 151.2, y: 211)) bezier14Path.close() bezier14Path.usesEvenOddFillRule = true dark.setFill() bezier14Path.fill() //// Bezier 15 Drawing let bezier15Path = UIBezierPath() bezier15Path.move(to: CGPoint(x: 889.71, y: 111)) bezier15Path.addLine(to: CGPoint(x: 110.29, y: 111)) bezier15Path.addCurve(to: CGPoint(x: 104, y: 104.5), controlPoint1: CGPoint(x: 106.81, y: 111), controlPoint2: CGPoint(x: 104, y: 108.09)) bezier15Path.addCurve(to: CGPoint(x: 110.29, y: 98), controlPoint1: CGPoint(x: 104, y: 100.91), controlPoint2: CGPoint(x: 106.81, y: 98)) bezier15Path.addLine(to: CGPoint(x: 889.71, y: 98)) bezier15Path.addCurve(to: CGPoint(x: 896, y: 104.5), controlPoint1: CGPoint(x: 893.19, y: 98), controlPoint2: CGPoint(x: 896, y: 100.91)) bezier15Path.addCurve(to: CGPoint(x: 889.71, y: 111), controlPoint1: CGPoint(x: 896, y: 108.09), controlPoint2: CGPoint(x: 893.19, y: 111)) bezier15Path.close() bezier15Path.usesEvenOddFillRule = true dark.setFill() bezier15Path.fill() //// Bezier 16 Drawing let bezier16Path = UIBezierPath() bezier16Path.move(to: CGPoint(x: 147.75, y: 877)) bezier16Path.addLine(to: CGPoint(x: 110.25, y: 877)) bezier16Path.addCurve(to: CGPoint(x: 104, y: 870.71), controlPoint1: CGPoint(x: 106.8, y: 877), controlPoint2: CGPoint(x: 104, y: 874.19)) bezier16Path.addCurve(to: CGPoint(x: 110.25, y: 864.43), controlPoint1: CGPoint(x: 104, y: 867.24), controlPoint2: CGPoint(x: 106.8, y: 864.43)) bezier16Path.addLine(to: CGPoint(x: 141.5, y: 864.43)) bezier16Path.addLine(to: CGPoint(x: 141.5, y: 801.57)) bezier16Path.addLine(to: CGPoint(x: 110.25, y: 801.57)) bezier16Path.addCurve(to: CGPoint(x: 104, y: 795.29), controlPoint1: CGPoint(x: 106.8, y: 801.57), controlPoint2: CGPoint(x: 104, y: 798.76)) bezier16Path.addCurve(to: CGPoint(x: 110.25, y: 789), controlPoint1: CGPoint(x: 104, y: 791.81), controlPoint2: CGPoint(x: 106.8, y: 789)) bezier16Path.addLine(to: CGPoint(x: 147.75, y: 789)) bezier16Path.addCurve(to: CGPoint(x: 154, y: 795.29), controlPoint1: CGPoint(x: 151.2, y: 789), controlPoint2: CGPoint(x: 154, y: 791.81)) bezier16Path.addLine(to: CGPoint(x: 154, y: 870.71)) bezier16Path.addCurve(to: CGPoint(x: 147.75, y: 877), controlPoint1: CGPoint(x: 154, y: 874.19), controlPoint2: CGPoint(x: 151.2, y: 877)) bezier16Path.close() bezier16Path.usesEvenOddFillRule = true dark.setFill() bezier16Path.fill() //// Bezier 17 Drawing let bezier17Path = UIBezierPath() bezier17Path.move(to: CGPoint(x: 229.6, y: 864.43)) bezier17Path.addLine(to: CGPoint(x: 267.4, y: 864.43)) bezier17Path.addLine(to: CGPoint(x: 267.4, y: 801.57)) bezier17Path.addLine(to: CGPoint(x: 229.6, y: 801.57)) bezier17Path.addLine(to: CGPoint(x: 229.6, y: 864.43)) bezier17Path.close() bezier17Path.move(to: CGPoint(x: 273.7, y: 877)) bezier17Path.addLine(to: CGPoint(x: 223.3, y: 877)) bezier17Path.addCurve(to: CGPoint(x: 217, y: 870.71), controlPoint1: CGPoint(x: 219.82, y: 877), controlPoint2: CGPoint(x: 217, y: 874.19)) bezier17Path.addLine(to: CGPoint(x: 217, y: 795.29)) bezier17Path.addCurve(to: CGPoint(x: 223.3, y: 789), controlPoint1: CGPoint(x: 217, y: 791.81), controlPoint2: CGPoint(x: 219.82, y: 789)) bezier17Path.addLine(to: CGPoint(x: 273.7, y: 789)) bezier17Path.addCurve(to: CGPoint(x: 280, y: 795.29), controlPoint1: CGPoint(x: 277.18, y: 789), controlPoint2: CGPoint(x: 280, y: 791.81)) bezier17Path.addLine(to: CGPoint(x: 280, y: 870.71)) bezier17Path.addCurve(to: CGPoint(x: 273.7, y: 877), controlPoint1: CGPoint(x: 280, y: 874.19), controlPoint2: CGPoint(x: 277.18, y: 877)) bezier17Path.close() bezier17Path.usesEvenOddFillRule = true dark.setFill() bezier17Path.fill() //// Bezier 18 Drawing let bezier18Path = UIBezierPath() bezier18Path.move(to: CGPoint(x: 355.6, y: 864.43)) bezier18Path.addLine(to: CGPoint(x: 393.4, y: 864.43)) bezier18Path.addLine(to: CGPoint(x: 393.4, y: 801.57)) bezier18Path.addLine(to: CGPoint(x: 355.6, y: 801.57)) bezier18Path.addLine(to: CGPoint(x: 355.6, y: 864.43)) bezier18Path.close() bezier18Path.move(to: CGPoint(x: 399.7, y: 877)) bezier18Path.addLine(to: CGPoint(x: 349.3, y: 877)) bezier18Path.addCurve(to: CGPoint(x: 343, y: 870.71), controlPoint1: CGPoint(x: 345.82, y: 877), controlPoint2: CGPoint(x: 343, y: 874.19)) bezier18Path.addLine(to: CGPoint(x: 343, y: 795.29)) bezier18Path.addCurve(to: CGPoint(x: 349.3, y: 789), controlPoint1: CGPoint(x: 343, y: 791.81), controlPoint2: CGPoint(x: 345.82, y: 789)) bezier18Path.addLine(to: CGPoint(x: 399.7, y: 789)) bezier18Path.addCurve(to: CGPoint(x: 406, y: 795.29), controlPoint1: CGPoint(x: 403.18, y: 789), controlPoint2: CGPoint(x: 406, y: 791.81)) bezier18Path.addLine(to: CGPoint(x: 406, y: 870.71)) bezier18Path.addCurve(to: CGPoint(x: 399.7, y: 877), controlPoint1: CGPoint(x: 406, y: 874.19), controlPoint2: CGPoint(x: 403.18, y: 877)) bezier18Path.close() bezier18Path.usesEvenOddFillRule = true dark.setFill() bezier18Path.fill() //// Bezier 19 Drawing let bezier19Path = UIBezierPath() bezier19Path.move(to: CGPoint(x: 481.6, y: 864.43)) bezier19Path.addLine(to: CGPoint(x: 519.4, y: 864.43)) bezier19Path.addLine(to: CGPoint(x: 519.4, y: 801.57)) bezier19Path.addLine(to: CGPoint(x: 481.6, y: 801.57)) bezier19Path.addLine(to: CGPoint(x: 481.6, y: 864.43)) bezier19Path.close() bezier19Path.move(to: CGPoint(x: 525.7, y: 877)) bezier19Path.addLine(to: CGPoint(x: 475.3, y: 877)) bezier19Path.addCurve(to: CGPoint(x: 469, y: 870.71), controlPoint1: CGPoint(x: 471.82, y: 877), controlPoint2: CGPoint(x: 469, y: 874.19)) bezier19Path.addLine(to: CGPoint(x: 469, y: 795.29)) bezier19Path.addCurve(to: CGPoint(x: 475.3, y: 789), controlPoint1: CGPoint(x: 469, y: 791.81), controlPoint2: CGPoint(x: 471.82, y: 789)) bezier19Path.addLine(to: CGPoint(x: 525.7, y: 789)) bezier19Path.addCurve(to: CGPoint(x: 532, y: 795.29), controlPoint1: CGPoint(x: 529.18, y: 789), controlPoint2: CGPoint(x: 532, y: 791.81)) bezier19Path.addLine(to: CGPoint(x: 532, y: 870.71)) bezier19Path.addCurve(to: CGPoint(x: 525.7, y: 877), controlPoint1: CGPoint(x: 532, y: 874.19), controlPoint2: CGPoint(x: 529.18, y: 877)) bezier19Path.close() bezier19Path.usesEvenOddFillRule = true dark.setFill() bezier19Path.fill() //// Bezier 20 Drawing let bezier20Path = UIBezierPath() bezier20Path.move(to: CGPoint(x: 606.6, y: 864.43)) bezier20Path.addLine(to: CGPoint(x: 644.4, y: 864.43)) bezier20Path.addLine(to: CGPoint(x: 644.4, y: 801.57)) bezier20Path.addLine(to: CGPoint(x: 606.6, y: 801.57)) bezier20Path.addLine(to: CGPoint(x: 606.6, y: 864.43)) bezier20Path.close() bezier20Path.move(to: CGPoint(x: 650.7, y: 877)) bezier20Path.addLine(to: CGPoint(x: 600.3, y: 877)) bezier20Path.addCurve(to: CGPoint(x: 594, y: 870.71), controlPoint1: CGPoint(x: 596.82, y: 877), controlPoint2: CGPoint(x: 594, y: 874.19)) bezier20Path.addLine(to: CGPoint(x: 594, y: 795.29)) bezier20Path.addCurve(to: CGPoint(x: 600.3, y: 789), controlPoint1: CGPoint(x: 594, y: 791.81), controlPoint2: CGPoint(x: 596.82, y: 789)) bezier20Path.addLine(to: CGPoint(x: 650.7, y: 789)) bezier20Path.addCurve(to: CGPoint(x: 657, y: 795.29), controlPoint1: CGPoint(x: 654.18, y: 789), controlPoint2: CGPoint(x: 657, y: 791.81)) bezier20Path.addLine(to: CGPoint(x: 657, y: 870.71)) bezier20Path.addCurve(to: CGPoint(x: 650.7, y: 877), controlPoint1: CGPoint(x: 657, y: 874.19), controlPoint2: CGPoint(x: 654.18, y: 877)) bezier20Path.close() bezier20Path.usesEvenOddFillRule = true dark.setFill() bezier20Path.fill() //// Bezier 21 Drawing let bezier21Path = UIBezierPath() bezier21Path.move(to: CGPoint(x: 732.6, y: 864.43)) bezier21Path.addLine(to: CGPoint(x: 770.4, y: 864.43)) bezier21Path.addLine(to: CGPoint(x: 770.4, y: 801.57)) bezier21Path.addLine(to: CGPoint(x: 732.6, y: 801.57)) bezier21Path.addLine(to: CGPoint(x: 732.6, y: 864.43)) bezier21Path.close() bezier21Path.move(to: CGPoint(x: 776.7, y: 877)) bezier21Path.addLine(to: CGPoint(x: 726.3, y: 877)) bezier21Path.addCurve(to: CGPoint(x: 720, y: 870.71), controlPoint1: CGPoint(x: 722.82, y: 877), controlPoint2: CGPoint(x: 720, y: 874.19)) bezier21Path.addLine(to: CGPoint(x: 720, y: 795.29)) bezier21Path.addCurve(to: CGPoint(x: 726.3, y: 789), controlPoint1: CGPoint(x: 720, y: 791.81), controlPoint2: CGPoint(x: 722.82, y: 789)) bezier21Path.addLine(to: CGPoint(x: 776.7, y: 789)) bezier21Path.addCurve(to: CGPoint(x: 783, y: 795.29), controlPoint1: CGPoint(x: 780.18, y: 789), controlPoint2: CGPoint(x: 783, y: 791.81)) bezier21Path.addLine(to: CGPoint(x: 783, y: 870.71)) bezier21Path.addCurve(to: CGPoint(x: 776.7, y: 877), controlPoint1: CGPoint(x: 783, y: 874.19), controlPoint2: CGPoint(x: 780.18, y: 877)) bezier21Path.close() bezier21Path.usesEvenOddFillRule = true dark.setFill() bezier21Path.fill() //// Bezier 22 Drawing let bezier22Path = UIBezierPath() bezier22Path.move(to: CGPoint(x: 889.75, y: 877)) bezier22Path.addLine(to: CGPoint(x: 852.25, y: 877)) bezier22Path.addCurve(to: CGPoint(x: 846, y: 870.71), controlPoint1: CGPoint(x: 848.8, y: 877), controlPoint2: CGPoint(x: 846, y: 874.19)) bezier22Path.addLine(to: CGPoint(x: 846, y: 795.29)) bezier22Path.addCurve(to: CGPoint(x: 852.25, y: 789), controlPoint1: CGPoint(x: 846, y: 791.81), controlPoint2: CGPoint(x: 848.8, y: 789)) bezier22Path.addLine(to: CGPoint(x: 889.75, y: 789)) bezier22Path.addCurve(to: CGPoint(x: 896, y: 795.29), controlPoint1: CGPoint(x: 893.2, y: 789), controlPoint2: CGPoint(x: 896, y: 791.81)) bezier22Path.addCurve(to: CGPoint(x: 889.75, y: 801.57), controlPoint1: CGPoint(x: 896, y: 798.76), controlPoint2: CGPoint(x: 893.2, y: 801.57)) bezier22Path.addLine(to: CGPoint(x: 858.5, y: 801.57)) bezier22Path.addLine(to: CGPoint(x: 858.5, y: 864.43)) bezier22Path.addLine(to: CGPoint(x: 889.75, y: 864.43)) bezier22Path.addCurve(to: CGPoint(x: 896, y: 870.71), controlPoint1: CGPoint(x: 893.2, y: 864.43), controlPoint2: CGPoint(x: 896, y: 867.24)) bezier22Path.addCurve(to: CGPoint(x: 889.75, y: 877), controlPoint1: CGPoint(x: 896, y: 874.19), controlPoint2: CGPoint(x: 893.2, y: 877)) bezier22Path.close() bezier22Path.usesEvenOddFillRule = true dark.setFill() bezier22Path.fill() //// Bezier 23 Drawing let bezier23Path = UIBezierPath() bezier23Path.move(to: CGPoint(x: 889.71, y: 902)) bezier23Path.addLine(to: CGPoint(x: 110.29, y: 902)) bezier23Path.addCurve(to: CGPoint(x: 104, y: 895.5), controlPoint1: CGPoint(x: 106.81, y: 902), controlPoint2: CGPoint(x: 104, y: 899.09)) bezier23Path.addCurve(to: CGPoint(x: 110.29, y: 889), controlPoint1: CGPoint(x: 104, y: 891.91), controlPoint2: CGPoint(x: 106.81, y: 889)) bezier23Path.addLine(to: CGPoint(x: 889.71, y: 889)) bezier23Path.addCurve(to: CGPoint(x: 896, y: 895.5), controlPoint1: CGPoint(x: 893.19, y: 889), controlPoint2: CGPoint(x: 896, y: 891.91)) bezier23Path.addCurve(to: CGPoint(x: 889.71, y: 902), controlPoint1: CGPoint(x: 896, y: 899.09), controlPoint2: CGPoint(x: 893.19, y: 902)) bezier23Path.close() bezier23Path.usesEvenOddFillRule = true dark.setFill() bezier23Path.fill() //// Bezier 24 Drawing let bezier24Path = UIBezierPath() bezier24Path.move(to: CGPoint(x: 361.29, y: 682)) bezier24Path.addCurve(to: CGPoint(x: 356.84, y: 680.16), controlPoint1: CGPoint(x: 359.68, y: 682), controlPoint2: CGPoint(x: 358.07, y: 681.38)) bezier24Path.addCurve(to: CGPoint(x: 356.84, y: 671.26), controlPoint1: CGPoint(x: 354.39, y: 677.7), controlPoint2: CGPoint(x: 354.39, y: 673.72)) bezier24Path.addLine(to: CGPoint(x: 495.26, y: 532.84)) bezier24Path.addCurve(to: CGPoint(x: 504.16, y: 532.84), controlPoint1: CGPoint(x: 497.72, y: 530.39), controlPoint2: CGPoint(x: 501.7, y: 530.39)) bezier24Path.addCurve(to: CGPoint(x: 504.16, y: 541.74), controlPoint1: CGPoint(x: 506.61, y: 535.3), controlPoint2: CGPoint(x: 506.61, y: 539.28)) bezier24Path.addLine(to: CGPoint(x: 365.74, y: 680.16)) bezier24Path.addCurve(to: CGPoint(x: 361.29, y: 682), controlPoint1: CGPoint(x: 364.51, y: 681.38), controlPoint2: CGPoint(x: 362.9, y: 682)) bezier24Path.close() bezier24Path.usesEvenOddFillRule = true dark.setFill() bezier24Path.fill() //// Bezier 25 Drawing let bezier25Path = UIBezierPath() bezier25Path.move(to: CGPoint(x: 324.3, y: 719)) bezier25Path.addCurve(to: CGPoint(x: 318.51, y: 715.22), controlPoint1: CGPoint(x: 321.86, y: 719), controlPoint2: CGPoint(x: 319.53, y: 717.59)) bezier25Path.addCurve(to: CGPoint(x: 321.82, y: 707.01), controlPoint1: CGPoint(x: 317.14, y: 712.05), controlPoint2: CGPoint(x: 318.62, y: 708.37)) bezier25Path.addLine(to: CGPoint(x: 384.22, y: 680.51)) bezier25Path.addCurve(to: CGPoint(x: 392.49, y: 683.79), controlPoint1: CGPoint(x: 387.39, y: 679.14), controlPoint2: CGPoint(x: 391.12, y: 680.62)) bezier25Path.addCurve(to: CGPoint(x: 389.18, y: 692), controlPoint1: CGPoint(x: 393.86, y: 686.97), controlPoint2: CGPoint(x: 392.38, y: 690.64)) bezier25Path.addLine(to: CGPoint(x: 326.78, y: 718.5)) bezier25Path.addCurve(to: CGPoint(x: 324.3, y: 719), controlPoint1: CGPoint(x: 325.98, y: 718.84), controlPoint2: CGPoint(x: 325.13, y: 719)) bezier25Path.close() bezier25Path.usesEvenOddFillRule = true dark.setFill() bezier25Path.fill() //// Bezier 26 Drawing let bezier26Path = UIBezierPath() bezier26Path.move(to: CGPoint(x: 324.25, y: 720)) bezier26Path.addCurve(to: CGPoint(x: 321.79, y: 719.5), controlPoint1: CGPoint(x: 323.43, y: 720), controlPoint2: CGPoint(x: 322.59, y: 719.84)) bezier26Path.addCurve(to: CGPoint(x: 318.51, y: 711.21), controlPoint1: CGPoint(x: 318.62, y: 718.12), controlPoint2: CGPoint(x: 317.15, y: 714.41)) bezier26Path.addLine(to: CGPoint(x: 345.01, y: 648.82)) bezier26Path.addCurve(to: CGPoint(x: 353.21, y: 645.5), controlPoint1: CGPoint(x: 346.36, y: 645.62), controlPoint2: CGPoint(x: 350.06, y: 644.15)) bezier26Path.addCurve(to: CGPoint(x: 356.49, y: 653.79), controlPoint1: CGPoint(x: 356.38, y: 646.88), controlPoint2: CGPoint(x: 357.85, y: 650.59)) bezier26Path.addLine(to: CGPoint(x: 329.99, y: 716.18)) bezier26Path.addCurve(to: CGPoint(x: 324.25, y: 720), controlPoint1: CGPoint(x: 328.98, y: 718.57), controlPoint2: CGPoint(x: 326.67, y: 720)) bezier26Path.close() bezier26Path.usesEvenOddFillRule = true dark.setFill() bezier26Path.fill() //// Bezier 27 Drawing let bezier27Path = UIBezierPath() bezier27Path.move(to: CGPoint(x: 652.31, y: 392)) bezier27Path.addCurve(to: CGPoint(x: 647.85, y: 390.15), controlPoint1: CGPoint(x: 650.69, y: 392), controlPoint2: CGPoint(x: 649.08, y: 391.38)) bezier27Path.addCurve(to: CGPoint(x: 647.85, y: 381.23), controlPoint1: CGPoint(x: 645.38, y: 387.69), controlPoint2: CGPoint(x: 645.38, y: 383.7)) bezier27Path.addLine(to: CGPoint(x: 733.23, y: 295.85)) bezier27Path.addCurve(to: CGPoint(x: 742.15, y: 295.85), controlPoint1: CGPoint(x: 735.7, y: 293.38), controlPoint2: CGPoint(x: 739.69, y: 293.38)) bezier27Path.addCurve(to: CGPoint(x: 742.15, y: 304.77), controlPoint1: CGPoint(x: 744.62, y: 298.31), controlPoint2: CGPoint(x: 744.62, y: 302.3)) bezier27Path.addLine(to: CGPoint(x: 656.77, y: 390.15)) bezier27Path.addCurve(to: CGPoint(x: 652.31, y: 392), controlPoint1: CGPoint(x: 655.53, y: 391.38), controlPoint2: CGPoint(x: 653.92, y: 392)) bezier27Path.close() bezier27Path.usesEvenOddFillRule = true dark.setFill() bezier27Path.fill() //// Bezier 28 Drawing let bezier28Path = UIBezierPath() bezier28Path.move(to: CGPoint(x: 763.85, y: 316)) bezier28Path.addCurve(to: CGPoint(x: 759.51, y: 314.2), controlPoint1: CGPoint(x: 762.28, y: 316), controlPoint2: CGPoint(x: 760.71, y: 315.4)) bezier28Path.addLine(to: CGPoint(x: 750.8, y: 305.5)) bezier28Path.addCurve(to: CGPoint(x: 750.79, y: 296.8), controlPoint1: CGPoint(x: 748.4, y: 303.1), controlPoint2: CGPoint(x: 748.4, y: 299.2)) bezier28Path.addCurve(to: CGPoint(x: 759.49, y: 296.8), controlPoint1: CGPoint(x: 753.19, y: 294.4), controlPoint2: CGPoint(x: 757.09, y: 294.4)) bezier28Path.addLine(to: CGPoint(x: 768.2, y: 305.5)) bezier28Path.addCurve(to: CGPoint(x: 768.2, y: 314.2), controlPoint1: CGPoint(x: 770.6, y: 307.9), controlPoint2: CGPoint(x: 770.6, y: 311.8)) bezier28Path.addCurve(to: CGPoint(x: 763.85, y: 316), controlPoint1: CGPoint(x: 767, y: 315.4), controlPoint2: CGPoint(x: 765.43, y: 316)) bezier28Path.close() bezier28Path.usesEvenOddFillRule = true dark.setFill() bezier28Path.fill() //// Bezier 29 Drawing let bezier29Path = UIBezierPath() bezier29Path.move(to: CGPoint(x: 701.3, y: 378)) bezier29Path.addCurve(to: CGPoint(x: 696.85, y: 376.15), controlPoint1: CGPoint(x: 699.69, y: 378), controlPoint2: CGPoint(x: 698.08, y: 377.38)) bezier29Path.addCurve(to: CGPoint(x: 696.85, y: 367.24), controlPoint1: CGPoint(x: 694.38, y: 373.69), controlPoint2: CGPoint(x: 694.38, y: 369.7)) bezier29Path.addLine(to: CGPoint(x: 759.24, y: 304.85)) bezier29Path.addCurve(to: CGPoint(x: 768.15, y: 304.85), controlPoint1: CGPoint(x: 761.7, y: 302.38), controlPoint2: CGPoint(x: 765.69, y: 302.38)) bezier29Path.addCurve(to: CGPoint(x: 768.15, y: 313.76), controlPoint1: CGPoint(x: 770.62, y: 307.31), controlPoint2: CGPoint(x: 770.62, y: 311.3)) bezier29Path.addLine(to: CGPoint(x: 705.76, y: 376.15)) bezier29Path.addCurve(to: CGPoint(x: 701.3, y: 378), controlPoint1: CGPoint(x: 704.53, y: 377.38), controlPoint2: CGPoint(x: 702.91, y: 378)) bezier29Path.close() bezier29Path.usesEvenOddFillRule = true dark.setFill() bezier29Path.fill() //// Rectangle 2 Drawing let rectangle2Path = UIBezierPath(roundedRect: CGRect(x: 678, y: 365, width: 30, height: 13), cornerRadius: 6.2) dark.setFill() rectangle2Path.fill() //// Bezier 30 Drawing let bezier30Path = UIBezierPath() bezier30Path.move(to: CGPoint(x: 736.85, y: 289)) bezier30Path.addCurve(to: CGPoint(x: 732.5, y: 287.2), controlPoint1: CGPoint(x: 735.28, y: 289), controlPoint2: CGPoint(x: 733.7, y: 288.4)) bezier30Path.addLine(to: CGPoint(x: 723.8, y: 278.5)) bezier30Path.addCurve(to: CGPoint(x: 723.8, y: 269.8), controlPoint1: CGPoint(x: 721.4, y: 276.1), controlPoint2: CGPoint(x: 721.4, y: 272.2)) bezier30Path.addCurve(to: CGPoint(x: 732.5, y: 269.8), controlPoint1: CGPoint(x: 726.2, y: 267.4), controlPoint2: CGPoint(x: 730.1, y: 267.4)) bezier30Path.addLine(to: CGPoint(x: 741.2, y: 278.5)) bezier30Path.addCurve(to: CGPoint(x: 741.2, y: 287.2), controlPoint1: CGPoint(x: 743.6, y: 280.9), controlPoint2: CGPoint(x: 743.6, y: 284.8)) bezier30Path.addCurve(to: CGPoint(x: 736.85, y: 289), controlPoint1: CGPoint(x: 740, y: 288.4), controlPoint2: CGPoint(x: 738.42, y: 289)) bezier30Path.close() bezier30Path.usesEvenOddFillRule = true dark.setFill() bezier30Path.fill() //// Bezier 31 Drawing let bezier31Path = UIBezierPath() bezier31Path.move(to: CGPoint(x: 666.3, y: 343)) bezier31Path.addCurve(to: CGPoint(x: 661.85, y: 341.15), controlPoint1: CGPoint(x: 664.69, y: 343), controlPoint2: CGPoint(x: 663.08, y: 342.38)) bezier31Path.addCurve(to: CGPoint(x: 661.85, y: 332.24), controlPoint1: CGPoint(x: 659.38, y: 338.69), controlPoint2: CGPoint(x: 659.38, y: 334.7)) bezier31Path.addLine(to: CGPoint(x: 724.24, y: 269.85)) bezier31Path.addCurve(to: CGPoint(x: 733.15, y: 269.85), controlPoint1: CGPoint(x: 726.7, y: 267.38), controlPoint2: CGPoint(x: 730.69, y: 267.38)) bezier31Path.addCurve(to: CGPoint(x: 733.15, y: 278.76), controlPoint1: CGPoint(x: 735.62, y: 272.31), controlPoint2: CGPoint(x: 735.62, y: 276.3)) bezier31Path.addLine(to: CGPoint(x: 670.76, y: 341.15)) bezier31Path.addCurve(to: CGPoint(x: 666.3, y: 343), controlPoint1: CGPoint(x: 669.53, y: 342.38), controlPoint2: CGPoint(x: 667.91, y: 343)) bezier31Path.close() bezier31Path.usesEvenOddFillRule = true dark.setFill() bezier31Path.fill() //// Rectangle 3 Drawing let rectangle3Path = UIBezierPath(roundedRect: CGRect(x: 660, y: 330, width: 13, height: 30), cornerRadius: 6.5) dark.setFill() rectangle3Path.fill() //// Bezier 32 Drawing let bezier32Path = UIBezierPath() bezier32Path.move(to: CGPoint(x: 500.02, y: 689)) bezier32Path.addCurve(to: CGPoint(x: 495.57, y: 687.16), controlPoint1: CGPoint(x: 498.35, y: 689), controlPoint2: CGPoint(x: 496.75, y: 688.34)) bezier32Path.addLine(to: CGPoint(x: 437.97, y: 629.54)) bezier32Path.addCurve(to: CGPoint(x: 437.97, y: 620.64), controlPoint1: CGPoint(x: 435.52, y: 627.08), controlPoint2: CGPoint(x: 435.52, y: 623.1)) bezier32Path.addCurve(to: CGPoint(x: 446.86, y: 620.64), controlPoint1: CGPoint(x: 440.43, y: 618.18), controlPoint2: CGPoint(x: 444.41, y: 618.18)) bezier32Path.addLine(to: CGPoint(x: 500.02, y: 673.81)) bezier32Path.addLine(to: CGPoint(x: 640.52, y: 533.08)) bezier32Path.addCurve(to: CGPoint(x: 656.07, y: 511.24), controlPoint1: CGPoint(x: 647.03, y: 526.72), controlPoint2: CGPoint(x: 652.24, y: 519.38)) bezier32Path.addCurve(to: CGPoint(x: 640.52, y: 422.5), controlPoint1: CGPoint(x: 670.02, y: 481.39), controlPoint2: CGPoint(x: 663.78, y: 445.73)) bezier32Path.addCurve(to: CGPoint(x: 585.32, y: 399.58), controlPoint1: CGPoint(x: 625.79, y: 407.72), controlPoint2: CGPoint(x: 606.19, y: 399.58)) bezier32Path.addCurve(to: CGPoint(x: 530.03, y: 422.5), controlPoint1: CGPoint(x: 564.46, y: 399.58), controlPoint2: CGPoint(x: 544.81, y: 407.72)) bezier32Path.addLine(to: CGPoint(x: 504.46, y: 448.09)) bezier32Path.addCurve(to: CGPoint(x: 500.02, y: 449.93), controlPoint1: CGPoint(x: 503.28, y: 449.27), controlPoint2: CGPoint(x: 501.69, y: 449.93)) bezier32Path.addCurve(to: CGPoint(x: 495.57, y: 448.09), controlPoint1: CGPoint(x: 498.35, y: 449.93), controlPoint2: CGPoint(x: 496.75, y: 449.27)) bezier32Path.addLine(to: CGPoint(x: 470.02, y: 422.5)) bezier32Path.addCurve(to: CGPoint(x: 414.71, y: 399.58), controlPoint1: CGPoint(x: 455.24, y: 407.72), controlPoint2: CGPoint(x: 435.61, y: 399.58)) bezier32Path.addCurve(to: CGPoint(x: 359.42, y: 422.5), controlPoint1: CGPoint(x: 393.83, y: 399.58), controlPoint2: CGPoint(x: 374.19, y: 407.72)) bezier32Path.addCurve(to: CGPoint(x: 343.95, y: 511.14), controlPoint1: CGPoint(x: 336.2, y: 445.75), controlPoint2: CGPoint(x: 329.98, y: 481.38)) bezier32Path.addCurve(to: CGPoint(x: 359.42, y: 533.06), controlPoint1: CGPoint(x: 347.83, y: 519.31), controlPoint2: CGPoint(x: 353.03, y: 526.7)) bezier32Path.addLine(to: CGPoint(x: 417.76, y: 591.47)) bezier32Path.addCurve(to: CGPoint(x: 417.76, y: 600.36), controlPoint1: CGPoint(x: 420.21, y: 593.93), controlPoint2: CGPoint(x: 420.21, y: 597.91)) bezier32Path.addCurve(to: CGPoint(x: 408.87, y: 600.36), controlPoint1: CGPoint(x: 415.3, y: 602.82), controlPoint2: CGPoint(x: 411.32, y: 602.82)) bezier32Path.addLine(to: CGPoint(x: 350.54, y: 541.97)) bezier32Path.addCurve(to: CGPoint(x: 332.58, y: 516.51), controlPoint1: CGPoint(x: 343.13, y: 534.59), controlPoint2: CGPoint(x: 337.09, y: 526.02)) bezier32Path.addCurve(to: CGPoint(x: 350.53, y: 413.6), controlPoint1: CGPoint(x: 316.36, y: 481.94), controlPoint2: CGPoint(x: 323.57, y: 440.6)) bezier32Path.addCurve(to: CGPoint(x: 414.71, y: 387), controlPoint1: CGPoint(x: 367.67, y: 396.45), controlPoint2: CGPoint(x: 390.47, y: 387)) bezier32Path.addCurve(to: CGPoint(x: 478.9, y: 413.6), controlPoint1: CGPoint(x: 438.96, y: 387), controlPoint2: CGPoint(x: 461.76, y: 396.45)) bezier32Path.addLine(to: CGPoint(x: 500.02, y: 434.74)) bezier32Path.addLine(to: CGPoint(x: 521.14, y: 413.6)) bezier32Path.addCurve(to: CGPoint(x: 585.32, y: 387), controlPoint1: CGPoint(x: 538.31, y: 396.45), controlPoint2: CGPoint(x: 561.1, y: 387)) bezier32Path.addCurve(to: CGPoint(x: 649.41, y: 413.6), controlPoint1: CGPoint(x: 609.55, y: 387), controlPoint2: CGPoint(x: 632.32, y: 396.45)) bezier32Path.addCurve(to: CGPoint(x: 667.44, y: 516.57), controlPoint1: CGPoint(x: 676.4, y: 440.55), controlPoint2: CGPoint(x: 683.65, y: 481.93)) bezier32Path.addCurve(to: CGPoint(x: 649.36, y: 542.02), controlPoint1: CGPoint(x: 662.98, y: 526.1), controlPoint2: CGPoint(x: 656.9, y: 534.66)) bezier32Path.addLine(to: CGPoint(x: 504.46, y: 687.16)) bezier32Path.addCurve(to: CGPoint(x: 500.02, y: 689), controlPoint1: CGPoint(x: 503.28, y: 688.34), controlPoint2: CGPoint(x: 501.69, y: 689)) bezier32Path.close() bezier32Path.usesEvenOddFillRule = true dark.setFill() bezier32Path.fill() context.restoreGState() } @objc dynamic public class func drawBall(frame targetFrame: CGRect = CGRect(x: 0, y: 0, width: 1000, height: 1000), resizing: ResizingBehavior = .aspectFit, white: UIColor = UIColor(red: 1.000, green: 1.000, blue: 1.000, alpha: 1.000), light: UIColor = UIColor(red: 0.769, green: 0.847, blue: 0.984, alpha: 1.000), medium: UIColor = UIColor(red: 0.478, green: 0.663, blue: 0.973, alpha: 1.000), dark: UIColor = UIColor(red: 0.000, green: 0.478, blue: 1.000, alpha: 1.000)) { //// General Declarations let context = UIGraphicsGetCurrentContext()! //// Resize to Target Frame context.saveGState() let resizedFrame: CGRect = resizing.apply(rect: CGRect(x: 0, y: 0, width: 1000, height: 1000), target: targetFrame) context.translateBy(x: resizedFrame.minX, y: resizedFrame.minY) context.scaleBy(x: resizedFrame.width / 1000, y: resizedFrame.height / 1000) //// Group 3 //// Oval Drawing let ovalPath = UIBezierPath(ovalIn: CGRect(x: 197, y: 789, width: 606, height: 70)) light.setFill() ovalPath.fill() //// Oval 2 Drawing let oval2Path = UIBezierPath(ovalIn: CGRect(x: 450, y: 845, width: 99, height: 99)) light.setFill() oval2Path.fill() //// Bezier Drawing let bezierPath = UIBezierPath() bezierPath.move(to: CGPoint(x: 465, y: 894.5)) bezierPath.addCurve(to: CGPoint(x: 507, y: 845.72), controlPoint1: CGPoint(x: 465, y: 869.58), controlPoint2: CGPoint(x: 483.28, y: 849.17)) bezierPath.addCurve(to: CGPoint(x: 500, y: 845), controlPoint1: CGPoint(x: 504.7, y: 845.39), controlPoint2: CGPoint(x: 502.4, y: 845)) bezierPath.addCurve(to: CGPoint(x: 451, y: 894.5), controlPoint1: CGPoint(x: 472.94, y: 845), controlPoint2: CGPoint(x: 451, y: 867.15)) bezierPath.addCurve(to: CGPoint(x: 500, y: 944), controlPoint1: CGPoint(x: 451, y: 921.85), controlPoint2: CGPoint(x: 472.94, y: 944)) bezierPath.addCurve(to: CGPoint(x: 507, y: 943.28), controlPoint1: CGPoint(x: 502.4, y: 944), controlPoint2: CGPoint(x: 504.7, y: 943.61)) bezierPath.addCurve(to: CGPoint(x: 465, y: 894.5), controlPoint1: CGPoint(x: 483.28, y: 939.83), controlPoint2: CGPoint(x: 465, y: 919.41)) bezierPath.close() bezierPath.usesEvenOddFillRule = true white.setFill() bezierPath.fill() //// Bezier 2 Drawing let bezier2Path = UIBezierPath() bezier2Path.move(to: CGPoint(x: 535, y: 894.5)) bezier2Path.addCurve(to: CGPoint(x: 493, y: 845.72), controlPoint1: CGPoint(x: 535, y: 869.58), controlPoint2: CGPoint(x: 516.72, y: 849.17)) bezier2Path.addCurve(to: CGPoint(x: 500, y: 845), controlPoint1: CGPoint(x: 495.3, y: 845.39), controlPoint2: CGPoint(x: 497.6, y: 845)) bezier2Path.addCurve(to: CGPoint(x: 549, y: 894.5), controlPoint1: CGPoint(x: 527.06, y: 845), controlPoint2: CGPoint(x: 549, y: 867.15)) bezier2Path.addCurve(to: CGPoint(x: 500, y: 944), controlPoint1: CGPoint(x: 549, y: 921.85), controlPoint2: CGPoint(x: 527.06, y: 944)) bezier2Path.addCurve(to: CGPoint(x: 493, y: 943.28), controlPoint1: CGPoint(x: 497.6, y: 944), controlPoint2: CGPoint(x: 495.3, y: 943.61)) bezier2Path.addCurve(to: CGPoint(x: 535, y: 894.5), controlPoint1: CGPoint(x: 516.72, y: 939.83), controlPoint2: CGPoint(x: 535, y: 919.41)) bezier2Path.close() bezier2Path.usesEvenOddFillRule = true medium.setFill() bezier2Path.fill() //// Rectangle 2 Drawing let rectangle2Path = UIBezierPath(rect: CGRect(x: 479, y: 789, width: 42, height: 61)) medium.setFill() rectangle2Path.fill() //// Bezier 3 Drawing let bezier3Path = UIBezierPath() bezier3Path.move(to: CGPoint(x: 291.42, y: 347.09)) bezier3Path.addCurve(to: CGPoint(x: 471.27, y: 254.35), controlPoint1: CGPoint(x: 374.72, y: 327.39), controlPoint2: CGPoint(x: 471.27, y: 254.35)) bezier3Path.addLine(to: CGPoint(x: 476.35, y: 249)) bezier3Path.addCurve(to: CGPoint(x: 499.5, y: 254.06), controlPoint1: CGPoint(x: 483.27, y: 252.37), controlPoint2: CGPoint(x: 491.18, y: 254.06)) bezier3Path.addLine(to: CGPoint(x: 520.67, y: 263.92)) bezier3Path.addLine(to: CGPoint(x: 588.29, y: 293.89)) bezier3Path.addCurve(to: CGPoint(x: 707.56, y: 346.95), controlPoint1: CGPoint(x: 622.45, y: 314.44), controlPoint2: CGPoint(x: 666.5, y: 337.24)) bezier3Path.addLine(to: CGPoint(x: 704.19, y: 360.46)) bezier3Path.addCurve(to: CGPoint(x: 803, y: 817), controlPoint1: CGPoint(x: 704.19, y: 654.59), controlPoint2: CGPoint(x: 803, y: 690.34)) bezier3Path.addCurve(to: CGPoint(x: 499.5, y: 788.85), controlPoint1: CGPoint(x: 803, y: 817), controlPoint2: CGPoint(x: 690.07, y: 788.85)) bezier3Path.addCurve(to: CGPoint(x: 196, y: 817), controlPoint1: CGPoint(x: 308.93, y: 788.85), controlPoint2: CGPoint(x: 196, y: 817)) bezier3Path.addCurve(to: CGPoint(x: 294.81, y: 360.46), controlPoint1: CGPoint(x: 196, y: 690.34), controlPoint2: CGPoint(x: 294.81, y: 654.59)) bezier3Path.addLine(to: CGPoint(x: 291.42, y: 347.09)) bezier3Path.close() bezier3Path.usesEvenOddFillRule = true light.setFill() bezier3Path.fill() //// Bezier 4 Drawing let bezier4Path = UIBezierPath() bezier4Path.move(to: CGPoint(x: 238.51, y: 808.64)) bezier4Path.addCurve(to: CGPoint(x: 337, y: 360.38), controlPoint1: CGPoint(x: 242.74, y: 688.64), controlPoint2: CGPoint(x: 337, y: 647.95)) bezier4Path.addLine(to: CGPoint(x: 331.74, y: 334)) bezier4Path.addLine(to: CGPoint(x: 291.31, y: 347.01)) bezier4Path.addLine(to: CGPoint(x: 294.7, y: 360.39)) bezier4Path.addCurve(to: CGPoint(x: 196, y: 817), controlPoint1: CGPoint(x: 294.7, y: 654.57), controlPoint2: CGPoint(x: 196, y: 690.32)) bezier4Path.addCurve(to: CGPoint(x: 238.51, y: 808.64), controlPoint1: CGPoint(x: 196, y: 817), controlPoint2: CGPoint(x: 210.86, y: 813.33)) bezier4Path.close() bezier4Path.usesEvenOddFillRule = true white.setFill() bezier4Path.fill() //// Bezier 5 Drawing let bezier5Path = UIBezierPath() bezier5Path.move(to: CGPoint(x: 759.49, y: 808.64)) bezier5Path.addCurve(to: CGPoint(x: 661, y: 360.38), controlPoint1: CGPoint(x: 755.25, y: 688.64), controlPoint2: CGPoint(x: 661, y: 647.95)) bezier5Path.addLine(to: CGPoint(x: 666.26, y: 334)) bezier5Path.addLine(to: CGPoint(x: 706.69, y: 347.01)) bezier5Path.addLine(to: CGPoint(x: 703.3, y: 360.39)) bezier5Path.addCurve(to: CGPoint(x: 802, y: 817), controlPoint1: CGPoint(x: 703.3, y: 654.57), controlPoint2: CGPoint(x: 802, y: 690.32)) bezier5Path.addCurve(to: CGPoint(x: 759.49, y: 808.64), controlPoint1: CGPoint(x: 802, y: 817), controlPoint2: CGPoint(x: 787.14, y: 813.33)) bezier5Path.close() bezier5Path.usesEvenOddFillRule = true medium.setFill() bezier5Path.fill() //// Bezier 6 Drawing let bezier6Path = UIBezierPath() bezier6Path.move(to: CGPoint(x: 419.74, y: 302.87)) bezier6Path.addLine(to: CGPoint(x: 380, y: 408.92)) bezier6Path.addLine(to: CGPoint(x: 422.43, y: 394.83)) bezier6Path.addLine(to: CGPoint(x: 464.86, y: 423)) bezier6Path.addLine(to: CGPoint(x: 479, y: 263.86)) bezier6Path.addLine(to: CGPoint(x: 471.36, y: 254)) bezier6Path.addCurve(to: CGPoint(x: 411.26, y: 293.86), controlPoint1: CGPoint(x: 471.36, y: 254), controlPoint2: CGPoint(x: 446.61, y: 272.73)) bezier6Path.addLine(to: CGPoint(x: 419.74, y: 302.87)) bezier6Path.close() bezier6Path.usesEvenOddFillRule = true medium.setFill() bezier6Path.fill() //// Bezier 7 Drawing let bezier7Path = UIBezierPath() bezier7Path.move(to: CGPoint(x: 544.9, y: 183.29)) bezier7Path.addCurve(to: CGPoint(x: 549, y: 204.5), controlPoint1: CGPoint(x: 547.58, y: 189.37), controlPoint2: CGPoint(x: 549, y: 196.58)) bezier7Path.addCurve(to: CGPoint(x: 544.9, y: 225.71), controlPoint1: CGPoint(x: 549, y: 212.42), controlPoint2: CGPoint(x: 547.58, y: 219.63)) bezier7Path.addCurve(to: CGPoint(x: 499.5, y: 254), controlPoint1: CGPoint(x: 537.12, y: 243.96), controlPoint2: CGPoint(x: 519.29, y: 254)) bezier7Path.addCurve(to: CGPoint(x: 476.3, y: 248.91), controlPoint1: CGPoint(x: 491.16, y: 254), controlPoint2: CGPoint(x: 483.24, y: 252.3)) bezier7Path.addCurve(to: CGPoint(x: 454.1, y: 225.71), controlPoint1: CGPoint(x: 466.54, y: 244.24), controlPoint2: CGPoint(x: 458.63, y: 236.32)) bezier7Path.addCurve(to: CGPoint(x: 450, y: 204.5), controlPoint1: CGPoint(x: 451.41, y: 219.63), controlPoint2: CGPoint(x: 450, y: 212.42)) bezier7Path.addCurve(to: CGPoint(x: 454.1, y: 183.29), controlPoint1: CGPoint(x: 450, y: 196.58), controlPoint2: CGPoint(x: 451.42, y: 189.37)) bezier7Path.addCurve(to: CGPoint(x: 476.3, y: 160.09), controlPoint1: CGPoint(x: 458.63, y: 172.68), controlPoint2: CGPoint(x: 466.54, y: 164.76)) bezier7Path.addCurve(to: CGPoint(x: 499.5, y: 155), controlPoint1: CGPoint(x: 483.24, y: 156.7), controlPoint2: CGPoint(x: 491.16, y: 155)) bezier7Path.addCurve(to: CGPoint(x: 544.9, y: 183.29), controlPoint1: CGPoint(x: 519.29, y: 155), controlPoint2: CGPoint(x: 537.12, y: 165.04)) bezier7Path.close() bezier7Path.usesEvenOddFillRule = true light.setFill() bezier7Path.fill() //// Bezier 8 Drawing let bezier8Path = UIBezierPath() bezier8Path.move(to: CGPoint(x: 451, y: 204)) bezier8Path.addCurve(to: CGPoint(x: 455.06, y: 183.18), controlPoint1: CGPoint(x: 451.04, y: 196.23), controlPoint2: CGPoint(x: 452.43, y: 189.16)) bezier8Path.addCurve(to: CGPoint(x: 451, y: 204), controlPoint1: CGPoint(x: 452.43, y: 189.16), controlPoint2: CGPoint(x: 451.04, y: 196.23)) bezier8Path.close() bezier8Path.move(to: CGPoint(x: 477.04, y: 160.07)) bezier8Path.addCurve(to: CGPoint(x: 500, y: 155), controlPoint1: CGPoint(x: 483.9, y: 156.69), controlPoint2: CGPoint(x: 491.74, y: 155)) bezier8Path.addCurve(to: CGPoint(x: 477.04, y: 160.07), controlPoint1: CGPoint(x: 491.74, y: 155), controlPoint2: CGPoint(x: 483.9, y: 156.69)) bezier8Path.close() bezier8Path.usesEvenOddFillRule = true UIColor.red.setFill() bezier8Path.fill() //// Bezier 9 Drawing let bezier9Path = UIBezierPath() bezier9Path.move(to: CGPoint(x: 499.73, y: 254)) bezier9Path.addCurve(to: CGPoint(x: 476.43, y: 248.91), controlPoint1: CGPoint(x: 491.35, y: 254), controlPoint2: CGPoint(x: 483.39, y: 252.3)) bezier9Path.addCurve(to: CGPoint(x: 454.12, y: 225.71), controlPoint1: CGPoint(x: 466.62, y: 244.24), controlPoint2: CGPoint(x: 458.67, y: 236.32)) bezier9Path.addCurve(to: CGPoint(x: 450, y: 204.78), controlPoint1: CGPoint(x: 451.45, y: 219.7), controlPoint2: CGPoint(x: 450.03, y: 212.59)) bezier9Path.addCurve(to: CGPoint(x: 450, y: 204.5), controlPoint1: CGPoint(x: 450, y: 204.69), controlPoint2: CGPoint(x: 450, y: 204.59)) bezier9Path.addCurve(to: CGPoint(x: 450, y: 204.18), controlPoint1: CGPoint(x: 450, y: 204.4), controlPoint2: CGPoint(x: 450, y: 204.29)) bezier9Path.addCurve(to: CGPoint(x: 454.12, y: 183.29), controlPoint1: CGPoint(x: 450.04, y: 196.39), controlPoint2: CGPoint(x: 451.46, y: 189.29)) bezier9Path.addCurve(to: CGPoint(x: 476.43, y: 160.09), controlPoint1: CGPoint(x: 458.67, y: 172.68), controlPoint2: CGPoint(x: 466.62, y: 164.76)) bezier9Path.addCurve(to: CGPoint(x: 499.73, y: 155), controlPoint1: CGPoint(x: 483.39, y: 156.7), controlPoint2: CGPoint(x: 491.35, y: 155)) bezier9Path.addCurve(to: CGPoint(x: 500, y: 155), controlPoint1: CGPoint(x: 499.82, y: 155), controlPoint2: CGPoint(x: 499.91, y: 155)) bezier9Path.addCurve(to: CGPoint(x: 492.09, y: 155.63), controlPoint1: CGPoint(x: 497.32, y: 155.02), controlPoint2: CGPoint(x: 494.68, y: 155.25)) bezier9Path.addCurve(to: CGPoint(x: 500, y: 156.89), controlPoint1: CGPoint(x: 494.78, y: 155.91), controlPoint2: CGPoint(x: 497.43, y: 156.31)) bezier9Path.addCurve(to: CGPoint(x: 490.64, y: 160.09), controlPoint1: CGPoint(x: 496.72, y: 157.63), controlPoint2: CGPoint(x: 493.58, y: 158.66)) bezier9Path.addCurve(to: CGPoint(x: 468.33, y: 183.29), controlPoint1: CGPoint(x: 480.83, y: 164.76), controlPoint2: CGPoint(x: 472.88, y: 172.68)) bezier9Path.addCurve(to: CGPoint(x: 464.21, y: 204.5), controlPoint1: CGPoint(x: 465.63, y: 189.37), controlPoint2: CGPoint(x: 464.21, y: 196.58)) bezier9Path.addCurve(to: CGPoint(x: 468.33, y: 225.71), controlPoint1: CGPoint(x: 464.21, y: 212.42), controlPoint2: CGPoint(x: 465.63, y: 219.63)) bezier9Path.addCurve(to: CGPoint(x: 490.64, y: 248.91), controlPoint1: CGPoint(x: 472.88, y: 236.32), controlPoint2: CGPoint(x: 480.83, y: 244.24)) bezier9Path.addCurve(to: CGPoint(x: 500, y: 252.11), controlPoint1: CGPoint(x: 493.58, y: 250.34), controlPoint2: CGPoint(x: 496.72, y: 251.37)) bezier9Path.addCurve(to: CGPoint(x: 492.09, y: 253.37), controlPoint1: CGPoint(x: 497.43, y: 252.69), controlPoint2: CGPoint(x: 494.78, y: 253.09)) bezier9Path.addCurve(to: CGPoint(x: 500, y: 254), controlPoint1: CGPoint(x: 494.68, y: 253.75), controlPoint2: CGPoint(x: 497.32, y: 253.98)) bezier9Path.addCurve(to: CGPoint(x: 499.73, y: 254), controlPoint1: CGPoint(x: 499.91, y: 254), controlPoint2: CGPoint(x: 499.82, y: 254)) bezier9Path.close() bezier9Path.usesEvenOddFillRule = true white.setFill() bezier9Path.fill() //// Bezier 10 Drawing let bezier10Path = UIBezierPath() bezier10Path.move(to: CGPoint(x: 500.25, y: 254)) bezier10Path.addCurve(to: CGPoint(x: 500, y: 254), controlPoint1: CGPoint(x: 500.17, y: 254), controlPoint2: CGPoint(x: 500.09, y: 254)) bezier10Path.addCurve(to: CGPoint(x: 545.35, y: 225.71), controlPoint1: CGPoint(x: 519.78, y: 253.9), controlPoint2: CGPoint(x: 537.57, y: 243.87)) bezier10Path.addCurve(to: CGPoint(x: 549.47, y: 204.5), controlPoint1: CGPoint(x: 548.04, y: 219.63), controlPoint2: CGPoint(x: 549.47, y: 212.42)) bezier10Path.addCurve(to: CGPoint(x: 545.35, y: 183.29), controlPoint1: CGPoint(x: 549.47, y: 196.58), controlPoint2: CGPoint(x: 548.04, y: 189.37)) bezier10Path.addCurve(to: CGPoint(x: 500, y: 155), controlPoint1: CGPoint(x: 537.57, y: 165.13), controlPoint2: CGPoint(x: 519.78, y: 155.1)) bezier10Path.addCurve(to: CGPoint(x: 500.25, y: 155), controlPoint1: CGPoint(x: 500.09, y: 155), controlPoint2: CGPoint(x: 500.17, y: 155)) bezier10Path.addCurve(to: CGPoint(x: 523.57, y: 160.09), controlPoint1: CGPoint(x: 508.64, y: 155), controlPoint2: CGPoint(x: 516.6, y: 156.7)) bezier10Path.addCurve(to: CGPoint(x: 545.88, y: 183.29), controlPoint1: CGPoint(x: 533.37, y: 164.76), controlPoint2: CGPoint(x: 541.34, y: 172.68)) bezier10Path.addCurve(to: CGPoint(x: 550, y: 204.5), controlPoint1: CGPoint(x: 548.58, y: 189.37), controlPoint2: CGPoint(x: 550, y: 196.58)) bezier10Path.addCurve(to: CGPoint(x: 545.88, y: 225.71), controlPoint1: CGPoint(x: 550, y: 212.42), controlPoint2: CGPoint(x: 548.58, y: 219.63)) bezier10Path.addCurve(to: CGPoint(x: 523.57, y: 248.91), controlPoint1: CGPoint(x: 541.34, y: 236.32), controlPoint2: CGPoint(x: 533.37, y: 244.24)) bezier10Path.addCurve(to: CGPoint(x: 500.25, y: 254), controlPoint1: CGPoint(x: 516.6, y: 252.3), controlPoint2: CGPoint(x: 508.64, y: 254)) bezier10Path.close() bezier10Path.usesEvenOddFillRule = true UIColor.red.setFill() bezier10Path.fill() //// Bezier 11 Drawing let bezier11Path = UIBezierPath() bezier11Path.move(to: CGPoint(x: 500.01, y: 254)) bezier11Path.addCurve(to: CGPoint(x: 500, y: 254), controlPoint1: CGPoint(x: 500.01, y: 254), controlPoint2: CGPoint(x: 500.01, y: 254)) bezier11Path.addCurve(to: CGPoint(x: 507.84, y: 253.37), controlPoint1: CGPoint(x: 502.66, y: 253.98), controlPoint2: CGPoint(x: 505.27, y: 253.75)) bezier11Path.addCurve(to: CGPoint(x: 500, y: 252.11), controlPoint1: CGPoint(x: 505.17, y: 253.09), controlPoint2: CGPoint(x: 502.54, y: 252.69)) bezier11Path.addCurve(to: CGPoint(x: 509.27, y: 248.91), controlPoint1: CGPoint(x: 503.25, y: 251.37), controlPoint2: CGPoint(x: 506.36, y: 250.34)) bezier11Path.addCurve(to: CGPoint(x: 531.36, y: 225.71), controlPoint1: CGPoint(x: 518.98, y: 244.24), controlPoint2: CGPoint(x: 526.87, y: 236.32)) bezier11Path.addCurve(to: CGPoint(x: 535.45, y: 204.5), controlPoint1: CGPoint(x: 534.05, y: 219.63), controlPoint2: CGPoint(x: 535.45, y: 212.42)) bezier11Path.addCurve(to: CGPoint(x: 531.36, y: 183.29), controlPoint1: CGPoint(x: 535.45, y: 196.58), controlPoint2: CGPoint(x: 534.05, y: 189.37)) bezier11Path.addCurve(to: CGPoint(x: 509.27, y: 160.09), controlPoint1: CGPoint(x: 526.87, y: 172.68), controlPoint2: CGPoint(x: 518.98, y: 164.76)) bezier11Path.addCurve(to: CGPoint(x: 500, y: 156.89), controlPoint1: CGPoint(x: 506.36, y: 158.66), controlPoint2: CGPoint(x: 503.25, y: 157.63)) bezier11Path.addCurve(to: CGPoint(x: 507.84, y: 155.63), controlPoint1: CGPoint(x: 502.54, y: 156.31), controlPoint2: CGPoint(x: 505.17, y: 155.91)) bezier11Path.addCurve(to: CGPoint(x: 500, y: 155), controlPoint1: CGPoint(x: 505.27, y: 155.25), controlPoint2: CGPoint(x: 502.66, y: 155.02)) bezier11Path.addCurve(to: CGPoint(x: 500.01, y: 155), controlPoint1: CGPoint(x: 500.01, y: 155), controlPoint2: CGPoint(x: 500.01, y: 155)) bezier11Path.addCurve(to: CGPoint(x: 544.92, y: 183.29), controlPoint1: CGPoint(x: 519.6, y: 155.1), controlPoint2: CGPoint(x: 537.22, y: 165.13)) bezier11Path.addCurve(to: CGPoint(x: 549, y: 204.5), controlPoint1: CGPoint(x: 547.59, y: 189.37), controlPoint2: CGPoint(x: 549, y: 196.58)) bezier11Path.addCurve(to: CGPoint(x: 544.92, y: 225.71), controlPoint1: CGPoint(x: 549, y: 212.42), controlPoint2: CGPoint(x: 547.58, y: 219.63)) bezier11Path.addCurve(to: CGPoint(x: 500.01, y: 254), controlPoint1: CGPoint(x: 537.22, y: 243.87), controlPoint2: CGPoint(x: 519.6, y: 253.9)) bezier11Path.close() bezier11Path.usesEvenOddFillRule = true medium.setFill() bezier11Path.fill() //// Bezier 12 Drawing let bezier12Path = UIBezierPath() bezier12Path.move(to: CGPoint(x: 454.45, y: 226.01)) bezier12Path.addCurve(to: CGPoint(x: 476.6, y: 249.12), controlPoint1: CGPoint(x: 458.96, y: 236.58), controlPoint2: CGPoint(x: 466.86, y: 244.47)) bezier12Path.addLine(to: CGPoint(x: 471.52, y: 254.48)) bezier12Path.addCurve(to: CGPoint(x: 291.78, y: 347.34), controlPoint1: CGPoint(x: 471.52, y: 254.48), controlPoint2: CGPoint(x: 375.02, y: 327.61)) bezier12Path.addCurve(to: CGPoint(x: 190.77, y: 322.54), controlPoint1: CGPoint(x: 250.45, y: 357.35), controlPoint2: CGPoint(x: 212.35, y: 354.11)) bezier12Path.addCurve(to: CGPoint(x: 240.57, y: 56.9), controlPoint1: CGPoint(x: 158.74, y: 275.89), controlPoint2: CGPoint(x: 108.37, y: 56.9)) bezier12Path.addCurve(to: CGPoint(x: 471.38, y: 155.26), controlPoint1: CGPoint(x: 399.85, y: 56.9), controlPoint2: CGPoint(x: 471.38, y: 155.26)) bezier12Path.addLine(to: CGPoint(x: 476.6, y: 160.62)) bezier12Path.addCurve(to: CGPoint(x: 454.45, y: 183.73), controlPoint1: CGPoint(x: 466.87, y: 165.27), controlPoint2: CGPoint(x: 458.97, y: 173.16)) bezier12Path.addCurve(to: CGPoint(x: 450.36, y: 204.87), controlPoint1: CGPoint(x: 451.77, y: 189.79), controlPoint2: CGPoint(x: 450.36, y: 196.98)) bezier12Path.addCurve(to: CGPoint(x: 454.45, y: 226.01), controlPoint1: CGPoint(x: 450.36, y: 212.76), controlPoint2: CGPoint(x: 451.77, y: 219.95)) bezier12Path.close() bezier12Path.usesEvenOddFillRule = true medium.setFill() bezier12Path.fill() //// Bezier 13 Drawing let bezier13Path = UIBezierPath() bezier13Path.move(to: CGPoint(x: 233.09, y: 322.54)) bezier13Path.addCurve(to: CGPoint(x: 268.45, y: 57.97), controlPoint1: CGPoint(x: 202.31, y: 277.7), controlPoint2: CGPoint(x: 154.66, y: 73.69)) bezier13Path.addCurve(to: CGPoint(x: 240.57, y: 56.9), controlPoint1: CGPoint(x: 259.46, y: 57.29), controlPoint2: CGPoint(x: 250.19, y: 56.9)) bezier13Path.addCurve(to: CGPoint(x: 190.77, y: 322.54), controlPoint1: CGPoint(x: 108.37, y: 56.9), controlPoint2: CGPoint(x: 158.74, y: 275.89)) bezier13Path.addCurve(to: CGPoint(x: 276.05, y: 350.49), controlPoint1: CGPoint(x: 209.58, y: 350.05), controlPoint2: CGPoint(x: 240.94, y: 356.02)) bezier13Path.addCurve(to: CGPoint(x: 233.09, y: 322.54), controlPoint1: CGPoint(x: 258.73, y: 346.96), controlPoint2: CGPoint(x: 243.85, y: 338.28)) bezier13Path.close() bezier13Path.usesEvenOddFillRule = true light.setFill() bezier13Path.fill() //// Bezier 14 Drawing let bezier14Path = UIBezierPath() bezier14Path.move(to: CGPoint(x: 499.74, y: 254.19)) bezier14Path.addCurve(to: CGPoint(x: 545.02, y: 226.01), controlPoint1: CGPoint(x: 519.48, y: 254.19), controlPoint2: CGPoint(x: 537.27, y: 244.19)) bezier14Path.addCurve(to: CGPoint(x: 549.12, y: 204.87), controlPoint1: CGPoint(x: 547.7, y: 219.95), controlPoint2: CGPoint(x: 549.12, y: 212.76)) bezier14Path.addCurve(to: CGPoint(x: 545.02, y: 183.73), controlPoint1: CGPoint(x: 549.12, y: 196.98), controlPoint2: CGPoint(x: 547.7, y: 189.79)) bezier14Path.addCurve(to: CGPoint(x: 499.74, y: 155.55), controlPoint1: CGPoint(x: 537.27, y: 165.55), controlPoint2: CGPoint(x: 519.48, y: 155.55)) bezier14Path.addLine(to: CGPoint(x: 528.66, y: 155.55)) bezier14Path.addCurve(to: CGPoint(x: 758.91, y: 56.9), controlPoint1: CGPoint(x: 528.66, y: 155.55), controlPoint2: CGPoint(x: 599.62, y: 56.9)) bezier14Path.addCurve(to: CGPoint(x: 808.85, y: 322.54), controlPoint1: CGPoint(x: 891.09, y: 56.9), controlPoint2: CGPoint(x: 840.73, y: 275.89)) bezier14Path.addCurve(to: CGPoint(x: 707.68, y: 347.2), controlPoint1: CGPoint(x: 787.26, y: 354.25), controlPoint2: CGPoint(x: 749.03, y: 357.35)) bezier14Path.addCurve(to: CGPoint(x: 588.48, y: 294.07), controlPoint1: CGPoint(x: 666.64, y: 337.48), controlPoint2: CGPoint(x: 622.62, y: 314.65)) bezier14Path.addCurve(to: CGPoint(x: 528.52, y: 254.19), controlPoint1: CGPoint(x: 553.21, y: 272.94), controlPoint2: CGPoint(x: 528.52, y: 254.19)) bezier14Path.addLine(to: CGPoint(x: 520.9, y: 264.06)) bezier14Path.addLine(to: CGPoint(x: 499.74, y: 254.19)) bezier14Path.close() bezier14Path.usesEvenOddFillRule = true medium.setFill() bezier14Path.fill() //// Bezier 15 Drawing let bezier15Path = UIBezierPath() bezier15Path.move(to: CGPoint(x: 580.25, y: 302.87)) bezier15Path.addLine(to: CGPoint(x: 620, y: 408.92)) bezier15Path.addLine(to: CGPoint(x: 577.57, y: 394.83)) bezier15Path.addLine(to: CGPoint(x: 535.14, y: 423)) bezier15Path.addLine(to: CGPoint(x: 521, y: 263.86)) bezier15Path.addLine(to: CGPoint(x: 528.64, y: 254)) bezier15Path.addCurve(to: CGPoint(x: 588.74, y: 293.86), controlPoint1: CGPoint(x: 528.64, y: 254), controlPoint2: CGPoint(x: 553.39, y: 272.73)) bezier15Path.addLine(to: CGPoint(x: 580.25, y: 302.87)) bezier15Path.close() bezier15Path.usesEvenOddFillRule = true medium.setFill() bezier15Path.fill() //// Bezier 16 Drawing let bezier16Path = UIBezierPath() bezier16Path.move(to: CGPoint(x: 545.06, y: 866)) bezier16Path.addCurve(to: CGPoint(x: 538, y: 859.09), controlPoint1: CGPoint(x: 541.24, y: 866), controlPoint2: CGPoint(x: 538.1, y: 862.94)) bezier16Path.addCurve(to: CGPoint(x: 544.89, y: 851.82), controlPoint1: CGPoint(x: 537.92, y: 855.16), controlPoint2: CGPoint(x: 540.99, y: 851.92)) bezier16Path.addCurve(to: CGPoint(x: 801.25, y: 824.2), controlPoint1: CGPoint(x: 704.01, y: 847.98), controlPoint2: CGPoint(x: 797.36, y: 825.17)) bezier16Path.addCurve(to: CGPoint(x: 809.79, y: 829.4), controlPoint1: CGPoint(x: 805.01, y: 823.28), controlPoint2: CGPoint(x: 808.85, y: 825.57)) bezier16Path.addCurve(to: CGPoint(x: 804.64, y: 837.98), controlPoint1: CGPoint(x: 810.73, y: 833.19), controlPoint2: CGPoint(x: 808.43, y: 837.04)) bezier16Path.addCurve(to: CGPoint(x: 545.24, y: 866), controlPoint1: CGPoint(x: 800.68, y: 838.96), controlPoint2: CGPoint(x: 705.89, y: 862.11)) bezier16Path.addLine(to: CGPoint(x: 545.06, y: 866)) bezier16Path.close() bezier16Path.usesEvenOddFillRule = true dark.setFill() bezier16Path.fill() //// Bezier 17 Drawing let bezier17Path = UIBezierPath() bezier17Path.move(to: CGPoint(x: 453.95, y: 866)) bezier17Path.addLine(to: CGPoint(x: 453.77, y: 866)) bezier17Path.addCurve(to: CGPoint(x: 194.36, y: 837.98), controlPoint1: CGPoint(x: 293.12, y: 862.11), controlPoint2: CGPoint(x: 198.32, y: 838.96)) bezier17Path.addCurve(to: CGPoint(x: 189.21, y: 829.4), controlPoint1: CGPoint(x: 190.58, y: 837.04), controlPoint2: CGPoint(x: 188.27, y: 833.19)) bezier17Path.addCurve(to: CGPoint(x: 197.75, y: 824.2), controlPoint1: CGPoint(x: 190.14, y: 825.58), controlPoint2: CGPoint(x: 193.95, y: 823.28)) bezier17Path.addCurve(to: CGPoint(x: 454.12, y: 851.82), controlPoint1: CGPoint(x: 201.64, y: 825.18), controlPoint2: CGPoint(x: 294.98, y: 847.98)) bezier17Path.addCurve(to: CGPoint(x: 461, y: 859.09), controlPoint1: CGPoint(x: 458.01, y: 851.92), controlPoint2: CGPoint(x: 461.09, y: 855.16)) bezier17Path.addCurve(to: CGPoint(x: 453.95, y: 866), controlPoint1: CGPoint(x: 460.9, y: 862.94), controlPoint2: CGPoint(x: 457.77, y: 866)) bezier17Path.close() bezier17Path.usesEvenOddFillRule = true dark.setFill() bezier17Path.fill() //// Bezier 18 Drawing let bezier18Path = UIBezierPath() bezier18Path.move(to: CGPoint(x: 499.5, y: 852.09)) bezier18Path.addCurve(to: CGPoint(x: 481.41, y: 856.18), controlPoint1: CGPoint(x: 493.05, y: 852.09), controlPoint2: CGPoint(x: 486.96, y: 853.47)) bezier18Path.addCurve(to: CGPoint(x: 457.13, y: 894.48), controlPoint1: CGPoint(x: 466.63, y: 863.19), controlPoint2: CGPoint(x: 457.13, y: 878.23)) bezier18Path.addCurve(to: CGPoint(x: 499.5, y: 936.87), controlPoint1: CGPoint(x: 457.13, y: 917.86), controlPoint2: CGPoint(x: 476.14, y: 936.87)) bezier18Path.addCurve(to: CGPoint(x: 541.88, y: 894.48), controlPoint1: CGPoint(x: 522.87, y: 936.87), controlPoint2: CGPoint(x: 541.88, y: 917.86)) bezier18Path.addCurve(to: CGPoint(x: 517.66, y: 856.21), controlPoint1: CGPoint(x: 541.88, y: 878.23), controlPoint2: CGPoint(x: 532.37, y: 863.19)) bezier18Path.addCurve(to: CGPoint(x: 499.5, y: 852.09), controlPoint1: CGPoint(x: 512.04, y: 853.47), controlPoint2: CGPoint(x: 505.95, y: 852.09)) bezier18Path.close() bezier18Path.move(to: CGPoint(x: 499.5, y: 951)) bezier18Path.addCurve(to: CGPoint(x: 443, y: 894.48), controlPoint1: CGPoint(x: 468.35, y: 951), controlPoint2: CGPoint(x: 443, y: 925.64)) bezier18Path.addCurve(to: CGPoint(x: 475.29, y: 843.46), controlPoint1: CGPoint(x: 443, y: 872.79), controlPoint2: CGPoint(x: 455.67, y: 852.76)) bezier18Path.addCurve(to: CGPoint(x: 523.78, y: 843.48), controlPoint1: CGPoint(x: 490.14, y: 836.2), controlPoint2: CGPoint(x: 508.79, y: 836.16)) bezier18Path.addCurve(to: CGPoint(x: 556, y: 894.48), controlPoint1: CGPoint(x: 543.33, y: 852.76), controlPoint2: CGPoint(x: 556, y: 872.79)) bezier18Path.addCurve(to: CGPoint(x: 499.5, y: 951), controlPoint1: CGPoint(x: 556, y: 925.64), controlPoint2: CGPoint(x: 530.65, y: 951)) bezier18Path.close() bezier18Path.usesEvenOddFillRule = true dark.setFill() bezier18Path.fill() //// Rectangle 3 Drawing let rectangle3Path = UIBezierPath(roundedRect: CGRect(x: 514, y: 796, width: 14, height: 61), cornerRadius: 7) dark.setFill() rectangle3Path.fill() //// Rectangle 4 Drawing let rectangle4Path = UIBezierPath(roundedRect: CGRect(x: 472, y: 796, width: 14, height: 61), cornerRadius: 7) dark.setFill() rectangle4Path.fill() //// Bezier 19 Drawing let bezier19Path = UIBezierPath() bezier19Path.move(to: CGPoint(x: 196.06, y: 824)) bezier19Path.addCurve(to: CGPoint(x: 189, y: 816.96), controlPoint1: CGPoint(x: 192.16, y: 824), controlPoint2: CGPoint(x: 189, y: 820.85)) bezier19Path.addCurve(to: CGPoint(x: 223.84, y: 684.61), controlPoint1: CGPoint(x: 189, y: 765.28), controlPoint2: CGPoint(x: 205.15, y: 727.9)) bezier19Path.addCurve(to: CGPoint(x: 287.88, y: 360.04), controlPoint1: CGPoint(x: 252.37, y: 618.54), controlPoint2: CGPoint(x: 287.88, y: 536.33)) bezier19Path.addCurve(to: CGPoint(x: 294.94, y: 353), controlPoint1: CGPoint(x: 287.88, y: 356.15), controlPoint2: CGPoint(x: 291.03, y: 353)) bezier19Path.addCurve(to: CGPoint(x: 302, y: 360.04), controlPoint1: CGPoint(x: 298.84, y: 353), controlPoint2: CGPoint(x: 302, y: 356.15)) bezier19Path.addCurve(to: CGPoint(x: 236.82, y: 690.16), controlPoint1: CGPoint(x: 302, y: 539.23), controlPoint2: CGPoint(x: 265.86, y: 622.93)) bezier19Path.addCurve(to: CGPoint(x: 203.12, y: 816.96), controlPoint1: CGPoint(x: 217.99, y: 733.75), controlPoint2: CGPoint(x: 203.12, y: 768.18)) bezier19Path.addCurve(to: CGPoint(x: 196.06, y: 824), controlPoint1: CGPoint(x: 203.12, y: 820.85), controlPoint2: CGPoint(x: 199.97, y: 824)) bezier19Path.close() bezier19Path.usesEvenOddFillRule = true dark.setFill() bezier19Path.fill() //// Bezier 20 Drawing let bezier20Path = UIBezierPath() bezier20Path.move(to: CGPoint(x: 802.94, y: 824)) bezier20Path.addCurve(to: CGPoint(x: 795.88, y: 816.96), controlPoint1: CGPoint(x: 799.03, y: 824), controlPoint2: CGPoint(x: 795.88, y: 820.85)) bezier20Path.addCurve(to: CGPoint(x: 762.18, y: 690.17), controlPoint1: CGPoint(x: 795.88, y: 768.18), controlPoint2: CGPoint(x: 781.01, y: 733.75)) bezier20Path.addCurve(to: CGPoint(x: 697, y: 360.04), controlPoint1: CGPoint(x: 733.14, y: 622.93), controlPoint2: CGPoint(x: 697, y: 539.23)) bezier20Path.addCurve(to: CGPoint(x: 704.06, y: 353), controlPoint1: CGPoint(x: 697, y: 356.15), controlPoint2: CGPoint(x: 700.16, y: 353)) bezier20Path.addCurve(to: CGPoint(x: 711.12, y: 360.04), controlPoint1: CGPoint(x: 707.97, y: 353), controlPoint2: CGPoint(x: 711.12, y: 356.15)) bezier20Path.addCurve(to: CGPoint(x: 775.16, y: 684.61), controlPoint1: CGPoint(x: 711.12, y: 536.33), controlPoint2: CGPoint(x: 746.63, y: 618.55)) bezier20Path.addCurve(to: CGPoint(x: 810, y: 816.96), controlPoint1: CGPoint(x: 793.85, y: 727.9), controlPoint2: CGPoint(x: 810, y: 765.28)) bezier20Path.addCurve(to: CGPoint(x: 802.94, y: 824), controlPoint1: CGPoint(x: 810, y: 820.85), controlPoint2: CGPoint(x: 806.84, y: 824)) bezier20Path.close() bezier20Path.usesEvenOddFillRule = true dark.setFill() bezier20Path.fill() //// Bezier 21 Drawing let bezier21Path = UIBezierPath() bezier21Path.move(to: CGPoint(x: 802.95, y: 824)) bezier21Path.addCurve(to: CGPoint(x: 801.24, y: 823.78), controlPoint1: CGPoint(x: 802.39, y: 824), controlPoint2: CGPoint(x: 801.81, y: 823.93)) bezier21Path.addCurve(to: CGPoint(x: 499.5, y: 796), controlPoint1: CGPoint(x: 800.11, y: 823.51), controlPoint2: CGPoint(x: 686.81, y: 796)) bezier21Path.addCurve(to: CGPoint(x: 197.76, y: 823.78), controlPoint1: CGPoint(x: 312.19, y: 796), controlPoint2: CGPoint(x: 198.89, y: 823.51)) bezier21Path.addCurve(to: CGPoint(x: 189.21, y: 818.7), controlPoint1: CGPoint(x: 193.99, y: 824.73), controlPoint2: CGPoint(x: 190.15, y: 822.44)) bezier21Path.addCurve(to: CGPoint(x: 194.35, y: 810.22), controlPoint1: CGPoint(x: 188.27, y: 814.95), controlPoint2: CGPoint(x: 190.56, y: 811.15)) bezier21Path.addCurve(to: CGPoint(x: 499.5, y: 782), controlPoint1: CGPoint(x: 195.48, y: 809.92), controlPoint2: CGPoint(x: 310.29, y: 782)) bezier21Path.addCurve(to: CGPoint(x: 804.66, y: 810.22), controlPoint1: CGPoint(x: 688.72, y: 782), controlPoint2: CGPoint(x: 803.51, y: 809.92)) bezier21Path.addCurve(to: CGPoint(x: 809.79, y: 818.7), controlPoint1: CGPoint(x: 808.44, y: 811.15), controlPoint2: CGPoint(x: 810.74, y: 814.95)) bezier21Path.addCurve(to: CGPoint(x: 802.95, y: 824), controlPoint1: CGPoint(x: 808.99, y: 821.87), controlPoint2: CGPoint(x: 806.12, y: 824)) bezier21Path.close() bezier21Path.usesEvenOddFillRule = true dark.setFill() bezier21Path.fill() //// Bezier 22 Drawing let bezier22Path = UIBezierPath() bezier22Path.move(to: CGPoint(x: 499.74, y: 162.61)) bezier22Path.addCurve(to: CGPoint(x: 479.7, y: 166.96), controlPoint1: CGPoint(x: 492.35, y: 162.61), controlPoint2: CGPoint(x: 485.62, y: 164.07)) bezier22Path.addCurve(to: CGPoint(x: 460.95, y: 186.5), controlPoint1: CGPoint(x: 471.13, y: 171.06), controlPoint2: CGPoint(x: 464.66, y: 177.81)) bezier22Path.addCurve(to: CGPoint(x: 457.42, y: 204.87), controlPoint1: CGPoint(x: 458.62, y: 191.74), controlPoint2: CGPoint(x: 457.42, y: 198.07)) bezier22Path.addCurve(to: CGPoint(x: 460.91, y: 223.15), controlPoint1: CGPoint(x: 457.42, y: 211.66), controlPoint2: CGPoint(x: 458.62, y: 217.99)) bezier22Path.addCurve(to: CGPoint(x: 479.65, y: 242.75), controlPoint1: CGPoint(x: 464.66, y: 231.93), controlPoint2: CGPoint(x: 471.13, y: 238.68)) bezier22Path.addCurve(to: CGPoint(x: 499.74, y: 247.13), controlPoint1: CGPoint(x: 485.62, y: 245.66), controlPoint2: CGPoint(x: 492.35, y: 247.13)) bezier22Path.addCurve(to: CGPoint(x: 538.53, y: 223.24), controlPoint1: CGPoint(x: 517.64, y: 247.13), controlPoint2: CGPoint(x: 532.14, y: 238.2)) bezier22Path.addCurve(to: CGPoint(x: 542.05, y: 204.87), controlPoint1: CGPoint(x: 540.84, y: 217.99), controlPoint2: CGPoint(x: 542.05, y: 211.66)) bezier22Path.addCurve(to: CGPoint(x: 538.56, y: 186.58), controlPoint1: CGPoint(x: 542.05, y: 198.07), controlPoint2: CGPoint(x: 540.84, y: 191.74)) bezier22Path.addCurve(to: CGPoint(x: 499.74, y: 162.61), controlPoint1: CGPoint(x: 532.14, y: 171.53), controlPoint2: CGPoint(x: 517.64, y: 162.61)) bezier22Path.close() bezier22Path.move(to: CGPoint(x: 499.74, y: 261.22)) bezier22Path.addCurve(to: CGPoint(x: 473.5, y: 255.43), controlPoint1: CGPoint(x: 490.19, y: 261.22), controlPoint2: CGPoint(x: 481.36, y: 259.27)) bezier22Path.addCurve(to: CGPoint(x: 447.97, y: 228.77), controlPoint1: CGPoint(x: 461.9, y: 249.89), controlPoint2: CGPoint(x: 453.05, y: 240.66)) bezier22Path.addCurve(to: CGPoint(x: 443.31, y: 204.87), controlPoint1: CGPoint(x: 444.89, y: 221.81), controlPoint2: CGPoint(x: 443.31, y: 213.74)) bezier22Path.addCurve(to: CGPoint(x: 448, y: 180.89), controlPoint1: CGPoint(x: 443.31, y: 196), controlPoint2: CGPoint(x: 444.89, y: 187.94)) bezier22Path.addCurve(to: CGPoint(x: 473.56, y: 154.27), controlPoint1: CGPoint(x: 453.05, y: 169.08), controlPoint2: CGPoint(x: 461.9, y: 159.85)) bezier22Path.addCurve(to: CGPoint(x: 499.74, y: 148.52), controlPoint1: CGPoint(x: 481.36, y: 150.46), controlPoint2: CGPoint(x: 490.19, y: 148.52)) bezier22Path.addCurve(to: CGPoint(x: 551.5, y: 180.98), controlPoint1: CGPoint(x: 523.13, y: 148.52), controlPoint2: CGPoint(x: 542.96, y: 160.95)) bezier22Path.addCurve(to: CGPoint(x: 556.16, y: 204.87), controlPoint1: CGPoint(x: 554.58, y: 187.93), controlPoint2: CGPoint(x: 556.16, y: 196)) bezier22Path.addCurve(to: CGPoint(x: 551.46, y: 228.85), controlPoint1: CGPoint(x: 556.16, y: 213.73), controlPoint2: CGPoint(x: 554.58, y: 221.8)) bezier22Path.addCurve(to: CGPoint(x: 499.74, y: 261.22), controlPoint1: CGPoint(x: 542.96, y: 248.78), controlPoint2: CGPoint(x: 523.13, y: 261.22)) bezier22Path.close() bezier22Path.usesEvenOddFillRule = true dark.setFill() bezier22Path.fill() //// Bezier 23 Drawing let bezier23Path = UIBezierPath() bezier23Path.move(to: CGPoint(x: 746.49, y: 359.41)) bezier23Path.addCurve(to: CGPoint(x: 705.97, y: 353.99), controlPoint1: CGPoint(x: 734.22, y: 359.41), controlPoint2: CGPoint(x: 720.69, y: 357.61)) bezier23Path.addCurve(to: CGPoint(x: 584.81, y: 300.08), controlPoint1: CGPoint(x: 671.38, y: 345.8), controlPoint2: CGPoint(x: 630.59, y: 327.66)) bezier23Path.addCurve(to: CGPoint(x: 524.24, y: 259.78), controlPoint1: CGPoint(x: 549.64, y: 279), controlPoint2: CGPoint(x: 524.49, y: 259.98)) bezier23Path.addCurve(to: CGPoint(x: 522.89, y: 249.91), controlPoint1: CGPoint(x: 521.14, y: 257.43), controlPoint2: CGPoint(x: 520.54, y: 253.01)) bezier23Path.addCurve(to: CGPoint(x: 532.78, y: 248.57), controlPoint1: CGPoint(x: 525.25, y: 246.82), controlPoint2: CGPoint(x: 529.66, y: 246.21)) bezier23Path.addCurve(to: CGPoint(x: 592.09, y: 288.01), controlPoint1: CGPoint(x: 533.02, y: 248.76), controlPoint2: CGPoint(x: 557.61, y: 267.34)) bezier23Path.addCurve(to: CGPoint(x: 709.28, y: 340.31), controlPoint1: CGPoint(x: 636.62, y: 314.84), controlPoint2: CGPoint(x: 676.05, y: 332.44)) bezier23Path.addCurve(to: CGPoint(x: 802.96, y: 318.54), controlPoint1: CGPoint(x: 754.14, y: 351.3), controlPoint2: CGPoint(x: 785.65, y: 343.98)) bezier23Path.addCurve(to: CGPoint(x: 824.03, y: 101.01), controlPoint1: CGPoint(x: 825.1, y: 286.16), controlPoint2: CGPoint(x: 857.52, y: 164.33)) bezier23Path.addCurve(to: CGPoint(x: 758.86, y: 64), controlPoint1: CGPoint(x: 811.05, y: 76.45), controlPoint2: CGPoint(x: 789.12, y: 64)) bezier23Path.addCurve(to: CGPoint(x: 534.38, y: 159.68), controlPoint1: CGPoint(x: 605.01, y: 64), controlPoint2: CGPoint(x: 535.07, y: 158.71)) bezier23Path.addCurve(to: CGPoint(x: 524.53, y: 161.29), controlPoint1: CGPoint(x: 532.1, y: 162.83), controlPoint2: CGPoint(x: 527.69, y: 163.54)) bezier23Path.addCurve(to: CGPoint(x: 522.92, y: 151.45), controlPoint1: CGPoint(x: 521.37, y: 159.02), controlPoint2: CGPoint(x: 520.65, y: 154.61)) bezier23Path.addCurve(to: CGPoint(x: 758.86, y: 49.91), controlPoint1: CGPoint(x: 525.91, y: 147.31), controlPoint2: CGPoint(x: 597.84, y: 49.91)) bezier23Path.addCurve(to: CGPoint(x: 836.5, y: 94.43), controlPoint1: CGPoint(x: 794.76, y: 49.91), controlPoint2: CGPoint(x: 820.88, y: 64.89)) bezier23Path.addCurve(to: CGPoint(x: 814.63, y: 326.47), controlPoint1: CGPoint(x: 873.01, y: 163.44), controlPoint2: CGPoint(x: 838.82, y: 291.07)) bezier23Path.addCurve(to: CGPoint(x: 746.49, y: 359.41), controlPoint1: CGPoint(x: 799.69, y: 348.4), controlPoint2: CGPoint(x: 776.85, y: 359.41)) bezier23Path.close() bezier23Path.usesEvenOddFillRule = true dark.setFill() bezier23Path.fill() //// Bezier 24 Drawing let bezier24Path = UIBezierPath() bezier24Path.move(to: CGPoint(x: 253.37, y: 359.42)) bezier24Path.addCurve(to: CGPoint(x: 185, y: 326.48), controlPoint1: CGPoint(x: 222.92, y: 359.43), controlPoint2: CGPoint(x: 200, y: 348.41)) bezier24Path.addCurve(to: CGPoint(x: 162.92, y: 94.52), controlPoint1: CGPoint(x: 160.76, y: 291.17), controlPoint2: CGPoint(x: 126.45, y: 163.67)) bezier24Path.addCurve(to: CGPoint(x: 240.61, y: 49.91), controlPoint1: CGPoint(x: 178.54, y: 64.92), controlPoint2: CGPoint(x: 204.67, y: 49.91)) bezier24Path.addCurve(to: CGPoint(x: 477.09, y: 151.14), controlPoint1: CGPoint(x: 401.61, y: 49.91), controlPoint2: CGPoint(x: 474.08, y: 147)) bezier24Path.addCurve(to: CGPoint(x: 475.53, y: 160.97), controlPoint1: CGPoint(x: 479.38, y: 154.28), controlPoint2: CGPoint(x: 478.68, y: 158.68)) bezier24Path.addCurve(to: CGPoint(x: 465.68, y: 159.43), controlPoint1: CGPoint(x: 472.4, y: 163.26), controlPoint2: CGPoint(x: 467.98, y: 162.57)) bezier24Path.addCurve(to: CGPoint(x: 240.61, y: 63.99), controlPoint1: CGPoint(x: 464.98, y: 158.47), controlPoint2: CGPoint(x: 394.1, y: 63.99)) bezier24Path.addCurve(to: CGPoint(x: 175.4, y: 101.08), controlPoint1: CGPoint(x: 210.32, y: 63.99), controlPoint2: CGPoint(x: 188.39, y: 76.47)) bezier24Path.addCurve(to: CGPoint(x: 196.64, y: 318.52), controlPoint1: CGPoint(x: 141.94, y: 164.52), controlPoint2: CGPoint(x: 174.47, y: 286.23)) bezier24Path.addCurve(to: CGPoint(x: 290.16, y: 340.45), controlPoint1: CGPoint(x: 214, y: 343.89), controlPoint2: CGPoint(x: 245.46, y: 351.26)) bezier24Path.addCurve(to: CGPoint(x: 467.26, y: 248.84), controlPoint1: CGPoint(x: 370.98, y: 321.3), controlPoint2: CGPoint(x: 466.32, y: 249.57)) bezier24Path.addCurve(to: CGPoint(x: 477.15, y: 250.2), controlPoint1: CGPoint(x: 470.37, y: 246.48), controlPoint2: CGPoint(x: 474.79, y: 247.1)) bezier24Path.addCurve(to: CGPoint(x: 475.79, y: 260.07), controlPoint1: CGPoint(x: 479.5, y: 253.3), controlPoint2: CGPoint(x: 478.89, y: 257.72)) bezier24Path.addCurve(to: CGPoint(x: 293.44, y: 354.14), controlPoint1: CGPoint(x: 471.8, y: 263.09), controlPoint2: CGPoint(x: 377.16, y: 334.31)) bezier24Path.addCurve(to: CGPoint(x: 253.37, y: 359.42), controlPoint1: CGPoint(x: 278.9, y: 357.67), controlPoint2: CGPoint(x: 265.53, y: 359.42)) bezier24Path.close() bezier24Path.usesEvenOddFillRule = true dark.setFill() bezier24Path.fill() //// Bezier 25 Drawing let bezier25Path = UIBezierPath() bezier25Path.move(to: CGPoint(x: 545.07, y: 191)) bezier25Path.addCurve(to: CGPoint(x: 538.34, y: 186.12), controlPoint1: CGPoint(x: 542.08, y: 191), controlPoint2: CGPoint(x: 539.29, y: 189.1)) bezier25Path.addCurve(to: CGPoint(x: 542.93, y: 177.33), controlPoint1: CGPoint(x: 537.15, y: 182.44), controlPoint2: CGPoint(x: 539.2, y: 178.51)) bezier25Path.addLine(to: CGPoint(x: 631.8, y: 149.34)) bezier25Path.addCurve(to: CGPoint(x: 640.67, y: 153.89), controlPoint1: CGPoint(x: 635.49, y: 148.15), controlPoint2: CGPoint(x: 639.47, y: 150.2)) bezier25Path.addCurve(to: CGPoint(x: 636.07, y: 162.68), controlPoint1: CGPoint(x: 641.84, y: 157.57), controlPoint2: CGPoint(x: 639.79, y: 161.5)) bezier25Path.addLine(to: CGPoint(x: 547.21, y: 190.67)) bezier25Path.addCurve(to: CGPoint(x: 545.07, y: 191), controlPoint1: CGPoint(x: 546.49, y: 190.9), controlPoint2: CGPoint(x: 545.77, y: 191)) bezier25Path.close() bezier25Path.usesEvenOddFillRule = true dark.setFill() bezier25Path.fill() //// Bezier 26 Drawing let bezier26Path = UIBezierPath() bezier26Path.move(to: CGPoint(x: 633.94, y: 261)) bezier26Path.addCurve(to: CGPoint(x: 631.8, y: 260.67), controlPoint1: CGPoint(x: 633.22, y: 261), controlPoint2: CGPoint(x: 632.5, y: 260.9)) bezier26Path.addLine(to: CGPoint(x: 542.93, y: 232.68)) bezier26Path.addCurve(to: CGPoint(x: 538.34, y: 223.89), controlPoint1: CGPoint(x: 539.21, y: 231.5), controlPoint2: CGPoint(x: 537.15, y: 227.57)) bezier26Path.addCurve(to: CGPoint(x: 547.21, y: 219.33), controlPoint1: CGPoint(x: 539.52, y: 220.2), controlPoint2: CGPoint(x: 543.5, y: 218.15)) bezier26Path.addLine(to: CGPoint(x: 636.07, y: 247.33)) bezier26Path.addCurve(to: CGPoint(x: 640.67, y: 256.12), controlPoint1: CGPoint(x: 639.79, y: 248.5), controlPoint2: CGPoint(x: 641.84, y: 252.43)) bezier26Path.addCurve(to: CGPoint(x: 633.94, y: 261), controlPoint1: CGPoint(x: 639.7, y: 259.1), controlPoint2: CGPoint(x: 636.93, y: 261)) bezier26Path.close() bezier26Path.usesEvenOddFillRule = true dark.setFill() bezier26Path.fill() //// Bezier 27 Drawing let bezier27Path = UIBezierPath() bezier27Path.move(to: CGPoint(x: 454.93, y: 191)) bezier27Path.addCurve(to: CGPoint(x: 452.79, y: 190.67), controlPoint1: CGPoint(x: 454.22, y: 191), controlPoint2: CGPoint(x: 453.51, y: 190.9)) bezier27Path.addLine(to: CGPoint(x: 363.93, y: 162.67)) bezier27Path.addCurve(to: CGPoint(x: 359.33, y: 153.89), controlPoint1: CGPoint(x: 360.21, y: 161.5), controlPoint2: CGPoint(x: 358.15, y: 157.57)) bezier27Path.addCurve(to: CGPoint(x: 368.2, y: 149.33), controlPoint1: CGPoint(x: 360.51, y: 150.2), controlPoint2: CGPoint(x: 364.49, y: 148.16)) bezier27Path.addLine(to: CGPoint(x: 457.07, y: 177.33)) bezier27Path.addCurve(to: CGPoint(x: 461.67, y: 186.12), controlPoint1: CGPoint(x: 460.79, y: 178.5), controlPoint2: CGPoint(x: 462.85, y: 182.44)) bezier27Path.addCurve(to: CGPoint(x: 454.93, y: 191), controlPoint1: CGPoint(x: 460.71, y: 189.1), controlPoint2: CGPoint(x: 457.93, y: 191)) bezier27Path.close() bezier27Path.usesEvenOddFillRule = true dark.setFill() bezier27Path.fill() //// Bezier 28 Drawing let bezier28Path = UIBezierPath() bezier28Path.move(to: CGPoint(x: 366.07, y: 261)) bezier28Path.addCurve(to: CGPoint(x: 359.33, y: 256.12), controlPoint1: CGPoint(x: 363.07, y: 261), controlPoint2: CGPoint(x: 360.29, y: 259.1)) bezier28Path.addCurve(to: CGPoint(x: 363.93, y: 247.33), controlPoint1: CGPoint(x: 358.15, y: 252.44), controlPoint2: CGPoint(x: 360.21, y: 248.51)) bezier28Path.addLine(to: CGPoint(x: 452.79, y: 219.34)) bezier28Path.addCurve(to: CGPoint(x: 461.67, y: 223.89), controlPoint1: CGPoint(x: 456.49, y: 218.15), controlPoint2: CGPoint(x: 460.48, y: 220.2)) bezier28Path.addCurve(to: CGPoint(x: 457.07, y: 232.68), controlPoint1: CGPoint(x: 462.85, y: 227.57), controlPoint2: CGPoint(x: 460.79, y: 231.5)) bezier28Path.addLine(to: CGPoint(x: 368.2, y: 260.67)) bezier28Path.addCurve(to: CGPoint(x: 366.07, y: 261), controlPoint1: CGPoint(x: 367.49, y: 260.9), controlPoint2: CGPoint(x: 366.78, y: 261)) bezier28Path.close() bezier28Path.usesEvenOddFillRule = true dark.setFill() bezier28Path.fill() //// Bezier 29 Drawing let bezier29Path = UIBezierPath() bezier29Path.move(to: CGPoint(x: 535.19, y: 430)) bezier29Path.addCurve(to: CGPoint(x: 532.13, y: 429.31), controlPoint1: CGPoint(x: 534.14, y: 430), controlPoint2: CGPoint(x: 533.1, y: 429.77)) bezier29Path.addCurve(to: CGPoint(x: 528.15, y: 423.59), controlPoint1: CGPoint(x: 529.88, y: 428.23), controlPoint2: CGPoint(x: 528.37, y: 426.06)) bezier29Path.addLine(to: CGPoint(x: 514.03, y: 264.66)) bezier29Path.addCurve(to: CGPoint(x: 520.44, y: 257.03), controlPoint1: CGPoint(x: 513.68, y: 260.79), controlPoint2: CGPoint(x: 516.55, y: 257.38)) bezier29Path.addCurve(to: CGPoint(x: 528.1, y: 263.42), controlPoint1: CGPoint(x: 524.28, y: 256.66), controlPoint2: CGPoint(x: 527.75, y: 259.55)) bezier29Path.addLine(to: CGPoint(x: 541.18, y: 410.54)) bezier29Path.addLine(to: CGPoint(x: 573.65, y: 388.98)) bezier29Path.addCurve(to: CGPoint(x: 579.8, y: 388.17), controlPoint1: CGPoint(x: 575.47, y: 387.78), controlPoint2: CGPoint(x: 577.73, y: 387.47)) bezier29Path.addLine(to: CGPoint(x: 608.16, y: 397.58)) bezier29Path.addLine(to: CGPoint(x: 573.63, y: 305.46)) bezier29Path.addCurve(to: CGPoint(x: 577.77, y: 296.41), controlPoint1: CGPoint(x: 572.27, y: 301.82), controlPoint2: CGPoint(x: 574.12, y: 297.76)) bezier29Path.addCurve(to: CGPoint(x: 586.87, y: 300.54), controlPoint1: CGPoint(x: 581.42, y: 295.06), controlPoint2: CGPoint(x: 585.5, y: 296.9)) bezier29Path.addLine(to: CGPoint(x: 626.55, y: 406.44)) bezier29Path.addCurve(to: CGPoint(x: 625.02, y: 413.78), controlPoint1: CGPoint(x: 627.5, y: 408.98), controlPoint2: CGPoint(x: 626.91, y: 411.83)) bezier29Path.addCurve(to: CGPoint(x: 617.71, y: 415.57), controlPoint1: CGPoint(x: 623.13, y: 415.72), controlPoint2: CGPoint(x: 620.29, y: 416.44)) bezier29Path.addLine(to: CGPoint(x: 578.6, y: 402.6)) bezier29Path.addLine(to: CGPoint(x: 539.11, y: 428.82)) bezier29Path.addCurve(to: CGPoint(x: 535.19, y: 430), controlPoint1: CGPoint(x: 537.92, y: 429.6), controlPoint2: CGPoint(x: 536.55, y: 430)) bezier29Path.close() bezier29Path.usesEvenOddFillRule = true dark.setFill() bezier29Path.fill() //// Bezier 30 Drawing let bezier30Path = UIBezierPath() bezier30Path.move(to: CGPoint(x: 464.81, y: 430)) bezier30Path.addCurve(to: CGPoint(x: 460.89, y: 428.82), controlPoint1: CGPoint(x: 463.44, y: 430), controlPoint2: CGPoint(x: 462.07, y: 429.6)) bezier30Path.addLine(to: CGPoint(x: 421.39, y: 402.6)) bezier30Path.addLine(to: CGPoint(x: 382.3, y: 415.57)) bezier30Path.addCurve(to: CGPoint(x: 374.98, y: 413.79), controlPoint1: CGPoint(x: 379.71, y: 416.45), controlPoint2: CGPoint(x: 376.86, y: 415.73)) bezier30Path.addCurve(to: CGPoint(x: 373.45, y: 406.44), controlPoint1: CGPoint(x: 373.09, y: 411.84), controlPoint2: CGPoint(x: 372.5, y: 408.98)) bezier30Path.addLine(to: CGPoint(x: 413.14, y: 300.54)) bezier30Path.addCurve(to: CGPoint(x: 422.22, y: 296.41), controlPoint1: CGPoint(x: 414.5, y: 296.9), controlPoint2: CGPoint(x: 418.57, y: 295.07)) bezier30Path.addCurve(to: CGPoint(x: 426.37, y: 305.46), controlPoint1: CGPoint(x: 425.88, y: 297.77), controlPoint2: CGPoint(x: 427.73, y: 301.82)) bezier30Path.addLine(to: CGPoint(x: 391.84, y: 397.58)) bezier30Path.addLine(to: CGPoint(x: 420.2, y: 388.17)) bezier30Path.addCurve(to: CGPoint(x: 426.35, y: 388.99), controlPoint1: CGPoint(x: 422.27, y: 387.46), controlPoint2: CGPoint(x: 424.54, y: 387.77)) bezier30Path.addLine(to: CGPoint(x: 458.82, y: 410.54)) bezier30Path.addLine(to: CGPoint(x: 471.9, y: 263.42)) bezier30Path.addCurve(to: CGPoint(x: 479.56, y: 257.04), controlPoint1: CGPoint(x: 472.25, y: 259.56), controlPoint2: CGPoint(x: 475.77, y: 256.64)) bezier30Path.addCurve(to: CGPoint(x: 485.97, y: 264.66), controlPoint1: CGPoint(x: 483.45, y: 257.38), controlPoint2: CGPoint(x: 486.32, y: 260.79)) bezier30Path.addLine(to: CGPoint(x: 471.85, y: 423.59)) bezier30Path.addCurve(to: CGPoint(x: 467.87, y: 429.31), controlPoint1: CGPoint(x: 471.63, y: 426.06), controlPoint2: CGPoint(x: 470.12, y: 428.24)) bezier30Path.addCurve(to: CGPoint(x: 464.81, y: 430), controlPoint1: CGPoint(x: 466.9, y: 429.77), controlPoint2: CGPoint(x: 465.85, y: 430)) bezier30Path.close() bezier30Path.usesEvenOddFillRule = true dark.setFill() bezier30Path.fill() context.restoreGState() } @objc dynamic public class func drawCompass(frame targetFrame: CGRect = CGRect(x: 0, y: 0, width: 1000, height: 1000), resizing: ResizingBehavior = .aspectFit, white: UIColor = UIColor(red: 1.000, green: 1.000, blue: 1.000, alpha: 1.000), light: UIColor = UIColor(red: 0.769, green: 0.847, blue: 0.984, alpha: 1.000), medium: UIColor = UIColor(red: 0.478, green: 0.663, blue: 0.973, alpha: 1.000), dark: UIColor = UIColor(red: 0.000, green: 0.478, blue: 1.000, alpha: 1.000)) { //// General Declarations let context = UIGraphicsGetCurrentContext()! //// Resize to Target Frame context.saveGState() let resizedFrame: CGRect = resizing.apply(rect: CGRect(x: 0, y: 0, width: 1000, height: 1000), target: targetFrame) context.translateBy(x: resizedFrame.minX, y: resizedFrame.minY) context.scaleBy(x: resizedFrame.width / 1000, y: resizedFrame.height / 1000) //// Group 2 //// Oval Drawing let ovalPath = UIBezierPath(ovalIn: CGRect(x: 173.5, y: 285.5, width: 653, height: 652)) medium.setFill() ovalPath.fill() //// Oval 2 Drawing let oval2Path = UIBezierPath(ovalIn: CGRect(x: 173.5, y: 243.5, width: 653, height: 652)) light.setFill() oval2Path.fill() //// Bezier Drawing let bezierPath = UIBezierPath() bezierPath.move(to: CGPoint(x: 479, y: 201.85)) bezierPath.addLine(to: CGPoint(x: 479, y: 244)) bezierPath.addLine(to: CGPoint(x: 521, y: 244)) bezierPath.addLine(to: CGPoint(x: 521, y: 201.85)) bezierPath.addCurve(to: CGPoint(x: 500, y: 181), controlPoint1: CGPoint(x: 521, y: 190.34), controlPoint2: CGPoint(x: 511.59, y: 181)) bezierPath.addCurve(to: CGPoint(x: 479, y: 201.85), controlPoint1: CGPoint(x: 488.41, y: 181), controlPoint2: CGPoint(x: 479, y: 190.34)) bezierPath.close() bezierPath.usesEvenOddFillRule = true medium.setFill() bezierPath.fill() //// Bezier 2 Drawing let bezier2Path = UIBezierPath() bezier2Path.move(to: CGPoint(x: 492.99, y: 215.64)) bezier2Path.addCurve(to: CGPoint(x: 513.99, y: 194.86), controlPoint1: CGPoint(x: 492.99, y: 204.17), controlPoint2: CGPoint(x: 502.4, y: 194.86)) bezier2Path.addCurve(to: CGPoint(x: 520, y: 195.83), controlPoint1: CGPoint(x: 516.09, y: 194.86), controlPoint2: CGPoint(x: 518.09, y: 195.26)) bezier2Path.addCurve(to: CGPoint(x: 499.99, y: 181), controlPoint1: CGPoint(x: 517.41, y: 187.28), controlPoint2: CGPoint(x: 509.48, y: 181)) bezier2Path.addCurve(to: CGPoint(x: 479, y: 201.78), controlPoint1: CGPoint(x: 488.4, y: 181), controlPoint2: CGPoint(x: 479, y: 190.31)) bezier2Path.addLine(to: CGPoint(x: 479, y: 230)) bezier2Path.addLine(to: CGPoint(x: 493, y: 229.28)) bezier2Path.addLine(to: CGPoint(x: 493, y: 215.64)) bezier2Path.addLine(to: CGPoint(x: 492.99, y: 215.64)) bezier2Path.close() bezier2Path.usesEvenOddFillRule = true light.setFill() bezier2Path.fill() //// Oval 3 Drawing let oval3Path = UIBezierPath(ovalIn: CGRect(x: 215, y: 286, width: 570, height: 568)) white.setFill() oval3Path.fill() //// Oval 4 Drawing let oval4Path = UIBezierPath(ovalIn: CGRect(x: 242.45, y: 313.45, width: 514.1, height: 513)) light.setFill() oval4Path.fill() //// Oval 5 Drawing let oval5Path = UIBezierPath(ovalIn: CGRect(x: 353.5, y: 424.5, width: 292.1, height: 290.9)) white.setFill() oval5Path.fill() //// Bezier 3 Drawing let bezier3Path = UIBezierPath() bezier3Path.move(to: CGPoint(x: 524.03, y: 594)) bezier3Path.addLine(to: CGPoint(x: 475, y: 544.96)) bezier3Path.addLine(to: CGPoint(x: 651, y: 418)) bezier3Path.addLine(to: CGPoint(x: 524.03, y: 594)) bezier3Path.close() bezier3Path.usesEvenOddFillRule = true light.setFill() bezier3Path.fill() //// Bezier 4 Drawing let bezier4Path = UIBezierPath() bezier4Path.move(to: CGPoint(x: 474.97, y: 545)) bezier4Path.addLine(to: CGPoint(x: 524, y: 594.04)) bezier4Path.addLine(to: CGPoint(x: 348, y: 721)) bezier4Path.addLine(to: CGPoint(x: 474.97, y: 545)) bezier4Path.close() bezier4Path.usesEvenOddFillRule = true medium.setFill() bezier4Path.fill() //// Oval 6 Drawing let oval6Path = UIBezierPath(ovalIn: CGRect(x: 486, y: 556, width: 28, height: 28)) white.setFill() oval6Path.fill() //// Bezier 5 Drawing let bezier5Path = UIBezierPath() bezier5Path.move(to: CGPoint(x: 499.5, y: 249.9)) bezier5Path.addCurve(to: CGPoint(x: 180.85, y: 569.5), controlPoint1: CGPoint(x: 323.79, y: 249.9), controlPoint2: CGPoint(x: 180.85, y: 393.27)) bezier5Path.addCurve(to: CGPoint(x: 499.5, y: 889.1), controlPoint1: CGPoint(x: 180.85, y: 745.75), controlPoint2: CGPoint(x: 323.79, y: 889.1)) bezier5Path.addCurve(to: CGPoint(x: 724.82, y: 795.5), controlPoint1: CGPoint(x: 584.61, y: 889.1), controlPoint2: CGPoint(x: 664.64, y: 855.86)) bezier5Path.addCurve(to: CGPoint(x: 818.15, y: 569.5), controlPoint1: CGPoint(x: 785.01, y: 735.13), controlPoint2: CGPoint(x: 818.15, y: 654.88)) bezier5Path.addCurve(to: CGPoint(x: 724.82, y: 343.5), controlPoint1: CGPoint(x: 818.15, y: 484.13), controlPoint2: CGPoint(x: 785.01, y: 403.88)) bezier5Path.addCurve(to: CGPoint(x: 499.5, y: 249.9), controlPoint1: CGPoint(x: 664.64, y: 283.14), controlPoint2: CGPoint(x: 584.61, y: 249.9)) bezier5Path.close() bezier5Path.move(to: CGPoint(x: 499.5, y: 903)) bezier5Path.addCurve(to: CGPoint(x: 167, y: 569.5), controlPoint1: CGPoint(x: 316.16, y: 903), controlPoint2: CGPoint(x: 167, y: 753.4)) bezier5Path.addCurve(to: CGPoint(x: 499.5, y: 236), controlPoint1: CGPoint(x: 167, y: 385.61), controlPoint2: CGPoint(x: 316.16, y: 236)) bezier5Path.addCurve(to: CGPoint(x: 734.62, y: 333.68), controlPoint1: CGPoint(x: 588.32, y: 236), controlPoint2: CGPoint(x: 671.81, y: 270.69)) bezier5Path.addCurve(to: CGPoint(x: 832, y: 569.5), controlPoint1: CGPoint(x: 797.42, y: 396.67), controlPoint2: CGPoint(x: 832, y: 480.43)) bezier5Path.addCurve(to: CGPoint(x: 734.62, y: 805.32), controlPoint1: CGPoint(x: 832, y: 658.57), controlPoint2: CGPoint(x: 797.42, y: 742.33)) bezier5Path.addCurve(to: CGPoint(x: 499.5, y: 903), controlPoint1: CGPoint(x: 671.81, y: 868.31), controlPoint2: CGPoint(x: 588.32, y: 903)) bezier5Path.close() bezier5Path.usesEvenOddFillRule = true dark.setFill() bezier5Path.fill() //// Bezier 6 Drawing let bezier6Path = UIBezierPath() bezier6Path.move(to: CGPoint(x: 500, y: 291.91)) bezier6Path.addCurve(to: CGPoint(x: 222.86, y: 570), controlPoint1: CGPoint(x: 347.19, y: 291.91), controlPoint2: CGPoint(x: 222.87, y: 416.66)) bezier6Path.addCurve(to: CGPoint(x: 500, y: 848.1), controlPoint1: CGPoint(x: 222.86, y: 723.36), controlPoint2: CGPoint(x: 347.18, y: 848.1)) bezier6Path.addCurve(to: CGPoint(x: 695.97, y: 766.65), controlPoint1: CGPoint(x: 574.02, y: 848.1), controlPoint2: CGPoint(x: 643.62, y: 819.17)) bezier6Path.addCurve(to: CGPoint(x: 777.14, y: 570), controlPoint1: CGPoint(x: 748.32, y: 714.1), controlPoint2: CGPoint(x: 777.14, y: 644.27)) bezier6Path.addCurve(to: CGPoint(x: 500, y: 291.91), controlPoint1: CGPoint(x: 777.14, y: 416.66), controlPoint2: CGPoint(x: 652.82, y: 291.91)) bezier6Path.close() bezier6Path.move(to: CGPoint(x: 500, y: 862)) bezier6Path.addCurve(to: CGPoint(x: 209, y: 570), controlPoint1: CGPoint(x: 339.55, y: 862), controlPoint2: CGPoint(x: 209, y: 731.02)) bezier6Path.addCurve(to: CGPoint(x: 500, y: 278), controlPoint1: CGPoint(x: 209.01, y: 409), controlPoint2: CGPoint(x: 339.56, y: 278)) bezier6Path.addCurve(to: CGPoint(x: 791, y: 570), controlPoint1: CGPoint(x: 660.45, y: 278), controlPoint2: CGPoint(x: 791, y: 409)) bezier6Path.addCurve(to: CGPoint(x: 705.77, y: 776.48), controlPoint1: CGPoint(x: 791.01, y: 647.99), controlPoint2: CGPoint(x: 760.74, y: 721.32)) bezier6Path.addCurve(to: CGPoint(x: 500, y: 862), controlPoint1: CGPoint(x: 650.8, y: 831.64), controlPoint2: CGPoint(x: 577.73, y: 862)) bezier6Path.close() bezier6Path.usesEvenOddFillRule = true dark.setFill() bezier6Path.fill() //// Bezier 7 Drawing let bezier7Path = UIBezierPath() bezier7Path.move(to: CGPoint(x: 499.5, y: 319.89)) bezier7Path.addCurve(to: CGPoint(x: 249.87, y: 570), controlPoint1: CGPoint(x: 361.86, y: 319.89), controlPoint2: CGPoint(x: 249.87, y: 432.1)) bezier7Path.addCurve(to: CGPoint(x: 499.5, y: 820.1), controlPoint1: CGPoint(x: 249.87, y: 707.91), controlPoint2: CGPoint(x: 361.86, y: 820.1)) bezier7Path.addCurve(to: CGPoint(x: 749.13, y: 570), controlPoint1: CGPoint(x: 637.14, y: 820.1), controlPoint2: CGPoint(x: 749.13, y: 707.88)) bezier7Path.addCurve(to: CGPoint(x: 499.5, y: 319.89), controlPoint1: CGPoint(x: 749.13, y: 432.1), controlPoint2: CGPoint(x: 637.14, y: 319.89)) bezier7Path.close() bezier7Path.move(to: CGPoint(x: 499.5, y: 834)) bezier7Path.addCurve(to: CGPoint(x: 236, y: 570), controlPoint1: CGPoint(x: 354.21, y: 834), controlPoint2: CGPoint(x: 236, y: 715.57)) bezier7Path.addCurve(to: CGPoint(x: 499.5, y: 306), controlPoint1: CGPoint(x: 236, y: 424.43), controlPoint2: CGPoint(x: 354.21, y: 306)) bezier7Path.addCurve(to: CGPoint(x: 763, y: 570), controlPoint1: CGPoint(x: 644.8, y: 306), controlPoint2: CGPoint(x: 763, y: 424.43)) bezier7Path.addCurve(to: CGPoint(x: 499.5, y: 834), controlPoint1: CGPoint(x: 763, y: 715.57), controlPoint2: CGPoint(x: 644.79, y: 834)) bezier7Path.close() bezier7Path.usesEvenOddFillRule = true dark.setFill() bezier7Path.fill() //// Bezier 8 Drawing let bezier8Path = UIBezierPath() bezier8Path.move(to: CGPoint(x: 375.61, y: 653)) bezier8Path.addCurve(to: CGPoint(x: 369.7, y: 649.69), controlPoint1: CGPoint(x: 373.29, y: 653), controlPoint2: CGPoint(x: 371.01, y: 651.83)) bezier8Path.addCurve(to: CGPoint(x: 347, y: 569.64), controlPoint1: CGPoint(x: 354.85, y: 625.66), controlPoint2: CGPoint(x: 347, y: 597.98)) bezier8Path.addCurve(to: CGPoint(x: 499.73, y: 417), controlPoint1: CGPoint(x: 347, y: 485.47), controlPoint2: CGPoint(x: 415.51, y: 417)) bezier8Path.addCurve(to: CGPoint(x: 579.71, y: 439.59), controlPoint1: CGPoint(x: 528.04, y: 417), controlPoint2: CGPoint(x: 555.69, y: 424.81)) bezier8Path.addCurve(to: CGPoint(x: 581.97, y: 449.14), controlPoint1: CGPoint(x: 582.96, y: 441.6), controlPoint2: CGPoint(x: 583.98, y: 445.88)) bezier8Path.addCurve(to: CGPoint(x: 572.41, y: 451.41), controlPoint1: CGPoint(x: 579.95, y: 452.43), controlPoint2: CGPoint(x: 575.68, y: 453.43)) bezier8Path.addCurve(to: CGPoint(x: 499.73, y: 430.88), controlPoint1: CGPoint(x: 550.61, y: 437.98), controlPoint2: CGPoint(x: 525.47, y: 430.88)) bezier8Path.addCurve(to: CGPoint(x: 360.89, y: 569.64), controlPoint1: CGPoint(x: 423.18, y: 430.88), controlPoint2: CGPoint(x: 360.89, y: 493.13)) bezier8Path.addCurve(to: CGPoint(x: 381.52, y: 642.41), controlPoint1: CGPoint(x: 360.89, y: 595.38), controlPoint2: CGPoint(x: 368.02, y: 620.56)) bezier8Path.addCurve(to: CGPoint(x: 379.26, y: 651.97), controlPoint1: CGPoint(x: 383.53, y: 645.69), controlPoint2: CGPoint(x: 382.53, y: 649.94)) bezier8Path.addCurve(to: CGPoint(x: 375.61, y: 653), controlPoint1: CGPoint(x: 378.12, y: 652.65), controlPoint2: CGPoint(x: 376.86, y: 653)) bezier8Path.close() bezier8Path.usesEvenOddFillRule = true dark.setFill() bezier8Path.fill() //// Bezier 9 Drawing let bezier9Path = UIBezierPath() bezier9Path.move(to: CGPoint(x: 499.28, y: 723)) bezier9Path.addCurve(to: CGPoint(x: 419.3, y: 700.39), controlPoint1: CGPoint(x: 470.94, y: 723), controlPoint2: CGPoint(x: 443.28, y: 715.19)) bezier9Path.addCurve(to: CGPoint(x: 417.03, y: 690.81), controlPoint1: CGPoint(x: 416.03, y: 698.35), controlPoint2: CGPoint(x: 415.03, y: 694.1)) bezier9Path.addCurve(to: CGPoint(x: 426.59, y: 688.56), controlPoint1: CGPoint(x: 419.05, y: 687.53), controlPoint2: CGPoint(x: 423.34, y: 686.58)) bezier9Path.addCurve(to: CGPoint(x: 499.28, y: 709.12), controlPoint1: CGPoint(x: 448.38, y: 702.01), controlPoint2: CGPoint(x: 473.52, y: 709.12)) bezier9Path.addCurve(to: CGPoint(x: 638.12, y: 570.29), controlPoint1: CGPoint(x: 575.83, y: 709.12), controlPoint2: CGPoint(x: 638.12, y: 646.83)) bezier9Path.addCurve(to: CGPoint(x: 617.55, y: 497.58), controlPoint1: CGPoint(x: 638.12, y: 544.53), controlPoint2: CGPoint(x: 631.01, y: 519.39)) bezier9Path.addCurve(to: CGPoint(x: 619.81, y: 488.02), controlPoint1: CGPoint(x: 615.54, y: 494.31), controlPoint2: CGPoint(x: 616.54, y: 490.04)) bezier9Path.addCurve(to: CGPoint(x: 629.37, y: 490.29), controlPoint1: CGPoint(x: 623.07, y: 486.04), controlPoint2: CGPoint(x: 627.34, y: 487.01)) bezier9Path.addCurve(to: CGPoint(x: 652, y: 570.29), controlPoint1: CGPoint(x: 644.18, y: 514.27), controlPoint2: CGPoint(x: 652, y: 541.95)) bezier9Path.addCurve(to: CGPoint(x: 499.28, y: 723), controlPoint1: CGPoint(x: 652, y: 654.51), controlPoint2: CGPoint(x: 583.49, y: 723)) bezier9Path.close() bezier9Path.usesEvenOddFillRule = true dark.setFill() bezier9Path.fill() //// Bezier 10 Drawing let bezier10Path = UIBezierPath() bezier10Path.move(to: CGPoint(x: 499.52, y: 945)) bezier10Path.addCurve(to: CGPoint(x: 499.49, y: 945), controlPoint1: CGPoint(x: 499.5, y: 945), controlPoint2: CGPoint(x: 499.5, y: 945)) bezier10Path.addLine(to: CGPoint(x: 499.46, y: 945)) bezier10Path.addCurve(to: CGPoint(x: 264.37, y: 847.45), controlPoint1: CGPoint(x: 410.65, y: 945), controlPoint2: CGPoint(x: 327.18, y: 910.36)) bezier10Path.addCurve(to: CGPoint(x: 167, y: 611.94), controlPoint1: CGPoint(x: 201.58, y: 784.54), controlPoint2: CGPoint(x: 167, y: 700.9)) bezier10Path.addCurve(to: CGPoint(x: 173.93, y: 605), controlPoint1: CGPoint(x: 167, y: 608.12), controlPoint2: CGPoint(x: 170.1, y: 605)) bezier10Path.addCurve(to: CGPoint(x: 180.85, y: 611.94), controlPoint1: CGPoint(x: 177.76, y: 605), controlPoint2: CGPoint(x: 180.85, y: 608.12)) bezier10Path.addCurve(to: CGPoint(x: 274.17, y: 837.64), controlPoint1: CGPoint(x: 180.85, y: 697.21), controlPoint2: CGPoint(x: 213.99, y: 777.36)) bezier10Path.addCurve(to: CGPoint(x: 499.47, y: 931.12), controlPoint1: CGPoint(x: 334.35, y: 897.92), controlPoint2: CGPoint(x: 414.36, y: 931.12)) bezier10Path.addCurve(to: CGPoint(x: 499.49, y: 931.12), controlPoint1: CGPoint(x: 499.48, y: 931.12), controlPoint2: CGPoint(x: 499.48, y: 931.12)) bezier10Path.addCurve(to: CGPoint(x: 499.52, y: 931.12), controlPoint1: CGPoint(x: 499.49, y: 931.12), controlPoint2: CGPoint(x: 499.51, y: 931.12)) bezier10Path.addCurve(to: CGPoint(x: 724.82, y: 837.64), controlPoint1: CGPoint(x: 584.62, y: 931.12), controlPoint2: CGPoint(x: 664.64, y: 897.92)) bezier10Path.addCurve(to: CGPoint(x: 818.14, y: 611.94), controlPoint1: CGPoint(x: 785.01, y: 777.36), controlPoint2: CGPoint(x: 818.14, y: 697.21)) bezier10Path.addCurve(to: CGPoint(x: 825.07, y: 605), controlPoint1: CGPoint(x: 818.14, y: 608.12), controlPoint2: CGPoint(x: 821.24, y: 605)) bezier10Path.addCurve(to: CGPoint(x: 832, y: 611.94), controlPoint1: CGPoint(x: 828.9, y: 605), controlPoint2: CGPoint(x: 832, y: 608.12)) bezier10Path.addCurve(to: CGPoint(x: 734.61, y: 847.45), controlPoint1: CGPoint(x: 832, y: 700.89), controlPoint2: CGPoint(x: 797.42, y: 784.54)) bezier10Path.addCurve(to: CGPoint(x: 499.52, y: 945), controlPoint1: CGPoint(x: 671.82, y: 910.36), controlPoint2: CGPoint(x: 588.31, y: 945)) bezier10Path.close() bezier10Path.usesEvenOddFillRule = true dark.setFill() bezier10Path.fill() //// Bezier 11 Drawing let bezier11Path = UIBezierPath() bezier11Path.move(to: CGPoint(x: 174.01, y: 619)) bezier11Path.addCurve(to: CGPoint(x: 167.01, y: 612), controlPoint1: CGPoint(x: 170.14, y: 619), controlPoint2: CGPoint(x: 167.01, y: 615.88)) bezier11Path.addLine(to: CGPoint(x: 167, y: 570)) bezier11Path.addCurve(to: CGPoint(x: 173.99, y: 563), controlPoint1: CGPoint(x: 167, y: 566.15), controlPoint2: CGPoint(x: 170.13, y: 563)) bezier11Path.addCurve(to: CGPoint(x: 180.99, y: 570), controlPoint1: CGPoint(x: 177.86, y: 563), controlPoint2: CGPoint(x: 180.99, y: 566.15)) bezier11Path.addLine(to: CGPoint(x: 181, y: 612)) bezier11Path.addCurve(to: CGPoint(x: 174.01, y: 619), controlPoint1: CGPoint(x: 181, y: 615.88), controlPoint2: CGPoint(x: 177.87, y: 619)) bezier11Path.close() bezier11Path.usesEvenOddFillRule = true dark.setFill() bezier11Path.fill() //// Bezier 12 Drawing let bezier12Path = UIBezierPath() bezier12Path.move(to: CGPoint(x: 826, y: 619)) bezier12Path.addCurve(to: CGPoint(x: 819, y: 612), controlPoint1: CGPoint(x: 822.13, y: 619), controlPoint2: CGPoint(x: 819, y: 615.88)) bezier12Path.addLine(to: CGPoint(x: 819, y: 570)) bezier12Path.addCurve(to: CGPoint(x: 826, y: 563), controlPoint1: CGPoint(x: 819, y: 566.15), controlPoint2: CGPoint(x: 822.13, y: 563)) bezier12Path.addCurve(to: CGPoint(x: 833, y: 570), controlPoint1: CGPoint(x: 829.87, y: 563), controlPoint2: CGPoint(x: 833, y: 566.15)) bezier12Path.addLine(to: CGPoint(x: 833, y: 612)) bezier12Path.addCurve(to: CGPoint(x: 826, y: 619), controlPoint1: CGPoint(x: 833, y: 615.88), controlPoint2: CGPoint(x: 829.87, y: 619)) bezier12Path.close() bezier12Path.usesEvenOddFillRule = true dark.setFill() bezier12Path.fill() //// Bezier 13 Drawing let bezier13Path = UIBezierPath() bezier13Path.move(to: CGPoint(x: 479.01, y: 237)) bezier13Path.addCurve(to: CGPoint(x: 472.01, y: 230), controlPoint1: CGPoint(x: 475.14, y: 237), controlPoint2: CGPoint(x: 472.01, y: 233.87)) bezier13Path.addLine(to: CGPoint(x: 472, y: 202)) bezier13Path.addCurve(to: CGPoint(x: 478.99, y: 195), controlPoint1: CGPoint(x: 472, y: 198.13), controlPoint2: CGPoint(x: 475.13, y: 195)) bezier13Path.addCurve(to: CGPoint(x: 485.99, y: 202), controlPoint1: CGPoint(x: 482.86, y: 195), controlPoint2: CGPoint(x: 485.99, y: 198.13)) bezier13Path.addLine(to: CGPoint(x: 486, y: 230)) bezier13Path.addCurve(to: CGPoint(x: 479.01, y: 237), controlPoint1: CGPoint(x: 486, y: 233.87), controlPoint2: CGPoint(x: 482.87, y: 237)) bezier13Path.close() bezier13Path.usesEvenOddFillRule = true dark.setFill() bezier13Path.fill() //// Rectangle Drawing let rectanglePath = UIBezierPath(roundedRect: CGRect(x: 514, y: 195, width: 14, height: 42), cornerRadius: 7) dark.setFill() rectanglePath.fill() //// Bezier 14 Drawing let bezier14Path = UIBezierPath() bezier14Path.move(to: CGPoint(x: 520.13, y: 209)) bezier14Path.addCurve(to: CGPoint(x: 513.25, y: 202), controlPoint1: CGPoint(x: 516.33, y: 209), controlPoint2: CGPoint(x: 513.25, y: 205.87)) bezier14Path.addCurve(to: CGPoint(x: 499.49, y: 188), controlPoint1: CGPoint(x: 513.25, y: 194.27), controlPoint2: CGPoint(x: 507.08, y: 188)) bezier14Path.addCurve(to: CGPoint(x: 485.75, y: 202), controlPoint1: CGPoint(x: 491.91, y: 188), controlPoint2: CGPoint(x: 485.75, y: 194.27)) bezier14Path.addCurve(to: CGPoint(x: 478.87, y: 209), controlPoint1: CGPoint(x: 485.75, y: 205.87), controlPoint2: CGPoint(x: 482.67, y: 209)) bezier14Path.addCurve(to: CGPoint(x: 472, y: 202), controlPoint1: CGPoint(x: 475.07, y: 209), controlPoint2: CGPoint(x: 472, y: 205.87)) bezier14Path.addCurve(to: CGPoint(x: 499.49, y: 174), controlPoint1: CGPoint(x: 472, y: 186.56), controlPoint2: CGPoint(x: 484.34, y: 174)) bezier14Path.addCurve(to: CGPoint(x: 527, y: 202), controlPoint1: CGPoint(x: 514.66, y: 174), controlPoint2: CGPoint(x: 527, y: 186.56)) bezier14Path.addCurve(to: CGPoint(x: 520.13, y: 209), controlPoint1: CGPoint(x: 527, y: 205.87), controlPoint2: CGPoint(x: 523.93, y: 209)) bezier14Path.close() bezier14Path.usesEvenOddFillRule = true dark.setFill() bezier14Path.fill() //// Bezier 15 Drawing let bezier15Path = UIBezierPath() bezier15Path.move(to: CGPoint(x: 451.61, y: 205)) bezier15Path.addCurve(to: CGPoint(x: 447.21, y: 203.41), controlPoint1: CGPoint(x: 450.06, y: 205), controlPoint2: CGPoint(x: 448.5, y: 204.49)) bezier15Path.addCurve(to: CGPoint(x: 417, y: 139.21), controlPoint1: CGPoint(x: 428.01, y: 187.53), controlPoint2: CGPoint(x: 417, y: 164.13)) bezier15Path.addCurve(to: CGPoint(x: 500, y: 56), controlPoint1: CGPoint(x: 417, y: 93.33), controlPoint2: CGPoint(x: 454.23, y: 56)) bezier15Path.addCurve(to: CGPoint(x: 583, y: 139.21), controlPoint1: CGPoint(x: 545.77, y: 56), controlPoint2: CGPoint(x: 583, y: 93.33)) bezier15Path.addCurve(to: CGPoint(x: 554.25, y: 202.18), controlPoint1: CGPoint(x: 583, y: 163.41), controlPoint2: CGPoint(x: 572.52, y: 186.35)) bezier15Path.addCurve(to: CGPoint(x: 544.5, y: 201.46), controlPoint1: CGPoint(x: 551.38, y: 204.66), controlPoint2: CGPoint(x: 547, y: 204.36)) bezier15Path.addCurve(to: CGPoint(x: 545.2, y: 191.67), controlPoint1: CGPoint(x: 542, y: 198.57), controlPoint2: CGPoint(x: 542.31, y: 194.18)) bezier15Path.addCurve(to: CGPoint(x: 569.17, y: 139.21), controlPoint1: CGPoint(x: 560.44, y: 178.49), controlPoint2: CGPoint(x: 569.17, y: 159.37)) bezier15Path.addCurve(to: CGPoint(x: 500, y: 69.87), controlPoint1: CGPoint(x: 569.17, y: 100.98), controlPoint2: CGPoint(x: 538.14, y: 69.87)) bezier15Path.addCurve(to: CGPoint(x: 430.83, y: 139.21), controlPoint1: CGPoint(x: 461.86, y: 69.87), controlPoint2: CGPoint(x: 430.83, y: 100.98)) bezier15Path.addCurve(to: CGPoint(x: 456.02, y: 192.72), controlPoint1: CGPoint(x: 430.83, y: 159.98), controlPoint2: CGPoint(x: 440.01, y: 179.48)) bezier15Path.addCurve(to: CGPoint(x: 456.95, y: 202.48), controlPoint1: CGPoint(x: 458.96, y: 195.15), controlPoint2: CGPoint(x: 459.38, y: 199.53)) bezier15Path.addCurve(to: CGPoint(x: 451.61, y: 205), controlPoint1: CGPoint(x: 455.58, y: 204.15), controlPoint2: CGPoint(x: 453.6, y: 205)) bezier15Path.close() bezier15Path.usesEvenOddFillRule = true dark.setFill() bezier15Path.fill() //// Rectangle 2 Drawing let rectangle2Path = UIBezierPath(roundedRect: CGRect(x: 493, y: 278, width: 14, height: 56), cornerRadius: 7) dark.setFill() rectangle2Path.fill() //// Rectangle 3 Drawing let rectangle3Path = UIBezierPath(roundedRect: CGRect(x: 493, y: 806, width: 14, height: 56), cornerRadius: 7) dark.setFill() rectangle3Path.fill() //// Bezier 16 Drawing let bezier16Path = UIBezierPath() bezier16Path.move(to: CGPoint(x: 379, y: 366)) bezier16Path.addCurve(to: CGPoint(x: 372.94, y: 362.53), controlPoint1: CGPoint(x: 376.59, y: 366), controlPoint2: CGPoint(x: 374.23, y: 364.75)) bezier16Path.addLine(to: CGPoint(x: 351.94, y: 326.44)) bezier16Path.addCurve(to: CGPoint(x: 354.5, y: 316.95), controlPoint1: CGPoint(x: 350, y: 323.11), controlPoint2: CGPoint(x: 351.15, y: 318.87)) bezier16Path.addCurve(to: CGPoint(x: 364.06, y: 319.49), controlPoint1: CGPoint(x: 357.85, y: 315), controlPoint2: CGPoint(x: 362.14, y: 316.15)) bezier16Path.addLine(to: CGPoint(x: 385.06, y: 355.58)) bezier16Path.addCurve(to: CGPoint(x: 382.5, y: 365.06), controlPoint1: CGPoint(x: 387, y: 358.91), controlPoint2: CGPoint(x: 385.85, y: 363.15)) bezier16Path.addCurve(to: CGPoint(x: 379, y: 366), controlPoint1: CGPoint(x: 381.39, y: 365.7), controlPoint2: CGPoint(x: 380.19, y: 366)) bezier16Path.close() bezier16Path.usesEvenOddFillRule = true dark.setFill() bezier16Path.fill() //// Bezier 17 Drawing let bezier17Path = UIBezierPath() bezier17Path.move(to: CGPoint(x: 642, y: 823)) bezier17Path.addCurve(to: CGPoint(x: 635.94, y: 819.53), controlPoint1: CGPoint(x: 639.59, y: 823), controlPoint2: CGPoint(x: 637.23, y: 821.75)) bezier17Path.addLine(to: CGPoint(x: 614.94, y: 783.42)) bezier17Path.addCurve(to: CGPoint(x: 617.5, y: 773.94), controlPoint1: CGPoint(x: 613, y: 780.11), controlPoint2: CGPoint(x: 614.15, y: 775.84)) bezier17Path.addCurve(to: CGPoint(x: 627.06, y: 776.47), controlPoint1: CGPoint(x: 620.85, y: 772.02), controlPoint2: CGPoint(x: 625.14, y: 773.13)) bezier17Path.addLine(to: CGPoint(x: 648.06, y: 812.58)) bezier17Path.addCurve(to: CGPoint(x: 645.5, y: 822.08), controlPoint1: CGPoint(x: 650, y: 815.92), controlPoint2: CGPoint(x: 648.85, y: 820.15)) bezier17Path.addCurve(to: CGPoint(x: 642, y: 823), controlPoint1: CGPoint(x: 644.39, y: 822.7), controlPoint2: CGPoint(x: 643.19, y: 823)) bezier17Path.close() bezier17Path.usesEvenOddFillRule = true dark.setFill() bezier17Path.fill() //// Bezier 18 Drawing let bezier18Path = UIBezierPath() bezier18Path.move(to: CGPoint(x: 290.05, y: 455)) bezier18Path.addCurve(to: CGPoint(x: 286.57, y: 454.06), controlPoint1: CGPoint(x: 288.87, y: 455), controlPoint2: CGPoint(x: 287.67, y: 454.7)) bezier18Path.addLine(to: CGPoint(x: 250.47, y: 433.05)) bezier18Path.addCurve(to: CGPoint(x: 247.94, y: 423.49), controlPoint1: CGPoint(x: 247.15, y: 431.12), controlPoint2: CGPoint(x: 246.01, y: 426.84)) bezier18Path.addCurve(to: CGPoint(x: 257.42, y: 420.94), controlPoint1: CGPoint(x: 249.85, y: 420.16), controlPoint2: CGPoint(x: 254.11, y: 419.01)) bezier18Path.addLine(to: CGPoint(x: 293.52, y: 441.94)) bezier18Path.addCurve(to: CGPoint(x: 296.06, y: 451.5), controlPoint1: CGPoint(x: 296.85, y: 443.87), controlPoint2: CGPoint(x: 297.99, y: 448.15)) bezier18Path.addCurve(to: CGPoint(x: 290.05, y: 455), controlPoint1: CGPoint(x: 294.78, y: 453.74), controlPoint2: CGPoint(x: 292.44, y: 455)) bezier18Path.close() bezier18Path.usesEvenOddFillRule = true dark.setFill() bezier18Path.fill() //// Bezier 19 Drawing let bezier19Path = UIBezierPath() bezier19Path.move(to: CGPoint(x: 746.05, y: 719)) bezier19Path.addCurve(to: CGPoint(x: 742.58, y: 718.07), controlPoint1: CGPoint(x: 744.87, y: 719), controlPoint2: CGPoint(x: 743.68, y: 718.7)) bezier19Path.addLine(to: CGPoint(x: 706.47, y: 697.06)) bezier19Path.addCurve(to: CGPoint(x: 703.94, y: 687.52), controlPoint1: CGPoint(x: 703.15, y: 695.15), controlPoint2: CGPoint(x: 702.01, y: 690.85)) bezier19Path.addCurve(to: CGPoint(x: 713.43, y: 684.94), controlPoint1: CGPoint(x: 705.85, y: 684.15), controlPoint2: CGPoint(x: 710.13, y: 683)) bezier19Path.addLine(to: CGPoint(x: 749.52, y: 705.95)) bezier19Path.addCurve(to: CGPoint(x: 752.06, y: 715.5), controlPoint1: CGPoint(x: 752.85, y: 707.87), controlPoint2: CGPoint(x: 753.99, y: 712.16)) bezier19Path.addCurve(to: CGPoint(x: 746.05, y: 719), controlPoint1: CGPoint(x: 750.79, y: 717.74), controlPoint2: CGPoint(x: 748.44, y: 719)) bezier19Path.close() bezier19Path.usesEvenOddFillRule = true dark.setFill() bezier19Path.fill() //// Bezier 20 Drawing let bezier20Path = UIBezierPath() bezier20Path.move(to: CGPoint(x: 257.12, y: 577)) bezier20Path.addLine(to: CGPoint(x: 215.88, y: 577)) bezier20Path.addCurve(to: CGPoint(x: 209, y: 570), controlPoint1: CGPoint(x: 212.08, y: 577), controlPoint2: CGPoint(x: 209, y: 573.88)) bezier20Path.addCurve(to: CGPoint(x: 215.88, y: 563), controlPoint1: CGPoint(x: 209, y: 566.15), controlPoint2: CGPoint(x: 212.07, y: 563)) bezier20Path.addLine(to: CGPoint(x: 257.12, y: 563)) bezier20Path.addCurve(to: CGPoint(x: 264, y: 570), controlPoint1: CGPoint(x: 260.92, y: 563), controlPoint2: CGPoint(x: 264, y: 566.15)) bezier20Path.addCurve(to: CGPoint(x: 257.12, y: 577), controlPoint1: CGPoint(x: 264, y: 573.88), controlPoint2: CGPoint(x: 260.92, y: 577)) bezier20Path.close() bezier20Path.usesEvenOddFillRule = true dark.setFill() bezier20Path.fill() //// Bezier 21 Drawing let bezier21Path = UIBezierPath() bezier21Path.move(to: CGPoint(x: 784.12, y: 577)) bezier21Path.addLine(to: CGPoint(x: 742.87, y: 577)) bezier21Path.addCurve(to: CGPoint(x: 736, y: 570), controlPoint1: CGPoint(x: 739.07, y: 577), controlPoint2: CGPoint(x: 736, y: 573.88)) bezier21Path.addCurve(to: CGPoint(x: 742.87, y: 563), controlPoint1: CGPoint(x: 736, y: 566.15), controlPoint2: CGPoint(x: 739.07, y: 563)) bezier21Path.addLine(to: CGPoint(x: 784.12, y: 563)) bezier21Path.addCurve(to: CGPoint(x: 791, y: 570), controlPoint1: CGPoint(x: 787.92, y: 563), controlPoint2: CGPoint(x: 791, y: 566.15)) bezier21Path.addCurve(to: CGPoint(x: 784.12, y: 577), controlPoint1: CGPoint(x: 791, y: 573.88), controlPoint2: CGPoint(x: 787.92, y: 577)) bezier21Path.close() bezier21Path.usesEvenOddFillRule = true dark.setFill() bezier21Path.fill() //// Bezier 22 Drawing let bezier22Path = UIBezierPath() bezier22Path.move(to: CGPoint(x: 253.95, y: 719)) bezier22Path.addCurve(to: CGPoint(x: 247.94, y: 715.5), controlPoint1: CGPoint(x: 251.56, y: 719), controlPoint2: CGPoint(x: 249.21, y: 717.74)) bezier22Path.addCurve(to: CGPoint(x: 250.47, y: 705.96), controlPoint1: CGPoint(x: 246.01, y: 712.17), controlPoint2: CGPoint(x: 247.15, y: 707.87)) bezier22Path.addLine(to: CGPoint(x: 286.58, y: 684.94)) bezier22Path.addCurve(to: CGPoint(x: 296.06, y: 687.51), controlPoint1: CGPoint(x: 289.89, y: 683), controlPoint2: CGPoint(x: 294.15, y: 684.15)) bezier22Path.addCurve(to: CGPoint(x: 293.53, y: 697.05), controlPoint1: CGPoint(x: 297.99, y: 690.85), controlPoint2: CGPoint(x: 296.85, y: 695.14)) bezier22Path.addLine(to: CGPoint(x: 257.42, y: 718.07)) bezier22Path.addCurve(to: CGPoint(x: 253.95, y: 719), controlPoint1: CGPoint(x: 256.32, y: 718.7), controlPoint2: CGPoint(x: 255.13, y: 719)) bezier22Path.close() bezier22Path.usesEvenOddFillRule = true dark.setFill() bezier22Path.fill() //// Bezier 23 Drawing let bezier23Path = UIBezierPath() bezier23Path.move(to: CGPoint(x: 709.95, y: 455)) bezier23Path.addCurve(to: CGPoint(x: 703.94, y: 451.5), controlPoint1: CGPoint(x: 707.56, y: 455), controlPoint2: CGPoint(x: 705.23, y: 453.74)) bezier23Path.addCurve(to: CGPoint(x: 706.48, y: 441.94), controlPoint1: CGPoint(x: 702.01, y: 448.15), controlPoint2: CGPoint(x: 703.15, y: 443.87)) bezier23Path.addLine(to: CGPoint(x: 742.57, y: 420.94)) bezier23Path.addCurve(to: CGPoint(x: 752.06, y: 423.5), controlPoint1: CGPoint(x: 745.88, y: 419), controlPoint2: CGPoint(x: 750.12, y: 420.15)) bezier23Path.addCurve(to: CGPoint(x: 749.52, y: 433.06), controlPoint1: CGPoint(x: 753.99, y: 426.85), controlPoint2: CGPoint(x: 752.85, y: 431.13)) bezier23Path.addLine(to: CGPoint(x: 713.43, y: 454.05)) bezier23Path.addCurve(to: CGPoint(x: 709.95, y: 455), controlPoint1: CGPoint(x: 712.33, y: 454.7), controlPoint2: CGPoint(x: 711.13, y: 455)) bezier23Path.close() bezier23Path.usesEvenOddFillRule = true dark.setFill() bezier23Path.fill() //// Bezier 24 Drawing let bezier24Path = UIBezierPath() bezier24Path.move(to: CGPoint(x: 358, y: 823)) bezier24Path.addCurve(to: CGPoint(x: 354.5, y: 822.08), controlPoint1: CGPoint(x: 356.81, y: 823), controlPoint2: CGPoint(x: 355.61, y: 822.7)) bezier24Path.addCurve(to: CGPoint(x: 351.95, y: 812.58), controlPoint1: CGPoint(x: 351.15, y: 820.15), controlPoint2: CGPoint(x: 350, y: 815.92)) bezier24Path.addLine(to: CGPoint(x: 372.94, y: 776.46)) bezier24Path.addCurve(to: CGPoint(x: 382.5, y: 773.94), controlPoint1: CGPoint(x: 374.87, y: 773.15), controlPoint2: CGPoint(x: 379.16, y: 772.01)) bezier24Path.addCurve(to: CGPoint(x: 385.06, y: 783.42), controlPoint1: CGPoint(x: 385.85, y: 775.84), controlPoint2: CGPoint(x: 387, y: 780.1)) bezier24Path.addLine(to: CGPoint(x: 364.06, y: 819.53)) bezier24Path.addCurve(to: CGPoint(x: 358, y: 823), controlPoint1: CGPoint(x: 362.77, y: 821.75), controlPoint2: CGPoint(x: 360.41, y: 823)) bezier24Path.close() bezier24Path.usesEvenOddFillRule = true dark.setFill() bezier24Path.fill() //// Bezier 25 Drawing let bezier25Path = UIBezierPath() bezier25Path.move(to: CGPoint(x: 621, y: 366)) bezier25Path.addCurve(to: CGPoint(x: 617.5, y: 365.06), controlPoint1: CGPoint(x: 619.81, y: 366), controlPoint2: CGPoint(x: 618.61, y: 365.7)) bezier25Path.addCurve(to: CGPoint(x: 614.94, y: 355.57), controlPoint1: CGPoint(x: 614.15, y: 363.15), controlPoint2: CGPoint(x: 613, y: 358.9)) bezier25Path.addLine(to: CGPoint(x: 635.94, y: 319.47)) bezier25Path.addCurve(to: CGPoint(x: 645.5, y: 316.93), controlPoint1: CGPoint(x: 637.87, y: 316.14), controlPoint2: CGPoint(x: 642.17, y: 315.02)) bezier25Path.addCurve(to: CGPoint(x: 648.06, y: 326.42), controlPoint1: CGPoint(x: 648.85, y: 318.85), controlPoint2: CGPoint(x: 650, y: 323.1)) bezier25Path.addLine(to: CGPoint(x: 627.06, y: 362.52)) bezier25Path.addCurve(to: CGPoint(x: 621, y: 366), controlPoint1: CGPoint(x: 625.76, y: 364.75), controlPoint2: CGPoint(x: 623.41, y: 366)) bezier25Path.close() bezier25Path.usesEvenOddFillRule = true dark.setFill() bezier25Path.fill() //// Bezier 26 Drawing let bezier26Path = UIBezierPath() bezier26Path.move(to: CGPoint(x: 433.08, y: 329)) bezier26Path.addCurve(to: CGPoint(x: 426.39, y: 323.81), controlPoint1: CGPoint(x: 430.03, y: 329), controlPoint2: CGPoint(x: 427.23, y: 326.94)) bezier26Path.addLine(to: CGPoint(x: 419.24, y: 296.77)) bezier26Path.addCurve(to: CGPoint(x: 424.14, y: 288.21), controlPoint1: CGPoint(x: 418.25, y: 293.04), controlPoint2: CGPoint(x: 420.44, y: 289.22)) bezier26Path.addCurve(to: CGPoint(x: 432.61, y: 293.17), controlPoint1: CGPoint(x: 427.81, y: 287.3), controlPoint2: CGPoint(x: 431.61, y: 289.42)) bezier26Path.addLine(to: CGPoint(x: 439.76, y: 320.2)) bezier26Path.addCurve(to: CGPoint(x: 434.86, y: 328.77), controlPoint1: CGPoint(x: 440.75, y: 323.93), controlPoint2: CGPoint(x: 438.56, y: 327.75)) bezier26Path.addCurve(to: CGPoint(x: 433.08, y: 329), controlPoint1: CGPoint(x: 434.27, y: 328.92), controlPoint2: CGPoint(x: 433.67, y: 329)) bezier26Path.close() bezier26Path.usesEvenOddFillRule = true dark.setFill() bezier26Path.fill() //// Bezier 27 Drawing let bezier27Path = UIBezierPath() bezier27Path.move(to: CGPoint(x: 573.08, y: 852)) bezier27Path.addCurve(to: CGPoint(x: 566.39, y: 846.83), controlPoint1: CGPoint(x: 570.03, y: 852), controlPoint2: CGPoint(x: 567.23, y: 849.95)) bezier27Path.addLine(to: CGPoint(x: 559.24, y: 819.8)) bezier27Path.addCurve(to: CGPoint(x: 564.13, y: 811.22), controlPoint1: CGPoint(x: 558.25, y: 816.05), controlPoint2: CGPoint(x: 560.44, y: 812.23)) bezier27Path.addCurve(to: CGPoint(x: 572.61, y: 816.16), controlPoint1: CGPoint(x: 567.85, y: 810.29), controlPoint2: CGPoint(x: 571.61, y: 812.45)) bezier27Path.addLine(to: CGPoint(x: 579.76, y: 843.2)) bezier27Path.addCurve(to: CGPoint(x: 574.87, y: 851.78), controlPoint1: CGPoint(x: 580.75, y: 846.94), controlPoint2: CGPoint(x: 578.56, y: 850.77)) bezier27Path.addCurve(to: CGPoint(x: 573.08, y: 852), controlPoint1: CGPoint(x: 574.27, y: 851.92), controlPoint2: CGPoint(x: 573.67, y: 852)) bezier27Path.close() bezier27Path.usesEvenOddFillRule = true dark.setFill() bezier27Path.fill() //// Bezier 28 Drawing let bezier28Path = UIBezierPath() bezier28Path.move(to: CGPoint(x: 318.16, y: 395)) bezier28Path.addCurve(to: CGPoint(x: 313.33, y: 392.94), controlPoint1: CGPoint(x: 316.42, y: 395), controlPoint2: CGPoint(x: 314.67, y: 394.31)) bezier28Path.addLine(to: CGPoint(x: 294, y: 373.02)) bezier28Path.addCurve(to: CGPoint(x: 294, y: 363.06), controlPoint1: CGPoint(x: 291.33, y: 370.27), controlPoint2: CGPoint(x: 291.33, y: 365.81)) bezier28Path.addCurve(to: CGPoint(x: 303.67, y: 363.06), controlPoint1: CGPoint(x: 296.67, y: 360.31), controlPoint2: CGPoint(x: 301, y: 360.31)) bezier28Path.addLine(to: CGPoint(x: 323, y: 382.98)) bezier28Path.addCurve(to: CGPoint(x: 323, y: 392.94), controlPoint1: CGPoint(x: 325.67, y: 385.73), controlPoint2: CGPoint(x: 325.67, y: 390.19)) bezier28Path.addCurve(to: CGPoint(x: 318.16, y: 395), controlPoint1: CGPoint(x: 321.66, y: 394.31), controlPoint2: CGPoint(x: 319.91, y: 395)) bezier28Path.close() bezier28Path.usesEvenOddFillRule = true dark.setFill() bezier28Path.fill() //// Bezier 29 Drawing let bezier29Path = UIBezierPath() bezier29Path.move(to: CGPoint(x: 700.17, y: 778)) bezier29Path.addCurve(to: CGPoint(x: 695.33, y: 775.94), controlPoint1: CGPoint(x: 698.42, y: 778), controlPoint2: CGPoint(x: 696.67, y: 777.31)) bezier29Path.addLine(to: CGPoint(x: 676, y: 756.02)) bezier29Path.addCurve(to: CGPoint(x: 676, y: 746.06), controlPoint1: CGPoint(x: 673.33, y: 753.27), controlPoint2: CGPoint(x: 673.33, y: 748.81)) bezier29Path.addCurve(to: CGPoint(x: 685.67, y: 746.06), controlPoint1: CGPoint(x: 678.67, y: 743.31), controlPoint2: CGPoint(x: 683, y: 743.31)) bezier29Path.addLine(to: CGPoint(x: 705, y: 765.98)) bezier29Path.addCurve(to: CGPoint(x: 705, y: 775.94), controlPoint1: CGPoint(x: 707.67, y: 768.73), controlPoint2: CGPoint(x: 707.67, y: 773.19)) bezier29Path.addCurve(to: CGPoint(x: 700.17, y: 778), controlPoint1: CGPoint(x: 703.66, y: 777.31), controlPoint2: CGPoint(x: 701.91, y: 778)) bezier29Path.close() bezier29Path.usesEvenOddFillRule = true dark.setFill() bezier29Path.fill() //// Bezier 30 Drawing let bezier30Path = UIBezierPath() bezier30Path.move(to: CGPoint(x: 252.01, y: 510)) bezier30Path.addCurve(to: CGPoint(x: 250.2, y: 509.76), controlPoint1: CGPoint(x: 251.41, y: 510), controlPoint2: CGPoint(x: 250.81, y: 509.92)) bezier30Path.addLine(to: CGPoint(x: 223.17, y: 502.57)) bezier30Path.addCurve(to: CGPoint(x: 218.24, y: 494.1), controlPoint1: CGPoint(x: 219.45, y: 501.58), controlPoint2: CGPoint(x: 217.23, y: 497.79)) bezier30Path.addCurve(to: CGPoint(x: 226.8, y: 489.23), controlPoint1: CGPoint(x: 219.24, y: 490.43), controlPoint2: CGPoint(x: 223.05, y: 488.27)) bezier30Path.addLine(to: CGPoint(x: 253.83, y: 496.41)) bezier30Path.addCurve(to: CGPoint(x: 258.76, y: 504.88), controlPoint1: CGPoint(x: 257.55, y: 497.4), controlPoint2: CGPoint(x: 259.77, y: 501.19)) bezier30Path.addCurve(to: CGPoint(x: 252.01, y: 510), controlPoint1: CGPoint(x: 257.92, y: 507.96), controlPoint2: CGPoint(x: 255.1, y: 510)) bezier30Path.close() bezier30Path.usesEvenOddFillRule = true dark.setFill() bezier30Path.fill() //// Bezier 31 Drawing let bezier31Path = UIBezierPath() bezier31Path.move(to: CGPoint(x: 774, y: 650)) bezier31Path.addCurve(to: CGPoint(x: 772.18, y: 649.78), controlPoint1: CGPoint(x: 773.4, y: 650), controlPoint2: CGPoint(x: 772.8, y: 649.92)) bezier31Path.addLine(to: CGPoint(x: 745.18, y: 642.61)) bezier31Path.addCurve(to: CGPoint(x: 740.24, y: 634.1), controlPoint1: CGPoint(x: 741.45, y: 641.61), controlPoint2: CGPoint(x: 739.24, y: 637.81)) bezier31Path.addCurve(to: CGPoint(x: 748.81, y: 629.2), controlPoint1: CGPoint(x: 741.25, y: 630.42), controlPoint2: CGPoint(x: 745.07, y: 628.31)) bezier31Path.addLine(to: CGPoint(x: 775.82, y: 636.38)) bezier31Path.addCurve(to: CGPoint(x: 780.76, y: 644.88), controlPoint1: CGPoint(x: 779.54, y: 637.38), controlPoint2: CGPoint(x: 781.76, y: 641.17)) bezier31Path.addCurve(to: CGPoint(x: 774, y: 650), controlPoint1: CGPoint(x: 779.91, y: 647.97), controlPoint2: CGPoint(x: 777.09, y: 650)) bezier31Path.close() bezier31Path.usesEvenOddFillRule = true dark.setFill() bezier31Path.fill() //// Bezier 32 Drawing let bezier32Path = UIBezierPath() bezier32Path.move(to: CGPoint(x: 225, y: 650)) bezier32Path.addCurve(to: CGPoint(x: 218.24, y: 644.86), controlPoint1: CGPoint(x: 221.9, y: 650), controlPoint2: CGPoint(x: 219.08, y: 647.94)) bezier32Path.addCurve(to: CGPoint(x: 223.19, y: 636.36), controlPoint1: CGPoint(x: 217.24, y: 641.15), controlPoint2: CGPoint(x: 219.47, y: 637.36)) bezier32Path.addLine(to: CGPoint(x: 250.2, y: 629.21)) bezier32Path.addCurve(to: CGPoint(x: 258.76, y: 634.11), controlPoint1: CGPoint(x: 253.98, y: 628.29), controlPoint2: CGPoint(x: 257.75, y: 630.43)) bezier32Path.addCurve(to: CGPoint(x: 253.81, y: 642.61), controlPoint1: CGPoint(x: 259.76, y: 637.82), controlPoint2: CGPoint(x: 257.53, y: 641.61)) bezier32Path.addLine(to: CGPoint(x: 226.8, y: 649.76)) bezier32Path.addCurve(to: CGPoint(x: 225, y: 650), controlPoint1: CGPoint(x: 226.2, y: 649.92), controlPoint2: CGPoint(x: 225.58, y: 650)) bezier32Path.close() bezier32Path.usesEvenOddFillRule = true dark.setFill() bezier32Path.fill() //// Bezier 33 Drawing let bezier33Path = UIBezierPath() bezier33Path.move(to: CGPoint(x: 747, y: 510)) bezier33Path.addCurve(to: CGPoint(x: 740.24, y: 504.87), controlPoint1: CGPoint(x: 743.91, y: 510), controlPoint2: CGPoint(x: 741.08, y: 507.96)) bezier33Path.addCurve(to: CGPoint(x: 745.18, y: 496.38), controlPoint1: CGPoint(x: 739.24, y: 501.17), controlPoint2: CGPoint(x: 741.45, y: 497.38)) bezier33Path.addLine(to: CGPoint(x: 772.19, y: 489.21)) bezier33Path.addCurve(to: CGPoint(x: 780.76, y: 494.11), controlPoint1: CGPoint(x: 775.98, y: 488.3), controlPoint2: CGPoint(x: 779.75, y: 490.43)) bezier33Path.addCurve(to: CGPoint(x: 775.82, y: 502.6), controlPoint1: CGPoint(x: 781.76, y: 497.81), controlPoint2: CGPoint(x: 779.55, y: 501.6)) bezier33Path.addLine(to: CGPoint(x: 748.81, y: 509.77)) bezier33Path.addCurve(to: CGPoint(x: 747, y: 510), controlPoint1: CGPoint(x: 748.2, y: 509.92), controlPoint2: CGPoint(x: 747.6, y: 510)) bezier33Path.close() bezier33Path.usesEvenOddFillRule = true dark.setFill() bezier33Path.fill() //// Bezier 34 Drawing let bezier34Path = UIBezierPath() bezier34Path.move(to: CGPoint(x: 298.83, y: 778)) bezier34Path.addCurve(to: CGPoint(x: 294, y: 775.94), controlPoint1: CGPoint(x: 297.08, y: 778), controlPoint2: CGPoint(x: 295.34, y: 777.31)) bezier34Path.addCurve(to: CGPoint(x: 294, y: 765.98), controlPoint1: CGPoint(x: 291.33, y: 773.18), controlPoint2: CGPoint(x: 291.33, y: 768.7)) bezier34Path.addLine(to: CGPoint(x: 313.34, y: 746.06)) bezier34Path.addCurve(to: CGPoint(x: 323, y: 746.06), controlPoint1: CGPoint(x: 316.01, y: 743.31), controlPoint2: CGPoint(x: 320.33, y: 743.31)) bezier34Path.addCurve(to: CGPoint(x: 323, y: 756.02), controlPoint1: CGPoint(x: 325.67, y: 748.81), controlPoint2: CGPoint(x: 325.67, y: 753.3)) bezier34Path.addLine(to: CGPoint(x: 303.66, y: 775.94)) bezier34Path.addCurve(to: CGPoint(x: 298.83, y: 778), controlPoint1: CGPoint(x: 302.32, y: 777.31), controlPoint2: CGPoint(x: 300.58, y: 778)) bezier34Path.close() bezier34Path.usesEvenOddFillRule = true dark.setFill() bezier34Path.fill() //// Bezier 35 Drawing let bezier35Path = UIBezierPath() bezier35Path.move(to: CGPoint(x: 680.83, y: 395)) bezier35Path.addCurve(to: CGPoint(x: 676, y: 392.94), controlPoint1: CGPoint(x: 679.09, y: 395), controlPoint2: CGPoint(x: 677.34, y: 394.31)) bezier35Path.addCurve(to: CGPoint(x: 676, y: 382.98), controlPoint1: CGPoint(x: 673.33, y: 390.19), controlPoint2: CGPoint(x: 673.33, y: 385.73)) bezier35Path.addLine(to: CGPoint(x: 695.33, y: 363.06)) bezier35Path.addCurve(to: CGPoint(x: 705, y: 363.06), controlPoint1: CGPoint(x: 698, y: 360.31), controlPoint2: CGPoint(x: 702.33, y: 360.31)) bezier35Path.addCurve(to: CGPoint(x: 705, y: 373.02), controlPoint1: CGPoint(x: 707.67, y: 365.81), controlPoint2: CGPoint(x: 707.67, y: 370.27)) bezier35Path.addLine(to: CGPoint(x: 685.67, y: 392.94)) bezier35Path.addCurve(to: CGPoint(x: 680.83, y: 395), controlPoint1: CGPoint(x: 684.33, y: 394.31), controlPoint2: CGPoint(x: 682.58, y: 395)) bezier35Path.close() bezier35Path.usesEvenOddFillRule = true dark.setFill() bezier35Path.fill() //// Bezier 36 Drawing let bezier36Path = UIBezierPath() bezier36Path.move(to: CGPoint(x: 425.93, y: 852)) bezier36Path.addCurve(to: CGPoint(x: 424.14, y: 851.78), controlPoint1: CGPoint(x: 425.34, y: 852), controlPoint2: CGPoint(x: 424.74, y: 851.92)) bezier36Path.addCurve(to: CGPoint(x: 419.24, y: 843.2), controlPoint1: CGPoint(x: 420.45, y: 850.77), controlPoint2: CGPoint(x: 418.25, y: 846.94)) bezier36Path.addLine(to: CGPoint(x: 426.38, y: 816.17)) bezier36Path.addCurve(to: CGPoint(x: 434.86, y: 811.22), controlPoint1: CGPoint(x: 427.39, y: 812.46), controlPoint2: CGPoint(x: 431.11, y: 810.27)) bezier36Path.addCurve(to: CGPoint(x: 439.76, y: 819.78), controlPoint1: CGPoint(x: 438.55, y: 812.21), controlPoint2: CGPoint(x: 440.75, y: 816.06)) bezier36Path.addLine(to: CGPoint(x: 432.62, y: 846.81)) bezier36Path.addCurve(to: CGPoint(x: 425.93, y: 852), controlPoint1: CGPoint(x: 431.78, y: 849.95), controlPoint2: CGPoint(x: 428.98, y: 852)) bezier36Path.close() bezier36Path.usesEvenOddFillRule = true dark.setFill() bezier36Path.fill() //// Bezier 37 Drawing let bezier37Path = UIBezierPath() bezier37Path.move(to: CGPoint(x: 565.92, y: 329)) bezier37Path.addCurve(to: CGPoint(x: 564.13, y: 328.77), controlPoint1: CGPoint(x: 565.32, y: 329), controlPoint2: CGPoint(x: 564.73, y: 328.92)) bezier37Path.addCurve(to: CGPoint(x: 559.24, y: 320.18), controlPoint1: CGPoint(x: 560.44, y: 327.76), controlPoint2: CGPoint(x: 558.25, y: 323.93)) bezier37Path.addLine(to: CGPoint(x: 566.39, y: 293.15)) bezier37Path.addCurve(to: CGPoint(x: 574.87, y: 288.2), controlPoint1: CGPoint(x: 567.41, y: 289.43), controlPoint2: CGPoint(x: 571.19, y: 287.31)) bezier37Path.addCurve(to: CGPoint(x: 579.76, y: 296.78), controlPoint1: CGPoint(x: 578.56, y: 289.21), controlPoint2: CGPoint(x: 580.75, y: 293.04)) bezier37Path.addLine(to: CGPoint(x: 572.61, y: 323.82)) bezier37Path.addCurve(to: CGPoint(x: 565.92, y: 329), controlPoint1: CGPoint(x: 571.77, y: 326.94), controlPoint2: CGPoint(x: 568.97, y: 329)) bezier37Path.close() bezier37Path.usesEvenOddFillRule = true dark.setFill() bezier37Path.fill() //// Bezier 38 Drawing let bezier38Path = UIBezierPath() bezier38Path.move(to: CGPoint(x: 423.06, y: 577)) bezier38Path.addLine(to: CGPoint(x: 391.94, y: 577)) bezier38Path.addCurve(to: CGPoint(x: 385, y: 570), controlPoint1: CGPoint(x: 388.1, y: 577), controlPoint2: CGPoint(x: 385, y: 573.86)) bezier38Path.addCurve(to: CGPoint(x: 391.94, y: 563), controlPoint1: CGPoint(x: 385, y: 566.12), controlPoint2: CGPoint(x: 388.1, y: 563)) bezier38Path.addLine(to: CGPoint(x: 423.06, y: 563)) bezier38Path.addCurve(to: CGPoint(x: 430, y: 570), controlPoint1: CGPoint(x: 426.9, y: 563), controlPoint2: CGPoint(x: 430, y: 566.12)) bezier38Path.addCurve(to: CGPoint(x: 423.06, y: 577), controlPoint1: CGPoint(x: 430, y: 573.86), controlPoint2: CGPoint(x: 426.9, y: 577)) bezier38Path.close() bezier38Path.usesEvenOddFillRule = true dark.setFill() bezier38Path.fill() //// Bezier 39 Drawing let bezier39Path = UIBezierPath() bezier39Path.move(to: CGPoint(x: 608.06, y: 577)) bezier39Path.addLine(to: CGPoint(x: 576.94, y: 577)) bezier39Path.addCurve(to: CGPoint(x: 570, y: 570), controlPoint1: CGPoint(x: 573.1, y: 577), controlPoint2: CGPoint(x: 570, y: 573.86)) bezier39Path.addCurve(to: CGPoint(x: 576.94, y: 563), controlPoint1: CGPoint(x: 570, y: 566.12), controlPoint2: CGPoint(x: 573.1, y: 563)) bezier39Path.addLine(to: CGPoint(x: 608.06, y: 563)) bezier39Path.addCurve(to: CGPoint(x: 615, y: 570), controlPoint1: CGPoint(x: 611.9, y: 563), controlPoint2: CGPoint(x: 615, y: 566.12)) bezier39Path.addCurve(to: CGPoint(x: 608.06, y: 577), controlPoint1: CGPoint(x: 615, y: 573.86), controlPoint2: CGPoint(x: 611.9, y: 577)) bezier39Path.close() bezier39Path.usesEvenOddFillRule = true dark.setFill() bezier39Path.fill() //// Rectangle 4 Drawing let rectangle4Path = UIBezierPath(roundedRect: CGRect(x: 493, y: 640, width: 14, height: 45), cornerRadius: 7) dark.setFill() rectangle4Path.fill() //// Rectangle 5 Drawing let rectangle5Path = UIBezierPath(roundedRect: CGRect(x: 493, y: 455, width: 14, height: 45), cornerRadius: 7) dark.setFill() rectangle5Path.fill() //// Bezier 40 Drawing let bezier40Path = UIBezierPath() bezier40Path.move(to: CGPoint(x: 576.04, y: 653)) bezier40Path.addCurve(to: CGPoint(x: 571.11, y: 650.96), controlPoint1: CGPoint(x: 574.25, y: 653), controlPoint2: CGPoint(x: 572.47, y: 652.32)) bezier40Path.addLine(to: CGPoint(x: 549.04, y: 628.87)) bezier40Path.addCurve(to: CGPoint(x: 549.04, y: 619.04), controlPoint1: CGPoint(x: 546.32, y: 626.16), controlPoint2: CGPoint(x: 546.32, y: 621.75)) bezier40Path.addCurve(to: CGPoint(x: 558.89, y: 619.04), controlPoint1: CGPoint(x: 551.76, y: 616.32), controlPoint2: CGPoint(x: 556.17, y: 616.32)) bezier40Path.addLine(to: CGPoint(x: 580.96, y: 641.13)) bezier40Path.addCurve(to: CGPoint(x: 580.96, y: 650.96), controlPoint1: CGPoint(x: 583.68, y: 643.84), controlPoint2: CGPoint(x: 583.68, y: 648.25)) bezier40Path.addCurve(to: CGPoint(x: 576.04, y: 653), controlPoint1: CGPoint(x: 579.6, y: 652.32), controlPoint2: CGPoint(x: 577.82, y: 653)) bezier40Path.close() bezier40Path.usesEvenOddFillRule = true dark.setFill() bezier40Path.fill() //// Bezier 41 Drawing let bezier41Path = UIBezierPath() bezier41Path.move(to: CGPoint(x: 445.03, y: 522)) bezier41Path.addCurve(to: CGPoint(x: 440.11, y: 519.96), controlPoint1: CGPoint(x: 443.25, y: 522), controlPoint2: CGPoint(x: 441.47, y: 521.32)) bezier41Path.addLine(to: CGPoint(x: 418.04, y: 497.89)) bezier41Path.addCurve(to: CGPoint(x: 418.04, y: 488.04), controlPoint1: CGPoint(x: 415.32, y: 495.17), controlPoint2: CGPoint(x: 415.32, y: 490.76)) bezier41Path.addCurve(to: CGPoint(x: 427.89, y: 488.04), controlPoint1: CGPoint(x: 420.76, y: 485.32), controlPoint2: CGPoint(x: 425.17, y: 485.32)) bezier41Path.addLine(to: CGPoint(x: 449.96, y: 510.11)) bezier41Path.addCurve(to: CGPoint(x: 449.96, y: 519.96), controlPoint1: CGPoint(x: 452.68, y: 512.84), controlPoint2: CGPoint(x: 452.68, y: 517.24)) bezier41Path.addCurve(to: CGPoint(x: 445.03, y: 522), controlPoint1: CGPoint(x: 448.6, y: 521.32), controlPoint2: CGPoint(x: 446.82, y: 522)) bezier41Path.close() bezier41Path.usesEvenOddFillRule = true dark.setFill() bezier41Path.fill() //// Bezier 42 Drawing let bezier42Path = UIBezierPath() bezier42Path.move(to: CGPoint(x: 500, y: 563)) bezier42Path.addCurve(to: CGPoint(x: 493, y: 570), controlPoint1: CGPoint(x: 496.15, y: 563), controlPoint2: CGPoint(x: 493, y: 566.14)) bezier42Path.addCurve(to: CGPoint(x: 500, y: 577), controlPoint1: CGPoint(x: 493, y: 573.86), controlPoint2: CGPoint(x: 496.14, y: 577)) bezier42Path.addLine(to: CGPoint(x: 500.03, y: 577)) bezier42Path.addCurve(to: CGPoint(x: 507, y: 570), controlPoint1: CGPoint(x: 503.87, y: 577), controlPoint2: CGPoint(x: 507, y: 573.86)) bezier42Path.addCurve(to: CGPoint(x: 500, y: 563), controlPoint1: CGPoint(x: 507, y: 566.14), controlPoint2: CGPoint(x: 503.86, y: 563)) bezier42Path.close() bezier42Path.move(to: CGPoint(x: 500.03, y: 591)) bezier42Path.addCurve(to: CGPoint(x: 479, y: 570), controlPoint1: CGPoint(x: 488.43, y: 591), controlPoint2: CGPoint(x: 479, y: 581.56)) bezier42Path.addCurve(to: CGPoint(x: 500, y: 549), controlPoint1: CGPoint(x: 479, y: 558.43), controlPoint2: CGPoint(x: 488.42, y: 549)) bezier42Path.addCurve(to: CGPoint(x: 521, y: 570), controlPoint1: CGPoint(x: 511.58, y: 549), controlPoint2: CGPoint(x: 521, y: 558.43)) bezier42Path.addCurve(to: CGPoint(x: 500.03, y: 591), controlPoint1: CGPoint(x: 521, y: 581.56), controlPoint2: CGPoint(x: 511.59, y: 591)) bezier42Path.close() bezier42Path.usesEvenOddFillRule = true dark.setFill() bezier42Path.fill() //// Bezier 43 Drawing let bezier43Path = UIBezierPath() bezier43Path.move(to: CGPoint(x: 474.94, y: 551)) bezier43Path.addCurve(to: CGPoint(x: 469.32, y: 548.13), controlPoint1: CGPoint(x: 472.79, y: 551), controlPoint2: CGPoint(x: 470.67, y: 550)) bezier43Path.addCurve(to: CGPoint(x: 470.88, y: 538.45), controlPoint1: CGPoint(x: 467.07, y: 545.01), controlPoint2: CGPoint(x: 467.77, y: 540.67)) bezier43Path.addLine(to: CGPoint(x: 646.99, y: 411.32)) bezier43Path.addCurve(to: CGPoint(x: 656.68, y: 412.88), controlPoint1: CGPoint(x: 650.1, y: 409.06), controlPoint2: CGPoint(x: 654.43, y: 409.79)) bezier43Path.addCurve(to: CGPoint(x: 655.12, y: 422.57), controlPoint1: CGPoint(x: 658.93, y: 416), controlPoint2: CGPoint(x: 658.23, y: 420.33)) bezier43Path.addLine(to: CGPoint(x: 479.01, y: 549.7)) bezier43Path.addCurve(to: CGPoint(x: 474.94, y: 551), controlPoint1: CGPoint(x: 477.77, y: 550.59), controlPoint2: CGPoint(x: 476.35, y: 551)) bezier43Path.close() bezier43Path.usesEvenOddFillRule = true dark.setFill() bezier43Path.fill() //// Bezier 44 Drawing let bezier44Path = UIBezierPath() bezier44Path.move(to: CGPoint(x: 523.94, y: 601)) bezier44Path.addCurve(to: CGPoint(x: 519.88, y: 599.67), controlPoint1: CGPoint(x: 522.53, y: 601), controlPoint2: CGPoint(x: 521.11, y: 600.57)) bezier44Path.addCurve(to: CGPoint(x: 518.32, y: 590), controlPoint1: CGPoint(x: 516.77, y: 597.45), controlPoint2: CGPoint(x: 516.07, y: 593.11)) bezier44Path.addLine(to: CGPoint(x: 645.43, y: 413.87)) bezier44Path.addCurve(to: CGPoint(x: 655.12, y: 412.32), controlPoint1: CGPoint(x: 647.68, y: 410.77), controlPoint2: CGPoint(x: 652.02, y: 410.07)) bezier44Path.addCurve(to: CGPoint(x: 656.68, y: 422.01), controlPoint1: CGPoint(x: 658.23, y: 414.55), controlPoint2: CGPoint(x: 658.93, y: 418.89)) bezier44Path.addLine(to: CGPoint(x: 529.57, y: 598.13)) bezier44Path.addCurve(to: CGPoint(x: 523.94, y: 601), controlPoint1: CGPoint(x: 528.21, y: 600), controlPoint2: CGPoint(x: 526.09, y: 601)) bezier44Path.close() bezier44Path.usesEvenOddFillRule = true dark.setFill() bezier44Path.fill() //// Bezier 45 Drawing let bezier45Path = UIBezierPath() bezier45Path.move(to: CGPoint(x: 348.92, y: 728)) bezier45Path.addCurve(to: CGPoint(x: 343.31, y: 725.09), controlPoint1: CGPoint(x: 346.77, y: 728), controlPoint2: CGPoint(x: 344.66, y: 726.99)) bezier45Path.addCurve(to: CGPoint(x: 344.88, y: 715.39), controlPoint1: CGPoint(x: 341.07, y: 721.99), controlPoint2: CGPoint(x: 341.77, y: 717.64)) bezier45Path.addLine(to: CGPoint(x: 520.04, y: 588.34)) bezier45Path.addCurve(to: CGPoint(x: 529.69, y: 589.92), controlPoint1: CGPoint(x: 523.11, y: 586.06), controlPoint2: CGPoint(x: 527.44, y: 586.76)) bezier45Path.addCurve(to: CGPoint(x: 528.12, y: 599.62), controlPoint1: CGPoint(x: 531.93, y: 593.01), controlPoint2: CGPoint(x: 531.23, y: 597.36)) bezier45Path.addLine(to: CGPoint(x: 352.96, y: 726.67)) bezier45Path.addCurve(to: CGPoint(x: 348.92, y: 728), controlPoint1: CGPoint(x: 351.74, y: 727.56), controlPoint2: CGPoint(x: 350.32, y: 728)) bezier45Path.close() bezier45Path.usesEvenOddFillRule = true dark.setFill() bezier45Path.fill() //// Bezier 46 Drawing let bezier46Path = UIBezierPath() bezier46Path.move(to: CGPoint(x: 348.91, y: 728)) bezier46Path.addCurve(to: CGPoint(x: 344.88, y: 726.67), controlPoint1: CGPoint(x: 347.51, y: 728), controlPoint2: CGPoint(x: 346.09, y: 727.57)) bezier46Path.addCurve(to: CGPoint(x: 343.31, y: 716.97), controlPoint1: CGPoint(x: 341.77, y: 724.44), controlPoint2: CGPoint(x: 341.07, y: 720.1)) bezier46Path.addLine(to: CGPoint(x: 469.49, y: 540.9)) bezier46Path.addCurve(to: CGPoint(x: 479.12, y: 539.33), controlPoint1: CGPoint(x: 471.72, y: 537.78), controlPoint2: CGPoint(x: 476.05, y: 537.05)) bezier46Path.addCurve(to: CGPoint(x: 480.69, y: 549.03), controlPoint1: CGPoint(x: 482.23, y: 541.58), controlPoint2: CGPoint(x: 482.93, y: 545.93)) bezier46Path.addLine(to: CGPoint(x: 354.51, y: 725.09)) bezier46Path.addCurve(to: CGPoint(x: 348.91, y: 728), controlPoint1: CGPoint(x: 353.16, y: 726.99), controlPoint2: CGPoint(x: 351.06, y: 728)) bezier46Path.close() bezier46Path.usesEvenOddFillRule = true dark.setFill() bezier46Path.fill() //// Bezier 47 Drawing let bezier47Path = UIBezierPath() bezier47Path.move(to: CGPoint(x: 521, y: 751)) bezier47Path.addLine(to: CGPoint(x: 493, y: 751)) bezier47Path.addCurve(to: CGPoint(x: 486, y: 744), controlPoint1: CGPoint(x: 489.13, y: 751), controlPoint2: CGPoint(x: 486, y: 747.86)) bezier47Path.addCurve(to: CGPoint(x: 493, y: 737), controlPoint1: CGPoint(x: 486, y: 740.12), controlPoint2: CGPoint(x: 489.13, y: 737)) bezier47Path.addLine(to: CGPoint(x: 521, y: 737)) bezier47Path.addCurve(to: CGPoint(x: 528, y: 744), controlPoint1: CGPoint(x: 524.87, y: 737), controlPoint2: CGPoint(x: 528, y: 740.12)) bezier47Path.addCurve(to: CGPoint(x: 521, y: 751), controlPoint1: CGPoint(x: 528, y: 747.86), controlPoint2: CGPoint(x: 524.87, y: 751)) bezier47Path.close() bezier47Path.usesEvenOddFillRule = true dark.setFill() bezier47Path.fill() //// Bezier 48 Drawing let bezier48Path = UIBezierPath() bezier48Path.move(to: CGPoint(x: 521.01, y: 792)) bezier48Path.addCurve(to: CGPoint(x: 515.27, y: 788.99), controlPoint1: CGPoint(x: 518.81, y: 792), controlPoint2: CGPoint(x: 516.63, y: 790.93)) bezier48Path.addLine(to: CGPoint(x: 486.24, y: 746.99)) bezier48Path.addCurve(to: CGPoint(x: 488, y: 737.22), controlPoint1: CGPoint(x: 484.05, y: 743.79), controlPoint2: CGPoint(x: 484.84, y: 739.44)) bezier48Path.addCurve(to: CGPoint(x: 497.73, y: 739), controlPoint1: CGPoint(x: 491.17, y: 735.06), controlPoint2: CGPoint(x: 495.5, y: 735.83)) bezier48Path.addLine(to: CGPoint(x: 526.76, y: 781.01)) bezier48Path.addCurve(to: CGPoint(x: 525, y: 790.74), controlPoint1: CGPoint(x: 528.95, y: 784.18), controlPoint2: CGPoint(x: 528.16, y: 788.55)) bezier48Path.addCurve(to: CGPoint(x: 521.01, y: 792), controlPoint1: CGPoint(x: 523.78, y: 791.59), controlPoint2: CGPoint(x: 522.39, y: 792)) bezier48Path.close() bezier48Path.usesEvenOddFillRule = true dark.setFill() bezier48Path.fill() //// Bezier 49 Drawing let bezier49Path = UIBezierPath() bezier49Path.move(to: CGPoint(x: 521, y: 792)) bezier49Path.addLine(to: CGPoint(x: 493, y: 792)) bezier49Path.addCurve(to: CGPoint(x: 486, y: 785), controlPoint1: CGPoint(x: 489.13, y: 792), controlPoint2: CGPoint(x: 486, y: 788.85)) bezier49Path.addCurve(to: CGPoint(x: 493, y: 778), controlPoint1: CGPoint(x: 486, y: 781.12), controlPoint2: CGPoint(x: 489.13, y: 778)) bezier49Path.addLine(to: CGPoint(x: 521, y: 778)) bezier49Path.addCurve(to: CGPoint(x: 528, y: 785), controlPoint1: CGPoint(x: 524.87, y: 778), controlPoint2: CGPoint(x: 528, y: 781.12)) bezier49Path.addCurve(to: CGPoint(x: 521, y: 792), controlPoint1: CGPoint(x: 528, y: 788.85), controlPoint2: CGPoint(x: 524.87, y: 792)) bezier49Path.close() bezier49Path.usesEvenOddFillRule = true dark.setFill() bezier49Path.fill() //// Bezier 50 Drawing let bezier50Path = UIBezierPath() bezier50Path.move(to: CGPoint(x: 295.14, y: 598)) bezier50Path.addCurve(to: CGPoint(x: 288.49, y: 592.7), controlPoint1: CGPoint(x: 292.06, y: 598), controlPoint2: CGPoint(x: 289.26, y: 595.87)) bezier50Path.addLine(to: CGPoint(x: 278.2, y: 550.71)) bezier50Path.addCurve(to: CGPoint(x: 283.2, y: 542.21), controlPoint1: CGPoint(x: 277.29, y: 546.96), controlPoint2: CGPoint(x: 279.52, y: 543.16)) bezier50Path.addCurve(to: CGPoint(x: 291.51, y: 547.32), controlPoint1: CGPoint(x: 286.79, y: 541.28), controlPoint2: CGPoint(x: 290.59, y: 543.55)) bezier50Path.addLine(to: CGPoint(x: 301.8, y: 589.31)) bezier50Path.addCurve(to: CGPoint(x: 296.8, y: 597.78), controlPoint1: CGPoint(x: 302.71, y: 593.05), controlPoint2: CGPoint(x: 300.48, y: 596.85)) bezier50Path.addCurve(to: CGPoint(x: 295.14, y: 598), controlPoint1: CGPoint(x: 296.25, y: 597.92), controlPoint2: CGPoint(x: 295.69, y: 598)) bezier50Path.close() bezier50Path.usesEvenOddFillRule = true dark.setFill() bezier50Path.fill() //// Bezier 51 Drawing let bezier51Path = UIBezierPath() bezier51Path.move(to: CGPoint(x: 294.86, y: 598)) bezier51Path.addCurve(to: CGPoint(x: 292.45, y: 597.53), controlPoint1: CGPoint(x: 294.05, y: 598), controlPoint2: CGPoint(x: 293.24, y: 597.86)) bezier51Path.addCurve(to: CGPoint(x: 288.44, y: 588.54), controlPoint1: CGPoint(x: 288.9, y: 596.2), controlPoint2: CGPoint(x: 287.11, y: 592.15)) bezier51Path.addLine(to: CGPoint(x: 298.73, y: 560.56)) bezier51Path.addCurve(to: CGPoint(x: 307.55, y: 556.46), controlPoint1: CGPoint(x: 300.05, y: 556.93), controlPoint2: CGPoint(x: 304.03, y: 555.07)) bezier51Path.addCurve(to: CGPoint(x: 311.56, y: 565.48), controlPoint1: CGPoint(x: 311.1, y: 557.83), controlPoint2: CGPoint(x: 312.9, y: 561.85)) bezier51Path.addLine(to: CGPoint(x: 301.27, y: 593.46)) bezier51Path.addCurve(to: CGPoint(x: 294.86, y: 598), controlPoint1: CGPoint(x: 300.24, y: 596.25), controlPoint2: CGPoint(x: 297.63, y: 598)) bezier51Path.close() bezier51Path.usesEvenOddFillRule = true dark.setFill() bezier51Path.fill() //// Bezier 52 Drawing let bezier52Path = UIBezierPath() bezier52Path.move(to: CGPoint(x: 316.14, y: 598)) bezier52Path.addCurve(to: CGPoint(x: 309.73, y: 593.46), controlPoint1: CGPoint(x: 313.37, y: 598), controlPoint2: CGPoint(x: 310.76, y: 596.28)) bezier52Path.addLine(to: CGPoint(x: 299.44, y: 565.48)) bezier52Path.addCurve(to: CGPoint(x: 303.45, y: 556.46), controlPoint1: CGPoint(x: 298.1, y: 561.85), controlPoint2: CGPoint(x: 299.91, y: 557.82)) bezier52Path.addCurve(to: CGPoint(x: 312.27, y: 560.56), controlPoint1: CGPoint(x: 306.95, y: 555.07), controlPoint2: CGPoint(x: 310.95, y: 556.95)) bezier52Path.addLine(to: CGPoint(x: 322.56, y: 588.54)) bezier52Path.addCurve(to: CGPoint(x: 318.55, y: 597.56), controlPoint1: CGPoint(x: 323.9, y: 592.18), controlPoint2: CGPoint(x: 322.09, y: 596.2)) bezier52Path.addCurve(to: CGPoint(x: 316.14, y: 598), controlPoint1: CGPoint(x: 317.76, y: 597.86), controlPoint2: CGPoint(x: 316.95, y: 598)) bezier52Path.close() bezier52Path.usesEvenOddFillRule = true dark.setFill() bezier52Path.fill() //// Bezier 53 Drawing let bezier53Path = UIBezierPath() bezier53Path.move(to: CGPoint(x: 315.86, y: 598)) bezier53Path.addCurve(to: CGPoint(x: 314.2, y: 597.81), controlPoint1: CGPoint(x: 315.31, y: 598), controlPoint2: CGPoint(x: 314.76, y: 597.95)) bezier53Path.addCurve(to: CGPoint(x: 309.2, y: 589.31), controlPoint1: CGPoint(x: 310.53, y: 596.85), controlPoint2: CGPoint(x: 308.29, y: 593.05)) bezier53Path.addLine(to: CGPoint(x: 319.49, y: 547.31)) bezier53Path.addCurve(to: CGPoint(x: 327.8, y: 542.2), controlPoint1: CGPoint(x: 320.4, y: 543.54), controlPoint2: CGPoint(x: 324.08, y: 541.3)) bezier53Path.addCurve(to: CGPoint(x: 332.8, y: 550.7), controlPoint1: CGPoint(x: 331.47, y: 543.16), controlPoint2: CGPoint(x: 333.71, y: 546.96)) bezier53Path.addLine(to: CGPoint(x: 322.51, y: 592.7)) bezier53Path.addCurve(to: CGPoint(x: 315.86, y: 598), controlPoint1: CGPoint(x: 321.74, y: 595.9), controlPoint2: CGPoint(x: 318.94, y: 598)) bezier53Path.close() bezier53Path.usesEvenOddFillRule = true dark.setFill() bezier53Path.fill() //// Rectangle 6 Drawing let rectangle6Path = UIBezierPath(roundedRect: CGRect(x: 666, y: 542, width: 14, height: 56), cornerRadius: 7) dark.setFill() rectangle6Path.fill() //// Bezier 54 Drawing let bezier54Path = UIBezierPath() bezier54Path.move(to: CGPoint(x: 701, y: 556)) bezier54Path.addLine(to: CGPoint(x: 673, y: 556)) bezier54Path.addCurve(to: CGPoint(x: 666, y: 549), controlPoint1: CGPoint(x: 669.13, y: 556), controlPoint2: CGPoint(x: 666, y: 552.86)) bezier54Path.addCurve(to: CGPoint(x: 673, y: 542), controlPoint1: CGPoint(x: 666, y: 545.12), controlPoint2: CGPoint(x: 669.13, y: 542)) bezier54Path.addLine(to: CGPoint(x: 701, y: 542)) bezier54Path.addCurve(to: CGPoint(x: 708, y: 549), controlPoint1: CGPoint(x: 704.87, y: 542), controlPoint2: CGPoint(x: 708, y: 545.12)) bezier54Path.addCurve(to: CGPoint(x: 701, y: 556), controlPoint1: CGPoint(x: 708, y: 552.86), controlPoint2: CGPoint(x: 704.87, y: 556)) bezier54Path.close() bezier54Path.usesEvenOddFillRule = true dark.setFill() bezier54Path.fill() //// Bezier 55 Drawing let bezier55Path = UIBezierPath() bezier55Path.move(to: CGPoint(x: 701, y: 598)) bezier55Path.addLine(to: CGPoint(x: 673, y: 598)) bezier55Path.addCurve(to: CGPoint(x: 666, y: 591), controlPoint1: CGPoint(x: 669.13, y: 598), controlPoint2: CGPoint(x: 666, y: 594.86)) bezier55Path.addCurve(to: CGPoint(x: 673, y: 584), controlPoint1: CGPoint(x: 666, y: 587.12), controlPoint2: CGPoint(x: 669.13, y: 584)) bezier55Path.addLine(to: CGPoint(x: 701, y: 584)) bezier55Path.addCurve(to: CGPoint(x: 708, y: 591), controlPoint1: CGPoint(x: 704.87, y: 584), controlPoint2: CGPoint(x: 708, y: 587.12)) bezier55Path.addCurve(to: CGPoint(x: 701, y: 598), controlPoint1: CGPoint(x: 708, y: 594.86), controlPoint2: CGPoint(x: 704.87, y: 598)) bezier55Path.close() bezier55Path.usesEvenOddFillRule = true dark.setFill() bezier55Path.fill() //// Bezier 56 Drawing let bezier56Path = UIBezierPath() bezier56Path.move(to: CGPoint(x: 687.03, y: 577)) bezier56Path.addLine(to: CGPoint(x: 673.97, y: 577)) bezier56Path.addCurve(to: CGPoint(x: 667, y: 570), controlPoint1: CGPoint(x: 670.12, y: 577), controlPoint2: CGPoint(x: 667, y: 573.88)) bezier56Path.addCurve(to: CGPoint(x: 673.97, y: 563), controlPoint1: CGPoint(x: 667, y: 566.15), controlPoint2: CGPoint(x: 670.12, y: 563)) bezier56Path.addLine(to: CGPoint(x: 687.03, y: 563)) bezier56Path.addCurve(to: CGPoint(x: 694, y: 570), controlPoint1: CGPoint(x: 690.88, y: 563), controlPoint2: CGPoint(x: 694, y: 566.15)) bezier56Path.addCurve(to: CGPoint(x: 687.03, y: 577), controlPoint1: CGPoint(x: 694, y: 573.88), controlPoint2: CGPoint(x: 690.88, y: 577)) bezier56Path.close() bezier56Path.usesEvenOddFillRule = true dark.setFill() bezier56Path.fill() //// Rectangle 7 Drawing let rectangle7Path = UIBezierPath(roundedRect: CGRect(x: 479, y: 347, width: 14, height: 56), cornerRadius: 7) dark.setFill() rectangle7Path.fill() //// Bezier 57 Drawing let bezier57Path = UIBezierPath() bezier57Path.move(to: CGPoint(x: 514, y: 403)) bezier57Path.addCurve(to: CGPoint(x: 508.17, y: 399.88), controlPoint1: CGPoint(x: 511.74, y: 403), controlPoint2: CGPoint(x: 509.53, y: 401.9)) bezier57Path.addLine(to: CGPoint(x: 480.18, y: 357.9)) bezier57Path.addCurve(to: CGPoint(x: 482.12, y: 348.18), controlPoint1: CGPoint(x: 478.03, y: 354.68), controlPoint2: CGPoint(x: 478.91, y: 350.33)) bezier57Path.addCurve(to: CGPoint(x: 491.82, y: 350.12), controlPoint1: CGPoint(x: 485.3, y: 346.04), controlPoint2: CGPoint(x: 489.67, y: 346.89)) bezier57Path.addLine(to: CGPoint(x: 519.82, y: 392.1)) bezier57Path.addCurve(to: CGPoint(x: 517.88, y: 401.82), controlPoint1: CGPoint(x: 521.97, y: 395.32), controlPoint2: CGPoint(x: 521.1, y: 399.67)) bezier57Path.addCurve(to: CGPoint(x: 514, y: 403), controlPoint1: CGPoint(x: 516.69, y: 402.62), controlPoint2: CGPoint(x: 515.34, y: 403)) bezier57Path.close() bezier57Path.usesEvenOddFillRule = true dark.setFill() bezier57Path.fill() //// Rectangle 8 Drawing let rectangle8Path = UIBezierPath(roundedRect: CGRect(x: 507, y: 346, width: 14, height: 57), cornerRadius: 7) dark.setFill() rectangle8Path.fill() context.restoreGState() } @objc dynamic public class func drawMicro(frame targetFrame: CGRect = CGRect(x: 0, y: 0, width: 1000, height: 1000), resizing: ResizingBehavior = .aspectFit, white: UIColor = UIColor(red: 1.000, green: 1.000, blue: 1.000, alpha: 1.000), light: UIColor = UIColor(red: 0.769, green: 0.847, blue: 0.984, alpha: 1.000), medium: UIColor = UIColor(red: 0.478, green: 0.663, blue: 0.973, alpha: 1.000), dark: UIColor = UIColor(red: 0.000, green: 0.478, blue: 1.000, alpha: 1.000)) { //// General Declarations let context = UIGraphicsGetCurrentContext()! //// Resize to Target Frame context.saveGState() let resizedFrame: CGRect = resizing.apply(rect: CGRect(x: 0, y: 0, width: 1000, height: 1000), target: targetFrame) context.translateBy(x: resizedFrame.minX, y: resizedFrame.minY) context.scaleBy(x: resizedFrame.width / 1000, y: resizedFrame.height / 1000) //// Group 2 //// Oval Drawing let ovalPath = UIBezierPath(ovalIn: CGRect(x: 262.95, y: 641.95, width: 28.1, height: 28)) light.setFill() ovalPath.fill() //// Rectangle Drawing context.saveGState() context.translateBy(x: 488.5, y: 445.5) context.rotate(by: -45 * CGFloat.pi/180) let rectanglePath = UIBezierPath(rect: CGRect(x: -21.62, y: -14.43, width: 43.25, height: 28.85)) white.setFill() rectanglePath.fill() context.restoreGState() //// Rectangle 2 Drawing context.saveGState() context.translateBy(x: 458.5, y: 475.5) context.rotate(by: -45 * CGFloat.pi/180) let rectangle2Path = UIBezierPath(rect: CGRect(x: -21.65, y: -14.43, width: 43.3, height: 28.85)) light.setFill() rectangle2Path.fill() context.restoreGState() //// Bezier Drawing let bezierPath = UIBezierPath() bezierPath.move(to: CGPoint(x: 287.25, y: 665.77)) bezierPath.addCurve(to: CGPoint(x: 287.25, y: 645.77), controlPoint1: CGPoint(x: 292.75, y: 660.27), controlPoint2: CGPoint(x: 292.75, y: 651.28)) bezierPath.addCurve(to: CGPoint(x: 267.26, y: 645.77), controlPoint1: CGPoint(x: 281.75, y: 640.28), controlPoint2: CGPoint(x: 272.76, y: 640.28)) bezierPath.addCurve(to: CGPoint(x: 267.26, y: 665.77), controlPoint1: CGPoint(x: 261.76, y: 651.27), controlPoint2: CGPoint(x: 261.76, y: 660.27)) bezierPath.addCurve(to: CGPoint(x: 287.25, y: 665.77), controlPoint1: CGPoint(x: 272.76, y: 671.27), controlPoint2: CGPoint(x: 281.75, y: 671.26)) bezierPath.close() bezierPath.move(to: CGPoint(x: 453.09, y: 499.92)) bezierPath.addLine(to: CGPoint(x: 513.07, y: 439.95)) bezierPath.addLine(to: CGPoint(x: 493.08, y: 419.94)) bezierPath.addLine(to: CGPoint(x: 463.09, y: 449.94)) bezierPath.addLine(to: CGPoint(x: 433.1, y: 479.93)) bezierPath.addLine(to: CGPoint(x: 453.09, y: 499.92)) bezierPath.close() bezierPath.move(to: CGPoint(x: 703, y: 409.94)) bezierPath.addLine(to: CGPoint(x: 573.05, y: 459.94)) bezierPath.addLine(to: CGPoint(x: 297.25, y: 735.75)) bezierPath.addCurve(to: CGPoint(x: 257.26, y: 735.75), controlPoint1: CGPoint(x: 286.25, y: 746.74), controlPoint2: CGPoint(x: 268.26, y: 746.76)) bezierPath.addLine(to: CGPoint(x: 197.28, y: 675.76)) bezierPath.addCurve(to: CGPoint(x: 197.28, y: 635.78), controlPoint1: CGPoint(x: 186.19, y: 664.67), controlPoint2: CGPoint(x: 186.29, y: 646.77)) bezierPath.addLine(to: CGPoint(x: 473.09, y: 359.96)) bezierPath.addLine(to: CGPoint(x: 523.06, y: 230)) bezierPath.addLine(to: CGPoint(x: 703, y: 409.94)) bezierPath.close() bezierPath.usesEvenOddFillRule = true medium.setFill() bezierPath.fill() //// Bezier 2 Drawing let bezier2Path = UIBezierPath() bezier2Path.move(to: CGPoint(x: 493.88, y: 380.03)) bezier2Path.addLine(to: CGPoint(x: 544, y: 250)) bezier2Path.addLine(to: CGPoint(x: 523.94, y: 230)) bezier2Path.addLine(to: CGPoint(x: 473.84, y: 360.03)) bezier2Path.addLine(to: CGPoint(x: 197.3, y: 635.98)) bezier2Path.addCurve(to: CGPoint(x: 197.3, y: 675.98), controlPoint1: CGPoint(x: 186.28, y: 646.98), controlPoint2: CGPoint(x: 186.18, y: 664.89)) bezier2Path.addLine(to: CGPoint(x: 217.35, y: 696)) bezier2Path.addCurve(to: CGPoint(x: 217.35, y: 655.98), controlPoint1: CGPoint(x: 206.22, y: 684.9), controlPoint2: CGPoint(x: 206.33, y: 666.98)) bezier2Path.addLine(to: CGPoint(x: 493.88, y: 380.03)) bezier2Path.close() bezier2Path.usesEvenOddFillRule = true light.setFill() bezier2Path.fill() //// Bezier 3 Drawing let bezier3Path = UIBezierPath() bezier3Path.move(to: CGPoint(x: 829, y: 335)) bezier3Path.addLine(to: CGPoint(x: 809, y: 355)) bezier3Path.addLine(to: CGPoint(x: 579, y: 125)) bezier3Path.addLine(to: CGPoint(x: 599.01, y: 105)) bezier3Path.addLine(to: CGPoint(x: 829, y: 335)) bezier3Path.close() bezier3Path.usesEvenOddFillRule = true white.setFill() bezier3Path.fill() //// Bezier 4 Drawing let bezier4Path = UIBezierPath() bezier4Path.move(to: CGPoint(x: 794, y: 360.01)) bezier4Path.addCurve(to: CGPoint(x: 716, y: 402), controlPoint1: CGPoint(x: 771.89, y: 382.1), controlPoint2: CGPoint(x: 744.71, y: 396.09)) bezier4Path.addLine(to: CGPoint(x: 704, y: 410)) bezier4Path.addLine(to: CGPoint(x: 524, y: 230)) bezier4Path.addLine(to: CGPoint(x: 531.91, y: 217.91)) bezier4Path.addCurve(to: CGPoint(x: 574.01, y: 140), controlPoint1: CGPoint(x: 537.92, y: 189.31), controlPoint2: CGPoint(x: 551.91, y: 162.1)) bezier4Path.addLine(to: CGPoint(x: 584.01, y: 130)) bezier4Path.addLine(to: CGPoint(x: 804, y: 350.01)) bezier4Path.addLine(to: CGPoint(x: 794, y: 360.01)) bezier4Path.close() bezier4Path.usesEvenOddFillRule = true light.setFill() bezier4Path.fill() //// Bezier 5 Drawing let bezier5Path = UIBezierPath() bezier5Path.move(to: CGPoint(x: 593, y: 160.02)) bezier5Path.addLine(to: CGPoint(x: 573.02, y: 140)) bezier5Path.addCurve(to: CGPoint(x: 531, y: 217.98), controlPoint1: CGPoint(x: 550.96, y: 162.12), controlPoint2: CGPoint(x: 537, y: 189.35)) bezier5Path.addLine(to: CGPoint(x: 550.96, y: 238)) bezier5Path.addCurve(to: CGPoint(x: 593, y: 160.02), controlPoint1: CGPoint(x: 556.96, y: 209.37), controlPoint2: CGPoint(x: 570.93, y: 182.15)) bezier5Path.close() bezier5Path.usesEvenOddFillRule = true white.setFill() bezier5Path.fill() //// Bezier 6 Drawing let bezier6Path = UIBezierPath() bezier6Path.move(to: CGPoint(x: 773.93, y: 339.38)) bezier6Path.addLine(to: CGPoint(x: 793.97, y: 359.36)) bezier6Path.addCurve(to: CGPoint(x: 715.96, y: 401.4), controlPoint1: CGPoint(x: 771.83, y: 381.43), controlPoint2: CGPoint(x: 744.61, y: 395.4)) bezier6Path.addLine(to: CGPoint(x: 695.93, y: 381.43)) bezier6Path.addCurve(to: CGPoint(x: 773.93, y: 339.38), controlPoint1: CGPoint(x: 724.58, y: 375.43), controlPoint2: CGPoint(x: 751.81, y: 361.45)) bezier6Path.close() bezier6Path.usesEvenOddFillRule = true medium.setFill() bezier6Path.fill() //// Bezier 7 Drawing let bezier7Path = UIBezierPath() bezier7Path.move(to: CGPoint(x: 834.02, y: 319.4)) bezier7Path.addLine(to: CGPoint(x: 824.01, y: 329.39)) bezier7Path.addLine(to: CGPoint(x: 603.71, y: 109.63)) bezier7Path.addLine(to: CGPoint(x: 613.73, y: 99.64)) bezier7Path.addCurve(to: CGPoint(x: 834.02, y: 99.64), controlPoint1: CGPoint(x: 674.3, y: 39.2), controlPoint2: CGPoint(x: 773.44, y: 39.2)) bezier7Path.addCurve(to: CGPoint(x: 879.5, y: 209.5), controlPoint1: CGPoint(x: 864.27, y: 129.81), controlPoint2: CGPoint(x: 879.5, y: 169.76)) bezier7Path.addCurve(to: CGPoint(x: 834.02, y: 319.4), controlPoint1: CGPoint(x: 879.5, y: 249.28), controlPoint2: CGPoint(x: 864.27, y: 289.23)) bezier7Path.close() bezier7Path.usesEvenOddFillRule = true light.setFill() bezier7Path.fill() //// Bezier 8 Drawing let bezier8Path = UIBezierPath() bezier8Path.move(to: CGPoint(x: 843.53, y: 110.12)) bezier8Path.addCurve(to: CGPoint(x: 834.02, y: 99.64), controlPoint1: CGPoint(x: 840.53, y: 106.52), controlPoint2: CGPoint(x: 837.4, y: 103)) bezier8Path.addCurve(to: CGPoint(x: 613.73, y: 99.64), controlPoint1: CGPoint(x: 773.44, y: 39.2), controlPoint2: CGPoint(x: 674.3, y: 39.2)) bezier8Path.addLine(to: CGPoint(x: 633.75, y: 119.61)) bezier8Path.addCurve(to: CGPoint(x: 843.53, y: 110.12), controlPoint1: CGPoint(x: 690.95, y: 62.54), controlPoint2: CGPoint(x: 782.48, y: 59.44)) bezier8Path.close() bezier8Path.usesEvenOddFillRule = true white.setFill() bezier8Path.fill() //// Bezier 9 Drawing let bezier9Path = UIBezierPath() bezier9Path.move(to: CGPoint(x: 823.5, y: 90.16)) bezier9Path.addCurve(to: CGPoint(x: 834.02, y: 99.64), controlPoint1: CGPoint(x: 827.11, y: 93.15), controlPoint2: CGPoint(x: 830.65, y: 96.27)) bezier9Path.addCurve(to: CGPoint(x: 834.02, y: 319.39), controlPoint1: CGPoint(x: 894.61, y: 160.06), controlPoint2: CGPoint(x: 894.61, y: 258.95)) bezier9Path.addLine(to: CGPoint(x: 813.99, y: 299.41)) bezier9Path.addCurve(to: CGPoint(x: 823.5, y: 90.16), controlPoint1: CGPoint(x: 871.2, y: 242.35), controlPoint2: CGPoint(x: 874.31, y: 151.05)) bezier9Path.close() bezier9Path.usesEvenOddFillRule = true medium.setFill() bezier9Path.fill() //// Oval 2 Drawing let oval2Path = UIBezierPath(ovalIn: CGRect(x: 546.95, y: 173.05, width: 14, height: 13.9)) dark.setFill() oval2Path.fill() //// Oval 3 Drawing let oval3Path = UIBezierPath(ovalIn: CGRect(x: 546.95, y: 213.05, width: 14, height: 13.9)) dark.setFill() oval3Path.fill() //// Oval 4 Drawing let oval4Path = UIBezierPath(ovalIn: CGRect(x: 586.95, y: 173.05, width: 14, height: 13.9)) dark.setFill() oval4Path.fill() //// Oval 5 Drawing let oval5Path = UIBezierPath(ovalIn: CGRect(x: 586.95, y: 213.05, width: 14, height: 13.9)) dark.setFill() oval5Path.fill() //// Oval 6 Drawing let oval6Path = UIBezierPath(ovalIn: CGRect(x: 586.95, y: 253.05, width: 14, height: 13.9)) dark.setFill() oval6Path.fill() //// Oval 7 Drawing let oval7Path = UIBezierPath(ovalIn: CGRect(x: 627.95, y: 93.05, width: 14, height: 13.9)) dark.setFill() oval7Path.fill() //// Oval 8 Drawing let oval8Path = UIBezierPath(ovalIn: CGRect(x: 627.95, y: 213.05, width: 14, height: 13.9)) dark.setFill() oval8Path.fill() //// Oval 9 Drawing let oval9Path = UIBezierPath(ovalIn: CGRect(x: 627.95, y: 253.05, width: 14, height: 13.9)) dark.setFill() oval9Path.fill() //// Oval 10 Drawing let oval10Path = UIBezierPath(ovalIn: CGRect(x: 627.95, y: 293.05, width: 14, height: 13.9)) dark.setFill() oval10Path.fill() //// Oval 11 Drawing let oval11Path = UIBezierPath(ovalIn: CGRect(x: 667.95, y: 93.05, width: 14, height: 13.9)) dark.setFill() oval11Path.fill() //// Oval 12 Drawing let oval12Path = UIBezierPath(ovalIn: CGRect(x: 667.95, y: 133.05, width: 14, height: 13.9)) dark.setFill() oval12Path.fill() //// Oval 13 Drawing let oval13Path = UIBezierPath(ovalIn: CGRect(x: 667.95, y: 253.05, width: 14, height: 13.9)) dark.setFill() oval13Path.fill() //// Oval 14 Drawing let oval14Path = UIBezierPath(ovalIn: CGRect(x: 667.95, y: 293.05, width: 14, height: 13.9)) dark.setFill() oval14Path.fill() //// Oval 15 Drawing let oval15Path = UIBezierPath(ovalIn: CGRect(x: 667.95, y: 333.05, width: 14, height: 13.9)) dark.setFill() oval15Path.fill() //// Oval 16 Drawing let oval16Path = UIBezierPath(ovalIn: CGRect(x: 706.95, y: 52.05, width: 14, height: 13.9)) dark.setFill() oval16Path.fill() //// Oval 17 Drawing let oval17Path = UIBezierPath(ovalIn: CGRect(x: 706.95, y: 93.05, width: 14, height: 13.9)) dark.setFill() oval17Path.fill() //// Oval 18 Drawing let oval18Path = UIBezierPath(ovalIn: CGRect(x: 706.95, y: 133.05, width: 14, height: 13.9)) dark.setFill() oval18Path.fill() //// Oval 19 Drawing let oval19Path = UIBezierPath(ovalIn: CGRect(x: 706.95, y: 173.05, width: 14, height: 13.9)) dark.setFill() oval19Path.fill() //// Oval 20 Drawing let oval20Path = UIBezierPath(ovalIn: CGRect(x: 706.95, y: 293.05, width: 14, height: 13.9)) dark.setFill() oval20Path.fill() //// Oval 21 Drawing let oval21Path = UIBezierPath(ovalIn: CGRect(x: 706.95, y: 333.05, width: 14, height: 13.9)) dark.setFill() oval21Path.fill() //// Oval 22 Drawing let oval22Path = UIBezierPath(ovalIn: CGRect(x: 706.95, y: 373.05, width: 14, height: 13.9)) dark.setFill() oval22Path.fill() //// Oval 23 Drawing let oval23Path = UIBezierPath(ovalIn: CGRect(x: 746.95, y: 52.05, width: 14, height: 13.9)) dark.setFill() oval23Path.fill() //// Oval 24 Drawing let oval24Path = UIBezierPath(ovalIn: CGRect(x: 746.95, y: 93.05, width: 14, height: 13.9)) dark.setFill() oval24Path.fill() //// Oval 25 Drawing let oval25Path = UIBezierPath(ovalIn: CGRect(x: 746.95, y: 133.05, width: 14, height: 13.9)) dark.setFill() oval25Path.fill() //// Oval 26 Drawing let oval26Path = UIBezierPath(ovalIn: CGRect(x: 746.95, y: 173.05, width: 14, height: 13.9)) dark.setFill() oval26Path.fill() //// Oval 27 Drawing let oval27Path = UIBezierPath(ovalIn: CGRect(x: 746.95, y: 213.05, width: 14, height: 13.9)) dark.setFill() oval27Path.fill() //// Oval 28 Drawing let oval28Path = UIBezierPath(ovalIn: CGRect(x: 746.95, y: 333.05, width: 14, height: 13.9)) dark.setFill() oval28Path.fill() //// Oval 29 Drawing let oval29Path = UIBezierPath(ovalIn: CGRect(x: 746.95, y: 373.05, width: 14, height: 13.9)) dark.setFill() oval29Path.fill() //// Oval 30 Drawing let oval30Path = UIBezierPath(ovalIn: CGRect(x: 786.95, y: 93.05, width: 14, height: 13.9)) dark.setFill() oval30Path.fill() //// Oval 31 Drawing let oval31Path = UIBezierPath(ovalIn: CGRect(x: 786.95, y: 133.05, width: 14, height: 13.9)) dark.setFill() oval31Path.fill() //// Oval 32 Drawing let oval32Path = UIBezierPath(ovalIn: CGRect(x: 786.95, y: 173.05, width: 14, height: 13.9)) dark.setFill() oval32Path.fill() //// Oval 33 Drawing let oval33Path = UIBezierPath(ovalIn: CGRect(x: 786.95, y: 213.05, width: 14, height: 13.9)) dark.setFill() oval33Path.fill() //// Oval 34 Drawing let oval34Path = UIBezierPath(ovalIn: CGRect(x: 786.95, y: 253.05, width: 14, height: 13.9)) dark.setFill() oval34Path.fill() //// Oval 35 Drawing let oval35Path = UIBezierPath(ovalIn: CGRect(x: 826.95, y: 133.05, width: 14, height: 13.9)) dark.setFill() oval35Path.fill() //// Oval 36 Drawing let oval36Path = UIBezierPath(ovalIn: CGRect(x: 826.95, y: 173.05, width: 14, height: 13.9)) dark.setFill() oval36Path.fill() //// Oval 37 Drawing let oval37Path = UIBezierPath(ovalIn: CGRect(x: 826.95, y: 213.05, width: 14, height: 13.9)) dark.setFill() oval37Path.fill() //// Oval 38 Drawing let oval38Path = UIBezierPath(ovalIn: CGRect(x: 826.95, y: 253.05, width: 14, height: 13.9)) dark.setFill() oval38Path.fill() //// Oval 39 Drawing let oval39Path = UIBezierPath(ovalIn: CGRect(x: 826.95, y: 293.05, width: 14, height: 13.9)) dark.setFill() oval39Path.fill() //// Oval 40 Drawing let oval40Path = UIBezierPath(ovalIn: CGRect(x: 867.95, y: 173.05, width: 14, height: 13.9)) dark.setFill() oval40Path.fill() //// Oval 41 Drawing let oval41Path = UIBezierPath(ovalIn: CGRect(x: 867.95, y: 213.05, width: 14, height: 13.9)) dark.setFill() oval41Path.fill() //// Rectangle 3 Drawing context.saveGState() context.translateBy(x: 206, y: 728) context.rotate(by: -45 * CGFloat.pi/180) let rectangle3Path = UIBezierPath(rect: CGRect(x: -31.12, y: -14.12, width: 62.25, height: 28.25)) medium.setFill() rectangle3Path.fill() context.restoreGState() //// Bezier 10 Drawing let bezier10Path = UIBezierPath() bezier10Path.move(to: CGPoint(x: 531.91, y: 218)) bezier10Path.addLine(to: CGPoint(x: 524, y: 230.09)) bezier10Path.addLine(to: CGPoint(x: 704, y: 410)) bezier10Path.addLine(to: CGPoint(x: 716, y: 402.01)) bezier10Path.addLine(to: CGPoint(x: 531.91, y: 218)) bezier10Path.close() bezier10Path.usesEvenOddFillRule = true medium.setFill() bezier10Path.fill() //// Bezier 11 Drawing let bezier11Path = UIBezierPath() bezier11Path.move(to: CGPoint(x: 574, y: 139)) bezier11Path.addLine(to: CGPoint(x: 584, y: 129)) bezier11Path.addLine(to: CGPoint(x: 804, y: 349)) bezier11Path.addLine(to: CGPoint(x: 794, y: 359)) bezier11Path.addLine(to: CGPoint(x: 574, y: 139)) bezier11Path.close() bezier11Path.usesEvenOddFillRule = true medium.setFill() bezier11Path.fill() //// Bezier 12 Drawing let bezier12Path = UIBezierPath() bezier12Path.move(to: CGPoint(x: 604, y: 109)) bezier12Path.addLine(to: CGPoint(x: 614, y: 99)) bezier12Path.addLine(to: CGPoint(x: 834, y: 319)) bezier12Path.addLine(to: CGPoint(x: 824, y: 329)) bezier12Path.addLine(to: CGPoint(x: 604, y: 109)) bezier12Path.close() bezier12Path.usesEvenOddFillRule = true medium.setFill() bezier12Path.fill() //// Bezier 13 Drawing let bezier13Path = UIBezierPath() bezier13Path.move(to: CGPoint(x: 716.04, y: 410)) bezier13Path.addCurve(to: CGPoint(x: 709.15, y: 404.27), controlPoint1: CGPoint(x: 712.76, y: 410), controlPoint2: CGPoint(x: 709.84, y: 407.66)) bezier13Path.addCurve(to: CGPoint(x: 714.64, y: 395.8), controlPoint1: CGPoint(x: 708.35, y: 400.38), controlPoint2: CGPoint(x: 710.82, y: 396.6)) bezier13Path.addCurve(to: CGPoint(x: 788.95, y: 355.1), controlPoint1: CGPoint(x: 742.88, y: 389.88), controlPoint2: CGPoint(x: 768.58, y: 375.8)) bezier13Path.addCurve(to: CGPoint(x: 798.93, y: 355.1), controlPoint1: CGPoint(x: 791.71, y: 352.3), controlPoint2: CGPoint(x: 796.17, y: 352.3)) bezier13Path.addCurve(to: CGPoint(x: 798.93, y: 365.25), controlPoint1: CGPoint(x: 801.69, y: 357.91), controlPoint2: CGPoint(x: 801.69, y: 362.45)) bezier13Path.addCurve(to: CGPoint(x: 717.48, y: 409.84), controlPoint1: CGPoint(x: 776.61, y: 387.94), controlPoint2: CGPoint(x: 748.45, y: 403.37)) bezier13Path.addCurve(to: CGPoint(x: 716.04, y: 410), controlPoint1: CGPoint(x: 717.01, y: 409.96), controlPoint2: CGPoint(x: 716.51, y: 410)) bezier13Path.close() bezier13Path.usesEvenOddFillRule = true dark.setFill() bezier13Path.fill() //// Bezier 14 Drawing let bezier14Path = UIBezierPath() bezier14Path.move(to: CGPoint(x: 833.62, y: 326)) bezier14Path.addCurve(to: CGPoint(x: 828.63, y: 323.93), controlPoint1: CGPoint(x: 831.82, y: 326), controlPoint2: CGPoint(x: 830.01, y: 325.31)) bezier14Path.addCurve(to: CGPoint(x: 828.63, y: 313.95), controlPoint1: CGPoint(x: 825.87, y: 321.18), controlPoint2: CGPoint(x: 825.87, y: 316.71)) bezier14Path.addCurve(to: CGPoint(x: 871.89, y: 209.13), controlPoint1: CGPoint(x: 856.52, y: 286.05), controlPoint2: CGPoint(x: 871.89, y: 248.83)) bezier14Path.addCurve(to: CGPoint(x: 828.63, y: 104.34), controlPoint1: CGPoint(x: 871.89, y: 169.45), controlPoint2: CGPoint(x: 856.52, y: 132.24)) bezier14Path.addCurve(to: CGPoint(x: 723.83, y: 61.12), controlPoint1: CGPoint(x: 800.76, y: 76.47), controlPoint2: CGPoint(x: 763.54, y: 61.12)) bezier14Path.addCurve(to: CGPoint(x: 619.05, y: 104.34), controlPoint1: CGPoint(x: 684.13, y: 61.12), controlPoint2: CGPoint(x: 646.92, y: 76.47)) bezier14Path.addCurve(to: CGPoint(x: 609.07, y: 104.34), controlPoint1: CGPoint(x: 616.29, y: 107.1), controlPoint2: CGPoint(x: 611.82, y: 107.1)) bezier14Path.addCurve(to: CGPoint(x: 609.07, y: 94.36), controlPoint1: CGPoint(x: 606.31, y: 101.59), controlPoint2: CGPoint(x: 606.31, y: 97.12)) bezier14Path.addCurve(to: CGPoint(x: 723.83, y: 47), controlPoint1: CGPoint(x: 639.6, y: 63.82), controlPoint2: CGPoint(x: 680.36, y: 47)) bezier14Path.addCurve(to: CGPoint(x: 838.61, y: 94.36), controlPoint1: CGPoint(x: 767.31, y: 47), controlPoint2: CGPoint(x: 808.08, y: 63.82)) bezier14Path.addCurve(to: CGPoint(x: 886, y: 209.13), controlPoint1: CGPoint(x: 869.17, y: 124.92), controlPoint2: CGPoint(x: 886, y: 165.69)) bezier14Path.addCurve(to: CGPoint(x: 838.61, y: 323.93), controlPoint1: CGPoint(x: 886, y: 252.6), controlPoint2: CGPoint(x: 869.17, y: 293.37)) bezier14Path.addCurve(to: CGPoint(x: 833.62, y: 326), controlPoint1: CGPoint(x: 837.23, y: 325.31), controlPoint2: CGPoint(x: 835.43, y: 326)) bezier14Path.close() bezier14Path.usesEvenOddFillRule = true dark.setFill() bezier14Path.fill() //// Bezier 15 Drawing let bezier15Path = UIBezierPath() bezier15Path.move(to: CGPoint(x: 531.18, y: 224)) bezier15Path.addCurve(to: CGPoint(x: 529.7, y: 223.85), controlPoint1: CGPoint(x: 530.68, y: 224), controlPoint2: CGPoint(x: 530.2, y: 223.96)) bezier15Path.addCurve(to: CGPoint(x: 524.15, y: 215.48), controlPoint1: CGPoint(x: 525.82, y: 223.05), controlPoint2: CGPoint(x: 523.34, y: 219.31)) bezier15Path.addCurve(to: CGPoint(x: 568.77, y: 134.07), controlPoint1: CGPoint(x: 530.75, y: 184.51), controlPoint2: CGPoint(x: 546.17, y: 156.35)) bezier15Path.addCurve(to: CGPoint(x: 578.9, y: 134.07), controlPoint1: CGPoint(x: 571.57, y: 131.31), controlPoint2: CGPoint(x: 576.1, y: 131.31)) bezier15Path.addCurve(to: CGPoint(x: 578.9, y: 144.06), controlPoint1: CGPoint(x: 581.7, y: 136.83), controlPoint2: CGPoint(x: 581.7, y: 141.3)) bezier15Path.addCurve(to: CGPoint(x: 538.18, y: 218.38), controlPoint1: CGPoint(x: 558.28, y: 164.4), controlPoint2: CGPoint(x: 544.2, y: 190.1)) bezier15Path.addCurve(to: CGPoint(x: 531.18, y: 224), controlPoint1: CGPoint(x: 537.48, y: 221.71), controlPoint2: CGPoint(x: 534.48, y: 224)) bezier15Path.close() bezier15Path.usesEvenOddFillRule = true dark.setFill() bezier15Path.fill() //// Bezier 16 Drawing let bezier16Path = UIBezierPath() bezier16Path.move(to: CGPoint(x: 703.93, y: 417)) bezier16Path.addCurve(to: CGPoint(x: 698.94, y: 414.93), controlPoint1: CGPoint(x: 702.13, y: 417), controlPoint2: CGPoint(x: 700.32, y: 416.31)) bezier16Path.addLine(to: CGPoint(x: 519.07, y: 235.06)) bezier16Path.addCurve(to: CGPoint(x: 519.07, y: 225.07), controlPoint1: CGPoint(x: 516.31, y: 232.3), controlPoint2: CGPoint(x: 516.31, y: 227.83)) bezier16Path.addCurve(to: CGPoint(x: 529.06, y: 225.07), controlPoint1: CGPoint(x: 521.83, y: 222.31), controlPoint2: CGPoint(x: 526.3, y: 222.31)) bezier16Path.addLine(to: CGPoint(x: 708.93, y: 404.94)) bezier16Path.addCurve(to: CGPoint(x: 708.93, y: 414.93), controlPoint1: CGPoint(x: 711.69, y: 407.7), controlPoint2: CGPoint(x: 711.69, y: 412.17)) bezier16Path.addCurve(to: CGPoint(x: 703.93, y: 417), controlPoint1: CGPoint(x: 707.55, y: 416.31), controlPoint2: CGPoint(x: 705.74, y: 417)) bezier16Path.close() bezier16Path.usesEvenOddFillRule = true dark.setFill() bezier16Path.fill() //// Bezier 17 Drawing let bezier17Path = UIBezierPath() bezier17Path.move(to: CGPoint(x: 653.94, y: 407)) bezier17Path.addCurve(to: CGPoint(x: 648.94, y: 404.93), controlPoint1: CGPoint(x: 652.12, y: 407), controlPoint2: CGPoint(x: 650.32, y: 406.31)) bezier17Path.addLine(to: CGPoint(x: 529.07, y: 285.06)) bezier17Path.addCurve(to: CGPoint(x: 529.07, y: 275.07), controlPoint1: CGPoint(x: 526.31, y: 282.3), controlPoint2: CGPoint(x: 526.31, y: 277.83)) bezier17Path.addCurve(to: CGPoint(x: 539.06, y: 275.07), controlPoint1: CGPoint(x: 531.83, y: 272.31), controlPoint2: CGPoint(x: 536.3, y: 272.31)) bezier17Path.addLine(to: CGPoint(x: 658.93, y: 394.94)) bezier17Path.addCurve(to: CGPoint(x: 658.93, y: 404.93), controlPoint1: CGPoint(x: 661.69, y: 397.7), controlPoint2: CGPoint(x: 661.69, y: 402.17)) bezier17Path.addCurve(to: CGPoint(x: 653.94, y: 407), controlPoint1: CGPoint(x: 657.55, y: 406.31), controlPoint2: CGPoint(x: 655.73, y: 407)) bezier17Path.close() bezier17Path.usesEvenOddFillRule = true dark.setFill() bezier17Path.fill() //// Bezier 18 Drawing let bezier18Path = UIBezierPath() bezier18Path.move(to: CGPoint(x: 473.06, y: 367)) bezier18Path.addCurve(to: CGPoint(x: 470.52, y: 366.53), controlPoint1: CGPoint(x: 472.22, y: 367), controlPoint2: CGPoint(x: 471.36, y: 366.85)) bezier18Path.addCurve(to: CGPoint(x: 466.47, y: 357.4), controlPoint1: CGPoint(x: 466.89, y: 365.12), controlPoint2: CGPoint(x: 465.07, y: 361.04)) bezier18Path.addLine(to: CGPoint(x: 516.35, y: 227.53)) bezier18Path.addCurve(to: CGPoint(x: 525.47, y: 223.47), controlPoint1: CGPoint(x: 517.76, y: 223.9), controlPoint2: CGPoint(x: 521.83, y: 222.07)) bezier18Path.addCurve(to: CGPoint(x: 529.52, y: 232.61), controlPoint1: CGPoint(x: 529.11, y: 224.88), controlPoint2: CGPoint(x: 530.93, y: 228.96)) bezier18Path.addLine(to: CGPoint(x: 479.65, y: 362.47)) bezier18Path.addCurve(to: CGPoint(x: 473.06, y: 367), controlPoint1: CGPoint(x: 478.56, y: 365.28), controlPoint2: CGPoint(x: 475.89, y: 367)) bezier18Path.close() bezier18Path.usesEvenOddFillRule = true dark.setFill() bezier18Path.fill() //// Bezier 19 Drawing let bezier19Path = UIBezierPath() bezier19Path.move(to: CGPoint(x: 574.06, y: 467)) bezier19Path.addCurve(to: CGPoint(x: 567.47, y: 462.48), controlPoint1: CGPoint(x: 571.23, y: 467), controlPoint2: CGPoint(x: 568.56, y: 465.28)) bezier19Path.addCurve(to: CGPoint(x: 571.53, y: 453.36), controlPoint1: CGPoint(x: 566.08, y: 458.84), controlPoint2: CGPoint(x: 567.9, y: 454.76)) bezier19Path.addLine(to: CGPoint(x: 701.39, y: 403.46)) bezier19Path.addCurve(to: CGPoint(x: 710.52, y: 407.52), controlPoint1: CGPoint(x: 705.03, y: 402.09), controlPoint2: CGPoint(x: 709.12, y: 403.88)) bezier19Path.addCurve(to: CGPoint(x: 706.47, y: 416.64), controlPoint1: CGPoint(x: 711.93, y: 411.15), controlPoint2: CGPoint(x: 710.11, y: 415.23)) bezier19Path.addLine(to: CGPoint(x: 576.6, y: 466.53)) bezier19Path.addCurve(to: CGPoint(x: 574.06, y: 467), controlPoint1: CGPoint(x: 575.76, y: 466.85), controlPoint2: CGPoint(x: 574.91, y: 467)) bezier19Path.close() bezier19Path.usesEvenOddFillRule = true dark.setFill() bezier19Path.fill() //// Bezier 20 Drawing let bezier20Path = UIBezierPath() bezier20Path.move(to: CGPoint(x: 197.09, y: 644)) bezier20Path.addCurve(to: CGPoint(x: 192.08, y: 641.92), controlPoint1: CGPoint(x: 195.28, y: 644), controlPoint2: CGPoint(x: 193.46, y: 643.31)) bezier20Path.addCurve(to: CGPoint(x: 192.08, y: 631.89), controlPoint1: CGPoint(x: 189.31, y: 639.15), controlPoint2: CGPoint(x: 189.31, y: 634.66)) bezier20Path.addLine(to: CGPoint(x: 468.89, y: 355.08)) bezier20Path.addCurve(to: CGPoint(x: 478.92, y: 355.08), controlPoint1: CGPoint(x: 471.66, y: 352.31), controlPoint2: CGPoint(x: 476.15, y: 352.31)) bezier20Path.addCurve(to: CGPoint(x: 478.92, y: 365.11), controlPoint1: CGPoint(x: 481.69, y: 357.85), controlPoint2: CGPoint(x: 481.69, y: 362.34)) bezier20Path.addLine(to: CGPoint(x: 202.11, y: 641.92)) bezier20Path.addCurve(to: CGPoint(x: 197.09, y: 644), controlPoint1: CGPoint(x: 200.72, y: 643.31), controlPoint2: CGPoint(x: 198.91, y: 644)) bezier20Path.close() bezier20Path.usesEvenOddFillRule = true dark.setFill() bezier20Path.fill() //// Bezier 21 Drawing let bezier21Path = UIBezierPath() bezier21Path.move(to: CGPoint(x: 297.09, y: 744)) bezier21Path.addCurve(to: CGPoint(x: 292.08, y: 741.92), controlPoint1: CGPoint(x: 295.28, y: 744), controlPoint2: CGPoint(x: 293.46, y: 743.31)) bezier21Path.addCurve(to: CGPoint(x: 292.08, y: 731.89), controlPoint1: CGPoint(x: 289.31, y: 739.15), controlPoint2: CGPoint(x: 289.31, y: 734.66)) bezier21Path.addLine(to: CGPoint(x: 568.89, y: 455.08)) bezier21Path.addCurve(to: CGPoint(x: 578.92, y: 455.08), controlPoint1: CGPoint(x: 571.66, y: 452.31), controlPoint2: CGPoint(x: 576.15, y: 452.31)) bezier21Path.addCurve(to: CGPoint(x: 578.92, y: 465.11), controlPoint1: CGPoint(x: 581.69, y: 457.85), controlPoint2: CGPoint(x: 581.69, y: 462.34)) bezier21Path.addLine(to: CGPoint(x: 302.11, y: 741.92)) bezier21Path.addCurve(to: CGPoint(x: 297.09, y: 744), controlPoint1: CGPoint(x: 300.72, y: 743.31), controlPoint2: CGPoint(x: 298.91, y: 744)) bezier21Path.close() bezier21Path.usesEvenOddFillRule = true dark.setFill() bezier21Path.fill() //// Bezier 22 Drawing let bezier22Path = UIBezierPath() bezier22Path.move(to: CGPoint(x: 828.93, y: 342)) bezier22Path.addCurve(to: CGPoint(x: 823.94, y: 339.93), controlPoint1: CGPoint(x: 827.13, y: 342), controlPoint2: CGPoint(x: 825.32, y: 341.31)) bezier22Path.addLine(to: CGPoint(x: 594.07, y: 110.06)) bezier22Path.addCurve(to: CGPoint(x: 594.07, y: 100.07), controlPoint1: CGPoint(x: 591.31, y: 107.3), controlPoint2: CGPoint(x: 591.31, y: 102.83)) bezier22Path.addCurve(to: CGPoint(x: 604.06, y: 100.07), controlPoint1: CGPoint(x: 596.83, y: 97.31), controlPoint2: CGPoint(x: 601.3, y: 97.31)) bezier22Path.addLine(to: CGPoint(x: 833.93, y: 329.94)) bezier22Path.addCurve(to: CGPoint(x: 833.93, y: 339.93), controlPoint1: CGPoint(x: 836.69, y: 332.7), controlPoint2: CGPoint(x: 836.69, y: 337.17)) bezier22Path.addCurve(to: CGPoint(x: 828.93, y: 342), controlPoint1: CGPoint(x: 832.55, y: 341.31), controlPoint2: CGPoint(x: 830.74, y: 342)) bezier22Path.close() bezier22Path.usesEvenOddFillRule = true dark.setFill() bezier22Path.fill() //// Bezier 23 Drawing let bezier23Path = UIBezierPath() bezier23Path.move(to: CGPoint(x: 808.93, y: 362)) bezier23Path.addCurve(to: CGPoint(x: 803.94, y: 359.93), controlPoint1: CGPoint(x: 807.13, y: 362), controlPoint2: CGPoint(x: 805.32, y: 361.31)) bezier23Path.addLine(to: CGPoint(x: 574.07, y: 130.06)) bezier23Path.addCurve(to: CGPoint(x: 574.07, y: 120.07), controlPoint1: CGPoint(x: 571.31, y: 127.3), controlPoint2: CGPoint(x: 571.31, y: 122.83)) bezier23Path.addCurve(to: CGPoint(x: 584.06, y: 120.07), controlPoint1: CGPoint(x: 576.83, y: 117.31), controlPoint2: CGPoint(x: 581.3, y: 117.31)) bezier23Path.addLine(to: CGPoint(x: 813.93, y: 349.94)) bezier23Path.addCurve(to: CGPoint(x: 813.93, y: 359.93), controlPoint1: CGPoint(x: 816.69, y: 352.7), controlPoint2: CGPoint(x: 816.69, y: 357.17)) bezier23Path.addCurve(to: CGPoint(x: 808.93, y: 362), controlPoint1: CGPoint(x: 812.55, y: 361.31), controlPoint2: CGPoint(x: 810.74, y: 362)) bezier23Path.close() bezier23Path.usesEvenOddFillRule = true dark.setFill() bezier23Path.fill() //// Bezier 24 Drawing let bezier24Path = UIBezierPath() bezier24Path.move(to: CGPoint(x: 579.04, y: 132)) bezier24Path.addCurve(to: CGPoint(x: 574.06, y: 129.94), controlPoint1: CGPoint(x: 577.24, y: 132), controlPoint2: CGPoint(x: 575.44, y: 131.31)) bezier24Path.addCurve(to: CGPoint(x: 574.06, y: 119.98), controlPoint1: CGPoint(x: 571.31, y: 127.19), controlPoint2: CGPoint(x: 571.31, y: 122.73)) bezier24Path.addLine(to: CGPoint(x: 593.98, y: 100.06)) bezier24Path.addCurve(to: CGPoint(x: 603.94, y: 100.06), controlPoint1: CGPoint(x: 596.73, y: 97.31), controlPoint2: CGPoint(x: 601.19, y: 97.31)) bezier24Path.addCurve(to: CGPoint(x: 603.94, y: 110.02), controlPoint1: CGPoint(x: 606.69, y: 102.81), controlPoint2: CGPoint(x: 606.69, y: 107.27)) bezier24Path.addLine(to: CGPoint(x: 584.02, y: 129.94)) bezier24Path.addCurve(to: CGPoint(x: 579.04, y: 132), controlPoint1: CGPoint(x: 582.64, y: 131.31), controlPoint2: CGPoint(x: 580.84, y: 132)) bezier24Path.close() bezier24Path.usesEvenOddFillRule = true dark.setFill() bezier24Path.fill() //// Bezier 25 Drawing let bezier25Path = UIBezierPath() bezier25Path.move(to: CGPoint(x: 808.04, y: 362)) bezier25Path.addCurve(to: CGPoint(x: 803.06, y: 359.94), controlPoint1: CGPoint(x: 806.24, y: 362), controlPoint2: CGPoint(x: 804.44, y: 361.31)) bezier25Path.addCurve(to: CGPoint(x: 803.06, y: 349.98), controlPoint1: CGPoint(x: 800.31, y: 357.19), controlPoint2: CGPoint(x: 800.31, y: 352.73)) bezier25Path.addLine(to: CGPoint(x: 822.98, y: 330.06)) bezier25Path.addCurve(to: CGPoint(x: 832.94, y: 330.06), controlPoint1: CGPoint(x: 825.73, y: 327.31), controlPoint2: CGPoint(x: 830.19, y: 327.31)) bezier25Path.addCurve(to: CGPoint(x: 832.94, y: 340.02), controlPoint1: CGPoint(x: 835.69, y: 332.81), controlPoint2: CGPoint(x: 835.69, y: 337.27)) bezier25Path.addLine(to: CGPoint(x: 813.02, y: 359.94)) bezier25Path.addCurve(to: CGPoint(x: 808.04, y: 362), controlPoint1: CGPoint(x: 811.65, y: 361.31), controlPoint2: CGPoint(x: 809.84, y: 362)) bezier25Path.close() bezier25Path.usesEvenOddFillRule = true dark.setFill() bezier25Path.fill() //// Bezier 26 Drawing let bezier26Path = UIBezierPath() bezier26Path.move(to: CGPoint(x: 197.75, y: 683)) bezier26Path.addCurve(to: CGPoint(x: 192.62, y: 680.89), controlPoint1: CGPoint(x: 195.89, y: 683), controlPoint2: CGPoint(x: 194.04, y: 682.3)) bezier26Path.addCurve(to: CGPoint(x: 182, y: 655.44), controlPoint1: CGPoint(x: 185.76, y: 674.11), controlPoint2: CGPoint(x: 181.99, y: 665.07)) bezier26Path.addCurve(to: CGPoint(x: 192.62, y: 630.1), controlPoint1: CGPoint(x: 182.02, y: 645.88), controlPoint2: CGPoint(x: 185.79, y: 636.87)) bezier26Path.addCurve(to: CGPoint(x: 202.88, y: 630.1), controlPoint1: CGPoint(x: 195.45, y: 627.3), controlPoint2: CGPoint(x: 200.04, y: 627.3)) bezier26Path.addCurve(to: CGPoint(x: 202.88, y: 640.26), controlPoint1: CGPoint(x: 205.71, y: 632.91), controlPoint2: CGPoint(x: 205.71, y: 637.46)) bezier26Path.addCurve(to: CGPoint(x: 196.5, y: 655.47), controlPoint1: CGPoint(x: 198.78, y: 644.32), controlPoint2: CGPoint(x: 196.52, y: 649.72)) bezier26Path.addCurve(to: CGPoint(x: 202.88, y: 670.74), controlPoint1: CGPoint(x: 196.49, y: 661.24), controlPoint2: CGPoint(x: 198.75, y: 666.65)) bezier26Path.addCurve(to: CGPoint(x: 202.88, y: 680.89), controlPoint1: CGPoint(x: 205.71, y: 673.54), controlPoint2: CGPoint(x: 205.71, y: 678.09)) bezier26Path.addCurve(to: CGPoint(x: 197.75, y: 683), controlPoint1: CGPoint(x: 201.46, y: 682.3), controlPoint2: CGPoint(x: 199.6, y: 683)) bezier26Path.close() bezier26Path.usesEvenOddFillRule = true dark.setFill() bezier26Path.fill() //// Bezier 27 Drawing let bezier27Path = UIBezierPath() bezier27Path.move(to: CGPoint(x: 277.5, y: 752)) bezier27Path.addCurve(to: CGPoint(x: 252.1, y: 741.38), controlPoint1: CGPoint(x: 268.29, y: 752), controlPoint2: CGPoint(x: 259.1, y: 748.46)) bezier27Path.addCurve(to: CGPoint(x: 252.1, y: 731.13), controlPoint1: CGPoint(x: 249.3, y: 738.55), controlPoint2: CGPoint(x: 249.3, y: 733.96)) bezier27Path.addCurve(to: CGPoint(x: 262.26, y: 731.13), controlPoint1: CGPoint(x: 254.91, y: 728.29), controlPoint2: CGPoint(x: 259.46, y: 728.29)) bezier27Path.addCurve(to: CGPoint(x: 292.74, y: 731.13), controlPoint1: CGPoint(x: 270.66, y: 739.6), controlPoint2: CGPoint(x: 284.34, y: 739.6)) bezier27Path.addCurve(to: CGPoint(x: 302.9, y: 731.13), controlPoint1: CGPoint(x: 295.55, y: 728.29), controlPoint2: CGPoint(x: 300.09, y: 728.29)) bezier27Path.addCurve(to: CGPoint(x: 302.9, y: 741.38), controlPoint1: CGPoint(x: 305.7, y: 733.96), controlPoint2: CGPoint(x: 305.7, y: 738.55)) bezier27Path.addCurve(to: CGPoint(x: 277.5, y: 752), controlPoint1: CGPoint(x: 295.89, y: 748.46), controlPoint2: CGPoint(x: 286.69, y: 752)) bezier27Path.close() bezier27Path.usesEvenOddFillRule = true dark.setFill() bezier27Path.fill() //// Bezier 28 Drawing let bezier28Path = UIBezierPath() bezier28Path.move(to: CGPoint(x: 256.94, y: 743)) bezier28Path.addCurve(to: CGPoint(x: 251.95, y: 740.93), controlPoint1: CGPoint(x: 255.14, y: 743), controlPoint2: CGPoint(x: 253.33, y: 742.31)) bezier28Path.addLine(to: CGPoint(x: 192.07, y: 681.05)) bezier28Path.addCurve(to: CGPoint(x: 192.07, y: 671.07), controlPoint1: CGPoint(x: 189.31, y: 678.29), controlPoint2: CGPoint(x: 189.31, y: 673.82)) bezier28Path.addCurve(to: CGPoint(x: 202.05, y: 671.07), controlPoint1: CGPoint(x: 194.82, y: 668.31), controlPoint2: CGPoint(x: 199.29, y: 668.31)) bezier28Path.addLine(to: CGPoint(x: 261.93, y: 730.95)) bezier28Path.addCurve(to: CGPoint(x: 261.93, y: 740.93), controlPoint1: CGPoint(x: 264.69, y: 733.71), controlPoint2: CGPoint(x: 264.69, y: 738.18)) bezier28Path.addCurve(to: CGPoint(x: 256.94, y: 743), controlPoint1: CGPoint(x: 260.55, y: 742.31), controlPoint2: CGPoint(x: 258.75, y: 743)) bezier28Path.close() bezier28Path.usesEvenOddFillRule = true dark.setFill() bezier28Path.fill() //// Bezier 29 Drawing let bezier29Path = UIBezierPath() bezier29Path.move(to: CGPoint(x: 277, y: 648.88)) bezier29Path.addCurve(to: CGPoint(x: 272.05, y: 650.91), controlPoint1: CGPoint(x: 275.12, y: 648.88), controlPoint2: CGPoint(x: 273.36, y: 649.59)) bezier29Path.addCurve(to: CGPoint(x: 272.05, y: 660.87), controlPoint1: CGPoint(x: 269.32, y: 653.66), controlPoint2: CGPoint(x: 269.32, y: 658.12)) bezier29Path.addCurve(to: CGPoint(x: 281.96, y: 660.87), controlPoint1: CGPoint(x: 274.67, y: 663.51), controlPoint2: CGPoint(x: 279.33, y: 663.51)) bezier29Path.addCurve(to: CGPoint(x: 281.95, y: 650.91), controlPoint1: CGPoint(x: 284.68, y: 658.12), controlPoint2: CGPoint(x: 284.68, y: 653.66)) bezier29Path.addCurve(to: CGPoint(x: 277, y: 648.88), controlPoint1: CGPoint(x: 280.64, y: 649.59), controlPoint2: CGPoint(x: 278.89, y: 648.88)) bezier29Path.close() bezier29Path.move(to: CGPoint(x: 277, y: 677)) bezier29Path.addCurve(to: CGPoint(x: 262.14, y: 670.82), controlPoint1: CGPoint(x: 271.37, y: 677), controlPoint2: CGPoint(x: 266.1, y: 674.8)) bezier29Path.addCurve(to: CGPoint(x: 262.15, y: 640.96), controlPoint1: CGPoint(x: 253.95, y: 662.59), controlPoint2: CGPoint(x: 253.95, y: 649.19)) bezier29Path.addCurve(to: CGPoint(x: 291.86, y: 640.96), controlPoint1: CGPoint(x: 270.06, y: 633.02), controlPoint2: CGPoint(x: 283.94, y: 633.01)) bezier29Path.addCurve(to: CGPoint(x: 291.86, y: 670.82), controlPoint1: CGPoint(x: 300.05, y: 649.19), controlPoint2: CGPoint(x: 300.05, y: 662.6)) bezier29Path.addCurve(to: CGPoint(x: 277, y: 677), controlPoint1: CGPoint(x: 287.89, y: 674.81), controlPoint2: CGPoint(x: 282.62, y: 677)) bezier29Path.close() bezier29Path.usesEvenOddFillRule = true dark.setFill() bezier29Path.fill() //// Bezier 30 Drawing let bezier30Path = UIBezierPath() bezier30Path.move(to: CGPoint(x: 513.96, y: 447)) bezier30Path.addCurve(to: CGPoint(x: 508.98, y: 444.94), controlPoint1: CGPoint(x: 512.16, y: 447), controlPoint2: CGPoint(x: 510.36, y: 446.31)) bezier30Path.addLine(to: CGPoint(x: 489.06, y: 425.02)) bezier30Path.addCurve(to: CGPoint(x: 489.06, y: 415.06), controlPoint1: CGPoint(x: 486.31, y: 422.27), controlPoint2: CGPoint(x: 486.31, y: 417.81)) bezier30Path.addCurve(to: CGPoint(x: 499.02, y: 415.06), controlPoint1: CGPoint(x: 491.82, y: 412.31), controlPoint2: CGPoint(x: 496.27, y: 412.31)) bezier30Path.addLine(to: CGPoint(x: 518.94, y: 434.98)) bezier30Path.addCurve(to: CGPoint(x: 518.94, y: 444.94), controlPoint1: CGPoint(x: 521.69, y: 437.73), controlPoint2: CGPoint(x: 521.69, y: 442.19)) bezier30Path.addCurve(to: CGPoint(x: 513.96, y: 447), controlPoint1: CGPoint(x: 517.56, y: 446.31), controlPoint2: CGPoint(x: 515.77, y: 447)) bezier30Path.close() bezier30Path.usesEvenOddFillRule = true dark.setFill() bezier30Path.fill() //// Bezier 31 Drawing let bezier31Path = UIBezierPath() bezier31Path.move(to: CGPoint(x: 454.06, y: 507)) bezier31Path.addCurve(to: CGPoint(x: 449.07, y: 504.93), controlPoint1: CGPoint(x: 452.25, y: 507), controlPoint2: CGPoint(x: 450.45, y: 506.31)) bezier31Path.addCurve(to: CGPoint(x: 449.07, y: 494.95), controlPoint1: CGPoint(x: 446.31, y: 502.17), controlPoint2: CGPoint(x: 446.31, y: 497.71)) bezier31Path.addLine(to: CGPoint(x: 508.96, y: 435.07)) bezier31Path.addCurve(to: CGPoint(x: 518.93, y: 435.07), controlPoint1: CGPoint(x: 511.72, y: 432.31), controlPoint2: CGPoint(x: 516.18, y: 432.31)) bezier31Path.addCurve(to: CGPoint(x: 518.93, y: 445.05), controlPoint1: CGPoint(x: 521.69, y: 437.83), controlPoint2: CGPoint(x: 521.69, y: 442.29)) bezier31Path.addLine(to: CGPoint(x: 459.05, y: 504.93)) bezier31Path.addCurve(to: CGPoint(x: 454.06, y: 507), controlPoint1: CGPoint(x: 457.67, y: 506.31), controlPoint2: CGPoint(x: 455.86, y: 507)) bezier31Path.close() bezier31Path.usesEvenOddFillRule = true dark.setFill() bezier31Path.fill() //// Bezier 32 Drawing let bezier32Path = UIBezierPath() bezier32Path.move(to: CGPoint(x: 452.96, y: 507)) bezier32Path.addCurve(to: CGPoint(x: 447.98, y: 504.94), controlPoint1: CGPoint(x: 451.16, y: 507), controlPoint2: CGPoint(x: 449.36, y: 506.31)) bezier32Path.addLine(to: CGPoint(x: 428.06, y: 485.02)) bezier32Path.addCurve(to: CGPoint(x: 428.06, y: 475.06), controlPoint1: CGPoint(x: 425.31, y: 482.27), controlPoint2: CGPoint(x: 425.31, y: 477.81)) bezier32Path.addCurve(to: CGPoint(x: 438.02, y: 475.06), controlPoint1: CGPoint(x: 430.81, y: 472.31), controlPoint2: CGPoint(x: 435.27, y: 472.31)) bezier32Path.addLine(to: CGPoint(x: 457.94, y: 494.98)) bezier32Path.addCurve(to: CGPoint(x: 457.94, y: 504.94), controlPoint1: CGPoint(x: 460.69, y: 497.73), controlPoint2: CGPoint(x: 460.69, y: 502.19)) bezier32Path.addCurve(to: CGPoint(x: 452.96, y: 507), controlPoint1: CGPoint(x: 456.56, y: 506.31), controlPoint2: CGPoint(x: 454.76, y: 507)) bezier32Path.close() bezier32Path.usesEvenOddFillRule = true dark.setFill() bezier32Path.fill() //// Bezier 33 Drawing let bezier33Path = UIBezierPath() bezier33Path.move(to: CGPoint(x: 433.06, y: 487)) bezier33Path.addCurve(to: CGPoint(x: 428.07, y: 484.93), controlPoint1: CGPoint(x: 431.25, y: 487), controlPoint2: CGPoint(x: 429.45, y: 486.31)) bezier33Path.addCurve(to: CGPoint(x: 428.07, y: 474.95), controlPoint1: CGPoint(x: 425.31, y: 482.17), controlPoint2: CGPoint(x: 425.31, y: 477.71)) bezier33Path.addLine(to: CGPoint(x: 487.95, y: 415.07)) bezier33Path.addCurve(to: CGPoint(x: 497.93, y: 415.07), controlPoint1: CGPoint(x: 490.71, y: 412.31), controlPoint2: CGPoint(x: 495.18, y: 412.31)) bezier33Path.addCurve(to: CGPoint(x: 497.93, y: 425.05), controlPoint1: CGPoint(x: 500.69, y: 417.82), controlPoint2: CGPoint(x: 500.69, y: 422.29)) bezier33Path.addLine(to: CGPoint(x: 438.05, y: 484.93)) bezier33Path.addCurve(to: CGPoint(x: 433.06, y: 487), controlPoint1: CGPoint(x: 436.67, y: 486.31), controlPoint2: CGPoint(x: 434.86, y: 487)) bezier33Path.close() bezier33Path.usesEvenOddFillRule = true dark.setFill() bezier33Path.fill() //// Bezier 34 Drawing let bezier34Path = UIBezierPath() bezier34Path.move(to: CGPoint(x: 483.13, y: 477.44)) bezier34Path.addCurve(to: CGPoint(x: 478.13, y: 475.37), controlPoint1: CGPoint(x: 481.32, y: 477.44), controlPoint2: CGPoint(x: 479.51, y: 476.75)) bezier34Path.addLine(to: CGPoint(x: 458.16, y: 455.38)) bezier34Path.addCurve(to: CGPoint(x: 458.16, y: 445.38), controlPoint1: CGPoint(x: 455.4, y: 452.61), controlPoint2: CGPoint(x: 455.4, y: 448.14)) bezier34Path.addCurve(to: CGPoint(x: 468.15, y: 445.38), controlPoint1: CGPoint(x: 460.92, y: 442.61), controlPoint2: CGPoint(x: 465.39, y: 442.61)) bezier34Path.addLine(to: CGPoint(x: 488.12, y: 465.37)) bezier34Path.addCurve(to: CGPoint(x: 488.12, y: 475.37), controlPoint1: CGPoint(x: 490.88, y: 468.13), controlPoint2: CGPoint(x: 490.88, y: 472.61)) bezier34Path.addCurve(to: CGPoint(x: 483.13, y: 477.44), controlPoint1: CGPoint(x: 486.74, y: 476.75), controlPoint2: CGPoint(x: 484.93, y: 477.44)) bezier34Path.close() bezier34Path.usesEvenOddFillRule = true dark.setFill() bezier34Path.fill() //// Bezier 35 Drawing let bezier35Path = UIBezierPath() bezier35Path.move(to: CGPoint(x: 213.17, y: 952.75)) bezier35Path.addCurve(to: CGPoint(x: 142.34, y: 923.54), controlPoint1: CGPoint(x: 187.54, y: 952.75), controlPoint2: CGPoint(x: 161.89, y: 943.01)) bezier35Path.addCurve(to: CGPoint(x: 142.32, y: 781.54), controlPoint1: CGPoint(x: 103.22, y: 884.38), controlPoint2: CGPoint(x: 103.22, y: 820.69)) bezier35Path.addCurve(to: CGPoint(x: 152.31, y: 781.54), controlPoint1: CGPoint(x: 145.08, y: 778.78), controlPoint2: CGPoint(x: 149.55, y: 778.78)) bezier35Path.addCurve(to: CGPoint(x: 152.31, y: 791.54), controlPoint1: CGPoint(x: 155.07, y: 784.3), controlPoint2: CGPoint(x: 155.07, y: 788.78)) bezier35Path.addCurve(to: CGPoint(x: 152.31, y: 913.53), controlPoint1: CGPoint(x: 118.72, y: 825.18), controlPoint2: CGPoint(x: 118.72, y: 879.89)) bezier35Path.addCurve(to: CGPoint(x: 274.07, y: 913.43), controlPoint1: CGPoint(x: 185.93, y: 947.02), controlPoint2: CGPoint(x: 240.55, y: 946.98)) bezier35Path.addCurve(to: CGPoint(x: 284.05, y: 913.43), controlPoint1: CGPoint(x: 276.83, y: 910.67), controlPoint2: CGPoint(x: 281.3, y: 910.67)) bezier35Path.addCurve(to: CGPoint(x: 284.05, y: 923.43), controlPoint1: CGPoint(x: 286.81, y: 916.2), controlPoint2: CGPoint(x: 286.81, y: 920.67)) bezier35Path.addCurve(to: CGPoint(x: 213.17, y: 952.75), controlPoint1: CGPoint(x: 264.54, y: 942.97), controlPoint2: CGPoint(x: 238.86, y: 952.75)) bezier35Path.close() bezier35Path.usesEvenOddFillRule = true dark.setFill() bezier35Path.fill() //// Bezier 36 Drawing let bezier36Path = UIBezierPath() bezier36Path.move(to: CGPoint(x: 615.13, y: 773)) bezier36Path.addCurve(to: CGPoint(x: 610.13, y: 770.93), controlPoint1: CGPoint(x: 613.31, y: 773), controlPoint2: CGPoint(x: 611.51, y: 772.31)) bezier36Path.addCurve(to: CGPoint(x: 610.13, y: 760.93), controlPoint1: CGPoint(x: 607.37, y: 768.17), controlPoint2: CGPoint(x: 607.37, y: 763.69)) bezier36Path.addCurve(to: CGPoint(x: 610.13, y: 679.93), controlPoint1: CGPoint(x: 632.44, y: 738.61), controlPoint2: CGPoint(x: 632.44, y: 702.26)) bezier36Path.addCurve(to: CGPoint(x: 529.06, y: 679.84), controlPoint1: CGPoint(x: 587.74, y: 657.57), controlPoint2: CGPoint(x: 551.4, y: 657.52)) bezier36Path.addCurve(to: CGPoint(x: 519.07, y: 679.84), controlPoint1: CGPoint(x: 526.3, y: 682.6), controlPoint2: CGPoint(x: 521.83, y: 682.6)) bezier36Path.addCurve(to: CGPoint(x: 519.07, y: 669.84), controlPoint1: CGPoint(x: 516.31, y: 677.07), controlPoint2: CGPoint(x: 516.31, y: 672.6)) bezier36Path.addCurve(to: CGPoint(x: 620.13, y: 669.94), controlPoint1: CGPoint(x: 546.91, y: 642.02), controlPoint2: CGPoint(x: 592.24, y: 642.06)) bezier36Path.addCurve(to: CGPoint(x: 620.13, y: 770.93), controlPoint1: CGPoint(x: 647.96, y: 697.77), controlPoint2: CGPoint(x: 647.96, y: 743.09)) bezier36Path.addCurve(to: CGPoint(x: 615.13, y: 773), controlPoint1: CGPoint(x: 618.75, y: 772.31), controlPoint2: CGPoint(x: 616.93, y: 773)) bezier36Path.close() bezier36Path.usesEvenOddFillRule = true dark.setFill() bezier36Path.fill() //// Bezier 37 Drawing let bezier37Path = UIBezierPath() bezier37Path.move(to: CGPoint(x: 174.02, y: 747)) bezier37Path.addCurve(to: CGPoint(x: 169.06, y: 744.94), controlPoint1: CGPoint(x: 172.22, y: 747), controlPoint2: CGPoint(x: 170.43, y: 746.31)) bezier37Path.addCurve(to: CGPoint(x: 169.06, y: 735.01), controlPoint1: CGPoint(x: 166.31, y: 742.2), controlPoint2: CGPoint(x: 166.31, y: 737.76)) bezier37Path.addLine(to: CGPoint(x: 203.02, y: 701.06)) bezier37Path.addCurve(to: CGPoint(x: 212.94, y: 701.06), controlPoint1: CGPoint(x: 205.76, y: 698.31), controlPoint2: CGPoint(x: 210.2, y: 698.31)) bezier37Path.addCurve(to: CGPoint(x: 212.94, y: 710.99), controlPoint1: CGPoint(x: 215.69, y: 703.8), controlPoint2: CGPoint(x: 215.69, y: 708.24)) bezier37Path.addLine(to: CGPoint(x: 178.99, y: 744.94)) bezier37Path.addCurve(to: CGPoint(x: 174.02, y: 747), controlPoint1: CGPoint(x: 177.61, y: 746.32), controlPoint2: CGPoint(x: 175.82, y: 747)) bezier37Path.close() bezier37Path.usesEvenOddFillRule = true dark.setFill() bezier37Path.fill() //// Bezier 38 Drawing let bezier38Path = UIBezierPath() bezier38Path.move(to: CGPoint(x: 193.02, y: 767)) bezier38Path.addCurve(to: CGPoint(x: 188.06, y: 764.94), controlPoint1: CGPoint(x: 191.23, y: 767), controlPoint2: CGPoint(x: 189.43, y: 766.31)) bezier38Path.addCurve(to: CGPoint(x: 188.06, y: 755.01), controlPoint1: CGPoint(x: 185.31, y: 762.2), controlPoint2: CGPoint(x: 185.31, y: 757.76)) bezier38Path.addLine(to: CGPoint(x: 222.02, y: 721.06)) bezier38Path.addCurve(to: CGPoint(x: 231.94, y: 721.06), controlPoint1: CGPoint(x: 224.76, y: 718.31), controlPoint2: CGPoint(x: 229.2, y: 718.31)) bezier38Path.addCurve(to: CGPoint(x: 231.94, y: 730.99), controlPoint1: CGPoint(x: 234.69, y: 723.8), controlPoint2: CGPoint(x: 234.69, y: 728.24)) bezier38Path.addLine(to: CGPoint(x: 197.99, y: 764.94)) bezier38Path.addCurve(to: CGPoint(x: 193.02, y: 767), controlPoint1: CGPoint(x: 196.61, y: 766.31), controlPoint2: CGPoint(x: 194.82, y: 767)) bezier38Path.close() bezier38Path.usesEvenOddFillRule = true dark.setFill() bezier38Path.fill() //// Bezier 39 Drawing let bezier39Path = UIBezierPath() bezier39Path.move(to: CGPoint(x: 193.96, y: 767)) bezier39Path.addCurve(to: CGPoint(x: 188.98, y: 764.94), controlPoint1: CGPoint(x: 192.16, y: 767), controlPoint2: CGPoint(x: 190.35, y: 766.31)) bezier39Path.addLine(to: CGPoint(x: 169.06, y: 745.02)) bezier39Path.addCurve(to: CGPoint(x: 169.06, y: 735.06), controlPoint1: CGPoint(x: 166.31, y: 742.27), controlPoint2: CGPoint(x: 166.31, y: 737.81)) bezier39Path.addCurve(to: CGPoint(x: 179.02, y: 735.06), controlPoint1: CGPoint(x: 171.81, y: 732.31), controlPoint2: CGPoint(x: 176.27, y: 732.31)) bezier39Path.addLine(to: CGPoint(x: 198.94, y: 754.98)) bezier39Path.addCurve(to: CGPoint(x: 198.94, y: 764.94), controlPoint1: CGPoint(x: 201.69, y: 757.73), controlPoint2: CGPoint(x: 201.69, y: 762.19)) bezier39Path.addCurve(to: CGPoint(x: 193.96, y: 767), controlPoint1: CGPoint(x: 197.56, y: 766.31), controlPoint2: CGPoint(x: 195.76, y: 767)) bezier39Path.close() bezier39Path.usesEvenOddFillRule = true dark.setFill() bezier39Path.fill() //// Bezier 40 Drawing let bezier40Path = UIBezierPath() bezier40Path.move(to: CGPoint(x: 147.16, y: 793)) bezier40Path.addCurve(to: CGPoint(x: 142.1, y: 790.9), controlPoint1: CGPoint(x: 145.33, y: 793), controlPoint2: CGPoint(x: 143.5, y: 792.3)) bezier40Path.addCurve(to: CGPoint(x: 142.1, y: 780.77), controlPoint1: CGPoint(x: 139.3, y: 788.1), controlPoint2: CGPoint(x: 139.3, y: 783.57)) bezier40Path.addLine(to: CGPoint(x: 178.77, y: 744.1)) bezier40Path.addCurve(to: CGPoint(x: 188.9, y: 744.1), controlPoint1: CGPoint(x: 181.57, y: 741.3), controlPoint2: CGPoint(x: 186.1, y: 741.3)) bezier40Path.addCurve(to: CGPoint(x: 188.9, y: 754.23), controlPoint1: CGPoint(x: 191.7, y: 746.9), controlPoint2: CGPoint(x: 191.7, y: 751.43)) bezier40Path.addLine(to: CGPoint(x: 152.23, y: 790.9)) bezier40Path.addCurve(to: CGPoint(x: 147.16, y: 793), controlPoint1: CGPoint(x: 150.83, y: 792.3), controlPoint2: CGPoint(x: 149, y: 793)) bezier40Path.close() bezier40Path.usesEvenOddFillRule = true dark.setFill() bezier40Path.fill() //// Bezier 41 Drawing let bezier41Path = UIBezierPath() bezier41Path.move(to: CGPoint(x: 280.08, y: 925)) bezier41Path.addCurve(to: CGPoint(x: 275.07, y: 922.92), controlPoint1: CGPoint(x: 278.27, y: 925), controlPoint2: CGPoint(x: 276.46, y: 924.31)) bezier41Path.addCurve(to: CGPoint(x: 275.07, y: 912.91), controlPoint1: CGPoint(x: 272.31, y: 920.16), controlPoint2: CGPoint(x: 272.31, y: 915.68)) bezier41Path.addLine(to: CGPoint(x: 518.91, y: 669.07)) bezier41Path.addCurve(to: CGPoint(x: 528.93, y: 669.07), controlPoint1: CGPoint(x: 521.68, y: 666.31), controlPoint2: CGPoint(x: 526.16, y: 666.31)) bezier41Path.addCurve(to: CGPoint(x: 528.93, y: 679.09), controlPoint1: CGPoint(x: 531.69, y: 671.84), controlPoint2: CGPoint(x: 531.69, y: 676.32)) bezier41Path.addLine(to: CGPoint(x: 285.09, y: 922.92)) bezier41Path.addCurve(to: CGPoint(x: 280.08, y: 925), controlPoint1: CGPoint(x: 283.71, y: 924.31), controlPoint2: CGPoint(x: 281.89, y: 925)) bezier41Path.close() bezier41Path.usesEvenOddFillRule = true dark.setFill() bezier41Path.fill() //// Bezier 42 Drawing let bezier42Path = UIBezierPath() bezier42Path.move(to: CGPoint(x: 434.09, y: 953)) bezier42Path.addCurve(to: CGPoint(x: 429.08, y: 950.92), controlPoint1: CGPoint(x: 432.27, y: 953), controlPoint2: CGPoint(x: 430.46, y: 952.31)) bezier42Path.addCurve(to: CGPoint(x: 429.08, y: 940.9), controlPoint1: CGPoint(x: 426.31, y: 948.15), controlPoint2: CGPoint(x: 426.31, y: 943.67)) bezier42Path.addLine(to: CGPoint(x: 609.9, y: 760.08)) bezier42Path.addCurve(to: CGPoint(x: 619.92, y: 760.08), controlPoint1: CGPoint(x: 612.67, y: 757.31), controlPoint2: CGPoint(x: 617.16, y: 757.31)) bezier42Path.addCurve(to: CGPoint(x: 619.92, y: 770.1), controlPoint1: CGPoint(x: 622.69, y: 762.85), controlPoint2: CGPoint(x: 622.69, y: 767.33)) bezier42Path.addLine(to: CGPoint(x: 439.1, y: 950.92)) bezier42Path.addCurve(to: CGPoint(x: 434.09, y: 953), controlPoint1: CGPoint(x: 437.71, y: 952.31), controlPoint2: CGPoint(x: 435.9, y: 953)) bezier42Path.close() bezier42Path.usesEvenOddFillRule = true dark.setFill() bezier42Path.fill() context.restoreGState() } @objc dynamic public class func drawBook(frame targetFrame: CGRect = CGRect(x: 0, y: 0, width: 1000, height: 1000), resizing: ResizingBehavior = .aspectFit, white: UIColor = UIColor(red: 1.000, green: 1.000, blue: 1.000, alpha: 1.000), light: UIColor = UIColor(red: 0.769, green: 0.847, blue: 0.984, alpha: 1.000), medium: UIColor = UIColor(red: 0.478, green: 0.663, blue: 0.973, alpha: 1.000), dark: UIColor = UIColor(red: 0.000, green: 0.478, blue: 1.000, alpha: 1.000)) { //// General Declarations let context = UIGraphicsGetCurrentContext()! //// Resize to Target Frame context.saveGState() let resizedFrame: CGRect = resizing.apply(rect: CGRect(x: 0, y: 0, width: 1000, height: 1000), target: targetFrame) context.translateBy(x: resizedFrame.minX, y: resizedFrame.minY) context.scaleBy(x: resizedFrame.width / 1000, y: resizedFrame.height / 1000) //// Group 2 //// Bezier Drawing let bezierPath = UIBezierPath() bezierPath.move(to: CGPoint(x: 923.51, y: 203.67)) bezierPath.addCurve(to: CGPoint(x: 895.71, y: 203.67), controlPoint1: CGPoint(x: 915.73, y: 203.67), controlPoint2: CGPoint(x: 895.71, y: 203.67)) bezierPath.addLine(to: CGPoint(x: 881.81, y: 203.67)) bezierPath.addLine(to: CGPoint(x: 881.81, y: 772.75)) bezierPath.addCurve(to: CGPoint(x: 522.23, y: 788.43), controlPoint1: CGPoint(x: 881.81, y: 772.75), controlPoint2: CGPoint(x: 608.12, y: 761.78)) bezierPath.addCurve(to: CGPoint(x: 499.57, y: 800.51), controlPoint1: CGPoint(x: 511.39, y: 791.9), controlPoint2: CGPoint(x: 503.46, y: 795.79)) bezierPath.addCurve(to: CGPoint(x: 117.33, y: 772.75), controlPoint1: CGPoint(x: 464.82, y: 758.87), controlPoint2: CGPoint(x: 117.33, y: 772.75)) bezierPath.addLine(to: CGPoint(x: 117.33, y: 203.67)) bezierPath.addLine(to: CGPoint(x: 103.43, y: 203.67)) bezierPath.addCurve(to: CGPoint(x: 75.64, y: 203.67), controlPoint1: CGPoint(x: 103.43, y: 203.67), controlPoint2: CGPoint(x: 83.42, y: 203.67)) bezierPath.addCurve(to: CGPoint(x: 61.74, y: 217.55), controlPoint1: CGPoint(x: 67.85, y: 203.67), controlPoint2: CGPoint(x: 61.74, y: 209.78)) bezierPath.addCurve(to: CGPoint(x: 61.74, y: 231.43), controlPoint1: CGPoint(x: 61.74, y: 225.33), controlPoint2: CGPoint(x: 61.74, y: 231.43)) bezierPath.addLine(to: CGPoint(x: 61.74, y: 800.51)) bezierPath.addCurve(to: CGPoint(x: 75.64, y: 814.39), controlPoint1: CGPoint(x: 61.74, y: 808.14), controlPoint2: CGPoint(x: 67.99, y: 814.39)) bezierPath.addLine(to: CGPoint(x: 452.45, y: 814.39)) bezierPath.addCurve(to: CGPoint(x: 498.6, y: 828.27), controlPoint1: CGPoint(x: 452.45, y: 814.39), controlPoint2: CGPoint(x: 478.59, y: 827.85)) bezierPath.addCurve(to: CGPoint(x: 499.57, y: 828.27), controlPoint1: CGPoint(x: 498.88, y: 828.27), controlPoint2: CGPoint(x: 499.29, y: 828.27)) bezierPath.addCurve(to: CGPoint(x: 546.69, y: 814.39), controlPoint1: CGPoint(x: 519.73, y: 828.27), controlPoint2: CGPoint(x: 546.69, y: 814.39)) bezierPath.addLine(to: CGPoint(x: 923.51, y: 814.39)) bezierPath.addCurve(to: CGPoint(x: 937.41, y: 800.51), controlPoint1: CGPoint(x: 931.15, y: 814.39), controlPoint2: CGPoint(x: 937.41, y: 808.14)) bezierPath.addLine(to: CGPoint(x: 937.41, y: 231.43)) bezierPath.addCurve(to: CGPoint(x: 937.41, y: 217.55), controlPoint1: CGPoint(x: 937.41, y: 231.43), controlPoint2: CGPoint(x: 937.41, y: 225.33)) bezierPath.addCurve(to: CGPoint(x: 923.51, y: 203.67), controlPoint1: CGPoint(x: 937.41, y: 209.78), controlPoint2: CGPoint(x: 931.29, y: 203.67)) bezierPath.close() bezierPath.usesEvenOddFillRule = true medium.setFill() bezierPath.fill() //// Bezier 2 Drawing let bezier2Path = UIBezierPath() bezier2Path.move(to: CGPoint(x: 548.22, y: 509.03)) bezier2Path.addLine(to: CGPoint(x: 826.21, y: 509.03)) bezier2Path.addLine(to: CGPoint(x: 826.21, y: 273.08)) bezier2Path.addLine(to: CGPoint(x: 548.22, y: 273.08)) bezier2Path.addLine(to: CGPoint(x: 548.22, y: 509.03)) bezier2Path.close() bezier2Path.move(to: CGPoint(x: 172.93, y: 509.03)) bezier2Path.addLine(to: CGPoint(x: 450.92, y: 509.03)) bezier2Path.addLine(to: CGPoint(x: 450.92, y: 273.08)) bezier2Path.addLine(to: CGPoint(x: 172.93, y: 273.08)) bezier2Path.addLine(to: CGPoint(x: 172.93, y: 509.03)) bezier2Path.close() bezier2Path.move(to: CGPoint(x: 499.57, y: 203.67)) bezier2Path.addCurve(to: CGPoint(x: 117.33, y: 175.91), controlPoint1: CGPoint(x: 464.82, y: 162.04), controlPoint2: CGPoint(x: 117.33, y: 175.91)) bezier2Path.addLine(to: CGPoint(x: 117.33, y: 772.75)) bezier2Path.addCurve(to: CGPoint(x: 499.57, y: 800.51), controlPoint1: CGPoint(x: 117.33, y: 772.75), controlPoint2: CGPoint(x: 464.82, y: 758.87)) bezier2Path.addCurve(to: CGPoint(x: 522.22, y: 788.43), controlPoint1: CGPoint(x: 503.46, y: 795.79), controlPoint2: CGPoint(x: 511.39, y: 791.9)) bezier2Path.addCurve(to: CGPoint(x: 881.81, y: 772.75), controlPoint1: CGPoint(x: 608.12, y: 761.78), controlPoint2: CGPoint(x: 881.81, y: 772.75)) bezier2Path.addLine(to: CGPoint(x: 881.81, y: 175.91)) bezier2Path.addCurve(to: CGPoint(x: 499.57, y: 203.67), controlPoint1: CGPoint(x: 881.81, y: 175.91), controlPoint2: CGPoint(x: 534.32, y: 162.04)) bezier2Path.close() bezier2Path.usesEvenOddFillRule = true white.setFill() bezier2Path.fill() //// Rectangle Drawing let rectanglePath = UIBezierPath(rect: CGRect(x: 548, y: 273, width: 278, height: 236)) white.setFill() rectanglePath.fill() //// Rectangle 2 Drawing let rectangle2Path = UIBezierPath(rect: CGRect(x: 548, y: 273, width: 278, height: 167)) light.setFill() rectangle2Path.fill() //// Bezier 3 Drawing let bezier3Path = UIBezierPath() bezier3Path.move(to: CGPoint(x: 687.5, y: 328)) bezier3Path.addLine(to: CGPoint(x: 632, y: 372.45)) bezier3Path.addLine(to: CGPoint(x: 632, y: 453)) bezier3Path.addLine(to: CGPoint(x: 743, y: 453)) bezier3Path.addLine(to: CGPoint(x: 743, y: 372.45)) bezier3Path.addLine(to: CGPoint(x: 687.5, y: 328)) bezier3Path.close() bezier3Path.usesEvenOddFillRule = true medium.setFill() bezier3Path.fill() //// Bezier 4 Drawing let bezier4Path = UIBezierPath() bezier4Path.move(to: CGPoint(x: 632, y: 373.16)) bezier4Path.addLine(to: CGPoint(x: 632, y: 454)) bezier4Path.addLine(to: CGPoint(x: 646, y: 454)) bezier4Path.addLine(to: CGPoint(x: 646, y: 362)) bezier4Path.addLine(to: CGPoint(x: 632, y: 373.16)) bezier4Path.close() bezier4Path.usesEvenOddFillRule = true medium.setFill() bezier4Path.fill() //// Rectangle 3 Drawing let rectangle3Path = UIBezierPath(rect: CGRect(x: 173, y: 273, width: 278, height: 236)) light.setFill() rectangle3Path.fill() //// Bezier 5 Drawing let bezier5Path = UIBezierPath() bezier5Path.move(to: CGPoint(x: 368, y: 388.3)) bezier5Path.addLine(to: CGPoint(x: 312.5, y: 342)) bezier5Path.addLine(to: CGPoint(x: 257, y: 388.3)) bezier5Path.addLine(to: CGPoint(x: 257, y: 467)) bezier5Path.addLine(to: CGPoint(x: 368, y: 467)) bezier5Path.addLine(to: CGPoint(x: 368, y: 388.3)) bezier5Path.close() bezier5Path.usesEvenOddFillRule = true medium.setFill() bezier5Path.fill() //// Bezier 6 Drawing let bezier6Path = UIBezierPath() bezier6Path.move(to: CGPoint(x: 256, y: 388.54)) bezier6Path.addLine(to: CGPoint(x: 256, y: 467)) bezier6Path.addLine(to: CGPoint(x: 270, y: 467)) bezier6Path.addLine(to: CGPoint(x: 270, y: 377)) bezier6Path.addLine(to: CGPoint(x: 256, y: 388.54)) bezier6Path.close() bezier6Path.usesEvenOddFillRule = true light.setFill() bezier6Path.fill() //// Bezier 7 Drawing let bezier7Path = UIBezierPath() bezier7Path.move(to: CGPoint(x: 312.5, y: 315)) bezier7Path.addLine(to: CGPoint(x: 229, y: 384.29)) bezier7Path.addLine(to: CGPoint(x: 229, y: 412)) bezier7Path.addLine(to: CGPoint(x: 312.5, y: 342.71)) bezier7Path.addLine(to: CGPoint(x: 396, y: 412)) bezier7Path.addLine(to: CGPoint(x: 396, y: 384.29)) bezier7Path.addLine(to: CGPoint(x: 312.5, y: 315)) bezier7Path.close() bezier7Path.usesEvenOddFillRule = true medium.setFill() bezier7Path.fill() //// Bezier 8 Drawing let bezier8Path = UIBezierPath() bezier8Path.move(to: CGPoint(x: 118, y: 780)) bezier8Path.addCurve(to: CGPoint(x: 111, y: 773.06), controlPoint1: CGPoint(x: 114.13, y: 780), controlPoint2: CGPoint(x: 111, y: 776.89)) bezier8Path.addLine(to: CGPoint(x: 111, y: 175.94)) bezier8Path.addCurve(to: CGPoint(x: 118, y: 169), controlPoint1: CGPoint(x: 111, y: 172.11), controlPoint2: CGPoint(x: 114.13, y: 169)) bezier8Path.addCurve(to: CGPoint(x: 125, y: 175.94), controlPoint1: CGPoint(x: 121.87, y: 169), controlPoint2: CGPoint(x: 125, y: 172.11)) bezier8Path.addLine(to: CGPoint(x: 125, y: 773.06)) bezier8Path.addCurve(to: CGPoint(x: 118, y: 780), controlPoint1: CGPoint(x: 125, y: 776.89), controlPoint2: CGPoint(x: 121.87, y: 780)) bezier8Path.close() bezier8Path.usesEvenOddFillRule = true dark.setFill() bezier8Path.fill() //// Bezier 9 Drawing let bezier9Path = UIBezierPath() bezier9Path.move(to: CGPoint(x: 499.75, y: 807.28)) bezier9Path.addCurve(to: CGPoint(x: 494.41, y: 804.79), controlPoint1: CGPoint(x: 497.76, y: 807.28), controlPoint2: CGPoint(x: 495.79, y: 806.43)) bezier9Path.addCurve(to: CGPoint(x: 117.82, y: 779.51), controlPoint1: CGPoint(x: 470.53, y: 776.16), controlPoint2: CGPoint(x: 256.1, y: 774)) bezier9Path.addCurve(to: CGPoint(x: 110.6, y: 772.86), controlPoint1: CGPoint(x: 113.96, y: 779.58), controlPoint2: CGPoint(x: 110.75, y: 776.69)) bezier9Path.addCurve(to: CGPoint(x: 117.26, y: 765.65), controlPoint1: CGPoint(x: 110.44, y: 769.04), controlPoint2: CGPoint(x: 113.43, y: 765.8)) bezier9Path.addCurve(to: CGPoint(x: 505.09, y: 795.9), controlPoint1: CGPoint(x: 153.17, y: 764.23), controlPoint2: CGPoint(x: 469.18, y: 752.88)) bezier9Path.addCurve(to: CGPoint(x: 504.2, y: 805.67), controlPoint1: CGPoint(x: 507.55, y: 798.84), controlPoint2: CGPoint(x: 507.15, y: 803.22)) bezier9Path.addCurve(to: CGPoint(x: 499.75, y: 807.28), controlPoint1: CGPoint(x: 502.9, y: 806.75), controlPoint2: CGPoint(x: 501.32, y: 807.28)) bezier9Path.close() bezier9Path.usesEvenOddFillRule = true dark.setFill() bezier9Path.fill() //// Bezier 10 Drawing let bezier10Path = UIBezierPath() bezier10Path.move(to: CGPoint(x: 499.75, y: 210.55)) bezier10Path.addCurve(to: CGPoint(x: 494.41, y: 208.06), controlPoint1: CGPoint(x: 497.76, y: 210.55), controlPoint2: CGPoint(x: 495.79, y: 209.71)) bezier10Path.addCurve(to: CGPoint(x: 117.82, y: 182.79), controlPoint1: CGPoint(x: 470.53, y: 179.43), controlPoint2: CGPoint(x: 256.1, y: 177.27)) bezier10Path.addCurve(to: CGPoint(x: 110.6, y: 176.14), controlPoint1: CGPoint(x: 113.96, y: 183.01), controlPoint2: CGPoint(x: 110.75, y: 179.96)) bezier10Path.addCurve(to: CGPoint(x: 117.26, y: 168.93), controlPoint1: CGPoint(x: 110.44, y: 172.31), controlPoint2: CGPoint(x: 113.43, y: 169.08)) bezier10Path.addCurve(to: CGPoint(x: 505.09, y: 199.17), controlPoint1: CGPoint(x: 153.17, y: 167.48), controlPoint2: CGPoint(x: 469.18, y: 156.16)) bezier10Path.addCurve(to: CGPoint(x: 504.2, y: 208.95), controlPoint1: CGPoint(x: 507.55, y: 202.12), controlPoint2: CGPoint(x: 507.15, y: 206.49)) bezier10Path.addCurve(to: CGPoint(x: 499.75, y: 210.55), controlPoint1: CGPoint(x: 502.9, y: 210.02), controlPoint2: CGPoint(x: 501.32, y: 210.55)) bezier10Path.close() bezier10Path.usesEvenOddFillRule = true dark.setFill() bezier10Path.fill() //// Bezier 11 Drawing let bezier11Path = UIBezierPath() bezier11Path.move(to: CGPoint(x: 61.95, y: 807.28)) bezier11Path.addCurve(to: CGPoint(x: 55, y: 800.35), controlPoint1: CGPoint(x: 58.11, y: 807.28), controlPoint2: CGPoint(x: 55, y: 804.18)) bezier11Path.addLine(to: CGPoint(x: 55, y: 231.37)) bezier11Path.addCurve(to: CGPoint(x: 61.95, y: 224.43), controlPoint1: CGPoint(x: 55, y: 227.53), controlPoint2: CGPoint(x: 58.11, y: 224.43)) bezier11Path.addCurve(to: CGPoint(x: 68.9, y: 231.37), controlPoint1: CGPoint(x: 65.79, y: 224.43), controlPoint2: CGPoint(x: 68.9, y: 227.53)) bezier11Path.addLine(to: CGPoint(x: 68.9, y: 800.35)) bezier11Path.addCurve(to: CGPoint(x: 61.95, y: 807.28), controlPoint1: CGPoint(x: 68.9, y: 804.18), controlPoint2: CGPoint(x: 65.79, y: 807.28)) bezier11Path.close() bezier11Path.usesEvenOddFillRule = true dark.setFill() bezier11Path.fill() //// Bezier 12 Drawing let bezier12Path = UIBezierPath() bezier12Path.move(to: CGPoint(x: 499.54, y: 835)) bezier12Path.addCurve(to: CGPoint(x: 450.82, y: 821), controlPoint1: CGPoint(x: 479.86, y: 834.6), controlPoint2: CGPoint(x: 456.98, y: 824.02)) bezier12Path.addLine(to: CGPoint(x: 75.95, y: 821)) bezier12Path.addCurve(to: CGPoint(x: 69, y: 814), controlPoint1: CGPoint(x: 72.11, y: 821), controlPoint2: CGPoint(x: 69, y: 817.87)) bezier12Path.addCurve(to: CGPoint(x: 75.95, y: 807), controlPoint1: CGPoint(x: 69, y: 810.13), controlPoint2: CGPoint(x: 72.11, y: 807)) bezier12Path.addLine(to: CGPoint(x: 452.46, y: 807)) bezier12Path.addCurve(to: CGPoint(x: 455.64, y: 807.78), controlPoint1: CGPoint(x: 453.56, y: 807), controlPoint2: CGPoint(x: 454.66, y: 807.26)) bezier12Path.addCurve(to: CGPoint(x: 498.72, y: 821), controlPoint1: CGPoint(x: 455.89, y: 807.9), controlPoint2: CGPoint(x: 480.59, y: 820.62)) bezier12Path.addCurve(to: CGPoint(x: 506, y: 828.07), controlPoint1: CGPoint(x: 502.52, y: 821.08), controlPoint2: CGPoint(x: 506.04, y: 824.23)) bezier12Path.addCurve(to: CGPoint(x: 499.54, y: 835), controlPoint1: CGPoint(x: 505.96, y: 831.91), controlPoint2: CGPoint(x: 503.35, y: 835)) bezier12Path.close() bezier12Path.usesEvenOddFillRule = true dark.setFill() bezier12Path.fill() //// Bezier 13 Drawing let bezier13Path = UIBezierPath() bezier13Path.move(to: CGPoint(x: 499.75, y: 765.73)) bezier13Path.addCurve(to: CGPoint(x: 492.8, y: 758.79), controlPoint1: CGPoint(x: 495.91, y: 765.73), controlPoint2: CGPoint(x: 492.8, y: 762.63)) bezier13Path.addLine(to: CGPoint(x: 492.8, y: 231.14)) bezier13Path.addCurve(to: CGPoint(x: 499.75, y: 224.2), controlPoint1: CGPoint(x: 492.8, y: 227.3), controlPoint2: CGPoint(x: 495.91, y: 224.2)) bezier13Path.addCurve(to: CGPoint(x: 506.7, y: 231.14), controlPoint1: CGPoint(x: 503.59, y: 224.2), controlPoint2: CGPoint(x: 506.7, y: 227.3)) bezier13Path.addLine(to: CGPoint(x: 506.7, y: 758.79)) bezier13Path.addCurve(to: CGPoint(x: 499.75, y: 765.73), controlPoint1: CGPoint(x: 506.7, y: 762.63), controlPoint2: CGPoint(x: 503.59, y: 765.73)) bezier13Path.close() bezier13Path.usesEvenOddFillRule = true dark.setFill() bezier13Path.fill() //// Bezier 14 Drawing let bezier14Path = UIBezierPath() bezier14Path.move(to: CGPoint(x: 61.95, y: 238.09)) bezier14Path.addCurve(to: CGPoint(x: 55, y: 231.14), controlPoint1: CGPoint(x: 58.11, y: 238.09), controlPoint2: CGPoint(x: 55, y: 234.98)) bezier14Path.addLine(to: CGPoint(x: 55, y: 217.26)) bezier14Path.addCurve(to: CGPoint(x: 75.85, y: 196.43), controlPoint1: CGPoint(x: 55, y: 205.58), controlPoint2: CGPoint(x: 64.15, y: 196.43)) bezier14Path.addLine(to: CGPoint(x: 103.64, y: 196.43)) bezier14Path.addCurve(to: CGPoint(x: 110.59, y: 203.37), controlPoint1: CGPoint(x: 107.48, y: 196.43), controlPoint2: CGPoint(x: 110.59, y: 199.53)) bezier14Path.addCurve(to: CGPoint(x: 103.64, y: 210.32), controlPoint1: CGPoint(x: 110.59, y: 207.21), controlPoint2: CGPoint(x: 107.48, y: 210.32)) bezier14Path.addLine(to: CGPoint(x: 75.85, y: 210.32)) bezier14Path.addCurve(to: CGPoint(x: 68.9, y: 217.26), controlPoint1: CGPoint(x: 71.88, y: 210.32), controlPoint2: CGPoint(x: 68.9, y: 213.3)) bezier14Path.addLine(to: CGPoint(x: 68.9, y: 231.14)) bezier14Path.addCurve(to: CGPoint(x: 61.95, y: 238.09), controlPoint1: CGPoint(x: 68.9, y: 234.98), controlPoint2: CGPoint(x: 65.79, y: 238.09)) bezier14Path.close() bezier14Path.usesEvenOddFillRule = true dark.setFill() bezier14Path.fill() //// Bezier 15 Drawing let bezier15Path = UIBezierPath() bezier15Path.move(to: CGPoint(x: 75.85, y: 821.27)) bezier15Path.addCurve(to: CGPoint(x: 55, y: 800.45), controlPoint1: CGPoint(x: 64.35, y: 821.27), controlPoint2: CGPoint(x: 55, y: 811.93)) bezier15Path.addCurve(to: CGPoint(x: 61.95, y: 793.5), controlPoint1: CGPoint(x: 55, y: 796.61), controlPoint2: CGPoint(x: 58.11, y: 793.5)) bezier15Path.addCurve(to: CGPoint(x: 68.9, y: 800.45), controlPoint1: CGPoint(x: 65.79, y: 793.5), controlPoint2: CGPoint(x: 68.9, y: 796.61)) bezier15Path.addCurve(to: CGPoint(x: 75.85, y: 807.39), controlPoint1: CGPoint(x: 68.9, y: 804.27), controlPoint2: CGPoint(x: 72.01, y: 807.39)) bezier15Path.addCurve(to: CGPoint(x: 82.8, y: 814.33), controlPoint1: CGPoint(x: 79.69, y: 807.39), controlPoint2: CGPoint(x: 82.8, y: 810.49)) bezier15Path.addCurve(to: CGPoint(x: 75.85, y: 821.27), controlPoint1: CGPoint(x: 82.8, y: 818.17), controlPoint2: CGPoint(x: 79.69, y: 821.27)) bezier15Path.close() bezier15Path.usesEvenOddFillRule = true dark.setFill() bezier15Path.fill() //// Bezier 16 Drawing let bezier16Path = UIBezierPath() bezier16Path.move(to: CGPoint(x: 882, y: 780)) bezier16Path.addCurve(to: CGPoint(x: 875, y: 773.06), controlPoint1: CGPoint(x: 878.13, y: 780), controlPoint2: CGPoint(x: 875, y: 776.89)) bezier16Path.addLine(to: CGPoint(x: 875, y: 175.94)) bezier16Path.addCurve(to: CGPoint(x: 882, y: 169), controlPoint1: CGPoint(x: 875, y: 172.11), controlPoint2: CGPoint(x: 878.13, y: 169)) bezier16Path.addCurve(to: CGPoint(x: 889, y: 175.94), controlPoint1: CGPoint(x: 885.87, y: 169), controlPoint2: CGPoint(x: 889, y: 172.11)) bezier16Path.addLine(to: CGPoint(x: 889, y: 773.06)) bezier16Path.addCurve(to: CGPoint(x: 882, y: 780), controlPoint1: CGPoint(x: 889, y: 776.89), controlPoint2: CGPoint(x: 885.87, y: 780)) bezier16Path.close() bezier16Path.usesEvenOddFillRule = true dark.setFill() bezier16Path.fill() //// Bezier 17 Drawing let bezier17Path = UIBezierPath() bezier17Path.move(to: CGPoint(x: 499.38, y: 807.28)) bezier17Path.addCurve(to: CGPoint(x: 494.97, y: 805.7), controlPoint1: CGPoint(x: 497.83, y: 807.28), controlPoint2: CGPoint(x: 496.27, y: 806.77)) bezier17Path.addCurve(to: CGPoint(x: 494.02, y: 795.93), controlPoint1: CGPoint(x: 492.02, y: 803.26), controlPoint2: CGPoint(x: 491.59, y: 798.89)) bezier17Path.addCurve(to: CGPoint(x: 519.92, y: 781.65), controlPoint1: CGPoint(x: 498.6, y: 790.38), controlPoint2: CGPoint(x: 506.83, y: 785.86)) bezier17Path.addCurve(to: CGPoint(x: 881.78, y: 765.65), controlPoint1: CGPoint(x: 605.99, y: 754.96), controlPoint2: CGPoint(x: 870.57, y: 765.22)) bezier17Path.addCurve(to: CGPoint(x: 888.44, y: 772.86), controlPoint1: CGPoint(x: 885.6, y: 765.8), controlPoint2: CGPoint(x: 888.59, y: 769.04)) bezier17Path.addCurve(to: CGPoint(x: 881.21, y: 779.51), controlPoint1: CGPoint(x: 888.29, y: 776.69), controlPoint2: CGPoint(x: 885.14, y: 779.88)) bezier17Path.addCurve(to: CGPoint(x: 524.1, y: 794.89), controlPoint1: CGPoint(x: 878.48, y: 779.41), controlPoint2: CGPoint(x: 607.83, y: 768.92)) bezier17Path.addCurve(to: CGPoint(x: 504.76, y: 804.75), controlPoint1: CGPoint(x: 511.51, y: 798.92), controlPoint2: CGPoint(x: 506.62, y: 802.48)) bezier17Path.addCurve(to: CGPoint(x: 499.38, y: 807.28), controlPoint1: CGPoint(x: 503.38, y: 806.41), controlPoint2: CGPoint(x: 501.39, y: 807.28)) bezier17Path.close() bezier17Path.usesEvenOddFillRule = true dark.setFill() bezier17Path.fill() //// Bezier 18 Drawing let bezier18Path = UIBezierPath() bezier18Path.move(to: CGPoint(x: 499.38, y: 210.55)) bezier18Path.addCurve(to: CGPoint(x: 494.94, y: 208.95), controlPoint1: CGPoint(x: 497.82, y: 210.55), controlPoint2: CGPoint(x: 496.24, y: 210.02)) bezier18Path.addCurve(to: CGPoint(x: 494.05, y: 199.17), controlPoint1: CGPoint(x: 492, y: 206.49), controlPoint2: CGPoint(x: 491.59, y: 202.12)) bezier18Path.addCurve(to: CGPoint(x: 881.76, y: 168.93), controlPoint1: CGPoint(x: 529.93, y: 156.15), controlPoint2: CGPoint(x: 845.87, y: 167.48)) bezier18Path.addCurve(to: CGPoint(x: 888.44, y: 176.14), controlPoint1: CGPoint(x: 885.6, y: 169.08), controlPoint2: CGPoint(x: 888.59, y: 172.31)) bezier18Path.addCurve(to: CGPoint(x: 881.22, y: 182.79), controlPoint1: CGPoint(x: 888.29, y: 179.97), controlPoint2: CGPoint(x: 885.14, y: 183.09)) bezier18Path.addCurve(to: CGPoint(x: 504.73, y: 208.06), controlPoint1: CGPoint(x: 742.94, y: 177.27), controlPoint2: CGPoint(x: 528.6, y: 179.44)) bezier18Path.addCurve(to: CGPoint(x: 499.38, y: 210.55), controlPoint1: CGPoint(x: 503.35, y: 209.71), controlPoint2: CGPoint(x: 501.38, y: 210.55)) bezier18Path.close() bezier18Path.usesEvenOddFillRule = true dark.setFill() bezier18Path.fill() //// Bezier 19 Drawing let bezier19Path = UIBezierPath() bezier19Path.move(to: CGPoint(x: 937, y: 807)) bezier19Path.addCurve(to: CGPoint(x: 930, y: 800.06), controlPoint1: CGPoint(x: 933.13, y: 807), controlPoint2: CGPoint(x: 930, y: 803.9)) bezier19Path.addLine(to: CGPoint(x: 930, y: 230.94)) bezier19Path.addCurve(to: CGPoint(x: 937, y: 224), controlPoint1: CGPoint(x: 930, y: 227.1), controlPoint2: CGPoint(x: 933.13, y: 224)) bezier19Path.addCurve(to: CGPoint(x: 944, y: 230.94), controlPoint1: CGPoint(x: 940.87, y: 224), controlPoint2: CGPoint(x: 944, y: 227.1)) bezier19Path.addLine(to: CGPoint(x: 944, y: 800.06)) bezier19Path.addCurve(to: CGPoint(x: 937, y: 807), controlPoint1: CGPoint(x: 944, y: 803.9), controlPoint2: CGPoint(x: 940.87, y: 807)) bezier19Path.close() bezier19Path.usesEvenOddFillRule = true dark.setFill() bezier19Path.fill() //// Bezier 20 Drawing let bezier20Path = UIBezierPath() bezier20Path.move(to: CGPoint(x: 499.95, y: 835)) bezier20Path.addCurve(to: CGPoint(x: 493, y: 828), controlPoint1: CGPoint(x: 496.11, y: 835), controlPoint2: CGPoint(x: 493, y: 831.87)) bezier20Path.addCurve(to: CGPoint(x: 499.95, y: 821), controlPoint1: CGPoint(x: 493, y: 824.13), controlPoint2: CGPoint(x: 496.11, y: 821)) bezier20Path.addCurve(to: CGPoint(x: 543.89, y: 807.78), controlPoint1: CGPoint(x: 518.22, y: 821), controlPoint2: CGPoint(x: 543.65, y: 807.9)) bezier20Path.addCurve(to: CGPoint(x: 547.09, y: 807), controlPoint1: CGPoint(x: 544.88, y: 807.26), controlPoint2: CGPoint(x: 545.97, y: 807)) bezier20Path.addLine(to: CGPoint(x: 924.05, y: 807)) bezier20Path.addCurve(to: CGPoint(x: 931, y: 814), controlPoint1: CGPoint(x: 927.89, y: 807), controlPoint2: CGPoint(x: 931, y: 810.13)) bezier20Path.addCurve(to: CGPoint(x: 924.05, y: 821), controlPoint1: CGPoint(x: 931, y: 817.87), controlPoint2: CGPoint(x: 927.89, y: 821)) bezier20Path.addLine(to: CGPoint(x: 548.73, y: 821)) bezier20Path.addCurve(to: CGPoint(x: 499.95, y: 835), controlPoint1: CGPoint(x: 542.47, y: 824.08), controlPoint2: CGPoint(x: 518.92, y: 835)) bezier20Path.close() bezier20Path.usesEvenOddFillRule = true dark.setFill() bezier20Path.fill() //// Bezier 21 Drawing let bezier21Path = UIBezierPath() bezier21Path.move(to: CGPoint(x: 938, y: 238)) bezier21Path.addCurve(to: CGPoint(x: 931, y: 231), controlPoint1: CGPoint(x: 934.13, y: 238), controlPoint2: CGPoint(x: 931, y: 234.87)) bezier21Path.addLine(to: CGPoint(x: 931, y: 217)) bezier21Path.addCurve(to: CGPoint(x: 924, y: 210), controlPoint1: CGPoint(x: 931, y: 213.01), controlPoint2: CGPoint(x: 927.99, y: 210)) bezier21Path.addLine(to: CGPoint(x: 896, y: 210)) bezier21Path.addCurve(to: CGPoint(x: 889, y: 203), controlPoint1: CGPoint(x: 892.13, y: 210), controlPoint2: CGPoint(x: 889, y: 206.87)) bezier21Path.addCurve(to: CGPoint(x: 896, y: 196), controlPoint1: CGPoint(x: 889, y: 199.13), controlPoint2: CGPoint(x: 892.13, y: 196)) bezier21Path.addLine(to: CGPoint(x: 924, y: 196)) bezier21Path.addCurve(to: CGPoint(x: 945, y: 217), controlPoint1: CGPoint(x: 935.77, y: 196), controlPoint2: CGPoint(x: 945, y: 205.22)) bezier21Path.addLine(to: CGPoint(x: 945, y: 231)) bezier21Path.addCurve(to: CGPoint(x: 938, y: 238), controlPoint1: CGPoint(x: 945, y: 234.87), controlPoint2: CGPoint(x: 941.87, y: 238)) bezier21Path.close() bezier21Path.usesEvenOddFillRule = true dark.setFill() bezier21Path.fill() //// Bezier 22 Drawing let bezier22Path = UIBezierPath() bezier22Path.move(to: CGPoint(x: 924, y: 821)) bezier22Path.addCurve(to: CGPoint(x: 917, y: 814), controlPoint1: CGPoint(x: 920.13, y: 821), controlPoint2: CGPoint(x: 917, y: 817.87)) bezier22Path.addCurve(to: CGPoint(x: 924, y: 807), controlPoint1: CGPoint(x: 917, y: 810.13), controlPoint2: CGPoint(x: 920.13, y: 807)) bezier22Path.addCurve(to: CGPoint(x: 931, y: 800), controlPoint1: CGPoint(x: 927.86, y: 807), controlPoint2: CGPoint(x: 931, y: 803.86)) bezier22Path.addCurve(to: CGPoint(x: 938, y: 793), controlPoint1: CGPoint(x: 931, y: 796.13), controlPoint2: CGPoint(x: 934.13, y: 793)) bezier22Path.addCurve(to: CGPoint(x: 945, y: 800), controlPoint1: CGPoint(x: 941.87, y: 793), controlPoint2: CGPoint(x: 945, y: 796.13)) bezier22Path.addCurve(to: CGPoint(x: 924, y: 821), controlPoint1: CGPoint(x: 945, y: 811.58), controlPoint2: CGPoint(x: 935.58, y: 821)) bezier22Path.close() bezier22Path.usesEvenOddFillRule = true dark.setFill() bezier22Path.fill() //// Bezier 23 Drawing let bezier23Path = UIBezierPath() bezier23Path.move(to: CGPoint(x: 179.91, y: 502.11)) bezier23Path.addLine(to: CGPoint(x: 444.09, y: 502.11)) bezier23Path.addLine(to: CGPoint(x: 444.09, y: 279.89)) bezier23Path.addLine(to: CGPoint(x: 179.91, y: 279.89)) bezier23Path.addLine(to: CGPoint(x: 179.91, y: 502.11)) bezier23Path.close() bezier23Path.move(to: CGPoint(x: 451.05, y: 516)) bezier23Path.addLine(to: CGPoint(x: 172.95, y: 516)) bezier23Path.addCurve(to: CGPoint(x: 166, y: 509.05), controlPoint1: CGPoint(x: 169.11, y: 516), controlPoint2: CGPoint(x: 166, y: 512.9)) bezier23Path.addLine(to: CGPoint(x: 166, y: 272.95)) bezier23Path.addCurve(to: CGPoint(x: 172.95, y: 266), controlPoint1: CGPoint(x: 166, y: 269.11), controlPoint2: CGPoint(x: 169.11, y: 266)) bezier23Path.addLine(to: CGPoint(x: 451.05, y: 266)) bezier23Path.addCurve(to: CGPoint(x: 458, y: 272.95), controlPoint1: CGPoint(x: 454.89, y: 266), controlPoint2: CGPoint(x: 458, y: 269.11)) bezier23Path.addLine(to: CGPoint(x: 458, y: 509.05)) bezier23Path.addCurve(to: CGPoint(x: 451.05, y: 516), controlPoint1: CGPoint(x: 458, y: 512.89), controlPoint2: CGPoint(x: 454.89, y: 516)) bezier23Path.close() bezier23Path.usesEvenOddFillRule = true dark.setFill() bezier23Path.fill() //// Bezier 24 Drawing let bezier24Path = UIBezierPath() bezier24Path.move(to: CGPoint(x: 228.94, y: 391)) bezier24Path.addCurve(to: CGPoint(x: 223.61, y: 388.51), controlPoint1: CGPoint(x: 226.95, y: 391), controlPoint2: CGPoint(x: 224.98, y: 390.16)) bezier24Path.addCurve(to: CGPoint(x: 224.49, y: 378.77), controlPoint1: CGPoint(x: 221.16, y: 385.58), controlPoint2: CGPoint(x: 221.55, y: 381.21)) bezier24Path.addLine(to: CGPoint(x: 307.63, y: 309.6)) bezier24Path.addCurve(to: CGPoint(x: 317.39, y: 310.49), controlPoint1: CGPoint(x: 310.58, y: 307.16), controlPoint2: CGPoint(x: 314.95, y: 307.56)) bezier24Path.addCurve(to: CGPoint(x: 316.51, y: 320.23), controlPoint1: CGPoint(x: 319.84, y: 313.43), controlPoint2: CGPoint(x: 319.45, y: 317.79)) bezier24Path.addLine(to: CGPoint(x: 233.37, y: 389.4)) bezier24Path.addCurve(to: CGPoint(x: 228.94, y: 391), controlPoint1: CGPoint(x: 232.07, y: 390.47), controlPoint2: CGPoint(x: 230.5, y: 391)) bezier24Path.close() bezier24Path.usesEvenOddFillRule = true dark.setFill() bezier24Path.fill() //// Bezier 25 Drawing let bezier25Path = UIBezierPath() bezier25Path.move(to: CGPoint(x: 395.06, y: 391)) bezier25Path.addCurve(to: CGPoint(x: 390.63, y: 389.4), controlPoint1: CGPoint(x: 393.5, y: 391), controlPoint2: CGPoint(x: 391.93, y: 390.47)) bezier25Path.addLine(to: CGPoint(x: 307.49, y: 320.23)) bezier25Path.addCurve(to: CGPoint(x: 306.6, y: 310.49), controlPoint1: CGPoint(x: 304.56, y: 317.79), controlPoint2: CGPoint(x: 304.16, y: 313.43)) bezier25Path.addCurve(to: CGPoint(x: 316.37, y: 309.6), controlPoint1: CGPoint(x: 309.06, y: 307.56), controlPoint2: CGPoint(x: 313.41, y: 307.16)) bezier25Path.addLine(to: CGPoint(x: 399.51, y: 378.77)) bezier25Path.addCurve(to: CGPoint(x: 400.39, y: 388.51), controlPoint1: CGPoint(x: 402.45, y: 381.21), controlPoint2: CGPoint(x: 402.84, y: 385.58)) bezier25Path.addCurve(to: CGPoint(x: 395.06, y: 391), controlPoint1: CGPoint(x: 399.02, y: 390.16), controlPoint2: CGPoint(x: 397.05, y: 391)) bezier25Path.close() bezier25Path.usesEvenOddFillRule = true dark.setFill() bezier25Path.fill() //// Bezier 26 Drawing let bezier26Path = UIBezierPath() bezier26Path.move(to: CGPoint(x: 228.94, y: 419)) bezier26Path.addCurve(to: CGPoint(x: 223.61, y: 416.51), controlPoint1: CGPoint(x: 226.95, y: 419), controlPoint2: CGPoint(x: 224.98, y: 418.16)) bezier26Path.addCurve(to: CGPoint(x: 224.49, y: 406.77), controlPoint1: CGPoint(x: 221.16, y: 413.58), controlPoint2: CGPoint(x: 221.55, y: 409.21)) bezier26Path.addLine(to: CGPoint(x: 307.63, y: 337.6)) bezier26Path.addCurve(to: CGPoint(x: 317.39, y: 338.49), controlPoint1: CGPoint(x: 310.58, y: 335.16), controlPoint2: CGPoint(x: 314.95, y: 335.56)) bezier26Path.addCurve(to: CGPoint(x: 316.51, y: 348.23), controlPoint1: CGPoint(x: 319.84, y: 341.43), controlPoint2: CGPoint(x: 319.45, y: 345.79)) bezier26Path.addLine(to: CGPoint(x: 233.37, y: 417.4)) bezier26Path.addCurve(to: CGPoint(x: 228.94, y: 419), controlPoint1: CGPoint(x: 232.07, y: 418.47), controlPoint2: CGPoint(x: 230.5, y: 419)) bezier26Path.close() bezier26Path.usesEvenOddFillRule = true dark.setFill() bezier26Path.fill() //// Bezier 27 Drawing let bezier27Path = UIBezierPath() bezier27Path.move(to: CGPoint(x: 395.06, y: 419)) bezier27Path.addCurve(to: CGPoint(x: 390.63, y: 417.4), controlPoint1: CGPoint(x: 393.5, y: 419), controlPoint2: CGPoint(x: 391.93, y: 418.47)) bezier27Path.addLine(to: CGPoint(x: 307.49, y: 348.23)) bezier27Path.addCurve(to: CGPoint(x: 306.6, y: 338.49), controlPoint1: CGPoint(x: 304.56, y: 345.79), controlPoint2: CGPoint(x: 304.16, y: 341.43)) bezier27Path.addCurve(to: CGPoint(x: 316.37, y: 337.6), controlPoint1: CGPoint(x: 309.06, y: 335.56), controlPoint2: CGPoint(x: 313.41, y: 335.16)) bezier27Path.addLine(to: CGPoint(x: 399.51, y: 406.77)) bezier27Path.addCurve(to: CGPoint(x: 400.39, y: 416.51), controlPoint1: CGPoint(x: 402.45, y: 409.21), controlPoint2: CGPoint(x: 402.84, y: 413.58)) bezier27Path.addCurve(to: CGPoint(x: 395.06, y: 419), controlPoint1: CGPoint(x: 399.02, y: 418.16), controlPoint2: CGPoint(x: 397.05, y: 419)) bezier27Path.close() bezier27Path.usesEvenOddFillRule = true dark.setFill() bezier27Path.fill() //// Rectangle 4 Drawing let rectangle4Path = UIBezierPath(roundedRect: CGRect(x: 250, y: 405, width: 14, height: 69), cornerRadius: 7) dark.setFill() rectangle4Path.fill() //// Rectangle 5 Drawing let rectangle5Path = UIBezierPath(roundedRect: CGRect(x: 250, y: 460, width: 125, height: 14), cornerRadius: 7) dark.setFill() rectangle5Path.fill() //// Rectangle 6 Drawing let rectangle6Path = UIBezierPath(roundedRect: CGRect(x: 361, y: 405, width: 14, height: 69), cornerRadius: 7) dark.setFill() rectangle6Path.fill() //// Rectangle 7 Drawing let rectangle7Path = UIBezierPath(roundedRect: CGRect(x: 305, y: 432, width: 14, height: 42), cornerRadius: 7) dark.setFill() rectangle7Path.fill() //// Bezier 28 Drawing let bezier28Path = UIBezierPath() bezier28Path.move(to: CGPoint(x: 451.05, y: 558)) bezier28Path.addLine(to: CGPoint(x: 172.95, y: 558)) bezier28Path.addCurve(to: CGPoint(x: 166, y: 551), controlPoint1: CGPoint(x: 169.11, y: 558), controlPoint2: CGPoint(x: 166, y: 554.87)) bezier28Path.addCurve(to: CGPoint(x: 172.95, y: 544), controlPoint1: CGPoint(x: 166, y: 547.13), controlPoint2: CGPoint(x: 169.11, y: 544)) bezier28Path.addLine(to: CGPoint(x: 451.05, y: 544)) bezier28Path.addCurve(to: CGPoint(x: 458, y: 551), controlPoint1: CGPoint(x: 454.89, y: 544), controlPoint2: CGPoint(x: 458, y: 547.13)) bezier28Path.addCurve(to: CGPoint(x: 451.05, y: 558), controlPoint1: CGPoint(x: 458, y: 554.87), controlPoint2: CGPoint(x: 454.89, y: 558)) bezier28Path.close() bezier28Path.usesEvenOddFillRule = true dark.setFill() bezier28Path.fill() //// Bezier 29 Drawing let bezier29Path = UIBezierPath() bezier29Path.move(to: CGPoint(x: 451.05, y: 599)) bezier29Path.addLine(to: CGPoint(x: 172.95, y: 599)) bezier29Path.addCurve(to: CGPoint(x: 166, y: 592), controlPoint1: CGPoint(x: 169.11, y: 599), controlPoint2: CGPoint(x: 166, y: 595.87)) bezier29Path.addCurve(to: CGPoint(x: 172.95, y: 585), controlPoint1: CGPoint(x: 166, y: 588.13), controlPoint2: CGPoint(x: 169.11, y: 585)) bezier29Path.addLine(to: CGPoint(x: 451.05, y: 585)) bezier29Path.addCurve(to: CGPoint(x: 458, y: 592), controlPoint1: CGPoint(x: 454.89, y: 585), controlPoint2: CGPoint(x: 458, y: 588.13)) bezier29Path.addCurve(to: CGPoint(x: 451.05, y: 599), controlPoint1: CGPoint(x: 458, y: 595.87), controlPoint2: CGPoint(x: 454.89, y: 599)) bezier29Path.close() bezier29Path.usesEvenOddFillRule = true dark.setFill() bezier29Path.fill() //// Bezier 30 Drawing let bezier30Path = UIBezierPath() bezier30Path.move(to: CGPoint(x: 451.05, y: 641)) bezier30Path.addLine(to: CGPoint(x: 172.95, y: 641)) bezier30Path.addCurve(to: CGPoint(x: 166, y: 634), controlPoint1: CGPoint(x: 169.11, y: 641), controlPoint2: CGPoint(x: 166, y: 637.87)) bezier30Path.addCurve(to: CGPoint(x: 172.95, y: 627), controlPoint1: CGPoint(x: 166, y: 630.13), controlPoint2: CGPoint(x: 169.11, y: 627)) bezier30Path.addLine(to: CGPoint(x: 451.05, y: 627)) bezier30Path.addCurve(to: CGPoint(x: 458, y: 634), controlPoint1: CGPoint(x: 454.89, y: 627), controlPoint2: CGPoint(x: 458, y: 630.13)) bezier30Path.addCurve(to: CGPoint(x: 451.05, y: 641), controlPoint1: CGPoint(x: 458, y: 637.87), controlPoint2: CGPoint(x: 454.89, y: 641)) bezier30Path.close() bezier30Path.usesEvenOddFillRule = true dark.setFill() bezier30Path.fill() //// Rectangle 8 Drawing let rectangle8Path = UIBezierPath(roundedRect: CGRect(x: 166, y: 682, width: 125, height: 14), cornerRadius: 7) dark.setFill() rectangle8Path.fill() //// Bezier 31 Drawing let bezier31Path = UIBezierPath() bezier31Path.move(to: CGPoint(x: 555.91, y: 501.11)) bezier31Path.addLine(to: CGPoint(x: 820.1, y: 501.11)) bezier31Path.addLine(to: CGPoint(x: 820.1, y: 278.89)) bezier31Path.addLine(to: CGPoint(x: 555.91, y: 278.89)) bezier31Path.addLine(to: CGPoint(x: 555.91, y: 501.11)) bezier31Path.close() bezier31Path.move(to: CGPoint(x: 827.05, y: 515)) bezier31Path.addLine(to: CGPoint(x: 548.95, y: 515)) bezier31Path.addCurve(to: CGPoint(x: 542, y: 508.05), controlPoint1: CGPoint(x: 545.11, y: 515), controlPoint2: CGPoint(x: 542, y: 511.9)) bezier31Path.addLine(to: CGPoint(x: 542, y: 271.95)) bezier31Path.addCurve(to: CGPoint(x: 548.95, y: 265), controlPoint1: CGPoint(x: 542, y: 268.11), controlPoint2: CGPoint(x: 545.11, y: 265)) bezier31Path.addLine(to: CGPoint(x: 827.05, y: 265)) bezier31Path.addCurve(to: CGPoint(x: 834, y: 271.95), controlPoint1: CGPoint(x: 830.89, y: 265), controlPoint2: CGPoint(x: 834, y: 268.11)) bezier31Path.addLine(to: CGPoint(x: 834, y: 508.05)) bezier31Path.addCurve(to: CGPoint(x: 827.05, y: 515), controlPoint1: CGPoint(x: 834, y: 511.89), controlPoint2: CGPoint(x: 830.89, y: 515)) bezier31Path.close() bezier31Path.usesEvenOddFillRule = true dark.setFill() bezier31Path.fill() //// Bezier 32 Drawing let bezier32Path = UIBezierPath() bezier32Path.move(to: CGPoint(x: 617.92, y: 391)) bezier32Path.addCurve(to: CGPoint(x: 612.51, y: 388.41), controlPoint1: CGPoint(x: 615.89, y: 391), controlPoint2: CGPoint(x: 613.88, y: 390.11)) bezier32Path.addCurve(to: CGPoint(x: 613.59, y: 378.71), controlPoint1: CGPoint(x: 610.14, y: 385.43), controlPoint2: CGPoint(x: 610.61, y: 381.09)) bezier32Path.addLine(to: CGPoint(x: 682.76, y: 323.5)) bezier32Path.addCurve(to: CGPoint(x: 692.49, y: 324.58), controlPoint1: CGPoint(x: 685.77, y: 321.13), controlPoint2: CGPoint(x: 690.11, y: 321.62)) bezier32Path.addCurve(to: CGPoint(x: 691.41, y: 334.29), controlPoint1: CGPoint(x: 694.86, y: 327.56), controlPoint2: CGPoint(x: 694.39, y: 331.9)) bezier32Path.addLine(to: CGPoint(x: 622.24, y: 389.49)) bezier32Path.addCurve(to: CGPoint(x: 617.92, y: 391), controlPoint1: CGPoint(x: 620.96, y: 390.51), controlPoint2: CGPoint(x: 619.43, y: 391)) bezier32Path.close() bezier32Path.usesEvenOddFillRule = true dark.setFill() bezier32Path.fill() //// Bezier 33 Drawing let bezier33Path = UIBezierPath() bezier33Path.move(to: CGPoint(x: 757.08, y: 391)) bezier33Path.addCurve(to: CGPoint(x: 752.76, y: 389.49), controlPoint1: CGPoint(x: 755.56, y: 391), controlPoint2: CGPoint(x: 754.04, y: 390.51)) bezier33Path.addLine(to: CGPoint(x: 683.59, y: 334.29)) bezier33Path.addCurve(to: CGPoint(x: 682.51, y: 324.58), controlPoint1: CGPoint(x: 680.61, y: 331.9), controlPoint2: CGPoint(x: 680.14, y: 327.56)) bezier33Path.addCurve(to: CGPoint(x: 692.24, y: 323.5), controlPoint1: CGPoint(x: 684.92, y: 321.61), controlPoint2: CGPoint(x: 689.25, y: 321.14)) bezier33Path.addLine(to: CGPoint(x: 761.41, y: 378.71)) bezier33Path.addCurve(to: CGPoint(x: 762.49, y: 388.41), controlPoint1: CGPoint(x: 764.39, y: 381.09), controlPoint2: CGPoint(x: 764.86, y: 385.43)) bezier33Path.addCurve(to: CGPoint(x: 757.08, y: 391), controlPoint1: CGPoint(x: 761.12, y: 390.11), controlPoint2: CGPoint(x: 759.11, y: 391)) bezier33Path.close() bezier33Path.usesEvenOddFillRule = true dark.setFill() bezier33Path.fill() //// Rectangle 9 Drawing let rectangle9Path = UIBezierPath(roundedRect: CGRect(x: 625, y: 391, width: 14, height: 69), cornerRadius: 7) dark.setFill() rectangle9Path.fill() //// Rectangle 10 Drawing let rectangle10Path = UIBezierPath(roundedRect: CGRect(x: 625, y: 446, width: 125, height: 14), cornerRadius: 7) dark.setFill() rectangle10Path.fill() //// Rectangle 11 Drawing let rectangle11Path = UIBezierPath(roundedRect: CGRect(x: 736, y: 391, width: 14, height: 69), cornerRadius: 7) dark.setFill() rectangle11Path.fill() //// Rectangle 12 Drawing let rectangle12Path = UIBezierPath(roundedRect: CGRect(x: 680, y: 419, width: 14, height: 42), cornerRadius: 7) dark.setFill() rectangle12Path.fill() //// Bezier 34 Drawing let bezier34Path = UIBezierPath() bezier34Path.move(to: CGPoint(x: 826.05, y: 558)) bezier34Path.addLine(to: CGPoint(x: 547.95, y: 558)) bezier34Path.addCurve(to: CGPoint(x: 541, y: 551), controlPoint1: CGPoint(x: 544.11, y: 558), controlPoint2: CGPoint(x: 541, y: 554.87)) bezier34Path.addCurve(to: CGPoint(x: 547.95, y: 544), controlPoint1: CGPoint(x: 541, y: 547.13), controlPoint2: CGPoint(x: 544.11, y: 544)) bezier34Path.addLine(to: CGPoint(x: 826.05, y: 544)) bezier34Path.addCurve(to: CGPoint(x: 833, y: 551), controlPoint1: CGPoint(x: 829.89, y: 544), controlPoint2: CGPoint(x: 833, y: 547.13)) bezier34Path.addCurve(to: CGPoint(x: 826.05, y: 558), controlPoint1: CGPoint(x: 833, y: 554.87), controlPoint2: CGPoint(x: 829.89, y: 558)) bezier34Path.close() bezier34Path.usesEvenOddFillRule = true dark.setFill() bezier34Path.fill() //// Bezier 35 Drawing let bezier35Path = UIBezierPath() bezier35Path.move(to: CGPoint(x: 826.05, y: 599)) bezier35Path.addLine(to: CGPoint(x: 547.95, y: 599)) bezier35Path.addCurve(to: CGPoint(x: 541, y: 592), controlPoint1: CGPoint(x: 544.11, y: 599), controlPoint2: CGPoint(x: 541, y: 595.87)) bezier35Path.addCurve(to: CGPoint(x: 547.95, y: 585), controlPoint1: CGPoint(x: 541, y: 588.13), controlPoint2: CGPoint(x: 544.11, y: 585)) bezier35Path.addLine(to: CGPoint(x: 826.05, y: 585)) bezier35Path.addCurve(to: CGPoint(x: 833, y: 592), controlPoint1: CGPoint(x: 829.89, y: 585), controlPoint2: CGPoint(x: 833, y: 588.13)) bezier35Path.addCurve(to: CGPoint(x: 826.05, y: 599), controlPoint1: CGPoint(x: 833, y: 595.87), controlPoint2: CGPoint(x: 829.89, y: 599)) bezier35Path.close() bezier35Path.usesEvenOddFillRule = true dark.setFill() bezier35Path.fill() //// Bezier 36 Drawing let bezier36Path = UIBezierPath() bezier36Path.move(to: CGPoint(x: 826.05, y: 641)) bezier36Path.addLine(to: CGPoint(x: 547.95, y: 641)) bezier36Path.addCurve(to: CGPoint(x: 541, y: 634), controlPoint1: CGPoint(x: 544.11, y: 641), controlPoint2: CGPoint(x: 541, y: 637.87)) bezier36Path.addCurve(to: CGPoint(x: 547.95, y: 627), controlPoint1: CGPoint(x: 541, y: 630.13), controlPoint2: CGPoint(x: 544.11, y: 627)) bezier36Path.addLine(to: CGPoint(x: 826.05, y: 627)) bezier36Path.addCurve(to: CGPoint(x: 833, y: 634), controlPoint1: CGPoint(x: 829.89, y: 627), controlPoint2: CGPoint(x: 833, y: 630.13)) bezier36Path.addCurve(to: CGPoint(x: 826.05, y: 641), controlPoint1: CGPoint(x: 833, y: 637.87), controlPoint2: CGPoint(x: 829.89, y: 641)) bezier36Path.close() bezier36Path.usesEvenOddFillRule = true dark.setFill() bezier36Path.fill() //// Rectangle 13 Drawing let rectangle13Path = UIBezierPath(roundedRect: CGRect(x: 541, y: 682, width: 125, height: 14), cornerRadius: 7) dark.setFill() rectangle13Path.fill() //// Rectangle 14 Drawing let rectangle14Path = UIBezierPath(roundedRect: CGRect(x: 625, y: 349, width: 14, height: 31), cornerRadius: 7) dark.setFill() rectangle14Path.fill() //// Rectangle 15 Drawing let rectangle15Path = UIBezierPath(roundedRect: CGRect(x: 569, y: 432, width: 14, height: 28), cornerRadius: 7) dark.setFill() rectangle15Path.fill() //// Rectangle 16 Drawing let rectangle16Path = UIBezierPath(roundedRect: CGRect(x: 597, y: 432, width: 14, height: 28), cornerRadius: 7) dark.setFill() rectangle16Path.fill() //// Rectangle 17 Drawing let rectangle17Path = UIBezierPath(roundedRect: CGRect(x: 764, y: 432, width: 14, height: 28), cornerRadius: 7) dark.setFill() rectangle17Path.fill() //// Rectangle 18 Drawing let rectangle18Path = UIBezierPath(roundedRect: CGRect(x: 791, y: 432, width: 14, height: 28), cornerRadius: 7) dark.setFill() rectangle18Path.fill() context.restoreGState() } @objc dynamic public class func drawDocuments(frame targetFrame: CGRect = CGRect(x: 0, y: 0, width: 1000, height: 1000), resizing: ResizingBehavior = .aspectFit, white: UIColor = UIColor(red: 1.000, green: 1.000, blue: 1.000, alpha: 1.000), light: UIColor = UIColor(red: 0.769, green: 0.847, blue: 0.984, alpha: 1.000), medium: UIColor = UIColor(red: 0.478, green: 0.663, blue: 0.973, alpha: 1.000), dark: UIColor = UIColor(red: 0.000, green: 0.478, blue: 1.000, alpha: 1.000)) { //// General Declarations let context = UIGraphicsGetCurrentContext()! //// Resize to Target Frame context.saveGState() let resizedFrame: CGRect = resizing.apply(rect: CGRect(x: 0, y: 0, width: 1000, height: 1000), target: targetFrame) context.translateBy(x: resizedFrame.minX, y: resizedFrame.minY) context.scaleBy(x: resizedFrame.width / 1000, y: resizedFrame.height / 1000) //// fds //// Bezier Drawing let bezierPath = UIBezierPath() bezierPath.move(to: CGPoint(x: 838, y: 133.67)) bezierPath.addLine(to: CGPoint(x: 838, y: 189)) bezierPath.addLine(to: CGPoint(x: 161, y: 189)) bezierPath.addLine(to: CGPoint(x: 161, y: 133.67)) bezierPath.addLine(to: CGPoint(x: 202.45, y: 133.67)) bezierPath.addLine(to: CGPoint(x: 202.45, y: 106)) bezierPath.addLine(to: CGPoint(x: 340.61, y: 106)) bezierPath.addLine(to: CGPoint(x: 382.06, y: 133.67)) bezierPath.addLine(to: CGPoint(x: 838, y: 133.67)) bezierPath.close() bezierPath.usesEvenOddFillRule = true light.setFill() bezierPath.fill() //// Bezier 2 Drawing let bezier2Path = UIBezierPath() bezier2Path.move(to: CGPoint(x: 299, y: 190)) bezier2Path.addLine(to: CGPoint(x: 838, y: 190)) bezier2Path.addLine(to: CGPoint(x: 838, y: 231)) bezier2Path.addLine(to: CGPoint(x: 340.46, y: 231)) bezier2Path.addLine(to: CGPoint(x: 299, y: 190)) bezier2Path.close() bezier2Path.usesEvenOddFillRule = true light.setFill() bezier2Path.fill() //// Bezier 3 Drawing let bezier3Path = UIBezierPath() bezier3Path.move(to: CGPoint(x: 340.09, y: 230.57)) bezier3Path.addLine(to: CGPoint(x: 879, y: 230.57)) bezier3Path.addLine(to: CGPoint(x: 879, y: 286)) bezier3Path.addLine(to: CGPoint(x: 119, y: 286)) bezier3Path.addLine(to: CGPoint(x: 119, y: 230.57)) bezier3Path.addLine(to: CGPoint(x: 160.46, y: 230.57)) bezier3Path.addLine(to: CGPoint(x: 160.46, y: 189)) bezier3Path.addLine(to: CGPoint(x: 298.64, y: 189)) bezier3Path.addLine(to: CGPoint(x: 340.09, y: 230.57)) bezier3Path.close() bezier3Path.usesEvenOddFillRule = true light.setFill() bezier3Path.fill() //// Bezier 4 Drawing let bezier4Path = UIBezierPath() bezier4Path.move(to: CGPoint(x: 665.41, y: 652.06)) bezier4Path.addLine(to: CGPoint(x: 665.41, y: 610.59)) bezier4Path.addCurve(to: CGPoint(x: 644.67, y: 589.85), controlPoint1: CGPoint(x: 665.41, y: 599.11), controlPoint2: CGPoint(x: 656.14, y: 589.85)) bezier4Path.addCurve(to: CGPoint(x: 623.93, y: 610.59), controlPoint1: CGPoint(x: 633.19, y: 589.85), controlPoint2: CGPoint(x: 623.93, y: 599.11)) bezier4Path.addLine(to: CGPoint(x: 623.93, y: 631.32)) bezier4Path.addLine(to: CGPoint(x: 375.07, y: 631.32)) bezier4Path.addLine(to: CGPoint(x: 375.07, y: 610.59)) bezier4Path.addCurve(to: CGPoint(x: 354.33, y: 589.85), controlPoint1: CGPoint(x: 375.07, y: 599.11), controlPoint2: CGPoint(x: 365.81, y: 589.85)) bezier4Path.addCurve(to: CGPoint(x: 333.59, y: 610.59), controlPoint1: CGPoint(x: 342.86, y: 589.85), controlPoint2: CGPoint(x: 333.59, y: 599.11)) bezier4Path.addLine(to: CGPoint(x: 333.59, y: 652.06)) bezier4Path.addCurve(to: CGPoint(x: 354.33, y: 672.8), controlPoint1: CGPoint(x: 333.59, y: 663.54), controlPoint2: CGPoint(x: 342.86, y: 672.8)) bezier4Path.addLine(to: CGPoint(x: 644.67, y: 672.8)) bezier4Path.addCurve(to: CGPoint(x: 665.41, y: 652.06), controlPoint1: CGPoint(x: 656.14, y: 672.8), controlPoint2: CGPoint(x: 665.41, y: 663.54)) bezier4Path.close() bezier4Path.move(to: CGPoint(x: 935, y: 368.65)) bezier4Path.addLine(to: CGPoint(x: 935, y: 866.35)) bezier4Path.addCurve(to: CGPoint(x: 907.35, y: 894), controlPoint1: CGPoint(x: 935, y: 881.55), controlPoint2: CGPoint(x: 922.55, y: 894)) bezier4Path.addLine(to: CGPoint(x: 91.65, y: 894)) bezier4Path.addCurve(to: CGPoint(x: 64, y: 866.35), controlPoint1: CGPoint(x: 76.44, y: 894), controlPoint2: CGPoint(x: 64, y: 881.55)) bezier4Path.addLine(to: CGPoint(x: 64, y: 368.65)) bezier4Path.addCurve(to: CGPoint(x: 91.65, y: 341), controlPoint1: CGPoint(x: 64, y: 353.44), controlPoint2: CGPoint(x: 76.44, y: 341)) bezier4Path.addLine(to: CGPoint(x: 907.35, y: 341)) bezier4Path.addCurve(to: CGPoint(x: 935, y: 368.65), controlPoint1: CGPoint(x: 922.55, y: 341), controlPoint2: CGPoint(x: 935, y: 353.44)) bezier4Path.close() bezier4Path.usesEvenOddFillRule = true medium.setFill() bezier4Path.fill() //// Bezier 5 Drawing let bezier5Path = UIBezierPath() bezier5Path.move(to: CGPoint(x: 879, y: 327.25)) bezier5Path.addLine(to: CGPoint(x: 879, y: 341)) bezier5Path.addLine(to: CGPoint(x: 119, y: 341)) bezier5Path.addLine(to: CGPoint(x: 119, y: 286)) bezier5Path.addLine(to: CGPoint(x: 879, y: 286)) bezier5Path.addLine(to: CGPoint(x: 879, y: 327.25)) bezier5Path.close() bezier5Path.usesEvenOddFillRule = true light.setFill() bezier5Path.fill() //// Bezier 6 Drawing let bezier6Path = UIBezierPath() bezier6Path.move(to: CGPoint(x: 665, y: 610.75)) bezier6Path.addLine(to: CGPoint(x: 665, y: 652.25)) bezier6Path.addCurve(to: CGPoint(x: 644.25, y: 673), controlPoint1: CGPoint(x: 665, y: 663.73), controlPoint2: CGPoint(x: 655.73, y: 673)) bezier6Path.addLine(to: CGPoint(x: 353.75, y: 673)) bezier6Path.addCurve(to: CGPoint(x: 333, y: 652.25), controlPoint1: CGPoint(x: 342.27, y: 673), controlPoint2: CGPoint(x: 333, y: 663.73)) bezier6Path.addLine(to: CGPoint(x: 333, y: 610.75)) bezier6Path.addCurve(to: CGPoint(x: 353.75, y: 590), controlPoint1: CGPoint(x: 333, y: 599.27), controlPoint2: CGPoint(x: 342.27, y: 590)) bezier6Path.addCurve(to: CGPoint(x: 374.5, y: 610.75), controlPoint1: CGPoint(x: 365.23, y: 590), controlPoint2: CGPoint(x: 374.5, y: 599.27)) bezier6Path.addLine(to: CGPoint(x: 374.5, y: 631.5)) bezier6Path.addLine(to: CGPoint(x: 623.5, y: 631.5)) bezier6Path.addLine(to: CGPoint(x: 623.5, y: 610.75)) bezier6Path.addCurve(to: CGPoint(x: 644.25, y: 590), controlPoint1: CGPoint(x: 623.5, y: 599.27), controlPoint2: CGPoint(x: 632.76, y: 590)) bezier6Path.addCurve(to: CGPoint(x: 665, y: 610.75), controlPoint1: CGPoint(x: 655.73, y: 590), controlPoint2: CGPoint(x: 665, y: 599.27)) bezier6Path.close() bezier6Path.usesEvenOddFillRule = true white.setFill() bezier6Path.fill() //// Bezier 7 Drawing let bezier7Path = UIBezierPath() bezier7Path.move(to: CGPoint(x: 161, y: 286)) bezier7Path.addLine(to: CGPoint(x: 838, y: 286)) bezier7Path.addLine(to: CGPoint(x: 838, y: 258)) bezier7Path.addLine(to: CGPoint(x: 161, y: 258)) bezier7Path.addLine(to: CGPoint(x: 161, y: 286)) bezier7Path.close() bezier7Path.usesEvenOddFillRule = true white.setFill() bezier7Path.fill() //// Bezier 8 Drawing let bezier8Path = UIBezierPath() bezier8Path.move(to: CGPoint(x: 202, y: 189)) bezier8Path.addLine(to: CGPoint(x: 796, y: 189)) bezier8Path.addLine(to: CGPoint(x: 796, y: 161)) bezier8Path.addLine(to: CGPoint(x: 202, y: 161)) bezier8Path.addLine(to: CGPoint(x: 202, y: 189)) bezier8Path.close() bezier8Path.usesEvenOddFillRule = true white.setFill() bezier8Path.fill() //// Bezier 9 Drawing let bezier9Path = UIBezierPath() bezier9Path.move(to: CGPoint(x: 119, y: 341)) bezier9Path.addLine(to: CGPoint(x: 879, y: 341)) bezier9Path.addLine(to: CGPoint(x: 879, y: 327)) bezier9Path.addLine(to: CGPoint(x: 119, y: 327)) bezier9Path.addLine(to: CGPoint(x: 119, y: 341)) bezier9Path.close() bezier9Path.usesEvenOddFillRule = true white.setFill() bezier9Path.fill() //// Rectangle Drawing let rectanglePath = UIBezierPath(rect: CGRect(x: 119, y: 231, width: 14, height: 97)) white.setFill() rectanglePath.fill() //// Bezier 10 Drawing let bezier10Path = UIBezierPath() bezier10Path.move(to: CGPoint(x: 161.01, y: 189)) bezier10Path.addLine(to: CGPoint(x: 161, y: 189)) bezier10Path.addLine(to: CGPoint(x: 161, y: 134)) bezier10Path.addLine(to: CGPoint(x: 161.01, y: 134)) bezier10Path.addLine(to: CGPoint(x: 161.01, y: 188.99)) bezier10Path.addLine(to: CGPoint(x: 175, y: 188.99)) bezier10Path.addLine(to: CGPoint(x: 161.01, y: 188.99)) bezier10Path.addLine(to: CGPoint(x: 161.01, y: 189)) bezier10Path.close() bezier10Path.usesEvenOddFillRule = true UIColor.red.setFill() bezier10Path.fill() //// Rectangle 2 Drawing let rectangle2Path = UIBezierPath(rect: CGRect(x: 161, y: 134, width: 14, height: 55)) white.setFill() rectangle2Path.fill() //// Bezier 11 Drawing let bezier11Path = UIBezierPath() bezier11Path.move(to: CGPoint(x: 161, y: 189.5)) bezier11Path.addLine(to: CGPoint(x: 175, y: 189.5)) bezier11Path.addLine(to: CGPoint(x: 175, y: 189.5)) bezier11Path.addLine(to: CGPoint(x: 161, y: 189.5)) bezier11Path.addLine(to: CGPoint(x: 161, y: 189.5)) bezier11Path.close() bezier11Path.usesEvenOddFillRule = true UIColor.red.setFill() bezier11Path.fill() //// Rectangle 3 Drawing let rectangle3Path = UIBezierPath(rect: CGRect(x: 865, y: 231, width: 14, height: 97)) medium.setFill() rectangle3Path.fill() //// Rectangle 4 Drawing let rectangle4Path = UIBezierPath(rect: CGRect(x: 824, y: 134, width: 14, height: 55)) medium.setFill() rectangle4Path.fill() //// Rectangle 5 Drawing let rectangle5Path = UIBezierPath(rect: CGRect(x: 823.95, y: 189.48, width: 13.8, height: 27.65)) medium.setFill() rectangle5Path.fill() //// Bezier 12 Drawing let bezier12Path = UIBezierPath() bezier12Path.move(to: CGPoint(x: 91.55, y: 348.37)) bezier12Path.addCurve(to: CGPoint(x: 70.82, y: 369.09), controlPoint1: CGPoint(x: 80.12, y: 348.37), controlPoint2: CGPoint(x: 70.82, y: 357.66)) bezier12Path.addLine(to: CGPoint(x: 70.82, y: 866.46)) bezier12Path.addCurve(to: CGPoint(x: 91.55, y: 887.19), controlPoint1: CGPoint(x: 70.82, y: 877.89), controlPoint2: CGPoint(x: 80.12, y: 887.19)) bezier12Path.addLine(to: CGPoint(x: 906.85, y: 887.19)) bezier12Path.addCurve(to: CGPoint(x: 927.58, y: 866.46), controlPoint1: CGPoint(x: 918.28, y: 887.19), controlPoint2: CGPoint(x: 927.58, y: 877.89)) bezier12Path.addLine(to: CGPoint(x: 927.58, y: 369.09)) bezier12Path.addCurve(to: CGPoint(x: 906.85, y: 348.37), controlPoint1: CGPoint(x: 927.58, y: 357.66), controlPoint2: CGPoint(x: 918.28, y: 348.37)) bezier12Path.addLine(to: CGPoint(x: 91.55, y: 348.37)) bezier12Path.close() bezier12Path.move(to: CGPoint(x: 906.85, y: 901)) bezier12Path.addLine(to: CGPoint(x: 91.55, y: 901)) bezier12Path.addCurve(to: CGPoint(x: 57, y: 866.46), controlPoint1: CGPoint(x: 72.5, y: 901), controlPoint2: CGPoint(x: 57, y: 885.51)) bezier12Path.addLine(to: CGPoint(x: 57, y: 369.09)) bezier12Path.addCurve(to: CGPoint(x: 91.55, y: 334.55), controlPoint1: CGPoint(x: 57, y: 350.05), controlPoint2: CGPoint(x: 72.5, y: 334.55)) bezier12Path.addLine(to: CGPoint(x: 906.85, y: 334.55)) bezier12Path.addCurve(to: CGPoint(x: 941.4, y: 369.09), controlPoint1: CGPoint(x: 925.9, y: 334.55), controlPoint2: CGPoint(x: 941.4, y: 350.05)) bezier12Path.addLine(to: CGPoint(x: 941.4, y: 866.46)) bezier12Path.addCurve(to: CGPoint(x: 906.85, y: 901), controlPoint1: CGPoint(x: 941.4, y: 885.51), controlPoint2: CGPoint(x: 925.9, y: 901)) bezier12Path.close() bezier12Path.usesEvenOddFillRule = true dark.setFill() bezier12Path.fill() //// Bezier 13 Drawing let bezier13Path = UIBezierPath() bezier13Path.move(to: CGPoint(x: 353.68, y: 596.86)) bezier13Path.addCurve(to: CGPoint(x: 339.84, y: 610.71), controlPoint1: CGPoint(x: 346.05, y: 596.86), controlPoint2: CGPoint(x: 339.84, y: 603.08)) bezier13Path.addLine(to: CGPoint(x: 339.84, y: 652.28)) bezier13Path.addCurve(to: CGPoint(x: 353.68, y: 666.14), controlPoint1: CGPoint(x: 339.84, y: 659.92), controlPoint2: CGPoint(x: 346.05, y: 666.14)) bezier13Path.addLine(to: CGPoint(x: 644.32, y: 666.14)) bezier13Path.addCurve(to: CGPoint(x: 658.16, y: 652.28), controlPoint1: CGPoint(x: 651.94, y: 666.14), controlPoint2: CGPoint(x: 658.16, y: 659.92)) bezier13Path.addLine(to: CGPoint(x: 658.16, y: 610.71)) bezier13Path.addCurve(to: CGPoint(x: 644.32, y: 596.86), controlPoint1: CGPoint(x: 658.16, y: 603.08), controlPoint2: CGPoint(x: 651.94, y: 596.86)) bezier13Path.addCurve(to: CGPoint(x: 630.48, y: 610.71), controlPoint1: CGPoint(x: 636.7, y: 596.86), controlPoint2: CGPoint(x: 630.48, y: 603.08)) bezier13Path.addLine(to: CGPoint(x: 630.48, y: 631.5)) bezier13Path.addCurve(to: CGPoint(x: 623.56, y: 638.43), controlPoint1: CGPoint(x: 630.48, y: 635.33), controlPoint2: CGPoint(x: 627.39, y: 638.43)) bezier13Path.addLine(to: CGPoint(x: 374.44, y: 638.43)) bezier13Path.addCurve(to: CGPoint(x: 367.52, y: 631.5), controlPoint1: CGPoint(x: 370.62, y: 638.43), controlPoint2: CGPoint(x: 367.52, y: 635.33)) bezier13Path.addLine(to: CGPoint(x: 367.52, y: 610.71)) bezier13Path.addCurve(to: CGPoint(x: 353.68, y: 596.86), controlPoint1: CGPoint(x: 367.52, y: 603.08), controlPoint2: CGPoint(x: 361.31, y: 596.86)) bezier13Path.close() bezier13Path.move(to: CGPoint(x: 644.32, y: 680)) bezier13Path.addLine(to: CGPoint(x: 353.68, y: 680)) bezier13Path.addCurve(to: CGPoint(x: 326, y: 652.29), controlPoint1: CGPoint(x: 338.41, y: 680), controlPoint2: CGPoint(x: 326, y: 667.58)) bezier13Path.addLine(to: CGPoint(x: 326, y: 610.71)) bezier13Path.addCurve(to: CGPoint(x: 353.68, y: 583), controlPoint1: CGPoint(x: 326, y: 595.42), controlPoint2: CGPoint(x: 338.41, y: 583)) bezier13Path.addCurve(to: CGPoint(x: 381.36, y: 610.71), controlPoint1: CGPoint(x: 368.95, y: 583), controlPoint2: CGPoint(x: 381.36, y: 595.42)) bezier13Path.addLine(to: CGPoint(x: 381.36, y: 624.57)) bezier13Path.addLine(to: CGPoint(x: 616.64, y: 624.57)) bezier13Path.addLine(to: CGPoint(x: 616.64, y: 610.71)) bezier13Path.addCurve(to: CGPoint(x: 644.32, y: 583), controlPoint1: CGPoint(x: 616.64, y: 595.42), controlPoint2: CGPoint(x: 629.05, y: 583)) bezier13Path.addCurve(to: CGPoint(x: 672, y: 610.71), controlPoint1: CGPoint(x: 659.59, y: 583), controlPoint2: CGPoint(x: 672, y: 595.42)) bezier13Path.addLine(to: CGPoint(x: 672, y: 652.29)) bezier13Path.addCurve(to: CGPoint(x: 644.32, y: 680), controlPoint1: CGPoint(x: 672, y: 667.58), controlPoint2: CGPoint(x: 659.6, y: 680)) bezier13Path.close() bezier13Path.usesEvenOddFillRule = true dark.setFill() bezier13Path.fill() //// Rectangle 6 Drawing let rectangle6Path = UIBezierPath(roundedRect: CGRect(x: 112, y: 279, width: 14, height: 55), cornerRadius: 7) dark.setFill() rectangle6Path.fill() //// Bezier 14 Drawing let bezier14Path = UIBezierPath() bezier14Path.move(to: CGPoint(x: 879.09, y: 293)) bezier14Path.addLine(to: CGPoint(x: 118.91, y: 293)) bezier14Path.addCurve(to: CGPoint(x: 112, y: 286), controlPoint1: CGPoint(x: 115.09, y: 293), controlPoint2: CGPoint(x: 112, y: 289.87)) bezier14Path.addCurve(to: CGPoint(x: 118.91, y: 279), controlPoint1: CGPoint(x: 112, y: 282.13), controlPoint2: CGPoint(x: 115.09, y: 279)) bezier14Path.addLine(to: CGPoint(x: 879.09, y: 279)) bezier14Path.addCurve(to: CGPoint(x: 886, y: 286), controlPoint1: CGPoint(x: 882.91, y: 279), controlPoint2: CGPoint(x: 886, y: 282.13)) bezier14Path.addCurve(to: CGPoint(x: 879.09, y: 293), controlPoint1: CGPoint(x: 886, y: 289.87), controlPoint2: CGPoint(x: 882.91, y: 293)) bezier14Path.close() bezier14Path.usesEvenOddFillRule = true dark.setFill() bezier14Path.fill() //// Rectangle 7 Drawing let rectangle7Path = UIBezierPath(roundedRect: CGRect(x: 872, y: 279, width: 14, height: 55), cornerRadius: 7) dark.setFill() rectangle7Path.fill() //// Bezier 15 Drawing let bezier15Path = UIBezierPath() bezier15Path.move(to: CGPoint(x: 879.09, y: 238)) bezier15Path.addLine(to: CGPoint(x: 340.05, y: 238)) bezier15Path.addCurve(to: CGPoint(x: 335.17, y: 235.99), controlPoint1: CGPoint(x: 338.22, y: 238), controlPoint2: CGPoint(x: 336.46, y: 237.27)) bezier15Path.addLine(to: CGPoint(x: 295.73, y: 196.75)) bezier15Path.addLine(to: CGPoint(x: 167.29, y: 196.75)) bezier15Path.addLine(to: CGPoint(x: 167.29, y: 231.12)) bezier15Path.addCurve(to: CGPoint(x: 160.38, y: 238), controlPoint1: CGPoint(x: 167.29, y: 234.92), controlPoint2: CGPoint(x: 164.19, y: 238)) bezier15Path.addLine(to: CGPoint(x: 118.91, y: 238)) bezier15Path.addCurve(to: CGPoint(x: 112, y: 231.12), controlPoint1: CGPoint(x: 115.09, y: 238), controlPoint2: CGPoint(x: 112, y: 234.92)) bezier15Path.addCurve(to: CGPoint(x: 118.91, y: 224.25), controlPoint1: CGPoint(x: 112, y: 227.32), controlPoint2: CGPoint(x: 115.09, y: 224.25)) bezier15Path.addLine(to: CGPoint(x: 153.46, y: 224.25)) bezier15Path.addLine(to: CGPoint(x: 153.46, y: 189.87)) bezier15Path.addCurve(to: CGPoint(x: 160.38, y: 183), controlPoint1: CGPoint(x: 153.46, y: 186.08), controlPoint2: CGPoint(x: 156.56, y: 183)) bezier15Path.addLine(to: CGPoint(x: 298.59, y: 183)) bezier15Path.addCurve(to: CGPoint(x: 303.47, y: 185.01), controlPoint1: CGPoint(x: 300.42, y: 183), controlPoint2: CGPoint(x: 302.18, y: 183.73)) bezier15Path.addLine(to: CGPoint(x: 342.91, y: 224.25)) bezier15Path.addLine(to: CGPoint(x: 879.09, y: 224.25)) bezier15Path.addCurve(to: CGPoint(x: 886, y: 231.12), controlPoint1: CGPoint(x: 882.91, y: 224.25), controlPoint2: CGPoint(x: 886, y: 227.32)) bezier15Path.addCurve(to: CGPoint(x: 879.09, y: 238), controlPoint1: CGPoint(x: 886, y: 234.92), controlPoint2: CGPoint(x: 882.91, y: 238)) bezier15Path.close() bezier15Path.usesEvenOddFillRule = true dark.setFill() bezier15Path.fill() //// Rectangle 8 Drawing let rectangle8Path = UIBezierPath(roundedRect: CGRect(x: 872, y: 224, width: 14, height: 55), cornerRadius: 7) dark.setFill() rectangle8Path.fill() //// Rectangle 9 Drawing let rectangle9Path = UIBezierPath(roundedRect: CGRect(x: 112, y: 224, width: 14, height: 55), cornerRadius: 7) dark.setFill() rectangle9Path.fill() //// Bezier 16 Drawing let bezier16Path = UIBezierPath() bezier16Path.move(to: CGPoint(x: 838.09, y: 265)) bezier16Path.addLine(to: CGPoint(x: 160.91, y: 265)) bezier16Path.addCurve(to: CGPoint(x: 154, y: 258), controlPoint1: CGPoint(x: 157.09, y: 265), controlPoint2: CGPoint(x: 154, y: 261.87)) bezier16Path.addCurve(to: CGPoint(x: 160.91, y: 251), controlPoint1: CGPoint(x: 154, y: 254.13), controlPoint2: CGPoint(x: 157.09, y: 251)) bezier16Path.addLine(to: CGPoint(x: 838.09, y: 251)) bezier16Path.addCurve(to: CGPoint(x: 845, y: 258), controlPoint1: CGPoint(x: 841.91, y: 251), controlPoint2: CGPoint(x: 845, y: 254.13)) bezier16Path.addCurve(to: CGPoint(x: 838.09, y: 265), controlPoint1: CGPoint(x: 845, y: 261.87), controlPoint2: CGPoint(x: 841.91, y: 265)) bezier16Path.close() bezier16Path.usesEvenOddFillRule = true dark.setFill() bezier16Path.fill() //// Bezier 17 Drawing let bezier17Path = UIBezierPath() bezier17Path.move(to: CGPoint(x: 838.09, y: 196)) bezier17Path.addLine(to: CGPoint(x: 326.91, y: 196)) bezier17Path.addCurve(to: CGPoint(x: 320, y: 189), controlPoint1: CGPoint(x: 323.09, y: 196), controlPoint2: CGPoint(x: 320, y: 192.87)) bezier17Path.addCurve(to: CGPoint(x: 326.91, y: 182), controlPoint1: CGPoint(x: 320, y: 185.13), controlPoint2: CGPoint(x: 323.09, y: 182)) bezier17Path.addLine(to: CGPoint(x: 838.09, y: 182)) bezier17Path.addCurve(to: CGPoint(x: 845, y: 189), controlPoint1: CGPoint(x: 841.91, y: 182), controlPoint2: CGPoint(x: 845, y: 185.13)) bezier17Path.addCurve(to: CGPoint(x: 838.09, y: 196), controlPoint1: CGPoint(x: 845, y: 192.87), controlPoint2: CGPoint(x: 841.91, y: 196)) bezier17Path.close() bezier17Path.usesEvenOddFillRule = true dark.setFill() bezier17Path.fill() //// Rectangle 10 Drawing let rectangle10Path = UIBezierPath(roundedRect: CGRect(x: 831, y: 183, width: 14, height: 41), cornerRadius: 7) dark.setFill() rectangle10Path.fill() //// Bezier 18 Drawing let bezier18Path = UIBezierPath() bezier18Path.move(to: CGPoint(x: 838.09, y: 141)) bezier18Path.addLine(to: CGPoint(x: 382.03, y: 141)) bezier18Path.addCurve(to: CGPoint(x: 378.2, y: 139.85), controlPoint1: CGPoint(x: 380.67, y: 141), controlPoint2: CGPoint(x: 379.33, y: 140.6)) bezier18Path.addLine(to: CGPoint(x: 338.48, y: 113.67)) bezier18Path.addLine(to: CGPoint(x: 209.28, y: 113.67)) bezier18Path.addLine(to: CGPoint(x: 209.28, y: 134.17)) bezier18Path.addCurve(to: CGPoint(x: 202.37, y: 141), controlPoint1: CGPoint(x: 209.28, y: 137.94), controlPoint2: CGPoint(x: 206.19, y: 141)) bezier18Path.addLine(to: CGPoint(x: 160.91, y: 141)) bezier18Path.addCurve(to: CGPoint(x: 154, y: 134.17), controlPoint1: CGPoint(x: 157.09, y: 141), controlPoint2: CGPoint(x: 154, y: 137.94)) bezier18Path.addCurve(to: CGPoint(x: 160.91, y: 127.33), controlPoint1: CGPoint(x: 154, y: 130.39), controlPoint2: CGPoint(x: 157.09, y: 127.33)) bezier18Path.addLine(to: CGPoint(x: 195.46, y: 127.33)) bezier18Path.addLine(to: CGPoint(x: 195.46, y: 106.83)) bezier18Path.addCurve(to: CGPoint(x: 202.37, y: 100), controlPoint1: CGPoint(x: 195.46, y: 103.05), controlPoint2: CGPoint(x: 198.55, y: 100)) bezier18Path.addLine(to: CGPoint(x: 340.57, y: 100)) bezier18Path.addCurve(to: CGPoint(x: 344.4, y: 101.15), controlPoint1: CGPoint(x: 341.93, y: 100), controlPoint2: CGPoint(x: 343.27, y: 100.4)) bezier18Path.addLine(to: CGPoint(x: 384.12, y: 127.33)) bezier18Path.addLine(to: CGPoint(x: 838.09, y: 127.33)) bezier18Path.addCurve(to: CGPoint(x: 845, y: 134.17), controlPoint1: CGPoint(x: 841.91, y: 127.33), controlPoint2: CGPoint(x: 845, y: 130.39)) bezier18Path.addCurve(to: CGPoint(x: 838.09, y: 141), controlPoint1: CGPoint(x: 845, y: 137.94), controlPoint2: CGPoint(x: 841.91, y: 141)) bezier18Path.close() bezier18Path.usesEvenOddFillRule = true dark.setFill() bezier18Path.fill() //// Rectangle 11 Drawing let rectangle11Path = UIBezierPath(roundedRect: CGRect(x: 831, y: 127, width: 14, height: 55), cornerRadius: 7) dark.setFill() rectangle11Path.fill() //// Rectangle 12 Drawing let rectangle12Path = UIBezierPath(roundedRect: CGRect(x: 154, y: 127, width: 14, height: 55), cornerRadius: 7) dark.setFill() rectangle12Path.fill() //// Bezier 19 Drawing let bezier19Path = UIBezierPath() bezier19Path.move(to: CGPoint(x: 796.09, y: 169)) bezier19Path.addLine(to: CGPoint(x: 201.91, y: 169)) bezier19Path.addCurve(to: CGPoint(x: 195, y: 162), controlPoint1: CGPoint(x: 198.09, y: 169), controlPoint2: CGPoint(x: 195, y: 165.87)) bezier19Path.addCurve(to: CGPoint(x: 201.91, y: 155), controlPoint1: CGPoint(x: 195, y: 158.13), controlPoint2: CGPoint(x: 198.09, y: 155)) bezier19Path.addLine(to: CGPoint(x: 796.09, y: 155)) bezier19Path.addCurve(to: CGPoint(x: 803, y: 162), controlPoint1: CGPoint(x: 799.91, y: 155), controlPoint2: CGPoint(x: 803, y: 158.13)) bezier19Path.addCurve(to: CGPoint(x: 796.09, y: 169), controlPoint1: CGPoint(x: 803, y: 165.87), controlPoint2: CGPoint(x: 799.91, y: 169)) bezier19Path.close() bezier19Path.usesEvenOddFillRule = true dark.setFill() bezier19Path.fill() //// Bezier 20 Drawing let bezier20Path = UIBezierPath() bezier20Path.move(to: CGPoint(x: 119, y: 832)) bezier20Path.addCurve(to: CGPoint(x: 112, y: 825.1), controlPoint1: CGPoint(x: 115.13, y: 832), controlPoint2: CGPoint(x: 112, y: 828.91)) bezier20Path.addLine(to: CGPoint(x: 112, y: 410.9)) bezier20Path.addCurve(to: CGPoint(x: 119, y: 404), controlPoint1: CGPoint(x: 112, y: 407.09), controlPoint2: CGPoint(x: 115.13, y: 404)) bezier20Path.addCurve(to: CGPoint(x: 126, y: 410.9), controlPoint1: CGPoint(x: 122.87, y: 404), controlPoint2: CGPoint(x: 126, y: 407.09)) bezier20Path.addLine(to: CGPoint(x: 126, y: 825.1)) bezier20Path.addCurve(to: CGPoint(x: 119, y: 832), controlPoint1: CGPoint(x: 126, y: 828.91), controlPoint2: CGPoint(x: 122.87, y: 832)) bezier20Path.close() bezier20Path.usesEvenOddFillRule = true dark.setFill() bezier20Path.fill() //// Bezier 21 Drawing let bezier21Path = UIBezierPath() bezier21Path.move(to: CGPoint(x: 879, y: 832)) bezier21Path.addCurve(to: CGPoint(x: 872, y: 825.1), controlPoint1: CGPoint(x: 875.13, y: 832), controlPoint2: CGPoint(x: 872, y: 828.91)) bezier21Path.addLine(to: CGPoint(x: 872, y: 410.9)) bezier21Path.addCurve(to: CGPoint(x: 879, y: 404), controlPoint1: CGPoint(x: 872, y: 407.09), controlPoint2: CGPoint(x: 875.13, y: 404)) bezier21Path.addCurve(to: CGPoint(x: 886, y: 410.9), controlPoint1: CGPoint(x: 882.87, y: 404), controlPoint2: CGPoint(x: 886, y: 407.09)) bezier21Path.addLine(to: CGPoint(x: 886, y: 825.1)) bezier21Path.addCurve(to: CGPoint(x: 879, y: 832), controlPoint1: CGPoint(x: 886, y: 828.91), controlPoint2: CGPoint(x: 882.87, y: 832)) bezier21Path.close() bezier21Path.usesEvenOddFillRule = true dark.setFill() bezier21Path.fill() context.restoreGState() } @objc dynamic public class func drawCalendar(frame targetFrame: CGRect = CGRect(x: 0, y: 0, width: 1000, height: 1000), resizing: ResizingBehavior = .aspectFit, white: UIColor = UIColor(red: 1.000, green: 1.000, blue: 1.000, alpha: 1.000), light: UIColor = UIColor(red: 0.769, green: 0.847, blue: 0.984, alpha: 1.000), medium: UIColor = UIColor(red: 0.478, green: 0.663, blue: 0.973, alpha: 1.000), dark: UIColor = UIColor(red: 0.000, green: 0.478, blue: 1.000, alpha: 1.000)) { //// General Declarations let context = UIGraphicsGetCurrentContext()! //// Resize to Target Frame context.saveGState() let resizedFrame: CGRect = resizing.apply(rect: CGRect(x: 0, y: 0, width: 1000, height: 1000), target: targetFrame) context.translateBy(x: resizedFrame.minX, y: resizedFrame.minY) context.scaleBy(x: resizedFrame.width / 1000, y: resizedFrame.height / 1000) //// Group 2 //// Group 3 context.saveGState() context.beginTransparencyLayer(auxiliaryInfo: nil) //// Clip Clip let clipPath = UIBezierPath(rect: CGRect(x: 33.43, y: 700.48, width: 682.35, height: 148.35)) clipPath.addClip() //// Rectangle Drawing let rectanglePath = UIBezierPath(rect: CGRect(x: 28.43, y: 695.48, width: 692.35, height: 158.35)) white.setFill() rectanglePath.fill() context.endTransparencyLayer() context.restoreGState() //// Bezier Drawing let bezierPath = UIBezierPath() bezierPath.move(to: CGPoint(x: 715.77, y: 819.12)) bezierPath.addLine(to: CGPoint(x: 152.08, y: 819.12)) bezierPath.addLine(to: CGPoint(x: 33.42, y: 700.45)) bezierPath.addLine(to: CGPoint(x: 33.42, y: 314.78)) bezierPath.addLine(to: CGPoint(x: 715.77, y: 314.78)) bezierPath.addLine(to: CGPoint(x: 715.77, y: 819.12)) bezierPath.close() bezierPath.usesEvenOddFillRule = true light.setFill() bezierPath.fill() //// Rectangle 3 Drawing let rectangle3Path = UIBezierPath(rect: CGRect(x: 33.43, y: 181.3, width: 682.35, height: 133.5)) medium.setFill() rectangle3Path.fill() //// Rectangle 4 Drawing let rectangle4Path = UIBezierPath(roundedRect: CGRect(x: 137.28, y: 121.97, width: 29.65, height: 118.65), cornerRadius: 14.8) light.setFill() rectangle4Path.fill() //// Rectangle 5 Drawing let rectangle5Path = UIBezierPath(roundedRect: CGRect(x: 285.58, y: 121.97, width: 29.65, height: 118.65), cornerRadius: 14.8) light.setFill() rectangle5Path.fill() //// Rectangle 6 Drawing let rectangle6Path = UIBezierPath(roundedRect: CGRect(x: 433.93, y: 121.97, width: 29.65, height: 118.65), cornerRadius: 14.8) light.setFill() rectangle6Path.fill() //// Rectangle 7 Drawing let rectangle7Path = UIBezierPath(roundedRect: CGRect(x: 582.27, y: 121.97, width: 29.65, height: 118.65), cornerRadius: 14.8) light.setFill() rectangle7Path.fill() //// Bezier 2 Drawing let bezier2Path = UIBezierPath() bezier2Path.move(to: CGPoint(x: 597.1, y: 136.78)) bezier2Path.addCurve(to: CGPoint(x: 611.93, y: 151.61), controlPoint1: CGPoint(x: 605.3, y: 136.78), controlPoint2: CGPoint(x: 611.93, y: 143.42)) bezier2Path.addLine(to: CGPoint(x: 611.93, y: 136.78)) bezier2Path.addCurve(to: CGPoint(x: 597.1, y: 121.94), controlPoint1: CGPoint(x: 611.93, y: 128.58), controlPoint2: CGPoint(x: 605.3, y: 121.94)) bezier2Path.addCurve(to: CGPoint(x: 582.27, y: 136.78), controlPoint1: CGPoint(x: 588.91, y: 121.94), controlPoint2: CGPoint(x: 582.27, y: 128.58)) bezier2Path.addLine(to: CGPoint(x: 582.27, y: 151.61)) bezier2Path.addCurve(to: CGPoint(x: 597.1, y: 136.78), controlPoint1: CGPoint(x: 582.27, y: 143.42), controlPoint2: CGPoint(x: 588.91, y: 136.78)) bezier2Path.close() bezier2Path.usesEvenOddFillRule = true white.setFill() bezier2Path.fill() //// Bezier 3 Drawing let bezier3Path = UIBezierPath() bezier3Path.move(to: CGPoint(x: 448.76, y: 136.78)) bezier3Path.addCurve(to: CGPoint(x: 463.59, y: 151.61), controlPoint1: CGPoint(x: 456.95, y: 136.78), controlPoint2: CGPoint(x: 463.59, y: 143.42)) bezier3Path.addLine(to: CGPoint(x: 463.59, y: 136.78)) bezier3Path.addCurve(to: CGPoint(x: 448.76, y: 121.94), controlPoint1: CGPoint(x: 463.59, y: 128.58), controlPoint2: CGPoint(x: 456.95, y: 121.94)) bezier3Path.addCurve(to: CGPoint(x: 433.93, y: 136.78), controlPoint1: CGPoint(x: 440.57, y: 121.94), controlPoint2: CGPoint(x: 433.93, y: 128.58)) bezier3Path.addLine(to: CGPoint(x: 433.93, y: 151.61)) bezier3Path.addCurve(to: CGPoint(x: 448.76, y: 136.78), controlPoint1: CGPoint(x: 433.93, y: 143.42), controlPoint2: CGPoint(x: 440.57, y: 136.78)) bezier3Path.close() bezier3Path.usesEvenOddFillRule = true white.setFill() bezier3Path.fill() //// Bezier 4 Drawing let bezier4Path = UIBezierPath() bezier4Path.move(to: CGPoint(x: 300.42, y: 136.78)) bezier4Path.addCurve(to: CGPoint(x: 315.26, y: 151.61), controlPoint1: CGPoint(x: 308.61, y: 136.78), controlPoint2: CGPoint(x: 315.26, y: 143.42)) bezier4Path.addLine(to: CGPoint(x: 315.26, y: 136.78)) bezier4Path.addCurve(to: CGPoint(x: 300.42, y: 121.94), controlPoint1: CGPoint(x: 315.26, y: 128.58), controlPoint2: CGPoint(x: 308.61, y: 121.94)) bezier4Path.addCurve(to: CGPoint(x: 285.59, y: 136.78), controlPoint1: CGPoint(x: 292.23, y: 121.94), controlPoint2: CGPoint(x: 285.59, y: 128.58)) bezier4Path.addLine(to: CGPoint(x: 285.59, y: 151.61)) bezier4Path.addCurve(to: CGPoint(x: 300.42, y: 136.78), controlPoint1: CGPoint(x: 285.59, y: 143.42), controlPoint2: CGPoint(x: 292.23, y: 136.78)) bezier4Path.close() bezier4Path.usesEvenOddFillRule = true white.setFill() bezier4Path.fill() //// Bezier 5 Drawing let bezier5Path = UIBezierPath() bezier5Path.move(to: CGPoint(x: 152.08, y: 136.78)) bezier5Path.addCurve(to: CGPoint(x: 166.92, y: 151.61), controlPoint1: CGPoint(x: 160.29, y: 136.78), controlPoint2: CGPoint(x: 166.92, y: 143.42)) bezier5Path.addLine(to: CGPoint(x: 166.92, y: 136.78)) bezier5Path.addCurve(to: CGPoint(x: 152.08, y: 121.94), controlPoint1: CGPoint(x: 166.92, y: 128.58), controlPoint2: CGPoint(x: 160.29, y: 121.94)) bezier5Path.addCurve(to: CGPoint(x: 137.25, y: 136.78), controlPoint1: CGPoint(x: 143.89, y: 121.94), controlPoint2: CGPoint(x: 137.25, y: 128.58)) bezier5Path.addLine(to: CGPoint(x: 137.25, y: 151.61)) bezier5Path.addCurve(to: CGPoint(x: 152.08, y: 136.78), controlPoint1: CGPoint(x: 137.25, y: 143.42), controlPoint2: CGPoint(x: 143.89, y: 136.78)) bezier5Path.close() bezier5Path.usesEvenOddFillRule = true white.setFill() bezier5Path.fill() //// Bezier 6 Drawing let bezier6Path = UIBezierPath() bezier6Path.move(to: CGPoint(x: 33.42, y: 878.45)) bezier6Path.addLine(to: CGPoint(x: 738.01, y: 878.45)) bezier6Path.addLine(to: CGPoint(x: 738.01, y: 848.79)) bezier6Path.addLine(to: CGPoint(x: 33.42, y: 848.79)) bezier6Path.addLine(to: CGPoint(x: 33.42, y: 878.45)) bezier6Path.close() bezier6Path.usesEvenOddFillRule = true white.setFill() bezier6Path.fill() //// Rectangle 8 Drawing let rectangle8Path = UIBezierPath(rect: CGRect(x: 344.93, y: 359.27, width: 59.35, height: 59.35)) white.setFill() rectangle8Path.fill() //// Rectangle 9 Drawing let rectangle9Path = UIBezierPath(rect: CGRect(x: 433.93, y: 359.27, width: 59.35, height: 59.35)) white.setFill() rectangle9Path.fill() //// Rectangle 10 Drawing let rectangle10Path = UIBezierPath(rect: CGRect(x: 522.93, y: 359.27, width: 59.35, height: 59.35)) white.setFill() rectangle10Path.fill() //// Rectangle 11 Drawing let rectangle11Path = UIBezierPath(rect: CGRect(x: 77.93, y: 448.27, width: 59.35, height: 59.35)) white.setFill() rectangle11Path.fill() //// Rectangle 12 Drawing let rectangle12Path = UIBezierPath(rect: CGRect(x: 166.93, y: 448.27, width: 59.35, height: 59.35)) white.setFill() rectangle12Path.fill() //// Rectangle 13 Drawing let rectangle13Path = UIBezierPath(rect: CGRect(x: 255.93, y: 448.27, width: 59.35, height: 59.35)) white.setFill() rectangle13Path.fill() //// Rectangle 14 Drawing let rectangle14Path = UIBezierPath(rect: CGRect(x: 344.93, y: 448.27, width: 59.35, height: 59.35)) white.setFill() rectangle14Path.fill() //// Rectangle 15 Drawing let rectangle15Path = UIBezierPath(rect: CGRect(x: 433.93, y: 448.27, width: 59.35, height: 59.35)) white.setFill() rectangle15Path.fill() //// Rectangle 16 Drawing let rectangle16Path = UIBezierPath(rect: CGRect(x: 522.93, y: 448.27, width: 59.35, height: 59.35)) white.setFill() rectangle16Path.fill() //// Rectangle 17 Drawing let rectangle17Path = UIBezierPath(rect: CGRect(x: 78.53, y: 537.27, width: 59.35, height: 59.35)) white.setFill() rectangle17Path.fill() //// Rectangle 18 Drawing let rectangle18Path = UIBezierPath(rect: CGRect(x: 77.93, y: 626.27, width: 59.35, height: 59.35)) white.setFill() rectangle18Path.fill() //// Rectangle 19 Drawing let rectangle19Path = UIBezierPath(rect: CGRect(x: 166.93, y: 626.27, width: 59.35, height: 59.35)) white.setFill() rectangle19Path.fill() //// Rectangle 20 Drawing let rectangle20Path = UIBezierPath(rect: CGRect(x: 256.52, y: 626.27, width: 59.35, height: 59.35)) white.setFill() rectangle20Path.fill() //// Rectangle 21 Drawing let rectangle21Path = UIBezierPath(rect: CGRect(x: 345.53, y: 626.27, width: 59.35, height: 59.35)) white.setFill() rectangle21Path.fill() //// Rectangle 22 Drawing let rectangle22Path = UIBezierPath(rect: CGRect(x: 434.53, y: 626.27, width: 59.35, height: 59.35)) white.setFill() rectangle22Path.fill() //// Rectangle 23 Drawing let rectangle23Path = UIBezierPath(rect: CGRect(x: 434.53, y: 715.27, width: 59.35, height: 59.35)) white.setFill() rectangle23Path.fill() //// Rectangle 24 Drawing let rectangle24Path = UIBezierPath(rect: CGRect(x: 345.53, y: 715.27, width: 59.35, height: 59.35)) white.setFill() rectangle24Path.fill() //// Rectangle 25 Drawing let rectangle25Path = UIBezierPath(rect: CGRect(x: 255.93, y: 715.27, width: 59.35, height: 59.35)) white.setFill() rectangle25Path.fill() //// Rectangle 26 Drawing let rectangle26Path = UIBezierPath(rect: CGRect(x: 166.93, y: 715.27, width: 59.35, height: 59.35)) white.setFill() rectangle26Path.fill() //// Rectangle 27 Drawing let rectangle27Path = UIBezierPath(rect: CGRect(x: 167.53, y: 537.27, width: 59.35, height: 59.35)) white.setFill() rectangle27Path.fill() //// Rectangle 28 Drawing let rectangle28Path = UIBezierPath(rect: CGRect(x: 256.52, y: 537.27, width: 59.35, height: 59.35)) white.setFill() rectangle28Path.fill() //// Rectangle 29 Drawing let rectangle29Path = UIBezierPath(rect: CGRect(x: 345.53, y: 537.27, width: 59.35, height: 59.35)) white.setFill() rectangle29Path.fill() //// Rectangle 30 Drawing let rectangle30Path = UIBezierPath(rect: CGRect(x: 434.53, y: 537.27, width: 59.35, height: 59.35)) white.setFill() rectangle30Path.fill() //// Bezier 7 Drawing let bezier7Path = UIBezierPath() bezier7Path.move(to: CGPoint(x: 152.08, y: 819.12)) bezier7Path.addLine(to: CGPoint(x: 152.08, y: 700.45)) bezier7Path.addLine(to: CGPoint(x: 33.42, y: 700.45)) bezier7Path.addLine(to: CGPoint(x: 152.08, y: 819.12)) bezier7Path.close() bezier7Path.usesEvenOddFillRule = true white.setFill() bezier7Path.fill() //// Bezier 8 Drawing let bezier8Path = UIBezierPath() bezier8Path.move(to: CGPoint(x: 715.77, y: 285.12)) bezier8Path.addLine(to: CGPoint(x: 715.77, y: 181.28)) bezier8Path.addLine(to: CGPoint(x: 715.78, y: 181.28)) bezier8Path.addLine(to: CGPoint(x: 715.78, y: 285.12)) bezier8Path.addCurve(to: CGPoint(x: 715.77, y: 285.12), controlPoint1: CGPoint(x: 715.77, y: 285.12), controlPoint2: CGPoint(x: 715.77, y: 285.12)) bezier8Path.close() bezier8Path.usesEvenOddFillRule = true UIColor.red.setFill() bezier8Path.fill() //// Bezier 9 Drawing let bezier9Path = UIBezierPath() bezier9Path.move(to: CGPoint(x: 967.94, y: 648.54)) bezier9Path.addCurve(to: CGPoint(x: 738.01, y: 878.46), controlPoint1: CGPoint(x: 967.94, y: 775.67), controlPoint2: CGPoint(x: 865.14, y: 878.46)) bezier9Path.addCurve(to: CGPoint(x: 508.1, y: 648.54), controlPoint1: CGPoint(x: 610.88, y: 878.46), controlPoint2: CGPoint(x: 508.1, y: 775.67)) bezier9Path.addCurve(to: CGPoint(x: 620.92, y: 371.9), controlPoint1: CGPoint(x: 508.1, y: 531.24), controlPoint2: CGPoint(x: 562.59, y: 438.05)) bezier9Path.addCurve(to: CGPoint(x: 760.26, y: 255.45), controlPoint1: CGPoint(x: 688.06, y: 295.76), controlPoint2: CGPoint(x: 760.26, y: 255.45)) bezier9Path.addCurve(to: CGPoint(x: 760.26, y: 374.12), controlPoint1: CGPoint(x: 760.26, y: 255.45), controlPoint2: CGPoint(x: 726.3, y: 340)) bezier9Path.addCurve(to: CGPoint(x: 849.27, y: 359.28), controlPoint1: CGPoint(x: 794.38, y: 408.08), controlPoint2: CGPoint(x: 849.27, y: 359.28)) bezier9Path.addCurve(to: CGPoint(x: 967.94, y: 648.54), controlPoint1: CGPoint(x: 849.27, y: 359.28), controlPoint2: CGPoint(x: 967.94, y: 485.96)) bezier9Path.close() bezier9Path.usesEvenOddFillRule = true medium.setFill() bezier9Path.fill() //// Bezier 10 Drawing let bezier10Path = UIBezierPath() bezier10Path.move(to: CGPoint(x: 537.76, y: 648.54)) bezier10Path.addCurve(to: CGPoint(x: 752.36, y: 280.08), controlPoint1: CGPoint(x: 537.76, y: 457.61), controlPoint2: CGPoint(x: 682.1, y: 330.61)) bezier10Path.addCurve(to: CGPoint(x: 760.26, y: 255.44), controlPoint1: CGPoint(x: 756.25, y: 265.56), controlPoint2: CGPoint(x: 760.26, y: 255.44)) bezier10Path.addCurve(to: CGPoint(x: 508.1, y: 648.53), controlPoint1: CGPoint(x: 760.26, y: 255.44), controlPoint2: CGPoint(x: 508.1, y: 396.22)) bezier10Path.addCurve(to: CGPoint(x: 738.01, y: 878.46), controlPoint1: CGPoint(x: 508.1, y: 775.66), controlPoint2: CGPoint(x: 610.89, y: 878.46)) bezier10Path.addCurve(to: CGPoint(x: 752.85, y: 877.7), controlPoint1: CGPoint(x: 743.03, y: 878.46), controlPoint2: CGPoint(x: 747.93, y: 878.02)) bezier10Path.addCurve(to: CGPoint(x: 537.76, y: 648.54), controlPoint1: CGPoint(x: 632.69, y: 870.04), controlPoint2: CGPoint(x: 537.76, y: 770.65)) bezier10Path.close() bezier10Path.usesEvenOddFillRule = true light.setFill() bezier10Path.fill() //// Oval Drawing let ovalPath = UIBezierPath(ovalIn: CGRect(x: 537.75, y: 448.3, width: 400.5, height: 400.5)) white.setFill() ovalPath.fill() //// Group 4 context.saveGState() context.beginTransparencyLayer(auxiliaryInfo: nil) //// Clip Clip 2 let clip2Path = UIBezierPath() clip2Path.move(to: CGPoint(x: 48.25, y: 314.79)) clip2Path.addLine(to: CGPoint(x: 33.42, y: 314.79)) clip2Path.addLine(to: CGPoint(x: 48.25, y: 314.78)) clip2Path.addLine(to: CGPoint(x: 48.25, y: 314.79)) clip2Path.close() clip2Path.usesEvenOddFillRule = true clip2Path.addClip() //// Rectangle 31 Drawing let rectangle31Path = UIBezierPath(rect: CGRect(x: 28.43, y: 309.8, width: 24.85, height: 10)) medium.setFill() rectangle31Path.fill() context.endTransparencyLayer() context.restoreGState() //// Bezier 12 Drawing let bezier12Path = UIBezierPath() bezier12Path.move(to: CGPoint(x: 537.76, y: 826.54)) bezier12Path.addLine(to: CGPoint(x: 152.08, y: 826.54)) bezier12Path.addCurve(to: CGPoint(x: 144.67, y: 819.12), controlPoint1: CGPoint(x: 147.99, y: 826.54), controlPoint2: CGPoint(x: 144.67, y: 823.22)) bezier12Path.addCurve(to: CGPoint(x: 152.08, y: 811.71), controlPoint1: CGPoint(x: 144.67, y: 815.03), controlPoint2: CGPoint(x: 147.99, y: 811.71)) bezier12Path.addLine(to: CGPoint(x: 537.76, y: 811.71)) bezier12Path.addCurve(to: CGPoint(x: 545.18, y: 819.12), controlPoint1: CGPoint(x: 541.86, y: 811.71), controlPoint2: CGPoint(x: 545.18, y: 815.03)) bezier12Path.addCurve(to: CGPoint(x: 537.76, y: 826.54), controlPoint1: CGPoint(x: 545.18, y: 823.22), controlPoint2: CGPoint(x: 541.86, y: 826.54)) bezier12Path.close() bezier12Path.usesEvenOddFillRule = true dark.setFill() bezier12Path.fill() //// Group 5 context.saveGState() context.beginTransparencyLayer(auxiliaryInfo: nil) //// Clip Clip 3 let clip3Path = UIBezierPath() clip3Path.move(to: CGPoint(x: 33.42, y: 707.87)) clip3Path.addCurve(to: CGPoint(x: 26, y: 700.45), controlPoint1: CGPoint(x: 29.32, y: 707.87), controlPoint2: CGPoint(x: 26, y: 704.55)) clip3Path.addLine(to: CGPoint(x: 26, y: 181.28)) clip3Path.addCurve(to: CGPoint(x: 33.42, y: 173.86), controlPoint1: CGPoint(x: 26, y: 177.18), controlPoint2: CGPoint(x: 29.32, y: 173.86)) clip3Path.addCurve(to: CGPoint(x: 40.83, y: 181.28), controlPoint1: CGPoint(x: 37.52, y: 173.86), controlPoint2: CGPoint(x: 40.83, y: 177.18)) clip3Path.addLine(to: CGPoint(x: 40.83, y: 700.45)) clip3Path.addCurve(to: CGPoint(x: 33.42, y: 707.87), controlPoint1: CGPoint(x: 40.83, y: 704.55), controlPoint2: CGPoint(x: 37.52, y: 707.87)) clip3Path.close() clip3Path.usesEvenOddFillRule = true clip3Path.addClip() //// Bezier 13 Drawing let bezier13Path = UIBezierPath() bezier13Path.move(to: CGPoint(x: 21, y: 168.86)) bezier13Path.addLine(to: CGPoint(x: 45.83, y: 168.86)) bezier13Path.addLine(to: CGPoint(x: 45.83, y: 712.87)) bezier13Path.addLine(to: CGPoint(x: 21, y: 712.87)) bezier13Path.addLine(to: CGPoint(x: 21, y: 168.86)) bezier13Path.close() dark.setFill() bezier13Path.fill() context.endTransparencyLayer() context.restoreGState() //// Bezier 15 Drawing let bezier15Path = UIBezierPath() bezier15Path.move(to: CGPoint(x: 107.59, y: 188.69)) bezier15Path.addLine(to: CGPoint(x: 33.42, y: 188.69)) bezier15Path.addCurve(to: CGPoint(x: 26, y: 181.28), controlPoint1: CGPoint(x: 29.32, y: 188.69), controlPoint2: CGPoint(x: 26, y: 185.38)) bezier15Path.addCurve(to: CGPoint(x: 33.42, y: 173.86), controlPoint1: CGPoint(x: 26, y: 177.18), controlPoint2: CGPoint(x: 29.32, y: 173.86)) bezier15Path.addLine(to: CGPoint(x: 107.59, y: 173.86)) bezier15Path.addCurve(to: CGPoint(x: 115, y: 181.28), controlPoint1: CGPoint(x: 111.69, y: 173.86), controlPoint2: CGPoint(x: 115, y: 177.18)) bezier15Path.addCurve(to: CGPoint(x: 107.59, y: 188.69), controlPoint1: CGPoint(x: 115, y: 185.38), controlPoint2: CGPoint(x: 111.69, y: 188.69)) bezier15Path.close() bezier15Path.usesEvenOddFillRule = true dark.setFill() bezier15Path.fill() //// Rectangle 32 Drawing let rectangle32Path = UIBezierPath(roundedRect: CGRect(x: 634.2, y: 173.87, width: 89, height: 14.85), cornerRadius: 7.4) dark.setFill() rectangle32Path.fill() //// Rectangle 33 Drawing let rectangle33Path = UIBezierPath(roundedRect: CGRect(x: 708.33, y: 173.88, width: 14.85, height: 74.15), cornerRadius: 7.4) dark.setFill() rectangle33Path.fill() //// Bezier 16 Drawing let bezier16Path = UIBezierPath() bezier16Path.move(to: CGPoint(x: 626.76, y: 322.2)) bezier16Path.addLine(to: CGPoint(x: 33.42, y: 322.2)) bezier16Path.addCurve(to: CGPoint(x: 26, y: 314.78), controlPoint1: CGPoint(x: 29.32, y: 322.2), controlPoint2: CGPoint(x: 26, y: 318.88)) bezier16Path.addCurve(to: CGPoint(x: 33.42, y: 307.36), controlPoint1: CGPoint(x: 26, y: 310.68), controlPoint2: CGPoint(x: 29.32, y: 307.36)) bezier16Path.addLine(to: CGPoint(x: 626.76, y: 307.36)) bezier16Path.addCurve(to: CGPoint(x: 634.18, y: 314.78), controlPoint1: CGPoint(x: 630.87, y: 307.36), controlPoint2: CGPoint(x: 634.18, y: 310.68)) bezier16Path.addCurve(to: CGPoint(x: 626.76, y: 322.2), controlPoint1: CGPoint(x: 634.18, y: 318.88), controlPoint2: CGPoint(x: 630.87, y: 322.2)) bezier16Path.close() bezier16Path.usesEvenOddFillRule = true dark.setFill() bezier16Path.fill() //// Bezier 17 Drawing let bezier17Path = UIBezierPath() bezier17Path.move(to: CGPoint(x: 352.34, y: 411.2)) bezier17Path.addLine(to: CGPoint(x: 396.84, y: 411.2)) bezier17Path.addLine(to: CGPoint(x: 396.84, y: 366.7)) bezier17Path.addLine(to: CGPoint(x: 352.34, y: 366.7)) bezier17Path.addLine(to: CGPoint(x: 352.34, y: 411.2)) bezier17Path.close() bezier17Path.move(to: CGPoint(x: 404.26, y: 426.03)) bezier17Path.addLine(to: CGPoint(x: 344.93, y: 426.03)) bezier17Path.addCurve(to: CGPoint(x: 337.51, y: 418.61), controlPoint1: CGPoint(x: 340.83, y: 426.03), controlPoint2: CGPoint(x: 337.51, y: 422.71)) bezier17Path.addLine(to: CGPoint(x: 337.51, y: 359.28)) bezier17Path.addCurve(to: CGPoint(x: 344.93, y: 351.86), controlPoint1: CGPoint(x: 337.51, y: 355.18), controlPoint2: CGPoint(x: 340.83, y: 351.86)) bezier17Path.addLine(to: CGPoint(x: 404.26, y: 351.86)) bezier17Path.addCurve(to: CGPoint(x: 411.68, y: 359.28), controlPoint1: CGPoint(x: 408.36, y: 351.86), controlPoint2: CGPoint(x: 411.68, y: 355.18)) bezier17Path.addLine(to: CGPoint(x: 411.68, y: 418.61)) bezier17Path.addCurve(to: CGPoint(x: 404.26, y: 426.03), controlPoint1: CGPoint(x: 411.68, y: 422.71), controlPoint2: CGPoint(x: 408.36, y: 426.03)) bezier17Path.close() bezier17Path.usesEvenOddFillRule = true dark.setFill() bezier17Path.fill() //// Bezier 18 Drawing let bezier18Path = UIBezierPath() bezier18Path.move(to: CGPoint(x: 441.34, y: 411.2)) bezier18Path.addLine(to: CGPoint(x: 485.85, y: 411.2)) bezier18Path.addLine(to: CGPoint(x: 485.85, y: 366.7)) bezier18Path.addLine(to: CGPoint(x: 441.34, y: 366.7)) bezier18Path.addLine(to: CGPoint(x: 441.34, y: 411.2)) bezier18Path.close() bezier18Path.move(to: CGPoint(x: 493.27, y: 426.03)) bezier18Path.addLine(to: CGPoint(x: 433.93, y: 426.03)) bezier18Path.addCurve(to: CGPoint(x: 426.51, y: 418.61), controlPoint1: CGPoint(x: 429.83, y: 426.03), controlPoint2: CGPoint(x: 426.51, y: 422.71)) bezier18Path.addLine(to: CGPoint(x: 426.51, y: 359.28)) bezier18Path.addCurve(to: CGPoint(x: 433.93, y: 351.86), controlPoint1: CGPoint(x: 426.51, y: 355.18), controlPoint2: CGPoint(x: 429.83, y: 351.86)) bezier18Path.addLine(to: CGPoint(x: 493.27, y: 351.86)) bezier18Path.addCurve(to: CGPoint(x: 500.68, y: 359.28), controlPoint1: CGPoint(x: 497.37, y: 351.86), controlPoint2: CGPoint(x: 500.68, y: 355.18)) bezier18Path.addLine(to: CGPoint(x: 500.68, y: 418.61)) bezier18Path.addCurve(to: CGPoint(x: 493.27, y: 426.03), controlPoint1: CGPoint(x: 500.68, y: 422.71), controlPoint2: CGPoint(x: 497.37, y: 426.03)) bezier18Path.close() bezier18Path.usesEvenOddFillRule = true dark.setFill() bezier18Path.fill() //// Bezier 19 Drawing let bezier19Path = UIBezierPath() bezier19Path.move(to: CGPoint(x: 522.93, y: 426.03)) bezier19Path.addCurve(to: CGPoint(x: 515.51, y: 418.61), controlPoint1: CGPoint(x: 518.83, y: 426.03), controlPoint2: CGPoint(x: 515.51, y: 422.71)) bezier19Path.addLine(to: CGPoint(x: 515.51, y: 359.28)) bezier19Path.addCurve(to: CGPoint(x: 522.93, y: 351.86), controlPoint1: CGPoint(x: 515.51, y: 355.18), controlPoint2: CGPoint(x: 518.83, y: 351.86)) bezier19Path.addLine(to: CGPoint(x: 582.27, y: 351.86)) bezier19Path.addCurve(to: CGPoint(x: 589.68, y: 359.28), controlPoint1: CGPoint(x: 586.36, y: 351.86), controlPoint2: CGPoint(x: 589.68, y: 355.18)) bezier19Path.addCurve(to: CGPoint(x: 582.27, y: 366.7), controlPoint1: CGPoint(x: 589.68, y: 363.38), controlPoint2: CGPoint(x: 586.36, y: 366.7)) bezier19Path.addLine(to: CGPoint(x: 530.35, y: 366.7)) bezier19Path.addLine(to: CGPoint(x: 530.35, y: 418.61)) bezier19Path.addCurve(to: CGPoint(x: 522.93, y: 426.03), controlPoint1: CGPoint(x: 530.34, y: 422.71), controlPoint2: CGPoint(x: 527.03, y: 426.03)) bezier19Path.close() bezier19Path.usesEvenOddFillRule = true dark.setFill() bezier19Path.fill() //// Bezier 20 Drawing let bezier20Path = UIBezierPath() bezier20Path.move(to: CGPoint(x: 85.34, y: 500.2)) bezier20Path.addLine(to: CGPoint(x: 129.84, y: 500.2)) bezier20Path.addLine(to: CGPoint(x: 129.84, y: 455.7)) bezier20Path.addLine(to: CGPoint(x: 85.34, y: 455.7)) bezier20Path.addLine(to: CGPoint(x: 85.34, y: 500.2)) bezier20Path.close() bezier20Path.move(to: CGPoint(x: 137.25, y: 515.03)) bezier20Path.addLine(to: CGPoint(x: 77.92, y: 515.03)) bezier20Path.addCurve(to: CGPoint(x: 70.5, y: 507.62), controlPoint1: CGPoint(x: 73.82, y: 515.03), controlPoint2: CGPoint(x: 70.5, y: 511.72)) bezier20Path.addLine(to: CGPoint(x: 70.5, y: 448.28)) bezier20Path.addCurve(to: CGPoint(x: 77.92, y: 440.86), controlPoint1: CGPoint(x: 70.5, y: 444.18), controlPoint2: CGPoint(x: 73.82, y: 440.86)) bezier20Path.addLine(to: CGPoint(x: 137.26, y: 440.86)) bezier20Path.addCurve(to: CGPoint(x: 144.67, y: 448.28), controlPoint1: CGPoint(x: 141.35, y: 440.86), controlPoint2: CGPoint(x: 144.67, y: 444.18)) bezier20Path.addLine(to: CGPoint(x: 144.67, y: 507.62)) bezier20Path.addCurve(to: CGPoint(x: 137.25, y: 515.03), controlPoint1: CGPoint(x: 144.67, y: 511.72), controlPoint2: CGPoint(x: 141.35, y: 515.03)) bezier20Path.close() bezier20Path.usesEvenOddFillRule = true dark.setFill() bezier20Path.fill() //// Bezier 21 Drawing let bezier21Path = UIBezierPath() bezier21Path.move(to: CGPoint(x: 174.34, y: 500.2)) bezier21Path.addLine(to: CGPoint(x: 218.84, y: 500.2)) bezier21Path.addLine(to: CGPoint(x: 218.84, y: 455.7)) bezier21Path.addLine(to: CGPoint(x: 174.34, y: 455.7)) bezier21Path.addLine(to: CGPoint(x: 174.34, y: 500.2)) bezier21Path.close() bezier21Path.move(to: CGPoint(x: 226.26, y: 515.03)) bezier21Path.addLine(to: CGPoint(x: 166.92, y: 515.03)) bezier21Path.addCurve(to: CGPoint(x: 159.5, y: 507.62), controlPoint1: CGPoint(x: 162.82, y: 515.03), controlPoint2: CGPoint(x: 159.5, y: 511.72)) bezier21Path.addLine(to: CGPoint(x: 159.5, y: 448.28)) bezier21Path.addCurve(to: CGPoint(x: 166.92, y: 440.86), controlPoint1: CGPoint(x: 159.5, y: 444.18), controlPoint2: CGPoint(x: 162.82, y: 440.86)) bezier21Path.addLine(to: CGPoint(x: 226.26, y: 440.86)) bezier21Path.addCurve(to: CGPoint(x: 233.67, y: 448.28), controlPoint1: CGPoint(x: 230.35, y: 440.86), controlPoint2: CGPoint(x: 233.67, y: 444.18)) bezier21Path.addLine(to: CGPoint(x: 233.67, y: 507.62)) bezier21Path.addCurve(to: CGPoint(x: 226.26, y: 515.03), controlPoint1: CGPoint(x: 233.67, y: 511.72), controlPoint2: CGPoint(x: 230.35, y: 515.03)) bezier21Path.close() bezier21Path.usesEvenOddFillRule = true dark.setFill() bezier21Path.fill() //// Bezier 22 Drawing let bezier22Path = UIBezierPath() bezier22Path.move(to: CGPoint(x: 263.34, y: 500.2)) bezier22Path.addLine(to: CGPoint(x: 307.84, y: 500.2)) bezier22Path.addLine(to: CGPoint(x: 307.84, y: 455.7)) bezier22Path.addLine(to: CGPoint(x: 263.34, y: 455.7)) bezier22Path.addLine(to: CGPoint(x: 263.34, y: 500.2)) bezier22Path.close() bezier22Path.move(to: CGPoint(x: 315.26, y: 515.03)) bezier22Path.addLine(to: CGPoint(x: 255.92, y: 515.03)) bezier22Path.addCurve(to: CGPoint(x: 248.5, y: 507.62), controlPoint1: CGPoint(x: 251.82, y: 515.03), controlPoint2: CGPoint(x: 248.5, y: 511.72)) bezier22Path.addLine(to: CGPoint(x: 248.5, y: 448.28)) bezier22Path.addCurve(to: CGPoint(x: 255.92, y: 440.86), controlPoint1: CGPoint(x: 248.5, y: 444.18), controlPoint2: CGPoint(x: 251.82, y: 440.86)) bezier22Path.addLine(to: CGPoint(x: 315.26, y: 440.86)) bezier22Path.addCurve(to: CGPoint(x: 322.67, y: 448.28), controlPoint1: CGPoint(x: 319.36, y: 440.86), controlPoint2: CGPoint(x: 322.67, y: 444.18)) bezier22Path.addLine(to: CGPoint(x: 322.67, y: 507.62)) bezier22Path.addCurve(to: CGPoint(x: 315.26, y: 515.03), controlPoint1: CGPoint(x: 322.67, y: 511.72), controlPoint2: CGPoint(x: 319.36, y: 515.03)) bezier22Path.close() bezier22Path.usesEvenOddFillRule = true dark.setFill() bezier22Path.fill() //// Bezier 23 Drawing let bezier23Path = UIBezierPath() bezier23Path.move(to: CGPoint(x: 352.34, y: 500.2)) bezier23Path.addLine(to: CGPoint(x: 396.84, y: 500.2)) bezier23Path.addLine(to: CGPoint(x: 396.84, y: 455.7)) bezier23Path.addLine(to: CGPoint(x: 352.34, y: 455.7)) bezier23Path.addLine(to: CGPoint(x: 352.34, y: 500.2)) bezier23Path.close() bezier23Path.move(to: CGPoint(x: 404.26, y: 515.03)) bezier23Path.addLine(to: CGPoint(x: 344.93, y: 515.03)) bezier23Path.addCurve(to: CGPoint(x: 337.51, y: 507.62), controlPoint1: CGPoint(x: 340.83, y: 515.03), controlPoint2: CGPoint(x: 337.51, y: 511.72)) bezier23Path.addLine(to: CGPoint(x: 337.51, y: 448.28)) bezier23Path.addCurve(to: CGPoint(x: 344.93, y: 440.86), controlPoint1: CGPoint(x: 337.51, y: 444.18), controlPoint2: CGPoint(x: 340.83, y: 440.86)) bezier23Path.addLine(to: CGPoint(x: 404.26, y: 440.86)) bezier23Path.addCurve(to: CGPoint(x: 411.68, y: 448.28), controlPoint1: CGPoint(x: 408.36, y: 440.86), controlPoint2: CGPoint(x: 411.68, y: 444.18)) bezier23Path.addLine(to: CGPoint(x: 411.68, y: 507.62)) bezier23Path.addCurve(to: CGPoint(x: 404.26, y: 515.03), controlPoint1: CGPoint(x: 411.68, y: 511.72), controlPoint2: CGPoint(x: 408.36, y: 515.03)) bezier23Path.close() bezier23Path.usesEvenOddFillRule = true dark.setFill() bezier23Path.fill() //// Bezier 24 Drawing let bezier24Path = UIBezierPath() bezier24Path.move(to: CGPoint(x: 441.34, y: 500.2)) bezier24Path.addLine(to: CGPoint(x: 485.85, y: 500.2)) bezier24Path.addLine(to: CGPoint(x: 485.85, y: 455.7)) bezier24Path.addLine(to: CGPoint(x: 441.34, y: 455.7)) bezier24Path.addLine(to: CGPoint(x: 441.34, y: 500.2)) bezier24Path.close() bezier24Path.move(to: CGPoint(x: 493.27, y: 515.03)) bezier24Path.addLine(to: CGPoint(x: 433.93, y: 515.03)) bezier24Path.addCurve(to: CGPoint(x: 426.51, y: 507.62), controlPoint1: CGPoint(x: 429.83, y: 515.03), controlPoint2: CGPoint(x: 426.51, y: 511.72)) bezier24Path.addLine(to: CGPoint(x: 426.51, y: 448.28)) bezier24Path.addCurve(to: CGPoint(x: 433.93, y: 440.86), controlPoint1: CGPoint(x: 426.51, y: 444.18), controlPoint2: CGPoint(x: 429.83, y: 440.86)) bezier24Path.addLine(to: CGPoint(x: 493.27, y: 440.86)) bezier24Path.addCurve(to: CGPoint(x: 500.68, y: 448.28), controlPoint1: CGPoint(x: 497.37, y: 440.86), controlPoint2: CGPoint(x: 500.68, y: 444.18)) bezier24Path.addLine(to: CGPoint(x: 500.68, y: 507.62)) bezier24Path.addCurve(to: CGPoint(x: 493.27, y: 515.03), controlPoint1: CGPoint(x: 500.68, y: 511.72), controlPoint2: CGPoint(x: 497.37, y: 515.03)) bezier24Path.close() bezier24Path.usesEvenOddFillRule = true dark.setFill() bezier24Path.fill() //// Rectangle 34 Drawing let rectangle34Path = UIBezierPath(roundedRect: CGRect(x: 515.53, y: 440.88, width: 14.85, height: 29.65), cornerRadius: 7.4) dark.setFill() rectangle34Path.fill() //// Bezier 25 Drawing let bezier25Path = UIBezierPath() bezier25Path.move(to: CGPoint(x: 85.34, y: 589.2)) bezier25Path.addLine(to: CGPoint(x: 129.84, y: 589.2)) bezier25Path.addLine(to: CGPoint(x: 129.84, y: 544.7)) bezier25Path.addLine(to: CGPoint(x: 85.34, y: 544.7)) bezier25Path.addLine(to: CGPoint(x: 85.34, y: 589.2)) bezier25Path.close() bezier25Path.move(to: CGPoint(x: 137.25, y: 604.04)) bezier25Path.addLine(to: CGPoint(x: 77.92, y: 604.04)) bezier25Path.addCurve(to: CGPoint(x: 70.5, y: 596.62), controlPoint1: CGPoint(x: 73.82, y: 604.04), controlPoint2: CGPoint(x: 70.5, y: 600.72)) bezier25Path.addLine(to: CGPoint(x: 70.5, y: 537.28)) bezier25Path.addCurve(to: CGPoint(x: 77.92, y: 529.87), controlPoint1: CGPoint(x: 70.5, y: 533.19), controlPoint2: CGPoint(x: 73.82, y: 529.87)) bezier25Path.addLine(to: CGPoint(x: 137.26, y: 529.87)) bezier25Path.addCurve(to: CGPoint(x: 144.67, y: 537.28), controlPoint1: CGPoint(x: 141.35, y: 529.87), controlPoint2: CGPoint(x: 144.67, y: 533.19)) bezier25Path.addLine(to: CGPoint(x: 144.67, y: 596.62)) bezier25Path.addCurve(to: CGPoint(x: 137.25, y: 604.04), controlPoint1: CGPoint(x: 144.67, y: 600.72), controlPoint2: CGPoint(x: 141.35, y: 604.04)) bezier25Path.close() bezier25Path.usesEvenOddFillRule = true dark.setFill() bezier25Path.fill() //// Bezier 26 Drawing let bezier26Path = UIBezierPath() bezier26Path.move(to: CGPoint(x: 174.34, y: 589.2)) bezier26Path.addLine(to: CGPoint(x: 218.84, y: 589.2)) bezier26Path.addLine(to: CGPoint(x: 218.84, y: 544.7)) bezier26Path.addLine(to: CGPoint(x: 174.34, y: 544.7)) bezier26Path.addLine(to: CGPoint(x: 174.34, y: 589.2)) bezier26Path.close() bezier26Path.move(to: CGPoint(x: 226.26, y: 604.04)) bezier26Path.addLine(to: CGPoint(x: 166.92, y: 604.04)) bezier26Path.addCurve(to: CGPoint(x: 159.5, y: 596.62), controlPoint1: CGPoint(x: 162.82, y: 604.04), controlPoint2: CGPoint(x: 159.5, y: 600.72)) bezier26Path.addLine(to: CGPoint(x: 159.5, y: 537.28)) bezier26Path.addCurve(to: CGPoint(x: 166.92, y: 529.87), controlPoint1: CGPoint(x: 159.5, y: 533.19), controlPoint2: CGPoint(x: 162.82, y: 529.87)) bezier26Path.addLine(to: CGPoint(x: 226.26, y: 529.87)) bezier26Path.addCurve(to: CGPoint(x: 233.67, y: 537.28), controlPoint1: CGPoint(x: 230.35, y: 529.87), controlPoint2: CGPoint(x: 233.67, y: 533.19)) bezier26Path.addLine(to: CGPoint(x: 233.67, y: 596.62)) bezier26Path.addCurve(to: CGPoint(x: 226.26, y: 604.04), controlPoint1: CGPoint(x: 233.67, y: 600.72), controlPoint2: CGPoint(x: 230.35, y: 604.04)) bezier26Path.close() bezier26Path.usesEvenOddFillRule = true dark.setFill() bezier26Path.fill() //// Bezier 27 Drawing let bezier27Path = UIBezierPath() bezier27Path.move(to: CGPoint(x: 263.34, y: 589.2)) bezier27Path.addLine(to: CGPoint(x: 307.84, y: 589.2)) bezier27Path.addLine(to: CGPoint(x: 307.84, y: 544.7)) bezier27Path.addLine(to: CGPoint(x: 263.34, y: 544.7)) bezier27Path.addLine(to: CGPoint(x: 263.34, y: 589.2)) bezier27Path.close() bezier27Path.move(to: CGPoint(x: 315.26, y: 604.04)) bezier27Path.addLine(to: CGPoint(x: 255.92, y: 604.04)) bezier27Path.addCurve(to: CGPoint(x: 248.5, y: 596.62), controlPoint1: CGPoint(x: 251.82, y: 604.04), controlPoint2: CGPoint(x: 248.5, y: 600.72)) bezier27Path.addLine(to: CGPoint(x: 248.5, y: 537.28)) bezier27Path.addCurve(to: CGPoint(x: 255.92, y: 529.87), controlPoint1: CGPoint(x: 248.5, y: 533.19), controlPoint2: CGPoint(x: 251.82, y: 529.87)) bezier27Path.addLine(to: CGPoint(x: 315.26, y: 529.87)) bezier27Path.addCurve(to: CGPoint(x: 322.67, y: 537.28), controlPoint1: CGPoint(x: 319.36, y: 529.87), controlPoint2: CGPoint(x: 322.67, y: 533.19)) bezier27Path.addLine(to: CGPoint(x: 322.67, y: 596.62)) bezier27Path.addCurve(to: CGPoint(x: 315.26, y: 604.04), controlPoint1: CGPoint(x: 322.67, y: 600.72), controlPoint2: CGPoint(x: 319.36, y: 604.04)) bezier27Path.close() bezier27Path.usesEvenOddFillRule = true dark.setFill() bezier27Path.fill() //// Bezier 28 Drawing let bezier28Path = UIBezierPath() bezier28Path.move(to: CGPoint(x: 352.34, y: 589.2)) bezier28Path.addLine(to: CGPoint(x: 396.84, y: 589.2)) bezier28Path.addLine(to: CGPoint(x: 396.84, y: 544.7)) bezier28Path.addLine(to: CGPoint(x: 352.34, y: 544.7)) bezier28Path.addLine(to: CGPoint(x: 352.34, y: 589.2)) bezier28Path.close() bezier28Path.move(to: CGPoint(x: 404.26, y: 604.04)) bezier28Path.addLine(to: CGPoint(x: 344.93, y: 604.04)) bezier28Path.addCurve(to: CGPoint(x: 337.51, y: 596.62), controlPoint1: CGPoint(x: 340.83, y: 604.04), controlPoint2: CGPoint(x: 337.51, y: 600.72)) bezier28Path.addLine(to: CGPoint(x: 337.51, y: 537.28)) bezier28Path.addCurve(to: CGPoint(x: 344.93, y: 529.87), controlPoint1: CGPoint(x: 337.51, y: 533.19), controlPoint2: CGPoint(x: 340.83, y: 529.87)) bezier28Path.addLine(to: CGPoint(x: 404.26, y: 529.87)) bezier28Path.addCurve(to: CGPoint(x: 411.68, y: 537.28), controlPoint1: CGPoint(x: 408.36, y: 529.87), controlPoint2: CGPoint(x: 411.68, y: 533.19)) bezier28Path.addLine(to: CGPoint(x: 411.68, y: 596.62)) bezier28Path.addCurve(to: CGPoint(x: 404.26, y: 604.04), controlPoint1: CGPoint(x: 411.68, y: 600.72), controlPoint2: CGPoint(x: 408.36, y: 604.04)) bezier28Path.close() bezier28Path.usesEvenOddFillRule = true dark.setFill() bezier28Path.fill() //// Bezier 29 Drawing let bezier29Path = UIBezierPath() bezier29Path.move(to: CGPoint(x: 433.93, y: 604.04)) bezier29Path.addCurve(to: CGPoint(x: 426.51, y: 596.62), controlPoint1: CGPoint(x: 429.83, y: 604.04), controlPoint2: CGPoint(x: 426.51, y: 600.72)) bezier29Path.addLine(to: CGPoint(x: 426.51, y: 537.28)) bezier29Path.addCurve(to: CGPoint(x: 433.93, y: 529.87), controlPoint1: CGPoint(x: 426.51, y: 533.19), controlPoint2: CGPoint(x: 429.83, y: 529.87)) bezier29Path.addLine(to: CGPoint(x: 493.27, y: 529.87)) bezier29Path.addCurve(to: CGPoint(x: 500.68, y: 537.28), controlPoint1: CGPoint(x: 497.37, y: 529.87), controlPoint2: CGPoint(x: 500.68, y: 533.19)) bezier29Path.addCurve(to: CGPoint(x: 493.27, y: 544.7), controlPoint1: CGPoint(x: 500.68, y: 541.38), controlPoint2: CGPoint(x: 497.37, y: 544.7)) bezier29Path.addLine(to: CGPoint(x: 441.34, y: 544.7)) bezier29Path.addLine(to: CGPoint(x: 441.34, y: 596.62)) bezier29Path.addCurve(to: CGPoint(x: 433.93, y: 604.04), controlPoint1: CGPoint(x: 441.34, y: 600.72), controlPoint2: CGPoint(x: 438.03, y: 604.04)) bezier29Path.close() bezier29Path.usesEvenOddFillRule = true dark.setFill() bezier29Path.fill() //// Bezier 30 Drawing let bezier30Path = UIBezierPath() bezier30Path.move(to: CGPoint(x: 263.34, y: 678.21)) bezier30Path.addLine(to: CGPoint(x: 307.84, y: 678.21)) bezier30Path.addLine(to: CGPoint(x: 307.84, y: 633.71)) bezier30Path.addLine(to: CGPoint(x: 263.34, y: 633.71)) bezier30Path.addLine(to: CGPoint(x: 263.34, y: 678.21)) bezier30Path.close() bezier30Path.move(to: CGPoint(x: 315.26, y: 693.04)) bezier30Path.addLine(to: CGPoint(x: 255.92, y: 693.04)) bezier30Path.addCurve(to: CGPoint(x: 248.5, y: 685.62), controlPoint1: CGPoint(x: 251.82, y: 693.04), controlPoint2: CGPoint(x: 248.5, y: 689.72)) bezier30Path.addLine(to: CGPoint(x: 248.5, y: 626.29)) bezier30Path.addCurve(to: CGPoint(x: 255.92, y: 618.87), controlPoint1: CGPoint(x: 248.5, y: 622.19), controlPoint2: CGPoint(x: 251.82, y: 618.87)) bezier30Path.addLine(to: CGPoint(x: 315.26, y: 618.87)) bezier30Path.addCurve(to: CGPoint(x: 322.67, y: 626.29), controlPoint1: CGPoint(x: 319.36, y: 618.87), controlPoint2: CGPoint(x: 322.67, y: 622.19)) bezier30Path.addLine(to: CGPoint(x: 322.67, y: 685.62)) bezier30Path.addCurve(to: CGPoint(x: 315.26, y: 693.04), controlPoint1: CGPoint(x: 322.67, y: 689.72), controlPoint2: CGPoint(x: 319.36, y: 693.04)) bezier30Path.close() bezier30Path.usesEvenOddFillRule = true dark.setFill() bezier30Path.fill() //// Bezier 31 Drawing let bezier31Path = UIBezierPath() bezier31Path.move(to: CGPoint(x: 352.34, y: 678.21)) bezier31Path.addLine(to: CGPoint(x: 396.84, y: 678.21)) bezier31Path.addLine(to: CGPoint(x: 396.84, y: 633.71)) bezier31Path.addLine(to: CGPoint(x: 352.34, y: 633.71)) bezier31Path.addLine(to: CGPoint(x: 352.34, y: 678.21)) bezier31Path.close() bezier31Path.move(to: CGPoint(x: 404.26, y: 693.04)) bezier31Path.addLine(to: CGPoint(x: 344.93, y: 693.04)) bezier31Path.addCurve(to: CGPoint(x: 337.51, y: 685.62), controlPoint1: CGPoint(x: 340.83, y: 693.04), controlPoint2: CGPoint(x: 337.51, y: 689.72)) bezier31Path.addLine(to: CGPoint(x: 337.51, y: 626.29)) bezier31Path.addCurve(to: CGPoint(x: 344.93, y: 618.87), controlPoint1: CGPoint(x: 337.51, y: 622.19), controlPoint2: CGPoint(x: 340.83, y: 618.87)) bezier31Path.addLine(to: CGPoint(x: 404.26, y: 618.87)) bezier31Path.addCurve(to: CGPoint(x: 411.68, y: 626.29), controlPoint1: CGPoint(x: 408.36, y: 618.87), controlPoint2: CGPoint(x: 411.68, y: 622.19)) bezier31Path.addLine(to: CGPoint(x: 411.68, y: 685.62)) bezier31Path.addCurve(to: CGPoint(x: 404.26, y: 693.04), controlPoint1: CGPoint(x: 411.68, y: 689.72), controlPoint2: CGPoint(x: 408.36, y: 693.04)) bezier31Path.close() bezier31Path.usesEvenOddFillRule = true dark.setFill() bezier31Path.fill() //// Bezier 32 Drawing let bezier32Path = UIBezierPath() bezier32Path.move(to: CGPoint(x: 478.44, y: 693.04)) bezier32Path.addLine(to: CGPoint(x: 433.92, y: 693.04)) bezier32Path.addCurve(to: CGPoint(x: 426.51, y: 685.62), controlPoint1: CGPoint(x: 429.83, y: 693.04), controlPoint2: CGPoint(x: 426.51, y: 689.72)) bezier32Path.addLine(to: CGPoint(x: 426.51, y: 626.29)) bezier32Path.addCurve(to: CGPoint(x: 433.92, y: 618.87), controlPoint1: CGPoint(x: 426.51, y: 622.19), controlPoint2: CGPoint(x: 429.82, y: 618.87)) bezier32Path.addLine(to: CGPoint(x: 478.44, y: 618.87)) bezier32Path.addCurve(to: CGPoint(x: 485.85, y: 626.29), controlPoint1: CGPoint(x: 482.53, y: 618.87), controlPoint2: CGPoint(x: 485.85, y: 622.19)) bezier32Path.addCurve(to: CGPoint(x: 478.44, y: 633.7), controlPoint1: CGPoint(x: 485.85, y: 630.39), controlPoint2: CGPoint(x: 482.53, y: 633.7)) bezier32Path.addLine(to: CGPoint(x: 441.34, y: 633.7)) bezier32Path.addLine(to: CGPoint(x: 441.34, y: 678.2)) bezier32Path.addLine(to: CGPoint(x: 478.44, y: 678.2)) bezier32Path.addCurve(to: CGPoint(x: 485.85, y: 685.62), controlPoint1: CGPoint(x: 482.53, y: 678.2), controlPoint2: CGPoint(x: 485.85, y: 681.52)) bezier32Path.addCurve(to: CGPoint(x: 478.44, y: 693.04), controlPoint1: CGPoint(x: 485.85, y: 689.72), controlPoint2: CGPoint(x: 482.53, y: 693.04)) bezier32Path.close() bezier32Path.usesEvenOddFillRule = true dark.setFill() bezier32Path.fill() //// Bezier 33 Drawing let bezier33Path = UIBezierPath() bezier33Path.move(to: CGPoint(x: 263.34, y: 767.21)) bezier33Path.addLine(to: CGPoint(x: 307.84, y: 767.21)) bezier33Path.addLine(to: CGPoint(x: 307.84, y: 722.71)) bezier33Path.addLine(to: CGPoint(x: 263.34, y: 722.71)) bezier33Path.addLine(to: CGPoint(x: 263.34, y: 767.21)) bezier33Path.close() bezier33Path.move(to: CGPoint(x: 315.26, y: 782.04)) bezier33Path.addLine(to: CGPoint(x: 255.92, y: 782.04)) bezier33Path.addCurve(to: CGPoint(x: 248.5, y: 774.62), controlPoint1: CGPoint(x: 251.82, y: 782.04), controlPoint2: CGPoint(x: 248.5, y: 778.72)) bezier33Path.addLine(to: CGPoint(x: 248.5, y: 715.29)) bezier33Path.addCurve(to: CGPoint(x: 255.92, y: 707.87), controlPoint1: CGPoint(x: 248.5, y: 711.19), controlPoint2: CGPoint(x: 251.82, y: 707.87)) bezier33Path.addLine(to: CGPoint(x: 315.26, y: 707.87)) bezier33Path.addCurve(to: CGPoint(x: 322.67, y: 715.29), controlPoint1: CGPoint(x: 319.36, y: 707.87), controlPoint2: CGPoint(x: 322.67, y: 711.19)) bezier33Path.addLine(to: CGPoint(x: 322.67, y: 774.62)) bezier33Path.addCurve(to: CGPoint(x: 315.26, y: 782.04), controlPoint1: CGPoint(x: 322.67, y: 778.72), controlPoint2: CGPoint(x: 319.36, y: 782.04)) bezier33Path.close() bezier33Path.usesEvenOddFillRule = true dark.setFill() bezier33Path.fill() //// Bezier 34 Drawing let bezier34Path = UIBezierPath() bezier34Path.move(to: CGPoint(x: 352.34, y: 767.21)) bezier34Path.addLine(to: CGPoint(x: 396.84, y: 767.21)) bezier34Path.addLine(to: CGPoint(x: 396.84, y: 722.71)) bezier34Path.addLine(to: CGPoint(x: 352.34, y: 722.71)) bezier34Path.addLine(to: CGPoint(x: 352.34, y: 767.21)) bezier34Path.close() bezier34Path.move(to: CGPoint(x: 404.26, y: 782.04)) bezier34Path.addLine(to: CGPoint(x: 344.93, y: 782.04)) bezier34Path.addCurve(to: CGPoint(x: 337.51, y: 774.62), controlPoint1: CGPoint(x: 340.83, y: 782.04), controlPoint2: CGPoint(x: 337.51, y: 778.72)) bezier34Path.addLine(to: CGPoint(x: 337.51, y: 715.29)) bezier34Path.addCurve(to: CGPoint(x: 344.93, y: 707.87), controlPoint1: CGPoint(x: 337.51, y: 711.19), controlPoint2: CGPoint(x: 340.83, y: 707.87)) bezier34Path.addLine(to: CGPoint(x: 404.26, y: 707.87)) bezier34Path.addCurve(to: CGPoint(x: 411.68, y: 715.29), controlPoint1: CGPoint(x: 408.36, y: 707.87), controlPoint2: CGPoint(x: 411.68, y: 711.19)) bezier34Path.addLine(to: CGPoint(x: 411.68, y: 774.62)) bezier34Path.addCurve(to: CGPoint(x: 404.26, y: 782.04), controlPoint1: CGPoint(x: 411.68, y: 778.72), controlPoint2: CGPoint(x: 408.36, y: 782.04)) bezier34Path.close() bezier34Path.usesEvenOddFillRule = true dark.setFill() bezier34Path.fill() //// Bezier 35 Drawing let bezier35Path = UIBezierPath() bezier35Path.move(to: CGPoint(x: 493.27, y: 782.04)) bezier35Path.addLine(to: CGPoint(x: 433.93, y: 782.04)) bezier35Path.addCurve(to: CGPoint(x: 426.51, y: 774.62), controlPoint1: CGPoint(x: 429.83, y: 782.04), controlPoint2: CGPoint(x: 426.51, y: 778.72)) bezier35Path.addLine(to: CGPoint(x: 426.51, y: 715.29)) bezier35Path.addCurve(to: CGPoint(x: 433.93, y: 707.87), controlPoint1: CGPoint(x: 426.51, y: 711.19), controlPoint2: CGPoint(x: 429.83, y: 707.87)) bezier35Path.addCurve(to: CGPoint(x: 441.34, y: 715.29), controlPoint1: CGPoint(x: 438.03, y: 707.87), controlPoint2: CGPoint(x: 441.34, y: 711.19)) bezier35Path.addLine(to: CGPoint(x: 441.34, y: 767.2)) bezier35Path.addLine(to: CGPoint(x: 493.27, y: 767.2)) bezier35Path.addCurve(to: CGPoint(x: 500.68, y: 774.62), controlPoint1: CGPoint(x: 497.37, y: 767.2), controlPoint2: CGPoint(x: 500.68, y: 770.52)) bezier35Path.addCurve(to: CGPoint(x: 493.27, y: 782.04), controlPoint1: CGPoint(x: 500.68, y: 778.72), controlPoint2: CGPoint(x: 497.37, y: 782.04)) bezier35Path.close() bezier35Path.usesEvenOddFillRule = true dark.setFill() bezier35Path.fill() //// Bezier 36 Drawing let bezier36Path = UIBezierPath() bezier36Path.move(to: CGPoint(x: 567.43, y: 856.21)) bezier36Path.addLine(to: CGPoint(x: 33.42, y: 856.21)) bezier36Path.addCurve(to: CGPoint(x: 26, y: 848.79), controlPoint1: CGPoint(x: 29.32, y: 856.21), controlPoint2: CGPoint(x: 26, y: 852.89)) bezier36Path.addCurve(to: CGPoint(x: 33.42, y: 841.38), controlPoint1: CGPoint(x: 26, y: 844.69), controlPoint2: CGPoint(x: 29.32, y: 841.38)) bezier36Path.addLine(to: CGPoint(x: 567.43, y: 841.38)) bezier36Path.addCurve(to: CGPoint(x: 574.84, y: 848.79), controlPoint1: CGPoint(x: 571.53, y: 841.38), controlPoint2: CGPoint(x: 574.84, y: 844.69)) bezier36Path.addCurve(to: CGPoint(x: 567.43, y: 856.21), controlPoint1: CGPoint(x: 574.85, y: 852.89), controlPoint2: CGPoint(x: 571.53, y: 856.21)) bezier36Path.close() bezier36Path.usesEvenOddFillRule = true dark.setFill() bezier36Path.fill() //// Bezier 37 Drawing let bezier37Path = UIBezierPath() bezier37Path.move(to: CGPoint(x: 611.93, y: 885.88)) bezier37Path.addLine(to: CGPoint(x: 33.42, y: 885.88)) bezier37Path.addCurve(to: CGPoint(x: 26, y: 878.46), controlPoint1: CGPoint(x: 29.32, y: 885.88), controlPoint2: CGPoint(x: 26, y: 882.56)) bezier37Path.addCurve(to: CGPoint(x: 33.42, y: 871.04), controlPoint1: CGPoint(x: 26, y: 874.36), controlPoint2: CGPoint(x: 29.32, y: 871.04)) bezier37Path.addLine(to: CGPoint(x: 611.93, y: 871.04)) bezier37Path.addCurve(to: CGPoint(x: 619.35, y: 878.46), controlPoint1: CGPoint(x: 616.03, y: 871.04), controlPoint2: CGPoint(x: 619.35, y: 874.36)) bezier37Path.addCurve(to: CGPoint(x: 611.93, y: 885.88), controlPoint1: CGPoint(x: 619.35, y: 882.56), controlPoint2: CGPoint(x: 616.03, y: 885.88)) bezier37Path.close() bezier37Path.usesEvenOddFillRule = true dark.setFill() bezier37Path.fill() //// Bezier 38 Drawing let bezier38Path = UIBezierPath() bezier38Path.move(to: CGPoint(x: 152.08, y: 826.54)) bezier38Path.addCurve(to: CGPoint(x: 146.84, y: 824.37), controlPoint1: CGPoint(x: 150.19, y: 826.54), controlPoint2: CGPoint(x: 148.29, y: 825.82)) bezier38Path.addLine(to: CGPoint(x: 28.17, y: 705.7)) bezier38Path.addCurve(to: CGPoint(x: 28.17, y: 695.21), controlPoint1: CGPoint(x: 25.27, y: 702.8), controlPoint2: CGPoint(x: 25.27, y: 698.11)) bezier38Path.addCurve(to: CGPoint(x: 38.66, y: 695.21), controlPoint1: CGPoint(x: 31.07, y: 692.31), controlPoint2: CGPoint(x: 35.77, y: 692.31)) bezier38Path.addLine(to: CGPoint(x: 157.33, y: 813.88)) bezier38Path.addCurve(to: CGPoint(x: 157.33, y: 824.37), controlPoint1: CGPoint(x: 160.23, y: 816.78), controlPoint2: CGPoint(x: 160.23, y: 821.47)) bezier38Path.addCurve(to: CGPoint(x: 152.08, y: 826.54), controlPoint1: CGPoint(x: 155.88, y: 825.82), controlPoint2: CGPoint(x: 153.98, y: 826.54)) bezier38Path.close() bezier38Path.usesEvenOddFillRule = true dark.setFill() bezier38Path.fill() //// Rectangle 35 Drawing let rectangle35Path = UIBezierPath(roundedRect: CGRect(x: 144.68, y: 693.05, width: 14.85, height: 133.5), cornerRadius: 7.4) dark.setFill() rectangle35Path.fill() //// Bezier 39 Drawing let bezier39Path = UIBezierPath() bezier39Path.move(to: CGPoint(x: 152.08, y: 707.87)) bezier39Path.addLine(to: CGPoint(x: 33.42, y: 707.87)) bezier39Path.addCurve(to: CGPoint(x: 26, y: 700.45), controlPoint1: CGPoint(x: 29.32, y: 707.87), controlPoint2: CGPoint(x: 26, y: 704.55)) bezier39Path.addCurve(to: CGPoint(x: 33.42, y: 693.04), controlPoint1: CGPoint(x: 26, y: 696.36), controlPoint2: CGPoint(x: 29.32, y: 693.04)) bezier39Path.addLine(to: CGPoint(x: 152.08, y: 693.04)) bezier39Path.addCurve(to: CGPoint(x: 159.5, y: 700.45), controlPoint1: CGPoint(x: 156.19, y: 693.04), controlPoint2: CGPoint(x: 159.5, y: 696.36)) bezier39Path.addCurve(to: CGPoint(x: 152.08, y: 707.87), controlPoint1: CGPoint(x: 159.5, y: 704.55), controlPoint2: CGPoint(x: 156.19, y: 707.87)) bezier39Path.close() bezier39Path.usesEvenOddFillRule = true dark.setFill() bezier39Path.fill() //// Bezier 40 Drawing let bezier40Path = UIBezierPath() bezier40Path.move(to: CGPoint(x: 33.42, y: 856.21)) bezier40Path.addCurve(to: CGPoint(x: 26, y: 848.79), controlPoint1: CGPoint(x: 29.32, y: 856.21), controlPoint2: CGPoint(x: 26, y: 852.89)) bezier40Path.addLine(to: CGPoint(x: 26, y: 741.87)) bezier40Path.addCurve(to: CGPoint(x: 33.42, y: 734.45), controlPoint1: CGPoint(x: 26, y: 737.77), controlPoint2: CGPoint(x: 29.32, y: 734.45)) bezier40Path.addCurve(to: CGPoint(x: 40.83, y: 741.87), controlPoint1: CGPoint(x: 37.52, y: 734.45), controlPoint2: CGPoint(x: 40.83, y: 737.77)) bezier40Path.addLine(to: CGPoint(x: 40.83, y: 848.79)) bezier40Path.addCurve(to: CGPoint(x: 33.42, y: 856.21), controlPoint1: CGPoint(x: 40.83, y: 852.89), controlPoint2: CGPoint(x: 37.52, y: 856.21)) bezier40Path.close() bezier40Path.usesEvenOddFillRule = true dark.setFill() bezier40Path.fill() //// Rectangle 36 Drawing let rectangle36Path = UIBezierPath(roundedRect: CGRect(x: 70.53, y: 618.88, width: 74.15, height: 14.85), cornerRadius: 7.4) dark.setFill() rectangle36Path.fill() //// Rectangle 37 Drawing let rectangle37Path = UIBezierPath(roundedRect: CGRect(x: 129.83, y: 618.88, width: 14.85, height: 59.35), cornerRadius: 7.4) dark.setFill() rectangle37Path.fill() //// Rectangle 38 Drawing let rectangle38Path = UIBezierPath(roundedRect: CGRect(x: 70.48, y: 618.88, width: 14.85, height: 59.35), cornerRadius: 7.4) dark.setFill() rectangle38Path.fill() //// Rectangle 39 Drawing let rectangle39Path = UIBezierPath(roundedRect: CGRect(x: 159.47, y: 618.88, width: 14.85, height: 59.35), cornerRadius: 7.4) dark.setFill() rectangle39Path.fill() //// Rectangle 40 Drawing let rectangle40Path = UIBezierPath(roundedRect: CGRect(x: 159.53, y: 618.88, width: 74.15, height: 14.85), cornerRadius: 7.4) dark.setFill() rectangle40Path.fill() //// Rectangle 41 Drawing let rectangle41Path = UIBezierPath(roundedRect: CGRect(x: 218.82, y: 618.88, width: 14.85, height: 74.15), cornerRadius: 7.4) dark.setFill() rectangle41Path.fill() //// Rectangle 42 Drawing let rectangle42Path = UIBezierPath(roundedRect: CGRect(x: 174.32, y: 678.17, width: 59.35, height: 14.85), cornerRadius: 7.4) dark.setFill() rectangle42Path.fill() //// Rectangle 43 Drawing let rectangle43Path = UIBezierPath(roundedRect: CGRect(x: 218.82, y: 707.88, width: 14.85, height: 74.15), cornerRadius: 7.4) dark.setFill() rectangle43Path.fill() //// Rectangle 44 Drawing let rectangle44Path = UIBezierPath(roundedRect: CGRect(x: 174.32, y: 767.17, width: 59.35, height: 14.85), cornerRadius: 7.4) dark.setFill() rectangle44Path.fill() //// Rectangle 45 Drawing let rectangle45Path = UIBezierPath(roundedRect: CGRect(x: 174.32, y: 707.88, width: 59.35, height: 14.85), cornerRadius: 7.4) dark.setFill() rectangle45Path.fill() //// Rectangle 46 Drawing let rectangle46Path = UIBezierPath(roundedRect: CGRect(x: 77.93, y: 277.67, width: 59.35, height: 14.85), cornerRadius: 7.4) dark.setFill() rectangle46Path.fill() //// Rectangle 47 Drawing let rectangle47Path = UIBezierPath(roundedRect: CGRect(x: 166.93, y: 277.67, width: 59.35, height: 14.85), cornerRadius: 7.4) dark.setFill() rectangle47Path.fill() //// Rectangle 48 Drawing let rectangle48Path = UIBezierPath(roundedRect: CGRect(x: 255.93, y: 277.67, width: 59.35, height: 14.85), cornerRadius: 7.4) dark.setFill() rectangle48Path.fill() //// Rectangle 49 Drawing let rectangle49Path = UIBezierPath(roundedRect: CGRect(x: 344.93, y: 277.67, width: 59.35, height: 14.85), cornerRadius: 7.4) dark.setFill() rectangle49Path.fill() //// Rectangle 50 Drawing let rectangle50Path = UIBezierPath(roundedRect: CGRect(x: 433.93, y: 277.67, width: 59.35, height: 14.85), cornerRadius: 7.4) dark.setFill() rectangle50Path.fill() //// Rectangle 51 Drawing let rectangle51Path = UIBezierPath(roundedRect: CGRect(x: 522.93, y: 277.67, width: 59.35, height: 14.85), cornerRadius: 7.4) dark.setFill() rectangle51Path.fill() //// Rectangle 52 Drawing let rectangle52Path = UIBezierPath(roundedRect: CGRect(x: 611.93, y: 277.67, width: 59.35, height: 14.85), cornerRadius: 7.4) dark.setFill() rectangle52Path.fill() //// Bezier 41 Drawing let bezier41Path = UIBezierPath() bezier41Path.move(to: CGPoint(x: 152.08, y: 129.36)) bezier41Path.addCurve(to: CGPoint(x: 144.67, y: 136.78), controlPoint1: CGPoint(x: 148, y: 129.36), controlPoint2: CGPoint(x: 144.67, y: 132.68)) bezier41Path.addLine(to: CGPoint(x: 144.67, y: 225.78)) bezier41Path.addCurve(to: CGPoint(x: 152.08, y: 233.2), controlPoint1: CGPoint(x: 144.67, y: 229.87), controlPoint2: CGPoint(x: 148, y: 233.2)) bezier41Path.addCurve(to: CGPoint(x: 159.5, y: 225.78), controlPoint1: CGPoint(x: 156.18, y: 233.2), controlPoint2: CGPoint(x: 159.5, y: 229.87)) bezier41Path.addLine(to: CGPoint(x: 159.5, y: 136.78)) bezier41Path.addCurve(to: CGPoint(x: 152.08, y: 129.36), controlPoint1: CGPoint(x: 159.5, y: 132.68), controlPoint2: CGPoint(x: 156.18, y: 129.36)) bezier41Path.close() bezier41Path.move(to: CGPoint(x: 152.08, y: 248.03)) bezier41Path.addCurve(to: CGPoint(x: 129.84, y: 225.78), controlPoint1: CGPoint(x: 139.82, y: 248.03), controlPoint2: CGPoint(x: 129.84, y: 238.05)) bezier41Path.addLine(to: CGPoint(x: 129.84, y: 136.78)) bezier41Path.addCurve(to: CGPoint(x: 152.08, y: 114.53), controlPoint1: CGPoint(x: 129.84, y: 124.51), controlPoint2: CGPoint(x: 139.82, y: 114.53)) bezier41Path.addCurve(to: CGPoint(x: 174.34, y: 136.78), controlPoint1: CGPoint(x: 164.36, y: 114.53), controlPoint2: CGPoint(x: 174.34, y: 124.51)) bezier41Path.addLine(to: CGPoint(x: 174.34, y: 225.78)) bezier41Path.addCurve(to: CGPoint(x: 152.08, y: 248.03), controlPoint1: CGPoint(x: 174.34, y: 238.05), controlPoint2: CGPoint(x: 164.36, y: 248.03)) bezier41Path.close() bezier41Path.usesEvenOddFillRule = true dark.setFill() bezier41Path.fill() //// Bezier 42 Drawing let bezier42Path = UIBezierPath() bezier42Path.move(to: CGPoint(x: 300.42, y: 129.36)) bezier42Path.addCurve(to: CGPoint(x: 293.01, y: 136.78), controlPoint1: CGPoint(x: 296.33, y: 129.36), controlPoint2: CGPoint(x: 293.01, y: 132.68)) bezier42Path.addLine(to: CGPoint(x: 293.01, y: 225.78)) bezier42Path.addCurve(to: CGPoint(x: 300.42, y: 233.2), controlPoint1: CGPoint(x: 293.01, y: 229.87), controlPoint2: CGPoint(x: 296.33, y: 233.2)) bezier42Path.addCurve(to: CGPoint(x: 307.84, y: 225.78), controlPoint1: CGPoint(x: 304.52, y: 233.2), controlPoint2: CGPoint(x: 307.84, y: 229.87)) bezier42Path.addLine(to: CGPoint(x: 307.84, y: 136.78)) bezier42Path.addCurve(to: CGPoint(x: 300.42, y: 129.36), controlPoint1: CGPoint(x: 307.84, y: 132.68), controlPoint2: CGPoint(x: 304.52, y: 129.36)) bezier42Path.close() bezier42Path.move(to: CGPoint(x: 300.42, y: 248.03)) bezier42Path.addCurve(to: CGPoint(x: 278.17, y: 225.78), controlPoint1: CGPoint(x: 288.15, y: 248.03), controlPoint2: CGPoint(x: 278.17, y: 238.05)) bezier42Path.addLine(to: CGPoint(x: 278.17, y: 136.78)) bezier42Path.addCurve(to: CGPoint(x: 300.42, y: 114.53), controlPoint1: CGPoint(x: 278.17, y: 124.51), controlPoint2: CGPoint(x: 288.15, y: 114.53)) bezier42Path.addCurve(to: CGPoint(x: 322.67, y: 136.78), controlPoint1: CGPoint(x: 312.69, y: 114.53), controlPoint2: CGPoint(x: 322.67, y: 124.51)) bezier42Path.addLine(to: CGPoint(x: 322.67, y: 225.78)) bezier42Path.addCurve(to: CGPoint(x: 300.42, y: 248.03), controlPoint1: CGPoint(x: 322.67, y: 238.05), controlPoint2: CGPoint(x: 312.69, y: 248.03)) bezier42Path.close() bezier42Path.usesEvenOddFillRule = true dark.setFill() bezier42Path.fill() //// Bezier 43 Drawing let bezier43Path = UIBezierPath() bezier43Path.move(to: CGPoint(x: 448.77, y: 129.36)) bezier43Path.addCurve(to: CGPoint(x: 441.34, y: 136.78), controlPoint1: CGPoint(x: 444.68, y: 129.36), controlPoint2: CGPoint(x: 441.34, y: 132.68)) bezier43Path.addLine(to: CGPoint(x: 441.34, y: 225.78)) bezier43Path.addCurve(to: CGPoint(x: 448.77, y: 233.2), controlPoint1: CGPoint(x: 441.34, y: 229.87), controlPoint2: CGPoint(x: 444.67, y: 233.2)) bezier43Path.addCurve(to: CGPoint(x: 456.18, y: 225.78), controlPoint1: CGPoint(x: 452.86, y: 233.2), controlPoint2: CGPoint(x: 456.18, y: 229.87)) bezier43Path.addLine(to: CGPoint(x: 456.18, y: 136.78)) bezier43Path.addCurve(to: CGPoint(x: 448.77, y: 129.36), controlPoint1: CGPoint(x: 456.18, y: 132.68), controlPoint2: CGPoint(x: 452.86, y: 129.36)) bezier43Path.close() bezier43Path.move(to: CGPoint(x: 448.77, y: 248.03)) bezier43Path.addCurve(to: CGPoint(x: 426.51, y: 225.78), controlPoint1: CGPoint(x: 436.5, y: 248.03), controlPoint2: CGPoint(x: 426.51, y: 238.05)) bezier43Path.addLine(to: CGPoint(x: 426.51, y: 136.78)) bezier43Path.addCurve(to: CGPoint(x: 448.77, y: 114.53), controlPoint1: CGPoint(x: 426.51, y: 124.51), controlPoint2: CGPoint(x: 436.5, y: 114.53)) bezier43Path.addCurve(to: CGPoint(x: 471.02, y: 136.78), controlPoint1: CGPoint(x: 461.04, y: 114.53), controlPoint2: CGPoint(x: 471.02, y: 124.51)) bezier43Path.addLine(to: CGPoint(x: 471.02, y: 225.78)) bezier43Path.addCurve(to: CGPoint(x: 448.77, y: 248.03), controlPoint1: CGPoint(x: 471.02, y: 238.05), controlPoint2: CGPoint(x: 461.04, y: 248.03)) bezier43Path.close() bezier43Path.usesEvenOddFillRule = true dark.setFill() bezier43Path.fill() //// Bezier 44 Drawing let bezier44Path = UIBezierPath() bezier44Path.move(to: CGPoint(x: 597.1, y: 129.36)) bezier44Path.addCurve(to: CGPoint(x: 589.68, y: 136.78), controlPoint1: CGPoint(x: 593.01, y: 129.36), controlPoint2: CGPoint(x: 589.68, y: 132.68)) bezier44Path.addLine(to: CGPoint(x: 589.68, y: 225.78)) bezier44Path.addCurve(to: CGPoint(x: 597.1, y: 233.2), controlPoint1: CGPoint(x: 589.68, y: 229.87), controlPoint2: CGPoint(x: 593.01, y: 233.2)) bezier44Path.addCurve(to: CGPoint(x: 604.51, y: 225.78), controlPoint1: CGPoint(x: 601.18, y: 233.2), controlPoint2: CGPoint(x: 604.51, y: 229.87)) bezier44Path.addLine(to: CGPoint(x: 604.51, y: 136.78)) bezier44Path.addCurve(to: CGPoint(x: 597.1, y: 129.36), controlPoint1: CGPoint(x: 604.51, y: 132.68), controlPoint2: CGPoint(x: 601.18, y: 129.36)) bezier44Path.close() bezier44Path.move(to: CGPoint(x: 597.1, y: 248.03)) bezier44Path.addCurve(to: CGPoint(x: 574.85, y: 225.78), controlPoint1: CGPoint(x: 584.83, y: 248.03), controlPoint2: CGPoint(x: 574.85, y: 238.05)) bezier44Path.addLine(to: CGPoint(x: 574.85, y: 136.78)) bezier44Path.addCurve(to: CGPoint(x: 597.1, y: 114.53), controlPoint1: CGPoint(x: 574.85, y: 124.51), controlPoint2: CGPoint(x: 584.83, y: 114.53)) bezier44Path.addCurve(to: CGPoint(x: 619.35, y: 136.78), controlPoint1: CGPoint(x: 609.37, y: 114.53), controlPoint2: CGPoint(x: 619.35, y: 124.51)) bezier44Path.addLine(to: CGPoint(x: 619.35, y: 225.78)) bezier44Path.addCurve(to: CGPoint(x: 597.1, y: 248.03), controlPoint1: CGPoint(x: 619.35, y: 238.05), controlPoint2: CGPoint(x: 609.37, y: 248.03)) bezier44Path.close() bezier44Path.usesEvenOddFillRule = true dark.setFill() bezier44Path.fill() //// Rectangle 53 Drawing let rectangle53Path = UIBezierPath(roundedRect: CGRect(x: 189.18, y: 173.87, width: 74.15, height: 14.85), cornerRadius: 7.4) dark.setFill() rectangle53Path.fill() //// Rectangle 54 Drawing let rectangle54Path = UIBezierPath(roundedRect: CGRect(x: 337.53, y: 173.87, width: 74.15, height: 14.85), cornerRadius: 7.4) dark.setFill() rectangle54Path.fill() //// Rectangle 55 Drawing let rectangle55Path = UIBezierPath(roundedRect: CGRect(x: 485.88, y: 173.87, width: 74.15, height: 14.85), cornerRadius: 7.4) dark.setFill() rectangle55Path.fill() //// Bezier 45 Drawing let bezier45Path = UIBezierPath() bezier45Path.move(to: CGPoint(x: 738.01, y: 885.88)) bezier45Path.addCurve(to: CGPoint(x: 730.6, y: 878.46), controlPoint1: CGPoint(x: 733.92, y: 885.88), controlPoint2: CGPoint(x: 730.6, y: 882.56)) bezier45Path.addCurve(to: CGPoint(x: 738.01, y: 871.04), controlPoint1: CGPoint(x: 730.6, y: 874.36), controlPoint2: CGPoint(x: 733.92, y: 871.04)) bezier45Path.addCurve(to: CGPoint(x: 960.52, y: 648.54), controlPoint1: CGPoint(x: 860.71, y: 871.04), controlPoint2: CGPoint(x: 960.52, y: 771.23)) bezier45Path.addCurve(to: CGPoint(x: 967.94, y: 641.12), controlPoint1: CGPoint(x: 960.52, y: 644.44), controlPoint2: CGPoint(x: 963.84, y: 641.12)) bezier45Path.addCurve(to: CGPoint(x: 975.35, y: 648.54), controlPoint1: CGPoint(x: 972.03, y: 641.12), controlPoint2: CGPoint(x: 975.35, y: 644.44)) bezier45Path.addCurve(to: CGPoint(x: 738.01, y: 885.88), controlPoint1: CGPoint(x: 975.35, y: 779.4), controlPoint2: CGPoint(x: 868.88, y: 885.88)) bezier45Path.close() bezier45Path.usesEvenOddFillRule = true dark.setFill() bezier45Path.fill() //// Bezier 46 Drawing let bezier46Path = UIBezierPath() bezier46Path.move(to: CGPoint(x: 738.01, y: 885.88)) bezier46Path.addCurve(to: CGPoint(x: 500.68, y: 648.54), controlPoint1: CGPoint(x: 607.15, y: 885.88), controlPoint2: CGPoint(x: 500.68, y: 779.4)) bezier46Path.addCurve(to: CGPoint(x: 508.1, y: 641.12), controlPoint1: CGPoint(x: 500.68, y: 644.44), controlPoint2: CGPoint(x: 504, y: 641.12)) bezier46Path.addCurve(to: CGPoint(x: 515.51, y: 648.54), controlPoint1: CGPoint(x: 512.2, y: 641.12), controlPoint2: CGPoint(x: 515.51, y: 644.44)) bezier46Path.addCurve(to: CGPoint(x: 738.02, y: 871.04), controlPoint1: CGPoint(x: 515.51, y: 771.23), controlPoint2: CGPoint(x: 615.32, y: 871.04)) bezier46Path.addCurve(to: CGPoint(x: 745.43, y: 878.46), controlPoint1: CGPoint(x: 742.12, y: 871.04), controlPoint2: CGPoint(x: 745.43, y: 874.36)) bezier46Path.addCurve(to: CGPoint(x: 738.01, y: 885.88), controlPoint1: CGPoint(x: 745.43, y: 882.56), controlPoint2: CGPoint(x: 742.12, y: 885.88)) bezier46Path.close() bezier46Path.usesEvenOddFillRule = true dark.setFill() bezier46Path.fill() //// Bezier 47 Drawing let bezier47Path = UIBezierPath() bezier47Path.move(to: CGPoint(x: 967.94, y: 655.95)) bezier47Path.addCurve(to: CGPoint(x: 960.52, y: 648.54), controlPoint1: CGPoint(x: 963.84, y: 655.95), controlPoint2: CGPoint(x: 960.52, y: 652.64)) bezier47Path.addCurve(to: CGPoint(x: 848.41, y: 369.53), controlPoint1: CGPoint(x: 960.52, y: 508.82), controlPoint2: CGPoint(x: 870, y: 394.73)) bezier47Path.addCurve(to: CGPoint(x: 755.04, y: 379.37), controlPoint1: CGPoint(x: 832.44, y: 381.78), controlPoint2: CGPoint(x: 787.02, y: 411.25)) bezier47Path.addCurve(to: CGPoint(x: 746.65, y: 272.68), controlPoint1: CGPoint(x: 728.53, y: 352.75), controlPoint2: CGPoint(x: 738.38, y: 301.17)) bezier47Path.addCurve(to: CGPoint(x: 515.51, y: 648.54), controlPoint1: CGPoint(x: 690.36, y: 309.86), controlPoint2: CGPoint(x: 515.51, y: 442)) bezier47Path.addCurve(to: CGPoint(x: 508.1, y: 655.95), controlPoint1: CGPoint(x: 515.51, y: 652.64), controlPoint2: CGPoint(x: 512.2, y: 655.95)) bezier47Path.addCurve(to: CGPoint(x: 500.68, y: 648.54), controlPoint1: CGPoint(x: 503.99, y: 655.95), controlPoint2: CGPoint(x: 500.68, y: 652.64)) bezier47Path.addCurve(to: CGPoint(x: 756.65, y: 248.97), controlPoint1: CGPoint(x: 500.68, y: 394.8), controlPoint2: CGPoint(x: 754.1, y: 250.4)) bezier47Path.addCurve(to: CGPoint(x: 765.16, y: 249.87), controlPoint1: CGPoint(x: 759.38, y: 247.46), controlPoint2: CGPoint(x: 762.8, y: 247.81)) bezier47Path.addCurve(to: CGPoint(x: 767.15, y: 258.2), controlPoint1: CGPoint(x: 767.53, y: 251.95), controlPoint2: CGPoint(x: 768.32, y: 255.29)) bezier47Path.addCurve(to: CGPoint(x: 765.52, y: 368.87), controlPoint1: CGPoint(x: 766.83, y: 259.01), controlPoint2: CGPoint(x: 735.41, y: 338.63)) bezier47Path.addCurve(to: CGPoint(x: 844.34, y: 353.74), controlPoint1: CGPoint(x: 794.32, y: 397.57), controlPoint2: CGPoint(x: 843.84, y: 354.19)) bezier47Path.addCurve(to: CGPoint(x: 854.69, y: 354.21), controlPoint1: CGPoint(x: 847.33, y: 351.06), controlPoint2: CGPoint(x: 851.94, y: 351.27)) bezier47Path.addCurve(to: CGPoint(x: 975.36, y: 648.53), controlPoint1: CGPoint(x: 859.61, y: 359.47), controlPoint2: CGPoint(x: 975.36, y: 484.91)) bezier47Path.addCurve(to: CGPoint(x: 967.94, y: 655.95), controlPoint1: CGPoint(x: 975.35, y: 652.64), controlPoint2: CGPoint(x: 972.03, y: 655.95)) bezier47Path.close() bezier47Path.usesEvenOddFillRule = true dark.setFill() bezier47Path.fill() //// Oval 2 Drawing let oval2Path = UIBezierPath(ovalIn: CGRect(x: 730.95, y: 470.55, width: 14.9, height: 14.8)) dark.setFill() oval2Path.fill() //// Oval 3 Drawing let oval3Path = UIBezierPath(ovalIn: CGRect(x: 730.95, y: 811.7, width: 14.9, height: 14.8)) dark.setFill() oval3Path.fill() //// Oval 4 Drawing let oval4Path = UIBezierPath(ovalIn: CGRect(x: 645.65, y: 493.4, width: 14.9, height: 14.8)) dark.setFill() oval4Path.fill() //// Oval 5 Drawing let oval5Path = UIBezierPath(ovalIn: CGRect(x: 816.2, y: 788.85, width: 14.9, height: 14.8)) dark.setFill() oval5Path.fill() //// Oval 6 Drawing let oval6Path = UIBezierPath(ovalIn: CGRect(x: 583.2, y: 555.85, width: 14.9, height: 14.8)) dark.setFill() oval6Path.fill() //// Oval 7 Drawing let oval7Path = UIBezierPath(ovalIn: CGRect(x: 878.65, y: 726.45, width: 14.9, height: 14.8)) dark.setFill() oval7Path.fill() //// Oval 8 Drawing let oval8Path = UIBezierPath(ovalIn: CGRect(x: 560.3, y: 641.15, width: 14.9, height: 14.8)) dark.setFill() oval8Path.fill() //// Oval 9 Drawing let oval9Path = UIBezierPath(ovalIn: CGRect(x: 901.5, y: 641.15, width: 14.9, height: 14.8)) dark.setFill() oval9Path.fill() //// Oval 10 Drawing let oval10Path = UIBezierPath(ovalIn: CGRect(x: 583.15, y: 726.45, width: 14.9, height: 14.8)) dark.setFill() oval10Path.fill() //// Oval 11 Drawing let oval11Path = UIBezierPath(ovalIn: CGRect(x: 878.65, y: 555.85, width: 14.9, height: 14.8)) dark.setFill() oval11Path.fill() //// Oval 12 Drawing let oval12Path = UIBezierPath(ovalIn: CGRect(x: 645.6, y: 788.9, width: 14.9, height: 14.8)) dark.setFill() oval12Path.fill() //// Oval 13 Drawing let oval13Path = UIBezierPath(ovalIn: CGRect(x: 816.2, y: 493.4, width: 14.9, height: 14.8)) dark.setFill() oval13Path.fill() //// Group 6 context.saveGState() context.beginTransparencyLayer(auxiliaryInfo: nil) //// Clip Clip 4 let clip4Path = UIBezierPath() clip4Path.move(to: CGPoint(x: 738.01, y: 455.7)) clip4Path.addCurve(to: CGPoint(x: 545.18, y: 648.54), controlPoint1: CGPoint(x: 631.69, y: 455.7), controlPoint2: CGPoint(x: 545.18, y: 542.21)) clip4Path.addCurve(to: CGPoint(x: 738.01, y: 841.38), controlPoint1: CGPoint(x: 545.18, y: 754.86), controlPoint2: CGPoint(x: 631.69, y: 841.38)) clip4Path.addCurve(to: CGPoint(x: 930.85, y: 648.54), controlPoint1: CGPoint(x: 844.34, y: 841.38), controlPoint2: CGPoint(x: 930.85, y: 754.86)) clip4Path.addCurve(to: CGPoint(x: 738.01, y: 455.7), controlPoint1: CGPoint(x: 930.85, y: 542.21), controlPoint2: CGPoint(x: 844.34, y: 455.7)) clip4Path.close() clip4Path.move(to: CGPoint(x: 738.01, y: 856.21)) clip4Path.addCurve(to: CGPoint(x: 530.34, y: 648.54), controlPoint1: CGPoint(x: 623.5, y: 856.21), controlPoint2: CGPoint(x: 530.34, y: 763.05)) clip4Path.addCurve(to: CGPoint(x: 738.01, y: 440.86), controlPoint1: CGPoint(x: 530.34, y: 534.02), controlPoint2: CGPoint(x: 623.5, y: 440.86)) clip4Path.addCurve(to: CGPoint(x: 945.69, y: 648.54), controlPoint1: CGPoint(x: 852.53, y: 440.86), controlPoint2: CGPoint(x: 945.69, y: 534.02)) clip4Path.addCurve(to: CGPoint(x: 738.01, y: 856.21), controlPoint1: CGPoint(x: 945.69, y: 763.05), controlPoint2: CGPoint(x: 852.53, y: 856.21)) clip4Path.close() clip4Path.usesEvenOddFillRule = true clip4Path.addClip() //// Rectangle 56 Drawing let rectangle56Path = UIBezierPath(rect: CGRect(x: 525.33, y: 435.88, width: 425.35, height: 425.35)) dark.setFill() rectangle56Path.fill() context.endTransparencyLayer() context.restoreGState() //// Rectangle 57 Drawing let rectangle57Path = UIBezierPath(roundedRect: CGRect(x: 730.58, y: 515.05, width: 14.85, height: 140.9), cornerRadius: 7.4) dark.setFill() rectangle57Path.fill() //// Bezier 49 Drawing let bezier49Path = UIBezierPath() bezier49Path.move(to: CGPoint(x: 819.6, y: 737.54)) bezier49Path.addCurve(to: CGPoint(x: 814.36, y: 735.37), controlPoint1: CGPoint(x: 817.7, y: 737.54), controlPoint2: CGPoint(x: 815.81, y: 736.81)) bezier49Path.addLine(to: CGPoint(x: 732.77, y: 653.78)) bezier49Path.addCurve(to: CGPoint(x: 732.77, y: 643.29), controlPoint1: CGPoint(x: 729.88, y: 650.88), controlPoint2: CGPoint(x: 729.88, y: 646.19)) bezier49Path.addCurve(to: CGPoint(x: 743.26, y: 643.29), controlPoint1: CGPoint(x: 735.67, y: 640.39), controlPoint2: CGPoint(x: 740.36, y: 640.39)) bezier49Path.addLine(to: CGPoint(x: 824.85, y: 724.88)) bezier49Path.addCurve(to: CGPoint(x: 824.85, y: 735.37), controlPoint1: CGPoint(x: 827.74, y: 727.78), controlPoint2: CGPoint(x: 827.74, y: 732.47)) bezier49Path.addCurve(to: CGPoint(x: 819.6, y: 737.54), controlPoint1: CGPoint(x: 823.4, y: 736.81), controlPoint2: CGPoint(x: 821.5, y: 737.54)) bezier49Path.close() bezier49Path.usesEvenOddFillRule = true dark.setFill() bezier49Path.fill() //// Rectangle 58 Drawing let rectangle58Path = UIBezierPath(roundedRect: CGRect(x: 426.53, y: 589.17, width: 59.35, height: 14.85), cornerRadius: 7.4) dark.setFill() rectangle58Path.fill() //// Rectangle 59 Drawing let rectangle59Path = UIBezierPath(roundedRect: CGRect(x: 574.83, y: 351.87, width: 14.85, height: 29.65), cornerRadius: 7.4) dark.setFill() rectangle59Path.fill() //// Rectangle 60 Drawing let rectangle60Path = UIBezierPath(roundedRect: CGRect(x: 515.53, y: 411.17, width: 29.65, height: 14.85), cornerRadius: 7.4) dark.setFill() rectangle60Path.fill() //// Rectangle 61 Drawing let rectangle61Path = UIBezierPath(roundedRect: CGRect(x: 485.82, y: 737.55, width: 14.85, height: 44.5), cornerRadius: 7.4) dark.setFill() rectangle61Path.fill() //// Rectangle 62 Drawing let rectangle62Path = UIBezierPath(roundedRect: CGRect(x: 426.53, y: 707.88, width: 59.35, height: 14.85), cornerRadius: 7.4) dark.setFill() rectangle62Path.fill() context.restoreGState() } @objc dynamic public class func drawHeadphones(frame targetFrame: CGRect = CGRect(x: 0, y: 0, width: 1000, height: 1000), resizing: ResizingBehavior = .aspectFit, white: UIColor = UIColor(red: 1.000, green: 1.000, blue: 1.000, alpha: 1.000), light: UIColor = UIColor(red: 0.769, green: 0.847, blue: 0.984, alpha: 1.000), medium: UIColor = UIColor(red: 0.478, green: 0.663, blue: 0.973, alpha: 1.000), dark: UIColor = UIColor(red: 0.000, green: 0.478, blue: 1.000, alpha: 1.000)) { //// General Declarations let context = UIGraphicsGetCurrentContext()! //// Resize to Target Frame context.saveGState() let resizedFrame: CGRect = resizing.apply(rect: CGRect(x: 0, y: 0, width: 1000, height: 1000), target: targetFrame) context.translateBy(x: resizedFrame.minX, y: resizedFrame.minY) context.scaleBy(x: resizedFrame.width / 1000, y: resizedFrame.height / 1000) //// Group 2 //// Bezier Drawing let bezierPath = UIBezierPath() bezierPath.move(to: CGPoint(x: 663.17, y: 669.21)) bezierPath.addLine(to: CGPoint(x: 680.79, y: 629.17)) bezierPath.addCurve(to: CGPoint(x: 757.34, y: 599.2), controlPoint1: CGPoint(x: 693.6, y: 599.77), controlPoint2: CGPoint(x: 727.93, y: 586.24)) bezierPath.addCurve(to: CGPoint(x: 789.5, y: 634.86), controlPoint1: CGPoint(x: 773.34, y: 606.2), controlPoint2: CGPoint(x: 784.56, y: 619.42)) bezierPath.addLine(to: CGPoint(x: 802.75, y: 640.69)) bezierPath.addLine(to: CGPoint(x: 678.46, y: 924.59)) bezierPath.addLine(to: CGPoint(x: 665.22, y: 918.76)) bezierPath.addCurve(to: CGPoint(x: 617.34, y: 919.35), controlPoint1: CGPoint(x: 650.66, y: 925.61), controlPoint2: CGPoint(x: 633.34, y: 926.18)) bezierPath.addCurve(to: CGPoint(x: 587.35, y: 842.61), controlPoint1: CGPoint(x: 587.93, y: 906.39), controlPoint2: CGPoint(x: 574.4, y: 872.04)) bezierPath.addLine(to: CGPoint(x: 604.82, y: 802.57)) bezierPath.addLine(to: CGPoint(x: 634.06, y: 735.89)) bezierPath.addLine(to: CGPoint(x: 663.17, y: 669.21)) bezierPath.close() bezierPath.usesEvenOddFillRule = true medium.setFill() bezierPath.fill() //// Group 3 context.saveGState() context.beginTransparencyLayer(auxiliaryInfo: nil) //// Clip Clip let clipPath = UIBezierPath() clipPath.move(to: CGPoint(x: 616.92, y: 857.07)) clipPath.addLine(to: CGPoint(x: 634.37, y: 817.05)) clipPath.addLine(to: CGPoint(x: 663.6, y: 750.39)) clipPath.addLine(to: CGPoint(x: 692.69, y: 683.73)) clipPath.addLine(to: CGPoint(x: 710.31, y: 643.71)) clipPath.addCurve(to: CGPoint(x: 773.55, y: 609.88), controlPoint1: CGPoint(x: 721.21, y: 618.67), controlPoint2: CGPoint(x: 747.76, y: 605.31)) clipPath.addCurve(to: CGPoint(x: 757.71, y: 599.2), controlPoint1: CGPoint(x: 768.94, y: 605.62), controlPoint2: CGPoint(x: 763.79, y: 601.84)) clipPath.addCurve(to: CGPoint(x: 681.22, y: 629.16), controlPoint1: CGPoint(x: 728.33, y: 586.23), controlPoint2: CGPoint(x: 694.01, y: 599.76)) clipPath.addLine(to: CGPoint(x: 663.6, y: 669.18)) clipPath.addLine(to: CGPoint(x: 634.51, y: 735.83)) clipPath.addLine(to: CGPoint(x: 605.28, y: 802.49)) clipPath.addLine(to: CGPoint(x: 587.83, y: 842.51)) clipPath.addCurve(to: CGPoint(x: 617.8, y: 919.23), controlPoint1: CGPoint(x: 574.89, y: 871.93), controlPoint2: CGPoint(x: 588.41, y: 906.27)) clipPath.addCurve(to: CGPoint(x: 630.99, y: 923.07), controlPoint1: CGPoint(x: 622.13, y: 921.08), controlPoint2: CGPoint(x: 626.55, y: 922.27)) clipPath.addCurve(to: CGPoint(x: 616.92, y: 857.07), controlPoint1: CGPoint(x: 613.24, y: 906.67), controlPoint2: CGPoint(x: 606.65, y: 880.4)) clipPath.close() clipPath.usesEvenOddFillRule = true clipPath.addClip() //// Rectangle Drawing let rectanglePath = UIBezierPath(rect: CGRect(x: 577.92, y: 589.25, width: 200.65, height: 338.8)) light.setFill() rectanglePath.fill() context.endTransparencyLayer() context.restoreGState() //// Bezier 34 Drawing let bezier34Path = UIBezierPath() bezier34Path.move(to: CGPoint(x: 690.76, y: 686.15)) bezier34Path.addCurve(to: CGPoint(x: 687.85, y: 685.55), controlPoint1: CGPoint(x: 689.78, y: 686.15), controlPoint2: CGPoint(x: 688.8, y: 685.95)) bezier34Path.addLine(to: CGPoint(x: 661.21, y: 673.9)) bezier34Path.addCurve(to: CGPoint(x: 657.46, y: 664.31), controlPoint1: CGPoint(x: 657.53, y: 672.27), controlPoint2: CGPoint(x: 655.86, y: 667.98)) bezier34Path.addCurve(to: CGPoint(x: 667.04, y: 660.56), controlPoint1: CGPoint(x: 659.07, y: 660.62), controlPoint2: CGPoint(x: 663.37, y: 658.94)) bezier34Path.addLine(to: CGPoint(x: 693.67, y: 672.22)) bezier34Path.addCurve(to: CGPoint(x: 697.42, y: 681.8), controlPoint1: CGPoint(x: 697.37, y: 673.81), controlPoint2: CGPoint(x: 699.05, y: 678.1)) bezier34Path.addCurve(to: CGPoint(x: 690.76, y: 686.15), controlPoint1: CGPoint(x: 696.23, y: 684.53), controlPoint2: CGPoint(x: 693.56, y: 686.15)) bezier34Path.close() bezier34Path.usesEvenOddFillRule = true dark.setFill() bezier34Path.fill() //// Bezier 3 Drawing let bezier3Path = UIBezierPath() bezier3Path.move(to: CGPoint(x: 847.27, y: 639.24)) bezier3Path.addCurve(to: CGPoint(x: 853.82, y: 644.33), controlPoint1: CGPoint(x: 849.46, y: 640.55), controlPoint2: CGPoint(x: 851.79, y: 642.28)) bezier3Path.addLine(to: CGPoint(x: 874.72, y: 657.44)) bezier3Path.addCurve(to: CGPoint(x: 762.28, y: 927.95), controlPoint1: CGPoint(x: 857.69, y: 757.31), controlPoint2: CGPoint(x: 820.78, y: 845.82)) bezier3Path.addLine(to: CGPoint(x: 744.96, y: 944.98)) bezier3Path.addCurve(to: CGPoint(x: 697.23, y: 954.27), controlPoint1: CGPoint(x: 726.18, y: 966.96), controlPoint2: CGPoint(x: 707.71, y: 958.8)) bezier3Path.addLine(to: CGPoint(x: 670.6, y: 942.64)) bezier3Path.addLine(to: CGPoint(x: 678.46, y: 924.59)) bezier3Path.addLine(to: CGPoint(x: 802.75, y: 640.69)) bezier3Path.addLine(to: CGPoint(x: 810.75, y: 622.49)) bezier3Path.addLine(to: CGPoint(x: 837.38, y: 634.29)) bezier3Path.addCurve(to: CGPoint(x: 847.27, y: 639.24), controlPoint1: CGPoint(x: 840.3, y: 635.46), controlPoint2: CGPoint(x: 843.78, y: 637.05)) bezier3Path.close() bezier3Path.usesEvenOddFillRule = true light.setFill() bezier3Path.fill() //// Bezier 4 Drawing let bezier4Path = UIBezierPath() bezier4Path.move(to: CGPoint(x: 495.09, y: 71.44)) bezier4Path.addCurve(to: CGPoint(x: 169.82, y: 264.93), controlPoint1: CGPoint(x: 308.51, y: 71.44), controlPoint2: CGPoint(x: 215.23, y: 176.56)) bezier4Path.addCurve(to: CGPoint(x: 165.16, y: 274.39), controlPoint1: CGPoint(x: 168.22, y: 267.98), controlPoint2: CGPoint(x: 166.62, y: 271.19)) bezier4Path.addCurve(to: CGPoint(x: 242, y: 927.95), controlPoint1: CGPoint(x: 73.48, y: 463.36), controlPoint2: CGPoint(x: 105.2, y: 736.21)) bezier4Path.addLine(to: CGPoint(x: 218.43, y: 944.98)) bezier4Path.addCurve(to: CGPoint(x: 495.09, y: 42.32), controlPoint1: CGPoint(x: -19.52, y: 611.86), controlPoint2: CGPoint(x: 51.93, y: 42.32)) bezier4Path.addCurve(to: CGPoint(x: 786, y: 944.98), controlPoint1: CGPoint(x: 938.37, y: 42.32), controlPoint2: CGPoint(x: 1023.8, y: 611.86)) bezier4Path.addLine(to: CGPoint(x: 762.28, y: 927.95)) bezier4Path.addCurve(to: CGPoint(x: 876.38, y: 648.11), controlPoint1: CGPoint(x: 820.78, y: 845.82), controlPoint2: CGPoint(x: 859.35, y: 747.98)) bezier4Path.addCurve(to: CGPoint(x: 830.83, y: 275.99), controlPoint1: CGPoint(x: 898.79, y: 517.51), controlPoint2: CGPoint(x: 884.68, y: 383.29)) bezier4Path.addCurve(to: CGPoint(x: 828.64, y: 271.62), controlPoint1: CGPoint(x: 830.11, y: 274.54), controlPoint2: CGPoint(x: 829.38, y: 273.08)) bezier4Path.addCurve(to: CGPoint(x: 495.09, y: 71.44), controlPoint1: CGPoint(x: 781.64, y: 180.34), controlPoint2: CGPoint(x: 685.74, y: 71.44)) bezier4Path.close() bezier4Path.usesEvenOddFillRule = true light.setFill() bezier4Path.fill() //// Bezier 5 Drawing let bezier5Path = UIBezierPath() bezier5Path.move(to: CGPoint(x: 861.61, y: 649.22)) bezier5Path.addCurve(to: CGPoint(x: 718.58, y: 959.48), controlPoint1: CGPoint(x: 844.5, y: 748.66), controlPoint2: CGPoint(x: 786.05, y: 879.38)) bezier5Path.addCurve(to: CGPoint(x: 744.96, y: 944.98), controlPoint1: CGPoint(x: 726.71, y: 959.2), controlPoint2: CGPoint(x: 735.79, y: 955.7)) bezier5Path.addLine(to: CGPoint(x: 762.28, y: 927.95)) bezier5Path.addCurve(to: CGPoint(x: 874.72, y: 657.44), controlPoint1: CGPoint(x: 820.78, y: 845.82), controlPoint2: CGPoint(x: 857.69, y: 757.31)) bezier5Path.addLine(to: CGPoint(x: 861.61, y: 649.22)) bezier5Path.close() bezier5Path.usesEvenOddFillRule = true medium.setFill() bezier5Path.fill() //// Bezier 6 Drawing let bezier6Path = UIBezierPath() bezier6Path.move(to: CGPoint(x: 324.01, y: 629.17)) bezier6Path.addCurve(to: CGPoint(x: 247.47, y: 599.2), controlPoint1: CGPoint(x: 311.21, y: 599.77), controlPoint2: CGPoint(x: 276.86, y: 586.24)) bezier6Path.addCurve(to: CGPoint(x: 215.3, y: 634.86), controlPoint1: CGPoint(x: 231.46, y: 606.2), controlPoint2: CGPoint(x: 220.25, y: 619.42)) bezier6Path.addLine(to: CGPoint(x: 202.06, y: 640.69)) bezier6Path.addLine(to: CGPoint(x: 326.34, y: 924.59)) bezier6Path.addLine(to: CGPoint(x: 339.59, y: 918.76)) bezier6Path.addCurve(to: CGPoint(x: 387.47, y: 919.35), controlPoint1: CGPoint(x: 354.14, y: 925.61), controlPoint2: CGPoint(x: 371.46, y: 926.18)) bezier6Path.addCurve(to: CGPoint(x: 417.45, y: 842.61), controlPoint1: CGPoint(x: 416.87, y: 906.39), controlPoint2: CGPoint(x: 430.4, y: 872.04)) bezier6Path.addLine(to: CGPoint(x: 399.98, y: 802.57)) bezier6Path.addLine(to: CGPoint(x: 370.73, y: 735.89)) bezier6Path.addLine(to: CGPoint(x: 341.63, y: 669.21)) bezier6Path.addLine(to: CGPoint(x: 324.01, y: 629.17)) bezier6Path.close() bezier6Path.usesEvenOddFillRule = true medium.setFill() bezier6Path.fill() //// Group 4 context.saveGState() context.beginTransparencyLayer(auxiliaryInfo: nil) //// Clip Clip 2 let clip2Path = UIBezierPath() clip2Path.move(to: CGPoint(x: 388.67, y: 857.07)) clip2Path.addLine(to: CGPoint(x: 371.21, y: 817.05)) clip2Path.addLine(to: CGPoint(x: 341.98, y: 750.39)) clip2Path.addLine(to: CGPoint(x: 312.89, y: 683.73)) clip2Path.addLine(to: CGPoint(x: 295.28, y: 643.71)) clip2Path.addCurve(to: CGPoint(x: 232.03, y: 609.88), controlPoint1: CGPoint(x: 284.38, y: 618.67), controlPoint2: CGPoint(x: 257.82, y: 605.31)) clip2Path.addCurve(to: CGPoint(x: 247.87, y: 599.2), controlPoint1: CGPoint(x: 236.65, y: 605.62), controlPoint2: CGPoint(x: 241.79, y: 601.84)) clip2Path.addCurve(to: CGPoint(x: 324.37, y: 629.16), controlPoint1: CGPoint(x: 277.25, y: 586.23), controlPoint2: CGPoint(x: 311.58, y: 599.76)) clip2Path.addLine(to: CGPoint(x: 341.98, y: 669.18)) clip2Path.addLine(to: CGPoint(x: 371.07, y: 735.83)) clip2Path.addLine(to: CGPoint(x: 400.3, y: 802.49)) clip2Path.addLine(to: CGPoint(x: 417.75, y: 842.51)) clip2Path.addCurve(to: CGPoint(x: 387.79, y: 919.23), controlPoint1: CGPoint(x: 430.69, y: 871.93), controlPoint2: CGPoint(x: 417.17, y: 906.27)) clip2Path.addCurve(to: CGPoint(x: 374.6, y: 923.07), controlPoint1: CGPoint(x: 383.46, y: 921.08), controlPoint2: CGPoint(x: 379.04, y: 922.27)) clip2Path.addCurve(to: CGPoint(x: 388.67, y: 857.07), controlPoint1: CGPoint(x: 392.35, y: 906.67), controlPoint2: CGPoint(x: 398.93, y: 880.4)) clip2Path.close() clip2Path.usesEvenOddFillRule = true clip2Path.addClip() //// Rectangle 2 Drawing let rectangle2Path = UIBezierPath(rect: CGRect(x: 227.03, y: 589.25, width: 200.65, height: 338.8)) light.setFill() rectangle2Path.fill() context.endTransparencyLayer() context.restoreGState() //// Group 5 context.saveGState() context.beginTransparencyLayer(auxiliaryInfo: nil) //// Clip Clip 3 let clip3Path = UIBezierPath() clip3Path.move(to: CGPoint(x: 150.75, y: 644.15)) clip3Path.addLine(to: CGPoint(x: 129.82, y: 657.28)) clip3Path.addCurve(to: CGPoint(x: 242.43, y: 928.21), controlPoint1: CGPoint(x: 146.87, y: 757.3), controlPoint2: CGPoint(x: 183.84, y: 845.96)) clip3Path.addLine(to: CGPoint(x: 259.78, y: 945.27)) clip3Path.addCurve(to: CGPoint(x: 307.58, y: 954.58), controlPoint1: CGPoint(x: 278.58, y: 967.28), controlPoint2: CGPoint(x: 297.09, y: 959.11)) clip3Path.addLine(to: CGPoint(x: 334.26, y: 942.93)) clip3Path.addLine(to: CGPoint(x: 326.38, y: 924.85)) clip3Path.addLine(to: CGPoint(x: 201.91, y: 640.5)) clip3Path.addLine(to: CGPoint(x: 193.9, y: 622.27)) clip3Path.addLine(to: CGPoint(x: 167.22, y: 634.09)) clip3Path.addCurve(to: CGPoint(x: 157.31, y: 639.05), controlPoint1: CGPoint(x: 164.3, y: 635.26), controlPoint2: CGPoint(x: 160.81, y: 636.86)) clip3Path.addCurve(to: CGPoint(x: 150.75, y: 644.15), controlPoint1: CGPoint(x: 155.12, y: 640.36), controlPoint2: CGPoint(x: 152.79, y: 642.1)) clip3Path.close() clip3Path.usesEvenOddFillRule = true clip3Path.addClip() //// Rectangle 3 Drawing let rectangle3Path = UIBezierPath(rect: CGRect(x: 124.83, y: 617.3, width: 214.45, height: 347.6)) light.setFill() rectangle3Path.fill() context.endTransparencyLayer() context.restoreGState() //// Bezier 9 Drawing let bezier9Path = UIBezierPath() bezier9Path.move(to: CGPoint(x: 143.18, y: 649.22)) bezier9Path.addCurve(to: CGPoint(x: 286.22, y: 959.48), controlPoint1: CGPoint(x: 160.3, y: 748.66), controlPoint2: CGPoint(x: 218.76, y: 879.38)) bezier9Path.addCurve(to: CGPoint(x: 259.84, y: 944.98), controlPoint1: CGPoint(x: 278.08, y: 959.2), controlPoint2: CGPoint(x: 269, y: 955.7)) bezier9Path.addLine(to: CGPoint(x: 242.52, y: 927.95)) bezier9Path.addCurve(to: CGPoint(x: 130.08, y: 657.44), controlPoint1: CGPoint(x: 184.01, y: 845.82), controlPoint2: CGPoint(x: 147.11, y: 757.31)) bezier9Path.addLine(to: CGPoint(x: 143.18, y: 649.22)) bezier9Path.close() bezier9Path.usesEvenOddFillRule = true medium.setFill() bezier9Path.fill() //// Bezier 10 Drawing let bezier10Path = UIBezierPath() bezier10Path.move(to: CGPoint(x: 495.09, y: 42.32)) bezier10Path.addCurve(to: CGPoint(x: 487.81, y: 42.47), controlPoint1: CGPoint(x: 492.63, y: 42.32), controlPoint2: CGPoint(x: 490.25, y: 42.43)) bezier10Path.addCurve(to: CGPoint(x: 776.28, y: 937.98), controlPoint1: CGPoint(x: 921.66, y: 48.68), controlPoint2: CGPoint(x: 1006.71, y: 605.83)) bezier10Path.addLine(to: CGPoint(x: 786, y: 944.98)) bezier10Path.addCurve(to: CGPoint(x: 495.09, y: 42.32), controlPoint1: CGPoint(x: 1023.8, y: 611.86), controlPoint2: CGPoint(x: 938.38, y: 42.32)) bezier10Path.close() bezier10Path.usesEvenOddFillRule = true white.setFill() bezier10Path.fill() //// Bezier 11 Drawing let bezier11Path = UIBezierPath() bezier11Path.move(to: CGPoint(x: 502.36, y: 42.47)) bezier11Path.addCurve(to: CGPoint(x: 495.09, y: 42.32), controlPoint1: CGPoint(x: 499.93, y: 42.43), controlPoint2: CGPoint(x: 497.55, y: 42.32)) bezier11Path.addCurve(to: CGPoint(x: 218.43, y: 944.98), controlPoint1: CGPoint(x: 51.93, y: 42.32), controlPoint2: CGPoint(x: -19.52, y: 611.86)) bezier11Path.addLine(to: CGPoint(x: 228.13, y: 937.95)) bezier11Path.addCurve(to: CGPoint(x: 502.36, y: 42.47), controlPoint1: CGPoint(x: -2.61, y: 605.8), controlPoint2: CGPoint(x: 68.81, y: 48.68)) bezier11Path.close() bezier11Path.usesEvenOddFillRule = true white.setFill() bezier11Path.fill() //// Group 6 context.saveGState() context.beginTransparencyLayer(auxiliaryInfo: nil) //// Clip Clip 4 let clip4Path = UIBezierPath() clip4Path.move(to: CGPoint(x: 187.66, y: 285.29)) clip4Path.addLine(to: CGPoint(x: 167.3, y: 275.54)) clip4Path.addLine(to: CGPoint(x: 165.41, y: 274.67)) clip4Path.addCurve(to: CGPoint(x: 170.06, y: 265.21), controlPoint1: CGPoint(x: 166.87, y: 271.47), controlPoint2: CGPoint(x: 168.46, y: 268.27)) clip4Path.addCurve(to: CGPoint(x: 495.17, y: 71.88), controlPoint1: CGPoint(x: 215.45, y: 176.91), controlPoint2: CGPoint(x: 308.69, y: 71.88)) clip4Path.addCurve(to: CGPoint(x: 828.56, y: 271.9), controlPoint1: CGPoint(x: 685.72, y: 71.88), controlPoint2: CGPoint(x: 781.58, y: 180.69)) clip4Path.addCurve(to: CGPoint(x: 830.74, y: 276.26), controlPoint1: CGPoint(x: 829.29, y: 273.36), controlPoint2: CGPoint(x: 830.02, y: 274.82)) clip4Path.addLine(to: CGPoint(x: 802.67, y: 285.28)) clip4Path.addCurve(to: CGPoint(x: 495.17, y: 100.97), controlPoint1: CGPoint(x: 759.46, y: 201.21), controlPoint2: CGPoint(x: 671.02, y: 100.97)) clip4Path.addCurve(to: CGPoint(x: 187.66, y: 285.29), controlPoint1: CGPoint(x: 319.45, y: 100.97), controlPoint2: CGPoint(x: 231.01, y: 201.21)) clip4Path.close() clip4Path.usesEvenOddFillRule = true clip4Path.addClip() //// Rectangle 4 Drawing let rectangle4Path = UIBezierPath(rect: CGRect(x: 160.43, y: 66.9, width: 675.35, height: 223.4)) medium.setFill() rectangle4Path.fill() context.endTransparencyLayer() context.restoreGState() //// Bezier 13 Drawing let bezier13Path = UIBezierPath() bezier13Path.move(to: CGPoint(x: 786, y: 952.26)) bezier13Path.addCurve(to: CGPoint(x: 781.78, y: 950.89), controlPoint1: CGPoint(x: 784.54, y: 952.26), controlPoint2: CGPoint(x: 783.06, y: 951.8)) bezier13Path.addCurve(to: CGPoint(x: 780.09, y: 940.74), controlPoint1: CGPoint(x: 778.52, y: 948.56), controlPoint2: CGPoint(x: 777.75, y: 944.01)) bezier13Path.addCurve(to: CGPoint(x: 848.13, y: 261.75), controlPoint1: CGPoint(x: 920.64, y: 743.85), controlPoint2: CGPoint(x: 949.25, y: 458.31)) bezier13Path.addCurve(to: CGPoint(x: 495.09, y: 49.6), controlPoint1: CGPoint(x: 777.73, y: 124.94), controlPoint2: CGPoint(x: 652.37, y: 49.6)) bezier13Path.addCurve(to: CGPoint(x: 487.81, y: 42.32), controlPoint1: CGPoint(x: 491.06, y: 49.6), controlPoint2: CGPoint(x: 487.81, y: 46.34)) bezier13Path.addCurve(to: CGPoint(x: 495.09, y: 35.04), controlPoint1: CGPoint(x: 487.81, y: 38.3), controlPoint2: CGPoint(x: 491.06, y: 35.04)) bezier13Path.addCurve(to: CGPoint(x: 861.06, y: 255.09), controlPoint1: CGPoint(x: 658.08, y: 35.04), controlPoint2: CGPoint(x: 788.06, y: 113.19)) bezier13Path.addCurve(to: CGPoint(x: 791.93, y: 949.21), controlPoint1: CGPoint(x: 964.54, y: 456.22), controlPoint2: CGPoint(x: 935.46, y: 748.15)) bezier13Path.addCurve(to: CGPoint(x: 786, y: 952.26), controlPoint1: CGPoint(x: 790.51, y: 951.17), controlPoint2: CGPoint(x: 788.28, y: 952.26)) bezier13Path.close() bezier13Path.usesEvenOddFillRule = true dark.setFill() bezier13Path.fill() //// Bezier 14 Drawing let bezier14Path = UIBezierPath() bezier14Path.move(to: CGPoint(x: 218.44, y: 952.26)) bezier14Path.addCurve(to: CGPoint(x: 212.51, y: 949.21), controlPoint1: CGPoint(x: 216.16, y: 952.26), controlPoint2: CGPoint(x: 213.93, y: 951.2)) bezier14Path.addCurve(to: CGPoint(x: 137.44, y: 248.33), controlPoint1: CGPoint(x: 65.79, y: 743.8), controlPoint2: CGPoint(x: 34.21, y: 449.04)) bezier14Path.addCurve(to: CGPoint(x: 495.09, y: 35.04), controlPoint1: CGPoint(x: 208.17, y: 110.79), controlPoint2: CGPoint(x: 335.18, y: 35.04)) bezier14Path.addCurve(to: CGPoint(x: 502.36, y: 42.32), controlPoint1: CGPoint(x: 499.11, y: 35.04), controlPoint2: CGPoint(x: 502.36, y: 38.3)) bezier14Path.addCurve(to: CGPoint(x: 495.09, y: 49.6), controlPoint1: CGPoint(x: 502.36, y: 46.34), controlPoint2: CGPoint(x: 499.11, y: 49.6)) bezier14Path.addCurve(to: CGPoint(x: 150.38, y: 254.99), controlPoint1: CGPoint(x: 297.48, y: 49.6), controlPoint2: CGPoint(x: 198.56, y: 161.29)) bezier14Path.addCurve(to: CGPoint(x: 224.35, y: 940.74), controlPoint1: CGPoint(x: 49.5, y: 451.13), controlPoint2: CGPoint(x: 80.62, y: 739.53)) bezier14Path.addCurve(to: CGPoint(x: 222.66, y: 950.89), controlPoint1: CGPoint(x: 226.69, y: 944.01), controlPoint2: CGPoint(x: 225.93, y: 948.56)) bezier14Path.addCurve(to: CGPoint(x: 218.44, y: 952.26), controlPoint1: CGPoint(x: 221.38, y: 951.8), controlPoint2: CGPoint(x: 219.9, y: 952.26)) bezier14Path.close() bezier14Path.usesEvenOddFillRule = true dark.setFill() bezier14Path.fill() //// Bezier 15 Drawing let bezier15Path = UIBezierPath() bezier15Path.move(to: CGPoint(x: 762.27, y: 935.22)) bezier15Path.addCurve(to: CGPoint(x: 758.06, y: 933.86), controlPoint1: CGPoint(x: 760.81, y: 935.22), controlPoint2: CGPoint(x: 759.34, y: 934.77)) bezier15Path.addCurve(to: CGPoint(x: 756.36, y: 923.71), controlPoint1: CGPoint(x: 754.78, y: 931.53), controlPoint2: CGPoint(x: 754.03, y: 926.98)) bezier15Path.addCurve(to: CGPoint(x: 869.22, y: 646.89), controlPoint1: CGPoint(x: 812.82, y: 844.46), controlPoint2: CGPoint(x: 851.85, y: 748.75)) bezier15Path.addCurve(to: CGPoint(x: 824.32, y: 279.25), controlPoint1: CGPoint(x: 892.16, y: 513.21), controlPoint2: CGPoint(x: 876.21, y: 382.64)) bezier15Path.addLine(to: CGPoint(x: 822.15, y: 274.89)) bezier15Path.addCurve(to: CGPoint(x: 495.09, y: 78.72), controlPoint1: CGPoint(x: 776.07, y: 185.44), controlPoint2: CGPoint(x: 681.91, y: 78.72)) bezier15Path.addCurve(to: CGPoint(x: 487.81, y: 71.44), controlPoint1: CGPoint(x: 491.06, y: 78.72), controlPoint2: CGPoint(x: 487.81, y: 75.46)) bezier15Path.addCurve(to: CGPoint(x: 495.09, y: 64.16), controlPoint1: CGPoint(x: 487.81, y: 67.41), controlPoint2: CGPoint(x: 491.06, y: 64.16)) bezier15Path.addCurve(to: CGPoint(x: 835.11, y: 268.29), controlPoint1: CGPoint(x: 689.25, y: 64.16), controlPoint2: CGPoint(x: 787.15, y: 175.16)) bezier15Path.addLine(to: CGPoint(x: 837.34, y: 272.73)) bezier15Path.addCurve(to: CGPoint(x: 883.56, y: 649.36), controlPoint1: CGPoint(x: 890.61, y: 378.87), controlPoint2: CGPoint(x: 907.02, y: 512.62)) bezier15Path.addCurve(to: CGPoint(x: 768.21, y: 932.15), controlPoint1: CGPoint(x: 865.82, y: 753.35), controlPoint2: CGPoint(x: 825.94, y: 851.14)) bezier15Path.addCurve(to: CGPoint(x: 762.27, y: 935.22), controlPoint1: CGPoint(x: 766.79, y: 934.14), controlPoint2: CGPoint(x: 764.54, y: 935.22)) bezier15Path.close() bezier15Path.usesEvenOddFillRule = true dark.setFill() bezier15Path.fill() //// Bezier 16 Drawing let bezier16Path = UIBezierPath() bezier16Path.move(to: CGPoint(x: 242.01, y: 935.22)) bezier16Path.addCurve(to: CGPoint(x: 236.08, y: 932.15), controlPoint1: CGPoint(x: 239.73, y: 935.22), controlPoint2: CGPoint(x: 237.5, y: 934.14)) bezier16Path.addCurve(to: CGPoint(x: 158.62, y: 271.21), controlPoint1: CGPoint(x: 98.76, y: 739.7), controlPoint2: CGPoint(x: 66.18, y: 461.73)) bezier16Path.addCurve(to: CGPoint(x: 163.37, y: 261.55), controlPoint1: CGPoint(x: 160.05, y: 268.06), controlPoint2: CGPoint(x: 161.71, y: 264.72)) bezier16Path.addCurve(to: CGPoint(x: 495.09, y: 64.16), controlPoint1: CGPoint(x: 209.63, y: 171.53), controlPoint2: CGPoint(x: 304.75, y: 64.16)) bezier16Path.addCurve(to: CGPoint(x: 502.36, y: 71.44), controlPoint1: CGPoint(x: 499.11, y: 64.16), controlPoint2: CGPoint(x: 502.36, y: 67.42)) bezier16Path.addCurve(to: CGPoint(x: 495.09, y: 78.72), controlPoint1: CGPoint(x: 502.36, y: 75.46), controlPoint2: CGPoint(x: 499.11, y: 78.72)) bezier16Path.addCurve(to: CGPoint(x: 176.29, y: 268.25), controlPoint1: CGPoint(x: 312.1, y: 78.72), controlPoint2: CGPoint(x: 220.72, y: 181.79)) bezier16Path.addCurve(to: CGPoint(x: 171.78, y: 277.41), controlPoint1: CGPoint(x: 174.73, y: 271.25), controlPoint2: CGPoint(x: 173.18, y: 274.33)) bezier16Path.addCurve(to: CGPoint(x: 247.92, y: 923.71), controlPoint1: CGPoint(x: 81.46, y: 463.58), controlPoint2: CGPoint(x: 113.51, y: 735.32)) bezier16Path.addCurve(to: CGPoint(x: 246.23, y: 933.86), controlPoint1: CGPoint(x: 250.26, y: 926.98), controlPoint2: CGPoint(x: 249.5, y: 931.53)) bezier16Path.addCurve(to: CGPoint(x: 242.01, y: 935.22), controlPoint1: CGPoint(x: 244.95, y: 934.77), controlPoint2: CGPoint(x: 243.47, y: 935.22)) bezier16Path.close() bezier16Path.usesEvenOddFillRule = true dark.setFill() bezier16Path.fill() //// Bezier 17 Drawing let bezier17Path = UIBezierPath() bezier17Path.move(to: CGPoint(x: 786, y: 952.26)) bezier17Path.addCurve(to: CGPoint(x: 781.77, y: 950.89), controlPoint1: CGPoint(x: 784.53, y: 952.26), controlPoint2: CGPoint(x: 783.05, y: 951.8)) bezier17Path.addLine(to: CGPoint(x: 758.03, y: 933.86)) bezier17Path.addCurve(to: CGPoint(x: 756.37, y: 923.68), controlPoint1: CGPoint(x: 754.78, y: 931.5), controlPoint2: CGPoint(x: 754.03, y: 926.95)) bezier17Path.addCurve(to: CGPoint(x: 766.52, y: 922.03), controlPoint1: CGPoint(x: 758.72, y: 920.41), controlPoint2: CGPoint(x: 763.24, y: 919.67)) bezier17Path.addLine(to: CGPoint(x: 790.25, y: 939.06)) bezier17Path.addCurve(to: CGPoint(x: 791.92, y: 949.21), controlPoint1: CGPoint(x: 793.51, y: 941.39), controlPoint2: CGPoint(x: 794.26, y: 945.94)) bezier17Path.addCurve(to: CGPoint(x: 786, y: 952.26), controlPoint1: CGPoint(x: 790.49, y: 951.2), controlPoint2: CGPoint(x: 788.26, y: 952.26)) bezier17Path.close() bezier17Path.usesEvenOddFillRule = true dark.setFill() bezier17Path.fill() //// Bezier 18 Drawing let bezier18Path = UIBezierPath() bezier18Path.move(to: CGPoint(x: 218.44, y: 952.26)) bezier18Path.addCurve(to: CGPoint(x: 212.53, y: 949.24), controlPoint1: CGPoint(x: 216.18, y: 952.26), controlPoint2: CGPoint(x: 213.96, y: 951.2)) bezier18Path.addCurve(to: CGPoint(x: 214.17, y: 939.06), controlPoint1: CGPoint(x: 210.18, y: 945.97), controlPoint2: CGPoint(x: 210.91, y: 941.42)) bezier18Path.addLine(to: CGPoint(x: 237.74, y: 922.03)) bezier18Path.addCurve(to: CGPoint(x: 247.9, y: 923.68), controlPoint1: CGPoint(x: 241, y: 919.64), controlPoint2: CGPoint(x: 245.54, y: 920.44)) bezier18Path.addCurve(to: CGPoint(x: 246.27, y: 933.83), controlPoint1: CGPoint(x: 250.25, y: 926.92), controlPoint2: CGPoint(x: 249.52, y: 931.47)) bezier18Path.addLine(to: CGPoint(x: 222.7, y: 950.86)) bezier18Path.addCurve(to: CGPoint(x: 218.44, y: 952.26), controlPoint1: CGPoint(x: 221.4, y: 951.8), controlPoint2: CGPoint(x: 219.92, y: 952.26)) bezier18Path.close() bezier18Path.usesEvenOddFillRule = true dark.setFill() bezier18Path.fill() //// Bezier 19 Drawing let bezier19Path = UIBezierPath() bezier19Path.move(to: CGPoint(x: 287.3, y: 966.79)) bezier19Path.addCurve(to: CGPoint(x: 254.22, y: 949.7), controlPoint1: CGPoint(x: 277.2, y: 966.79), controlPoint2: CGPoint(x: 265.53, y: 962.92)) bezier19Path.addCurve(to: CGPoint(x: 255.03, y: 939.43), controlPoint1: CGPoint(x: 251.61, y: 946.65), controlPoint2: CGPoint(x: 251.98, y: 942.05)) bezier19Path.addCurve(to: CGPoint(x: 265.29, y: 940.23), controlPoint1: CGPoint(x: 258.08, y: 936.81), controlPoint2: CGPoint(x: 262.67, y: 937.18)) bezier19Path.addCurve(to: CGPoint(x: 304.58, y: 947.62), controlPoint1: CGPoint(x: 280.56, y: 958.11), controlPoint2: CGPoint(x: 294.44, y: 952.03)) bezier19Path.addCurve(to: CGPoint(x: 314.16, y: 951.37), controlPoint1: CGPoint(x: 308.26, y: 946.03), controlPoint2: CGPoint(x: 312.55, y: 947.71)) bezier19Path.addCurve(to: CGPoint(x: 310.4, y: 960.96), controlPoint1: CGPoint(x: 315.77, y: 955.04), controlPoint2: CGPoint(x: 314.09, y: 959.34)) bezier19Path.addCurve(to: CGPoint(x: 287.3, y: 966.79), controlPoint1: CGPoint(x: 305.41, y: 963.15), controlPoint2: CGPoint(x: 297.1, y: 966.79)) bezier19Path.close() bezier19Path.usesEvenOddFillRule = true dark.setFill() bezier19Path.fill() //// Bezier 20 Drawing let bezier20Path = UIBezierPath() bezier20Path.move(to: CGPoint(x: 150.9, y: 651.61)) bezier20Path.addCurve(to: CGPoint(x: 145.58, y: 649.28), controlPoint1: CGPoint(x: 148.95, y: 651.61), controlPoint2: CGPoint(x: 147.01, y: 650.81)) bezier20Path.addCurve(to: CGPoint(x: 145.94, y: 638.98), controlPoint1: CGPoint(x: 142.84, y: 646.35), controlPoint2: CGPoint(x: 143, y: 641.74)) bezier20Path.addCurve(to: CGPoint(x: 154.03, y: 632.87), controlPoint1: CGPoint(x: 148.83, y: 636.31), controlPoint2: CGPoint(x: 151.41, y: 634.35)) bezier20Path.addCurve(to: CGPoint(x: 164.79, y: 627.53), controlPoint1: CGPoint(x: 157.02, y: 631), controlPoint2: CGPoint(x: 160.64, y: 629.18)) bezier20Path.addCurve(to: CGPoint(x: 174.25, y: 631.59), controlPoint1: CGPoint(x: 168.48, y: 626.05), controlPoint2: CGPoint(x: 172.77, y: 627.87)) bezier20Path.addCurve(to: CGPoint(x: 170.2, y: 641.03), controlPoint1: CGPoint(x: 175.74, y: 635.32), controlPoint2: CGPoint(x: 173.93, y: 639.55)) bezier20Path.addCurve(to: CGPoint(x: 161.46, y: 645.41), controlPoint1: CGPoint(x: 166.87, y: 642.37), controlPoint2: CGPoint(x: 164.01, y: 643.79)) bezier20Path.addCurve(to: CGPoint(x: 155.86, y: 649.65), controlPoint1: CGPoint(x: 159.57, y: 646.46), controlPoint2: CGPoint(x: 157.88, y: 647.77)) bezier20Path.addCurve(to: CGPoint(x: 150.9, y: 651.61), controlPoint1: CGPoint(x: 154.46, y: 650.96), controlPoint2: CGPoint(x: 152.68, y: 651.61)) bezier20Path.close() bezier20Path.usesEvenOddFillRule = true dark.setFill() bezier20Path.fill() //// Bezier 21 Drawing let bezier21Path = UIBezierPath() bezier21Path.move(to: CGPoint(x: 167.5, y: 641.57)) bezier21Path.addCurve(to: CGPoint(x: 160.84, y: 637.22), controlPoint1: CGPoint(x: 164.71, y: 641.57), controlPoint2: CGPoint(x: 162.04, y: 639.95)) bezier21Path.addCurve(to: CGPoint(x: 164.54, y: 627.64), controlPoint1: CGPoint(x: 159.21, y: 633.55), controlPoint2: CGPoint(x: 160.87, y: 629.26)) bezier21Path.addLine(to: CGPoint(x: 191.17, y: 615.84)) bezier21Path.addCurve(to: CGPoint(x: 200.77, y: 619.53), controlPoint1: CGPoint(x: 194.86, y: 614.19), controlPoint2: CGPoint(x: 199.14, y: 615.87)) bezier21Path.addCurve(to: CGPoint(x: 197.07, y: 629.15), controlPoint1: CGPoint(x: 202.4, y: 623.2), controlPoint2: CGPoint(x: 200.74, y: 627.53)) bezier21Path.addLine(to: CGPoint(x: 170.44, y: 640.94)) bezier21Path.addCurve(to: CGPoint(x: 167.5, y: 641.57), controlPoint1: CGPoint(x: 169.48, y: 641.37), controlPoint2: CGPoint(x: 168.48, y: 641.57)) bezier21Path.close() bezier21Path.usesEvenOddFillRule = true dark.setFill() bezier21Path.fill() //// Bezier 22 Drawing let bezier22Path = UIBezierPath() bezier22Path.move(to: CGPoint(x: 307.5, y: 961.55)) bezier22Path.addCurve(to: CGPoint(x: 300.83, y: 957.2), controlPoint1: CGPoint(x: 304.69, y: 961.55), controlPoint2: CGPoint(x: 302.02, y: 959.93)) bezier22Path.addCurve(to: CGPoint(x: 304.58, y: 947.62), controlPoint1: CGPoint(x: 299.21, y: 953.51), controlPoint2: CGPoint(x: 300.9, y: 949.21)) bezier22Path.addLine(to: CGPoint(x: 331.21, y: 935.96)) bezier22Path.addCurve(to: CGPoint(x: 340.79, y: 939.71), controlPoint1: CGPoint(x: 334.9, y: 934.4), controlPoint2: CGPoint(x: 339.19, y: 936.05)) bezier22Path.addCurve(to: CGPoint(x: 337.04, y: 949.3), controlPoint1: CGPoint(x: 342.41, y: 943.41), controlPoint2: CGPoint(x: 340.72, y: 947.71)) bezier22Path.addLine(to: CGPoint(x: 310.41, y: 960.96)) bezier22Path.addCurve(to: CGPoint(x: 307.5, y: 961.55), controlPoint1: CGPoint(x: 309.46, y: 961.35), controlPoint2: CGPoint(x: 308.46, y: 961.55)) bezier22Path.close() bezier22Path.usesEvenOddFillRule = true dark.setFill() bezier22Path.fill() //// Bezier 23 Drawing let bezier23Path = UIBezierPath() bezier23Path.move(to: CGPoint(x: 334.13, y: 949.92)) bezier23Path.addCurve(to: CGPoint(x: 327.45, y: 945.55), controlPoint1: CGPoint(x: 331.32, y: 949.92), controlPoint2: CGPoint(x: 328.65, y: 948.28)) bezier23Path.addLine(to: CGPoint(x: 187.46, y: 625.42)) bezier23Path.addCurve(to: CGPoint(x: 191.19, y: 615.81), controlPoint1: CGPoint(x: 185.84, y: 621.72), controlPoint2: CGPoint(x: 187.51, y: 617.43)) bezier23Path.addCurve(to: CGPoint(x: 200.78, y: 619.56), controlPoint1: CGPoint(x: 194.9, y: 614.22), controlPoint2: CGPoint(x: 199.17, y: 615.87)) bezier23Path.addLine(to: CGPoint(x: 208.79, y: 637.77)) bezier23Path.addLine(to: CGPoint(x: 340.8, y: 939.75)) bezier23Path.addCurve(to: CGPoint(x: 337.03, y: 949.3), controlPoint1: CGPoint(x: 342.4, y: 943.42), controlPoint2: CGPoint(x: 340.71, y: 947.71)) bezier23Path.addCurve(to: CGPoint(x: 334.13, y: 949.92), controlPoint1: CGPoint(x: 336.09, y: 949.72), controlPoint2: CGPoint(x: 335.1, y: 949.92)) bezier23Path.close() bezier23Path.usesEvenOddFillRule = true dark.setFill() bezier23Path.fill() //// Bezier 24 Drawing let bezier24Path = UIBezierPath() bezier24Path.move(to: CGPoint(x: 314.93, y: 688.15)) bezier24Path.addCurve(to: CGPoint(x: 308.25, y: 683.8), controlPoint1: CGPoint(x: 312.12, y: 688.15), controlPoint2: CGPoint(x: 309.45, y: 686.53)) bezier24Path.addCurve(to: CGPoint(x: 312, y: 674.22), controlPoint1: CGPoint(x: 306.64, y: 680.1), controlPoint2: CGPoint(x: 308.32, y: 675.81)) bezier24Path.addLine(to: CGPoint(x: 338.64, y: 662.56)) bezier24Path.addCurve(to: CGPoint(x: 348.22, y: 666.31), controlPoint1: CGPoint(x: 342.32, y: 660.97), controlPoint2: CGPoint(x: 346.62, y: 662.61)) bezier24Path.addCurve(to: CGPoint(x: 344.46, y: 675.89), controlPoint1: CGPoint(x: 349.83, y: 669.98), controlPoint2: CGPoint(x: 348.15, y: 674.27)) bezier24Path.addLine(to: CGPoint(x: 317.83, y: 687.55)) bezier24Path.addCurve(to: CGPoint(x: 314.93, y: 688.15), controlPoint1: CGPoint(x: 316.89, y: 687.95), controlPoint2: CGPoint(x: 315.9, y: 688.15)) bezier24Path.close() bezier24Path.usesEvenOddFillRule = true dark.setFill() bezier24Path.fill() //// Bezier 25 Drawing let bezier25Path = UIBezierPath() bezier25Path.move(to: CGPoint(x: 344.17, y: 754.83)) bezier25Path.addCurve(to: CGPoint(x: 337.5, y: 750.48), controlPoint1: CGPoint(x: 341.37, y: 754.83), controlPoint2: CGPoint(x: 338.7, y: 753.21)) bezier25Path.addCurve(to: CGPoint(x: 341.25, y: 740.9), controlPoint1: CGPoint(x: 335.89, y: 746.78), controlPoint2: CGPoint(x: 337.57, y: 742.49)) bezier25Path.addLine(to: CGPoint(x: 367.89, y: 729.24)) bezier25Path.addCurve(to: CGPoint(x: 377.47, y: 732.99), controlPoint1: CGPoint(x: 371.57, y: 727.65), controlPoint2: CGPoint(x: 375.87, y: 729.29)) bezier25Path.addCurve(to: CGPoint(x: 373.71, y: 742.58), controlPoint1: CGPoint(x: 379.08, y: 736.66), controlPoint2: CGPoint(x: 377.4, y: 740.95)) bezier25Path.addLine(to: CGPoint(x: 347.08, y: 754.23)) bezier25Path.addCurve(to: CGPoint(x: 344.17, y: 754.83), controlPoint1: CGPoint(x: 346.14, y: 754.63), controlPoint2: CGPoint(x: 345.15, y: 754.83)) bezier25Path.close() bezier25Path.usesEvenOddFillRule = true dark.setFill() bezier25Path.fill() //// Bezier 26 Drawing let bezier26Path = UIBezierPath() bezier26Path.move(to: CGPoint(x: 373.28, y: 821.51)) bezier26Path.addCurve(to: CGPoint(x: 366.61, y: 817.13), controlPoint1: CGPoint(x: 370.47, y: 821.51), controlPoint2: CGPoint(x: 367.8, y: 819.86)) bezier26Path.addCurve(to: CGPoint(x: 370.36, y: 807.55), controlPoint1: CGPoint(x: 365, y: 813.46), controlPoint2: CGPoint(x: 366.68, y: 809.17)) bezier26Path.addLine(to: CGPoint(x: 397, y: 795.92)) bezier26Path.addCurve(to: CGPoint(x: 406.57, y: 799.67), controlPoint1: CGPoint(x: 400.69, y: 794.3), controlPoint2: CGPoint(x: 404.98, y: 796)) bezier26Path.addCurve(to: CGPoint(x: 402.82, y: 809.25), controlPoint1: CGPoint(x: 408.19, y: 803.34), controlPoint2: CGPoint(x: 406.5, y: 807.63)) bezier26Path.addLine(to: CGPoint(x: 376.19, y: 820.89)) bezier26Path.addCurve(to: CGPoint(x: 373.28, y: 821.51), controlPoint1: CGPoint(x: 375.24, y: 821.31), controlPoint2: CGPoint(x: 374.25, y: 821.51)) bezier26Path.close() bezier26Path.usesEvenOddFillRule = true dark.setFill() bezier26Path.fill() //// Bezier 27 Drawing let bezier27Path = UIBezierPath() bezier27Path.move(to: CGPoint(x: 364.04, y: 931.44)) bezier27Path.addCurve(to: CGPoint(x: 336.44, y: 925.36), controlPoint1: CGPoint(x: 354.56, y: 931.44), controlPoint2: CGPoint(x: 345.13, y: 929.42)) bezier27Path.addCurve(to: CGPoint(x: 332.92, y: 915.69), controlPoint1: CGPoint(x: 332.8, y: 923.68), controlPoint2: CGPoint(x: 331.22, y: 919.33)) bezier27Path.addCurve(to: CGPoint(x: 342.58, y: 912.16), controlPoint1: CGPoint(x: 334.6, y: 912.08), controlPoint2: CGPoint(x: 338.92, y: 910.43)) bezier27Path.addCurve(to: CGPoint(x: 384.68, y: 912.64), controlPoint1: CGPoint(x: 355.74, y: 918.27), controlPoint2: CGPoint(x: 371.09, y: 918.47)) bezier27Path.addCurve(to: CGPoint(x: 410.84, y: 845.51), controlPoint1: CGPoint(x: 410.27, y: 901.35), controlPoint2: CGPoint(x: 422.04, y: 871.24)) bezier27Path.addLine(to: CGPoint(x: 317.41, y: 632.1)) bezier27Path.addCurve(to: CGPoint(x: 250.31, y: 605.86), controlPoint1: CGPoint(x: 306.09, y: 606.4), controlPoint2: CGPoint(x: 275.99, y: 594.6)) bezier27Path.addCurve(to: CGPoint(x: 222.32, y: 637.02), controlPoint1: CGPoint(x: 236.84, y: 611.8), controlPoint2: CGPoint(x: 226.63, y: 623.17)) bezier27Path.addCurve(to: CGPoint(x: 213.21, y: 641.83), controlPoint1: CGPoint(x: 221.12, y: 640.86), controlPoint2: CGPoint(x: 217.06, y: 643.02)) bezier27Path.addCurve(to: CGPoint(x: 208.43, y: 632.7), controlPoint1: CGPoint(x: 209.38, y: 640.63), controlPoint2: CGPoint(x: 207.23, y: 636.54)) bezier27Path.addCurve(to: CGPoint(x: 244.45, y: 592.55), controlPoint1: CGPoint(x: 213.98, y: 614.81), controlPoint2: CGPoint(x: 227.12, y: 600.17)) bezier27Path.addCurve(to: CGPoint(x: 330.74, y: 626.24), controlPoint1: CGPoint(x: 277.46, y: 578.02), controlPoint2: CGPoint(x: 316.17, y: 593.17)) bezier27Path.addLine(to: CGPoint(x: 424.18, y: 839.68)) bezier27Path.addCurve(to: CGPoint(x: 390.47, y: 926.01), controlPoint1: CGPoint(x: 438.57, y: 872.75), controlPoint2: CGPoint(x: 423.44, y: 911.48)) bezier27Path.addCurve(to: CGPoint(x: 364.04, y: 931.44), controlPoint1: CGPoint(x: 381.99, y: 929.62), controlPoint2: CGPoint(x: 372.99, y: 931.44)) bezier27Path.close() bezier27Path.usesEvenOddFillRule = true dark.setFill() bezier27Path.fill() //// Bezier 28 Drawing let bezier28Path = UIBezierPath() bezier28Path.move(to: CGPoint(x: 717.59, y: 966.87)) bezier28Path.addCurve(to: CGPoint(x: 694.52, y: 961.04), controlPoint1: CGPoint(x: 708.05, y: 966.87), controlPoint2: CGPoint(x: 699.88, y: 963.34)) bezier28Path.addCurve(to: CGPoint(x: 690.64, y: 951.43), controlPoint1: CGPoint(x: 690.84, y: 959.45), controlPoint2: CGPoint(x: 689.05, y: 955.13)) bezier28Path.addCurve(to: CGPoint(x: 700.12, y: 947.59), controlPoint1: CGPoint(x: 692.23, y: 947.74), controlPoint2: CGPoint(x: 696.41, y: 946.03)) bezier28Path.addCurve(to: CGPoint(x: 739.43, y: 940.23), controlPoint1: CGPoint(x: 710.41, y: 952.03), controlPoint2: CGPoint(x: 724.25, y: 958)) bezier28Path.addCurve(to: CGPoint(x: 749.69, y: 939.43), controlPoint1: CGPoint(x: 742.03, y: 937.19), controlPoint2: CGPoint(x: 746.63, y: 936.82)) bezier28Path.addCurve(to: CGPoint(x: 750.5, y: 949.7), controlPoint1: CGPoint(x: 752.75, y: 942.05), controlPoint2: CGPoint(x: 753.1, y: 946.66)) bezier28Path.addCurve(to: CGPoint(x: 717.59, y: 966.87), controlPoint1: CGPoint(x: 739.15, y: 962.98), controlPoint2: CGPoint(x: 727.62, y: 966.87)) bezier28Path.close() bezier28Path.usesEvenOddFillRule = true dark.setFill() bezier28Path.fill() //// Bezier 29 Drawing let bezier29Path = UIBezierPath() bezier29Path.move(to: CGPoint(x: 853.82, y: 651.61)) bezier29Path.addCurve(to: CGPoint(x: 848.68, y: 649.48), controlPoint1: CGPoint(x: 851.96, y: 651.61), controlPoint2: CGPoint(x: 850.1, y: 650.9)) bezier29Path.addCurve(to: CGPoint(x: 843.54, y: 645.47), controlPoint1: CGPoint(x: 847.22, y: 648), controlPoint2: CGPoint(x: 845.38, y: 646.58)) bezier29Path.addCurve(to: CGPoint(x: 834.68, y: 641.03), controlPoint1: CGPoint(x: 840.85, y: 643.79), controlPoint2: CGPoint(x: 837.99, y: 642.37)) bezier29Path.addCurve(to: CGPoint(x: 830.62, y: 631.59), controlPoint1: CGPoint(x: 830.94, y: 639.55), controlPoint2: CGPoint(x: 829.13, y: 635.32)) bezier29Path.addCurve(to: CGPoint(x: 840.08, y: 627.52), controlPoint1: CGPoint(x: 832.11, y: 627.84), controlPoint2: CGPoint(x: 836.36, y: 626.04)) bezier29Path.addCurve(to: CGPoint(x: 851.14, y: 633.07), controlPoint1: CGPoint(x: 844.22, y: 629.17), controlPoint2: CGPoint(x: 847.83, y: 630.99)) bezier29Path.addCurve(to: CGPoint(x: 858.97, y: 639.18), controlPoint1: CGPoint(x: 853.9, y: 634.72), controlPoint2: CGPoint(x: 856.65, y: 636.85)) bezier29Path.addCurve(to: CGPoint(x: 858.97, y: 649.48), controlPoint1: CGPoint(x: 861.81, y: 642.02), controlPoint2: CGPoint(x: 861.81, y: 646.63)) bezier29Path.addCurve(to: CGPoint(x: 853.82, y: 651.61), controlPoint1: CGPoint(x: 857.55, y: 650.9), controlPoint2: CGPoint(x: 855.69, y: 651.61)) bezier29Path.close() bezier29Path.usesEvenOddFillRule = true dark.setFill() bezier29Path.fill() //// Bezier 30 Drawing let bezier30Path = UIBezierPath() bezier30Path.move(to: CGPoint(x: 837.37, y: 641.57)) bezier30Path.addCurve(to: CGPoint(x: 834.43, y: 640.95), controlPoint1: CGPoint(x: 836.39, y: 641.57), controlPoint2: CGPoint(x: 835.39, y: 641.37)) bezier30Path.addLine(to: CGPoint(x: 807.79, y: 629.15)) bezier30Path.addCurve(to: CGPoint(x: 804.1, y: 619.54), controlPoint1: CGPoint(x: 804.13, y: 627.53), controlPoint2: CGPoint(x: 802.46, y: 623.2)) bezier30Path.addCurve(to: CGPoint(x: 813.69, y: 615.84), controlPoint1: CGPoint(x: 805.72, y: 615.9), controlPoint2: CGPoint(x: 810.02, y: 614.22)) bezier30Path.addLine(to: CGPoint(x: 840.32, y: 627.64)) bezier30Path.addCurve(to: CGPoint(x: 844.03, y: 637.22), controlPoint1: CGPoint(x: 844, y: 629.26), controlPoint2: CGPoint(x: 845.65, y: 633.56)) bezier30Path.addCurve(to: CGPoint(x: 837.37, y: 641.57), controlPoint1: CGPoint(x: 842.83, y: 639.95), controlPoint2: CGPoint(x: 840.17, y: 641.57)) bezier30Path.close() bezier30Path.usesEvenOddFillRule = true dark.setFill() bezier30Path.fill() //// Bezier 31 Drawing let bezier31Path = UIBezierPath() bezier31Path.move(to: CGPoint(x: 697.22, y: 961.55)) bezier31Path.addCurve(to: CGPoint(x: 694.32, y: 960.96), controlPoint1: CGPoint(x: 696.25, y: 961.55), controlPoint2: CGPoint(x: 695.26, y: 961.35)) bezier31Path.addLine(to: CGPoint(x: 667.69, y: 949.3)) bezier31Path.addCurve(to: CGPoint(x: 663.93, y: 939.72), controlPoint1: CGPoint(x: 664.01, y: 947.71), controlPoint2: CGPoint(x: 662.31, y: 943.41)) bezier31Path.addCurve(to: CGPoint(x: 673.52, y: 935.96), controlPoint1: CGPoint(x: 665.54, y: 936.05), controlPoint2: CGPoint(x: 669.83, y: 934.4)) bezier31Path.addLine(to: CGPoint(x: 700.15, y: 947.62)) bezier31Path.addCurve(to: CGPoint(x: 703.9, y: 957.2), controlPoint1: CGPoint(x: 703.83, y: 949.21), controlPoint2: CGPoint(x: 705.51, y: 953.51)) bezier31Path.addCurve(to: CGPoint(x: 697.22, y: 961.55), controlPoint1: CGPoint(x: 702.71, y: 959.93), controlPoint2: CGPoint(x: 700.03, y: 961.55)) bezier31Path.close() bezier31Path.usesEvenOddFillRule = true dark.setFill() bezier31Path.fill() //// Bezier 32 Drawing let bezier32Path = UIBezierPath() bezier32Path.move(to: CGPoint(x: 670.59, y: 949.92)) bezier32Path.addCurve(to: CGPoint(x: 667.69, y: 949.3), controlPoint1: CGPoint(x: 669.62, y: 949.92), controlPoint2: CGPoint(x: 668.64, y: 949.73)) bezier32Path.addCurve(to: CGPoint(x: 663.92, y: 939.74), controlPoint1: CGPoint(x: 664.01, y: 947.71), controlPoint2: CGPoint(x: 662.31, y: 943.41)) bezier32Path.addLine(to: CGPoint(x: 804.08, y: 619.56)) bezier32Path.addCurve(to: CGPoint(x: 813.67, y: 615.81), controlPoint1: CGPoint(x: 805.7, y: 615.87), controlPoint2: CGPoint(x: 809.97, y: 614.22)) bezier32Path.addCurve(to: CGPoint(x: 817.4, y: 625.42), controlPoint1: CGPoint(x: 817.35, y: 617.43), controlPoint2: CGPoint(x: 819.02, y: 621.72)) bezier32Path.addLine(to: CGPoint(x: 677.27, y: 945.55)) bezier32Path.addCurve(to: CGPoint(x: 670.59, y: 949.92), controlPoint1: CGPoint(x: 676.07, y: 948.28), controlPoint2: CGPoint(x: 673.4, y: 949.92)) bezier32Path.close() bezier32Path.usesEvenOddFillRule = true dark.setFill() bezier32Path.fill() //// Bezier 33 Drawing let bezier33Path = UIBezierPath() bezier33Path.move(to: CGPoint(x: 660.7, y: 754.83)) bezier33Path.addCurve(to: CGPoint(x: 657.78, y: 754.23), controlPoint1: CGPoint(x: 659.72, y: 754.83), controlPoint2: CGPoint(x: 658.73, y: 754.63)) bezier33Path.addLine(to: CGPoint(x: 631.15, y: 742.58)) bezier33Path.addCurve(to: CGPoint(x: 627.39, y: 732.99), controlPoint1: CGPoint(x: 627.47, y: 740.95), controlPoint2: CGPoint(x: 625.79, y: 736.66)) bezier33Path.addCurve(to: CGPoint(x: 636.97, y: 729.24), controlPoint1: CGPoint(x: 629, y: 729.3), controlPoint2: CGPoint(x: 633.31, y: 727.62)) bezier33Path.addLine(to: CGPoint(x: 663.61, y: 740.9)) bezier33Path.addCurve(to: CGPoint(x: 667.36, y: 750.48), controlPoint1: CGPoint(x: 667.3, y: 742.49), controlPoint2: CGPoint(x: 668.98, y: 746.78)) bezier33Path.addCurve(to: CGPoint(x: 660.7, y: 754.83), controlPoint1: CGPoint(x: 666.17, y: 753.21), controlPoint2: CGPoint(x: 663.49, y: 754.83)) bezier33Path.close() bezier33Path.usesEvenOddFillRule = true dark.setFill() bezier33Path.fill() //// Bezier 35 Drawing let bezier35Path = UIBezierPath() bezier35Path.move(to: CGPoint(x: 631.59, y: 821.51)) bezier35Path.addCurve(to: CGPoint(x: 628.69, y: 820.91), controlPoint1: CGPoint(x: 630.62, y: 821.51), controlPoint2: CGPoint(x: 629.64, y: 821.31)) bezier35Path.addLine(to: CGPoint(x: 601.91, y: 809.26)) bezier35Path.addCurve(to: CGPoint(x: 598.15, y: 799.67), controlPoint1: CGPoint(x: 598.23, y: 807.66), controlPoint2: CGPoint(x: 596.54, y: 803.37)) bezier35Path.addCurve(to: CGPoint(x: 607.71, y: 795.89), controlPoint1: CGPoint(x: 599.74, y: 796), controlPoint2: CGPoint(x: 604, y: 794.33)) bezier35Path.addLine(to: CGPoint(x: 634.49, y: 807.55)) bezier35Path.addCurve(to: CGPoint(x: 638.27, y: 817.13), controlPoint1: CGPoint(x: 638.18, y: 809.14), controlPoint2: CGPoint(x: 639.88, y: 813.43)) bezier35Path.addCurve(to: CGPoint(x: 631.59, y: 821.51), controlPoint1: CGPoint(x: 637.07, y: 819.86), controlPoint2: CGPoint(x: 634.4, y: 821.51)) bezier35Path.close() bezier35Path.usesEvenOddFillRule = true dark.setFill() bezier35Path.fill() //// Bezier 36 Drawing let bezier36Path = UIBezierPath() bezier36Path.move(to: CGPoint(x: 640.78, y: 931.44)) bezier36Path.addCurve(to: CGPoint(x: 614.48, y: 926.04), controlPoint1: CGPoint(x: 631.88, y: 931.44), controlPoint2: CGPoint(x: 622.92, y: 929.65)) bezier36Path.addCurve(to: CGPoint(x: 580.69, y: 839.68), controlPoint1: CGPoint(x: 581.29, y: 911.39), controlPoint2: CGPoint(x: 566.17, y: 872.69)) bezier36Path.addLine(to: CGPoint(x: 674.13, y: 626.24)) bezier36Path.addCurve(to: CGPoint(x: 710.27, y: 591.5), controlPoint1: CGPoint(x: 681.1, y: 610.23), controlPoint2: CGPoint(x: 693.94, y: 597.87)) bezier36Path.addCurve(to: CGPoint(x: 760.27, y: 592.52), controlPoint1: CGPoint(x: 726.53, y: 585.13), controlPoint2: CGPoint(x: 744.28, y: 585.5)) bezier36Path.addCurve(to: CGPoint(x: 796.42, y: 632.64), controlPoint1: CGPoint(x: 777.49, y: 600.06), controlPoint2: CGPoint(x: 790.67, y: 614.67)) bezier36Path.addCurve(to: CGPoint(x: 791.72, y: 641.8), controlPoint1: CGPoint(x: 797.66, y: 636.48), controlPoint2: CGPoint(x: 795.54, y: 640.57)) bezier36Path.addCurve(to: CGPoint(x: 782.57, y: 637.08), controlPoint1: CGPoint(x: 787.89, y: 642.99), controlPoint2: CGPoint(x: 783.79, y: 640.92)) bezier36Path.addCurve(to: CGPoint(x: 754.42, y: 605.86), controlPoint1: CGPoint(x: 778.09, y: 623.11), controlPoint2: CGPoint(x: 767.83, y: 611.71)) bezier36Path.addCurve(to: CGPoint(x: 715.55, y: 605.06), controlPoint1: CGPoint(x: 742.02, y: 600.4), controlPoint2: CGPoint(x: 728.2, y: 600.11)) bezier36Path.addCurve(to: CGPoint(x: 687.46, y: 632.1), controlPoint1: CGPoint(x: 702.86, y: 610.01), controlPoint2: CGPoint(x: 692.88, y: 619.62)) bezier36Path.addLine(to: CGPoint(x: 594.03, y: 845.53)) bezier36Path.addCurve(to: CGPoint(x: 620.26, y: 912.7), controlPoint1: CGPoint(x: 582.71, y: 871.21), controlPoint2: CGPoint(x: 594.49, y: 901.32)) bezier36Path.addCurve(to: CGPoint(x: 662.12, y: 912.19), controlPoint1: CGPoint(x: 633.83, y: 918.47), controlPoint2: CGPoint(x: 649.11, y: 918.3)) bezier36Path.addCurve(to: CGPoint(x: 671.79, y: 915.66), controlPoint1: CGPoint(x: 665.71, y: 910.45), controlPoint2: CGPoint(x: 670.08, y: 912.05)) bezier36Path.addCurve(to: CGPoint(x: 668.3, y: 925.35), controlPoint1: CGPoint(x: 673.5, y: 919.29), controlPoint2: CGPoint(x: 671.94, y: 923.65)) bezier36Path.addCurve(to: CGPoint(x: 640.78, y: 931.44), controlPoint1: CGPoint(x: 659.66, y: 929.42), controlPoint2: CGPoint(x: 650.26, y: 931.44)) bezier36Path.close() bezier36Path.usesEvenOddFillRule = true dark.setFill() bezier36Path.fill() //// Bezier 37 Drawing let bezier37Path = UIBezierPath() bezier37Path.move(to: CGPoint(x: 802.75, y: 292.3)) bezier37Path.addCurve(to: CGPoint(x: 795.81, y: 287.24), controlPoint1: CGPoint(x: 799.66, y: 292.3), controlPoint2: CGPoint(x: 796.81, y: 290.33)) bezier37Path.addCurve(to: CGPoint(x: 800.52, y: 278.08), controlPoint1: CGPoint(x: 794.59, y: 283.42), controlPoint2: CGPoint(x: 796.69, y: 279.31)) bezier37Path.addLine(to: CGPoint(x: 828.6, y: 269.06)) bezier37Path.addCurve(to: CGPoint(x: 837.75, y: 273.76), controlPoint1: CGPoint(x: 832.44, y: 267.83), controlPoint2: CGPoint(x: 836.53, y: 269.92)) bezier37Path.addCurve(to: CGPoint(x: 833.05, y: 282.92), controlPoint1: CGPoint(x: 838.99, y: 277.59), controlPoint2: CGPoint(x: 836.88, y: 281.69)) bezier37Path.addLine(to: CGPoint(x: 804.96, y: 291.95)) bezier37Path.addCurve(to: CGPoint(x: 802.75, y: 292.3), controlPoint1: CGPoint(x: 804.23, y: 292.18), controlPoint2: CGPoint(x: 803.49, y: 292.3)) bezier37Path.close() bezier37Path.usesEvenOddFillRule = true dark.setFill() bezier37Path.fill() //// Bezier 38 Drawing let bezier38Path = UIBezierPath() bezier38Path.move(to: CGPoint(x: 802.75, y: 292.3)) bezier38Path.addCurve(to: CGPoint(x: 796.27, y: 288.34), controlPoint1: CGPoint(x: 800.1, y: 292.3), controlPoint2: CGPoint(x: 797.56, y: 290.85)) bezier38Path.addCurve(to: CGPoint(x: 495.09, y: 107.84), controlPoint1: CGPoint(x: 753.97, y: 205.99), controlPoint2: CGPoint(x: 667.38, y: 107.84)) bezier38Path.addCurve(to: CGPoint(x: 487.81, y: 100.56), controlPoint1: CGPoint(x: 491.07, y: 107.84), controlPoint2: CGPoint(x: 487.81, y: 104.58)) bezier38Path.addCurve(to: CGPoint(x: 495.09, y: 93.27), controlPoint1: CGPoint(x: 487.81, y: 96.53), controlPoint2: CGPoint(x: 491.07, y: 93.27)) bezier38Path.addCurve(to: CGPoint(x: 809.21, y: 281.69), controlPoint1: CGPoint(x: 674.72, y: 93.27), controlPoint2: CGPoint(x: 765.06, y: 195.73)) bezier38Path.addCurve(to: CGPoint(x: 806.07, y: 291.49), controlPoint1: CGPoint(x: 811.05, y: 285.26), controlPoint2: CGPoint(x: 809.64, y: 289.65)) bezier38Path.addCurve(to: CGPoint(x: 802.75, y: 292.3), controlPoint1: CGPoint(x: 805.01, y: 292.04), controlPoint2: CGPoint(x: 803.87, y: 292.3)) bezier38Path.close() bezier38Path.usesEvenOddFillRule = true dark.setFill() bezier38Path.fill() //// Group 7 context.saveGState() context.beginTransparencyLayer(auxiliaryInfo: nil) //// Clip Clip 5 let clip5Path = UIBezierPath() clip5Path.move(to: CGPoint(x: 187.04, y: 292.25)) clip5Path.addCurve(to: CGPoint(x: 183.71, y: 291.44), controlPoint1: CGPoint(x: 185.91, y: 292.25), controlPoint2: CGPoint(x: 184.77, y: 291.99)) clip5Path.addCurve(to: CGPoint(x: 180.57, y: 281.61), controlPoint1: CGPoint(x: 180.13, y: 289.59), controlPoint2: CGPoint(x: 178.73, y: 285.19)) clip5Path.addCurve(to: CGPoint(x: 494.98, y: 92.78), controlPoint1: CGPoint(x: 224.91, y: 195.46), controlPoint2: CGPoint(x: 315.44, y: 92.78)) clip5Path.addCurve(to: CGPoint(x: 502.26, y: 100.07), controlPoint1: CGPoint(x: 499, y: 92.78), controlPoint2: CGPoint(x: 502.26, y: 96.04)) clip5Path.addCurve(to: CGPoint(x: 494.98, y: 107.37), controlPoint1: CGPoint(x: 502.26, y: 104.11), controlPoint2: CGPoint(x: 499, y: 107.37)) clip5Path.addCurve(to: CGPoint(x: 193.52, y: 288.3), controlPoint1: CGPoint(x: 322.78, y: 107.37), controlPoint2: CGPoint(x: 236, y: 205.76)) clip5Path.addCurve(to: CGPoint(x: 187.04, y: 292.25), controlPoint1: CGPoint(x: 192.22, y: 290.81), controlPoint2: CGPoint(x: 189.67, y: 292.25)) clip5Path.close() clip5Path.usesEvenOddFillRule = true clip5Path.addClip() //// Rectangle 5 Drawing let rectangle5Path = UIBezierPath(rect: CGRect(x: 174.75, y: 87.75, width: 332.5, height: 209.5)) dark.setFill() rectangle5Path.fill() context.endTransparencyLayer() context.restoreGState() //// Bezier 40 Drawing let bezier40Path = UIBezierPath() bezier40Path.move(to: CGPoint(x: 187.42, y: 292.3)) bezier40Path.addCurve(to: CGPoint(x: 184.29, y: 291.58), controlPoint1: CGPoint(x: 186.37, y: 292.3), controlPoint2: CGPoint(x: 185.3, y: 292.07)) bezier40Path.addLine(to: CGPoint(x: 163.91, y: 281.83)) bezier40Path.addCurve(to: CGPoint(x: 160.49, y: 272.12), controlPoint1: CGPoint(x: 160.29, y: 280.1), controlPoint2: CGPoint(x: 158.75, y: 275.75)) bezier40Path.addCurve(to: CGPoint(x: 170.19, y: 268.69), controlPoint1: CGPoint(x: 162.22, y: 268.49), controlPoint2: CGPoint(x: 166.56, y: 266.97)) bezier40Path.addLine(to: CGPoint(x: 190.57, y: 278.45)) bezier40Path.addCurve(to: CGPoint(x: 193.99, y: 288.16), controlPoint1: CGPoint(x: 194.19, y: 280.18), controlPoint2: CGPoint(x: 195.73, y: 284.53)) bezier40Path.addCurve(to: CGPoint(x: 187.42, y: 292.3), controlPoint1: CGPoint(x: 192.74, y: 290.78), controlPoint2: CGPoint(x: 190.13, y: 292.3)) bezier40Path.close() bezier40Path.usesEvenOddFillRule = true dark.setFill() bezier40Path.fill() context.restoreGState() } @objc dynamic public class func drawWindmill(frame targetFrame: CGRect = CGRect(x: 0, y: 0, width: 1000, height: 1000), resizing: ResizingBehavior = .aspectFit, white: UIColor = UIColor(red: 1.000, green: 1.000, blue: 1.000, alpha: 1.000), light: UIColor = UIColor(red: 0.769, green: 0.847, blue: 0.984, alpha: 1.000), medium: UIColor = UIColor(red: 0.478, green: 0.663, blue: 0.973, alpha: 1.000), dark: UIColor = UIColor(red: 0.000, green: 0.478, blue: 1.000, alpha: 1.000)) { //// General Declarations let context = UIGraphicsGetCurrentContext()! //// Resize to Target Frame context.saveGState() let resizedFrame: CGRect = resizing.apply(rect: CGRect(x: 0, y: 0, width: 1000, height: 1000), target: targetFrame) context.translateBy(x: resizedFrame.minX, y: resizedFrame.minY) context.scaleBy(x: resizedFrame.width / 1000, y: resizedFrame.height / 1000) //// Group 2 //// Bezier Drawing let bezierPath = UIBezierPath() bezierPath.move(to: CGPoint(x: 523.68, y: 379.71)) bezierPath.addLine(to: CGPoint(x: 494, y: 379.71)) bezierPath.addLine(to: CGPoint(x: 464.79, y: 959.75)) bezierPath.addLine(to: CGPoint(x: 552.89, y: 959.75)) bezierPath.addLine(to: CGPoint(x: 523.68, y: 379.71)) bezierPath.close() bezierPath.usesEvenOddFillRule = true medium.setFill() bezierPath.fill() //// Bezier 2 Drawing let bezier2Path = UIBezierPath() bezier2Path.move(to: CGPoint(x: 203.97, y: 959.76)) bezier2Path.addLine(to: CGPoint(x: 812.56, y: 959.76)) bezier2Path.addLine(to: CGPoint(x: 812.56, y: 945.27)) bezier2Path.addLine(to: CGPoint(x: 203.97, y: 945.27)) bezier2Path.addLine(to: CGPoint(x: 203.97, y: 959.76)) bezier2Path.close() bezier2Path.usesEvenOddFillRule = true light.setFill() bezier2Path.fill() //// Bezier 3 Drawing let bezier3Path = UIBezierPath() bezier3Path.move(to: CGPoint(x: 305.66, y: 270.4)) bezier3Path.addCurve(to: CGPoint(x: 88.28, y: 241.93), controlPoint1: CGPoint(x: 172.05, y: 234.6), controlPoint2: CGPoint(x: 88.28, y: 241.93)) bezier3Path.addLine(to: CGPoint(x: 88.25, y: 242.03)) bezier3Path.addCurve(to: CGPoint(x: 290.75, y: 326.1), controlPoint1: CGPoint(x: 88.25, y: 242.03), controlPoint2: CGPoint(x: 157.16, y: 290.3)) bezier3Path.addCurve(to: CGPoint(x: 479.22, y: 356.6), controlPoint1: CGPoint(x: 357.56, y: 344), controlPoint2: CGPoint(x: 441.58, y: 353.94)) bezier3Path.addLine(to: CGPoint(x: 484.17, y: 337.82)) bezier3Path.addCurve(to: CGPoint(x: 305.66, y: 270.4), controlPoint1: CGPoint(x: 450.24, y: 321.28), controlPoint2: CGPoint(x: 372.48, y: 288.32)) bezier3Path.close() bezier3Path.usesEvenOddFillRule = true light.setFill() bezier3Path.fill() //// Bezier 4 Drawing let bezier4Path = UIBezierPath() bezier4Path.move(to: CGPoint(x: 681.58, y: 220.9)) bezier4Path.addCurve(to: CGPoint(x: 814.92, y: 46.85), controlPoint1: CGPoint(x: 779.39, y: 123.08), controlPoint2: CGPoint(x: 814.92, y: 46.85)) bezier4Path.addLine(to: CGPoint(x: 814.86, y: 46.78)) bezier4Path.addCurve(to: CGPoint(x: 640.81, y: 180.14), controlPoint1: CGPoint(x: 814.86, y: 46.78), controlPoint2: CGPoint(x: 738.6, y: 82.32)) bezier4Path.addCurve(to: CGPoint(x: 520.16, y: 328.13), controlPoint1: CGPoint(x: 591.9, y: 229.05), controlPoint2: CGPoint(x: 541.29, y: 296.86)) bezier4Path.addLine(to: CGPoint(x: 533.94, y: 341.81)) bezier4Path.addCurve(to: CGPoint(x: 681.58, y: 220.9), controlPoint1: CGPoint(x: 565.23, y: 320.7), controlPoint2: CGPoint(x: 632.66, y: 269.81)) bezier4Path.close() bezier4Path.usesEvenOddFillRule = true light.setFill() bezier4Path.fill() //// Bezier 5 Drawing let bezier5Path = UIBezierPath() bezier5Path.move(to: CGPoint(x: 530.29, y: 335.5)) bezier5Path.addCurve(to: CGPoint(x: 655.3, y: 180.14), controlPoint1: CGPoint(x: 551.42, y: 304.23), controlPoint2: CGPoint(x: 606.39, y: 229.05)) bezier5Path.addCurve(to: CGPoint(x: 809.27, y: 57.66), controlPoint1: CGPoint(x: 723.04, y: 112.38), controlPoint2: CGPoint(x: 780.39, y: 74.54)) bezier5Path.addCurve(to: CGPoint(x: 814.92, y: 46.85), controlPoint1: CGPoint(x: 813.05, y: 50.78), controlPoint2: CGPoint(x: 814.92, y: 46.85)) bezier5Path.addLine(to: CGPoint(x: 814.86, y: 46.78)) bezier5Path.addCurve(to: CGPoint(x: 640.81, y: 180.14), controlPoint1: CGPoint(x: 814.86, y: 46.78), controlPoint2: CGPoint(x: 738.6, y: 82.32)) bezier5Path.addCurve(to: CGPoint(x: 520.16, y: 328.13), controlPoint1: CGPoint(x: 591.9, y: 229.05), controlPoint2: CGPoint(x: 541.29, y: 296.86)) bezier5Path.addLine(to: CGPoint(x: 530.29, y: 335.5)) bezier5Path.close() bezier5Path.usesEvenOddFillRule = true white.setFill() bezier5Path.fill() //// Bezier 6 Drawing let bezier6Path = UIBezierPath() bezier6Path.move(to: CGPoint(x: 621.8, y: 774.14)) bezier6Path.addLine(to: CGPoint(x: 621.89, y: 774.12)) bezier6Path.addCurve(to: CGPoint(x: 593.45, y: 556.68), controlPoint1: CGPoint(x: 621.89, y: 774.12), controlPoint2: CGPoint(x: 629.25, y: 690.29)) bezier6Path.addCurve(to: CGPoint(x: 525.62, y: 378.17), controlPoint1: CGPoint(x: 575.55, y: 489.85), controlPoint2: CGPoint(x: 542.14, y: 412.11)) bezier6Path.addLine(to: CGPoint(x: 506.89, y: 383.27)) bezier6Path.addCurve(to: CGPoint(x: 537.76, y: 571.61), controlPoint1: CGPoint(x: 509.53, y: 420.93), controlPoint2: CGPoint(x: 519.86, y: 504.77)) bezier6Path.addCurve(to: CGPoint(x: 621.8, y: 774.14), controlPoint1: CGPoint(x: 573.57, y: 705.24), controlPoint2: CGPoint(x: 621.8, y: 774.14)) bezier6Path.close() bezier6Path.usesEvenOddFillRule = true light.setFill() bezier6Path.fill() //// Bezier 7 Drawing let bezier7Path = UIBezierPath() bezier7Path.move(to: CGPoint(x: 521.38, y: 383.27)) bezier7Path.addLine(to: CGPoint(x: 527.29, y: 381.66)) bezier7Path.addCurve(to: CGPoint(x: 525.62, y: 378.17), controlPoint1: CGPoint(x: 526.74, y: 380.49), controlPoint2: CGPoint(x: 526.15, y: 379.25)) bezier7Path.addLine(to: CGPoint(x: 506.89, y: 383.27)) bezier7Path.addCurve(to: CGPoint(x: 537.76, y: 571.61), controlPoint1: CGPoint(x: 509.53, y: 420.93), controlPoint2: CGPoint(x: 519.86, y: 504.77)) bezier7Path.addCurve(to: CGPoint(x: 621.8, y: 774.14), controlPoint1: CGPoint(x: 573.57, y: 705.24), controlPoint2: CGPoint(x: 621.8, y: 774.14)) bezier7Path.addLine(to: CGPoint(x: 621.89, y: 774.12)) bezier7Path.addCurve(to: CGPoint(x: 622.5, y: 751.35), controlPoint1: CGPoint(x: 621.89, y: 774.12), controlPoint2: CGPoint(x: 622.57, y: 766.16)) bezier7Path.addCurve(to: CGPoint(x: 552.25, y: 571.61), controlPoint1: CGPoint(x: 605.57, y: 721.09), controlPoint2: CGPoint(x: 576.17, y: 660.89)) bezier7Path.addCurve(to: CGPoint(x: 521.38, y: 383.27), controlPoint1: CGPoint(x: 534.35, y: 504.77), controlPoint2: CGPoint(x: 524.02, y: 420.93)) bezier7Path.close() bezier7Path.usesEvenOddFillRule = true white.setFill() bezier7Path.fill() //// Oval Drawing let ovalPath = UIBezierPath(ovalIn: CGRect(x: 479.15, y: 325.3, width: 58, height: 58)) medium.setFill() ovalPath.fill() //// Bezier 8 Drawing let bezier8Path = UIBezierPath() bezier8Path.move(to: CGPoint(x: 493.66, y: 354.29)) bezier8Path.addCurve(to: CGPoint(x: 515.39, y: 326.33), controlPoint1: CGPoint(x: 493.66, y: 340.8), controlPoint2: CGPoint(x: 502.91, y: 329.56)) bezier8Path.addCurve(to: CGPoint(x: 508.15, y: 325.3), controlPoint1: CGPoint(x: 513.06, y: 325.73), controlPoint2: CGPoint(x: 510.67, y: 325.3)) bezier8Path.addCurve(to: CGPoint(x: 479.17, y: 354.29), controlPoint1: CGPoint(x: 492.14, y: 325.3), controlPoint2: CGPoint(x: 479.17, y: 338.28)) bezier8Path.addCurve(to: CGPoint(x: 508.15, y: 383.27), controlPoint1: CGPoint(x: 479.17, y: 370.3), controlPoint2: CGPoint(x: 492.14, y: 383.27)) bezier8Path.addCurve(to: CGPoint(x: 515.39, y: 382.25), controlPoint1: CGPoint(x: 510.67, y: 383.27), controlPoint2: CGPoint(x: 513.06, y: 382.85)) bezier8Path.addCurve(to: CGPoint(x: 493.66, y: 354.29), controlPoint1: CGPoint(x: 502.91, y: 379.01), controlPoint2: CGPoint(x: 493.66, y: 367.77)) bezier8Path.close() bezier8Path.usesEvenOddFillRule = true light.setFill() bezier8Path.fill() //// Bezier 9 Drawing let bezier9Path = UIBezierPath() bezier9Path.move(to: CGPoint(x: 464.79, y: 967)) bezier9Path.addCurve(to: CGPoint(x: 464.42, y: 966.99), controlPoint1: CGPoint(x: 464.68, y: 967), controlPoint2: CGPoint(x: 464.55, y: 967)) bezier9Path.addCurve(to: CGPoint(x: 457.56, y: 959.39), controlPoint1: CGPoint(x: 460.43, y: 966.79), controlPoint2: CGPoint(x: 457.35, y: 963.38)) bezier9Path.addLine(to: CGPoint(x: 482.32, y: 466.63)) bezier9Path.addCurve(to: CGPoint(x: 489.92, y: 459.76), controlPoint1: CGPoint(x: 482.51, y: 462.64), controlPoint2: CGPoint(x: 485.38, y: 459.39)) bezier9Path.addCurve(to: CGPoint(x: 496.78, y: 467.36), controlPoint1: CGPoint(x: 493.91, y: 459.96), controlPoint2: CGPoint(x: 496.99, y: 463.36)) bezier9Path.addLine(to: CGPoint(x: 472.02, y: 960.11)) bezier9Path.addCurve(to: CGPoint(x: 464.79, y: 967), controlPoint1: CGPoint(x: 471.84, y: 963.98), controlPoint2: CGPoint(x: 468.62, y: 967)) bezier9Path.close() bezier9Path.usesEvenOddFillRule = true dark.setFill() bezier9Path.fill() //// Bezier 10 Drawing let bezier10Path = UIBezierPath() bezier10Path.move(to: CGPoint(x: 551.73, y: 967)) bezier10Path.addCurve(to: CGPoint(x: 544.5, y: 960.11), controlPoint1: CGPoint(x: 547.9, y: 967), controlPoint2: CGPoint(x: 544.68, y: 963.98)) bezier10Path.addLine(to: CGPoint(x: 528.48, y: 641.28)) bezier10Path.addCurve(to: CGPoint(x: 535.34, y: 633.68), controlPoint1: CGPoint(x: 528.27, y: 637.29), controlPoint2: CGPoint(x: 531.35, y: 633.9)) bezier10Path.addCurve(to: CGPoint(x: 542.94, y: 640.56), controlPoint1: CGPoint(x: 539.64, y: 633.36), controlPoint2: CGPoint(x: 542.76, y: 636.57)) bezier10Path.addLine(to: CGPoint(x: 558.96, y: 959.39)) bezier10Path.addCurve(to: CGPoint(x: 552.1, y: 966.99), controlPoint1: CGPoint(x: 559.17, y: 963.38), controlPoint2: CGPoint(x: 556.09, y: 966.79)) bezier10Path.addCurve(to: CGPoint(x: 551.73, y: 967), controlPoint1: CGPoint(x: 551.97, y: 967), controlPoint2: CGPoint(x: 551.84, y: 967)) bezier10Path.close() bezier10Path.usesEvenOddFillRule = true dark.setFill() bezier10Path.fill() //// Bezier 11 Drawing let bezier11Path = UIBezierPath() bezier11Path.move(to: CGPoint(x: 538.12, y: 311.04)) bezier11Path.addCurve(to: CGPoint(x: 534.07, y: 309.8), controlPoint1: CGPoint(x: 536.72, y: 311.04), controlPoint2: CGPoint(x: 535.3, y: 310.64)) bezier11Path.addCurve(to: CGPoint(x: 532.12, y: 299.74), controlPoint1: CGPoint(x: 530.74, y: 307.56), controlPoint2: CGPoint(x: 529.87, y: 303.06)) bezier11Path.addCurve(to: CGPoint(x: 636.35, y: 174.96), controlPoint1: CGPoint(x: 551.53, y: 270.95), controlPoint2: CGPoint(x: 585.39, y: 225.92)) bezier11Path.addCurve(to: CGPoint(x: 812.46, y: 40.14), controlPoint1: CGPoint(x: 733.95, y: 77.35), controlPoint2: CGPoint(x: 809.29, y: 41.61)) bezier11Path.addCurve(to: CGPoint(x: 822.08, y: 43.64), controlPoint1: CGPoint(x: 816.07, y: 38.48), controlPoint2: CGPoint(x: 820.38, y: 40.01)) bezier11Path.addCurve(to: CGPoint(x: 818.58, y: 53.27), controlPoint1: CGPoint(x: 823.76, y: 47.26), controlPoint2: CGPoint(x: 822.21, y: 51.58)) bezier11Path.addCurve(to: CGPoint(x: 646.6, y: 185.21), controlPoint1: CGPoint(x: 817.82, y: 53.63), controlPoint2: CGPoint(x: 742.2, y: 89.59)) bezier11Path.addCurve(to: CGPoint(x: 544.12, y: 307.85), controlPoint1: CGPoint(x: 596.46, y: 235.36), controlPoint2: CGPoint(x: 563.2, y: 279.58)) bezier11Path.addCurve(to: CGPoint(x: 538.12, y: 311.04), controlPoint1: CGPoint(x: 542.73, y: 309.93), controlPoint2: CGPoint(x: 540.44, y: 311.04)) bezier11Path.close() bezier11Path.usesEvenOddFillRule = true dark.setFill() bezier11Path.fill() //// Bezier 12 Drawing let bezier12Path = UIBezierPath() bezier12Path.move(to: CGPoint(x: 557.73, y: 332.03)) bezier12Path.addCurve(to: CGPoint(x: 551.72, y: 328.83), controlPoint1: CGPoint(x: 555.41, y: 332.03), controlPoint2: CGPoint(x: 553.12, y: 330.91)) bezier12Path.addCurve(to: CGPoint(x: 553.68, y: 318.78), controlPoint1: CGPoint(x: 549.48, y: 325.51), controlPoint2: CGPoint(x: 550.36, y: 321.01)) bezier12Path.addCurve(to: CGPoint(x: 677.11, y: 215.72), controlPoint1: CGPoint(x: 582.16, y: 299.59), controlPoint2: CGPoint(x: 626.69, y: 266.14)) bezier12Path.addCurve(to: CGPoint(x: 809.02, y: 43.71), controlPoint1: CGPoint(x: 772.71, y: 120.1), controlPoint2: CGPoint(x: 808.66, y: 44.46)) bezier12Path.addCurve(to: CGPoint(x: 818.65, y: 40.21), controlPoint1: CGPoint(x: 810.72, y: 40.08), controlPoint2: CGPoint(x: 815.06, y: 38.53)) bezier12Path.addCurve(to: CGPoint(x: 822.15, y: 49.84), controlPoint1: CGPoint(x: 822.28, y: 41.91), controlPoint2: CGPoint(x: 823.83, y: 46.21)) bezier12Path.addCurve(to: CGPoint(x: 687.35, y: 225.97), controlPoint1: CGPoint(x: 820.68, y: 53), controlPoint2: CGPoint(x: 784.95, y: 128.36)) bezier12Path.addCurve(to: CGPoint(x: 561.78, y: 330.79), controlPoint1: CGPoint(x: 636.12, y: 277.21), controlPoint2: CGPoint(x: 590.79, y: 311.26)) bezier12Path.addCurve(to: CGPoint(x: 557.73, y: 332.03), controlPoint1: CGPoint(x: 560.53, y: 331.64), controlPoint2: CGPoint(x: 559.13, y: 332.03)) bezier12Path.close() bezier12Path.usesEvenOddFillRule = true dark.setFill() bezier12Path.fill() //// Bezier 13 Drawing let bezier13Path = UIBezierPath() bezier13Path.move(to: CGPoint(x: 620.57, y: 781.41)) bezier13Path.addCurve(to: CGPoint(x: 614.64, y: 778.31), controlPoint1: CGPoint(x: 618.29, y: 781.41), controlPoint2: CGPoint(x: 616.04, y: 780.34)) bezier13Path.addCurve(to: CGPoint(x: 529.53, y: 573.5), controlPoint1: CGPoint(x: 612.64, y: 775.47), controlPoint2: CGPoint(x: 565.26, y: 706.84)) bezier13Path.addCurve(to: CGPoint(x: 501.61, y: 412.87), controlPoint1: CGPoint(x: 510.84, y: 503.7), controlPoint2: CGPoint(x: 504.03, y: 447.62)) bezier13Path.addCurve(to: CGPoint(x: 508.34, y: 405.13), controlPoint1: CGPoint(x: 501.34, y: 408.88), controlPoint2: CGPoint(x: 504.34, y: 405.42)) bezier13Path.addCurve(to: CGPoint(x: 516.07, y: 411.86), controlPoint1: CGPoint(x: 512.24, y: 404.96), controlPoint2: CGPoint(x: 515.79, y: 407.86)) bezier13Path.addCurve(to: CGPoint(x: 543.54, y: 569.75), controlPoint1: CGPoint(x: 518.43, y: 445.98), controlPoint2: CGPoint(x: 525.13, y: 501.07)) bezier13Path.addCurve(to: CGPoint(x: 626.52, y: 770), controlPoint1: CGPoint(x: 578.53, y: 700.37), controlPoint2: CGPoint(x: 626.04, y: 769.32)) bezier13Path.addCurve(to: CGPoint(x: 624.72, y: 780.09), controlPoint1: CGPoint(x: 628.8, y: 773.29), controlPoint2: CGPoint(x: 628, y: 777.8)) bezier13Path.addCurve(to: CGPoint(x: 620.57, y: 781.41), controlPoint1: CGPoint(x: 623.46, y: 780.99), controlPoint2: CGPoint(x: 622.02, y: 781.41)) bezier13Path.close() bezier13Path.usesEvenOddFillRule = true dark.setFill() bezier13Path.fill() //// Bezier 14 Drawing let bezier14Path = UIBezierPath() bezier14Path.move(to: CGPoint(x: 620.69, y: 781.38)) bezier14Path.addCurve(to: CGPoint(x: 620.05, y: 781.35), controlPoint1: CGPoint(x: 620.47, y: 781.38), controlPoint2: CGPoint(x: 620.26, y: 781.37)) bezier14Path.addCurve(to: CGPoint(x: 613.45, y: 773.5), controlPoint1: CGPoint(x: 616.06, y: 781), controlPoint2: CGPoint(x: 613.12, y: 777.49)) bezier14Path.addCurve(to: CGPoint(x: 585.2, y: 558.59), controlPoint1: CGPoint(x: 613.52, y: 772.68), controlPoint2: CGPoint(x: 620.21, y: 689.2)) bezier14Path.addCurve(to: CGPoint(x: 530.05, y: 408.13), controlPoint1: CGPoint(x: 566.8, y: 489.86), controlPoint2: CGPoint(x: 545.05, y: 438.84)) bezier14Path.addCurve(to: CGPoint(x: 533.37, y: 398.44), controlPoint1: CGPoint(x: 528.29, y: 404.54), controlPoint2: CGPoint(x: 529.78, y: 400.19)) bezier14Path.addCurve(to: CGPoint(x: 543.07, y: 401.76), controlPoint1: CGPoint(x: 536.97, y: 396.69), controlPoint2: CGPoint(x: 541.3, y: 398.16)) bezier14Path.addCurve(to: CGPoint(x: 599.21, y: 554.83), controlPoint1: CGPoint(x: 558.35, y: 433.05), controlPoint2: CGPoint(x: 580.5, y: 484.99)) bezier14Path.addCurve(to: CGPoint(x: 627.89, y: 774.76), controlPoint1: CGPoint(x: 634.94, y: 688.17), controlPoint2: CGPoint(x: 628.2, y: 771.29)) bezier14Path.addCurve(to: CGPoint(x: 620.69, y: 781.38), controlPoint1: CGPoint(x: 627.56, y: 778.54), controlPoint2: CGPoint(x: 624.39, y: 781.38)) bezier14Path.close() bezier14Path.usesEvenOddFillRule = true dark.setFill() bezier14Path.fill() //// Bezier 15 Drawing let bezier15Path = UIBezierPath() bezier15Path.move(to: CGPoint(x: 449.55, y: 360.65)) bezier15Path.addCurve(to: CGPoint(x: 449.02, y: 360.63), controlPoint1: CGPoint(x: 449.36, y: 360.65), controlPoint2: CGPoint(x: 449.19, y: 360.64)) bezier15Path.addCurve(to: CGPoint(x: 288.85, y: 332.73), controlPoint1: CGPoint(x: 399.2, y: 357.11), controlPoint2: CGPoint(x: 343.83, y: 347.47)) bezier15Path.addCurve(to: CGPoint(x: 84.08, y: 247.6), controlPoint1: CGPoint(x: 155.57, y: 297.02), controlPoint2: CGPoint(x: 86.94, y: 249.6)) bezier15Path.addCurve(to: CGPoint(x: 82.31, y: 237.51), controlPoint1: CGPoint(x: 80.81, y: 245.3), controlPoint2: CGPoint(x: 80.02, y: 240.79)) bezier15Path.addCurve(to: CGPoint(x: 92.4, y: 235.73), controlPoint1: CGPoint(x: 84.57, y: 234.24), controlPoint2: CGPoint(x: 89.07, y: 233.43)) bezier15Path.addCurve(to: CGPoint(x: 292.6, y: 318.74), controlPoint1: CGPoint(x: 93.08, y: 236.2), controlPoint2: CGPoint(x: 162.02, y: 283.75)) bezier15Path.addCurve(to: CGPoint(x: 450.04, y: 346.18), controlPoint1: CGPoint(x: 360.94, y: 337.05), controlPoint2: CGPoint(x: 415.94, y: 343.77)) bezier15Path.addCurve(to: CGPoint(x: 456.76, y: 353.91), controlPoint1: CGPoint(x: 454.03, y: 346.45), controlPoint2: CGPoint(x: 457.05, y: 349.92)) bezier15Path.addCurve(to: CGPoint(x: 449.55, y: 360.65), controlPoint1: CGPoint(x: 456.5, y: 357.73), controlPoint2: CGPoint(x: 453.31, y: 360.65)) bezier15Path.close() bezier15Path.usesEvenOddFillRule = true dark.setFill() bezier15Path.fill() //// Bezier 16 Drawing let bezier16Path = UIBezierPath() bezier16Path.move(to: CGPoint(x: 457.02, y: 331.74)) bezier16Path.addCurve(to: CGPoint(x: 453.85, y: 331.01), controlPoint1: CGPoint(x: 455.94, y: 331.74), controlPoint2: CGPoint(x: 454.87, y: 331.51)) bezier16Path.addCurve(to: CGPoint(x: 303.77, y: 276.04), controlPoint1: CGPoint(x: 423.17, y: 316.06), controlPoint2: CGPoint(x: 372.24, y: 294.4)) bezier16Path.addCurve(to: CGPoint(x: 88.91, y: 247.78), controlPoint1: CGPoint(x: 172.9, y: 240.97), controlPoint2: CGPoint(x: 89.71, y: 247.7)) bezier16Path.addCurve(to: CGPoint(x: 81.05, y: 241.19), controlPoint1: CGPoint(x: 84.7, y: 248.17), controlPoint2: CGPoint(x: 81.39, y: 245.18)) bezier16Path.addCurve(to: CGPoint(x: 87.63, y: 233.35), controlPoint1: CGPoint(x: 80.7, y: 237.21), controlPoint2: CGPoint(x: 83.66, y: 233.69)) bezier16Path.addCurve(to: CGPoint(x: 307.54, y: 262.04), controlPoint1: CGPoint(x: 91.09, y: 233.03), controlPoint2: CGPoint(x: 174.21, y: 226.3)) bezier16Path.addCurve(to: CGPoint(x: 460.19, y: 317.97), controlPoint1: CGPoint(x: 377.1, y: 280.7), controlPoint2: CGPoint(x: 428.95, y: 302.76)) bezier16Path.addCurve(to: CGPoint(x: 463.53, y: 327.66), controlPoint1: CGPoint(x: 463.78, y: 319.73), controlPoint2: CGPoint(x: 465.29, y: 324.07)) bezier16Path.addCurve(to: CGPoint(x: 457.02, y: 331.74), controlPoint1: CGPoint(x: 462.28, y: 330.24), controlPoint2: CGPoint(x: 459.69, y: 331.74)) bezier16Path.close() bezier16Path.usesEvenOddFillRule = true dark.setFill() bezier16Path.fill() //// Bezier 17 Drawing let bezier17Path = UIBezierPath() bezier17Path.move(to: CGPoint(x: 508.16, y: 332.41)) bezier17Path.addCurve(to: CGPoint(x: 492.69, y: 338.83), controlPoint1: CGPoint(x: 502.32, y: 332.41), controlPoint2: CGPoint(x: 496.83, y: 334.69)) bezier17Path.addCurve(to: CGPoint(x: 486.28, y: 354.29), controlPoint1: CGPoint(x: 488.56, y: 342.96), controlPoint2: CGPoint(x: 486.28, y: 348.45)) bezier17Path.addCurve(to: CGPoint(x: 492.68, y: 369.75), controlPoint1: CGPoint(x: 486.28, y: 360.13), controlPoint2: CGPoint(x: 488.55, y: 365.62)) bezier17Path.addCurve(to: CGPoint(x: 523.63, y: 369.76), controlPoint1: CGPoint(x: 500.95, y: 378.02), controlPoint2: CGPoint(x: 515.36, y: 378.02)) bezier17Path.addCurve(to: CGPoint(x: 523.61, y: 338.83), controlPoint1: CGPoint(x: 532.14, y: 361.24), controlPoint2: CGPoint(x: 532.14, y: 347.35)) bezier17Path.addCurve(to: CGPoint(x: 508.16, y: 332.41), controlPoint1: CGPoint(x: 519.48, y: 334.69), controlPoint2: CGPoint(x: 513.99, y: 332.41)) bezier17Path.close() bezier17Path.move(to: CGPoint(x: 508.16, y: 390.65)) bezier17Path.addCurve(to: CGPoint(x: 482.44, y: 380), controlPoint1: CGPoint(x: 498.44, y: 390.65), controlPoint2: CGPoint(x: 489.3, y: 386.87)) bezier17Path.addCurve(to: CGPoint(x: 471.79, y: 354.29), controlPoint1: CGPoint(x: 475.57, y: 373.13), controlPoint2: CGPoint(x: 471.79, y: 364)) bezier17Path.addCurve(to: CGPoint(x: 482.45, y: 328.57), controlPoint1: CGPoint(x: 471.79, y: 344.57), controlPoint2: CGPoint(x: 475.59, y: 335.44)) bezier17Path.addCurve(to: CGPoint(x: 533.86, y: 328.58), controlPoint1: CGPoint(x: 496.16, y: 314.86), controlPoint2: CGPoint(x: 520.12, y: 314.82)) bezier17Path.addCurve(to: CGPoint(x: 533.87, y: 380.01), controlPoint1: CGPoint(x: 548.04, y: 342.75), controlPoint2: CGPoint(x: 548.04, y: 365.82)) bezier17Path.addCurve(to: CGPoint(x: 508.16, y: 390.65), controlPoint1: CGPoint(x: 527, y: 386.87), controlPoint2: CGPoint(x: 517.87, y: 390.65)) bezier17Path.close() bezier17Path.usesEvenOddFillRule = true dark.setFill() bezier17Path.fill() //// Bezier 18 Drawing let bezier18Path = UIBezierPath() bezier18Path.move(to: CGPoint(x: 349.99, y: 98.28)) bezier18Path.addCurve(to: CGPoint(x: 343.8, y: 94.81), controlPoint1: CGPoint(x: 347.55, y: 98.28), controlPoint2: CGPoint(x: 345.16, y: 97.05)) bezier18Path.addCurve(to: CGPoint(x: 346.21, y: 84.85), controlPoint1: CGPoint(x: 341.72, y: 91.4), controlPoint2: CGPoint(x: 342.8, y: 86.93)) bezier18Path.addCurve(to: CGPoint(x: 372.26, y: 70.63), controlPoint1: CGPoint(x: 354.63, y: 79.71), controlPoint2: CGPoint(x: 363.39, y: 74.93)) bezier18Path.addCurve(to: CGPoint(x: 381.94, y: 74), controlPoint1: CGPoint(x: 375.88, y: 68.91), controlPoint2: CGPoint(x: 380.18, y: 70.39)) bezier18Path.addCurve(to: CGPoint(x: 378.57, y: 83.68), controlPoint1: CGPoint(x: 383.68, y: 77.6), controlPoint2: CGPoint(x: 382.18, y: 81.93)) bezier18Path.addCurve(to: CGPoint(x: 353.77, y: 97.22), controlPoint1: CGPoint(x: 370.12, y: 87.77), controlPoint2: CGPoint(x: 361.77, y: 92.33)) bezier18Path.addCurve(to: CGPoint(x: 349.99, y: 98.28), controlPoint1: CGPoint(x: 352.58, y: 97.94), controlPoint2: CGPoint(x: 351.27, y: 98.28)) bezier18Path.close() bezier18Path.move(to: CGPoint(x: 666.85, y: 98.58)) bezier18Path.addCurve(to: CGPoint(x: 663.07, y: 97.52), controlPoint1: CGPoint(x: 665.56, y: 98.58), controlPoint2: CGPoint(x: 664.24, y: 98.24)) bezier18Path.addCurve(to: CGPoint(x: 638.26, y: 83.92), controlPoint1: CGPoint(x: 655.02, y: 92.6), controlPoint2: CGPoint(x: 646.67, y: 88.02)) bezier18Path.addCurve(to: CGPoint(x: 634.92, y: 74.23), controlPoint1: CGPoint(x: 634.65, y: 82.16), controlPoint2: CGPoint(x: 633.17, y: 77.82)) bezier18Path.addCurve(to: CGPoint(x: 644.6, y: 70.9), controlPoint1: CGPoint(x: 636.69, y: 70.62), controlPoint2: CGPoint(x: 641.07, y: 69.15)) bezier18Path.addCurve(to: CGPoint(x: 670.62, y: 85.15), controlPoint1: CGPoint(x: 653.43, y: 75.2), controlPoint2: CGPoint(x: 662.18, y: 79.99)) bezier18Path.addCurve(to: CGPoint(x: 673.03, y: 95.11), controlPoint1: CGPoint(x: 674.04, y: 87.24), controlPoint2: CGPoint(x: 675.11, y: 91.69)) bezier18Path.addCurve(to: CGPoint(x: 666.85, y: 98.58), controlPoint1: CGPoint(x: 671.66, y: 97.35), controlPoint2: CGPoint(x: 669.28, y: 98.58)) bezier18Path.close() bezier18Path.move(to: CGPoint(x: 203.92, y: 350.91)) bezier18Path.addCurve(to: CGPoint(x: 203.75, y: 350.91), controlPoint1: CGPoint(x: 203.86, y: 350.91), controlPoint2: CGPoint(x: 203.81, y: 350.91)) bezier18Path.addCurve(to: CGPoint(x: 196.68, y: 343.48), controlPoint1: CGPoint(x: 199.75, y: 350.81), controlPoint2: CGPoint(x: 196.58, y: 347.49)) bezier18Path.addCurve(to: CGPoint(x: 287.89, y: 130.78), controlPoint1: CGPoint(x: 198.63, y: 263.16), controlPoint2: CGPoint(x: 231.02, y: 187.61)) bezier18Path.addCurve(to: CGPoint(x: 321.64, y: 101.49), controlPoint1: CGPoint(x: 298.45, y: 120.23), controlPoint2: CGPoint(x: 309.8, y: 110.37)) bezier18Path.addCurve(to: CGPoint(x: 331.79, y: 102.94), controlPoint1: CGPoint(x: 324.83, y: 99.1), controlPoint2: CGPoint(x: 329.37, y: 99.72)) bezier18Path.addCurve(to: CGPoint(x: 330.33, y: 113.08), controlPoint1: CGPoint(x: 334.18, y: 106.13), controlPoint2: CGPoint(x: 333.53, y: 110.68)) bezier18Path.addCurve(to: CGPoint(x: 298.14, y: 141.02), controlPoint1: CGPoint(x: 319.04, y: 121.55), controlPoint2: CGPoint(x: 308.21, y: 130.95)) bezier18Path.addCurve(to: CGPoint(x: 211.17, y: 343.84), controlPoint1: CGPoint(x: 243.91, y: 195.22), controlPoint2: CGPoint(x: 213.02, y: 267.25)) bezier18Path.addCurve(to: CGPoint(x: 203.92, y: 350.91), controlPoint1: CGPoint(x: 211.07, y: 347.78), controlPoint2: CGPoint(x: 207.84, y: 350.91)) bezier18Path.close() bezier18Path.move(to: CGPoint(x: 812.37, y: 351.48)) bezier18Path.addCurve(to: CGPoint(x: 805.13, y: 344.4), controlPoint1: CGPoint(x: 808.44, y: 351.48), controlPoint2: CGPoint(x: 805.21, y: 348.35)) bezier18Path.addCurve(to: CGPoint(x: 718.17, y: 141.02), controlPoint1: CGPoint(x: 803.4, y: 267.61), controlPoint2: CGPoint(x: 772.52, y: 195.38)) bezier18Path.addCurve(to: CGPoint(x: 686.42, y: 113.41), controlPoint1: CGPoint(x: 708.22, y: 131.07), controlPoint2: CGPoint(x: 697.54, y: 121.78)) bezier18Path.addCurve(to: CGPoint(x: 684.99, y: 103.26), controlPoint1: CGPoint(x: 683.22, y: 111.01), controlPoint2: CGPoint(x: 682.58, y: 106.46)) bezier18Path.addCurve(to: CGPoint(x: 695.13, y: 101.83), controlPoint1: CGPoint(x: 687.38, y: 100.06), controlPoint2: CGPoint(x: 691.95, y: 99.44)) bezier18Path.addCurve(to: CGPoint(x: 728.42, y: 130.77), controlPoint1: CGPoint(x: 706.8, y: 110.61), controlPoint2: CGPoint(x: 718, y: 120.34)) bezier18Path.addCurve(to: CGPoint(x: 819.62, y: 344.07), controlPoint1: CGPoint(x: 785.41, y: 187.78), controlPoint2: CGPoint(x: 817.81, y: 263.54)) bezier18Path.addCurve(to: CGPoint(x: 812.54, y: 351.48), controlPoint1: CGPoint(x: 819.7, y: 348.07), controlPoint2: CGPoint(x: 816.53, y: 351.39)) bezier18Path.addCurve(to: CGPoint(x: 812.37, y: 351.48), controlPoint1: CGPoint(x: 812.48, y: 351.48), controlPoint2: CGPoint(x: 812.43, y: 351.48)) bezier18Path.close() bezier18Path.move(to: CGPoint(x: 207.98, y: 408.64)) bezier18Path.addCurve(to: CGPoint(x: 200.85, y: 402.59), controlPoint1: CGPoint(x: 204.52, y: 408.64), controlPoint2: CGPoint(x: 201.45, y: 406.14)) bezier18Path.addCurve(to: CGPoint(x: 197.36, y: 373.13), controlPoint1: CGPoint(x: 199.24, y: 392.93), controlPoint2: CGPoint(x: 198.06, y: 383.02)) bezier18Path.addCurve(to: CGPoint(x: 204.08, y: 365.4), controlPoint1: CGPoint(x: 197.07, y: 369.14), controlPoint2: CGPoint(x: 200.09, y: 365.67)) bezier18Path.addCurve(to: CGPoint(x: 211.82, y: 372.11), controlPoint1: CGPoint(x: 207.77, y: 365.02), controlPoint2: CGPoint(x: 211.53, y: 368.1)) bezier18Path.addCurve(to: CGPoint(x: 215.14, y: 400.2), controlPoint1: CGPoint(x: 212.48, y: 381.54), controlPoint2: CGPoint(x: 213.6, y: 390.99)) bezier18Path.addCurve(to: CGPoint(x: 209.2, y: 408.54), controlPoint1: CGPoint(x: 215.81, y: 404.14), controlPoint2: CGPoint(x: 213.15, y: 407.88)) bezier18Path.addCurve(to: CGPoint(x: 207.98, y: 408.64), controlPoint1: CGPoint(x: 208.79, y: 408.61), controlPoint2: CGPoint(x: 208.39, y: 408.64)) bezier18Path.close() bezier18Path.move(to: CGPoint(x: 808.18, y: 409.22)) bezier18Path.addCurve(to: CGPoint(x: 806.97, y: 409.12), controlPoint1: CGPoint(x: 807.77, y: 409.22), controlPoint2: CGPoint(x: 807.38, y: 409.18)) bezier18Path.addCurve(to: CGPoint(x: 801.02, y: 400.76), controlPoint1: CGPoint(x: 803.02, y: 408.44), controlPoint2: CGPoint(x: 800.36, y: 404.71)) bezier18Path.addCurve(to: CGPoint(x: 804.4, y: 372.68), controlPoint1: CGPoint(x: 802.59, y: 391.45), controlPoint2: CGPoint(x: 803.74, y: 382.01)) bezier18Path.addCurve(to: CGPoint(x: 812.16, y: 365.98), controlPoint1: CGPoint(x: 804.7, y: 368.68), controlPoint2: CGPoint(x: 808.2, y: 365.65)) bezier18Path.addCurve(to: CGPoint(x: 818.87, y: 373.73), controlPoint1: CGPoint(x: 816.15, y: 366.26), controlPoint2: CGPoint(x: 819.15, y: 369.74)) bezier18Path.addCurve(to: CGPoint(x: 815.31, y: 403.18), controlPoint1: CGPoint(x: 818.16, y: 383.51), controlPoint2: CGPoint(x: 816.95, y: 393.42)) bezier18Path.addCurve(to: CGPoint(x: 808.18, y: 409.22), controlPoint1: CGPoint(x: 814.72, y: 406.72), controlPoint2: CGPoint(x: 811.65, y: 409.22)) bezier18Path.close() bezier18Path.move(to: CGPoint(x: 701.88, y: 593.01)) bezier18Path.addCurve(to: CGPoint(x: 696.29, y: 590.37), controlPoint1: CGPoint(x: 699.8, y: 593.01), controlPoint2: CGPoint(x: 697.74, y: 592.11)) bezier18Path.addCurve(to: CGPoint(x: 697.27, y: 580.17), controlPoint1: CGPoint(x: 693.75, y: 587.29), controlPoint2: CGPoint(x: 694.18, y: 582.72)) bezier18Path.addCurve(to: CGPoint(x: 718.19, y: 561.13), controlPoint1: CGPoint(x: 704.45, y: 574.24), controlPoint2: CGPoint(x: 711.48, y: 567.83)) bezier18Path.addCurve(to: CGPoint(x: 728.43, y: 561.13), controlPoint1: CGPoint(x: 721.02, y: 558.3), controlPoint2: CGPoint(x: 725.6, y: 558.3)) bezier18Path.addCurve(to: CGPoint(x: 728.43, y: 571.38), controlPoint1: CGPoint(x: 731.26, y: 563.96), controlPoint2: CGPoint(x: 731.26, y: 568.55)) bezier18Path.addCurve(to: CGPoint(x: 706.5, y: 591.34), controlPoint1: CGPoint(x: 721.4, y: 578.4), controlPoint2: CGPoint(x: 714.02, y: 585.11)) bezier18Path.addCurve(to: CGPoint(x: 701.88, y: 593.01), controlPoint1: CGPoint(x: 705.15, y: 592.45), controlPoint2: CGPoint(x: 703.51, y: 593.01)) bezier18Path.close() bezier18Path.move(to: CGPoint(x: 388.26, y: 638.11)) bezier18Path.addCurve(to: CGPoint(x: 385.41, y: 637.53), controlPoint1: CGPoint(x: 387.3, y: 638.11), controlPoint2: CGPoint(x: 386.34, y: 637.93)) bezier18Path.addCurve(to: CGPoint(x: 358.73, y: 624.55), controlPoint1: CGPoint(x: 376.39, y: 633.67), controlPoint2: CGPoint(x: 367.42, y: 629.3)) bezier18Path.addCurve(to: CGPoint(x: 355.86, y: 614.72), controlPoint1: CGPoint(x: 355.22, y: 622.63), controlPoint2: CGPoint(x: 353.93, y: 618.23)) bezier18Path.addCurve(to: CGPoint(x: 365.69, y: 611.83), controlPoint1: CGPoint(x: 357.78, y: 611.21), controlPoint2: CGPoint(x: 362.17, y: 609.93)) bezier18Path.addCurve(to: CGPoint(x: 391.12, y: 624.21), controlPoint1: CGPoint(x: 373.96, y: 616.36), controlPoint2: CGPoint(x: 382.52, y: 620.52)) bezier18Path.addCurve(to: CGPoint(x: 394.93, y: 633.72), controlPoint1: CGPoint(x: 394.8, y: 625.78), controlPoint2: CGPoint(x: 396.5, y: 630.05)) bezier18Path.addCurve(to: CGPoint(x: 388.26, y: 638.11), controlPoint1: CGPoint(x: 393.74, y: 636.47), controlPoint2: CGPoint(x: 391.06, y: 638.11)) bezier18Path.close() bezier18Path.move(to: CGPoint(x: 508.15, y: 662.65)) bezier18Path.addCurve(to: CGPoint(x: 413.2, y: 647.89), controlPoint1: CGPoint(x: 475.83, y: 662.65), controlPoint2: CGPoint(x: 443.87, y: 657.69)) bezier18Path.addCurve(to: CGPoint(x: 408.5, y: 638.79), controlPoint1: CGPoint(x: 409.39, y: 646.67), controlPoint2: CGPoint(x: 407.28, y: 642.6)) bezier18Path.addCurve(to: CGPoint(x: 417.61, y: 634.09), controlPoint1: CGPoint(x: 409.73, y: 634.98), controlPoint2: CGPoint(x: 413.76, y: 632.83)) bezier18Path.addCurve(to: CGPoint(x: 508.15, y: 648.16), controlPoint1: CGPoint(x: 446.86, y: 643.43), controlPoint2: CGPoint(x: 477.32, y: 648.16)) bezier18Path.addCurve(to: CGPoint(x: 674.65, y: 597.15), controlPoint1: CGPoint(x: 567.89, y: 648.16), controlPoint2: CGPoint(x: 625.47, y: 630.53)) bezier18Path.addCurve(to: CGPoint(x: 684.72, y: 599.08), controlPoint1: CGPoint(x: 677.95, y: 594.9), controlPoint2: CGPoint(x: 682.48, y: 595.77)) bezier18Path.addCurve(to: CGPoint(x: 682.78, y: 609.14), controlPoint1: CGPoint(x: 686.95, y: 602.39), controlPoint2: CGPoint(x: 686.09, y: 606.9)) bezier18Path.addCurve(to: CGPoint(x: 508.15, y: 662.65), controlPoint1: CGPoint(x: 631.2, y: 644.16), controlPoint2: CGPoint(x: 570.81, y: 662.65)) bezier18Path.close() bezier18Path.usesEvenOddFillRule = true dark.setFill() bezier18Path.fill() //// Bezier 19 Drawing let bezier19Path = UIBezierPath() bezier19Path.move(to: CGPoint(x: 386.31, y: 255.51)) bezier19Path.addCurve(to: CGPoint(x: 381.63, y: 253.79), controlPoint1: CGPoint(x: 384.65, y: 255.51), controlPoint2: CGPoint(x: 383, y: 254.95)) bezier19Path.addCurve(to: CGPoint(x: 380.78, y: 243.58), controlPoint1: CGPoint(x: 378.57, y: 251.21), controlPoint2: CGPoint(x: 378.19, y: 246.64)) bezier19Path.addCurve(to: CGPoint(x: 402.31, y: 222.33), controlPoint1: CGPoint(x: 387.3, y: 235.86), controlPoint2: CGPoint(x: 394.55, y: 228.71)) bezier19Path.addCurve(to: CGPoint(x: 412.52, y: 223.33), controlPoint1: CGPoint(x: 405.4, y: 219.79), controlPoint2: CGPoint(x: 409.96, y: 220.23)) bezier19Path.addCurve(to: CGPoint(x: 411.51, y: 233.53), controlPoint1: CGPoint(x: 415.05, y: 226.42), controlPoint2: CGPoint(x: 414.61, y: 230.99)) bezier19Path.addCurve(to: CGPoint(x: 391.84, y: 252.94), controlPoint1: CGPoint(x: 404.42, y: 239.36), controlPoint2: CGPoint(x: 397.8, y: 245.89)) bezier19Path.addCurve(to: CGPoint(x: 386.31, y: 255.51), controlPoint1: CGPoint(x: 390.41, y: 254.64), controlPoint2: CGPoint(x: 388.36, y: 255.51)) bezier19Path.close() bezier19Path.move(to: CGPoint(x: 657.87, y: 303.56)) bezier19Path.addCurve(to: CGPoint(x: 651.07, y: 298.79), controlPoint1: CGPoint(x: 654.92, y: 303.56), controlPoint2: CGPoint(x: 652.13, y: 301.73)) bezier19Path.addCurve(to: CGPoint(x: 639.26, y: 273.84), controlPoint1: CGPoint(x: 647.94, y: 290.2), controlPoint2: CGPoint(x: 643.98, y: 281.8)) bezier19Path.addCurve(to: CGPoint(x: 641.83, y: 263.91), controlPoint1: CGPoint(x: 637.23, y: 270.4), controlPoint2: CGPoint(x: 638.37, y: 265.95)) bezier19Path.addCurve(to: CGPoint(x: 651.75, y: 266.47), controlPoint1: CGPoint(x: 645.21, y: 261.9), controlPoint2: CGPoint(x: 649.69, y: 263.01)) bezier19Path.addCurve(to: CGPoint(x: 664.68, y: 293.83), controlPoint1: CGPoint(x: 656.9, y: 275.2), controlPoint2: CGPoint(x: 661.26, y: 284.41)) bezier19Path.addCurve(to: CGPoint(x: 660.35, y: 303.12), controlPoint1: CGPoint(x: 666.05, y: 297.59), controlPoint2: CGPoint(x: 664.12, y: 301.75)) bezier19Path.addCurve(to: CGPoint(x: 657.87, y: 303.56), controlPoint1: CGPoint(x: 659.53, y: 303.41), controlPoint2: CGPoint(x: 658.69, y: 303.56)) bezier19Path.close() bezier19Path.move(to: CGPoint(x: 451.49, y: 507.37)) bezier19Path.addCurve(to: CGPoint(x: 448.91, y: 506.89), controlPoint1: CGPoint(x: 450.62, y: 507.37), controlPoint2: CGPoint(x: 449.76, y: 507.22)) bezier19Path.addCurve(to: CGPoint(x: 341.51, y: 351.05), controlPoint1: CGPoint(x: 384.67, y: 482.46), controlPoint2: CGPoint(x: 341.51, y: 419.83)) bezier19Path.addCurve(to: CGPoint(x: 363.44, y: 268.36), controlPoint1: CGPoint(x: 341.51, y: 322.01), controlPoint2: CGPoint(x: 349.09, y: 293.42)) bezier19Path.addCurve(to: CGPoint(x: 373.32, y: 265.67), controlPoint1: CGPoint(x: 365.42, y: 264.88), controlPoint2: CGPoint(x: 369.87, y: 263.69)) bezier19Path.addCurve(to: CGPoint(x: 376.01, y: 275.56), controlPoint1: CGPoint(x: 376.8, y: 267.66), controlPoint2: CGPoint(x: 378, y: 272.09)) bezier19Path.addCurve(to: CGPoint(x: 356, y: 351.05), controlPoint1: CGPoint(x: 362.92, y: 298.43), controlPoint2: CGPoint(x: 356, y: 324.54)) bezier19Path.addCurve(to: CGPoint(x: 454.06, y: 493.35), controlPoint1: CGPoint(x: 356, y: 413.85), controlPoint2: CGPoint(x: 395.41, y: 471.04)) bezier19Path.addCurve(to: CGPoint(x: 458.26, y: 502.7), controlPoint1: CGPoint(x: 457.8, y: 494.77), controlPoint2: CGPoint(x: 459.68, y: 498.95)) bezier19Path.addCurve(to: CGPoint(x: 451.49, y: 507.37), controlPoint1: CGPoint(x: 457.16, y: 505.59), controlPoint2: CGPoint(x: 454.4, y: 507.37)) bezier19Path.close() bezier19Path.move(to: CGPoint(x: 508.18, y: 517.74)) bezier19Path.addCurve(to: CGPoint(x: 478.06, y: 515.03), controlPoint1: CGPoint(x: 498.1, y: 517.74), controlPoint2: CGPoint(x: 487.97, y: 516.82)) bezier19Path.addCurve(to: CGPoint(x: 472.22, y: 506.6), controlPoint1: CGPoint(x: 474.11, y: 514.32), controlPoint2: CGPoint(x: 471.51, y: 510.54)) bezier19Path.addCurve(to: CGPoint(x: 480.64, y: 500.77), controlPoint1: CGPoint(x: 472.94, y: 502.65), controlPoint2: CGPoint(x: 476.75, y: 500.08)) bezier19Path.addCurve(to: CGPoint(x: 508.18, y: 503.24), controlPoint1: CGPoint(x: 489.7, y: 502.41), controlPoint2: CGPoint(x: 498.96, y: 503.24)) bezier19Path.addCurve(to: CGPoint(x: 509.17, y: 503.31), controlPoint1: CGPoint(x: 508.51, y: 503.24), controlPoint2: CGPoint(x: 508.84, y: 503.26)) bezier19Path.addCurve(to: CGPoint(x: 510.16, y: 503.23), controlPoint1: CGPoint(x: 509.49, y: 503.26), controlPoint2: CGPoint(x: 509.83, y: 503.23)) bezier19Path.addCurve(to: CGPoint(x: 660.3, y: 351.08), controlPoint1: CGPoint(x: 592.95, y: 502.17), controlPoint2: CGPoint(x: 660.3, y: 433.92)) bezier19Path.addCurve(to: CGPoint(x: 658.14, y: 325.47), controlPoint1: CGPoint(x: 660.28, y: 342.46), controlPoint2: CGPoint(x: 659.56, y: 333.84)) bezier19Path.addCurve(to: CGPoint(x: 664.09, y: 317.12), controlPoint1: CGPoint(x: 657.48, y: 321.53), controlPoint2: CGPoint(x: 660.14, y: 317.79)) bezier19Path.addCurve(to: CGPoint(x: 672.43, y: 323.07), controlPoint1: CGPoint(x: 667.98, y: 316.56), controlPoint2: CGPoint(x: 671.77, y: 319.11)) bezier19Path.addCurve(to: CGPoint(x: 674.78, y: 351.07), controlPoint1: CGPoint(x: 673.98, y: 332.22), controlPoint2: CGPoint(x: 674.77, y: 341.64)) bezier19Path.addCurve(to: CGPoint(x: 510.35, y: 517.72), controlPoint1: CGPoint(x: 674.78, y: 441.81), controlPoint2: CGPoint(x: 601.02, y: 516.56)) bezier19Path.addCurve(to: CGPoint(x: 509.26, y: 517.66), controlPoint1: CGPoint(x: 509.76, y: 517.7), controlPoint2: CGPoint(x: 509.62, y: 517.71)) bezier19Path.addCurve(to: CGPoint(x: 508.18, y: 517.74), controlPoint1: CGPoint(x: 508.91, y: 517.7), controlPoint2: CGPoint(x: 508.54, y: 517.74)) bezier19Path.close() bezier19Path.usesEvenOddFillRule = true dark.setFill() bezier19Path.fill() //// Bezier 20 Drawing let bezier20Path = UIBezierPath() bezier20Path.move(to: CGPoint(x: 588.05, y: 392.64)) bezier20Path.addCurve(to: CGPoint(x: 585.2, y: 392.06), controlPoint1: CGPoint(x: 587.11, y: 392.64), controlPoint2: CGPoint(x: 586.13, y: 392.46)) bezier20Path.addCurve(to: CGPoint(x: 581.39, y: 382.54), controlPoint1: CGPoint(x: 581.53, y: 390.48), controlPoint2: CGPoint(x: 579.82, y: 386.22)) bezier20Path.addCurve(to: CGPoint(x: 587.84, y: 351.06), controlPoint1: CGPoint(x: 585.68, y: 372.55), controlPoint2: CGPoint(x: 587.84, y: 361.96)) bezier20Path.addCurve(to: CGPoint(x: 587.49, y: 343.57), controlPoint1: CGPoint(x: 587.84, y: 348.56), controlPoint2: CGPoint(x: 587.73, y: 346.06)) bezier20Path.addCurve(to: CGPoint(x: 593.18, y: 335.8), controlPoint1: CGPoint(x: 587.15, y: 339.86), controlPoint2: CGPoint(x: 589.64, y: 336.56)) bezier20Path.addCurve(to: CGPoint(x: 585.16, y: 330.49), controlPoint1: CGPoint(x: 589.63, y: 336.3), controlPoint2: CGPoint(x: 586.1, y: 334.07)) bezier20Path.addCurve(to: CGPoint(x: 564.51, y: 294.72), controlPoint1: CGPoint(x: 581.57, y: 317.02), controlPoint2: CGPoint(x: 574.43, y: 304.65)) bezier20Path.addCurve(to: CGPoint(x: 508.13, y: 271.38), controlPoint1: CGPoint(x: 549.44, y: 279.67), controlPoint2: CGPoint(x: 529.41, y: 271.38)) bezier20Path.addCurve(to: CGPoint(x: 451.8, y: 294.71), controlPoint1: CGPoint(x: 486.87, y: 271.38), controlPoint2: CGPoint(x: 466.86, y: 279.66)) bezier20Path.addCurve(to: CGPoint(x: 428.45, y: 351.09), controlPoint1: CGPoint(x: 436.74, y: 309.77), controlPoint2: CGPoint(x: 428.45, y: 329.79)) bezier20Path.addCurve(to: CGPoint(x: 429, y: 360.54), controlPoint1: CGPoint(x: 428.45, y: 354.24), controlPoint2: CGPoint(x: 428.63, y: 357.4)) bezier20Path.addCurve(to: CGPoint(x: 422.68, y: 368.59), controlPoint1: CGPoint(x: 429.48, y: 364.51), controlPoint2: CGPoint(x: 426.65, y: 368.11)) bezier20Path.addCurve(to: CGPoint(x: 414.63, y: 362.26), controlPoint1: CGPoint(x: 418.77, y: 369.05), controlPoint2: CGPoint(x: 415.09, y: 366.25)) bezier20Path.addCurve(to: CGPoint(x: 413.96, y: 351.09), controlPoint1: CGPoint(x: 414.17, y: 358.55), controlPoint2: CGPoint(x: 413.96, y: 354.82)) bezier20Path.addCurve(to: CGPoint(x: 441.56, y: 284.46), controlPoint1: CGPoint(x: 413.96, y: 325.93), controlPoint2: CGPoint(x: 423.75, y: 302.27)) bezier20Path.addCurve(to: CGPoint(x: 508.14, y: 256.89), controlPoint1: CGPoint(x: 459.36, y: 266.68), controlPoint2: CGPoint(x: 482.99, y: 256.89)) bezier20Path.addCurve(to: CGPoint(x: 574.76, y: 284.48), controlPoint1: CGPoint(x: 533.29, y: 256.89), controlPoint2: CGPoint(x: 556.95, y: 266.69)) bezier20Path.addCurve(to: CGPoint(x: 599.17, y: 326.76), controlPoint1: CGPoint(x: 586.49, y: 296.21), controlPoint2: CGPoint(x: 594.92, y: 310.83)) bezier20Path.addCurve(to: CGPoint(x: 594.03, y: 335.63), controlPoint1: CGPoint(x: 600.2, y: 330.63), controlPoint2: CGPoint(x: 597.89, y: 334.6)) bezier20Path.addCurve(to: CGPoint(x: 593.68, y: 335.71), controlPoint1: CGPoint(x: 593.9, y: 335.66), controlPoint2: CGPoint(x: 593.79, y: 335.69)) bezier20Path.addCurve(to: CGPoint(x: 594.03, y: 335.67), controlPoint1: CGPoint(x: 593.79, y: 335.7), controlPoint2: CGPoint(x: 593.92, y: 335.68)) bezier20Path.addCurve(to: CGPoint(x: 601.93, y: 342.21), controlPoint1: CGPoint(x: 597.92, y: 335.28), controlPoint2: CGPoint(x: 601.54, y: 338.22)) bezier20Path.addCurve(to: CGPoint(x: 602.34, y: 351.06), controlPoint1: CGPoint(x: 602.19, y: 345.15), controlPoint2: CGPoint(x: 602.34, y: 348.11)) bezier20Path.addCurve(to: CGPoint(x: 594.72, y: 388.25), controlPoint1: CGPoint(x: 602.34, y: 363.93), controlPoint2: CGPoint(x: 599.78, y: 376.44)) bezier20Path.addCurve(to: CGPoint(x: 588.05, y: 392.64), controlPoint1: CGPoint(x: 593.54, y: 390.99), controlPoint2: CGPoint(x: 590.86, y: 392.64)) bezier20Path.close() bezier20Path.move(to: CGPoint(x: 446.68, y: 419.82)) bezier20Path.addCurve(to: CGPoint(x: 441.55, y: 417.71), controlPoint1: CGPoint(x: 444.82, y: 419.82), controlPoint2: CGPoint(x: 442.97, y: 419.11)) bezier20Path.addCurve(to: CGPoint(x: 431.41, y: 405.73), controlPoint1: CGPoint(x: 437.86, y: 414.02), controlPoint2: CGPoint(x: 434.45, y: 409.99)) bezier20Path.addCurve(to: CGPoint(x: 433.09, y: 395.63), controlPoint1: CGPoint(x: 429.09, y: 402.48), controlPoint2: CGPoint(x: 429.84, y: 397.95)) bezier20Path.addCurve(to: CGPoint(x: 443.21, y: 397.31), controlPoint1: CGPoint(x: 436.37, y: 393.31), controlPoint2: CGPoint(x: 440.87, y: 394.05)) bezier20Path.addCurve(to: CGPoint(x: 451.8, y: 407.45), controlPoint1: CGPoint(x: 445.78, y: 400.92), controlPoint2: CGPoint(x: 448.67, y: 404.33)) bezier20Path.addCurve(to: CGPoint(x: 451.8, y: 417.69), controlPoint1: CGPoint(x: 454.63, y: 410.28), controlPoint2: CGPoint(x: 454.63, y: 414.86)) bezier20Path.addCurve(to: CGPoint(x: 446.68, y: 419.82), controlPoint1: CGPoint(x: 450.38, y: 419.12), controlPoint2: CGPoint(x: 448.53, y: 419.82)) bezier20Path.close() bezier20Path.usesEvenOddFillRule = true dark.setFill() bezier20Path.fill() //// Bezier 21 Drawing let bezier21Path = UIBezierPath() bezier21Path.move(to: CGPoint(x: 446.76, y: 134.66)) bezier21Path.addCurve(to: CGPoint(x: 439.77, y: 129.33), controlPoint1: CGPoint(x: 443.58, y: 134.66), controlPoint2: CGPoint(x: 440.65, y: 132.54)) bezier21Path.addCurve(to: CGPoint(x: 444.85, y: 120.42), controlPoint1: CGPoint(x: 438.72, y: 125.47), controlPoint2: CGPoint(x: 440.99, y: 121.49)) bezier21Path.addCurve(to: CGPoint(x: 474.09, y: 114.37), controlPoint1: CGPoint(x: 454.38, y: 117.82), controlPoint2: CGPoint(x: 464.21, y: 115.78)) bezier21Path.addCurve(to: CGPoint(x: 482.28, y: 120.52), controlPoint1: CGPoint(x: 477.92, y: 113.8), controlPoint2: CGPoint(x: 481.7, y: 116.55)) bezier21Path.addCurve(to: CGPoint(x: 476.12, y: 128.72), controlPoint1: CGPoint(x: 482.84, y: 124.48), controlPoint2: CGPoint(x: 480.09, y: 128.15)) bezier21Path.addCurve(to: CGPoint(x: 448.67, y: 134.41), controlPoint1: CGPoint(x: 466.86, y: 130.04), controlPoint2: CGPoint(x: 457.62, y: 131.96)) bezier21Path.addCurve(to: CGPoint(x: 446.76, y: 134.66), controlPoint1: CGPoint(x: 448.03, y: 134.58), controlPoint2: CGPoint(x: 447.38, y: 134.66)) bezier21Path.close() bezier21Path.move(to: CGPoint(x: 721.58, y: 267.62)) bezier21Path.addCurve(to: CGPoint(x: 714.91, y: 263.21), controlPoint1: CGPoint(x: 718.76, y: 267.62), controlPoint2: CGPoint(x: 716.09, y: 265.97)) bezier21Path.addCurve(to: CGPoint(x: 508.16, y: 126.45), controlPoint1: CGPoint(x: 679.57, y: 180.13), controlPoint2: CGPoint(x: 598.41, y: 126.45)) bezier21Path.addLine(to: CGPoint(x: 504.08, y: 126.49)) bezier21Path.addCurve(to: CGPoint(x: 496.7, y: 119.39), controlPoint1: CGPoint(x: 499.49, y: 126.32), controlPoint2: CGPoint(x: 496.78, y: 123.37)) bezier21Path.addCurve(to: CGPoint(x: 503.8, y: 111.99), controlPoint1: CGPoint(x: 496.61, y: 115.39), controlPoint2: CGPoint(x: 499.8, y: 112.08)) bezier21Path.addLine(to: CGPoint(x: 508.16, y: 111.95)) bezier21Path.addCurve(to: CGPoint(x: 728.24, y: 257.54), controlPoint1: CGPoint(x: 604.24, y: 111.95), controlPoint2: CGPoint(x: 690.63, y: 169.1)) bezier21Path.addCurve(to: CGPoint(x: 724.41, y: 267.04), controlPoint1: CGPoint(x: 729.81, y: 261.23), controlPoint2: CGPoint(x: 728.1, y: 265.48)) bezier21Path.addCurve(to: CGPoint(x: 721.58, y: 267.62), controlPoint1: CGPoint(x: 723.49, y: 267.44), controlPoint2: CGPoint(x: 722.53, y: 267.62)) bezier21Path.close() bezier21Path.move(to: CGPoint(x: 737.33, y: 323.23)) bezier21Path.addCurve(to: CGPoint(x: 730.18, y: 317.07), controlPoint1: CGPoint(x: 733.81, y: 323.23), controlPoint2: CGPoint(x: 730.72, y: 320.66)) bezier21Path.addCurve(to: CGPoint(x: 724.24, y: 289.67), controlPoint1: CGPoint(x: 728.78, y: 307.82), controlPoint2: CGPoint(x: 726.79, y: 298.6)) bezier21Path.addCurve(to: CGPoint(x: 729.24, y: 280.71), controlPoint1: CGPoint(x: 723.15, y: 285.82), controlPoint2: CGPoint(x: 725.39, y: 281.81)) bezier21Path.addCurve(to: CGPoint(x: 738.18, y: 285.7), controlPoint1: CGPoint(x: 733.11, y: 279.58), controlPoint2: CGPoint(x: 737.08, y: 281.86)) bezier21Path.addCurve(to: CGPoint(x: 744.51, y: 314.91), controlPoint1: CGPoint(x: 740.9, y: 295.23), controlPoint2: CGPoint(x: 743.02, y: 305.05)) bezier21Path.addCurve(to: CGPoint(x: 738.44, y: 323.16), controlPoint1: CGPoint(x: 745.11, y: 318.86), controlPoint2: CGPoint(x: 742.38, y: 322.55)) bezier21Path.addCurve(to: CGPoint(x: 737.33, y: 323.23), controlPoint1: CGPoint(x: 738.07, y: 323.21), controlPoint2: CGPoint(x: 737.7, y: 323.23)) bezier21Path.close() bezier21Path.move(to: CGPoint(x: 276.3, y: 360.42)) bezier21Path.addCurve(to: CGPoint(x: 269.06, y: 353.18), controlPoint1: CGPoint(x: 272.3, y: 360.42), controlPoint2: CGPoint(x: 269.06, y: 357.18)) bezier21Path.addLine(to: CGPoint(x: 269.06, y: 351.05)) bezier21Path.addCurve(to: CGPoint(x: 270.63, y: 323.44), controlPoint1: CGPoint(x: 269.06, y: 341.88), controlPoint2: CGPoint(x: 269.58, y: 332.59)) bezier21Path.addCurve(to: CGPoint(x: 278.65, y: 317.06), controlPoint1: CGPoint(x: 271.08, y: 319.45), controlPoint2: CGPoint(x: 274.72, y: 316.54)) bezier21Path.addCurve(to: CGPoint(x: 285.03, y: 325.08), controlPoint1: CGPoint(x: 282.63, y: 317.52), controlPoint2: CGPoint(x: 285.49, y: 321.1)) bezier21Path.addCurve(to: CGPoint(x: 283.55, y: 351.05), controlPoint1: CGPoint(x: 284.04, y: 333.68), controlPoint2: CGPoint(x: 283.55, y: 342.42)) bezier21Path.addLine(to: CGPoint(x: 283.55, y: 353.18)) bezier21Path.addCurve(to: CGPoint(x: 276.3, y: 360.42), controlPoint1: CGPoint(x: 283.55, y: 357.18), controlPoint2: CGPoint(x: 280.31, y: 360.42)) bezier21Path.close() bezier21Path.move(to: CGPoint(x: 600.79, y: 570.97)) bezier21Path.addCurve(to: CGPoint(x: 594.15, y: 566.63), controlPoint1: CGPoint(x: 598, y: 570.97), controlPoint2: CGPoint(x: 595.34, y: 569.34)) bezier21Path.addCurve(to: CGPoint(x: 597.9, y: 557.09), controlPoint1: CGPoint(x: 592.55, y: 562.95), controlPoint2: CGPoint(x: 594.22, y: 558.69)) bezier21Path.addCurve(to: CGPoint(x: 622.82, y: 544.29), controlPoint1: CGPoint(x: 606.41, y: 553.38), controlPoint2: CGPoint(x: 614.8, y: 549.08)) bezier21Path.addCurve(to: CGPoint(x: 632.76, y: 546.81), controlPoint1: CGPoint(x: 626.22, y: 542.25), controlPoint2: CGPoint(x: 630.67, y: 543.36)) bezier21Path.addCurve(to: CGPoint(x: 630.23, y: 556.75), controlPoint1: CGPoint(x: 634.81, y: 550.25), controlPoint2: CGPoint(x: 633.68, y: 554.71)) bezier21Path.addCurve(to: CGPoint(x: 603.67, y: 570.38), controlPoint1: CGPoint(x: 621.69, y: 561.84), controlPoint2: CGPoint(x: 612.75, y: 566.43)) bezier21Path.addCurve(to: CGPoint(x: 600.79, y: 570.97), controlPoint1: CGPoint(x: 602.74, y: 570.79), controlPoint2: CGPoint(x: 601.75, y: 570.97)) bezier21Path.close() bezier21Path.move(to: CGPoint(x: 450.82, y: 583.06)) bezier21Path.addCurve(to: CGPoint(x: 449.04, y: 582.83), controlPoint1: CGPoint(x: 450.24, y: 583.06), controlPoint2: CGPoint(x: 449.63, y: 582.99)) bezier21Path.addCurve(to: CGPoint(x: 271.17, y: 383), controlPoint1: CGPoint(x: 355.43, y: 559.04), controlPoint2: CGPoint(x: 283.94, y: 478.73)) bezier21Path.addCurve(to: CGPoint(x: 277.39, y: 374.87), controlPoint1: CGPoint(x: 270.64, y: 379.04), controlPoint2: CGPoint(x: 273.43, y: 375.4)) bezier21Path.addCurve(to: CGPoint(x: 285.53, y: 381.09), controlPoint1: CGPoint(x: 281.28, y: 374.34), controlPoint2: CGPoint(x: 285.01, y: 377.11)) bezier21Path.addCurve(to: CGPoint(x: 452.6, y: 568.79), controlPoint1: CGPoint(x: 297.54, y: 471.01), controlPoint2: CGPoint(x: 364.67, y: 546.44)) bezier21Path.addCurve(to: CGPoint(x: 457.84, y: 577.59), controlPoint1: CGPoint(x: 456.48, y: 569.78), controlPoint2: CGPoint(x: 458.83, y: 573.72)) bezier21Path.addCurve(to: CGPoint(x: 450.82, y: 583.06), controlPoint1: CGPoint(x: 457.01, y: 580.88), controlPoint2: CGPoint(x: 454.06, y: 583.06)) bezier21Path.close() bezier21Path.move(to: CGPoint(x: 508.24, y: 590.2)) bezier21Path.addCurve(to: CGPoint(x: 508.18, y: 590.2), controlPoint1: CGPoint(x: 508.22, y: 590.2), controlPoint2: CGPoint(x: 508.2, y: 590.2)) bezier21Path.addCurve(to: CGPoint(x: 478.37, y: 588.36), controlPoint1: CGPoint(x: 498.23, y: 590.2), controlPoint2: CGPoint(x: 488.21, y: 589.58)) bezier21Path.addCurve(to: CGPoint(x: 472.08, y: 580.28), controlPoint1: CGPoint(x: 474.4, y: 587.87), controlPoint2: CGPoint(x: 471.58, y: 584.25)) bezier21Path.addCurve(to: CGPoint(x: 480.16, y: 573.98), controlPoint1: CGPoint(x: 472.56, y: 576.3), controlPoint2: CGPoint(x: 476.25, y: 573.4)) bezier21Path.addCurve(to: CGPoint(x: 508.24, y: 575.71), controlPoint1: CGPoint(x: 489.43, y: 575.13), controlPoint2: CGPoint(x: 498.93, y: 576.23)) bezier21Path.addCurve(to: CGPoint(x: 571.53, y: 566.65), controlPoint1: CGPoint(x: 529.77, y: 575.71), controlPoint2: CGPoint(x: 551.07, y: 572.67)) bezier21Path.addCurve(to: CGPoint(x: 580.51, y: 571.58), controlPoint1: CGPoint(x: 575.4, y: 565.5), controlPoint2: CGPoint(x: 579.4, y: 567.74)) bezier21Path.addCurve(to: CGPoint(x: 575.6, y: 580.56), controlPoint1: CGPoint(x: 581.64, y: 575.41), controlPoint2: CGPoint(x: 579.44, y: 579.43)) bezier21Path.addCurve(to: CGPoint(x: 508.24, y: 590.2), controlPoint1: CGPoint(x: 553.81, y: 586.96), controlPoint2: CGPoint(x: 531.16, y: 590.2)) bezier21Path.close() bezier21Path.usesEvenOddFillRule = true dark.setFill() bezier21Path.fill() //// Bezier 22 Drawing let bezier22Path = UIBezierPath() bezier22Path.move(to: CGPoint(x: 203.96, y: 967)) bezier22Path.addCurve(to: CGPoint(x: 196.72, y: 959.75), controlPoint1: CGPoint(x: 199.96, y: 967), controlPoint2: CGPoint(x: 196.72, y: 963.76)) bezier22Path.addLine(to: CGPoint(x: 196.72, y: 945.26)) bezier22Path.addCurve(to: CGPoint(x: 203.96, y: 938.01), controlPoint1: CGPoint(x: 196.72, y: 941.26), controlPoint2: CGPoint(x: 199.96, y: 938.01)) bezier22Path.addCurve(to: CGPoint(x: 211.21, y: 945.26), controlPoint1: CGPoint(x: 207.97, y: 938.01), controlPoint2: CGPoint(x: 211.21, y: 941.26)) bezier22Path.addLine(to: CGPoint(x: 211.21, y: 959.75)) bezier22Path.addCurve(to: CGPoint(x: 203.96, y: 967), controlPoint1: CGPoint(x: 211.21, y: 963.76), controlPoint2: CGPoint(x: 207.97, y: 967)) bezier22Path.close() bezier22Path.usesEvenOddFillRule = true dark.setFill() bezier22Path.fill() //// Bezier 23 Drawing let bezier23Path = UIBezierPath() bezier23Path.move(to: CGPoint(x: 232.95, y: 967)) bezier23Path.addCurve(to: CGPoint(x: 225.7, y: 959.75), controlPoint1: CGPoint(x: 228.94, y: 967), controlPoint2: CGPoint(x: 225.7, y: 963.76)) bezier23Path.addLine(to: CGPoint(x: 225.7, y: 945.26)) bezier23Path.addCurve(to: CGPoint(x: 232.95, y: 938.01), controlPoint1: CGPoint(x: 225.7, y: 941.26), controlPoint2: CGPoint(x: 228.94, y: 938.01)) bezier23Path.addCurve(to: CGPoint(x: 240.19, y: 945.26), controlPoint1: CGPoint(x: 236.95, y: 938.01), controlPoint2: CGPoint(x: 240.19, y: 941.26)) bezier23Path.addLine(to: CGPoint(x: 240.19, y: 959.75)) bezier23Path.addCurve(to: CGPoint(x: 232.95, y: 967), controlPoint1: CGPoint(x: 240.19, y: 963.76), controlPoint2: CGPoint(x: 236.95, y: 967)) bezier23Path.close() bezier23Path.usesEvenOddFillRule = true dark.setFill() bezier23Path.fill() //// Bezier 24 Drawing let bezier24Path = UIBezierPath() bezier24Path.move(to: CGPoint(x: 261.93, y: 967)) bezier24Path.addCurve(to: CGPoint(x: 254.68, y: 959.75), controlPoint1: CGPoint(x: 257.92, y: 967), controlPoint2: CGPoint(x: 254.68, y: 963.76)) bezier24Path.addLine(to: CGPoint(x: 254.68, y: 945.26)) bezier24Path.addCurve(to: CGPoint(x: 261.93, y: 938.01), controlPoint1: CGPoint(x: 254.68, y: 941.26), controlPoint2: CGPoint(x: 257.92, y: 938.01)) bezier24Path.addCurve(to: CGPoint(x: 269.17, y: 945.26), controlPoint1: CGPoint(x: 265.93, y: 938.01), controlPoint2: CGPoint(x: 269.17, y: 941.26)) bezier24Path.addLine(to: CGPoint(x: 269.17, y: 959.75)) bezier24Path.addCurve(to: CGPoint(x: 261.93, y: 967), controlPoint1: CGPoint(x: 269.17, y: 963.76), controlPoint2: CGPoint(x: 265.93, y: 967)) bezier24Path.close() bezier24Path.usesEvenOddFillRule = true dark.setFill() bezier24Path.fill() //// Bezier 25 Drawing let bezier25Path = UIBezierPath() bezier25Path.move(to: CGPoint(x: 290.91, y: 967)) bezier25Path.addCurve(to: CGPoint(x: 283.66, y: 959.75), controlPoint1: CGPoint(x: 286.9, y: 967), controlPoint2: CGPoint(x: 283.66, y: 963.76)) bezier25Path.addLine(to: CGPoint(x: 283.66, y: 945.26)) bezier25Path.addCurve(to: CGPoint(x: 290.91, y: 938.01), controlPoint1: CGPoint(x: 283.66, y: 941.26), controlPoint2: CGPoint(x: 286.9, y: 938.01)) bezier25Path.addCurve(to: CGPoint(x: 298.15, y: 945.26), controlPoint1: CGPoint(x: 294.91, y: 938.01), controlPoint2: CGPoint(x: 298.15, y: 941.26)) bezier25Path.addLine(to: CGPoint(x: 298.15, y: 959.75)) bezier25Path.addCurve(to: CGPoint(x: 290.91, y: 967), controlPoint1: CGPoint(x: 298.15, y: 963.76), controlPoint2: CGPoint(x: 294.91, y: 967)) bezier25Path.close() bezier25Path.usesEvenOddFillRule = true dark.setFill() bezier25Path.fill() //// Bezier 26 Drawing let bezier26Path = UIBezierPath() bezier26Path.move(to: CGPoint(x: 319.89, y: 967)) bezier26Path.addCurve(to: CGPoint(x: 312.64, y: 959.75), controlPoint1: CGPoint(x: 315.88, y: 967), controlPoint2: CGPoint(x: 312.64, y: 963.76)) bezier26Path.addLine(to: CGPoint(x: 312.64, y: 945.26)) bezier26Path.addCurve(to: CGPoint(x: 319.89, y: 938.01), controlPoint1: CGPoint(x: 312.64, y: 941.26), controlPoint2: CGPoint(x: 315.88, y: 938.01)) bezier26Path.addCurve(to: CGPoint(x: 327.13, y: 945.26), controlPoint1: CGPoint(x: 323.89, y: 938.01), controlPoint2: CGPoint(x: 327.13, y: 941.26)) bezier26Path.addLine(to: CGPoint(x: 327.13, y: 959.75)) bezier26Path.addCurve(to: CGPoint(x: 319.89, y: 967), controlPoint1: CGPoint(x: 327.13, y: 963.76), controlPoint2: CGPoint(x: 323.89, y: 967)) bezier26Path.close() bezier26Path.usesEvenOddFillRule = true dark.setFill() bezier26Path.fill() //// Bezier 27 Drawing let bezier27Path = UIBezierPath() bezier27Path.move(to: CGPoint(x: 348.87, y: 967)) bezier27Path.addCurve(to: CGPoint(x: 341.62, y: 959.75), controlPoint1: CGPoint(x: 344.86, y: 967), controlPoint2: CGPoint(x: 341.62, y: 963.76)) bezier27Path.addLine(to: CGPoint(x: 341.62, y: 945.26)) bezier27Path.addCurve(to: CGPoint(x: 348.87, y: 938.01), controlPoint1: CGPoint(x: 341.62, y: 941.26), controlPoint2: CGPoint(x: 344.86, y: 938.01)) bezier27Path.addCurve(to: CGPoint(x: 356.11, y: 945.26), controlPoint1: CGPoint(x: 352.87, y: 938.01), controlPoint2: CGPoint(x: 356.11, y: 941.26)) bezier27Path.addLine(to: CGPoint(x: 356.11, y: 959.75)) bezier27Path.addCurve(to: CGPoint(x: 348.87, y: 967), controlPoint1: CGPoint(x: 356.11, y: 963.76), controlPoint2: CGPoint(x: 352.87, y: 967)) bezier27Path.close() bezier27Path.usesEvenOddFillRule = true dark.setFill() bezier27Path.fill() //// Bezier 28 Drawing let bezier28Path = UIBezierPath() bezier28Path.move(to: CGPoint(x: 377.85, y: 967)) bezier28Path.addCurve(to: CGPoint(x: 370.6, y: 959.75), controlPoint1: CGPoint(x: 373.84, y: 967), controlPoint2: CGPoint(x: 370.6, y: 963.76)) bezier28Path.addLine(to: CGPoint(x: 370.6, y: 945.26)) bezier28Path.addCurve(to: CGPoint(x: 377.85, y: 938.01), controlPoint1: CGPoint(x: 370.6, y: 941.26), controlPoint2: CGPoint(x: 373.84, y: 938.01)) bezier28Path.addCurve(to: CGPoint(x: 385.09, y: 945.26), controlPoint1: CGPoint(x: 381.85, y: 938.01), controlPoint2: CGPoint(x: 385.09, y: 941.26)) bezier28Path.addLine(to: CGPoint(x: 385.09, y: 959.75)) bezier28Path.addCurve(to: CGPoint(x: 377.85, y: 967), controlPoint1: CGPoint(x: 385.09, y: 963.76), controlPoint2: CGPoint(x: 381.85, y: 967)) bezier28Path.close() bezier28Path.usesEvenOddFillRule = true dark.setFill() bezier28Path.fill() //// Bezier 29 Drawing let bezier29Path = UIBezierPath() bezier29Path.move(to: CGPoint(x: 406.83, y: 967)) bezier29Path.addCurve(to: CGPoint(x: 399.58, y: 959.75), controlPoint1: CGPoint(x: 402.82, y: 967), controlPoint2: CGPoint(x: 399.58, y: 963.76)) bezier29Path.addLine(to: CGPoint(x: 399.58, y: 945.26)) bezier29Path.addCurve(to: CGPoint(x: 406.83, y: 938.01), controlPoint1: CGPoint(x: 399.58, y: 941.26), controlPoint2: CGPoint(x: 402.82, y: 938.01)) bezier29Path.addCurve(to: CGPoint(x: 414.07, y: 945.26), controlPoint1: CGPoint(x: 410.83, y: 938.01), controlPoint2: CGPoint(x: 414.07, y: 941.26)) bezier29Path.addLine(to: CGPoint(x: 414.07, y: 959.75)) bezier29Path.addCurve(to: CGPoint(x: 406.83, y: 967), controlPoint1: CGPoint(x: 414.07, y: 963.76), controlPoint2: CGPoint(x: 410.83, y: 967)) bezier29Path.close() bezier29Path.usesEvenOddFillRule = true dark.setFill() bezier29Path.fill() //// Bezier 30 Drawing let bezier30Path = UIBezierPath() bezier30Path.move(to: CGPoint(x: 435.81, y: 967)) bezier30Path.addCurve(to: CGPoint(x: 428.56, y: 959.75), controlPoint1: CGPoint(x: 431.8, y: 967), controlPoint2: CGPoint(x: 428.56, y: 963.76)) bezier30Path.addLine(to: CGPoint(x: 428.56, y: 945.26)) bezier30Path.addCurve(to: CGPoint(x: 435.81, y: 938.01), controlPoint1: CGPoint(x: 428.56, y: 941.26), controlPoint2: CGPoint(x: 431.8, y: 938.01)) bezier30Path.addCurve(to: CGPoint(x: 443.05, y: 945.26), controlPoint1: CGPoint(x: 439.81, y: 938.01), controlPoint2: CGPoint(x: 443.05, y: 941.26)) bezier30Path.addLine(to: CGPoint(x: 443.05, y: 959.75)) bezier30Path.addCurve(to: CGPoint(x: 435.81, y: 967), controlPoint1: CGPoint(x: 443.05, y: 963.76), controlPoint2: CGPoint(x: 439.81, y: 967)) bezier30Path.close() bezier30Path.usesEvenOddFillRule = true dark.setFill() bezier30Path.fill() //// Bezier 31 Drawing let bezier31Path = UIBezierPath() bezier31Path.move(to: CGPoint(x: 493.77, y: 967)) bezier31Path.addCurve(to: CGPoint(x: 486.53, y: 959.75), controlPoint1: CGPoint(x: 489.77, y: 967), controlPoint2: CGPoint(x: 486.53, y: 963.76)) bezier31Path.addLine(to: CGPoint(x: 486.53, y: 945.26)) bezier31Path.addCurve(to: CGPoint(x: 493.77, y: 938.01), controlPoint1: CGPoint(x: 486.53, y: 941.26), controlPoint2: CGPoint(x: 489.77, y: 938.01)) bezier31Path.addCurve(to: CGPoint(x: 501.02, y: 945.26), controlPoint1: CGPoint(x: 497.77, y: 938.01), controlPoint2: CGPoint(x: 501.02, y: 941.26)) bezier31Path.addLine(to: CGPoint(x: 501.02, y: 959.75)) bezier31Path.addCurve(to: CGPoint(x: 493.77, y: 967), controlPoint1: CGPoint(x: 501.02, y: 963.76), controlPoint2: CGPoint(x: 497.77, y: 967)) bezier31Path.close() bezier31Path.usesEvenOddFillRule = true dark.setFill() bezier31Path.fill() //// Bezier 32 Drawing let bezier32Path = UIBezierPath() bezier32Path.move(to: CGPoint(x: 522.75, y: 967)) bezier32Path.addCurve(to: CGPoint(x: 515.5, y: 959.75), controlPoint1: CGPoint(x: 518.74, y: 967), controlPoint2: CGPoint(x: 515.5, y: 963.76)) bezier32Path.addLine(to: CGPoint(x: 515.5, y: 945.26)) bezier32Path.addCurve(to: CGPoint(x: 522.75, y: 938.01), controlPoint1: CGPoint(x: 515.5, y: 941.26), controlPoint2: CGPoint(x: 518.74, y: 938.01)) bezier32Path.addCurve(to: CGPoint(x: 529.99, y: 945.26), controlPoint1: CGPoint(x: 526.75, y: 938.01), controlPoint2: CGPoint(x: 529.99, y: 941.26)) bezier32Path.addLine(to: CGPoint(x: 529.99, y: 959.75)) bezier32Path.addCurve(to: CGPoint(x: 522.75, y: 967), controlPoint1: CGPoint(x: 529.99, y: 963.76), controlPoint2: CGPoint(x: 526.75, y: 967)) bezier32Path.close() bezier32Path.usesEvenOddFillRule = true dark.setFill() bezier32Path.fill() //// Bezier 33 Drawing let bezier33Path = UIBezierPath() bezier33Path.move(to: CGPoint(x: 580.71, y: 967)) bezier33Path.addCurve(to: CGPoint(x: 573.47, y: 959.75), controlPoint1: CGPoint(x: 576.71, y: 967), controlPoint2: CGPoint(x: 573.47, y: 963.76)) bezier33Path.addLine(to: CGPoint(x: 573.47, y: 945.26)) bezier33Path.addCurve(to: CGPoint(x: 580.71, y: 938.01), controlPoint1: CGPoint(x: 573.47, y: 941.26), controlPoint2: CGPoint(x: 576.71, y: 938.01)) bezier33Path.addCurve(to: CGPoint(x: 587.95, y: 945.26), controlPoint1: CGPoint(x: 584.72, y: 938.01), controlPoint2: CGPoint(x: 587.95, y: 941.26)) bezier33Path.addLine(to: CGPoint(x: 587.95, y: 959.75)) bezier33Path.addCurve(to: CGPoint(x: 580.71, y: 967), controlPoint1: CGPoint(x: 587.95, y: 963.76), controlPoint2: CGPoint(x: 584.72, y: 967)) bezier33Path.close() bezier33Path.usesEvenOddFillRule = true dark.setFill() bezier33Path.fill() //// Bezier 34 Drawing let bezier34Path = UIBezierPath() bezier34Path.move(to: CGPoint(x: 609.69, y: 967)) bezier34Path.addCurve(to: CGPoint(x: 602.44, y: 959.75), controlPoint1: CGPoint(x: 605.69, y: 967), controlPoint2: CGPoint(x: 602.44, y: 963.76)) bezier34Path.addLine(to: CGPoint(x: 602.44, y: 945.26)) bezier34Path.addCurve(to: CGPoint(x: 609.69, y: 938.01), controlPoint1: CGPoint(x: 602.44, y: 941.26), controlPoint2: CGPoint(x: 605.69, y: 938.01)) bezier34Path.addCurve(to: CGPoint(x: 616.93, y: 945.26), controlPoint1: CGPoint(x: 613.69, y: 938.01), controlPoint2: CGPoint(x: 616.93, y: 941.26)) bezier34Path.addLine(to: CGPoint(x: 616.93, y: 959.75)) bezier34Path.addCurve(to: CGPoint(x: 609.69, y: 967), controlPoint1: CGPoint(x: 616.94, y: 963.76), controlPoint2: CGPoint(x: 613.69, y: 967)) bezier34Path.close() bezier34Path.usesEvenOddFillRule = true dark.setFill() bezier34Path.fill() //// Bezier 35 Drawing let bezier35Path = UIBezierPath() bezier35Path.move(to: CGPoint(x: 638.67, y: 967)) bezier35Path.addCurve(to: CGPoint(x: 631.43, y: 959.75), controlPoint1: CGPoint(x: 634.67, y: 967), controlPoint2: CGPoint(x: 631.43, y: 963.76)) bezier35Path.addLine(to: CGPoint(x: 631.43, y: 945.26)) bezier35Path.addCurve(to: CGPoint(x: 638.67, y: 938.01), controlPoint1: CGPoint(x: 631.43, y: 941.26), controlPoint2: CGPoint(x: 634.67, y: 938.01)) bezier35Path.addCurve(to: CGPoint(x: 645.92, y: 945.26), controlPoint1: CGPoint(x: 642.68, y: 938.01), controlPoint2: CGPoint(x: 645.92, y: 941.26)) bezier35Path.addLine(to: CGPoint(x: 645.92, y: 959.75)) bezier35Path.addCurve(to: CGPoint(x: 638.67, y: 967), controlPoint1: CGPoint(x: 645.92, y: 963.76), controlPoint2: CGPoint(x: 642.68, y: 967)) bezier35Path.close() bezier35Path.usesEvenOddFillRule = true dark.setFill() bezier35Path.fill() //// Bezier 36 Drawing let bezier36Path = UIBezierPath() bezier36Path.move(to: CGPoint(x: 667.65, y: 967)) bezier36Path.addCurve(to: CGPoint(x: 660.41, y: 959.75), controlPoint1: CGPoint(x: 663.65, y: 967), controlPoint2: CGPoint(x: 660.41, y: 963.76)) bezier36Path.addLine(to: CGPoint(x: 660.41, y: 945.26)) bezier36Path.addCurve(to: CGPoint(x: 667.65, y: 938.01), controlPoint1: CGPoint(x: 660.41, y: 941.26), controlPoint2: CGPoint(x: 663.65, y: 938.01)) bezier36Path.addCurve(to: CGPoint(x: 674.9, y: 945.26), controlPoint1: CGPoint(x: 671.66, y: 938.01), controlPoint2: CGPoint(x: 674.9, y: 941.26)) bezier36Path.addLine(to: CGPoint(x: 674.9, y: 959.75)) bezier36Path.addCurve(to: CGPoint(x: 667.65, y: 967), controlPoint1: CGPoint(x: 674.9, y: 963.76), controlPoint2: CGPoint(x: 671.66, y: 967)) bezier36Path.close() bezier36Path.usesEvenOddFillRule = true dark.setFill() bezier36Path.fill() //// Bezier 37 Drawing let bezier37Path = UIBezierPath() bezier37Path.move(to: CGPoint(x: 696.63, y: 967)) bezier37Path.addCurve(to: CGPoint(x: 689.39, y: 959.75), controlPoint1: CGPoint(x: 692.63, y: 967), controlPoint2: CGPoint(x: 689.39, y: 963.76)) bezier37Path.addLine(to: CGPoint(x: 689.39, y: 945.26)) bezier37Path.addCurve(to: CGPoint(x: 696.63, y: 938.01), controlPoint1: CGPoint(x: 689.39, y: 941.26), controlPoint2: CGPoint(x: 692.63, y: 938.01)) bezier37Path.addCurve(to: CGPoint(x: 703.88, y: 945.26), controlPoint1: CGPoint(x: 700.64, y: 938.01), controlPoint2: CGPoint(x: 703.88, y: 941.26)) bezier37Path.addLine(to: CGPoint(x: 703.88, y: 959.75)) bezier37Path.addCurve(to: CGPoint(x: 696.63, y: 967), controlPoint1: CGPoint(x: 703.88, y: 963.76), controlPoint2: CGPoint(x: 700.64, y: 967)) bezier37Path.close() bezier37Path.usesEvenOddFillRule = true dark.setFill() bezier37Path.fill() //// Bezier 38 Drawing let bezier38Path = UIBezierPath() bezier38Path.move(to: CGPoint(x: 725.61, y: 967)) bezier38Path.addCurve(to: CGPoint(x: 718.37, y: 959.75), controlPoint1: CGPoint(x: 721.61, y: 967), controlPoint2: CGPoint(x: 718.37, y: 963.76)) bezier38Path.addLine(to: CGPoint(x: 718.37, y: 945.26)) bezier38Path.addCurve(to: CGPoint(x: 725.61, y: 938.01), controlPoint1: CGPoint(x: 718.37, y: 941.26), controlPoint2: CGPoint(x: 721.61, y: 938.01)) bezier38Path.addCurve(to: CGPoint(x: 732.86, y: 945.26), controlPoint1: CGPoint(x: 729.62, y: 938.01), controlPoint2: CGPoint(x: 732.86, y: 941.26)) bezier38Path.addLine(to: CGPoint(x: 732.86, y: 959.75)) bezier38Path.addCurve(to: CGPoint(x: 725.61, y: 967), controlPoint1: CGPoint(x: 732.86, y: 963.76), controlPoint2: CGPoint(x: 729.62, y: 967)) bezier38Path.close() bezier38Path.usesEvenOddFillRule = true dark.setFill() bezier38Path.fill() //// Bezier 39 Drawing let bezier39Path = UIBezierPath() bezier39Path.move(to: CGPoint(x: 754.59, y: 967)) bezier39Path.addCurve(to: CGPoint(x: 747.35, y: 959.75), controlPoint1: CGPoint(x: 750.59, y: 967), controlPoint2: CGPoint(x: 747.35, y: 963.76)) bezier39Path.addLine(to: CGPoint(x: 747.35, y: 945.26)) bezier39Path.addCurve(to: CGPoint(x: 754.59, y: 938.01), controlPoint1: CGPoint(x: 747.35, y: 941.26), controlPoint2: CGPoint(x: 750.59, y: 938.01)) bezier39Path.addCurve(to: CGPoint(x: 761.84, y: 945.26), controlPoint1: CGPoint(x: 758.6, y: 938.01), controlPoint2: CGPoint(x: 761.84, y: 941.26)) bezier39Path.addLine(to: CGPoint(x: 761.84, y: 959.75)) bezier39Path.addCurve(to: CGPoint(x: 754.59, y: 967), controlPoint1: CGPoint(x: 761.84, y: 963.76), controlPoint2: CGPoint(x: 758.6, y: 967)) bezier39Path.close() bezier39Path.usesEvenOddFillRule = true dark.setFill() bezier39Path.fill() //// Bezier 40 Drawing let bezier40Path = UIBezierPath() bezier40Path.move(to: CGPoint(x: 783.58, y: 967)) bezier40Path.addCurve(to: CGPoint(x: 776.33, y: 959.75), controlPoint1: CGPoint(x: 779.57, y: 967), controlPoint2: CGPoint(x: 776.33, y: 963.76)) bezier40Path.addLine(to: CGPoint(x: 776.33, y: 945.26)) bezier40Path.addCurve(to: CGPoint(x: 783.58, y: 938.01), controlPoint1: CGPoint(x: 776.33, y: 941.26), controlPoint2: CGPoint(x: 779.57, y: 938.01)) bezier40Path.addCurve(to: CGPoint(x: 790.82, y: 945.26), controlPoint1: CGPoint(x: 787.58, y: 938.01), controlPoint2: CGPoint(x: 790.82, y: 941.26)) bezier40Path.addLine(to: CGPoint(x: 790.82, y: 959.75)) bezier40Path.addCurve(to: CGPoint(x: 783.58, y: 967), controlPoint1: CGPoint(x: 790.82, y: 963.76), controlPoint2: CGPoint(x: 787.58, y: 967)) bezier40Path.close() bezier40Path.usesEvenOddFillRule = true dark.setFill() bezier40Path.fill() //// Bezier 41 Drawing let bezier41Path = UIBezierPath() bezier41Path.move(to: CGPoint(x: 812.55, y: 967)) bezier41Path.addCurve(to: CGPoint(x: 805.31, y: 959.75), controlPoint1: CGPoint(x: 808.55, y: 967), controlPoint2: CGPoint(x: 805.31, y: 963.76)) bezier41Path.addLine(to: CGPoint(x: 805.31, y: 945.26)) bezier41Path.addCurve(to: CGPoint(x: 812.55, y: 938.01), controlPoint1: CGPoint(x: 805.31, y: 941.26), controlPoint2: CGPoint(x: 808.55, y: 938.01)) bezier41Path.addCurve(to: CGPoint(x: 819.8, y: 945.26), controlPoint1: CGPoint(x: 816.56, y: 938.01), controlPoint2: CGPoint(x: 819.8, y: 941.26)) bezier41Path.addLine(to: CGPoint(x: 819.8, y: 959.75)) bezier41Path.addCurve(to: CGPoint(x: 812.55, y: 967), controlPoint1: CGPoint(x: 819.8, y: 963.76), controlPoint2: CGPoint(x: 816.56, y: 967)) bezier41Path.close() bezier41Path.usesEvenOddFillRule = true dark.setFill() bezier41Path.fill() context.restoreGState() } @objc(StyleKitNameResizingBehavior) public enum ResizingBehavior: Int { case aspectFit /// The content is proportionally resized to fit into the target rectangle. case aspectFill /// The content is proportionally resized to completely fill the target rectangle. case stretch /// The content is stretched to match the entire target rectangle. case center /// The content is centered in the target rectangle, but it is NOT resized. public func apply(rect: CGRect, target: CGRect) -> CGRect { if rect == target || target == CGRect.zero { return rect } var scales = CGSize.zero scales.width = abs(target.width / rect.width) scales.height = abs(target.height / rect.height) switch self { case .aspectFit: scales.width = min(scales.width, scales.height) scales.height = scales.width case .aspectFill: scales.width = max(scales.width, scales.height) scales.height = scales.width case .stretch: break case .center: scales.width = 1 scales.height = 1 } var result = rect.standardized result.size.width *= scales.width result.size.height *= scales.height result.origin.x = target.minX + (target.width - result.width) / 2 result.origin.y = target.minY + (target.height - result.height) / 2 return result } } } }
mit
6102f1ab53c36fa8e3e237c826a04a26
63.415393
486
0.639531
3.013186
false
false
false
false
yeziahehe/Gank
Pods/PKHUD/PKHUD/PKHUDSystemActivityIndicatorView.swift
2
1444
// // PKHUDSystemActivityIndicatorView.swift // PKHUD // // Created by Philip Kluz on 6/12/15. // Copyright (c) 2016 NSExceptional. All rights reserved. // Licensed under the MIT license. // import UIKit /// PKHUDSystemActivityIndicatorView provides the system UIActivityIndicatorView as an alternative. public final class PKHUDSystemActivityIndicatorView: PKHUDSquareBaseView, PKHUDAnimating { public init() { super.init(frame: PKHUDSquareBaseView.defaultSquareBaseViewFrame) commonInit() } public override init(frame: CGRect) { super.init(frame: frame) commonInit() } public required init?(coder aDecoder: NSCoder) { super.init(coder: aDecoder) commonInit() } func commonInit () { backgroundColor = UIColor.clear alpha = 0.8 self.addSubview(activityIndicatorView) } public override func layoutSubviews() { super.layoutSubviews() activityIndicatorView.center = self.center } let activityIndicatorView: UIActivityIndicatorView = { #if swift(>=4.2) let activity = UIActivityIndicatorView(style: .whiteLarge) #else let activity = UIActivityIndicatorView(activityIndicatorStyle: .whiteLarge) #endif activity.color = UIColor.black return activity }() public func startAnimation() { activityIndicatorView.startAnimating() } }
gpl-3.0
3665ad9e05f082dbc4bba123bd5f743f
25.254545
99
0.673823
5.102473
false
false
false
false
ymsheng/ReachabilitySwift
ReachabilitySwift/MNReachability/Ping/PingHelper.swift
1
2785
// // PingHelper.swift // ReachabilitySwift // // Created by mosn on 2/25/16. // Copyright © 2016 com.*. All rights reserved. // import Foundation let kPingResultNotification = "kPingResultNotification" public typealias comBlock = (Bool) -> Void open class PingHelper : PingFoundationDelegate { static let shareInstance = PingHelper() var completionBlock:comBlock? var pingFoundation:PingFoundation? var isPinging:Bool = false open func pingWithBlock(_ completion:@escaping comBlock) { if self.isPinging == false { self.completionBlock = completion self.pingFoundation!.stop() weak var weakSelf = self as PingHelper DispatchQueue.main.async(execute: { () -> Void in weakSelf?.isPinging = true weakSelf?.pingFoundation!.start() let popTime = DispatchTime.now() + Double(Int64(2 * Double(NSEC_PER_SEC))) / Double(NSEC_PER_SEC) DispatchQueue.main.asyncAfter(deadline: popTime, execute: { () -> Void in weakSelf?.endWithFlag(false) }) }) } } func setHost(_ host:String) { self.pingFoundation = PingFoundation.pingFoundationWithHostName(host) self.pingFoundation!.delegate = self } func endWithFlag(_ isSuccess:Bool) { // if self.isPinging == false { // return // } self.isPinging = false self.pingFoundation?.stop() if self.completionBlock != nil { self.completionBlock!(isSuccess) } self.completionBlock = nil DispatchQueue.main.async { () -> Void in NotificationCenter.default.post(name: Notification.Name(rawValue: kPingResultNotification), object: NSNumber(value: isSuccess as Bool)) } } //MARK: - pingfoundation delegate @objc open func pingFoundationDidStartWithAddress(_ pinger:PingFoundation, address:Data) { } @objc open func pingFoundationDidFailWithError(_ pinger:PingFoundation, error:NSError) { self.endWithFlag(false) } @objc open func pingFoundationDidSendPacket(_ pinger:PingFoundation, packet:Data) { } @objc open func pingFoundationDidFailToSendPacketWithError(_ pinger:PingFoundation, packet:Data, error:NSError) { self.endWithFlag(false) } @objc open func pingFoundationDidReceivePingResponsePacket(_ pinger:PingFoundation, packet:Data) { self.endWithFlag(true) } @objc open func pingFoundationDidReceiveUnexpectedPacket(_ ping:PingFoundation, packet:Data) { } deinit { self.completionBlock = nil } }
mit
bfcc8c13948ced584e4e6edea48d69f2
30.280899
147
0.62033
4.601653
false
false
false
false
mckaskle/FlintKit
FlintKit/Security/Keychain.swift
1
20397
// // MIT License // // Keychain.swift // // Copyright (c) 2016 Devin McKaskle // // Modified from https://github.com/jrendel/SwiftKeychainWrapper // Copyright © 2016 Jason Rendel. All rights reserved. // // The MIT License (MIT) // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in all // copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. import Foundation import Security private let SecAttrAccessGroup = kSecAttrAccessGroup as String private let SecAttrAccessible = kSecAttrAccessible as String private let SecAttrAccount = kSecAttrAccount as String private let SecAttrGeneric = kSecAttrGeneric as String private let SecAttrService = kSecAttrService as String private let SecClass = kSecClass as String private let SecMatchLimit = kSecMatchLimit as String private let SecReturnData = kSecReturnData as String private let SecValueData = kSecValueData as String final public class Keychain { // MARK: - Enum public enum Accessibility { /** The data in the keychain item cannot be accessed after a restart until the device has been unlocked once by the user. After the first unlock, the data remains accessible until the next restart. This is recommended for items that need to be accessed by background applications. Items with this attribute migrate to a new device when using encrypted backups. */ @available(iOS 4, *) case afterFirstUnlock /** The data in the keychain item cannot be accessed after a restart until the device has been unlocked once by the user. After the first unlock, the data remains accessible until the next restart. This is recommended for items that need to be accessed by background applications. Items with this attribute do not migrate to a new device. Thus, after restoring from a backup of a different device, these items will not be present. */ @available(iOS 4, *) case afterFirstUnlockThisDeviceOnly /** The data in the keychain item can always be accessed regardless of whether the device is locked. This is not recommended for application use. Items with this attribute migrate to a new device when using encrypted backups. */ @available(iOS 4, *) case always /** The data in the keychain can only be accessed when the device is unlocked. Only available if a passcode is set on the device. This is recommended for items that only need to be accessible while the application is in the foreground. Items with this attribute never migrate to a new device. After a backup is restored to a new device, these items are missing. No items can be stored in this class on devices without a passcode. Disabling the device passcode causes all items in this class to be deleted. */ @available(iOS 8, *) case whenPasscodeSetThisDeviceOnly /** The data in the keychain item can always be accessed regardless of whether the device is locked. This is not recommended for application use. Items with this attribute do not migrate to a new device. Thus, after restoring from a backup of a different device, these items will not be present. */ @available(iOS 4, *) case alwaysThisDeviceOnly /** The data in the keychain item can be accessed only while the device is unlocked by the user. This is recommended for items that need to be accessible only while the application is in the foreground. Items with this attribute migrate to a new device when using encrypted backups. This is the default value for keychain items added without explicitly setting an accessibility constant. */ @available(iOS 4, *) case whenUnlocked /** The data in the keychain item can be accessed only while the device is unlocked by the user. This is recommended for items that need to be accessible only while the application is in the foreground. Items with this attribute do not migrate to a new device. Thus, after restoring from a backup of a different device, these items will not be present. */ @available(iOS 4, *) case whenUnlockedThisDeviceOnly fileprivate var keychainAttrValue: CFString { switch self { case .afterFirstUnlock: return kSecAttrAccessibleAfterFirstUnlock case .afterFirstUnlockThisDeviceOnly: return kSecAttrAccessibleAfterFirstUnlockThisDeviceOnly case .always: return kSecAttrAccessibleAlways case .whenPasscodeSetThisDeviceOnly: return kSecAttrAccessibleWhenPasscodeSetThisDeviceOnly case .alwaysThisDeviceOnly : return kSecAttrAccessibleAlwaysThisDeviceOnly case .whenUnlocked: return kSecAttrAccessibleWhenUnlocked case .whenUnlockedThisDeviceOnly: return kSecAttrAccessibleWhenUnlockedThisDeviceOnly } } } public enum Error: Swift.Error { case didNotReceiveItemAsData case couldNotDecodeObject case couldNotDecodeString case couldNotEncodeString case couldNotEncodeKey case couldNotCreateKeychainItem(OSStatus) case couldNotDeleteKeychainItem(OSStatus) case couldNotDeleteKeychainService(OSStatus) case couldNotUpdateKeychainItem(OSStatus) } // MARK: - Object Lifecycle /// Create a custom instance of Keychain with a custom Service Name and optional /// custom access group. /// /// - parameter serviceName: The ServiceName for this instance. Used to uniquely /// identify all keys stored using this keychain wrapper instance. /// - parameter accessGroup: Optional unique AccessGroup for this instance. Use a /// matching AccessGroup between applications to allow shared keychain access. public init(serviceName: String, accessGroup: String? = nil, defaultAccessibility: Accessibility = .whenUnlocked) { self.serviceName = serviceName self.accessGroup = accessGroup self.defaultAccessibility = defaultAccessibility } // MARK: - Public Methods // MARK: Getters /// Returns an Int value for a specified key. /// /// - parameter forKey: The key to lookup data for. /// - parameter accessibility: Optional accessibility to use when retrieving /// the keychain item. /// - returns: The Int associated with the key if it exists. If no data /// exists, returns nil. /// - throws: If the Int data cannot be decoded, an error is thrown. public func integer(forKey key: String, accessibility: Accessibility? = nil) throws -> Int? { return try number(forKey: key, accessibility: accessibility)?.intValue } /// Returns an Float value for a specified key. /// /// - parameter forKey: The key to lookup data for. /// - parameter accessibility: Optional accessibility to use when retrieving /// the keychain item. /// - returns: The Float associated with the key if it exists. If no data /// exists, returns nil. /// - throws: If the Float data cannot be decoded, an error is thrown. public func float(forKey key: String, accessibility: Accessibility? = nil) throws -> Float? { return try number(forKey: key, accessibility: accessibility)?.floatValue } /// Returns an Double value for a specified key. /// /// - parameter forKey: The key to lookup data for. /// - parameter accessibility: Optional accessibility to use when retrieving /// the keychain item. /// - returns: The Double associated with the key if it exists. If no data /// exists, returns nil. /// - throws: If the Double data cannot be decoded, an error is thrown. public func double(forKey key: String, accessibility: Accessibility? = nil) throws -> Double? { return try number(forKey: key, accessibility: accessibility)?.doubleValue } /// Returns an Bool value for a specified key. /// /// - parameter forKey: The key to lookup data for. /// - parameter accessibility: Optional accessibility to use when retrieving /// the keychain item. /// - returns: The Bool associated with the key if it exists. If no data /// exists, returns nil. /// - throws: If the Bool data cannot be decoded, an error is thrown. public func bool(forKey key: String, accessibility: Accessibility? = nil) throws -> Bool? { return try number(forKey: key, accessibility: accessibility)?.boolValue } /// Returns a string value for a specified key. /// /// - parameter forKey: The key to lookup data for. /// - parameter accessibility: Optional accessibility to use when retrieving /// the keychain item. /// - returns: The String associated with the key if it exists. If no data /// exists, returns nil. /// - throws: If the string data cannot be decoded, an error is thrown. public func string(forKey key: String, accessibility: Accessibility? = nil) throws -> String? { guard let data = try self.data(forKey: key, accessibility: accessibility) else { return nil } guard let string = String(data: data, encoding: .utf8) else { throw Error.couldNotDecodeString } return string } /// Returns an object that conforms to NSCoding for a specified key. /// /// - parameter forKey: The key to lookup data for. /// - parameter accessibility: Optional accessibility to use when retrieving /// the keychain item. /// - returns: The decoded object associated with the key if it exists. If no /// data exists, returns nil. /// - throws: If the data cannot be decoded, an error is thrown. public func object<T: NSCoding>(forKey key: String, accessibility: Accessibility? = nil) throws -> T? { guard let data = try self.data(forKey: key, accessibility: accessibility) else { return nil } guard let object = NSKeyedUnarchiver.unarchiveObject(with: data) as? T else { throw Error.couldNotDecodeObject } return object } /// Returns a Data object for a specified key. /// /// - parameter forKey: The key to lookup data for. /// - parameter accessibility: Optional accessibility to use when retrieving /// the keychain item. /// - returns: The Data object associated with the key if it exists. If no /// data exists, returns nil. /// - throws: If the result of the keychain query is anything other than a /// Data object, an error is thrown. public func data(forKey key: String, accessibility: Accessibility? = nil) throws -> Data? { var dictionary = try queryDictionary(forKey: key, accessibility: accessibility) var result: AnyObject? // Limit search results to one dictionary[SecMatchLimit] = kSecMatchLimitOne // Specify we want Data/CFData returned dictionary[SecReturnData] = kCFBooleanTrue // Search let status = withUnsafeMutablePointer(to: &result) { SecItemCopyMatching(dictionary as CFDictionary, UnsafeMutablePointer($0)) } guard status != errSecItemNotFound else { return nil } guard let data = result as? Data else { throw Error.didNotReceiveItemAsData } return data } // MARK: Setters public func set(_ value: Int, forKey key: String, accessibility: Accessibility? = nil) throws { try set(NSNumber(value: value), forKey: key, accessibility: accessibility) } public func set(_ value: Float, forKey key: String, accessibility: Accessibility? = nil) throws { try set(NSNumber(value: value), forKey: key, accessibility: accessibility) } public func set(_ value: Double, forKey key: String, accessibility: Accessibility? = nil) throws { try set(NSNumber(value: value), forKey: key, accessibility: accessibility) } public func set(_ value: Bool, forKey key: String, accessibility: Accessibility? = nil) throws { try set(NSNumber(value: value), forKey: key, accessibility: accessibility) } /// Save a String value to the keychain associated with a specified key. If a /// String value already exists for the given key, the string will be /// overwritten with the new value. /// /// - parameter value: The String value to save. /// - parameter forKey: The key to save the String under. /// - parameter accessibility: accessibility to use when setting the keychain /// item. /// - throws: Throws an error if the save failed. public func set(_ value: String, forKey key: String, accessibility: Accessibility? = nil) throws { guard let data = value.data(using: .utf8, allowLossyConversion: false) else { throw Error.couldNotEncodeString } try set(data, forKey: key, accessibility: accessibility) } /// Save an NSCoding compliant object to the keychain associated with a /// specified key. If an object already exists for the given key, the object /// will be overwritten with the new value. /// /// - parameter value: The NSCoding compliant object to save. /// - parameter forKey: The key to save the object under. /// - parameter accessibility: accessibility to use when setting the keychain /// item. /// - throws: Throws an error if the save failed. public func set(_ value: NSCoding, forKey key: String, accessibility: Accessibility? = nil) throws { let data = NSKeyedArchiver.archivedData(withRootObject: value) try set(data, forKey: key, accessibility: accessibility) } /// Save a Data object to the keychain associated with a specified key. If data /// already exists for the given key, the data will be overwritten with the new /// value. /// /// - parameter value: The Data object to save. /// - parameter forKey: The key to save the object under. /// - parameter accessibility: accessibility to use when setting the keychain /// item. /// - throws: Throws an error if the save failed. public func set(_ value: Data, forKey key: String, accessibility givenAccessibility: Accessibility? = nil) throws { let accessibility = givenAccessibility ?? defaultAccessibility var dictionary = try queryDictionary(forKey: key, accessibility: accessibility) dictionary[SecValueData] = value dictionary[SecAttrAccessible] = accessibility.keychainAttrValue let status = SecItemAdd(dictionary as CFDictionary, nil) if status == errSecDuplicateItem { try update(value, forKey: key, accessibility: accessibility) return } guard status == errSecSuccess else { throw Error.couldNotCreateKeychainItem(status) } } /// Remove an object associated with a specified key. If re-using a key but /// with a different accessibility, first remove the previous key value using /// removeObject(forKey:accessibility:) using the same accessibilty it was /// saved with. /// /// - parameter forKey: The key value to remove data for. /// - parameter accessibility: accessibility level to use when /// looking up the keychain item. /// - throws: Throws an error if the item could not be deleted. public func removeItem(forKey key: String, accessibility givenAccessibility: Accessibility? = nil) throws { let accessibility = givenAccessibility ?? defaultAccessibility let dictionary = try queryDictionary(forKey: key, accessibility: accessibility) // Delete let status = SecItemDelete(dictionary as CFDictionary) guard status == errSecSuccess else { throw Error.couldNotDeleteKeychainItem(status) } } /// Remove all keychain data added through Keychain. This will only delete /// items matching the currnt ServiceName and AccessGroup if one is set. /// /// - throws: Throws an error if the keychain service couldn't be deleted. public func removeAll() throws { // Setup dictionary to access keychain and specify we are using a generic // password (rather than a certificate, internet password, etc) var dictionary: [String: Any] = [SecClass: kSecClassGenericPassword] // Uniquely identify this keychain accessor dictionary[SecAttrService] = serviceName // Set the keychain access group if defined if let accessGroup = accessGroup { dictionary[SecAttrAccessGroup] = accessGroup } let status = SecItemDelete(dictionary as CFDictionary) let validStatuses: Set<OSStatus> = [errSecSuccess, errSecItemNotFound] guard validStatuses.contains(status) else { throw Error.couldNotDeleteKeychainService(status) } } // MARK: - Private Properties /// ServiceName is used for the kSecAttrService property to uniquely identify /// this keychain accessor. private let serviceName: String /// AccessGroup is used for the kSecAttrAccessGroup property to identify which /// Keychain Access Group this entry belongs to. This allows you to use the /// KeychainWrapper with shared keychain access between different applications. private let accessGroup: String? /// This is the accessibility that is used when setting or deleting a value if none is specified. private let defaultAccessibility: Accessibility // MARK: - Private Methods /// Setup the keychain query dictionary used to access the keychain on iOS for /// a specified key name. Takes into account the Service Name and Access Group /// if one is set. /// /// - parameter forKey: The key this query is for /// - parameter accessibility: Optional accessibility to use when setting the /// keychain item. If none is provided, will default to .WhenUnlocked /// - returns: A dictionary with all the needed properties setup to access the /// keychain on iOS /// - throws: Throws an error when the key could not be encoded. private func queryDictionary(forKey key: String, accessibility: Accessibility?) throws -> [String: Any] { // Setup default access as generic password (rather than a certificate, // internet password, etc). var dictionary: [String: Any] = [SecClass: kSecClassGenericPassword] // Uniquely identify this keychain accessor. dictionary[SecAttrService] = serviceName // Only set accessibiilty if its passed in, we don't want to default it // here in case the user didn't want it set. if let accessibility = accessibility { dictionary[SecAttrAccessible] = accessibility.keychainAttrValue } // Set the keychain access group, if defined. if let accessGroup = accessGroup { dictionary[SecAttrAccessGroup] = accessGroup } // Uniquely identify the account who will be accessing the keychain guard let encodedIdentifier = key.data(using: .utf8) else { throw Error.couldNotEncodeKey } dictionary[SecAttrGeneric] = encodedIdentifier dictionary[SecAttrAccount] = encodedIdentifier return dictionary } /// Update existing data associated with a specified key name. The existing /// data will be overwritten by the new data. private func update(_ value: Data, forKey key: String, accessibility: Accessibility?) throws { let queryDictionary = try self.queryDictionary(forKey: key, accessibility: accessibility) let updateDictionary = [SecValueData: value] // Update let status = SecItemUpdate(queryDictionary as CFDictionary, updateDictionary as CFDictionary) guard status == errSecSuccess else { throw Error.couldNotUpdateKeychainItem(status) } } private func number(forKey key: String, accessibility: Accessibility?) throws -> NSNumber? { return try self.object(forKey: key, accessibility: accessibility) } }
mit
ab60d8aa63990e7c7a2a8c1179c4b9e4
42.120507
117
0.71514
4.951687
false
false
false
false
mbuchetics/RealmDataSource
Carthage/Checkouts/realm-cocoa/RealmSwift-swift2.0/Tests/RealmTests.swift
1
24489
//////////////////////////////////////////////////////////////////////////// // // Copyright 2015 Realm Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // //////////////////////////////////////////////////////////////////////////// import XCTest import RealmSwift import Foundation class RealmTests: TestCase { override func setUp() { super.setUp() autoreleasepool { try! self.realmWithTestPath().write { self.realmWithTestPath().create(SwiftStringObject.self, value: ["1"]) self.realmWithTestPath().create(SwiftStringObject.self, value: ["2"]) self.realmWithTestPath().create(SwiftStringObject.self, value: ["3"]) } try! Realm().write { try! Realm().create(SwiftIntObject.self, value: [100]) try! Realm().create(SwiftIntObject.self, value: [200]) try! Realm().create(SwiftIntObject.self, value: [300]) } } } func testPath() { XCTAssertEqual(Realm.defaultPath, try! Realm().path) XCTAssertEqual(testRealmPath(), realmWithTestPath().path) } func testReadOnly() { autoreleasepool { XCTAssertEqual(try! Realm().readOnly, false) } let readOnlyRealm = try! Realm(path: Realm.defaultPath, readOnly: true) XCTAssertEqual(true, readOnlyRealm.readOnly) XCTAssertEqual(3, readOnlyRealm.objects(SwiftIntObject).count) assertThrows(try! Realm(), "Realm has different readOnly settings") } func testSchema() { let schema = try! Realm().schema XCTAssert(schema as AnyObject is Schema) XCTAssertEqual(1, schema.objectSchema.filter({ $0.className == "SwiftStringObject" }).count) } func testIsEmpty() { try! NSFileManager.defaultManager().removeItemAtPath(Realm.defaultPath) let realm = try! Realm() XCTAssert(realm.isEmpty, "Realm should be empty on creation.") realm.beginWrite() realm.create(SwiftStringObject.self, value: ["a"]) XCTAssertFalse(realm.isEmpty, "Realm should not be empty within a write transaction after adding an object.") realm.cancelWrite() XCTAssertTrue(realm.isEmpty, "Realm should be empty after canceling a write transaction that added an object.") realm.beginWrite() realm.create(SwiftStringObject.self, value: ["a"]) try! realm.commitWrite() XCTAssertFalse(realm.isEmpty, "Realm should not be empty after committing a write transaction that added an object.") } func testDefaultPath() { let defaultPath = try! Realm().path XCTAssertEqual(Realm.defaultPath, defaultPath) let newPath = (defaultPath as NSString).stringByAppendingPathExtension("new")! Realm.defaultPath = newPath XCTAssertEqual(Realm.defaultPath, newPath) XCTAssertEqual(try! Realm().path, Realm.defaultPath) } func testInit() { XCTAssertEqual(try! Realm().path, Realm.defaultPath) XCTAssertEqual(try! Realm(path: testRealmPath()).path, testRealmPath()) assertThrows(try! Realm(path: "")) } func testInitFailable() { autoreleasepool { try! Realm(path: Realm.defaultPath, readOnly: false) } NSFileManager.defaultManager().createFileAtPath(Realm.defaultPath, contents:"a".dataUsingEncoding(NSUTF8StringEncoding, allowLossyConversion: false), attributes: nil) do { _ = try Realm(path: Realm.defaultPath, readOnly: false) XCTFail("Realm creation should have failed") } catch { } assertThrows(try! Realm(path: Realm.defaultPath, readOnly: false, encryptionKey: "asdf".dataUsingEncoding(NSUTF8StringEncoding, allowLossyConversion: false))) assertThrows(try! Realm(path: "", readOnly: false)) } func testInitInMemory() { autoreleasepool { let realm = inMemoryRealm("identifier") try! realm.write { realm.create(SwiftIntObject.self, value: [1]) return } } let realm = inMemoryRealm("identifier") XCTAssertEqual(realm.objects(SwiftIntObject).count, 0) try! realm.write { realm.create(SwiftIntObject.self, value: [1]) XCTAssertEqual(realm.objects(SwiftIntObject).count, 1) inMemoryRealm("identifier").create(SwiftIntObject.self, value: [1]) XCTAssertEqual(realm.objects(SwiftIntObject).count, 2) } let realm2 = inMemoryRealm("identifier2") XCTAssertEqual(realm2.objects(SwiftIntObject).count, 0) } func testInitCustomClassList() { let configuration = Realm.Configuration(path: Realm.Configuration.defaultConfiguration.path, objectTypes: [SwiftStringObject.self]) XCTAssert(configuration.objectTypes! is [SwiftStringObject.Type]) let realm = try! Realm(configuration: configuration) XCTAssertEqual(["SwiftStringObject"], realm.schema.objectSchema.map { $0.className }) } func testWrite() { try! Realm().write { self.assertThrows(try! Realm().beginWrite()) self.assertThrows(try! Realm().write { }) try! Realm().create(SwiftStringObject.self, value: ["1"]) XCTAssertEqual(try! Realm().objects(SwiftStringObject).count, 1) } XCTAssertEqual(try! Realm().objects(SwiftStringObject).count, 1) } func testDynamicWrite() { try! Realm().write { self.assertThrows(try! Realm().beginWrite()) self.assertThrows(try! Realm().write { }) try! Realm().dynamicCreate("SwiftStringObject", value: ["1"]) XCTAssertEqual(try! Realm().objects(SwiftStringObject).count, 1) } XCTAssertEqual(try! Realm().objects(SwiftStringObject).count, 1) } func testDynamicWriteSubscripting() { try! Realm().beginWrite() let object = try! Realm().dynamicCreate("SwiftStringObject", value: ["1"]) try! Realm().commitWrite() XCTAssertNotNil(object,"Dynamic Object Creation Failed") let stringVal = object["stringCol"] as! String XCTAssertEqual(stringVal, "1", "Object Subscripting Failed") } func testBeginWrite() { try! Realm().beginWrite() assertThrows(try! Realm().beginWrite()) try! Realm().cancelWrite() try! Realm().beginWrite() try! Realm().create(SwiftStringObject.self, value: ["1"]) XCTAssertEqual(try! Realm().objects(SwiftStringObject).count, 1) } func testCommitWrite() { try! Realm().beginWrite() try! Realm().create(SwiftStringObject.self, value: ["1"]) try! Realm().commitWrite() XCTAssertEqual(try! Realm().objects(SwiftStringObject).count, 1) try! Realm().beginWrite() } func testCancelWrite() { assertThrows(try! Realm().cancelWrite()) try! Realm().beginWrite() try! Realm().create(SwiftStringObject.self, value: ["1"]) try! Realm().cancelWrite() XCTAssertEqual(try! Realm().objects(SwiftStringObject).count, 0) try! Realm().write { self.assertThrows(self.realmWithTestPath().cancelWrite()) let object = try! Realm().create(SwiftStringObject) try! Realm().cancelWrite() XCTAssertTrue(object.invalidated) XCTAssertEqual(try! Realm().objects(SwiftStringObject).count, 0) } XCTAssertEqual(try! Realm().objects(SwiftStringObject).count, 0) } func testInWriteTransaction() { let realm = try! Realm() XCTAssertFalse(realm.inWriteTransaction) realm.beginWrite() XCTAssertTrue(realm.inWriteTransaction) realm.cancelWrite() try! realm.write { XCTAssertTrue(realm.inWriteTransaction) realm.cancelWrite() XCTAssertFalse(realm.inWriteTransaction) } realm.beginWrite() realm.invalidate() XCTAssertFalse(realm.inWriteTransaction) } func testAddSingleObject() { let realm = try! Realm() assertThrows(_ = realm.add(SwiftObject())) XCTAssertEqual(0, realm.objects(SwiftObject).count) var defaultRealmObject: SwiftObject! try! realm.write { defaultRealmObject = SwiftObject() realm.add(defaultRealmObject) XCTAssertEqual(1, realm.objects(SwiftObject).count) realm.add(defaultRealmObject) XCTAssertEqual(1, realm.objects(SwiftObject).count) } XCTAssertEqual(1, realm.objects(SwiftObject).count) let testRealm = realmWithTestPath() try! testRealm.write { self.assertThrows(_ = testRealm.add(defaultRealmObject)) } } func testAddWithUpdateSingleObject() { let realm = try! Realm() XCTAssertEqual(0, realm.objects(SwiftPrimaryStringObject).count) var defaultRealmObject: SwiftPrimaryStringObject! try! realm.write { defaultRealmObject = SwiftPrimaryStringObject() realm.add(defaultRealmObject, update: true) XCTAssertEqual(1, realm.objects(SwiftPrimaryStringObject).count) realm.add(SwiftPrimaryStringObject(), update: true) XCTAssertEqual(1, realm.objects(SwiftPrimaryStringObject).count) } XCTAssertEqual(1, realm.objects(SwiftPrimaryStringObject).count) let testRealm = realmWithTestPath() try! testRealm.write { self.assertThrows(_ = testRealm.add(defaultRealmObject, update: true)) } } func testAddMultipleObjects() { let realm = try! Realm() assertThrows(_ = realm.add([SwiftObject(), SwiftObject()])) XCTAssertEqual(0, realm.objects(SwiftObject).count) try! realm.write { let objs = [SwiftObject(), SwiftObject()] realm.add(objs) XCTAssertEqual(2, realm.objects(SwiftObject).count) } XCTAssertEqual(2, realm.objects(SwiftObject).count) let testRealm = realmWithTestPath() try! testRealm.write { self.assertThrows(_ = testRealm.add(realm.objects(SwiftObject))) } } func testAddWithUpdateMultipleObjects() { let realm = try! Realm() XCTAssertEqual(0, realm.objects(SwiftPrimaryStringObject).count) try! realm.write { let objs = [SwiftPrimaryStringObject(), SwiftPrimaryStringObject()] realm.add(objs, update: true) XCTAssertEqual(1, realm.objects(SwiftPrimaryStringObject).count) } XCTAssertEqual(1, realm.objects(SwiftPrimaryStringObject).count) let testRealm = realmWithTestPath() try! testRealm.write { self.assertThrows(_ = testRealm.add(realm.objects(SwiftPrimaryStringObject), update: true)) } } // create() tests are in ObjectCreationTests.swift func testDeleteSingleObject() { let realm = try! Realm() XCTAssertEqual(0, realm.objects(SwiftObject).count) assertThrows(_ = realm.delete(SwiftObject())) var defaultRealmObject: SwiftObject! try! realm.write { defaultRealmObject = SwiftObject() self.assertThrows(_ = realm.delete(defaultRealmObject)) XCTAssertEqual(0, realm.objects(SwiftObject).count) realm.add(defaultRealmObject) XCTAssertEqual(1, realm.objects(SwiftObject).count) realm.delete(defaultRealmObject) XCTAssertEqual(0, realm.objects(SwiftObject).count) } assertThrows(_ = realm.delete(defaultRealmObject)) XCTAssertEqual(0, realm.objects(SwiftObject).count) let testRealm = realmWithTestPath() assertThrows(_ = testRealm.delete(defaultRealmObject)) try! testRealm.write { self.assertThrows(_ = testRealm.delete(defaultRealmObject)) } } func testDeleteSequenceOfObjects() { let realm = try! Realm() XCTAssertEqual(0, realm.objects(SwiftObject).count) var objs: [SwiftObject]! try! realm.write { objs = [SwiftObject(), SwiftObject()] realm.add(objs) XCTAssertEqual(2, realm.objects(SwiftObject).count) realm.delete(objs) XCTAssertEqual(0, realm.objects(SwiftObject).count) } XCTAssertEqual(0, realm.objects(SwiftObject).count) let testRealm = realmWithTestPath() assertThrows(_ = testRealm.delete(objs)) try! testRealm.write { self.assertThrows(_ = testRealm.delete(objs)) } } func testDeleteListOfObjects() { let realm = try! Realm() XCTAssertEqual(0, realm.objects(SwiftCompanyObject).count) try! realm.write { let obj = SwiftCompanyObject() obj.employees.append(SwiftEmployeeObject()) realm.add(obj) XCTAssertEqual(1, realm.objects(SwiftEmployeeObject).count) realm.delete(obj.employees) XCTAssertEqual(0, obj.employees.count) XCTAssertEqual(0, realm.objects(SwiftEmployeeObject).count) } XCTAssertEqual(0, realm.objects(SwiftEmployeeObject).count) } func testDeleteResults() { let realm = try! Realm(path: testRealmPath()) XCTAssertEqual(0, realm.objects(SwiftCompanyObject).count) try! realm.write { realm.add(SwiftIntObject(value: [1])) realm.add(SwiftIntObject(value: [1])) realm.add(SwiftIntObject(value: [2])) XCTAssertEqual(3, realm.objects(SwiftIntObject).count) realm.delete(realm.objects(SwiftIntObject).filter("intCol = 1")) XCTAssertEqual(1, realm.objects(SwiftIntObject).count) } XCTAssertEqual(1, realm.objects(SwiftIntObject).count) } func testDeleteAll() { let realm = try! Realm() try! realm.write { realm.add(SwiftObject()) XCTAssertEqual(1, realm.objects(SwiftObject).count) realm.deleteAll() XCTAssertEqual(0, realm.objects(SwiftObject).count) } XCTAssertEqual(0, realm.objects(SwiftObject).count) } func testObjects() { XCTAssertEqual(0, try! Realm().objects(SwiftStringObject).count) XCTAssertEqual(3, try! Realm().objects(SwiftIntObject).count) XCTAssertEqual(3, try! Realm().objects(SwiftIntObject).count) assertThrows(try! Realm().objects(Object)) } func testDynamicObjects() { XCTAssertEqual(0, try! Realm().dynamicObjects("SwiftStringObject").count) XCTAssertEqual(3, try! Realm().dynamicObjects("SwiftIntObject").count) XCTAssertEqual(3, try! Realm().dynamicObjects("SwiftIntObject").count) assertThrows(try! Realm().dynamicObjects("Object")) } func testDynamicObjectProperties() { try! Realm().write { try! Realm().create(SwiftObject) } let object = try! Realm().dynamicObjects("SwiftObject")[0] let dictionary = SwiftObject.defaultValues() XCTAssertEqual(object["boolCol"] as? NSNumber, dictionary["boolCol"] as! NSNumber?) XCTAssertEqual(object["intCol"] as? NSNumber, dictionary["intCol"] as! NSNumber?) XCTAssertEqual(object["floatCol"] as? NSNumber, dictionary["floatCol"] as! Float?) XCTAssertEqual(object["doubleCol"] as? NSNumber, dictionary["doubleCol"] as! Double?) XCTAssertEqual(object["stringCol"] as! String?, dictionary["stringCol"] as! String?) XCTAssertEqual(object["binaryCol"] as! NSData?, dictionary["binaryCol"] as! NSData?) XCTAssertEqual(object["dateCol"] as! NSDate?, dictionary["dateCol"] as! NSDate?) XCTAssertEqual(object["objectCol"]?.boolCol, false) } func testDynamicObjectOptionalProperties() { try! Realm().write { try! Realm().create(SwiftOptionalDefaultValuesObject) } let object = try! Realm().dynamicObjects("SwiftOptionalDefaultValuesObject")[0] let dictionary = SwiftOptionalDefaultValuesObject.defaultValues() XCTAssertEqual(object["optIntCol"] as? NSNumber, dictionary["optIntCol"] as! NSNumber?) XCTAssertEqual(object["optInt8Col"] as? NSNumber, dictionary["optInt8Col"] as! NSNumber?) XCTAssertEqual(object["optInt16Col"] as? NSNumber, dictionary["optInt16Col"] as! NSNumber?) XCTAssertEqual(object["optInt32Col"] as? NSNumber, dictionary["optInt32Col"] as! NSNumber?) XCTAssertEqual(object["optInt64Col"] as? NSNumber, dictionary["optInt64Col"] as! NSNumber?) XCTAssertEqual(object["optFloatCol"] as? NSNumber, dictionary["optFloatCol"] as! Float?) XCTAssertEqual(object["optDoubleCol"] as? NSNumber, dictionary["optDoubleCol"] as! Double?) XCTAssertEqual(object["optStringCol"] as! String?, dictionary["optStringCol"] as! String?) XCTAssertEqual(object["optNSStringCol"] as! String?, dictionary["optNSStringCol"] as! String?) XCTAssertEqual(object["optBinaryCol"] as! NSData?, dictionary["optBinaryCol"] as! NSData?) XCTAssertEqual(object["optDateCol"] as! NSDate?, dictionary["optDateCol"] as! NSDate?) XCTAssertEqual(object["optObjectCol"]?.boolCol, true) } func testObjectForPrimaryKey() { let realm = try! Realm() try! realm.write { realm.create(SwiftPrimaryStringObject.self, value: ["a", 1]) realm.create(SwiftPrimaryStringObject.self, value: ["b", 2]) } XCTAssertNotNil(realm.objectForPrimaryKey(SwiftPrimaryStringObject.self, key: "a")) // When this is directly inside the XCTAssertNil, it fails for some reason let missingObject = realm.objectForPrimaryKey(SwiftPrimaryStringObject.self, key: "z") XCTAssertNil(missingObject) } func testDynamicObjectForPrimaryKey() { let realm = try! Realm() try! realm.write { realm.create(SwiftPrimaryStringObject.self, value: ["a", 1]) realm.create(SwiftPrimaryStringObject.self, value: ["b", 2]) } XCTAssertNotNil(realm.dynamicObjectForPrimaryKey("SwiftPrimaryStringObject", key: "a")) XCTAssertNil(realm.dynamicObjectForPrimaryKey("SwiftPrimaryStringObject", key: "z")) } func testDynamicObjectForPrimaryKeySubscripting() { let realm = try! Realm() try! realm.write { realm.create(SwiftPrimaryStringObject.self, value: ["a", 1]) } let object = realm.dynamicObjectForPrimaryKey("SwiftPrimaryStringObject", key: "a") let stringVal = object!["stringCol"] as! String XCTAssertEqual(stringVal, "a", "Object Subscripting Failed!") } func testAddNotificationBlock() { let realm = try! Realm() var notificationCalled = false let token = realm.addNotificationBlock { _, realm in XCTAssertEqual(realm.path, Realm.defaultPath) notificationCalled = true } XCTAssertFalse(notificationCalled) try! realm.write {} XCTAssertTrue(notificationCalled) realm.removeNotification(token) } func testRemoveNotification() { let realm = try! Realm() var notificationCalled = false let token = realm.addNotificationBlock { (notification, realm) -> Void in XCTAssertEqual(realm.path, Realm.defaultPath) notificationCalled = true } realm.removeNotification(token) try! realm.write {} XCTAssertFalse(notificationCalled) } func testAutorefresh() { let realm = try! Realm() XCTAssertTrue(realm.autorefresh, "Autorefresh should default to true") realm.autorefresh = false XCTAssertFalse(realm.autorefresh) realm.autorefresh = true XCTAssertTrue(realm.autorefresh) // test that autoreresh is applied // we have two notifications, one for opening the realm, and a second when performing our transaction let notificationFired = expectationWithDescription("notification fired") let token = realm.addNotificationBlock { _, realm in XCTAssertNotNil(realm, "Realm should not be nil") notificationFired.fulfill() } dispatchSyncNewThread { let realm = try! Realm() try! realm.write { realm.create(SwiftStringObject.self, value: ["string"]) } } waitForExpectationsWithTimeout(1, handler: nil) realm.removeNotification(token) // get object let results = realm.objects(SwiftStringObject) XCTAssertEqual(results.count, Int(1), "There should be 1 object of type StringObject") XCTAssertEqual(results[0].stringCol, "string", "Value of first column should be 'string'") } func testRefresh() { let realm = try! Realm() realm.autorefresh = false // test that autoreresh is not applied // we have two notifications, one for opening the realm, and a second when performing our transaction let notificationFired = expectationWithDescription("notification fired") let token = realm.addNotificationBlock { _, realm in XCTAssertNotNil(realm, "Realm should not be nil") notificationFired.fulfill() } let results = realm.objects(SwiftStringObject) XCTAssertEqual(results.count, Int(0), "There should be 1 object of type StringObject") dispatchSyncNewThread { try! Realm().write { try! Realm().create(SwiftStringObject.self, value: ["string"]) return } } waitForExpectationsWithTimeout(1, handler: nil) realm.removeNotification(token) XCTAssertEqual(results.count, Int(0), "There should be 1 object of type StringObject") // refresh realm.refresh() XCTAssertEqual(results.count, Int(1), "There should be 1 object of type StringObject") XCTAssertEqual(results[0].stringCol, "string", "Value of first column should be 'string'") } func testInvalidate() { let realm = try! Realm() let object = SwiftObject() try! realm.write { realm.add(object) return } realm.invalidate() XCTAssertEqual(object.invalidated, true) try! realm.write { realm.add(SwiftObject()) return } XCTAssertEqual(realm.objects(SwiftObject).count, 2) XCTAssertEqual(object.invalidated, true) } func testWriteCopyToPath() { let realm = try! Realm() try! realm.write { realm.add(SwiftObject()) } let path = ((Realm.defaultPath as NSString).stringByDeletingLastPathComponent as NSString ).stringByAppendingPathComponent("copy.realm") do { try realm.writeCopyToPath(path) } catch { XCTFail("writeCopyToPath failed") } autoreleasepool { let copy = try! Realm(path: path) XCTAssertEqual(1, copy.objects(SwiftObject).count) } try! NSFileManager.defaultManager().removeItemAtPath(path) } func testSetEncryptionKey() { Realm.setEncryptionKey(NSMutableData(length: 64)) Realm.setEncryptionKey(nil, forPath: Realm.defaultPath) XCTAssert(true, "setting those keys should not throw") } func testEquals() { let realm = try! Realm() XCTAssertTrue(try! realm == Realm()) let testRealm = realmWithTestPath() XCTAssertFalse(realm == testRealm) dispatchSyncNewThread { let otherThreadRealm = try! Realm() XCTAssertFalse(realm == otherThreadRealm) } } }
mit
18a3b27d30585784824e65e21a6cb839
38.434783
166
0.633019
5.078598
false
true
false
false
woohyuknrg/GithubTrending
githubTests/DiscoverViewModelSpec.swift
1
3472
import Quick import Nimble import RxBlocking import RxSwift import RxCocoa import RxTest import Moya @testable import github class DiscoverViewModelSpec: QuickSpec { override func spec() { var sut: DiscoverViewModel! var scheduler: TestScheduler! var disposeBag: DisposeBag! beforeEach { scheduler = TestScheduler(initialClock: 0) SharingScheduler.mock(scheduler: scheduler) { sut = DiscoverViewModel(provider: MoyaProvider(stubClosure: MoyaProvider.immediatelyStub)) } disposeBag = DisposeBag() } afterEach { scheduler = nil sut = nil disposeBag = nil } it ("returns valid title") { expect(sut.title) == "Trending" } it("returns one repo when created") { let observer = scheduler.createObserver([RepoCellViewModel].self) scheduler.scheduleAt(100) { sut.results.drive(observer).disposed(by: disposeBag) } scheduler.start() let results = observer.events.first .map { event in event.value.element!.count } expect(results) == 1 } it("fetches repos when triggered refresh") { let observer = scheduler.createObserver([RepoCellViewModel].self) scheduler.scheduleAt(100) { sut.results.drive(observer).disposed(by: disposeBag) } scheduler.scheduleAt(200) { sut.triggerRefresh.onNext(()) } scheduler.start() let numberOfCalls = observer.events .map { event in event.value.element!.count } .reduce(0) { $0 + $1 } expect(numberOfCalls) == 2 } it("sends true when network request is executing and false when it finishes") { let observer = scheduler.createObserver(Bool.self) scheduler.scheduleAt(100) { sut.executing.drive(observer).disposed(by: disposeBag) sut.results.drive().disposed(by: disposeBag) } scheduler.start() let results = observer.events .map { event in event.value.element! } expect(results) == [false, true, false] } it("returns repository view model when item selected") { let observer = scheduler.createObserver(RepositoryViewModel.self) scheduler.scheduleAt(100) { sut.results.drive().disposed(by: disposeBag) } scheduler.scheduleAt(200) { sut.selectedViewModel.drive(observer).disposed(by: disposeBag) } scheduler.scheduleAt(300) { sut.selectedItem.onNext(IndexPath(row: 0, section: 0)) } scheduler.start() let result = observer.events.first .map { event in event.value.element! } expect(result).notTo(beNil()) } } }
mit
e1bf4cbb0beb81016a4c03fe69d27697
29.191304
106
0.494528
5.748344
false
false
false
false
AppLozic/Applozic-iOS-SDK
sample-with-framework/Applozic/Applozic/ALPhotoPicker.swift
1
5226
// // ALPhotoPicker.swift // Applozic // // Created by apple on 12/11/20. // Copyright © 2020 applozic Inc. All rights reserved. // import Foundation import PhotosUI @objc public class ALPhotoPicker: NSObject { @objc public weak var delegate: ALCustomPickerDelegate? private var selectionLimit: Int private var loadingTitle: String = "" private let multimediaData: ALMultimediaData = ALMultimediaData() @objc public init(selectionLimit: Int, loadingTitle: String) { self.selectionLimit = selectionLimit self.loadingTitle = loadingTitle super.init() } @available(iOS 14, *) @objc public func openGallery(from controller: UIViewController) { var configuration = PHPickerConfiguration() configuration.selectionLimit = selectionLimit var filter: PHPickerFilter? if ALApplozicSettings.imagesHiddenInGallery() { filter = .any(of: [.videos]) } else if ALApplozicSettings.videosHiddenInGallery() { filter = .any(of: [.images]) } else{ filter = .any(of: [.images, .videos]) } configuration.filter = filter let picker = PHPickerViewController(configuration: configuration) picker.delegate = self controller.present(picker, animated: true) } @available(iOS 14, *) private func export( results: [PHPickerResult], completion: @escaping (_ images: [UIImage], _ videos: [String], _ gif: [Data]) -> Void ) { var selectedImages: [UIImage] = [] var selectedVideosPath: [String] = [] var selectedGif: [Data] = [] let exportGroup = DispatchGroup() DispatchQueue.global(qos: .userInitiated).async { for result in results { exportGroup.enter() let provider = result.itemProvider if provider.hasItemConformingToTypeIdentifier(UTType.gif.identifier) { provider.loadDataRepresentation(forTypeIdentifier: UTType.gif.identifier) { (data, error) in if let error = error { print("Failed to export gif due to error: \(error)") } else if let data = data { selectedGif.append(data) } exportGroup.leave() } } else if provider.canLoadObject(ofClass: UIImage.self) { provider.loadObject(ofClass: UIImage.self) { image, error in if let error = error { print("Failed to export image due to error: \(error)") } else if let image = image as? UIImage { selectedImages.append(image) } exportGroup.leave() } } else { provider.loadFileRepresentation(forTypeIdentifier: UTType.movie.identifier) { url, error in if let error = error { print("Failed to export video due to error: \(error)") } else if let url = url, let newURL = ALUtilityClass.moveFileToDocuments(withFileURL: url) { selectedVideosPath.append(newURL.path) } exportGroup.leave() } } } exportGroup.wait() DispatchQueue.main.async { completion(selectedImages, selectedVideosPath, selectedGif) } } } private func selectedMultimediaList(images: [UIImage], videos: [String], gifs: [Data]) -> [ALMultimediaData] { var multimediaList = [ALMultimediaData]() for gifData in gifs { multimediaList.append(multimediaData.getOf(ALMultimediaTypeGif, with: UIImage.animatedImage(withAnimatedGIFData: gifData), withGif: gifData, withVideo: nil)) } for image in images { multimediaList.append(multimediaData.getOf(ALMultimediaTypeImage, with: image, withGif: nil, withVideo: nil)) } for video in videos { multimediaList.append(multimediaData.getOf(ALMultimediaTypeVideo, with: nil, withGif: nil, withVideo: video)) } return multimediaList } } @available(iOS 14, *) extension ALPhotoPicker: PHPickerViewControllerDelegate { public func picker(_ picker: PHPickerViewController, didFinishPicking results: [PHPickerResult]) { guard !results.isEmpty else { picker.dismiss(animated: true) return } let alertController = ALUIUtilityClass.displayLoadingAlertController(withText: loadingTitle); export(results: results) { images, videos, gifData in ALUIUtilityClass.dismiss(alertController) { (dismiss) in picker.dismiss(animated: true) self.delegate?.multimediaSelected(self.selectedMultimediaList(images: images, videos: videos, gifs: gifData)) } } } }
bsd-3-clause
bf232cb5c1e87d7618a18c0fb5b07b94
40.141732
134
0.570909
4.915334
false
false
false
false
franklinsch/usagi
iOS/usagi-iOS/usagi-iOS/LoginViewController.swift
1
2467
// // LoginViewController.swift // usagi-iOS // // Created by Franklin Schrans on 31/01/2016. // Copyright © 2016 Franklin Schrans. All rights reserved. // import UIKit class LoginViewController: UIViewController { @IBOutlet weak var welcomeLabel: UILabel! @IBOutlet weak var uptimalLogo: UILabel! @IBOutlet weak var descLabel: UILabel! @IBOutlet weak var loginButton: UIButton! override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the view. welcomeLabel.transform = CGAffineTransformMakeTranslation(0, -10) welcomeLabel.alpha = 0.0 UIView.animateWithDuration(0.6, delay: 0.2, options: .TransitionNone, animations: { self.welcomeLabel.transform = CGAffineTransformIdentity self.welcomeLabel.alpha = 1.0 }, completion: nil) uptimalLogo.transform = CGAffineTransformMakeScale(1.2, 1.2) uptimalLogo.alpha = 0.0 UIView.animateWithDuration(1.2, delay: 0.5, options: .TransitionNone, animations: { self.uptimalLogo.transform = CGAffineTransformIdentity self.uptimalLogo.alpha = 1.0 }, completion: nil) descLabel.transform = CGAffineTransformMakeTranslation(0, 0) descLabel.alpha = 0.0 UIView.animateWithDuration(0.6, delay: 1.5, options: .TransitionNone, animations: { self.descLabel.transform = CGAffineTransformIdentity self.descLabel.alpha = 1.0 }, completion: nil) loginButton.transform = CGAffineTransformMakeTranslation(0, 0) loginButton.alpha = 0.0 UIView.animateWithDuration(0.6, delay: 1.5, options: .TransitionNone, animations: { self.loginButton.transform = CGAffineTransformIdentity self.loginButton.alpha = 1.0 }, completion: nil) } override func didReceiveMemoryWarning() { super.didReceiveMemoryWarning() // Dispose of any resources that can be recreated. } /* // MARK: - Navigation // In a storyboard-based application, you will often want to do a little preparation before navigation override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) { // Get the new view controller using segue.destinationViewController. // Pass the selected object to the new view controller. } */ }
mit
6672897caa72ff16877958e15fbecb6e
33.25
106
0.654096
4.981818
false
false
false
false
eldesperado/SpareTimeAlarmApp
SpareTimeMusicApp/FancyTextField.swift
1
3878
// // FancyTextField.swift // SpareTimeAlarmApp // // Created by Pham Nguyen Nhat Trung on 8/13/15. // Copyright (c) 2015 Pham Nguyen Nhat Trung. All rights reserved. // import UIKit @IBDesignable class FancyTextField: NTTextField { // MARK: Public Properties override var placeholder: String? { didSet { update() } } @IBInspectable var inactiveFontSize: CGFloat = 14 { didSet { update() } } @IBInspectable var activeFontSize: CGFloat = 22 { didSet { update() } } @IBInspectable var inactiveColor: UIColor = UIColor(white: 1.0, alpha: 0.51) { didSet { update() } } @IBInspectable var activeColor: UIColor = UIColor.whiteColor() { didSet { update() } } override var bounds: CGRect { didSet { update() } } // MARK: Private Properties private let placeholderInsets = CGPoint(x: 0, y: 0) private let textFieldInsets = CGPoint(x: 0, y: 12) private var inactiveTextFieldStatus = (status: StatusType.Inactive, fontsize: CGFloat(0.0), color: UIColor.whiteColor()) private var activeTextFieldStatus = (StatusType.Active, fontsize: CGFloat(0.0), color: UIColor.whiteColor()) // MARK: Private Layout Functions private func updateLabels(status: TextFieldStatus) { if let aFont = font { font = aFont.fontWithSize(status.fontsize) } textColor = status.color } private func updatePlaceholder(status: TextFieldStatus) { placeholderLabel.text = placeholder if let aFont = font { font = aFont.fontWithSize(status.fontsize) } placeholderLabel.textColor = status.color placeholderLabel.sizeToFit() } private func update() { inactiveTextFieldStatus.color = inactiveColor inactiveTextFieldStatus.fontsize = inactiveFontSize activeTextFieldStatus.color = activeColor activeTextFieldStatus.fontsize = activeFontSize // Update Label & placeholder switch (isEdit) { case .Active: updateLabels(activeTextFieldStatus) updatePlaceholder(inactiveTextFieldStatus) case .Inactive: updateLabels(inactiveTextFieldStatus) updatePlaceholder(activeTextFieldStatus) } reloadInputViews() } // MARK: NTTextFieldProtocol override func drawViewsForRect(rect: CGRect) { let frame = CGRect(origin: CGPointZero, size: rect.size) // Set Placeholder placeholderLabel.frame = frame if let aFont = font { font = aFont.fontWithSize(activeFontSize) } placeholderLabel.textColor = activeColor addSubview(placeholderLabel) // Update update() // Set Label Text textColor = inactiveColor if let aFont = font { font = aFont.fontWithSize(inactiveFontSize) } } override func animateViewsForTextEntry() { // Animate textField placeholder when UITextfield's text is empty UIView.animateWithDuration(0.3, delay: 0.0, usingSpringWithDamping: 0.8, initialSpringVelocity: 1.0, options: UIViewAnimationOptions.BeginFromCurrentState, animations: ({ [weak self] in self?.update() }), completion: { (completed) in }) } override func animateViewsForTextDisplay() { UIView.animateWithDuration(0.35, delay: 0.0, usingSpringWithDamping: 0.8, initialSpringVelocity: 2.0, options: UIViewAnimationOptions.BeginFromCurrentState, animations: ({ [weak self] in // Animate textField placeholder when UITextfield's text is filled self?.update() }), completion: { (completed) in }) } // MARK: Overrides override func editingRectForBounds(bounds: CGRect) -> CGRect { return CGRectOffset(bounds, textFieldInsets.x, textFieldInsets.y) } override func textRectForBounds(bounds: CGRect) -> CGRect { return CGRectOffset(bounds, textFieldInsets.x, textFieldInsets.y) } }
mit
438459d638fbab308c2a7c489465b393
26.118881
190
0.680248
4.64988
false
false
false
false
nissivm/DemoShop
Demo Shop/Objects/Card.swift
1
8787
// // Card.swift // Demo Shop // // Created by Nissi Vieira Miranda on 1/11/16. // Copyright © 2016 Nissi Vieira Miranda. All rights reserved. // import Foundation class Card { static var cardNumber = "" static var expirationDate = "" static var cvc = "" private var cardBrand: STPCardBrand? //-------------------------------------------------------------------------// // MARK: Card brand //-------------------------------------------------------------------------// func retrieveCardBrand() { let sanitizedNumber = STPCardValidator.sanitizedNumericStringForString(Card.cardNumber) cardBrand = STPCardValidator.brandForNumber(sanitizedNumber) } func cardBrandName() -> String { retrieveCardBrand() var imageName = "" switch cardBrand! { case .Visa: imageName = "visa" break case .MasterCard: imageName = "mastercard" break case .DinersClub: imageName = "diners" break case .Amex: imageName = "amex" break case .Discover: imageName = "discover" break case .JCB: imageName = "jcb" break case .Unknown: imageName = "" break } return imageName } func cardImageForBrandName(brandName: String) -> UIImage? { if brandName.characters.count > 0 { let path = NSBundle.mainBundle().pathForResource(brandName, ofType: "png") return UIImage(contentsOfFile: path!) } else { return nil } } //-------------------------------------------------------------------------// // MARK: Format //-------------------------------------------------------------------------// func formatCardNumber() -> String { var cardNumber = Card.cardNumber let cardNumberNSString = NSString(string: cardNumber) let cardNumberLength = cardNumberNSString.length retrieveCardBrand() if (cardNumberLength == 5) || ((cardBrand! == .Amex) && (cardNumberLength == 12)) || ((cardBrand! != .Amex) && (cardNumberLength == 10)) || ((cardBrand! != .Amex) && (cardNumberLength == 15)) { let part1 = cardNumberNSString.substringToIndex(cardNumberLength - 1) let part2 = cardNumberNSString.substringFromIndex(cardNumberLength - 1) cardNumber = part1 + " " + part2 } else if ((cardBrand! == .Amex) && (cardNumberLength > 12)) { let maxCardLengthForCardBrand = STPCardValidator.lengthForCardBrand(cardBrand!) if (cardNumberLength - 2) > maxCardLengthForCardBrand // 2 -> spaces { cardNumber = cardNumberNSString.substringToIndex(cardNumberLength - 1) } } else if ((cardBrand! != .Amex) && (cardNumberLength > 15)) { if cardBrand! != .Unknown { let maxCardLengthForCardBrand = STPCardValidator.lengthForCardBrand(cardBrand!) if (cardNumberLength - 3) > maxCardLengthForCardBrand // 3 -> spaces { cardNumber = cardNumberNSString.substringToIndex(cardNumberLength - 1) } } } return cardNumber } func formatExpirationDate() -> String { var expirationDate = Card.expirationDate let expirationDateNSString = NSString(string: expirationDate) let expirationDateLength = expirationDateNSString.length if (expirationDateLength == 1) && (expirationDate != "0") && (expirationDate != "1") { expirationDate = "0" + expirationDate } else if expirationDateLength == 3 { let part1 = expirationDateNSString.substringToIndex(expirationDateLength - 1) let part2 = expirationDateNSString.substringFromIndex(expirationDateLength - 1) expirationDate = part1 + " / " + part2 } else if expirationDateLength > 7 { expirationDate = expirationDateNSString.substringToIndex(expirationDateLength - 1) } return expirationDate } func formatCVC() -> String { var cvc = Card.cvc let cvcNSString = NSString(string: cvc) let cvcLength = cvcNSString.length retrieveCardBrand() if cardBrand! != .Unknown { let maxCardBrandCVCLength = Int(STPCardValidator.maxCVCLengthForCardBrand(cardBrand!)) if cvcLength > maxCardBrandCVCLength { cvc = cvcNSString.substringToIndex(cvcLength - 1) } } return cvc } //-------------------------------------------------------------------------// // MARK: Validation //-------------------------------------------------------------------------// func cardNumberIsValid() -> Bool { var isValid = false if Card.cardNumber.characters.count > 0 { let status = cardNumberValidationStatus() if status == .Valid { isValid = true } } return isValid } func cardNumberValidationStatus() -> STPCardValidationState { let sanitizedNumber = STPCardValidator.sanitizedNumericStringForString(Card.cardNumber) return STPCardValidator.validationStateForNumber(sanitizedNumber, validatingCardBrand:true) } func expirationDateIsValid() -> Bool { var isValid = false if Card.expirationDate.characters.count == 7 { let monthStatus = monthValidationStatus(Card.expirationDate) let yearStatus = yearValidationStatus(Card.expirationDate) if (monthStatus == .Valid) && (yearStatus == .Valid) { isValid = true } } return isValid } func monthValidationStatus(expirationDate: String) -> STPCardValidationState { let sanitizedMonth = getSanitizedMonth(expirationDate) return STPCardValidator.validationStateForExpirationMonth(sanitizedMonth) } func yearValidationStatus(expirationDate: String) -> STPCardValidationState { let sanitizedMonth = getSanitizedMonth(expirationDate) let sanitizedYear = getSanitizedYear(expirationDate) return STPCardValidator.validationStateForExpirationYear(sanitizedYear, inMonth: sanitizedMonth) } func cvcIsValid() -> Bool { var isValid = false if Card.cvc.characters.count > 0 { let status = cvcValidationStatus() if status == .Valid { isValid = true } } return isValid } func cvcValidationStatus() -> STPCardValidationState { retrieveCardBrand() return STPCardValidator.validationStateForCVC(Card.cvc, cardBrand: cardBrand!) } //-------------------------------------------------------------------------// // MARK: Sanitized Month & Year //-------------------------------------------------------------------------// func getSanitizedMonth(expirationDate: String) -> String { let sanitizedDate = STPCardValidator.sanitizedNumericStringForString(expirationDate) return NSString(string: sanitizedDate).substringToIndex(2) } func getSanitizedYear(expirationDate: String) -> String { let sanitizedDate = STPCardValidator.sanitizedNumericStringForString(expirationDate) return NSString(string: sanitizedDate).substringWithRange(NSMakeRange(2, 2)) } //-------------------------------------------------------------------------// // MARK: STPCardParams //-------------------------------------------------------------------------// func getCardParams() -> STPCardParams { let params = STPCardParams() params.number = STPCardValidator.sanitizedNumericStringForString(Card.cardNumber) params.expMonth = UInt(Int(getSanitizedMonth(Card.expirationDate))!) params.expYear = UInt(Int(getSanitizedYear(Card.expirationDate))!) params.cvc = Card.cvc return params } }
mit
26ab725812a799a06a713dd401c2a3c8
30.952727
104
0.516617
5.99727
false
false
false
false
EricConnerApps/SwiftyReview
Sources/SwiftyReview.swift
1
5012
// The MIT License (MIT) // // Copyright (c) 2017 Eric Conner // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in all // copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. import Foundation import StoreKit public class SwiftyReview { /// User default keys private enum UserDefaultKey: String { case requestCounter = "SwiftyReviewRequestCounterKey" case alertsThisYear = "SwiftyReviewThisYearKey" case savedMonth = "SwiftyReviewSavedMonthKey" case savedYear = "SwiftyReviewSavedYearKey" } /// Request counter private static var requestCounter: Int { get { return UserDefaults.standard.integer(forKey: UserDefaultKey.requestCounter.rawValue) } set { UserDefaults.standard.set(newValue, forKey: UserDefaultKey.requestCounter.rawValue) } } /// Alerts shown this year private static var alertsThisYear: Int { get { return UserDefaults.standard.integer(forKey: UserDefaultKey.alertsThisYear.rawValue) } set { UserDefaults.standard.set(newValue, forKey: UserDefaultKey.alertsThisYear.rawValue) } } /// Saved month private static var savedMonth: Int { get { return UserDefaults.standard.integer(forKey: UserDefaultKey.savedMonth.rawValue) } set { UserDefaults.standard.set(newValue, forKey: UserDefaultKey.savedMonth.rawValue) } } /// Saved year private static var savedYear: Int { get { return UserDefaults.standard.integer(forKey: UserDefaultKey.savedYear.rawValue) } set { UserDefaults.standard.set(newValue, forKey: UserDefaultKey.savedYear.rawValue) } } /// Request review /// - parameter requestsBeforeAlert: The number of requestReviews before an alert is shown. Default is 15. public class func requestReview(requestsBeforeAlert: Int = 15) { requestCounter += 1 #if os(tvOS) print("[SwiftyReview] - tvOS is not currently supported") #elseif os(OSX) print("[SwiftyReview] - macOS is not currently supported") #elseif os(iOS) if canShowReview(requestsBeforeAlert: requestsBeforeAlert) { print("[SwiftyReview] - Review requested") #if os(iOS) if #available(iOS 10.3, *) { SKStoreReviewController.requestReview() } else { print("[SwiftyReview] - Not supported on this iOS version") } #endif } #endif } /// Determine if the review dialog can be shown. private class func canShowReview(requestsBeforeAlert: Int) -> Bool { // Get date let date = Date() let formatter = DateFormatter() formatter.locale = Locale(identifier: "en_US") formatter.dateFormat = "MM.yyyy" let dateResult = formatter.string(from: date) // Get month string guard let monthString = dateResult.components(separatedBy: ".").first else { print("[SwiftyReview] - Month String error") return false } // Get month int guard let month = Int(monthString) else { print("[SwiftyReview] - Month Int error") return false } // Get year string guard let yearString = dateResult.components(separatedBy: ".").last else { print("[SwiftyReview] - Year String error") return false } // Get year int guard let year = Int(yearString) else { print("[SwiftyReview] - Year Int error") return false } // Update saved month/year if never set before if savedMonth == 0 { savedMonth = month } if savedYear == 0 { savedYear = year } // If year has changed reset everything if year > savedYear { savedYear = year alertsThisYear = 0 requestCounter = 0 } print("[SwiftyReview]") print("\tRequest count: \(requestCounter)/\(requestsBeforeAlert)") print("\tAlerts this year: \(alertsThisYear)") print("\tDate: \(savedMonth)-\(savedYear)") // Check that max number of 3 alerts shown per year is not reached guard alertsThisYear < 3 else { return false } // Show alert if needed if requestCounter == requestsBeforeAlert { alertsThisYear += 1 savedMonth = month return true } else if requestCounter > requestsBeforeAlert, month >= (savedMonth + 4) { alertsThisYear += 1 savedMonth = month return true } // No alert is needed to show return false } }
mit
afae3aec3b4008d37fa40a1ba85f0099
31.128205
107
0.723264
3.825954
false
false
false
false
nathawes/swift
test/IRGen/objc_class_export.swift
4
6050
// RUN: %empty-directory(%t) // RUN: %build-irgen-test-overlays // RUN: %target-swift-frontend -sdk %S/Inputs -I %t -primary-file %s -emit-ir -disable-objc-attr-requires-foundation-module | %FileCheck %s // REQUIRES: CPU=x86_64 // REQUIRES: objc_interop // CHECK-DAG: %swift.refcounted = type // CHECK-DAG: [[HOOZIT:%T17objc_class_export6HoozitC]] = type <{ [[REF:%swift.refcounted]] }> // CHECK-DAG: [[FOO:%T17objc_class_export3FooC]] = type <{ [[REF]], %TSi }> // CHECK-DAG: [[INT:%TSi]] = type <{ i64 }> // CHECK-DAG: [[DOUBLE:%TSd]] = type <{ double }> // CHECK-DAG: [[NSRECT:%TSo6NSRectV]] = type <{ %TSo7NSPointV, %TSo6NSSizeV }> // CHECK-DAG: [[NSPOINT:%TSo7NSPointV]] = type <{ %TSd, %TSd }> // CHECK-DAG: [[NSSIZE:%TSo6NSSizeV]] = type <{ %TSd, %TSd }> // CHECK: @"OBJC_METACLASS_$__TtC17objc_class_export3Foo" = hidden global %objc_class { // CHECK-SAME: %objc_class* @"OBJC_METACLASS_$_{{(_TtCs12_)?}}SwiftObject", // CHECK-SAME: %objc_class* @"OBJC_METACLASS_$_{{(_TtCs12_)?}}SwiftObject", // CHECK-SAME: %swift.opaque* @_objc_empty_cache, // CHECK-SAME: %swift.opaque* null, // CHECK-SAME: i64 ptrtoint ({{.*}}* @_METACLASS_DATA__TtC17objc_class_export3Foo to i64) // CHECK-SAME: } // CHECK: [[FOO_NAME:@.*]] = private unnamed_addr constant [28 x i8] c"_TtC17objc_class_export3Foo\00" // CHECK: @_METACLASS_DATA__TtC17objc_class_export3Foo = internal constant {{.*\*}} } { // CHECK-SAME: i32 129, // CHECK-SAME: i32 40, // CHECK-SAME: i32 40, // CHECK-SAME: i32 0, // CHECK-SAME: i8* null, // CHECK-SAME: i8* getelementptr inbounds ([{{[0-9]+}} x i8], [{{[0-9]+}} x i8]* [[FOO_NAME]], i64 0, i64 0), // CHECK-SAME: @_CLASS_METHODS__TtC17objc_class_export3Foo, // CHECK-SAME: i8* null, // CHECK-SAME: i8* null, // CHECK-SAME: i8* null, // CHECK-SAME: i8* null // CHECK-SAME: }, section "__DATA, {{.*}}", align 8 // CHECK: @_DATA__TtC17objc_class_export3Foo = internal constant {{.*\*}} } { // CHECK-SAME: i32 128, // CHECK-SAME: i32 16, // CHECK-SAME: i32 24, // CHECK-SAME: i32 0, // CHECK-SAME: i8* null, // CHECK-SAME: i8* getelementptr inbounds ([{{[0-9]+}} x i8], [{{[0-9]+}} x i8]* [[FOO_NAME]], i64 0, i64 0), // CHECK-SAME: { i32, i32, [6 x { i8*, i8*, i8* }] }* @_INSTANCE_METHODS__TtC17objc_class_export3Foo, // CHECK-SAME: i8* null, // CHECK-SAME: @_IVARS__TtC17objc_class_export3Foo, // CHECK-SAME: i8* null, // CHECK-SAME: _PROPERTIES__TtC17objc_class_export3Foo // CHECK-SAME: }, section "__DATA, {{.*}}", align 8 // CHECK: @"$s17objc_class_export3FooCMf" = internal global <{{.*}} }> <{ // CHECK-SAME: void ([[FOO]]*)* @"$s17objc_class_export3FooCfD", // CHECK-SAME: i8** @"$sBOWV", // CHECK-SAME: i64 ptrtoint (%objc_class* @"OBJC_METACLASS_$__TtC17objc_class_export3Foo" to i64), // CHECK-SAME: %objc_class* @"OBJC_CLASS_$_{{(_TtCs12_)?}}SwiftObject", // CHECK-SAME: %swift.opaque* @_objc_empty_cache, // CHECK-SAME: %swift.opaque* null, // CHECK-SAME: i64 add (i64 ptrtoint ({{.*}}* @_DATA__TtC17objc_class_export3Foo to i64), i64 {{1|2}}), // CHECK-SAME: [[FOO]]* (%swift.type*)* @"$s17objc_class_export3FooC6createACyFZ", // CHECK-SAME: void (double, double, double, double, [[FOO]]*)* @"$s17objc_class_export3FooC10drawInRect5dirtyySo6NSRectV_tF" // CHECK-SAME: }>, section "__DATA,__objc_data, regular" // -- TODO: The OBJC_CLASS symbol should reflect the qualified runtime name of // Foo. // CHECK: @"$s17objc_class_export3FooCN" = hidden alias %swift.type, bitcast (i64* getelementptr inbounds ({{.*}} @"$s17objc_class_export3FooCMf", i32 0, i32 2) to %swift.type*) // CHECK: @"OBJC_CLASS_$__TtC17objc_class_export3Foo" = hidden alias %swift.type, %swift.type* @"$s17objc_class_export3FooCN" import gizmo class Hoozit {} struct BigStructWithNativeObjects { var x, y, w : Double var h : Hoozit } @objc class Foo { @objc var x = 0 @objc class func create() -> Foo { return Foo() } @objc func drawInRect(dirty dirty: NSRect) { } // CHECK: define internal void @"$s17objc_class_export3FooC10drawInRect5dirtyySo6NSRectV_tFTo"([[OPAQUE:%.*]]* %0, i8* %1, [[NSRECT]]* byval align 8 %2) {{[#0-9]*}} { // CHECK: [[CAST:%[a-zA-Z0-9]+]] = bitcast [[OPAQUE]]* %0 to [[FOO]]* // CHECK: call swiftcc void @"$s17objc_class_export3FooC10drawInRect5dirtyySo6NSRectV_tF"(double {{.*}}, double {{.*}}, double {{.*}}, double {{.*}}, [[FOO]]* swiftself [[CAST]]) // CHECK: } @objc func bounds() -> NSRect { return NSRect(origin: NSPoint(x: 0, y: 0), size: NSSize(width: 0, height: 0)) } // CHECK: define internal void @"$s17objc_class_export3FooC6boundsSo6NSRectVyFTo"([[NSRECT]]* noalias nocapture sret %0, [[OPAQUE4:%.*]]* %1, i8* %2) {{[#0-9]*}} { // CHECK: [[CAST:%[a-zA-Z0-9]+]] = bitcast [[OPAQUE4]]* %1 to [[FOO]]* // CHECK: call swiftcc { double, double, double, double } @"$s17objc_class_export3FooC6boundsSo6NSRectVyF"([[FOO]]* swiftself [[CAST]]) @objc func convertRectToBacking(r r: NSRect) -> NSRect { return r } // CHECK: define internal void @"$s17objc_class_export3FooC20convertRectToBacking1rSo6NSRectVAG_tFTo"([[NSRECT]]* noalias nocapture sret %0, [[OPAQUE5:%.*]]* %1, i8* %2, [[NSRECT]]* byval align 8 %3) {{[#0-9]*}} { // CHECK: [[CAST:%[a-zA-Z0-9]+]] = bitcast [[OPAQUE5]]* %1 to [[FOO]]* // CHECK: call swiftcc { double, double, double, double } @"$s17objc_class_export3FooC20convertRectToBacking1rSo6NSRectVAG_tF"(double {{.*}}, double {{.*}}, double {{.*}}, double {{.*}}, [[FOO]]* swiftself [[CAST]]) func doStuffToSwiftSlice(f f: [Int]) { } // This function is not representable in Objective-C, so don't emit the objc entry point. // CHECK-NOT: @"$s17objc_class_export3FooC19doStuffToSwiftSlice1fySaySiG_tcAAFTo" func doStuffToBigSwiftStruct(f f: BigStructWithNativeObjects) { } // This function is not representable in Objective-C, so don't emit the objc entry point. // CHECK-NOT: @_TToFC17objc_class_export3Foo23doStuffToBigSwiftStruct1ffS_FTV17objc_class_export27BigStructWithNativeObjects_T_ @objc init() { } }
apache-2.0
891f5f3f118ac17863dab3b413dfbb42
51.155172
219
0.636364
3.055556
false
false
false
false
lgouger/iTerm2
sources/PasswordManagerDataSourceProvider.swift
2
6986
// // PasswordManagerDataSourceProvider.swift // iTerm2SharedARC // // Created by George Nachman on 3/19/22. // import Foundation import LocalAuthentication @objc(iTermPasswordManagerDataSourceProvider) class PasswordManagerDataSourceProvider: NSObject { @objc private(set) static var authenticated = false private static var _dataSource: PasswordManagerDataSource? = nil private static var dataSourceType: DataSource = preferredDataSource private static let _keychain = KeychainPasswordDataSource() private static var _onePassword = OnePasswordDataSource() private static var _lastPass = LastPassDataSource() private static let dataSourceNameUserDefaultsKey = "NoSyncPasswordManagerDataSourceName" enum DataSource: String { case keychain = "Keychain" case onePassword = "OnePassword" case lastPass = "LastPass" static let defaultValue = DataSource.keychain } static var preferredDataSource: DataSource { get { let rawValue = UserDefaults.standard.string(forKey: dataSourceNameUserDefaultsKey) ?? "" return DataSource(rawValue: rawValue) ?? DataSource.defaultValue } set { UserDefaults.standard.set(newValue.rawValue, forKey: dataSourceNameUserDefaultsKey) _dataSource = nil } } @objc static var dataSource: PasswordManagerDataSource? { guard authenticated else { return nil } guard let existing = _dataSource else { let fresh = { () -> PasswordManagerDataSource in switch preferredDataSource { case .keychain: return keychain! case .onePassword: return onePassword! case .lastPass: return lastPass! } }() _dataSource = fresh return fresh } return existing } @objc static func enableKeychain() { preferredDataSource = .keychain } @objc static var keychainEnabled: Bool { return preferredDataSource == .keychain } @objc static func enable1Password() { preferredDataSource = .onePassword } @objc static var onePasswordEnabled: Bool { return preferredDataSource == .onePassword } @objc static func enableLastPass() { preferredDataSource = .lastPass } @objc static var lastPassEnabled: Bool { return preferredDataSource == .lastPass } @objc static var keychain: PasswordManagerDataSource? { if !authenticated { return nil } return _keychain } private static var onePassword: OnePasswordDataSource? { if !authenticated { return nil } return _onePassword } private static var lastPass: LastPassDataSource? { if !authenticated { return nil } return _lastPass } @objc static func revokeAuthentication() { authenticated = false } @objc static func requestAuthenticationIfNeeded(_ completion: @escaping (Bool) -> ()) { if authenticated { completion(true) return } if !SecureUserDefaults.instance.requireAuthToOpenPasswordmanager.value { authenticated = true completion(true) return } let context = LAContext() let policy = LAPolicy.deviceOwnerAuthentication var error: NSError? = nil if !context.canEvaluatePolicy(policy, error: &error) { DLog("Can't evaluate \(policy): \(error?.localizedDescription ?? "(nil)")") return } iTermApplication.shared().localAuthenticationDialogOpen = true let reason = "open the password manager" context.evaluatePolicy(policy, localizedReason: reason) { success, error in DLog("Policy evaluation success=\(success) error=\(String(describing: error))") DispatchQueue.main.async { iTermApplication.shared().localAuthenticationDialogOpen = false if success { Self.authenticated = true completion(true) } else { Self.authenticated = false if let error = error as NSError?, (error.code != LAError.systemCancel.rawValue && error.code != LAError.appCancel.rawValue) { showError(error) } completion(false) } } } } @objc static func consolidateAvailabilityChecks(_ block: () -> ()) { if let dataSource = dataSource { dataSource.consolidateAvailabilityChecks(block) return } block() } private static func showError(_ error: NSError) { let alert = NSAlert() let reason: String switch LAError.Code(rawValue: error.code) { case .authenticationFailed: reason = "valid credentials weren't supplied."; case .userCancel: reason = "password entry was cancelled."; case .userFallback: reason = "password authentication was requested."; case .systemCancel: reason = "the system cancelled the authentication request."; case .passcodeNotSet: reason = "no passcode is set."; case .touchIDNotAvailable: reason = "touch ID is not available."; case .biometryNotEnrolled: reason = "touch ID doesn't have any fingers enrolled."; case .biometryLockout: reason = "there were too many failed Touch ID attempts."; case .appCancel: reason = "authentication was cancelled by iTerm2."; case .invalidContext: reason = "the context is invalid. This is a bug in iTerm2. Please report it."; case .none: reason = error.localizedDescription case .touchIDNotEnrolled: reason = "touch ID is not enrolled." case .touchIDLockout: reason = "touch ID is locked out." case .notInteractive: reason = "the required user interface could not be displayed." case .watchNotAvailable: reason = "watch is not available." case .biometryNotPaired: reason = "biometry is not paired." case .biometryDisconnected: reason = "biometry is disconnected." case .invalidDimensions: reason = "invalid dimensions given." @unknown default: reason = error.localizedDescription } alert.messageText = "Authentication Failed" alert.informativeText = "Authentication failed because \(reason)" alert.addButton(withTitle: "OK") alert.runModal() } }
gpl-2.0
0f11141cea1bb11e5b9d5757a4f86542
30.327354
101
0.594188
5.540048
false
false
false
false
appsandwich/PullToRefreshView
Example/PullToRefreshViewDotSwift/ViewController.swift
1
2419
// // ViewController.swift // PullToRefreshViewDotSwift // // Created by vinny.coyne on 07/18/2017. // Copyright (c) 2017 vinny.coyne. All rights reserved. // import UIKit import PullToRefreshViewDotSwift class ViewController: UIViewController, UITableViewDataSource, UITableViewDelegate { @IBOutlet weak var tableView: UITableView! override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the view, typically from a nib. self.tableView.installPullToRefreshViewWithHandler { [weak self] (ptrView) in DispatchQueue.main.asyncAfter(deadline: .now() + .seconds(3), execute: { self?.tableView.pullToRefreshView()?.endRefreshing() self?.tableView.reloadData() }) } self.tableView.pullToRefreshView()?.refreshDidStartAnimationHandler = { [weak self] (ptrView) in UIView.animate(withDuration: 0.1, animations: { self?.tableView.backgroundColor = .red }) } self.tableView.pullToRefreshView()?.refreshDidStopAnimationHandler = { [weak self] (ptrView) in UIView.animate(withDuration: 0.1, animations: { self?.tableView.backgroundColor = .green }) } } override func didReceiveMemoryWarning() { super.didReceiveMemoryWarning() // Dispose of any resources that can be recreated. } internal func configureCell(_ cell: UITableViewCell, at indexPath: IndexPath) { cell.textLabel?.text = "Row \(indexPath.row)" } // MARK: - Table view delegate & data source func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { return 100 } func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { let cellID = "cellID" guard let cell = tableView.dequeueReusableCell(withIdentifier: cellID) else { let newCell = UITableViewCell(style: .default, reuseIdentifier: cellID) self.configureCell(newCell, at: indexPath) return newCell } self.configureCell(cell, at: indexPath) return cell } }
mit
beebd529935ef6585e1a222ef48767e0
30.415584
104
0.598594
5.435955
false
false
false
false
libzhu/LearnSwift
基本运算符/MyPlayground.playground/Contents.swift
1
4977
//: Playground - noun: a place where people can play import UIKit var str = "Hello, playground" /* 运算符分为一元、二元和三元运算符: 一元运算符对单一操作对象操作(如 -a)。一元运算符分前置运算符和后置运算符,前置运算符需紧跟在操作对象之前(如 !b),后置运算符需紧跟在操作对象之后(如 c!)。 二元运算符操作两个操作对象(如 2 + 3),是中置的,因为它们出现在两个操作对象之间。 三元运算符操作三个操作对象,和 C 语言一样,Swift 只有一个三元运算符,就是三目运算符(a ? b : c)。 受运算符影响的值叫操作数,在表达式 1 + 2 中,加号 + 是二元运算符,它的两个操作数是值 1 和 2。 */ /*-------------------赋值运算符---------------------*/ //赋值运算符(a = b),表示用 b 的值来初始化或更新 a 的值: let b = 10 var a = 5 a = b //如果赋值的右边是一个元祖,它的元素可以被分解成多个常量或变量 let (x, y) = (10, 20) print(x) print(y) //语法错误例子 //if x = y {//swift和c oc语言不一样 没有非零即真概念, 只有TRUE FALSE // // 此句错误, 因为 x = y 并不返回任何值 //} "hello" + " " + "world" 3-2 33/3 33%3 9%4 var c = 8 c += 1 c -= 1 let name = "hello world" if name != "hello world" { print("true") }else{ print("false") } /* 当元组中的值可以比较时,你也可以使用这些运算符来比较它们的大小。例如,因为 Int 和 String 类型的值可以比较,所以类型为 (Int, String) 的元组也可以被比较。相反,Bool 不能被比较,也意味着存有布尔类型的元组不能被比较。 比较元组大小会按照从左到右、逐值比较的方式,直到发现有两个值不等时停止。如果所有的值都相等,那么这一对元组我们就称它们是相等的。例如: */ (3, "zebra") < (2, "apple") // true,因为 1 小于 2 (3, "c") < (3, "b") // true,因为 3 等于 3,但是 apple 小于 bird (4, "dog") == (4, "dog") // true,因为 4 等于 4,dog 等于 dog /* 三目运算符(Ternary Conditional Operator) 三目运算符的特殊在于它是有三个操作数的运算符,它的形式是 问题 ? 答案 1 : 答案 2。它简洁地表达根据 问题成立与否作出二选一的操作。如果 问题 成立,返回 答案 1 的结果;反之返回 答案 2 的结果。 三目运算符是以下代码的缩写形式: if question { answer1 } else { answer2 } */ let contentHeight = 40 let hasHeader = true let rowHeight = contentHeight + (hasHeader ? 50 : 20) /*--------------------空和运算符------------------------------*/ //空和运算符(a ?? b) 将对可选类型 a 进行空判断 如果 a 包含一个值就解封,否者就会返回一个默认值 b。表达式 a 必须是可选类型 Optional。默认值 b 的类型必选要和 a 存储值的类型保持一致; 空和运算符的表达式是简化的三目运算符 a != nil ? a! : b let defaultColorName = "red" var userDefineColorName : String? //默认值为nil var colorNameToUse = userDefineColorName ?? defaultColorName//如果可选类型userDefineColorName 值 为nil 就取 defaultColorName的值; userDefineColorName = "green" colorNameToUse = userDefineColorName ?? defaultColorName /*区间运算符 swift提供了两个方便表达一个区间的值的区间运算符 闭区间运算符 (a ... b)定义一个包含从 a 到 b (包含 a 和 b )的所有值的区间。a 不能超过 b 。 闭区间运算符在迭代一个区间的所有值时是非常有用的,如在 for-in 循环中: */ for index in 1 ... 5 { print("\(index) * 5 = \(index * 5)") } /* 半开半闭区间 半开区间运算符(a..<b)定义一个从 a 到 b 但不包括 b 的区间。 之所以称为半开区间,是因为该区间包含第一个值而不包括最后的值。 半开区间的实用性在于当你使用一个从 0 开始的列表(如数组)时,非常方便地从0数到列表的长度。 */ let nameArr = ["张三", "李四", "王五", "赵六", "马七"] let count = nameArr.count for index in 0..<count { print("第\(index)元素的值是:\(nameArr[index])") } /* 逻辑运算符(Logical Operators) 逻辑运算符的操作对象是逻辑布尔值。Swift 支持基于 C 语言的三个标准逻辑运算。 逻辑非(!a) 逻辑与(a && b) 逻辑或(a || b) */ //逻辑非运算符(!a)对一个布尔值取反,使得 true 变 false,false 变 true。它是一个前置运算符,需紧跟在操作数之前,且不加空格。读作 非 a ,例子如下: let allowedEntry = false if !allowedEntry { print("不能进入!") } var isRead : Bool? var isSleep = isRead ?? false isRead = true isRead = isRead ?? false
mit
9cae71ea99ee9c1aaa1d67d8d8a846b9
17.474684
146
0.641658
2.235069
false
false
false
false
RCacheaux/Bitbucket-iOS
Carthage/Checkouts/ReSwift/ReSwiftTests/StoreSubscriberTests.swift
1
2487
// // StoreSubscriberTests.swift // ReSwift // // Created by Benji Encz on 1/23/16. // Copyright © 2016 Benjamin Encz. All rights reserved. // import XCTest import ReSwift class StoreSubscriberTests: XCTestCase { /** it allows to pass a state selector closure */ func testAllowsSelectorClosure() { let reducer = TestReducer() let store = Store(reducer: reducer, state: TestAppState()) let subscriber = TestFilteredSubscriber() store.subscribe(subscriber) { $0.testValue } store.dispatch(SetValueAction(3)) XCTAssertEqual(subscriber.receivedValue, 3) } /** it supports complex state selector closures */ func testComplexStateSelector() { let reducer = TestComplexAppStateReducer() let store = Store(reducer: reducer, state: TestComplexAppState()) let subscriber = TestSelectiveSubscriber() store.subscribe(subscriber) { ($0.testValue, $0.otherState?.name) } store.dispatch(SetValueAction(5)) store.dispatch(SetOtherStateAction( otherState: OtherState(name: "TestName", age: 99) )) XCTAssertEqual(subscriber.receivedValue.0, 5) XCTAssertEqual(subscriber.receivedValue.1, "TestName") } } class TestFilteredSubscriber: StoreSubscriber { var receivedValue: Int? func newState(state: Int?) { receivedValue = state } } /** Example of how you can select a substate. The return value from `selectSubstate` and the argument for `newState` need to match up. */ class TestSelectiveSubscriber: StoreSubscriber { var receivedValue: (Int?, String?) func newState(state: (Int?, String?)) { receivedValue = state } } struct TestComplexAppState: StateType { var testValue: Int? var otherState: OtherState? } struct OtherState { var name: String? var age: Int? } struct TestComplexAppStateReducer: Reducer { func handleAction(action: Action, state: TestComplexAppState?) -> TestComplexAppState { var state = state ?? TestComplexAppState() switch action { case let action as SetValueAction: state.testValue = action.value return state case let action as SetOtherStateAction: state.otherState = action.otherState default: break } return state } } struct SetOtherStateAction: Action { var otherState: OtherState }
apache-2.0
709fd798ac27898bc6dcb28ee489232f
23.86
91
0.654867
4.495479
false
true
false
false
blockchain/My-Wallet-V3-iOS
Modules/Platform/Sources/PlatformKit/Coincore/Account/Fiat/LinkedBank/LinkedBanksFactory.swift
1
3053
// Copyright © Blockchain Luxembourg S.A. All rights reserved. import DIKit import MoneyKit import RxSwift import ToolKit public protocol LinkedBanksFactoryAPI { var linkedBanks: Single<[LinkedBankAccount]> { get } var nonWireTransferBanks: Single<[LinkedBankAccount]> { get } func bankPaymentMethods(for currency: FiatCurrency) -> Single<[PaymentMethodType]> } final class LinkedBanksFactory: LinkedBanksFactoryAPI { private let linkedBankService: LinkedBanksServiceAPI private let paymentMethodService: PaymentMethodTypesServiceAPI init( linkedBankService: LinkedBanksServiceAPI = resolve(), paymentMethodService: PaymentMethodTypesServiceAPI = resolve() ) { self.linkedBankService = linkedBankService self.paymentMethodService = paymentMethodService } var linkedBanks: Single<[LinkedBankAccount]> { linkedBankService .fetchLinkedBanks() .map { linkedBankData in linkedBankData.filter(\.isActive) } .map { linkedBankData in linkedBankData.map { data in LinkedBankAccount( label: data.account?.bankName ?? "", accountNumber: data.account?.number ?? "", accountId: data.identifier, bankAccountType: data.account?.type ?? .checking, currency: data.currency, paymentType: data.paymentMethodType, partner: data.partner, data: data ) } } } var nonWireTransferBanks: Single<[LinkedBankAccount]> { linkedBankService .linkedBanks .map { banks in banks .filter { $0.isActive && $0.paymentMethodType == .bankTransfer } } .map { linkedBankData in linkedBankData.map { data in LinkedBankAccount( label: data.account?.name ?? "", accountNumber: data.account?.number ?? "", accountId: data.identifier, bankAccountType: data.account?.type ?? .checking, currency: data.currency, paymentType: data.paymentMethodType, partner: data.partner, data: data ) } } } func bankPaymentMethods(for currency: FiatCurrency) -> Single<[PaymentMethodType]> { paymentMethodService .eligiblePaymentMethods(for: currency) .map { paymentMethodTyps in paymentMethodTyps.filter { paymentType in paymentType.method == .bankAccount(.fiat(currency)) || paymentType.method == .bankTransfer(.fiat(currency)) } } } }
lgpl-3.0
42a87624a87a546588d944ae770c39ce
34.488372
88
0.538336
6.007874
false
false
false
false
Diego5529/tcc-swift
tcc-swift/AppDelegate.swift
1
6084
// // AppDelegate.swift // tcc-swift // // Created by Diego on 8/7/16. // Copyright © 2016 ifsp. All rights reserved. // import UIKit import CoreData @UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { // Override point for customization after application launch. return true } func applicationWillResignActive(application: UIApplication) { // 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. // 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. } func applicationDidEnterBackground(application: UIApplication) { // 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. // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. } func applicationWillEnterForeground(application: UIApplication) { // 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. } func applicationDidBecomeActive(application: UIApplication) { // 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. } func applicationWillTerminate(application: UIApplication) { // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. // Saves changes in the application's managed object context before the application terminates. self.saveContext() } // MARK: - Core Data stack lazy var applicationDocumentsDirectory: NSURL = { // The directory the application uses to store the Core Data store file. This code uses a directory named "ifsp-tcc.com.br.tcc_swift" in the application's documents Application Support directory. let urls = NSFileManager.defaultManager().URLsForDirectory(.DocumentDirectory, inDomains: .UserDomainMask) return urls[urls.count-1] }() lazy var managedObjectModel: NSManagedObjectModel = { // The managed object model for the application. This property is not optional. It is a fatal error for the application not to be able to find and load its model. let modelURL = NSBundle.mainBundle().URLForResource("tcc_swift", withExtension: "momd")! return NSManagedObjectModel(contentsOfURL: modelURL)! }() lazy var persistentStoreCoordinator: NSPersistentStoreCoordinator = { // The persistent store coordinator for the application. This implementation creates and returns a coordinator, having added the store for the application to it. This property is optional since there are legitimate error conditions that could cause the creation of the store to fail. // Create the coordinator and store let coordinator = NSPersistentStoreCoordinator(managedObjectModel: self.managedObjectModel) let url = self.applicationDocumentsDirectory.URLByAppendingPathComponent("SingleViewCoreData.sqlite") var failureReason = "There was an error creating or loading the application's saved data." do { try coordinator.addPersistentStoreWithType(NSSQLiteStoreType, configuration: nil, URL: url, options: nil) } catch { // Report any error we got. var dict = [String: AnyObject]() dict[NSLocalizedDescriptionKey] = "Failed to initialize the application's saved data" dict[NSLocalizedFailureReasonErrorKey] = failureReason dict[NSUnderlyingErrorKey] = error as NSError let wrappedError = NSError(domain: "YOUR_ERROR_DOMAIN", code: 9999, userInfo: dict) // Replace this with code to handle the error appropriately. // abort() causes the application to generate a crash log and terminate. You should not use this function in a shipping application, although it may be useful during development. NSLog("Unresolved error \(wrappedError), \(wrappedError.userInfo)") abort() } return coordinator }() lazy var managedObjectContext: NSManagedObjectContext = { // Returns the managed object context for the application (which is already bound to the persistent store coordinator for the application.) This property is optional since there are legitimate error conditions that could cause the creation of the context to fail. let coordinator = self.persistentStoreCoordinator var managedObjectContext = NSManagedObjectContext(concurrencyType: .MainQueueConcurrencyType) managedObjectContext.persistentStoreCoordinator = coordinator return managedObjectContext }() // MARK: - Core Data Saving support func saveContext () { if managedObjectContext.hasChanges { do { try managedObjectContext.save() } catch { // Replace this implementation with code to handle the error appropriately. // abort() causes the application to generate a crash log and terminate. You should not use this function in a shipping application, although it may be useful during development. let nserror = error as NSError NSLog("Unresolved error \(nserror), \(nserror.userInfo)") abort() } } } }
mit
da012ef9d75d2a31eb8ae7f30cb9a3f5
53.801802
291
0.71856
5.832215
false
false
false
false
faimin/ZDOpenSourceDemo
ZDOpenSourceSwiftDemo/Pods/PromiseKit/Sources/Deprecations.swift
7
3208
import Dispatch @available(*, deprecated, message: "See `init(resolver:)`") public func wrap<T>(_ body: (@escaping (T?, Error?) -> Void) throws -> Void) -> Promise<T> { return Promise { seal in try body(seal.resolve) } } @available(*, deprecated, message: "See `init(resolver:)`") public func wrap<T>(_ body: (@escaping (T, Error?) -> Void) throws -> Void) -> Promise<T> { return Promise { seal in try body(seal.resolve) } } @available(*, deprecated, message: "See `init(resolver:)`") public func wrap<T>(_ body: (@escaping (Error?, T?) -> Void) throws -> Void) -> Promise<T> { return Promise { seal in try body(seal.resolve) } } @available(*, deprecated, message: "See `init(resolver:)`") public func wrap(_ body: (@escaping (Error?) -> Void) throws -> Void) -> Promise<Void> { return Promise { seal in try body(seal.resolve) } } @available(*, deprecated, message: "See `init(resolver:)`") public func wrap<T>(_ body: (@escaping (T) -> Void) throws -> Void) -> Promise<T> { return Promise { seal in try body(seal.fulfill) } } public extension Promise { @available(*, deprecated, message: "See `ensure`") func always(on q: DispatchQueue = .main, execute body: @escaping () -> Void) -> Promise { return ensure(on: q, body) } } public extension Thenable { #if PMKFullDeprecations /// disabled due to ambiguity with the other `.flatMap` @available(*, deprecated, message: "See: `compactMap`") func flatMap<U>(on: DispatchQueue? = conf.Q.map, _ transform: @escaping(T) throws -> U?) -> Promise<U> { return compactMap(on: on, transform) } #endif } public extension Thenable where T: Sequence { #if PMKFullDeprecations /// disabled due to ambiguity with the other `.map` @available(*, deprecated, message: "See: `mapValues`") func map<U>(on: DispatchQueue? = conf.Q.map, _ transform: @escaping(T.Iterator.Element) throws -> U) -> Promise<[U]> { return mapValues(on: on, transform) } /// disabled due to ambiguity with the other `.flatMap` @available(*, deprecated, message: "See: `flatMapValues`") func flatMap<U: Sequence>(on: DispatchQueue? = conf.Q.map, _ transform: @escaping(T.Iterator.Element) throws -> U) -> Promise<[U.Iterator.Element]> { return flatMapValues(on: on, transform) } #endif @available(*, deprecated, message: "See: `filterValues`") func filter(on: DispatchQueue? = conf.Q.map, test: @escaping (T.Iterator.Element) -> Bool) -> Promise<[T.Iterator.Element]> { return filterValues(on: on, test) } } public extension Thenable where T: Collection { @available(*, deprecated, message: "See: `firstValue`") var first: Promise<T.Iterator.Element> { return firstValue } @available(*, deprecated, message: "See: `lastValue`") var last: Promise<T.Iterator.Element> { return lastValue } } public extension Thenable where T: Sequence, T.Iterator.Element: Comparable { @available(*, deprecated, message: "See: `sortedValues`") func sorted(on: DispatchQueue? = conf.Q.map) -> Promise<[T.Iterator.Element]> { return sortedValues(on: on) } }
mit
ff0ac034d87b099d6d8cc0442c05f05d
33.494624
153
0.638404
3.730233
false
false
false
false
yellow-cat/SportTime
src/model/WorkoutsService/DTO/WorkoutStep.swift
1
780
// // WorkoutStep.swift // SportTime // // Created by Vladimir Popko on 1/12/15. // Copyright (c) 2015 visput. All rights reserved. // import UIKit class WorkoutStep: NSObject { private(set) var name:String = "" private(set) var duration:Int = 0 // [Sec] init(name:String, duration:Int) { super.init() self.name = name self.duration = duration } required init(coder aDecoder: NSCoder) { super.init() self.name = aDecoder.decodeObjectForKey("name") as String self.duration = aDecoder.decodeIntegerForKey("duration") } func encodeWithCoder(aCoder: NSCoder) { aCoder.encodeObject(self.name, forKey:"name") aCoder.encodeInteger(self.duration, forKey: "duration") } }
gpl-3.0
3ab320b42fcc55a3008320e437b3c076
24.16129
65
0.628205
3.939394
false
false
false
false
tensorflow/examples
lite/examples/bert_qa/ios/ViewInSwiftUI/KeyboardHeightObserver.swift
1
1573
// Copyright 2020 The TensorFlow Authors. All Rights Reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. import SwiftUI /// Observes keyboard height events. final class KeyboardHeightObserver: ObservableObject { @Published private(set) var height: CGFloat = 0 init() { NotificationCenter.default.addObserver( self, selector: #selector(keyBoardWillShow(notification:)), name: UIResponder.keyboardWillShowNotification, object: nil) NotificationCenter.default.addObserver( self, selector: #selector(keyBoardWillHide(notification:)), name: UIResponder.keyboardWillHideNotification, object: nil) } deinit { NotificationCenter.default.removeObserver(self) } @objc func keyBoardWillShow(notification: Notification) { if let keyboardFrame = (notification.userInfo?[UIResponder.keyboardFrameEndUserInfoKey] as? NSValue)? .cgRectValue { height = keyboardFrame.height } else { height = 0 } } @objc func keyBoardWillHide(notification: Notification) { height = 0 } }
apache-2.0
4a5bf2a62778f0ec81bdd92f4aeef42e
31.770833
84
0.731723
4.695522
false
false
false
false
CORDEA/ConviviumCalculator
ios (swift)/ConviviumCalculator/CsvIo.swift
1
3386
// // CsvIo.swift // ConviviumCalculator // // Created by Yoshihiro Tanaka on 2018/05/03. // import RxSwift import Realm import RealmSwift class CsvIo { private static let scheduler = SerialDispatchQueueScheduler(qos: .default) static func input(_ csv: String) -> Completable { return Single .create(subscribe: { (single) -> Disposable in do { single(.success(try Realm())) } catch let error { single(.error(error)) } return Disposables.create() }) .do(onSuccess: { (realm: Realm) in realm.beginWrite() realm.deleteAll() }) .asObservable() .flatMap { (realm: Realm) -> Observable<ListItem> in return createListItemFromCsv(csv) .do(onNext: { (item) in realm.add(item) }, onCompleted: { _ = try? realm.commitWrite() }) } .ignoreElements() .subscribeOn(scheduler) .observeOn(MainScheduler.instance) } static func output() -> Single<String> { return Single .create(subscribe: { (single) -> Disposable in do { single(.success(try Realm())) } catch let error { single(.error(error)) } return Disposables.create() }) .map { (realm: Realm) in return realm.objects(ListItem.self) } .asObservable() .flatMap { (items: Results<ListItem>) -> Observable<ListItem> in return Observable.from(items) } .map { (item: ListItem) in if let name = item.name { return String(format: "%@,%d,%@", name, item.price, String(item.isChecked)) } return "" } .toArray() .asSingle() .map { (items: [String]) -> String in return items.joined(separator: "\n") } .subscribeOn(scheduler) .observeOn(MainScheduler.instance) } private static func createListItemFromCsv(_ csv: String) -> Observable<ListItem> { return Single.just(csv) .asObservable() .flatMap { (lines: String) -> Observable<Array<Substring>> in return Observable.from(optional: lines.split(separator: "\n")) } .flatMap { (lines: Array<Substring>) -> Observable<Substring> in return Observable.from(lines) } .map { (line: Substring) in return line.split(separator: ",") } .map { (line: [Substring]) in return line.map { String($0) } } .filter { (line: [String]) -> Bool in return !line.isEmpty } .map { (line: [String]) -> ListItem in let item = ListItem() item.name = line[0] item.price = Int(line[1]) ?? 0 item.isChecked = line.count > 2 ? NSString(string: line[2]).boolValue : false return item } } }
apache-2.0
82d276d95d65035ce0a7670b50b379b2
32.196078
95
0.466037
4.964809
false
false
false
false
yorcent/spdbapp
spdbapp/spdbapp/AppManager.swift
1
8934
// // AppManager.swift // spdbapp // // Created by tommy on 15/5/11. // Copyright (c) 2015年 shgbit. All rights reserved. // import UIKit import Foundation import Alamofire class Poller { var timer: NSTimer? func start(obj: NSObject, method: Selector) { stop() timer = NSTimer(timeInterval: 3, target: obj, selector: method , userInfo: nil, repeats: true) NSRunLoop.currentRunLoop().addTimer(timer!, forMode: NSRunLoopCommonModes) } func stop() { if (isRun()){ timer?.invalidate() } } func isRun() -> Bool{ return (timer != nil && timer?.valid != nil) } } class AppManager : NSObject, UIAlertViewDelegate { dynamic var current : GBMeeting = GBMeeting() var reqData: String = "" var files: GBMeeting? var local : GBBox? let baseURL : String = "http://192.168.21.36:8080" var reqBoxURL : String? override init(){ super.init() reqBoxURL = self.baseURL + "/box" //定时器每隔2s检测当前current是否发生变化 var getCurrentPoller = Poller() getCurrentPoller.start(self, method: "getCurrent:") local = createBox() DownLoadManager.downLoadJSON() //println("reqdata = \(reqData)") } //register current ipad id to server,返回已经注册的id并保存 func registerCurrentId(){ let paras = ["id":GBNetwork.getMacId()] var id: NSString = "" Alamofire.request(.POST, reqBoxURL! ,parameters: paras, encoding: .JSON).responseJSON(options: NSJSONReadingOptions.MutableContainers) { (request,response, data, error) -> Void in println("data = \(data!)") if(error != nil){ NSLog("%@", error!) } if(response?.statusCode != 200){ println("res = \(response?.statusCode)") return } //如果注册成功,则保存当前的iPad的id至../Documents/idData.txt 目录文件中 if(response?.statusCode == 200){ id = (data?.objectForKey("id")) as! NSString self.idInfoSave(id) } } } //保存当前iPad的id func idInfoSave(id: NSString) { var idFilePath = NSHomeDirectory().stringByAppendingPathComponent("Documents/idData.txt") println("iffilepath = \(idFilePath)") var readData = NSData(contentsOfFile: idFilePath) var content = NSString(data: readData!, encoding: NSUTF8StringEncoding)! if(content == id){ return } var b = id.writeToFile(idFilePath, atomically: true, encoding: NSUTF8StringEncoding, error: nil) if b { NSLog("当前ipad的id保存成功") } else{ NSLog("请重新注册id") } } //读取本地iddata.txt中的id,若不存在,则重新注册并返回id,否则直接返回iddata.txt中的id func IsLocalExistID() -> Bool { var filePath = NSHomeDirectory().stringByAppendingPathComponent("Documents/idData.txt") //判断该文件是否存在,则创建该iddata. txt文件 var manager = NSFileManager.defaultManager() if !manager.fileExistsAtPath(filePath){ return false } return true } //根据id获取ipad所需信息 func createBox() -> GBBox{ //dynamic var respData = "" var result = GBBox() var idstr = NSString() var b = IsLocalExistID() var filePath = NSHomeDirectory().stringByAppendingPathComponent("Documents/idData.txt") //如果iddata文件夹不存在,则创建iddata.txt文件 if !b{ var manager = NSFileManager.defaultManager() var bCreateFile = manager.createFileAtPath(filePath, contents: nil, attributes: nil) if bCreateFile{ println("ok file create") idstr = GBNetwork.getMacId() } } var readData = NSData(contentsOfFile: filePath) idstr = NSString(data: readData!, encoding: NSUTF8StringEncoding)! as NSString //如果不存在,则GBNetwork.getMacId()赋给id if (idstr.length <= 0){ println("chongxin zhuce") idstr = GBNetwork.getMacId() } var urlString = "\(reqBoxURL!)?id=\(idstr)" NSLog("idstr = %@", idstr) Alamofire.request(.GET, urlString).responseJSON(options: NSJSONReadingOptions.MutableContainers) { (request, response, data, error) -> Void in if error != nil{ println("注册失败\(error)") return } println("getdata = \(data!)") //若返回值为not find type or name则弹出“请重新注册”的对话框,并且将当前的idstr进行注册并保存 // if((data?.isEqual("type or name is nil")) != nil){ // UIAlertView(title: "未注册id", message: "请先注册id", delegate: self, cancelButtonTitle: "重试").show() // self.registerCurrentId() // self.reqData = "type or name is nil" // } if(response?.statusCode == 200){ println("注册成功") result.macId = (data?.objectForKey("id")) as! String result.type = (data?.objectForKey("type")) as? GBMeetingType result.name = (data?.objectForKey("name")) as! String } //若不返回200则弹出“请重新注册”的对话框,并且将当前的idstr进行注册并保存 else { UIAlertView(title: "未注册id", message: "请先注册id", delegate: self, cancelButtonTitle: "重试").show() self.registerCurrentId() } } return result } //打印当前文件路径 func printFilePath()-> String{ var home = NSHomeDirectory() var docPath = home.stringByAppendingPathComponent("Documents") //NSLog("%@", docPath) return docPath } //获取当前会议current func getCurrent(timer: NSTimer){ var router = Router.GetCurrentMeeting() var docPath = NSHomeDirectory().stringByAppendingPathComponent("Documents") Alamofire.request(router.0,router.1).responseJSON(options: NSJSONReadingOptions.MutableContainers) { (request, response, data, error) -> Void in if error != nil { //网络出错时调用LocalCreateMeeting 方法,从本地获取会议资料创建会议 println("从服务器获取当前会议出错\(error)") println("会议信息将直接从本地读取,本地文件地址为\(docPath)") var builder = Builder() self.current = builder.LocalCreateMeeting() return // var localJSONPath = NSHomeDirectory().stringByAppendingPathComponent("Documents/jsondata.txt") // var filemanager = NSFileManager.defaultManager() // if filemanager.fileExistsAtPath(localJSONPath){ // var jsonLocal = filemanager.contentsAtPath(localJSONPath) // var json: AnyObject = NSJSONSerialization.JSONObjectWithData(jsonLocal!, options: NSJSONReadingOptions.AllowFragments, error: nil)! // var fileLists = json.objectForKey("files") as! NSMutableArray // self.current.id = json["_id"] as! String // self.current.name = json["name"] as! String // println(self.current.name) //println(fileLists) // var jsonLocalArray1 = [NSArray]() // var jsonLocalArray2 = [NSArray]() // jsonLocal = NSKeyedArchiver.archivedDataWithRootObject(jsonLocalArray1) // jsonLocalArray2 = NSKeyedUnarchiver.unarchiveObjectWithData(jsonLocal!) // } // return } var builder = Builder() let json = JSON(data!) var id = json["_id"].stringValue if self.current.isEqual(nil) { self.current = builder.CreateMeeting(json) DownLoadManager.downLoadAllFile() DownLoadManager.downLoadJSON() NSLog("self.current.id = %@", self.current.id) } if(self.current.id == id) { return } self.current = builder.CreateMeeting(json) DownLoadManager.downLoadAllFile() DownLoadManager.downLoadJSON() } } }
bsd-3-clause
0cc807acacf24e7a3d0e4885a7f88947
32.878049
187
0.552796
4.60442
false
false
false
false
LeaderQiu/SwiftDictModel
SwiftDictModel/SwiftDictModelTests/Dict2ModelTest.swift
3
2032
// // Dict2ModelTest.swift // SwiftDictModel // // Created by 刘凡 on 15/2/18. // Copyright (c) 2015年 joyios. All rights reserved. // import UIKit import XCTest class Dict2ModelTest: XCTestCase { override func setUp() { super.setUp() // Put setup code here. This method is called before the invocation of each test method in the class. } override func tearDown() { // Put teardown code here. This method is called after the invocation of each test method in the class. super.tearDown() } func testDict2Model() { var json: NSDictionary = serializationJSON("ModelInfo.json")! as! NSDictionary var modelInfo: ModelInfo? = modelManager.objectWithDictionary(json, cls: ModelInfo.self) as? ModelInfo printLog("------\(modelInfo)") printLog(modelInfo?.other?.modelName) printLog(modelInfo?.num) printLog(modelInfo?.others) } func testPerformence() { var json: NSDictionary = serializationJSON("ModelInfo.json")! as! NSDictionary performenceRunFunction(10000) { autoreleasepool({ () -> () in var modelInfo: ModelInfo? = modelManager.objectWithDictionary(json, cls: ModelInfo.self) as? ModelInfo }) } } func performenceRunFunction(var loopTimes:Int, testFunc: ()->()) { var start = CFAbsoluteTimeGetCurrent() println("测试开始...") for _ in 0...loopTimes { testFunc() } var end = CFAbsoluteTimeGetCurrent() println("运行 \(loopTimes) 次,耗时 \(end - start)") } func testModel2Dict() { var json: NSDictionary = serializationJSON("ModelInfo.json")! as! NSDictionary if let modelInfo: ModelInfo = modelManager.objectWithDictionary(json, cls: ModelInfo.self) as? ModelInfo { var dict = modelManager.objectDictionary(modelInfo) printLog(dict) } } }
mit
c9c2e7fcdaa17d874c905533a6f41ee8
29.861538
118
0.610169
4.559091
false
true
false
false
Eonil/EditorLegacy
Modules/EditorDebuggingFeature/EditorDebuggingFeature/ExecutionStateTreeViewController.swift
1
7734
// // ExecutionStateTreeViewController.swift // EditorDebuggingFeature // // Created by Hoon H. on 2015/02/02. // Copyright (c) 2015 Eonil. All rights reserved. // import Foundation import LLDBWrapper import EditorUIComponents public protocol ExecutionStateTreeViewControllerDelegate: class { /// Called user selected a new node. /// /// :param: frame Can be `nil` . func executionStateTreeViewControllerDidSelectFrame(frame:LLDBFrame?) } /// This is a snapshot display. You need to set a new snapshot to display updated state. /// This object REQUIRES delegate for every events. You must set a valid `delegate` object. /// /// This view-controller incorporates a scrolling support, so you should not wrap this in a /// scroll-view. public final class ExecutionStateTreeViewController: NSViewController, NSOutlineViewDataSource, NSOutlineViewDelegate { public weak var delegate:ExecutionStateTreeViewControllerDelegate? { willSet { assert(delegate == nil) } } public var snapshot:Snapshot? { didSet { super.representedObject = self.snapshot?.rootNode self._rootNode = self.snapshot?.rootNode self.outlineView.reloadData() for n in _rootNode?.subnodes ||| [] { self.outlineView.expandItem(n, expandChildren: true) } } } @availability(*,unavailable) public final override var representedObject:AnyObject? { get { deletedPropertyFatalError() } set(v) { deletedPropertyFatalError() } } public final override var view:NSView { willSet { fatalError("You cannot replace view of this view-controller. It is prohibited by design.") } } public override func loadView() { super.view = NSScrollView() } public override func viewDidLoad() { super.viewDidLoad() assert(super.view is NSScrollView) scrollView.hasVerticalScroller = true scrollView.hasHorizontalRuler = false scrollView.documentView = outlineView //// self.outlineView.setDataSource(self) self.outlineView.setDelegate(self) self.outlineView.headerView = nil self.outlineView.rowHeight = Palette.defaultLineHeight let tc1 = NSTableColumn() self.outlineView.addTableColumn(tc1) self.outlineView.outlineTableColumn = tc1 } public func outlineView(outlineView: NSOutlineView, numberOfChildrenOfItem item: AnyObject?) -> Int { if item == nil { return _rootNode?.subnodes.count ||| 0 } let n = item as! NodeBase return n.subnodes.count } public func outlineView(outlineView: NSOutlineView, child index: Int, ofItem item: AnyObject?) -> AnyObject { if item == nil { return _rootNode!.subnodes[index] } let n = item as! NodeBase return n.subnodes[index] } // public func outlineView(outlineView: NSOutlineView, objectValueForTableColumn tableColumn: NSTableColumn?, byItem item: AnyObject?) -> AnyObject? { // let n = item as NodeBase // return n.label // } public func outlineView(outlineView: NSOutlineView, isItemExpandable item: AnyObject) -> Bool { return self.outlineView(outlineView, numberOfChildrenOfItem: item) > 0 } public func outlineView(outlineView: NSOutlineView, rowViewForItem item: AnyObject) -> NSTableRowView? { let v = DarkVibrancyAwareTableRowView() // v.appearance = outlineView.appearance return v } public func outlineView(outlineView: NSOutlineView, viewForTableColumn tableColumn: NSTableColumn?, item: AnyObject) -> NSView? { let n = item as! NodeBase let v = AttributedStringTableCellView() v.attributedString = Text(n.label).setFont(Palette.defaultFont()).setTextColor(NSColor.labelColor()).attributedString // v.appearance = outlineView.appearance return v } public func outlineView(outlineView: NSOutlineView, shouldSelectItem item: AnyObject) -> Bool { assert(self.delegate != nil) if let fn = item as? FrameNode { self.delegate!.executionStateTreeViewControllerDidSelectFrame(fn.data) } else { self.delegate!.executionStateTreeViewControllerDidSelectFrame(nil) } return true } //// internal let outlineView = NSOutlineView() internal var scrollView:NSScrollView { get { return view as! NSScrollView } } //// private var _rootNode:DebuggerNode? } public extension ExecutionStateTreeViewController { public struct Snapshot { public init(_ debugger:LLDBDebugger) { self.rootNode = DebuggerNode(debugger) } private let rootNode:DebuggerNode } } /// MARK: /// MARK: Node Classes private class NodeBase { var label = NSAttributedString() var subnodes = [] as [NodeBase] } private class DebuggerNode: NodeBase { var data:LLDBDebugger init(_ data:LLDBDebugger) { self.data = data super.init() self.label = Text("Debugger").attributedString self.subnodes = data.allTargets.map({ v in TargetNode(v) }) } } private class TargetNode: NodeBase { var data:LLDBTarget init(_ data:LLDBTarget) { self.data = data super.init() self.label = Text("\(data.executableFileSpec().filename) (\(data.triple()))").attributedString self.subnodes = data.process == nil ? [] : [ProcessNode(data.process)] } } private class ProcessNode: NodeBase { var data:LLDBProcess init(_ data:LLDBProcess) { self.data = data super.init() let ps2 = data.state == LLDBStateType.Exited ? [ processStateDescription(data.state), "=", data.exitStatus.description, ] : [ processStateDescription(data.state), ] let ps3 = ps2 + (data.exitDescription == nil ? [] : [quote(data.exitDescription)]) let s3 = join(" ", ps3.filter({ v in v != "" })) let ps4 = [ "PID", "=", data.processID.description, brace(s3), ] let s = join(" ", ps4.filter({ v in v != "" })) self.label = Text(s).attributedString self.subnodes = data.allThreads.map({ v in ThreadNode(v) }) } } private class ThreadNode: NodeBase { var data:LLDBThread init(_ data:LLDBThread) { self.data = data super.init() let ps = [ "TID", "=", data.threadID.description, quote(data.name), quote(data.queueName), brace(data.stopDescription()), ] let s = join(" ", ps.filter({ v in v != "" })) self.label = Text(s).attributedString self.subnodes = data.allFrames.filter({ v in v != nil }).map({ v in FrameNode(v!) }) } } private class FrameNode: NodeBase { var data:LLDBFrame init(_ data:LLDBFrame) { self.data = data super.init() let s = "\(data.frameID) \(data.functionName)" self.label = Text(s).attributedString self.subnodes = [] } } private func processStateDescription(s:LLDBStateType) -> String { switch s { case .Attaching: return "attached" case .Connected: return "connected" case .Crashed: return "crashed" case .Detached: return "detached" case .Exited: return "exited" case .Invalid: return "invalid" case .Launching: return "launching" case .Running: return "running" case .Stepping: return "stepping" case .Stopped: return "stopped" case .Suspended: return "suspended" case .Unloaded: return "unloaded" } } private func threadStopReasonDescription(s:LLDBStopReason) -> String { switch s { case .Breakpoint: return "breakpoint" case .Exception: return "exception" case .Exec: return "exec" case .Instrumentation: return "instrumentation" case .Invalid: return "invalid" case .None: return "none" case .PlanComplete: return "plan complete" case .Signal: return "signal" case .ThreadExiting: return "thread exiting" case .Trace: return "trace" case .Watchpoint: return "watchpoint" } } private func quote(s:String?) -> String { if let s1 = s { return "`\(s!)`" } return "" } private func brace(s:String?) -> String { if let s1 = s { return "(\(s!))" } return "" }
mit
920b4f90de21c6dd2b939268fd419dd2
19.846361
150
0.696535
3.279898
false
false
false
false
cliffpanos/True-Pass-iOS
iOSApp/CheckIn/Primary Controllers/SplitViewController.swift
1
2966
// // SplitViewController.swift // True Pass // // Created by Cliff Panos on 6/19/17. // Copyright © 2017 Clifford Panos. All rights reserved. // import UIKit class SplitViewController: UISplitViewController, UISplitViewControllerDelegate { weak static var instance: SplitViewController? static var isShowingPrimary: Bool { guard let instance = instance else { return false } for vc in instance.viewControllers { if vc is PassesViewController { return true } } return false } static var isShowingDetail: Bool { guard let instance = instance else { return false } for vc in instance.viewControllers { if vc is PassDetailNavigationController { return true } } return false } override func viewDidLoad() { super.viewDidLoad() SplitViewController.instance = self self.delegate = self self.presentsWithGesture = true } override func viewWillAppear(_ animated: Bool) { super.viewWillAppear(animated) } func primaryViewController(forCollapsing splitViewController: UISplitViewController) -> UIViewController? { print("primary for collapsing \(viewControllers[0])") return viewControllers[0] } func splitViewController(_ svc: UISplitViewController, shouldHide vc: UIViewController, in orientation: UIInterfaceOrientation) -> Bool { //print("hide? \(vc)") if vc is PassesNavigationController || vc is PassDetailNavigationController { return false } print("hiding") return true } // func splitViewController(_ splitViewController: UISplitViewController, // collapseSecondary secondaryViewController: UIViewController, // onto primaryViewController: UIViewController) -> Bool{ // print("collapse second?") // guard let secondaryAsNavController = secondaryViewController as? PassDetailNavigationController else { return false } // guard let topAsDetailController = secondaryAsNavController.topViewController as? PassDetailEmbedderController else { print("didnt find embedder"); return false } // if topAsDetailController.pass == nil { // // Return true to indicate that we have handled the collapse by doing nothing; the secondary controller will be discarded. // print("discarding second VC") // return true // } // print("made it to end") // return false // } deinit { SplitViewController.instance = nil } /* // MARK: - Navigation // In a storyboard-based application, you will often want to do a little preparation before navigation override func prepare(for segue: UIStoryboardSegue, sender: Any?) { // Get the new view controller using segue.destinationViewController. // Pass the selected object to the new view controller. } */ }
apache-2.0
a82903436e3ba3ab79304c70efbe0e16
35.604938
171
0.668128
5.531716
false
false
false
false
stripe/stripe-ios
StripeUICore/StripeUICore/Source/Controls/ActivityIndicator.swift
1
7078
// // ActivityIndicator.swift // StripeUICore // // Created by Ramon Torres on 12/3/21. // Copyright © 2021 Stripe, Inc. All rights reserved. // import UIKit /// A custom replacement for `UIActivityIndicatorView`. /// For internal SDK use only @objc(STP_Internal_ActivityIndicator) @_spi(STP) public final class ActivityIndicator: UIView { #if DEBUG /// Disables animation. This should be only be modified for snapshot tests. public static var isAnimationEnabled = true #endif struct Constants { /// Animation speed in revolutions per second static let animationSpeed: Double = 1.8 static let animationKey: String = "spin" } /// Size of the activity indicator. public enum Size { /// The default size of an activity indicator (20x20). case medium /// A large activity indicator (37x37). case large } /// If `true`, the activity indicator will hide itself when not animating. public var hidesWhenStopped: Bool = true { didSet { if hidesWhenStopped { updateVisibility() } else { isHidden = false } } } /// The color of the activity indicator. public var color: UIColor { get { return tintColor } set { tintColor = newValue } } public private(set) var isAnimating: Bool = false private let size: Size private var radius: CGFloat { switch size { case .medium: return 8 case .large: return 14.5 } } private var thickness: CGFloat { switch size { case .medium: return 2 case .large: return 4 } } private lazy var cometLayer: CAGradientLayer = { let shape = CAShapeLayer() shape.path = makeArcPath(radius: radius, startAngle: 0.05, endAngle: 0.95) shape.lineWidth = thickness shape.lineCap = .round shape.strokeColor = UIColor.black.cgColor shape.fillColor = UIColor.clear.cgColor let gradientLayer = CAGradientLayer() gradientLayer.type = .conic gradientLayer.startPoint = CGPoint(x: 0.5, y: 0.5) gradientLayer.endPoint = CGPoint(x: 1, y: 0.5) gradientLayer.anchorPoint = CGPoint(x: 0.5, y: 0.5) gradientLayer.contentsGravity = .center gradientLayer.mask = shape return gradientLayer }() private var contentLayer: CALayer { return cometLayer } public override var intrinsicContentSize: CGSize { let size: CGFloat = (radius + thickness) * 2 return CGSize(width: size, height: size) } public convenience init() { self.init(size: .medium) } /// Creates a new activity indicator. /// - Parameter size: Size of the activity indicator. public init(size: Size) { self.size = size super.init(frame: .zero) layer.addSublayer(contentLayer) setContentHuggingPriority(.defaultHigh, for: .horizontal) setContentHuggingPriority(.defaultHigh, for: .vertical) updateVisibility() updatecolor() NotificationCenter.default.addObserver( self, selector: #selector(applicationWillEnterForeground(_:)), name: UIApplication.willEnterForegroundNotification, object: nil ) } deinit { NotificationCenter.default.removeObserver(self) } public required init?(coder: NSCoder) { fatalError("init(coder:) has not been implemented") } public override func tintColorDidChange() { super.tintColorDidChange() updatecolor() } public override func traitCollectionDidChange(_ previousTraitCollection: UITraitCollection?) { super.traitCollectionDidChange(previousTraitCollection) updatecolor() } public override func layoutSubviews() { super.layoutSubviews() CATransaction.begin() // `bounds` and `position` are both animatable. Disable actions to turn off // implicit animations when updating them. CATransaction.setDisableActions(true) contentLayer.bounds = CGRect(origin: .zero, size: intrinsicContentSize) contentLayer.position = CGPoint(x: bounds.midX, y: bounds.midY) CATransaction.commit() } public override func willMove(toWindow newWindow: UIWindow?) { super.willMove(toWindow: newWindow) if let window = newWindow { contentLayer.shouldRasterize = true contentLayer.rasterizationScale = window.screen.scale } if isAnimating { startAnimating() } else { stopAnimating() } } } // MARK: - Methods public extension ActivityIndicator { func startAnimating() { defer { isAnimating = true updateVisibility() } #if DEBUG guard ActivityIndicator.isAnimationEnabled else { return } #endif let rotatingAnimation = CABasicAnimation(keyPath: "transform.rotation.z") rotatingAnimation.byValue = 2 * Float.pi rotatingAnimation.duration = 1 / Constants.animationSpeed rotatingAnimation.isAdditive = true rotatingAnimation.repeatCount = .infinity contentLayer.add(rotatingAnimation, forKey: Constants.animationKey) } func stopAnimating() { contentLayer.removeAnimation(forKey: Constants.animationKey) isAnimating = false updateVisibility() } } // MARK: - Private methods private extension ActivityIndicator { func updatecolor() { // Tint color gradient from 0% to 100% alpha cometLayer.colors = [ tintColor.withAlphaComponent(0).cgColor, tintColor.cgColor ] } @objc func applicationWillEnterForeground(_ notification: Notification) { if isAnimating { // Resume animations startAnimating() } } func updateVisibility() { if hidesWhenStopped { isHidden = !isAnimating } } /// Creates an path containing an arc shape of a given radius and angles. /// /// Angles must be expressed in turns. /// /// <https://en.wikipedia.org/wiki/Turn_(angle)> /// /// - Parameters: /// - radius: Arc radius. /// - startAngle: Start angle. /// - endAngle: End angle. /// - Returns: Arc path. func makeArcPath(radius: CGFloat, startAngle: CGFloat, endAngle: CGFloat) -> CGPath { let path = CGMutablePath() let center = CGPoint( x: intrinsicContentSize.width / 2, y: intrinsicContentSize.height / 2 ) path.addArc( center: center, radius: radius, startAngle: CGFloat.pi * 2 * startAngle, endAngle: CGFloat.pi * 2 * endAngle, clockwise: false ) return path } }
mit
510a7c12e356f71ecb5278496a566acc
25.908745
98
0.604776
5.084052
false
false
false
false
stripe/stripe-ios
Stripe/STPPaymentCardTextFieldCell.swift
1
2608
// // STPPaymentCardTextFieldCell.swift // StripeiOS // // Created by Jack Flintermann on 6/16/16. // Copyright © 2016 Stripe, Inc. All rights reserved. // @_spi(STP) import StripePaymentsUI import UIKit class STPPaymentCardTextFieldCell: UITableViewCell { private(set) weak var paymentField: STPPaymentCardTextField? var theme: STPTheme = STPTheme.defaultTheme { didSet { updateAppearance() } } private var _inputAccessoryView: UIView? override var inputAccessoryView: UIView? { get { _inputAccessoryView } set(inputAccessoryView) { _inputAccessoryView = inputAccessoryView paymentField?.inputAccessoryView = inputAccessoryView } } func isEmpty() -> Bool { return (paymentField?.cardNumber?.count ?? 0) == 0 } override init( style: UITableViewCell.CellStyle, reuseIdentifier: String? ) { super.init(style: style, reuseIdentifier: reuseIdentifier) let paymentField = STPPaymentCardTextField(frame: bounds) paymentField.postalCodeEntryEnabled = false contentView.addSubview(paymentField) self.paymentField = paymentField theme = STPTheme.defaultTheme updateAppearance() } override func layoutSubviews() { super.layoutSubviews() paymentField?.frame = contentView.bounds } @objc func updateAppearance() { paymentField?.backgroundColor = UIColor.clear paymentField?.placeholderColor = theme.tertiaryForegroundColor paymentField?.borderColor = UIColor.clear paymentField?.textColor = theme.primaryForegroundColor paymentField?.textErrorColor = theme.errorColor paymentField?.font = theme.font backgroundColor = theme.secondaryBackgroundColor } @objc override func becomeFirstResponder() -> Bool { return paymentField?.becomeFirstResponder() ?? false } override func accessibilityElementCount() -> Int { return paymentField?.allFields.count ?? 0 } override func accessibilityElement(at index: Int) -> Any? { return paymentField?.allFields[index] } override func index(ofAccessibilityElement element: Any) -> Int { let fields = paymentField?.allFields for i in 0..<(fields?.count ?? 0) { if (element as? AnyHashable) == fields?[i] { return i } } return 0 } required init?( coder aDecoder: NSCoder ) { super.init(coder: aDecoder) } }
mit
992f3ecafc3387597562afcae1cd36e1
27.648352
70
0.642501
5.23494
false
false
false
false
UberJason/DateTools
DateToolsSwift/DateTools/Date+TimeAgo.swift
1
10569
// // Date+TimeAgo.swift // DateToolsTests // // Created by Matthew York on 8/23/16. // Copyright © 2016 Matthew York. All rights reserved. // import Foundation /** * Extends the Date class by adding convenient methods to display the passage of * time in String format. */ public extension Date { //MARK: - Time Ago /** * Takes in a date and returns a string with the most convenient unit of time representing * how far in the past that date is from now. * * - parameter date: Date to be measured from now * * - returns String - Formatted return string */ static func timeAgo(since date:Date) -> String{ return date.timeAgo(since: Date(), numericDates: false, numericTimes: false) } /** * Takes in a date and returns a shortened string with the most convenient unit of time representing * how far in the past that date is from now. * * - parameter date: Date to be measured from now * * - returns String - Formatted return string */ static func shortTimeAgo(since date:Date) -> String { return date.shortTimeAgo(since:Date()) } /** * Returns a string with the most convenient unit of time representing * how far in the past that date is from now. * * - returns String - Formatted return string */ var timeAgoSinceNow: String { return self.timeAgo(since:Date()) } /** * Returns a shortened string with the most convenient unit of time representing * how far in the past that date is from now. * * - returns String - Formatted return string */ var shortTimeAgoSinceNow: String { return self.shortTimeAgo(since:Date()) } func timeAgo(since date:Date, numericDates: Bool = false, numericTimes: Bool = false) -> String { let calendar = NSCalendar.current let unitFlags = Set<Calendar.Component>([.second,.minute,.hour,.day,.weekOfYear,.month,.year]) let earliest = self.earlierDate(date) let latest = (earliest == self) ? date : self //Should be triple equals, but not extended to Date at this time let components = calendar.dateComponents(unitFlags, from: earliest, to: latest) let yesterday = latest.subtract(1.days) let isYesterday = yesterday.day == earliest.day //Not Yet Implemented/Optional //The following strings are present in the translation files but lack logic as of 2014.04.05 //@"Today", @"This week", @"This month", @"This year" //and @"This morning", @"This afternoon" if (components.year! >= 2) { return self.logicalLocalizedStringFromFormat(format: "%%d %@years ago", value: components.year!) } else if (components.year! >= 1) { if (numericDates) { return DateToolsLocalizedStrings("1 year ago"); } return DateToolsLocalizedStrings("Last year"); } else if (components.month! >= 2) { return self.logicalLocalizedStringFromFormat(format: "%%d %@months ago", value: components.month!) } else if (components.month! >= 1) { if (numericDates) { return DateToolsLocalizedStrings("1 month ago"); } return DateToolsLocalizedStrings("Last month"); } else if (components.weekOfYear! >= 2) { return self.logicalLocalizedStringFromFormat(format: "%%d %@weeks ago", value: components.weekOfYear!) } else if (components.weekOfYear! >= 1) { if (numericDates) { return DateToolsLocalizedStrings("1 week ago"); } return DateToolsLocalizedStrings("Last week"); } else if (components.day! >= 2) { return self.logicalLocalizedStringFromFormat(format: "%%d %@days ago", value: components.day!) } else if (components.day! >= 1) { if (isYesterday) { if (numericDates) { return DateToolsLocalizedStrings("1 day ago"); } return DateToolsLocalizedStrings("Yesterday"); } else { return DateToolsLocalizedStrings("1 day ago") } } else if (components.hour! >= 2) { return self.logicalLocalizedStringFromFormat(format: "%%d %@hours ago", value: components.hour!) } else if (components.hour! >= 1) { if (numericTimes) { return DateToolsLocalizedStrings("1 hour ago"); } return DateToolsLocalizedStrings("An hour ago"); } else if (components.minute! >= 2) { return self.logicalLocalizedStringFromFormat(format: "%%d %@minutes ago", value: components.minute!) } else if (components.minute! >= 1) { if (numericTimes) { return DateToolsLocalizedStrings("1 minute ago"); } return DateToolsLocalizedStrings("A minute ago"); } else if (components.second! >= 3) { return self.logicalLocalizedStringFromFormat(format: "%%d %@seconds ago", value: components.second!) } else { if (numericTimes) { return DateToolsLocalizedStrings("1 second ago"); } return DateToolsLocalizedStrings("Just now"); } } func shortTimeAgo(since date:Date) -> String { let calendar = NSCalendar.current let unitFlags = Set<Calendar.Component>([.second,.minute,.hour,.day,.weekOfYear,.month,.year]) let earliest = self.earlierDate(date) let latest = (earliest == self) ? date : self //Should pbe triple equals, but not extended to Date at this time let components = calendar.dateComponents(unitFlags, from: earliest, to: latest) let yesterday = date.subtract(1.days) let isYesterday = yesterday.day == self.day if (components.year! >= 1) { return self.logicalLocalizedStringFromFormat(format: "%%d%@y", value: components.year!) } else if (components.month! >= 1) { return self.logicalLocalizedStringFromFormat(format: "%%d%@M", value: components.month!) } else if (components.weekOfYear! >= 1) { return self.logicalLocalizedStringFromFormat(format: "%%d%@w", value: components.weekOfYear!) } else if (components.day! >= 2) { return self.logicalLocalizedStringFromFormat(format: "%%d%@d", value: components.day!) } else if (isYesterday) { return self.logicalLocalizedStringFromFormat(format: "%%d%@d", value: 1) } else if (components.hour! >= 1) { return self.logicalLocalizedStringFromFormat(format: "%%d%@h", value: components.hour!) } else if (components.minute! >= 1) { return self.logicalLocalizedStringFromFormat(format: "%%d%@m", value: components.minute!) } else if (components.second! >= 3) { return self.logicalLocalizedStringFromFormat(format: "%%d%@s", value: components.second!) } else { return self.logicalLocalizedStringFromFormat(format: "%%d%@s", value: components.second!) //return DateToolsLocalizedStrings(@"Now"); //string not yet translated 2014.04.05 } } private func logicalLocalizedStringFromFormat(format: String, value: Int) -> String{ #if os(Linux) let localeFormat = String.init(format: format, getLocaleFormatUnderscoresWithValue(Double(value)) as! CVarArg) // this may not work, unclear!! #else let localeFormat = String.init(format: format, getLocaleFormatUnderscoresWithValue(Double(value))) #endif return String.init(format: DateToolsLocalizedStrings(localeFormat), value) } private func getLocaleFormatUnderscoresWithValue(_ value: Double) -> String{ let localCode = Bundle.main.preferredLocalizations[0] if (localCode == "ru" || localCode == "uk") { let XY = Int(floor(value).truncatingRemainder(dividingBy: 100)) let Y = Int(floor(value).truncatingRemainder(dividingBy: 10)) if(Y == 0 || Y > 4 || (XY > 10 && XY < 15)) { return "" } if(Y > 1 && Y < 5 && (XY < 10 || XY > 20)) { return "_" } if(Y == 1 && XY != 11) { return "__" } } return "" } // MARK: - Localization private func DateToolsLocalizedStrings(_ string: String) -> String { //let classBundle = Bundle(for:TimeChunk.self as! AnyClass.Type).resourcePath!.appending("DateTools.bundle") //let bundelPath = Bundle(path:classBundle)! #if os(Linux) // NSLocalizedString() is not available yet, see: https://github.com/apple/swift-corelibs-foundation/blob/16f83ddcd311b768e30a93637af161676b0a5f2f/Foundation/NSData.swift // However, a seemingly-equivalent method from NSBundle is: https://github.com/apple/swift-corelibs-foundation/blob/master/Foundation/NSBundle.swift return Bundle.main.localizedString(forKey: string, value: "", table: "DateTools") #else return NSLocalizedString(string, tableName: "DateTools", bundle: Bundle.dateToolsBundle(), value: "", comment: "") #endif } // MARK: - Date Earlier/Later /** * Return the earlier of two dates, between self and a given date. * * - parameter date: The date to compare to self * * - returns: The date that is earlier */ func earlierDate(_ date:Date) -> Date{ return (self.timeIntervalSince1970 <= date.timeIntervalSince1970) ? self : date } /** * Return the later of two dates, between self and a given date. * * - parameter date: The date to compare to self * * - returns: The date that is later */ func laterDate(_ date:Date) -> Date{ return (self.timeIntervalSince1970 >= date.timeIntervalSince1970) ? self : date } }
mit
e61865ef890b5ebdf10318101db94206
36.742857
178
0.580431
4.633056
false
false
false
false
azimin/AZTabBarController
Source/UIView+Extensions.swift
1
1200
// // UIView+Extensions.swift // AZTabBarController // // Created by Alex Zimin on 15/11/2016. // Copyright © 2016 Alexander Zimin. All rights reserved. // import UIKit internal extension UIView { class func az_viewFromNib() -> Self { return self.az_viewFromNib(withOwner: nil) } class func az_viewFromNib(withOwner owner: Any?) -> Self { let name = NSStringFromClass(self as AnyClass).components(separatedBy: ".").last! let view = UINib(nibName: name, bundle: nil).instantiate(withOwner: owner, options: nil).first! // assert((view is self), nil) return cast(view)! } func az_loadFromNibIfEmbeddedInDifferentNib() -> Self { // based on: http://blog.yangmeyer.de/blog/2012/07/09/an-update-on-nested-nib-loading let isJustAPlaceholder = self.subviews.count == 0 if isJustAPlaceholder { let theRealThing = type(of: self).az_viewFromNib(withOwner: nil) theRealThing.frame = self.frame self.translatesAutoresizingMaskIntoConstraints = false theRealThing.translatesAutoresizingMaskIntoConstraints = false return theRealThing } return self } } private func cast<T, U>(_ value: T) -> U? { return value as? U }
mit
79f247ad84ce2be42e8eb575a9201ffe
29.74359
99
0.696414
3.880259
false
false
false
false
mrommel/MiRoRecipeBook
MiRoRecipeBook/MiRoRecipeBook/Presentation/Recipes/RecipeDetailTableViewDelegate.swift
1
3028
// // IngredientsAndStepsTableViewDelegate.swift // MiRoRecipeBook // // Created by Michael Rommel on 15.12.16. // Copyright © 2016 MiRo Soft. All rights reserved. // import UIKit class RecipeDetailHeaderView: UITableViewCell { @IBOutlet weak public var titleLabel: UILabel! @IBOutlet weak public var descLabel: UILabel! @IBOutlet weak public var durationLabel: UILabel! @IBOutlet weak public var portionsLabel: UILabel! @IBOutlet weak public var sectionLabel: UILabel! } class RecipeDetailTableViewDelegate: NSObject, UITableViewDelegate { func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { tableView.deselectRow(at: indexPath, animated: true) } func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? { let footerView = UIView(frame: CGRect(x:0,y: 0,width: tableView.frame.size.width,height: 1)) footerView.backgroundColor = ColorPalette.gray25 return footerView } func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? { // This is where you would change section header content let headerView = tableView.dequeueReusableCell(withIdentifier: "header") as? RecipeDetailHeaderView if section == 1 { headerView?.titleLabel?.isHidden = true headerView?.descLabel?.isHidden = true headerView?.portionsLabel?.isHidden = true headerView?.durationLabel?.isHidden = true headerView?.sectionLabel?.text = "steps".localized } else { let ds = tableView.dataSource as! RecipeDetailTableViewDatasource? let recipe = ds?.recipe headerView?.titleLabel?.text = recipe?.name headerView?.titleLabel?.isHidden = false headerView?.descLabel?.text = recipe?.desc headerView?.descLabel?.isHidden = false headerView?.portionsLabel?.text = "portions".localized + ": \((recipe?.portions)!)" headerView?.portionsLabel?.isHidden = false headerView?.durationLabel?.text = "duration".localized + ": \((recipe?.time)!) " + "min".localized headerView?.durationLabel?.isHidden = false headerView?.sectionLabel?.text = "ingredients".localized } return headerView } func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat { if indexPath.section == 0 { return 60 } else { return UITableView.automaticDimension } } func tableView(_ tableView: UITableView, heightForFooterInSection section: Int) -> CGFloat { return 1.0 } func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat { if section == 0 { return 160 } return 40.0 } }
gpl-3.0
ab7ab10c2bd8727d3cdd16769ebecf43
34.197674
110
0.63264
5.454054
false
false
false
false
FsThatOne/OneSunChat
OneSunChat/OneSunChat/BasicClass/BasicViewController.swift
1
1546
// // OSunBasicViewController.swift // OneSunChat // // Created by 刘ToTo on 16/2/19. // Copyright © 2016年 刘ToTo. All rights reserved. // import UIKit class BasicViewController: UIViewController { // MARK: - layout override func viewDidLoad() { super.viewDidLoad() view.backgroundColor = kLightBackGroundColor } // MARK: - lazyloading lazy var backBarButton: UIBarButtonItem = { let backImage:UIImage = UIImage(named: "back_nav_icon")! var backBarButton = UIBarButtonItem(image: backImage, style: .plain, target: self, action: #selector(backBarClick)) return backBarButton }() } // MARK: - convenience extension BasicViewController{ convenience init(title: String, imageName: String?) { self.init() self.title = title //如果imageName为空则直接返回 guard (imageName != nil) else{ return } tabBarItem.image = UIImage(name: imageName!, renderingMode: .alwaysOriginal) tabBarItem.selectedImage = UIImage(name: imageName! + "HL", renderingMode: .alwaysOriginal) } convenience init(title: String, hiddenTabBar: Bool) { self.init(title: title, imageName: nil) hidesBottomBarWhenPushed = hiddenTabBar } } // MARK: - custom method extension BasicViewController{ func backBarClick(){ if (self.navigationController != nil) { self.navigationController!.popViewController(animated: true) } } }
mit
ddea2e5bce9b00e328eb9ccffd50507f
25.224138
123
0.639053
4.473529
false
false
false
false
mihaicris/learn
Intro_TDD_Workshop/Tests/BalanceTests/BalanceTests.swift
1
3140
import XCTest @testable import Balance class BalanceTests: XCTestCase { var account: Account! override func setUp() { account = BalanceTests.buildAccount() } override func tearDown() { account = nil super.tearDown() } func test_get_balance_for_new_account_is_zero() { let balance = account.getBalance() XCTAssertEqual(balance, 0) } func test_deposit_0_throws_exeption() { try assert(account.deposit(amount: 0), throwsError: AccountOperationError.amountNotPositive) } func test_deposit_negative_amount_throws_exeption() { try assert(account.deposit(amount: -100), throwsError: AccountOperationError.amountNotPositive) } func test_deposit_more_than_max_amount_throws_exeption() { XCTAssertThrowsError(try account.deposit(amount: 1000)) } func test_deposit_100_in_new_account_results_a_balance_of_100() { do { try account.deposit(amount: 100) } catch { XCTFail("Deposit 100 in an empty account should not throw") } let balance = account.getBalance() XCTAssertEqual(balance, 100) } func test_deposit_noninteger_amount() { do { try account.deposit(amount: 100.5) } catch { XCTFail("Deposit 100 in an empty account should not throw") } let balance = account.getBalance() XCTAssertEqual(balance, 100.5) } func test_deposit_dollars_result_correct_balance_in_ron() { do { try account.deposit(amount: 1, currency: .usd) } catch { XCTFail("Deposit 100 in an empty account should not throw") } let balance = account.getBalance() XCTAssertEqual(balance, 4) } // MARK: - Helper Methods private func assert<T, E: Error>(_ expression: @autoclosure () throws -> T, throwsError expectedError: E) where E: Equatable { do { _ = try expression() XCTFail("Expected error to be thrown") } catch let error as E { XCTAssertEqual(error, expectedError) } catch { XCTFail("Unexpected error type: \(type(of: error))") } } private static func buildAccount() -> Account { return Account() } } extension BalanceTests { static var allTests = [ ("test_deposit_0_throws_exeption", test_deposit_0_throws_exeption), ("test_deposit_negative_amount_throws_exeption", test_deposit_negative_amount_throws_exeption), ("test_deposit_more_than_max_amount_throws_exeption", test_deposit_more_than_max_amount_throws_exeption), ("test_get_balance_for_new_account_is_zero", test_get_balance_for_new_account_is_zero), ("test_deposit_noninteger_amount", test_deposit_noninteger_amount), ("test_deposit_dollars_result_correct_balance_in_ron", test_deposit_dollars_result_correct_balance_in_ron), ("test_deposit_100_in_new_account_results_a_balance_of_100", test_deposit_100_in_new_account_results_a_balance_of_100), ] }
mit
bea211fe3c6ebf66d1550ce61c265771
33.130435
130
0.621975
4.077922
false
true
false
false
yangchenghu/actor-platform
actor-apps/app-ios/ActorApp/Controllers/Conversation/Cells/AABubbleMediaCell.swift
6
14622
// // Copyright (c) 2014-2015 Actor LLC. <https://actor.im> // import Foundation class AABubbleMediaCell : AABubbleBaseFileCell, NYTPhotosViewControllerDelegate { // Views let preview = UIImageView() let progress = CircullarLayerProgress(size: CGSizeMake(64, 64)) let timeBg = UIImageView() let timeLabel = UILabel() let statusView = UIImageView() // Binded data var bindedLayout: MediaCellLayout! var thumbLoaded = false var contentLoaded = false // Constructors init(frame: CGRect) { super.init(frame: frame, isFullSize: false) timeBg.image = Imaging.imageWithColor(MainAppTheme.bubbles.mediaDateBg, size: CGSize(width: 1, height: 1)) timeLabel.font = UIFont.italicSystemFontOfSize(11) timeLabel.textColor = MainAppTheme.bubbles.mediaDate statusView.contentMode = UIViewContentMode.Center mainView.addSubview(preview) mainView.addSubview(progress) mainView.addSubview(timeBg) mainView.addSubview(timeLabel) mainView.addSubview(statusView) preview.addGestureRecognizer(UITapGestureRecognizer(target: self, action: "mediaDidTap")) preview.userInteractionEnabled = true contentInsets = UIEdgeInsets(top: 1, left: 1, bottom: 1, right: 1) } required init(coder aDecoder: NSCoder) { fatalError("init(coder:) has not been implemented") } // Binding override func bind(message: ACMessage, reuse: Bool, cellLayout: CellLayout, setting: CellSetting) { self.bindedLayout = cellLayout as! MediaCellLayout bubbleInsets = UIEdgeInsets( top: setting.clenchTop ? AABubbleCell.bubbleTopCompact : AABubbleCell.bubbleTop, left: 10 + (isIPad ? 16 : 0), bottom: setting.clenchBottom ? AABubbleCell.bubbleBottomCompact : AABubbleCell.bubbleBottom, right: 10 + (isIPad ? 16 : 0)) if (!reuse) { // Bind bubble if (self.isOut) { bindBubbleType(BubbleType.MediaOut, isCompact: false) } else { bindBubbleType(BubbleType.MediaIn, isCompact: false) } // Reset content state self.preview.image = nil contentLoaded = false thumbLoaded = false // Reset progress self.progress.hideButton() UIView.animateWithDuration(0, animations: { () -> Void in self.progress.alpha = 0 self.preview.alpha = 0 }) // Bind file fileBind(message, autoDownload: bindedLayout.autoDownload) } // Update time timeLabel.text = cellLayout.date // Update status if (isOut) { statusView.hidden = false switch(UInt(message.messageState.ordinal())) { case ACMessageState.PENDING.rawValue: self.statusView.image = Resources.iconClock; self.statusView.tintColor = MainAppTheme.bubbles.statusMediaSending break; case ACMessageState.SENT.rawValue: self.statusView.image = Resources.iconCheck1; self.statusView.tintColor = MainAppTheme.bubbles.statusMediaSent break; case ACMessageState.RECEIVED.rawValue: self.statusView.image = Resources.iconCheck2; self.statusView.tintColor = MainAppTheme.bubbles.statusMediaReceived break; case ACMessageState.READ.rawValue: self.statusView.image = Resources.iconCheck2; self.statusView.tintColor = MainAppTheme.bubbles.statusMediaRead break; case ACMessageState.ERROR.rawValue: self.statusView.image = Resources.iconError; self.statusView.tintColor = MainAppTheme.bubbles.statusMediaError break default: self.statusView.image = Resources.iconClock; self.statusView.tintColor = MainAppTheme.bubbles.statusMediaSending break; } } else { statusView.hidden = true } } // File state binding override func fileUploadPaused(reference: String, selfGeneration: Int) { bgLoadReference(reference, selfGeneration: selfGeneration) runOnUiThread(selfGeneration) { () -> () in self.progress.showView() self.progress.setButtonType(FlatButtonType.buttonUpBasicType, animated: true) self.progress.hideProgress() } } override func fileUploading(reference: String, progress: Double, selfGeneration: Int) { bgLoadReference(reference, selfGeneration: selfGeneration) runOnUiThread(selfGeneration) { () -> () in self.progress.showView() self.progress.setButtonType(FlatButtonType.buttonPausedType, animated: true) self.progress.setProgress(progress) } } override func fileDownloadPaused(selfGeneration: Int) { bgLoadThumb(selfGeneration) runOnUiThread(selfGeneration) { () -> () in self.progress.showView() self.progress.setButtonType(FlatButtonType.buttonDownloadType, animated: true) self.progress.hideProgress() } } override func fileDownloading(progress: Double, selfGeneration: Int) { bgLoadThumb(selfGeneration) runOnUiThread(selfGeneration) { () -> () in self.progress.showView() self.progress.setButtonType(FlatButtonType.buttonPausedType, animated: true) self.progress.setProgress(progress) } } override func fileReady(reference: String, selfGeneration: Int) { bgLoadReference(reference, selfGeneration: selfGeneration) runOnUiThread(selfGeneration) { () -> () in self.progress.setProgress(1) self.progress.hideView() } } func bgLoadThumb(selfGeneration: Int) { if (thumbLoaded) { return } thumbLoaded = true if (bindedLayout.fastThumb != nil) { let loadedThumb = UIImage(data: bindedLayout.fastThumb!)? .roundCorners(bindedLayout.screenSize.width, h: bindedLayout.screenSize.height, roundSize: 14) runOnUiThread(selfGeneration,closure: { ()->() in self.setPreviewImage(loadedThumb!, fast: true) }); } } func bgLoadReference(reference: String, selfGeneration: Int) { if (contentLoaded) { return } contentLoaded = true let loadedContent = UIImage(contentsOfFile: CocoaFiles.pathFromDescriptor(reference))?.roundCorners(self.bindedLayout.screenSize.width, h: self.bindedLayout.screenSize.height, roundSize: 14) if (loadedContent == nil) { return } runOnUiThread(selfGeneration, closure: { () -> () in self.setPreviewImage(loadedContent!, fast: false) }) } func setPreviewImage(img: UIImage, fast: Bool){ if ((fast && self.preview.image == nil) || !fast) { self.preview.image = img; self.preview.showView() } } // Media Action func mediaDidTap() { let content = bindedMessage!.content as! ACDocumentContent if let fileSource = content.getSource() as? ACFileRemoteSource { Actor.requestStateWithFileId(fileSource.getFileReference().getFileId(), withCallback: CocoaDownloadCallback( notDownloaded: { () -> () in Actor.startDownloadingWithReference(fileSource.getFileReference()) }, onDownloading: { (progress) -> () in Actor.cancelDownloadingWithFileId(fileSource.getFileReference().getFileId()) }, onDownloaded: { (reference) -> () in let photoInfo = AAPhoto(image: UIImage(contentsOfFile: CocoaFiles.pathFromDescriptor(reference))!) let controller = NYTPhotosViewController(photos: [photoInfo]) controller.delegate = self (UIApplication.sharedApplication().delegate as! AppDelegate).hideBadge() UIApplication.sharedApplication().setStatusBarHidden(true, withAnimation: UIStatusBarAnimation.Fade) self.controller.presentViewController(controller, animated: true, completion: nil) })) } else if let fileSource = content.getSource() as? ACFileLocalSource { let rid = bindedMessage!.rid Actor.requestUploadStateWithRid(rid, withCallback: CocoaUploadCallback( notUploaded: { () -> () in Actor.resumeUploadWithRid(rid) }, onUploading: { (progress) -> () in Actor.pauseUploadWithRid(rid) }, onUploadedClosure: { () -> () in let photoInfo = AAPhoto(image: UIImage(contentsOfFile: CocoaFiles.pathFromDescriptor(fileSource.getFileDescriptor()))!) let controller = NYTPhotosViewController(photos: [photoInfo]) controller.delegate = self (UIApplication.sharedApplication().delegate as! AppDelegate).hideBadge() UIApplication.sharedApplication().setStatusBarHidden(true, withAnimation: UIStatusBarAnimation.Fade) self.controller.presentViewController(controller, animated: true, completion: nil) })) } } // Layouting override func layoutContent(maxWidth: CGFloat, offsetX: CGFloat) { let insets = fullContentInsets let contentWidth = self.contentView.frame.width let contentHeight = self.contentView.frame.height let bubbleWidth = self.bindedLayout.screenSize.width let bubbleHeight = self.bindedLayout.screenSize.height layoutBubble(bubbleWidth, contentHeight: bubbleHeight) if (isOut) { preview.frame = CGRectMake(contentWidth - insets.left - bubbleWidth, insets.top, bubbleWidth, bubbleHeight) } else { preview.frame = CGRectMake(insets.left, insets.top, bubbleWidth, bubbleHeight) } progress.frame = CGRectMake(preview.frame.origin.x + preview.frame.width/2 - 32, preview.frame.origin.y + preview.frame.height/2 - 32, 64, 64) timeLabel.frame = CGRectMake(0, 0, 1000, 1000) timeLabel.sizeToFit() let timeWidth = (isOut ? 23 : 0) + timeLabel.bounds.width let timeHeight: CGFloat = 20 timeLabel.frame = CGRectMake(preview.frame.maxX - timeWidth - 18, preview.frame.maxY - timeHeight - 6, timeLabel.frame.width, timeHeight) if (isOut) { statusView.frame = CGRectMake(timeLabel.frame.maxX, timeLabel.frame.minY, 23, timeHeight) } timeBg.frame = CGRectMake(timeLabel.frame.minX - 3, timeLabel.frame.minY - 1, timeWidth + 6, timeHeight + 2) } // Photo preview func photosViewController(photosViewController: NYTPhotosViewController!, referenceViewForPhoto photo: NYTPhoto!) -> UIView! { return self.preview } func photosViewControllerWillDismiss(photosViewController: NYTPhotosViewController!) { (UIApplication.sharedApplication().delegate as! AppDelegate).showBadge() UIApplication.sharedApplication().setStatusBarHidden(false, withAnimation: UIStatusBarAnimation.Fade) } } /** Media cell layout */ class MediaCellLayout: CellLayout { let fastThumb: NSData? let contentSize: CGSize let screenSize: CGSize let autoDownload: Bool /** Creting layout for media bubble */ init(id: Int64, width: CGFloat, height:CGFloat, date: Int64, fastThumb: ACFastThumb?, autoDownload: Bool) { // Saving content size self.contentSize = CGSizeMake(width, height) // Saving autodownload flag self.autoDownload = autoDownload // Calculating bubble screen size let scaleW = 240 / width let scaleH = 340 / height let scale = min(scaleW, scaleH) self.screenSize = CGSize(width: scale * width, height: scale * height) // Prepare fast thumb self.fastThumb = fastThumb?.getImage().toNSData() // Creating layout super.init(height: self.screenSize.height + 2, date: date, key: "media") } /** Creating layout for photo content */ convenience init(id: Int64, photoContent: ACPhotoContent, date: Int64) { self.init(id: id, width: CGFloat(photoContent.getW()), height: CGFloat(photoContent.getH()), date: date, fastThumb: photoContent.getFastThumb(), autoDownload: true) } /** Creating layout for video content */ convenience init(id: Int64, videoContent: ACVideoContent, date: Int64) { self.init(id: id, width: CGFloat(videoContent.getW()), height: CGFloat(videoContent.getH()), date: date, fastThumb: videoContent.getFastThumb(),autoDownload: false) } /** Creating layout for message */ convenience init(message: ACMessage) { if let content = message.content as? ACPhotoContent { self.init(id: Int64(message.rid), photoContent: content, date: Int64(message.date)) } else if let content = message.content as? ACVideoContent { self.init(id: Int64(message.rid), videoContent: content, date: Int64(message.date)) } else { fatalError("Unsupported content for media cell") } } } /** Layouter for media bubbles */ class AABubbleMediaCellLayouter: AABubbleLayouter { func isSuitable(message: ACMessage) -> Bool { if message.content is ACPhotoContent { return true } else if message.content is ACVideoContent { return true } return false } func buildLayout(peer: ACPeer, message: ACMessage) -> CellLayout { return MediaCellLayout(message: message) } func cellClass() -> AnyClass { return AABubbleMediaCell.self } }
mit
2ee688aa7b12cba82a04bc411e38a7de
36.981818
198
0.609151
5.00582
false
false
false
false
fragginAJ/projectEuler
projectEuler1.playground/Contents.swift
1
2050
//: Playground - noun: a place where people can play import UIKit /* The basic idea here is to increment by 3 and 5 but be mindful of cases where multiples of 3 and 5 are shared, such as 15 or 30. */ // // Brute Force // func bruteForceCalculateSumOfThreeAndFiveMultiples() { let upperLimit = 1000 var sum = 0 var counter = 1 repeat { //check for both every time because multiples of 3 and 5 are sometimes the same //ex. 15, 30, 90, etc. if (((counter % 3) == 0) || ((counter % 5) == 0)) { sum += counter } counter++ } while counter < upperLimit print("Sum: ", sum) } bruteForceCalculateSumOfThreeAndFiveMultiples() // // Brute Force with Versatility // func bruteForceCalculateSumOfMultiples(multiples : [Int]) { let upperLimit = 1000 var sum = 0 var counter = 1 repeat { for i in multiples { //Gotchya! if (counter % i == 0) { sum += counter break } } counter++ } while counter < upperLimit print("Sum: ", sum) } bruteForceCalculateSumOfMultiples([3, 5, 7, 11]) // // Optimized // http://www.mathblog.dk/project-euler-problem-1/ // The sequences for any number divisible by n can be written as n*N*(N+1)/2. // func optimallyCalculateSumOfThreeAndFiveMultiples() { //exclude the absolute upperLimit value by subtracting 1 because we want the 'sum of all the multiples below 1000' let upperLimit = 1000 // (sum of multiples of 3) + (sum of multiples of 5) - (sum of multiples of 15) let sum = sumOfMultiple(3, upperLimit: (upperLimit-1)) + sumOfMultiple(5, upperLimit: (upperLimit-1)) - sumOfMultiple(15, upperLimit: (upperLimit-1)) print("Sum: ", sum) } func sumOfMultiple(multiple: Int, upperLimit : Int) -> Int { // n*N*(N+1)/2 // n = multiple = sequential difference // N = upperLimit/multiple = index in sequence return multiple*(upperLimit/multiple)*((upperLimit/multiple)+1)/2 } optimallyCalculateSumOfThreeAndFiveMultiples() // // Homework! // Figure out how to make the above method more versatile; a.k.a allow an array of multiples to be // passed in //
mit
2998a485c4a868b0d49725725830b5ca
21.043011
150
0.686829
3.213166
false
false
false
false