From e1725019cf7a94c47853e5a60be12481d03e55da Mon Sep 17 00:00:00 2001 From: Ceyhun Ozugur Date: Sat, 14 Jan 2017 14:41:05 +0300 Subject: [PATCH 1/2] Dispatched `Presenter.init(config:view:delegate:)` call in `SwiftMessages` class to the main queue `Presenter.init(config:view:delegate:)` initializes a `PassthroughView` instance variable called `maskingView` which is a `UIView` and this triggers a `setNeedsDisplay` call that should be made in the main thread. --- SwiftMessages/SwiftMessages.swift | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/SwiftMessages/SwiftMessages.swift b/SwiftMessages/SwiftMessages.swift index 7f13e01e..d4b4ae58 100644 --- a/SwiftMessages/SwiftMessages.swift +++ b/SwiftMessages/SwiftMessages.swift @@ -244,10 +244,13 @@ open class SwiftMessages: PresenterDelegate { - Parameter view: The view to be displayed. */ open func show(config: Config, view: UIView) { - syncQueue.async { [weak self] in + DispatchQueue.main.async { [weak self] in guard let strongSelf = self else { return } let presenter = Presenter(config: config, view: view, delegate: strongSelf) - strongSelf.enqueue(presenter: presenter) + strongSelf.syncQueue.async { [weak self] in + guard let strongSelf = self else { return } + strongSelf.enqueue(presenter: presenter) + } } } From 0153648d4fa8190f3d86c11506b42c38eda35ad7 Mon Sep 17 00:00:00 2001 From: Timothy Moose Date: Sun, 15 Jan 2017 11:40:27 -0600 Subject: [PATCH 2/2] Release prep --- CHANGELOG.md | 6 ++++++ SwiftMessages.podspec | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 51bea17d..4960d1fa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,12 @@ # Change Log All notable changes to this project will be documented in this file. +## [3.1.4](https://github.com/SwiftKickMobile/SwiftMessages/releases/tag/3.1.4) + +### Bug Fixes + +* Fixed an issue where UIKit components were being instantiated off the main queue. + ## [3.1.3](https://github.com/SwiftKickMobile/SwiftMessages/releases/tag/3.1.3) ### Features diff --git a/SwiftMessages.podspec b/SwiftMessages.podspec index a840a0b9..9521def6 100644 --- a/SwiftMessages.podspec +++ b/SwiftMessages.podspec @@ -1,11 +1,11 @@ Pod::Spec.new do |spec| spec.name = 'SwiftMessages' - spec.version = '3.1.3' + spec.version = '3.1.4' spec.license = { :type => 'MIT' } spec.homepage = 'https://github.com/SwiftKickMobile/SwiftMessages' spec.authors = { 'Timothy Moose' => 'tim@swiftkick.it' } spec.summary = 'A very flexible message bar for iOS written in Swift.' - spec.source = {:git => 'https://github.com/SwiftKickMobile/SwiftMessages.git', :tag => '3.1.3'} + spec.source = {:git => 'https://github.com/SwiftKickMobile/SwiftMessages.git', :tag => '3.1.4'} spec.platform = :ios, '8.0' spec.ios.deployment_target = '8.0' spec.source_files = 'SwiftMessages/**/*.swift'