Created
July 12, 2016 05:50
-
-
Save RyogaK/91cbe7f55a66b6a9d8c204859f6b73e5 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Entity {} | |
struct Token { | |
let entity = Entity() | |
} | |
func asyncProcess() -> Token { | |
let token = Token() | |
weak var entity = token.entity | |
dispatch_async(dispatch_get_main_queue) { | |
// 重くてキャンセルできない処理 | |
if entity != nil { | |
// 反映処理 | |
} | |
} | |
return token | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment