Skip to navigation Skip to content
Simon Technology Blog
  • Architecture
  • Cloud
  • Database
  • Develop
  • Hardware
  • Industry
  • Language
  • Mobile
  • Opensource
  • OS
  • Web
Main Navigation

Tag: SWIFT

SWIFT – NSFONTATTRIBUTEDSTRING Work before Xcode 6.1

let timeFont = [NSFontAttributeName:UIFont(name: “Voyage”, size: 20.0)]
var attrString3 = NSAttributedString(“(Time)”, attributes: timeFont); // <--- compiler error "Extra argument in call" This co

October 10, 2021By Simo Swift 6.1, Before, NSFONTATTRIBUTEDSTRING, SWIFT, XcodeLeave a Comment

Swift error: ‘Sequence’ Requirements Type ‘T’ and ‘ArraysLice’ is equivalent

I am trying to update the math library to be compatible with Swift 3, but I encountered an error:

‘Sequence’ requires types’T’ and’ ArraySlice’ is equivalent to

The Apple documentation

October 10, 2021By Simo Swift Arrayslice, error, Isometric, requirements, Sequence, SWIFT, TypesLeave a Comment

How to get the current time of SWIFT?

I want to get the current time, so far I have completed this:

let date = NSDate()
let calender = NSCalendar.currentCalendar()
let components = calender.component([.Hour, .Minute], fromDate

October 10, 2021By Simo Swift Current, how to get, SWIFT, timeLeave a Comment

SWIFT: How to set anyobject to nil or equivalent

I have a very general function that needs to return AnyObject:

func backgroundFunction(dm: DataManager) -> AnyObject {
…
} But in some cases I want to return an empty/null value

I th

October 10, 2021By Simo Swift AnyObject, equivalent, How, NIL, setting, SWIFTLeave a Comment

Swift 4 JSONSerialization.jsonObject

I am using Xcode 9.2 and Swift 4. How to check whether the returned json data is empty?
Now it gives me error if json [0] [“data”] type’Any’ has no subscript member in the line

var json: NSM

October 10, 2021By Simo Swift jsonobject, jsonserialization, jsonserialization.jsonobject, SWIFTLeave a Comment

SWIFT – Using the Alamofire and ObjectMapper, the integer value is always zero

I am using Alamofire and ObjectMapper, my model class is like this

class Category: Object, Mappable {
dynamic var id: Int = 0
dynamic var name = “”
dynamic var thumbnail = “”
var children = L

October 10, 2021By Simo Swift Alamofire, Always, Objectmapper, SWIFT, use, value, wholeLeave a Comment

How do I decode the JWT (JSON Web token) token in SWIFT?

eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiYWRtaW4iOnRydWV9.TJVA95OrM7E2cBab30RMHrHDcEfxjoYZgeFONFh7HgQ How do I decode this so that I can get the payload like this

{ “sub”: “1234567890”, “name”: “John Doe ”, “admin”: true }

October 10, 2021By Simo Swift Decoding, How to, JSON, JWT, Label, letter, Medium, SWIFT, WEBLeave a Comment

How to add a map view of Google Maps for iOS in SWIFT

I tried to add a marker on Google Maps, but the application crashed when the addMarker() function was called. The exception details are as follows,

The catched exception’GMSThreadException’ t

October 10, 2021By Simo Swift Add, Google, How to, IOS, Map, SDK, SWIFT, Tag, viewLeave a Comment

SWIFT: OPTIONAL’s useless default?

I am creating a function like this:

func foo(bar: UInt? = 0) { let doSomething = someOtherFunc(bar!)
) If I pass a zero value to foo(), I want to use the default value 0 when opening it, not

October 10, 2021By Simo Swift default, Optional, SWIFT, uselessLeave a Comment

SWIFT3 – Error via the Cocoapods installation field

I encountered this strange error when installing realm on xcode 8, cocoa pods version cocoapods-1.2.0

The error is –

Installing Realm (2.4.3)

[!] /bin/bash -c
set -e
sh build.sh

October 10, 2021By Simo Swift cocoapods, error, Field, installation, pass, SWIFT, Swift3, timeLeave a Comment

Posts navigation

Page 1 Page 2 Page 3 … Page 8
Recent Posts
  • Sencha-Touch-2 – Sencha Touch 2, Nested XML Analysis NodeValue
  • Add a separation line and format XML content
  • Is there a norm of simplified XML subsets?
  • Look at it when you write React
  • ReactJS – Present React Redux React-Router App to add the server to the Firebase hosted by the Firebase
Categories
  • Android
  • Apache
  • Apache Kafka
  • Asp
  • Auto-Test
  • Automated Build
  • Aws
  • Bitcoin
  • Browser
  • C & C++
  • C#
  • Centos
  • Cgi
  • Character
  • Cloud Service
  • Cocos2dx
  • Cordova
  • CSS
  • Data Structure
  • Delphi
  • Design Pattern
  • Dojo
  • Dubbo
  • ELK
  • Flex
  • football
  • Game
  • Hadoop
  • Hibernate
  • HTML
  • Hybrid
  • Intel
  • IOS
  • Ipad
  • iPhone
  • Java
  • Javascript
  • Jetty
  • JQuery
  • Jsp
  • Linux
  • Load Balance
  • Lua
  • Macbook
  • Macos
  • Mathematics
  • Micro Services
  • Monitoring
  • Motherboard
  • Mysql
  • Network Hardware
  • Network Marketing
  • Nginx
  • NodeJs
  • Nosql
  • Oracle
  • Os Theory
  • Performance
  • PHP
  • Postgresql
  • Power Designer
  • React
  • Redis
  • Regexp
  • Rom
  • Rss
  • Ruby
  • Search Engines
  • Shell Script
  • Silicon Valley
  • Silverlight
  • Software Design
  • Spring
  • Sql
  • Sqlite
  • Sqlserver
  • Storage
  • Storm
  • Surface
  • SVN
  • Swift
  • System Architecture
  • Tablet
  • Uncategorized
  • Unix
  • Visual Basic
  • Visual Studio
  • Web Crawler
  • WebService
  • Windows
  • Wireless
  • XML
  • ZooKeeper
Archives
  • October 2021
  • September 2021
  • August 2021
  • May 2021
  • April 2021
  • September 2020
  • September 2019
  • August 2019
  • June 2019
  • May 2019
  • April 2019
  • March 2019
© Simon Technology Blog 2025 • ThemeCountry Powered by WordPress