The data is being fetched asynchronously and the print statement is getting executed before the response is received. print the data after you assign value to self.jumlahStok
More Related Contents:
- Add objective c code to swift file [closed]
- Type ‘Any’ Has no Subscript Members in Xcode 8.1 Swift 3
- Objective-C and Swift URL encoding
- Wait for Firebase to load before returning from a function
- Date Format in Swift
- How to Resize image in Swift?
- Getting list of files in documents folder
- Base64 Decoding in iOS 7+
- How can I change locale programmatically with Swift
- Get System Volume iOS
- Replacement for C-style loop in Swift 2.2
- UISearchBar increases navigation bar height in iOS 11
- Static Library and Swift
- How do I save a UIColor with UserDefaults? [duplicate]
- iOS linkedin authentication
- How do I create a new Swift project without using Storyboards?
- Linker Error in iOS (duplicate symbols for architecture x86_64)
- Remove objects with duplicate properties from Swift array
- “Creating an image format with an unknown type is an error” with UIImagePickerController
- UITableViewCell Buttons with action
- Swift UIColor initializer – compiler error only when targeting iPhone5s
- How can I programmatically find Swift’s version?
- How I can implement Login / Logout Navigation using UserDefaults in swift?
- Blocks on Swift (animateWithDuration:animations:completion:)
- iOS – ‘MyProject-Swift.h’ file not found when running Unit Tests for Swift
- Facebook Graph API GET request – Should contain “fields” parameter (Swift, Facebook SDK v4.5.1)
- How To Get HTML source from URL with Swift
- Pass multiple parameters to addTarget
- Can we add text, shape and signature in Photo Markup with Pencil Kit?
- Working with Live Photos in Playground