(ns sample.core (:require [uikit.core :as uikit])) (def white (-> ($ UIColor) ($ :whiteColor))) (declare abc) (defn on-tap [scope] ;(uikit/alert! "Clojure" "Oh hai!") (uikit/alert! "Clojure" (abc)) ) (def my-screen [:UIView :main {:setBackgroundColor white :constraints ["C:button.centerx=main.centerx" "C:button.centery=main.centery"]} [(uikit/button 1) :button {:setTitle:forState ["Tap me!" 0] :gestures {:UITapGestureRecognizer #'on-tap}}]]) (defn main [] (let [window (-> ($ UIWindow) ($ :alloc) ($ :initWithFrame (-> ($ UIScreen) ($ :mainScreen) ($ :bounds)))) nav (-> ($ UINavigationController) ($ :new))] (doto window ($ :makeKeyAndVisible) ($ :setRootViewController nav) ($ :setBackgroundColor white)) (reset! uikit/current-top-controller nav) ($ nav :setNavigationBarHidden true) (uikit/nav-push (uikit/controller "Screen title" my-screen)))) (defn abc [] (let [;url (-> ($ NSString) ; ($ :stringWithFormat ["http://localhost:3000/consume/@%/@%/@%" "abc" 0 1])) ;url ($ ($ NSCommon) :invokeSuperSel ($ NSString) :withDispatchClass nil :withSelector "stringWithFormat:" :withArgs ["http://localhost:3000/consume/@%/@%/@%" "abc" 0 1]) url (-> ($ NSURL) ($ :URLWithString "http://localhost:3000/consume/bc/0/1")) error (-> ($ NSError) ($ :alloc) ($ :init)) request (-> ($ NSMutableURLRequest) ($ :requestWithURL url)) ;response-data (-> ($ NSConnectionURL) ; ($ :sendSynchronousRequest request :returningResponse nil :error error)) ;result (-> ($ NSString) ; ($ :alloc) ; ($ :initWithResponseData response-data :encoding ($ NSUTF8StringEncoding))) ] ;result "YO ABC" ))